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,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `collections.json` artifact, and the decisions an import makes from it
|
|
3
|
-
* (#3643).
|
|
3
|
+
* (#3643), on custody and roles (#4731).
|
|
4
4
|
*
|
|
5
5
|
* `documents export-all` / `documents import` carry Yjs state, blobs,
|
|
6
6
|
* permissions and aliases, but nothing about collections: which exist, what
|
|
@@ -16,11 +16,28 @@
|
|
|
16
16
|
* reads against a real server, they are the facts the plan is built from, and
|
|
17
17
|
* the command performs them and hands the answers in.
|
|
18
18
|
*/
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The only file version this CLI reads or writes. #4731 added custody and
|
|
21
|
+
* roles to it without a new version (DSO4731-14): every field a version-1
|
|
22
|
+
* reader needs (`owner`, a `permission` on every member, `groupType` and
|
|
23
|
+
* `permission` on every grant) is still written, and `custodian`, `settings`
|
|
24
|
+
* and a `role` beside each `permission` are added, so an older CLI still
|
|
25
|
+
* reads a new file and this CLI reads an old one.
|
|
26
|
+
*/
|
|
20
27
|
export declare const COLLECTION_EXPORT_VERSION = 1;
|
|
21
28
|
/** Its name inside an export directory, beside `manifest.json`. */
|
|
22
29
|
export declare const COLLECTION_EXPORT_FILENAME = "collections.json";
|
|
23
30
|
export type CollectionPermission = "reader" | "read-write";
|
|
31
|
+
/** A collection role, highest first. */
|
|
32
|
+
export declare const COLLECTION_ROLES: readonly ["owner", "manager", "editor", "contributor", "viewer"];
|
|
33
|
+
export type CollectionRole = (typeof COLLECTION_ROLES)[number];
|
|
34
|
+
/**
|
|
35
|
+
* The role a `permission` reads as when a file records no `role`: the
|
|
36
|
+
* mapping the server's compatibility layer applies to an old client's grant.
|
|
37
|
+
*/
|
|
38
|
+
export declare function roleForLegacyPermission(permission: unknown): CollectionRole;
|
|
39
|
+
/** The `permission` a role reads as, written beside it for an older reader. */
|
|
40
|
+
export declare function permissionForRole(role: CollectionRole): CollectionPermission;
|
|
24
41
|
export interface ExportedOwner {
|
|
25
42
|
/** The SOURCE app's userId. Meaningful in the target only for a same-app import. */
|
|
26
43
|
userId: string;
|
|
@@ -28,12 +45,17 @@ export interface ExportedOwner {
|
|
|
28
45
|
email?: string;
|
|
29
46
|
}
|
|
30
47
|
export interface ExportedMember extends ExportedOwner {
|
|
48
|
+
/** What a reader written before roles reads; `role` is the answer. */
|
|
31
49
|
permission: CollectionPermission;
|
|
50
|
+
role: CollectionRole;
|
|
32
51
|
}
|
|
33
52
|
export interface ExportedGroupGrant {
|
|
34
|
-
|
|
53
|
+
/** The group's type, so a group written before the role model still resolves. */
|
|
54
|
+
groupType?: string;
|
|
35
55
|
groupId: string;
|
|
36
|
-
|
|
56
|
+
/** What a reader written before roles reads; `role` is the answer. */
|
|
57
|
+
permission?: CollectionPermission;
|
|
58
|
+
role: CollectionRole;
|
|
37
59
|
}
|
|
38
60
|
export interface ExportedCollectionDocument {
|
|
39
61
|
documentId: string;
|
|
@@ -45,7 +67,18 @@ export interface ExportedCollection {
|
|
|
45
67
|
description: string | null;
|
|
46
68
|
collectionType: string | null;
|
|
47
69
|
createdAt: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* `user:<source userId>`, `app`, or null for a collection created before
|
|
72
|
+
* custody (its creator holds the owner row). Absent in a file written before
|
|
73
|
+
* #4731, which reads as null.
|
|
74
|
+
*/
|
|
75
|
+
custodian?: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* The custodian user's identity (the creator's, when `custodian` is null);
|
|
78
|
+
* null under app custody.
|
|
79
|
+
*/
|
|
48
80
|
owner: ExportedOwner | null;
|
|
81
|
+
settings?: Record<string, unknown> | null;
|
|
49
82
|
documents: ExportedCollectionDocument[];
|
|
50
83
|
members: ExportedMember[];
|
|
51
84
|
groups: ExportedGroupGrant[];
|
|
@@ -95,12 +128,17 @@ export interface CollectionImportProblem {
|
|
|
95
128
|
/** The target collection a name match found, as far as compatibility cares. */
|
|
96
129
|
export interface ExistingTargetCollection {
|
|
97
130
|
collectionId: string;
|
|
98
|
-
|
|
131
|
+
/** `app` or `user:<userId>`; a legacy row with none reads as its creator's. */
|
|
132
|
+
custodian: string;
|
|
99
133
|
collectionType: string | null;
|
|
100
134
|
}
|
|
135
|
+
/** The custodian a create sends: `app`, or the owner as `user:<userId>`. */
|
|
136
|
+
export declare function custodianFor(ownerUserId: string | null, appCustody: boolean): string | null;
|
|
101
137
|
export interface CollectionResolution {
|
|
102
138
|
/** The userId the owner resolved to in the TARGET app, or null. */
|
|
103
139
|
ownerUserId: string | null;
|
|
140
|
+
/** The file records app custody (and `--owner` did not override it). */
|
|
141
|
+
appCustody?: boolean;
|
|
104
142
|
/** Why the owner could not be resolved — becomes the refusal's reason. */
|
|
105
143
|
ownerReason?: string;
|
|
106
144
|
/** The ONE target collection carrying this exact name, if any. */
|
|
@@ -122,21 +160,32 @@ export interface CollectionPlanRow {
|
|
|
122
160
|
reason?: string;
|
|
123
161
|
/** Where it lands: known up front only for a `merge`. */
|
|
124
162
|
targetCollectionId?: string;
|
|
125
|
-
/** The resolved owner, for a `create
|
|
163
|
+
/** The resolved owner, for a `create` under user custody. */
|
|
126
164
|
ownerUserId?: string;
|
|
165
|
+
/** The custodian the collection lands with: `app` or `user:<userId>`. */
|
|
166
|
+
custodian?: string;
|
|
127
167
|
/** A refusal that must also be REPORTED as a problem carries it here. */
|
|
128
168
|
problem?: Omit<CollectionImportProblem, "sourceCollectionId" | "name">;
|
|
129
169
|
}
|
|
130
170
|
/**
|
|
131
|
-
* Which of
|
|
132
|
-
* fields
|
|
133
|
-
* rejects a type change
|
|
134
|
-
* merged away (F2). A `contextId` an older file still carries is not
|
|
135
|
-
* the platform removed the field (#3926), so it is no difference at
|
|
171
|
+
* Which of the custodian and `collectionType` a name match differs on — the
|
|
172
|
+
* fields a merge cannot change (custody moves only by a transfer, and
|
|
173
|
+
* `collections-controller.ts` rejects a type change), so a difference cannot
|
|
174
|
+
* be merged away (F2). A `contextId` an older file still carries is not
|
|
175
|
+
* compared: the platform removed the field (#3926), so it is no difference at
|
|
176
|
+
* all.
|
|
136
177
|
*
|
|
137
178
|
* Returns null when the match is compatible.
|
|
138
179
|
*/
|
|
139
|
-
export declare function incompatibleField(collection: Pick<ExportedCollection, "collectionType">, existing: ExistingTargetCollection,
|
|
180
|
+
export declare function incompatibleField(collection: Pick<ExportedCollection, "collectionType">, existing: ExistingTargetCollection, custodian: string): "owner" | "collectionType" | null;
|
|
181
|
+
/**
|
|
182
|
+
* Whether two grants name the same group. A group is addressed by its id
|
|
183
|
+
* alone: the server stores every new group as type `group` and the
|
|
184
|
+
* migration keeps a public id unique across types, so a recorded grant's
|
|
185
|
+
* deprecated type (`team`) names the target's group of that id whatever type
|
|
186
|
+
* it stored. A platform type (`_col-*`) keeps its exact meaning.
|
|
187
|
+
*/
|
|
188
|
+
export declare function sameGrantGroup(a: ExportedGroupGrant, b: ExportedGroupGrant): boolean;
|
|
140
189
|
/** What to do about one recorded group grant, given the target's grants. */
|
|
141
190
|
export type GrantDisposition = "grant" | "already-applied" | "update";
|
|
142
191
|
/**
|
|
@@ -151,8 +200,8 @@ export type GrantDisposition = "grant" | "already-applied" | "update";
|
|
|
151
200
|
* used to report such a grant instead of changing it (F3).
|
|
152
201
|
*/
|
|
153
202
|
export declare function grantDisposition(wanted: ExportedGroupGrant, targetGrants: ExportedGroupGrant[]): GrantDisposition;
|
|
154
|
-
/** The line a
|
|
155
|
-
export declare function grantUpdateLine(groupLabel: string,
|
|
203
|
+
/** The line a role change is announced with, named from and to. */
|
|
204
|
+
export declare function grantUpdateLine(groupLabel: string, existingRole: string, wantedRole: string): string;
|
|
156
205
|
/**
|
|
157
206
|
* What a server refusal reads as in a per-item problem.
|
|
158
207
|
*
|
|
@@ -189,9 +238,21 @@ export declare function duplicateNameSources(collections: ExportedCollection[]):
|
|
|
189
238
|
export declare function groupTargetsByName(rows: Array<{
|
|
190
239
|
collectionId: string;
|
|
191
240
|
name: string;
|
|
192
|
-
|
|
241
|
+
custodian?: string | null;
|
|
242
|
+
createdBy?: string;
|
|
193
243
|
collectionType?: string | null;
|
|
194
244
|
}>): Map<string, ExistingTargetCollection[]>;
|
|
245
|
+
/**
|
|
246
|
+
* The custodian a listing row records. A legacy row written before custody
|
|
247
|
+
* has none; its creator holds the owner row, so it reads as theirs — the
|
|
248
|
+
* server's own reading of such a row.
|
|
249
|
+
*/
|
|
250
|
+
export declare function rowCustodian(row: {
|
|
251
|
+
custodian?: string | null;
|
|
252
|
+
createdBy?: string;
|
|
253
|
+
}): string;
|
|
254
|
+
/** The userId a `user:<userId>` custodian names; null for `app`. */
|
|
255
|
+
export declare function custodianUserId(custodian: string): string | null;
|
|
195
256
|
export interface CollectionImportSummary {
|
|
196
257
|
created: number;
|
|
197
258
|
merged: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `collections.json` artifact, and the decisions an import makes from it
|
|
3
|
-
* (#3643).
|
|
3
|
+
* (#3643), on custody and roles (#4731).
|
|
4
4
|
*
|
|
5
5
|
* `documents export-all` / `documents import` carry Yjs state, blobs,
|
|
6
6
|
* permissions and aliases, but nothing about collections: which exist, what
|
|
@@ -18,10 +18,33 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import fs from "node:fs";
|
|
20
20
|
import path from "node:path";
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The only file version this CLI reads or writes. #4731 added custody and
|
|
23
|
+
* roles to it without a new version (DSO4731-14): every field a version-1
|
|
24
|
+
* reader needs (`owner`, a `permission` on every member, `groupType` and
|
|
25
|
+
* `permission` on every grant) is still written, and `custodian`, `settings`
|
|
26
|
+
* and a `role` beside each `permission` are added, so an older CLI still
|
|
27
|
+
* reads a new file and this CLI reads an old one.
|
|
28
|
+
*/
|
|
22
29
|
export const COLLECTION_EXPORT_VERSION = 1;
|
|
23
30
|
/** Its name inside an export directory, beside `manifest.json`. */
|
|
24
31
|
export const COLLECTION_EXPORT_FILENAME = "collections.json";
|
|
32
|
+
/** A collection role, highest first. */
|
|
33
|
+
export const COLLECTION_ROLES = ["owner", "manager", "editor", "contributor", "viewer"];
|
|
34
|
+
function isCollectionRole(value) {
|
|
35
|
+
return typeof value === "string" && COLLECTION_ROLES.includes(value);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The role a `permission` reads as when a file records no `role`: the
|
|
39
|
+
* mapping the server's compatibility layer applies to an old client's grant.
|
|
40
|
+
*/
|
|
41
|
+
export function roleForLegacyPermission(permission) {
|
|
42
|
+
return permission === "read-write" ? "editor" : "viewer";
|
|
43
|
+
}
|
|
44
|
+
/** The `permission` a role reads as, written beside it for an older reader. */
|
|
45
|
+
export function permissionForRole(role) {
|
|
46
|
+
return role === "viewer" || role === "contributor" ? "reader" : "read-write";
|
|
47
|
+
}
|
|
25
48
|
/**
|
|
26
49
|
* Resolve the `<path>` an import was given to the file it must read.
|
|
27
50
|
*
|
|
@@ -57,7 +80,8 @@ export function readCollectionExportFile(inputPath) {
|
|
|
57
80
|
throw new Error(`${filePath} declares version ${JSON.stringify(parsed?.version)}; ` +
|
|
58
81
|
`this CLI reads version ${COLLECTION_EXPORT_VERSION} only.`);
|
|
59
82
|
}
|
|
60
|
-
const
|
|
83
|
+
const raw = Array.isArray(parsed.collections) ? parsed.collections : [];
|
|
84
|
+
const collections = raw.map(withRoles);
|
|
61
85
|
const legacyContextIdCount = collections.filter((c) => typeof c?.contextId === "string" && c.contextId !== "").length;
|
|
62
86
|
return {
|
|
63
87
|
version: parsed.version,
|
|
@@ -69,16 +93,55 @@ export function readCollectionExportFile(inputPath) {
|
|
|
69
93
|
};
|
|
70
94
|
}
|
|
71
95
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
96
|
+
* One collection as the import reads it, with a `role` on every member and
|
|
97
|
+
* grant. A file written before #4731 records only a `permission`: each reads
|
|
98
|
+
* as the role the server's compatibility layer gives it (`reader` → viewer,
|
|
99
|
+
* `read-write` → editor), except the owner's own `read-write` row, which the
|
|
100
|
+
* server reads as the owner row on a collection with no custodian, and so
|
|
101
|
+
* does this.
|
|
102
|
+
*/
|
|
103
|
+
function withRoles(collection) {
|
|
104
|
+
const preCustody = !collection || !("custodian" in collection);
|
|
105
|
+
const owner = collection?.owner ?? null;
|
|
106
|
+
const isOwner = (m) => owner !== null &&
|
|
107
|
+
((owner.userId && m?.userId === owner.userId) || (owner.email && m?.email === owner.email));
|
|
108
|
+
return {
|
|
109
|
+
...collection,
|
|
110
|
+
custodian: collection?.custodian ?? null,
|
|
111
|
+
owner,
|
|
112
|
+
settings: collection?.settings ?? null,
|
|
113
|
+
members: (Array.isArray(collection?.members) ? collection.members : []).map((m) => {
|
|
114
|
+
const role = isCollectionRole(m?.role)
|
|
115
|
+
? m.role
|
|
116
|
+
: preCustody && m?.permission === "read-write" && isOwner(m)
|
|
117
|
+
? "owner"
|
|
118
|
+
: roleForLegacyPermission(m?.permission);
|
|
119
|
+
return { ...m, role, permission: m?.permission ?? permissionForRole(role) };
|
|
120
|
+
}),
|
|
121
|
+
groups: (Array.isArray(collection?.groups) ? collection.groups : []).map((g) => {
|
|
122
|
+
const role = isCollectionRole(g?.role) ? g.role : roleForLegacyPermission(g?.permission);
|
|
123
|
+
return { ...g, role, permission: g?.permission ?? permissionForRole(role) };
|
|
124
|
+
}),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** The custodian a create sends: `app`, or the owner as `user:<userId>`. */
|
|
128
|
+
export function custodianFor(ownerUserId, appCustody) {
|
|
129
|
+
if (appCustody)
|
|
130
|
+
return "app";
|
|
131
|
+
return ownerUserId ? `user:${ownerUserId}` : null;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Which of the custodian and `collectionType` a name match differs on — the
|
|
135
|
+
* fields a merge cannot change (custody moves only by a transfer, and
|
|
136
|
+
* `collections-controller.ts` rejects a type change), so a difference cannot
|
|
137
|
+
* be merged away (F2). A `contextId` an older file still carries is not
|
|
138
|
+
* compared: the platform removed the field (#3926), so it is no difference at
|
|
139
|
+
* all.
|
|
77
140
|
*
|
|
78
141
|
* Returns null when the match is compatible.
|
|
79
142
|
*/
|
|
80
|
-
export function incompatibleField(collection, existing,
|
|
81
|
-
if (existing.
|
|
143
|
+
export function incompatibleField(collection, existing, custodian) {
|
|
144
|
+
if (existing.custodian !== custodian)
|
|
82
145
|
return "owner";
|
|
83
146
|
// The server defaults an unset type to "default", so the file's null and the
|
|
84
147
|
// target's "default" are the same collection type, not a difference.
|
|
@@ -87,6 +150,21 @@ export function incompatibleField(collection, existing, ownerUserId) {
|
|
|
87
150
|
return "collectionType";
|
|
88
151
|
return null;
|
|
89
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Whether two grants name the same group. A group is addressed by its id
|
|
155
|
+
* alone: the server stores every new group as type `group` and the
|
|
156
|
+
* migration keeps a public id unique across types, so a recorded grant's
|
|
157
|
+
* deprecated type (`team`) names the target's group of that id whatever type
|
|
158
|
+
* it stored. A platform type (`_col-*`) keeps its exact meaning.
|
|
159
|
+
*/
|
|
160
|
+
export function sameGrantGroup(a, b) {
|
|
161
|
+
if (a.groupId !== b.groupId)
|
|
162
|
+
return false;
|
|
163
|
+
const system = (grant) => String(grant.groupType ?? "").startsWith("_");
|
|
164
|
+
if (system(a) || system(b))
|
|
165
|
+
return a.groupType === b.groupType;
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
90
168
|
/**
|
|
91
169
|
* Compare a recorded grant with the target's.
|
|
92
170
|
*
|
|
@@ -99,17 +177,15 @@ export function incompatibleField(collection, existing, ownerUserId) {
|
|
|
99
177
|
* used to report such a grant instead of changing it (F3).
|
|
100
178
|
*/
|
|
101
179
|
export function grantDisposition(wanted, targetGrants) {
|
|
102
|
-
const existing = targetGrants.find((g) => g
|
|
180
|
+
const existing = targetGrants.find((g) => sameGrantGroup(g, wanted));
|
|
103
181
|
if (!existing)
|
|
104
182
|
return "grant";
|
|
105
|
-
return existing.
|
|
106
|
-
? "already-applied"
|
|
107
|
-
: "update";
|
|
183
|
+
return existing.role === wanted.role ? "already-applied" : "update";
|
|
108
184
|
}
|
|
109
|
-
/** The line a
|
|
110
|
-
export function grantUpdateLine(groupLabel,
|
|
111
|
-
return (`${groupLabel}: ${
|
|
112
|
-
`(the
|
|
185
|
+
/** The line a role change is announced with, named from and to. */
|
|
186
|
+
export function grantUpdateLine(groupLabel, existingRole, wantedRole) {
|
|
187
|
+
return (`${groupLabel}: ${existingRole} → ${wantedRole} ` +
|
|
188
|
+
`(the role the export records)`);
|
|
113
189
|
}
|
|
114
190
|
/**
|
|
115
191
|
* What a server refusal reads as in a per-item problem.
|
|
@@ -170,7 +246,8 @@ export function planCollection(collection, resolution, options) {
|
|
|
170
246
|
problem: { kind: "collection", id: collection.name, reason },
|
|
171
247
|
};
|
|
172
248
|
}
|
|
173
|
-
|
|
249
|
+
const custodian = custodianFor(resolution.ownerUserId, Boolean(resolution.appCustody));
|
|
250
|
+
if (!custodian) {
|
|
174
251
|
const reason = resolution.ownerReason ??
|
|
175
252
|
`its owner could not be resolved in the target app`;
|
|
176
253
|
return {
|
|
@@ -189,14 +266,15 @@ export function planCollection(collection, resolution, options) {
|
|
|
189
266
|
return {
|
|
190
267
|
...base,
|
|
191
268
|
action: "create",
|
|
192
|
-
|
|
269
|
+
custodian,
|
|
270
|
+
...(resolution.ownerUserId && !resolution.appCustody ? { ownerUserId: resolution.ownerUserId } : {}),
|
|
193
271
|
};
|
|
194
272
|
}
|
|
195
273
|
// A name match is checked for compatibility WHETHER OR NOT --overwrite was
|
|
196
274
|
// given: none of these fields can be changed after creation, so an
|
|
197
275
|
// incompatible match can never become the collection the file describes, and
|
|
198
276
|
// reporting it under --dry-run is the point (F2).
|
|
199
|
-
const field = incompatibleField(collection, existing,
|
|
277
|
+
const field = incompatibleField(collection, existing, custodian);
|
|
200
278
|
if (field) {
|
|
201
279
|
const reason = `a collection named "${collection.name}" already exists in the target ` +
|
|
202
280
|
`(${existing.collectionId}) with a different ${field}, which cannot be ` +
|
|
@@ -221,7 +299,8 @@ export function planCollection(collection, resolution, options) {
|
|
|
221
299
|
...base,
|
|
222
300
|
action: "merge",
|
|
223
301
|
targetCollectionId: existing.collectionId,
|
|
224
|
-
|
|
302
|
+
custodian,
|
|
303
|
+
...(resolution.ownerUserId && !resolution.appCustody ? { ownerUserId: resolution.ownerUserId } : {}),
|
|
225
304
|
};
|
|
226
305
|
}
|
|
227
306
|
/**
|
|
@@ -257,13 +336,27 @@ export function groupTargetsByName(rows) {
|
|
|
257
336
|
const matches = byName.get(row.name) ?? [];
|
|
258
337
|
matches.push({
|
|
259
338
|
collectionId: row.collectionId,
|
|
260
|
-
|
|
339
|
+
custodian: rowCustodian(row),
|
|
261
340
|
collectionType: row.collectionType ?? null,
|
|
262
341
|
});
|
|
263
342
|
byName.set(row.name, matches);
|
|
264
343
|
}
|
|
265
344
|
return byName;
|
|
266
345
|
}
|
|
346
|
+
/**
|
|
347
|
+
* The custodian a listing row records. A legacy row written before custody
|
|
348
|
+
* has none; its creator holds the owner row, so it reads as theirs — the
|
|
349
|
+
* server's own reading of such a row.
|
|
350
|
+
*/
|
|
351
|
+
export function rowCustodian(row) {
|
|
352
|
+
if (typeof row.custodian === "string" && row.custodian.length > 0)
|
|
353
|
+
return row.custodian;
|
|
354
|
+
return row.createdBy ? `user:${row.createdBy}` : "app";
|
|
355
|
+
}
|
|
356
|
+
/** The userId a `user:<userId>` custodian names; null for `app`. */
|
|
357
|
+
export function custodianUserId(custodian) {
|
|
358
|
+
return custodian.startsWith("user:") ? custodian.slice("user:".length) : null;
|
|
359
|
+
}
|
|
267
360
|
export function emptyImportSummary() {
|
|
268
361
|
return {
|
|
269
362
|
created: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-export.js","sourceRoot":"","sources":["../../../src/lib/collection-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B
|
|
1
|
+
{"version":3,"file":"collection-export.js","sourceRoot":"","sources":["../../../src/lib/collection-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C,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,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A collection member as the CLI names it: a user id, or `group:<group-id>`,
|
|
3
|
+
* and its role on the collection's five-rung ladder.
|
|
4
|
+
*/
|
|
5
|
+
/** Collection roles, highest first. */
|
|
6
|
+
export declare const COLLECTION_ROLES: readonly ["owner", "manager", "editor", "contributor", "viewer"];
|
|
7
|
+
/** A collection role. */
|
|
8
|
+
export type CollectionRole = (typeof COLLECTION_ROLES)[number];
|
|
9
|
+
/** A member as the member routes take it in a body. */
|
|
10
|
+
export type CollectionPrincipalBody = {
|
|
11
|
+
userId: string;
|
|
12
|
+
} | {
|
|
13
|
+
groupId: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Parse `<user-id>` or `group:<group-id>`. Throws, naming the expected
|
|
17
|
+
* shape, for an empty value, an empty group id, or one carrying a
|
|
18
|
+
* separator.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseCollectionPrincipal(value: string): CollectionPrincipalBody;
|
|
21
|
+
/** Parse a role, or throw naming the five. */
|
|
22
|
+
export declare function parseCollectionRole(value: string): CollectionRole;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A collection member as the CLI names it: a user id, or `group:<group-id>`,
|
|
3
|
+
* and its role on the collection's five-rung ladder.
|
|
4
|
+
*/
|
|
5
|
+
/** Collection roles, highest first. */
|
|
6
|
+
export const COLLECTION_ROLES = ["owner", "manager", "editor", "contributor", "viewer"];
|
|
7
|
+
const GROUP_PREFIX = "group:";
|
|
8
|
+
const SEPARATORS = /[\s#/?%]/;
|
|
9
|
+
/**
|
|
10
|
+
* Parse `<user-id>` or `group:<group-id>`. Throws, naming the expected
|
|
11
|
+
* shape, for an empty value, an empty group id, or one carrying a
|
|
12
|
+
* separator.
|
|
13
|
+
*/
|
|
14
|
+
export function parseCollectionPrincipal(value) {
|
|
15
|
+
const shape = 'A member is a user id or "group:<group-id>"';
|
|
16
|
+
if (typeof value !== "string" || value.length === 0)
|
|
17
|
+
throw new Error(`${shape}.`);
|
|
18
|
+
if (value.startsWith(GROUP_PREFIX)) {
|
|
19
|
+
const groupId = value.slice(GROUP_PREFIX.length);
|
|
20
|
+
if (groupId.length === 0 || SEPARATORS.test(groupId)) {
|
|
21
|
+
throw new Error(`"${value}" does not name a group: ${shape}.`);
|
|
22
|
+
}
|
|
23
|
+
return { groupId };
|
|
24
|
+
}
|
|
25
|
+
if (SEPARATORS.test(value))
|
|
26
|
+
throw new Error(`"${value}" is not a principal: ${shape}.`);
|
|
27
|
+
return { userId: value };
|
|
28
|
+
}
|
|
29
|
+
/** Parse a role, or throw naming the five. */
|
|
30
|
+
export function parseCollectionRole(value) {
|
|
31
|
+
if (COLLECTION_ROLES.includes(value))
|
|
32
|
+
return value;
|
|
33
|
+
throw new Error(`Unknown role "${value}": the role is one of ${COLLECTION_ROLES.join(", ")}.`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=collection-principal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-principal.js","sourceRoot":"","sources":["../../../src/lib/collection-principal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAU,CAAC;AAQjG,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,MAAM,UAAU,GAAG,UAAU,CAAC;AAE9B;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,MAAM,KAAK,GAAG,6CAA6C,CAAC;IAC5D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;IAClF,IAAI,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,4BAA4B,KAAK,GAAG,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,yBAAyB,KAAK,GAAG,CAAC,CAAC;IACxF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,IAAK,gBAAsC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAuB,CAAC;IAC5F,MAAM,IAAI,KAAK,CAAC,iBAAiB,KAAK,yBAAyB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjG,CAAC"}
|
|
@@ -71,10 +71,10 @@ export interface ConfigObjectCompanionFile {
|
|
|
71
71
|
fields: readonly ConfigFieldDescriptor[];
|
|
72
72
|
}
|
|
73
73
|
export interface ConfigObjectDescriptor {
|
|
74
|
-
/** Selector name: `
|
|
74
|
+
/** Selector name: `function`, `prompt`, `app`, `var`. */
|
|
75
75
|
type: string;
|
|
76
76
|
/**
|
|
77
|
-
* Layout metadata for the
|
|
77
|
+
* Layout metadata for the per-entity types. Absent for the two root
|
|
78
78
|
* singletons (`app.toml`, `vars.toml`), which `SYNC_RESOURCE_TYPES`
|
|
79
79
|
* deliberately excludes.
|
|
80
80
|
*/
|
|
@@ -83,7 +83,7 @@ export interface ConfigObjectDescriptor {
|
|
|
83
83
|
fileHint: string;
|
|
84
84
|
/**
|
|
85
85
|
* Dotted path of the key that names the object, when it has one in-file.
|
|
86
|
-
* Types keyed purely by filename (
|
|
86
|
+
* Types keyed purely by filename (rule-sets) declare none.
|
|
87
87
|
*/
|
|
88
88
|
identity?: string;
|
|
89
89
|
/** One line describing what the object configures. */
|
|
@@ -102,25 +102,6 @@ export interface ConfigObjectDescriptor {
|
|
|
102
102
|
}
|
|
103
103
|
/** The identity path a descriptor declares, or `undefined` when keyed by filename. */
|
|
104
104
|
export declare function describedIdentityPath(descriptor: ConfigObjectDescriptor): string | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* What the server assumes when a `[workflow]` key is absent.
|
|
107
|
-
*
|
|
108
|
-
* The vendored `WORKFLOW_TABLE` (#2644) carries key set and value shape but
|
|
109
|
-
* not defaults, so the defaults are stated here, next to the other types'.
|
|
110
|
-
* They are not free text: the `models.yaml` `WorkflowDefinition` defaults are
|
|
111
|
-
* the source of truth, and
|
|
112
|
-
* `cli/tests/unit/config-object-descriptor.test.ts` parses that model and fails
|
|
113
|
-
* when a default here disagrees or a newly-defaulted field is missing. Without
|
|
114
|
-
* them `config fields workflow` reported `default null` for the queueing and
|
|
115
|
-
* dispatch knobs — the command that replaced per-flag `--help` under-reporting
|
|
116
|
-
* exactly what the removed flags used to document (issue #2645).
|
|
117
|
-
*
|
|
118
|
-
* Exported because `config diff`'s workflow comparator needs exactly this table
|
|
119
|
-
* to normalize omitted-vs-defaulted fields, and kept a hand-mirrored second
|
|
120
|
-
* copy of it until #2731. Two tables can disagree; a guarded one cannot go
|
|
121
|
-
* stale unnoticed.
|
|
122
|
-
*/
|
|
123
|
-
export declare const WORKFLOW_FIELD_DEFAULTS: Record<string, string | number | boolean>;
|
|
124
105
|
export declare const CONFIG_OBJECT_DESCRIPTORS: readonly ConfigObjectDescriptor[];
|
|
125
106
|
/** Every selector type name, in registry order. */
|
|
126
107
|
export declare const CONFIG_OBJECT_TYPES: readonly string[];
|