primitive-admin 1.2.0-alpha.9 → 1.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +258 -186
- package/assets/skill/skills/primitive-platform/SKILL.md +93 -27
- package/dist/bin/primitive.js +15 -89
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.js +80 -17
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/agent-sessions.d.ts +129 -0
- package/dist/src/commands/agent-sessions.js +532 -20
- package/dist/src/commands/agent-sessions.js.map +1 -1
- package/dist/src/commands/analytics.js +207 -155
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps-children.js +3 -0
- package/dist/src/commands/apps-children.js.map +1 -1
- package/dist/src/commands/apps-transitions.d.ts +39 -0
- package/dist/src/commands/apps-transitions.js +198 -0
- package/dist/src/commands/apps-transitions.js.map +1 -0
- package/dist/src/commands/apps.d.ts +17 -0
- package/dist/src/commands/apps.js +108 -3
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.js +2 -0
- package/dist/src/commands/auth-sessions.js.map +1 -1
- package/dist/src/commands/auth.js +138 -44
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +2 -0
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/collections.js +318 -256
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/comparisons.js +2 -0
- package/dist/src/commands/comparisons.js.map +1 -1
- package/dist/src/commands/config.d.ts +2 -2
- package/dist/src/commands/config.js +59 -33
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/connections.js +2 -0
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +5 -3
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.js +6 -4
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/db3-types.d.ts +15 -0
- package/dist/src/commands/db3-types.js +159 -0
- package/dist/src/commands/db3-types.js.map +1 -0
- package/dist/src/commands/db3.d.ts +24 -0
- package/dist/src/commands/db3.js +1444 -0
- package/dist/src/commands/db3.js.map +1 -0
- package/dist/src/commands/documents.d.ts +110 -10
- package/dist/src/commands/documents.js +1012 -748
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +74 -0
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.js +8 -4
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/function-trigger-commands.d.ts +28 -0
- package/dist/src/commands/function-trigger-commands.js +341 -0
- package/dist/src/commands/function-trigger-commands.js.map +1 -0
- package/dist/src/commands/functions.js +376 -30
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/groups.js +168 -50
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +7 -5
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/hosting.d.ts +8 -0
- package/dist/src/commands/hosting.js +346 -0
- package/dist/src/commands/hosting.js.map +1 -0
- package/dist/src/commands/init.js +129 -38
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +82 -53
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/locks.d.ts +5 -3
- package/dist/src/commands/locks.js +19 -61
- package/dist/src/commands/locks.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.d.ts +2 -2
- package/dist/src/commands/metadata-category-configs.js +4 -2
- package/dist/src/commands/metadata-category-configs.js.map +1 -1
- package/dist/src/commands/metadata.js +41 -0
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +75 -52
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rate-counters.d.ts +19 -0
- package/dist/src/commands/rate-counters.js +104 -0
- package/dist/src/commands/rate-counters.js.map +1 -0
- package/dist/src/commands/rule-sets.d.ts +1 -1
- package/dist/src/commands/rule-sets.js +2 -1
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/schemas.d.ts +15 -0
- package/dist/src/commands/schemas.js +122 -0
- package/dist/src/commands/schemas.js.map +1 -0
- package/dist/src/commands/scripts.d.ts +9 -17
- package/dist/src/commands/scripts.js +24 -479
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/secrets.js +47 -3
- package/dist/src/commands/secrets.js.map +1 -1
- package/dist/src/commands/sessions.js +2 -0
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/skill.js +2 -0
- package/dist/src/commands/skill.js.map +1 -1
- package/dist/src/commands/sync-schemas.d.ts +202 -0
- package/dist/src/commands/sync-schemas.js +629 -0
- package/dist/src/commands/sync-schemas.js.map +1 -0
- package/dist/src/commands/sync-user-properties.d.ts +118 -0
- package/dist/src/commands/sync-user-properties.js +276 -0
- package/dist/src/commands/sync-user-properties.js.map +1 -0
- package/dist/src/commands/sync.d.ts +518 -546
- package/dist/src/commands/sync.js +3010 -4877
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +5 -3
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/transitions.d.ts +54 -0
- package/dist/src/commands/transitions.js +418 -0
- package/dist/src/commands/transitions.js.map +1 -0
- package/dist/src/commands/usage.d.ts +18 -0
- package/dist/src/commands/usage.js +343 -0
- package/dist/src/commands/usage.js.map +1 -0
- package/dist/src/commands/user-properties.d.ts +14 -0
- package/dist/src/commands/user-properties.js +79 -0
- package/dist/src/commands/user-properties.js.map +1 -0
- package/dist/src/commands/users.js +911 -18
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +2 -0
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/waitlist.js +39 -4
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/workflows.d.ts +5 -83
- package/dist/src/commands/workflows.js +57 -2282
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/analytics-query.d.ts +58 -0
- package/dist/src/lib/analytics-query.js +134 -0
- package/dist/src/lib/analytics-query.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +1818 -438
- package/dist/src/lib/api-client.js +965 -544
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +1 -1
- package/dist/src/lib/app-settings-descriptor.js +6 -0
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/auth-fixtures.d.ts +44 -0
- package/dist/src/lib/auth-fixtures.js +61 -0
- package/dist/src/lib/auth-fixtures.js.map +1 -0
- package/dist/src/lib/auth-flow.d.ts +34 -1
- package/dist/src/lib/auth-flow.js +429 -13
- package/dist/src/lib/auth-flow.js.map +1 -1
- package/dist/src/lib/block-layout.d.ts +12 -23
- package/dist/src/lib/block-layout.js +26 -92
- package/dist/src/lib/block-layout.js.map +1 -1
- package/dist/src/lib/block-selector.d.ts +8 -14
- package/dist/src/lib/block-selector.js +8 -19
- package/dist/src/lib/block-selector.js.map +1 -1
- package/dist/src/lib/child-apps-local.d.ts +3 -1
- package/dist/src/lib/child-apps-local.js +9 -1
- package/dist/src/lib/child-apps-local.js.map +1 -1
- package/dist/src/lib/cli-manifest.d.ts +9 -0
- package/dist/src/lib/cli-manifest.js +10 -1
- package/dist/src/lib/cli-manifest.js.map +1 -1
- package/dist/src/lib/cli-version.d.ts +14 -0
- package/dist/src/lib/cli-version.js +38 -0
- package/dist/src/lib/cli-version.js.map +1 -0
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +41 -0
- package/dist/src/lib/codegen-shared/prettierStable.js +146 -24
- package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -1
- package/dist/src/lib/collection-export.d.ts +76 -15
- package/dist/src/lib/collection-export.js +116 -23
- package/dist/src/lib/collection-export.js.map +1 -1
- package/dist/src/lib/collection-principal.d.ts +22 -0
- package/dist/src/lib/collection-principal.js +35 -0
- package/dist/src/lib/collection-principal.js.map +1 -0
- package/dist/src/lib/command-groups.d.ts +30 -0
- package/dist/src/lib/command-groups.js +109 -0
- package/dist/src/lib/command-groups.js.map +1 -0
- package/dist/src/lib/command-status.d.ts +147 -0
- package/dist/src/lib/command-status.js +266 -0
- package/dist/src/lib/command-status.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +9 -22
- package/dist/src/lib/config-object-descriptor.js +107 -276
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +3 -7
- package/dist/src/lib/config-surface.js +9 -13
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/config-toml.d.ts +11 -2
- package/dist/src/lib/config-toml.js +25 -2
- package/dist/src/lib/config-toml.js.map +1 -1
- package/dist/src/lib/credentials-home.d.ts +7 -0
- package/dist/src/lib/credentials-home.js +45 -10
- package/dist/src/lib/credentials-home.js.map +1 -1
- package/dist/src/lib/credentials-lock.d.ts +14 -6
- package/dist/src/lib/credentials-lock.js +90 -10
- package/dist/src/lib/credentials-lock.js.map +1 -1
- package/dist/src/lib/credentials-store.d.ts +123 -70
- package/dist/src/lib/credentials-store.js +358 -113
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/custodian.d.ts +8 -0
- package/dist/src/lib/custodian.js +18 -0
- package/dist/src/lib/custodian.js.map +1 -0
- package/dist/src/lib/data-input.d.ts +1 -1
- package/dist/src/lib/data-input.js +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.js +3 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +38 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js +29 -7
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/db-type-records.d.ts +106 -0
- package/dist/src/lib/db-type-records.js +224 -0
- package/dist/src/lib/db-type-records.js.map +1 -0
- package/dist/src/lib/db3-export.d.ts +287 -0
- package/dist/src/lib/db3-export.js +647 -0
- package/dist/src/lib/db3-export.js.map +1 -0
- package/dist/src/lib/db3-index-output.d.ts +116 -0
- package/dist/src/lib/db3-index-output.js +223 -0
- package/dist/src/lib/db3-index-output.js.map +1 -0
- package/dist/src/lib/db3-type-models.d.ts +134 -0
- package/dist/src/lib/db3-type-models.js +452 -0
- package/dist/src/lib/db3-type-models.js.map +1 -0
- package/dist/src/lib/deprecation.d.ts +2 -2
- package/dist/src/lib/deprecation.js +2 -2
- package/dist/src/lib/document-ingest-artifact.d.ts +13 -0
- package/dist/src/lib/document-ingest-artifact.js +36 -6
- package/dist/src/lib/document-ingest-artifact.js.map +1 -1
- package/dist/src/lib/document-ingest-format2.d.ts +36 -0
- package/dist/src/lib/document-ingest-format2.js +78 -0
- package/dist/src/lib/document-ingest-format2.js.map +1 -0
- package/dist/src/lib/document-ingest-input.d.ts +9 -0
- package/dist/src/lib/document-ingest-input.js +28 -1
- package/dist/src/lib/document-ingest-input.js.map +1 -1
- package/dist/src/lib/document-ingest.d.ts +11 -1
- package/dist/src/lib/document-ingest.js +16 -0
- package/dist/src/lib/document-ingest.js.map +1 -1
- package/dist/src/lib/document-schema-rows.d.ts +42 -0
- package/dist/src/lib/document-schema-rows.js +53 -0
- package/dist/src/lib/document-schema-rows.js.map +1 -0
- package/dist/src/lib/experimental-apis.d.ts +36 -0
- package/dist/src/lib/experimental-apis.js +46 -0
- package/dist/src/lib/experimental-apis.js.map +1 -0
- package/dist/src/lib/file-attachment.d.ts +24 -0
- package/dist/src/lib/file-attachment.js +31 -0
- package/dist/src/lib/file-attachment.js.map +1 -0
- package/dist/src/lib/function-authorize-check.d.ts +142 -0
- package/dist/src/lib/function-authorize-check.js +311 -0
- package/dist/src/lib/function-authorize-check.js.map +1 -0
- package/dist/src/lib/function-authorize-view.d.ts +27 -0
- package/dist/src/lib/function-authorize-view.js +88 -0
- package/dist/src/lib/function-authorize-view.js.map +1 -0
- package/dist/src/lib/function-bundle.d.ts +27 -5
- package/dist/src/lib/function-bundle.js +142 -7
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +90 -12
- package/dist/src/lib/function-collect.js +482 -12
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +65 -11
- package/dist/src/lib/function-db-types.js +297 -157
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-document-types.d.ts +19 -7
- package/dist/src/lib/function-document-types.js +24 -12
- package/dist/src/lib/function-document-types.js.map +1 -1
- package/dist/src/lib/function-lint.d.ts +57 -0
- package/dist/src/lib/function-lint.js +234 -0
- package/dist/src/lib/function-lint.js.map +1 -0
- package/dist/src/lib/function-log-row.js +21 -2
- package/dist/src/lib/function-log-row.js.map +1 -1
- package/dist/src/lib/function-run.d.ts +13 -21
- package/dist/src/lib/function-run.js +14 -27
- package/dist/src/lib/function-run.js.map +1 -1
- package/dist/src/lib/function-schema-codegen.d.ts +86 -22
- package/dist/src/lib/function-schema-codegen.js +194 -88
- package/dist/src/lib/function-schema-codegen.js.map +1 -1
- package/dist/src/lib/function-schema-refs.d.ts +98 -0
- package/dist/src/lib/function-schema-refs.js +177 -0
- package/dist/src/lib/function-schema-refs.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +109 -6
- package/dist/src/lib/function-sync.js +179 -26
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-trigger-listing.d.ts +11 -6
- package/dist/src/lib/function-trigger-listing.js +32 -11
- package/dist/src/lib/function-trigger-listing.js.map +1 -1
- package/dist/src/lib/function-typecheck.d.ts +52 -0
- package/dist/src/lib/function-typecheck.js +174 -54
- package/dist/src/lib/function-typecheck.js.map +1 -1
- package/dist/src/lib/function-versions.d.ts +2 -0
- package/dist/src/lib/function-versions.js +1 -0
- package/dist/src/lib/function-versions.js.map +1 -1
- package/dist/src/lib/generated-build-flags.d.ts +13 -0
- package/dist/src/lib/generated-build-flags.js +14 -0
- package/dist/src/lib/generated-build-flags.js.map +1 -0
- package/dist/src/lib/generated-command-status.d.ts +6 -0
- package/dist/src/lib/generated-command-status.js +469 -0
- package/dist/src/lib/generated-command-status.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +538 -141
- package/dist/src/lib/generated-config-surfaces.js +1772 -1854
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/generated-sdk-types.d.ts +1 -1
- package/dist/src/lib/generated-sdk-types.js +1 -1
- package/dist/src/lib/generated-sdk-types.js.map +1 -1
- package/dist/src/lib/hosting-build.d.ts +97 -0
- package/dist/src/lib/hosting-build.js +204 -0
- package/dist/src/lib/hosting-build.js.map +1 -0
- package/dist/src/lib/hosting-client.d.ts +167 -0
- package/dist/src/lib/hosting-client.js +340 -0
- package/dist/src/lib/hosting-client.js.map +1 -0
- package/dist/src/lib/hosting-environments.d.ts +32 -0
- package/dist/src/lib/hosting-environments.js +74 -0
- package/dist/src/lib/hosting-environments.js.map +1 -0
- package/dist/src/lib/hosting-errors.d.ts +30 -0
- package/dist/src/lib/hosting-errors.js +43 -0
- package/dist/src/lib/hosting-errors.js.map +1 -0
- package/dist/src/lib/hosting-token.d.ts +46 -0
- package/dist/src/lib/hosting-token.js +60 -0
- package/dist/src/lib/hosting-token.js.map +1 -0
- package/dist/src/lib/hosting-wait.d.ts +42 -0
- package/dist/src/lib/hosting-wait.js +84 -0
- package/dist/src/lib/hosting-wait.js.map +1 -0
- package/dist/src/lib/hosting-wfp-upload.d.ts +86 -0
- package/dist/src/lib/hosting-wfp-upload.js +149 -0
- package/dist/src/lib/hosting-wfp-upload.js.map +1 -0
- package/dist/src/lib/init-assets.d.ts +2 -6
- package/dist/src/lib/init-assets.js +11 -27
- package/dist/src/lib/init-assets.js.map +1 -1
- package/dist/src/lib/init-ios-links.d.ts +11 -7
- package/dist/src/lib/init-ios-links.js +28 -22
- package/dist/src/lib/init-ios-links.js.map +1 -1
- package/dist/src/lib/init-login-note.d.ts +13 -0
- package/dist/src/lib/init-login-note.js +22 -0
- package/dist/src/lib/init-login-note.js.map +1 -0
- package/dist/src/lib/init-schema.d.ts +15 -0
- package/dist/src/lib/init-schema.js +54 -0
- package/dist/src/lib/init-schema.js.map +1 -1
- package/dist/src/lib/integration-test-request.d.ts +54 -0
- package/dist/src/lib/integration-test-request.js +207 -0
- package/dist/src/lib/integration-test-request.js.map +1 -0
- package/dist/src/lib/invoker-shared-enums.d.ts +35 -0
- package/dist/src/lib/invoker-shared-enums.js +98 -0
- package/dist/src/lib/invoker-shared-enums.js.map +1 -0
- package/dist/src/lib/json-value.d.ts +6 -0
- package/dist/src/lib/json-value.js +13 -0
- package/dist/src/lib/json-value.js.map +1 -0
- package/dist/src/lib/load-routes.d.ts +33 -0
- package/dist/src/lib/load-routes.js +35 -0
- package/dist/src/lib/load-routes.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +23 -4
- package/dist/src/lib/log-inspection.js +14 -5
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/login-exchange-check.d.ts +18 -0
- package/dist/src/lib/login-exchange-check.js +27 -0
- package/dist/src/lib/login-exchange-check.js.map +1 -0
- package/dist/src/lib/login-scope-lines.d.ts +17 -7
- package/dist/src/lib/login-scope-lines.js +33 -10
- package/dist/src/lib/login-scope-lines.js.map +1 -1
- package/dist/src/lib/metadata-report.d.ts +85 -0
- package/dist/src/lib/metadata-report.js +81 -0
- package/dist/src/lib/metadata-report.js.map +1 -0
- package/dist/src/lib/object-status-filter.d.ts +9 -1
- package/dist/src/lib/object-status-filter.js +9 -1
- package/dist/src/lib/object-status-filter.js.map +1 -1
- package/dist/src/lib/output.d.ts +1 -1
- package/dist/src/lib/output.js +3 -1
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/pin-refusal-hint.d.ts +12 -0
- package/dist/src/lib/pin-refusal-hint.js +35 -0
- package/dist/src/lib/pin-refusal-hint.js.map +1 -0
- package/dist/src/lib/platform-owned.js +5 -0
- package/dist/src/lib/platform-owned.js.map +1 -1
- package/dist/src/lib/primitive-declaration-names.d.ts +21 -0
- package/dist/src/lib/primitive-declaration-names.js +22 -0
- package/dist/src/lib/primitive-declaration-names.js.map +1 -0
- package/dist/src/lib/primitive-declaration.d.ts +174 -0
- package/dist/src/lib/primitive-declaration.js +792 -0
- package/dist/src/lib/primitive-declaration.js.map +1 -0
- package/dist/src/lib/primitive-env-plugin.d.ts +99 -0
- package/dist/src/lib/primitive-env-plugin.js +408 -0
- package/dist/src/lib/primitive-env-plugin.js.map +1 -0
- package/dist/src/lib/project-login-apps.d.ts +8 -0
- package/dist/src/lib/project-login-apps.js +27 -0
- package/dist/src/lib/project-login-apps.js.map +1 -0
- package/dist/src/lib/prompt-schema-codegen.d.ts +36 -12
- package/dist/src/lib/prompt-schema-codegen.js +96 -100
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
- package/dist/src/lib/prompt-schema-document.d.ts +35 -0
- package/dist/src/lib/prompt-schema-document.js +92 -0
- package/dist/src/lib/prompt-schema-document.js.map +1 -0
- package/dist/src/lib/prompt-schema-refs.d.ts +173 -0
- package/dist/src/lib/prompt-schema-refs.js +478 -0
- package/dist/src/lib/prompt-schema-refs.js.map +1 -0
- package/dist/src/lib/records-verbs.d.ts +79 -0
- package/dist/src/lib/records-verbs.js +45 -0
- package/dist/src/lib/records-verbs.js.map +1 -0
- package/dist/src/lib/register-commands.d.ts +36 -0
- package/dist/src/lib/register-commands.js +37 -0
- package/dist/src/lib/register-commands.js.map +1 -0
- package/dist/src/lib/retired-imports.d.ts +53 -0
- package/dist/src/lib/retired-imports.js +120 -0
- package/dist/src/lib/retired-imports.js.map +1 -0
- package/dist/src/lib/run-status.d.ts +1 -1
- package/dist/src/lib/run-status.generated.d.ts +2 -2
- package/dist/src/lib/run-status.generated.js +3 -1
- package/dist/src/lib/run-status.generated.js.map +1 -1
- package/dist/src/lib/run-status.js +1 -1
- package/dist/src/lib/schema-codegen/compiledSpace.d.ts +62 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js +103 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.d.ts +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js +227 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.d.ts +85 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.d.ts +218 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js +397 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-table.d.ts +80 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js +542 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.d.ts +195 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js +503 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +258 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +422 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.d.ts +129 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js +475 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.d.ts +115 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js +274 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.d.ts +366 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js +1789 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.d.ts +27 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js +126 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js.map +1 -0
- package/dist/src/lib/schema-codegen/namedRefs.d.ts +56 -0
- package/dist/src/lib/schema-codegen/namedRefs.js +143 -0
- package/dist/src/lib/schema-codegen/namedRefs.js.map +1 -0
- package/dist/src/lib/schema-codegen/naming.d.ts +35 -0
- package/dist/src/lib/schema-codegen/naming.js +83 -0
- package/dist/src/lib/schema-codegen/naming.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaChanges.d.ts +74 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js +277 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaDocs.d.ts +69 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js +219 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaIR.d.ts +158 -0
- package/dist/src/lib/schema-codegen/schemaIR.js +279 -0
- package/dist/src/lib/schema-codegen/schemaIR.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaToTs.d.ts +109 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js +269 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/schema-codegen/valuesLists.d.ts +48 -0
- package/dist/src/lib/schema-codegen/valuesLists.js +144 -0
- package/dist/src/lib/schema-codegen/valuesLists.js.map +1 -0
- package/dist/src/lib/schema-family-index.d.ts +228 -0
- package/dist/src/lib/schema-family-index.js +813 -0
- package/dist/src/lib/schema-family-index.js.map +1 -0
- package/dist/src/lib/schema-pins.d.ts +82 -0
- package/dist/src/lib/schema-pins.js +198 -0
- package/dist/src/lib/schema-pins.js.map +1 -0
- package/dist/src/lib/schema-preview.d.ts +244 -0
- package/dist/src/lib/schema-preview.js +498 -0
- package/dist/src/lib/schema-preview.js.map +1 -0
- package/dist/src/lib/scope-request.d.ts +23 -11
- package/dist/src/lib/scope-request.js +69 -31
- package/dist/src/lib/scope-request.js.map +1 -1
- package/dist/src/lib/session-scope.d.ts +26 -0
- package/dist/src/lib/session-scope.js +58 -0
- package/dist/src/lib/session-scope.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +2 -2
- package/dist/src/lib/skill-installer.js +2 -21
- package/dist/src/lib/skill-installer.js.map +1 -1
- package/dist/src/lib/step-run-table.d.ts +1 -2
- package/dist/src/lib/step-run-table.js +1 -2
- package/dist/src/lib/step-run-table.js.map +1 -1
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +2 -1
- package/dist/src/lib/swift-codegen/agentGenerator.js +25 -23
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/banners.d.ts +12 -0
- package/dist/src/lib/swift-codegen/banners.js +12 -0
- package/dist/src/lib/swift-codegen/banners.js.map +1 -1
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +36 -1
- package/dist/src/lib/swift-codegen/functionGenerator.js +169 -51
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +33 -9
- package/dist/src/lib/swift-codegen/schemaToSwift.js +215 -179
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
- package/dist/src/lib/swift-codegen/sharedGenerator.d.ts +45 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js +165 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/swiftKeys.d.ts +19 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js +31 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js.map +1 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.d.ts +30 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js +69 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +117 -31
- package/dist/src/lib/sync-resource-types.js +197 -189
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +7 -0
- package/dist/src/lib/sync-selectors.js +22 -2
- package/dist/src/lib/sync-selectors.js.map +1 -1
- package/dist/src/lib/template.d.ts +39 -3
- package/dist/src/lib/template.js +103 -14
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/lib/test-case-file-names.d.ts +3 -5
- package/dist/src/lib/test-case-file-names.js +3 -5
- package/dist/src/lib/test-case-file-names.js.map +1 -1
- package/dist/src/lib/test-runs.d.ts +45 -0
- package/dist/src/lib/test-runs.js +150 -0
- package/dist/src/lib/test-runs.js.map +1 -0
- package/dist/src/lib/test-users.d.ts +25 -0
- package/dist/src/lib/test-users.js +36 -0
- package/dist/src/lib/test-users.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +4 -2
- package/dist/src/lib/toml-database-config.js +11 -6
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/toml-scalar-edit.js +6 -4
- package/dist/src/lib/toml-scalar-edit.js.map +1 -1
- package/dist/src/lib/transition-warnings.d.ts +21 -0
- package/dist/src/lib/transition-warnings.js +49 -0
- package/dist/src/lib/transition-warnings.js.map +1 -0
- package/dist/src/lib/user-index.d.ts +80 -0
- package/dist/src/lib/user-index.js +166 -0
- package/dist/src/lib/user-index.js.map +1 -0
- package/dist/src/lib/user-properties/generated-properties-schema.d.ts +159 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js +471 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js.map +1 -0
- package/dist/src/lib/user-properties/user-properties-codegen.d.ts +55 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js +129 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js.map +1 -0
- package/dist/src/lib/user-walk.d.ts +31 -0
- package/dist/src/lib/user-walk.js +102 -0
- package/dist/src/lib/user-walk.js.map +1 -0
- package/dist/src/lib/webhook-capture.d.ts +43 -0
- package/dist/src/lib/webhook-capture.js +91 -0
- package/dist/src/lib/webhook-capture.js.map +1 -0
- package/dist/src/lib/webhook-deliver.d.ts +18 -20
- package/dist/src/lib/webhook-deliver.js +34 -89
- package/dist/src/lib/webhook-deliver.js.map +1 -1
- package/dist/src/lib/webhook-test-run.d.ts +32 -0
- package/dist/src/lib/webhook-test-run.js +108 -0
- package/dist/src/lib/webhook-test-run.js.map +1 -0
- package/dist/src/lib/worker-perf-format.d.ts +22 -0
- package/dist/src/lib/worker-perf-format.js +27 -0
- package/dist/src/lib/worker-perf-format.js.map +1 -0
- package/dist/src/types/index.d.ts +20 -65
- package/dist/src/validators.d.ts +7 -55
- package/dist/src/validators.js +7 -53
- package/dist/src/validators.js.map +1 -1
- package/dist/src/vite.d.ts +17 -0
- package/dist/src/vite.js +18 -0
- package/dist/src/vite.js.map +1 -0
- package/package.json +20 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"child-apps-local.js","sourceRoot":"","sources":["../../../src/lib/child-apps-local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGrC,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,GAEf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,GAE1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EACL,mBAAmB,E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,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;SACpC,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC,KAAK,MAAM,CAAC;AAC5E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1E,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAChC,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,MAAc;IAC1D,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,MAAM,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC;AAC/F,CAAC"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* for downstream tooling.
|
|
22
22
|
*/
|
|
23
23
|
import type { Command } from "commander";
|
|
24
|
+
import { type CommandStatus } from "./command-status.js";
|
|
24
25
|
/** Current manifest schema version. Bump on any breaking shape change. */
|
|
25
26
|
export declare const CLI_MANIFEST_SCHEMA_VERSION = 1;
|
|
26
27
|
export interface ManifestArg {
|
|
@@ -50,6 +51,14 @@ export interface ManifestCommand {
|
|
|
50
51
|
args: ManifestArg[];
|
|
51
52
|
options: ManifestOption[];
|
|
52
53
|
commands: ManifestCommand[];
|
|
54
|
+
/**
|
|
55
|
+
* The command's status: its row of the generated status table, which
|
|
56
|
+
* `registerAllCommands` applies to every command. `variants` appears only
|
|
57
|
+
* on a command whose row has them. Absent only on a tree built without the
|
|
58
|
+
* table when neither the command nor any ancestor declares a status, which
|
|
59
|
+
* reads as production and not deprecated.
|
|
60
|
+
*/
|
|
61
|
+
status?: CommandStatus;
|
|
53
62
|
}
|
|
54
63
|
export interface CliManifest {
|
|
55
64
|
schemaVersion: number;
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* shape and fail loud if a future CLI bumps it. Bumping it is a breaking change
|
|
21
21
|
* for downstream tooling.
|
|
22
22
|
*/
|
|
23
|
+
import { effectiveStatus } from "./command-status.js";
|
|
23
24
|
/** Current manifest schema version. Bump on any breaking shape change. */
|
|
24
25
|
export const CLI_MANIFEST_SCHEMA_VERSION = 1;
|
|
25
26
|
function serializeArg(arg) {
|
|
@@ -40,7 +41,7 @@ function serializeOption(opt) {
|
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
43
|
function serializeCommand(cmd) {
|
|
43
|
-
|
|
44
|
+
const serialized = {
|
|
44
45
|
name: cmd.name(),
|
|
45
46
|
description: cmd.description() || "",
|
|
46
47
|
aliases: cmd.aliases() || [],
|
|
@@ -48,6 +49,14 @@ function serializeCommand(cmd) {
|
|
|
48
49
|
options: (cmd.options || []).map(serializeOption),
|
|
49
50
|
commands: (cmd.commands || []).map(serializeCommand),
|
|
50
51
|
};
|
|
52
|
+
const status = effectiveStatus(cmd);
|
|
53
|
+
if (status) {
|
|
54
|
+
serialized.status = { stability: status.stability, deprecated: status.deprecated };
|
|
55
|
+
if (status.variants) {
|
|
56
|
+
serialized.status.variants = Object.fromEntries(Object.entries(status.variants).map(([name, variant]) => [name, { ...variant }]));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return serialized;
|
|
51
60
|
}
|
|
52
61
|
/**
|
|
53
62
|
* Build the JSON manifest for a fully-built commander program.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-manifest.js","sourceRoot":"","sources":["../../../src/lib/c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phase 3).
|
|
4
|
+
*
|
|
5
|
+
* `ApiClient.request()` sends `X-Primitive-CLI-Version` on every call, so the
|
|
6
|
+
* server can tell which CLI made a push. An unreadable package file sends
|
|
7
|
+
* `0.0.0`, the lowest version, rather than no header.
|
|
8
|
+
*/
|
|
9
|
+
/** The request header naming the CLI version that sent the request. */
|
|
10
|
+
export declare const CLI_VERSION_HEADER = "X-Primitive-CLI-Version";
|
|
11
|
+
/** The installed CLI's package version, or null when its `package.json` cannot be read. */
|
|
12
|
+
export declare function getCliVersion(): string | null;
|
|
13
|
+
/** The value `X-Primitive-CLI-Version` carries: the package version, or `0.0.0` when it cannot be read. */
|
|
14
|
+
export declare function cliVersionHeaderValue(version?: string | null): string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CLI's own version, and the header that carries it on every request
|
|
3
|
+
* (#5532, project `unified-schemas` phase 3).
|
|
4
|
+
*
|
|
5
|
+
* `ApiClient.request()` sends `X-Primitive-CLI-Version` on every call, so the
|
|
6
|
+
* server can tell which CLI made a push. An unreadable package file sends
|
|
7
|
+
* `0.0.0`, the lowest version, rather than no header.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, readFileSync } from "fs";
|
|
10
|
+
import { fileURLToPath } from "url";
|
|
11
|
+
/** The request header naming the CLI version that sent the request. */
|
|
12
|
+
export const CLI_VERSION_HEADER = "X-Primitive-CLI-Version";
|
|
13
|
+
/** The installed CLI's package version, or null when its `package.json` cannot be read. */
|
|
14
|
+
export function getCliVersion() {
|
|
15
|
+
// dist/src/lib -> package root is three levels up; src/lib (tsx) -> two
|
|
16
|
+
// levels up. Both candidates can exist (from source, ../../../ is the repo
|
|
17
|
+
// root), so require the CLI's package name to pick the right one.
|
|
18
|
+
for (const rel of ["../../../package.json", "../../package.json"]) {
|
|
19
|
+
try {
|
|
20
|
+
const path = fileURLToPath(new URL(rel, import.meta.url));
|
|
21
|
+
if (!existsSync(path))
|
|
22
|
+
continue;
|
|
23
|
+
const pkg = JSON.parse(readFileSync(path, "utf-8"));
|
|
24
|
+
if (pkg.name === "primitive-admin" && typeof pkg.version === "string") {
|
|
25
|
+
return pkg.version;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// try next path
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
/** The value `X-Primitive-CLI-Version` carries: the package version, or `0.0.0` when it cannot be read. */
|
|
35
|
+
export function cliVersionHeaderValue(version = getCliVersion()) {
|
|
36
|
+
return version ?? "0.0.0";
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=cli-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-version.js","sourceRoot":"","sources":["../../../src/lib/cli-version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,uEAAuE;AACvE,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAE5D,2FAA2F;AAC3F,MAAM,UAAU,aAAa;IAC3B,wEAAwE;IACxE,2EAA2E;IAC3E,kEAAkE;IAClE,KAAK,MAAM,GAAG,IAAI,CAAC,uBAAuB,EAAE,oBAAoB,CAAC,EAAE,CAAC;QAClE,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAC1D,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBAAE,SAAS;YAChC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;YACpD,IAAI,GAAG,CAAC,IAAI,KAAK,iBAAiB,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBACtE,OAAO,GAAG,CAAC,OAAO,CAAC;YACrB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,gBAAgB;QAClB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAAU,qBAAqB,CAAC,UAAyB,aAAa,EAAE;IAC5E,OAAO,OAAO,IAAI,OAAO,CAAC;AAC5B,CAAC"}
|
|
@@ -36,6 +36,19 @@
|
|
|
36
36
|
*/
|
|
37
37
|
/** Prettier's default `printWidth`. */
|
|
38
38
|
export declare const PRINT_WIDTH = 80;
|
|
39
|
+
/**
|
|
40
|
+
* Render a construct as Prettier prints it `levels` indentation levels deep
|
|
41
|
+
* (a declaration inside a namespace, #5544). Every line of it shifts right
|
|
42
|
+
* alike, so its width decisions are the ones it makes at column 0 with that
|
|
43
|
+
* much less width; blank lines stay blank.
|
|
44
|
+
*/
|
|
45
|
+
export declare function printedAtLevel(levels: number, render: () => string): string;
|
|
46
|
+
/**
|
|
47
|
+
* A type member key as Prettier's default `quoteProps: "as-needed"` prints
|
|
48
|
+
* it: bare when it is an identifier, else a string literal quoted the way
|
|
49
|
+
* Prettier quotes one.
|
|
50
|
+
*/
|
|
51
|
+
export declare function tsPropertyKey(name: string): string;
|
|
39
52
|
/** `level` indentation levels of 2 spaces (Prettier's default `tabWidth`). */
|
|
40
53
|
export declare function indent(level: number): string;
|
|
41
54
|
/**
|
|
@@ -68,6 +81,13 @@ export declare function tsStringLiteral(value: string): string;
|
|
|
68
81
|
* - `array` — `T[]`, parenthesized when the element needs it.
|
|
69
82
|
* - `objectType` — `{ a: A; b: B }`, breaking one member per line when the
|
|
70
83
|
* inline form does not fit.
|
|
84
|
+
* - `paren` — `(A | B)`, a union inside an intersection (#5544),
|
|
85
|
+
* breaking to `(\n | A\n | B\n)`.
|
|
86
|
+
* - `tuple` — `[A, B]` (#5544), breaking one element per line with a
|
|
87
|
+
* trailing comma.
|
|
88
|
+
* - `literalObject` — `{ a: A; b: B }` whose member types are nodes (#5544),
|
|
89
|
+
* breaking one member per line, each member's type
|
|
90
|
+
* breaking in turn.
|
|
71
91
|
*/
|
|
72
92
|
export type TypeNode = {
|
|
73
93
|
kind: "atom";
|
|
@@ -91,6 +111,18 @@ export type TypeNode = {
|
|
|
91
111
|
} | {
|
|
92
112
|
kind: "objectType";
|
|
93
113
|
members: string[];
|
|
114
|
+
} | {
|
|
115
|
+
kind: "paren";
|
|
116
|
+
inner: TypeNode;
|
|
117
|
+
} | {
|
|
118
|
+
kind: "tuple";
|
|
119
|
+
elements: TypeNode[];
|
|
120
|
+
} | {
|
|
121
|
+
kind: "literalObject";
|
|
122
|
+
members: Array<{
|
|
123
|
+
key: string;
|
|
124
|
+
value: TypeNode;
|
|
125
|
+
}>;
|
|
94
126
|
};
|
|
95
127
|
export declare const atom: (text: string) => TypeNode;
|
|
96
128
|
export declare const block: (render: (level: number) => string) => TypeNode;
|
|
@@ -98,6 +130,15 @@ export declare const union: (members: TypeNode[]) => TypeNode;
|
|
|
98
130
|
export declare const intersection: (members: TypeNode[]) => TypeNode;
|
|
99
131
|
export declare const generic: (name: string, args: TypeNode[]) => TypeNode;
|
|
100
132
|
export declare const arrayOf: (element: TypeNode) => TypeNode;
|
|
133
|
+
/** A parenthesized type: a union or intersection inside an intersection (#5544). */
|
|
134
|
+
export declare const paren: (inner: TypeNode) => TypeNode;
|
|
135
|
+
/** A tuple type `[A, B]` (#5544). */
|
|
136
|
+
export declare const tuple: (elements: TypeNode[]) => TypeNode;
|
|
137
|
+
/** An inline-first object type whose member types are nodes (#5544); `key` is already quoted as needed. */
|
|
138
|
+
export declare const literalObject: (members: Array<{
|
|
139
|
+
key: string;
|
|
140
|
+
value: TypeNode;
|
|
141
|
+
}>) => TypeNode;
|
|
101
142
|
/**
|
|
102
143
|
* An inline-first object type (`{ input: X }`). Unlike `block`, it starts
|
|
103
144
|
* inline and only breaks when it does not fit — which is exactly what Prettier
|
|
@@ -36,6 +36,35 @@
|
|
|
36
36
|
*/
|
|
37
37
|
/** Prettier's default `printWidth`. */
|
|
38
38
|
export const PRINT_WIDTH = 80;
|
|
39
|
+
/** The width every fit decision below is made against: `PRINT_WIDTH`, less the indent `printedAtLevel` shifts by. */
|
|
40
|
+
let width = PRINT_WIDTH;
|
|
41
|
+
/**
|
|
42
|
+
* Render a construct as Prettier prints it `levels` indentation levels deep
|
|
43
|
+
* (a declaration inside a namespace, #5544). Every line of it shifts right
|
|
44
|
+
* alike, so its width decisions are the ones it makes at column 0 with that
|
|
45
|
+
* much less width; blank lines stay blank.
|
|
46
|
+
*/
|
|
47
|
+
export function printedAtLevel(levels, render) {
|
|
48
|
+
const saved = width;
|
|
49
|
+
width = saved - 2 * levels;
|
|
50
|
+
try {
|
|
51
|
+
return render()
|
|
52
|
+
.split("\n")
|
|
53
|
+
.map((line) => (line === "" ? line : `${indent(levels)}${line}`))
|
|
54
|
+
.join("\n");
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
width = saved;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A type member key as Prettier's default `quoteProps: "as-needed"` prints
|
|
62
|
+
* it: bare when it is an identifier, else a string literal quoted the way
|
|
63
|
+
* Prettier quotes one.
|
|
64
|
+
*/
|
|
65
|
+
export function tsPropertyKey(name) {
|
|
66
|
+
return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) ? name : tsStringLiteral(name);
|
|
67
|
+
}
|
|
39
68
|
/** `level` indentation levels of 2 spaces (Prettier's default `tabWidth`). */
|
|
40
69
|
export function indent(level) {
|
|
41
70
|
return " ".repeat(level);
|
|
@@ -98,6 +127,15 @@ export const arrayOf = (element) => ({
|
|
|
98
127
|
kind: "array",
|
|
99
128
|
element,
|
|
100
129
|
});
|
|
130
|
+
/** A parenthesized type: a union or intersection inside an intersection (#5544). */
|
|
131
|
+
export const paren = (inner) => ({ kind: "paren", inner });
|
|
132
|
+
/** A tuple type `[A, B]` (#5544). */
|
|
133
|
+
export const tuple = (elements) => ({ kind: "tuple", elements });
|
|
134
|
+
/** An inline-first object type whose member types are nodes (#5544); `key` is already quoted as needed. */
|
|
135
|
+
export const literalObject = (members) => ({
|
|
136
|
+
kind: "literalObject",
|
|
137
|
+
members,
|
|
138
|
+
});
|
|
101
139
|
/**
|
|
102
140
|
* An inline-first object type (`{ input: X }`). Unlike `block`, it starts
|
|
103
141
|
* inline and only breaks when it does not fit — which is exactly what Prettier
|
|
@@ -126,6 +164,19 @@ function needsParensAsArrayElement(node) {
|
|
|
126
164
|
function isHuggableTypeArg(node) {
|
|
127
165
|
return node.kind === "atom" || node.kind === "block";
|
|
128
166
|
}
|
|
167
|
+
const isObjectish = (node) => node.kind === "block" || node.kind === "objectType" || node.kind === "literalObject";
|
|
168
|
+
/**
|
|
169
|
+
* True for a union Prettier HUGS (#5544): one object type followed only by
|
|
170
|
+
* `null` (or `undefined`). It prints `{ … } | null` with the object breaking in
|
|
171
|
+
* place, never the leading-pipe form.
|
|
172
|
+
*/
|
|
173
|
+
function isHuggedUnion(node) {
|
|
174
|
+
if (node.kind !== "union" || node.members.length < 2 || !isObjectish(node.members[0]))
|
|
175
|
+
return false;
|
|
176
|
+
return node.members
|
|
177
|
+
.slice(1)
|
|
178
|
+
.every((m) => m.kind === "atom" && (m.text === "null" || m.text === "undefined"));
|
|
179
|
+
}
|
|
129
180
|
/**
|
|
130
181
|
* True when an over-width node can break WITHIN itself, keeping its head on the
|
|
131
182
|
* line it starts. A lone identifier, or a generic whose single type argument is
|
|
@@ -140,6 +191,9 @@ function canBreakInPlace(node) {
|
|
|
140
191
|
case "objectType":
|
|
141
192
|
case "union":
|
|
142
193
|
case "intersection":
|
|
194
|
+
case "paren":
|
|
195
|
+
case "tuple":
|
|
196
|
+
case "literalObject":
|
|
143
197
|
return true;
|
|
144
198
|
case "array":
|
|
145
199
|
return canBreakInPlace(node.element);
|
|
@@ -184,7 +238,24 @@ export function inlineType(node) {
|
|
|
184
238
|
: `${elem}[]`;
|
|
185
239
|
}
|
|
186
240
|
case "objectType":
|
|
187
|
-
return `{ ${node.members.join("; ")} }`;
|
|
241
|
+
return node.members.length === 0 ? "{}" : `{ ${node.members.join("; ")} }`;
|
|
242
|
+
case "paren": {
|
|
243
|
+
const inner = inlineType(node.inner);
|
|
244
|
+
return inner === null ? null : `(${inner})`;
|
|
245
|
+
}
|
|
246
|
+
case "tuple": {
|
|
247
|
+
const parts = node.elements.map(inlineType);
|
|
248
|
+
return parts.some((p) => p === null) ? null : `[${parts.join(", ")}]`;
|
|
249
|
+
}
|
|
250
|
+
case "literalObject": {
|
|
251
|
+
if (node.members.length === 0)
|
|
252
|
+
return "{}";
|
|
253
|
+
const parts = node.members.map((m) => {
|
|
254
|
+
const value = inlineType(m.value);
|
|
255
|
+
return value === null ? null : `${m.key}: ${value}`;
|
|
256
|
+
});
|
|
257
|
+
return parts.some((p) => p === null) ? null : `{ ${parts.join("; ")} }`;
|
|
258
|
+
}
|
|
188
259
|
}
|
|
189
260
|
}
|
|
190
261
|
/**
|
|
@@ -199,9 +270,12 @@ function firstBreakWidth(node) {
|
|
|
199
270
|
return node.text.length;
|
|
200
271
|
case "block":
|
|
201
272
|
case "objectType":
|
|
202
|
-
|
|
273
|
+
case "paren":
|
|
274
|
+
case "tuple":
|
|
275
|
+
case "literalObject":
|
|
276
|
+
return 1; // `{`, `(` or `[`
|
|
203
277
|
case "union":
|
|
204
|
-
return 0;
|
|
278
|
+
return isHuggedUnion(node) ? firstBreakWidth(node.members[0]) : 0;
|
|
205
279
|
case "array":
|
|
206
280
|
return needsParensAsArrayElement(node.element)
|
|
207
281
|
? 1
|
|
@@ -234,7 +308,7 @@ function alwaysBreaks(node) {
|
|
|
234
308
|
*/
|
|
235
309
|
export function printType(node, col, level, reserve = 0) {
|
|
236
310
|
const inline = inlineType(node);
|
|
237
|
-
if (inline !== null && col + inline.length + reserve <=
|
|
311
|
+
if (inline !== null && col + inline.length + reserve <= width) {
|
|
238
312
|
return inline;
|
|
239
313
|
}
|
|
240
314
|
switch (node.kind) {
|
|
@@ -262,8 +336,24 @@ export function printType(node, col, level, reserve = 0) {
|
|
|
262
336
|
.join(",\n");
|
|
263
337
|
return `${node.name}<\n${inner}\n${indent(level)}>`;
|
|
264
338
|
}
|
|
265
|
-
case "union":
|
|
339
|
+
case "union": {
|
|
340
|
+
if (isHuggedUnion(node)) {
|
|
341
|
+
const tail = node.members
|
|
342
|
+
.slice(1)
|
|
343
|
+
.map((m) => ` | ${inlineType(m)}`)
|
|
344
|
+
.join("");
|
|
345
|
+
return `${printType(node.members[0], col, level, reserve + tail.length)}${tail}`;
|
|
346
|
+
}
|
|
266
347
|
return printUnionBroken(node.members, level);
|
|
348
|
+
}
|
|
349
|
+
case "paren": {
|
|
350
|
+
// Prettier breaks a parenthesized union into the leading-pipe form inside
|
|
351
|
+
// the parens, the closing paren back at the line's indent.
|
|
352
|
+
if (node.inner.kind === "union") {
|
|
353
|
+
return `(\n${indent(level + 1)}${printUnionBroken(node.inner.members, level + 1)}\n${indent(level)})`;
|
|
354
|
+
}
|
|
355
|
+
return `(${printType(node.inner, col + 1, level, reserve + 1)})`;
|
|
356
|
+
}
|
|
267
357
|
case "array": {
|
|
268
358
|
// A parenthesized element that overflows breaks inside its parens:
|
|
269
359
|
// `(\n | "a"\n | "b"\n)[]`. A bare element (identifier / generic)
|
|
@@ -288,18 +378,34 @@ export function printType(node, col, level, reserve = 0) {
|
|
|
288
378
|
// first member that cannot reach the next break opportunity — so
|
|
289
379
|
// `{ input: Short } & Omit<A, B>` breaks the `Omit<...>` argument list,
|
|
290
380
|
// while a long `{ input: VeryLong }` breaks the object instead and leaves
|
|
291
|
-
// the `Omit<...>` inline on the closing `}` line.
|
|
381
|
+
// the `Omit<...>` inline on the closing `}` line. Between two members
|
|
382
|
+
// neither of which is an object type (two parenthesized unions, #5544),
|
|
383
|
+
// a broken intersection puts the `&` at the line's end and the next
|
|
384
|
+
// member on its own line, one level in.
|
|
292
385
|
let cursor = col;
|
|
293
386
|
const parts = [];
|
|
387
|
+
let wasIndented = false;
|
|
294
388
|
node.members.forEach((m, i) => {
|
|
295
|
-
const sep = i > 0 ? " & " : "";
|
|
296
|
-
cursor += sep.length;
|
|
297
389
|
const last = i === node.members.length - 1;
|
|
298
390
|
// What follows this member before the line could next break.
|
|
299
391
|
const lookahead = last
|
|
300
392
|
? reserve
|
|
301
393
|
: 3 + firstBreakWidth(node.members[i + 1]);
|
|
302
|
-
|
|
394
|
+
if (i > 0 && !isObjectish(node.members[i - 1]) && !isObjectish(m)) {
|
|
395
|
+
const rendered = printType(m, (level + 1) * 2, level + 1, lookahead);
|
|
396
|
+
parts.push(` &\n${indent(level + 1)}${rendered}`);
|
|
397
|
+
cursor = rendered.includes("\n")
|
|
398
|
+
? lastLineWidth(rendered)
|
|
399
|
+
: (level + 1) * 2 + rendered.length;
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
const sep = i > 0 ? " & " : "";
|
|
403
|
+
cursor += sep.length;
|
|
404
|
+
const bothObjects = i > 0 && isObjectish(node.members[i - 1]) && isObjectish(m);
|
|
405
|
+
if (i > 1 && !bothObjects)
|
|
406
|
+
wasIndented = true;
|
|
407
|
+
const memberLevel = i > 1 && (!bothObjects || wasIndented) ? level + 1 : level;
|
|
408
|
+
const rendered = printType(m, cursor, memberLevel, lookahead);
|
|
303
409
|
parts.push(sep + rendered);
|
|
304
410
|
cursor = rendered.includes("\n")
|
|
305
411
|
? lastLineWidth(rendered)
|
|
@@ -313,6 +419,22 @@ export function printType(node, col, level, reserve = 0) {
|
|
|
313
419
|
.join("\n");
|
|
314
420
|
return `{\n${members}\n${indent(level)}}`;
|
|
315
421
|
}
|
|
422
|
+
case "tuple": {
|
|
423
|
+
// One element per line, each followed by a comma (`trailingComma: "all"`).
|
|
424
|
+
const elements = node.elements
|
|
425
|
+
.map((e) => `${indent(level + 1)}${printType(e, (level + 1) * 2, level + 1, 1)},`)
|
|
426
|
+
.join("\n");
|
|
427
|
+
return `[\n${elements}\n${indent(level)}]`;
|
|
428
|
+
}
|
|
429
|
+
case "literalObject": {
|
|
430
|
+
const members = node.members
|
|
431
|
+
.map((m) => {
|
|
432
|
+
const head = `${indent(level + 1)}${m.key}: `;
|
|
433
|
+
return `${head}${printType(m.value, head.length, level + 1, 1)};`;
|
|
434
|
+
})
|
|
435
|
+
.join("\n");
|
|
436
|
+
return `{\n${members}\n${indent(level)}}`;
|
|
437
|
+
}
|
|
316
438
|
}
|
|
317
439
|
}
|
|
318
440
|
/**
|
|
@@ -342,21 +464,21 @@ function printUnionBroken(members, level) {
|
|
|
342
464
|
*/
|
|
343
465
|
export function renderTypeAlias(name, node) {
|
|
344
466
|
const prefix = `export type ${name} = `;
|
|
345
|
-
if (node.kind === "union") {
|
|
467
|
+
if (node.kind === "union" && !isHuggedUnion(node)) {
|
|
346
468
|
if (!needsHeadBreak(node, prefix.length, 1)) {
|
|
347
469
|
return `${prefix}${inlineType(node)};`;
|
|
348
470
|
}
|
|
349
471
|
// When `export type <name> =` does not itself fit, Prettier switches the
|
|
350
472
|
// assignment to its break-after-operator layout: the header keeps the `=`
|
|
351
473
|
// and the union moves below it.
|
|
352
|
-
if (`export type ${name} =`.length >
|
|
474
|
+
if (`export type ${name} =`.length > width) {
|
|
353
475
|
// In that layout the union is measured afresh at its new indent — the
|
|
354
476
|
// over-long header is behind it and no longer constrains it. A union that
|
|
355
477
|
// fits there prints INLINE, with no leading pipes and no blank line
|
|
356
478
|
// (#1565 review cycle 1).
|
|
357
479
|
const inlineUnion = inlineType(node);
|
|
358
480
|
if (inlineUnion !== null &&
|
|
359
|
-
indent(1).length + inlineUnion.length + 1 <=
|
|
481
|
+
indent(1).length + inlineUnion.length + 1 <= width) {
|
|
360
482
|
return `export type ${name} =\n${indent(1)}${inlineUnion};`;
|
|
361
483
|
}
|
|
362
484
|
// Only when it still does not fit does it break, and then the assignment's
|
|
@@ -370,7 +492,7 @@ export function renderTypeAlias(name, node) {
|
|
|
370
492
|
return `export type ${name} =\n${indent(1)}${body};`;
|
|
371
493
|
}
|
|
372
494
|
const inline = inlineType(node);
|
|
373
|
-
if (inline !== null && prefix.length + inline.length + 1 <=
|
|
495
|
+
if (inline !== null && prefix.length + inline.length + 1 <= width) {
|
|
374
496
|
return `${prefix}${inline};`;
|
|
375
497
|
}
|
|
376
498
|
const broken = `export type ${name} =\n${indent(1)}${printType(node, 2, 1, 1)};`;
|
|
@@ -382,7 +504,7 @@ export function renderTypeAlias(name, node) {
|
|
|
382
504
|
return broken;
|
|
383
505
|
// A breakable one only has to reach its first break point (`<` / `{`) on the
|
|
384
506
|
// `=` line; it breaks open from there.
|
|
385
|
-
if (prefix.length + firstBreakWidth(node) >
|
|
507
|
+
if (prefix.length + firstBreakWidth(node) > width)
|
|
386
508
|
return broken;
|
|
387
509
|
return `${prefix}${printType(node, prefix.length, 0, 1)};`;
|
|
388
510
|
}
|
|
@@ -405,12 +527,12 @@ export function renderMember(level, name, optional, node) {
|
|
|
405
527
|
* intersection breaks in place, keeping its head on the prefix's line.
|
|
406
528
|
*/
|
|
407
529
|
function needsHeadBreak(node, col, reserve) {
|
|
408
|
-
if (node.kind !== "union")
|
|
530
|
+
if (node.kind !== "union" || isHuggedUnion(node))
|
|
409
531
|
return false;
|
|
410
532
|
if (alwaysBreaks(node))
|
|
411
533
|
return true;
|
|
412
534
|
const inline = inlineType(node);
|
|
413
|
-
return col + inline.length + reserve >
|
|
535
|
+
return col + inline.length + reserve > width;
|
|
414
536
|
}
|
|
415
537
|
/** A parameter entry's single-line form, or null when its type must break. */
|
|
416
538
|
function paramInline(entry) {
|
|
@@ -432,7 +554,7 @@ export function renderParenList(prefix, entries, tail, level) {
|
|
|
432
554
|
const inlines = entries.map(paramInline);
|
|
433
555
|
if (inlines.every((e) => e !== null)) {
|
|
434
556
|
const inline = `${prefix}(${inlines.join(", ")})${tail}`;
|
|
435
|
-
if (inline.length <=
|
|
557
|
+
if (inline.length <= width)
|
|
436
558
|
return inline;
|
|
437
559
|
}
|
|
438
560
|
const body = entries
|
|
@@ -473,7 +595,7 @@ export function renderCall(prefix, leadingArgs, objectMembers, level, tail = "")
|
|
|
473
595
|
// straight to one argument per line (with a trailing comma).
|
|
474
596
|
if (objectMembers === undefined) {
|
|
475
597
|
const oneLine = `${prefix}(${leadingArgs.join(", ")})${tail}`;
|
|
476
|
-
if (calleeWidth + oneLine.length - prefix.length <=
|
|
598
|
+
if (calleeWidth + oneLine.length - prefix.length <= width) {
|
|
477
599
|
return oneLine;
|
|
478
600
|
}
|
|
479
601
|
const broken = leadingArgs
|
|
@@ -484,17 +606,17 @@ export function renderCall(prefix, leadingArgs, objectMembers, level, tail = "")
|
|
|
484
606
|
const objectInline = `{ ${objectMembers.map(memberInline).join(", ")} }`;
|
|
485
607
|
const args = [...leadingArgs, objectInline];
|
|
486
608
|
const oneLine = `${prefix}(${args.join(", ")})${tail}`;
|
|
487
|
-
if (calleeWidth + oneLine.length - prefix.length <=
|
|
609
|
+
if (calleeWidth + oneLine.length - prefix.length <= width) {
|
|
488
610
|
return oneLine;
|
|
489
611
|
}
|
|
490
612
|
const hugHead = `${prefix}(${leadingArgs.map((a) => `${a}, `).join("")}{`;
|
|
491
|
-
if (calleeWidth + hugHead.length - prefix.length <=
|
|
613
|
+
if (calleeWidth + hugHead.length - prefix.length <= width) {
|
|
492
614
|
return `${hugHead}\n${objectBody(objectMembers, level)}\n${indent(level)}})${tail}`;
|
|
493
615
|
}
|
|
494
616
|
// One argument per line. The object argument stays inline on its line if it
|
|
495
617
|
// fits there; otherwise it expands too.
|
|
496
618
|
const objectLine = `${indent(level + 1)}${objectInline},`;
|
|
497
|
-
const objectArg = objectLine.length <=
|
|
619
|
+
const objectArg = objectLine.length <= width
|
|
498
620
|
? objectLine
|
|
499
621
|
: `${indent(level + 1)}{\n${objectBody(objectMembers, level + 1)}\n${indent(level + 1)}},`;
|
|
500
622
|
const broken = [
|
|
@@ -517,7 +639,7 @@ function objectBody(members, level) {
|
|
|
517
639
|
return members
|
|
518
640
|
.map((m) => {
|
|
519
641
|
const line = `${indent(level + 1)}${memberInline(m)},`;
|
|
520
|
-
if (line.length <=
|
|
642
|
+
if (line.length <= width || typeof m === "string")
|
|
521
643
|
return line;
|
|
522
644
|
return `${indent(level + 1)}${m.key}:\n${indent(level + 2)}${m.value},`;
|
|
523
645
|
})
|
|
@@ -542,7 +664,7 @@ export function renderArrowCall(opts) {
|
|
|
542
664
|
: [...leadingArgs, `{ ${objectMembers.map(memberInline).join(", ")} }`];
|
|
543
665
|
const oneLine = `${calleeInline}(${args.join(", ")})${tail}`;
|
|
544
666
|
if (calleeInline !== null &&
|
|
545
|
-
lastLineWidth(head) + 1 + oneLine.length <=
|
|
667
|
+
lastLineWidth(head) + 1 + oneLine.length <= width) {
|
|
546
668
|
return `${head} ${oneLine}`;
|
|
547
669
|
}
|
|
548
670
|
const prefix = indent(level) + printType(callee, level * 2, level, 1);
|
|
@@ -586,7 +708,7 @@ export function renderArrowProperty(opts) {
|
|
|
586
708
|
const tail = opts.tail ?? "";
|
|
587
709
|
const keyPrefix = `${indent(level)}${key}: `;
|
|
588
710
|
// `+ 1` is the arrow's `(` — its first break opportunity.
|
|
589
|
-
if (keyPrefix.length + 1 >
|
|
711
|
+
if (keyPrefix.length + 1 > width) {
|
|
590
712
|
const head = renderParenList(indent(level + 1), params, signatureTail, level + 1);
|
|
591
713
|
const body = renderArrowCall({
|
|
592
714
|
head,
|