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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-sdk-types.js","sourceRoot":"","sources":["../../../src/lib/generated-sdk-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"generated-sdk-types.js","sourceRoot":"","sources":["../../../src/lib/generated-sdk-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,q0vLAAq0vL,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the committed default -> the sole environment) against an explicit root.
|
|
9
9
|
*/
|
|
10
10
|
import { join } from "path";
|
|
11
|
-
import {
|
|
11
|
+
import { isCommittedEnvironment, readLocalState, selectEnvironmentName, } from "./env-resolver-core.js";
|
|
12
12
|
import { PROJECT_TREE_DIR, PROJECT_CONFIG_FILENAME, loadProjectConfigFromPath, } from "./project-config.js";
|
|
13
13
|
/**
|
|
14
14
|
* Resolves the environment `init` adopts from the project rooted at `root`.
|
|
@@ -18,15 +18,24 @@ import { PROJECT_TREE_DIR, PROJECT_CONFIG_FILENAME, loadProjectConfigFromPath, }
|
|
|
18
18
|
export function resolveAdoptedEnvironment(root, options = {}) {
|
|
19
19
|
const projectConfigPath = join(root, PROJECT_TREE_DIR, PROJECT_CONFIG_FILENAME);
|
|
20
20
|
const projectConfig = loadProjectConfigFromPath(projectConfigPath);
|
|
21
|
+
const localState = readLocalState(projectConfigPath, projectConfig);
|
|
21
22
|
const { name } = selectEnvironmentName(projectConfig, {
|
|
22
23
|
explicitEnvName: options.explicitEnvName ?? null,
|
|
23
24
|
envVarName: options.envVarName ?? null,
|
|
24
|
-
localSelection:
|
|
25
|
+
localSelection: localState.selectedEnvironment,
|
|
26
|
+
localEnvironments: localState.environments,
|
|
25
27
|
configPath: projectConfigPath,
|
|
26
28
|
});
|
|
29
|
+
// A machine-local environment (#4117) names its app and server in
|
|
30
|
+
// `.primitive/local.json`, not in the committed config.
|
|
31
|
+
const localEntry = isCommittedEnvironment(projectConfig, name)
|
|
32
|
+
? undefined
|
|
33
|
+
: localState.environments[name];
|
|
27
34
|
return {
|
|
28
35
|
name,
|
|
29
|
-
config:
|
|
36
|
+
config: localEntry
|
|
37
|
+
? { apiUrl: localEntry.apiUrl, appId: localEntry.appId, appName: localEntry.appName }
|
|
38
|
+
: projectConfig.environments[name],
|
|
30
39
|
projectConfig,
|
|
31
40
|
projectConfigPath,
|
|
32
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-adopt.js","sourceRoot":"","sources":["../../../src/lib/init-adopt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"init-adopt.js","sourceRoot":"","sources":["../../../src/lib/init-adopt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,GAG1B,MAAM,qBAAqB,CAAC;AAS7B;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,IAAY,EACZ,UAA2E,EAAE;IAE7E,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,uBAAuB,CAAC,CAAC;IAChF,MAAM,aAAa,GAAG,yBAAyB,CAAC,iBAAiB,CAAC,CAAC;IACnE,MAAM,UAAU,GAAG,cAAc,CAAC,iBAAiB,EAAE,aAAoB,CAAC,CAAC;IAC3E,MAAM,EAAE,IAAI,EAAE,GAAG,qBAAqB,CAAC,aAAoB,EAAE;QAC3D,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,IAAI;QAChD,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI;QACtC,cAAc,EAAE,UAAU,CAAC,mBAAmB;QAC9C,iBAAiB,EAAE,UAAU,CAAC,YAAY;QAC1C,UAAU,EAAE,iBAAiB;KAC9B,CAAC,CAAC;IACH,kEAAkE;IAClE,wDAAwD;IACxD,MAAM,UAAU,GAAG,sBAAsB,CAAC,aAAa,EAAE,IAAI,CAAC;QAC5D,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,UAAU;YAChB,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE;YACrF,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC;QACpC,aAAa;QACb,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `primitive init` says about the login it seeds into a new project
|
|
3
|
+
* (#4512). Init signs in before its app exists, so it cannot pin the login to
|
|
4
|
+
* the app; the note names the login that does.
|
|
5
|
+
*/
|
|
6
|
+
import type { Credentials } from "../types/index.js";
|
|
7
|
+
/** The note for a seeded login that covers all of the admin's apps. */
|
|
8
|
+
export declare const INIT_ALL_APPS_NOTE = "This login covers all of your apps. Run 'primitive login' inside the project to limit it to this app.";
|
|
9
|
+
/**
|
|
10
|
+
* The note for `credentials` once seeded, or null: a pinned login says
|
|
11
|
+
* nothing, and a CI job's `PRIMITIVE_TOKEN` is never seeded.
|
|
12
|
+
*/
|
|
13
|
+
export declare function initLoginNote(credentials: Credentials): string | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The note for a seeded login that covers all of the admin's apps. */
|
|
2
|
+
export const INIT_ALL_APPS_NOTE = "This login covers all of your apps. Run 'primitive login' inside the project to limit it to this app.";
|
|
3
|
+
/** The apps an access token is pinned to; none for an unpinned or unreadable one. */
|
|
4
|
+
function pinsOf(accessToken) {
|
|
5
|
+
try {
|
|
6
|
+
const claims = JSON.parse(Buffer.from(accessToken.split(".")[1] ?? "", "base64url").toString("utf-8"));
|
|
7
|
+
return Array.isArray(claims?.apps) ? claims.apps : [];
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The note for `credentials` once seeded, or null: a pinned login says
|
|
15
|
+
* nothing, and a CI job's `PRIMITIVE_TOKEN` is never seeded.
|
|
16
|
+
*/
|
|
17
|
+
export function initLoginNote(credentials) {
|
|
18
|
+
if (credentials.source === "env")
|
|
19
|
+
return null;
|
|
20
|
+
return pinsOf(credentials.accessToken).length === 0 ? INIT_ALL_APPS_NOTE : null;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=init-login-note.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-login-note.js","sourceRoot":"","sources":["../../../src/lib/init-login-note.ts"],"names":[],"mappings":"AAOA,uEAAuE;AACvE,MAAM,CAAC,MAAM,kBAAkB,GAC7B,uGAAuG,CAAC;AAE1G,qFAAqF;AACrF,SAAS,MAAM,CAAC,WAAmB;IACjC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACvG,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,WAAwB;IACpD,IAAI,WAAW,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAC9C,OAAO,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a JSON-or-table value a TOML file or an API response carries: a string
|
|
3
|
+
* is JSON text, anything else is already the value (TOML parsed it as a
|
|
4
|
+
* table). Absent stays absent.
|
|
5
|
+
*/
|
|
6
|
+
export function safeJsonParse(value) {
|
|
7
|
+
if (value === undefined || value === null)
|
|
8
|
+
return undefined;
|
|
9
|
+
if (typeof value === "string")
|
|
10
|
+
return JSON.parse(value);
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=json-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-value.js","sourceRoot":"","sources":["../../../src/lib/json-value.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAU;IACtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bulk-load and snapshot routes a data verb drives, by family (#4889):
|
|
3
|
+
* `documents/:id/*` for `primitive documents ingest|ingests|snapshots`, and
|
|
4
|
+
* `db3/:id/*` for their `primitive db3` twins. The verbs share one action
|
|
5
|
+
* body each (`../commands/documents.ts`) and differ only in these calls.
|
|
6
|
+
*/
|
|
7
|
+
import type { ApiClient } from "./api-client.js";
|
|
8
|
+
/** One chunk of a bulk-load artifact, as the upload sends it. */
|
|
9
|
+
export type LoadChunkUpload = Parameters<ApiClient["uploadDocumentIngestChunk"]>[3];
|
|
10
|
+
/** A listing page's options. */
|
|
11
|
+
export type LoadPageOptions = {
|
|
12
|
+
limit?: number;
|
|
13
|
+
cursor?: string;
|
|
14
|
+
};
|
|
15
|
+
/** The calls one family's bulk-load and snapshot verbs make. */
|
|
16
|
+
export interface LoadRoutes {
|
|
17
|
+
/** What the verbs' prompts call the target: `document` or `db3`. */
|
|
18
|
+
noun: "document" | "db3";
|
|
19
|
+
schema(client: ApiClient, appId: string, id: string): Promise<any>;
|
|
20
|
+
listIngests(client: ApiClient, appId: string, id: string, options: LoadPageOptions): Promise<any>;
|
|
21
|
+
getIngest(client: ApiClient, appId: string, id: string, sessionId: string): Promise<any>;
|
|
22
|
+
createIngest(client: ApiClient, appId: string, id: string, body: Parameters<ApiClient["createDocumentIngest"]>[2]): Promise<any>;
|
|
23
|
+
uploadIngestChunk(client: ApiClient, appId: string, id: string, sessionId: string, chunk: LoadChunkUpload): Promise<any>;
|
|
24
|
+
commitIngest(client: ApiClient, appId: string, id: string, sessionId: string): Promise<any>;
|
|
25
|
+
abortIngest(client: ApiClient, appId: string, id: string, sessionId: string): Promise<any>;
|
|
26
|
+
listSnapshots(client: ApiClient, appId: string, id: string, options: LoadPageOptions): Promise<any>;
|
|
27
|
+
getSnapshot(client: ApiClient, appId: string, id: string, segmentId: string): Promise<any>;
|
|
28
|
+
requestSnapshot(client: ApiClient, appId: string, id: string): Promise<any>;
|
|
29
|
+
}
|
|
30
|
+
/** `documents/:id/*`. */
|
|
31
|
+
export declare const DOCUMENT_LOAD_ROUTES: LoadRoutes;
|
|
32
|
+
/** `db3/:id/*`: the same routes under a db3's own name. */
|
|
33
|
+
export declare const DB3_LOAD_ROUTES: LoadRoutes;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bulk-load and snapshot routes a data verb drives, by family (#4889):
|
|
3
|
+
* `documents/:id/*` for `primitive documents ingest|ingests|snapshots`, and
|
|
4
|
+
* `db3/:id/*` for their `primitive db3` twins. The verbs share one action
|
|
5
|
+
* body each (`../commands/documents.ts`) and differ only in these calls.
|
|
6
|
+
*/
|
|
7
|
+
/** `documents/:id/*`. */
|
|
8
|
+
export const DOCUMENT_LOAD_ROUTES = {
|
|
9
|
+
noun: "document",
|
|
10
|
+
schema: (client, appId, id) => client.getDocumentSchema(appId, id),
|
|
11
|
+
listIngests: (client, appId, id, options) => client.listDocumentIngests(appId, id, options),
|
|
12
|
+
getIngest: (client, appId, id, sessionId) => client.getDocumentIngest(appId, id, sessionId),
|
|
13
|
+
createIngest: (client, appId, id, body) => client.createDocumentIngest(appId, id, body),
|
|
14
|
+
uploadIngestChunk: (client, appId, id, sessionId, chunk) => client.uploadDocumentIngestChunk(appId, id, sessionId, chunk),
|
|
15
|
+
commitIngest: (client, appId, id, sessionId) => client.commitDocumentIngest(appId, id, sessionId),
|
|
16
|
+
abortIngest: (client, appId, id, sessionId) => client.abortDocumentIngest(appId, id, sessionId),
|
|
17
|
+
listSnapshots: (client, appId, id, options) => client.listDocumentSnapshots(appId, id, options),
|
|
18
|
+
getSnapshot: (client, appId, id, segmentId) => client.getDocumentSnapshot(appId, id, segmentId),
|
|
19
|
+
requestSnapshot: (client, appId, id) => client.requestDocumentSnapshot(appId, id),
|
|
20
|
+
};
|
|
21
|
+
/** `db3/:id/*`: the same routes under a db3's own name. */
|
|
22
|
+
export const DB3_LOAD_ROUTES = {
|
|
23
|
+
noun: "db3",
|
|
24
|
+
schema: (client, appId, id) => client.getDb3Schema(appId, id),
|
|
25
|
+
listIngests: (client, appId, id, options) => client.listDb3Ingests(appId, id, options),
|
|
26
|
+
getIngest: (client, appId, id, sessionId) => client.getDb3Ingest(appId, id, sessionId),
|
|
27
|
+
createIngest: (client, appId, id, body) => client.createDb3Ingest(appId, id, body),
|
|
28
|
+
uploadIngestChunk: (client, appId, id, sessionId, chunk) => client.uploadDb3IngestChunk(appId, id, sessionId, chunk),
|
|
29
|
+
commitIngest: (client, appId, id, sessionId) => client.commitDb3Ingest(appId, id, sessionId),
|
|
30
|
+
abortIngest: (client, appId, id, sessionId) => client.abortDb3Ingest(appId, id, sessionId),
|
|
31
|
+
listSnapshots: (client, appId, id, options) => client.listDb3Snapshots(appId, id, options),
|
|
32
|
+
getSnapshot: (client, appId, id, segmentId) => client.getDb3Snapshot(appId, id, segmentId),
|
|
33
|
+
requestSnapshot: (client, appId, id) => client.requestDb3Snapshot(appId, id),
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=load-routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-routes.js","sourceRoot":"","sources":["../../../src/lib/load-routes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0BH,yBAAyB;AACzB,MAAM,CAAC,MAAM,oBAAoB,GAAe;IAC9C,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,EAAE,CAAC;IAClE,WAAW,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC;IAC3F,SAAS,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,CAAC;IAC3F,YAAY,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC;IACvF,iBAAiB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,yBAAyB,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC;IACzH,YAAY,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,C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,EAAE,EAAE,EAAE,IAAI,CAAC;IAClF,iBAAiB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC;IACpH,YAAY,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,CAAC;IAC5F,WAAW,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,CAAC;IAC1F,aAAa,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC;IAC1F,WAAW,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,SAAS,CAAC;IAC1F,eAAe,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC;CAC7E,CAAC"}
|
|
@@ -11,13 +11,29 @@
|
|
|
11
11
|
* CLI, Vite plugin, Swift script — agrees; this module owns the writes and the
|
|
12
12
|
* ignore coverage that keeps the file out of `git status`.
|
|
13
13
|
*/
|
|
14
|
-
import { localStatePathForConfigPath, readLocalSelection } from "./env-resolver-core.js";
|
|
14
|
+
import { localStatePathForConfigPath, readLocalSelection, type CoreLocalEnvironmentEntry } from "./env-resolver-core.js";
|
|
15
15
|
export { localStatePathForConfigPath, readLocalSelection };
|
|
16
16
|
/**
|
|
17
17
|
* Writes this machine's environment selection. Returns the path written so
|
|
18
18
|
* callers can name it in their success message.
|
|
19
19
|
*/
|
|
20
20
|
export declare function writeLocalSelection(configPath: string, name: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Registers (or replaces) the machine-local environment `name` (#4117): a
|
|
23
|
+
* child app's entry, naming its own app and server and the committed
|
|
24
|
+
* environment whose tree it shares. Returns the path written.
|
|
25
|
+
*
|
|
26
|
+
* Refuses, writing nothing, a name a committed environment already has and
|
|
27
|
+
* any entry the resolver core would refuse to read — the file this writes is
|
|
28
|
+
* always one every reader accepts. The selection and unrelated keys are kept.
|
|
29
|
+
*/
|
|
30
|
+
export declare function writeLocalEnvironment(configPath: string, name: string, entry: CoreLocalEnvironmentEntry): string;
|
|
31
|
+
/**
|
|
32
|
+
* Removes the machine-local environment `name` and clears a selection that
|
|
33
|
+
* names it, so no later command resolves an entry that is gone. Returns
|
|
34
|
+
* whether there was an entry to remove; anything else in the file is kept.
|
|
35
|
+
*/
|
|
36
|
+
export declare function removeLocalEnvironment(configPath: string, name: string): boolean;
|
|
21
37
|
/**
|
|
22
38
|
* Clears the selection if (and only if) it names `name`. Used by `env remove`
|
|
23
39
|
* so removing the selected environment can't leave a dangling selection that
|
|
@@ -39,17 +55,32 @@ export interface IgnoreCoverageOutcome {
|
|
|
39
55
|
/** Why, for `failed`. */
|
|
40
56
|
detail?: string;
|
|
41
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Makes sure the machine-local file at `path` is git-ignored before it is
|
|
60
|
+
* written, and confirms it.
|
|
61
|
+
*
|
|
62
|
+
* When the file is not already covered an anchored pattern is appended to the
|
|
63
|
+
* repository's exclude file, resolved via `git rev-parse --git-path
|
|
64
|
+
* info/exclude` so a linked worktree (where `.git` is a FILE) works, and
|
|
65
|
+
* anchored relative to `git rev-parse --show-toplevel` so a project root
|
|
66
|
+
* nested below the worktree root is not mis-rooted. `reason` names the command
|
|
67
|
+
* in the comment written beside the pattern.
|
|
68
|
+
*
|
|
69
|
+
* Coverage is confirmed, not assumed (#4485): a destination git already
|
|
70
|
+
* tracks is a failure, and so is one `git check-ignore` still reports as not
|
|
71
|
+
* ignored once the pattern is in place — a committed `.gitignore` negation
|
|
72
|
+
* outranks `info/exclude`. Git runs from the nearest existing directory above
|
|
73
|
+
* the destination, and no directory is created.
|
|
74
|
+
*/
|
|
75
|
+
export declare function ensureFileIgnored(path: string, options: {
|
|
76
|
+
reason: string;
|
|
77
|
+
}): IgnoreCoverageOutcome;
|
|
42
78
|
/**
|
|
43
79
|
* Makes sure `.primitive/local.json` is ignored before it is written.
|
|
44
80
|
*
|
|
45
81
|
* Templates scaffolded from now on carry the entry in their `.gitignore`, but
|
|
46
82
|
* projects created before this change do not — and `env use` writing an
|
|
47
83
|
* untracked-but-committable file would be exactly the "switching backends
|
|
48
|
-
* dirties the repo" problem this replaced.
|
|
49
|
-
* covered we append an anchored pattern to the repository's exclude file,
|
|
50
|
-
* resolved via `git rev-parse --git-path info/exclude` so a linked worktree
|
|
51
|
-
* (where `.git` is a FILE) works, and anchored relative to
|
|
52
|
-
* `git rev-parse --show-toplevel` so a project root nested below the worktree
|
|
53
|
-
* root is not mis-rooted.
|
|
84
|
+
* dirties the repo" problem this replaced. See {@link ensureFileIgnored}.
|
|
54
85
|
*/
|
|
55
86
|
export declare function ensureLocalStateIgnored(localStatePath: string): IgnoreCoverageOutcome;
|
|
@@ -14,8 +14,34 @@
|
|
|
14
14
|
import { execFileSync } from "child_process";
|
|
15
15
|
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "fs";
|
|
16
16
|
import { basename, dirname, join, relative, sep } from "path";
|
|
17
|
-
import { PRIMITIVE_LOCAL_STATE_VERSION, localStatePathForConfigPath, readLocalSelection, } from "./env-resolver-core.js";
|
|
17
|
+
import { PRIMITIVE_LOCAL_STATE_VERSION, PROJECT_CONFIG_DISPLAY_NAME, isCommittedEnvironment, localStatePathForConfigPath, parseLocalEnvironments, readCoreProjectConfig, readLocalSelection, } from "./env-resolver-core.js";
|
|
18
18
|
export { localStatePathForConfigPath, readLocalSelection };
|
|
19
|
+
/**
|
|
20
|
+
* The file's current keys, or an empty object for a missing or corrupt file.
|
|
21
|
+
* Unrelated keys a future version of the CLI may have written are preserved
|
|
22
|
+
* by every write.
|
|
23
|
+
*/
|
|
24
|
+
function readExistingLocalState(path) {
|
|
25
|
+
if (!existsSync(path))
|
|
26
|
+
return {};
|
|
27
|
+
try {
|
|
28
|
+
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
29
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
30
|
+
return parsed;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// A corrupt file is replaced wholesale — that is exactly the remedy the
|
|
35
|
+
// corrupt-local-state error tells the user to reach for.
|
|
36
|
+
}
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
function writeLocalStateFile(path, body) {
|
|
40
|
+
const dir = dirname(path);
|
|
41
|
+
if (!existsSync(dir))
|
|
42
|
+
mkdirSync(dir, { recursive: true });
|
|
43
|
+
writeFileSync(path, JSON.stringify(body, null, 2) + "\n");
|
|
44
|
+
}
|
|
19
45
|
/**
|
|
20
46
|
* Writes this machine's environment selection. Returns the path written so
|
|
21
47
|
* callers can name it in their success message.
|
|
@@ -25,20 +51,7 @@ export function writeLocalSelection(configPath, name) {
|
|
|
25
51
|
const dir = dirname(path);
|
|
26
52
|
if (!existsSync(dir))
|
|
27
53
|
mkdirSync(dir, { recursive: true });
|
|
28
|
-
|
|
29
|
-
let existing = {};
|
|
30
|
-
if (existsSync(path)) {
|
|
31
|
-
try {
|
|
32
|
-
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
33
|
-
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
34
|
-
existing = parsed;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
// A corrupt file is replaced wholesale — that is exactly the remedy the
|
|
39
|
-
// corrupt-local-state error tells the user to reach for.
|
|
40
|
-
}
|
|
41
|
-
}
|
|
54
|
+
const existing = readExistingLocalState(path);
|
|
42
55
|
const body = {
|
|
43
56
|
...existing,
|
|
44
57
|
version: PRIMITIVE_LOCAL_STATE_VERSION,
|
|
@@ -47,6 +60,72 @@ export function writeLocalSelection(configPath, name) {
|
|
|
47
60
|
writeFileSync(path, JSON.stringify(body, null, 2) + "\n");
|
|
48
61
|
return path;
|
|
49
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Registers (or replaces) the machine-local environment `name` (#4117): a
|
|
65
|
+
* child app's entry, naming its own app and server and the committed
|
|
66
|
+
* environment whose tree it shares. Returns the path written.
|
|
67
|
+
*
|
|
68
|
+
* Refuses, writing nothing, a name a committed environment already has and
|
|
69
|
+
* any entry the resolver core would refuse to read — the file this writes is
|
|
70
|
+
* always one every reader accepts. The selection and unrelated keys are kept.
|
|
71
|
+
*/
|
|
72
|
+
export function writeLocalEnvironment(configPath, name, entry) {
|
|
73
|
+
const path = localStatePathForConfigPath(configPath);
|
|
74
|
+
const config = readCoreProjectConfig(configPath);
|
|
75
|
+
if (isCommittedEnvironment(config, name)) {
|
|
76
|
+
throw new Error(`"${name}" is a committed environment in ${PROJECT_CONFIG_DISPLAY_NAME}; a machine-local environment needs a name of its own.`);
|
|
77
|
+
}
|
|
78
|
+
const existing = readExistingLocalState(path);
|
|
79
|
+
const current = existing.environments &&
|
|
80
|
+
typeof existing.environments === "object" &&
|
|
81
|
+
!Array.isArray(existing.environments)
|
|
82
|
+
? existing.environments
|
|
83
|
+
: {};
|
|
84
|
+
const environments = {
|
|
85
|
+
...current,
|
|
86
|
+
[name]: {
|
|
87
|
+
apiUrl: entry.apiUrl,
|
|
88
|
+
appId: entry.appId,
|
|
89
|
+
...(entry.appName !== undefined ? { appName: entry.appName } : {}),
|
|
90
|
+
tree: entry.tree,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
// The same rules the read applies, so a refused entry never reaches disk.
|
|
94
|
+
parseLocalEnvironments(environments, path, config);
|
|
95
|
+
writeLocalStateFile(path, {
|
|
96
|
+
...existing,
|
|
97
|
+
version: PRIMITIVE_LOCAL_STATE_VERSION,
|
|
98
|
+
environments,
|
|
99
|
+
});
|
|
100
|
+
return path;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Removes the machine-local environment `name` and clears a selection that
|
|
104
|
+
* names it, so no later command resolves an entry that is gone. Returns
|
|
105
|
+
* whether there was an entry to remove; anything else in the file is kept.
|
|
106
|
+
*/
|
|
107
|
+
export function removeLocalEnvironment(configPath, name) {
|
|
108
|
+
const path = localStatePathForConfigPath(configPath);
|
|
109
|
+
const existing = readExistingLocalState(path);
|
|
110
|
+
const environments = existing.environments;
|
|
111
|
+
if (!environments ||
|
|
112
|
+
typeof environments !== "object" ||
|
|
113
|
+
Array.isArray(environments) ||
|
|
114
|
+
!Object.prototype.hasOwnProperty.call(environments, name)) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
const remaining = { ...environments };
|
|
118
|
+
delete remaining[name];
|
|
119
|
+
const body = {
|
|
120
|
+
...existing,
|
|
121
|
+
version: PRIMITIVE_LOCAL_STATE_VERSION,
|
|
122
|
+
environments: remaining,
|
|
123
|
+
};
|
|
124
|
+
if (body.selectedEnvironment === name)
|
|
125
|
+
delete body.selectedEnvironment;
|
|
126
|
+
writeLocalStateFile(path, body);
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
50
129
|
/**
|
|
51
130
|
* Clears the selection if (and only if) it names `name`. Used by `env remove`
|
|
52
131
|
* so removing the selected environment can't leave a dangling selection that
|
|
@@ -97,71 +176,115 @@ function git(cwd, args) {
|
|
|
97
176
|
function escapeGitignorePattern(relPath) {
|
|
98
177
|
return relPath.replace(/[\\*?[\]]/g, (c) => "\\" + c).replace(/^([#!])/, "\\$1");
|
|
99
178
|
}
|
|
179
|
+
/** The nearest directory at or above `path` that exists. */
|
|
180
|
+
function nearestExistingDir(path) {
|
|
181
|
+
let dir = dirname(path);
|
|
182
|
+
while (!existsSync(dir)) {
|
|
183
|
+
const parent = dirname(dir);
|
|
184
|
+
if (parent === dir)
|
|
185
|
+
break;
|
|
186
|
+
dir = parent;
|
|
187
|
+
}
|
|
188
|
+
return dir;
|
|
189
|
+
}
|
|
190
|
+
/** Whether git reports `path` as ignored, run from `cwd`. */
|
|
191
|
+
function isGitIgnored(cwd, path) {
|
|
192
|
+
try {
|
|
193
|
+
execFileSync("git", ["check-ignore", "-q", "--", path], { cwd, stdio: "ignore" });
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
// Exit 1 means "not ignored".
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** Whether git tracks `path`, run from `cwd`. */
|
|
202
|
+
function isGitTracked(cwd, path) {
|
|
203
|
+
try {
|
|
204
|
+
execFileSync("git", ["ls-files", "--error-unmatch", "--", path], { cwd, stdio: "ignore" });
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
100
211
|
/**
|
|
101
|
-
* Makes sure
|
|
212
|
+
* Makes sure the machine-local file at `path` is git-ignored before it is
|
|
213
|
+
* written, and confirms it.
|
|
102
214
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
215
|
+
* When the file is not already covered an anchored pattern is appended to the
|
|
216
|
+
* repository's exclude file, resolved via `git rev-parse --git-path
|
|
217
|
+
* info/exclude` so a linked worktree (where `.git` is a FILE) works, and
|
|
218
|
+
* anchored relative to `git rev-parse --show-toplevel` so a project root
|
|
219
|
+
* nested below the worktree root is not mis-rooted. `reason` names the command
|
|
220
|
+
* in the comment written beside the pattern.
|
|
221
|
+
*
|
|
222
|
+
* Coverage is confirmed, not assumed (#4485): a destination git already
|
|
223
|
+
* tracks is a failure, and so is one `git check-ignore` still reports as not
|
|
224
|
+
* ignored once the pattern is in place — a committed `.gitignore` negation
|
|
225
|
+
* outranks `info/exclude`. Git runs from the nearest existing directory above
|
|
226
|
+
* the destination, and no directory is created.
|
|
112
227
|
*/
|
|
113
|
-
export function
|
|
114
|
-
const
|
|
115
|
-
if (!existsSync(dir))
|
|
116
|
-
mkdirSync(dir, { recursive: true });
|
|
228
|
+
export function ensureFileIgnored(path, options) {
|
|
229
|
+
const cwd = nearestExistingDir(path);
|
|
117
230
|
let topLevel;
|
|
118
231
|
try {
|
|
119
|
-
topLevel = git(
|
|
232
|
+
topLevel = git(cwd, ["rev-parse", "--show-toplevel"]);
|
|
120
233
|
}
|
|
121
234
|
catch {
|
|
122
235
|
return { status: "not-a-repo" };
|
|
123
236
|
}
|
|
124
237
|
if (!topLevel)
|
|
125
238
|
return { status: "not-a-repo" };
|
|
126
|
-
try {
|
|
127
|
-
execFileSync("git", ["check-ignore", "-q", "--", localStatePath], {
|
|
128
|
-
cwd: dir,
|
|
129
|
-
stdio: "ignore",
|
|
130
|
-
});
|
|
131
|
-
return { status: "already-ignored" };
|
|
132
|
-
}
|
|
133
|
-
catch {
|
|
134
|
-
// Exit 1 means "not ignored" — carry on and add coverage.
|
|
135
|
-
}
|
|
136
239
|
// git reports the toplevel with symlinks resolved (/private/var on macOS);
|
|
137
240
|
// the caller's path usually is not (/var). Compare like for like or the
|
|
138
241
|
// "relative" path escapes the repository entirely.
|
|
139
|
-
const
|
|
140
|
-
const rel = relative(topLevel, join(
|
|
141
|
-
|
|
142
|
-
|
|
242
|
+
const realPath = join(realpathSync(cwd), relative(cwd, path));
|
|
243
|
+
const rel = relative(topLevel, realPath).split(sep).join("/");
|
|
244
|
+
if (isGitTracked(cwd, realPath)) {
|
|
245
|
+
return { status: "failed", detail: `${rel} is tracked by git` };
|
|
246
|
+
}
|
|
247
|
+
if (isGitIgnored(cwd, realPath))
|
|
248
|
+
return { status: "already-ignored" };
|
|
143
249
|
const pattern = "/" + escapeGitignorePattern(rel);
|
|
250
|
+
const overridden = {
|
|
251
|
+
status: "failed",
|
|
252
|
+
detail: `${rel} is still not ignored: a .gitignore rule overrides the exclude entry "${pattern}"`,
|
|
253
|
+
};
|
|
144
254
|
try {
|
|
145
|
-
const excludePath = git(
|
|
255
|
+
const excludePath = git(cwd, ["rev-parse", "--path-format=absolute", "--git-path", "info/exclude"]);
|
|
146
256
|
if (!excludePath)
|
|
147
257
|
return { status: "failed", detail: "could not locate the git exclude file" };
|
|
148
258
|
mkdirSync(dirname(excludePath), { recursive: true });
|
|
149
259
|
const existing = existsSync(excludePath) ? readFileSync(excludePath, "utf-8") : "";
|
|
150
260
|
if (existing.split(/\r?\n/).some((line) => line.trim() === pattern)) {
|
|
151
|
-
return { status: "already-ignored" };
|
|
261
|
+
return isGitIgnored(cwd, realPath) ? { status: "already-ignored" } : overridden;
|
|
152
262
|
}
|
|
153
263
|
const prefix = existing === "" || existing.endsWith("\n") ? "" : "\n";
|
|
154
264
|
writeFileSync(excludePath, existing +
|
|
155
265
|
prefix +
|
|
156
|
-
`\n# Added by '
|
|
157
|
-
`#
|
|
158
|
-
`#
|
|
266
|
+
`\n# Added by '${options.reason}' — ${basename(path)} is per-machine Primitive\n` +
|
|
267
|
+
`# state, never committed. Add the same pattern to a committed .gitignore to\n` +
|
|
268
|
+
`# make the coverage shared.\n` +
|
|
159
269
|
pattern +
|
|
160
270
|
"\n");
|
|
271
|
+
if (!isGitIgnored(cwd, realPath))
|
|
272
|
+
return overridden;
|
|
161
273
|
return { status: "excluded", excludePath, pattern };
|
|
162
274
|
}
|
|
163
275
|
catch (err) {
|
|
164
276
|
return { status: "failed", detail: err?.message || String(err) };
|
|
165
277
|
}
|
|
166
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* Makes sure `.primitive/local.json` is ignored before it is written.
|
|
281
|
+
*
|
|
282
|
+
* Templates scaffolded from now on carry the entry in their `.gitignore`, but
|
|
283
|
+
* projects created before this change do not — and `env use` writing an
|
|
284
|
+
* untracked-but-committable file would be exactly the "switching backends
|
|
285
|
+
* dirties the repo" problem this replaced. See {@link ensureFileIgnored}.
|
|
286
|
+
*/
|
|
287
|
+
export function ensureLocalStateIgnored(localStatePath) {
|
|
288
|
+
return ensureFileIgnored(localStatePath, { reason: "primitive env use" });
|
|
289
|
+
}
|
|
167
290
|
//# sourceMappingURL=local-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-state.js","sourceRoot":"","sources":["../../../src/lib/local-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE9D,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"local-state.js","sourceRoot":"","sources":["../../../src/lib/local-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE9D,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GAEnB,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CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -37,8 +37,11 @@ export interface LocalTestCaseScan {
|
|
|
37
37
|
export type ManagedTestCases = Record<string, {
|
|
38
38
|
id?: string;
|
|
39
39
|
} | undefined>;
|
|
40
|
-
/**
|
|
41
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Read the current environment's manifest test-case rows, or nothing when it
|
|
42
|
+
* cannot be read.
|
|
43
|
+
*/
|
|
44
|
+
export declare function readManagedTestCases(): ManagedTestCases;
|
|
42
45
|
/**
|
|
43
46
|
* The `*.toml` case files in a suite's sidecar directory, if it has one.
|
|
44
47
|
*
|
|
@@ -30,10 +30,13 @@ import { existsSync, readFileSync, readdirSync, statSync } from "fs";
|
|
|
30
30
|
import { basename, join } from "path";
|
|
31
31
|
import { testCaseFileBasenames } from "./test-case-file-names.js";
|
|
32
32
|
import { normalizeTestCaseKey } from "./test-case-keys.js";
|
|
33
|
-
import {
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
import { resolveSyncStateReadPath } from "./sync-paths.js";
|
|
34
|
+
/**
|
|
35
|
+
* Read the current environment's manifest test-case rows, or nothing when it
|
|
36
|
+
* cannot be read.
|
|
37
|
+
*/
|
|
38
|
+
export function readManagedTestCases() {
|
|
39
|
+
const syncFile = resolveSyncStateReadPath();
|
|
37
40
|
if (!existsSync(syncFile))
|
|
38
41
|
return {};
|
|
39
42
|
try {
|