primitive-admin 1.0.61 → 1.0.63
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 +125 -69
- package/assets/skill/skills/primitive-platform/SKILL.md +336 -37
- package/dist/bin/primitive.js +25 -14
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/analytics.js +36 -16
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps.js +52 -188
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +13 -153
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/collection-type-configs.js +14 -100
- package/dist/src/commands/collection-type-configs.js.map +1 -1
- package/dist/src/commands/collections.js +47 -8
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/config.d.ts +46 -0
- package/dist/src/commands/config.js +479 -0
- package/dist/src/commands/config.js.map +1 -0
- package/dist/src/commands/connections.js +12 -7
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/cron-triggers.js +84 -176
- package/dist/src/commands/cron-triggers.js.map +1 -1
- package/dist/src/commands/database-type-configs.d.ts +2 -0
- package/dist/src/commands/database-type-configs.js +171 -0
- package/dist/src/commands/database-type-configs.js.map +1 -0
- package/dist/src/commands/database-types.js +4 -4
- package/dist/src/commands/database-types.js.map +1 -1
- package/dist/src/commands/databases.d.ts +63 -0
- package/dist/src/commands/databases.js +649 -87
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.js +869 -12
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +21 -128
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.d.ts +12 -1
- package/dist/src/commands/env.js +115 -26
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/feature-flags.d.ts +14 -0
- package/dist/src/commands/feature-flags.js +116 -0
- package/dist/src/commands/feature-flags.js.map +1 -0
- package/dist/src/commands/group-type-configs.js +14 -109
- package/dist/src/commands/group-type-configs.js.map +1 -1
- package/dist/src/commands/init.d.ts +24 -1
- package/dist/src/commands/init.js +1194 -279
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +166 -435
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.d.ts +12 -0
- package/dist/src/commands/metadata-category-configs.js +112 -0
- package/dist/src/commands/metadata-category-configs.js.map +1 -0
- package/dist/src/commands/metadata.js +33 -141
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +206 -563
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.d.ts +1 -1
- package/dist/src/commands/rule-sets.js +16 -132
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/scripts.d.ts +10 -0
- package/dist/src/commands/scripts.js +203 -241
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/sessions.js +17 -5
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/sync-app-settings.d.ts +113 -70
- package/dist/src/commands/sync-app-settings.js +193 -242
- package/dist/src/commands/sync-app-settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +1904 -51
- package/dist/src/commands/sync.js +9468 -1790
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +8 -2
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.js +92 -1
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +44 -58
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/webhooks.js +318 -156
- package/dist/src/commands/webhooks.js.map +1 -1
- package/dist/src/commands/workflows.d.ts +49 -12
- package/dist/src/commands/workflows.js +652 -1086
- 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 +541 -61
- package/dist/src/lib/api-client.js +559 -102
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +180 -25
- package/dist/src/lib/app-settings-descriptor.js +403 -82
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- 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/cli-manifest.d.ts +8 -0
- package/dist/src/lib/cli-manifest.js +1 -0
- package/dist/src/lib/cli-manifest.js.map +1 -1
- package/dist/src/lib/codegen-shared/generatedFiles.d.ts +6 -2
- package/dist/src/lib/codegen-shared/generatedFiles.js +9 -2
- package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +6 -6
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +8 -8
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -1
- package/dist/src/lib/config-object-descriptor.d.ts +127 -0
- package/dist/src/lib/config-object-descriptor.js +658 -0
- package/dist/src/lib/config-object-descriptor.js.map +1 -0
- package/dist/src/lib/config-payload.d.ts +85 -0
- package/dist/src/lib/config-payload.js +116 -0
- package/dist/src/lib/config-payload.js.map +1 -0
- package/dist/src/lib/config-surface.d.ts +130 -0
- package/dist/src/lib/config-surface.js +300 -0
- package/dist/src/lib/config-surface.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +10 -0
- package/dist/src/lib/credentials-store.js +23 -0
- package/dist/src/lib/credentials-store.js.map +1 -1
- 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/dbTemplates.js +1 -1
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +1 -1
- package/dist/src/lib/env-resolver-core.d.ts +187 -0
- package/dist/src/lib/env-resolver-core.js +325 -0
- package/dist/src/lib/env-resolver-core.js.map +1 -0
- package/dist/src/lib/env-resolver.d.ts +28 -6
- package/dist/src/lib/env-resolver.js +44 -32
- package/dist/src/lib/env-resolver.js.map +1 -1
- package/dist/src/lib/generated-allowlist.js +12 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +682 -0
- package/dist/src/lib/generated-config-surfaces.js +4058 -0
- package/dist/src/lib/generated-config-surfaces.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/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 +44 -5
- package/dist/src/lib/init-config.js +80 -7
- package/dist/src/lib/init-config.js.map +1 -1
- 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 +90 -0
- package/dist/src/lib/init-ios-links.js +218 -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 +33 -0
- package/dist/src/lib/init-xcode.js +114 -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/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 +135 -0
- package/dist/src/lib/local-test-cases.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +568 -0
- package/dist/src/lib/log-inspection.js +639 -0
- package/dist/src/lib/log-inspection.js.map +1 -0
- package/dist/src/lib/migration-nag.d.ts +2 -2
- package/dist/src/lib/migration-nag.js +3 -3
- 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 +24 -1
- package/dist/src/lib/output.js +42 -1
- 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 +50 -0
- package/dist/src/lib/paginate.js +53 -0
- package/dist/src/lib/paginate.js.map +1 -1
- package/dist/src/lib/platform-owned.d.ts +29 -3
- package/dist/src/lib/platform-owned.js +42 -3
- package/dist/src/lib/platform-owned.js.map +1 -1
- package/dist/src/lib/project-config.d.ts +8 -0
- package/dist/src/lib/project-config.js +30 -5
- package/dist/src/lib/project-config.js.map +1 -1
- package/dist/src/lib/query-operators.d.ts +1 -1
- package/dist/src/lib/query-operators.js +1 -1
- 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/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-platform.d.ts +43 -14
- package/dist/src/lib/resolve-platform.js +74 -12
- package/dist/src/lib/resolve-platform.js.map +1 -1
- 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.js +6 -3
- package/dist/src/lib/skill-installer.js.map +1 -1
- package/dist/src/lib/snapshots.d.ts +2 -2
- package/dist/src/lib/snapshots.js +2 -2
- package/dist/src/lib/swift-codegen/dbGenerator.d.ts +15 -2
- package/dist/src/lib/swift-codegen/dbGenerator.js +250 -18
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/generator.d.ts +11 -2
- package/dist/src/lib/swift-codegen/generator.js +181 -7
- package/dist/src/lib/swift-codegen/generator.js.map +1 -1
- package/dist/src/lib/swift-codegen/siblingSymbols.d.ts +7 -3
- package/dist/src/lib/swift-codegen/siblingSymbols.js +4 -1
- package/dist/src/lib/swift-codegen/siblingSymbols.js.map +1 -1
- 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 +39 -0
- package/dist/src/lib/sync-paths.js +70 -2
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/sync-resource-types.d.ts +138 -31
- package/dist/src/lib/sync-resource-types.js +241 -47
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +95 -0
- package/dist/src/lib/sync-selectors.js +228 -0
- package/dist/src/lib/sync-selectors.js.map +1 -0
- package/dist/src/lib/template.d.ts +62 -4
- package/dist/src/lib/template.js +147 -39
- 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 +15 -0
- package/dist/src/lib/test-case-variables.js +29 -0
- package/dist/src/lib/test-case-variables.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +4 -4
- package/dist/src/lib/toml-database-config.js +27 -34
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/toml-metadata-config.d.ts +9 -5
- package/dist/src/lib/toml-metadata-config.js +40 -45
- package/dist/src/lib/toml-metadata-config.js.map +1 -1
- package/dist/src/lib/toml-native-form.d.ts +1 -1
- package/dist/src/lib/toml-native-form.js +1 -1
- package/dist/src/lib/toml-params-validator.d.ts +1 -1
- package/dist/src/lib/toml-params-validator.js +1 -1
- 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 +25 -0
- package/dist/src/lib/version-check.js +77 -8
- package/dist/src/lib/version-check.js.map +1 -1
- 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/workflow-apply.d.ts +69 -45
- package/dist/src/lib/workflow-apply.js +99 -72
- package/dist/src/lib/workflow-apply.js.map +1 -1
- package/dist/src/lib/workflow-codegen/generator.js +4 -4
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +11 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js +5 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
- 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-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 +31 -20
- package/dist/src/lib/workflow-payload.js +100 -110
- package/dist/src/lib/workflow-payload.js.map +1 -1
- package/dist/src/lib/workflow-toml-validator.d.ts +37 -16
- package/dist/src/lib/workflow-toml-validator.js +141 -16
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/dist/src/types/index.d.ts +78 -22
- package/dist/src/validators.d.ts +7 -7
- package/dist/src/validators.js +6 -6
- package/package.json +11 -6
- package/dist/src/commands/settings.d.ts +0 -15
- package/dist/src/commands/settings.js +0 -102
- package/dist/src/commands/settings.js.map +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Option } from "commander";
|
|
1
2
|
import { ApiClient } from "../lib/api-client.js";
|
|
2
3
|
import { resolveAppId } from "../lib/config.js";
|
|
3
4
|
import { error, info, formatTable, formatDate, json, } from "../lib/output.js";
|
|
5
|
+
import { resolveUserSelector } from "../lib/user-selector.js";
|
|
4
6
|
export function registerSessionsCommands(program) {
|
|
5
7
|
const sessions = program
|
|
6
8
|
.command("sessions")
|
|
@@ -11,19 +13,29 @@ expired — an expired session that has not yet been swept still appears, with
|
|
|
11
13
|
ACTIVE = false. Authentication tokens are never returned.
|
|
12
14
|
|
|
13
15
|
Examples:
|
|
14
|
-
$ primitive sessions list --user 01HXY...
|
|
15
|
-
$ primitive sessions list --user 01HXY... --limit 50
|
|
16
|
-
$ primitive sessions list --user 01HXY... --json
|
|
16
|
+
$ primitive sessions list --user-id 01HXY...
|
|
17
|
+
$ primitive sessions list --user-id 01HXY... --limit 50
|
|
18
|
+
$ primitive sessions list --user-id 01HXY... --json
|
|
17
19
|
`);
|
|
18
20
|
sessions
|
|
19
21
|
.command("list")
|
|
20
22
|
.description("List a user's sessions")
|
|
21
23
|
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
22
|
-
|
|
24
|
+
// `--user-id` is canonical (#2357). It cannot be a `requiredOption` any
|
|
25
|
+
// more, because the deprecated `--user` alias also satisfies the
|
|
26
|
+
// requirement — commander would reject `--user 01H…` before the alias
|
|
27
|
+
// resolution runs. The explicit check below keeps the same contract.
|
|
28
|
+
.option("--user-id <user-id>", "List sessions for this user")
|
|
29
|
+
.addOption(new Option("--user <user-id>", "Deprecated alias of --user-id").hideHelp())
|
|
23
30
|
.option("--limit <n>", "Maximum rows to return (default 25, max 100)")
|
|
24
31
|
.option("--cursor <cursor>", "Pagination cursor from a previous page")
|
|
25
32
|
.option("--json", "Output as JSON")
|
|
26
33
|
.action(async (options) => {
|
|
34
|
+
const userId = resolveUserSelector(options, "sessions list");
|
|
35
|
+
if (!userId) {
|
|
36
|
+
error("required option '--user-id <user-id>' not specified");
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
27
39
|
const resolvedAppId = resolveAppId(undefined, options);
|
|
28
40
|
const client = new ApiClient();
|
|
29
41
|
const limit = options.limit ? Number(options.limit) : undefined;
|
|
@@ -33,7 +45,7 @@ Examples:
|
|
|
33
45
|
process.exit(1);
|
|
34
46
|
}
|
|
35
47
|
try {
|
|
36
|
-
const { items, nextCursor } = await client.listSessions(resolvedAppId,
|
|
48
|
+
const { items, nextCursor } = await client.listSessions(resolvedAppId, userId, { limit, cursor: options.cursor });
|
|
37
49
|
if (options.json) {
|
|
38
50
|
json({ items, nextCursor });
|
|
39
51
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../src/commands/sessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../src/commands/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACL,KAAK,EACL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,UAAU,wBAAwB,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CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,102 +1,123 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared app-settings
|
|
2
|
+
* Shared app-settings helpers (issue #1033, Phase 2; narrowed by #2645).
|
|
3
3
|
*
|
|
4
4
|
* The descriptor-driven `app.toml` round-trip (issue #1033, Phase 1) was born
|
|
5
|
-
* inside the big `
|
|
6
|
-
* app-settings-specific pieces here so
|
|
5
|
+
* inside the big `config pull` / `config push` command flow. Phase 2 lifted the
|
|
6
|
+
* app-settings-specific pieces here so both surfaces could drive them. #2645
|
|
7
|
+
* then removed the second surface: `app.toml` is authored like every other
|
|
8
|
+
* configuration file and applied by `config push`, so what is left here is what
|
|
9
|
+
* `sync` calls (`serializeAppSettings`, `writePulledAppSettings`,
|
|
10
|
+
* `collectAppSettingsPushErrors`, `diffAppSettings` for `config diff --only app`)
|
|
11
|
+
* plus the one thing the file cannot answer — `renderAppSettings`, the
|
|
12
|
+
* server-effective view behind `primitive apps get` (#2759).
|
|
7
13
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
+
* #2880 added the comparison the whole epic is about — `appSettingsFieldDiffs`,
|
|
15
|
+
* `hashAppSettingsForDiff` and `appSettingsNameExcluded` — and removed the last
|
|
16
|
+
* caller of the retired byte-hash/present-only rule (the `settings push`
|
|
17
|
+
* orchestrator #2645 had already unhooked). `app.toml` is now compared field by
|
|
18
|
+
* field against live state by both commands, over the full writable descriptor
|
|
19
|
+
* set, and applied as the whole truth.
|
|
14
20
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* `googleClientSecret` never leaves the server through here: pull omits it,
|
|
22
|
-
* push errors on it (pointing at `primitive apps update --google-client-secret`),
|
|
23
|
-
* and `settings show` redacts it in both the rendered and `--json` views.
|
|
21
|
+
* Google is a typed client map here (#2891): `googleClients` renders as
|
|
22
|
+
* `[auth.google.clients.<type>]`, and each entry's `clientSecret` holds a whole
|
|
23
|
+
* `{{secrets.KEY}}` reference, not the secret itself, so the map pulls, pushes,
|
|
24
|
+
* diffs and shows like any other setting. The secrets' values live only in the
|
|
25
|
+
* app secret store (`primitive secrets set`).
|
|
24
26
|
*/
|
|
25
27
|
import type { ApiClient } from "../lib/api-client.js";
|
|
26
28
|
import { type AppSettingSection } from "../lib/app-settings-descriptor.js";
|
|
29
|
+
import type { SyncState } from "../types/index.js";
|
|
27
30
|
/** The app-settings file name inside a sync directory. */
|
|
28
31
|
export declare const APP_TOML_FILENAME = "app.toml";
|
|
29
32
|
/** Absolute path to `app.toml` inside a sync directory. */
|
|
30
33
|
export declare function appTomlPath(configDir: string): string;
|
|
31
34
|
/**
|
|
32
35
|
* Serialize server settings into the `app.toml` string (pull direction).
|
|
33
|
-
* Descriptor-driven;
|
|
34
|
-
* serializer both `sync pull` and `settings pull` use.
|
|
36
|
+
* Descriptor-driven; this is the single serializer every pull path uses.
|
|
35
37
|
*/
|
|
36
38
|
export declare function serializeAppSettings(settings: any): string;
|
|
37
39
|
/**
|
|
38
40
|
* Write `app.toml` from server settings and return its content hash. Shared by
|
|
39
|
-
* `
|
|
40
|
-
*
|
|
41
|
+
* `config pull` (whole-tree and `--only app`), so the file and the hash have one
|
|
42
|
+
* producer.
|
|
41
43
|
*/
|
|
42
44
|
export declare function writeAppSettingsToml(configDir: string, settings: any): string;
|
|
43
45
|
/**
|
|
44
|
-
* Validate a parsed `app.toml` for push and return the fatal errors (a
|
|
45
|
-
*
|
|
46
|
-
* proceed. Warnings (
|
|
47
|
-
* the caller surfaces those at apply time.
|
|
48
|
-
*
|
|
46
|
+
* Validate a parsed `app.toml` for push and return the fatal errors (a type
|
|
47
|
+
* mismatch, an unrecognized or retired key, a missing required key). An empty
|
|
48
|
+
* array means the push may proceed. Warnings (advisory notes) are intentionally
|
|
49
|
+
* not returned here — the caller surfaces those at apply time.
|
|
50
|
+
*
|
|
51
|
+
* ONE validator, run by `config push`'s preflight AND by `config diff` (#2880
|
|
52
|
+
* criterion 1): a file diff calls Synced is a file push accepts, and a file
|
|
53
|
+
* push refuses is named by diff with the identical message.
|
|
49
54
|
*/
|
|
50
55
|
export declare function collectAppSettingsPushErrors(tomlData: Record<string, any>, options?: {
|
|
51
56
|
isCrossAppPush?: boolean;
|
|
57
|
+
excludeName?: boolean;
|
|
52
58
|
}): string[];
|
|
53
|
-
/** Placeholder shown in `settings show` in place of any secret field value. */
|
|
54
|
-
export declare const REDACTED_PLACEHOLDER = "[redacted \u2014 set via: primitive apps update <appId> --google-client-secret]";
|
|
55
59
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* BOTH the rendered and `--json` outputs of `settings show` so the real secret
|
|
59
|
-
* never leaves the server through this command (codex design-review concern #2).
|
|
60
|
+
* Render server-effective settings grouped by `app.toml` section — the view
|
|
61
|
+
* `apps get` prints (issue #2759; it was `apps get` before the fold).
|
|
60
62
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* - the companion `<field>Set` boolean is true — #1603 made the secret
|
|
65
|
-
* write-only, so `GET /settings` omits the raw value entirely and reports
|
|
66
|
-
* `googleClientSecretSet` instead. Without this branch a configured secret
|
|
67
|
-
* renders as "(not set)", indistinguishable from an unconfigured one.
|
|
63
|
+
* Descriptor-driven on purpose: a new setting appears here by being declared,
|
|
64
|
+
* where the hand-curated block `apps get` used to print showed whichever
|
|
65
|
+
* fields somebody remembered to add.
|
|
68
66
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
67
|
+
* Nothing is redacted (#2256, #2891): the only credential-shaped settings are
|
|
68
|
+
* the per-entry `clientSecret`s inside `googleClients`, and each is a whole
|
|
69
|
+
* `{{secrets.KEY}}` reference rather than the secret itself — so printing one
|
|
70
|
+
* tells the operator which secret is in use rather than leaking one. There is
|
|
71
|
+
* no withheld state left to explain.
|
|
72
|
+
*
|
|
73
|
+
* Takes settings rather than a client, and never exits: `apps get` fetches the
|
|
74
|
+
* app and its settings together and tolerates a settings fetch it is not
|
|
75
|
+
* allowed to make, so failure handling belongs at the call site.
|
|
77
76
|
*/
|
|
78
|
-
export declare function
|
|
79
|
-
json?: boolean;
|
|
80
|
-
}): Promise<void>;
|
|
77
|
+
export declare function renderAppSettings(settings: any): void;
|
|
81
78
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
79
|
+
* Write the pulled `app.toml`.
|
|
80
|
+
*
|
|
81
|
+
* The file carries EVERY writable setting as of #2891 — the server withholds
|
|
82
|
+
* nothing, so there is no longer a class of value the pull has to warn about
|
|
83
|
+
* being absent (#2307's warning went with the withholding layer). `config pull`
|
|
84
|
+
* calls this for `app.toml`, whether the pull is whole-tree or `--only app`.
|
|
84
85
|
*/
|
|
85
|
-
export declare function
|
|
86
|
-
|
|
87
|
-
}):
|
|
86
|
+
export declare function writePulledAppSettings(configDir: string, settings: any, options?: {
|
|
87
|
+
log?: (message: string) => void;
|
|
88
|
+
}): {
|
|
89
|
+
path: string;
|
|
90
|
+
contentHash: string;
|
|
91
|
+
};
|
|
88
92
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
93
|
+
* Whether `[app].name` is out of BOTH the comparison and the payload right now
|
|
94
|
+
* (#2880 DSO-001) — the cross-app rule, shared so diff and push cannot disagree.
|
|
95
|
+
*
|
|
96
|
+
* A cross-app push (the sync state belongs to a different app) applies the file
|
|
97
|
+
* to the target with `name` excluded, so it never renames the target, and it
|
|
98
|
+
* RECORDS the file's name in `entities.app.excludedName` with the baseline
|
|
99
|
+
* hashed the same way. While that record stands and the file still states that
|
|
100
|
+
* name, the field stays excluded: the target keeps its own name and no phantom
|
|
101
|
+
* difference appears.
|
|
102
|
+
*
|
|
103
|
+
* A file name that DIFFERS from the recorded one is, by construction, a local
|
|
104
|
+
* name edit — the operator changed the line — so the exclusion lifts, the name
|
|
105
|
+
* goes into the payload, and the baseline is restamped with `name` from the
|
|
106
|
+
* server's returned record. It cannot be discovered by comparison instead:
|
|
107
|
+
* `classifyPushChange` only answers `local-edited` when the remote hash equals
|
|
108
|
+
* the baseline, and a baseline stamped without `name` matches neither side once
|
|
109
|
+
* `name` re-enters, so every post-cross-app rename would report `both-changed`.
|
|
94
110
|
*/
|
|
95
|
-
export declare function
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
111
|
+
export declare function appSettingsNameExcluded(input: {
|
|
112
|
+
/** The sync state belongs to a different app than the one being written. */
|
|
113
|
+
isCrossAppPush: boolean;
|
|
114
|
+
/** `entities.app.excludedName` — the name a prior cross-app push left alone. */
|
|
115
|
+
recordedExcludedName?: unknown;
|
|
116
|
+
/** The `[app].name` the local file states right now. */
|
|
117
|
+
fileName?: unknown;
|
|
118
|
+
}): boolean;
|
|
119
|
+
/** `appSettingsNameExcluded` for a caller holding the loaded state (diff). */
|
|
120
|
+
export declare function appSettingsNameExcludedForState(state: SyncState | null, appId: string, tomlData: Record<string, any> | null | undefined): boolean;
|
|
100
121
|
export interface AppSettingsFieldDiff {
|
|
101
122
|
field: string;
|
|
102
123
|
section: AppSettingSection;
|
|
@@ -105,10 +126,32 @@ export interface AppSettingsFieldDiff {
|
|
|
105
126
|
remote: unknown;
|
|
106
127
|
}
|
|
107
128
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
129
|
+
* The fields the local `app.toml` and the live settings disagree on (#2880).
|
|
130
|
+
*
|
|
131
|
+
* Compared over the FULL writable descriptor set, not just the keys the file
|
|
132
|
+
* carries: `app.toml` is the whole truth, so a key the file omits is not "no
|
|
133
|
+
* opinion", it is the absent-value the push will send. Both sides run through
|
|
134
|
+
* `projectAppSettingsForComparison`, which applies the same canonicalization
|
|
135
|
+
* and the same `whenSet`-empty flattening to each — so a pulled file compares
|
|
136
|
+
* equal to the server it was pulled from, and a deleted key shows as the clear
|
|
137
|
+
* push would apply.
|
|
138
|
+
*
|
|
139
|
+
* One helper, three callers: `config diff --only app`'s per-field output, the
|
|
140
|
+
* app-settings row in the full `config diff`, and the push gate.
|
|
141
|
+
*/
|
|
142
|
+
export declare function appSettingsFieldDiffs(localSettings: Record<string, any>, remoteSettings: Record<string, any> | null | undefined, options?: {
|
|
143
|
+
excludeName?: boolean;
|
|
144
|
+
}): AppSettingsFieldDiff[];
|
|
145
|
+
/**
|
|
146
|
+
* The comparator's hash of one side's app settings — the push gate's
|
|
147
|
+
* `localHash`/`remoteHash`, and the `entities.app.semanticHash` baseline
|
|
148
|
+
* stamped once the two agree (#2880 criterion 6).
|
|
149
|
+
*/
|
|
150
|
+
export declare function hashAppSettingsForDiff(settings: Record<string, any> | null | undefined, options?: {
|
|
151
|
+
excludeName?: boolean;
|
|
152
|
+
}): string;
|
|
153
|
+
/**
|
|
154
|
+
* `config diff --only app` — the per-field report, over the full writable set.
|
|
112
155
|
*/
|
|
113
156
|
export declare function diffAppSettings(client: ApiClient, appId: string, configDir: string, options?: {
|
|
114
157
|
json?: boolean;
|