@haustle/notion-orm 0.0.43 → 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 +85 -30
- 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
- package/src/BuildCall.ts +0 -118
- package/src/DatabaseActions.ts +0 -227
- package/src/GenerateTypes.ts +0 -448
- package/src/cli.ts +0 -40
- package/src/index.ts +0 -136
- package/src/queryTypes.ts +0 -177
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen-environment.d.ts","sourceRoot":"","sources":["../../../../src/ast/shared/codegen-environment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,YAAY,CAAC;AAE7D,KAAK,oBAAoB,GAAG;IAC3B,IAAI,EAAE,OAAO,CAAC;CACd,CAAC;AAeF,wBAAgB,yBAAyB,CAAC,IAAI,CAAC,EAAE;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACrC,GAAG,kBAAkB,CAMrB;AAQD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,kBAAkB,GAC7B,MAAM,CAER;AAED,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codegen extension rules (central source of truth for TS vs JS choices):
|
|
3
|
+
*
|
|
4
|
+
* Rule 1 (env-driven). Per-file ARTIFACT extension is `.ts` or `.js` based
|
|
5
|
+
* on the consumer project's environment. Compose filenames with
|
|
6
|
+
* `codegenArtifactFileName(basename, env)` (or
|
|
7
|
+
* `getCodegenArtifactExtension(env)` only when you need the raw
|
|
8
|
+
* extension) — never inline the TS/JS ternary.
|
|
9
|
+
* Rule 2 (constant). Relative IMPORT SPECIFIERS inside generated `.ts`
|
|
10
|
+
* and `.d.ts` modules are always `.js` (TS ESM NodeNext pattern
|
|
11
|
+
* so emitted JS and Node resolution line up). Use
|
|
12
|
+
* `getCodegenImportExtension()`.
|
|
13
|
+
* Rule 3 (constant). DECLARATION artifacts are always `.d.ts` /
|
|
14
|
+
* `.d.ts.map` regardless of environment (see
|
|
15
|
+
* `AST_FS_FILENAMES.INDEX_DTS` / `INDEX_DTS_MAP`).
|
|
16
|
+
*
|
|
17
|
+
* New env-dependent file locations should go through
|
|
18
|
+
* `codegenIndexSourcePath` (for `index.{ts,js}`-shaped outputs) rather than
|
|
19
|
+
* reintroducing `Ts`/`Js` paired constants.
|
|
20
|
+
*/
|
|
21
|
+
import fs from "fs";
|
|
22
|
+
import path from "path";
|
|
23
|
+
const TSCONFIG_CANDIDATES = [
|
|
24
|
+
"tsconfig.json",
|
|
25
|
+
"tsconfig.app.json",
|
|
26
|
+
"tsconfig.base.json",
|
|
27
|
+
"tsconfig.build.json",
|
|
28
|
+
];
|
|
29
|
+
function hasTypeScriptConfig(projectRoot) {
|
|
30
|
+
return TSCONFIG_CANDIDATES.some((candidate) => fs.existsSync(path.join(projectRoot, candidate)));
|
|
31
|
+
}
|
|
32
|
+
export function resolveCodegenEnvironment(args) {
|
|
33
|
+
const projectRoot = args?.projectRoot ?? process.cwd();
|
|
34
|
+
if (args?.configRuntime?.isTS) {
|
|
35
|
+
return "typescript";
|
|
36
|
+
}
|
|
37
|
+
return hasTypeScriptConfig(projectRoot) ? "typescript" : "javascript";
|
|
38
|
+
}
|
|
39
|
+
function getCodegenArtifactExtension(environment) {
|
|
40
|
+
return environment === "typescript" ? "ts" : "js";
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Environment-aware artifact filename: `{basename}.{ts|js}`.
|
|
44
|
+
* Use for on-disk module paths and relative `./Foo.{ts|js}` import paths in
|
|
45
|
+
* emitted registries — do not interpolate `getCodegenArtifactExtension` by hand.
|
|
46
|
+
*/
|
|
47
|
+
export function codegenArtifactFileName(basename, environment) {
|
|
48
|
+
return `${basename}.${getCodegenArtifactExtension(environment)}`;
|
|
49
|
+
}
|
|
50
|
+
export function getCodegenImportExtension() {
|
|
51
|
+
return "js";
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=codegen-environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen-environment.js","sourceRoot":"","sources":["../../../../src/ast/shared/codegen-environment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB,MAAM,mBAAmB,GAAG;IAC3B,eAAe;IACf,mBAAmB;IACnB,oBAAoB;IACpB,qBAAqB;CACZ,CAAC;AAEX,SAAS,mBAAmB,CAAC,WAAmB;IAC/C,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAC7C,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAChD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAGzC;IACA,MAAM,WAAW,GAAG,IAAI,EAAE,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACvD,IAAI,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAC;IACrB,CAAC;IACD,OAAO,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC;AACvE,CAAC;AAED,SAAS,2BAA2B,CACnC,WAA+B;IAE/B,OAAO,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACtC,QAAgB,EAChB,WAA+B;IAE/B,OAAO,GAAG,QAAQ,IAAI,2BAA2B,CAAC,WAAW,CAAC,EAAE,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,yBAAyB;IACxC,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { type CodegenEnvironment } from "./codegen-environment";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve generated artifact paths from the current project root, not from the
|
|
4
|
+
* installed package location. This keeps `notion sync` writing into the
|
|
5
|
+
* consuming app when the package is linked locally.
|
|
6
|
+
*/
|
|
7
|
+
declare function getProjectBuildDir(): string;
|
|
8
|
+
/** Canonical output directory for generated database modules (`notion/databases/*`). */
|
|
9
|
+
declare function getDatabasesDir(): string;
|
|
10
|
+
/** Canonical output directory for generated agent modules (`notion/agents/*`). */
|
|
11
|
+
declare function getAgentsDir(): string;
|
|
12
|
+
export declare const AGENTS_DIR: string;
|
|
13
|
+
/** Filesystem targets used by emitters. Getters stay lazy for testability. */
|
|
14
|
+
export declare const AST_FS_PATHS: {
|
|
15
|
+
/** Codegen root (`notion/`): index entrypoint lives here alongside `databases/` and `agents/`. */
|
|
16
|
+
readonly CODEGEN_ROOT_DIR: string;
|
|
17
|
+
readonly DATABASES_DIR: string;
|
|
18
|
+
readonly metadataFile: string;
|
|
19
|
+
readonly agentMetadataFile: string;
|
|
20
|
+
readonly buildIndexDts: string;
|
|
21
|
+
readonly buildIndexDtsMap: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Named locations where an environment-specific `index.ts` / `index.js` is emitted.
|
|
25
|
+
* Scopes are the keys of `CODEGEN_INDEX_DIR_RESOLVERS` only (AGENTS.md: derive unions from maps).
|
|
26
|
+
*/
|
|
27
|
+
declare const CODEGEN_INDEX_DIR_RESOLVERS: {
|
|
28
|
+
readonly codegenRoot: typeof getProjectBuildDir;
|
|
29
|
+
readonly databases: typeof getDatabasesDir;
|
|
30
|
+
readonly agents: typeof getAgentsDir;
|
|
31
|
+
};
|
|
32
|
+
type CodegenIndexScope = keyof typeof CODEGEN_INDEX_DIR_RESOLVERS;
|
|
33
|
+
/**
|
|
34
|
+
* Canonical filesystem path for a generated `index.{ts,js}` source file.
|
|
35
|
+
* Centralizes the "where does the environment-specific barrel live" rule so
|
|
36
|
+
* callers never branch on TS vs JS filenames directly.
|
|
37
|
+
*/
|
|
38
|
+
export declare function codegenIndexSourcePath(args: {
|
|
39
|
+
scope: CodegenIndexScope;
|
|
40
|
+
environment: CodegenEnvironment;
|
|
41
|
+
}): string;
|
|
42
|
+
/** Import paths used while generating TypeScript source. */
|
|
43
|
+
export declare const AST_IMPORT_PATHS: {
|
|
44
|
+
readonly DATABASE_CLIENT: "@haustle/notion-orm";
|
|
45
|
+
readonly AGENT_CLIENT: "@haustle/notion-orm";
|
|
46
|
+
readonly QUERY_TYPES: "@haustle/notion-orm";
|
|
47
|
+
readonly ORM_BASE: "@haustle/notion-orm/base";
|
|
48
|
+
readonly ZOD: "zod";
|
|
49
|
+
readonly databaseClass: (name: string) => string;
|
|
50
|
+
readonly agentClass: (name: string) => string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Backward-compatible alias for shared runtime constants.
|
|
54
|
+
* New runtime code should prefer importing from `src/runtime-constants.ts`.
|
|
55
|
+
*/
|
|
56
|
+
export declare const AST_RUNTIME_CONSTANTS: {
|
|
57
|
+
readonly NOTION_API_VERSION: "2026-03-11";
|
|
58
|
+
readonly PACKAGE_LOG_PREFIX: "[@haustle/notion-orm]";
|
|
59
|
+
readonly CLI_GENERATE_COMMAND: "notion sync";
|
|
60
|
+
readonly SCHEMA_DRIFT_PREFIX: "Schema drift detected";
|
|
61
|
+
readonly SCHEMA_DRIFT_HELP_MESSAGE: "To easily fix this, please run `notion sync` to refresh all database schemas.";
|
|
62
|
+
};
|
|
63
|
+
/** Canonical generated type names referenced across emitters. */
|
|
64
|
+
export declare const AST_TYPE_NAMES: {
|
|
65
|
+
readonly PAGE_SCHEMA: "PageSchema";
|
|
66
|
+
readonly CREATE_SCHEMA: "CreateSchema";
|
|
67
|
+
readonly COLUMN_NAME_TO_COLUMN_TYPE: "ColumnNameToColumnType";
|
|
68
|
+
readonly QUERY_SCHEMA: "QuerySchema";
|
|
69
|
+
readonly PROPERTY_VALUES_SUFFIX: "PropertyValues";
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Relative virtual-filesystem paths used by the demo playground builder.
|
|
73
|
+
* Matches the directory layout of a real consuming project so the
|
|
74
|
+
* browser-based TypeScript environment resolves imports correctly.
|
|
75
|
+
*
|
|
76
|
+
* Kept here alongside the production path constants so both stay in sync
|
|
77
|
+
* when the build layout changes.
|
|
78
|
+
*/
|
|
79
|
+
export declare const PLAYGROUND_PATHS: {
|
|
80
|
+
/** Virtual file path for the generated index module. */
|
|
81
|
+
readonly BUILD_INDEX: "notion/index.ts";
|
|
82
|
+
/**
|
|
83
|
+
* Recommended import path segment for consumer code (`./notion/` → `index.ts`).
|
|
84
|
+
* Keeps demo snippets aligned with the same pattern we document in README.
|
|
85
|
+
*/
|
|
86
|
+
readonly BUILD_INDEX_DIR: "notion/";
|
|
87
|
+
readonly databaseModule: (name: string) => string;
|
|
88
|
+
readonly agentModule: (name: string) => string;
|
|
89
|
+
readonly databaseImport: (name: string) => string;
|
|
90
|
+
readonly agentImport: (name: string) => string;
|
|
91
|
+
readonly MOCK_PACKAGE_INDEX: "playground_modules/haustle-notion-orm/index.ts";
|
|
92
|
+
readonly MOCK_PACKAGE_NOTION_ID_PATTERNS: "playground_modules/haustle-notion-orm/notion-id-patterns.ts";
|
|
93
|
+
readonly MOCK_PACKAGE_BASE: "playground_modules/haustle-notion-orm/base.ts";
|
|
94
|
+
readonly MOCK_PACKAGE_PREFIX: "playground_modules/";
|
|
95
|
+
readonly DEMO_AUTH_PLACEHOLDER: "my-notion-api-key";
|
|
96
|
+
};
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/ast/shared/constants.ts"],"names":[],"mappings":"AAQA,OAAO,EAEN,KAAK,kBAAkB,EACvB,MAAM,uBAAuB,CAAC;AAc/B;;;;GAIG;AACH,iBAAS,kBAAkB,IAAI,MAAM,CAEpC;AAED,wFAAwF;AACxF,iBAAS,eAAe,IAAI,MAAM,CAEjC;AAED,kFAAkF;AAClF,iBAAS,YAAY,IAAI,MAAM,CAE9B;AAED,eAAO,MAAM,UAAU,QAAiB,CAAC;AAEzC,8EAA8E;AAC9E,eAAO,MAAM,YAAY;IACxB,kGAAkG;+BAC1E,MAAM;4BAIT,MAAM;2BAIP,MAAM;gCAID,MAAM;4BAIV,MAAM;+BAIH,MAAM;CAMrB,CAAC;AAEX;;;GAGG;AACH,QAAA,MAAM,2BAA2B;;;;CAIgB,CAAC;AAElD,KAAK,iBAAiB,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC5C,KAAK,EAAE,iBAAiB,CAAC;IACzB,WAAW,EAAE,kBAAkB,CAAC;CAChC,GAAG,MAAM,CAIT;AASD,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB;;;;;;mCAQR,MAAM,KAAG,MAAM;gCAIlB,MAAM,KAAG,MAAM;CAGvB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;CAA4B,CAAC;AAE/D,iEAAiE;AACjE,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;IAC5B,wDAAwD;;IAGxD;;;OAGG;;oCAGkB,MAAM,KAAG,MAAM;iCAGlB,MAAM,KAAG,MAAM;oCAIZ,MAAM,KAAG,MAAM;iCAGlB,MAAM,KAAG,MAAM;;;;;;CAWxB,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal constants shared by the AST emitters and generated client layer.
|
|
3
|
+
* Centralizing these paths and string literals makes refactors safer because
|
|
4
|
+
* emitters do not need to duplicate structure-sensitive values.
|
|
5
|
+
*/
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { toPascalCase } from "../../helpers.js";
|
|
8
|
+
import { PACKAGE_RUNTIME_CONSTANTS } from "../../runtime-constants.js";
|
|
9
|
+
import { codegenArtifactFileName, } from "./codegen-environment.js";
|
|
10
|
+
/**
|
|
11
|
+
* Top-level directory name for CLI-generated artifacts in consuming projects
|
|
12
|
+
* (`notion/` entry + `databases/`, `agents/`). Prefer **`import { NotionORM } from "./notion/"`**
|
|
13
|
+
* in apps (directory import resolves to `index` — no need to spell `index`). Distinct from this package's
|
|
14
|
+
* npm `outDir` (`build/`), which is hidden behind stable package exports such as
|
|
15
|
+
* `@haustle/notion-orm/base`.
|
|
16
|
+
*/
|
|
17
|
+
const PROJECT_CODEGEN_DIR_NAME = "notion";
|
|
18
|
+
/** Subdirectory under the codegen root for generated database modules. */
|
|
19
|
+
const PROJECT_DATABASES_DIR_NAME = "databases";
|
|
20
|
+
/**
|
|
21
|
+
* Resolve generated artifact paths from the current project root, not from the
|
|
22
|
+
* installed package location. This keeps `notion sync` writing into the
|
|
23
|
+
* consuming app when the package is linked locally.
|
|
24
|
+
*/
|
|
25
|
+
function getProjectBuildDir() {
|
|
26
|
+
return path.resolve(process.cwd(), PROJECT_CODEGEN_DIR_NAME);
|
|
27
|
+
}
|
|
28
|
+
/** Canonical output directory for generated database modules (`notion/databases/*`). */
|
|
29
|
+
function getDatabasesDir() {
|
|
30
|
+
return path.join(getProjectBuildDir(), PROJECT_DATABASES_DIR_NAME);
|
|
31
|
+
}
|
|
32
|
+
/** Canonical output directory for generated agent modules (`notion/agents/*`). */
|
|
33
|
+
function getAgentsDir() {
|
|
34
|
+
return path.join(getProjectBuildDir(), "agents");
|
|
35
|
+
}
|
|
36
|
+
export const AGENTS_DIR = getAgentsDir();
|
|
37
|
+
/** Filesystem targets used by emitters. Getters stay lazy for testability. */
|
|
38
|
+
export const AST_FS_PATHS = {
|
|
39
|
+
/** Codegen root (`notion/`): index entrypoint lives here alongside `databases/` and `agents/`. */
|
|
40
|
+
get CODEGEN_ROOT_DIR() {
|
|
41
|
+
return getProjectBuildDir();
|
|
42
|
+
},
|
|
43
|
+
get DATABASES_DIR() {
|
|
44
|
+
return getDatabasesDir();
|
|
45
|
+
},
|
|
46
|
+
get metadataFile() {
|
|
47
|
+
return path.resolve(getDatabasesDir(), AST_FS_FILENAMES.METADATA);
|
|
48
|
+
},
|
|
49
|
+
get agentMetadataFile() {
|
|
50
|
+
return path.resolve(getAgentsDir(), AST_FS_FILENAMES.METADATA);
|
|
51
|
+
},
|
|
52
|
+
get buildIndexDts() {
|
|
53
|
+
return path.resolve(AST_FS_PATHS.CODEGEN_ROOT_DIR, AST_FS_FILENAMES.INDEX_DTS);
|
|
54
|
+
},
|
|
55
|
+
get buildIndexDtsMap() {
|
|
56
|
+
return path.resolve(AST_FS_PATHS.CODEGEN_ROOT_DIR, AST_FS_FILENAMES.INDEX_DTS_MAP);
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Named locations where an environment-specific `index.ts` / `index.js` is emitted.
|
|
61
|
+
* Scopes are the keys of `CODEGEN_INDEX_DIR_RESOLVERS` only (AGENTS.md: derive unions from maps).
|
|
62
|
+
*/
|
|
63
|
+
const CODEGEN_INDEX_DIR_RESOLVERS = {
|
|
64
|
+
codegenRoot: getProjectBuildDir,
|
|
65
|
+
databases: getDatabasesDir,
|
|
66
|
+
agents: getAgentsDir,
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Canonical filesystem path for a generated `index.{ts,js}` source file.
|
|
70
|
+
* Centralizes the "where does the environment-specific barrel live" rule so
|
|
71
|
+
* callers never branch on TS vs JS filenames directly.
|
|
72
|
+
*/
|
|
73
|
+
export function codegenIndexSourcePath(args) {
|
|
74
|
+
const { scope, environment } = args;
|
|
75
|
+
const dir = CODEGEN_INDEX_DIR_RESOLVERS[scope]();
|
|
76
|
+
return path.join(dir, codegenArtifactFileName("index", environment));
|
|
77
|
+
}
|
|
78
|
+
/** Shared filenames used across emitted artifacts. */
|
|
79
|
+
const AST_FS_FILENAMES = {
|
|
80
|
+
METADATA: "metadata.json",
|
|
81
|
+
INDEX_DTS: "index.d.ts",
|
|
82
|
+
INDEX_DTS_MAP: "index.d.ts.map",
|
|
83
|
+
};
|
|
84
|
+
/** Import paths used while generating TypeScript source. */
|
|
85
|
+
export const AST_IMPORT_PATHS = {
|
|
86
|
+
DATABASE_CLIENT: "@haustle/notion-orm",
|
|
87
|
+
AGENT_CLIENT: "@haustle/notion-orm",
|
|
88
|
+
QUERY_TYPES: "@haustle/notion-orm",
|
|
89
|
+
ORM_BASE: "@haustle/notion-orm/base",
|
|
90
|
+
ZOD: "zod",
|
|
91
|
+
databaseClass(name) {
|
|
92
|
+
return `./${PROJECT_DATABASES_DIR_NAME}/${toPascalCase(name)}.js`;
|
|
93
|
+
},
|
|
94
|
+
agentClass(name) {
|
|
95
|
+
return `./agents/${toPascalCase(name)}.js`;
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Backward-compatible alias for shared runtime constants.
|
|
100
|
+
* New runtime code should prefer importing from `src/runtime-constants.ts`.
|
|
101
|
+
*/
|
|
102
|
+
export const AST_RUNTIME_CONSTANTS = PACKAGE_RUNTIME_CONSTANTS;
|
|
103
|
+
/** Canonical generated type names referenced across emitters. */
|
|
104
|
+
export const AST_TYPE_NAMES = {
|
|
105
|
+
PAGE_SCHEMA: "PageSchema",
|
|
106
|
+
CREATE_SCHEMA: "CreateSchema",
|
|
107
|
+
COLUMN_NAME_TO_COLUMN_TYPE: "ColumnNameToColumnType",
|
|
108
|
+
QUERY_SCHEMA: "QuerySchema",
|
|
109
|
+
PROPERTY_VALUES_SUFFIX: "PropertyValues",
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Relative virtual-filesystem paths used by the demo playground builder.
|
|
113
|
+
* Matches the directory layout of a real consuming project so the
|
|
114
|
+
* browser-based TypeScript environment resolves imports correctly.
|
|
115
|
+
*
|
|
116
|
+
* Kept here alongside the production path constants so both stay in sync
|
|
117
|
+
* when the build layout changes.
|
|
118
|
+
*/
|
|
119
|
+
export const PLAYGROUND_PATHS = {
|
|
120
|
+
/** Virtual file path for the generated index module. */
|
|
121
|
+
BUILD_INDEX: `${PROJECT_CODEGEN_DIR_NAME}/index.ts`,
|
|
122
|
+
/**
|
|
123
|
+
* Recommended import path segment for consumer code (`./notion/` → `index.ts`).
|
|
124
|
+
* Keeps demo snippets aligned with the same pattern we document in README.
|
|
125
|
+
*/
|
|
126
|
+
BUILD_INDEX_DIR: `${PROJECT_CODEGEN_DIR_NAME}/`,
|
|
127
|
+
databaseModule(name) {
|
|
128
|
+
return `${PROJECT_CODEGEN_DIR_NAME}/${PROJECT_DATABASES_DIR_NAME}/${toPascalCase(name)}.ts`;
|
|
129
|
+
},
|
|
130
|
+
agentModule(name) {
|
|
131
|
+
return `${PROJECT_CODEGEN_DIR_NAME}/agents/${toPascalCase(name)}.ts`;
|
|
132
|
+
},
|
|
133
|
+
databaseImport(name) {
|
|
134
|
+
return `./${PROJECT_DATABASES_DIR_NAME}/${toPascalCase(name)}.ts`;
|
|
135
|
+
},
|
|
136
|
+
agentImport(name) {
|
|
137
|
+
return `./agents/${toPascalCase(name)}.ts`;
|
|
138
|
+
},
|
|
139
|
+
MOCK_PACKAGE_INDEX: "playground_modules/haustle-notion-orm/index.ts",
|
|
140
|
+
MOCK_PACKAGE_NOTION_ID_PATTERNS: "playground_modules/haustle-notion-orm/notion-id-patterns.ts",
|
|
141
|
+
MOCK_PACKAGE_BASE: "playground_modules/haustle-notion-orm/base.ts",
|
|
142
|
+
MOCK_PACKAGE_PREFIX: "playground_modules/",
|
|
143
|
+
DEMO_AUTH_PLACEHOLDER: "my-notion-api-key",
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/ast/shared/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EACN,uBAAuB,GAEvB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,wBAAwB,GAAG,QAAiB,CAAC;AAEnD,0EAA0E;AAC1E,MAAM,0BAA0B,GAAG,WAAoB,CAAC;AAExD;;;;GAIG;AACH,SAAS,kBAAkB;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,wBAAwB,CAAC,CAAC;AAC9D,CAAC;AAED,wFAAwF;AACxF,SAAS,eAAe;IACvB,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,0BAA0B,CAAC,CAAC;AACpE,CAAC;AAED,kFAAkF;AAClF,SAAS,YAAY;IACpB,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,EAAE,CAAC;AAEzC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,kGAAkG;IAClG,IAAI,gBAAgB;QACnB,OAAO,kBAAkB,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,aAAa;QAChB,OAAO,eAAe,EAAE,CAAC;IAC1B,CAAC;IAED,IAAI,YAAY;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,iBAAiB;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,aAAa;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,gBAAgB;QACnB,OAAO,IAAI,CAAC,OAAO,CAClB,YAAY,CAAC,gBAAgB,EAC7B,gBAAgB,CAAC,aAAa,CAC9B,CAAC;IACH,CAAC;CACQ,CAAC;AAEX;;;GAGG;AACH,MAAM,2BAA2B,GAAG;IACnC,WAAW,EAAE,kBAAkB;IAC/B,SAAS,EAAE,eAAe;IAC1B,MAAM,EAAE,YAAY;CAC4B,CAAC;AAIlD;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAGtC;IACA,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACpC,MAAM,GAAG,GAAG,2BAA2B,CAAC,KAAK,CAAC,EAAE,CAAC;IACjD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,sDAAsD;AACtD,MAAM,gBAAgB,GAAG;IACxB,QAAQ,EAAE,eAAe;IACzB,SAAS,EAAE,YAAY;IACvB,aAAa,EAAE,gBAAgB;CACtB,CAAC;AAEX,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,eAAe,EAAE,qBAAqB;IACtC,YAAY,EAAE,qBAAqB;IACnC,WAAW,EAAE,qBAAqB;IAClC,QAAQ,EAAE,0BAA0B;IAEpC,GAAG,EAAE,KAAK;IAEV,aAAa,CAAC,IAAY;QACzB,OAAO,KAAK,0BAA0B,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;IACnE,CAAC;IAED,UAAU,CAAC,IAAY;QACtB,OAAO,YAAY,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5C,CAAC;CACQ,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE/D,iEAAiE;AACjE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,WAAW,EAAE,YAAY;IACzB,aAAa,EAAE,cAAc;IAC7B,0BAA0B,EAAE,wBAAwB;IACpD,YAAY,EAAE,aAAa;IAC3B,sBAAsB,EAAE,gBAAgB;CAC/B,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,wDAAwD;IACxD,WAAW,EAAE,GAAG,wBAAwB,WAAW;IAEnD;;;OAGG;IACH,eAAe,EAAE,GAAG,wBAAwB,GAAG;IAE/C,cAAc,CAAC,IAAY;QAC1B,OAAO,GAAG,wBAAwB,IAAI,0BAA0B,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;IAC7F,CAAC;IACD,WAAW,CAAC,IAAY;QACvB,OAAO,GAAG,wBAAwB,WAAW,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;IACtE,CAAC;IAED,cAAc,CAAC,IAAY;QAC1B,OAAO,KAAK,0BAA0B,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;IACnE,CAAC;IACD,WAAW,CAAC,IAAY;QACvB,OAAO,YAAY,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;IAC5C,CAAC;IAED,kBAAkB,EAAE,gDAAgD;IACpE,+BAA+B,EAC9B,6DAA6D;IAC9D,iBAAiB,EAAE,+CAA+C;IAClE,mBAAmB,EAAE,qBAAqB;IAE1C,qBAAqB,EAAE,mBAAmB;CACjC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
import { type TsEmitContext } from "./ts-emit-core";
|
|
3
|
+
export type ConfigListKey = "databases" | "agents";
|
|
4
|
+
export interface ConfigListItem {
|
|
5
|
+
value: string;
|
|
6
|
+
comment?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* `appendUnique` keeps existing entries and appends only missing values.
|
|
10
|
+
* `replaceAll` rewrites the full list to exactly match provided items.
|
|
11
|
+
*/
|
|
12
|
+
export type ConfigListUpdateStrategy = "appendUnique" | "replaceAll";
|
|
13
|
+
/**
|
|
14
|
+
* Builds AST nodes for a starter `notion.config` module.
|
|
15
|
+
*
|
|
16
|
+
* Example:
|
|
17
|
+
* `buildConfigTemplateModuleAst({ isTS: true })`
|
|
18
|
+
* builds:
|
|
19
|
+
* - `const auth = process.env.NOTION_KEY || "...";`
|
|
20
|
+
* - `const NotionConfig = { auth, databases: [], agents: [] };`
|
|
21
|
+
* - `export default NotionConfig`
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildConfigTemplateModuleAst(args: {
|
|
24
|
+
isTS: boolean;
|
|
25
|
+
}): ts.Statement[];
|
|
26
|
+
/**
|
|
27
|
+
* Renders the starter `notion.config` module to source code text.
|
|
28
|
+
*
|
|
29
|
+
* Example:
|
|
30
|
+
* `renderConfigTemplateModule({ isTS: false })`
|
|
31
|
+
* returns CommonJS config source.
|
|
32
|
+
*/
|
|
33
|
+
export declare function renderConfigTemplateModule(args: {
|
|
34
|
+
isTS: boolean;
|
|
35
|
+
context?: TsEmitContext;
|
|
36
|
+
}): string;
|
|
37
|
+
/**
|
|
38
|
+
* Updates one config list (`databases` or `agents`) inside module source code.
|
|
39
|
+
*
|
|
40
|
+
* Example (append only new IDs):
|
|
41
|
+
* `updateConfigListInConfigModule({ sourceCode, isTS: true, key: "databases", strategy: "appendUnique", items: [...] })`
|
|
42
|
+
*
|
|
43
|
+
* Example (replace entire list):
|
|
44
|
+
* `updateConfigListInConfigModule({ sourceCode, isTS: true, key: "agents", strategy: "replaceAll", items: [...] })`
|
|
45
|
+
*/
|
|
46
|
+
export declare function updateConfigListInConfigModule(args: {
|
|
47
|
+
sourceCode: string;
|
|
48
|
+
isTS: boolean;
|
|
49
|
+
key: ConfigListKey;
|
|
50
|
+
items: ConfigListItem[];
|
|
51
|
+
strategy: ConfigListUpdateStrategy;
|
|
52
|
+
}): {
|
|
53
|
+
modified: boolean;
|
|
54
|
+
code: string;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=config-emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-emitter.d.ts","sourceRoot":"","sources":["../../../../../src/ast/shared/emit/config-emitter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAGN,KAAK,aAAa,EAClB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG,YAAY,CAAC;AAmErE;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IAClD,IAAI,EAAE,OAAO,CAAC;CACd,GAAG,EAAE,CAAC,SAAS,EAAE,CAiDjB;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAChD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,aAAa,CAAC;CACxB,GAAG,MAAM,CAWT;AAybD;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,aAAa,CAAC;IACnB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,QAAQ,EAAE,wBAAwB,CAAC;CACnC,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAgCtC"}
|