@notionhq/client 5.23.0 → 5.23.1

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.23.0",
3
+ "version": "5.23.1",
4
4
  "description": "A simple and easy to use client for the Notion API",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -1 +1 @@
1
- {"version":3,"file":"data-sources.js","sourceRoot":"","sources":["../../../src/api-endpoints/data-sources.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,+CAA+C;;;AAsU/C;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAA8B,EAAU,EAAE,CAC/C,gBAAgB,CAAC,CAAC,cAAc,EAAE;CAC5B,CAAA;AAgMV;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC;IAE7E,IAAI,EAAE,CAAC,CAAiC,EAAU,EAAE,CAClD,gBAAgB,CAAC,CAAC,cAAc,EAAE;CAC5B,CAAA;AAwDV;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,CAAC,mBAAmB,CAAC;IAClC,UAAU,EAAE;QACV,UAAU;QACV,OAAO;QACP,QAAQ;QACR,cAAc;QACd,WAAW;QACX,UAAU;QACV,aAAa;KACd;IAED,IAAI,EAAE,CAAC,CAAgC,EAAU,EAAE,CACjD,gBAAgB,CAAC,CAAC,cAAc,QAAQ;CAClC,CAAA;AAmBV;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC;IAErD,IAAI,EAAE,GAAW,EAAE,CAAC,cAAc;CAC1B,CAAA;AAoCV;;GAEG;AACU,QAAA,uBAAuB,GAAG;IACrC,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,CAAC;IAClD,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAAwC,EAAU,EAAE,CACzD,gBAAgB,CAAC,CAAC,cAAc,YAAY;CACtC,CAAA","sourcesContent":["// cspell:disable-file\n// Note: This is a generated file. DO NOT EDIT!\n\nimport type {\n DataSourceParentResponse,\n DatabaseParentResponse,\n EmptyObject,\n GroupFilterOperatorArray,\n IdRequest,\n IdResponse,\n NumberFormat,\n PageCoverResponse,\n PageIconRequest,\n PageIconResponse,\n PageObjectResponse,\n ParentOfDataSourceRequest,\n ParentOfDatabaseResponse,\n PartialPageObjectResponse,\n PartialUserObjectResponse,\n PropertyConfigurationRequest,\n PropertyDescriptionRequest,\n PropertyFilter,\n RichTextItemRequest,\n RichTextItemResponse,\n RollupFunction,\n SelectColor,\n StatusPropertyConfigUpdateRequest,\n TimestampFilter,\n} from \"./common\"\n\ntype CheckboxDatabasePropertyConfigResponse = {\n // Always `checkbox`\n type: \"checkbox\"\n checkbox: EmptyObject\n}\n\ntype CreatedByDatabasePropertyConfigResponse = {\n // Always `created_by`\n type: \"created_by\"\n created_by: EmptyObject\n}\n\ntype CreatedTimeDatabasePropertyConfigResponse = {\n // Always `created_time`\n type: \"created_time\"\n created_time: EmptyObject\n}\n\nexport type DataSourceObjectResponse = {\n // The data source object type name.\n object: \"data_source\"\n // The ID of the data source.\n id: IdResponse\n // The title of the data source.\n title: Array<RichTextItemResponse>\n // The description of the data source.\n description: Array<RichTextItemResponse>\n // The parent of the data source.\n parent: ParentOfDataSourceResponse\n // The parent of the data source's containing database. This is typically a page, block,\n // or workspace, but can be another database in the case of wikis.\n database_parent: ParentOfDatabaseResponse\n // Whether the data source is inline.\n is_inline: boolean\n // Whether the data source is in the trash.\n in_trash: boolean\n /** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */\n archived: boolean\n // The time when the data source was created.\n created_time: string\n // The time when the data source was last edited.\n last_edited_time: string\n // The user who created the data source.\n created_by: PartialUserObjectResponse\n // The user who last edited the data source.\n last_edited_by: PartialUserObjectResponse\n // The properties schema of the data source.\n properties: Record<string, DatabasePropertyConfigResponse>\n // The icon of the data source.\n icon: PageIconResponse | null\n // The cover of the data source.\n cover: PageCoverResponse | null\n // The URL of the data source.\n url: string\n // The public URL of the data source if it is publicly accessible.\n public_url: string | null\n}\n\ntype DatabasePropertyConfigResponse = DatabasePropertyConfigResponseCommon &\n (\n | NumberDatabasePropertyConfigResponse\n | FormulaDatabasePropertyConfigResponse\n | SelectDatabasePropertyConfigResponse\n | MultiSelectDatabasePropertyConfigResponse\n | StatusDatabasePropertyConfigResponse\n | RelationDatabasePropertyConfigResponse\n | RollupDatabasePropertyConfigResponse\n | UniqueIdDatabasePropertyConfigResponse\n | TitleDatabasePropertyConfigResponse\n | RichTextDatabasePropertyConfigResponse\n | UrlDatabasePropertyConfigResponse\n | PeopleDatabasePropertyConfigResponse\n | FilesDatabasePropertyConfigResponse\n | EmailDatabasePropertyConfigResponse\n | PhoneNumberDatabasePropertyConfigResponse\n | DateDatabasePropertyConfigResponse\n | CheckboxDatabasePropertyConfigResponse\n | CreatedByDatabasePropertyConfigResponse\n | CreatedTimeDatabasePropertyConfigResponse\n | LastEditedByDatabasePropertyConfigResponse\n | LastEditedTimeDatabasePropertyConfigResponse\n )\n\ntype DatabasePropertyConfigResponseCommon = {\n // The ID of the property.\n id: string\n // The name of the property.\n name: string\n // The description of the property.\n description: PropertyDescriptionRequest | null\n}\n\ntype DatabasePropertyRelationConfigResponse =\n DatabasePropertyRelationConfigResponseCommon &\n (\n | SinglePropertyDatabasePropertyRelationConfigResponse\n | DualPropertyDatabasePropertyRelationConfigResponse\n )\n\ntype DatabasePropertyRelationConfigResponseCommon = {\n database_id: IdResponse\n data_source_id: IdResponse\n}\n\ntype DateDatabasePropertyConfigResponse = {\n // Always `date`\n type: \"date\"\n date: EmptyObject\n}\n\ntype DualPropertyDatabasePropertyRelationConfigResponse = {\n // Always `dual_property`\n type?: \"dual_property\"\n dual_property: { synced_property_id: string; synced_property_name: string }\n}\n\ntype EmailDatabasePropertyConfigResponse = {\n // Always `email`\n type: \"email\"\n email: EmptyObject\n}\n\ntype FilesDatabasePropertyConfigResponse = {\n // Always `files`\n type: \"files\"\n files: EmptyObject\n}\n\ntype FormulaDatabasePropertyConfigResponse = {\n // Always `formula`\n type: \"formula\"\n formula: { expression: string }\n}\n\ntype LastEditedByDatabasePropertyConfigResponse = {\n // Always `last_edited_by`\n type: \"last_edited_by\"\n last_edited_by: EmptyObject\n}\n\ntype LastEditedTimeDatabasePropertyConfigResponse = {\n // Always `last_edited_time`\n type: \"last_edited_time\"\n last_edited_time: EmptyObject\n}\n\ntype MultiSelectDatabasePropertyConfigResponse = {\n // Always `multi_select`\n type: \"multi_select\"\n multi_select: { options: Array<SelectPropertyResponse> }\n}\n\ntype NumberDatabasePropertyConfigResponse = {\n // Always `number`\n type: \"number\"\n number: {\n // The number format for the property.\n format: NumberFormat\n }\n}\n\n/**\n * The parent of the data source. This is typically a database (`database_id`), but for\n * externally synced data sources, can be another data source (`data_source_id`).\n */\ntype ParentOfDataSourceResponse =\n | DatabaseParentResponse\n | DataSourceParentResponse\n\nexport type PartialDataSourceObjectResponse = {\n // The data source object type name.\n object: \"data_source\"\n // The ID of the data source.\n id: IdResponse\n // The properties schema of the data source.\n properties: Record<string, DatabasePropertyConfigResponse>\n}\n\ntype PeopleDatabasePropertyConfigResponse = {\n // Always `people`\n type: \"people\"\n people: EmptyObject\n}\n\ntype PhoneNumberDatabasePropertyConfigResponse = {\n // Always `phone_number`\n type: \"phone_number\"\n phone_number: EmptyObject\n}\n\ntype RelationDatabasePropertyConfigResponse = {\n // Always `relation`\n type: \"relation\"\n relation: DatabasePropertyRelationConfigResponse\n}\n\ntype RichTextDatabasePropertyConfigResponse = {\n // Always `rich_text`\n type: \"rich_text\"\n rich_text: EmptyObject\n}\n\ntype RollupDatabasePropertyConfigResponse = {\n // Always `rollup`\n type: \"rollup\"\n rollup: {\n // The function to use for the rollup, e.g. count, count_values, percent_not_empty, max.\n function: RollupFunction\n rollup_property_name: string\n relation_property_name: string\n rollup_property_id: string\n relation_property_id: string\n }\n}\n\ntype SelectDatabasePropertyConfigResponse = {\n // Always `select`\n type: \"select\"\n select: { options: Array<SelectPropertyResponse> }\n}\n\ntype SelectPropertyResponse = {\n id: string\n name: string\n color: SelectColor\n description: string | null\n}\n\ntype SinglePropertyDatabasePropertyRelationConfigResponse = {\n // Always `single_property`\n type: \"single_property\"\n single_property: EmptyObject\n}\n\ntype StatusDatabasePropertyConfigResponse = {\n // Always `status`\n type: \"status\"\n status: {\n // The options for the status property.\n options: Array<StatusPropertyResponse>\n // The groups for the status property.\n groups: Array<{\n // The ID of the status group.\n id: string\n // The name of the status group.\n name: string\n // The color of the status group.\n color: SelectColor\n // The IDs of the status options in this group.\n option_ids: Array<string>\n }>\n }\n}\n\ntype StatusPropertyResponse = {\n // The ID of the status option.\n id: string\n // The name of the status option.\n name: string\n // The color of the status option.\n color: SelectColor\n // The description of the status option.\n description: string | null\n}\n\ntype TitleDatabasePropertyConfigResponse = {\n // Always `title`\n type: \"title\"\n title: EmptyObject\n}\n\ntype UniqueIdDatabasePropertyConfigResponse = {\n // Always `unique_id`\n type: \"unique_id\"\n unique_id: {\n // The prefix for the unique ID.\n prefix: string | null\n }\n}\n\ntype UrlDatabasePropertyConfigResponse = {\n // Always `url`\n type: \"url\"\n url: EmptyObject\n}\n\ntype GetDataSourcePathParameters = {\n // ID of a Notion data source.\n data_source_id: IdRequest\n}\n\nexport type GetDataSourceParameters = GetDataSourcePathParameters\n\nexport type GetDataSourceResponse =\n | PartialDataSourceObjectResponse\n | DataSourceObjectResponse\n\n/**\n * Retrieve a data source\n */\nexport const getDataSource = {\n method: \"get\",\n pathParams: [\"data_source_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: GetDataSourcePathParameters): string =>\n `data_sources/${p.data_source_id}`,\n} as const\n\ntype UpdateDataSourcePathParameters = {\n // ID of a Notion data source.\n data_source_id: IdRequest\n}\n\ntype UpdateDataSourceBodyParameters = {\n // Title of data source as it appears in Notion.\n title?: Array<RichTextItemRequest>\n // Page icon.\n icon?: PageIconRequest | null\n // The property schema of the data source. The keys are property names or IDs, and the\n // values are property configuration objects. Properties set to null will be removed.\n properties?: Record<\n string,\n | ({\n // The name of the property.\n name?: string\n // The description of the property.\n description?: PropertyDescriptionRequest | null\n } & (\n | {\n // Always `number`\n type?: \"number\"\n number: { format?: NumberFormat }\n }\n | {\n // Always `formula`\n type?: \"formula\"\n formula: { expression?: string }\n }\n | {\n // Always `select`\n type?: \"select\"\n select: {\n options?: Array<\n { color?: SelectColor; description?: string | null } & (\n | { name: string; id?: string }\n | { id: string; name?: string }\n )\n >\n }\n }\n | {\n // Always `multi_select`\n type?: \"multi_select\"\n multi_select: {\n options?: Array<\n { color?: SelectColor; description?: string | null } & (\n | { name: string; id?: string }\n | { id: string; name?: string }\n )\n >\n }\n }\n | {\n // Always `status`\n type?: \"status\"\n status: StatusPropertyConfigUpdateRequest\n }\n | {\n // Always `relation`\n type?: \"relation\"\n relation: { data_source_id: IdRequest } & (\n | {\n // Always `single_property`\n type?: \"single_property\"\n single_property: EmptyObject\n }\n | {\n // Always `dual_property`\n type?: \"dual_property\"\n dual_property: {\n synced_property_id?: string\n synced_property_name?: string\n }\n }\n )\n }\n | {\n // Always `rollup`\n type?: \"rollup\"\n rollup: {\n // The function to use for the rollup, e.g. count, count_values, percent_not_empty, max.\n function: RollupFunction\n } & (\n | { relation_property_name: string; rollup_property_name: string }\n | { relation_property_id: string; rollup_property_name: string }\n | { relation_property_name: string; rollup_property_id: string }\n | { relation_property_id: string; rollup_property_id: string }\n )\n }\n | {\n // Always `unique_id`\n type?: \"unique_id\"\n unique_id: { prefix?: string | null }\n }\n | {\n // Always `title`\n type?: \"title\"\n title: EmptyObject\n }\n | {\n // Always `rich_text`\n type?: \"rich_text\"\n rich_text: EmptyObject\n }\n | {\n // Always `url`\n type?: \"url\"\n url: EmptyObject\n }\n | {\n // Always `people`\n type?: \"people\"\n people: EmptyObject\n }\n | {\n // Always `files`\n type?: \"files\"\n files: EmptyObject\n }\n | {\n // Always `email`\n type?: \"email\"\n email: EmptyObject\n }\n | {\n // Always `phone_number`\n type?: \"phone_number\"\n phone_number: EmptyObject\n }\n | {\n // Always `date`\n type?: \"date\"\n date: EmptyObject\n }\n | {\n // Always `checkbox`\n type?: \"checkbox\"\n checkbox: EmptyObject\n }\n | {\n // Always `created_by`\n type?: \"created_by\"\n created_by: EmptyObject\n }\n | {\n // Always `created_time`\n type?: \"created_time\"\n created_time: EmptyObject\n }\n | {\n // Always `last_edited_by`\n type?: \"last_edited_by\"\n last_edited_by: EmptyObject\n }\n | {\n // Always `last_edited_time`\n type?: \"last_edited_time\"\n last_edited_time: EmptyObject\n }\n | {\n // Always `place`\n type?: \"place\"\n place: EmptyObject\n }\n ))\n | {\n // The new name of the property.\n name: string\n }\n | null\n >\n // Whether the database should be moved to or from the trash. If not provided, the trash\n // status will not be updated.\n in_trash?: boolean\n /** @deprecated Use `in_trash` instead. */\n archived?: boolean\n // The parent of the data source, when moving it to a different database. If not\n // provided, the parent will not be updated.\n parent?: ParentOfDataSourceRequest\n}\n\nexport type UpdateDataSourceParameters = UpdateDataSourcePathParameters &\n UpdateDataSourceBodyParameters\n\nexport type UpdateDataSourceResponse =\n | PartialDataSourceObjectResponse\n | DataSourceObjectResponse\n\n/**\n * Update a data source\n */\nexport const updateDataSource = {\n method: \"patch\",\n pathParams: [\"data_source_id\"],\n queryParams: [],\n bodyParams: [\"archived\", \"title\", \"icon\", \"properties\", \"in_trash\", \"parent\"],\n\n path: (p: UpdateDataSourcePathParameters): string =>\n `data_sources/${p.data_source_id}`,\n} as const\n\ntype QueryDataSourcePathParameters = {\n data_source_id: IdRequest\n}\n\ntype QueryDataSourceQueryParameters = {\n filter_properties?: Array<string>\n}\n\ntype QueryDataSourceBodyParameters = {\n sorts?: Array<\n | { property: string; direction: \"ascending\" | \"descending\" }\n | {\n timestamp: \"created_time\" | \"last_edited_time\"\n direction: \"ascending\" | \"descending\"\n }\n >\n filter?:\n | { or: GroupFilterOperatorArray }\n | { and: GroupFilterOperatorArray }\n | PropertyFilter\n | TimestampFilter\n start_cursor?: string | null\n page_size?: number\n in_trash?: boolean\n /** @deprecated Use `in_trash` instead. */\n archived?: boolean\n // Optionally filter the results to only include pages or data sources. Regular, non-wiki\n // databases only support page children. The default behavior is no result type\n // filtering, in other words, returning both pages and data sources for wikis.\n result_type?: \"page\" | \"data_source\"\n}\n\nexport type QueryDataSourceParameters = QueryDataSourcePathParameters &\n QueryDataSourceQueryParameters &\n QueryDataSourceBodyParameters\n\nexport type QueryDataSourceResponse = {\n type: \"page_or_data_source\"\n page_or_data_source: EmptyObject\n object: \"list\"\n next_cursor: string | null\n has_more: boolean\n results: Array<\n | PageObjectResponse\n | PartialPageObjectResponse\n | PartialDataSourceObjectResponse\n | DataSourceObjectResponse\n >\n request_status?: {\n type: \"complete\" | \"incomplete\"\n incomplete_reason?: \"query_result_limit_reached\"\n }\n}\n\n/**\n * Query a data source\n */\nexport const queryDataSource = {\n method: \"post\",\n pathParams: [\"data_source_id\"],\n queryParams: [\"filter_properties\"],\n bodyParams: [\n \"archived\",\n \"sorts\",\n \"filter\",\n \"start_cursor\",\n \"page_size\",\n \"in_trash\",\n \"result_type\",\n ],\n\n path: (p: QueryDataSourcePathParameters): string =>\n `data_sources/${p.data_source_id}/query`,\n} as const\n\ntype CreateDataSourceBodyParameters = {\n // An object specifying the parent of the new data source to be created.\n parent: ParentOfDataSourceRequest\n // Property schema of data source.\n properties: Record<string, PropertyConfigurationRequest>\n // Title of data source as it appears in Notion.\n title?: Array<RichTextItemRequest>\n // Page icon.\n icon?: PageIconRequest | null\n}\n\nexport type CreateDataSourceParameters = CreateDataSourceBodyParameters\n\nexport type CreateDataSourceResponse =\n | PartialDataSourceObjectResponse\n | DataSourceObjectResponse\n\n/**\n * Create a data source\n */\nexport const createDataSource = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [\"parent\", \"properties\", \"title\", \"icon\"],\n\n path: (): string => `data_sources`,\n} as const\n\ntype ListDataSourceTemplatesPathParameters = {\n // ID of a Notion data source.\n data_source_id: IdRequest\n}\n\ntype ListDataSourceTemplatesQueryParameters = {\n // Filter templates by name (case-insensitive substring match).\n name?: string\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 | null\n // The number of items from the full list desired in the response. Maximum: 100\n page_size?: number\n}\n\nexport type ListDataSourceTemplatesParameters =\n ListDataSourceTemplatesPathParameters & ListDataSourceTemplatesQueryParameters\n\nexport type ListDataSourceTemplatesResponse = {\n // Array of templates available in this data source.\n templates: Array<{\n // ID of the template page.\n id: IdResponse\n // Name of the template.\n name: string\n // Whether this template is the default template for the data source.\n is_default: boolean\n }>\n // Whether there are more templates available beyond this page.\n has_more: boolean\n // Cursor to use for the next page of results. Null if there are no more results.\n next_cursor: IdResponse | null\n}\n\n/**\n * List templates in a data source\n */\nexport const listDataSourceTemplates = {\n method: \"get\",\n pathParams: [\"data_source_id\"],\n queryParams: [\"name\", \"start_cursor\", \"page_size\"],\n bodyParams: [],\n\n path: (p: ListDataSourceTemplatesPathParameters): string =>\n `data_sources/${p.data_source_id}/templates`,\n} as const\n"]}
1
+ {"version":3,"file":"data-sources.js","sourceRoot":"","sources":["../../../src/api-endpoints/data-sources.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,+CAA+C;;;AAsU/C;;GAEG;AACU,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAA8B,EAAU,EAAE,CAC/C,gBAAgB,CAAC,CAAC,cAAc,EAAE;CAC5B,CAAA;AAgMV;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC;IAE7E,IAAI,EAAE,CAAC,CAAiC,EAAU,EAAE,CAClD,gBAAgB,CAAC,CAAC,cAAc,EAAE;CAC5B,CAAA;AAwDV;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,CAAC,mBAAmB,CAAC;IAClC,UAAU,EAAE;QACV,UAAU;QACV,OAAO;QACP,QAAQ;QACR,cAAc;QACd,WAAW;QACX,UAAU;QACV,aAAa;KACd;IAED,IAAI,EAAE,CAAC,CAAgC,EAAU,EAAE,CACjD,gBAAgB,CAAC,CAAC,cAAc,QAAQ;CAClC,CAAA;AAmBV;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC;IAErD,IAAI,EAAE,GAAW,EAAE,CAAC,cAAc;CAC1B,CAAA;AAoCV;;GAEG;AACU,QAAA,uBAAuB,GAAG;IACrC,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,CAAC;IAClD,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAAwC,EAAU,EAAE,CACzD,gBAAgB,CAAC,CAAC,cAAc,YAAY;CACtC,CAAA","sourcesContent":["// cspell:disable-file\n// Note: This is a generated file. DO NOT EDIT!\n\nimport type {\n DataSourceParentResponse,\n DatabaseParentResponse,\n EmptyObject,\n GroupFilterOperatorArray,\n IdRequest,\n IdResponse,\n NumberFormat,\n PageCoverResponse,\n PageIconRequest,\n PageIconResponse,\n PageObjectResponse,\n ParentOfDataSourceRequest,\n ParentOfDatabaseResponse,\n PartialPageObjectResponse,\n PartialUserObjectResponse,\n PropertyConfigurationRequest,\n PropertyDescriptionRequest,\n PropertyFilter,\n RichTextItemRequest,\n RichTextItemResponse,\n RollupFunction,\n SelectColor,\n StatusPropertyConfigUpdateRequest,\n TimestampFilter,\n} from \"./common\"\n\ntype CheckboxDatabasePropertyConfigResponse = {\n // Always `checkbox`\n type: \"checkbox\"\n checkbox: EmptyObject\n}\n\ntype CreatedByDatabasePropertyConfigResponse = {\n // Always `created_by`\n type: \"created_by\"\n created_by: EmptyObject\n}\n\ntype CreatedTimeDatabasePropertyConfigResponse = {\n // Always `created_time`\n type: \"created_time\"\n created_time: EmptyObject\n}\n\nexport type DataSourceObjectResponse = {\n // The data source object type name.\n object: \"data_source\"\n // The ID of the data source.\n id: IdResponse\n // The title of the data source.\n title: Array<RichTextItemResponse>\n // The description of the data source.\n description: Array<RichTextItemResponse>\n // The parent of the data source.\n parent: ParentOfDataSourceResponse\n // The parent of the data source's containing database. This is typically a page, block,\n // or workspace, but can be another database in the case of wikis.\n database_parent: ParentOfDatabaseResponse\n // Whether the data source is inline.\n is_inline: boolean\n // Whether the data source is in the trash.\n in_trash: boolean\n /** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */\n archived: boolean\n // The time when the data source was created.\n created_time: string\n // The time when the data source was last edited.\n last_edited_time: string\n // The user who created the data source.\n created_by: PartialUserObjectResponse\n // The user who last edited the data source.\n last_edited_by: PartialUserObjectResponse\n // The properties schema of the data source.\n properties: Record<string, DatabasePropertyConfigResponse>\n // The icon of the data source.\n icon: PageIconResponse | null\n // The cover of the data source.\n cover: PageCoverResponse | null\n // The URL of the data source.\n url: string\n // The public URL of the data source if it is publicly accessible.\n public_url: string | null\n}\n\ntype DatabasePropertyConfigResponse = DatabasePropertyConfigResponseCommon &\n (\n | NumberDatabasePropertyConfigResponse\n | FormulaDatabasePropertyConfigResponse\n | SelectDatabasePropertyConfigResponse\n | MultiSelectDatabasePropertyConfigResponse\n | StatusDatabasePropertyConfigResponse\n | RelationDatabasePropertyConfigResponse\n | RollupDatabasePropertyConfigResponse\n | UniqueIdDatabasePropertyConfigResponse\n | TitleDatabasePropertyConfigResponse\n | RichTextDatabasePropertyConfigResponse\n | UrlDatabasePropertyConfigResponse\n | PeopleDatabasePropertyConfigResponse\n | FilesDatabasePropertyConfigResponse\n | EmailDatabasePropertyConfigResponse\n | PhoneNumberDatabasePropertyConfigResponse\n | DateDatabasePropertyConfigResponse\n | CheckboxDatabasePropertyConfigResponse\n | CreatedByDatabasePropertyConfigResponse\n | CreatedTimeDatabasePropertyConfigResponse\n | LastEditedByDatabasePropertyConfigResponse\n | LastEditedTimeDatabasePropertyConfigResponse\n )\n\ntype DatabasePropertyConfigResponseCommon = {\n // The ID of the property.\n id: string\n // The name of the property.\n name: string\n // The description of the property.\n description: PropertyDescriptionRequest | null\n}\n\ntype DatabasePropertyRelationConfigResponse =\n DatabasePropertyRelationConfigResponseCommon &\n (\n | SinglePropertyDatabasePropertyRelationConfigResponse\n | DualPropertyDatabasePropertyRelationConfigResponse\n )\n\ntype DatabasePropertyRelationConfigResponseCommon = {\n database_id: IdResponse\n data_source_id: IdResponse\n}\n\ntype DateDatabasePropertyConfigResponse = {\n // Always `date`\n type: \"date\"\n date: EmptyObject\n}\n\ntype DualPropertyDatabasePropertyRelationConfigResponse = {\n // Always `dual_property`\n type?: \"dual_property\"\n dual_property: { synced_property_id: string; synced_property_name: string }\n}\n\ntype EmailDatabasePropertyConfigResponse = {\n // Always `email`\n type: \"email\"\n email: EmptyObject\n}\n\ntype FilesDatabasePropertyConfigResponse = {\n // Always `files`\n type: \"files\"\n files: EmptyObject\n}\n\ntype FormulaDatabasePropertyConfigResponse = {\n // Always `formula`\n type: \"formula\"\n formula: { expression: string }\n}\n\ntype LastEditedByDatabasePropertyConfigResponse = {\n // Always `last_edited_by`\n type: \"last_edited_by\"\n last_edited_by: EmptyObject\n}\n\ntype LastEditedTimeDatabasePropertyConfigResponse = {\n // Always `last_edited_time`\n type: \"last_edited_time\"\n last_edited_time: EmptyObject\n}\n\ntype MultiSelectDatabasePropertyConfigResponse = {\n // Always `multi_select`\n type: \"multi_select\"\n multi_select: { options: Array<SelectPropertyResponse> }\n}\n\ntype NumberDatabasePropertyConfigResponse = {\n // Always `number`\n type: \"number\"\n number: {\n // The number format for the property.\n format: NumberFormat\n }\n}\n\n/**\n * The parent of the data source. This is typically a database (`database_id`), but for\n * externally synced data sources, can be another data source (`data_source_id`).\n */\ntype ParentOfDataSourceResponse =\n | DatabaseParentResponse\n | DataSourceParentResponse\n\nexport type PartialDataSourceObjectResponse = {\n // The data source object type name.\n object: \"data_source\"\n // The ID of the data source.\n id: IdResponse\n // The properties schema of the data source.\n properties: Record<string, DatabasePropertyConfigResponse>\n}\n\ntype PeopleDatabasePropertyConfigResponse = {\n // Always `people`\n type: \"people\"\n people: EmptyObject\n}\n\ntype PhoneNumberDatabasePropertyConfigResponse = {\n // Always `phone_number`\n type: \"phone_number\"\n phone_number: EmptyObject\n}\n\ntype RelationDatabasePropertyConfigResponse = {\n // Always `relation`\n type: \"relation\"\n relation: DatabasePropertyRelationConfigResponse\n}\n\ntype RichTextDatabasePropertyConfigResponse = {\n // Always `rich_text`\n type: \"rich_text\"\n rich_text: EmptyObject\n}\n\ntype RollupDatabasePropertyConfigResponse = {\n // Always `rollup`\n type: \"rollup\"\n rollup: {\n // The function to use for the rollup, e.g. count, count_values, percent_not_empty, max.\n function: RollupFunction\n rollup_property_name: string\n relation_property_name: string\n rollup_property_id: string\n relation_property_id: string\n }\n}\n\ntype SelectDatabasePropertyConfigResponse = {\n // Always `select`\n type: \"select\"\n select: { options: Array<SelectPropertyResponse> }\n}\n\ntype SelectPropertyResponse = {\n id: string\n name: string\n color: SelectColor\n description: string | null\n}\n\ntype SinglePropertyDatabasePropertyRelationConfigResponse = {\n // Always `single_property`\n type: \"single_property\"\n single_property: EmptyObject\n}\n\ntype StatusDatabasePropertyConfigResponse = {\n // Always `status`\n type: \"status\"\n status: {\n // The options for the status property.\n options: Array<StatusPropertyResponse>\n // The groups for the status property.\n groups: Array<{\n // The ID of the status group.\n id: string\n // The name of the status group.\n name: string\n // The color of the status group.\n color: SelectColor\n // The IDs of the status options in this group.\n option_ids: Array<string>\n }>\n }\n}\n\ntype StatusPropertyResponse = {\n // The ID of the status option.\n id: string\n // The name of the status option.\n name: string\n // The color of the status option.\n color: SelectColor\n // The description of the status option.\n description: string | null\n}\n\ntype TitleDatabasePropertyConfigResponse = {\n // Always `title`\n type: \"title\"\n title: EmptyObject\n}\n\ntype UniqueIdDatabasePropertyConfigResponse = {\n // Always `unique_id`\n type: \"unique_id\"\n unique_id: {\n // The prefix for the unique ID.\n prefix: string | null\n }\n}\n\ntype UrlDatabasePropertyConfigResponse = {\n // Always `url`\n type: \"url\"\n url: EmptyObject\n}\n\ntype GetDataSourcePathParameters = {\n // ID of a Notion data source.\n data_source_id: IdRequest\n}\n\nexport type GetDataSourceParameters = GetDataSourcePathParameters\n\nexport type GetDataSourceResponse =\n | PartialDataSourceObjectResponse\n | DataSourceObjectResponse\n\n/**\n * Retrieve a data source\n */\nexport const getDataSource = {\n method: \"get\",\n pathParams: [\"data_source_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: GetDataSourcePathParameters): string =>\n `data_sources/${p.data_source_id}`,\n} as const\n\ntype UpdateDataSourcePathParameters = {\n // ID of a Notion data source.\n data_source_id: IdRequest\n}\n\ntype UpdateDataSourceBodyParameters = {\n // Title of data source as it appears in Notion.\n title?: Array<RichTextItemRequest>\n // Data source icon.\n icon?: PageIconRequest | null\n // The property schema of the data source. The keys are property names or IDs, and the\n // values are property configuration objects. Properties set to null will be removed.\n properties?: Record<\n string,\n | ({\n // The name of the property.\n name?: string\n // The description of the property.\n description?: PropertyDescriptionRequest | null\n } & (\n | {\n // Always `number`\n type?: \"number\"\n number: { format?: NumberFormat }\n }\n | {\n // Always `formula`\n type?: \"formula\"\n formula: { expression?: string }\n }\n | {\n // Always `select`\n type?: \"select\"\n select: {\n options?: Array<\n { color?: SelectColor; description?: string | null } & (\n | { name: string; id?: string }\n | { id: string; name?: string }\n )\n >\n }\n }\n | {\n // Always `multi_select`\n type?: \"multi_select\"\n multi_select: {\n options?: Array<\n { color?: SelectColor; description?: string | null } & (\n | { name: string; id?: string }\n | { id: string; name?: string }\n )\n >\n }\n }\n | {\n // Always `status`\n type?: \"status\"\n status: StatusPropertyConfigUpdateRequest\n }\n | {\n // Always `relation`\n type?: \"relation\"\n relation: { data_source_id: IdRequest } & (\n | {\n // Always `single_property`\n type?: \"single_property\"\n single_property: EmptyObject\n }\n | {\n // Always `dual_property`\n type?: \"dual_property\"\n dual_property: {\n synced_property_id?: string\n synced_property_name?: string\n }\n }\n )\n }\n | {\n // Always `rollup`\n type?: \"rollup\"\n rollup: {\n // The function to use for the rollup, e.g. count, count_values, percent_not_empty, max.\n function: RollupFunction\n } & (\n | { relation_property_name: string; rollup_property_name: string }\n | { relation_property_id: string; rollup_property_name: string }\n | { relation_property_name: string; rollup_property_id: string }\n | { relation_property_id: string; rollup_property_id: string }\n )\n }\n | {\n // Always `unique_id`\n type?: \"unique_id\"\n unique_id: { prefix?: string | null }\n }\n | {\n // Always `title`\n type?: \"title\"\n title: EmptyObject\n }\n | {\n // Always `rich_text`\n type?: \"rich_text\"\n rich_text: EmptyObject\n }\n | {\n // Always `url`\n type?: \"url\"\n url: EmptyObject\n }\n | {\n // Always `people`\n type?: \"people\"\n people: EmptyObject\n }\n | {\n // Always `files`\n type?: \"files\"\n files: EmptyObject\n }\n | {\n // Always `email`\n type?: \"email\"\n email: EmptyObject\n }\n | {\n // Always `phone_number`\n type?: \"phone_number\"\n phone_number: EmptyObject\n }\n | {\n // Always `date`\n type?: \"date\"\n date: EmptyObject\n }\n | {\n // Always `checkbox`\n type?: \"checkbox\"\n checkbox: EmptyObject\n }\n | {\n // Always `created_by`\n type?: \"created_by\"\n created_by: EmptyObject\n }\n | {\n // Always `created_time`\n type?: \"created_time\"\n created_time: EmptyObject\n }\n | {\n // Always `last_edited_by`\n type?: \"last_edited_by\"\n last_edited_by: EmptyObject\n }\n | {\n // Always `last_edited_time`\n type?: \"last_edited_time\"\n last_edited_time: EmptyObject\n }\n | {\n // Always `place`\n type?: \"place\"\n place: EmptyObject\n }\n ))\n | {\n // The new name of the property.\n name: string\n }\n | null\n >\n // Whether the data source should be moved to or from the trash. If not provided, the\n // trash status will not be updated.\n in_trash?: boolean\n /** @deprecated Use `in_trash` instead. */\n archived?: boolean\n // The parent of the data source, when moving it to a different database. If not\n // provided, the parent will not be updated.\n parent?: ParentOfDataSourceRequest\n}\n\nexport type UpdateDataSourceParameters = UpdateDataSourcePathParameters &\n UpdateDataSourceBodyParameters\n\nexport type UpdateDataSourceResponse =\n | PartialDataSourceObjectResponse\n | DataSourceObjectResponse\n\n/**\n * Update a data source\n */\nexport const updateDataSource = {\n method: \"patch\",\n pathParams: [\"data_source_id\"],\n queryParams: [],\n bodyParams: [\"archived\", \"title\", \"icon\", \"properties\", \"in_trash\", \"parent\"],\n\n path: (p: UpdateDataSourcePathParameters): string =>\n `data_sources/${p.data_source_id}`,\n} as const\n\ntype QueryDataSourcePathParameters = {\n data_source_id: IdRequest\n}\n\ntype QueryDataSourceQueryParameters = {\n filter_properties?: Array<string>\n}\n\ntype QueryDataSourceBodyParameters = {\n sorts?: Array<\n | { property: string; direction: \"ascending\" | \"descending\" }\n | {\n timestamp: \"created_time\" | \"last_edited_time\"\n direction: \"ascending\" | \"descending\"\n }\n >\n filter?:\n | { or: GroupFilterOperatorArray }\n | { and: GroupFilterOperatorArray }\n | PropertyFilter\n | TimestampFilter\n start_cursor?: string | null\n page_size?: number\n in_trash?: boolean\n /** @deprecated Use `in_trash` instead. */\n archived?: boolean\n // Optionally filter the results to only include pages or data sources. Regular, non-wiki\n // databases only support page children. The default behavior is no result type\n // filtering, in other words, returning both pages and data sources for wikis.\n result_type?: \"page\" | \"data_source\"\n}\n\nexport type QueryDataSourceParameters = QueryDataSourcePathParameters &\n QueryDataSourceQueryParameters &\n QueryDataSourceBodyParameters\n\nexport type QueryDataSourceResponse = {\n type: \"page_or_data_source\"\n page_or_data_source: EmptyObject\n object: \"list\"\n next_cursor: string | null\n has_more: boolean\n results: Array<\n | PageObjectResponse\n | PartialPageObjectResponse\n | PartialDataSourceObjectResponse\n | DataSourceObjectResponse\n >\n request_status?: {\n type: \"complete\" | \"incomplete\"\n incomplete_reason?: \"query_result_limit_reached\"\n }\n}\n\n/**\n * Query a data source\n */\nexport const queryDataSource = {\n method: \"post\",\n pathParams: [\"data_source_id\"],\n queryParams: [\"filter_properties\"],\n bodyParams: [\n \"archived\",\n \"sorts\",\n \"filter\",\n \"start_cursor\",\n \"page_size\",\n \"in_trash\",\n \"result_type\",\n ],\n\n path: (p: QueryDataSourcePathParameters): string =>\n `data_sources/${p.data_source_id}/query`,\n} as const\n\ntype CreateDataSourceBodyParameters = {\n // An object specifying the parent of the new data source to be created.\n parent: ParentOfDataSourceRequest\n // Property schema of data source.\n properties: Record<string, PropertyConfigurationRequest>\n // Title of data source as it appears in Notion.\n title?: Array<RichTextItemRequest>\n // Page icon.\n icon?: PageIconRequest | null\n}\n\nexport type CreateDataSourceParameters = CreateDataSourceBodyParameters\n\nexport type CreateDataSourceResponse =\n | PartialDataSourceObjectResponse\n | DataSourceObjectResponse\n\n/**\n * Create a data source\n */\nexport const createDataSource = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [\"parent\", \"properties\", \"title\", \"icon\"],\n\n path: (): string => `data_sources`,\n} as const\n\ntype ListDataSourceTemplatesPathParameters = {\n // ID of a Notion data source.\n data_source_id: IdRequest\n}\n\ntype ListDataSourceTemplatesQueryParameters = {\n // Filter templates by name (case-insensitive substring match).\n name?: string\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 | null\n // The number of items from the full list desired in the response. Maximum: 100\n page_size?: number\n}\n\nexport type ListDataSourceTemplatesParameters =\n ListDataSourceTemplatesPathParameters & ListDataSourceTemplatesQueryParameters\n\nexport type ListDataSourceTemplatesResponse = {\n // Array of templates available in this data source.\n templates: Array<{\n // ID of the template page.\n id: IdResponse\n // Name of the template.\n name: string\n // Whether this template is the default template for the data source.\n is_default: boolean\n }>\n // Whether there are more templates available beyond this page.\n has_more: boolean\n // Cursor to use for the next page of results. Null if there are no more results.\n next_cursor: IdResponse | null\n}\n\n/**\n * List templates in a data source\n */\nexport const listDataSourceTemplates = {\n method: \"get\",\n pathParams: [\"data_source_id\"],\n queryParams: [\"name\", \"start_cursor\", \"page_size\"],\n bodyParams: [],\n\n path: (p: ListDataSourceTemplatesPathParameters): string =>\n `data_sources/${p.data_source_id}/templates`,\n} as const\n"]}
@@ -1,7 +1,7 @@
1
1
  import { BlockObjectResponse, CommentObjectResponse, DatabaseObjectResponse, DataSourceObjectResponse, DataSourceViewObjectResponse, EquationRichTextItemResponse, GroupFilterOperatorArray, ListDataSourceTemplatesResponse, MentionRichTextItemResponse, PageObjectResponse, PartialBlockObjectResponse, PartialCommentObjectResponse, PartialDatabaseObjectResponse, PartialDataSourceObjectResponse, PartialDataSourceViewObjectResponse, PartialPageObjectResponse, PartialUserObjectResponse, PropertyFilter, QueryDataSourceParameters, QueryDataSourceResponse, RichTextItemResponse, RichTextItemResponseCommon, TextRichTextItemResponse, TimestampFilter, UserObjectResponse } from "./api-endpoints";
2
2
  import type Client from "./Client";
3
3
  type PaginatedArgs = {
4
- start_cursor?: string;
4
+ start_cursor?: string | null;
5
5
  };
6
6
  type PaginatedList<T> = {
7
7
  object: "list";
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,+BAA+B,EAC/B,mCAAmC,EACnC,yBAAyB,EACzB,yBAAyB,EACzB,cAAc,EACd,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EACnB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAElC,KAAK,aAAa,GAAG;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,KAAK,aAAa,CAAC,CAAC,IAAI;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,CAAC,EAAE,CAAA;IACZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAuB,mBAAmB,CAAC,IAAI,SAAS,aAAa,EAAE,IAAI,EACzE,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KA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;IAC3C,OAAO,eAAe,CAAC,OAAO,CAAC,CAAA;AACjC,CAAC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAAC,YAAoB;IACjD,IAAI,CAAC,YAAY,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QACtD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,mEAAmE;IACnE,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAA;IACpE,IAAI,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;IAClC,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import {\n BlockObjectResponse,\n CommentObjectResponse,\n DatabaseObjectResponse,\n DataSourceObjectResponse,\n DataSourceViewObjectResponse,\n EquationRichTextItemResponse,\n GroupFilterOperatorArray,\n ListDataSourceTemplatesResponse,\n MentionRichTextItemResponse,\n PageObjectResponse,\n PartialBlockObjectResponse,\n PartialCommentObjectResponse,\n PartialDatabaseObjectResponse,\n PartialDataSourceObjectResponse,\n PartialDataSourceViewObjectResponse,\n PartialPageObjectResponse,\n PartialUserObjectResponse,\n PropertyFilter,\n QueryDataSourceParameters,\n QueryDataSourceResponse,\n RichTextItemResponse,\n RichTextItemResponseCommon,\n TextRichTextItemResponse,\n TimestampFilter,\n UserObjectResponse,\n} from \"./api-endpoints\"\nimport type Client from \"./Client\"\n\ntype PaginatedArgs = {\n start_cursor?: string\n}\n\ntype PaginatedList<T> = {\n object: \"list\"\n results: T[]\n next_cursor: string | null\n has_more: boolean\n}\n\n/**\n * Returns an async iterator over the results of any paginated Notion API.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * for await (const block of iteratePaginatedAPI(notion.blocks.children.list, {\n * block_id: parentBlockId,\n * })) {\n * // Do something with block.\n * }\n * ```\n *\n * @param listFn A bound function on the Notion client that represents a conforming paginated\n * API. Example: `notion.blocks.children.list`.\n * @param firstPageArgs Arguments that should be passed to the API on the first and subsequent\n * calls to the API. Any necessary `next_cursor` will be automatically populated by\n * this function. Example: `{ block_id: \"<my block id>\" }`\n */\nexport async function* iteratePaginatedAPI<Args extends PaginatedArgs, Item>(\n listFn: (args: Args) => Promise<PaginatedList<Item>>,\n firstPageArgs: Args\n): AsyncIterableIterator<Item> {\n let nextCursor: string | null | undefined = firstPageArgs.start_cursor\n do {\n const response: PaginatedList<Item> = await listFn({\n ...firstPageArgs,\n start_cursor: nextCursor,\n })\n yield* response.results\n nextCursor = response.next_cursor\n } while (nextCursor)\n}\n\n/**\n * Collect all of the results of paginating an API into an in-memory array.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * const blocks = await collectPaginatedAPI(notion.blocks.children.list, {\n * block_id: parentBlockId,\n * })\n * // Do something with blocks.\n * ```\n *\n * @param listFn A bound function on the Notion client that represents a conforming paginated\n * API. Example: `notion.blocks.children.list`.\n * @param firstPageArgs Arguments that should be passed to the API on the first and subsequent\n * calls to the API. Any necessary `next_cursor` will be automatically populated by\n * this function. Example: `{ block_id: \"<my block id>\" }`\n */\nexport async function collectPaginatedAPI<Args extends PaginatedArgs, Item>(\n listFn: (args: Args) => Promise<PaginatedList<Item>>,\n firstPageArgs: Args\n): Promise<Item[]> {\n const results: Item[] = []\n for await (const item of iteratePaginatedAPI(listFn, firstPageArgs)) {\n results.push(item)\n }\n return results\n}\n\ntype DataSourceTemplate = ListDataSourceTemplatesResponse[\"templates\"][number]\n\ntype ListDataSourceTemplatesArgs = PaginatedArgs & {\n data_source_id: string\n name?: string\n page_size?: number\n}\n\n/**\n * Returns an async iterator over data source templates.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * for await (const template of iterateDataSourceTemplates(notion, {\n * data_source_id: dataSourceId,\n * })) {\n * console.log(template.name, template.is_default)\n * }\n * ```\n *\n * @param client A Notion client instance.\n * @param args Arguments including the data_source_id and optional start_cursor.\n */\nexport async function* iterateDataSourceTemplates(\n client: Client,\n args: ListDataSourceTemplatesArgs\n): AsyncIterableIterator<DataSourceTemplate> {\n let nextCursor: string | null | undefined = args.start_cursor\n do {\n const response: ListDataSourceTemplatesResponse =\n await client.dataSources.listTemplates({\n ...args,\n start_cursor: nextCursor,\n })\n yield* response.templates\n nextCursor = response.next_cursor\n } while (nextCursor)\n}\n\n/**\n * Collect all data source templates into an in-memory array.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * const templates = await collectDataSourceTemplates(notion, {\n * data_source_id: dataSourceId,\n * })\n * // Do something with templates.\n * ```\n *\n * @param client A Notion client instance.\n * @param args Arguments including the data_source_id and optional start_cursor.\n */\nexport async function collectDataSourceTemplates(\n client: Client,\n args: ListDataSourceTemplatesArgs\n): Promise<DataSourceTemplate[]> {\n const results: DataSourceTemplate[] = []\n for await (const template of iterateDataSourceTemplates(client, args)) {\n results.push(template)\n }\n return results\n}\n\ntype DataSourceRow = QueryDataSourceResponse[\"results\"][number]\n\n/**\n * A filter the full-query helpers can combine with a created_time window bound.\n *\n * A top-level `or` filter is intentionally excluded: the helpers add a\n * created_time lower bound with `and`, and Notion only supports two levels of\n * filter nesting, so an `or` at the root leaves no room for the bound. Express\n * such queries as an `and` group, or run the helper once per `or` branch and\n * merge the results.\n */\nexport type FullDataSourceQueryFilter =\n | PropertyFilter\n | TimestampFilter\n | { and: GroupFilterOperatorArray }\n\n/**\n * Arguments for the full-query helpers. The same as `dataSources.query`, minus\n * the fields the helper controls: `start_cursor` (pagination is automatic) and\n * `sorts` (the helper sorts by created_time to partition). `filter` is narrowed\n * to {@link FullDataSourceQueryFilter}.\n */\nexport type FullDataSourceQueryArgs = Omit<\n QueryDataSourceParameters,\n \"start_cursor\" | \"sorts\" | \"filter\"\n> & {\n filter?: FullDataSourceQueryFilter\n}\n\n/**\n * Iterate over every row of a data source, including rows past the per-query\n * result limit that `dataSources.query` enforces on large data sources.\n *\n * A single query (one filter and sort) returns at most a fixed number of rows\n * (10,000 by default). Once that limit is reached, `has_more` becomes `false`\n * and the response carries `request_status.type === \"incomplete\"`. Plain\n * pagination such as {@link iteratePaginatedAPI} stops there and silently\n * misses the rest of the data source.\n *\n * This helper works around the limit by partitioning the data source into\n * created_time windows. It sorts by created_time ascending; whenever a window\n * reaches the limit, it starts a fresh query from the last row's created_time.\n * Each fresh query has a different filter, so it gets its own result budget.\n * Rows that share a boundary timestamp are de-duplicated by id, so every row is\n * yielded exactly once.\n *\n * created_time is used because it never changes. last_edited_time would shift\n * rows between windows as they are edited, causing gaps or duplicates.\n *\n * Throws if a single created_time value holds more rows than the limit, since\n * the window cannot be narrowed by time alone. Add a filter in that case so\n * each window stays under the limit.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * for await (const row of iterateAllDataSourceRows(notion, {\n * data_source_id: dataSourceId,\n * })) {\n * // Do something with row.\n * }\n * ```\n *\n * @param client A Notion client instance.\n * @param args Query arguments. `start_cursor` and `sorts` are managed by the\n * helper; `filter` is combined with the created_time window bound.\n */\nexport async function* iterateAllDataSourceRows(\n client: Client,\n args: FullDataSourceQueryArgs\n): AsyncIterableIterator<DataSourceRow> {\n const seenRowIds = new Set<string>()\n let windowStart: string | undefined = undefined\n\n for (;;) {\n let limitReached = false\n let lastCreatedTime: string | undefined = undefined\n let cursor: string | undefined = undefined\n\n do {\n const response = await client.dataSources.query({\n ...args,\n sorts: [{ timestamp: \"created_time\", direction: \"ascending\" }],\n filter: createdTimeLowerBound(args.filter, windowStart),\n start_cursor: cursor,\n })\n for (const row of response.results) {\n // Wiki data sources can return child data-source rows alongside pages.\n // Both carry created_time and either can be the window's boundary row,\n // so advance on either; reading only pages would stall a window made up\n // of data-source rows and throw spuriously.\n if (isFullPageOrDataSource(row)) {\n lastCreatedTime = row.created_time\n }\n if (!seenRowIds.has(row.id)) {\n seenRowIds.add(row.id)\n yield row\n }\n }\n if (response.request_status?.type === \"incomplete\") {\n limitReached = true\n }\n cursor = response.next_cursor ?? undefined\n } while (cursor)\n\n if (!limitReached) {\n return\n }\n if (lastCreatedTime === undefined || lastCreatedTime === windowStart) {\n throw new Error(\n \"iterateAllDataSourceRows cannot make progress: the per-query result \" +\n \"limit was reached but the created_time window could not advance \" +\n `past ${String(lastCreatedTime)}. More rows share this timestamp ` +\n \"than the limit allows. Add a filter to narrow the query.\"\n )\n }\n windowStart = lastCreatedTime\n }\n}\n\n/**\n * Collect every row of a data source into an in-memory array, including rows\n * past the per-query result limit. See {@link iterateAllDataSourceRows} for how\n * the limit is handled.\n *\n * Before using this, check that the full data source fits in memory. For very\n * large data sources, prefer {@link iterateAllDataSourceRows} and process rows\n * as they stream.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * const rows = await collectAllDataSourceRows(notion, {\n * data_source_id: dataSourceId,\n * })\n * // Do something with rows.\n * ```\n *\n * @param client A Notion client instance.\n * @param args Query arguments. See {@link iterateAllDataSourceRows}.\n */\nexport async function collectAllDataSourceRows(\n client: Client,\n args: FullDataSourceQueryArgs\n): Promise<DataSourceRow[]> {\n const rows: DataSourceRow[] = []\n for await (const row of iterateAllDataSourceRows(client, args)) {\n rows.push(row)\n }\n return rows\n}\n\n/**\n * Combine a caller-provided filter with the created_time lower bound used to\n * advance the partition window. Returns the filter unchanged for the first\n * window, which has no bound yet.\n */\nfunction createdTimeLowerBound(\n filter: FullDataSourceQueryFilter | undefined,\n windowStart: string | undefined\n): FullDataSourceQueryFilter | undefined {\n if (windowStart === undefined) {\n return filter\n }\n const bound: TimestampFilter = {\n timestamp: \"created_time\",\n created_time: { on_or_after: windowStart },\n }\n if (filter === undefined) {\n return bound\n }\n if (\"and\" in filter) {\n return { and: [...filter.and, bound] }\n }\n return { and: [filter, bound] }\n}\n\ntype ObjectResponse =\n | PageObjectResponse\n | PartialPageObjectResponse\n | DataSourceObjectResponse\n | PartialDataSourceObjectResponse\n | DatabaseObjectResponse\n | PartialDatabaseObjectResponse\n | BlockObjectResponse\n | PartialBlockObjectResponse\n\n/**\n * @returns `true` if `response` is a full `BlockObjectResponse`.\n */\nexport function isFullBlock(\n response: ObjectResponse\n): response is BlockObjectResponse {\n return response.object === \"block\" && \"type\" in response\n}\n\n/**\n * @returns `true` if `response` is a full `PageObjectResponse`.\n */\nexport function isFullPage(\n response: ObjectResponse\n): response is PageObjectResponse {\n return response.object === \"page\" && \"url\" in response\n}\n\n/**\n * @returns `true` if `response` is a full `DataSourceObjectResponse`.\n */\nexport function isFullDataSource(\n response: ObjectResponse\n): response is DataSourceObjectResponse {\n return response.object === \"data_source\"\n}\n\n/**\n * @returns `true` if `response` is a full `DatabaseObjectResponse`.\n */\nexport function isFullDatabase(\n response: ObjectResponse\n): response is DatabaseObjectResponse {\n return response.object === \"database\"\n}\n\n/**\n * @returns `true` if `response` is a full `DataSourceObjectResponse` or a full\n * `PageObjectResponse`.\n *\n * Can be used on the results of the list response from `queryDataSource` or\n * `search` APIs.\n */\nexport function isFullPageOrDataSource(\n response: ObjectResponse\n): response is DataSourceObjectResponse | PageObjectResponse {\n if (response.object === \"data_source\") {\n return isFullDataSource(response)\n } else {\n return isFullPage(response)\n }\n}\n\n/**\n * @returns `true` if `response` is a full `UserObjectResponse`.\n */\nexport function isFullUser(\n response: UserObjectResponse | PartialUserObjectResponse\n): response is UserObjectResponse {\n return \"type\" in response\n}\n\n/**\n * @returns `true` if `response` is a full `CommentObjectResponse`.\n */\nexport function isFullComment(\n response: CommentObjectResponse | PartialCommentObjectResponse\n): response is CommentObjectResponse {\n return \"created_by\" in response\n}\n\n/**\n * @returns `true` if `response` is a full `DataSourceViewObjectResponse`.\n */\nexport function isFullView(\n response: DataSourceViewObjectResponse | PartialDataSourceViewObjectResponse\n): response is DataSourceViewObjectResponse {\n return \"type\" in response\n}\n\n/**\n * @returns `true` if `richText` is a `TextRichTextItemResponse`.\n */\nexport function isTextRichTextItemResponse(\n richText: RichTextItemResponse\n): richText is RichTextItemResponseCommon & TextRichTextItemResponse {\n return richText.type === \"text\"\n}\n\n/**\n * @returns `true` if `richText` is an `EquationRichTextItemResponse`.\n */\nexport function isEquationRichTextItemResponse(\n richText: RichTextItemResponse\n): richText is RichTextItemResponseCommon & EquationRichTextItemResponse {\n return richText.type === \"equation\"\n}\n\n/**\n * @returns `true` if `richText` is an `MentionRichTextItemResponse`.\n */\nexport function isMentionRichTextItemResponse(\n richText: RichTextItemResponse\n): richText is RichTextItemResponseCommon & MentionRichTextItemResponse {\n return richText.type === \"mention\"\n}\n\n/**\n * Extracts a Notion ID from a Notion URL or returns the input if it's already a valid ID.\n *\n * Prioritizes path IDs over query parameters to avoid extracting view IDs instead of database IDs.\n *\n * @param urlOrId A Notion URL or ID string\n * @returns The extracted UUID in standard format (with hyphens) or null if invalid\n *\n * @example\n * ```typescript\n * // Database URL with view ID - extracts database ID, not view ID\n * extractNotionId('https://notion.so/workspace/DB-abc123def456789012345678901234ab?v=viewid123')\n * // Returns: 'abc123de-f456-7890-1234-5678901234ab' (database ID)\n *\n * // Already formatted UUID\n * extractNotionId('12345678-1234-1234-1234-123456789abc')\n * // Returns: '12345678-1234-1234-1234-123456789abc'\n * ```\n */\nexport function extractNotionId(urlOrId: string): string | null {\n if (!urlOrId || typeof urlOrId !== \"string\") {\n return null\n }\n\n const trimmed = urlOrId.trim()\n\n // Check if it's already a properly formatted UUID\n const uuidRegex =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i\n if (uuidRegex.test(trimmed)) {\n return trimmed.toLowerCase()\n }\n\n // Check if it's a compact UUID (32 chars, no hyphens)\n const compactUuidRegex = /^[0-9a-f]{32}$/i\n if (compactUuidRegex.test(trimmed)) {\n return formatUuid(trimmed)\n }\n\n // Extract from URL - prioritize path over query parameters\n // This prevents extracting view IDs when database IDs are in the path\n const pathMatch = trimmed.match(/\\/[^/?#]*-([0-9a-f]{32})(?:[/?#]|$)/i)\n if (pathMatch && pathMatch[1]) {\n return formatUuid(pathMatch[1])\n }\n\n // Fallback to query parameters if no path ID found\n const queryMatch = trimmed.match(\n /[?&](?:p|page_id|database_id)=([0-9a-f]{32})/i\n )\n if (queryMatch && queryMatch[1]) {\n return formatUuid(queryMatch[1])\n }\n\n // Last resort: any 32-char hex string in the URL\n const anyMatch = trimmed.match(/([0-9a-f]{32})/i)\n if (anyMatch && anyMatch[1]) {\n return formatUuid(anyMatch[1])\n }\n\n return null\n}\n\n/**\n * Formats a 32-character hex string into a standard UUID format.\n * @param compactId 32-character hex string without hyphens\n * @returns UUID with hyphens in standard format\n */\nfunction formatUuid(compactId: string): string {\n const clean = compactId.toLowerCase()\n return `${clean.slice(0, 8)}-${clean.slice(8, 12)}-${clean.slice(\n 12,\n 16\n )}-${clean.slice(16, 20)}-${clean.slice(20, 32)}`\n}\n\n/**\n * Extracts a database ID from a Notion database URL.\n * Convenience wrapper around `extractNotionId`.\n */\nexport function extractDatabaseId(databaseUrl: string): string | null {\n return extractNotionId(databaseUrl)\n}\n\n/**\n * Extracts a page ID from a Notion page URL.\n * Convenience wrapper around `extractNotionId`.\n */\nexport function extractPageId(pageUrl: string): string | null {\n return extractNotionId(pageUrl)\n}\n\n/**\n * Extracts a block ID from a Notion URL with a block fragment.\n * Looks for #block-<id> or #<id> patterns.\n */\nexport function extractBlockId(urlWithBlock: string): string | null {\n if (!urlWithBlock || typeof urlWithBlock !== \"string\") {\n return null\n }\n\n // Look for block fragment in URL (#block-32chars or just #32chars)\n const blockMatch = urlWithBlock.match(/#(?:block-)?([0-9a-f]{32})/i)\n if (blockMatch && blockMatch[1]) {\n return formatUuid(blockMatch[1])\n }\n\n return null\n}\n"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":";;AA2DA,kDAaC;AAoBD,kDASC;AA0BD,gEAcC;AAiBD,gEASC;AAqED,4DAmDC;AAuBD,4DASC;AAwCD,kCAIC;AAKD,gCAIC;AAKD,4CAIC;AAKD,wCAIC;AASD,wDAQC;AAKD,gCAIC;AAKD,sCAIC;AAKD,gCAIC;AAKD,gE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,CAAC,6BAA6B,CAAC,CAAA;IACpE,IAAI,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;IAClC,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import {\n BlockObjectResponse,\n CommentObjectResponse,\n DatabaseObjectResponse,\n DataSourceObjectResponse,\n DataSourceViewObjectResponse,\n EquationRichTextItemResponse,\n GroupFilterOperatorArray,\n ListDataSourceTemplatesResponse,\n MentionRichTextItemResponse,\n PageObjectResponse,\n PartialBlockObjectResponse,\n PartialCommentObjectResponse,\n PartialDatabaseObjectResponse,\n PartialDataSourceObjectResponse,\n PartialDataSourceViewObjectResponse,\n PartialPageObjectResponse,\n PartialUserObjectResponse,\n PropertyFilter,\n QueryDataSourceParameters,\n QueryDataSourceResponse,\n RichTextItemResponse,\n RichTextItemResponseCommon,\n TextRichTextItemResponse,\n TimestampFilter,\n UserObjectResponse,\n} from \"./api-endpoints\"\nimport type Client from \"./Client\"\n\ntype PaginatedArgs = {\n start_cursor?: string | null\n}\n\ntype PaginatedList<T> = {\n object: \"list\"\n results: T[]\n next_cursor: string | null\n has_more: boolean\n}\n\n/**\n * Returns an async iterator over the results of any paginated Notion API.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * for await (const block of iteratePaginatedAPI(notion.blocks.children.list, {\n * block_id: parentBlockId,\n * })) {\n * // Do something with block.\n * }\n * ```\n *\n * @param listFn A bound function on the Notion client that represents a conforming paginated\n * API. Example: `notion.blocks.children.list`.\n * @param firstPageArgs Arguments that should be passed to the API on the first and subsequent\n * calls to the API. Any necessary `next_cursor` will be automatically populated by\n * this function. Example: `{ block_id: \"<my block id>\" }`\n */\nexport async function* iteratePaginatedAPI<Args extends PaginatedArgs, Item>(\n listFn: (args: Args) => Promise<PaginatedList<Item>>,\n firstPageArgs: Args\n): AsyncIterableIterator<Item> {\n let nextCursor: string | null | undefined = firstPageArgs.start_cursor\n do {\n const response: PaginatedList<Item> = await listFn({\n ...firstPageArgs,\n start_cursor: nextCursor,\n })\n yield* response.results\n nextCursor = response.next_cursor\n } while (nextCursor)\n}\n\n/**\n * Collect all of the results of paginating an API into an in-memory array.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * const blocks = await collectPaginatedAPI(notion.blocks.children.list, {\n * block_id: parentBlockId,\n * })\n * // Do something with blocks.\n * ```\n *\n * @param listFn A bound function on the Notion client that represents a conforming paginated\n * API. Example: `notion.blocks.children.list`.\n * @param firstPageArgs Arguments that should be passed to the API on the first and subsequent\n * calls to the API. Any necessary `next_cursor` will be automatically populated by\n * this function. Example: `{ block_id: \"<my block id>\" }`\n */\nexport async function collectPaginatedAPI<Args extends PaginatedArgs, Item>(\n listFn: (args: Args) => Promise<PaginatedList<Item>>,\n firstPageArgs: Args\n): Promise<Item[]> {\n const results: Item[] = []\n for await (const item of iteratePaginatedAPI(listFn, firstPageArgs)) {\n results.push(item)\n }\n return results\n}\n\ntype DataSourceTemplate = ListDataSourceTemplatesResponse[\"templates\"][number]\n\ntype ListDataSourceTemplatesArgs = PaginatedArgs & {\n data_source_id: string\n name?: string\n page_size?: number\n}\n\n/**\n * Returns an async iterator over data source templates.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * for await (const template of iterateDataSourceTemplates(notion, {\n * data_source_id: dataSourceId,\n * })) {\n * console.log(template.name, template.is_default)\n * }\n * ```\n *\n * @param client A Notion client instance.\n * @param args Arguments including the data_source_id and optional start_cursor.\n */\nexport async function* iterateDataSourceTemplates(\n client: Client,\n args: ListDataSourceTemplatesArgs\n): AsyncIterableIterator<DataSourceTemplate> {\n let nextCursor: string | null | undefined = args.start_cursor\n do {\n const response: ListDataSourceTemplatesResponse =\n await client.dataSources.listTemplates({\n ...args,\n start_cursor: nextCursor,\n })\n yield* response.templates\n nextCursor = response.next_cursor\n } while (nextCursor)\n}\n\n/**\n * Collect all data source templates into an in-memory array.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * const templates = await collectDataSourceTemplates(notion, {\n * data_source_id: dataSourceId,\n * })\n * // Do something with templates.\n * ```\n *\n * @param client A Notion client instance.\n * @param args Arguments including the data_source_id and optional start_cursor.\n */\nexport async function collectDataSourceTemplates(\n client: Client,\n args: ListDataSourceTemplatesArgs\n): Promise<DataSourceTemplate[]> {\n const results: DataSourceTemplate[] = []\n for await (const template of iterateDataSourceTemplates(client, args)) {\n results.push(template)\n }\n return results\n}\n\ntype DataSourceRow = QueryDataSourceResponse[\"results\"][number]\n\n/**\n * A filter the full-query helpers can combine with a created_time window bound.\n *\n * A top-level `or` filter is intentionally excluded: the helpers add a\n * created_time lower bound with `and`, and Notion only supports two levels of\n * filter nesting, so an `or` at the root leaves no room for the bound. Express\n * such queries as an `and` group, or run the helper once per `or` branch and\n * merge the results.\n */\nexport type FullDataSourceQueryFilter =\n | PropertyFilter\n | TimestampFilter\n | { and: GroupFilterOperatorArray }\n\n/**\n * Arguments for the full-query helpers. The same as `dataSources.query`, minus\n * the fields the helper controls: `start_cursor` (pagination is automatic) and\n * `sorts` (the helper sorts by created_time to partition). `filter` is narrowed\n * to {@link FullDataSourceQueryFilter}.\n */\nexport type FullDataSourceQueryArgs = Omit<\n QueryDataSourceParameters,\n \"start_cursor\" | \"sorts\" | \"filter\"\n> & {\n filter?: FullDataSourceQueryFilter\n}\n\n/**\n * Iterate over every row of a data source, including rows past the per-query\n * result limit that `dataSources.query` enforces on large data sources.\n *\n * A single query (one filter and sort) returns at most a fixed number of rows\n * (10,000 by default). Once that limit is reached, `has_more` becomes `false`\n * and the response carries `request_status.type === \"incomplete\"`. Plain\n * pagination such as {@link iteratePaginatedAPI} stops there and silently\n * misses the rest of the data source.\n *\n * This helper works around the limit by partitioning the data source into\n * created_time windows. It sorts by created_time ascending; whenever a window\n * reaches the limit, it starts a fresh query from the last row's created_time.\n * Each fresh query has a different filter, so it gets its own result budget.\n * Rows that share a boundary timestamp are de-duplicated by id, so every row is\n * yielded exactly once.\n *\n * created_time is used because it never changes. last_edited_time would shift\n * rows between windows as they are edited, causing gaps or duplicates.\n *\n * Throws if a single created_time value holds more rows than the limit, since\n * the window cannot be narrowed by time alone. Add a filter in that case so\n * each window stays under the limit.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * for await (const row of iterateAllDataSourceRows(notion, {\n * data_source_id: dataSourceId,\n * })) {\n * // Do something with row.\n * }\n * ```\n *\n * @param client A Notion client instance.\n * @param args Query arguments. `start_cursor` and `sorts` are managed by the\n * helper; `filter` is combined with the created_time window bound.\n */\nexport async function* iterateAllDataSourceRows(\n client: Client,\n args: FullDataSourceQueryArgs\n): AsyncIterableIterator<DataSourceRow> {\n const seenRowIds = new Set<string>()\n let windowStart: string | undefined = undefined\n\n for (;;) {\n let limitReached = false\n let lastCreatedTime: string | undefined = undefined\n let cursor: string | undefined = undefined\n\n do {\n const response = await client.dataSources.query({\n ...args,\n sorts: [{ timestamp: \"created_time\", direction: \"ascending\" }],\n filter: createdTimeLowerBound(args.filter, windowStart),\n start_cursor: cursor,\n })\n for (const row of response.results) {\n // Wiki data sources can return child data-source rows alongside pages.\n // Both carry created_time and either can be the window's boundary row,\n // so advance on either; reading only pages would stall a window made up\n // of data-source rows and throw spuriously.\n if (isFullPageOrDataSource(row)) {\n lastCreatedTime = row.created_time\n }\n if (!seenRowIds.has(row.id)) {\n seenRowIds.add(row.id)\n yield row\n }\n }\n if (response.request_status?.type === \"incomplete\") {\n limitReached = true\n }\n cursor = response.next_cursor ?? undefined\n } while (cursor)\n\n if (!limitReached) {\n return\n }\n if (lastCreatedTime === undefined || lastCreatedTime === windowStart) {\n throw new Error(\n \"iterateAllDataSourceRows cannot make progress: the per-query result \" +\n \"limit was reached but the created_time window could not advance \" +\n `past ${String(lastCreatedTime)}. More rows share this timestamp ` +\n \"than the limit allows. Add a filter to narrow the query.\"\n )\n }\n windowStart = lastCreatedTime\n }\n}\n\n/**\n * Collect every row of a data source into an in-memory array, including rows\n * past the per-query result limit. See {@link iterateAllDataSourceRows} for how\n * the limit is handled.\n *\n * Before using this, check that the full data source fits in memory. For very\n * large data sources, prefer {@link iterateAllDataSourceRows} and process rows\n * as they stream.\n *\n * Example (given a notion Client called `notion`):\n *\n * ```\n * const rows = await collectAllDataSourceRows(notion, {\n * data_source_id: dataSourceId,\n * })\n * // Do something with rows.\n * ```\n *\n * @param client A Notion client instance.\n * @param args Query arguments. See {@link iterateAllDataSourceRows}.\n */\nexport async function collectAllDataSourceRows(\n client: Client,\n args: FullDataSourceQueryArgs\n): Promise<DataSourceRow[]> {\n const rows: DataSourceRow[] = []\n for await (const row of iterateAllDataSourceRows(client, args)) {\n rows.push(row)\n }\n return rows\n}\n\n/**\n * Combine a caller-provided filter with the created_time lower bound used to\n * advance the partition window. Returns the filter unchanged for the first\n * window, which has no bound yet.\n */\nfunction createdTimeLowerBound(\n filter: FullDataSourceQueryFilter | undefined,\n windowStart: string | undefined\n): FullDataSourceQueryFilter | undefined {\n if (windowStart === undefined) {\n return filter\n }\n const bound: TimestampFilter = {\n timestamp: \"created_time\",\n created_time: { on_or_after: windowStart },\n }\n if (filter === undefined) {\n return bound\n }\n if (\"and\" in filter) {\n return { and: [...filter.and, bound] }\n }\n return { and: [filter, bound] }\n}\n\ntype ObjectResponse =\n | PageObjectResponse\n | PartialPageObjectResponse\n | DataSourceObjectResponse\n | PartialDataSourceObjectResponse\n | DatabaseObjectResponse\n | PartialDatabaseObjectResponse\n | BlockObjectResponse\n | PartialBlockObjectResponse\n\n/**\n * @returns `true` if `response` is a full `BlockObjectResponse`.\n */\nexport function isFullBlock(\n response: ObjectResponse\n): response is BlockObjectResponse {\n return response.object === \"block\" && \"type\" in response\n}\n\n/**\n * @returns `true` if `response` is a full `PageObjectResponse`.\n */\nexport function isFullPage(\n response: ObjectResponse\n): response is PageObjectResponse {\n return response.object === \"page\" && \"url\" in response\n}\n\n/**\n * @returns `true` if `response` is a full `DataSourceObjectResponse`.\n */\nexport function isFullDataSource(\n response: ObjectResponse\n): response is DataSourceObjectResponse {\n return response.object === \"data_source\"\n}\n\n/**\n * @returns `true` if `response` is a full `DatabaseObjectResponse`.\n */\nexport function isFullDatabase(\n response: ObjectResponse\n): response is DatabaseObjectResponse {\n return response.object === \"database\"\n}\n\n/**\n * @returns `true` if `response` is a full `DataSourceObjectResponse` or a full\n * `PageObjectResponse`.\n *\n * Can be used on the results of the list response from `queryDataSource` or\n * `search` APIs.\n */\nexport function isFullPageOrDataSource(\n response: ObjectResponse\n): response is DataSourceObjectResponse | PageObjectResponse {\n if (response.object === \"data_source\") {\n return isFullDataSource(response)\n } else {\n return isFullPage(response)\n }\n}\n\n/**\n * @returns `true` if `response` is a full `UserObjectResponse`.\n */\nexport function isFullUser(\n response: UserObjectResponse | PartialUserObjectResponse\n): response is UserObjectResponse {\n return \"type\" in response\n}\n\n/**\n * @returns `true` if `response` is a full `CommentObjectResponse`.\n */\nexport function isFullComment(\n response: CommentObjectResponse | PartialCommentObjectResponse\n): response is CommentObjectResponse {\n return \"created_by\" in response\n}\n\n/**\n * @returns `true` if `response` is a full `DataSourceViewObjectResponse`.\n */\nexport function isFullView(\n response: DataSourceViewObjectResponse | PartialDataSourceViewObjectResponse\n): response is DataSourceViewObjectResponse {\n return \"type\" in response\n}\n\n/**\n * @returns `true` if `richText` is a `TextRichTextItemResponse`.\n */\nexport function isTextRichTextItemResponse(\n richText: RichTextItemResponse\n): richText is RichTextItemResponseCommon & TextRichTextItemResponse {\n return richText.type === \"text\"\n}\n\n/**\n * @returns `true` if `richText` is an `EquationRichTextItemResponse`.\n */\nexport function isEquationRichTextItemResponse(\n richText: RichTextItemResponse\n): richText is RichTextItemResponseCommon & EquationRichTextItemResponse {\n return richText.type === \"equation\"\n}\n\n/**\n * @returns `true` if `richText` is an `MentionRichTextItemResponse`.\n */\nexport function isMentionRichTextItemResponse(\n richText: RichTextItemResponse\n): richText is RichTextItemResponseCommon & MentionRichTextItemResponse {\n return richText.type === \"mention\"\n}\n\n/**\n * Extracts a Notion ID from a Notion URL or returns the input if it's already a valid ID.\n *\n * Prioritizes path IDs over query parameters to avoid extracting view IDs instead of database IDs.\n *\n * @param urlOrId A Notion URL or ID string\n * @returns The extracted UUID in standard format (with hyphens) or null if invalid\n *\n * @example\n * ```typescript\n * // Database URL with view ID - extracts database ID, not view ID\n * extractNotionId('https://notion.so/workspace/DB-abc123def456789012345678901234ab?v=viewid123')\n * // Returns: 'abc123de-f456-7890-1234-5678901234ab' (database ID)\n *\n * // Already formatted UUID\n * extractNotionId('12345678-1234-1234-1234-123456789abc')\n * // Returns: '12345678-1234-1234-1234-123456789abc'\n * ```\n */\nexport function extractNotionId(urlOrId: string): string | null {\n if (!urlOrId || typeof urlOrId !== \"string\") {\n return null\n }\n\n const trimmed = urlOrId.trim()\n\n // Check if it's already a properly formatted UUID\n const uuidRegex =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i\n if (uuidRegex.test(trimmed)) {\n return trimmed.toLowerCase()\n }\n\n // Check if it's a compact UUID (32 chars, no hyphens)\n const compactUuidRegex = /^[0-9a-f]{32}$/i\n if (compactUuidRegex.test(trimmed)) {\n return formatUuid(trimmed)\n }\n\n // Extract from URL - prioritize path over query parameters\n // This prevents extracting view IDs when database IDs are in the path\n const pathMatch = trimmed.match(/\\/[^/?#]*-([0-9a-f]{32})(?:[/?#]|$)/i)\n if (pathMatch && pathMatch[1]) {\n return formatUuid(pathMatch[1])\n }\n\n // Fallback to query parameters if no path ID found\n const queryMatch = trimmed.match(\n /[?&](?:p|page_id|database_id)=([0-9a-f]{32})/i\n )\n if (queryMatch && queryMatch[1]) {\n return formatUuid(queryMatch[1])\n }\n\n // Last resort: any 32-char hex string in the URL\n const anyMatch = trimmed.match(/([0-9a-f]{32})/i)\n if (anyMatch && anyMatch[1]) {\n return formatUuid(anyMatch[1])\n }\n\n return null\n}\n\n/**\n * Formats a 32-character hex string into a standard UUID format.\n * @param compactId 32-character hex string without hyphens\n * @returns UUID with hyphens in standard format\n */\nfunction formatUuid(compactId: string): string {\n const clean = compactId.toLowerCase()\n return `${clean.slice(0, 8)}-${clean.slice(8, 12)}-${clean.slice(\n 12,\n 16\n )}-${clean.slice(16, 20)}-${clean.slice(20, 32)}`\n}\n\n/**\n * Extracts a database ID from a Notion database URL.\n * Convenience wrapper around `extractNotionId`.\n */\nexport function extractDatabaseId(databaseUrl: string): string | null {\n return extractNotionId(databaseUrl)\n}\n\n/**\n * Extracts a page ID from a Notion page URL.\n * Convenience wrapper around `extractNotionId`.\n */\nexport function extractPageId(pageUrl: string): string | null {\n return extractNotionId(pageUrl)\n}\n\n/**\n * Extracts a block ID from a Notion URL with a block fragment.\n * Looks for #block-<id> or #<id> patterns.\n */\nexport function extractBlockId(urlWithBlock: string): string | null {\n if (!urlWithBlock || typeof urlWithBlock !== \"string\") {\n return null\n }\n\n // Look for block fragment in URL (#block-32chars or just #32chars)\n const blockMatch = urlWithBlock.match(/#(?:block-)?([0-9a-f]{32})/i)\n if (blockMatch && blockMatch[1]) {\n return formatUuid(blockMatch[1])\n }\n\n return null\n}\n"]}
@@ -6,7 +6,9 @@
6
6
  *
7
7
  * @packageDocumentation
8
8
  */
9
- export type { AppendBlockChildrenParameters, AppendBlockChildrenResponse, AudioBlockObjectResponse, BlockObjectRequest, BlockObjectResponse, BookmarkBlockObjectResponse, BotUserObjectResponse, BreadcrumbBlockObjectResponse, BulletedListItemBlockObjectResponse, ButtonPropertyItemObjectResponse, CalloutBlockObjectResponse, CheckboxPropertyItemObjectResponse, ChildDatabaseBlockObjectResponse, ChildPageBlockObjectResponse, CodeBlockObjectResponse, ColumnBlockObjectResponse, ColumnListBlockObjectResponse, CommentObjectResponse, CompleteFileUploadParameters, CompleteFileUploadResponse, CreateCommentParameters, CreateCommentResponse, CreateDatabaseParameters, CreateDatabaseResponse, CreateDataSourceParameters, CreateDataSourceResponse, CreateViewParameters, CreateViewResponse, CreateViewQueryParameters, CreateViewQueryResponse, DashboardRowResponse, DashboardWidgetResponse, CreatedByPropertyItemObjectResponse, CreatedTimePropertyItemObjectResponse, CreateFileUploadParameters, CreateFileUploadResponse, CreatePageParameters, CreatePageResponse, DatabaseObjectResponse, DataSourceObjectResponse, DataSourceViewObjectResponse, DatePropertyItemObjectResponse, DeleteBlockParameters, DeleteBlockResponse, DeleteCommentParameters, DeleteCommentResponse, DeletedViewQueryResponse, DeleteViewParameters, DeleteViewResponse, DeleteViewQueryParameters, DeleteViewQueryResponse, DividerBlockObjectResponse, EmailPropertyItemObjectResponse, EmbedBlockObjectResponse, EquationBlockObjectResponse, EquationRichTextItemResponse, FileBlockObjectResponse, FilesPropertyItemObjectResponse, FileUploadObjectResponse, FormulaPropertyItemObjectResponse, GetAsyncTaskParameters, GetAsyncTaskResponse, GetBlockParameters, GetBlockResponse, GetCommentParameters, GetCommentResponse, GetDatabaseParameters, GetDatabaseResponse, GetDataSourceParameters, GetDataSourceResponse, GetFileUploadParameters, GetFileUploadResponse, GetPageParameters, GetPagePropertyParameters, GetPagePropertyResponse, GetPageResponse, GetSelfParameters, GetSelfResponse, GetUserParameters, GetUserResponse, GetViewParameters, GetViewResponse, GetViewQueryResultsParameters, GetViewQueryResultsResponse, GroupObjectResponse, Heading1BlockObjectResponse, Heading2BlockObjectResponse, Heading3BlockObjectResponse, ImageBlockObjectResponse, LastEditedByPropertyItemObjectResponse, LastEditedTimePropertyItemObjectResponse, LinkPreviewBlockObjectResponse, LinkToPageBlockObjectResponse, ListBlockChildrenParameters, ListBlockChildrenResponse, ListCommentsParameters, ListCommentsResponse, ListCustomEmojisParameters, ListCustomEmojisResponse, CustomEmojiResponse, ListDatabaseViewsParameters, ListDatabaseViewsResponse, ListFileUploadsParameters, ListFileUploadsResponse, ListUsersParameters, ListUsersResponse, MeetingNotesBlockObjectResponse, MentionRichTextItemResponse, MovePageParameters, MovePageResponse, MultiSelectPropertyItemObjectResponse, NumberedListItemBlockObjectResponse, NumberPropertyItemObjectResponse, OauthIntrospectParameters, OauthIntrospectResponse, OauthRevokeParameters, OauthRevokeResponse, OauthTokenParameters, OauthTokenResponse, PageObjectResponse, ParagraphBlockObjectResponse, PartialBlockObjectResponse, PartialCommentObjectResponse, PartialDatabaseObjectResponse, PartialDataSourceObjectResponse, PartialDataSourceViewObjectResponse, PartialPageObjectResponse, PartialUserObjectResponse, PdfBlockObjectResponse, PeoplePropertyItemObjectResponse, PersonUserObjectResponse, PhoneNumberPropertyItemObjectResponse, PropertyItemListResponse, PropertyItemObjectResponse, PublicApiAsyncTaskStatusResultJsonValue, QueryDataSourceParameters, QueryDataSourceResponse, QuoteBlockObjectResponse, RelationPropertyItemObjectResponse, RichTextItemResponse, RichTextPropertyItemObjectResponse, RollupPropertyItemObjectResponse, SearchParameters, SearchResponse, SelectPropertyItemObjectResponse, SendFileUploadParameters, SendFileUploadResponse, StatusPropertyItemObjectResponse, SyncedBlockBlockObjectResponse, TableBlockObjectResponse, TableOfContentsBlockObjectResponse, TableRowBlockObjectResponse, TemplateBlockObjectResponse, TextRichTextItemResponse, TitlePropertyItemObjectResponse, ToDoBlockObjectResponse, ToggleBlockObjectResponse, TranscriptionBlockObjectResponse, UniqueIdPropertyItemObjectResponse, UnsupportedBlockObjectResponse, UpdateBlockParameters, UpdateBlockResponse, UpdateCommentParameters, UpdateCommentResponse, UpdateDatabaseParameters, UpdateDatabaseResponse, UpdateDataSourceParameters, UpdateDataSourceResponse, UpdatePageParameters, UpdatePageResponse, UpdateViewParameters, UpdateViewResponse, UrlPropertyItemObjectResponse, UserObjectResponse, ViewQueryResponse, VerificationPropertyItemObjectResponse, VideoBlockObjectResponse, BaseWebhookPayload, CommentCreatedWebhookPayload, CommentDeletedWebhookPayload, CommentUpdatedWebhookPayload, DataSourceContentUpdatedWebhookPayload, DataSourceCreatedWebhookPayload, DataSourceDeletedWebhookPayload, DataSourceMovedWebhookPayload, DataSourceSchemaUpdatedWebhookPayload, DataSourceUndeletedWebhookPayload, DatabaseContentUpdatedWebhookPayload, DatabaseCreatedWebhookPayload, DatabaseDeletedWebhookPayload, DatabaseMovedWebhookPayload, DatabaseSchemaUpdatedWebhookPayload, DatabaseUndeletedWebhookPayload, FileUploadCompletedWebhookPayload, FileUploadCreatedWebhookPayload, FileUploadExpiredWebhookPayload, FileUploadUploadFailedWebhookPayload, PageContentUpdatedWebhookPayload, PageCreatedWebhookPayload, PageDeletedWebhookPayload, PageLockedWebhookPayload, PageMovedWebhookPayload, PagePropertiesUpdatedWebhookPayload, PageTranscriptionBlockTranscriptDeletedWebhookPayload, PageUndeletedWebhookPayload, PageUnlockedWebhookPayload, ViewCreatedWebhookPayload, ViewDeletedWebhookPayload, ViewUpdatedWebhookPayload, } from "./api-endpoints";
9
+ import type { RichTextItemResponseCommon } from "./api-endpoints";
10
+ export type { ApiColor, AppendBlockChildrenParameters, AppendBlockChildrenResponse, AudioBlockObjectResponse, BlockObjectRequest, BlockObjectResponse, BookmarkBlockObjectResponse, BotUserObjectResponse, BreadcrumbBlockObjectResponse, BulletedListItemBlockObjectResponse, ButtonPropertyItemObjectResponse, CalloutBlockObjectResponse, CheckboxPropertyItemObjectResponse, ChildDatabaseBlockObjectResponse, ChildPageBlockObjectResponse, CodeBlockObjectResponse, ColumnBlockObjectResponse, ColumnListBlockObjectResponse, CommentObjectResponse, CompleteFileUploadParameters, CompleteFileUploadResponse, CreateCommentParameters, CreateCommentResponse, CreateDatabaseParameters, CreateDatabaseResponse, CreateDataSourceParameters, CreateDataSourceResponse, CreateViewParameters, CreateViewResponse, CreateViewQueryParameters, CreateViewQueryResponse, DashboardRowResponse, DashboardWidgetResponse, CreatedByPropertyItemObjectResponse, CreatedTimePropertyItemObjectResponse, CreateFileUploadParameters, CreateFileUploadResponse, CreatePageParameters, CreatePageResponse, DatabaseObjectResponse, DataSourceObjectResponse, DataSourceViewObjectResponse, DatePropertyItemObjectResponse, DeleteBlockParameters, DeleteBlockResponse, DeleteCommentParameters, DeleteCommentResponse, DeletedViewQueryResponse, DeleteViewParameters, DeleteViewResponse, DeleteViewQueryParameters, DeleteViewQueryResponse, DividerBlockObjectResponse, EmailPropertyItemObjectResponse, EmbedBlockObjectResponse, EquationBlockObjectResponse, EquationRichTextItemResponse, FileBlockObjectResponse, FilesPropertyItemObjectResponse, FileUploadObjectResponse, FormulaPropertyItemObjectResponse, GetAsyncTaskParameters, GetAsyncTaskResponse, GetBlockParameters, GetBlockResponse, GetCommentParameters, GetCommentResponse, GetDatabaseParameters, GetDatabaseResponse, GetDataSourceParameters, GetDataSourceResponse, GetFileUploadParameters, GetFileUploadResponse, GetPageParameters, GetPagePropertyParameters, GetPagePropertyResponse, GetPageResponse, GetSelfParameters, GetSelfResponse, GetUserParameters, GetUserResponse, GetViewParameters, GetViewResponse, GetViewQueryResultsParameters, GetViewQueryResultsResponse, GroupObjectResponse, Heading1BlockObjectResponse, Heading2BlockObjectResponse, Heading3BlockObjectResponse, ImageBlockObjectResponse, LastEditedByPropertyItemObjectResponse, LastEditedTimePropertyItemObjectResponse, LinkPreviewBlockObjectResponse, LinkToPageBlockObjectResponse, ListBlockChildrenParameters, ListBlockChildrenResponse, ListCommentsParameters, ListCommentsResponse, ListCustomEmojisParameters, ListCustomEmojisResponse, CustomEmojiResponse, ListDatabaseViewsParameters, ListDatabaseViewsResponse, ListFileUploadsParameters, ListFileUploadsResponse, ListUsersParameters, ListUsersResponse, MeetingNotesBlockObjectResponse, MentionRichTextItemResponse, MovePageParameters, MovePageResponse, MultiSelectPropertyItemObjectResponse, NumberedListItemBlockObjectResponse, NumberPropertyItemObjectResponse, OauthIntrospectParameters, OauthIntrospectResponse, OauthRevokeParameters, OauthRevokeResponse, OauthTokenParameters, OauthTokenResponse, PageObjectResponse, ParagraphBlockObjectResponse, PartialBlockObjectResponse, PartialCommentObjectResponse, PartialDatabaseObjectResponse, PartialDataSourceObjectResponse, PartialDataSourceViewObjectResponse, PartialPageObjectResponse, PartialUserObjectResponse, PdfBlockObjectResponse, PeoplePropertyItemObjectResponse, PersonUserObjectResponse, PhoneNumberPropertyItemObjectResponse, PropertyItemListResponse, PropertyItemObjectResponse, PublicApiAsyncTaskStatusResultJsonValue, QueryDataSourceParameters, QueryDataSourceResponse, QuoteBlockObjectResponse, RelationPropertyItemObjectResponse, RichTextItemResponse, RichTextItemResponseCommon, RichTextPropertyItemObjectResponse, RollupPropertyItemObjectResponse, SearchParameters, SearchResponse, SelectPropertyItemObjectResponse, SendFileUploadParameters, SendFileUploadResponse, StatusPropertyItemObjectResponse, SyncedBlockBlockObjectResponse, TableBlockObjectResponse, TableOfContentsBlockObjectResponse, TableRowBlockObjectResponse, TemplateBlockObjectResponse, TextRichTextItemResponse, TitlePropertyItemObjectResponse, ToDoBlockObjectResponse, ToggleBlockObjectResponse, TranscriptionBlockObjectResponse, UniqueIdPropertyItemObjectResponse, UnsupportedBlockObjectResponse, UpdateBlockParameters, UpdateBlockResponse, UpdateCommentParameters, UpdateCommentResponse, UpdateDatabaseParameters, UpdateDatabaseResponse, UpdateDataSourceParameters, UpdateDataSourceResponse, UpdatePageParameters, UpdatePageResponse, UpdateViewParameters, UpdateViewResponse, UrlPropertyItemObjectResponse, UserObjectResponse, ViewQueryResponse, VerificationPropertyItemObjectResponse, VideoBlockObjectResponse, BaseWebhookPayload, CommentCreatedWebhookPayload, CommentDeletedWebhookPayload, CommentUpdatedWebhookPayload, DataSourceContentUpdatedWebhookPayload, DataSourceCreatedWebhookPayload, DataSourceDeletedWebhookPayload, DataSourceMovedWebhookPayload, DataSourceSchemaUpdatedWebhookPayload, DataSourceUndeletedWebhookPayload, DatabaseContentUpdatedWebhookPayload, DatabaseCreatedWebhookPayload, DatabaseDeletedWebhookPayload, DatabaseMovedWebhookPayload, DatabaseSchemaUpdatedWebhookPayload, DatabaseUndeletedWebhookPayload, FileUploadCompletedWebhookPayload, FileUploadCreatedWebhookPayload, FileUploadExpiredWebhookPayload, FileUploadUploadFailedWebhookPayload, PageContentUpdatedWebhookPayload, PageCreatedWebhookPayload, PageDeletedWebhookPayload, PageLockedWebhookPayload, PageMovedWebhookPayload, PagePropertiesUpdatedWebhookPayload, PageTranscriptionBlockTranscriptDeletedWebhookPayload, PageUndeletedWebhookPayload, PageUnlockedWebhookPayload, ViewCreatedWebhookPayload, ViewDeletedWebhookPayload, ViewUpdatedWebhookPayload, } from "./api-endpoints";
11
+ export type AnnotationResponse = RichTextItemResponseCommon["annotations"];
10
12
  export { default as Client } from "./Client";
11
13
  export { LogLevel, Logger } from "./logging";
12
14
  export { NotionErrorCode, APIErrorCode, ClientErrorCode, NotionClientError, APIResponseError, UnknownHTTPResponseError, RequestTimeoutError, InvalidPathParameterError, isNotionClientError, isHTTPResponseError, } from "./errors";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACV,6BAA6B,EAC7B,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,mCAAmC,EACnC,gCAAgC,EAChC,0BAA0B,EAC1B,kCAAkC,EAClC,gCAAgC,EAChC,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,6BAA6B,EAC7B,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,mCAAmC,EACnC,qCAAqC,EACrC,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,8BAA8B,EAC9B,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,oB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AAA;AAC1B,kHAAA,qBAAqB,OAAA;AAEvB,qCAmBkB;AAlBhB,8GAAA,mBAAmB,OAAA;AACnB,8GAAA,mBAAmB,OAAA;AACnB,qHAAA,0BAA0B,OAAA;AAC1B,qHAAA,0BAA0B,OAAA;AAC1B,mHAAA,wBAAwB,OAAA;AACxB,mHAAA,wBAAwB,OAAA;AACxB,sGAAA,WAAW,OAAA;AACX,2GAAA,gBAAgB,OAAA;AAChB,yGAAA,cAAc,OAAA;AACd,qGAAA,UAAU,OAAA;AACV,qGAAA,UAAU,OAAA;AACV,wGAAA,aAAa,OAAA;AACb,qGAAA,UAAU,OAAA;AACV,iHAAA,sBAAsB,OAAA;AACtB,0GAAA,eAAe,OAAA;AACf,4GAAA,iBAAiB,OAAA;AACjB,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AAMhB,uCAAuE;AAA9D,kHAAA,sBAAsB,OAAA;AAAE,8GAAA,kBAAkB,OAAA;AAWnD,iDAAkE;AAAzD,iIAAA,gCAAgC,OAAA","sourcesContent":["/**\n * index.ts\n *\n * This file is the entry point for the Notion SDK.\n * It exports the Client class and all the API endpoints.\n *\n * @packageDocumentation\n */\n\nexport type {\n AppendBlockChildrenParameters,\n AppendBlockChildrenResponse,\n AudioBlockObjectResponse,\n BlockObjectRequest,\n BlockObjectResponse,\n BookmarkBlockObjectResponse,\n BotUserObjectResponse,\n BreadcrumbBlockObjectResponse,\n BulletedListItemBlockObjectResponse,\n ButtonPropertyItemObjectResponse,\n CalloutBlockObjectResponse,\n CheckboxPropertyItemObjectResponse,\n ChildDatabaseBlockObjectResponse,\n ChildPageBlockObjectResponse,\n CodeBlockObjectResponse,\n ColumnBlockObjectResponse,\n ColumnListBlockObjectResponse,\n CommentObjectResponse,\n CompleteFileUploadParameters,\n CompleteFileUploadResponse,\n CreateCommentParameters,\n CreateCommentResponse,\n CreateDatabaseParameters,\n CreateDatabaseResponse,\n CreateDataSourceParameters,\n CreateDataSourceResponse,\n CreateViewParameters,\n CreateViewResponse,\n CreateViewQueryParameters,\n CreateViewQueryResponse,\n DashboardRowResponse,\n DashboardWidgetResponse,\n CreatedByPropertyItemObjectResponse,\n CreatedTimePropertyItemObjectResponse,\n CreateFileUploadParameters,\n CreateFileUploadResponse,\n CreatePageParameters,\n CreatePageResponse,\n DatabaseObjectResponse,\n DataSourceObjectResponse,\n DataSourceViewObjectResponse,\n DatePropertyItemObjectResponse,\n DeleteBlockParameters,\n DeleteBlockResponse,\n DeleteCommentParameters,\n DeleteCommentResponse,\n DeletedViewQueryResponse,\n DeleteViewParameters,\n DeleteViewResponse,\n DeleteViewQueryParameters,\n DeleteViewQueryResponse,\n DividerBlockObjectResponse,\n EmailPropertyItemObjectResponse,\n EmbedBlockObjectResponse,\n EquationBlockObjectResponse,\n EquationRichTextItemResponse,\n FileBlockObjectResponse,\n FilesPropertyItemObjectResponse,\n FileUploadObjectResponse,\n FormulaPropertyItemObjectResponse,\n GetAsyncTaskParameters,\n GetAsyncTaskResponse,\n GetBlockParameters,\n GetBlockResponse,\n GetCommentParameters,\n GetCommentResponse,\n GetDatabaseParameters,\n GetDatabaseResponse,\n GetDataSourceParameters,\n GetDataSourceResponse,\n GetFileUploadParameters,\n GetFileUploadResponse,\n GetPageParameters,\n GetPagePropertyParameters,\n GetPagePropertyResponse,\n GetPageResponse,\n GetSelfParameters,\n GetSelfResponse,\n GetUserParameters,\n GetUserResponse,\n GetViewParameters,\n GetViewResponse,\n GetViewQueryResultsParameters,\n GetViewQueryResultsResponse,\n GroupObjectResponse,\n Heading1BlockObjectResponse,\n Heading2BlockObjectResponse,\n Heading3BlockObjectResponse,\n ImageBlockObjectResponse,\n LastEditedByPropertyItemObjectResponse,\n LastEditedTimePropertyItemObjectResponse,\n LinkPreviewBlockObjectResponse,\n LinkToPageBlockObjectResponse,\n ListBlockChildrenParameters,\n ListBlockChildrenResponse,\n ListCommentsParameters,\n ListCommentsResponse,\n ListCustomEmojisParameters,\n ListCustomEmojisResponse,\n CustomEmojiResponse,\n ListDatabaseViewsParameters,\n ListDatabaseViewsResponse,\n ListFileUploadsParameters,\n ListFileUploadsResponse,\n ListUsersParameters,\n ListUsersResponse,\n MeetingNotesBlockObjectResponse,\n MentionRichTextItemResponse,\n MovePageParameters,\n MovePageResponse,\n MultiSelectPropertyItemObjectResponse,\n NumberedListItemBlockObjectResponse,\n NumberPropertyItemObjectResponse,\n OauthIntrospectParameters,\n OauthIntrospectResponse,\n OauthRevokeParameters,\n OauthRevokeResponse,\n OauthTokenParameters,\n OauthTokenResponse,\n PageObjectResponse,\n ParagraphBlockObjectResponse,\n PartialBlockObjectResponse,\n PartialCommentObjectResponse,\n PartialDatabaseObjectResponse,\n PartialDataSourceObjectResponse,\n PartialDataSourceViewObjectResponse,\n PartialPageObjectResponse,\n PartialUserObjectResponse,\n PdfBlockObjectResponse,\n PeoplePropertyItemObjectResponse,\n PersonUserObjectResponse,\n PhoneNumberPropertyItemObjectResponse,\n PropertyItemListResponse,\n PropertyItemObjectResponse,\n PublicApiAsyncTaskStatusResultJsonValue,\n QueryDataSourceParameters,\n QueryDataSourceResponse,\n QuoteBlockObjectResponse,\n RelationPropertyItemObjectResponse,\n RichTextItemResponse,\n RichTextPropertyItemObjectResponse,\n RollupPropertyItemObjectResponse,\n SearchParameters,\n SearchResponse,\n SelectPropertyItemObjectResponse,\n SendFileUploadParameters,\n SendFileUploadResponse,\n StatusPropertyItemObjectResponse,\n SyncedBlockBlockObjectResponse,\n TableBlockObjectResponse,\n TableOfContentsBlockObjectResponse,\n TableRowBlockObjectResponse,\n TemplateBlockObjectResponse,\n TextRichTextItemResponse,\n TitlePropertyItemObjectResponse,\n ToDoBlockObjectResponse,\n ToggleBlockObjectResponse,\n TranscriptionBlockObjectResponse,\n UniqueIdPropertyItemObjectResponse,\n UnsupportedBlockObjectResponse,\n UpdateBlockParameters,\n UpdateBlockResponse,\n UpdateCommentParameters,\n UpdateCommentResponse,\n UpdateDatabaseParameters,\n UpdateDatabaseResponse,\n UpdateDataSourceParameters,\n UpdateDataSourceResponse,\n UpdatePageParameters,\n UpdatePageResponse,\n UpdateViewParameters,\n UpdateViewResponse,\n UrlPropertyItemObjectResponse,\n UserObjectResponse,\n ViewQueryResponse,\n VerificationPropertyItemObjectResponse,\n VideoBlockObjectResponse,\n // Webhook payload types\n BaseWebhookPayload,\n CommentCreatedWebhookPayload,\n CommentDeletedWebhookPayload,\n CommentUpdatedWebhookPayload,\n DataSourceContentUpdatedWebhookPayload,\n DataSourceCreatedWebhookPayload,\n DataSourceDeletedWebhookPayload,\n DataSourceMovedWebhookPayload,\n DataSourceSchemaUpdatedWebhookPayload,\n DataSourceUndeletedWebhookPayload,\n DatabaseContentUpdatedWebhookPayload,\n DatabaseCreatedWebhookPayload,\n DatabaseDeletedWebhookPayload,\n DatabaseMovedWebhookPayload,\n DatabaseSchemaUpdatedWebhookPayload,\n DatabaseUndeletedWebhookPayload,\n FileUploadCompletedWebhookPayload,\n FileUploadCreatedWebhookPayload,\n FileUploadExpiredWebhookPayload,\n FileUploadUploadFailedWebhookPayload,\n PageContentUpdatedWebhookPayload,\n PageCreatedWebhookPayload,\n PageDeletedWebhookPayload,\n PageLockedWebhookPayload,\n PageMovedWebhookPayload,\n PagePropertiesUpdatedWebhookPayload,\n PageTranscriptionBlockTranscriptDeletedWebhookPayload,\n PageUndeletedWebhookPayload,\n PageUnlockedWebhookPayload,\n ViewCreatedWebhookPayload,\n ViewDeletedWebhookPayload,\n ViewUpdatedWebhookPayload,\n} from \"./api-endpoints\"\nexport { default as Client } from \"./Client\"\nexport { LogLevel, Logger } from \"./logging\"\nexport {\n // Error codes\n NotionErrorCode,\n APIErrorCode,\n ClientErrorCode,\n // Error types\n NotionClientError,\n APIResponseError,\n UnknownHTTPResponseError,\n RequestTimeoutError,\n InvalidPathParameterError,\n // Error helpers\n isNotionClientError,\n isHTTPResponseError,\n} from \"./errors\"\nexport type { RetryOptions } from \"./Client\"\nexport {\n DEFAULT_BASE_URL,\n DEFAULT_TIMEOUT_MS,\n DEFAULT_MAX_RETRIES,\n DEFAULT_INITIAL_RETRY_DELAY_MS,\n DEFAULT_MAX_RETRY_DELAY_MS,\n MIN_VIEW_COLUMN_WIDTH,\n} from \"./constants\"\nexport {\n collectPaginatedAPI,\n iteratePaginatedAPI,\n collectDataSourceTemplates,\n iterateDataSourceTemplates,\n iterateAllDataSourceRows,\n collectAllDataSourceRows,\n isFullBlock,\n isFullDataSource,\n isFullDatabase,\n isFullPage,\n isFullUser,\n isFullComment,\n isFullView,\n isFullPageOrDataSource,\n extractNotionId,\n extractDatabaseId,\n extractPageId,\n extractBlockId,\n} from \"./helpers\"\nexport type {\n FullDataSourceQueryArgs,\n FullDataSourceQueryFilter,\n} from \"./helpers\"\nexport { verifyWebhookSignature, signWebhookPayload } from \"./webhooks\"\nexport type { VerifyWebhookSignatureArgs } from \"./webhooks\"\nexport type { QueryMeetingNotesResponse } from \"./api-endpoints/meeting-notes\"\nexport type {\n QueryMeetingNotesParameters,\n MeetingNotesCombinatorFilter,\n MeetingNotesFilterNode,\n MeetingNotesPropertyFilter,\n MeetingNotesPropertyName,\n MeetingNotesSort,\n} from \"./meeting-notes\"\nexport { meetingNotesFilterableProperties } from \"./meeting-notes\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AA2NH,mCAA4C;AAAnC,gGAAA,OAAO,OAAU;AAC1B,qCAA4C;AAAnC,mGAAA,QAAQ,OAAA;AACjB,mCAciB;AAXf,sGAAA,YAAY,OAAA;AACZ,yGAAA,eAAe,OAAA;AAGf,0GAAA,gBAAgB,OAAA;AAChB,kHAAA,wBAAwB,OAAA;AACxB,6GAAA,mBAAmB,OAAA;AACnB,mHAAA,yBAAyB,OAAA;AACzB,gBAAgB;AAChB,6GAAA,mBAAmB,OAAA;AACnB,6GAAA,mBAAmB,OAAA;AAGrB,yCAOoB;AANlB,6GAAA,gBAAgB,OAAA;AAChB,+GAAA,kBAAkB,OAAA;AAClB,gHAAA,mBAAmB,OAAA;AACnB,2HAAA,8BAA8B,OAAA;AAC9B,uHAAA,0BAA0B,OAAA;AAC1B,kHAAA,qBAAqB,OAAA;AAEvB,qCAmBkB;AAlBhB,8GAAA,mBAAmB,OAAA;AACnB,8GAAA,mBAAmB,OAAA;AACnB,qHAAA,0BAA0B,OAAA;AAC1B,qHAAA,0BAA0B,OAAA;AAC1B,mHAAA,wBAAwB,OAAA;AACxB,mHAAA,wBAAwB,OAAA;AACxB,sGAAA,WAAW,OAAA;AACX,2GAAA,gBAAgB,OAAA;AAChB,yGAAA,cAAc,OAAA;AACd,qGAAA,UAAU,OAAA;AACV,qGAAA,UAAU,OAAA;AACV,wGAAA,aAAa,OAAA;AACb,qGAAA,UAAU,OAAA;AACV,iHAAA,sBAAsB,OAAA;AACtB,0GAAA,eAAe,OAAA;AACf,4GAAA,iBAAiB,OAAA;AACjB,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AAMhB,uCAAuE;AAA9D,kHAAA,sBAAsB,OAAA;AAAE,8GAAA,kBAAkB,OAAA;AAWnD,iDAAkE;AAAzD,iIAAA,gCAAgC,OAAA","sourcesContent":["/**\n * index.ts\n *\n * This file is the entry point for the Notion SDK.\n * It exports the Client class and all the API endpoints.\n *\n * @packageDocumentation\n */\n\nimport type { RichTextItemResponseCommon } from \"./api-endpoints\"\n\nexport type {\n ApiColor,\n AppendBlockChildrenParameters,\n AppendBlockChildrenResponse,\n AudioBlockObjectResponse,\n BlockObjectRequest,\n BlockObjectResponse,\n BookmarkBlockObjectResponse,\n BotUserObjectResponse,\n BreadcrumbBlockObjectResponse,\n BulletedListItemBlockObjectResponse,\n ButtonPropertyItemObjectResponse,\n CalloutBlockObjectResponse,\n CheckboxPropertyItemObjectResponse,\n ChildDatabaseBlockObjectResponse,\n ChildPageBlockObjectResponse,\n CodeBlockObjectResponse,\n ColumnBlockObjectResponse,\n ColumnListBlockObjectResponse,\n CommentObjectResponse,\n CompleteFileUploadParameters,\n CompleteFileUploadResponse,\n CreateCommentParameters,\n CreateCommentResponse,\n CreateDatabaseParameters,\n CreateDatabaseResponse,\n CreateDataSourceParameters,\n CreateDataSourceResponse,\n CreateViewParameters,\n CreateViewResponse,\n CreateViewQueryParameters,\n CreateViewQueryResponse,\n DashboardRowResponse,\n DashboardWidgetResponse,\n CreatedByPropertyItemObjectResponse,\n CreatedTimePropertyItemObjectResponse,\n CreateFileUploadParameters,\n CreateFileUploadResponse,\n CreatePageParameters,\n CreatePageResponse,\n DatabaseObjectResponse,\n DataSourceObjectResponse,\n DataSourceViewObjectResponse,\n DatePropertyItemObjectResponse,\n DeleteBlockParameters,\n DeleteBlockResponse,\n DeleteCommentParameters,\n DeleteCommentResponse,\n DeletedViewQueryResponse,\n DeleteViewParameters,\n DeleteViewResponse,\n DeleteViewQueryParameters,\n DeleteViewQueryResponse,\n DividerBlockObjectResponse,\n EmailPropertyItemObjectResponse,\n EmbedBlockObjectResponse,\n EquationBlockObjectResponse,\n EquationRichTextItemResponse,\n FileBlockObjectResponse,\n FilesPropertyItemObjectResponse,\n FileUploadObjectResponse,\n FormulaPropertyItemObjectResponse,\n GetAsyncTaskParameters,\n GetAsyncTaskResponse,\n GetBlockParameters,\n GetBlockResponse,\n GetCommentParameters,\n GetCommentResponse,\n GetDatabaseParameters,\n GetDatabaseResponse,\n GetDataSourceParameters,\n GetDataSourceResponse,\n GetFileUploadParameters,\n GetFileUploadResponse,\n GetPageParameters,\n GetPagePropertyParameters,\n GetPagePropertyResponse,\n GetPageResponse,\n GetSelfParameters,\n GetSelfResponse,\n GetUserParameters,\n GetUserResponse,\n GetViewParameters,\n GetViewResponse,\n GetViewQueryResultsParameters,\n GetViewQueryResultsResponse,\n GroupObjectResponse,\n Heading1BlockObjectResponse,\n Heading2BlockObjectResponse,\n Heading3BlockObjectResponse,\n ImageBlockObjectResponse,\n LastEditedByPropertyItemObjectResponse,\n LastEditedTimePropertyItemObjectResponse,\n LinkPreviewBlockObjectResponse,\n LinkToPageBlockObjectResponse,\n ListBlockChildrenParameters,\n ListBlockChildrenResponse,\n ListCommentsParameters,\n ListCommentsResponse,\n ListCustomEmojisParameters,\n ListCustomEmojisResponse,\n CustomEmojiResponse,\n ListDatabaseViewsParameters,\n ListDatabaseViewsResponse,\n ListFileUploadsParameters,\n ListFileUploadsResponse,\n ListUsersParameters,\n ListUsersResponse,\n MeetingNotesBlockObjectResponse,\n MentionRichTextItemResponse,\n MovePageParameters,\n MovePageResponse,\n MultiSelectPropertyItemObjectResponse,\n NumberedListItemBlockObjectResponse,\n NumberPropertyItemObjectResponse,\n OauthIntrospectParameters,\n OauthIntrospectResponse,\n OauthRevokeParameters,\n OauthRevokeResponse,\n OauthTokenParameters,\n OauthTokenResponse,\n PageObjectResponse,\n ParagraphBlockObjectResponse,\n PartialBlockObjectResponse,\n PartialCommentObjectResponse,\n PartialDatabaseObjectResponse,\n PartialDataSourceObjectResponse,\n PartialDataSourceViewObjectResponse,\n PartialPageObjectResponse,\n PartialUserObjectResponse,\n PdfBlockObjectResponse,\n PeoplePropertyItemObjectResponse,\n PersonUserObjectResponse,\n PhoneNumberPropertyItemObjectResponse,\n PropertyItemListResponse,\n PropertyItemObjectResponse,\n PublicApiAsyncTaskStatusResultJsonValue,\n QueryDataSourceParameters,\n QueryDataSourceResponse,\n QuoteBlockObjectResponse,\n RelationPropertyItemObjectResponse,\n RichTextItemResponse,\n RichTextItemResponseCommon,\n RichTextPropertyItemObjectResponse,\n RollupPropertyItemObjectResponse,\n SearchParameters,\n SearchResponse,\n SelectPropertyItemObjectResponse,\n SendFileUploadParameters,\n SendFileUploadResponse,\n StatusPropertyItemObjectResponse,\n SyncedBlockBlockObjectResponse,\n TableBlockObjectResponse,\n TableOfContentsBlockObjectResponse,\n TableRowBlockObjectResponse,\n TemplateBlockObjectResponse,\n TextRichTextItemResponse,\n TitlePropertyItemObjectResponse,\n ToDoBlockObjectResponse,\n ToggleBlockObjectResponse,\n TranscriptionBlockObjectResponse,\n UniqueIdPropertyItemObjectResponse,\n UnsupportedBlockObjectResponse,\n UpdateBlockParameters,\n UpdateBlockResponse,\n UpdateCommentParameters,\n UpdateCommentResponse,\n UpdateDatabaseParameters,\n UpdateDatabaseResponse,\n UpdateDataSourceParameters,\n UpdateDataSourceResponse,\n UpdatePageParameters,\n UpdatePageResponse,\n UpdateViewParameters,\n UpdateViewResponse,\n UrlPropertyItemObjectResponse,\n UserObjectResponse,\n ViewQueryResponse,\n VerificationPropertyItemObjectResponse,\n VideoBlockObjectResponse,\n // Webhook payload types\n BaseWebhookPayload,\n CommentCreatedWebhookPayload,\n CommentDeletedWebhookPayload,\n CommentUpdatedWebhookPayload,\n DataSourceContentUpdatedWebhookPayload,\n DataSourceCreatedWebhookPayload,\n DataSourceDeletedWebhookPayload,\n DataSourceMovedWebhookPayload,\n DataSourceSchemaUpdatedWebhookPayload,\n DataSourceUndeletedWebhookPayload,\n DatabaseContentUpdatedWebhookPayload,\n DatabaseCreatedWebhookPayload,\n DatabaseDeletedWebhookPayload,\n DatabaseMovedWebhookPayload,\n DatabaseSchemaUpdatedWebhookPayload,\n DatabaseUndeletedWebhookPayload,\n FileUploadCompletedWebhookPayload,\n FileUploadCreatedWebhookPayload,\n FileUploadExpiredWebhookPayload,\n FileUploadUploadFailedWebhookPayload,\n PageContentUpdatedWebhookPayload,\n PageCreatedWebhookPayload,\n PageDeletedWebhookPayload,\n PageLockedWebhookPayload,\n PageMovedWebhookPayload,\n PagePropertiesUpdatedWebhookPayload,\n PageTranscriptionBlockTranscriptDeletedWebhookPayload,\n PageUndeletedWebhookPayload,\n PageUnlockedWebhookPayload,\n ViewCreatedWebhookPayload,\n ViewDeletedWebhookPayload,\n ViewUpdatedWebhookPayload,\n} from \"./api-endpoints\"\nexport type AnnotationResponse = RichTextItemResponseCommon[\"annotations\"]\nexport { default as Client } from \"./Client\"\nexport { LogLevel, Logger } from \"./logging\"\nexport {\n // Error codes\n NotionErrorCode,\n APIErrorCode,\n ClientErrorCode,\n // Error types\n NotionClientError,\n APIResponseError,\n UnknownHTTPResponseError,\n RequestTimeoutError,\n InvalidPathParameterError,\n // Error helpers\n isNotionClientError,\n isHTTPResponseError,\n} from \"./errors\"\nexport type { RetryOptions } from \"./Client\"\nexport {\n DEFAULT_BASE_URL,\n DEFAULT_TIMEOUT_MS,\n DEFAULT_MAX_RETRIES,\n DEFAULT_INITIAL_RETRY_DELAY_MS,\n DEFAULT_MAX_RETRY_DELAY_MS,\n MIN_VIEW_COLUMN_WIDTH,\n} from \"./constants\"\nexport {\n collectPaginatedAPI,\n iteratePaginatedAPI,\n collectDataSourceTemplates,\n iterateDataSourceTemplates,\n iterateAllDataSourceRows,\n collectAllDataSourceRows,\n isFullBlock,\n isFullDataSource,\n isFullDatabase,\n isFullPage,\n isFullUser,\n isFullComment,\n isFullView,\n isFullPageOrDataSource,\n extractNotionId,\n extractDatabaseId,\n extractPageId,\n extractBlockId,\n} from \"./helpers\"\nexport type {\n FullDataSourceQueryArgs,\n FullDataSourceQueryFilter,\n} from \"./helpers\"\nexport { verifyWebhookSignature, signWebhookPayload } from \"./webhooks\"\nexport type { VerifyWebhookSignatureArgs } from \"./webhooks\"\nexport type { QueryMeetingNotesResponse } from \"./api-endpoints/meeting-notes\"\nexport type {\n QueryMeetingNotesParameters,\n MeetingNotesCombinatorFilter,\n MeetingNotesFilterNode,\n MeetingNotesPropertyFilter,\n MeetingNotesPropertyName,\n MeetingNotesSort,\n} from \"./meeting-notes\"\nexport { meetingNotesFilterableProperties } from \"./meeting-notes\"\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notionhq/client",
3
- "version": "5.23.0",
3
+ "version": "5.23.1",
4
4
  "description": "A simple and easy to use client for the Notion API",
5
5
  "engines": {
6
6
  "node": ">=18"