primitive-admin 1.1.0-alpha.9 → 1.2.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 +530 -116
- package/assets/skill/skills/primitive-platform/SKILL.md +295 -0
- package/dist/bin/primitive.d.ts +2 -0
- package/dist/bin/primitive.js +372 -21
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.d.ts +2 -0
- package/dist/src/commands/admins.js +136 -30
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/analytics.d.ts +2 -0
- package/dist/src/commands/analytics.js +713 -55
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps.d.ts +2 -0
- package/dist/src/commands/apps.js +65 -100
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.d.ts +7 -0
- package/dist/src/commands/auth-sessions.js +144 -0
- package/dist/src/commands/auth-sessions.js.map +1 -0
- package/dist/src/commands/auth.d.ts +2 -0
- package/dist/src/commands/auth.js +238 -108
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.d.ts +2 -0
- package/dist/src/commands/blob-buckets.js +331 -0
- package/dist/src/commands/blob-buckets.js.map +1 -0
- package/dist/src/commands/catalog.d.ts +2 -0
- package/dist/src/commands/catalog.js +63 -48
- package/dist/src/commands/catalog.js.map +1 -1
- package/dist/src/commands/collection-type-configs.d.ts +2 -0
- package/dist/src/commands/collection-type-configs.js +85 -0
- package/dist/src/commands/collection-type-configs.js.map +1 -0
- package/dist/src/commands/collections.d.ts +2 -0
- package/dist/src/commands/collections.js +1285 -0
- package/dist/src/commands/collections.js.map +1 -0
- package/dist/src/commands/comparisons.d.ts +2 -0
- package/dist/src/commands/comparisons.js +6 -6
- package/dist/src/commands/comparisons.js.map +1 -1
- package/dist/src/commands/config.d.ts +46 -0
- package/dist/src/commands/config.js +465 -0
- package/dist/src/commands/config.js.map +1 -0
- package/dist/src/commands/connections.d.ts +2 -0
- package/dist/src/commands/connections.js +99 -0
- package/dist/src/commands/connections.js.map +1 -0
- package/dist/src/commands/cron-triggers.d.ts +2 -0
- package/dist/src/commands/cron-triggers.js +266 -0
- package/dist/src/commands/cron-triggers.js.map +1 -0
- package/dist/src/commands/database-type-configs.d.ts +2 -0
- package/dist/src/commands/database-type-configs.js +164 -0
- package/dist/src/commands/database-type-configs.js.map +1 -0
- package/dist/src/commands/database-types.d.ts +2 -0
- package/dist/src/commands/database-types.js +171 -0
- package/dist/src/commands/database-types.js.map +1 -0
- package/dist/src/commands/databases.d.ts +65 -0
- package/dist/src/commands/databases.js +1868 -243
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +60 -0
- package/dist/src/commands/documents.js +2888 -22
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.d.ts +2 -0
- package/dist/src/commands/email-templates.js +175 -0
- package/dist/src/commands/email-templates.js.map +1 -0
- package/dist/src/commands/env.d.ts +23 -0
- package/dist/src/commands/env.js +395 -0
- package/dist/src/commands/env.js.map +1 -0
- package/dist/src/commands/feature-flags.d.ts +14 -0
- package/dist/src/commands/feature-flags.js +117 -0
- package/dist/src/commands/feature-flags.js.map +1 -0
- package/dist/src/commands/functions.d.ts +20 -0
- package/dist/src/commands/functions.js +1630 -0
- package/dist/src/commands/functions.js.map +1 -0
- package/dist/src/commands/group-type-configs.d.ts +2 -0
- package/dist/src/commands/group-type-configs.js +87 -0
- package/dist/src/commands/group-type-configs.js.map +1 -0
- package/dist/src/commands/groups.d.ts +2 -0
- package/dist/src/commands/groups.js +81 -113
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.d.ts +223 -0
- package/dist/src/commands/guides.js +627 -69
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +37 -0
- package/dist/src/commands/init.js +1693 -208
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.d.ts +2 -0
- package/dist/src/commands/integrations.js +428 -187
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.d.ts +2 -0
- package/dist/src/commands/llm.js +13 -8
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/locks.d.ts +8 -0
- package/dist/src/commands/locks.js +175 -0
- package/dist/src/commands/locks.js.map +1 -0
- package/dist/src/commands/metadata-category-configs.d.ts +12 -0
- package/dist/src/commands/metadata-category-configs.js +113 -0
- package/dist/src/commands/metadata-category-configs.js.map +1 -0
- package/dist/src/commands/metadata.d.ts +2 -0
- package/dist/src/commands/metadata.js +288 -0
- package/dist/src/commands/metadata.js.map +1 -0
- package/dist/src/commands/prompts.d.ts +2 -0
- package/dist/src/commands/prompts.js +322 -634
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.d.ts +3 -0
- package/dist/src/commands/rule-sets.js +139 -148
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/scripts.d.ts +30 -0
- package/dist/src/commands/scripts.js +688 -0
- package/dist/src/commands/scripts.js.map +1 -0
- package/dist/src/commands/secrets.d.ts +2 -0
- package/dist/src/commands/secrets.js +109 -0
- package/dist/src/commands/secrets.js.map +1 -0
- package/dist/src/commands/sessions.d.ts +2 -0
- package/dist/src/commands/sessions.js +76 -0
- package/dist/src/commands/sessions.js.map +1 -0
- package/dist/src/commands/settings.d.ts +18 -0
- package/dist/src/commands/settings.js +54 -0
- package/dist/src/commands/settings.js.map +1 -0
- package/dist/src/commands/skill.d.ts +2 -0
- package/dist/src/commands/skill.js +29 -0
- package/dist/src/commands/skill.js.map +1 -0
- package/dist/src/commands/sync-app-settings.d.ts +158 -0
- package/dist/src/commands/sync-app-settings.js +328 -0
- package/dist/src/commands/sync-app-settings.js.map +1 -0
- package/dist/src/commands/sync.d.ts +2667 -0
- package/dist/src/commands/sync.js +17141 -834
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.d.ts +2 -0
- package/dist/src/commands/tokens.js +132 -22
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.d.ts +2 -0
- package/dist/src/commands/users.js +542 -24
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.d.ts +8 -0
- package/dist/src/commands/vars.js +97 -0
- package/dist/src/commands/vars.js.map +1 -0
- package/dist/src/commands/waitlist.d.ts +2 -0
- package/dist/src/commands/waitlist.js +12 -11
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +31 -0
- package/dist/src/commands/webhooks.js +633 -0
- package/dist/src/commands/webhooks.js.map +1 -0
- package/dist/src/commands/workflows.d.ts +88 -0
- package/dist/src/commands/workflows.js +1568 -742
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/access-rule-display.d.ts +21 -0
- package/dist/src/lib/access-rule-display.js +34 -0
- package/dist/src/lib/access-rule-display.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +2513 -0
- package/dist/src/lib/api-client.js +2456 -162
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-match-guard.d.ts +44 -0
- package/dist/src/lib/app-match-guard.js +72 -0
- package/dist/src/lib/app-match-guard.js.map +1 -0
- package/dist/src/lib/app-settings-descriptor.d.ts +263 -0
- package/dist/src/lib/app-settings-descriptor.js +583 -0
- package/dist/src/lib/app-settings-descriptor.js.map +1 -0
- package/dist/src/lib/auth-flow.d.ts +8 -0
- package/dist/src/lib/batch.d.ts +26 -0
- package/dist/src/lib/batch.js +32 -0
- package/dist/src/lib/batch.js.map +1 -0
- package/dist/src/lib/block-layout.d.ts +160 -0
- package/dist/src/lib/block-layout.js +451 -0
- package/dist/src/lib/block-layout.js.map +1 -0
- package/dist/src/lib/block-selector.d.ts +58 -0
- package/dist/src/lib/block-selector.js +92 -0
- package/dist/src/lib/block-selector.js.map +1 -0
- package/dist/src/lib/canonical-json.d.ts +12 -0
- package/dist/src/lib/canonical-json.js +35 -0
- package/dist/src/lib/canonical-json.js.map +1 -0
- package/dist/src/lib/channel.d.ts +30 -0
- package/dist/src/lib/channel.js +68 -0
- package/dist/src/lib/channel.js.map +1 -0
- package/dist/src/lib/cli-manifest.d.ts +68 -0
- package/dist/src/lib/cli-manifest.js +71 -0
- package/dist/src/lib/cli-manifest.js.map +1 -0
- package/dist/src/lib/codegen-shared/generatedFiles.d.ts +101 -0
- package/dist/src/lib/codegen-shared/generatedFiles.js +191 -0
- package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -0
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +262 -0
- package/dist/src/lib/codegen-shared/prettierStable.js +610 -0
- package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +38 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +46 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -0
- package/dist/src/lib/collection-export.d.ts +212 -0
- package/dist/src/lib/collection-export.js +288 -0
- package/dist/src/lib/collection-export.js.map +1 -0
- package/dist/src/lib/config-json-field.d.ts +28 -0
- package/dist/src/lib/config-json-field.js +56 -0
- package/dist/src/lib/config-json-field.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +127 -0
- package/dist/src/lib/config-object-descriptor.js +740 -0
- package/dist/src/lib/config-object-descriptor.js.map +1 -0
- package/dist/src/lib/config-payload.d.ts +92 -0
- package/dist/src/lib/config-payload.js +161 -0
- package/dist/src/lib/config-payload.js.map +1 -0
- package/dist/src/lib/config-surface.d.ts +141 -0
- package/dist/src/lib/config-surface.js +368 -0
- package/dist/src/lib/config-surface.js.map +1 -0
- package/dist/src/lib/config-toml.d.ts +10 -0
- package/dist/src/lib/config-toml.js +42 -0
- package/dist/src/lib/config-toml.js.map +1 -0
- package/dist/src/lib/config.d.ts +71 -0
- package/dist/src/lib/config.js +71 -68
- package/dist/src/lib/config.js.map +1 -1
- package/dist/src/lib/confirm-prompt.d.ts +83 -0
- package/dist/src/lib/confirm-prompt.js +110 -0
- package/dist/src/lib/confirm-prompt.js.map +1 -0
- package/dist/src/lib/constants.d.ts +11 -0
- package/dist/src/lib/constants.js +12 -0
- package/dist/src/lib/constants.js.map +1 -0
- package/dist/src/lib/crash-handlers.d.ts +20 -0
- package/dist/src/lib/crash-handlers.js +49 -0
- package/dist/src/lib/crash-handlers.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +104 -0
- package/dist/src/lib/credentials-store.js +336 -0
- package/dist/src/lib/credentials-store.js.map +1 -0
- package/dist/src/lib/csv.d.ts +47 -0
- package/dist/src/lib/csv.js +172 -0
- package/dist/src/lib/csv.js.map +1 -0
- package/dist/src/lib/data-input.d.ts +23 -0
- package/dist/src/lib/data-input.js +50 -0
- package/dist/src/lib/data-input.js.map +1 -0
- package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
- package/dist/src/lib/db-codegen/dbFingerprint.js +17 -0
- package/dist/src/lib/db-codegen/dbFingerprint.js.map +1 -0
- package/dist/src/lib/db-codegen/dbGenerator.d.ts +67 -0
- package/dist/src/lib/db-codegen/dbGenerator.js +170 -0
- package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -0
- package/dist/src/lib/db-codegen/dbNaming.d.ts +87 -0
- package/dist/src/lib/db-codegen/dbNaming.js +180 -0
- package/dist/src/lib/db-codegen/dbNaming.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +272 -0
- package/dist/src/lib/db-codegen/dbTemplates.js +480 -0
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +73 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js +139 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +146 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js +525 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.d.ts +112 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js +211 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js.map +1 -0
- package/dist/src/lib/deprecation.d.ts +22 -0
- package/dist/src/lib/deprecation.js +43 -0
- package/dist/src/lib/deprecation.js.map +1 -0
- package/dist/src/lib/document-export-permissions.d.ts +30 -0
- package/dist/src/lib/document-export-permissions.js +54 -0
- package/dist/src/lib/document-export-permissions.js.map +1 -0
- package/dist/src/lib/document-ingest-artifact.d.ts +120 -0
- package/dist/src/lib/document-ingest-artifact.js +505 -0
- package/dist/src/lib/document-ingest-artifact.js.map +1 -0
- package/dist/src/lib/document-ingest-input.d.ts +51 -0
- package/dist/src/lib/document-ingest-input.js +132 -0
- package/dist/src/lib/document-ingest-input.js.map +1 -0
- package/dist/src/lib/document-ingest-rows.d.ts +137 -0
- package/dist/src/lib/document-ingest-rows.js +181 -0
- package/dist/src/lib/document-ingest-rows.js.map +1 -0
- package/dist/src/lib/document-ingest.d.ts +101 -0
- package/dist/src/lib/document-ingest.js +384 -0
- package/dist/src/lib/document-ingest.js.map +1 -0
- package/dist/src/lib/env-resolver-core.d.ts +258 -0
- package/dist/src/lib/env-resolver-core.js +447 -0
- package/dist/src/lib/env-resolver-core.js.map +1 -0
- package/dist/src/lib/env-resolver.d.ts +99 -0
- package/dist/src/lib/env-resolver.js +153 -0
- package/dist/src/lib/env-resolver.js.map +1 -0
- package/dist/src/lib/fetch.d.ts +5 -0
- package/dist/src/lib/function-bundle.d.ts +147 -0
- package/dist/src/lib/function-bundle.js +341 -0
- package/dist/src/lib/function-bundle.js.map +1 -0
- package/dist/src/lib/function-collect.d.ts +123 -0
- package/dist/src/lib/function-collect.js +610 -0
- package/dist/src/lib/function-collect.js.map +1 -0
- package/dist/src/lib/function-db-types.d.ts +202 -0
- package/dist/src/lib/function-db-types.js +870 -0
- package/dist/src/lib/function-db-types.js.map +1 -0
- package/dist/src/lib/function-document-types.d.ts +144 -0
- package/dist/src/lib/function-document-types.js +370 -0
- package/dist/src/lib/function-document-types.js.map +1 -0
- package/dist/src/lib/function-grants-preflight.d.ts +64 -0
- package/dist/src/lib/function-grants-preflight.js +105 -0
- package/dist/src/lib/function-grants-preflight.js.map +1 -0
- package/dist/src/lib/function-log-lines.d.ts +76 -0
- package/dist/src/lib/function-log-lines.js +160 -0
- package/dist/src/lib/function-log-lines.js.map +1 -0
- package/dist/src/lib/function-log-row.d.ts +29 -0
- package/dist/src/lib/function-log-row.js +73 -0
- package/dist/src/lib/function-log-row.js.map +1 -0
- package/dist/src/lib/function-log-tail.d.ts +132 -0
- package/dist/src/lib/function-log-tail.js +262 -0
- package/dist/src/lib/function-log-tail.js.map +1 -0
- package/dist/src/lib/function-run.d.ts +289 -0
- package/dist/src/lib/function-run.js +389 -0
- package/dist/src/lib/function-run.js.map +1 -0
- package/dist/src/lib/function-schema-codegen.d.ts +143 -0
- package/dist/src/lib/function-schema-codegen.js +420 -0
- package/dist/src/lib/function-schema-codegen.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +459 -0
- package/dist/src/lib/function-sync.js +1258 -0
- package/dist/src/lib/function-sync.js.map +1 -0
- package/dist/src/lib/function-trigger-listing.d.ts +27 -0
- package/dist/src/lib/function-trigger-listing.js +70 -0
- package/dist/src/lib/function-trigger-listing.js.map +1 -0
- package/dist/src/lib/function-triggers.d.ts +66 -0
- package/dist/src/lib/function-triggers.js +285 -0
- package/dist/src/lib/function-triggers.js.map +1 -0
- package/dist/src/lib/function-typecheck.d.ts +86 -0
- package/dist/src/lib/function-typecheck.js +370 -0
- package/dist/src/lib/function-typecheck.js.map +1 -0
- package/dist/src/lib/function-versions.d.ts +122 -0
- package/dist/src/lib/function-versions.js +182 -0
- package/dist/src/lib/function-versions.js.map +1 -0
- package/dist/src/lib/generated-allowlist.d.ts +28 -0
- package/dist/src/lib/generated-allowlist.js +280 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +2936 -0
- package/dist/src/lib/generated-config-surfaces.js +10593 -0
- package/dist/src/lib/generated-config-surfaces.js.map +1 -0
- package/dist/src/lib/generated-sdk-types.d.ts +12 -0
- package/dist/src/lib/generated-sdk-types.js +13 -0
- package/dist/src/lib/generated-sdk-types.js.map +1 -0
- package/dist/src/lib/generated-template-lint.d.ts +212 -0
- package/dist/src/lib/generated-template-lint.js +624 -0
- package/dist/src/lib/generated-template-lint.js.map +1 -0
- 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/google-client-secret-status.d.ts +35 -0
- package/dist/src/lib/google-client-secret-status.js +56 -0
- package/dist/src/lib/google-client-secret-status.js.map +1 -0
- package/dist/src/lib/init-adopt.d.ts +16 -0
- package/dist/src/lib/init-adopt.js +34 -0
- package/dist/src/lib/init-adopt.js.map +1 -0
- package/dist/src/lib/init-assets.d.ts +39 -0
- package/dist/src/lib/init-assets.js +97 -0
- package/dist/src/lib/init-assets.js.map +1 -0
- package/dist/src/lib/init-client-platforms.d.ts +14 -0
- package/dist/src/lib/init-client-platforms.js +71 -0
- package/dist/src/lib/init-client-platforms.js.map +1 -0
- package/dist/src/lib/init-config.d.ts +98 -0
- package/dist/src/lib/init-config.js +186 -0
- package/dist/src/lib/init-config.js.map +1 -0
- package/dist/src/lib/init-email-redirect-uris.d.ts +37 -0
- package/dist/src/lib/init-email-redirect-uris.js +46 -0
- package/dist/src/lib/init-email-redirect-uris.js.map +1 -0
- package/dist/src/lib/init-ios-links.d.ts +91 -0
- package/dist/src/lib/init-ios-links.js +219 -0
- package/dist/src/lib/init-ios-links.js.map +1 -0
- package/dist/src/lib/init-plan.d.ts +80 -0
- package/dist/src/lib/init-plan.js +95 -0
- package/dist/src/lib/init-plan.js.map +1 -0
- package/dist/src/lib/init-production-env.d.ts +48 -0
- package/dist/src/lib/init-production-env.js +59 -0
- package/dist/src/lib/init-production-env.js.map +1 -0
- package/dist/src/lib/init-schema.d.ts +74 -0
- package/dist/src/lib/init-schema.js +358 -0
- package/dist/src/lib/init-schema.js.map +1 -0
- package/dist/src/lib/init-xcode.d.ts +34 -0
- package/dist/src/lib/init-xcode.js +138 -0
- package/dist/src/lib/init-xcode.js.map +1 -0
- package/dist/src/lib/integration-request-config.d.ts +30 -0
- package/dist/src/lib/integration-request-config.js +145 -0
- package/dist/src/lib/integration-request-config.js.map +1 -0
- package/dist/src/lib/integration-selector.d.ts +42 -0
- package/dist/src/lib/integration-selector.js +46 -0
- package/dist/src/lib/integration-selector.js.map +1 -0
- package/dist/src/lib/ios-app-id.d.ts +34 -0
- package/dist/src/lib/ios-app-id.js +69 -0
- package/dist/src/lib/ios-app-id.js.map +1 -0
- package/dist/src/lib/list-options.d.ts +68 -0
- package/dist/src/lib/list-options.js +89 -0
- package/dist/src/lib/list-options.js.map +1 -0
- package/dist/src/lib/local-state.d.ts +55 -0
- package/dist/src/lib/local-state.js +167 -0
- package/dist/src/lib/local-state.js.map +1 -0
- package/dist/src/lib/local-test-cases.d.ts +63 -0
- package/dist/src/lib/local-test-cases.js +136 -0
- package/dist/src/lib/local-test-cases.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +710 -0
- package/dist/src/lib/log-inspection.js +814 -0
- package/dist/src/lib/log-inspection.js.map +1 -0
- package/dist/src/lib/logout-admin-session.d.ts +33 -0
- package/dist/src/lib/logout-admin-session.js +70 -0
- package/dist/src/lib/logout-admin-session.js.map +1 -0
- package/dist/src/lib/migration-nag.d.ts +49 -0
- package/dist/src/lib/migration-nag.js +164 -0
- package/dist/src/lib/migration-nag.js.map +1 -0
- package/dist/src/lib/object-status-filter.d.ts +22 -0
- package/dist/src/lib/object-status-filter.js +45 -0
- package/dist/src/lib/object-status-filter.js.map +1 -0
- package/dist/src/lib/output.d.ts +124 -0
- package/dist/src/lib/output.js +219 -8
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/package-manager.d.ts +140 -0
- package/dist/src/lib/package-manager.js +305 -0
- package/dist/src/lib/package-manager.js.map +1 -0
- package/dist/src/lib/paginate.d.ts +82 -0
- package/dist/src/lib/paginate.js +99 -0
- package/dist/src/lib/paginate.js.map +1 -0
- package/dist/src/lib/platform-owned.d.ts +63 -0
- package/dist/src/lib/platform-owned.js +85 -0
- package/dist/src/lib/platform-owned.js.map +1 -0
- package/dist/src/lib/project-config.d.ts +122 -0
- package/dist/src/lib/project-config.js +244 -0
- package/dist/src/lib/project-config.js.map +1 -0
- package/dist/src/lib/prompt-cost-format.d.ts +11 -0
- package/dist/src/lib/prompt-cost-format.js +41 -0
- package/dist/src/lib/prompt-cost-format.js.map +1 -0
- package/dist/src/lib/prompt-schema-codegen.d.ts +147 -0
- package/dist/src/lib/prompt-schema-codegen.js +462 -0
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -0
- package/dist/src/lib/query-operators.d.ts +43 -0
- package/dist/src/lib/query-operators.js +80 -0
- package/dist/src/lib/query-operators.js.map +1 -0
- package/dist/src/lib/record-filter.d.ts +18 -0
- package/dist/src/lib/record-filter.js +55 -0
- package/dist/src/lib/record-filter.js.map +1 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +73 -0
- package/dist/src/lib/refresh-admin-credentials.js +123 -0
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -0
- package/dist/src/lib/resolve-init-dev-port.d.ts +56 -0
- package/dist/src/lib/resolve-init-dev-port.js +55 -0
- package/dist/src/lib/resolve-init-dev-port.js.map +1 -0
- package/dist/src/lib/resolve-init-server.d.ts +64 -0
- package/dist/src/lib/resolve-init-server.js +77 -0
- package/dist/src/lib/resolve-init-server.js.map +1 -0
- package/dist/src/lib/resolve-owner.d.ts +19 -0
- package/dist/src/lib/resolve-owner.js +20 -0
- package/dist/src/lib/resolve-owner.js.map +1 -0
- package/dist/src/lib/resolve-platform.d.ts +74 -0
- package/dist/src/lib/resolve-platform.js +105 -0
- package/dist/src/lib/resolve-platform.js.map +1 -0
- package/dist/src/lib/run-status.d.ts +19 -0
- package/dist/src/lib/run-status.generated.d.ts +39 -0
- package/dist/src/lib/run-status.generated.js +66 -0
- package/dist/src/lib/run-status.generated.js.map +1 -0
- package/dist/src/lib/run-status.js +19 -0
- package/dist/src/lib/run-status.js.map +1 -0
- package/dist/src/lib/server-text-normalization.d.ts +51 -0
- package/dist/src/lib/server-text-normalization.js +90 -0
- package/dist/src/lib/server-text-normalization.js.map +1 -0
- package/dist/src/lib/server-url.d.ts +22 -0
- package/dist/src/lib/server-url.js +33 -0
- package/dist/src/lib/server-url.js.map +1 -0
- package/dist/src/lib/signing-secret-status.d.ts +81 -0
- package/dist/src/lib/signing-secret-status.js +116 -0
- package/dist/src/lib/signing-secret-status.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +71 -0
- package/dist/src/lib/skill-installer.js +441 -0
- package/dist/src/lib/skill-installer.js.map +1 -0
- package/dist/src/lib/snapshot-audit-source.d.ts +45 -0
- package/dist/src/lib/snapshot-audit-source.js +58 -0
- package/dist/src/lib/snapshot-audit-source.js.map +1 -0
- package/dist/src/lib/snapshot-audit-store.d.ts +52 -0
- package/dist/src/lib/snapshot-audit-store.js +196 -0
- package/dist/src/lib/snapshot-audit-store.js.map +1 -0
- package/dist/src/lib/snapshot-audit.d.ts +207 -0
- package/dist/src/lib/snapshot-audit.js +431 -0
- package/dist/src/lib/snapshot-audit.js.map +1 -0
- package/dist/src/lib/snapshot-build-rows.d.ts +60 -0
- package/dist/src/lib/snapshot-build-rows.js +87 -0
- package/dist/src/lib/snapshot-build-rows.js.map +1 -0
- package/dist/src/lib/snapshot-build.d.ts +50 -0
- package/dist/src/lib/snapshot-build.js +111 -0
- package/dist/src/lib/snapshot-build.js.map +1 -0
- package/dist/src/lib/snapshot-manifest-layout.d.ts +61 -0
- package/dist/src/lib/snapshot-manifest-layout.js +70 -0
- package/dist/src/lib/snapshot-manifest-layout.js.map +1 -0
- package/dist/src/lib/snapshots.d.ts +98 -0
- package/dist/src/lib/snapshots.js +294 -0
- package/dist/src/lib/snapshots.js.map +1 -0
- package/dist/src/lib/step-run-table.d.ts +43 -0
- package/dist/src/lib/step-run-table.js +129 -0
- package/dist/src/lib/step-run-table.js.map +1 -0
- package/dist/src/lib/storage-pending-retry.d.ts +26 -0
- package/dist/src/lib/storage-pending-retry.js +42 -0
- package/dist/src/lib/storage-pending-retry.js.map +1 -0
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +42 -0
- package/dist/src/lib/swift-codegen/agentGenerator.js +118 -0
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/banners.d.ts +24 -0
- package/dist/src/lib/swift-codegen/banners.js +25 -0
- package/dist/src/lib/swift-codegen/banners.js.map +1 -0
- package/dist/src/lib/swift-codegen/dbGenerator.d.ts +113 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js +926 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.d.ts +42 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.js +100 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.js.map +1 -0
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +139 -0
- package/dist/src/lib/swift-codegen/functionGenerator.js +462 -0
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/generator.d.ts +100 -0
- package/dist/src/lib/swift-codegen/generator.js +457 -0
- package/dist/src/lib/swift-codegen/generator.js.map +1 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +87 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js +661 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.d.ts +94 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.js +155 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.js.map +1 -0
- package/dist/src/lib/swift-codegen/swiftNaming.d.ts +85 -0
- package/dist/src/lib/swift-codegen/swiftNaming.js +198 -0
- package/dist/src/lib/swift-codegen/swiftNaming.js.map +1 -0
- package/dist/src/lib/sync-dir-selector.d.ts +21 -0
- package/dist/src/lib/sync-dir-selector.js +30 -0
- package/dist/src/lib/sync-dir-selector.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +128 -0
- package/dist/src/lib/sync-paths.js +195 -0
- package/dist/src/lib/sync-paths.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +563 -0
- package/dist/src/lib/sync-resource-types.js +1073 -0
- package/dist/src/lib/sync-resource-types.js.map +1 -0
- package/dist/src/lib/sync-selectors.d.ts +138 -0
- package/dist/src/lib/sync-selectors.js +289 -0
- package/dist/src/lib/sync-selectors.js.map +1 -0
- package/dist/src/lib/template.d.ts +170 -0
- package/dist/src/lib/template.js +484 -68
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/lib/test-case-file-names.d.ts +40 -0
- package/dist/src/lib/test-case-file-names.js +91 -0
- package/dist/src/lib/test-case-file-names.js.map +1 -0
- package/dist/src/lib/test-case-keys.d.ts +29 -0
- package/dist/src/lib/test-case-keys.js +55 -0
- package/dist/src/lib/test-case-keys.js.map +1 -0
- package/dist/src/lib/test-case-variables.d.ts +29 -0
- package/dist/src/lib/test-case-variables.js +71 -0
- package/dist/src/lib/test-case-variables.js.map +1 -0
- package/dist/src/lib/token-inject.d.ts +56 -0
- package/dist/src/lib/token-inject.js +204 -0
- package/dist/src/lib/token-inject.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +123 -0
- package/dist/src/lib/toml-database-config.js +544 -0
- package/dist/src/lib/toml-database-config.js.map +1 -0
- package/dist/src/lib/toml-metadata-config.d.ts +151 -0
- package/dist/src/lib/toml-metadata-config.js +476 -0
- package/dist/src/lib/toml-metadata-config.js.map +1 -0
- package/dist/src/lib/toml-native-form.d.ts +46 -0
- package/dist/src/lib/toml-native-form.js +78 -0
- package/dist/src/lib/toml-native-form.js.map +1 -0
- package/dist/src/lib/toml-params-validator.d.ts +129 -0
- package/dist/src/lib/toml-params-validator.js +298 -0
- package/dist/src/lib/toml-params-validator.js.map +1 -0
- package/dist/src/lib/toml-scalar-edit.d.ts +43 -0
- package/dist/src/lib/toml-scalar-edit.js +283 -0
- package/dist/src/lib/toml-scalar-edit.js.map +1 -0
- package/dist/src/lib/user-selector.d.ts +24 -0
- package/dist/src/lib/user-selector.js +33 -0
- package/dist/src/lib/user-selector.js.map +1 -0
- package/dist/src/lib/version-check.d.ts +35 -0
- package/dist/src/lib/version-check.js +241 -0
- package/dist/src/lib/version-check.js.map +1 -0
- package/dist/src/lib/watch.d.ts +121 -0
- package/dist/src/lib/watch.js +169 -0
- package/dist/src/lib/watch.js.map +1 -0
- package/dist/src/lib/web-url.d.ts +40 -0
- package/dist/src/lib/web-url.js +76 -0
- package/dist/src/lib/web-url.js.map +1 -0
- package/dist/src/lib/webhook-deliver.d.ts +209 -0
- package/dist/src/lib/webhook-deliver.js +519 -0
- package/dist/src/lib/webhook-deliver.js.map +1 -0
- package/dist/src/lib/workflow-apply.d.ts +110 -0
- package/dist/src/lib/workflow-apply.js +164 -0
- package/dist/src/lib/workflow-apply.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.d.ts +129 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js +269 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generator.d.ts +96 -0
- package/dist/src/lib/workflow-codegen/generator.js +361 -0
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -0
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +94 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js +76 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -0
- package/dist/src/lib/workflow-codegen/naming.d.ts +33 -0
- package/dist/src/lib/workflow-codegen/naming.js +81 -0
- package/dist/src/lib/workflow-codegen/naming.js.map +1 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.d.ts +80 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.js +303 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/workflow-config-apply.d.ts +70 -0
- package/dist/src/lib/workflow-config-apply.js +137 -0
- package/dist/src/lib/workflow-config-apply.js.map +1 -0
- package/dist/src/lib/workflow-config-sidecar.d.ts +63 -0
- package/dist/src/lib/workflow-config-sidecar.js +96 -0
- package/dist/src/lib/workflow-config-sidecar.js.map +1 -0
- package/dist/src/lib/workflow-defaults.d.ts +29 -0
- package/dist/src/lib/workflow-defaults.js +41 -0
- package/dist/src/lib/workflow-defaults.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/lib/workflow-fragments.d.ts +64 -0
- package/dist/src/lib/workflow-fragments.js +342 -0
- package/dist/src/lib/workflow-fragments.js.map +1 -0
- package/dist/src/lib/workflow-include-preserve.d.ts +76 -0
- package/dist/src/lib/workflow-include-preserve.js +286 -0
- package/dist/src/lib/workflow-include-preserve.js.map +1 -0
- package/dist/src/lib/workflow-payload.d.ts +98 -0
- package/dist/src/lib/workflow-payload.js +178 -0
- package/dist/src/lib/workflow-payload.js.map +1 -0
- package/dist/src/lib/workflow-toml-validator.d.ts +211 -0
- package/dist/src/lib/workflow-toml-validator.js +770 -0
- package/dist/src/lib/workflow-toml-validator.js.map +1 -0
- package/dist/src/lib/workflow-usage.d.ts +196 -0
- package/dist/src/lib/workflow-usage.js +310 -0
- package/dist/src/lib/workflow-usage.js.map +1 -0
- package/dist/src/types/index.d.ts +591 -0
- package/dist/src/validators.d.ts +65 -0
- package/dist/src/validators.js +64 -0
- package/dist/src/validators.js.map +1 -0
- package/package.json +34 -9
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "fs";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
import { parseConfigToml } from "./config-toml.js";
|
|
4
|
+
import { PROJECT_CONFIG_DISPLAY_NAME } from "./project-config.js";
|
|
5
|
+
import { parsePlatformList } from "./resolve-platform.js";
|
|
6
|
+
import { validateServerUrl } from "./server-url.js";
|
|
7
|
+
export const INIT_CONFIG_FILENAME = ".primitive-init.toml";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the "use an existing app" app id from the two places it can be
|
|
10
|
+
* specified: the `--use-existing-app-id` CLI flag (highest precedence) or an
|
|
11
|
+
* init-config TOML with `action = "use-existing"` + `app_id`.
|
|
12
|
+
*
|
|
13
|
+
* Before this existed, `init` only read the flag, so a `use-existing` TOML fell
|
|
14
|
+
* through to the create-app branch and interactively prompted for an app name —
|
|
15
|
+
* hanging non-interactive (`--config`) runs. (See js-bao-wss #1217.)
|
|
16
|
+
*
|
|
17
|
+
* Returns `undefined` when neither source selects an existing app (i.e. the run
|
|
18
|
+
* should create a new app).
|
|
19
|
+
*/
|
|
20
|
+
export function resolveUseExistingAppId(flag, initConfig) {
|
|
21
|
+
if (flag)
|
|
22
|
+
return flag;
|
|
23
|
+
if (initConfig?.action === "use-existing")
|
|
24
|
+
return initConfig.app_id;
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Resolves whether `primitive init` skips the dependency install, from the two
|
|
29
|
+
* places it can be requested: the `--skip-install` flag (highest precedence)
|
|
30
|
+
* or `skip_install = true` in the init-config TOML.
|
|
31
|
+
*
|
|
32
|
+
* `init` used to read only the flag, so a config's `skip_install` was silently
|
|
33
|
+
* ignored and CI runs installed anyway (#2720). Precedence matches #2376's
|
|
34
|
+
* `server` fix: the flag wins. Because `--skip-install` is a boolean flag it
|
|
35
|
+
* can only ever request a skip, so an explicit `skip_install = false` in the
|
|
36
|
+
* config cannot un-skip a run that passed the flag.
|
|
37
|
+
*/
|
|
38
|
+
export function resolveSkipInstall(flag, initConfig) {
|
|
39
|
+
if (flag)
|
|
40
|
+
return { skipInstall: true, source: "flag" };
|
|
41
|
+
// Strict `=== true`: a non-boolean that slipped past validation must not
|
|
42
|
+
// skip the install by truthiness (`skip_install = "false"` reads as a skip).
|
|
43
|
+
if (initConfig?.skip_install === true) {
|
|
44
|
+
return { skipInstall: true, source: "config" };
|
|
45
|
+
}
|
|
46
|
+
return { skipInstall: false, source: "default" };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Parses a TOML string into an InitConfig object.
|
|
50
|
+
* Throws if the string contains invalid TOML.
|
|
51
|
+
*/
|
|
52
|
+
export function parseInitConfigToml(content) {
|
|
53
|
+
const parsed = parseConfigToml(content);
|
|
54
|
+
// The cast is safe because validateInitConfig() is always called after parsing
|
|
55
|
+
return parsed;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Loads and parses a .primitive-init.toml file from the given directory.
|
|
59
|
+
* Returns null if the file does not exist.
|
|
60
|
+
* Throws if the file exists but contains invalid TOML.
|
|
61
|
+
*/
|
|
62
|
+
export function loadInitConfig(dir) {
|
|
63
|
+
const configPath = join(dir, INIT_CONFIG_FILENAME);
|
|
64
|
+
if (!existsSync(configPath)) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const content = readFileSync(configPath, "utf-8");
|
|
68
|
+
return parseInitConfigToml(content);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Validates an InitConfig object. Returns a ValidationResult with any errors.
|
|
72
|
+
*/
|
|
73
|
+
export function validateInitConfig(config) {
|
|
74
|
+
const errors = [];
|
|
75
|
+
// action is required
|
|
76
|
+
const ACTIONS = ["create", "use-existing", "add-client"];
|
|
77
|
+
if (!config.action) {
|
|
78
|
+
errors.push(`Missing required field: "action" (must be ${ACTIONS.map((a) => `"${a}"`).join(", ")})`);
|
|
79
|
+
}
|
|
80
|
+
else if (!ACTIONS.includes(config.action)) {
|
|
81
|
+
errors.push(`"action" must be ${ACTIONS.map((a) => `"${a}"`).join(", ")}`);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Validate action-specific required fields
|
|
85
|
+
if (config.action === "create" && !config.app_name) {
|
|
86
|
+
errors.push('"app_name" is required when action is "create"');
|
|
87
|
+
}
|
|
88
|
+
if (config.action === "use-existing" && !config.app_id) {
|
|
89
|
+
errors.push('"app_id" is required when action is "use-existing"');
|
|
90
|
+
}
|
|
91
|
+
// `add-client` takes its app — and therefore its access mode and its
|
|
92
|
+
// invitations — from the environment it adopts. Naming any of them here
|
|
93
|
+
// would describe a second app this run is not allowed to touch.
|
|
94
|
+
if (config.action === "add-client") {
|
|
95
|
+
for (const key of [
|
|
96
|
+
"app_name",
|
|
97
|
+
"app_id",
|
|
98
|
+
"access_mode",
|
|
99
|
+
"invite_emails",
|
|
100
|
+
"allowed_domains",
|
|
101
|
+
]) {
|
|
102
|
+
const value = config[key];
|
|
103
|
+
const present = Array.isArray(value) ? value.length > 0 : value !== undefined;
|
|
104
|
+
if (present) {
|
|
105
|
+
errors.push(`"${key}" is not allowed with action = "add-client": the app comes from the selected environment of the existing ${PROJECT_CONFIG_DISPLAY_NAME}.`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Validate access_mode if provided
|
|
111
|
+
if (config.access_mode) {
|
|
112
|
+
const validModes = ["public", "domain", "invite-only"];
|
|
113
|
+
if (!validModes.includes(config.access_mode)) {
|
|
114
|
+
errors.push('"access_mode" must be "public", "domain", or "invite-only"');
|
|
115
|
+
}
|
|
116
|
+
else if (config.access_mode === "domain" && (!config.allowed_domains || config.allowed_domains.length === 0)) {
|
|
117
|
+
errors.push('"allowed_domains" is required when access_mode is "domain"');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Validate platform if provided. A string or an array of strings; only "web"
|
|
121
|
+
// and "ios" are supported (`macos` is intentionally rejected until the macOS
|
|
122
|
+
// template is ready), and each may be named once (#2890).
|
|
123
|
+
if (config.platform !== undefined) {
|
|
124
|
+
if (typeof config.platform !== "string" && !Array.isArray(config.platform)) {
|
|
125
|
+
errors.push('"platform" must be a string or an array of strings');
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
const parsed = parsePlatformList(config.platform);
|
|
129
|
+
if (!parsed.ok)
|
|
130
|
+
errors.push(`"platform": ${parsed.error}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// `promote_schema` is consent for a move that only the add-client path can
|
|
134
|
+
// make; anywhere else it would silently do nothing.
|
|
135
|
+
if (config.promote_schema !== undefined) {
|
|
136
|
+
if (typeof config.promote_schema !== "boolean") {
|
|
137
|
+
errors.push('"promote_schema" must be a boolean (true or false)');
|
|
138
|
+
}
|
|
139
|
+
else if (config.action !== "add-client") {
|
|
140
|
+
errors.push('"promote_schema" is only valid with action = "add-client"');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Validate server if provided. An unusable value must fail here rather than
|
|
144
|
+
// fall through to the current server, which is how #2376 went unnoticed.
|
|
145
|
+
if (config.server !== undefined) {
|
|
146
|
+
const serverValidation = validateServerUrl(config.server);
|
|
147
|
+
if (serverValidation !== true) {
|
|
148
|
+
errors.push(`"server" must be a valid URL (e.g., https://primitiveapi.com): ${serverValidation}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Validate skip_install if provided. The TOML is cast to InitConfig without
|
|
152
|
+
// runtime narrowing, so a non-boolean has to be rejected here rather than
|
|
153
|
+
// reach the resolver, where anything truthy would skip the install.
|
|
154
|
+
if (config.skip_install !== undefined && typeof config.skip_install !== "boolean") {
|
|
155
|
+
errors.push('"skip_install" must be a boolean (true or false)');
|
|
156
|
+
}
|
|
157
|
+
// Validate dev_port if provided
|
|
158
|
+
if (config.dev_port !== undefined) {
|
|
159
|
+
if (typeof config.dev_port !== "number" || !Number.isInteger(config.dev_port) || config.dev_port < 1 || config.dev_port > 65535) {
|
|
160
|
+
errors.push('"dev_port" must be an integer between 1 and 65535');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Validate invite_emails format if provided
|
|
164
|
+
if (config.invite_emails && Array.isArray(config.invite_emails)) {
|
|
165
|
+
for (const email of config.invite_emails) {
|
|
166
|
+
if (!email.includes("@")) {
|
|
167
|
+
errors.push(`Invalid email in invite_emails: "${email}"`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Warn about fields ignored for use-existing action
|
|
172
|
+
if (config.action === "use-existing") {
|
|
173
|
+
const ignoredFields = [];
|
|
174
|
+
if (config.access_mode)
|
|
175
|
+
ignoredFields.push("access_mode");
|
|
176
|
+
if (config.invite_emails && config.invite_emails.length > 0)
|
|
177
|
+
ignoredFields.push("invite_emails");
|
|
178
|
+
if (config.allowed_domains && config.allowed_domains.length > 0)
|
|
179
|
+
ignoredFields.push("allowed_domains");
|
|
180
|
+
if (ignoredFields.length > 0) {
|
|
181
|
+
errors.push(`The following fields are ignored when action is "use-existing": ${ignoredFields.join(", ")}. Remove them to avoid confusion.`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return { valid: errors.length === 0, errors };
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=init-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-config.js","sourceRoot":"","sources":["../../../src/lib/init-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,CAAC,MA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C,aAAa,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QAChE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACzC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,MAAM,CAAC,IAAI,CAAC,oCAAoC,KAAK,GAAG,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;IAED,oDAAoD;IACpD,IAAI,MAAM,CAAC,MAAM,KAAK,cAAc,EAAE,CAAC;QACrC,MAAM,aAAa,GAAa,EAAE,CAAC;QACnC,IAAI,MAAM,CAAC,WAAW;YAAE,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1D,IAAI,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;YAAE,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACjG,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;YAAE,aAAa,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACvG,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,mEAAmE,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAC9I,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether init may add a sign-in callback to an app's magic-link allow-list,
|
|
3
|
+
* and what to write (#2982).
|
|
4
|
+
*
|
|
5
|
+
* A combined iOS + web app emails ONE https link — the web app's
|
|
6
|
+
* `/oauth/callback` — and the server matches that target against
|
|
7
|
+
* `emailRedirectUris` fail-closed. So init only points an environment's
|
|
8
|
+
* `webUrl` at a dev origin whose callback the app actually allows; otherwise it
|
|
9
|
+
* would flip a working code-only email into a request that 400s.
|
|
10
|
+
*
|
|
11
|
+
* A brand-new app is seeded with `http://localhost:5173/oauth/callback` at
|
|
12
|
+
* creation, and the dev-port step merges the chosen port's callback — but an
|
|
13
|
+
* app adopted with `--use-existing-app-id` on the default port has been through
|
|
14
|
+
* neither, and its allow-list is whatever it already was.
|
|
15
|
+
*
|
|
16
|
+
* The one thing this must never do is NARROW that list. An app with no
|
|
17
|
+
* `emailRedirectUris` attribute still behaves by the pre-#2891 app-wide
|
|
18
|
+
* `redirectUris`, and writing a fresh single-entry list would silently replace
|
|
19
|
+
* that fallback with our callback — breaking magic-link sign-in for whichever
|
|
20
|
+
* client was relying on it. An explicitly empty list is a deliberate "reject
|
|
21
|
+
* everything" for the same reason. Both are left alone, and init falls back to
|
|
22
|
+
* printing the manual step.
|
|
23
|
+
*/
|
|
24
|
+
export type EmailRedirectUriMerge = {
|
|
25
|
+
action: "already-listed";
|
|
26
|
+
} | {
|
|
27
|
+
action: "merge";
|
|
28
|
+
uris: string[];
|
|
29
|
+
} | {
|
|
30
|
+
action: "leave-alone";
|
|
31
|
+
reason: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Decide what to do with `existing` (the app's `emailRedirectUris` as the
|
|
35
|
+
* settings API reports it) to make `callbackUri` an allowed target.
|
|
36
|
+
*/
|
|
37
|
+
export declare function planEmailRedirectUriMerge(existing: unknown, callbackUri: string): EmailRedirectUriMerge;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether init may add a sign-in callback to an app's magic-link allow-list,
|
|
3
|
+
* and what to write (#2982).
|
|
4
|
+
*
|
|
5
|
+
* A combined iOS + web app emails ONE https link — the web app's
|
|
6
|
+
* `/oauth/callback` — and the server matches that target against
|
|
7
|
+
* `emailRedirectUris` fail-closed. So init only points an environment's
|
|
8
|
+
* `webUrl` at a dev origin whose callback the app actually allows; otherwise it
|
|
9
|
+
* would flip a working code-only email into a request that 400s.
|
|
10
|
+
*
|
|
11
|
+
* A brand-new app is seeded with `http://localhost:5173/oauth/callback` at
|
|
12
|
+
* creation, and the dev-port step merges the chosen port's callback — but an
|
|
13
|
+
* app adopted with `--use-existing-app-id` on the default port has been through
|
|
14
|
+
* neither, and its allow-list is whatever it already was.
|
|
15
|
+
*
|
|
16
|
+
* The one thing this must never do is NARROW that list. An app with no
|
|
17
|
+
* `emailRedirectUris` attribute still behaves by the pre-#2891 app-wide
|
|
18
|
+
* `redirectUris`, and writing a fresh single-entry list would silently replace
|
|
19
|
+
* that fallback with our callback — breaking magic-link sign-in for whichever
|
|
20
|
+
* client was relying on it. An explicitly empty list is a deliberate "reject
|
|
21
|
+
* everything" for the same reason. Both are left alone, and init falls back to
|
|
22
|
+
* printing the manual step.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Decide what to do with `existing` (the app's `emailRedirectUris` as the
|
|
26
|
+
* settings API reports it) to make `callbackUri` an allowed target.
|
|
27
|
+
*/
|
|
28
|
+
export function planEmailRedirectUriMerge(existing, callbackUri) {
|
|
29
|
+
if (!Array.isArray(existing)) {
|
|
30
|
+
return {
|
|
31
|
+
action: "leave-alone",
|
|
32
|
+
reason: "this app has no emailRedirectUris list of its own, and writing one would replace the allow-list it behaves by today",
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const uris = existing.filter((value) => typeof value === "string");
|
|
36
|
+
if (uris.length === 0) {
|
|
37
|
+
return {
|
|
38
|
+
action: "leave-alone",
|
|
39
|
+
reason: "this app's emailRedirectUris list is empty, which is a deliberate 'reject every link target'",
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (uris.includes(callbackUri))
|
|
43
|
+
return { action: "already-listed" };
|
|
44
|
+
return { action: "merge", uris: [...uris, callbackUri] };
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=init-email-redirect-uris.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-email-redirect-uris.js","sourceRoot":"","sources":["../../../src/lib/init-email-redirect-uris.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAAiB,EACjB,WAAmB;IAEnB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,MAAM,EACJ,qHAAqH;SACxH,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;IACpF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,MAAM,EACJ,8FAA8F;SACjG,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IACpE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `CFBundleURLName` the library and the template agree on. Changing it
|
|
3
|
+
* breaks the manager's scheme resolution, so it is pinned by a test that reads
|
|
4
|
+
* both files.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PRIMITIVE_AUTH_URL_TYPE_NAME = "PrimitiveAuth";
|
|
7
|
+
/** The library's fallback scheme — reserved, never a derived result. */
|
|
8
|
+
export declare const FALLBACK_CALLBACK_SCHEME = "primitiveapp";
|
|
9
|
+
/**
|
|
10
|
+
* The custom URL scheme for one scaffolded client: a readable prefix from the
|
|
11
|
+
* app name, then the full lowercased app ID.
|
|
12
|
+
*
|
|
13
|
+
* Deterministic and injective over server-generated app IDs — two apps never
|
|
14
|
+
* share a scheme, whatever they are called.
|
|
15
|
+
*/
|
|
16
|
+
export declare function deriveCallbackScheme(appName: string, appId: string, clientDirName?: string): string;
|
|
17
|
+
/** The redirect target the emailed sign-in link uses, for one scheme. */
|
|
18
|
+
export declare function iosMagicLinkRedirectUri(scheme: string): string;
|
|
19
|
+
export interface StampResult {
|
|
20
|
+
/** `not-found` when the plist predates the `PrimitiveAuth` URL type. */
|
|
21
|
+
outcome: "stamped" | "already" | "not-found";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Replaces the scheme registered under the `PrimitiveAuth` URL type in a
|
|
25
|
+
* scaffolded client's `Info-Partial.plist`.
|
|
26
|
+
*
|
|
27
|
+
* A targeted text substitution, not a plist rewrite: the file's comments are
|
|
28
|
+
* the checklist a developer reads when their emailed link does nothing, and a
|
|
29
|
+
* serializer would drop them.
|
|
30
|
+
*/
|
|
31
|
+
export declare function stampCallbackScheme(clientDir: string, scheme: string): StampResult;
|
|
32
|
+
/**
|
|
33
|
+
* How to point an environment at the app's web origin — in the shape that
|
|
34
|
+
* actually works (#2982).
|
|
35
|
+
*
|
|
36
|
+
* `primitive env add` CREATES an environment: it requires `--api-url` and
|
|
37
|
+
* `--app-id` (#3152), and refuses a name the config already has. Every
|
|
38
|
+
* environment anyone reads this about already exists (init wrote `dev`; `prod`
|
|
39
|
+
* was added when the app was deployed), so the instruction for those has to be
|
|
40
|
+
* the file, which is also what the docs describe as the way to edit one. The
|
|
41
|
+
* flag is worth naming only where a new environment is being created — and
|
|
42
|
+
* there it is shown with the flags the command will refuse to run without.
|
|
43
|
+
*
|
|
44
|
+
* `origin` is the placeholder or real origin to show.
|
|
45
|
+
*/
|
|
46
|
+
export declare function setWebUrlInstruction(origin: string, indent?: string): string[];
|
|
47
|
+
/**
|
|
48
|
+
* What init prints about email sign-in on the iOS path: it already works, and
|
|
49
|
+
* this is the one opt-in that adds the link.
|
|
50
|
+
*
|
|
51
|
+
* The allow-list step is phrased as a MERGE into the existing array — `app.toml`
|
|
52
|
+
* is the whole app-settings truth on push (#2880), so a replacement array would
|
|
53
|
+
* silently drop the web callback the app was seeded with.
|
|
54
|
+
*
|
|
55
|
+
* `registered` is false when the scheme could not be stamped (an older template
|
|
56
|
+
* with no `PrimitiveAuth` URL type). The allow-list entry and the flag are the
|
|
57
|
+
* same either way, but the closing line must not claim a registration that is
|
|
58
|
+
* not there: a developer who did only the two steps would be left with a dead
|
|
59
|
+
* tap and nothing naming the missing piece.
|
|
60
|
+
*/
|
|
61
|
+
export declare function linkOptInGuidance(scheme: string, options?: {
|
|
62
|
+
registered?: boolean;
|
|
63
|
+
}): string[];
|
|
64
|
+
/**
|
|
65
|
+
* What init prints for an app with BOTH clients: the emailed sign-in link is
|
|
66
|
+
* already the web app's https callback, and this is what it takes to make that
|
|
67
|
+
* link open the iOS app in production (#2982).
|
|
68
|
+
*
|
|
69
|
+
* Everything here is a post-deploy step by necessity — the production web
|
|
70
|
+
* domain does not exist at init time, and the deploy script never learns the
|
|
71
|
+
* URL it deployed to. The order is load-bearing: the `applinks:` entitlement
|
|
72
|
+
* is the ONLY thing that makes Apple fetch the association document, and
|
|
73
|
+
* Apple's CDN caches what it gets, so it goes last — after the deployed
|
|
74
|
+
* document has been verified.
|
|
75
|
+
*
|
|
76
|
+
* `webOrigin` is the dev origin the run seeded — set only when the run also
|
|
77
|
+
* confirmed that origin's `/oauth/callback` is on the app's allow-list, since
|
|
78
|
+
* that is what makes the seeded link work.
|
|
79
|
+
*
|
|
80
|
+
* `unverifiedDevCallback` is the opposite case: a combined app whose allow-list
|
|
81
|
+
* this run could not vouch for (an adopted app, or no credentials to ask with).
|
|
82
|
+
* Nothing was seeded — the app keeps its working code-only email — and the two
|
|
83
|
+
* steps that turn the link on are printed instead. Neither is set for an
|
|
84
|
+
* adopting run, which does not own the project config at all.
|
|
85
|
+
*/
|
|
86
|
+
export declare function universalLinkGuidance(options?: {
|
|
87
|
+
webOrigin?: string;
|
|
88
|
+
unverifiedDevCallback?: string;
|
|
89
|
+
}): string[];
|
|
90
|
+
/** What init says when the template predates the `PrimitiveAuth` URL type. */
|
|
91
|
+
export declare function missingUrlTypeGuidance(scheme: string): string[];
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The iOS app's own URL scheme, and the documented opt-in that turns the
|
|
3
|
+
* sign-in email's LINK on (#2969).
|
|
4
|
+
*
|
|
5
|
+
* The Swift template registers one custom URL scheme, under the
|
|
6
|
+
* `PrimitiveAuth` URL-type name that `PrimitiveAuthManager` reads its callback
|
|
7
|
+
* scheme from. Shipped, that scheme is `primitiveapp` — which every app
|
|
8
|
+
* scaffolded from the template would otherwise share, making iOS link routing
|
|
9
|
+
* between two of them on one device ambiguous. So init stamps an app-unique
|
|
10
|
+
* scheme in its place.
|
|
11
|
+
*
|
|
12
|
+
* The suffix is the WHOLE app ID, not a tail or a hash of it: app IDs are
|
|
13
|
+
* 26-character ULIDs, and any fixed-width squeeze of them is many-to-one — two
|
|
14
|
+
* distinct apps could still be handed the same scheme, which is the failure
|
|
15
|
+
* this stamping exists to prevent.
|
|
16
|
+
*
|
|
17
|
+
* Init writes no app settings here. Email sign-in works out of the box because
|
|
18
|
+
* the manager sends NO redirect target by default, so the email carries the
|
|
19
|
+
* code alone and the allow-list is not consulted at all. Sending the link is
|
|
20
|
+
* the developer's opt-in — one allow-list entry plus one flag — and init only
|
|
21
|
+
* prints what those are.
|
|
22
|
+
*/
|
|
23
|
+
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
24
|
+
import { join } from "path";
|
|
25
|
+
/**
|
|
26
|
+
* The `CFBundleURLName` the library and the template agree on. Changing it
|
|
27
|
+
* breaks the manager's scheme resolution, so it is pinned by a test that reads
|
|
28
|
+
* both files.
|
|
29
|
+
*/
|
|
30
|
+
export const PRIMITIVE_AUTH_URL_TYPE_NAME = "PrimitiveAuth";
|
|
31
|
+
/** The library's fallback scheme — reserved, never a derived result. */
|
|
32
|
+
export const FALLBACK_CALLBACK_SCHEME = "primitiveapp";
|
|
33
|
+
/** How much of the app name survives into the readable prefix. */
|
|
34
|
+
const PREFIX_MAX_LENGTH = 20;
|
|
35
|
+
/** The app-name placeholder init carries when it never asked for one. */
|
|
36
|
+
const APP_NAME_PLACEHOLDER = "(existing app)";
|
|
37
|
+
/**
|
|
38
|
+
* A URL-scheme-safe, letter-first fragment of `value`, or `""` when nothing
|
|
39
|
+
* usable survives (an empty name, an emoji-only one, digits alone).
|
|
40
|
+
*/
|
|
41
|
+
function schemeFragment(value, maxLength) {
|
|
42
|
+
const sanitized = (value ?? "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
43
|
+
// RFC 3986 schemes start with a letter, and the prefix is what leads.
|
|
44
|
+
const letterFirst = sanitized.replace(/^[0-9]+/, "");
|
|
45
|
+
return letterFirst.slice(0, maxLength);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The custom URL scheme for one scaffolded client: a readable prefix from the
|
|
49
|
+
* app name, then the full lowercased app ID.
|
|
50
|
+
*
|
|
51
|
+
* Deterministic and injective over server-generated app IDs — two apps never
|
|
52
|
+
* share a scheme, whatever they are called.
|
|
53
|
+
*/
|
|
54
|
+
export function deriveCallbackScheme(appName, appId, clientDirName) {
|
|
55
|
+
const named = appName === APP_NAME_PLACEHOLDER ? "" : appName;
|
|
56
|
+
const prefix = schemeFragment(named, PREFIX_MAX_LENGTH) ||
|
|
57
|
+
schemeFragment(clientDirName, PREFIX_MAX_LENGTH) ||
|
|
58
|
+
"app";
|
|
59
|
+
// No truncation: the whole ID is what makes the scheme unique.
|
|
60
|
+
const suffix = (appId ?? "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
61
|
+
const scheme = suffix ? `${prefix}-${suffix}` : prefix;
|
|
62
|
+
// Only reachable with no app ID at all, but the reserved scheme is exactly
|
|
63
|
+
// what a derived one must never collide with.
|
|
64
|
+
return scheme === FALLBACK_CALLBACK_SCHEME ? `${scheme}-app` : scheme;
|
|
65
|
+
}
|
|
66
|
+
/** The redirect target the emailed sign-in link uses, for one scheme. */
|
|
67
|
+
export function iosMagicLinkRedirectUri(scheme) {
|
|
68
|
+
return `${scheme}://auth/magic-link`;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Replaces the scheme registered under the `PrimitiveAuth` URL type in a
|
|
72
|
+
* scaffolded client's `Info-Partial.plist`.
|
|
73
|
+
*
|
|
74
|
+
* A targeted text substitution, not a plist rewrite: the file's comments are
|
|
75
|
+
* the checklist a developer reads when their emailed link does nothing, and a
|
|
76
|
+
* serializer would drop them.
|
|
77
|
+
*/
|
|
78
|
+
export function stampCallbackScheme(clientDir, scheme) {
|
|
79
|
+
const plistPath = join(clientDir, "Info-Partial.plist");
|
|
80
|
+
if (!existsSync(plistPath))
|
|
81
|
+
return { outcome: "not-found" };
|
|
82
|
+
let text;
|
|
83
|
+
try {
|
|
84
|
+
text = readFileSync(plistPath, "utf-8");
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return { outcome: "not-found" };
|
|
88
|
+
}
|
|
89
|
+
const marker = `<string>${PRIMITIVE_AUTH_URL_TYPE_NAME}</string>`;
|
|
90
|
+
const markerIndex = text.indexOf(marker);
|
|
91
|
+
if (markerIndex === -1)
|
|
92
|
+
return { outcome: "not-found" };
|
|
93
|
+
// Stay inside the URL-type dict the marker names: an app may register other
|
|
94
|
+
// schemes (a Google reversed client ID, say) and those are not ours to move.
|
|
95
|
+
const dictStart = text.lastIndexOf("<dict>", markerIndex);
|
|
96
|
+
const dictEnd = text.indexOf("</dict>", markerIndex);
|
|
97
|
+
if (dictStart === -1 || dictEnd === -1)
|
|
98
|
+
return { outcome: "not-found" };
|
|
99
|
+
const block = text.slice(dictStart, dictEnd);
|
|
100
|
+
if (!block.includes("<key>CFBundleURLName</key>"))
|
|
101
|
+
return { outcome: "not-found" };
|
|
102
|
+
const schemesPattern = /(<key>CFBundleURLSchemes<\/key>\s*<array>\s*<string>)([^<]*)(<\/string>)/;
|
|
103
|
+
const match = schemesPattern.exec(block);
|
|
104
|
+
if (!match)
|
|
105
|
+
return { outcome: "not-found" };
|
|
106
|
+
if (match[2] === scheme)
|
|
107
|
+
return { outcome: "already" };
|
|
108
|
+
const rewritten = block.replace(schemesPattern, `$1${scheme}$3`);
|
|
109
|
+
writeFileSync(plistPath, text.slice(0, dictStart) + rewritten + text.slice(dictEnd));
|
|
110
|
+
return { outcome: "stamped" };
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* How to point an environment at the app's web origin — in the shape that
|
|
114
|
+
* actually works (#2982).
|
|
115
|
+
*
|
|
116
|
+
* `primitive env add` CREATES an environment: it requires `--api-url` and
|
|
117
|
+
* `--app-id` (#3152), and refuses a name the config already has. Every
|
|
118
|
+
* environment anyone reads this about already exists (init wrote `dev`; `prod`
|
|
119
|
+
* was added when the app was deployed), so the instruction for those has to be
|
|
120
|
+
* the file, which is also what the docs describe as the way to edit one. The
|
|
121
|
+
* flag is worth naming only where a new environment is being created — and
|
|
122
|
+
* there it is shown with the flags the command will refuse to run without.
|
|
123
|
+
*
|
|
124
|
+
* `origin` is the placeholder or real origin to show.
|
|
125
|
+
*/
|
|
126
|
+
export function setWebUrlInstruction(origin, indent = " ") {
|
|
127
|
+
return [
|
|
128
|
+
`${indent}add "webUrl": "${origin}" to that environment in primitive/config.json`,
|
|
129
|
+
`${indent}(\`primitive env add <name> --api-url … --app-id … --web-url <origin>\` does this only for an`,
|
|
130
|
+
`${indent}environment it CREATES — it cannot edit one that already exists).`,
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* What init prints about email sign-in on the iOS path: it already works, and
|
|
135
|
+
* this is the one opt-in that adds the link.
|
|
136
|
+
*
|
|
137
|
+
* The allow-list step is phrased as a MERGE into the existing array — `app.toml`
|
|
138
|
+
* is the whole app-settings truth on push (#2880), so a replacement array would
|
|
139
|
+
* silently drop the web callback the app was seeded with.
|
|
140
|
+
*
|
|
141
|
+
* `registered` is false when the scheme could not be stamped (an older template
|
|
142
|
+
* with no `PrimitiveAuth` URL type). The allow-list entry and the flag are the
|
|
143
|
+
* same either way, but the closing line must not claim a registration that is
|
|
144
|
+
* not there: a developer who did only the two steps would be left with a dead
|
|
145
|
+
* tap and nothing naming the missing piece.
|
|
146
|
+
*/
|
|
147
|
+
export function linkOptInGuidance(scheme, options = {}) {
|
|
148
|
+
const registered = options.registered !== false;
|
|
149
|
+
const redirectUri = iosMagicLinkRedirectUri(scheme);
|
|
150
|
+
return [
|
|
151
|
+
"Email sign-in works now: the email carries a 6-digit code and needs no app settings.",
|
|
152
|
+
"When this app gets a web client, prefer the https link: set the environment's `webUrl` —",
|
|
153
|
+
...setWebUrlInstruction("https://<your-web-domain>"),
|
|
154
|
+
" The email then carries that origin's /oauth/callback instead — one link that opens this",
|
|
155
|
+
" app where it is installed and signs in through the browser anywhere else.",
|
|
156
|
+
`Until then, to ALSO send a sign-in link that opens this app, add "${redirectUri}" to the existing`,
|
|
157
|
+
" [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), then run",
|
|
159
|
+
" `primitive config push --only app` and set `authManager.sendsEmailSignInLink = true`.",
|
|
160
|
+
registered
|
|
161
|
+
? "The scheme registration and the link routing are already in this client."
|
|
162
|
+
: `The scheme "${scheme}" is NOT registered in this client yet — register it first (see`
|
|
163
|
+
+ ` the ${PRIMITIVE_AUTH_URL_TYPE_NAME} warning above), or the link stays a dead tap.`,
|
|
164
|
+
" Full checklist: `primitive guides get authentication --language swift`, or the",
|
|
165
|
+
" authentication.md docs page — 'Make the emailed sign-in link open your app'.",
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* What init prints for an app with BOTH clients: the emailed sign-in link is
|
|
170
|
+
* already the web app's https callback, and this is what it takes to make that
|
|
171
|
+
* link open the iOS app in production (#2982).
|
|
172
|
+
*
|
|
173
|
+
* Everything here is a post-deploy step by necessity — the production web
|
|
174
|
+
* domain does not exist at init time, and the deploy script never learns the
|
|
175
|
+
* URL it deployed to. The order is load-bearing: the `applinks:` entitlement
|
|
176
|
+
* is the ONLY thing that makes Apple fetch the association document, and
|
|
177
|
+
* Apple's CDN caches what it gets, so it goes last — after the deployed
|
|
178
|
+
* document has been verified.
|
|
179
|
+
*
|
|
180
|
+
* `webOrigin` is the dev origin the run seeded — set only when the run also
|
|
181
|
+
* confirmed that origin's `/oauth/callback` is on the app's allow-list, since
|
|
182
|
+
* that is what makes the seeded link work.
|
|
183
|
+
*
|
|
184
|
+
* `unverifiedDevCallback` is the opposite case: a combined app whose allow-list
|
|
185
|
+
* this run could not vouch for (an adopted app, or no credentials to ask with).
|
|
186
|
+
* Nothing was seeded — the app keeps its working code-only email — and the two
|
|
187
|
+
* steps that turn the link on are printed instead. Neither is set for an
|
|
188
|
+
* adopting run, which does not own the project config at all.
|
|
189
|
+
*/
|
|
190
|
+
export function universalLinkGuidance(options = {}) {
|
|
191
|
+
const lines = [
|
|
192
|
+
"This app has both an iOS and a web client, so its sign-in email carries ONE https link:",
|
|
193
|
+
" the web app's /oauth/callback. Tapped where the iOS app is installed it opens the app;",
|
|
194
|
+
" anywhere else it is an ordinary web sign-in. The 6-digit code still works everywhere.",
|
|
195
|
+
];
|
|
196
|
+
if (options.webOrigin) {
|
|
197
|
+
lines.push(`In dev that link is ${options.webOrigin}/oauth/callback — seeded as the environment's`, " `webUrl`, and allow-listed on the app. Nothing to do.");
|
|
198
|
+
}
|
|
199
|
+
else if (options.unverifiedDevCallback) {
|
|
200
|
+
const origin = options.unverifiedDevCallback.replace(/\/oauth\/callback$/, "");
|
|
201
|
+
lines.push("The link is NOT on yet in dev: this app already existed, and its sign-in link allow-list", ` does not (or could not be checked to) carry ${options.unverifiedDevCallback}. Nothing was`, " changed — the email stays code-only, which works. To turn the link on:", ` 1. Merge "${options.unverifiedDevCallback}" into the existing [auth].emailRedirectUris`, " array in config/app.toml (run `primitive config pull --only app` first if that file is", " not there yet), then `primitive config push --only app`.", ` 2. Then ${setWebUrlInstruction(origin, "")[0]}`, " — the same edit the production steps below describe.");
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
lines.push("Set `webUrl` on this app's environment to turn it on (this run did not write the", " project config):", ...setWebUrlInstruction("https://<your-web-domain>"), " Allow-list that origin's /oauth/callback in [auth].emailRedirectUris too.");
|
|
205
|
+
}
|
|
206
|
+
lines.push("For production, once the web app is deployed:", " 1. Set that environment's `webUrl` to the deployed origin —", ...setWebUrlInstruction("https://<your-web-domain>", " "), " 2. Merge \"https://<your-web-domain>/oauth/callback\" into the existing", " [auth].emailRedirectUris array in config/app.toml (run `primitive config pull --only app`", " first if that file is not there yet), then `primitive config push --only app`.", " 3. Add `\"iosAppId\": \"ABCDE12345.com.example.app\"` beside that same environment's `webUrl`", " — the iOS client's Application Identifier Prefix (10 characters, usually your Team ID;", " verify it against the signed app's application-identifier entitlement) and its bundle id", " for THAT environment. `pnpm cf-deploy` generates the apple-app-site-association document", " from it per deploy, so each environment serves its own app id and none serves another's.", " 4. Deploy, then verify: `curl -i https://<your-web-domain>/.well-known/apple-app-site-association`", " must return 200, application/json and the JSON body — HTML means the SPA fallback answered.", " 5. Only then enable the `applinks:<your-web-domain>` entitlement in the iOS client's", " project.yml (it needs a real DEVELOPMENT_TEAM) and reinstall the app.", " Full checklist: the web client's public/.well-known/README.md, or the authentication", " docs page — 'Make the emailed sign-in link open your app'.");
|
|
207
|
+
return lines;
|
|
208
|
+
}
|
|
209
|
+
/** What init says when the template predates the `PrimitiveAuth` URL type. */
|
|
210
|
+
export function missingUrlTypeGuidance(scheme) {
|
|
211
|
+
return [
|
|
212
|
+
`This template's Info-Partial.plist registers no ${PRIMITIVE_AUTH_URL_TYPE_NAME} URL type, so the`,
|
|
213
|
+
` scheme "${scheme}" was not stamped and an emailed sign-in link cannot open this app.`,
|
|
214
|
+
` Add a CFBundleURLTypes entry named ${PRIMITIVE_AUTH_URL_TYPE_NAME} with that scheme, then follow`,
|
|
215
|
+
" the authentication.md docs page — 'Make the emailed sign-in link open your app'",
|
|
216
|
+
" (or `primitive guides get authentication --language swift`).",
|
|
217
|
+
];
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=init-ios-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-ios-links.js","sourceRoot":"","sources":["../../../src/lib/init-ios-links.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAE5D,wEAAwE;AACxE,MAAM,CAAC,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAEvD,kEAAkE;AAClE,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,yEAAyE;AACzE,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,SAAS,cAAc,CAAC,KAAyB,EAAE,SAAiB;IAClE,MAAM,SAAS,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACxE,sEAAsE;IACtE,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACrD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAe,EACf,KAAa,EACb,aAAsB;IAEtB,MAAM,KAAK,GAAG,OAAO,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