@notionhq/client 5.16.0 → 5.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notionhq/client",
3
- "version": "5.16.0",
3
+ "version": "5.17.0",
4
4
  "description": "A simple and easy to use client for the Notion API",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -31,7 +31,6 @@ export type PartialCommentObjectResponse = {
31
31
  id: IdResponse;
32
32
  };
33
33
  type CreateCommentBodyParameters = {
34
- rich_text: Array<RichTextItemRequest>;
35
34
  attachments?: Array<{
36
35
  file_upload_id: string;
37
36
  type?: "file_upload";
@@ -54,8 +53,22 @@ type CreateCommentBodyParameters = {
54
53
  block_id: IdRequest;
55
54
  type?: "block_id";
56
55
  };
56
+ rich_text: Array<RichTextItemRequest>;
57
+ } | {
58
+ parent: {
59
+ page_id: IdRequest;
60
+ type?: "page_id";
61
+ } | {
62
+ block_id: IdRequest;
63
+ type?: "block_id";
64
+ };
65
+ markdown: string;
66
+ } | {
67
+ discussion_id: IdRequest;
68
+ rich_text: Array<RichTextItemRequest>;
57
69
  } | {
58
70
  discussion_id: IdRequest;
71
+ markdown: string;
59
72
  });
60
73
  export type CreateCommentParameters = CreateCommentBodyParameters;
61
74
  export type CreateCommentResponse = PartialCommentObjectResponse | CommentObjectResponse;
@@ -66,7 +79,7 @@ export declare const createComment: {
66
79
  readonly method: "post";
67
80
  readonly pathParams: readonly [];
68
81
  readonly queryParams: readonly [];
69
- readonly bodyParams: readonly ["rich_text", "attachments", "display_name", "parent", "discussion_id"];
82
+ readonly bodyParams: readonly ["attachments", "display_name", "parent", "rich_text", "markdown", "discussion_id"];
70
83
  readonly path: () => string;
71
84
  };
