primitive-admin 1.2.0-alpha.9 → 1.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +258 -186
- package/assets/skill/skills/primitive-platform/SKILL.md +93 -27
- package/dist/bin/primitive.js +15 -89
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.js +80 -17
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/agent-sessions.d.ts +129 -0
- package/dist/src/commands/agent-sessions.js +532 -20
- package/dist/src/commands/agent-sessions.js.map +1 -1
- package/dist/src/commands/analytics.js +207 -155
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps-children.js +3 -0
- package/dist/src/commands/apps-children.js.map +1 -1
- package/dist/src/commands/apps-transitions.d.ts +39 -0
- package/dist/src/commands/apps-transitions.js +198 -0
- package/dist/src/commands/apps-transitions.js.map +1 -0
- package/dist/src/commands/apps.d.ts +17 -0
- package/dist/src/commands/apps.js +108 -3
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.js +2 -0
- package/dist/src/commands/auth-sessions.js.map +1 -1
- package/dist/src/commands/auth.js +138 -44
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +2 -0
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/collections.js +318 -256
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/comparisons.js +2 -0
- package/dist/src/commands/comparisons.js.map +1 -1
- package/dist/src/commands/config.d.ts +2 -2
- package/dist/src/commands/config.js +59 -33
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/connections.js +2 -0
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +5 -3
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.js +6 -4
- 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 +159 -0
- package/dist/src/commands/db3-types.js.map +1 -0
- package/dist/src/commands/db3.d.ts +24 -0
- package/dist/src/commands/db3.js +1444 -0
- package/dist/src/commands/db3.js.map +1 -0
- package/dist/src/commands/documents.d.ts +110 -10
- package/dist/src/commands/documents.js +1012 -748
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +74 -0
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.js +8 -4
- 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 +376 -30
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/groups.js +168 -50
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +7 -5
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/hosting.d.ts +8 -0
- package/dist/src/commands/hosting.js +346 -0
- package/dist/src/commands/hosting.js.map +1 -0
- package/dist/src/commands/init.js +129 -38
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +82 -53
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/locks.d.ts +5 -3
- package/dist/src/commands/locks.js +19 -61
- package/dist/src/commands/locks.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.d.ts +2 -2
- package/dist/src/commands/metadata-category-configs.js +4 -2
- package/dist/src/commands/metadata-category-configs.js.map +1 -1
- package/dist/src/commands/metadata.js +41 -0
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +75 -52
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rate-counters.d.ts +19 -0
- package/dist/src/commands/rate-counters.js +104 -0
- package/dist/src/commands/rate-counters.js.map +1 -0
- package/dist/src/commands/rule-sets.d.ts +1 -1
- package/dist/src/commands/rule-sets.js +2 -1
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/schemas.d.ts +15 -0
- package/dist/src/commands/schemas.js +122 -0
- package/dist/src/commands/schemas.js.map +1 -0
- 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/secrets.js +47 -3
- package/dist/src/commands/secrets.js.map +1 -1
- package/dist/src/commands/sessions.js +2 -0
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/skill.js +2 -0
- package/dist/src/commands/skill.js.map +1 -1
- package/dist/src/commands/sync-schemas.d.ts +202 -0
- package/dist/src/commands/sync-schemas.js +629 -0
- package/dist/src/commands/sync-schemas.js.map +1 -0
- package/dist/src/commands/sync-user-properties.d.ts +118 -0
- package/dist/src/commands/sync-user-properties.js +276 -0
- package/dist/src/commands/sync-user-properties.js.map +1 -0
- package/dist/src/commands/sync.d.ts +518 -546
- package/dist/src/commands/sync.js +3010 -4877
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +5 -3
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/transitions.d.ts +54 -0
- package/dist/src/commands/transitions.js +418 -0
- package/dist/src/commands/transitions.js.map +1 -0
- package/dist/src/commands/usage.d.ts +18 -0
- package/dist/src/commands/usage.js +343 -0
- package/dist/src/commands/usage.js.map +1 -0
- package/dist/src/commands/user-properties.d.ts +14 -0
- package/dist/src/commands/user-properties.js +79 -0
- package/dist/src/commands/user-properties.js.map +1 -0
- package/dist/src/commands/users.js +911 -18
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +2 -0
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/waitlist.js +39 -4
- package/dist/src/commands/waitlist.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/analytics-query.d.ts +58 -0
- package/dist/src/lib/analytics-query.js +134 -0
- package/dist/src/lib/analytics-query.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +1818 -438
- package/dist/src/lib/api-client.js +965 -544
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +1 -1
- package/dist/src/lib/app-settings-descriptor.js +6 -0
- 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 +34 -1
- package/dist/src/lib/auth-flow.js +429 -13
- 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 +8 -14
- package/dist/src/lib/block-selector.js +8 -19
- package/dist/src/lib/block-selector.js.map +1 -1
- package/dist/src/lib/child-apps-local.d.ts +3 -1
- package/dist/src/lib/child-apps-local.js +9 -1
- package/dist/src/lib/child-apps-local.js.map +1 -1
- package/dist/src/lib/cli-manifest.d.ts +9 -0
- package/dist/src/lib/cli-manifest.js +10 -1
- package/dist/src/lib/cli-manifest.js.map +1 -1
- package/dist/src/lib/cli-version.d.ts +14 -0
- package/dist/src/lib/cli-version.js +38 -0
- package/dist/src/lib/cli-version.js.map +1 -0
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +41 -0
- package/dist/src/lib/codegen-shared/prettierStable.js +146 -24
- package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -1
- 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/command-groups.d.ts +30 -0
- package/dist/src/lib/command-groups.js +109 -0
- package/dist/src/lib/command-groups.js.map +1 -0
- package/dist/src/lib/command-status.d.ts +147 -0
- package/dist/src/lib/command-status.js +266 -0
- package/dist/src/lib/command-status.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +9 -22
- package/dist/src/lib/config-object-descriptor.js +107 -276
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +3 -7
- package/dist/src/lib/config-surface.js +9 -13
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/config-toml.d.ts +11 -2
- package/dist/src/lib/config-toml.js +25 -2
- package/dist/src/lib/config-toml.js.map +1 -1
- package/dist/src/lib/credentials-home.d.ts +7 -0
- package/dist/src/lib/credentials-home.js +45 -10
- package/dist/src/lib/credentials-home.js.map +1 -1
- package/dist/src/lib/credentials-lock.d.ts +14 -6
- package/dist/src/lib/credentials-lock.js +90 -10
- package/dist/src/lib/credentials-lock.js.map +1 -1
- package/dist/src/lib/credentials-store.d.ts +123 -70
- package/dist/src/lib/credentials-store.js +358 -113
- package/dist/src/lib/credentials-store.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/data-input.d.ts +1 -1
- package/dist/src/lib/data-input.js +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.js +3 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +38 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js +29 -7
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/db-type-records.d.ts +106 -0
- package/dist/src/lib/db-type-records.js +224 -0
- package/dist/src/lib/db-type-records.js.map +1 -0
- package/dist/src/lib/db3-export.d.ts +287 -0
- package/dist/src/lib/db3-export.js +647 -0
- package/dist/src/lib/db3-export.js.map +1 -0
- package/dist/src/lib/db3-index-output.d.ts +116 -0
- package/dist/src/lib/db3-index-output.js +223 -0
- package/dist/src/lib/db3-index-output.js.map +1 -0
- package/dist/src/lib/db3-type-models.d.ts +134 -0
- package/dist/src/lib/db3-type-models.js +452 -0
- package/dist/src/lib/db3-type-models.js.map +1 -0
- package/dist/src/lib/deprecation.d.ts +2 -2
- package/dist/src/lib/deprecation.js +2 -2
- package/dist/src/lib/document-ingest-artifact.d.ts +13 -0
- package/dist/src/lib/document-ingest-artifact.js +36 -6
- 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.d.ts +11 -1
- package/dist/src/lib/document-ingest.js +16 -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/experimental-apis.d.ts +36 -0
- package/dist/src/lib/experimental-apis.js +46 -0
- package/dist/src/lib/experimental-apis.js.map +1 -0
- package/dist/src/lib/file-attachment.d.ts +24 -0
- package/dist/src/lib/file-attachment.js +31 -0
- package/dist/src/lib/file-attachment.js.map +1 -0
- package/dist/src/lib/function-authorize-check.d.ts +142 -0
- package/dist/src/lib/function-authorize-check.js +311 -0
- package/dist/src/lib/function-authorize-check.js.map +1 -0
- package/dist/src/lib/function-authorize-view.d.ts +27 -0
- package/dist/src/lib/function-authorize-view.js +88 -0
- package/dist/src/lib/function-authorize-view.js.map +1 -0
- package/dist/src/lib/function-bundle.d.ts +27 -5
- package/dist/src/lib/function-bundle.js +142 -7
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +90 -12
- package/dist/src/lib/function-collect.js +482 -12
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +65 -11
- package/dist/src/lib/function-db-types.js +297 -157
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-document-types.d.ts +19 -7
- package/dist/src/lib/function-document-types.js +24 -12
- package/dist/src/lib/function-document-types.js.map +1 -1
- package/dist/src/lib/function-lint.d.ts +57 -0
- package/dist/src/lib/function-lint.js +234 -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 +13 -21
- package/dist/src/lib/function-run.js +14 -27
- package/dist/src/lib/function-run.js.map +1 -1
- package/dist/src/lib/function-schema-codegen.d.ts +86 -22
- package/dist/src/lib/function-schema-codegen.js +194 -88
- package/dist/src/lib/function-schema-codegen.js.map +1 -1
- package/dist/src/lib/function-schema-refs.d.ts +98 -0
- package/dist/src/lib/function-schema-refs.js +177 -0
- package/dist/src/lib/function-schema-refs.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +109 -6
- package/dist/src/lib/function-sync.js +179 -26
- 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 +52 -0
- package/dist/src/lib/function-typecheck.js +174 -54
- 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-build-flags.d.ts +13 -0
- package/dist/src/lib/generated-build-flags.js +14 -0
- package/dist/src/lib/generated-build-flags.js.map +1 -0
- package/dist/src/lib/generated-command-status.d.ts +6 -0
- package/dist/src/lib/generated-command-status.js +469 -0
- package/dist/src/lib/generated-command-status.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +538 -141
- package/dist/src/lib/generated-config-surfaces.js +1772 -1854
- 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/hosting-build.d.ts +97 -0
- package/dist/src/lib/hosting-build.js +204 -0
- package/dist/src/lib/hosting-build.js.map +1 -0
- package/dist/src/lib/hosting-client.d.ts +167 -0
- package/dist/src/lib/hosting-client.js +340 -0
- package/dist/src/lib/hosting-client.js.map +1 -0
- package/dist/src/lib/hosting-environments.d.ts +32 -0
- package/dist/src/lib/hosting-environments.js +74 -0
- package/dist/src/lib/hosting-environments.js.map +1 -0
- package/dist/src/lib/hosting-errors.d.ts +30 -0
- package/dist/src/lib/hosting-errors.js +43 -0
- package/dist/src/lib/hosting-errors.js.map +1 -0
- package/dist/src/lib/hosting-token.d.ts +46 -0
- package/dist/src/lib/hosting-token.js +60 -0
- package/dist/src/lib/hosting-token.js.map +1 -0
- package/dist/src/lib/hosting-wait.d.ts +42 -0
- package/dist/src/lib/hosting-wait.js +84 -0
- package/dist/src/lib/hosting-wait.js.map +1 -0
- package/dist/src/lib/hosting-wfp-upload.d.ts +86 -0
- package/dist/src/lib/hosting-wfp-upload.js +149 -0
- package/dist/src/lib/hosting-wfp-upload.js.map +1 -0
- package/dist/src/lib/init-assets.d.ts +2 -6
- package/dist/src/lib/init-assets.js +11 -27
- package/dist/src/lib/init-assets.js.map +1 -1
- package/dist/src/lib/init-ios-links.d.ts +11 -7
- package/dist/src/lib/init-ios-links.js +28 -22
- package/dist/src/lib/init-ios-links.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/init-schema.d.ts +15 -0
- package/dist/src/lib/init-schema.js +54 -0
- package/dist/src/lib/init-schema.js.map +1 -1
- package/dist/src/lib/integration-test-request.d.ts +54 -0
- package/dist/src/lib/integration-test-request.js +207 -0
- package/dist/src/lib/integration-test-request.js.map +1 -0
- package/dist/src/lib/invoker-shared-enums.d.ts +35 -0
- package/dist/src/lib/invoker-shared-enums.js +98 -0
- package/dist/src/lib/invoker-shared-enums.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/log-inspection.d.ts +23 -4
- package/dist/src/lib/log-inspection.js +14 -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 +17 -7
- package/dist/src/lib/login-scope-lines.js +33 -10
- package/dist/src/lib/login-scope-lines.js.map +1 -1
- package/dist/src/lib/metadata-report.d.ts +85 -0
- package/dist/src/lib/metadata-report.js +81 -0
- package/dist/src/lib/metadata-report.js.map +1 -0
- 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.d.ts +1 -1
- package/dist/src/lib/output.js +3 -1
- package/dist/src/lib/output.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/platform-owned.js +5 -0
- package/dist/src/lib/platform-owned.js.map +1 -1
- package/dist/src/lib/primitive-declaration-names.d.ts +21 -0
- package/dist/src/lib/primitive-declaration-names.js +22 -0
- package/dist/src/lib/primitive-declaration-names.js.map +1 -0
- package/dist/src/lib/primitive-declaration.d.ts +174 -0
- package/dist/src/lib/primitive-declaration.js +792 -0
- package/dist/src/lib/primitive-declaration.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-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 +36 -12
- package/dist/src/lib/prompt-schema-codegen.js +96 -100
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
- package/dist/src/lib/prompt-schema-document.d.ts +35 -0
- package/dist/src/lib/prompt-schema-document.js +92 -0
- package/dist/src/lib/prompt-schema-document.js.map +1 -0
- package/dist/src/lib/prompt-schema-refs.d.ts +173 -0
- package/dist/src/lib/prompt-schema-refs.js +478 -0
- package/dist/src/lib/prompt-schema-refs.js.map +1 -0
- package/dist/src/lib/records-verbs.d.ts +79 -0
- package/dist/src/lib/records-verbs.js +45 -0
- package/dist/src/lib/records-verbs.js.map +1 -0
- package/dist/src/lib/register-commands.d.ts +36 -0
- package/dist/src/lib/register-commands.js +37 -0
- package/dist/src/lib/register-commands.js.map +1 -0
- package/dist/src/lib/retired-imports.d.ts +53 -0
- package/dist/src/lib/retired-imports.js +120 -0
- package/dist/src/lib/retired-imports.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/compiledSpace.d.ts +62 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js +103 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.d.ts +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js +227 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.d.ts +85 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.d.ts +218 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js +397 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-table.d.ts +80 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js +542 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.d.ts +195 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js +503 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +258 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +422 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.d.ts +129 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js +475 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.d.ts +115 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js +274 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.d.ts +366 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js +1789 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.d.ts +27 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js +126 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js.map +1 -0
- package/dist/src/lib/schema-codegen/namedRefs.d.ts +56 -0
- package/dist/src/lib/schema-codegen/namedRefs.js +143 -0
- package/dist/src/lib/schema-codegen/namedRefs.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/schemaChanges.d.ts +74 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js +277 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaDocs.d.ts +69 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js +219 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaIR.d.ts +158 -0
- package/dist/src/lib/schema-codegen/schemaIR.js +279 -0
- package/dist/src/lib/schema-codegen/schemaIR.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaToTs.d.ts +109 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js +269 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/schema-codegen/valuesLists.d.ts +48 -0
- package/dist/src/lib/schema-codegen/valuesLists.js +144 -0
- package/dist/src/lib/schema-codegen/valuesLists.js.map +1 -0
- package/dist/src/lib/schema-family-index.d.ts +228 -0
- package/dist/src/lib/schema-family-index.js +813 -0
- package/dist/src/lib/schema-family-index.js.map +1 -0
- package/dist/src/lib/schema-pins.d.ts +82 -0
- package/dist/src/lib/schema-pins.js +198 -0
- package/dist/src/lib/schema-pins.js.map +1 -0
- package/dist/src/lib/schema-preview.d.ts +244 -0
- package/dist/src/lib/schema-preview.js +498 -0
- package/dist/src/lib/schema-preview.js.map +1 -0
- package/dist/src/lib/scope-request.d.ts +23 -11
- package/dist/src/lib/scope-request.js +69 -31
- package/dist/src/lib/scope-request.js.map +1 -1
- package/dist/src/lib/session-scope.d.ts +26 -0
- package/dist/src/lib/session-scope.js +58 -0
- package/dist/src/lib/session-scope.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +2 -2
- package/dist/src/lib/skill-installer.js +2 -21
- package/dist/src/lib/skill-installer.js.map +1 -1
- package/dist/src/lib/step-run-table.d.ts +1 -2
- package/dist/src/lib/step-run-table.js +1 -2
- package/dist/src/lib/step-run-table.js.map +1 -1
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +2 -1
- package/dist/src/lib/swift-codegen/agentGenerator.js +25 -23
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/banners.d.ts +12 -0
- package/dist/src/lib/swift-codegen/banners.js +12 -0
- package/dist/src/lib/swift-codegen/banners.js.map +1 -1
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +36 -1
- package/dist/src/lib/swift-codegen/functionGenerator.js +169 -51
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +33 -9
- package/dist/src/lib/swift-codegen/schemaToSwift.js +215 -179
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
- package/dist/src/lib/swift-codegen/sharedGenerator.d.ts +45 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js +165 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js.map +1 -0
- 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/swift-codegen/userPropertiesGenerator.d.ts +30 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js +69 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +117 -31
- package/dist/src/lib/sync-resource-types.js +197 -189
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +7 -0
- package/dist/src/lib/sync-selectors.js +22 -2
- package/dist/src/lib/sync-selectors.js.map +1 -1
- package/dist/src/lib/template.d.ts +39 -3
- package/dist/src/lib/template.js +103 -14
- package/dist/src/lib/template.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/test-runs.d.ts +45 -0
- package/dist/src/lib/test-runs.js +150 -0
- package/dist/src/lib/test-runs.js.map +1 -0
- package/dist/src/lib/test-users.d.ts +25 -0
- package/dist/src/lib/test-users.js +36 -0
- package/dist/src/lib/test-users.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +4 -2
- package/dist/src/lib/toml-database-config.js +11 -6
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/toml-scalar-edit.js +6 -4
- package/dist/src/lib/toml-scalar-edit.js.map +1 -1
- package/dist/src/lib/transition-warnings.d.ts +21 -0
- package/dist/src/lib/transition-warnings.js +49 -0
- package/dist/src/lib/transition-warnings.js.map +1 -0
- package/dist/src/lib/user-index.d.ts +80 -0
- package/dist/src/lib/user-index.js +166 -0
- package/dist/src/lib/user-index.js.map +1 -0
- package/dist/src/lib/user-properties/generated-properties-schema.d.ts +159 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js +471 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js.map +1 -0
- package/dist/src/lib/user-properties/user-properties-codegen.d.ts +55 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js +129 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js.map +1 -0
- package/dist/src/lib/user-walk.d.ts +31 -0
- package/dist/src/lib/user-walk.js +102 -0
- package/dist/src/lib/user-walk.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/worker-perf-format.d.ts +22 -0
- package/dist/src/lib/worker-perf-format.js +27 -0
- package/dist/src/lib/worker-perf-format.js.map +1 -0
- package/dist/src/types/index.d.ts +20 -65
- 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 -9
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, unlinkSync, } from "fs";
|
|
17
17
|
import { basename, dirname, join, resolve, sep } from "path";
|
|
18
|
-
import {
|
|
18
|
+
import { parseRawToml } from "./config-toml.js";
|
|
19
19
|
const tomlFile = (key) => `${key}.toml`;
|
|
20
20
|
/**
|
|
21
21
|
* Rule sets are keyed on disk (and in sync state) by their name with
|
|
@@ -43,24 +43,6 @@ export const SYNC_RESOURCE_TYPES = [
|
|
|
43
43
|
// `/admin/api/apps/{id}/integrations` paginates; pull drains it with fetchAll.
|
|
44
44
|
listingComplete: true,
|
|
45
45
|
},
|
|
46
|
-
{
|
|
47
|
-
label: "webhook",
|
|
48
|
-
dir: "webhooks",
|
|
49
|
-
ext: ".toml",
|
|
50
|
-
stateSlot: "webhooks",
|
|
51
|
-
fileFromKey: tomlFile,
|
|
52
|
-
// `/admin/api/apps/{id}/webhooks` paginates; pull drains it with fetchAll.
|
|
53
|
-
listingComplete: true,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
label: "cron-trigger",
|
|
57
|
-
dir: "cron-triggers",
|
|
58
|
-
ext: ".toml",
|
|
59
|
-
stateSlot: "cronTriggers",
|
|
60
|
-
fileFromKey: tomlFile,
|
|
61
|
-
// Server drains `triggersByApp` and filters archived across the full set (#1668).
|
|
62
|
-
listingComplete: true,
|
|
63
|
-
},
|
|
64
46
|
{
|
|
65
47
|
label: "blob-bucket",
|
|
66
48
|
dir: "blob-buckets",
|
|
@@ -80,30 +62,6 @@ export const SYNC_RESOURCE_TYPES = [
|
|
|
80
62
|
// `/admin/api/apps/{id}/prompts` paginates; pull drains it with fetchAll.
|
|
81
63
|
listingComplete: true,
|
|
82
64
|
},
|
|
83
|
-
{
|
|
84
|
-
label: "workflow",
|
|
85
|
-
dir: "workflows",
|
|
86
|
-
ext: ".toml",
|
|
87
|
-
stateSlot: "workflows",
|
|
88
|
-
fileFromKey: tomlFile,
|
|
89
|
-
testBlockType: "workflow",
|
|
90
|
-
// #2645 — named config bodies live in `workflows/<key>.configs/`.
|
|
91
|
-
namedConfigsDirFromKey: (key) => `${key}.configs`,
|
|
92
|
-
// `/admin/api/apps/{id}/workflows` paginates; pull drains it with fetchAll.
|
|
93
|
-
listingComplete: true,
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
// Rhai scripts: `.rhai` bodies, not TOML, with tests at
|
|
97
|
-
// `transforms/<name>.tests/`.
|
|
98
|
-
label: "transform",
|
|
99
|
-
dir: "transforms",
|
|
100
|
-
ext: ".rhai",
|
|
101
|
-
stateSlot: "scripts",
|
|
102
|
-
fileFromKey: (key) => `${key}.rhai`,
|
|
103
|
-
testBlockType: "script",
|
|
104
|
-
// Server drains `scriptsByApp` across all pages (#1668).
|
|
105
|
-
listingComplete: true,
|
|
106
|
-
},
|
|
107
65
|
{
|
|
108
66
|
// #3179 — server functions. `functions/<key>.toml` states the function and
|
|
109
67
|
// names its `entry`; the TypeScript the entry reaches lives beside it in
|
|
@@ -128,6 +86,18 @@ export const SYNC_RESOURCE_TYPES = [
|
|
|
128
86
|
// Server drains `databaseTypeConfigsForApp` across all pages (#1668).
|
|
129
87
|
listingComplete: true,
|
|
130
88
|
},
|
|
89
|
+
{
|
|
90
|
+
// #4802 — a db3 type: the same `DatabaseTypeConfig` row as the database
|
|
91
|
+
// type of its name, written by `config pull` under `db3-types/` beside
|
|
92
|
+
// the legacy file and applied by `config push` through `PUT db3-types`.
|
|
93
|
+
label: "db3-type",
|
|
94
|
+
dir: "db3-types",
|
|
95
|
+
ext: ".toml",
|
|
96
|
+
stateSlot: "db3Types",
|
|
97
|
+
fileFromKey: tomlFile,
|
|
98
|
+
// The same listing as the database types'.
|
|
99
|
+
listingComplete: true,
|
|
100
|
+
},
|
|
131
101
|
{
|
|
132
102
|
// The state key is already the sanitized filename the write loop derives
|
|
133
103
|
// from the rule set's name (`name.replace(/[/\\:*?"<>|]/g, "_")`), so the
|
|
@@ -140,24 +110,6 @@ export const SYNC_RESOURCE_TYPES = [
|
|
|
140
110
|
// Server drains `ruleSetsForApp` across all pages (#1668).
|
|
141
111
|
listingComplete: true,
|
|
142
112
|
},
|
|
143
|
-
{
|
|
144
|
-
label: "group-type-config",
|
|
145
|
-
dir: "group-type-configs",
|
|
146
|
-
ext: ".toml",
|
|
147
|
-
stateSlot: "groupTypeConfigs",
|
|
148
|
-
fileFromKey: tomlFile,
|
|
149
|
-
// Server drains `configsForApp` across all pages (#1668).
|
|
150
|
-
listingComplete: true,
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
label: "collection-type-config",
|
|
154
|
-
dir: "collection-type-configs",
|
|
155
|
-
ext: ".toml",
|
|
156
|
-
stateSlot: "collectionTypeConfigs",
|
|
157
|
-
fileFromKey: tomlFile,
|
|
158
|
-
// Server drains `collectionConfigsForApp` across all pages (#1668).
|
|
159
|
-
listingComplete: true,
|
|
160
|
-
},
|
|
161
113
|
{
|
|
162
114
|
// State key is the `resourceType#category` pair; the file on disk is
|
|
163
115
|
// `resourceType.category.toml`.
|
|
@@ -169,6 +121,17 @@ export const SYNC_RESOURCE_TYPES = [
|
|
|
169
121
|
// Server drains `metadataCategoriesForApp` across all pages (#1668).
|
|
170
122
|
listingComplete: true,
|
|
171
123
|
},
|
|
124
|
+
{
|
|
125
|
+
// #5532 — shared shapes: `schemas/<file>.toml`, one immutable `AppSchema`
|
|
126
|
+
// version per push. Keyed by the file's name; there is no in-file identity.
|
|
127
|
+
label: "schema",
|
|
128
|
+
dir: "schemas",
|
|
129
|
+
ext: ".toml",
|
|
130
|
+
stateSlot: "schemas",
|
|
131
|
+
fileFromKey: tomlFile,
|
|
132
|
+
// `GET …/schemas` drains the app's partition server-side.
|
|
133
|
+
listingComplete: true,
|
|
134
|
+
},
|
|
172
135
|
{
|
|
173
136
|
label: "email-template",
|
|
174
137
|
dir: "email-templates",
|
|
@@ -504,18 +467,6 @@ export async function applyPrune(options) {
|
|
|
504
467
|
result.removed.push(extra.relative);
|
|
505
468
|
log(` Removed ${extra.relative} — ${ABSENT_FROM_EXPORT}`);
|
|
506
469
|
}
|
|
507
|
-
// #2645 — the entity's named config bodies go with it. They describe
|
|
508
|
-
// configurations of a block the server no longer has, and leaving them
|
|
509
|
-
// would have the next push re-create the block from its own leftovers.
|
|
510
|
-
const configsDirName = resourceType.namedConfigsDirFromKey?.(key);
|
|
511
|
-
if (configsDirName) {
|
|
512
|
-
const configsDir = join(configDir, resourceType.dir, configsDirName);
|
|
513
|
-
if (existsSync(configsDir) && isSafeSyncFilename(configsDirName)) {
|
|
514
|
-
rmSync(configsDir, { recursive: true, force: true });
|
|
515
|
-
result.removed.push(`${resourceType.dir}/${configsDirName}`);
|
|
516
|
-
log(` Removed ${resourceType.dir}/${configsDirName} — ${ABSENT_FROM_EXPORT}`);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
470
|
if (!resourceType.testBlockType)
|
|
520
471
|
continue;
|
|
521
472
|
// Sidecar tests: `<key>.tests/` holds the block's test-case TOMLs and their
|
|
@@ -547,20 +498,13 @@ export const addressByKey = (key) => key || undefined;
|
|
|
547
498
|
/**
|
|
548
499
|
* Live modified timestamp used by the drift check. Most admin/app detail
|
|
549
500
|
* endpoints serialize `modifiedAt` at the top level (the same field `config pull`
|
|
550
|
-
* records into state), with `updatedAt` as a defensive fallback.
|
|
551
|
-
*
|
|
552
|
-
* below (`
|
|
553
|
-
*
|
|
501
|
+
* records into state), with `updatedAt` as a defensive fallback. The email
|
|
502
|
+
* template detail endpoint nests the entity under a wrapper key and needs its
|
|
503
|
+
* own extractor below (`emailTemplatePruneModifiedAt`) so the drift check
|
|
504
|
+
* reads the real timestamp instead of `undefined` — a top-level
|
|
554
505
|
* read there always looks like drift and blocks `--prune` without `--force`.
|
|
555
506
|
*/
|
|
556
507
|
export const pruneModifiedAt = (detail) => (detail && (detail.modifiedAt ?? detail.updatedAt)) || undefined;
|
|
557
|
-
/**
|
|
558
|
-
* Workflow detail-read extractor. `getWorkflow` (server `getAppWorkflow`,
|
|
559
|
-
* src/admin-api.ts) returns `{ workflow, draft, revisions, configs }` — the
|
|
560
|
-
* entity and its `modifiedAt` are nested under `workflow`, unlike every other
|
|
561
|
-
* detail endpoint. Read there, not the top level.
|
|
562
|
-
*/
|
|
563
|
-
export const workflowPruneModifiedAt = (detail) => pruneModifiedAt(detail && detail.workflow);
|
|
564
508
|
/**
|
|
565
509
|
* Email-template detail-read extractor. `getEmailTemplate` returns
|
|
566
510
|
* `{ emailType, label, hasOverride, override, default, variables }`; the
|
|
@@ -575,15 +519,16 @@ export const emailTemplatePruneModifiedAt = (detail) => pruneModifiedAt(detail &
|
|
|
575
519
|
* be parsed — callers fall back to the filename-derived key, matching the
|
|
576
520
|
* `<field> || basename(file)` convention every `config push` parser uses.
|
|
577
521
|
*
|
|
578
|
-
* Parsed via `
|
|
579
|
-
*
|
|
580
|
-
*
|
|
581
|
-
*
|
|
522
|
+
* Parsed via `parseRawToml` (not `parseTomlFile`) so this avoids depending
|
|
523
|
+
* on `commands/sync.ts` (which would be a circular import) while producing the
|
|
524
|
+
* same key push does. Raw, not expanding (#5541): a field table that does not
|
|
525
|
+
* compile must not cost the file its declared identity, or `config set` and
|
|
526
|
+
* `--only` would resolve a renamed file by its basename instead.
|
|
582
527
|
*/
|
|
583
528
|
function declaredTomlKey(filePath, section, field) {
|
|
584
529
|
let parsed;
|
|
585
530
|
try {
|
|
586
|
-
parsed =
|
|
531
|
+
parsed = parseRawToml(readFileSync(filePath, "utf-8"));
|
|
587
532
|
}
|
|
588
533
|
catch {
|
|
589
534
|
return undefined;
|
|
@@ -602,10 +547,9 @@ function tomlDeclaredKeyFromFile(section, field) {
|
|
|
602
547
|
return (filePath) => declaredTomlKey(filePath, section, field) ?? basename(filePath, ".toml");
|
|
603
548
|
}
|
|
604
549
|
/**
|
|
605
|
-
* `keyFromFile` for types keyed purely by filename —
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
* changes the entity and the basename is the correct key.
|
|
550
|
+
* `keyFromFile` for types keyed purely by filename — rule-sets (the state key
|
|
551
|
+
* is the sanitized basename). These have no in-file identity, so a rename
|
|
552
|
+
* genuinely changes the entity and the basename is the correct key.
|
|
609
553
|
*/
|
|
610
554
|
function basenameKeyFromFile(ext) {
|
|
611
555
|
return (filePath) => basename(filePath, ext);
|
|
@@ -670,11 +614,20 @@ function pruneTypeFor(label) {
|
|
|
670
614
|
throw new Error(`no sync resource type '${label}'`);
|
|
671
615
|
return found;
|
|
672
616
|
}
|
|
617
|
+
/**
|
|
618
|
+
* #4802 — a database type's key is present while EITHER of its two files
|
|
619
|
+
* declares it: the legacy `database-type-configs/<name>.toml` or the db3
|
|
620
|
+
* type's `db3-types/<name>.toml`. Only a type whose files are gone from both
|
|
621
|
+
* is a prune candidate. Also the key a `db3-types/` file declares for `--only`.
|
|
622
|
+
*/
|
|
623
|
+
export function db3TypeKeyFromFile(path) {
|
|
624
|
+
return tomlDeclaredKeyFromFile("type", "name")(path);
|
|
625
|
+
}
|
|
626
|
+
const DB3_TYPE_TWIN = { dir: "db3-types", keyFromFile: db3TypeKeyFromFile };
|
|
673
627
|
/**
|
|
674
628
|
* Every resource type push-prune can retire. Id-addressed types (integrations,
|
|
675
|
-
*
|
|
676
|
-
*
|
|
677
|
-
* group-type-configs, collection-type-configs, email-templates) by the key.
|
|
629
|
+
* blob-buckets, prompts, functions, rule-sets) fetch/delete by the stored id; key-addressed types (database-type-configs,
|
|
630
|
+
* email-templates) by the key.
|
|
678
631
|
*
|
|
679
632
|
* `--force` (the CLI's existing "override baseline drift" flag) only relaxes the
|
|
680
633
|
* drift check — it deliberately does NOT pass a server-side force flag on the
|
|
@@ -688,7 +641,7 @@ export const PUSH_PRUNE_SPECS = [
|
|
|
688
641
|
addressOf: addressById,
|
|
689
642
|
fetchDetail: (c, a, id) => c.getIntegration(a, id),
|
|
690
643
|
modifiedAtOf: pruneModifiedAt,
|
|
691
|
-
// Hard-delete rather than archive (#2803, following #2232's
|
|
644
|
+
// Hard-delete rather than archive (#2803, following #2232's per-app
|
|
692
645
|
// reasoning). `--prune` is the CLI's hard-delete path: the file that
|
|
693
646
|
// declared this integration is gone from the config tree, and an archived
|
|
694
647
|
// row keeps holding its `integrationKey` with no way to reclaim it from
|
|
@@ -696,39 +649,7 @@ export const PUSH_PRUNE_SPECS = [
|
|
|
696
649
|
deleteEntity: async (c, a, id) => {
|
|
697
650
|
await c.deleteIntegration(a, id, { hard: true });
|
|
698
651
|
},
|
|
699
|
-
|
|
700
|
-
{
|
|
701
|
-
resourceType: pruneTypeFor("webhook"),
|
|
702
|
-
keyFromFile: tomlDeclaredKeyFromFile("webhook", "key"),
|
|
703
|
-
addressOf: addressById,
|
|
704
|
-
fetchDetail: (c, a, id) => c.getWebhook(a, id),
|
|
705
|
-
modifiedAtOf: pruneModifiedAt,
|
|
706
|
-
// Hard-delete rather than archive (#2232). Webhooks are the one pruned type with
|
|
707
|
-
// a per-app cap that archived rows still consume, so an archiving prune
|
|
708
|
-
// would burn a slot — and keep holding the `webhookKey` — with no way to
|
|
709
|
-
// reclaim it from `sync`. Enough prune cycles and the app could never
|
|
710
|
-
// create a webhook again. `--prune` is opt-in and confirmed, and the file
|
|
711
|
-
// that declared this webhook is gone from the config dir, so a hard delete
|
|
712
|
-
// is what "retire it" means here. Delivery rows are left behind either way.
|
|
713
|
-
deleteEntity: async (c, a, id) => {
|
|
714
|
-
await c.deleteWebhook(a, id, { hard: true });
|
|
715
|
-
},
|
|
716
|
-
},
|
|
717
|
-
{
|
|
718
|
-
resourceType: pruneTypeFor("cron-trigger"),
|
|
719
|
-
keyFromFile: tomlDeclaredKeyFromFile("cronTrigger", "key"),
|
|
720
|
-
addressOf: addressById,
|
|
721
|
-
fetchDetail: (c, a, id) => c.getCronTrigger(a, id),
|
|
722
|
-
modifiedAtOf: pruneModifiedAt,
|
|
723
|
-
// Hard-delete rather than archive (#2803, following #2232's webhook
|
|
724
|
-
// reasoning). Cron triggers have a per-app cap that archived rows still
|
|
725
|
-
// consume, and an archived row keeps holding its `triggerKey` with no way
|
|
726
|
-
// to reclaim it from `config`. `--prune` is opt-in and confirmed, and the
|
|
727
|
-
// file that declared this trigger is gone from the config tree, so a hard
|
|
728
|
-
// delete is what "retire it" means here.
|
|
729
|
-
deleteEntity: async (c, a, id) => {
|
|
730
|
-
await c.deleteCronTrigger(a, id, { hard: true });
|
|
731
|
-
},
|
|
652
|
+
deleteNeedsAdmin: true,
|
|
732
653
|
},
|
|
733
654
|
{
|
|
734
655
|
resourceType: pruneTypeFor("blob-bucket"),
|
|
@@ -746,7 +667,7 @@ export const PUSH_PRUNE_SPECS = [
|
|
|
746
667
|
addressOf: addressById,
|
|
747
668
|
fetchDetail: (c, a, id) => c.getPrompt(a, id),
|
|
748
669
|
modifiedAtOf: pruneModifiedAt,
|
|
749
|
-
// Hard-delete rather than archive (#2887, following #2232's
|
|
670
|
+
// Hard-delete rather than archive (#2887, following #2232's per-app
|
|
750
671
|
// reasoning). A plain DELETE archives now, and an archived prompt keeps
|
|
751
672
|
// holding its `promptKey` with no way to reclaim it from `config`. This
|
|
752
673
|
// had to change in the SAME commit that made the plain DELETE soft, or
|
|
@@ -754,6 +675,7 @@ export const PUSH_PRUNE_SPECS = [
|
|
|
754
675
|
deleteEntity: async (c, a, id) => {
|
|
755
676
|
await c.deletePrompt(a, id, true);
|
|
756
677
|
},
|
|
678
|
+
deleteNeedsAdmin: true,
|
|
757
679
|
},
|
|
758
680
|
{
|
|
759
681
|
// #3179 — server functions. Hard-delete rather than archive, following the
|
|
@@ -770,32 +692,7 @@ export const PUSH_PRUNE_SPECS = [
|
|
|
770
692
|
deleteEntity: async (c, a, id) => {
|
|
771
693
|
await c.deleteFunction(a, id, { hard: true });
|
|
772
694
|
},
|
|
773
|
-
|
|
774
|
-
{
|
|
775
|
-
resourceType: pruneTypeFor("workflow"),
|
|
776
|
-
keyFromFile: tomlDeclaredKeyFromFile("workflow", "key"),
|
|
777
|
-
addressOf: addressById,
|
|
778
|
-
fetchDetail: (c, a, id) => c.getWorkflow(a, id),
|
|
779
|
-
// `getWorkflow` nests the entity (and modifiedAt) under `workflow`.
|
|
780
|
-
modifiedAtOf: workflowPruneModifiedAt,
|
|
781
|
-
// Hard-delete rather than archive (#2887) — same reasoning as the prompt
|
|
782
|
-
// spec above: the file that declared this workflow is gone from the config
|
|
783
|
-
// tree, `--prune` is opt-in and confirmed, and an archived row would go on
|
|
784
|
-
// holding its `workflowKey`.
|
|
785
|
-
deleteEntity: async (c, a, id) => {
|
|
786
|
-
await c.deleteWorkflow(a, id, { hard: true });
|
|
787
|
-
},
|
|
788
|
-
},
|
|
789
|
-
{
|
|
790
|
-
resourceType: pruneTypeFor("transform"),
|
|
791
|
-
// Rhai scripts are keyed by the `.rhai` basename — no in-file identity.
|
|
792
|
-
keyFromFile: basenameKeyFromFile(".rhai"),
|
|
793
|
-
addressOf: addressById,
|
|
794
|
-
fetchDetail: (c, a, id) => c.getScript(a, id),
|
|
795
|
-
modifiedAtOf: pruneModifiedAt,
|
|
796
|
-
deleteEntity: async (c, a, id) => {
|
|
797
|
-
await c.deleteScript(a, id);
|
|
798
|
-
},
|
|
695
|
+
deleteNeedsAdmin: true,
|
|
799
696
|
},
|
|
800
697
|
{
|
|
801
698
|
resourceType: pruneTypeFor("rule-set"),
|
|
@@ -811,6 +708,7 @@ export const PUSH_PRUNE_SPECS = [
|
|
|
811
708
|
{
|
|
812
709
|
resourceType: pruneTypeFor("database-type-config"),
|
|
813
710
|
keyFromFile: tomlDeclaredKeyFromFile("type", "databaseType"),
|
|
711
|
+
alsoDeclaredIn: [DB3_TYPE_TWIN],
|
|
814
712
|
addressOf: addressByKey,
|
|
815
713
|
fetchDetail: (c, a, key) => c.getDatabaseTypeConfig(a, key),
|
|
816
714
|
modifiedAtOf: pruneModifiedAt,
|
|
@@ -820,24 +718,44 @@ export const PUSH_PRUNE_SPECS = [
|
|
|
820
718
|
},
|
|
821
719
|
},
|
|
822
720
|
{
|
|
823
|
-
|
|
824
|
-
|
|
721
|
+
// #4802 — a db3 type, retired through `DELETE db3-types/:name`, which
|
|
722
|
+
// refuses (409, reported blocked) while any db3 is of the type. Its key is
|
|
723
|
+
// present while either of its two files declares it, as the database
|
|
724
|
+
// type's is.
|
|
725
|
+
resourceType: pruneTypeFor("db3-type"),
|
|
726
|
+
keyFromFile: db3TypeKeyFromFile,
|
|
727
|
+
alsoDeclaredIn: [{ dir: "database-type-configs", keyFromFile: tomlDeclaredKeyFromFile("type", "databaseType") }],
|
|
825
728
|
addressOf: addressByKey,
|
|
826
|
-
fetchDetail: (c, a, key) => c.
|
|
729
|
+
fetchDetail: (c, a, key) => c.getDb3TypeConfig(a, key),
|
|
827
730
|
modifiedAtOf: pruneModifiedAt,
|
|
828
731
|
deleteEntity: async (c, a, key) => {
|
|
829
|
-
await c.
|
|
732
|
+
await c.deleteDb3Type(a, key);
|
|
830
733
|
},
|
|
831
734
|
},
|
|
832
735
|
{
|
|
833
|
-
|
|
834
|
-
|
|
736
|
+
// #5532 — a `schemas/` file is retired by a tombstone version, never a
|
|
737
|
+
// delete: already-pushed dependants keep the shapes they inlined. The
|
|
738
|
+
// tombstone is pinned to the version the plan's read confirmed (under
|
|
739
|
+
// `--force` too), so a version another tree pushed since is refused 409
|
|
740
|
+
// and stays live. A file the server already tombstoned reads as absent.
|
|
741
|
+
resourceType: pruneTypeFor("schema"),
|
|
742
|
+
keyFromFile: basenameKeyFromFile(".toml"),
|
|
835
743
|
addressOf: addressByKey,
|
|
836
|
-
fetchDetail: (c, a,
|
|
837
|
-
modifiedAtOf:
|
|
838
|
-
|
|
839
|
-
|
|
744
|
+
fetchDetail: (c, a, file) => c.getSchemaFile(a, file),
|
|
745
|
+
modifiedAtOf: (detail) => (detail && detail.createdAt) || undefined,
|
|
746
|
+
absentOf: (detail) => detail?.tombstone === true,
|
|
747
|
+
pinsDeleteToRead: true,
|
|
748
|
+
deleteEntity: async (c, a, file, detail) => {
|
|
749
|
+
await c.tombstoneSchemaFile(a, file, typeof detail?.version === "number" ? detail.version : undefined);
|
|
840
750
|
},
|
|
751
|
+
blockedMessage: (err) => {
|
|
752
|
+
const details = err?.details;
|
|
753
|
+
const versions = details && typeof details.version === "number"
|
|
754
|
+
? ` (expected version ${details.expectedVersion}, the server has version ${details.version})`
|
|
755
|
+
: "";
|
|
756
|
+
return `changed on the server during the push${versions}; re-run \`config push --prune\``;
|
|
757
|
+
},
|
|
758
|
+
deleteCaveat: "writes a tombstone; already-pushed dependants keep working",
|
|
841
759
|
},
|
|
842
760
|
{
|
|
843
761
|
resourceType: pruneTypeFor("email-template"),
|
|
@@ -891,17 +809,22 @@ export const PUSH_PRUNE_SPECS = [
|
|
|
891
809
|
*/
|
|
892
810
|
export function collectLocalDeclaredKeys(input) {
|
|
893
811
|
const { spec, configDir } = input;
|
|
894
|
-
const dirPath = join(configDir, spec.resourceType.dir);
|
|
895
812
|
const keys = new Set();
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
813
|
+
const scan = (dir, keyFromFile) => {
|
|
814
|
+
const dirPath = join(configDir, dir);
|
|
815
|
+
if (!existsSync(dirPath))
|
|
816
|
+
return;
|
|
817
|
+
for (const file of readdirSync(dirPath)) {
|
|
818
|
+
if (!file.endsWith(spec.resourceType.ext))
|
|
819
|
+
continue;
|
|
820
|
+
const key = keyFromFile(join(dirPath, file));
|
|
821
|
+
if (key)
|
|
822
|
+
keys.add(key);
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
scan(spec.resourceType.dir, spec.keyFromFile);
|
|
826
|
+
for (const twin of spec.alsoDeclaredIn ?? [])
|
|
827
|
+
scan(twin.dir, twin.keyFromFile);
|
|
905
828
|
return keys;
|
|
906
829
|
}
|
|
907
830
|
/**
|
|
@@ -939,6 +862,10 @@ export function collectPushPruneCandidates(input) {
|
|
|
939
862
|
* live `modifiedAt` matches prior state (or under `--force`). A 404 means the
|
|
940
863
|
* work is already done (drop the stale state). Any other read failure, a missing
|
|
941
864
|
* address, or a type without a delete surface leaves everything untouched.
|
|
865
|
+
*
|
|
866
|
+
* An archived row is still pending deletion, whatever its `modifiedAt`: it
|
|
867
|
+
* keeps its key, and archiving is what moved the timestamp. Status is
|
|
868
|
+
* server-owned and not in TOML, so the move is not drift.
|
|
942
869
|
*/
|
|
943
870
|
export function decidePushPruneCandidate(input) {
|
|
944
871
|
const { spec, address, priorModifiedAt, fetch: fetchOutcome, force } = input;
|
|
@@ -946,13 +873,21 @@ export function decidePushPruneCandidate(input) {
|
|
|
946
873
|
return { action: "skip", reason: "no-id" };
|
|
947
874
|
if (!spec.deleteEntity)
|
|
948
875
|
return { action: "skip", reason: "unsupported" };
|
|
876
|
+
if (fetchOutcome.ok && spec.absentOf?.(fetchOutcome.detail))
|
|
877
|
+
return { action: "drop-state" };
|
|
949
878
|
if (fetchOutcome.ok) {
|
|
950
879
|
const serverModifiedAt = spec.modifiedAtOf(fetchOutcome.detail);
|
|
951
880
|
const unchanged = !!priorModifiedAt &&
|
|
952
881
|
!!serverModifiedAt &&
|
|
953
882
|
serverModifiedAt === priorModifiedAt;
|
|
954
|
-
|
|
955
|
-
|
|
883
|
+
const archived = fetchOutcome.detail?.status === "archived";
|
|
884
|
+
if (force || unchanged || archived) {
|
|
885
|
+
return {
|
|
886
|
+
action: "delete",
|
|
887
|
+
address,
|
|
888
|
+
serverModifiedAt,
|
|
889
|
+
...(spec.pinsDeleteToRead ? { detail: fetchOutcome.detail } : {}),
|
|
890
|
+
};
|
|
956
891
|
}
|
|
957
892
|
return { action: "skip", reason: "drift", serverModifiedAt };
|
|
958
893
|
}
|
|
@@ -962,6 +897,51 @@ export function decidePushPruneCandidate(input) {
|
|
|
962
897
|
return { action: "drop-state" };
|
|
963
898
|
return { action: "skip", reason: "unconfirmed" };
|
|
964
899
|
}
|
|
900
|
+
/**
|
|
901
|
+
* Plan a push-prune over `specs`: every prior-state key no local file declares
|
|
902
|
+
* and `includes` selects, each confirmed by a point read and decided by
|
|
903
|
+
* {@link decidePushPruneCandidate}. Reads only.
|
|
904
|
+
*/
|
|
905
|
+
export async function planPushPrune(input) {
|
|
906
|
+
const { configDir, entities, includes, client, appId, force } = input;
|
|
907
|
+
const items = [];
|
|
908
|
+
for (const spec of input.specs) {
|
|
909
|
+
const candidates = collectPushPruneCandidates({
|
|
910
|
+
spec,
|
|
911
|
+
configDir,
|
|
912
|
+
priorEntities: entities?.[spec.resourceType.stateSlot],
|
|
913
|
+
}).filter(({ key }) => includes(spec.resourceType.label, key));
|
|
914
|
+
for (const { key, entry } of candidates) {
|
|
915
|
+
const address = spec.addressOf(key, entry);
|
|
916
|
+
// Behavior 4: skip the point read for a candidate we could not
|
|
917
|
+
// delete anyway — no usable address (for metadata-category-configs
|
|
918
|
+
// that includes a state key that is not a `resourceType#category`
|
|
919
|
+
// pair, #2762), or a spec with no delete surface.
|
|
920
|
+
let fetchOutcome = { ok: false };
|
|
921
|
+
if (address && spec.deleteEntity) {
|
|
922
|
+
// Point read: confirm live presence + drift. Fail closed — any
|
|
923
|
+
// non-404 error leaves the entity and its state slot untouched.
|
|
924
|
+
try {
|
|
925
|
+
fetchOutcome = { ok: true, detail: await spec.fetchDetail(client, appId, address) };
|
|
926
|
+
}
|
|
927
|
+
catch (err) {
|
|
928
|
+
if (err?.statusCode === 404) {
|
|
929
|
+
fetchOutcome = { ok: false, status: 404 };
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
const decision = decidePushPruneCandidate({
|
|
934
|
+
spec,
|
|
935
|
+
address,
|
|
936
|
+
priorModifiedAt: entry?.modifiedAt,
|
|
937
|
+
fetch: fetchOutcome,
|
|
938
|
+
force,
|
|
939
|
+
});
|
|
940
|
+
items.push({ spec, key, entry, address, decision });
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
return items;
|
|
944
|
+
}
|
|
965
945
|
/**
|
|
966
946
|
* Classify an error thrown by a prune delete — one arm for every type.
|
|
967
947
|
*
|
|
@@ -1014,6 +994,44 @@ export function formatPrunePlan(items) {
|
|
|
1014
994
|
};
|
|
1015
995
|
});
|
|
1016
996
|
}
|
|
997
|
+
/** The step-up a prune's hard deletes need, valid for 15 minutes. */
|
|
998
|
+
export const PRUNE_STEP_UP_COMMAND = "primitive login --step-up --scope write,admin";
|
|
999
|
+
/**
|
|
1000
|
+
* The refusal for a prune plan that hard-deletes, from a session without the
|
|
1001
|
+
* `admin` scope: it names each hard delete, the missing scope and the step-up.
|
|
1002
|
+
* A candidate whose point read failed is named too: the plan `config push`
|
|
1003
|
+
* rebuilds after applying could find it and delete it. Null when the plan
|
|
1004
|
+
* deletes nothing that needs `admin`. `config push` checks it before applying
|
|
1005
|
+
* anything, so the push does not land halfway and then have its deletes
|
|
1006
|
+
* refused one by one.
|
|
1007
|
+
*/
|
|
1008
|
+
export function pruneAdminScopeRefusal(items) {
|
|
1009
|
+
const needsAdmin = items.filter(({ spec }) => spec.deleteNeedsAdmin);
|
|
1010
|
+
const hard = needsAdmin.filter(({ decision }) => decision.action === "delete");
|
|
1011
|
+
const unconfirmed = needsAdmin.filter(({ decision }) => decision.action === "skip" && decision.reason === "unconfirmed");
|
|
1012
|
+
if (hard.length === 0 && unconfirmed.length === 0)
|
|
1013
|
+
return null;
|
|
1014
|
+
const names = (list) => list.map(({ spec, key }) => `${spec.resourceType.label} ${key}`).join(", ");
|
|
1015
|
+
const what = [
|
|
1016
|
+
...(hard.length > 0 ? [`permanently deletes ${names(hard)}`] : []),
|
|
1017
|
+
...(unconfirmed.length > 0
|
|
1018
|
+
? [`may permanently delete ${names(unconfirmed)} (the read that would confirm it failed)`]
|
|
1019
|
+
: []),
|
|
1020
|
+
].join(" and ");
|
|
1021
|
+
return (`The prune plan ${what}, which needs the \`admin\` scope ` +
|
|
1022
|
+
`this session lacks. Nothing was applied. Run \`${PRUNE_STEP_UP_COMMAND}\` ` +
|
|
1023
|
+
`for a 15-minute step-up, then push again.`);
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* The refusal for a prune plan that hard-deletes when the session's scope
|
|
1027
|
+
* could not be read: the push stops rather than assume `admin` and apply
|
|
1028
|
+
* everything else before the deletes are refused.
|
|
1029
|
+
*/
|
|
1030
|
+
export function pruneScopeUnknownRefusal(reason) {
|
|
1031
|
+
return (`Could not confirm this session holds the \`admin\` scope the prune plan's ` +
|
|
1032
|
+
`permanent deletes need: ${reason}. Nothing was applied. Push again, or run ` +
|
|
1033
|
+
`\`${PRUNE_STEP_UP_COMMAND}\` for a 15-minute step-up first.`);
|
|
1034
|
+
}
|
|
1017
1035
|
/**
|
|
1018
1036
|
* Remove a pruned block's sidecar `<key>.tests/` directory and its
|
|
1019
1037
|
* `entities.testCases` state records. The main file is already gone (that is
|
|
@@ -1025,16 +1043,6 @@ export function removePrunedSidecar(options) {
|
|
|
1025
1043
|
const log = logger ?? (() => { });
|
|
1026
1044
|
const removed = [];
|
|
1027
1045
|
const removedTestCaseKeys = [];
|
|
1028
|
-
// #2645 — the entity's named config bodies orphan the same way its tests do.
|
|
1029
|
-
const configsDirName = resourceType.namedConfigsDirFromKey?.(key);
|
|
1030
|
-
if (configsDirName) {
|
|
1031
|
-
const configsDir = join(configDir, resourceType.dir, configsDirName);
|
|
1032
|
-
if (existsSync(configsDir) && isSafeSyncFilename(configsDirName)) {
|
|
1033
|
-
rmSync(configsDir, { recursive: true, force: true });
|
|
1034
|
-
removed.push(`${resourceType.dir}/${configsDirName}`);
|
|
1035
|
-
log(` Removed orphaned ${resourceType.dir}/${configsDirName}`);
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
1046
|
if (!resourceType.testBlockType)
|
|
1039
1047
|
return { removed, removedTestCaseKeys };
|
|
1040
1048
|
const testsDirName = `${key}.tests`;
|