@haustle/notion-orm 0.0.44 → 0.0.45
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.
- package/README.md +449 -109
- package/build/src/agents-sdk-resolver.d.ts +8 -0
- package/build/src/agents-sdk-resolver.d.ts.map +1 -0
- package/build/src/agents-sdk-resolver.js +23 -0
- package/build/src/agents-sdk-resolver.js.map +1 -0
- package/build/src/ast/agents/agent-file-writer.d.ts +21 -0
- package/build/src/ast/agents/agent-file-writer.d.ts.map +1 -0
- package/build/src/ast/agents/agent-file-writer.js +99 -0
- package/build/src/ast/agents/agent-file-writer.js.map +1 -0
- package/build/src/ast/agents/generate-agents-cli.d.ts +24 -0
- package/build/src/ast/agents/generate-agents-cli.d.ts.map +1 -0
- package/build/src/ast/agents/generate-agents-cli.js +193 -0
- package/build/src/ast/agents/generate-agents-cli.js.map +1 -0
- package/build/src/ast/database/database-file-writer.d.ts +37 -0
- package/build/src/ast/database/database-file-writer.d.ts.map +1 -0
- package/build/src/ast/database/database-file-writer.js +240 -0
- package/build/src/ast/database/database-file-writer.js.map +1 -0
- package/build/src/ast/database/generate-databases-cli.d.ts +27 -0
- package/build/src/ast/database/generate-databases-cli.d.ts.map +1 -0
- package/build/src/ast/database/generate-databases-cli.js +141 -0
- package/build/src/ast/database/generate-databases-cli.js.map +1 -0
- package/build/src/ast/database/notion-column-generators.d.ts +180 -0
- package/build/src/ast/database/notion-column-generators.d.ts.map +1 -0
- package/build/src/ast/database/notion-column-generators.js +269 -0
- package/build/src/ast/database/notion-column-generators.js.map +1 -0
- package/build/src/ast/database/zod-schema.d.ts +17 -0
- package/build/src/ast/database/zod-schema.d.ts.map +1 -0
- package/build/src/ast/database/zod-schema.js +5 -0
- package/build/src/ast/database/zod-schema.js.map +1 -0
- package/build/src/ast/demo/datasource-fixture-builder.d.ts +38 -0
- package/build/src/ast/demo/datasource-fixture-builder.d.ts.map +1 -0
- package/build/src/ast/demo/datasource-fixture-builder.js +274 -0
- package/build/src/ast/demo/datasource-fixture-builder.js.map +1 -0
- package/build/src/ast/demo/demo-entry-builders.d.ts +28 -0
- package/build/src/ast/demo/demo-entry-builders.d.ts.map +1 -0
- package/build/src/ast/demo/demo-entry-builders.js +133 -0
- package/build/src/ast/demo/demo-entry-builders.js.map +1 -0
- package/build/src/ast/demo/demo-playground-spec.d.ts +51 -0
- package/build/src/ast/demo/demo-playground-spec.d.ts.map +1 -0
- package/build/src/ast/demo/demo-playground-spec.js +91 -0
- package/build/src/ast/demo/demo-playground-spec.js.map +1 -0
- package/build/src/ast/demo/demo-workspace-builder.d.ts +24 -0
- package/build/src/ast/demo/demo-workspace-builder.d.ts.map +1 -0
- package/build/src/ast/demo/demo-workspace-builder.js +90 -0
- package/build/src/ast/demo/demo-workspace-builder.js.map +1 -0
- package/build/src/ast/shared/ast-builders.d.ts +112 -0
- package/build/src/ast/shared/ast-builders.d.ts.map +1 -0
- package/build/src/ast/shared/ast-builders.js +181 -0
- package/build/src/ast/shared/ast-builders.js.map +1 -0
- package/build/src/ast/shared/cached-metadata.d.ts +26 -0
- package/build/src/ast/shared/cached-metadata.d.ts.map +1 -0
- package/build/src/ast/shared/cached-metadata.js +76 -0
- package/build/src/ast/shared/cached-metadata.js.map +1 -0
- package/build/src/ast/shared/codegen-diagnostics.d.ts +23 -0
- package/build/src/ast/shared/codegen-diagnostics.d.ts.map +1 -0
- package/build/src/ast/shared/codegen-diagnostics.js +13 -0
- package/build/src/ast/shared/codegen-diagnostics.js.map +1 -0
- package/build/src/ast/shared/codegen-environment.d.ts +37 -0
- package/build/src/ast/shared/codegen-environment.d.ts.map +1 -0
- package/build/src/ast/shared/codegen-environment.js +53 -0
- package/build/src/ast/shared/codegen-environment.js.map +1 -0
- package/build/src/ast/shared/constants.d.ts +98 -0
- package/build/src/ast/shared/constants.d.ts.map +1 -0
- package/build/src/ast/shared/constants.js +145 -0
- package/build/src/ast/shared/constants.js.map +1 -0
- package/build/src/ast/shared/emit/config-emitter.d.ts +56 -0
- package/build/src/ast/shared/emit/config-emitter.d.ts.map +1 -0
- package/build/src/ast/shared/emit/config-emitter.js +454 -0
- package/build/src/ast/shared/emit/config-emitter.js.map +1 -0
- package/build/src/ast/shared/emit/emit-value-as-expression.d.ts +10 -0
- package/build/src/ast/shared/emit/emit-value-as-expression.d.ts.map +1 -0
- package/build/src/ast/shared/emit/emit-value-as-expression.js +37 -0
- package/build/src/ast/shared/emit/emit-value-as-expression.js.map +1 -0
- package/build/src/ast/shared/emit/orm-index-emitter.d.ts +61 -0
- package/build/src/ast/shared/emit/orm-index-emitter.d.ts.map +1 -0
- package/build/src/ast/shared/emit/orm-index-emitter.js +376 -0
- package/build/src/ast/shared/emit/orm-index-emitter.js.map +1 -0
- package/build/src/ast/shared/emit/registry-emitter.d.ts +35 -0
- package/build/src/ast/shared/emit/registry-emitter.d.ts.map +1 -0
- package/build/src/ast/shared/emit/registry-emitter.js +39 -0
- package/build/src/ast/shared/emit/registry-emitter.js.map +1 -0
- package/build/src/ast/shared/emit/ts-emit-core.d.ts +79 -0
- package/build/src/ast/shared/emit/ts-emit-core.d.ts.map +1 -0
- package/build/src/ast/shared/emit/ts-emit-core.js +135 -0
- package/build/src/ast/shared/emit/ts-emit-core.js.map +1 -0
- package/build/src/ast/shared/emit/ts-emit-options.d.ts +29 -0
- package/build/src/ast/shared/emit/ts-emit-options.d.ts.map +1 -0
- package/build/src/ast/shared/emit/ts-emit-options.js +29 -0
- package/build/src/ast/shared/emit/ts-emit-options.js.map +1 -0
- package/build/src/base.d.ts +21 -0
- package/build/src/base.d.ts.map +1 -0
- package/build/src/base.js +19 -0
- package/build/src/base.js.map +1 -0
- package/build/src/cli/agents-sdk-setup.d.ts +2 -0
- package/build/src/cli/agents-sdk-setup.d.ts.map +1 -0
- package/build/src/cli/agents-sdk-setup.js +107 -0
- package/build/src/cli/agents-sdk-setup.js.map +1 -0
- package/build/src/cli/helpers.d.ts +14 -0
- package/build/src/cli/helpers.d.ts.map +1 -0
- package/build/src/cli/helpers.js +125 -0
- package/build/src/cli/helpers.js.map +1 -0
- package/build/src/cli/index.d.ts +3 -0
- package/build/src/cli/index.d.ts.map +1 -0
- package/build/src/cli/index.js +244 -0
- package/build/src/cli/index.js.map +1 -0
- package/build/src/cli/sync-progress-renderer.d.ts +20 -0
- package/build/src/cli/sync-progress-renderer.d.ts.map +1 -0
- package/build/src/cli/sync-progress-renderer.js +79 -0
- package/build/src/cli/sync-progress-renderer.js.map +1 -0
- package/build/src/cli/sync-progress.d.ts +55 -0
- package/build/src/cli/sync-progress.d.ts.map +1 -0
- package/build/src/cli/sync-progress.js +120 -0
- package/build/src/cli/sync-progress.js.map +1 -0
- package/build/src/cli/sync-report.d.ts +17 -0
- package/build/src/cli/sync-report.d.ts.map +1 -0
- package/build/src/cli/sync-report.js +86 -0
- package/build/src/cli/sync-report.js.map +1 -0
- package/build/src/client/agent/AgentClient.d.ts +84 -0
- package/build/src/client/agent/AgentClient.d.ts.map +1 -0
- package/build/src/client/agent/AgentClient.js +118 -0
- package/build/src/client/agent/AgentClient.js.map +1 -0
- package/build/src/client/database/DatabaseClient.d.ts +37 -0
- package/build/src/client/database/DatabaseClient.d.ts.map +1 -0
- package/build/src/client/database/DatabaseClient.js +328 -0
- package/build/src/client/database/DatabaseClient.js.map +1 -0
- package/build/src/client/database/create/build-create-page-parameters.d.ts +9 -0
- package/build/src/client/database/create/build-create-page-parameters.d.ts.map +1 -0
- package/build/src/client/database/create/build-create-page-parameters.js +13 -0
- package/build/src/client/database/create/build-create-page-parameters.js.map +1 -0
- package/build/src/client/database/create/index.d.ts +4 -0
- package/build/src/client/database/create/index.d.ts.map +1 -0
- package/build/src/client/database/create/index.js +4 -0
- package/build/src/client/database/create/index.js.map +1 -0
- package/build/src/client/database/create/map-to-notion-properties.d.ts +14 -0
- package/build/src/client/database/create/map-to-notion-properties.d.ts.map +1 -0
- package/build/src/client/database/create/map-to-notion-properties.js +31 -0
- package/build/src/client/database/create/map-to-notion-properties.js.map +1 -0
- package/build/src/client/database/create/property-value.d.ts +16 -0
- package/build/src/client/database/create/property-value.d.ts.map +1 -0
- package/build/src/client/database/create/property-value.js +213 -0
- package/build/src/client/database/create/property-value.js.map +1 -0
- package/build/src/client/database/query/build-query-params.d.ts +11 -0
- package/build/src/client/database/query/build-query-params.d.ts.map +1 -0
- package/build/src/client/database/query/build-query-params.js +24 -0
- package/build/src/client/database/query/build-query-params.js.map +1 -0
- package/build/src/client/database/query/build-query-response.d.ts +23 -0
- package/build/src/client/database/query/build-query-response.d.ts.map +1 -0
- package/build/src/client/database/query/build-query-response.js +41 -0
- package/build/src/client/database/query/build-query-response.js.map +1 -0
- package/build/src/client/database/query/filter/builders.d.ts +4 -0
- package/build/src/client/database/query/filter/builders.d.ts.map +1 -0
- package/build/src/client/database/query/filter/builders.js +141 -0
- package/build/src/client/database/query/filter/builders.js.map +1 -0
- package/build/src/client/database/query/filter/compound.d.ts +3 -0
- package/build/src/client/database/query/filter/compound.d.ts.map +1 -0
- package/build/src/client/database/query/filter/compound.js +13 -0
- package/build/src/client/database/query/filter/compound.js.map +1 -0
- package/build/src/client/database/query/filter/index.d.ts +3 -0
- package/build/src/client/database/query/filter/index.d.ts.map +1 -0
- package/build/src/client/database/query/filter/index.js +89 -0
- package/build/src/client/database/query/filter/index.js.map +1 -0
- package/build/src/client/database/query/http-guards.d.ts +2 -0
- package/build/src/client/database/query/http-guards.d.ts.map +1 -0
- package/build/src/client/database/query/http-guards.js +10 -0
- package/build/src/client/database/query/http-guards.js.map +1 -0
- package/build/src/client/database/query/index.d.ts +5 -0
- package/build/src/client/database/query/index.d.ts.map +1 -0
- package/build/src/client/database/query/index.js +5 -0
- package/build/src/client/database/query/index.js.map +1 -0
- package/build/src/client/database/query/normalize-page-result.d.ts +15 -0
- package/build/src/client/database/query/normalize-page-result.d.ts.map +1 -0
- package/build/src/client/database/query/normalize-page-result.js +35 -0
- package/build/src/client/database/query/normalize-page-result.js.map +1 -0
- package/build/src/client/database/query/page-collection.d.ts +42 -0
- package/build/src/client/database/query/page-collection.d.ts.map +1 -0
- package/build/src/client/database/query/page-collection.js +71 -0
- package/build/src/client/database/query/page-collection.js.map +1 -0
- package/build/src/client/database/query/projection.d.ts +9 -0
- package/build/src/client/database/query/projection.d.ts.map +1 -0
- package/build/src/client/database/query/projection.js +43 -0
- package/build/src/client/database/query/projection.js.map +1 -0
- package/build/src/client/database/query/response/checkbox.d.ts +3 -0
- package/build/src/client/database/query/response/checkbox.d.ts.map +1 -0
- package/build/src/client/database/query/response/checkbox.js +7 -0
- package/build/src/client/database/query/response/checkbox.js.map +1 -0
- package/build/src/client/database/query/response/created_by.d.ts +3 -0
- package/build/src/client/database/query/response/created_by.d.ts.map +1 -0
- package/build/src/client/database/query/response/created_by.js +8 -0
- package/build/src/client/database/query/response/created_by.js.map +1 -0
- package/build/src/client/database/query/response/created_time.d.ts +3 -0
- package/build/src/client/database/query/response/created_time.d.ts.map +1 -0
- package/build/src/client/database/query/response/created_time.js +7 -0
- package/build/src/client/database/query/response/created_time.js.map +1 -0
- package/build/src/client/database/query/response/date.d.ts +6 -0
- package/build/src/client/database/query/response/date.d.ts.map +1 -0
- package/build/src/client/database/query/response/date.js +13 -0
- package/build/src/client/database/query/response/date.js.map +1 -0
- package/build/src/client/database/query/response/email.d.ts +3 -0
- package/build/src/client/database/query/response/email.d.ts.map +1 -0
- package/build/src/client/database/query/response/email.js +7 -0
- package/build/src/client/database/query/response/email.js.map +1 -0
- package/build/src/client/database/query/response/files.d.ts +6 -0
- package/build/src/client/database/query/response/files.d.ts.map +1 -0
- package/build/src/client/database/query/response/files.js +8 -0
- package/build/src/client/database/query/response/files.js.map +1 -0
- package/build/src/client/database/query/response/index.d.ts +53 -0
- package/build/src/client/database/query/response/index.d.ts.map +1 -0
- package/build/src/client/database/query/response/index.js +44 -0
- package/build/src/client/database/query/response/index.js.map +1 -0
- package/build/src/client/database/query/response/last_edited_by.d.ts +3 -0
- package/build/src/client/database/query/response/last_edited_by.d.ts.map +1 -0
- package/build/src/client/database/query/response/last_edited_by.js +8 -0
- package/build/src/client/database/query/response/last_edited_by.js.map +1 -0
- package/build/src/client/database/query/response/last_edited_time.d.ts +3 -0
- package/build/src/client/database/query/response/last_edited_time.d.ts.map +1 -0
- package/build/src/client/database/query/response/last_edited_time.js +7 -0
- package/build/src/client/database/query/response/last_edited_time.js.map +1 -0
- package/build/src/client/database/query/response/multi_select.d.ts +3 -0
- package/build/src/client/database/query/response/multi_select.d.ts.map +1 -0
- package/build/src/client/database/query/response/multi_select.js +10 -0
- package/build/src/client/database/query/response/multi_select.js.map +1 -0
- package/build/src/client/database/query/response/number.d.ts +3 -0
- package/build/src/client/database/query/response/number.d.ts.map +1 -0
- package/build/src/client/database/query/response/number.js +7 -0
- package/build/src/client/database/query/response/number.js.map +1 -0
- package/build/src/client/database/query/response/people.d.ts +3 -0
- package/build/src/client/database/query/response/people.d.ts.map +1 -0
- package/build/src/client/database/query/response/people.js +13 -0
- package/build/src/client/database/query/response/people.js.map +1 -0
- package/build/src/client/database/query/response/phone_number.d.ts +3 -0
- package/build/src/client/database/query/response/phone_number.d.ts.map +1 -0
- package/build/src/client/database/query/response/phone_number.js +7 -0
- package/build/src/client/database/query/response/phone_number.js.map +1 -0
- package/build/src/client/database/query/response/relation.d.ts +4 -0
- package/build/src/client/database/query/response/relation.d.ts.map +1 -0
- package/build/src/client/database/query/response/relation.js +14 -0
- package/build/src/client/database/query/response/relation.js.map +1 -0
- package/build/src/client/database/query/response/rich_text.d.ts +3 -0
- package/build/src/client/database/query/response/rich_text.d.ts.map +1 -0
- package/build/src/client/database/query/response/rich_text.js +12 -0
- package/build/src/client/database/query/response/rich_text.js.map +1 -0
- package/build/src/client/database/query/response/select.d.ts +3 -0
- package/build/src/client/database/query/response/select.d.ts.map +1 -0
- package/build/src/client/database/query/response/select.js +7 -0
- package/build/src/client/database/query/response/select.js.map +1 -0
- package/build/src/client/database/query/response/shared.d.ts +6 -0
- package/build/src/client/database/query/response/shared.d.ts.map +1 -0
- package/build/src/client/database/query/response/shared.js +41 -0
- package/build/src/client/database/query/response/shared.js.map +1 -0
- package/build/src/client/database/query/response/status.d.ts +3 -0
- package/build/src/client/database/query/response/status.d.ts.map +1 -0
- package/build/src/client/database/query/response/status.js +7 -0
- package/build/src/client/database/query/response/status.js.map +1 -0
- package/build/src/client/database/query/response/title.d.ts +3 -0
- package/build/src/client/database/query/response/title.d.ts.map +1 -0
- package/build/src/client/database/query/response/title.js +12 -0
- package/build/src/client/database/query/response/title.js.map +1 -0
- package/build/src/client/database/query/response/unique_id.d.ts +3 -0
- package/build/src/client/database/query/response/unique_id.d.ts.map +1 -0
- package/build/src/client/database/query/response/unique_id.js +14 -0
- package/build/src/client/database/query/response/unique_id.js.map +1 -0
- package/build/src/client/database/query/response/url.d.ts +3 -0
- package/build/src/client/database/query/response/url.d.ts.map +1 -0
- package/build/src/client/database/query/response/url.js +7 -0
- package/build/src/client/database/query/response/url.js.map +1 -0
- package/build/src/client/database/query/schema-drift-validation.d.ts +31 -0
- package/build/src/client/database/query/schema-drift-validation.d.ts.map +1 -0
- package/build/src/client/database/query/schema-drift-validation.js +68 -0
- package/build/src/client/database/query/schema-drift-validation.js.map +1 -0
- package/build/src/client/database/query/sort-transform.d.ts +6 -0
- package/build/src/client/database/query/sort-transform.d.ts.map +1 -0
- package/build/src/client/database/query/sort-transform.js +13 -0
- package/build/src/client/database/query/sort-transform.js.map +1 -0
- package/build/src/client/database/query/types.d.ts +42 -0
- package/build/src/client/database/query/types.d.ts.map +1 -0
- package/build/src/client/database/query/types.js +2 -0
- package/build/src/client/database/query/types.js.map +1 -0
- package/build/src/client/database/schema-builder.d.ts +8 -0
- package/build/src/client/database/schema-builder.d.ts.map +1 -0
- package/build/src/client/database/schema-builder.js +78 -0
- package/build/src/client/database/schema-builder.js.map +1 -0
- package/build/src/client/database/types/crud.d.ts +40 -0
- package/build/src/client/database/types/crud.d.ts.map +1 -0
- package/build/src/client/database/types/crud.js +5 -0
- package/build/src/client/database/types/crud.js.map +1 -0
- package/build/src/client/database/types/filter-capability.d.ts +30 -0
- package/build/src/client/database/types/filter-capability.d.ts.map +1 -0
- package/build/src/client/database/types/filter-capability.js +28 -0
- package/build/src/client/database/types/filter-capability.js.map +1 -0
- package/build/src/client/database/types/index.d.ts +16 -0
- package/build/src/client/database/types/index.d.ts.map +1 -0
- package/build/src/client/database/types/index.js +16 -0
- package/build/src/client/database/types/index.js.map +1 -0
- package/build/src/client/database/types/notion-database-id.d.ts +14 -0
- package/build/src/client/database/types/notion-database-id.d.ts.map +1 -0
- package/build/src/client/database/types/notion-database-id.js +9 -0
- package/build/src/client/database/types/notion-database-id.js.map +1 -0
- package/build/src/client/database/types/notion-filter-model.d.ts +98 -0
- package/build/src/client/database/types/notion-filter-model.d.ts.map +1 -0
- package/build/src/client/database/types/notion-filter-model.js +5 -0
- package/build/src/client/database/types/notion-filter-model.js.map +1 -0
- package/build/src/client/database/types/notion-id-brand.d.ts +27 -0
- package/build/src/client/database/types/notion-id-brand.d.ts.map +1 -0
- package/build/src/client/database/types/notion-id-brand.js +8 -0
- package/build/src/client/database/types/notion-id-brand.js.map +1 -0
- package/build/src/client/database/types/notion-page-id.d.ts +10 -0
- package/build/src/client/database/types/notion-page-id.d.ts.map +1 -0
- package/build/src/client/database/types/notion-page-id.js +6 -0
- package/build/src/client/database/types/notion-page-id.js.map +1 -0
- package/build/src/client/database/types/notion-user-id.d.ts +10 -0
- package/build/src/client/database/types/notion-user-id.d.ts.map +1 -0
- package/build/src/client/database/types/notion-user-id.js +6 -0
- package/build/src/client/database/types/notion-user-id.js.map +1 -0
- package/build/src/client/database/types/projection.d.ts +78 -0
- package/build/src/client/database/types/projection.d.ts.map +1 -0
- package/build/src/client/database/types/projection.js +6 -0
- package/build/src/client/database/types/projection.js.map +1 -0
- package/build/src/client/database/types/query-filter.d.ts +19 -0
- package/build/src/client/database/types/query-filter.d.ts.map +1 -0
- package/build/src/client/database/types/query-filter.js +5 -0
- package/build/src/client/database/types/query-filter.js.map +1 -0
- package/build/src/client/database/types/query-object.d.ts +42 -0
- package/build/src/client/database/types/query-object.d.ts.map +1 -0
- package/build/src/client/database/types/query-object.js +5 -0
- package/build/src/client/database/types/query-object.js.map +1 -0
- package/build/src/client/database/types/schema.d.ts +190 -0
- package/build/src/client/database/types/schema.d.ts.map +1 -0
- package/build/src/client/database/types/schema.js +41 -0
- package/build/src/client/database/types/schema.js.map +1 -0
- package/build/src/client/database/types/sort.d.ts +22 -0
- package/build/src/client/database/types/sort.d.ts.map +1 -0
- package/build/src/client/database/types/sort.js +5 -0
- package/build/src/client/database/types/sort.js.map +1 -0
- package/build/src/config/findConfigFile.d.ts +8 -0
- package/build/src/config/findConfigFile.d.ts.map +1 -0
- package/build/src/config/findConfigFile.js +18 -0
- package/build/src/config/findConfigFile.js.map +1 -0
- package/build/src/config/helpers.d.ts +7 -0
- package/build/src/config/helpers.d.ts.map +1 -0
- package/build/src/config/helpers.js +57 -0
- package/build/src/config/helpers.js.map +1 -0
- package/build/src/config/init.d.ts +7 -0
- package/build/src/config/init.d.ts.map +1 -0
- package/build/src/config/init.js +28 -0
- package/build/src/config/init.js.map +1 -0
- package/build/src/config/loadConfig.d.ts +11 -0
- package/build/src/config/loadConfig.d.ts.map +1 -0
- package/build/src/config/loadConfig.js +91 -0
- package/build/src/config/loadConfig.js.map +1 -0
- package/build/src/config/loadDotEnvFromCwd.d.ts +12 -0
- package/build/src/config/loadDotEnvFromCwd.d.ts.map +1 -0
- package/build/src/config/loadDotEnvFromCwd.js +47 -0
- package/build/src/config/loadDotEnvFromCwd.js.map +1 -0
- package/build/src/config/notion-config-filenames.d.ts +20 -0
- package/build/src/config/notion-config-filenames.d.ts.map +1 -0
- package/build/src/config/notion-config-filenames.js +24 -0
- package/build/src/config/notion-config-filenames.js.map +1 -0
- package/build/src/config/resolveNotionAuth.d.ts +18 -0
- package/build/src/config/resolveNotionAuth.d.ts.map +1 -0
- package/build/src/config/resolveNotionAuth.js +24 -0
- package/build/src/config/resolveNotionAuth.js.map +1 -0
- package/build/src/config/types.d.ts +16 -0
- package/build/src/config/types.d.ts.map +1 -0
- package/build/src/config/types.js +7 -0
- package/build/src/config/types.js.map +1 -0
- package/build/src/helpers.d.ts +22 -0
- package/build/src/helpers.d.ts.map +1 -0
- package/build/src/helpers.js +67 -0
- package/build/src/helpers.js.map +1 -0
- package/build/src/index.d.ts +15 -11
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +11 -116
- package/build/src/index.js.map +1 -1
- package/build/src/notion-id-patterns.d.ts +9 -0
- package/build/src/notion-id-patterns.d.ts.map +1 -0
- package/build/src/notion-id-patterns.js +9 -0
- package/build/src/notion-id-patterns.js.map +1 -0
- package/build/src/runtime-constants.d.ts +13 -0
- package/build/src/runtime-constants.d.ts.map +1 -0
- package/build/src/runtime-constants.js +13 -0
- package/build/src/runtime-constants.js.map +1 -0
- package/build/src/typeUtils.d.ts +77 -0
- package/build/src/typeUtils.d.ts.map +1 -0
- package/build/src/typeUtils.js +52 -0
- package/build/src/typeUtils.js.map +1 -0
- package/package.json +86 -32
- package/build/src/BuildCall.d.ts +0 -45
- package/build/src/BuildCall.d.ts.map +0 -1
- package/build/src/BuildCall.js +0 -114
- package/build/src/BuildCall.js.map +0 -1
- package/build/src/DatabaseActions.d.ts +0 -19
- package/build/src/DatabaseActions.d.ts.map +0 -1
- package/build/src/DatabaseActions.js +0 -158
- package/build/src/DatabaseActions.js.map +0 -1
- package/build/src/GenerateTypes.d.ts +0 -8
- package/build/src/GenerateTypes.d.ts.map +0 -1
- package/build/src/GenerateTypes.js +0 -257
- package/build/src/GenerateTypes.js.map +0 -1
- package/build/src/cli.d.ts +0 -3
- package/build/src/cli.d.ts.map +0 -1
- package/build/src/cli.js +0 -48
- package/build/src/cli.js.map +0 -1
- package/build/src/queryTypes.d.ts +0 -117
- package/build/src/queryTypes.d.ts.map +0 -1
- package/build/src/queryTypes.js +0 -7
- package/build/src/queryTypes.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameter types for create / update / delete database operations.
|
|
3
|
+
*/
|
|
4
|
+
import type { CreatePageParameters } from "@notionhq/client/build/src/api-endpoints";
|
|
5
|
+
import type { QueryFilter } from "./query-filter";
|
|
6
|
+
import type { CreateSchema, DatabaseDefinition, SchemaRecord } from "./schema";
|
|
7
|
+
import type { QuerySort } from "./sort";
|
|
8
|
+
export type Create<Y extends SchemaRecord> = {
|
|
9
|
+
properties: Y;
|
|
10
|
+
icon?: CreatePageParameters["icon"];
|
|
11
|
+
cover?: CreatePageParameters["cover"];
|
|
12
|
+
markdown?: CreatePageParameters["markdown"];
|
|
13
|
+
};
|
|
14
|
+
export type CreateMany<Y extends SchemaRecord> = ReadonlyArray<Create<Y>>;
|
|
15
|
+
export type Update<Y extends SchemaRecord> = {
|
|
16
|
+
where: {
|
|
17
|
+
id: string;
|
|
18
|
+
};
|
|
19
|
+
properties: Partial<Y>;
|
|
20
|
+
};
|
|
21
|
+
export type UpdateMany<Definition extends DatabaseDefinition> = {
|
|
22
|
+
where: QueryFilter<Definition>;
|
|
23
|
+
properties: Partial<CreateSchema<Definition>>;
|
|
24
|
+
};
|
|
25
|
+
export type Upsert<Definition extends DatabaseDefinition> = {
|
|
26
|
+
where: QueryFilter<Definition>;
|
|
27
|
+
create: CreateSchema<Definition>;
|
|
28
|
+
update: Partial<CreateSchema<Definition>>;
|
|
29
|
+
/** When multiple rows match `where`, which row to update (default: oldest by `created_time`). */
|
|
30
|
+
sortBy?: QuerySort<Definition>;
|
|
31
|
+
};
|
|
32
|
+
export type Delete = {
|
|
33
|
+
where: {
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export type DeleteMany<Definition extends DatabaseDefinition> = {
|
|
38
|
+
where: QueryFilter<Definition>;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=crud.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AAE,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1C,iGAAiG;IACjG,MAAM,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,UAAU,SAAS,kBAAkB,IAAI;IAC/D,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;CAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crud.js","sourceRoot":"","sources":["../../../../../src/client/database/types/crud.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which column types support filtering in the typed query DSL.
|
|
3
|
+
*/
|
|
4
|
+
import type { SupportedNotionColumnType } from "./schema";
|
|
5
|
+
export declare const FILTERABLE_PROPERTY_TYPES: {
|
|
6
|
+
readonly files: true;
|
|
7
|
+
readonly people: true;
|
|
8
|
+
readonly relation: true;
|
|
9
|
+
readonly created_by: true;
|
|
10
|
+
readonly last_edited_by: true;
|
|
11
|
+
readonly created_time: true;
|
|
12
|
+
readonly last_edited_time: true;
|
|
13
|
+
readonly url: true;
|
|
14
|
+
readonly phone_number: true;
|
|
15
|
+
readonly title: true;
|
|
16
|
+
readonly email: true;
|
|
17
|
+
readonly checkbox: true;
|
|
18
|
+
readonly date: true;
|
|
19
|
+
readonly multi_select: true;
|
|
20
|
+
readonly status: true;
|
|
21
|
+
readonly number: true;
|
|
22
|
+
readonly rich_text: true;
|
|
23
|
+
readonly select: true;
|
|
24
|
+
readonly unique_id: true;
|
|
25
|
+
};
|
|
26
|
+
export type FilterableNotionColumnType = {
|
|
27
|
+
[K in keyof typeof FILTERABLE_PROPERTY_TYPES]: (typeof FILTERABLE_PROPERTY_TYPES)[K] extends true ? K : never;
|
|
28
|
+
}[keyof typeof FILTERABLE_PROPERTY_TYPES];
|
|
29
|
+
export declare function isFilterablePropertyType(propertyType: SupportedNotionColumnType): propertyType is FilterableNotionColumnType;
|
|
30
|
+
//# sourceMappingURL=filter-capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-capability.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/filter-capability.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;CAqByB,CAAC;AAEhE,MAAM,MAAM,0BAA0B,GAAG;KACvC,CAAC,IAAI,MAAM,OAAO,yBAAyB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAC9F,CAAC,GACD,KAAK;CACR,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAE1C,wBAAgB,wBAAwB,CACvC,YAAY,EAAE,yBAAyB,GACrC,YAAY,IAAI,0BAA0B,CAE5C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which column types support filtering in the typed query DSL.
|
|
3
|
+
*/
|
|
4
|
+
export const FILTERABLE_PROPERTY_TYPES = {
|
|
5
|
+
files: true,
|
|
6
|
+
people: true,
|
|
7
|
+
relation: true,
|
|
8
|
+
created_by: true,
|
|
9
|
+
last_edited_by: true,
|
|
10
|
+
created_time: true,
|
|
11
|
+
last_edited_time: true,
|
|
12
|
+
url: true,
|
|
13
|
+
phone_number: true,
|
|
14
|
+
title: true,
|
|
15
|
+
email: true,
|
|
16
|
+
checkbox: true,
|
|
17
|
+
date: true,
|
|
18
|
+
multi_select: true,
|
|
19
|
+
status: true,
|
|
20
|
+
number: true,
|
|
21
|
+
rich_text: true,
|
|
22
|
+
select: true,
|
|
23
|
+
unique_id: true,
|
|
24
|
+
};
|
|
25
|
+
export function isFilterablePropertyType(propertyType) {
|
|
26
|
+
return FILTERABLE_PROPERTY_TYPES[propertyType];
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=filter-capability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-capability.js","sourceRoot":"","sources":["../../../../../src/client/database/types/filter-capability.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,IAAI;IAClB,gBAAgB,EAAE,IAAI;IAEtB,GAAG,EAAE,IAAI;IACT,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;CAC+C,CAAC;AAQhE,MAAM,UAAU,wBAAwB,CACvC,YAAuC;IAEvC,OAAO,yBAAyB,CAAC,YAAY,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database client type definitions: schema shapes, filters, sorts, projections, and CRUD parameter types.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./crud";
|
|
5
|
+
export * from "./notion-database-id";
|
|
6
|
+
export * from "./notion-id-brand";
|
|
7
|
+
export * from "./notion-page-id";
|
|
8
|
+
export * from "./notion-user-id";
|
|
9
|
+
export * from "./filter-capability";
|
|
10
|
+
export * from "./notion-filter-model";
|
|
11
|
+
export * from "./projection";
|
|
12
|
+
export * from "./query-filter";
|
|
13
|
+
export * from "./query-object";
|
|
14
|
+
export * from "./schema";
|
|
15
|
+
export * from "./sort";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database client type definitions: schema shapes, filters, sorts, projections, and CRUD parameter types.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./crud.js";
|
|
5
|
+
export * from "./notion-database-id.js";
|
|
6
|
+
export * from "./notion-id-brand.js";
|
|
7
|
+
export * from "./notion-page-id.js";
|
|
8
|
+
export * from "./notion-user-id.js";
|
|
9
|
+
export * from "./filter-capability.js";
|
|
10
|
+
export * from "./notion-filter-model.js";
|
|
11
|
+
export * from "./projection.js";
|
|
12
|
+
export * from "./query-filter.js";
|
|
13
|
+
export * from "./query-object.js";
|
|
14
|
+
export * from "./schema.js";
|
|
15
|
+
export * from "./sort.js";
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/client/database/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BrandedNotionId } from "./notion-id-brand";
|
|
2
|
+
/**
|
|
3
|
+
* Notion **database** id (canonical undashed UUID) for relation column
|
|
4
|
+
* `relatedDatabaseId` metadata.
|
|
5
|
+
* Plain strings assign; explicit `NotionDatabaseId` annotations preserve nominal typing vs
|
|
6
|
+
* {@link NotionPageId}.
|
|
7
|
+
*/
|
|
8
|
+
export type NotionDatabaseId = BrandedNotionId<"database">;
|
|
9
|
+
/**
|
|
10
|
+
* Accepts dashed or undashed Notion ids; validates UUID length/segment shape (see
|
|
11
|
+
* {@link toUndashedNotionId}), then returns the canonical undashed form, branded.
|
|
12
|
+
*/
|
|
13
|
+
export declare function toNotionDatabaseId(id: string): NotionDatabaseId;
|
|
14
|
+
//# sourceMappingURL=notion-database-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-database-id.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-database-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,CAE/D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { toUndashedNotionId } from "../../../helpers.js";
|
|
2
|
+
/**
|
|
3
|
+
* Accepts dashed or undashed Notion ids; validates UUID length/segment shape (see
|
|
4
|
+
* {@link toUndashedNotionId}), then returns the canonical undashed form, branded.
|
|
5
|
+
*/
|
|
6
|
+
export function toNotionDatabaseId(id) {
|
|
7
|
+
return toUndashedNotionId(id);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=notion-database-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-database-id.js","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-database-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAWtD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAU;IAC5C,OAAO,kBAAkB,CAAC,EAAE,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notion API filter shapes and per-column filter option maps (user query DSL ↔ API).
|
|
3
|
+
*/
|
|
4
|
+
import type { QueryDataSourceParameters } from "@notionhq/client/build/src/api-endpoints";
|
|
5
|
+
import type { SupportedNotionColumnType } from "./schema";
|
|
6
|
+
type NotionApiFilter = NonNullable<QueryDataSourceParameters["filter"]>;
|
|
7
|
+
type ApiSingleFilter = Extract<NotionApiFilter, {
|
|
8
|
+
property: string;
|
|
9
|
+
}>;
|
|
10
|
+
type ApiSingleFilterByColumnType = {
|
|
11
|
+
[K in SupportedNotionColumnType]: Extract<ApiSingleFilter, Record<K, unknown>>[K];
|
|
12
|
+
};
|
|
13
|
+
type TextPropertyFilters = {
|
|
14
|
+
equals: string;
|
|
15
|
+
does_not_equal: string;
|
|
16
|
+
contains: string;
|
|
17
|
+
does_not_contain: string;
|
|
18
|
+
starts_with: string;
|
|
19
|
+
ends_with: string;
|
|
20
|
+
is_empty: true;
|
|
21
|
+
is_not_empty: true;
|
|
22
|
+
};
|
|
23
|
+
type NumberPropertyFilters = {
|
|
24
|
+
equals: number;
|
|
25
|
+
does_not_equals: number;
|
|
26
|
+
greater_than: number;
|
|
27
|
+
less_than: number;
|
|
28
|
+
greater_than_or_equal_to: number;
|
|
29
|
+
less_than_or_equal_to: number;
|
|
30
|
+
is_empty: true;
|
|
31
|
+
is_not_empty: true;
|
|
32
|
+
};
|
|
33
|
+
type CheckBoxPropertyFilters = {
|
|
34
|
+
equals: boolean;
|
|
35
|
+
does_not_equal: boolean;
|
|
36
|
+
};
|
|
37
|
+
type SchemaOptionUnion<T> = T extends readonly (infer U)[] ? U : T;
|
|
38
|
+
type SelectPropertyFilters<T> = {
|
|
39
|
+
equals: SchemaOptionUnion<T> | string;
|
|
40
|
+
does_not_equal: SchemaOptionUnion<T> | string;
|
|
41
|
+
is_empty: true;
|
|
42
|
+
is_not_empty: true;
|
|
43
|
+
};
|
|
44
|
+
type MultiSelectPropertyFilters<T> = {
|
|
45
|
+
contains: SchemaOptionUnion<T> | string;
|
|
46
|
+
does_not_contain: SchemaOptionUnion<T> | string;
|
|
47
|
+
is_empty: true;
|
|
48
|
+
is_not_empty: true;
|
|
49
|
+
};
|
|
50
|
+
type StatusPropertyFilters<T> = SelectPropertyFilters<T>;
|
|
51
|
+
type ISO8601Date = string;
|
|
52
|
+
type DatePropertyFilters = {
|
|
53
|
+
equals: ISO8601Date;
|
|
54
|
+
before: ISO8601Date;
|
|
55
|
+
after: ISO8601Date;
|
|
56
|
+
on_or_before: ISO8601Date;
|
|
57
|
+
is_empty: true;
|
|
58
|
+
is_not_empty: true;
|
|
59
|
+
on_or_after: string;
|
|
60
|
+
past_week: Record<string, never>;
|
|
61
|
+
past_month: Record<string, never>;
|
|
62
|
+
past_year: Record<string, never>;
|
|
63
|
+
this_week: Record<string, never>;
|
|
64
|
+
next_week: Record<string, never>;
|
|
65
|
+
next_month: Record<string, never>;
|
|
66
|
+
next_year: Record<string, never>;
|
|
67
|
+
};
|
|
68
|
+
type FilesPropertyFilters = ApiSingleFilterByColumnType["files"];
|
|
69
|
+
type PeoplePropertyFilters = ApiSingleFilterByColumnType["people"];
|
|
70
|
+
type RelationPropertyFilters = ApiSingleFilterByColumnType["relation"];
|
|
71
|
+
type CreatedByPropertyFilters = ApiSingleFilterByColumnType["created_by"];
|
|
72
|
+
type LastEditedByPropertyFilters = ApiSingleFilterByColumnType["last_edited_by"];
|
|
73
|
+
type CreatedTimePropertyFilters = ApiSingleFilterByColumnType["created_time"];
|
|
74
|
+
type LastEditedTimePropertyFilters = ApiSingleFilterByColumnType["last_edited_time"];
|
|
75
|
+
type UniqueIdPropertyFilters = ApiSingleFilterByColumnType["unique_id"];
|
|
76
|
+
export type FilterOptions<T = []> = {
|
|
77
|
+
rich_text: TextPropertyFilters;
|
|
78
|
+
title: TextPropertyFilters;
|
|
79
|
+
number: NumberPropertyFilters;
|
|
80
|
+
checkbox: CheckBoxPropertyFilters;
|
|
81
|
+
select: SelectPropertyFilters<T>;
|
|
82
|
+
multi_select: MultiSelectPropertyFilters<T>;
|
|
83
|
+
url: TextPropertyFilters;
|
|
84
|
+
date: DatePropertyFilters;
|
|
85
|
+
status: StatusPropertyFilters<T>;
|
|
86
|
+
email: TextPropertyFilters;
|
|
87
|
+
phone_number: TextPropertyFilters;
|
|
88
|
+
files: FilesPropertyFilters;
|
|
89
|
+
people: PeoplePropertyFilters;
|
|
90
|
+
relation: RelationPropertyFilters;
|
|
91
|
+
created_by: CreatedByPropertyFilters;
|
|
92
|
+
last_edited_by: LastEditedByPropertyFilters;
|
|
93
|
+
created_time: CreatedTimePropertyFilters;
|
|
94
|
+
last_edited_time: LastEditedTimePropertyFilters;
|
|
95
|
+
unique_id: UniqueIdPropertyFilters;
|
|
96
|
+
};
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=notion-filter-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-filter-model.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-filter-model.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,KAAK,E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"notion-filter-model.js","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-filter-model.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared nominal typing for Notion id strings.
|
|
3
|
+
*
|
|
4
|
+
* **Runtime:** Values are ordinary strings (canonical undashed UUIDs from the `toNotion*`
|
|
5
|
+
* helpers). The brand is compile-time only.
|
|
6
|
+
*
|
|
7
|
+
* **Assignability:** A branded id is a subtype of `string`, so you can pass `NotionPageId`
|
|
8
|
+
* anywhere a `string` is expected. Same for arrays: `NotionPageId[]` assigns to `string[]`.
|
|
9
|
+
* You may still see errors when:
|
|
10
|
+
* - the value is **optional** (`NotionPageId[] | undefined` from a partial row) — use
|
|
11
|
+
* `ids ?? []`, `NonNullable`, or {@link brandedNotionIdsAsStringArray};
|
|
12
|
+
* - the value is a **readonly** array — TypeScript will not assign `readonly NotionPageId[]`
|
|
13
|
+
* to a mutable `string[]`; use a copy (`[...ids]`) or {@link brandedNotionIdsAsStringArray}.
|
|
14
|
+
*
|
|
15
|
+
* Distinct brands ({@link NotionPageId} vs {@link NotionDatabaseId} vs {@link NotionUserId})
|
|
16
|
+
* stay separate when you annotate variables or use the matching `toNotion*` helpers.
|
|
17
|
+
*/
|
|
18
|
+
export type NotionIdKind = "page" | "database" | "user";
|
|
19
|
+
export type BrandedNotionId<K extends NotionIdKind> = string & {
|
|
20
|
+
readonly __notionIdKind?: K;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Same elements at runtime; widens to a mutable `string[]` for APIs that expect plain
|
|
24
|
+
* strings. Treats `null` / `undefined` as `[]` (copies via spread so readonly inputs are OK).
|
|
25
|
+
*/
|
|
26
|
+
export declare function brandedNotionIdsAsStringArray<K extends NotionIdKind>(ids: readonly BrandedNotionId<K>[] | BrandedNotionId<K>[] | null | undefined): string[];
|
|
27
|
+
//# sourceMappingURL=notion-id-brand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-id-brand.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-id-brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,YAAY,IAAI,MAAM,GAAG;IAC9D,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,YAAY,EACnE,GAAG,EAAE,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,GAC1E,MAAM,EAAE,CAEV"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same elements at runtime; widens to a mutable `string[]` for APIs that expect plain
|
|
3
|
+
* strings. Treats `null` / `undefined` as `[]` (copies via spread so readonly inputs are OK).
|
|
4
|
+
*/
|
|
5
|
+
export function brandedNotionIdsAsStringArray(ids) {
|
|
6
|
+
return ids == null ? [] : [...ids];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=notion-id-brand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-id-brand.js","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-id-brand.ts"],"names":[],"mappings":"AAuBA;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC5C,GAA4E;IAE5E,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BrandedNotionId } from "./notion-id-brand";
|
|
2
|
+
/**
|
|
3
|
+
* Notion **page** id (UUID) for relation property values and similar.
|
|
4
|
+
* Plain strings assign; explicit `NotionPageId` annotations preserve nominal typing vs
|
|
5
|
+
* {@link NotionDatabaseId}.
|
|
6
|
+
*/
|
|
7
|
+
export type NotionPageId = BrandedNotionId<"page">;
|
|
8
|
+
/** Accepts dashed or undashed Notion ids; returns the canonical undashed form, branded. */
|
|
9
|
+
export declare function toNotionPageId(id: string): NotionPageId;
|
|
10
|
+
//# sourceMappingURL=notion-page-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-page-id.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-page-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAEnD,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,CAEvD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { toUndashedNotionId } from "../../../helpers.js";
|
|
2
|
+
/** Accepts dashed or undashed Notion ids; returns the canonical undashed form, branded. */
|
|
3
|
+
export function toNotionPageId(id) {
|
|
4
|
+
return toUndashedNotionId(id);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=notion-page-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-page-id.js","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-page-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAUtD,2FAA2F;AAC3F,MAAM,UAAU,cAAc,CAAC,EAAU;IACxC,OAAO,kBAAkB,CAAC,EAAE,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BrandedNotionId } from "./notion-id-brand";
|
|
2
|
+
/**
|
|
3
|
+
* Notion **user** id (UUID) for `people` property payloads and similar.
|
|
4
|
+
* Plain strings assign; explicit `NotionUserId` annotations preserve nominal typing vs
|
|
5
|
+
* {@link NotionPageId} / {@link NotionDatabaseId}.
|
|
6
|
+
*/
|
|
7
|
+
export type NotionUserId = BrandedNotionId<"user">;
|
|
8
|
+
/** Accepts dashed or undashed Notion ids; returns the canonical undashed form, branded. */
|
|
9
|
+
export declare function toNotionUserId(id: string): NotionUserId;
|
|
10
|
+
//# sourceMappingURL=notion-user-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-user-id.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-user-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAEnD,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,CAEvD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { toUndashedNotionId } from "../../../helpers.js";
|
|
2
|
+
/** Accepts dashed or undashed Notion ids; returns the canonical undashed form, branded. */
|
|
3
|
+
export function toNotionUserId(id) {
|
|
4
|
+
return toUndashedNotionId(id);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=notion-user-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-user-id.js","sourceRoot":"","sources":["../../../../../src/client/database/types/notion-user-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAUtD,2FAA2F;AAC3F,MAAM,UAAU,cAAc,CAAC,EAAU;IACxC,OAAO,kBAAkB,CAAC,EAAE,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select/omit projection helpers for `findMany` / `findFirst` / `findUnique`,
|
|
3
|
+
* plus paginated/streaming `find*` argument shapes.
|
|
4
|
+
*/
|
|
5
|
+
import type { QueryFilter } from "./query-filter";
|
|
6
|
+
import type { DatabaseDefinition, DatabaseSchema, SchemaRecord } from "./schema";
|
|
7
|
+
import type { QuerySort } from "./sort";
|
|
8
|
+
export type ProjectionPropertyName<Schema extends SchemaRecord> = Extract<keyof Schema, string>;
|
|
9
|
+
export type ProjectionPropertyList<Schema extends SchemaRecord> = readonly ProjectionPropertyName<Schema>[];
|
|
10
|
+
export type Projection<Schema extends SchemaRecord> = {
|
|
11
|
+
select: ProjectionPropertyList<Schema>;
|
|
12
|
+
omit?: never;
|
|
13
|
+
} | {
|
|
14
|
+
select?: never;
|
|
15
|
+
omit: ProjectionPropertyList<Schema>;
|
|
16
|
+
} | {
|
|
17
|
+
select?: undefined;
|
|
18
|
+
omit?: undefined;
|
|
19
|
+
};
|
|
20
|
+
export type ProjectionSelection<Schema extends SchemaRecord> = Projection<Schema> | undefined;
|
|
21
|
+
type ResolvedProjection<Schema extends SchemaRecord, ProjectionSelection extends Projection<Schema> | undefined> = [ProjectionSelection] extends [undefined] ? Projection<Schema> : ProjectionSelection extends Projection<Schema> ? ProjectionSelection : Projection<Schema>;
|
|
22
|
+
/** Row type implied by a select/omit `Projection`; tuple form avoids `keyof` collapsing when `Projection` is a union. */
|
|
23
|
+
export type ResultProjection<Schema extends SchemaRecord, ProjectionSelection extends Projection<Schema> | undefined = undefined> = [ProjectionSelection] extends [undefined] ? Partial<Schema> : [ProjectionSelection] extends [
|
|
24
|
+
{
|
|
25
|
+
select: infer SelectedPropertyNames extends ProjectionPropertyList<Schema>;
|
|
26
|
+
}
|
|
27
|
+
] ? Partial<Pick<Schema, SelectedPropertyNames[number]>> : [ProjectionSelection] extends [
|
|
28
|
+
{
|
|
29
|
+
omit: infer OmittedPropertyNames extends ProjectionPropertyList<Schema>;
|
|
30
|
+
}
|
|
31
|
+
] ? Partial<Omit<Schema, OmittedPropertyNames[number]>> : Partial<Schema>;
|
|
32
|
+
type ProjectionSelectionFromPropertyLists<Schema extends SchemaRecord, SelectedPropertyNames extends ProjectionPropertyList<Schema> | undefined, OmittedPropertyNames extends ProjectionPropertyList<Schema> | undefined> = SelectedPropertyNames extends ProjectionPropertyList<Schema> ? {
|
|
33
|
+
select: SelectedPropertyNames;
|
|
34
|
+
} : OmittedPropertyNames extends ProjectionPropertyList<Schema> ? {
|
|
35
|
+
omit: OmittedPropertyNames;
|
|
36
|
+
} : undefined;
|
|
37
|
+
export type ProjectedRow<Schema extends SchemaRecord, SelectedPropertyNames extends ProjectionPropertyList<Schema> | undefined = undefined, OmittedPropertyNames extends ProjectionPropertyList<Schema> | undefined = undefined> = ResultProjection<Schema, ProjectionSelectionFromPropertyLists<Schema, SelectedPropertyNames, OmittedPropertyNames>>;
|
|
38
|
+
export type FindMany<Definition extends DatabaseDefinition, ProjectionSelection extends Projection<DatabaseSchema<Definition>> | undefined = undefined> = {
|
|
39
|
+
where?: QueryFilter<Definition>;
|
|
40
|
+
sortBy?: QuerySort<Definition>;
|
|
41
|
+
size?: number;
|
|
42
|
+
stream?: number;
|
|
43
|
+
after?: string | null;
|
|
44
|
+
} & ResolvedProjection<DatabaseSchema<Definition>, ProjectionSelection>;
|
|
45
|
+
export type FindFirst<Definition extends DatabaseDefinition, ProjectionSelection extends Projection<DatabaseSchema<Definition>> | undefined = undefined> = {
|
|
46
|
+
where?: QueryFilter<Definition>;
|
|
47
|
+
sortBy?: QuerySort<Definition>;
|
|
48
|
+
} & ResolvedProjection<DatabaseSchema<Definition>, ProjectionSelection>;
|
|
49
|
+
export type FindUnique<Schema extends SchemaRecord, ProjectionSelection extends Projection<Schema> | undefined = undefined> = {
|
|
50
|
+
where: {
|
|
51
|
+
id: string;
|
|
52
|
+
};
|
|
53
|
+
} & ResolvedProjection<Schema, ProjectionSelection>;
|
|
54
|
+
export type PaginateResult<Row extends object> = {
|
|
55
|
+
data: Row[];
|
|
56
|
+
nextCursor: string | null;
|
|
57
|
+
hasMore: boolean;
|
|
58
|
+
};
|
|
59
|
+
export type Count<Definition extends DatabaseDefinition> = {
|
|
60
|
+
where?: QueryFilter<Definition>;
|
|
61
|
+
};
|
|
62
|
+
/** Discriminated `findMany` args: streaming (async iterable). */
|
|
63
|
+
export type FindManyStream<Definition extends DatabaseDefinition, Proj extends Projection<DatabaseSchema<Definition>> | undefined> = FindMany<Definition, Proj> & {
|
|
64
|
+
stream: number;
|
|
65
|
+
after?: never;
|
|
66
|
+
};
|
|
67
|
+
/** Discriminated `findMany` args: cursor pagination. */
|
|
68
|
+
export type FindManyPaginated<Definition extends DatabaseDefinition, Proj extends Projection<DatabaseSchema<Definition>> | undefined> = FindMany<Definition, Proj> & {
|
|
69
|
+
after: string | null;
|
|
70
|
+
stream?: never;
|
|
71
|
+
};
|
|
72
|
+
/** Discriminated `findMany` args: load full list in one response. */
|
|
73
|
+
export type FindManyList<Definition extends DatabaseDefinition, Proj extends Projection<DatabaseSchema<Definition>> | undefined> = FindMany<Definition, Proj> & {
|
|
74
|
+
after?: never;
|
|
75
|
+
stream?: never;
|
|
76
|
+
};
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/projection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACX,kBAAkB,EAElB,cAAc,EACd,YAAY,EACZ,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,MAAM,sBAAsB,CAAC,MAAM,SAAS,YAAY,IAAI,OAAO,CACxE,MAAM,MAAM,EACZ,MAAM,CACN,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,MAAM,S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M,iBAAiB,CAC5B,UAAU,SAAS,kBAAkB,EACrC,IAAI,SAAS,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,GAAG,SAAS,IAC5D,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAChC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,YAAY,CACvB,UAAU,SAAS,kBAAkB,EACrC,IAAI,SAAS,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,GAAG,SAAS,IAC5D,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../../../../../src/client/database/types/projection.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-facing `where` filter tree (single properties + compound and/or).
|
|
3
|
+
*/
|
|
4
|
+
import type { FilterOptions } from "./notion-filter-model";
|
|
5
|
+
import type { DatabaseColumnTypes, DatabaseDefinition, DatabaseSchema, SupportedNotionColumnType } from "./schema";
|
|
6
|
+
type FilterValueForColumnType<PropertyValue, ColumnType extends SupportedNotionColumnType> = Partial<FilterOptions<NonNullable<PropertyValue>>[ColumnType]>;
|
|
7
|
+
type DatabaseDefinitionPropertyName<Definition extends DatabaseDefinition> = Extract<keyof DatabaseSchema<Definition>, keyof DatabaseColumnTypes<Definition>>;
|
|
8
|
+
type FilterValueForProperty<Definition extends DatabaseDefinition, PropertyName extends DatabaseDefinitionPropertyName<Definition>> = FilterValueForColumnType<DatabaseSchema<Definition>[PropertyName], DatabaseColumnTypes<Definition>[PropertyName]>;
|
|
9
|
+
export type SingleFilter<Definition extends DatabaseDefinition> = {
|
|
10
|
+
[PropertyName in DatabaseDefinitionPropertyName<Definition>]?: FilterValueForProperty<Definition, PropertyName>;
|
|
11
|
+
};
|
|
12
|
+
export type CompoundFilters<Definition extends DatabaseDefinition> = {
|
|
13
|
+
and: Array<SingleFilter<Definition> | CompoundFilters<Definition>>;
|
|
14
|
+
} | {
|
|
15
|
+
or: Array<SingleFilter<Definition> | CompoundFilters<Definition>>;
|
|
16
|
+
};
|
|
17
|
+
export type QueryFilter<Definition extends DatabaseDefinition> = SingleFilter<Definition> | CompoundFilters<Definition>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=query-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-filter.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/query-filter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EACX,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,MAAM,UAAU,CAAC;AAElB,KAAK,wBAAwB,CAC5B,aAAa,EACb,UAAU,SAAS,yBAAyB,IACzC,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAEnE,KAAK,8BAA8B,CAClC,UAAU,SAAS,kBAAkB,IAClC,OAAO,CACV,MAAM,cAAc,CAAC,UAAU,CAAC,EAChC,MAAM,mBAAmB,CAAC,UAAU,CAAC,CACrC,CAAC;AAEF,KAAK,sBAAsB,CAC1B,UAAU,SAAS,kBAAkB,EACrC,YAAY,SAAS,8BAA8B,CAAC,UAAU,CAAC,IAC5D,wBAAwB,CAC3B,cAAc,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,EACxC,mBAAmB,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAC7C,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,UAAU,SAAS,kBAAkB,IAAI;KAChE,YAAY,IAAI,8BAA8B,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,sBAAsB,CACpF,UAAU,EACV,YAAY,CACZ;CACD,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,UAAU,SAAS,kBAAkB,IAC9D;IACA,GAAG,EAAE,KAAK,CACP,YAAY,CAAC,UAAU,CAAC,GACxB,eAAe,CAAC,UAAU,CAAC,CAC7B,CAAC;CACD,GACD;IACA,EAAE,EAAE,KAAK,CACN,YAAY,CAAC,UAAU,CAAC,GACxB,eAAe,CAAC,UAAU,CAAC,CAC7B,CAAC;CACD,CAAC;AAEL,MAAM,MAAM,WAAW,CAAC,UAAU,SAAS,kBAAkB,IAC1D,YAAY,CAAC,UAAU,CAAC,GACxB,eAAe,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-filter.js","sourceRoot":"","sources":["../../../../../src/client/database/types/query-filter.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Top-level `Query` object and wire-format filter aliases / normalized responses.
|
|
3
|
+
*/
|
|
4
|
+
import type { QueryDataSourceParameters, QueryDataSourceResponse } from "@notionhq/client/build/src/api-endpoints";
|
|
5
|
+
import type { QueryFilter } from "./query-filter";
|
|
6
|
+
import type { DatabaseDefinition } from "./schema";
|
|
7
|
+
import type { QuerySort } from "./sort";
|
|
8
|
+
type NotionApiFilter = NonNullable<QueryDataSourceParameters["filter"]>;
|
|
9
|
+
type QueryBase<Definition extends DatabaseDefinition> = {
|
|
10
|
+
filter?: QueryFilter<Definition>;
|
|
11
|
+
sort?: QuerySort<Definition>;
|
|
12
|
+
};
|
|
13
|
+
export type QueryWithoutRawResponse<Definition extends DatabaseDefinition> = QueryBase<Definition> & {
|
|
14
|
+
includeRawResponse?: false | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type QueryWithRawResponse<Definition extends DatabaseDefinition> = QueryBase<Definition> & {
|
|
17
|
+
includeRawResponse: true;
|
|
18
|
+
};
|
|
19
|
+
export type Query<Definition extends DatabaseDefinition> = QueryWithoutRawResponse<Definition> | QueryWithRawResponse<Definition>;
|
|
20
|
+
export type apiFilterQuery = {
|
|
21
|
+
filter?: apiSingleFilter | apiAndFilter | apiOrFilter;
|
|
22
|
+
};
|
|
23
|
+
export type apiSingleFilter = Extract<NotionApiFilter, {
|
|
24
|
+
property: string;
|
|
25
|
+
}>;
|
|
26
|
+
export type apiAndFilter = Extract<NotionApiFilter, {
|
|
27
|
+
and: unknown;
|
|
28
|
+
}>;
|
|
29
|
+
export type apiOrFilter = Extract<NotionApiFilter, {
|
|
30
|
+
or: unknown;
|
|
31
|
+
}>;
|
|
32
|
+
export type apiFilterType = QueryDataSourceParameters["filter"];
|
|
33
|
+
type QueryBaseResponse<DatabaseSchema> = {
|
|
34
|
+
results: Partial<DatabaseSchema>[];
|
|
35
|
+
};
|
|
36
|
+
export type QueryResponseWithRawResponse<DatabaseSchema> = QueryBaseResponse<DatabaseSchema> & {
|
|
37
|
+
rawResponse: QueryDataSourceResponse;
|
|
38
|
+
};
|
|
39
|
+
export type QueryResponseWithoutRawResponse<DatabaseSchema> = QueryBaseResponse<DatabaseSchema>;
|
|
40
|
+
export type SimpleQueryResponse<DatabaseSchema> = QueryResponseWithoutRawResponse<DatabaseSchema> | QueryResponseWithRawResponse<DatabaseSchema>;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=query-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-object.d.ts","sourceRoot":"","sources":["../../../../../src/client/database/types/query-object.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACX,yBAAyB,EACzB,uBAAuB,EACvB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAg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