primitive-admin 1.2.0-alpha.8 → 1.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +258 -186
- package/assets/skill/skills/primitive-platform/SKILL.md +103 -29
- package/dist/bin/primitive.js +15 -89
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.js +80 -17
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/agent-sessions.d.ts +129 -0
- package/dist/src/commands/agent-sessions.js +532 -20
- package/dist/src/commands/agent-sessions.js.map +1 -1
- package/dist/src/commands/analytics.js +207 -155
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps-children.d.ts +1 -1
- package/dist/src/commands/apps-children.js +56 -145
- package/dist/src/commands/apps-children.js.map +1 -1
- package/dist/src/commands/apps-transitions.d.ts +39 -0
- package/dist/src/commands/apps-transitions.js +198 -0
- package/dist/src/commands/apps-transitions.js.map +1 -0
- package/dist/src/commands/apps.d.ts +17 -0
- package/dist/src/commands/apps.js +108 -3
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.js +2 -0
- package/dist/src/commands/auth-sessions.js.map +1 -1
- package/dist/src/commands/auth.js +138 -44
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +2 -0
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/collections.js +318 -256
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/comparisons.js +2 -0
- package/dist/src/commands/comparisons.js.map +1 -1
- package/dist/src/commands/config.d.ts +2 -2
- package/dist/src/commands/config.js +59 -33
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/connections.js +2 -0
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +5 -3
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/database-types.js +13 -313
- package/dist/src/commands/database-types.js.map +1 -1
- package/dist/src/commands/databases.js +6 -4
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/db3-types.d.ts +15 -0
- package/dist/src/commands/db3-types.js +159 -0
- package/dist/src/commands/db3-types.js.map +1 -0
- package/dist/src/commands/db3.d.ts +24 -0
- package/dist/src/commands/db3.js +1444 -0
- package/dist/src/commands/db3.js.map +1 -0
- package/dist/src/commands/documents.d.ts +110 -10
- package/dist/src/commands/documents.js +1012 -748
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +74 -0
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.js +8 -4
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/function-trigger-commands.d.ts +28 -0
- package/dist/src/commands/function-trigger-commands.js +341 -0
- package/dist/src/commands/function-trigger-commands.js.map +1 -0
- package/dist/src/commands/functions.js +376 -30
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/groups.js +168 -50
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +7 -5
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/hosting.d.ts +8 -0
- package/dist/src/commands/hosting.js +346 -0
- package/dist/src/commands/hosting.js.map +1 -0
- package/dist/src/commands/init.js +129 -38
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +82 -53
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.js +9 -6
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/locks.d.ts +5 -3
- package/dist/src/commands/locks.js +19 -61
- package/dist/src/commands/locks.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.d.ts +2 -2
- package/dist/src/commands/metadata-category-configs.js +4 -2
- package/dist/src/commands/metadata-category-configs.js.map +1 -1
- package/dist/src/commands/metadata.js +41 -0
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +75 -52
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rate-counters.d.ts +19 -0
- package/dist/src/commands/rate-counters.js +104 -0
- package/dist/src/commands/rate-counters.js.map +1 -0
- package/dist/src/commands/rule-sets.d.ts +1 -1
- package/dist/src/commands/rule-sets.js +2 -1
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/schemas.d.ts +15 -0
- package/dist/src/commands/schemas.js +122 -0
- package/dist/src/commands/schemas.js.map +1 -0
- package/dist/src/commands/scripts.d.ts +9 -17
- package/dist/src/commands/scripts.js +24 -479
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/secrets.js +47 -3
- package/dist/src/commands/secrets.js.map +1 -1
- package/dist/src/commands/sessions.js +2 -0
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/settings.d.ts +12 -9
- package/dist/src/commands/settings.js +31 -79
- package/dist/src/commands/settings.js.map +1 -1
- package/dist/src/commands/skill.js +2 -0
- package/dist/src/commands/skill.js.map +1 -1
- package/dist/src/commands/sync-schemas.d.ts +202 -0
- package/dist/src/commands/sync-schemas.js +629 -0
- package/dist/src/commands/sync-schemas.js.map +1 -0
- package/dist/src/commands/sync-user-properties.d.ts +118 -0
- package/dist/src/commands/sync-user-properties.js +276 -0
- package/dist/src/commands/sync-user-properties.js.map +1 -0
- package/dist/src/commands/sync.d.ts +519 -554
- package/dist/src/commands/sync.js +3010 -4909
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +5 -3
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/transitions.d.ts +54 -0
- package/dist/src/commands/transitions.js +418 -0
- package/dist/src/commands/transitions.js.map +1 -0
- package/dist/src/commands/usage.d.ts +18 -0
- package/dist/src/commands/usage.js +343 -0
- package/dist/src/commands/usage.js.map +1 -0
- package/dist/src/commands/user-properties.d.ts +14 -0
- package/dist/src/commands/user-properties.js +79 -0
- package/dist/src/commands/user-properties.js.map +1 -0
- package/dist/src/commands/users.js +911 -18
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +2 -0
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/waitlist.js +39 -4
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/workflows.d.ts +5 -83
- package/dist/src/commands/workflows.js +57 -2282
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/analytics-query.d.ts +58 -0
- package/dist/src/lib/analytics-query.js +134 -0
- package/dist/src/lib/analytics-query.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +1830 -429
- package/dist/src/lib/api-client.js +1025 -546
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +1 -1
- package/dist/src/lib/app-settings-descriptor.js +6 -0
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/auth-fixtures.d.ts +44 -0
- package/dist/src/lib/auth-fixtures.js +61 -0
- package/dist/src/lib/auth-fixtures.js.map +1 -0
- package/dist/src/lib/auth-flow.d.ts +34 -1
- package/dist/src/lib/auth-flow.js +429 -13
- package/dist/src/lib/auth-flow.js.map +1 -1
- package/dist/src/lib/block-layout.d.ts +12 -23
- package/dist/src/lib/block-layout.js +26 -92
- package/dist/src/lib/block-layout.js.map +1 -1
- package/dist/src/lib/block-selector.d.ts +8 -14
- package/dist/src/lib/block-selector.js +8 -19
- package/dist/src/lib/block-selector.js.map +1 -1
- package/dist/src/lib/child-apps-local.d.ts +3 -47
- package/dist/src/lib/child-apps-local.js +11 -73
- package/dist/src/lib/child-apps-local.js.map +1 -1
- package/dist/src/lib/cli-manifest.d.ts +9 -0
- package/dist/src/lib/cli-manifest.js +10 -1
- package/dist/src/lib/cli-manifest.js.map +1 -1
- package/dist/src/lib/cli-version.d.ts +14 -0
- package/dist/src/lib/cli-version.js +38 -0
- package/dist/src/lib/cli-version.js.map +1 -0
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +41 -0
- package/dist/src/lib/codegen-shared/prettierStable.js +146 -24
- package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -1
- package/dist/src/lib/collection-export.d.ts +76 -15
- package/dist/src/lib/collection-export.js +116 -23
- package/dist/src/lib/collection-export.js.map +1 -1
- package/dist/src/lib/collection-principal.d.ts +22 -0
- package/dist/src/lib/collection-principal.js +35 -0
- package/dist/src/lib/collection-principal.js.map +1 -0
- package/dist/src/lib/command-groups.d.ts +30 -0
- package/dist/src/lib/command-groups.js +109 -0
- package/dist/src/lib/command-groups.js.map +1 -0
- package/dist/src/lib/command-status.d.ts +147 -0
- package/dist/src/lib/command-status.js +266 -0
- package/dist/src/lib/command-status.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +9 -22
- package/dist/src/lib/config-object-descriptor.js +107 -276
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +3 -7
- package/dist/src/lib/config-surface.js +9 -13
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/config-toml.d.ts +11 -2
- package/dist/src/lib/config-toml.js +25 -2
- package/dist/src/lib/config-toml.js.map +1 -1
- package/dist/src/lib/credentials-home.d.ts +7 -0
- package/dist/src/lib/credentials-home.js +45 -10
- package/dist/src/lib/credentials-home.js.map +1 -1
- package/dist/src/lib/credentials-lock.d.ts +14 -6
- package/dist/src/lib/credentials-lock.js +90 -10
- package/dist/src/lib/credentials-lock.js.map +1 -1
- package/dist/src/lib/credentials-store.d.ts +123 -70
- package/dist/src/lib/credentials-store.js +358 -113
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/custodian.d.ts +8 -0
- package/dist/src/lib/custodian.js +18 -0
- package/dist/src/lib/custodian.js.map +1 -0
- package/dist/src/lib/data-input.d.ts +1 -1
- package/dist/src/lib/data-input.js +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.js +3 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +38 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js +29 -7
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/db-type-records.d.ts +106 -0
- package/dist/src/lib/db-type-records.js +224 -0
- package/dist/src/lib/db-type-records.js.map +1 -0
- package/dist/src/lib/db3-export.d.ts +287 -0
- package/dist/src/lib/db3-export.js +647 -0
- package/dist/src/lib/db3-export.js.map +1 -0
- package/dist/src/lib/db3-index-output.d.ts +116 -0
- package/dist/src/lib/db3-index-output.js +223 -0
- package/dist/src/lib/db3-index-output.js.map +1 -0
- package/dist/src/lib/db3-type-models.d.ts +134 -0
- package/dist/src/lib/db3-type-models.js +452 -0
- package/dist/src/lib/db3-type-models.js.map +1 -0
- package/dist/src/lib/deprecation.d.ts +2 -2
- package/dist/src/lib/deprecation.js +2 -2
- package/dist/src/lib/document-ingest-artifact.d.ts +13 -0
- package/dist/src/lib/document-ingest-artifact.js +36 -6
- package/dist/src/lib/document-ingest-artifact.js.map +1 -1
- package/dist/src/lib/document-ingest-format2.d.ts +36 -0
- package/dist/src/lib/document-ingest-format2.js +78 -0
- package/dist/src/lib/document-ingest-format2.js.map +1 -0
- package/dist/src/lib/document-ingest-input.d.ts +9 -0
- package/dist/src/lib/document-ingest-input.js +28 -1
- package/dist/src/lib/document-ingest-input.js.map +1 -1
- package/dist/src/lib/document-ingest.d.ts +11 -1
- package/dist/src/lib/document-ingest.js +16 -0
- package/dist/src/lib/document-ingest.js.map +1 -1
- package/dist/src/lib/document-schema-rows.d.ts +42 -0
- package/dist/src/lib/document-schema-rows.js +53 -0
- package/dist/src/lib/document-schema-rows.js.map +1 -0
- package/dist/src/lib/experimental-apis.d.ts +36 -0
- package/dist/src/lib/experimental-apis.js +46 -0
- package/dist/src/lib/experimental-apis.js.map +1 -0
- package/dist/src/lib/file-attachment.d.ts +24 -0
- package/dist/src/lib/file-attachment.js +31 -0
- package/dist/src/lib/file-attachment.js.map +1 -0
- package/dist/src/lib/function-authorize-check.d.ts +142 -0
- package/dist/src/lib/function-authorize-check.js +311 -0
- package/dist/src/lib/function-authorize-check.js.map +1 -0
- package/dist/src/lib/function-authorize-view.d.ts +27 -0
- package/dist/src/lib/function-authorize-view.js +88 -0
- package/dist/src/lib/function-authorize-view.js.map +1 -0
- package/dist/src/lib/function-bundle.d.ts +27 -5
- package/dist/src/lib/function-bundle.js +142 -7
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +90 -12
- package/dist/src/lib/function-collect.js +482 -12
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +65 -11
- package/dist/src/lib/function-db-types.js +297 -157
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-document-types.d.ts +19 -7
- package/dist/src/lib/function-document-types.js +24 -12
- package/dist/src/lib/function-document-types.js.map +1 -1
- package/dist/src/lib/function-lint.d.ts +57 -0
- package/dist/src/lib/function-lint.js +234 -0
- package/dist/src/lib/function-lint.js.map +1 -0
- package/dist/src/lib/function-log-row.js +21 -2
- package/dist/src/lib/function-log-row.js.map +1 -1
- package/dist/src/lib/function-run.d.ts +13 -21
- package/dist/src/lib/function-run.js +14 -27
- package/dist/src/lib/function-run.js.map +1 -1
- package/dist/src/lib/function-schema-codegen.d.ts +86 -22
- package/dist/src/lib/function-schema-codegen.js +194 -88
- package/dist/src/lib/function-schema-codegen.js.map +1 -1
- package/dist/src/lib/function-schema-refs.d.ts +98 -0
- package/dist/src/lib/function-schema-refs.js +177 -0
- package/dist/src/lib/function-schema-refs.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +109 -6
- package/dist/src/lib/function-sync.js +179 -26
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-trigger-listing.d.ts +11 -6
- package/dist/src/lib/function-trigger-listing.js +32 -11
- package/dist/src/lib/function-trigger-listing.js.map +1 -1
- package/dist/src/lib/function-triggers.d.ts +15 -3
- package/dist/src/lib/function-triggers.js +72 -10
- package/dist/src/lib/function-triggers.js.map +1 -1
- package/dist/src/lib/function-typecheck.d.ts +52 -0
- package/dist/src/lib/function-typecheck.js +174 -54
- package/dist/src/lib/function-typecheck.js.map +1 -1
- package/dist/src/lib/function-versions.d.ts +2 -0
- package/dist/src/lib/function-versions.js +1 -0
- package/dist/src/lib/function-versions.js.map +1 -1
- package/dist/src/lib/generated-build-flags.d.ts +13 -0
- package/dist/src/lib/generated-build-flags.js +14 -0
- package/dist/src/lib/generated-build-flags.js.map +1 -0
- package/dist/src/lib/generated-command-status.d.ts +6 -0
- package/dist/src/lib/generated-command-status.js +469 -0
- package/dist/src/lib/generated-command-status.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +586 -152
- package/dist/src/lib/generated-config-surfaces.js +1919 -1883
- 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/generated-workflow-model-fields.d.ts +20 -0
- package/dist/src/lib/generated-workflow-model-fields.js +53 -0
- package/dist/src/lib/generated-workflow-model-fields.js.map +1 -0
- package/dist/src/lib/hosting-build.d.ts +97 -0
- package/dist/src/lib/hosting-build.js +204 -0
- package/dist/src/lib/hosting-build.js.map +1 -0
- package/dist/src/lib/hosting-client.d.ts +167 -0
- package/dist/src/lib/hosting-client.js +340 -0
- package/dist/src/lib/hosting-client.js.map +1 -0
- package/dist/src/lib/hosting-environments.d.ts +32 -0
- package/dist/src/lib/hosting-environments.js +74 -0
- package/dist/src/lib/hosting-environments.js.map +1 -0
- package/dist/src/lib/hosting-errors.d.ts +30 -0
- package/dist/src/lib/hosting-errors.js +43 -0
- package/dist/src/lib/hosting-errors.js.map +1 -0
- package/dist/src/lib/hosting-token.d.ts +46 -0
- package/dist/src/lib/hosting-token.js +60 -0
- package/dist/src/lib/hosting-token.js.map +1 -0
- package/dist/src/lib/hosting-wait.d.ts +42 -0
- package/dist/src/lib/hosting-wait.js +84 -0
- package/dist/src/lib/hosting-wait.js.map +1 -0
- package/dist/src/lib/hosting-wfp-upload.d.ts +86 -0
- package/dist/src/lib/hosting-wfp-upload.js +149 -0
- package/dist/src/lib/hosting-wfp-upload.js.map +1 -0
- package/dist/src/lib/init-assets.d.ts +2 -6
- package/dist/src/lib/init-assets.js +11 -27
- package/dist/src/lib/init-assets.js.map +1 -1
- package/dist/src/lib/init-ios-links.d.ts +11 -7
- package/dist/src/lib/init-ios-links.js +28 -22
- package/dist/src/lib/init-ios-links.js.map +1 -1
- package/dist/src/lib/init-login-note.d.ts +13 -0
- package/dist/src/lib/init-login-note.js +22 -0
- package/dist/src/lib/init-login-note.js.map +1 -0
- package/dist/src/lib/init-schema.d.ts +15 -0
- package/dist/src/lib/init-schema.js +54 -0
- package/dist/src/lib/init-schema.js.map +1 -1
- package/dist/src/lib/integration-test-request.d.ts +54 -0
- package/dist/src/lib/integration-test-request.js +207 -0
- package/dist/src/lib/integration-test-request.js.map +1 -0
- package/dist/src/lib/invoker-shared-enums.d.ts +35 -0
- package/dist/src/lib/invoker-shared-enums.js +98 -0
- package/dist/src/lib/invoker-shared-enums.js.map +1 -0
- package/dist/src/lib/json-value.d.ts +6 -0
- package/dist/src/lib/json-value.js +13 -0
- package/dist/src/lib/json-value.js.map +1 -0
- package/dist/src/lib/load-routes.d.ts +33 -0
- package/dist/src/lib/load-routes.js +35 -0
- package/dist/src/lib/load-routes.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +23 -4
- package/dist/src/lib/log-inspection.js +14 -5
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/login-exchange-check.d.ts +18 -0
- package/dist/src/lib/login-exchange-check.js +27 -0
- package/dist/src/lib/login-exchange-check.js.map +1 -0
- package/dist/src/lib/login-scope-lines.d.ts +17 -7
- package/dist/src/lib/login-scope-lines.js +33 -10
- package/dist/src/lib/login-scope-lines.js.map +1 -1
- package/dist/src/lib/metadata-report.d.ts +85 -0
- package/dist/src/lib/metadata-report.js +81 -0
- package/dist/src/lib/metadata-report.js.map +1 -0
- package/dist/src/lib/object-status-filter.d.ts +9 -1
- package/dist/src/lib/object-status-filter.js +9 -1
- package/dist/src/lib/object-status-filter.js.map +1 -1
- package/dist/src/lib/output.d.ts +1 -1
- package/dist/src/lib/output.js +3 -1
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/pin-refusal-hint.d.ts +12 -0
- package/dist/src/lib/pin-refusal-hint.js +35 -0
- package/dist/src/lib/pin-refusal-hint.js.map +1 -0
- package/dist/src/lib/platform-owned.js +5 -0
- package/dist/src/lib/platform-owned.js.map +1 -1
- package/dist/src/lib/primitive-declaration-names.d.ts +21 -0
- package/dist/src/lib/primitive-declaration-names.js +22 -0
- package/dist/src/lib/primitive-declaration-names.js.map +1 -0
- package/dist/src/lib/primitive-declaration.d.ts +174 -0
- package/dist/src/lib/primitive-declaration.js +792 -0
- package/dist/src/lib/primitive-declaration.js.map +1 -0
- package/dist/src/lib/primitive-env-plugin.d.ts +99 -0
- package/dist/src/lib/primitive-env-plugin.js +408 -0
- package/dist/src/lib/primitive-env-plugin.js.map +1 -0
- package/dist/src/lib/project-login-apps.d.ts +8 -0
- package/dist/src/lib/project-login-apps.js +27 -0
- package/dist/src/lib/project-login-apps.js.map +1 -0
- package/dist/src/lib/prompt-schema-codegen.d.ts +46 -15
- package/dist/src/lib/prompt-schema-codegen.js +142 -108
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
- package/dist/src/lib/prompt-schema-document.d.ts +35 -0
- package/dist/src/lib/prompt-schema-document.js +92 -0
- package/dist/src/lib/prompt-schema-document.js.map +1 -0
- package/dist/src/lib/prompt-schema-refs.d.ts +173 -0
- package/dist/src/lib/prompt-schema-refs.js +478 -0
- package/dist/src/lib/prompt-schema-refs.js.map +1 -0
- package/dist/src/lib/records-verbs.d.ts +79 -0
- package/dist/src/lib/records-verbs.js +45 -0
- package/dist/src/lib/records-verbs.js.map +1 -0
- package/dist/src/lib/register-commands.d.ts +36 -0
- package/dist/src/lib/register-commands.js +37 -0
- package/dist/src/lib/register-commands.js.map +1 -0
- package/dist/src/lib/retired-imports.d.ts +53 -0
- package/dist/src/lib/retired-imports.js +120 -0
- package/dist/src/lib/retired-imports.js.map +1 -0
- package/dist/src/lib/run-status.d.ts +1 -1
- package/dist/src/lib/run-status.generated.d.ts +2 -2
- package/dist/src/lib/run-status.generated.js +3 -1
- package/dist/src/lib/run-status.generated.js.map +1 -1
- package/dist/src/lib/run-status.js +1 -1
- package/dist/src/lib/schema-codegen/compiledSpace.d.ts +62 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js +103 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.d.ts +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js +227 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.d.ts +85 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.d.ts +218 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js +397 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-table.d.ts +80 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js +542 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.d.ts +195 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js +503 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +258 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +422 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.d.ts +129 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js +475 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.d.ts +115 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js +274 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.d.ts +366 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js +1789 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.d.ts +27 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js +126 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js.map +1 -0
- package/dist/src/lib/schema-codegen/namedRefs.d.ts +56 -0
- package/dist/src/lib/schema-codegen/namedRefs.js +143 -0
- package/dist/src/lib/schema-codegen/namedRefs.js.map +1 -0
- package/dist/src/lib/schema-codegen/naming.d.ts +35 -0
- package/dist/src/lib/schema-codegen/naming.js +83 -0
- package/dist/src/lib/schema-codegen/naming.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaChanges.d.ts +74 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js +277 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaDocs.d.ts +69 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js +219 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaIR.d.ts +158 -0
- package/dist/src/lib/schema-codegen/schemaIR.js +279 -0
- package/dist/src/lib/schema-codegen/schemaIR.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaToTs.d.ts +109 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js +269 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/schema-codegen/valuesLists.d.ts +48 -0
- package/dist/src/lib/schema-codegen/valuesLists.js +144 -0
- package/dist/src/lib/schema-codegen/valuesLists.js.map +1 -0
- package/dist/src/lib/schema-family-index.d.ts +228 -0
- package/dist/src/lib/schema-family-index.js +813 -0
- package/dist/src/lib/schema-family-index.js.map +1 -0
- package/dist/src/lib/schema-pins.d.ts +82 -0
- package/dist/src/lib/schema-pins.js +198 -0
- package/dist/src/lib/schema-pins.js.map +1 -0
- package/dist/src/lib/schema-preview.d.ts +244 -0
- package/dist/src/lib/schema-preview.js +498 -0
- package/dist/src/lib/schema-preview.js.map +1 -0
- package/dist/src/lib/scope-request.d.ts +23 -11
- package/dist/src/lib/scope-request.js +69 -31
- package/dist/src/lib/scope-request.js.map +1 -1
- package/dist/src/lib/session-scope.d.ts +26 -0
- package/dist/src/lib/session-scope.js +58 -0
- package/dist/src/lib/session-scope.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +2 -2
- package/dist/src/lib/skill-installer.js +2 -21
- package/dist/src/lib/skill-installer.js.map +1 -1
- package/dist/src/lib/step-run-table.d.ts +1 -2
- package/dist/src/lib/step-run-table.js +1 -2
- package/dist/src/lib/step-run-table.js.map +1 -1
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +8 -3
- package/dist/src/lib/swift-codegen/agentGenerator.js +76 -22
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/banners.d.ts +12 -0
- package/dist/src/lib/swift-codegen/banners.js +12 -0
- package/dist/src/lib/swift-codegen/banners.js.map +1 -1
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +36 -1
- package/dist/src/lib/swift-codegen/functionGenerator.js +169 -51
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +33 -9
- package/dist/src/lib/swift-codegen/schemaToSwift.js +215 -179
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
- package/dist/src/lib/swift-codegen/sharedGenerator.d.ts +45 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js +165 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/swiftKeys.d.ts +19 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js +31 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js.map +1 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.d.ts +30 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js +69 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +117 -31
- package/dist/src/lib/sync-resource-types.js +197 -189
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +7 -0
- package/dist/src/lib/sync-selectors.js +22 -2
- package/dist/src/lib/sync-selectors.js.map +1 -1
- package/dist/src/lib/template.d.ts +39 -3
- package/dist/src/lib/template.js +103 -14
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/lib/test-case-file-names.d.ts +3 -5
- package/dist/src/lib/test-case-file-names.js +3 -5
- package/dist/src/lib/test-case-file-names.js.map +1 -1
- package/dist/src/lib/test-runs.d.ts +45 -0
- package/dist/src/lib/test-runs.js +150 -0
- package/dist/src/lib/test-runs.js.map +1 -0
- package/dist/src/lib/test-users.d.ts +25 -0
- package/dist/src/lib/test-users.js +36 -0
- package/dist/src/lib/test-users.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +4 -2
- package/dist/src/lib/toml-database-config.js +11 -6
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/toml-scalar-edit.js +6 -4
- package/dist/src/lib/toml-scalar-edit.js.map +1 -1
- package/dist/src/lib/transition-warnings.d.ts +21 -0
- package/dist/src/lib/transition-warnings.js +49 -0
- package/dist/src/lib/transition-warnings.js.map +1 -0
- package/dist/src/lib/user-index.d.ts +80 -0
- package/dist/src/lib/user-index.js +166 -0
- package/dist/src/lib/user-index.js.map +1 -0
- package/dist/src/lib/user-properties/generated-properties-schema.d.ts +159 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js +471 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js.map +1 -0
- package/dist/src/lib/user-properties/user-properties-codegen.d.ts +55 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js +129 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js.map +1 -0
- package/dist/src/lib/user-walk.d.ts +31 -0
- package/dist/src/lib/user-walk.js +102 -0
- package/dist/src/lib/user-walk.js.map +1 -0
- package/dist/src/lib/webhook-capture.d.ts +43 -0
- package/dist/src/lib/webhook-capture.js +91 -0
- package/dist/src/lib/webhook-capture.js.map +1 -0
- package/dist/src/lib/webhook-deliver.d.ts +18 -20
- package/dist/src/lib/webhook-deliver.js +34 -89
- package/dist/src/lib/webhook-deliver.js.map +1 -1
- package/dist/src/lib/webhook-test-run.d.ts +32 -0
- package/dist/src/lib/webhook-test-run.js +108 -0
- package/dist/src/lib/webhook-test-run.js.map +1 -0
- package/dist/src/lib/worker-perf-format.d.ts +22 -0
- package/dist/src/lib/worker-perf-format.js +27 -0
- package/dist/src/lib/worker-perf-format.js.map +1 -0
- package/dist/src/lib/workflow-field-descriptor.d.ts +91 -0
- package/dist/src/lib/workflow-field-descriptor.js +153 -0
- package/dist/src/lib/workflow-field-descriptor.js.map +1 -0
- package/dist/src/types/index.d.ts +20 -65
- package/dist/src/validators.d.ts +7 -55
- package/dist/src/validators.js +7 -53
- package/dist/src/validators.js.map +1 -1
- package/dist/src/vite.d.ts +17 -0
- package/dist/src/vite.js +18 -0
- package/dist/src/vite.js.map +1 -0
- package/package.json +20 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosting-token.js","sourceRoot":"","sources":["../../../src/lib/hosting-token.ts"],"names":[],"mappings":"AAAA;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OAAO,CAAC;YACjB,CAAC,CAAC;iBACD,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACtB,CAAC,CAAC,CAAC;QACP,CAAC;QACD,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED,8EAA8E;IAC9E,SAAS;QACP,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** The header every answer produced from an active deployment carries. */
|
|
2
|
+
export declare const DEPLOY_HEADER = "x-primitive-hosting-deploy";
|
|
3
|
+
/** How long a command waits for the origin to serve a deployment. */
|
|
4
|
+
export declare const SERVE_TIMEOUT_MS = 120000;
|
|
5
|
+
/** Time between two probes of the origin. */
|
|
6
|
+
export declare const SERVE_INTERVAL_MS = 1000;
|
|
7
|
+
/** One probe's answer: its status and the deployment id it carried, if any. */
|
|
8
|
+
export interface ProbeAnswer {
|
|
9
|
+
status: number;
|
|
10
|
+
deployId: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** What {@link waitUntilServed} needs. */
|
|
13
|
+
export interface WaitOptions {
|
|
14
|
+
/** The origin being probed, for the timeout's message. */
|
|
15
|
+
origin: string;
|
|
16
|
+
/** The deployment the origin must serve. */
|
|
17
|
+
deployId: string;
|
|
18
|
+
/**
|
|
19
|
+
* One `HEAD <origin>/`; a thrown error counts as no answer. The signal is
|
|
20
|
+
* aborted when the wait's deadline passes while the probe is in flight.
|
|
21
|
+
*/
|
|
22
|
+
probe: (signal: AbortSignal) => Promise<ProbeAnswer>;
|
|
23
|
+
/** How long to wait in all; 120 s by default. */
|
|
24
|
+
timeoutMs?: number;
|
|
25
|
+
/** Time between probes; 1 s by default. */
|
|
26
|
+
intervalMs?: number;
|
|
27
|
+
/** The clock; `Date.now` by default. */
|
|
28
|
+
now?: () => number;
|
|
29
|
+
/** Waits `ms`; a timer by default. */
|
|
30
|
+
sleep?: (ms: number) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Polls until the origin serves `deployId`. Each probe is bounded by the
|
|
34
|
+
* time left before `timeoutMs`, and an answer that arrives after the
|
|
35
|
+
* deadline is not accepted, so the wait never succeeds or runs past it.
|
|
36
|
+
*
|
|
37
|
+
* @param options The origin, the deployment, the probe and the clock.
|
|
38
|
+
* @returns The answer that showed the deployment served.
|
|
39
|
+
* @throws HostingError `activation_timeout` once `timeoutMs` have passed,
|
|
40
|
+
* carrying the last answer in `details`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function waitUntilServed(options: WaitOptions): Promise<ProbeAnswer>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How `primitive hosting deploy` and `activate` know the origin serves a
|
|
3
|
+
* deployment: they poll `HEAD <origin>/` until an answer carries the
|
|
4
|
+
* deployment's id in `x-primitive-hosting-deploy` with a status below 500.
|
|
5
|
+
* A 5xx carrying the id (the dispatcher's storage-unavailable 503) is not
|
|
6
|
+
* served.
|
|
7
|
+
*/
|
|
8
|
+
import { HostingError } from "./hosting-errors.js";
|
|
9
|
+
/** The header every answer produced from an active deployment carries. */
|
|
10
|
+
export const DEPLOY_HEADER = "x-primitive-hosting-deploy";
|
|
11
|
+
/** How long a command waits for the origin to serve a deployment. */
|
|
12
|
+
export const SERVE_TIMEOUT_MS = 120_000;
|
|
13
|
+
/** Time between two probes of the origin. */
|
|
14
|
+
export const SERVE_INTERVAL_MS = 1_000;
|
|
15
|
+
function seconds(ms) {
|
|
16
|
+
return `${Math.round(ms / 100) / 10} s`;
|
|
17
|
+
}
|
|
18
|
+
/** A probe cut off by the wait's deadline: not an answer, so the last real answer stands. */
|
|
19
|
+
class DeadlinePassed extends Error {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Runs one probe, bounded by what is left of the wait: when `remainingMs`
|
|
23
|
+
* pass first, the probe's signal is aborted and the probe counts as no answer.
|
|
24
|
+
*/
|
|
25
|
+
async function boundedProbe(probe, remainingMs) {
|
|
26
|
+
const controller = new AbortController();
|
|
27
|
+
let timer;
|
|
28
|
+
const expired = new Promise((_, reject) => {
|
|
29
|
+
timer = setTimeout(() => {
|
|
30
|
+
controller.abort();
|
|
31
|
+
reject(new DeadlinePassed("no answer before the wait's deadline"));
|
|
32
|
+
}, Math.max(0, remainingMs));
|
|
33
|
+
});
|
|
34
|
+
const probing = probe(controller.signal);
|
|
35
|
+
// A probe that settles after the deadline won must not surface as an unhandled rejection.
|
|
36
|
+
probing.catch(() => undefined);
|
|
37
|
+
try {
|
|
38
|
+
return await Promise.race([probing, expired]);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
clearTimeout(timer);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Polls until the origin serves `deployId`. Each probe is bounded by the
|
|
46
|
+
* time left before `timeoutMs`, and an answer that arrives after the
|
|
47
|
+
* deadline is not accepted, so the wait never succeeds or runs past it.
|
|
48
|
+
*
|
|
49
|
+
* @param options The origin, the deployment, the probe and the clock.
|
|
50
|
+
* @returns The answer that showed the deployment served.
|
|
51
|
+
* @throws HostingError `activation_timeout` once `timeoutMs` have passed,
|
|
52
|
+
* carrying the last answer in `details`.
|
|
53
|
+
*/
|
|
54
|
+
export async function waitUntilServed(options) {
|
|
55
|
+
const { origin, deployId, probe, timeoutMs = SERVE_TIMEOUT_MS, intervalMs = SERVE_INTERVAL_MS, now = Date.now, sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)), } = options;
|
|
56
|
+
const started = now();
|
|
57
|
+
let last = null;
|
|
58
|
+
let lastError = null;
|
|
59
|
+
for (;;) {
|
|
60
|
+
try {
|
|
61
|
+
const answer = await boundedProbe(probe, timeoutMs - (now() - started));
|
|
62
|
+
last = answer;
|
|
63
|
+
lastError = null;
|
|
64
|
+
const servedInTime = now() - started <= timeoutMs;
|
|
65
|
+
if (servedInTime && answer.deployId === deployId && answer.status < 500)
|
|
66
|
+
return answer;
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
if (!(err instanceof DeadlinePassed && (last || lastError))) {
|
|
70
|
+
last = null;
|
|
71
|
+
lastError = err instanceof Error ? err.message : String(err);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const elapsed = now() - started;
|
|
75
|
+
if (elapsed >= timeoutMs)
|
|
76
|
+
break;
|
|
77
|
+
await sleep(Math.min(intervalMs, timeoutMs - elapsed));
|
|
78
|
+
}
|
|
79
|
+
const lastAnswer = last
|
|
80
|
+
? `${last.status} ${last.deployId ? `from deployment ${last.deployId}` : "with no deployment id"}`
|
|
81
|
+
: `no answer (${lastError ?? "unknown error"})`;
|
|
82
|
+
throw new HostingError("activation_timeout", `Deployment ${deployId} is active in the registry, but ${origin} did not serve it within ${seconds(timeoutMs)}; it last answered ${lastAnswer}. Check it with 'primitive hosting get'.`, undefined, { deployId, origin, lastStatus: last?.status ?? null, lastDeployId: last?.deployId ?? null });
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=hosting-wait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosting-wait.js","sourceRoot":"","sources":["../../../src/lib/hosting-wait.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAE1D,qEAAqE;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAExC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AA6BvC,SAAS,OAAO,CAAC,EAAU;IACzB,OAAO,GAAG,IAAI,CAAC,KAA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C,CAAC,uBAAuB,EAAE;QAClG,CAAC,CAAC,cAAc,SAAS,IAAI,eAAe,GAAG,CAAC;IAClD,MAAM,IAAI,YAAY,CACpB,oBAAoB,EACpB,cAAc,QAAQ,mCAAmC,MAAM,4BAA4B,OAAO,CAAC,SAAS,CAAC,sBAAsB,UAAU,0CAA0C,EACvL,SAAS,EACT,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,IAAI,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,IAAI,IAAI,EAAE,CAC7F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { BuildFile } from "./hosting-build.js";
|
|
2
|
+
/** A file the hosting service uploads beside the build's (its version marker). */
|
|
3
|
+
export interface PlatformFile {
|
|
4
|
+
/** The file's 32-hex hash, as the buckets name it. */
|
|
5
|
+
hash: string;
|
|
6
|
+
contentType: string;
|
|
7
|
+
/** The file's bytes, base64. */
|
|
8
|
+
base64: string;
|
|
9
|
+
}
|
|
10
|
+
/** A create's `upload` answer on `wfp`. */
|
|
11
|
+
export interface UploadSession {
|
|
12
|
+
url: string;
|
|
13
|
+
token: string;
|
|
14
|
+
/** Groups of 32-hex hashes, each uploaded in one request. */
|
|
15
|
+
buckets: string[][];
|
|
16
|
+
platformFiles: PlatformFile[];
|
|
17
|
+
}
|
|
18
|
+
/** Buckets uploaded at once. */
|
|
19
|
+
export declare const BUCKET_CONCURRENCY = 3;
|
|
20
|
+
/** Retries of one bucket after a network failure or a 5xx. */
|
|
21
|
+
export declare const BUCKET_RETRIES = 3;
|
|
22
|
+
/**
|
|
23
|
+
* Refuses an upload URL that is not Cloudflare's API, before any byte or the
|
|
24
|
+
* session token is sent.
|
|
25
|
+
*
|
|
26
|
+
* @param url The create answer's `upload.url`.
|
|
27
|
+
* @throws HostingError `upload_target_invalid`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function checkUploadTarget(url: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Whether a failed bucket upload is tried again: after a network failure or
|
|
32
|
+
* a 5xx, never after a 4xx.
|
|
33
|
+
*
|
|
34
|
+
* @param failure The answer's status, or that there was none.
|
|
35
|
+
* @returns True to retry.
|
|
36
|
+
*/
|
|
37
|
+
export declare function shouldRetryUpload(failure: {
|
|
38
|
+
status: number;
|
|
39
|
+
} | {
|
|
40
|
+
network: true;
|
|
41
|
+
}): boolean;
|
|
42
|
+
/** One field of a bucket: a build file read from disk, or a platform file's bytes. */
|
|
43
|
+
export type BucketPart = {
|
|
44
|
+
name: string;
|
|
45
|
+
contentType: string;
|
|
46
|
+
file: BuildFile;
|
|
47
|
+
} | {
|
|
48
|
+
name: string;
|
|
49
|
+
contentType: string;
|
|
50
|
+
base64: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The fields of one bucket, one per hash: the build file holding it, else
|
|
54
|
+
* the platform file the session listed. The same bytes at two paths are one
|
|
55
|
+
* field.
|
|
56
|
+
*
|
|
57
|
+
* @param bucket The bucket's 32-hex hashes.
|
|
58
|
+
* @param files The build's files.
|
|
59
|
+
* @param platformFiles The session's platform files.
|
|
60
|
+
* @returns The bucket's fields, in the bucket's order.
|
|
61
|
+
* @throws HostingError `hosting_error` when a hash matches neither.
|
|
62
|
+
*/
|
|
63
|
+
export declare function bucketParts(bucket: readonly string[], files: readonly BuildFile[], platformFiles: readonly PlatformFile[]): BucketPart[];
|
|
64
|
+
/**
|
|
65
|
+
* One bucket as Cloudflare's upload takes it: a field per hash, named by
|
|
66
|
+
* the hash, holding the file's base64 with its content type.
|
|
67
|
+
*
|
|
68
|
+
* @param parts The bucket's fields ({@link bucketParts}).
|
|
69
|
+
* @returns The multipart form.
|
|
70
|
+
*/
|
|
71
|
+
export declare function bucketForm(parts: readonly BucketPart[]): Promise<FormData>;
|
|
72
|
+
/**
|
|
73
|
+
* Uploads every bucket of the session, {@link BUCKET_CONCURRENCY} at a time.
|
|
74
|
+
* Every bucket is checked against the build before the first is sent.
|
|
75
|
+
*
|
|
76
|
+
* @param session The create's `upload` answer; its URL is not checked here ({@link checkUploadTarget}).
|
|
77
|
+
* @param files The build's files.
|
|
78
|
+
* @param options `sleep` replaces the pause between retries.
|
|
79
|
+
* @returns How many files were uploaded.
|
|
80
|
+
* @throws HostingError `upload_session_expired`, `upload_refused`, `upload_failed` or `hosting_error`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function uploadBuckets(session: UploadSession, files: readonly BuildFile[], options?: {
|
|
83
|
+
sleep?: (ms: number) => Promise<void>;
|
|
84
|
+
}): Promise<{
|
|
85
|
+
uploaded: number;
|
|
86
|
+
}>;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How `primitive hosting deploy` uploads a build on the `wfp` backend: the
|
|
3
|
+
* create answers an `upload` session (Cloudflare's upload URL, a session
|
|
4
|
+
* token valid one hour, and the buckets of files the app's user Worker
|
|
5
|
+
* lacks), and the CLI sends each bucket straight to Cloudflare as base64
|
|
6
|
+
* multipart, three buckets at a time. The session token is sent only to
|
|
7
|
+
* `https://api.cloudflare.com` and never printed.
|
|
8
|
+
*/
|
|
9
|
+
import { readFile } from "fs/promises";
|
|
10
|
+
import { hostingFetch } from "./hosting-client.js";
|
|
11
|
+
import { HostingError } from "./hosting-errors.js";
|
|
12
|
+
/** Buckets uploaded at once. */
|
|
13
|
+
export const BUCKET_CONCURRENCY = 3;
|
|
14
|
+
/** Retries of one bucket after a network failure or a 5xx. */
|
|
15
|
+
export const BUCKET_RETRIES = 3;
|
|
16
|
+
/** How long one bucket upload may take. */
|
|
17
|
+
const BUCKET_TIMEOUT_MS = 120_000;
|
|
18
|
+
/**
|
|
19
|
+
* Refuses an upload URL that is not Cloudflare's API, before any byte or the
|
|
20
|
+
* session token is sent.
|
|
21
|
+
*
|
|
22
|
+
* @param url The create answer's `upload.url`.
|
|
23
|
+
* @throws HostingError `upload_target_invalid`.
|
|
24
|
+
*/
|
|
25
|
+
export function checkUploadTarget(url) {
|
|
26
|
+
let target;
|
|
27
|
+
try {
|
|
28
|
+
target = new URL(url);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
target = null;
|
|
32
|
+
}
|
|
33
|
+
const ok = target !== null && target.protocol === "https:" && target.host === "api.cloudflare.com" && !target.username && !target.password;
|
|
34
|
+
if (!ok) {
|
|
35
|
+
throw new HostingError("upload_target_invalid", "The hosting service named an upload target that is not https://api.cloudflare.com, so nothing was uploaded. Check that PRIMITIVE_HOSTING_URL points at a Primitive hosting service.");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether a failed bucket upload is tried again: after a network failure or
|
|
40
|
+
* a 5xx, never after a 4xx.
|
|
41
|
+
*
|
|
42
|
+
* @param failure The answer's status, or that there was none.
|
|
43
|
+
* @returns True to retry.
|
|
44
|
+
*/
|
|
45
|
+
export function shouldRetryUpload(failure) {
|
|
46
|
+
return "network" in failure || failure.status >= 500;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The fields of one bucket, one per hash: the build file holding it, else
|
|
50
|
+
* the platform file the session listed. The same bytes at two paths are one
|
|
51
|
+
* field.
|
|
52
|
+
*
|
|
53
|
+
* @param bucket The bucket's 32-hex hashes.
|
|
54
|
+
* @param files The build's files.
|
|
55
|
+
* @param platformFiles The session's platform files.
|
|
56
|
+
* @returns The bucket's fields, in the bucket's order.
|
|
57
|
+
* @throws HostingError `hosting_error` when a hash matches neither.
|
|
58
|
+
*/
|
|
59
|
+
export function bucketParts(bucket, files, platformFiles) {
|
|
60
|
+
const byHash = new Map();
|
|
61
|
+
for (const file of files)
|
|
62
|
+
if (!byHash.has(file.sha256.slice(0, 32)))
|
|
63
|
+
byHash.set(file.sha256.slice(0, 32), file);
|
|
64
|
+
return bucket.map((hash) => {
|
|
65
|
+
const file = byHash.get(hash);
|
|
66
|
+
if (file)
|
|
67
|
+
return { name: hash, contentType: file.contentType, file };
|
|
68
|
+
const platform = platformFiles.find((p) => p.hash === hash);
|
|
69
|
+
if (platform)
|
|
70
|
+
return { name: hash, contentType: platform.contentType, base64: platform.base64 };
|
|
71
|
+
throw new HostingError("hosting_error", `The hosting service asked for a file the build does not hold (${hash}).`);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* One bucket as Cloudflare's upload takes it: a field per hash, named by
|
|
76
|
+
* the hash, holding the file's base64 with its content type.
|
|
77
|
+
*
|
|
78
|
+
* @param parts The bucket's fields ({@link bucketParts}).
|
|
79
|
+
* @returns The multipart form.
|
|
80
|
+
*/
|
|
81
|
+
export async function bucketForm(parts) {
|
|
82
|
+
const form = new FormData();
|
|
83
|
+
for (const part of parts) {
|
|
84
|
+
const base64 = "file" in part ? (await readFile(part.file.absolutePath)).toString("base64") : part.base64;
|
|
85
|
+
form.append(part.name, new Blob([base64], { type: part.contentType }), part.name);
|
|
86
|
+
}
|
|
87
|
+
return form;
|
|
88
|
+
}
|
|
89
|
+
/** Waits `ms`. */
|
|
90
|
+
const pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
91
|
+
/** Uploads one bucket, retried as {@link shouldRetryUpload} says. */
|
|
92
|
+
async function uploadBucket(session, parts, sleep) {
|
|
93
|
+
const form = await bucketForm(parts);
|
|
94
|
+
const encoded = new Response(form);
|
|
95
|
+
const contentType = encoded.headers.get("content-type");
|
|
96
|
+
const body = Buffer.from(await encoded.arrayBuffer());
|
|
97
|
+
let last = "";
|
|
98
|
+
let attempts = 0;
|
|
99
|
+
for (let attempt = 0; attempt <= BUCKET_RETRIES; attempt++) {
|
|
100
|
+
if (attempt > 0)
|
|
101
|
+
await sleep(250 * attempt);
|
|
102
|
+
attempts++;
|
|
103
|
+
let status;
|
|
104
|
+
try {
|
|
105
|
+
status = (await hostingFetch(session.url, {
|
|
106
|
+
method: "POST",
|
|
107
|
+
headers: { Authorization: `Bearer ${session.token}`, "Content-Type": contentType },
|
|
108
|
+
body,
|
|
109
|
+
timeoutMs: BUCKET_TIMEOUT_MS,
|
|
110
|
+
})).status;
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
last = `a network error (${err instanceof Error ? err.message : String(err)})`;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (status >= 200 && status < 300)
|
|
117
|
+
return;
|
|
118
|
+
if (status === 401 || status === 403) {
|
|
119
|
+
throw new HostingError("upload_session_expired", "The upload session expired or was not accepted. Run the deploy again: it opens a new session and uploads what is still missing.", status);
|
|
120
|
+
}
|
|
121
|
+
if (!shouldRetryUpload({ status })) {
|
|
122
|
+
throw new HostingError("upload_refused", `The hosting backend refused an upload with ${status}. Nothing was activated; run the deploy again.`, status);
|
|
123
|
+
}
|
|
124
|
+
last = `${status}`;
|
|
125
|
+
}
|
|
126
|
+
throw new HostingError("upload_failed", `Could not upload ${parts.length} file(s) after ${BUCKET_RETRIES} retries: the last attempt ended with ${last}. Nothing was activated; run the deploy again to upload what is still missing.`, undefined, { attempts });
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Uploads every bucket of the session, {@link BUCKET_CONCURRENCY} at a time.
|
|
130
|
+
* Every bucket is checked against the build before the first is sent.
|
|
131
|
+
*
|
|
132
|
+
* @param session The create's `upload` answer; its URL is not checked here ({@link checkUploadTarget}).
|
|
133
|
+
* @param files The build's files.
|
|
134
|
+
* @param options `sleep` replaces the pause between retries.
|
|
135
|
+
* @returns How many files were uploaded.
|
|
136
|
+
* @throws HostingError `upload_session_expired`, `upload_refused`, `upload_failed` or `hosting_error`.
|
|
137
|
+
*/
|
|
138
|
+
export async function uploadBuckets(session, files, options = {}) {
|
|
139
|
+
const queue = session.buckets.map((bucket) => bucketParts(bucket, files, session.platformFiles ?? []));
|
|
140
|
+
const sleep = options.sleep ?? pause;
|
|
141
|
+
let next = 0;
|
|
142
|
+
const worker = async () => {
|
|
143
|
+
while (next < queue.length)
|
|
144
|
+
await uploadBucket(session, queue[next++], sleep);
|
|
145
|
+
};
|
|
146
|
+
await Promise.all(Array.from({ length: Math.min(BUCKET_CONCURRENCY, queue.length) }, worker));
|
|
147
|
+
return { uploaded: queue.reduce((n, parts) => n + parts.length, 0) };
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=hosting-wfp-upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosting-wfp-upload.js","sourceRoot":"","sources":["../../../src/lib/hosting-wfp-upload.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAoBnD,gCAAgC;AAChC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAEpC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC,2CAA2C;AAC3C,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,IAAI,MAAkB,CAAC;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,EAAE,GAAG,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,oBAAoB,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC3I,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,MAAM,IAAI,YAAY,CACpB,uBAAuB,EACvB,qLAAqL,CACtL,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAi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ACtB,KAA2B,EAC3B,UAAqD,EAAE;IAEvD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,CAAC;IACvG,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC;IACrC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,MAAM,MAAM,GAAG,KAAK,IAAI,EAAE;QACxB,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM;YAAE,MAAM,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAChF,CAAC,CAAC;IACF,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9F,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;AACvE,CAAC"}
|
|
@@ -18,12 +18,6 @@ export declare function platformLabel(platform: Platform): string;
|
|
|
18
18
|
* file is the cheapest place for a reader to find that rule.
|
|
19
19
|
*/
|
|
20
20
|
export declare const CANONICAL_SCHEMA_HEADER = "# The model schema for this app \u2014 ONE copy, shared by every client.\n#\n# The TOML keys here are the wire field names, so a second copy that drifts\n# orphans the other one's records. Every client reads THIS file:\n# - the web client's codegen input points at it, and its generated barrel\n# imports it directly\n# - the Swift client names it in `bao-codegen.json` beside its sources\n# Add or change a model here, then re-run each client's codegen.\n";
|
|
21
|
-
/**
|
|
22
|
-
* A starter schema for the rare composition that has no template starter to
|
|
23
|
-
* adopt. The scaffolded clients normally supply their own, which is what a
|
|
24
|
-
* composed repo promotes to the root.
|
|
25
|
-
*/
|
|
26
|
-
export declare const FALLBACK_STARTER_SCHEMA = "[models.user_prefs.fields.id]\ntype = \"id\"\nauto_assign = true\nindexed = true\nrequired = true\n\n[models.user_prefs.fields.key]\ntype = \"string\"\nindexed = true\nunique = true\n\n[models.user_prefs.fields.value]\ntype = \"string\"\n";
|
|
27
21
|
/**
|
|
28
22
|
* The app-wide `AGENTS.md` for a repository with several clients.
|
|
29
23
|
*
|
|
@@ -36,4 +30,6 @@ export declare function rootAgentsMarkdown(input: {
|
|
|
36
30
|
platform: Platform;
|
|
37
31
|
dir: string;
|
|
38
32
|
}>;
|
|
33
|
+
/** Whether the repository has `models/models.toml`; the layout names it only then. */
|
|
34
|
+
schema?: boolean;
|
|
39
35
|
}): string;
|
|
@@ -18,25 +18,6 @@ export const CANONICAL_SCHEMA_HEADER = `# The model schema for this app — ONE
|
|
|
18
18
|
# - the Swift client names it in \`bao-codegen.json\` beside its sources
|
|
19
19
|
# Add or change a model here, then re-run each client's codegen.
|
|
20
20
|
`;
|
|
21
|
-
/**
|
|
22
|
-
* A starter schema for the rare composition that has no template starter to
|
|
23
|
-
* adopt. The scaffolded clients normally supply their own, which is what a
|
|
24
|
-
* composed repo promotes to the root.
|
|
25
|
-
*/
|
|
26
|
-
export const FALLBACK_STARTER_SCHEMA = `[models.user_prefs.fields.id]
|
|
27
|
-
type = "id"
|
|
28
|
-
auto_assign = true
|
|
29
|
-
indexed = true
|
|
30
|
-
required = true
|
|
31
|
-
|
|
32
|
-
[models.user_prefs.fields.key]
|
|
33
|
-
type = "string"
|
|
34
|
-
indexed = true
|
|
35
|
-
unique = true
|
|
36
|
-
|
|
37
|
-
[models.user_prefs.fields.value]
|
|
38
|
-
type = "string"
|
|
39
|
-
`;
|
|
40
21
|
/**
|
|
41
22
|
* The app-wide `AGENTS.md` for a repository with several clients.
|
|
42
23
|
*
|
|
@@ -44,13 +25,20 @@ type = "string"
|
|
|
44
25
|
* own file is never replaced by init.
|
|
45
26
|
*/
|
|
46
27
|
export function rootAgentsMarkdown(input) {
|
|
28
|
+
const schema = input.schema ?? true;
|
|
47
29
|
const rows = input.clients
|
|
48
30
|
.map((client) => `- \`${client.dir}/\` — ${platformLabel(client.platform)} client`)
|
|
49
31
|
.join("\n");
|
|
32
|
+
const schemaRow = schema
|
|
33
|
+
? `- \`models/models.toml\` — the model schema. ONE copy: its keys are the wire
|
|
34
|
+
field names, so a second copy that drifts orphans the other's records. Each
|
|
35
|
+
client's codegen reads this file in place; never copy it into a client.
|
|
36
|
+
`
|
|
37
|
+
: "";
|
|
50
38
|
return `# ${input.appName}
|
|
51
39
|
|
|
52
40
|
One Primitive app, several clients. The app is the shared thing: one app ID,
|
|
53
|
-
one set of environments, one exported server config, one model schema. Each
|
|
41
|
+
one set of environments, one exported server config${schema ? ", one model schema" : ""}. Each
|
|
54
42
|
client is an independent project in its own directory — there is no workspace
|
|
55
43
|
file and no root \`package.json\`.
|
|
56
44
|
|
|
@@ -61,10 +49,7 @@ file and no root \`package.json\`.
|
|
|
61
49
|
- \`primitive/<env>/\` — the exported server config (workflows,
|
|
62
50
|
database type configs, app settings) that \`primitive config diff\` and
|
|
63
51
|
\`primitive config push\` read and write.
|
|
64
|
-
|
|
65
|
-
field names, so a second copy that drifts orphans the other's records. Each
|
|
66
|
-
client's codegen reads this file in place; never copy it into a client.
|
|
67
|
-
${rows}
|
|
52
|
+
${schemaRow}${rows}
|
|
68
53
|
|
|
69
54
|
## Per app vs per client
|
|
70
55
|
|
|
@@ -72,8 +57,7 @@ ${rows}
|
|
|
72
57
|
| --- | --- |
|
|
73
58
|
| Environments and app ID | Generated code |
|
|
74
59
|
| Exported server config | Dependencies and build config |
|
|
75
|
-
| Model schema | Runtime connection settings |
|
|
76
|
-
| Secrets | Deploy configuration |
|
|
60
|
+
${schema ? "| Model schema | Runtime connection settings |\n| Secrets | Deploy configuration |" : "| Secrets | Runtime connection settings |\n| — | Deploy configuration |"}
|
|
77
61
|
| — | Its own \`AGENTS.md\` |
|
|
78
62
|
|
|
79
63
|
## Running commands
|
|
@@ -90,7 +74,7 @@ primitive init <dir> --platform <web|ios>
|
|
|
90
74
|
\`\`\`
|
|
91
75
|
|
|
92
76
|
Run from inside this repository, that adds a client to THIS app: it reuses this
|
|
93
|
-
config, wires the new client to \`models/models.toml\`, and creates no second
|
|
77
|
+
config, ${schema ? "wires the new client to \`models/models.toml\`, " : ""}and creates no second
|
|
94
78
|
\`.primitive/\` and no second git repository.
|
|
95
79
|
`;
|
|
96
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-assets.js","sourceRoot":"","sources":["../../../src/lib/init-assets.ts"],"names":[],"mappings":"AAWA,yEAAyE;AACzE,MAAM,UAAU,aAAa,CAAC,QAAkB;IAC9C,OAAO,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC;AAC5D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;CAQtC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"init-assets.js","sourceRoot":"","sources":["../../../src/lib/init-assets.ts"],"names":[],"mappings":"AAWA,yEAAyE;AACzE,MAAM,UAAU,aAAa,CAAC,QAAkB;IAC9C,OAAO,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC;AAC5D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;CAQtC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAKlC;IACC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC;IACpC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO;SACvB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,CAAC,GAAG,SAAS,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;SAClF,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,MAAM,SAAS,GAAG,MAAM;QACtB,CAAC,CAAC;;;CAGL;QACG,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,KAAK,KAAK,CAAC,OAAO;;;qDAG0B,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;EAWrF,SAAS,GAAG,IAAI;;;;;;;;EAQhB,MAAM,CAAC,CAAC,CAAC,oFAAoF,CAAC,CAAC,CAAC,yEAAyE;;;;;;;;;;;;;;;;;UAiBjK,MAAM,CAAC,CAAC,CAAC,kDAAkD,CAAC,CAAC,CAAC,EAAE;;CAEzE,CAAC;AACF,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `CFBundleURLName` the
|
|
3
|
-
* breaks the manager's scheme resolution, so it is pinned by a test that reads
|
|
4
|
-
* both files.
|
|
2
|
+
* The `CFBundleURLName` of the template's URL type: the entry init stamps.
|
|
5
3
|
*/
|
|
6
4
|
export declare const PRIMITIVE_AUTH_URL_TYPE_NAME = "PrimitiveAuth";
|
|
7
|
-
/** The
|
|
5
|
+
/** The template's shipped scheme — reserved, never a derived result. */
|
|
8
6
|
export declare const FALLBACK_CALLBACK_SCHEME = "primitiveapp";
|
|
9
7
|
/**
|
|
10
8
|
* The custom URL scheme for one scaffolded client: a readable prefix from the
|
|
@@ -14,8 +12,13 @@ export declare const FALLBACK_CALLBACK_SCHEME = "primitiveapp";
|
|
|
14
12
|
* share a scheme, whatever they are called.
|
|
15
13
|
*/
|
|
16
14
|
export declare function deriveCallbackScheme(appName: string, appId: string, clientDirName?: string): string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The scheme callback an emailed sign-in link lands on, for one scheme: the
|
|
17
|
+
* value of the `PrimitiveOAuthRedirectURI` key, and the allow-list entry.
|
|
18
|
+
*/
|
|
19
|
+
export declare function iosSchemeCallbackUri(scheme: string): string;
|
|
20
|
+
/** The Info.plist key the template reads its `oauthRedirectUri` from. */
|
|
21
|
+
export declare const OAUTH_REDIRECT_URI_PLIST_KEY = "PrimitiveOAuthRedirectURI";
|
|
19
22
|
export interface StampResult {
|
|
20
23
|
/** `not-found` when the plist predates the `PrimitiveAuth` URL type. */
|
|
21
24
|
outcome: "stamped" | "already" | "not-found";
|
|
@@ -46,7 +49,8 @@ export declare function stampCallbackScheme(clientDir: string, scheme: string):
|
|
|
46
49
|
export declare function setWebUrlInstruction(origin: string, indent?: string): string[];
|
|
47
50
|
/**
|
|
48
51
|
* What init prints about email sign-in on the iOS path: it already works, and
|
|
49
|
-
* this is the
|
|
52
|
+
* this is the opt-in that adds a scheme link — an allow-list entry and one
|
|
53
|
+
* Info.plist key, no source edit.
|
|
50
54
|
*
|
|
51
55
|
* The allow-list step is phrased as a MERGE into the existing array — `app.toml`
|
|
52
56
|
* is the whole app-settings truth on push (#2880), so a replacement array would
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The iOS app's own URL scheme, and the documented opt-in that turns the
|
|
3
|
-
* sign-in email's LINK on (#2969).
|
|
3
|
+
* sign-in email's LINK on (#2969, #4930).
|
|
4
4
|
*
|
|
5
5
|
* The Swift template registers one custom URL scheme, under the
|
|
6
|
-
* `PrimitiveAuth` URL-type name that `
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* scheme in its place.
|
|
6
|
+
* `PrimitiveAuth` URL-type name. Shipped, that scheme is `primitiveapp` —
|
|
7
|
+
* which every app scaffolded from the template would otherwise share, making
|
|
8
|
+
* iOS link routing between two of them on one device ambiguous. So init
|
|
9
|
+
* stamps an app-unique scheme in its place.
|
|
11
10
|
*
|
|
12
11
|
* The suffix is the WHOLE app ID, not a tail or a hash of it: app IDs are
|
|
13
12
|
* 26-character ULIDs, and any fixed-width squeeze of them is many-to-one — two
|
|
14
13
|
* distinct apps could still be handed the same scheme, which is the failure
|
|
15
14
|
* this stamping exists to prevent.
|
|
16
15
|
*
|
|
17
|
-
* Init writes no app settings here. Email sign-in works out of the box
|
|
18
|
-
* the
|
|
19
|
-
* code alone and the allow-list is not consulted at
|
|
20
|
-
* the developer's opt-in — one allow-list entry
|
|
21
|
-
*
|
|
16
|
+
* Init writes no app settings here. Email sign-in works out of the box: with
|
|
17
|
+
* no web origin and no `oauthRedirectUri`, the client sends NO redirect target,
|
|
18
|
+
* so the email carries the code alone and the allow-list is not consulted at
|
|
19
|
+
* all. Sending a scheme link is the developer's opt-in — one allow-list entry
|
|
20
|
+
* plus the `PrimitiveOAuthRedirectURI` key in `Info-Partial.plist`, which the
|
|
21
|
+
* template forwards as the client's `oauthRedirectUri` — and init only prints
|
|
22
|
+
* what those are.
|
|
22
23
|
*/
|
|
23
24
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
24
25
|
import { join } from "path";
|
|
25
26
|
/**
|
|
26
|
-
* The `CFBundleURLName` the
|
|
27
|
-
* breaks the manager's scheme resolution, so it is pinned by a test that reads
|
|
28
|
-
* both files.
|
|
27
|
+
* The `CFBundleURLName` of the template's URL type: the entry init stamps.
|
|
29
28
|
*/
|
|
30
29
|
export const PRIMITIVE_AUTH_URL_TYPE_NAME = "PrimitiveAuth";
|
|
31
|
-
/** The
|
|
30
|
+
/** The template's shipped scheme — reserved, never a derived result. */
|
|
32
31
|
export const FALLBACK_CALLBACK_SCHEME = "primitiveapp";
|
|
33
32
|
/** How much of the app name survives into the readable prefix. */
|
|
34
33
|
const PREFIX_MAX_LENGTH = 20;
|
|
@@ -63,10 +62,15 @@ export function deriveCallbackScheme(appName, appId, clientDirName) {
|
|
|
63
62
|
// what a derived one must never collide with.
|
|
64
63
|
return scheme === FALLBACK_CALLBACK_SCHEME ? `${scheme}-app` : scheme;
|
|
65
64
|
}
|
|
66
|
-
/**
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
/**
|
|
66
|
+
* The scheme callback an emailed sign-in link lands on, for one scheme: the
|
|
67
|
+
* value of the `PrimitiveOAuthRedirectURI` key, and the allow-list entry.
|
|
68
|
+
*/
|
|
69
|
+
export function iosSchemeCallbackUri(scheme) {
|
|
70
|
+
return `${scheme}://oauth/callback`;
|
|
69
71
|
}
|
|
72
|
+
/** The Info.plist key the template reads its `oauthRedirectUri` from. */
|
|
73
|
+
export const OAUTH_REDIRECT_URI_PLIST_KEY = "PrimitiveOAuthRedirectURI";
|
|
70
74
|
/**
|
|
71
75
|
* Replaces the scheme registered under the `PrimitiveAuth` URL type in a
|
|
72
76
|
* scaffolded client's `Info-Partial.plist`.
|
|
@@ -132,7 +136,8 @@ export function setWebUrlInstruction(origin, indent = " ") {
|
|
|
132
136
|
}
|
|
133
137
|
/**
|
|
134
138
|
* What init prints about email sign-in on the iOS path: it already works, and
|
|
135
|
-
* this is the
|
|
139
|
+
* this is the opt-in that adds a scheme link — an allow-list entry and one
|
|
140
|
+
* Info.plist key, no source edit.
|
|
136
141
|
*
|
|
137
142
|
* The allow-list step is phrased as a MERGE into the existing array — `app.toml`
|
|
138
143
|
* is the whole app-settings truth on push (#2880), so a replacement array would
|
|
@@ -146,7 +151,7 @@ export function setWebUrlInstruction(origin, indent = " ") {
|
|
|
146
151
|
*/
|
|
147
152
|
export function linkOptInGuidance(scheme, options = {}) {
|
|
148
153
|
const registered = options.registered !== false;
|
|
149
|
-
const redirectUri =
|
|
154
|
+
const redirectUri = iosSchemeCallbackUri(scheme);
|
|
150
155
|
return [
|
|
151
156
|
"Email sign-in works now: the email carries a 6-digit code and needs no app settings.",
|
|
152
157
|
"When this app gets a web client, prefer the https link: set the environment's `webUrl` —",
|
|
@@ -155,8 +160,9 @@ export function linkOptInGuidance(scheme, options = {}) {
|
|
|
155
160
|
" app where it is installed and signs in through the browser anywhere else.",
|
|
156
161
|
`Until then, to ALSO send a sign-in link that opens this app, add "${redirectUri}" to the existing`,
|
|
157
162
|
" [auth].emailRedirectUris array in config/app.toml (merge it in — run",
|
|
158
|
-
" `primitive config pull --only app` first if that file is not there yet),
|
|
159
|
-
|
|
163
|
+
" `primitive config pull --only app` first if that file is not there yet), run",
|
|
164
|
+
` \`primitive config push --only app\`, and add the ${OAUTH_REDIRECT_URI_PLIST_KEY} key to`,
|
|
165
|
+
` Info-Partial.plist with the value "${redirectUri}".`,
|
|
160
166
|
registered
|
|
161
167
|
? "The scheme registration and the link routing are already in this client."
|
|
162
168
|
: `The scheme "${scheme}" is NOT registered in this client yet — register it first (see`
|