primitive-admin 1.0.63 → 1.0.64
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 +132 -42
- package/assets/skill/skills/primitive-platform/SKILL.md +142 -661
- package/dist/bin/primitive.js +121 -41
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.js +37 -50
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/analytics.js +178 -9
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps.js +12 -5
- 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.js +76 -116
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +2 -1
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/catalog.js +26 -10
- package/dist/src/commands/catalog.js.map +1 -1
- package/dist/src/commands/collection-type-configs.js +3 -10
- package/dist/src/commands/collection-type-configs.js.map +1 -1
- package/dist/src/commands/collections.js +736 -19
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/config.js +13 -27
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/connections.js +8 -9
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/cron-triggers.js +2 -1
- package/dist/src/commands/cron-triggers.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +5 -12
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.js +59 -72
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +58 -0
- package/dist/src/commands/documents.js +1623 -95
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +2 -1
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.d.ts +1 -1
- package/dist/src/commands/env.js +89 -43
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/feature-flags.js +2 -1
- package/dist/src/commands/feature-flags.js.map +1 -1
- 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.js +2 -1
- package/dist/src/commands/group-type-configs.js.map +1 -1
- package/dist/src/commands/groups.js +30 -17
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +17 -11
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +12 -15
- package/dist/src/commands/init.js +44 -92
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +35 -12
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/locks.js +17 -2
- package/dist/src/commands/locks.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.js +2 -1
- package/dist/src/commands/metadata-category-configs.js.map +1 -1
- package/dist/src/commands/metadata.js +8 -1
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +106 -59
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.js +3 -10
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/scripts.js +33 -28
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/secrets.js +2 -1
- package/dist/src/commands/secrets.js.map +1 -1
- package/dist/src/commands/sessions.js +10 -9
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/sync-app-settings.js +3 -5
- package/dist/src/commands/sync-app-settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +390 -13
- package/dist/src/commands/sync.js +2613 -451
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +2 -1
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.js +19 -10
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +2 -1
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/waitlist.js +2 -1
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +29 -0
- package/dist/src/commands/webhooks.js +135 -64
- package/dist/src/commands/webhooks.js.map +1 -1
- package/dist/src/commands/workflows.d.ts +1 -29
- package/dist/src/commands/workflows.js +113 -179
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +628 -14
- package/dist/src/lib/api-client.js +776 -70
- 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 +9 -1
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- 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/codegen-shared/resolveCodegenSourceDir.d.ts +24 -54
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +31 -153
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -1
- package/dist/src/lib/collection-export.d.ts +184 -0
- package/dist/src/lib/collection-export.js +252 -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.js +88 -6
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-payload.d.ts +8 -1
- package/dist/src/lib/config-payload.js +49 -4
- package/dist/src/lib/config-payload.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +12 -1
- package/dist/src/lib/config-surface.js +71 -3
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/config.d.ts +31 -13
- package/dist/src/lib/config.js +34 -70
- package/dist/src/lib/config.js.map +1 -1
- package/dist/src/lib/credentials-store.d.ts +37 -22
- package/dist/src/lib/credentials-store.js +103 -97
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js +8 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- 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 +89 -18
- package/dist/src/lib/env-resolver-core.js +145 -23
- package/dist/src/lib/env-resolver-core.js.map +1 -1
- package/dist/src/lib/env-resolver.d.ts +18 -3
- package/dist/src/lib/env-resolver.js +23 -3
- package/dist/src/lib/env-resolver.js.map +1 -1
- 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-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.js +4 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +2332 -78
- package/dist/src/lib/generated-config-surfaces.js +6979 -468
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- 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/init-adopt.js +2 -2
- package/dist/src/lib/init-adopt.js.map +1 -1
- package/dist/src/lib/init-assets.js +3 -3
- package/dist/src/lib/init-config.d.ts +1 -1
- package/dist/src/lib/init-ios-links.d.ts +6 -5
- package/dist/src/lib/init-ios-links.js +9 -8
- package/dist/src/lib/init-ios-links.js.map +1 -1
- package/dist/src/lib/init-plan.d.ts +1 -1
- package/dist/src/lib/init-plan.js +1 -1
- package/dist/src/lib/init-xcode.d.ts +6 -5
- package/dist/src/lib/init-xcode.js +34 -10
- package/dist/src/lib/init-xcode.js.map +1 -1
- 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 +1 -1
- package/dist/src/lib/local-state.js +1 -1
- package/dist/src/lib/local-test-cases.d.ts +1 -1
- package/dist/src/lib/local-test-cases.js +2 -1
- package/dist/src/lib/local-test-cases.js.map +1 -1
- package/dist/src/lib/log-inspection.d.ts +152 -5
- package/dist/src/lib/log-inspection.js +179 -2
- package/dist/src/lib/log-inspection.js.map +1 -1
- 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/output.d.ts +15 -0
- package/dist/src/lib/output.js +28 -0
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/paginate.d.ts +15 -0
- package/dist/src/lib/paginate.js +17 -0
- package/dist/src/lib/paginate.js.map +1 -1
- package/dist/src/lib/project-config.d.ts +38 -21
- package/dist/src/lib/project-config.js +57 -47
- package/dist/src/lib/project-config.js.map +1 -1
- 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/refresh-admin-credentials.d.ts +9 -1
- package/dist/src/lib/refresh-admin-credentials.js +22 -2
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
- 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/skill-installer.d.ts +49 -3
- package/dist/src/lib/skill-installer.js +275 -100
- package/dist/src/lib/skill-installer.js.map +1 -1
- 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 +8 -9
- package/dist/src/lib/snapshots.js +20 -83
- package/dist/src/lib/snapshots.js.map +1 -1
- 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.js +19 -7
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
- 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 +7 -1
- package/dist/src/lib/swift-codegen/generator.js +28 -11
- package/dist/src/lib/swift-codegen/generator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +15 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js +21 -4
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
- package/dist/src/lib/sync-paths.d.ts +72 -55
- package/dist/src/lib/sync-paths.js +97 -100
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/sync-resource-types.d.ts +23 -4
- package/dist/src/lib/sync-resource-types.js +106 -8
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +45 -2
- package/dist/src/lib/sync-selectors.js +66 -5
- package/dist/src/lib/sync-selectors.js.map +1 -1
- package/dist/src/lib/template.d.ts +2 -2
- package/dist/src/lib/template.js +2 -2
- package/dist/src/lib/test-case-keys.d.ts +1 -1
- package/dist/src/lib/test-case-keys.js +1 -1
- package/dist/src/lib/test-case-variables.d.ts +14 -0
- package/dist/src/lib/test-case-variables.js +42 -0
- package/dist/src/lib/test-case-variables.js.map +1 -1
- package/dist/src/lib/toml-database-config.js +19 -2
- package/dist/src/lib/toml-database-config.js.map +1 -1
- 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-codegen/generator.d.ts +1 -1
- package/dist/src/lib/workflow-codegen/generator.js +1 -1
- package/dist/src/lib/workflow-toml-validator.d.ts +17 -8
- package/dist/src/lib/workflow-toml-validator.js +25 -12
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- 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 +12 -2
- package/package.json +5 -4
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* CHECKED IN — that is what Xcode's Run button, a bare `xcodebuild` and a fresh
|
|
7
7
|
* clone all compile. A composed repository moves two files the Xcode build
|
|
8
8
|
* phases declare out of the client: the model schema (up to `models/` at the
|
|
9
|
-
* root) and
|
|
9
|
+
* root) and `primitive/config.json` (which the whole app shares). Rewriting
|
|
10
10
|
* only `project.yml` would leave the shipped project declaring paths that are
|
|
11
11
|
* no longer there — a build input error naming a file, with nothing saying the
|
|
12
12
|
* schema moved — so every rewrite here lands in both places.
|
|
@@ -17,15 +17,38 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { existsSync, readFileSync, readdirSync, writeFileSync } from "fs";
|
|
19
19
|
import { join, relative, sep } from "path";
|
|
20
|
+
import { LOCAL_STATE_FILENAME, PROJECT_CONFIG_FILENAME, PROJECT_LOCAL_STATE_DIR, PROJECT_TREE_DIR, } from "./env-resolver-core.js";
|
|
21
|
+
/**
|
|
22
|
+
* The committed Xcode files that spell a `$(SRCROOT)/`-relative path, beyond
|
|
23
|
+
* the spec and the checked-in project.
|
|
24
|
+
*
|
|
25
|
+
* The codegen phase declares its config-dependent inputs and outputs through
|
|
26
|
+
* these two lists (#3078), refreshed by `scripts/codegen.sh` on every build. A
|
|
27
|
+
* composed client's lists would otherwise ship naming a schema this run just
|
|
28
|
+
* removed — self-healed on the first build, but wrong in the committed tree
|
|
29
|
+
* until then, and invisible to the check that refuses to strand a declaration.
|
|
30
|
+
*/
|
|
31
|
+
const XCODE_FILE_LISTS = [
|
|
32
|
+
join("scripts", "codegen-inputs.xcfilelist"),
|
|
33
|
+
join("scripts", "codegen-outputs.xcfilelist"),
|
|
34
|
+
];
|
|
20
35
|
/** The build phase inputs that name the project config, relative to a client. */
|
|
21
36
|
const PROJECT_CONFIG_INPUTS = [
|
|
22
|
-
join(
|
|
23
|
-
join(
|
|
37
|
+
join(PROJECT_TREE_DIR, PROJECT_CONFIG_FILENAME),
|
|
38
|
+
join(PROJECT_LOCAL_STATE_DIR, LOCAL_STATE_FILENAME),
|
|
24
39
|
];
|
|
25
40
|
/** A POSIX-style path from `fromDir` to `toPath`, for a build-setting string. */
|
|
26
41
|
function posixRelative(fromDir, toPath) {
|
|
27
42
|
return relative(fromDir, toPath).split(sep).join("/");
|
|
28
43
|
}
|
|
44
|
+
/** Every file in `clientDir` that can declare a `$(SRCROOT)/`-relative path. */
|
|
45
|
+
function declaringFiles(clientDir) {
|
|
46
|
+
return [
|
|
47
|
+
join(clientDir, "project.yml"),
|
|
48
|
+
...findPbxprojFiles(clientDir),
|
|
49
|
+
...XCODE_FILE_LISTS.map((rel) => join(clientDir, rel)),
|
|
50
|
+
];
|
|
51
|
+
}
|
|
29
52
|
/** Every checked-in `project.pbxproj` beside the client's sources. */
|
|
30
53
|
function findPbxprojFiles(clientDir) {
|
|
31
54
|
let entries;
|
|
@@ -41,9 +64,10 @@ function findPbxprojFiles(clientDir) {
|
|
|
41
64
|
.filter((path) => existsSync(path));
|
|
42
65
|
}
|
|
43
66
|
/**
|
|
44
|
-
* Retargets one `$(SRCROOT)`-relative build-phase path, in `project.yml
|
|
45
|
-
* every checked-in Xcode project
|
|
46
|
-
*
|
|
67
|
+
* Retargets one `$(SRCROOT)`-relative build-phase path, in `project.yml`, in
|
|
68
|
+
* every checked-in Xcode project, and in the committed codegen file lists. They
|
|
69
|
+
* all spell the path the same way, so one literal substitution covers the
|
|
70
|
+
* declared inputs and outputs alike.
|
|
47
71
|
*
|
|
48
72
|
* Returns the files it rewrote.
|
|
49
73
|
*/
|
|
@@ -53,7 +77,7 @@ export function retargetXcodePath(clientDir, fromRelative, toRelative) {
|
|
|
53
77
|
if (from === to)
|
|
54
78
|
return [];
|
|
55
79
|
const rewritten = [];
|
|
56
|
-
for (const path of
|
|
80
|
+
for (const path of declaringFiles(clientDir)) {
|
|
57
81
|
if (!existsSync(path))
|
|
58
82
|
continue;
|
|
59
83
|
const before = readFileSync(path, "utf-8");
|
|
@@ -80,7 +104,7 @@ export function xcodePathsLeftBehind(clientDir, fromRelative, toRelative) {
|
|
|
80
104
|
if (from === to)
|
|
81
105
|
return [];
|
|
82
106
|
const stranded = [];
|
|
83
|
-
for (const path of
|
|
107
|
+
for (const path of declaringFiles(clientDir)) {
|
|
84
108
|
if (!existsSync(path))
|
|
85
109
|
continue;
|
|
86
110
|
const retargeted = readFileSync(path, "utf-8").split(from).join(to);
|
|
@@ -90,11 +114,11 @@ export function xcodePathsLeftBehind(clientDir, fromRelative, toRelative) {
|
|
|
90
114
|
return stranded;
|
|
91
115
|
}
|
|
92
116
|
/**
|
|
93
|
-
* Points the Xcode build phases at the app's
|
|
117
|
+
* Points the Xcode build phases at the app's `primitive/config.json` when it
|
|
94
118
|
* lives above the client.
|
|
95
119
|
*
|
|
96
120
|
* Without this an Xcode build has no readable config: the phase declares
|
|
97
|
-
* `$(SRCROOT)
|
|
121
|
+
* `$(SRCROOT)/primitive/config.json`, which a composed client does not have,
|
|
98
122
|
* and the sandbox denies everything undeclared. A fresh clone (where
|
|
99
123
|
* `primitive.json` is gitignored) then cannot build at all, and a working copy
|
|
100
124
|
* that still has one keeps whichever environment generated it — so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-xcode.js","sourceRoot":"","sources":["../../../src/lib/init-xcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"init-xcode.js","sourceRoot":"","sources":["../../../src/lib/init-xcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;GASG;AACH,MAAM,gBAAgB,GAAG;IACvB,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAC5C,IAAI,CAAC,SAAS,EAAE,4BAA4B,CAAC;CAC9C,CAAC;AAEF,iFAAiF;AACjF,MAAM,qBAAqB,GAAG;IAC5B,IAAI,CAAC,gBAAgB,EAAE,uBAAuB,CAAC;IAC/C,IAAI,CAAC,uBAAuB,EAAE,oBAAoB,CAAC;CACpD,CAAC;AAEF,iFAAiF;AACjF,SAAS,aAAa,CAAC,OAAe,EAAE,MAAc;IACpD,OAAO,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC;AAED,gFAAgF;AAChF,SAAS,cAAc,CAAC,SAAiB;IACvC,OAAO;Q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;;;GAaG;AACH,MAAM,UAAU,0BAA0B,CACxC,SAAiB,EACjB,WAAmB;IAEnB,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,qBAAqB,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;QAClE,SAAS,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The iOS client's Apple app identifier, per environment (#3081).
|
|
3
|
+
*
|
|
4
|
+
* Apple matches an association document against
|
|
5
|
+
* `<Application Identifier Prefix>.<Bundle Identifier>` — the prefix is ten
|
|
6
|
+
* alphanumerics, and it is USUALLY the Team ID but a legacy app's can differ
|
|
7
|
+
* (TN2311). Every message below therefore says "Application Identifier Prefix"
|
|
8
|
+
* and points at the signed app's `application-identifier` entitlement: a
|
|
9
|
+
* well-formed identifier with the wrong prefix produces a document that PARSES,
|
|
10
|
+
* so Apple caches it and both universal links and passkeys fail with nothing to
|
|
11
|
+
* read.
|
|
12
|
+
*
|
|
13
|
+
* One value per environment, because an app with alpha and production has one
|
|
14
|
+
* bundle id each. It is declared beside `webUrl` (#2982) — that pair is one
|
|
15
|
+
* cross-client link, the origin and the app it vouches for — and the Vue
|
|
16
|
+
* template's `scripts/deploy.mjs` generates the association document from it at
|
|
17
|
+
* deploy time.
|
|
18
|
+
*
|
|
19
|
+
* Returns the `string | true` shape `@inquirer/prompts` expects, like
|
|
20
|
+
* `validateWebUrl`, so the same function backs the flag check, the project
|
|
21
|
+
* config's field validation and any future prompt. `deploy.mjs` duplicates the
|
|
22
|
+
* shape rule (it is self-contained, node builtins only) but not these messages.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Validates an Apple app identifier. Returns `true` when valid, otherwise the
|
|
26
|
+
* message to show the user.
|
|
27
|
+
*/
|
|
28
|
+
export declare function validateIosAppId(value: string): string | true;
|
|
29
|
+
/**
|
|
30
|
+
* The stored form of an already-validated identifier: trimmed, and otherwise
|
|
31
|
+
* byte-for-byte what Apple matches. Case is NOT folded — a bundle id is
|
|
32
|
+
* case-sensitive to Apple, and the prefix is uppercase already.
|
|
33
|
+
*/
|
|
34
|
+
export declare function normalizeIosAppId(value: string): string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The iOS client's Apple app identifier, per environment (#3081).
|
|
3
|
+
*
|
|
4
|
+
* Apple matches an association document against
|
|
5
|
+
* `<Application Identifier Prefix>.<Bundle Identifier>` — the prefix is ten
|
|
6
|
+
* alphanumerics, and it is USUALLY the Team ID but a legacy app's can differ
|
|
7
|
+
* (TN2311). Every message below therefore says "Application Identifier Prefix"
|
|
8
|
+
* and points at the signed app's `application-identifier` entitlement: a
|
|
9
|
+
* well-formed identifier with the wrong prefix produces a document that PARSES,
|
|
10
|
+
* so Apple caches it and both universal links and passkeys fail with nothing to
|
|
11
|
+
* read.
|
|
12
|
+
*
|
|
13
|
+
* One value per environment, because an app with alpha and production has one
|
|
14
|
+
* bundle id each. It is declared beside `webUrl` (#2982) — that pair is one
|
|
15
|
+
* cross-client link, the origin and the app it vouches for — and the Vue
|
|
16
|
+
* template's `scripts/deploy.mjs` generates the association document from it at
|
|
17
|
+
* deploy time.
|
|
18
|
+
*
|
|
19
|
+
* Returns the `string | true` shape `@inquirer/prompts` expects, like
|
|
20
|
+
* `validateWebUrl`, so the same function backs the flag check, the project
|
|
21
|
+
* config's field validation and any future prompt. `deploy.mjs` duplicates the
|
|
22
|
+
* shape rule (it is self-contained, node builtins only) but not these messages.
|
|
23
|
+
*/
|
|
24
|
+
/** The example every message ends with, so a rejection is actionable. */
|
|
25
|
+
const SHAPE = "e.g. ABCDE12345.com.example.app";
|
|
26
|
+
/** Where the authoritative value is, when the Team ID is not the prefix. */
|
|
27
|
+
const VERIFY = "verify it against the signed app's application-identifier entitlement";
|
|
28
|
+
/** `<Application Identifier Prefix>.<Bundle Identifier>`, after trimming. */
|
|
29
|
+
const IOS_APP_ID = /^[A-Z0-9]{10}\.[A-Za-z0-9.-]+$/;
|
|
30
|
+
/** The placeholder the template's `.example` document ships with. */
|
|
31
|
+
const PLACEHOLDER_PREFIX = "TEAMID";
|
|
32
|
+
/**
|
|
33
|
+
* Validates an Apple app identifier. Returns `true` when valid, otherwise the
|
|
34
|
+
* message to show the user.
|
|
35
|
+
*/
|
|
36
|
+
export function validateIosAppId(value) {
|
|
37
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
38
|
+
return `iOS app id cannot be empty — ${SHAPE}`;
|
|
39
|
+
}
|
|
40
|
+
const trimmed = value.trim();
|
|
41
|
+
const dot = trimmed.indexOf(".");
|
|
42
|
+
if (dot === -1) {
|
|
43
|
+
return `iOS app id must be <Application Identifier Prefix>.<bundle id> — ${SHAPE}`;
|
|
44
|
+
}
|
|
45
|
+
const prefix = trimmed.slice(0, dot);
|
|
46
|
+
const bundleId = trimmed.slice(dot + 1);
|
|
47
|
+
if (prefix === PLACEHOLDER_PREFIX || bundleId === "BUNDLEID") {
|
|
48
|
+
return `iOS app id is still the "${PLACEHOLDER_PREFIX}.BUNDLEID" placeholder — replace it with this environment's Application Identifier Prefix (usually your Team ID; ${VERIFY}) and the iOS client's bundle id (${SHAPE})`;
|
|
49
|
+
}
|
|
50
|
+
if (!/^[A-Z0-9]{10}$/.test(prefix)) {
|
|
51
|
+
return `iOS app id must start with the 10-character Application Identifier Prefix (usually your Team ID; ${VERIFY}), not "${prefix}" — ${SHAPE}`;
|
|
52
|
+
}
|
|
53
|
+
if (!bundleId) {
|
|
54
|
+
return `iOS app id has no bundle id after the Application Identifier Prefix — ${SHAPE}`;
|
|
55
|
+
}
|
|
56
|
+
if (!IOS_APP_ID.test(trimmed)) {
|
|
57
|
+
return `iOS app id's bundle id may only contain letters, digits, dots and dashes — ${SHAPE}`;
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The stored form of an already-validated identifier: trimmed, and otherwise
|
|
63
|
+
* byte-for-byte what Apple matches. Case is NOT folded — a bundle id is
|
|
64
|
+
* case-sensitive to Apple, and the prefix is uppercase already.
|
|
65
|
+
*/
|
|
66
|
+
export function normalizeIosAppId(value) {
|
|
67
|
+
return value.trim();
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=ios-app-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ios-app-id.js","sourceRoot":"","sources":["../../../src/lib/ios-app-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,yEAAyE;AACzE,MAAM,KAAK,GAAG,iCAAiC,CAAC;AAEhD,4EAA4E;AAC5E,MAAM,MAAM,GACV,uEAAuE,CAAC;AAE1E,6EAA6E;AAC7E,MAAM,UAAU,GAAG,gCAAgC,CAAC;AAEpD,qEAAqE;AACrE,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAC/C,OAAO,gCAAgC,KAAK,EAAE,CAAC;IACjD,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;QACf,OAAO,oEAAoE,KAAK,EAAE,CAAC;IACrF,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACxC,IAAI,MAAM,KAAK,kBAAkB,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC7D,OAAO,4BAA4B,kBAAkB,oHAAoH,MAAM,qCAAqC,KAAK,GAAG,CAAC;IAC/N,CAAC;IACD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,OAAO,oGAAoG,MAAM,WAAW,MAAM,OAAO,KAAK,EAAE,CAAC;IACnJ,CAAC;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,yEAAyE,KAAK,EAAE,CAAC;IAC1F,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,OAAO,8EAA8E,KAAK,EAAE,CAAC;IAC/F,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `--limit` / `--cursor` pair every paged `list` verb declares (#3646).
|
|
3
|
+
*
|
|
4
|
+
* Pagination is a property of the route, not of the verb that happens to have
|
|
5
|
+
* needed it first: a `list` backed by a paged server route carries both flags,
|
|
6
|
+
* prints exactly one page and reports the page boundary in its envelope; a
|
|
7
|
+
* `list` backed by an unpaged route carries neither. Declaring the pair from
|
|
8
|
+
* one place keeps the help text — and therefore the command manifest the docs
|
|
9
|
+
* gate reads — identical across the thirty-odd verbs that page.
|
|
10
|
+
*
|
|
11
|
+
* `cli/tests/unit/list-envelope-uniform-3646.test.ts` walks the manifest and
|
|
12
|
+
* fails a `list` that declares one of the two without the other.
|
|
13
|
+
*/
|
|
14
|
+
import { Option } from "commander";
|
|
15
|
+
/** `--limit <n>`, for a list whose route pages. */
|
|
16
|
+
export declare function pageLimitOption(): Option;
|
|
17
|
+
/** `--cursor <cursor>`, for a list whose route pages. */
|
|
18
|
+
export declare function pageCursorOption(): Option;
|
|
19
|
+
/**
|
|
20
|
+
* Read `--limit` as a positive integer, or exit naming the flag.
|
|
21
|
+
*
|
|
22
|
+
* Refuses before the action asks anything of the server, so a typo costs a
|
|
23
|
+
* message rather than a page of rows the caller did not ask for.
|
|
24
|
+
*
|
|
25
|
+
* Only an absent flag means "the route's own default": an empty value is a
|
|
26
|
+
* value, and `--limit "$LIMIT"` with `LIMIT` unset is the ordinary way a script
|
|
27
|
+
* supplies one. Reading it as an omission would answer a malformed request with
|
|
28
|
+
* a page the caller never asked for, so it takes the same refusal as `--limit
|
|
29
|
+
* zero`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parsePageLimit(raw: unknown): number | undefined;
|
|
32
|
+
/** A page as the human-readable half of a `list` verb reads it. */
|
|
33
|
+
interface PageBoundary {
|
|
34
|
+
nextCursor?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A cursor as it must appear after `--cursor` in a printed hint.
|
|
38
|
+
*
|
|
39
|
+
* A list cursor is the server's keyset position run through `JSON.stringify`
|
|
40
|
+
* (`encodeListCursor`, `src/app-api/helpers/list-params.ts`), so the token a
|
|
41
|
+
* page hands back is routinely `{"documentId":"01HXY…"}` — braces and quotes
|
|
42
|
+
* that a shell eats. The hint exists to be copied verbatim, so anything but a
|
|
43
|
+
* bare word is single-quoted POSIX-style (an embedded `'` closes, escapes and
|
|
44
|
+
* reopens the quoting).
|
|
45
|
+
*/
|
|
46
|
+
export declare function quoteCursorArg(cursor: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* The "there is another page" hint, printed only when there is one.
|
|
49
|
+
*
|
|
50
|
+
* The counterpart of the envelope's `nextCursor` for a reader who is not
|
|
51
|
+
* parsing JSON: the same token, spelled as the argument that fetches the next
|
|
52
|
+
* page.
|
|
53
|
+
*/
|
|
54
|
+
export declare function printPageHint(page: PageBoundary): void;
|
|
55
|
+
/**
|
|
56
|
+
* The empty state for one page.
|
|
57
|
+
*
|
|
58
|
+
* An empty page is not the same thing as an empty listing: several routes cut
|
|
59
|
+
* the page from an index and filter it afterwards — `withoutFunctionOwned` and
|
|
60
|
+
* the status filter on webhooks, the bounded index scans — so a page can come
|
|
61
|
+
* back with no rows and a cursor pointing at matches further along. Before
|
|
62
|
+
* #3646 the draining readers hid that; now that a `list` prints one page,
|
|
63
|
+
* "No <subject> found." would be a lie in exactly that case, so it is said
|
|
64
|
+
* only when the server reported no next page, and the continuation is printed
|
|
65
|
+
* either way.
|
|
66
|
+
*/
|
|
67
|
+
export declare function printEmptyPage(page: PageBoundary, subject: string, emptyListing?: string): void;
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `--limit` / `--cursor` pair every paged `list` verb declares (#3646).
|
|
3
|
+
*
|
|
4
|
+
* Pagination is a property of the route, not of the verb that happens to have
|
|
5
|
+
* needed it first: a `list` backed by a paged server route carries both flags,
|
|
6
|
+
* prints exactly one page and reports the page boundary in its envelope; a
|
|
7
|
+
* `list` backed by an unpaged route carries neither. Declaring the pair from
|
|
8
|
+
* one place keeps the help text — and therefore the command manifest the docs
|
|
9
|
+
* gate reads — identical across the thirty-odd verbs that page.
|
|
10
|
+
*
|
|
11
|
+
* `cli/tests/unit/list-envelope-uniform-3646.test.ts` walks the manifest and
|
|
12
|
+
* fails a `list` that declares one of the two without the other.
|
|
13
|
+
*/
|
|
14
|
+
import { Option } from "commander";
|
|
15
|
+
import { error, info } from "./output.js";
|
|
16
|
+
/** `--limit <n>`, for a list whose route pages. */
|
|
17
|
+
export function pageLimitOption() {
|
|
18
|
+
return new Option("--limit <n>", "Maximum rows in one page (the route's own default when omitted)");
|
|
19
|
+
}
|
|
20
|
+
/** `--cursor <cursor>`, for a list whose route pages. */
|
|
21
|
+
export function pageCursorOption() {
|
|
22
|
+
return new Option("--cursor <cursor>", "Page to resume from: the `nextCursor` of a previous page");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Read `--limit` as a positive integer, or exit naming the flag.
|
|
26
|
+
*
|
|
27
|
+
* Refuses before the action asks anything of the server, so a typo costs a
|
|
28
|
+
* message rather than a page of rows the caller did not ask for.
|
|
29
|
+
*
|
|
30
|
+
* Only an absent flag means "the route's own default": an empty value is a
|
|
31
|
+
* value, and `--limit "$LIMIT"` with `LIMIT` unset is the ordinary way a script
|
|
32
|
+
* supplies one. Reading it as an omission would answer a malformed request with
|
|
33
|
+
* a page the caller never asked for, so it takes the same refusal as `--limit
|
|
34
|
+
* zero`.
|
|
35
|
+
*/
|
|
36
|
+
export function parsePageLimit(raw) {
|
|
37
|
+
if (raw === undefined || raw === null)
|
|
38
|
+
return undefined;
|
|
39
|
+
const limit = Number(raw);
|
|
40
|
+
if (!Number.isInteger(limit) || limit <= 0) {
|
|
41
|
+
error("--limit must be a positive integer.");
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
return limit;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A cursor as it must appear after `--cursor` in a printed hint.
|
|
48
|
+
*
|
|
49
|
+
* A list cursor is the server's keyset position run through `JSON.stringify`
|
|
50
|
+
* (`encodeListCursor`, `src/app-api/helpers/list-params.ts`), so the token a
|
|
51
|
+
* page hands back is routinely `{"documentId":"01HXY…"}` — braces and quotes
|
|
52
|
+
* that a shell eats. The hint exists to be copied verbatim, so anything but a
|
|
53
|
+
* bare word is single-quoted POSIX-style (an embedded `'` closes, escapes and
|
|
54
|
+
* reopens the quoting).
|
|
55
|
+
*/
|
|
56
|
+
export function quoteCursorArg(cursor) {
|
|
57
|
+
if (/^[A-Za-z0-9._:/=+-]+$/.test(cursor))
|
|
58
|
+
return cursor;
|
|
59
|
+
return `'${cursor.replace(/'/g, `'\\''`)}'`;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The "there is another page" hint, printed only when there is one.
|
|
63
|
+
*
|
|
64
|
+
* The counterpart of the envelope's `nextCursor` for a reader who is not
|
|
65
|
+
* parsing JSON: the same token, spelled as the argument that fetches the next
|
|
66
|
+
* page.
|
|
67
|
+
*/
|
|
68
|
+
export function printPageHint(page) {
|
|
69
|
+
if (!page.nextCursor)
|
|
70
|
+
return;
|
|
71
|
+
info(`More results available. Re-run with --cursor ${quoteCursorArg(page.nextCursor)}`);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The empty state for one page.
|
|
75
|
+
*
|
|
76
|
+
* An empty page is not the same thing as an empty listing: several routes cut
|
|
77
|
+
* the page from an index and filter it afterwards — `withoutFunctionOwned` and
|
|
78
|
+
* the status filter on webhooks, the bounded index scans — so a page can come
|
|
79
|
+
* back with no rows and a cursor pointing at matches further along. Before
|
|
80
|
+
* #3646 the draining readers hid that; now that a `list` prints one page,
|
|
81
|
+
* "No <subject> found." would be a lie in exactly that case, so it is said
|
|
82
|
+
* only when the server reported no next page, and the continuation is printed
|
|
83
|
+
* either way.
|
|
84
|
+
*/
|
|
85
|
+
export function printEmptyPage(page, subject, emptyListing = `No ${subject} found.`) {
|
|
86
|
+
info(page.nextCursor ? `No ${subject} on this page.` : emptyListing);
|
|
87
|
+
printPageHint(page);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=list-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-options.js","sourceRoot":"","sources":["../../../src/lib/list-options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE1C,mDAAmD;AACnD,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,MAAM,CACf,aAAa,EACb,iEAAiE,CAClE,CAAC;AACJ,CAAC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,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `primitive env use` records which environment THIS machine is pointed at.
|
|
5
5
|
* That is not a team decision, so it must not land in the committed
|
|
6
|
-
*
|
|
6
|
+
* `primitive/config.json` — `defaultEnvironment` stays the team default a
|
|
7
7
|
* fresh clone resolves. The file sits beside `credentials.json`, which has the
|
|
8
8
|
* same "local, never committed" property.
|
|
9
9
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `primitive env use` records which environment THIS machine is pointed at.
|
|
5
5
|
* That is not a team decision, so it must not land in the committed
|
|
6
|
-
*
|
|
6
|
+
* `primitive/config.json` — `defaultEnvironment` stays the team default a
|
|
7
7
|
* fresh clone resolves. The file sits beside `credentials.json`, which has the
|
|
8
8
|
* same "local, never committed" property.
|
|
9
9
|
*
|
|
@@ -33,7 +33,7 @@ export interface LocalTestCaseScan {
|
|
|
33
33
|
/** The subset no registered case accounts for, basename order. */
|
|
34
34
|
unregistered: string[];
|
|
35
35
|
}
|
|
36
|
-
/** The
|
|
36
|
+
/** The sync-state baseline rows that map a sidecar to a live case. */
|
|
37
37
|
export type ManagedTestCases = Record<string, {
|
|
38
38
|
id?: string;
|
|
39
39
|
} | undefined>;
|
|
@@ -30,9 +30,10 @@ import { existsSync, readFileSync, readdirSync, statSync } from "fs";
|
|
|
30
30
|
import { basename, join } from "path";
|
|
31
31
|
import { testCaseFileBasenames } from "./test-case-file-names.js";
|
|
32
32
|
import { normalizeTestCaseKey } from "./test-case-keys.js";
|
|
33
|
+
import { syncStateReadPath } from "./sync-paths.js";
|
|
33
34
|
/** Read the manifest's test-case rows, or nothing when it cannot be read. */
|
|
34
35
|
export function readManagedTestCases(configDir) {
|
|
35
|
-
const syncFile =
|
|
36
|
+
const syncFile = syncStateReadPath(configDir);
|
|
36
37
|
if (!existsSync(syncFile))
|
|
37
38
|
return {};
|
|
38
39
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-test-cases.js","sourceRoot":"","sources":["../../../src/lib/local-test-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"local-test-cases.js","sourceRoot":"","sources":["../../../src/lib/local-test-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAapD,6EAA6E;AAC7E,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC;QAC3C,OAAO,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,C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