72
85
  type ListCommentsQueryParameters = {
@@ -1 +1 @@
1
- {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../src/api-endpoints/comments.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,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qBAAqB,GAC7B,4BAA4B,GAC5B,qBAAqB,CAAA;AAEzB;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;yBAad,MAAM;CACR,CAAA;AAEV,KAAK,2BAA2B,GAAG;IAEjC,QAAQ,EAAE,SAAS,CAAA;IAGnB,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,2BAA2B,CAAA;AAEhE,MAAM,MAAM,oBAAoB,GAAG;IAEjC,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,UAAU,GAAG,IAAI,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAA;IAErC,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,EAAE,WAAW,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;yBAMb,MAAM;CACR,CAAA;AAEV,KAAK,wBAAwB,GAAG;IAE9B,UAAU,EAAE,SAAS,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAA;AAE3D,MAAM,MAAM,kBAAkB,GAC1B,4BAA4B,GAC5B,qBAAqB,CAAA;AAEzB;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;uBAMX,wBAAwB,KAAG,MAAM;CACnC,CAAA"}
@@ -11,10 +11,11 @@ exports.createComment = {
11
11
  pathParams: [],
12
12
  queryParams: [],
13
13
  bodyParams: [
14
- "rich_text",
15
14
  "attachments",
16
15
  "display_name",
17
16
  "parent",
17
+ "rich_text",
18
+ "markdown",
18
19
  "discussion_id",
19
20
  ],
20
21
  path: () => `comments`,
@@ -1 +1 @@
1
- {"version":3,"file":"comments.js","sourceRoot":"","sources":["../../../src/api-endpoints/comments.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,+CAA+C;;;AA6H/C;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE;QACV,WAAW;QACX,aAAa;QACb,cAAc;QACd,QAAQ;QACR,eAAe;KAChB;IAED,IAAI,EAAE,GAAW,EAAE,CAAC,UAAU;CACtB,CAAA;AAyBV;;GAEG;AACU,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,WAAW,CAAC;IACtD,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,GAAW,EAAE,CAAC,UAAU;CACtB,CAAA;AAaV;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,YAAY,CAAC;IAC1B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAA2B,EAAU,EAAE,CAAC,YAAY,CAAC,CAAC,UAAU,EAAE;CACjE,CAAA","sourcesContent":["// cspell:disable-file\n// Note: This is a generated file. DO NOT EDIT!\n\nimport type {\n EmptyObject,\n IdRequest,\n IdResponse,\n InternalFileResponse,\n PartialUserObjectResponse,\n RichTextItemRequest,\n RichTextItemResponse,\n} from \"./common\"\n\ntype BlockIdCommentParentResponse = {\n // Always `block_id`\n type: \"block_id\"\n block_id: IdResponse\n}\n\nexport type CommentObjectResponse = {\n // The comment object type name.\n object: \"comment\"\n // The ID of the comment.\n id: IdResponse\n // The parent of the comment.\n parent: CommentParentResponse\n // The ID of the discussion thread this comment belongs to.\n discussion_id: IdResponse\n // The time when the comment was created.\n created_time: string\n // The time when the comment was last edited.\n last_edited_time: string\n // The user who created the comment.\n created_by: PartialUserObjectResponse\n // The rich text content of the comment.\n rich_text: Array<RichTextItemResponse>\n // The display name of the comment.\n display_name: {\n // One of: `custom`, `user`, `integration`\n type: \"custom\" | \"user\" | \"integration\"\n resolved_name: string | null\n }\n // Any file attachments associated with the comment.\n attachments?: Array<{\n // One of: `audio`, `image`, `pdf`, `productivity`, `video`\n category: \"audio\" | \"image\" | \"pdf\" | \"productivity\" | \"video\"\n file: InternalFileResponse\n }>\n}\n\ntype CommentParentResponse =\n | PageIdCommentParentResponse\n | BlockIdCommentParentResponse\n\ntype PageIdCommentParentResponse = {\n // Always `page_id`\n type: \"page_id\"\n page_id: IdResponse\n}\n\nexport type PartialCommentObjectResponse = {\n // The comment object type name.\n object: \"comment\"\n // The ID of the comment.\n id: IdResponse\n}\n\ntype CreateCommentBodyParameters = {\n // An array of rich text objects that represent the content of the comment.\n rich_text: Array<RichTextItemRequest>\n // An array of files to attach to the comment. Maximum of 3 allowed.\n attachments?: Array<{\n // ID of a FileUpload object that has the status `uploaded`.\n file_upload_id: string\n // Always `file_upload`\n type?: \"file_upload\"\n }>\n // Display name for the comment.\n display_name?:\n | {\n // Always `integration`\n type: \"integration\"\n }\n | {\n // Always `user`\n type: \"user\"\n }\n | {\n // Always `custom`\n type: \"custom\"\n custom: {\n // The custom display name to use\n name: string\n }\n }\n} & (\n | {\n // The parent of the comment. This can be a page or a block.\n parent:\n | {\n // The ID of the parent page (with or without dashes), for example,\n // 195de9221179449fab8075a27c979105\n page_id: IdRequest\n // Always `page_id`\n type?: \"page_id\"\n }\n | {\n // The ID of the parent block (with or without dashes), for example,\n // 195de9221179449fab8075a27c979105\n block_id: IdRequest\n // Always `block_id`\n type?: \"block_id\"\n }\n }\n | {\n // The ID of the discussion to comment on.\n discussion_id: IdRequest\n }\n)\n\nexport type CreateCommentParameters = CreateCommentBodyParameters\n\nexport type CreateCommentResponse =\n | PartialCommentObjectResponse\n | CommentObjectResponse\n\n/**\n * Create a comment\n */\nexport const createComment = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [\n \"rich_text\",\n \"attachments\",\n \"display_name\",\n \"parent\",\n \"discussion_id\",\n ],\n\n path: (): string => `comments`,\n} as const\n\ntype ListCommentsQueryParameters = {\n // Identifier for a Notion block or page.\n block_id: IdRequest\n // If supplied, this endpoint will return a page of results starting after the cursor\n // provided. If not supplied, this endpoint will return the first page of results.\n start_cursor?: string\n // The number of items from the full list desired in the response. Maximum: 100\n page_size?: number\n}\n\nexport type ListCommentsParameters = ListCommentsQueryParameters\n\nexport type ListCommentsResponse = {\n // Always `list`\n object: \"list\"\n next_cursor: IdResponse | null\n has_more: boolean\n results: Array<CommentObjectResponse>\n // Always `comment`\n type: \"comment\"\n comment: EmptyObject\n}\n\n/**\n * List comments\n */\nexport const listComments = {\n method: \"get\",\n pathParams: [],\n queryParams: [\"block_id\", \"start_cursor\", \"page_size\"],\n bodyParams: [],\n\n path: (): string => `comments`,\n} as const\n\ntype GetCommentPathParameters = {\n // The ID of the comment to retrieve.\n comment_id: IdRequest\n}\n\nexport type GetCommentParameters = GetCommentPathParameters\n\nexport type GetCommentResponse =\n | PartialCommentObjectResponse\n | CommentObjectResponse\n\n/**\n * Retrieve a comment\n */\nexport const getComment = {\n method: \"get\",\n pathParams: [\"comment_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: GetCommentPathParameters): string => `comments/${p.comment_id}`,\n} as const\n"]}
1
+ {"version":3,"file":"comments.js","sourceRoot":"","sources":["../../../src/api-endpoints/comments.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,+CAA+C;;;AA2J/C;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE;QACV,aAAa;QACb,cAAc;QACd,QAAQ;QACR,WAAW;QACX,UAAU;QACV,eAAe;KAChB;IAED,IAAI,EAAE,GAAW,EAAE,CAAC,UAAU;CACtB,CAAA;AAyBV;;GAEG;AACU,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,WAAW,CAAC;IACtD,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,GAAW,EAAE,CAAC,UAAU;CACtB,CAAA;AAaV;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,YAAY,CAAC;IAC1B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAA2B,EAAU,EAAE,CAAC,YAAY,CAAC,CAAC,UAAU,EAAE;CACjE,CAAA","sourcesContent":["// cspell:disable-file\n// Note: This is a generated file. DO NOT EDIT!\n\nimport type {\n EmptyObject,\n IdRequest,\n IdResponse,\n InternalFileResponse,\n PartialUserObjectResponse,\n RichTextItemRequest,\n RichTextItemResponse,\n} from \"./common\"\n\ntype BlockIdCommentParentResponse = {\n // Always `block_id`\n type: \"block_id\"\n block_id: IdResponse\n}\n\nexport type CommentObjectResponse = {\n // The comment object type name.\n object: \"comment\"\n // The ID of the comment.\n id: IdResponse\n // The parent of the comment.\n parent: CommentParentResponse\n // The ID of the discussion thread this comment belongs to.\n discussion_id: IdResponse\n // The time when the comment was created.\n created_time: string\n // The time when the comment was last edited.\n last_edited_time: string\n // The user who created the comment.\n created_by: PartialUserObjectResponse\n // The rich text content of the comment.\n rich_text: Array<RichTextItemResponse>\n // The display name of the comment.\n display_name: {\n // One of: `custom`, `user`, `integration`\n type: \"custom\" | \"user\" | \"integration\"\n resolved_name: string | null\n }\n // Any file attachments associated with the comment.\n attachments?: Array<{\n // One of: `audio`, `image`, `pdf`, `productivity`, `video`\n category: \"audio\" | \"image\" | \"pdf\" | \"productivity\" | \"video\"\n file: InternalFileResponse\n }>\n}\n\ntype CommentParentResponse =\n | PageIdCommentParentResponse\n | BlockIdCommentParentResponse\n\ntype PageIdCommentParentResponse = {\n // Always `page_id`\n type: \"page_id\"\n page_id: IdResponse\n}\n\nexport type PartialCommentObjectResponse = {\n // The comment object type name.\n object: \"comment\"\n // The ID of the comment.\n id: IdResponse\n}\n\ntype CreateCommentBodyParameters = {\n // An array of files to attach to the comment. Maximum of 3 allowed.\n attachments?: Array<{\n // ID of a FileUpload object that has the status `uploaded`.\n file_upload_id: string\n // Always `file_upload`\n type?: \"file_upload\"\n }>\n // Display name for the comment.\n display_name?:\n | {\n // Always `integration`\n type: \"integration\"\n }\n | {\n // Always `user`\n type: \"user\"\n }\n | {\n // Always `custom`\n type: \"custom\"\n custom: {\n // The custom display name to use\n name: string\n }\n }\n} & (\n | {\n // The parent of the comment. This can be a page or a block.\n parent:\n | {\n // The ID of the parent page (with or without dashes), for example,\n // 195de9221179449fab8075a27c979105\n page_id: IdRequest\n // Always `page_id`\n type?: \"page_id\"\n }\n | {\n // The ID of the parent block (with or without dashes), for example,\n // 195de9221179449fab8075a27c979105\n block_id: IdRequest\n // Always `block_id`\n type?: \"block_id\"\n }\n // An array of rich text objects that represent the content of the comment.\n rich_text: Array<RichTextItemRequest>\n }\n | {\n // The parent of the comment. This can be a page or a block.\n parent:\n | {\n // The ID of the parent page (with or without dashes), for example,\n // 195de9221179449fab8075a27c979105\n page_id: IdRequest\n // Always `page_id`\n type?: \"page_id\"\n }\n | {\n // The ID of the parent block (with or without dashes), for example,\n // 195de9221179449fab8075a27c979105\n block_id: IdRequest\n // Always `block_id`\n type?: \"block_id\"\n }\n // The content of the comment as a Markdown string. Supports inline formatting (bold,\n // italic, strikethrough, code, links), inline equations ($expression$), and mentions.\n markdown: string\n }\n | {\n // The ID of the discussion to comment on.\n discussion_id: IdRequest\n // An array of rich text objects that represent the content of the comment.\n rich_text: Array<RichTextItemRequest>\n }\n | {\n // The ID of the discussion to comment on.\n discussion_id: IdRequest\n // The content of the comment as a Markdown string. Supports inline formatting (bold,\n // italic, strikethrough, code, links), inline equations ($expression$), and mentions.\n markdown: string\n }\n)\n\nexport type CreateCommentParameters = CreateCommentBodyParameters\n\nexport type CreateCommentResponse =\n | PartialCommentObjectResponse\n | CommentObjectResponse\n\n/**\n * Create a comment\n */\nexport const createComment = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [\n \"attachments\",\n \"display_name\",\n \"parent\",\n \"rich_text\",\n \"markdown\",\n \"discussion_id\",\n ],\n\n path: (): string => `comments`,\n} as const\n\ntype ListCommentsQueryParameters = {\n // Identifier for a Notion block or page.\n block_id: IdRequest\n // If supplied, this endpoint will return a page of results starting after the cursor\n // provided. If not supplied, this endpoint will return the first page of results.\n start_cursor?: string\n // The number of items from the full list desired in the response. Maximum: 100\n page_size?: number\n}\n\nexport type ListCommentsParameters = ListCommentsQueryParameters\n\nexport type ListCommentsResponse = {\n // Always `list`\n object: \"list\"\n next_cursor: IdResponse | null\n has_more: boolean\n results: Array<CommentObjectResponse>\n // Always `comment`\n type: \"comment\"\n comment: EmptyObject\n}\n\n/**\n * List comments\n */\nexport const listComments = {\n method: \"get\",\n pathParams: [],\n queryParams: [\"block_id\", \"start_cursor\", \"page_size\"],\n bodyParams: [],\n\n path: (): string => `comments`,\n} as const\n\ntype GetCommentPathParameters = {\n // The ID of the comment to retrieve.\n comment_id: IdRequest\n}\n\nexport type GetCommentParameters = GetCommentPathParameters\n\nexport type GetCommentResponse =\n | PartialCommentObjectResponse\n | CommentObjectResponse\n\n/**\n * Retrieve a comment\n */\nexport const getComment = {\n method: \"get\",\n pathParams: [\"comment_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: GetCommentPathParameters): string => `comments/${p.comment_id}`,\n} as const\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notionhq/client",
3
- "version": "5.16.0",
3
+ "version": "5.17.0",
4
4
  "description": "A simple and easy to use client for the Notion API",
5
5
  "engines": {
6
6
  "node": ">=18"