Code Monkey home page Code Monkey logo

confluence.js's People

Contributors

andymac4182 avatar elbalexandre avatar emulienfou avatar ggarcia24 avatar joeennever avatar mrrefactoring avatar theplenkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

confluence.js's Issues

Convert Dash-Cased Parameters to CamelCase in `getLabelPages`

In the getLabelPages function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getLabelPages<T = Models.Pagination<Models.Page>>(
  parameters: Parameters.GetLabelPages,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/labels/${parameters.id}/pages`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getLabelPages<T = Models.Pagination<Models.Page>>(
  parameters: Parameters.GetLabelPages,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/labels/${parameters.id}/pages`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getInlineCommentChildren`

In the getInlineCommentChildren function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getInlineCommentChildren<T = Models.Pagination<Models.InlineCommentChildren>>(
  parameters: Parameters.GetInlineCommentChildren,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/inline-comments/${parameters.id}/children`,
    method: 'GET',
    params: {
      'serialize-ids-as-strings': true,
      'body-format': parameters['body-format'],
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getInlineCommentChildren<T = Models.Pagination<Models.InlineCommentChildren>>(
  parameters: Parameters.GetInlineCommentChildren,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/inline-comments/${parameters.id}/children`,
    method: 'GET',
    params: {
      'serialize-ids-as-strings': true,
      'body-format': parameters.bodyFormat,
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
    },
  };

  return this.client.sendRequest(config, callback);
}

Enhancement: add `data` property to `blogPost.createBlogPost`

This issue tracks the need to enhance the blogPost.createBlogPost method by including a data property. The data property should have the following structure:

data: {
  spaceId: parameters.spaceId, // Required field of type string
  status: parameters.status, // Type: string
  title: parameters.title, // Type: string
  body: parameters.body, // Type: One of [BlogPostBodyWrite, BlogPostNestedBodyWrite]
}

PR should include also typings for spaceId, status, title, body

Reference:

For more context and detailed information, please refer to the Confluence REST API documentation.

Convert Dash-Cased Parameters to CamelCase in `getPageById`

In the getPageById function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getPageById<T = Models.Page>(parameters: Parameters.GetPageById, callback?: Callback<T>): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      'get-draft': parameters['get-draft'],
      version: parameters.version,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getPageById<T = Models.Page>(parameters: Parameters.GetPageById, callback?: Callback<T>): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      'get-draft': parameters.getDraft,
      version: parameters.version,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Attachments download

I tried to use the downloadAttachement feature, but the encoding seems incorrect:

image

�PNG... --> should begin with <89>PNG...

Any ideas?

Enhancement: add `data` property to `blogPost.updateBlogPost`

This issue tracks the need to enhance the blogPost.updateBlogPost method by including a data property. The data property should have the following structure:

data: {
  id: parameters.updateId, // Required field of type string
  status: parameters.status, // Required field of type: string
  title: parameters.title, // Required field of type: string
  body: parameters.body, // Required field of type: One of [BlogPostBodyWrite, BlogPostNestedBodyWrite]
  version: parameters.version, // Required field of type Version
}

PR should include also typings for updateId, status, title, body, version

Reference:

For more context and detailed information, please refer to the Confluence REST API documentation.

Support expand query

Hi there

Thanks for this tidy Confluence API library!

I've noticed that expand is supported by query parameters but is not actually passed through to the request query.

Example

const contents = await client.contentAttachments.getAttachments({
  id: "123123",
  filename: "test.png",
  expand: ["metadata.properties"]
});

Results in this request

GET https://somewhere.atlassian.net/wiki/rest/api/content/1595999911/child/attachment?filename=test.png

I was expecting

GET https://somewhere.atlassian.net/wiki/rest/api/content/1595999911/child/attachment?filename=test.png&expand=metadata.properties

Cheers!

Convert Dash-Cased Parameters to CamelCase in `getTaskById`

In the getTaskById function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getTaskById<T = Models.Task>(parameters: Parameters.GetTaskById, callback?: Callback<T>): Promise<void | T> {
  const config: RequestConfig = {
    url: `/tasks/${parameters.id}`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getTaskById<T = Models.Task>(parameters: Parameters.GetTaskById, callback?: Callback<T>): Promise<void | T> {
  const config: RequestConfig = {
    url: `/tasks/${parameters.id}`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Cannot get spaces, spaceKey values issue

Hi there, trying to get multiple spaces from Confluence however it seems there is an issue.

Here is the code that I use to get my spaces:

await client.space.getSpaces({ spaceKey: ['KEY1', 'KEY2'] })

The documentation said:

Returns information about a number of spaces.
Example request URI(s):
http://example.com/rest/api/space?spaceKey=TST&spaceKey=ds

However the generated URL is: https://example.atlassian.net/wiki/rest/api/space?spaceKey=KEY1,KEY2
Instead of: https://example.atlassian.net/wiki/rest/api/space?spaceKey=KEY1&spaceKey=KEY2

Convert Dash-Cased Parameters to CamelCase in `getCustomContentByTypeInBlogPost`

In the getCustomContentByTypeInBlogPost function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getCustomContentByTypeInBlogPost<T = Models.Pagination<Models.CustomContent>>(
  parameters: Parameters.GetCustomContentByTypeInBlogPost,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/blogposts/${parameters.id}/custom-content`,
    method: 'GET',
    params: {
      type: parameters.type,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'body-format': parameters['body-format'],
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getCustomContentByTypeInBlogPost<T = Models.Pagination<Models.CustomContent>>(
  parameters: Parameters.GetCustomContentByTypeInBlogPost,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/blogposts/${parameters.id}/custom-content`,
    method: 'GET',
    params: {
      type: parameters.type,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'body-format': parameters.bodyFormat,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getCustomContentById`

In the getCustomContentById function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getCustomContentById<T = Models.CustomContent>(
  parameters: Parameters.GetCustomContentById,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/custom-content/${parameters.id}`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      version: parameters.version,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getCustomContentById<T = Models.CustomContent>(
  parameters: Parameters.GetCustomContentById,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/custom-content/${parameters.id}`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      version: parameters.version,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getCustomContentVersions`

In the getCustomContentVersions function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getCustomContentVersions<T = Models.Pagination<Models.CustomContentVersion>>(
  parameters: Parameters.GetCustomContentVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/custom-content/${parameters.customContentId}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getCustomContentVersions<T = Models.Pagination<Models.CustomContentVersion>>(
  parameters: Parameters.GetCustomContentVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/custom-content/${parameters.customContentId}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Set `serializeIdsAsStrings` to true for all of endpoint use this.

What we have

A lot of endpoints added serializeIdsAsStrings property. Example

What should be done

  1. For all endpoints serializeIdsAsStrings setted to true by default
  2. serializeIdsAsStrings removed from all Models and Parameters

Example what I want to see

Was

    const config: RequestConfig = {
      url: `/attachments/${parameters.id}`,
      method: 'GET',
      params: {
        version: parameters.version,
        'serialize-ids-as-strings': parameters.serializeIdsAsStrings,
      },
    };

Now

    const config: RequestConfig = {
      url: `/attachments/${parameters.id}`,
      method: 'GET',
      params: {
        version: parameters.version,
        'serialize-ids-as-strings': true,
      },
    };

Convert Dash-Cased Parameters to CamelCase in `getSpaceById`

In the getSpaceById function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getSpaceById<T = Models.Space>(parameters: Parameters.GetSpaceById, callback?: Callback<T>): Promise<void | T> {
  const config: RequestConfig = {
    url: `/spaces/${parameters.id}`,
    method: 'GET',
    params: {
      'description-format': parameters['description-format'],
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getSpaceById<T = Models.Space>(parameters: Parameters.GetSpaceById, callback?: Callback<T>): Promise<void | T> {
  const config: RequestConfig = {
    url: `/spaces/${parameters.id}`,
    method: 'GET',
    params: {
      'description-format': parameters.descriptionFormat,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getInlineCommentById`

In the getInlineCommentById function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getInlineCommentById<T = Models.InlineCommentModel>(
  parameters: Parameters.GetInlineCommentById,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/inline-comments/${parameters.commentId}`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      version: parameters.version,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getInlineCommentById<T = Models.InlineCommentModel>(
  parameters: Parameters.GetInlineCommentById,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/inline-comments/${parameters.commentId}`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      version: parameters.version,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getBlogPostById`

In the getBlogPostById function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getBlogPostById<T = Models.BlogPost>(
    parameters: Parameters.GetBlogPostById,
    callback?: Callback<T>,
): Promise<void | T> {
    const config: RequestConfig = {
      url: `/blogposts/${parameters.id}`,
      method: 'GET',
      params: {
        'body-format': parameters['body-format'],
        'get-draft': parameters['get-draft'],
        version: parameters.version,
        'serialize-ids-as-strings': true,
      },
    };

    return this.client.sendRequest(config, callback);
} 

Expected function look:

async getBlogPostById<T = Models.BlogPost>(
    parameters: Parameters.GetBlogPostById,
    callback?: Callback<T>,
): Promise<void | T> {
    const config: RequestConfig = {
      url: `/blogposts/${parameters.id}`,
      method: 'GET',
      params: {
        'body-format': parameters.bodyFormat,
        'get-draft': parameters.getDraft,
        version: parameters.version,
        'serialize-ids-as-strings': true,
      },
    };

    return this.client.sendRequest(config, callback);
} 

[ServerClient] Creating and Updating attachments returns 415

Hello!

First of all thanks for this awesome lib! kudos to you 🥳

I think this is related to #23 , according to the [server documentation][https://docs.atlassian.com/ConfluenceServer/rest/7.18.3/#content/{id}/child/attachment-updateData] in order to update an attachment data the content-type header of the request needs to be multipart/form-data but it's currently being set to application/json

Please let me know if you need code examples and files, I can provide those, I'm reading a bit the code, trying to understand things, I will also try to submit a fix for this later🤞

Best regards
Gonzalo G

Convert Dash-Cased Parameters to CamelCase in `getBlogPostVersions`

In the getBlogPostVersions function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getBlogPostVersions<T = Models.Pagination<Models.BlogPostVersion>>(
  parameters: Parameters.GetBlogPostVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/blogposts/${parameters.id}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getBlogPostVersions<T = Models.Pagination<Models.BlogPostVersion>>(
  parameters: Parameters.GetBlogPostVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/blogposts/${parameters.id}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getPageFooterComments`

In the getPageFooterComments function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getPageFooterComments<T = Models.Pagination<Models.PageComment>>(
  parameters: Parameters.GetPageFooterComments,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}/footer-comments`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getPageFooterComments<T = Models.Pagination<Models.PageComment>>(
  parameters: Parameters.GetPageFooterComments,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}/footer-comments`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Cannot get body from `getContentById`

Trying to get the content body of a page when requesting it by ID:
await client.content.getContentById({ id: '1234', expand: 'body.view' })

However, the body field is not returned

  1. When I do the call https://example.atlassian.net/wiki/rest/api/content/1234?expand=body.view, body field is present.
  2. Interface Server/Parameters.GetContentById describe field expand?: string
  3. But Api/Parameters.GetContentById describe field expand?: string[]
  4. Signature seems to be more await client.content.getContentById({ id: '1234', expand: ['body'] }) } otherwise IDE with trigger a warning

Tried with string and string[] for expand parameter and with body and body.view but field body is still undefined.

Convert Dash-Cased Parameters to CamelCase in `getCustomContentByTypeInPage`

In the getCustomContentByTypeInPage function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getCustomContentByTypeInPage<T = Models.Pagination<Models.CustomContent>>(
  parameters: Parameters.GetCustomContentByTypeInPage,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}/custom-content`,
    method: 'GET',
    params: {
      type: parameters.type,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'body-format': parameters['body-format'],
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getCustomContentByTypeInPage<T = Models.Pagination<Models.CustomContent>>(
  parameters: Parameters.GetCustomContentByTypeInPage,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}/custom-content`,
    method: 'GET',
    params: {
      type: parameters.type,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'body-format': parameters.bodyFormat,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert query parameters to camelCase for `GET /tasks` endpoint

The GET /tasks endpoint in confluence.js library currently supports several query parameters as described in the Confluence OpenAPI documentation. However, these parameters are currently in a dash-case format, which is not consistent with the camelCase convention commonly used in JavaScript.

The task at hand is to convert all of these parameter names to camelCase format. Here are the parameters that need to be renamed:

  1. body-format should be bodyFormat
  2. include-blank-tasks should be includeBlankTasks
  3. task-id should be taskId
  4. space-id should be spaceId
  5. page-id should be pageId
  6. blogpost-id should be blogpostId
  7. created-by should be createdBy
  8. assigned-to should be assignedTo
  9. completed-by should be completedBy
  10. created-at-from should be createdAtFrom
  11. created-at-to should be createdAtTo
  12. due-at-from should be dueAtFrom
  13. due-at-to should be dueAtTo
  14. completed-at-from should be completedAtFrom
  15. completed-at-to should be completedAtTo

By converting these parameter names to camelCase, we will ensure that our library adheres to the common naming conventions of JavaScript, making it more intuitive and easier to use for developers.

Please make sure that this change does not break any existing functionality, and update all relevant function calls and documentations accordingly.

Convert Dash-Cased Parameters to CamelCase in `getPageInlineComments`

In the getPageInlineComments function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getPageInlineComments<T = Models.Pagination<Models.PageInlineComment>>(
  parameters: Parameters.GetPageInlineComments,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}/inline-comments`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getPageInlineComments<T = Models.Pagination<Models.PageInlineComment>>(
  parameters: Parameters.GetPageInlineComments,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}/inline-comments`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getFooterCommentVersions`

In the getFooterCommentVersions function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getFooterCommentVersions<T = Models.Pagination<Models.CommentVersion>>(
  parameters: Parameters.GetFooterCommentVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/footer-comments/${parameters.id}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getFooterCommentVersions<T = Models.Pagination<Models.CommentVersion>>(
  parameters: Parameters.GetFooterCommentVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/footer-comments/${parameters.id}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getSpaces`

In the getSpaces function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getSpaces<T = Models.Pagination<Models.Space>>(
  parameters?: Parameters.GetSpaces,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/spaces',
    method: 'GET',
    params: {
      ids: parameters?.ids,
      keys: parameters?.keys,
      type: parameters?.type,
      status: parameters?.status,
      labels: parameters?.labels,
      sort: parameters?.sort,
      'description-format': parameters?.['description-format'],
      cursor: parameters?.cursor,
      limit: parameters?.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getSpaces<T = Models.Pagination<Models.Space>>(
  parameters?: Parameters.GetSpaces,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/spaces',
    method: 'GET',
    params: {
      ids: parameters?.ids,
      keys: parameters?.keys,
      type: parameters?.type,
      status: parameters?.status,
      labels: parameters?.labels,
      sort: parameters?.sort,
      'description-format': parameters?.descriptionFormat,
      cursor: parameters?.cursor,
      limit: parameters?.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getPagesInSpace`

In the getPagesInSpace function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getPagesInSpace<T = Models.Pagination<Models.Page>>(
  parameters: Parameters.GetPagesInSpace,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/spaces/${parameters.id}/pages`,
    method: 'GET',
    params: {
      status: parameters.status,
      'body-format': parameters['body-format'],
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getPagesInSpace<T = Models.Pagination<Models.Page>>(
  parameters: Parameters.GetPagesInSpace,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/spaces/${parameters.id}/pages`,
    method: 'GET',
    params: {
      status: parameters.status,
      'body-format': parameters.bodyFormat,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getCustomContentByTypeInSpace`

In the getCustomContentByTypeInSpace function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getCustomContentByTypeInSpace<T = Models.Pagination<Models.CustomContent>>(
  parameters: Parameters.GetCustomContentByTypeInSpace,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/spaces/${parameters.id}/custom-content`,
    method: 'GET',
    params: {
      type: parameters.type,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'body-format': parameters['body-format'],
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getCustomContentByTypeInSpace<T = Models.Pagination<Models.CustomContent>>(
  parameters: Parameters.GetCustomContentByTypeInSpace,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/spaces/${parameters.id}/custom-content`,
    method: 'GET',
    params: {
      type: parameters.type,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'body-format': parameters.bodyFormat,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getPageVersions`

In the getPageVersions function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getPageVersions<T = Models.Pagination<Models.PageVersion>>(
  parameters: Parameters.GetPageVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getPageVersions<T = Models.Pagination<Models.PageVersion>>(
  parameters: Parameters.GetPageVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/pages/${parameters.id}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getInlineCommentVersions`

In the getInlineCommentVersions function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getInlineCommentVersions<T = Models.Pagination<Models.CommentVersion>>(
  parameters: Parameters.GetInlineCommentVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/inline-comments/${parameters.id}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getInlineCommentVersions<T = Models.Pagination<Models.CommentVersion>>(
  parameters: Parameters.GetInlineCommentVersions,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/inline-comments/${parameters.id}/versions`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      cursor: parameters.cursor,
      limit: parameters.limit,
      sort: parameters.sort,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getPages`

In the getPages function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getPages<T = Models.Pagination<Models.Page>>(
  parameters?: Parameters.GetPages,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/pages',
    method: 'GET',
    params: {
      id: parameters?.id,
      status: parameters?.status,
      'body-format': parameters?.['body-format'],
      cursor: parameters?.cursor,
      limit: parameters?.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getPages<T = Models.Pagination<Models.Page>>(
  parameters?: Parameters.GetPages,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/pages',
    method: 'GET',
    params: {
      id: parameters?.id,
      status: parameters?.status,
      'body-format': parameters?.bodyFormat,
      cursor: parameters?.cursor,
      limit: parameters?.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getBlogPostInlineComments`

In the getBlogPostInlineComments function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getBlogPostInlineComments<T = Models.Pagination<Models.BlogPostInlineComment>>(
  parameters: Parameters.GetBlogPostInlineComments,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/blogposts/${parameters.id}/inline-comments`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getBlogPostInlineComments<T = Models.Pagination<Models.BlogPostInlineComment>>(
  parameters: Parameters.GetBlogPostInlineComments,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/blogposts/${parameters.id}/inline-comments`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getTasks`

In the getTasks function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getTasks<T = Models.Pagination<Models.Task>>(
  parameters?: Parameters.GetTasks,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/tasks',
    method: 'GET',
    params: {
      'body-format': parameters?.['body-format'],
      'include-blank-tasks': parameters?.['include-blank-tasks'],
      status: parameters?.status,
      'task-id': parameters?.taskId,
      'space-id': parameters?.spaceId,
      'page-id': parameters?.pageId,
      'blogpost-id': parameters?.['blogpost-id'],
      'created-by': parameters?.['created-by'],
      'assigned-to': parameters?.['assigned-to'],
      'completed-by': parameters?.['completed-by'],
      'created-at-from': parameters?.['created-at-from'],
      'created-at-to': parameters?.['created-at-to'],
      'due-at-from': parameters?.['due-at-from'],
      'due-at-to': parameters?.['due-at-to'],
      'completed-at-from': parameters?.['completed-at-from'],
      'completed-at-to': parameters?.['completed-at-to'],
      cursor: parameters?.cursor,
      limit: parameters?.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getTasks<T = Models.Pagination<Models.Task>>(
  parameters?: Parameters.GetTasks,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/tasks',
    method: 'GET',
    params: {
      'body-format': parameters?.bodyFormat,
      'include-blank-tasks': parameters?.includeBlankTasks,
      status: parameters?.status,
      'task-id': parameters?.taskId,
      'space-id': parameters?.spaceId,
      'page-id': parameters?.pageId,
      'blogpost-id': parameters?.blogpostId,
      'created-by': parameters?.createdBy,
      'assigned-to': parameters?.assignedTo,
      'completed-by': parameters?.completedBy,
      'created-at-from': parameters?.createdAtFrom,
      'created-at-to': parameters?.createdAtTo,
      'due-at-from': parameters?.dueAtFrom,
      'due-at-to': parameters?.dueAtTo,
      'completed-at-from': parameters?.completedAtFrom,
      'completed-at-to': parameters?.completedAtTo,
      cursor: parameters?.cursor,
      limit: parameters?.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getCustomContentByType`

In the getCustomContentByType function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getCustomContentByType<T = Models.Pagination<Models.CustomContent>>(
  parameters: Parameters.GetCustomContentByType,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/custom-content',
    method: 'GET',
    params: {
      type: parameters.type,
      id: parameters.id,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'body-format': parameters['body-format'],
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getCustomContentByType<T = Models.Pagination<Models.CustomContent>>(
  parameters: Parameters.GetCustomContentByType,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: '/custom-content',
    method: 'GET',
    params: {
      type: parameters.type,
      id: parameters.id,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'body-format': parameters.bodyFormat,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getBlogPostFooterComments`

In the getBlogPostFooterComments function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getBlogPostFooterComments<T = Models.Pagination<Models.BlogPostComment>>(
  parameters: Parameters.GetBlogPostFooterComments,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/blogposts/${parameters.id}/footer-comments`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getBlogPostFooterComments<T = Models.Pagination<Models.BlogPostComment>>(
  parameters: Parameters.GetBlogPostFooterComments,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/blogposts/${parameters.id}/footer-comments`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Version 2 API Release checklist

Branch we are working

All PR should have a target for this branch.

General

Api

Models

  • Attachment: clarify types for pageId, blogPostId, customContentId. Mark optional parameters as required when it's needed.
  • Body: clarify interface properties and types of these properties.
  • UpdateInlineCommentModel: type of body?
  • UpdateFooterCommentModel: type of body?
  • Task: clarify types for id, localId, spaceId, pageId, blogPostId. Mark optional parameters as required when it's needed.
  • SpaceProperty: clarify type for id.
  • Space: clarify types for id, homepageId.
  • PrimaryBodyRepresentation clarify properties and properties types.
  • PageInlineCommentModel: clarify types for id, pageId. Mark optional parameters as required when it's needed.
  • PageCommentModel: clarify types for id, pageId. Mark optional parameters as required when it's needed.
  • PageBodyWrite: clarify properties.
  • Page: clarify types for id, spaceId, parentId. Mark optional parameters as required when it's needed.
  • Label: clarify types for id, name, prefix is optional?
  • InviteByEmail: clarify types.
  • InlineCommentModel: clarify types for id, blogPostId, pageId, parentCommentId. Mark optional parameters as required when it's needed.
  • InlineCommentChildrenModel: clarify types for id, parentCommentId. Mark optional parameters as required when it's needed.
  • ContentStatus: replate ContentStatus to a list of available statuses.
  • FooterCommentModel: clarify types for id, blogPostId, pageId, parentCommentId. Mark optional parameters as required when it's needed.
  • CustomContentVersion: Mark optional parameters as required when it's needed.
  • CustomContentBodyWrite: check types.
  • CustomContent: clarify types for id, spaceId, pageId, blogPostId, customContentId. Mark optional parameters as required when it's needed.
  • CreateInlineCommentModel: clarify types for body, inlineCommentProperties. Mark optional parameters as required when it's needed.
  • CreateFooterCommentModel: Mark optional parameters as required when it's needed.
  • ContentPropertyUpdateRequest: version property should be clarified.
  • ContentIdToContentTypeResponse: clarify the type.
  • CommentVersion: Mark optional parameters as required when it's needed.
  • CommentBodyWrite: clarify the type.
  • ChildrenCommentModel clarify types fo id, parentCommentId. Mark optional parameters as required when it's needed.
  • ChildPage: clarify types for id, spaceId. Mark optional parameters as required when it's needed.
  • ChildCustomContent: clarify types for id, spaceId. Mark optional parameters as required when it's needed.
  • CheckAccessByEmail: check types.
  • BlogPostVersion: Mark optional parameters as required when it's needed.
  • BlogPostInlineCommentModel: clarify types for id, blogPostId. Mark optional parameters as required when it's needed.
  • BlogPostCommentModel: clarify types for id, blogPostId. Mark optional parameters as required when it's needed.
  • BlogPostBodyWrite: clarify the type.
  • BlogPost: clarify types for id, spaceId. Mark optional parameters as required when it's needed.
  • #45
  • Remove unused models.

Paramerters


Special thanks

I would like to extend my gratitude to the following individuals for their contributions and support:


Convert Dash-Cased Parameters to CamelCase in `getFooterCommentById`

In the getFooterCommentById function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getFooterCommentById<T = Models.FooterCommentModel>(
  parameters: Parameters.GetFooterCommentById,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/footer-comments/${parameters.commentId}`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      version: parameters.version,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getFooterCommentById<T = Models.FooterCommentModel>(
  parameters: Parameters.GetFooterCommentById,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/footer-comments/${parameters.commentId}`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      version: parameters.version,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Convert Dash-Cased Parameters to CamelCase in `getFooterCommentChildren`

In the getFooterCommentChildren function, parameters with a dash (-) are used. The proposal is to replace these dash-cased parameters with camelCase.

The function currently looks like this:

async getFooterCommentChildren<T = Models.Pagination<Models.ChildrenComment>>(
  parameters: Parameters.GetFooterCommentChildren,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/footer-comments/${parameters.id}/children`,
    method: 'GET',
    params: {
      'body-format': parameters['body-format'],
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Expected function look:

async getFooterCommentChildren<T = Models.Pagination<Models.ChildrenComment>>(
  parameters: Parameters.GetFooterCommentChildren,
  callback?: Callback<T>,
): Promise<void | T> {
  const config: RequestConfig = {
    url: `/footer-comments/${parameters.id}/children`,
    method: 'GET',
    params: {
      'body-format': parameters.bodyFormat,
      sort: parameters.sort,
      cursor: parameters.cursor,
      limit: parameters.limit,
      'serialize-ids-as-strings': true,
    },
  };

  return this.client.sendRequest(config, callback);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.