primitive-admin 1.2.0-alpha.1 → 1.2.0-alpha.10
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 +105 -134
- package/assets/skill/skills/primitive-platform/SKILL.md +37 -4
- package/dist/bin/primitive.js +30 -35
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/agent-sessions.d.ts +133 -0
- package/dist/src/commands/agent-sessions.js +792 -0
- package/dist/src/commands/agent-sessions.js.map +1 -0
- package/dist/src/commands/analytics.js +0 -148
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps-children.d.ts +54 -0
- package/dist/src/commands/apps-children.js +631 -0
- package/dist/src/commands/apps-children.js.map +1 -0
- package/dist/src/commands/apps.d.ts +6 -0
- package/dist/src/commands/apps.js +131 -9
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.d.ts +3 -3
- package/dist/src/commands/auth-sessions.js +117 -23
- package/dist/src/commands/auth-sessions.js.map +1 -1
- package/dist/src/commands/auth.js +460 -36
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/collections.js +316 -256
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/config.d.ts +1 -1
- package/dist/src/commands/config.js +60 -28
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/connections.js +11 -12
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +2 -76
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.d.ts +9 -0
- package/dist/src/commands/databases.js +221 -457
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/db3-types.d.ts +15 -0
- package/dist/src/commands/db3-types.js +157 -0
- package/dist/src/commands/db3-types.js.map +1 -0
- package/dist/src/commands/db3.d.ts +12 -0
- package/dist/src/commands/db3.js +1052 -0
- package/dist/src/commands/db3.js.map +1 -0
- package/dist/src/commands/documents.d.ts +121 -2
- package/dist/src/commands/documents.js +1601 -1251
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/env.d.ts +9 -1
- package/dist/src/commands/env.js +164 -49
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/function-trigger-commands.d.ts +28 -0
- package/dist/src/commands/function-trigger-commands.js +341 -0
- package/dist/src/commands/function-trigger-commands.js.map +1 -0
- package/dist/src/commands/functions.js +297 -24
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/groups.js +150 -49
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +5 -5
- package/dist/src/commands/init.d.ts +7 -0
- package/dist/src/commands/init.js +23 -5
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +14 -8
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.d.ts +2 -2
- package/dist/src/commands/metadata-category-configs.js +2 -2
- package/dist/src/commands/prompts.d.ts +7 -0
- package/dist/src/commands/prompts.js +48 -5
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/scripts.d.ts +9 -17
- package/dist/src/commands/scripts.js +24 -479
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/sync-app-settings.d.ts +36 -8
- package/dist/src/commands/sync-app-settings.js +109 -23
- package/dist/src/commands/sync-app-settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +360 -610
- package/dist/src/commands/sync.js +3151 -6697
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +3 -3
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.js +77 -2
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/workflows.d.ts +5 -83
- package/dist/src/commands/workflows.js +57 -2282
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/aggregate-output.d.ts +25 -0
- package/dist/src/lib/aggregate-output.js +53 -0
- package/dist/src/lib/aggregate-output.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +681 -551
- package/dist/src/lib/api-client.js +880 -814
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +47 -1
- package/dist/src/lib/app-settings-descriptor.js +114 -10
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/auth-fixtures.d.ts +44 -0
- package/dist/src/lib/auth-fixtures.js +61 -0
- package/dist/src/lib/auth-fixtures.js.map +1 -0
- package/dist/src/lib/auth-flow.d.ts +41 -1
- package/dist/src/lib/auth-flow.js +70 -16
- package/dist/src/lib/auth-flow.js.map +1 -1
- package/dist/src/lib/block-layout.d.ts +12 -23
- package/dist/src/lib/block-layout.js +26 -92
- package/dist/src/lib/block-layout.js.map +1 -1
- package/dist/src/lib/block-selector.d.ts +2 -2
- package/dist/src/lib/block-selector.js +2 -2
- package/dist/src/lib/child-apps-local.d.ts +164 -0
- package/dist/src/lib/child-apps-local.js +258 -0
- package/dist/src/lib/child-apps-local.js.map +1 -0
- package/dist/src/lib/ci-session-request.d.ts +22 -0
- package/dist/src/lib/ci-session-request.js +51 -0
- package/dist/src/lib/ci-session-request.js.map +1 -0
- package/dist/src/lib/codegen-shared/generatedFiles.d.ts +10 -8
- package/dist/src/lib/codegen-shared/generatedFiles.js +21 -15
- package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +1 -1
- package/dist/src/lib/codegen-shared/prettierStable.js +1 -1
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +2 -2
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +2 -2
- package/dist/src/lib/collection-export.d.ts +76 -15
- package/dist/src/lib/collection-export.js +116 -23
- package/dist/src/lib/collection-export.js.map +1 -1
- package/dist/src/lib/collection-principal.d.ts +22 -0
- package/dist/src/lib/collection-principal.js +35 -0
- package/dist/src/lib/collection-principal.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +3 -22
- package/dist/src/lib/config-object-descriptor.js +56 -290
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-payload.js +2 -3
- package/dist/src/lib/config-payload.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +5 -7
- package/dist/src/lib/config-surface.js +18 -40
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/connections-list.d.ts +10 -0
- package/dist/src/lib/connections-list.js +18 -0
- package/dist/src/lib/connections-list.js.map +1 -0
- package/dist/src/lib/credentials-home.d.ts +58 -0
- package/dist/src/lib/credentials-home.js +204 -0
- package/dist/src/lib/credentials-home.js.map +1 -0
- package/dist/src/lib/credentials-lock.d.ts +88 -0
- package/dist/src/lib/credentials-lock.js +302 -0
- package/dist/src/lib/credentials-lock.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +179 -24
- package/dist/src/lib/credentials-store.js +712 -77
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/csv.d.ts +8 -9
- package/dist/src/lib/csv.js +3 -4
- package/dist/src/lib/csv.js.map +1 -1
- package/dist/src/lib/custodian.d.ts +8 -0
- package/dist/src/lib/custodian.js +18 -0
- package/dist/src/lib/custodian.js.map +1 -0
- package/dist/src/lib/db-codegen/dbGenerator.js +5 -16
- package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -1
- package/dist/src/lib/db-codegen/dbNaming.d.ts +5 -13
- package/dist/src/lib/db-codegen/dbNaming.js +5 -17
- package/dist/src/lib/db-codegen/dbNaming.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +7 -56
- package/dist/src/lib/db-codegen/dbTemplates.js +25 -125
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +2 -2
- package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +67 -2
- package/dist/src/lib/db-codegen/dbTypeIR.js +13 -2
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/db3-export.d.ts +231 -0
- package/dist/src/lib/db3-export.js +510 -0
- package/dist/src/lib/db3-export.js.map +1 -0
- package/dist/src/lib/db3-index-output.d.ts +27 -0
- package/dist/src/lib/db3-index-output.js +49 -0
- package/dist/src/lib/db3-index-output.js.map +1 -0
- package/dist/src/lib/document-export-lookups.d.ts +31 -0
- package/dist/src/lib/document-export-lookups.js +53 -0
- package/dist/src/lib/document-export-lookups.js.map +1 -0
- package/dist/src/lib/document-export-permissions.d.ts +7 -5
- package/dist/src/lib/document-export-permissions.js +7 -5
- package/dist/src/lib/document-export-permissions.js.map +1 -1
- package/dist/src/lib/document-export-record-log.d.ts +57 -0
- package/dist/src/lib/document-export-record-log.js +215 -0
- package/dist/src/lib/document-export-record-log.js.map +1 -0
- package/dist/src/lib/document-ingest-artifact.d.ts +26 -2
- package/dist/src/lib/document-ingest-artifact.js +42 -8
- package/dist/src/lib/document-ingest-artifact.js.map +1 -1
- package/dist/src/lib/document-ingest-format2.d.ts +36 -0
- package/dist/src/lib/document-ingest-format2.js +78 -0
- package/dist/src/lib/document-ingest-format2.js.map +1 -0
- package/dist/src/lib/document-ingest-input.d.ts +9 -0
- package/dist/src/lib/document-ingest-input.js +28 -1
- package/dist/src/lib/document-ingest-input.js.map +1 -1
- package/dist/src/lib/document-ingest-rows.d.ts +16 -0
- package/dist/src/lib/document-ingest-rows.js +17 -0
- package/dist/src/lib/document-ingest-rows.js.map +1 -1
- package/dist/src/lib/document-ingest.d.ts +33 -1
- package/dist/src/lib/document-ingest.js +49 -0
- package/dist/src/lib/document-ingest.js.map +1 -1
- package/dist/src/lib/document-schema-rows.d.ts +42 -0
- package/dist/src/lib/document-schema-rows.js +53 -0
- package/dist/src/lib/document-schema-rows.js.map +1 -0
- package/dist/src/lib/env-resolver-core.d.ts +70 -2
- package/dist/src/lib/env-resolver-core.js +137 -20
- package/dist/src/lib/env-resolver-core.js.map +1 -1
- package/dist/src/lib/env-resolver.d.ts +14 -2
- package/dist/src/lib/env-resolver.js +32 -10
- package/dist/src/lib/env-resolver.js.map +1 -1
- package/dist/src/lib/function-authorize-check.d.ts +142 -0
- package/dist/src/lib/function-authorize-check.js +310 -0
- package/dist/src/lib/function-authorize-check.js.map +1 -0
- package/dist/src/lib/function-authorize-view.d.ts +15 -0
- package/dist/src/lib/function-authorize-view.js +50 -0
- package/dist/src/lib/function-authorize-view.js.map +1 -0
- package/dist/src/lib/function-bundle.d.ts +38 -18
- package/dist/src/lib/function-bundle.js +96 -35
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +75 -12
- package/dist/src/lib/function-collect.js +427 -12
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +29 -0
- package/dist/src/lib/function-db-types.js +117 -7
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-document-types.d.ts +5 -3
- package/dist/src/lib/function-document-types.js +10 -14
- package/dist/src/lib/function-document-types.js.map +1 -1
- package/dist/src/lib/function-lint.d.ts +34 -0
- package/dist/src/lib/function-lint.js +112 -0
- package/dist/src/lib/function-lint.js.map +1 -0
- package/dist/src/lib/function-log-row.js +21 -2
- package/dist/src/lib/function-log-row.js.map +1 -1
- package/dist/src/lib/function-run.d.ts +16 -21
- package/dist/src/lib/function-run.js +37 -30
- package/dist/src/lib/function-run.js.map +1 -1
- package/dist/src/lib/function-schema-codegen.d.ts +1 -1
- package/dist/src/lib/function-schema-codegen.js +5 -5
- package/dist/src/lib/function-schema-codegen.js.map +1 -1
- package/dist/src/lib/function-source-roots.d.ts +67 -0
- package/dist/src/lib/function-source-roots.js +148 -0
- package/dist/src/lib/function-source-roots.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +108 -22
- package/dist/src/lib/function-sync.js +127 -39
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-trigger-listing.d.ts +11 -6
- package/dist/src/lib/function-trigger-listing.js +32 -11
- package/dist/src/lib/function-trigger-listing.js.map +1 -1
- package/dist/src/lib/function-typecheck.d.ts +37 -2
- package/dist/src/lib/function-typecheck.js +210 -28
- package/dist/src/lib/function-typecheck.js.map +1 -1
- package/dist/src/lib/function-versions.d.ts +2 -0
- package/dist/src/lib/function-versions.js +1 -0
- package/dist/src/lib/function-versions.js.map +1 -1
- package/dist/src/lib/generated-allowlist.js +0 -20
- package/dist/src/lib/generated-allowlist.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +703 -203
- package/dist/src/lib/generated-config-surfaces.js +2270 -2014
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/generated-sdk-types.d.ts +1 -1
- package/dist/src/lib/generated-sdk-types.js +1 -1
- package/dist/src/lib/generated-sdk-types.js.map +1 -1
- package/dist/src/lib/init-adopt.js +12 -3
- package/dist/src/lib/init-adopt.js.map +1 -1
- package/dist/src/lib/init-login-note.d.ts +13 -0
- package/dist/src/lib/init-login-note.js +22 -0
- package/dist/src/lib/init-login-note.js.map +1 -0
- package/dist/src/lib/json-value.d.ts +6 -0
- package/dist/src/lib/json-value.js +13 -0
- package/dist/src/lib/json-value.js.map +1 -0
- package/dist/src/lib/load-routes.d.ts +33 -0
- package/dist/src/lib/load-routes.js +35 -0
- package/dist/src/lib/load-routes.js.map +1 -0
- package/dist/src/lib/local-state.d.ts +38 -7
- package/dist/src/lib/local-state.js +172 -49
- package/dist/src/lib/local-state.js.map +1 -1
- package/dist/src/lib/local-test-cases.d.ts +5 -2
- package/dist/src/lib/local-test-cases.js +7 -4
- package/dist/src/lib/local-test-cases.js.map +1 -1
- package/dist/src/lib/log-inspection.d.ts +42 -4
- package/dist/src/lib/log-inspection.js +37 -5
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/login-exchange-check.d.ts +18 -0
- package/dist/src/lib/login-exchange-check.js +27 -0
- package/dist/src/lib/login-exchange-check.js.map +1 -0
- package/dist/src/lib/login-scope-lines.d.ts +25 -0
- package/dist/src/lib/login-scope-lines.js +45 -0
- package/dist/src/lib/login-scope-lines.js.map +1 -0
- package/dist/src/lib/logout-admin-session.d.ts +2 -1
- package/dist/src/lib/logout-admin-session.js +7 -1
- package/dist/src/lib/logout-admin-session.js.map +1 -1
- package/dist/src/lib/object-status-filter.d.ts +9 -1
- package/dist/src/lib/object-status-filter.js +9 -1
- package/dist/src/lib/object-status-filter.js.map +1 -1
- package/dist/src/lib/output.js +2 -0
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/paginate.d.ts +0 -5
- package/dist/src/lib/paginate.js +0 -5
- package/dist/src/lib/paginate.js.map +1 -1
- package/dist/src/lib/pin-refusal-hint.d.ts +12 -0
- package/dist/src/lib/pin-refusal-hint.js +35 -0
- package/dist/src/lib/pin-refusal-hint.js.map +1 -0
- package/dist/src/lib/primitive-env-plugin.d.ts +99 -0
- package/dist/src/lib/primitive-env-plugin.js +408 -0
- package/dist/src/lib/primitive-env-plugin.js.map +1 -0
- package/dist/src/lib/project-config.d.ts +7 -0
- package/dist/src/lib/project-config.js +22 -1
- package/dist/src/lib/project-config.js.map +1 -1
- package/dist/src/lib/project-login-apps.d.ts +8 -0
- package/dist/src/lib/project-login-apps.js +27 -0
- package/dist/src/lib/project-login-apps.js.map +1 -0
- package/dist/src/lib/prompt-schema-codegen.d.ts +10 -3
- package/dist/src/lib/prompt-schema-codegen.js +52 -11
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
- package/dist/src/lib/pull-write.d.ts +31 -0
- package/dist/src/lib/pull-write.js +49 -0
- package/dist/src/lib/pull-write.js.map +1 -0
- package/dist/src/lib/push-failure-report.d.ts +45 -0
- package/dist/src/lib/push-failure-report.js +57 -0
- package/dist/src/lib/push-failure-report.js.map +1 -0
- package/dist/src/lib/records-verbs.d.ts +69 -0
- package/dist/src/lib/records-verbs.js +40 -0
- package/dist/src/lib/records-verbs.js.map +1 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +7 -0
- package/dist/src/lib/refresh-admin-credentials.js +16 -4
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
- package/dist/src/lib/root-import-decision.d.ts +65 -0
- package/dist/src/lib/root-import-decision.js +109 -0
- package/dist/src/lib/root-import-decision.js.map +1 -0
- package/dist/src/lib/run-status.d.ts +1 -1
- package/dist/src/lib/run-status.generated.d.ts +2 -2
- package/dist/src/lib/run-status.generated.js +3 -1
- package/dist/src/lib/run-status.generated.js.map +1 -1
- package/dist/src/lib/run-status.js +1 -1
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +129 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +269 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/schema-codegen/naming.d.ts +35 -0
- package/dist/src/lib/schema-codegen/naming.js +83 -0
- package/dist/src/lib/schema-codegen/naming.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaToTs.d.ts +82 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js +305 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/scope-request.d.ts +84 -0
- package/dist/src/lib/scope-request.js +235 -0
- package/dist/src/lib/scope-request.js.map +1 -0
- package/dist/src/lib/session-id.d.ts +9 -0
- package/dist/src/lib/session-id.js +28 -0
- package/dist/src/lib/session-id.js.map +1 -0
- package/dist/src/lib/snapshot-build-rows.d.ts +21 -0
- package/dist/src/lib/snapshot-build-rows.js +22 -0
- package/dist/src/lib/snapshot-build-rows.js.map +1 -1
- package/dist/src/lib/snapshot-build.js +8 -3
- package/dist/src/lib/snapshot-build.js.map +1 -1
- package/dist/src/lib/snapshots.d.ts +17 -1
- package/dist/src/lib/snapshots.js +50 -2
- package/dist/src/lib/snapshots.js.map +1 -1
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +6 -2
- package/dist/src/lib/swift-codegen/agentGenerator.js +57 -5
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/banners.d.ts +34 -7
- package/dist/src/lib/swift-codegen/banners.js +37 -7
- package/dist/src/lib/swift-codegen/banners.js.map +1 -1
- package/dist/src/lib/swift-codegen/dbGenerator.d.ts +4 -3
- package/dist/src/lib/swift-codegen/dbGenerator.js +14 -117
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +3 -3
- package/dist/src/lib/swift-codegen/functionGenerator.js +23 -18
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/generator.d.ts +5 -5
- package/dist/src/lib/swift-codegen/generator.js +35 -40
- package/dist/src/lib/swift-codegen/generator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +3 -3
- package/dist/src/lib/swift-codegen/schemaToSwift.js +4 -4
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
- package/dist/src/lib/swift-codegen/swiftKeys.d.ts +19 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js +31 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +35 -0
- package/dist/src/lib/sync-paths.js +57 -5
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/sync-resource-types.d.ts +26 -26
- package/dist/src/lib/sync-resource-types.js +61 -189
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +5 -1
- package/dist/src/lib/sync-selectors.js +23 -13
- package/dist/src/lib/sync-selectors.js.map +1 -1
- package/dist/src/lib/test-case-file-names.d.ts +3 -5
- package/dist/src/lib/test-case-file-names.js +3 -5
- package/dist/src/lib/test-case-file-names.js.map +1 -1
- package/dist/src/lib/toml-database-config.d.ts +15 -75
- package/dist/src/lib/toml-database-config.js +17 -306
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/transient-retry.d.ts +43 -0
- package/dist/src/lib/transient-retry.js +94 -0
- package/dist/src/lib/transient-retry.js.map +1 -0
- package/dist/src/lib/vars-override.d.ts +105 -0
- package/dist/src/lib/vars-override.js +143 -0
- package/dist/src/lib/vars-override.js.map +1 -0
- package/dist/src/lib/webhook-capture.d.ts +43 -0
- package/dist/src/lib/webhook-capture.js +91 -0
- package/dist/src/lib/webhook-capture.js.map +1 -0
- package/dist/src/lib/webhook-deliver.d.ts +18 -20
- package/dist/src/lib/webhook-deliver.js +34 -89
- package/dist/src/lib/webhook-deliver.js.map +1 -1
- package/dist/src/lib/webhook-test-run.d.ts +32 -0
- package/dist/src/lib/webhook-test-run.js +108 -0
- package/dist/src/lib/webhook-test-run.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generator.d.ts +7 -7
- package/dist/src/lib/workflow-codegen/generator.js +16 -23
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +6 -12
- package/dist/src/lib/workflow-codegen/invokerIR.js +4 -5
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
- package/dist/src/lib/workflow-toml-validator.d.ts +2 -0
- package/dist/src/lib/workflow-toml-validator.js +28 -1
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/dist/src/types/index.d.ts +30 -37
- package/dist/src/validators.d.ts +7 -55
- package/dist/src/validators.js +7 -53
- package/dist/src/validators.js.map +1 -1
- package/dist/src/vite.d.ts +17 -0
- package/dist/src/vite.js +18 -0
- package/dist/src/vite.js.map +1 -0
- package/package.json +20 -12
|
@@ -201,8 +201,12 @@ export function trackedSelectorKeys(syncState, options) {
|
|
|
201
201
|
* retire one tracked key — the operator had to restore the TOML, which prune
|
|
202
202
|
* would then decline to consider, or drop `--only` and push the whole tree.
|
|
203
203
|
* Callers that pass no `tracked` keep the local-files-only meaning.
|
|
204
|
+
*
|
|
205
|
+
* `varsOverridePath` is the selected machine-local environment's
|
|
206
|
+
* `vars.<name>.override.toml` (#4485): a key either file declares is matched,
|
|
207
|
+
* and either file existing is "the file exists" for a tracked key.
|
|
204
208
|
*/
|
|
205
|
-
export function unmatchedSelectors(selection, configDir, tracked) {
|
|
209
|
+
export function unmatchedSelectors(selection, configDir, tracked, varsOverridePath) {
|
|
206
210
|
const missing = [];
|
|
207
211
|
for (const [label, keys] of selection.entityKeys) {
|
|
208
212
|
const descriptor = getConfigObjectDescriptor(label);
|
|
@@ -228,24 +232,30 @@ export function unmatchedSelectors(selection, configDir, tracked) {
|
|
|
228
232
|
missing.push("app");
|
|
229
233
|
}
|
|
230
234
|
if (selection.varKeys.size > 0) {
|
|
231
|
-
const
|
|
232
|
-
// The tracked-var fallback below needs
|
|
233
|
-
// key it matches is one
|
|
234
|
-
// from a PARSED
|
|
235
|
+
const varsFiles = [join(configDir, "vars.toml"), ...(varsOverridePath ? [varsOverridePath] : [])];
|
|
236
|
+
// The tracked-var fallback below needs a var file to exist, even though the
|
|
237
|
+
// key it matches is one no file declares any more: push plans var writes
|
|
238
|
+
// from a PARSED var table only (`preflightParsedVars` → `planVarsPush`),
|
|
235
239
|
// so with no file at all the deletion that would justify the selector is
|
|
236
|
-
// never planned and the push applies nothing.
|
|
237
|
-
//
|
|
238
|
-
|
|
240
|
+
// never planned and the push applies nothing. No var file at all is still
|
|
241
|
+
// this check's to refuse.
|
|
242
|
+
let varsFileExists = false;
|
|
239
243
|
let declared = new Set();
|
|
240
|
-
|
|
244
|
+
for (const varsPath of varsFiles) {
|
|
245
|
+
if (!existsSync(varsPath))
|
|
246
|
+
continue;
|
|
247
|
+
varsFileExists = true;
|
|
241
248
|
try {
|
|
242
|
-
//
|
|
243
|
-
|
|
249
|
+
// A var file is a FLAT root table — `API_BASE_URL = "…"`, no section.
|
|
250
|
+
for (const key of Object.keys(parseConfigToml(readFileSync(varsPath, "utf-8")))) {
|
|
251
|
+
declared.add(key);
|
|
252
|
+
}
|
|
244
253
|
}
|
|
245
254
|
catch {
|
|
246
|
-
// A malformed
|
|
255
|
+
// A malformed var file is the push preflight's error to report, not
|
|
247
256
|
// this check's — treat it as "cannot tell" and stay quiet.
|
|
248
|
-
declared = selection.varKeys;
|
|
257
|
+
declared = new Set(selection.varKeys);
|
|
258
|
+
break;
|
|
249
259
|
}
|
|
250
260
|
}
|
|
251
261
|
for (const key of selection.varKeys) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-selectors.js","sourceRoot":"","sources":["../../../src/lib/sync-selectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3D,qEAAqE;AACrE,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAaD,MAAM,YAAY,GAAG,IAAI,GAAG,CAC1B,yBAAyB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAC3E,CAAC;AAEF,MAAM,aAAa,GAAG,IAAI,GAAG,CAC3B,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAC5E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AAU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,WAAW,CAAC,GAAG,CAAC;SACpB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAC3C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SAC9B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
* What a test case's sidecar file is called (#2896).
|
|
3
3
|
*
|
|
4
4
|
* `config pull` writes these names, `config push` pairs files back to live
|
|
5
|
-
* cases by them, `config diff` reports them
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* a case's file differently from pull would either miss a file that never runs
|
|
9
|
-
* or accuse one that does.
|
|
5
|
+
* cases by them, and `config diff` reports them. They live here, in `lib/`, so
|
|
6
|
+
* all three read the SAME rule: a verb that named a case's file differently
|
|
7
|
+
* from pull would either miss a file that never runs or accuse one that does.
|
|
10
8
|
*/
|
|
11
9
|
export declare function slugifyTestCaseName(name: string): string;
|
|
12
10
|
/**
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
* What a test case's sidecar file is called (#2896).
|
|
3
3
|
*
|
|
4
4
|
* `config pull` writes these names, `config push` pairs files back to live
|
|
5
|
-
* cases by them, `config diff` reports them
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* a case's file differently from pull would either miss a file that never runs
|
|
9
|
-
* or accuse one that does.
|
|
5
|
+
* cases by them, and `config diff` reports them. They live here, in `lib/`, so
|
|
6
|
+
* all three read the SAME rule: a verb that named a case's file differently
|
|
7
|
+
* from pull would either miss a file that never runs or accuse one that does.
|
|
10
8
|
*/
|
|
11
9
|
import { normalizeTestCaseKey, testCaseKeyError } from "./test-case-keys.js";
|
|
12
10
|
// Test case helpers (exported for unit testing)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-case-file-names.js","sourceRoot":"","sources":["../../../src/lib/test-case-file-names.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"test-case-file-names.js","sourceRoot":"","sources":["../../../src/lib/test-case-file-names.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,gDAAgD;AAChD,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;WACrB,MAAM,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAY,EACZ,SAAsB,EACtB,SAAmC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;IAEjD,MAAM,KAAK,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IACtE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACjB,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,OAAO,KAAK,CAAC,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,QAAQ,GAAG,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC;IACtC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChC,OAAO,QAAQ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B,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,EAC5C,IAAI,EACJ,MAAM,CACP,CACF,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,84 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The database type config file's TOML builder, and the readers of the
|
|
3
|
+
* `[[operations]]` / `[[subscriptions]]` row shapes the database codegen still
|
|
4
|
+
* renders.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Three responsibilities:
|
|
12
|
-
* 1. `detectExistingOperationForms()` — read the raw TOML source and
|
|
13
|
-
* decide, per operation name, whether the file uses JSON-string
|
|
14
|
-
* form ("legacy") or nested-table form ("native") for each of
|
|
15
|
-
* `definition` and `params`. This drives form preservation on
|
|
16
|
-
* `config pull`.
|
|
17
|
-
* 2. `canEmitNative()` — recursively check whether a JS value can be
|
|
18
|
-
* represented in TOML **without data loss**. Returns a reason string
|
|
19
|
-
* if not. Catches `null`/`undefined` (and arrays containing `null`),
|
|
20
|
-
* which every TOML serializer silently drops on write. Heterogeneous
|
|
21
|
-
* arrays are fine — the config round-trip uses `smol-toml` (TOML 1.0),
|
|
22
|
-
* which emits and re-parses them faithfully (issue #1450).
|
|
23
|
-
* 3. `buildDatabaseTypeTomlData()` — builds the JS object that we
|
|
24
|
-
* hand to `stringifyConfigToml`. Per operation, decides JSON-string vs
|
|
25
|
-
* native based on (existing form, can-emit, override mode).
|
|
26
|
-
*/
|
|
27
|
-
import { type FieldForm } from "./toml-native-form.js";
|
|
28
|
-
export { type FieldForm, classifyInlineFieldForm, canEmitNative, } from "./toml-native-form.js";
|
|
29
|
-
export interface OperationFormHints {
|
|
30
|
-
/** Map of op name → existing form for `definition`. Missing op = "default". */
|
|
31
|
-
definition: Map<string, FieldForm>;
|
|
32
|
-
/** Map of op name → existing form for `params`. Missing op = "default". */
|
|
33
|
-
params: Map<string, FieldForm>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Inspect the raw TOML source for a database-type file and decide which
|
|
37
|
-
* form each operation's `definition`/`params` currently use.
|
|
38
|
-
*
|
|
39
|
-
* Detection is intentionally simple: we walk `[[operations]]` blocks in
|
|
40
|
-
* source order and, for each one, look for either a `definition = '...'`
|
|
41
|
-
* line (legacy) or an `[operations.definition]` / `[operations.definition.X]`
|
|
42
|
-
* sub-header (native).
|
|
43
|
-
*/
|
|
44
|
-
export declare function detectExistingOperationForms(rawToml: string): OperationFormHints;
|
|
45
|
-
/**
|
|
46
|
-
* Normalize a `params` value into a sorted array of
|
|
47
|
-
* `{ name, type, required, ... }` rows, suitable for emitting as
|
|
48
|
-
* `[[operations.params]]`. Accepts both shapes the wire/parser supports:
|
|
49
|
-
* - object form: `{ projectId: { type: "string", required: true } }`
|
|
50
|
-
* - array form: `[{ name: "projectId", type: "string", required: true }]`
|
|
6
|
+
* #3189 — `config push`, `pull` and `diff` no longer read or write
|
|
7
|
+
* `[[operations]]` or `[[subscriptions]]`: both retired with database
|
|
8
|
+
* operations and type-scoped subscriptions, and a file carrying either is
|
|
9
|
+
* refused by name. `normalizeOperationFromToml` and
|
|
10
|
+
* `normalizeSubscriptionFromToml` stay only for the database IR
|
|
11
|
+
* (`db-codegen/dbTypeIR.ts`), which still reads a stale file's tables when it
|
|
12
|
+
* resolves its records.
|
|
51
13
|
*/
|
|
52
|
-
|
|
53
|
-
export interface BuildOptions {
|
|
54
|
-
/** Per-op form hints derived from `detectExistingOperationForms`. */
|
|
55
|
-
hints?: OperationFormHints;
|
|
56
|
-
/**
|
|
57
|
-
* Override the default form for ops with no hint. Used by `config pull`
|
|
58
|
-
* to keep behavior backwards-compatible if we ever flip the default,
|
|
59
|
-
* and by `config migrate-toml` to force native everywhere.
|
|
60
|
-
*/
|
|
61
|
-
defaultForm?: FieldForm;
|
|
62
|
-
/** Sink for human-readable fallback messages. */
|
|
63
|
-
logger?: (message: string) => void;
|
|
64
|
-
/**
|
|
65
|
-
* Server `DatabaseTypeSubscription` rows to emit as `[[subscriptions]]`
|
|
66
|
-
* blocks (issue #803). Already sanitized by the controller's
|
|
67
|
-
* `sanitizeSubscription` (so `select`/`emit` are arrays and `params` is an
|
|
68
|
-
* object). Omitted on the `migrate-toml` path (no subscriptions to merge).
|
|
69
|
-
*/
|
|
70
|
-
subscriptions?: any[];
|
|
71
|
-
}
|
|
14
|
+
import { DATABASE_TYPE_TABLE } from "./config-surface.js";
|
|
72
15
|
/**
|
|
73
16
|
* Build the JS object to pass to `stringifyConfigToml` for a database-type
|
|
74
|
-
* config file
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* - Else emit `definition = '<json string>'` and log a message.
|
|
78
|
-
* - Same logic independently for `params`, but the native form for
|
|
79
|
-
* params is `[[operations.params]]` (array-of-tables).
|
|
17
|
+
* config file: the `[type]` table, `[triggers]`, the `[models.*]` blocks and
|
|
18
|
+
* the declared-access manifest. #3189 — `[[operations]]` and
|
|
19
|
+
* `[[subscriptions]]` are retired and never written.
|
|
80
20
|
*/
|
|
81
|
-
export declare function buildDatabaseTypeTomlData(typeConfig: any,
|
|
21
|
+
export declare function buildDatabaseTypeTomlData(typeConfig: any, ruleSetIdToName: Map<string, string>, table?: typeof DATABASE_TYPE_TABLE): any;
|
|
82
22
|
/**
|
|
83
23
|
* Thrown when a `[[subscriptions]]` block declares both `accessRule` and
|
|
84
24
|
* `access` with different values. We never silently drop the field
|
|
@@ -1,180 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The database type config file's TOML builder, and the readers of the
|
|
3
|
+
* `[[operations]]` / `[[subscriptions]]` row shapes the database codegen still
|
|
4
|
+
* renders.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Three responsibilities:
|
|
12
|
-
* 1. `detectExistingOperationForms()` — read the raw TOML source and
|
|
13
|
-
* decide, per operation name, whether the file uses JSON-string
|
|
14
|
-
* form ("legacy") or nested-table form ("native") for each of
|
|
15
|
-
* `definition` and `params`. This drives form preservation on
|
|
16
|
-
* `config pull`.
|
|
17
|
-
* 2. `canEmitNative()` — recursively check whether a JS value can be
|
|
18
|
-
* represented in TOML **without data loss**. Returns a reason string
|
|
19
|
-
* if not. Catches `null`/`undefined` (and arrays containing `null`),
|
|
20
|
-
* which every TOML serializer silently drops on write. Heterogeneous
|
|
21
|
-
* arrays are fine — the config round-trip uses `smol-toml` (TOML 1.0),
|
|
22
|
-
* which emits and re-parses them faithfully (issue #1450).
|
|
23
|
-
* 3. `buildDatabaseTypeTomlData()` — builds the JS object that we
|
|
24
|
-
* hand to `stringifyConfigToml`. Per operation, decides JSON-string vs
|
|
25
|
-
* native based on (existing form, can-emit, override mode).
|
|
6
|
+
* #3189 — `config push`, `pull` and `diff` no longer read or write
|
|
7
|
+
* `[[operations]]` or `[[subscriptions]]`: both retired with database
|
|
8
|
+
* operations and type-scoped subscriptions, and a file carrying either is
|
|
9
|
+
* refused by name. `normalizeOperationFromToml` and
|
|
10
|
+
* `normalizeSubscriptionFromToml` stay only for the database IR
|
|
11
|
+
* (`db-codegen/dbTypeIR.ts`), which still reads a stale file's tables when it
|
|
12
|
+
* resolves its records.
|
|
26
13
|
*/
|
|
27
14
|
import { parseConfigToml } from "./config-toml.js";
|
|
28
15
|
import { serializeDeclaredAccessManifest } from "./toml-metadata-config.js";
|
|
29
16
|
import { DATABASE_TYPE_TABLE } from "./config-surface.js";
|
|
30
17
|
import { projectRecordToToml } from "./config-payload.js";
|
|
31
|
-
import { classifyInlineFieldForm, canEmitNative, } from "./toml-native-form.js";
|
|
32
|
-
// `FieldForm`, `classifyInlineFieldForm`, and `canEmitNative` moved to the
|
|
33
|
-
// neutral `toml-native-form.ts` module (issue #1446) so workflow-schema
|
|
34
|
-
// serialization can share them without importing a database-specific module.
|
|
35
|
-
// Re-exported here so existing importers keep working.
|
|
36
|
-
export { classifyInlineFieldForm, canEmitNative, } from "./toml-native-form.js";
|
|
37
|
-
/**
|
|
38
|
-
* Inspect the raw TOML source for a database-type file and decide which
|
|
39
|
-
* form each operation's `definition`/`params` currently use.
|
|
40
|
-
*
|
|
41
|
-
* Detection is intentionally simple: we walk `[[operations]]` blocks in
|
|
42
|
-
* source order and, for each one, look for either a `definition = '...'`
|
|
43
|
-
* line (legacy) or an `[operations.definition]` / `[operations.definition.X]`
|
|
44
|
-
* sub-header (native).
|
|
45
|
-
*/
|
|
46
|
-
export function detectExistingOperationForms(rawToml) {
|
|
47
|
-
const lines = rawToml.split(/\r?\n/);
|
|
48
|
-
const operations = [];
|
|
49
|
-
let current = null;
|
|
50
|
-
// `inSubTable` flips to true the moment we descend into a sub-table of
|
|
51
|
-
// the current operation (e.g. `[operations.definition]` or
|
|
52
|
-
// `[[operations.params]]`). Once true, subsequent `name = "..."` /
|
|
53
|
-
// `definition = "..."` / `params = "..."` lines belong to the sub-table,
|
|
54
|
-
// not to the operation itself, so we must not let them overwrite the
|
|
55
|
-
// op-level fields (review feedback r3246634568).
|
|
56
|
-
let inSubTable = false;
|
|
57
|
-
for (const rawLine of lines) {
|
|
58
|
-
const line = rawLine.trim();
|
|
59
|
-
if (line === "[[operations]]") {
|
|
60
|
-
if (current)
|
|
61
|
-
operations.push(current);
|
|
62
|
-
current = { name: null, definition: null, params: null };
|
|
63
|
-
inSubTable = false;
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (!current)
|
|
67
|
-
continue;
|
|
68
|
-
// Sub-header for this op's definition or params.
|
|
69
|
-
if (/^\[operations\.definition(\..+)?\]/.test(line) || /^\[\[operations\.definition\..+\]\]/.test(line)) {
|
|
70
|
-
if (current.definition === null)
|
|
71
|
-
current.definition = "native";
|
|
72
|
-
inSubTable = true;
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
if (/^\[\[operations\.params\]\]/.test(line) || /^\[operations\.params(\..+)?\]/.test(line)) {
|
|
76
|
-
if (current.params === null)
|
|
77
|
-
current.params = "native";
|
|
78
|
-
inSubTable = true;
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
// A new top-level array-of-tables block ends the operation's scope
|
|
82
|
-
// for our purposes. We don't fully parse TOML here; we just stop
|
|
83
|
-
// ascribing later lines to this op.
|
|
84
|
-
if (/^\[\[/.test(line) && !line.startsWith("[[operations.")) {
|
|
85
|
-
operations.push(current);
|
|
86
|
-
current = null;
|
|
87
|
-
inSubTable = false;
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (/^\[/.test(line) && !line.startsWith("[operations.")) {
|
|
91
|
-
operations.push(current);
|
|
92
|
-
current = null;
|
|
93
|
-
inSubTable = false;
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
// Op-level fields. Skip if we've already descended into a sub-table —
|
|
97
|
-
// a `name = "id"` inside `[[operations.params]]` belongs to the param,
|
|
98
|
-
// not to the operation. Same for any other key we recognize here.
|
|
99
|
-
if (inSubTable)
|
|
100
|
-
continue;
|
|
101
|
-
const m = line.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(.*)$/);
|
|
102
|
-
if (!m)
|
|
103
|
-
continue;
|
|
104
|
-
const key = m[1];
|
|
105
|
-
const value = m[2];
|
|
106
|
-
if (key === "name") {
|
|
107
|
-
const nameMatch = value.match(/^["'](.+)["']\s*$/);
|
|
108
|
-
if (nameMatch)
|
|
109
|
-
current.name = nameMatch[1];
|
|
110
|
-
}
|
|
111
|
-
else if (key === "definition" && current.definition === null) {
|
|
112
|
-
// Distinguish the inline-table form (`definition = { ... }`) from the
|
|
113
|
-
// legacy JSON-string form (`definition = '...'`) so an inline author
|
|
114
|
-
// round-trips through native emission, not back to a JSON string
|
|
115
|
-
// (issue #1255).
|
|
116
|
-
current.definition = classifyInlineFieldForm(value);
|
|
117
|
-
}
|
|
118
|
-
else if (key === "params" && current.params === null) {
|
|
119
|
-
current.params = classifyInlineFieldForm(value);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (current)
|
|
123
|
-
operations.push(current);
|
|
124
|
-
const definition = new Map();
|
|
125
|
-
const params = new Map();
|
|
126
|
-
for (const op of operations) {
|
|
127
|
-
if (!op.name)
|
|
128
|
-
continue;
|
|
129
|
-
if (op.definition)
|
|
130
|
-
definition.set(op.name, op.definition);
|
|
131
|
-
if (op.params)
|
|
132
|
-
params.set(op.name, op.params);
|
|
133
|
-
}
|
|
134
|
-
return { definition, params };
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Normalize a `params` value into a sorted array of
|
|
138
|
-
* `{ name, type, required, ... }` rows, suitable for emitting as
|
|
139
|
-
* `[[operations.params]]`. Accepts both shapes the wire/parser supports:
|
|
140
|
-
* - object form: `{ projectId: { type: "string", required: true } }`
|
|
141
|
-
* - array form: `[{ name: "projectId", type: "string", required: true }]`
|
|
142
|
-
*/
|
|
143
|
-
export function normalizeParamsToArray(params) {
|
|
144
|
-
if (params == null)
|
|
145
|
-
return null;
|
|
146
|
-
if (Array.isArray(params)) {
|
|
147
|
-
return params
|
|
148
|
-
.map((p) => ({ ...p }))
|
|
149
|
-
.filter((p) => p && typeof p === "object");
|
|
150
|
-
}
|
|
151
|
-
if (typeof params === "object") {
|
|
152
|
-
return Object.entries(params).map(([name, spec]) => ({
|
|
153
|
-
name,
|
|
154
|
-
...(spec && typeof spec === "object" ? spec : {}),
|
|
155
|
-
}));
|
|
156
|
-
}
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Default form for a new operation (no existing form hint): native.
|
|
161
|
-
* That matches the issue's "new file from server → native by default"
|
|
162
|
-
* requirement.
|
|
163
|
-
*/
|
|
164
|
-
const DEFAULT_FORM = "native";
|
|
165
18
|
/**
|
|
166
19
|
* Build the JS object to pass to `stringifyConfigToml` for a database-type
|
|
167
|
-
* config file
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* - Else emit `definition = '<json string>'` and log a message.
|
|
171
|
-
* - Same logic independently for `params`, but the native form for
|
|
172
|
-
* params is `[[operations.params]]` (array-of-tables).
|
|
20
|
+
* config file: the `[type]` table, `[triggers]`, the `[models.*]` blocks and
|
|
21
|
+
* the declared-access manifest. #3189 — `[[operations]]` and
|
|
22
|
+
* `[[subscriptions]]` are retired and never written.
|
|
173
23
|
*/
|
|
174
|
-
export function buildDatabaseTypeTomlData(typeConfig,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
const log = options.logger ?? (() => { });
|
|
24
|
+
export function buildDatabaseTypeTomlData(typeConfig, ruleSetIdToName,
|
|
25
|
+
// #4802 — a db3 type file's `[type]` table names the type `name`.
|
|
26
|
+
table = DATABASE_TYPE_TABLE) {
|
|
178
27
|
// #2644 — the `[type]` key set comes from the vendored definition, so a
|
|
179
28
|
// scalar added there is written with no edit here. Only the two keys whose
|
|
180
29
|
// emitted VALUE is their own carry a producer:
|
|
@@ -190,7 +39,7 @@ export function buildDatabaseTypeTomlData(typeConfig, operations, ruleSetIdToNam
|
|
|
190
39
|
// the parsed `{ create?, update?, models? }` object, which serializes 1:1
|
|
191
40
|
// so a pull → push cycle is idempotent.
|
|
192
41
|
const data = {
|
|
193
|
-
type: projectRecordToToml(
|
|
42
|
+
type: projectRecordToToml(table, typeConfig, {
|
|
194
43
|
ruleSetId: (record) => {
|
|
195
44
|
if (record?._ruleSetName)
|
|
196
45
|
return record._ruleSetName;
|
|
@@ -221,147 +70,9 @@ export function buildDatabaseTypeTomlData(typeConfig, operations, ruleSetIdToNam
|
|
|
221
70
|
}
|
|
222
71
|
// Declared-access manifest (issue #1304, P-C): merge the top-level
|
|
223
72
|
// `[metadata]` + `secrets` fragments so a pull→push→pull cycle round-trips.
|
|
224
|
-
// Emitted before the operations-only early return so a type with a manifest
|
|
225
|
-
// but no operations still writes it.
|
|
226
73
|
Object.assign(data, serializeDeclaredAccessManifest(typeConfig.metadataManifest));
|
|
227
|
-
// Subscriptions (issue #803) — emitted as `[[subscriptions]]` array-of-
|
|
228
|
-
// tables, independent of operations. Built before the operations-only
|
|
229
|
-
// early return so a type with subscriptions but no operations still emits
|
|
230
|
-
// them.
|
|
231
|
-
const subscriptionRows = buildSubscriptionRows(options.subscriptions, log);
|
|
232
|
-
if (operations.length === 0) {
|
|
233
|
-
if (subscriptionRows.length > 0) {
|
|
234
|
-
data.subscriptions = subscriptionRows;
|
|
235
|
-
}
|
|
236
|
-
return data;
|
|
237
|
-
}
|
|
238
|
-
data.operations = operations.map((op) => {
|
|
239
|
-
const opRow = {
|
|
240
|
-
name: op.name,
|
|
241
|
-
type: op.type,
|
|
242
|
-
modelName: op.modelName,
|
|
243
|
-
};
|
|
244
|
-
if (op.access) {
|
|
245
|
-
opRow.access = op.access;
|
|
246
|
-
}
|
|
247
|
-
// ---- definition ----
|
|
248
|
-
const defForm = hints?.definition.get(op.name) ?? defaultForm;
|
|
249
|
-
const defValue = typeof op.definition === "string"
|
|
250
|
-
? safeParseJson(op.definition)
|
|
251
|
-
: op.definition;
|
|
252
|
-
let definitionEmitted = false;
|
|
253
|
-
if (defForm === "native" && defValue && typeof defValue === "object") {
|
|
254
|
-
const reason = canEmitNative(defValue);
|
|
255
|
-
if (reason) {
|
|
256
|
-
log(`Operation '${op.name}': cannot emit \`definition\` as native TOML (${reason}); falling back to JSON string for this field.`);
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
opRow.definition = defValue;
|
|
260
|
-
definitionEmitted = true;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
if (!definitionEmitted) {
|
|
264
|
-
opRow.definition = typeof op.definition === "object"
|
|
265
|
-
? JSON.stringify(op.definition)
|
|
266
|
-
: op.definition;
|
|
267
|
-
}
|
|
268
|
-
// ---- params ----
|
|
269
|
-
if (op.params != null) {
|
|
270
|
-
const paramsForm = hints?.params.get(op.name) ?? defaultForm;
|
|
271
|
-
let paramsEmitted = false;
|
|
272
|
-
if (paramsForm === "native") {
|
|
273
|
-
const paramsParsed = typeof op.params === "string"
|
|
274
|
-
? safeParseJson(op.params)
|
|
275
|
-
: op.params;
|
|
276
|
-
const paramsArray = normalizeParamsToArray(paramsParsed);
|
|
277
|
-
if (paramsArray && paramsArray.length > 0) {
|
|
278
|
-
const reason = canEmitNative(paramsArray);
|
|
279
|
-
if (reason) {
|
|
280
|
-
log(`Operation '${op.name}': cannot emit \`params\` as native TOML (${reason}); falling back to JSON string for this field.`);
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
opRow.params = paramsArray;
|
|
284
|
-
paramsEmitted = true;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
else if (paramsArray && paramsArray.length === 0) {
|
|
288
|
-
// Empty params: skip entirely rather than emitting an empty table.
|
|
289
|
-
paramsEmitted = true;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
if (!paramsEmitted) {
|
|
293
|
-
opRow.params = typeof op.params === "object"
|
|
294
|
-
? JSON.stringify(op.params)
|
|
295
|
-
: op.params;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
return opRow;
|
|
299
|
-
});
|
|
300
|
-
if (subscriptionRows.length > 0) {
|
|
301
|
-
data.subscriptions = subscriptionRows;
|
|
302
|
-
}
|
|
303
74
|
return data;
|
|
304
75
|
}
|
|
305
|
-
/**
|
|
306
|
-
* Build the `[[subscriptions]]` rows for a database-type TOML file from the
|
|
307
|
-
* server's sanitized subscription list (issue #803).
|
|
308
|
-
*
|
|
309
|
-
* Emits the canonical TOML key order and uses the wire key `access` (we read
|
|
310
|
-
* both `access` and `accessRule` on parse, but always emit `access` so a
|
|
311
|
-
* pull → push round-trip is stable). `select` / `emit` are plain string
|
|
312
|
-
* arrays; `params` is an inline object. Falls back to a JSON string for any
|
|
313
|
-
* field that TOML can't represent natively (mirrors operations'
|
|
314
|
-
* `definition` / `params` fallback), so an exotic `params` shape never
|
|
315
|
-
* breaks serialization.
|
|
316
|
-
*/
|
|
317
|
-
function buildSubscriptionRows(subscriptions, log) {
|
|
318
|
-
if (!Array.isArray(subscriptions) || subscriptions.length === 0)
|
|
319
|
-
return [];
|
|
320
|
-
return subscriptions.map((sub) => {
|
|
321
|
-
const row = {
|
|
322
|
-
subscriptionKey: sub.subscriptionKey,
|
|
323
|
-
displayName: sub.displayName,
|
|
324
|
-
modelName: sub.modelName,
|
|
325
|
-
};
|
|
326
|
-
if (sub.description != null && sub.description !== "") {
|
|
327
|
-
row.description = sub.description;
|
|
328
|
-
}
|
|
329
|
-
if (sub.filter != null) {
|
|
330
|
-
row.filter = sub.filter;
|
|
331
|
-
}
|
|
332
|
-
if (sub.access != null) {
|
|
333
|
-
row.access = sub.access;
|
|
334
|
-
}
|
|
335
|
-
// `select` / `emit`: server sanitizes to arrays (or null). Emit when a
|
|
336
|
-
// non-empty array is present.
|
|
337
|
-
if (Array.isArray(sub.select) && sub.select.length > 0) {
|
|
338
|
-
row.select = sub.select;
|
|
339
|
-
}
|
|
340
|
-
if (Array.isArray(sub.emit) && sub.emit.length > 0) {
|
|
341
|
-
row.emit = sub.emit;
|
|
342
|
-
}
|
|
343
|
-
// `params`: server sanitizes to an object (or {}). Emit when non-empty.
|
|
344
|
-
if (sub.params &&
|
|
345
|
-
typeof sub.params === "object" &&
|
|
346
|
-
!Array.isArray(sub.params) &&
|
|
347
|
-
Object.keys(sub.params).length > 0) {
|
|
348
|
-
const reason = canEmitNative(sub.params);
|
|
349
|
-
if (reason) {
|
|
350
|
-
log(`Subscription '${sub.subscriptionKey}': cannot emit \`params\` as native TOML (${reason}); falling back to JSON string.`);
|
|
351
|
-
row.params = JSON.stringify(sub.params);
|
|
352
|
-
}
|
|
353
|
-
else {
|
|
354
|
-
row.params = sub.params;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
// `status`: only emit when not the default "active" so round-tripped
|
|
358
|
-
// files stay clean.
|
|
359
|
-
if (sub.status && sub.status !== "active") {
|
|
360
|
-
row.status = sub.status;
|
|
361
|
-
}
|
|
362
|
-
return row;
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
76
|
function safeParseJson(s) {
|
|
366
77
|
try {
|
|
367
78
|
return JSON.parse(s);
|