primitive-admin 1.1.0-alpha.9 → 1.1.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 +523 -109
- package/assets/skill/skills/primitive-platform/SKILL.md +289 -0
- package/dist/bin/primitive.d.ts +2 -0
- package/dist/bin/primitive.js +372 -21
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.d.ts +2 -0
- package/dist/src/commands/admins.js +136 -30
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/analytics.d.ts +2 -0
- package/dist/src/commands/analytics.js +713 -55
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps.d.ts +2 -0
- package/dist/src/commands/apps.js +65 -100
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.d.ts +7 -0
- package/dist/src/commands/auth-sessions.js +144 -0
- package/dist/src/commands/auth-sessions.js.map +1 -0
- package/dist/src/commands/auth.d.ts +2 -0
- package/dist/src/commands/auth.js +238 -108
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.d.ts +2 -0
- package/dist/src/commands/blob-buckets.js +331 -0
- package/dist/src/commands/blob-buckets.js.map +1 -0
- package/dist/src/commands/catalog.d.ts +2 -0
- package/dist/src/commands/catalog.js +63 -48
- package/dist/src/commands/catalog.js.map +1 -1
- package/dist/src/commands/collection-type-configs.d.ts +2 -0
- package/dist/src/commands/collection-type-configs.js +85 -0
- package/dist/src/commands/collection-type-configs.js.map +1 -0
- package/dist/src/commands/collections.d.ts +2 -0
- package/dist/src/commands/collections.js +1282 -0
- package/dist/src/commands/collections.js.map +1 -0
- package/dist/src/commands/comparisons.d.ts +2 -0
- package/dist/src/commands/comparisons.js +6 -6
- package/dist/src/commands/comparisons.js.map +1 -1
- package/dist/src/commands/config.d.ts +46 -0
- package/dist/src/commands/config.js +465 -0
- package/dist/src/commands/config.js.map +1 -0
- package/dist/src/commands/connections.d.ts +2 -0
- package/dist/src/commands/connections.js +99 -0
- package/dist/src/commands/connections.js.map +1 -0
- package/dist/src/commands/cron-triggers.d.ts +2 -0
- package/dist/src/commands/cron-triggers.js +266 -0
- package/dist/src/commands/cron-triggers.js.map +1 -0
- package/dist/src/commands/database-type-configs.d.ts +2 -0
- package/dist/src/commands/database-type-configs.js +164 -0
- package/dist/src/commands/database-type-configs.js.map +1 -0
- package/dist/src/commands/database-types.d.ts +2 -0
- package/dist/src/commands/database-types.js +471 -0
- package/dist/src/commands/database-types.js.map +1 -0
- package/dist/src/commands/databases.d.ts +65 -0
- package/dist/src/commands/databases.js +1887 -243
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +60 -0
- package/dist/src/commands/documents.js +2888 -22
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.d.ts +2 -0
- package/dist/src/commands/email-templates.js +175 -0
- package/dist/src/commands/email-templates.js.map +1 -0
- package/dist/src/commands/env.d.ts +23 -0
- package/dist/src/commands/env.js +395 -0
- package/dist/src/commands/env.js.map +1 -0
- package/dist/src/commands/feature-flags.d.ts +14 -0
- package/dist/src/commands/feature-flags.js +117 -0
- package/dist/src/commands/feature-flags.js.map +1 -0
- package/dist/src/commands/functions.d.ts +20 -0
- package/dist/src/commands/functions.js +1630 -0
- package/dist/src/commands/functions.js.map +1 -0
- package/dist/src/commands/group-type-configs.d.ts +2 -0
- package/dist/src/commands/group-type-configs.js +87 -0
- package/dist/src/commands/group-type-configs.js.map +1 -0
- package/dist/src/commands/groups.d.ts +2 -0
- package/dist/src/commands/groups.js +65 -113
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.d.ts +223 -0
- package/dist/src/commands/guides.js +627 -69
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +37 -0
- package/dist/src/commands/init.js +1693 -208
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.d.ts +2 -0
- package/dist/src/commands/integrations.js +428 -187
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.d.ts +2 -0
- package/dist/src/commands/llm.js +4 -2
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/locks.d.ts +8 -0
- package/dist/src/commands/locks.js +175 -0
- package/dist/src/commands/locks.js.map +1 -0
- package/dist/src/commands/metadata-category-configs.d.ts +12 -0
- package/dist/src/commands/metadata-category-configs.js +113 -0
- package/dist/src/commands/metadata-category-configs.js.map +1 -0
- package/dist/src/commands/metadata.d.ts +2 -0
- package/dist/src/commands/metadata.js +288 -0
- package/dist/src/commands/metadata.js.map +1 -0
- package/dist/src/commands/prompts.d.ts +2 -0
- package/dist/src/commands/prompts.js +322 -634
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.d.ts +3 -0
- package/dist/src/commands/rule-sets.js +139 -148
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/scripts.d.ts +30 -0
- package/dist/src/commands/scripts.js +688 -0
- package/dist/src/commands/scripts.js.map +1 -0
- package/dist/src/commands/secrets.d.ts +2 -0
- package/dist/src/commands/secrets.js +109 -0
- package/dist/src/commands/secrets.js.map +1 -0
- package/dist/src/commands/sessions.d.ts +2 -0
- package/dist/src/commands/sessions.js +76 -0
- package/dist/src/commands/sessions.js.map +1 -0
- package/dist/src/commands/skill.d.ts +2 -0
- package/dist/src/commands/skill.js +29 -0
- package/dist/src/commands/skill.js.map +1 -0
- package/dist/src/commands/sync-app-settings.d.ts +158 -0
- package/dist/src/commands/sync-app-settings.js +328 -0
- package/dist/src/commands/sync-app-settings.js.map +1 -0
- package/dist/src/commands/sync.d.ts +2670 -0
- package/dist/src/commands/sync.js +17144 -834
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.d.ts +2 -0
- package/dist/src/commands/tokens.js +132 -22
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.d.ts +2 -0
- package/dist/src/commands/users.js +542 -24
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.d.ts +8 -0
- package/dist/src/commands/vars.js +97 -0
- package/dist/src/commands/vars.js.map +1 -0
- package/dist/src/commands/waitlist.d.ts +2 -0
- package/dist/src/commands/waitlist.js +12 -11
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +31 -0
- package/dist/src/commands/webhooks.js +633 -0
- package/dist/src/commands/webhooks.js.map +1 -0
- package/dist/src/commands/workflows.d.ts +88 -0
- package/dist/src/commands/workflows.js +1568 -742
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/access-rule-display.d.ts +21 -0
- package/dist/src/lib/access-rule-display.js +34 -0
- package/dist/src/lib/access-rule-display.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +2550 -0
- package/dist/src/lib/api-client.js +2503 -160
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +263 -0
- package/dist/src/lib/app-settings-descriptor.js +583 -0
- package/dist/src/lib/app-settings-descriptor.js.map +1 -0
- package/dist/src/lib/auth-flow.d.ts +8 -0
- package/dist/src/lib/batch.d.ts +26 -0
- package/dist/src/lib/batch.js +32 -0
- package/dist/src/lib/batch.js.map +1 -0
- package/dist/src/lib/block-layout.d.ts +160 -0
- package/dist/src/lib/block-layout.js +451 -0
- package/dist/src/lib/block-layout.js.map +1 -0
- package/dist/src/lib/block-selector.d.ts +58 -0
- package/dist/src/lib/block-selector.js +92 -0
- package/dist/src/lib/block-selector.js.map +1 -0
- package/dist/src/lib/canonical-json.d.ts +12 -0
- package/dist/src/lib/canonical-json.js +35 -0
- package/dist/src/lib/canonical-json.js.map +1 -0
- package/dist/src/lib/channel.d.ts +30 -0
- package/dist/src/lib/channel.js +68 -0
- package/dist/src/lib/channel.js.map +1 -0
- package/dist/src/lib/cli-manifest.d.ts +68 -0
- package/dist/src/lib/cli-manifest.js +71 -0
- package/dist/src/lib/cli-manifest.js.map +1 -0
- package/dist/src/lib/codegen-shared/generatedFiles.d.ts +101 -0
- package/dist/src/lib/codegen-shared/generatedFiles.js +191 -0
- package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -0
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +262 -0
- package/dist/src/lib/codegen-shared/prettierStable.js +610 -0
- package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +38 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +46 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -0
- package/dist/src/lib/collection-export.d.ts +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.d.ts +127 -0
- package/dist/src/lib/config-object-descriptor.js +740 -0
- package/dist/src/lib/config-object-descriptor.js.map +1 -0
- package/dist/src/lib/config-payload.d.ts +92 -0
- package/dist/src/lib/config-payload.js +161 -0
- package/dist/src/lib/config-payload.js.map +1 -0
- package/dist/src/lib/config-surface.d.ts +141 -0
- package/dist/src/lib/config-surface.js +368 -0
- package/dist/src/lib/config-surface.js.map +1 -0
- package/dist/src/lib/config-toml.d.ts +10 -0
- package/dist/src/lib/config-toml.js +42 -0
- package/dist/src/lib/config-toml.js.map +1 -0
- package/dist/src/lib/config.d.ts +71 -0
- package/dist/src/lib/config.js +71 -68
- package/dist/src/lib/config.js.map +1 -1
- package/dist/src/lib/confirm-prompt.d.ts +83 -0
- package/dist/src/lib/confirm-prompt.js +110 -0
- package/dist/src/lib/confirm-prompt.js.map +1 -0
- package/dist/src/lib/constants.d.ts +11 -0
- package/dist/src/lib/constants.js +12 -0
- package/dist/src/lib/constants.js.map +1 -0
- package/dist/src/lib/crash-handlers.d.ts +20 -0
- package/dist/src/lib/crash-handlers.js +49 -0
- package/dist/src/lib/crash-handlers.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +104 -0
- package/dist/src/lib/credentials-store.js +336 -0
- package/dist/src/lib/credentials-store.js.map +1 -0
- package/dist/src/lib/csv.d.ts +47 -0
- package/dist/src/lib/csv.js +172 -0
- package/dist/src/lib/csv.js.map +1 -0
- package/dist/src/lib/data-input.d.ts +23 -0
- package/dist/src/lib/data-input.js +50 -0
- package/dist/src/lib/data-input.js.map +1 -0
- package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
- package/dist/src/lib/db-codegen/dbFingerprint.js +17 -0
- package/dist/src/lib/db-codegen/dbFingerprint.js.map +1 -0
- package/dist/src/lib/db-codegen/dbGenerator.d.ts +67 -0
- package/dist/src/lib/db-codegen/dbGenerator.js +170 -0
- package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -0
- package/dist/src/lib/db-codegen/dbNaming.d.ts +87 -0
- package/dist/src/lib/db-codegen/dbNaming.js +180 -0
- package/dist/src/lib/db-codegen/dbNaming.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +272 -0
- package/dist/src/lib/db-codegen/dbTemplates.js +480 -0
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +73 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js +139 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +146 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js +525 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.d.ts +112 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js +211 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js.map +1 -0
- package/dist/src/lib/deprecation.d.ts +22 -0
- package/dist/src/lib/deprecation.js +43 -0
- package/dist/src/lib/deprecation.js.map +1 -0
- package/dist/src/lib/document-export-permissions.d.ts +30 -0
- package/dist/src/lib/document-export-permissions.js +54 -0
- package/dist/src/lib/document-export-permissions.js.map +1 -0
- package/dist/src/lib/document-ingest-artifact.d.ts +120 -0
- package/dist/src/lib/document-ingest-artifact.js +505 -0
- package/dist/src/lib/document-ingest-artifact.js.map +1 -0
- package/dist/src/lib/document-ingest-input.d.ts +51 -0
- package/dist/src/lib/document-ingest-input.js +132 -0
- package/dist/src/lib/document-ingest-input.js.map +1 -0
- package/dist/src/lib/document-ingest-rows.d.ts +137 -0
- package/dist/src/lib/document-ingest-rows.js +181 -0
- package/dist/src/lib/document-ingest-rows.js.map +1 -0
- package/dist/src/lib/document-ingest.d.ts +101 -0
- package/dist/src/lib/document-ingest.js +384 -0
- package/dist/src/lib/document-ingest.js.map +1 -0
- package/dist/src/lib/env-resolver-core.d.ts +258 -0
- package/dist/src/lib/env-resolver-core.js +447 -0
- package/dist/src/lib/env-resolver-core.js.map +1 -0
- package/dist/src/lib/env-resolver.d.ts +99 -0
- package/dist/src/lib/env-resolver.js +153 -0
- package/dist/src/lib/env-resolver.js.map +1 -0
- package/dist/src/lib/fetch.d.ts +5 -0
- package/dist/src/lib/function-bundle.d.ts +147 -0
- package/dist/src/lib/function-bundle.js +341 -0
- package/dist/src/lib/function-bundle.js.map +1 -0
- package/dist/src/lib/function-collect.d.ts +123 -0
- package/dist/src/lib/function-collect.js +610 -0
- package/dist/src/lib/function-collect.js.map +1 -0
- package/dist/src/lib/function-db-types.d.ts +202 -0
- package/dist/src/lib/function-db-types.js +870 -0
- package/dist/src/lib/function-db-types.js.map +1 -0
- package/dist/src/lib/function-document-types.d.ts +144 -0
- package/dist/src/lib/function-document-types.js +370 -0
- package/dist/src/lib/function-document-types.js.map +1 -0
- package/dist/src/lib/function-grants-preflight.d.ts +64 -0
- package/dist/src/lib/function-grants-preflight.js +105 -0
- package/dist/src/lib/function-grants-preflight.js.map +1 -0
- package/dist/src/lib/function-log-lines.d.ts +76 -0
- package/dist/src/lib/function-log-lines.js +160 -0
- package/dist/src/lib/function-log-lines.js.map +1 -0
- package/dist/src/lib/function-log-row.d.ts +29 -0
- package/dist/src/lib/function-log-row.js +73 -0
- package/dist/src/lib/function-log-row.js.map +1 -0
- package/dist/src/lib/function-log-tail.d.ts +132 -0
- package/dist/src/lib/function-log-tail.js +262 -0
- package/dist/src/lib/function-log-tail.js.map +1 -0
- package/dist/src/lib/function-run.d.ts +289 -0
- package/dist/src/lib/function-run.js +389 -0
- package/dist/src/lib/function-run.js.map +1 -0
- package/dist/src/lib/function-schema-codegen.d.ts +143 -0
- package/dist/src/lib/function-schema-codegen.js +420 -0
- package/dist/src/lib/function-schema-codegen.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +459 -0
- package/dist/src/lib/function-sync.js +1258 -0
- package/dist/src/lib/function-sync.js.map +1 -0
- package/dist/src/lib/function-trigger-listing.d.ts +27 -0
- package/dist/src/lib/function-trigger-listing.js +70 -0
- package/dist/src/lib/function-trigger-listing.js.map +1 -0
- package/dist/src/lib/function-typecheck.d.ts +86 -0
- package/dist/src/lib/function-typecheck.js +370 -0
- package/dist/src/lib/function-typecheck.js.map +1 -0
- package/dist/src/lib/function-versions.d.ts +122 -0
- package/dist/src/lib/function-versions.js +182 -0
- package/dist/src/lib/function-versions.js.map +1 -0
- package/dist/src/lib/generated-allowlist.d.ts +28 -0
- package/dist/src/lib/generated-allowlist.js +281 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +2936 -0
- package/dist/src/lib/generated-config-surfaces.js +10569 -0
- package/dist/src/lib/generated-config-surfaces.js.map +1 -0
- package/dist/src/lib/generated-sdk-types.d.ts +12 -0
- package/dist/src/lib/generated-sdk-types.js +13 -0
- package/dist/src/lib/generated-sdk-types.js.map +1 -0
- package/dist/src/lib/generated-template-lint.d.ts +212 -0
- package/dist/src/lib/generated-template-lint.js +624 -0
- package/dist/src/lib/generated-template-lint.js.map +1 -0
- package/dist/src/lib/init-adopt.d.ts +16 -0
- package/dist/src/lib/init-adopt.js +34 -0
- package/dist/src/lib/init-adopt.js.map +1 -0
- package/dist/src/lib/init-assets.d.ts +39 -0
- package/dist/src/lib/init-assets.js +97 -0
- package/dist/src/lib/init-assets.js.map +1 -0
- package/dist/src/lib/init-client-platforms.d.ts +14 -0
- package/dist/src/lib/init-client-platforms.js +71 -0
- package/dist/src/lib/init-client-platforms.js.map +1 -0
- package/dist/src/lib/init-config.d.ts +98 -0
- package/dist/src/lib/init-config.js +186 -0
- package/dist/src/lib/init-config.js.map +1 -0
- package/dist/src/lib/init-email-redirect-uris.d.ts +37 -0
- package/dist/src/lib/init-email-redirect-uris.js +46 -0
- package/dist/src/lib/init-email-redirect-uris.js.map +1 -0
- package/dist/src/lib/init-ios-links.d.ts +91 -0
- package/dist/src/lib/init-ios-links.js +219 -0
- package/dist/src/lib/init-ios-links.js.map +1 -0
- package/dist/src/lib/init-plan.d.ts +80 -0
- package/dist/src/lib/init-plan.js +95 -0
- package/dist/src/lib/init-plan.js.map +1 -0
- package/dist/src/lib/init-production-env.d.ts +48 -0
- package/dist/src/lib/init-production-env.js +59 -0
- package/dist/src/lib/init-production-env.js.map +1 -0
- package/dist/src/lib/init-schema.d.ts +74 -0
- package/dist/src/lib/init-schema.js +358 -0
- package/dist/src/lib/init-schema.js.map +1 -0
- package/dist/src/lib/init-xcode.d.ts +34 -0
- package/dist/src/lib/init-xcode.js +138 -0
- package/dist/src/lib/init-xcode.js.map +1 -0
- package/dist/src/lib/integration-request-config.d.ts +30 -0
- package/dist/src/lib/integration-request-config.js +145 -0
- package/dist/src/lib/integration-request-config.js.map +1 -0
- package/dist/src/lib/integration-selector.d.ts +42 -0
- package/dist/src/lib/integration-selector.js +46 -0
- package/dist/src/lib/integration-selector.js.map +1 -0
- package/dist/src/lib/ios-app-id.d.ts +34 -0
- package/dist/src/lib/ios-app-id.js +69 -0
- package/dist/src/lib/ios-app-id.js.map +1 -0
- package/dist/src/lib/list-options.d.ts +68 -0
- package/dist/src/lib/list-options.js +89 -0
- package/dist/src/lib/list-options.js.map +1 -0
- package/dist/src/lib/local-state.d.ts +55 -0
- package/dist/src/lib/local-state.js +167 -0
- package/dist/src/lib/local-state.js.map +1 -0
- package/dist/src/lib/local-test-cases.d.ts +63 -0
- package/dist/src/lib/local-test-cases.js +136 -0
- package/dist/src/lib/local-test-cases.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +715 -0
- package/dist/src/lib/log-inspection.js +816 -0
- package/dist/src/lib/log-inspection.js.map +1 -0
- package/dist/src/lib/logout-admin-session.d.ts +33 -0
- package/dist/src/lib/logout-admin-session.js +70 -0
- package/dist/src/lib/logout-admin-session.js.map +1 -0
- package/dist/src/lib/migration-nag.d.ts +49 -0
- package/dist/src/lib/migration-nag.js +163 -0
- package/dist/src/lib/migration-nag.js.map +1 -0
- package/dist/src/lib/object-status-filter.d.ts +22 -0
- package/dist/src/lib/object-status-filter.js +45 -0
- package/dist/src/lib/object-status-filter.js.map +1 -0
- package/dist/src/lib/output.d.ts +124 -0
- package/dist/src/lib/output.js +219 -8
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/package-manager.d.ts +140 -0
- package/dist/src/lib/package-manager.js +305 -0
- package/dist/src/lib/package-manager.js.map +1 -0
- package/dist/src/lib/paginate.d.ts +98 -0
- package/dist/src/lib/paginate.js +112 -0
- package/dist/src/lib/paginate.js.map +1 -0
- package/dist/src/lib/platform-owned.d.ts +63 -0
- package/dist/src/lib/platform-owned.js +85 -0
- package/dist/src/lib/platform-owned.js.map +1 -0
- package/dist/src/lib/project-config.d.ts +122 -0
- package/dist/src/lib/project-config.js +244 -0
- package/dist/src/lib/project-config.js.map +1 -0
- package/dist/src/lib/prompt-cost-format.d.ts +11 -0
- package/dist/src/lib/prompt-cost-format.js +41 -0
- package/dist/src/lib/prompt-cost-format.js.map +1 -0
- package/dist/src/lib/prompt-schema-codegen.d.ts +147 -0
- package/dist/src/lib/prompt-schema-codegen.js +462 -0
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -0
- package/dist/src/lib/query-operators.d.ts +43 -0
- package/dist/src/lib/query-operators.js +80 -0
- package/dist/src/lib/query-operators.js.map +1 -0
- package/dist/src/lib/record-filter.d.ts +18 -0
- package/dist/src/lib/record-filter.js +55 -0
- package/dist/src/lib/record-filter.js.map +1 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +73 -0
- package/dist/src/lib/refresh-admin-credentials.js +123 -0
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -0
- package/dist/src/lib/resolve-init-dev-port.d.ts +56 -0
- package/dist/src/lib/resolve-init-dev-port.js +55 -0
- package/dist/src/lib/resolve-init-dev-port.js.map +1 -0
- package/dist/src/lib/resolve-init-server.d.ts +64 -0
- package/dist/src/lib/resolve-init-server.js +77 -0
- package/dist/src/lib/resolve-init-server.js.map +1 -0
- package/dist/src/lib/resolve-owner.d.ts +19 -0
- package/dist/src/lib/resolve-owner.js +20 -0
- package/dist/src/lib/resolve-owner.js.map +1 -0
- package/dist/src/lib/resolve-platform.d.ts +74 -0
- package/dist/src/lib/resolve-platform.js +105 -0
- package/dist/src/lib/resolve-platform.js.map +1 -0
- package/dist/src/lib/run-status.d.ts +19 -0
- package/dist/src/lib/run-status.generated.d.ts +39 -0
- package/dist/src/lib/run-status.generated.js +66 -0
- package/dist/src/lib/run-status.generated.js.map +1 -0
- package/dist/src/lib/run-status.js +19 -0
- package/dist/src/lib/run-status.js.map +1 -0
- package/dist/src/lib/server-text-normalization.d.ts +51 -0
- package/dist/src/lib/server-text-normalization.js +90 -0
- package/dist/src/lib/server-text-normalization.js.map +1 -0
- package/dist/src/lib/server-url.d.ts +22 -0
- package/dist/src/lib/server-url.js +33 -0
- package/dist/src/lib/server-url.js.map +1 -0
- package/dist/src/lib/signing-secret-status.d.ts +81 -0
- package/dist/src/lib/signing-secret-status.js +116 -0
- package/dist/src/lib/signing-secret-status.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +71 -0
- package/dist/src/lib/skill-installer.js +441 -0
- package/dist/src/lib/skill-installer.js.map +1 -0
- package/dist/src/lib/snapshot-audit-source.d.ts +45 -0
- package/dist/src/lib/snapshot-audit-source.js +58 -0
- package/dist/src/lib/snapshot-audit-source.js.map +1 -0
- package/dist/src/lib/snapshot-audit-store.d.ts +52 -0
- package/dist/src/lib/snapshot-audit-store.js +196 -0
- package/dist/src/lib/snapshot-audit-store.js.map +1 -0
- package/dist/src/lib/snapshot-audit.d.ts +207 -0
- package/dist/src/lib/snapshot-audit.js +431 -0
- package/dist/src/lib/snapshot-audit.js.map +1 -0
- package/dist/src/lib/snapshot-build-rows.d.ts +60 -0
- package/dist/src/lib/snapshot-build-rows.js +87 -0
- package/dist/src/lib/snapshot-build-rows.js.map +1 -0
- package/dist/src/lib/snapshot-build.d.ts +50 -0
- package/dist/src/lib/snapshot-build.js +111 -0
- package/dist/src/lib/snapshot-build.js.map +1 -0
- package/dist/src/lib/snapshot-manifest-layout.d.ts +61 -0
- package/dist/src/lib/snapshot-manifest-layout.js +70 -0
- package/dist/src/lib/snapshot-manifest-layout.js.map +1 -0
- package/dist/src/lib/snapshots.d.ts +98 -0
- package/dist/src/lib/snapshots.js +294 -0
- package/dist/src/lib/snapshots.js.map +1 -0
- package/dist/src/lib/step-run-table.d.ts +43 -0
- package/dist/src/lib/step-run-table.js +129 -0
- package/dist/src/lib/step-run-table.js.map +1 -0
- package/dist/src/lib/storage-pending-retry.d.ts +26 -0
- package/dist/src/lib/storage-pending-retry.js +42 -0
- package/dist/src/lib/storage-pending-retry.js.map +1 -0
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +42 -0
- package/dist/src/lib/swift-codegen/agentGenerator.js +118 -0
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/banners.d.ts +24 -0
- package/dist/src/lib/swift-codegen/banners.js +25 -0
- package/dist/src/lib/swift-codegen/banners.js.map +1 -0
- package/dist/src/lib/swift-codegen/dbGenerator.d.ts +113 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js +926 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.d.ts +42 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.js +100 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.js.map +1 -0
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +139 -0
- package/dist/src/lib/swift-codegen/functionGenerator.js +462 -0
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/generator.d.ts +100 -0
- package/dist/src/lib/swift-codegen/generator.js +457 -0
- package/dist/src/lib/swift-codegen/generator.js.map +1 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +87 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js +661 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.d.ts +94 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.js +155 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.js.map +1 -0
- package/dist/src/lib/swift-codegen/swiftNaming.d.ts +85 -0
- package/dist/src/lib/swift-codegen/swiftNaming.js +198 -0
- package/dist/src/lib/swift-codegen/swiftNaming.js.map +1 -0
- package/dist/src/lib/sync-dir-selector.d.ts +21 -0
- package/dist/src/lib/sync-dir-selector.js +30 -0
- package/dist/src/lib/sync-dir-selector.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +128 -0
- package/dist/src/lib/sync-paths.js +195 -0
- package/dist/src/lib/sync-paths.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +563 -0
- package/dist/src/lib/sync-resource-types.js +1073 -0
- package/dist/src/lib/sync-resource-types.js.map +1 -0
- package/dist/src/lib/sync-selectors.d.ts +138 -0
- package/dist/src/lib/sync-selectors.js +289 -0
- package/dist/src/lib/sync-selectors.js.map +1 -0
- package/dist/src/lib/template.d.ts +170 -0
- package/dist/src/lib/template.js +484 -68
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/lib/test-case-file-names.d.ts +40 -0
- package/dist/src/lib/test-case-file-names.js +91 -0
- package/dist/src/lib/test-case-file-names.js.map +1 -0
- package/dist/src/lib/test-case-keys.d.ts +29 -0
- package/dist/src/lib/test-case-keys.js +55 -0
- package/dist/src/lib/test-case-keys.js.map +1 -0
- package/dist/src/lib/test-case-variables.d.ts +29 -0
- package/dist/src/lib/test-case-variables.js +71 -0
- package/dist/src/lib/test-case-variables.js.map +1 -0
- package/dist/src/lib/token-inject.d.ts +56 -0
- package/dist/src/lib/token-inject.js +204 -0
- package/dist/src/lib/token-inject.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +123 -0
- package/dist/src/lib/toml-database-config.js +544 -0
- package/dist/src/lib/toml-database-config.js.map +1 -0
- package/dist/src/lib/toml-metadata-config.d.ts +151 -0
- package/dist/src/lib/toml-metadata-config.js +476 -0
- package/dist/src/lib/toml-metadata-config.js.map +1 -0
- package/dist/src/lib/toml-native-form.d.ts +46 -0
- package/dist/src/lib/toml-native-form.js +78 -0
- package/dist/src/lib/toml-native-form.js.map +1 -0
- package/dist/src/lib/toml-params-validator.d.ts +129 -0
- package/dist/src/lib/toml-params-validator.js +298 -0
- package/dist/src/lib/toml-params-validator.js.map +1 -0
- package/dist/src/lib/toml-scalar-edit.d.ts +43 -0
- package/dist/src/lib/toml-scalar-edit.js +283 -0
- package/dist/src/lib/toml-scalar-edit.js.map +1 -0
- package/dist/src/lib/user-selector.d.ts +24 -0
- package/dist/src/lib/user-selector.js +33 -0
- package/dist/src/lib/user-selector.js.map +1 -0
- package/dist/src/lib/version-check.d.ts +35 -0
- package/dist/src/lib/version-check.js +241 -0
- package/dist/src/lib/version-check.js.map +1 -0
- package/dist/src/lib/watch.d.ts +121 -0
- package/dist/src/lib/watch.js +169 -0
- package/dist/src/lib/watch.js.map +1 -0
- package/dist/src/lib/web-url.d.ts +40 -0
- package/dist/src/lib/web-url.js +76 -0
- package/dist/src/lib/web-url.js.map +1 -0
- package/dist/src/lib/webhook-deliver.d.ts +209 -0
- package/dist/src/lib/webhook-deliver.js +519 -0
- package/dist/src/lib/webhook-deliver.js.map +1 -0
- package/dist/src/lib/workflow-apply.d.ts +110 -0
- package/dist/src/lib/workflow-apply.js +164 -0
- package/dist/src/lib/workflow-apply.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.d.ts +129 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js +269 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generator.d.ts +96 -0
- package/dist/src/lib/workflow-codegen/generator.js +361 -0
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -0
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +94 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js +76 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -0
- package/dist/src/lib/workflow-codegen/naming.d.ts +33 -0
- package/dist/src/lib/workflow-codegen/naming.js +81 -0
- package/dist/src/lib/workflow-codegen/naming.js.map +1 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.d.ts +80 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.js +303 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/workflow-config-apply.d.ts +70 -0
- package/dist/src/lib/workflow-config-apply.js +137 -0
- package/dist/src/lib/workflow-config-apply.js.map +1 -0
- package/dist/src/lib/workflow-config-sidecar.d.ts +63 -0
- package/dist/src/lib/workflow-config-sidecar.js +96 -0
- package/dist/src/lib/workflow-config-sidecar.js.map +1 -0
- package/dist/src/lib/workflow-defaults.d.ts +29 -0
- package/dist/src/lib/workflow-defaults.js +41 -0
- package/dist/src/lib/workflow-defaults.js.map +1 -0
- package/dist/src/lib/workflow-fragments.d.ts +64 -0
- package/dist/src/lib/workflow-fragments.js +342 -0
- package/dist/src/lib/workflow-fragments.js.map +1 -0
- package/dist/src/lib/workflow-include-preserve.d.ts +76 -0
- package/dist/src/lib/workflow-include-preserve.js +286 -0
- package/dist/src/lib/workflow-include-preserve.js.map +1 -0
- package/dist/src/lib/workflow-payload.d.ts +98 -0
- package/dist/src/lib/workflow-payload.js +178 -0
- package/dist/src/lib/workflow-payload.js.map +1 -0
- package/dist/src/lib/workflow-toml-validator.d.ts +211 -0
- package/dist/src/lib/workflow-toml-validator.js +770 -0
- package/dist/src/lib/workflow-toml-validator.js.map +1 -0
- package/dist/src/lib/workflow-usage.d.ts +196 -0
- package/dist/src/lib/workflow-usage.js +310 -0
- package/dist/src/lib/workflow-usage.js.map +1 -0
- package/dist/src/types/index.d.ts +591 -0
- package/dist/src/validators.d.ts +65 -0
- package/dist/src/validators.js +64 -0
- package/dist/src/validators.js.map +1 -0
- package/package.json +34 -9
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collecting a function's query manifest at push time (#3187, project
|
|
3
|
+
* `server-functions` phase 5).
|
|
4
|
+
*
|
|
5
|
+
* ── Why the tree has to RUN ──────────────────────────────────────────────
|
|
6
|
+
*
|
|
7
|
+
* `defineQuery(name, { models, params, cache, run })` is a registration
|
|
8
|
+
* helper, and registrations are ordinary code: a name can be computed, a
|
|
9
|
+
* models list can come from a constant another file exports, a whole set can
|
|
10
|
+
* be registered in a loop. Static extraction would see none of that. So the
|
|
11
|
+
* manifest is collected by BUILDING the tree a second time with
|
|
12
|
+
* `primitive-functions` aliased to a recording stub and executing the result.
|
|
13
|
+
*
|
|
14
|
+
* ── Why it runs somewhere else ───────────────────────────────────────────
|
|
15
|
+
*
|
|
16
|
+
* D3187-SO-006. A function bundle inlines its tree-local and npm imports, so
|
|
17
|
+
* "execute the bundle" means "run arbitrary module scope" — with, if it ran
|
|
18
|
+
* inside the CLI, the developer's environment, credentials, filesystem and
|
|
19
|
+
* network. That is a large step up from what `config push` did before, which
|
|
20
|
+
* was to type-erase and bundle the same code without running it.
|
|
21
|
+
*
|
|
22
|
+
* So collection runs in a spawned child `node` with:
|
|
23
|
+
*
|
|
24
|
+
* - a SCRUBBED environment: an explicit minimal pass-through, so a token in
|
|
25
|
+
* the developer's shell is not readable by a project's module scope;
|
|
26
|
+
* - the config tree as the working directory;
|
|
27
|
+
* - a hard timeout, killed with `SIGKILL`, so a loop in a tree is a named
|
|
28
|
+
* refusal rather than a hung push;
|
|
29
|
+
* - its result read back over a structured pipe (a sentinel-framed line on
|
|
30
|
+
* stdout), so a tree that prints is not mistaken for a tree that reported.
|
|
31
|
+
*
|
|
32
|
+
* What remains is the trust a developer already extends to their own tree by
|
|
33
|
+
* running its build: this is npm-postinstall-equivalent, and the docs say so.
|
|
34
|
+
* Full network denial was considered and not taken (Node offers no reliable
|
|
35
|
+
* in-process cutoff), and so was static extraction (it cannot see computed
|
|
36
|
+
* registrations).
|
|
37
|
+
*
|
|
38
|
+
* ── What the manifest is, and is not ─────────────────────────────────────
|
|
39
|
+
*
|
|
40
|
+
* Documentation. Since #3279 function code acts as the system, so the
|
|
41
|
+
* manifest authorizes nothing anywhere: its one job is telling an operator
|
|
42
|
+
* what a version registered and what it TOUCHES — the models its code names
|
|
43
|
+
* and the families it reaches — through `primitive functions get`. That
|
|
44
|
+
* second half (schema version 2) comes from a STATIC SCAN of the built
|
|
45
|
+
* bundle: the direct records API names a model in a literal request argument
|
|
46
|
+
* with neither a registration nor `.model()` (D3279-006), so the run above
|
|
47
|
+
* cannot see it and the text can. A name the scan cannot resolve — a computed
|
|
48
|
+
* `modelName`, a `.model(variable)` — is marked `dynamicModels` rather than
|
|
49
|
+
* dropped, which is the difference between "names none" and "names these,
|
|
50
|
+
* and possibly more".
|
|
51
|
+
*/
|
|
52
|
+
import * as esbuild from "esbuild";
|
|
53
|
+
import { spawn } from "node:child_process";
|
|
54
|
+
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
55
|
+
import { tmpdir } from "node:os";
|
|
56
|
+
import { join, resolve } from "node:path";
|
|
57
|
+
import { PRIMITIVE_FUNCTIONS_MODULE } from "./function-bundle.js";
|
|
58
|
+
/** The manifest encoding, versioned with the envelope that carries it. */
|
|
59
|
+
export const FUNCTION_MANIFEST_SCHEMA_VERSION = 2;
|
|
60
|
+
/** How long a tree's module scope may run before collection gives up. */
|
|
61
|
+
export const COLLECT_TIMEOUT_MS = 20_000;
|
|
62
|
+
/** A push that cannot proceed because its manifest could not be collected. */
|
|
63
|
+
export class FunctionCollectError extends Error {
|
|
64
|
+
constructor(message) {
|
|
65
|
+
super(message);
|
|
66
|
+
this.name = "FunctionCollectError";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* What the static scan reads out of a built bundle — #3279 behavior 10.
|
|
71
|
+
*
|
|
72
|
+
* Literal model names from every shape the platform surfaces name a model
|
|
73
|
+
* in: a `.model("…")` call on the typed handle, a `modelName: "…"` key in a
|
|
74
|
+
* records body or a batch entry, and a `model: "…"` key in a document records
|
|
75
|
+
* call. A non-literal in any of those positions sets `dynamicModels`. The
|
|
76
|
+
* families are the `ctx.api.<family>` namespaces and the ctx helpers
|
|
77
|
+
* (`ctx.db` → databases, `ctx.secret` → secrets, …), on whatever the author
|
|
78
|
+
* named the context parameter: the scan keys on the member access, not on
|
|
79
|
+
* the receiver's name.
|
|
80
|
+
*
|
|
81
|
+
* Imprecise by construction and documented as such: a name assembled at
|
|
82
|
+
* runtime is invisible, a name in dead code is counted, and a string that
|
|
83
|
+
* happens to follow `modelName:` in unrelated data is counted too. The bundle
|
|
84
|
+
* is unminified ES2022 (`function-bundle.ts`), which is what makes the
|
|
85
|
+
* literal shapes stable enough to scan.
|
|
86
|
+
*/
|
|
87
|
+
/** The text of a call's argument list, from just after its `(` to the match. */
|
|
88
|
+
function argumentText(bundle, from) {
|
|
89
|
+
let depth = 1;
|
|
90
|
+
for (let i = from; i < bundle.length; i++) {
|
|
91
|
+
const ch = bundle[i];
|
|
92
|
+
if (ch === "(" || ch === "{" || ch === "[")
|
|
93
|
+
depth++;
|
|
94
|
+
else if (ch === ")" || ch === "}" || ch === "]") {
|
|
95
|
+
depth--;
|
|
96
|
+
if (depth === 0)
|
|
97
|
+
return bundle.slice(from, i);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return bundle.slice(from);
|
|
101
|
+
}
|
|
102
|
+
export function scanBundleForManifest(bundle) {
|
|
103
|
+
const models = new Set();
|
|
104
|
+
const families = new Set();
|
|
105
|
+
let dynamicModels = false;
|
|
106
|
+
// A name is recorded only when the WHOLE expression is one literal
|
|
107
|
+
// (CR3279-003). Matching a literal PREFIX read `"Order" + input.suffix` as
|
|
108
|
+
// the model `Order` and said nothing about the part it could not resolve —
|
|
109
|
+
// a confident wrong answer where the manifest's whole job is to distinguish
|
|
110
|
+
// "these models" from "and something I could not read".
|
|
111
|
+
const literal = /^\s*(?:"([^"\\]*)"|'([^'\\]*)'|`([^`$\\]*)`)\s*$/;
|
|
112
|
+
const nameOf = (rest) => {
|
|
113
|
+
const match = literal.exec(rest);
|
|
114
|
+
if (!match)
|
|
115
|
+
return null;
|
|
116
|
+
return match[1] ?? match[2] ?? match[3] ?? null;
|
|
117
|
+
};
|
|
118
|
+
// `.model(<literal>)` on a handle; anything else in the parens is dynamic.
|
|
119
|
+
for (const match of bundle.matchAll(/\.model\(([^)]*)\)/g)) {
|
|
120
|
+
const name = nameOf(match[1]);
|
|
121
|
+
if (name !== null)
|
|
122
|
+
models.add(name);
|
|
123
|
+
else if (match[1].trim() !== "")
|
|
124
|
+
dynamicModels = true;
|
|
125
|
+
}
|
|
126
|
+
// `modelName: <value>` keys, quoted or bare — a records body or a batch
|
|
127
|
+
// entry, wherever they sit. The SHORTHAND `{ modelName }` names the model
|
|
128
|
+
// just as ordinarily and carries a variable, so it is unresolvable usage
|
|
129
|
+
// rather than no usage (CR3279-003): without it a function whose every call
|
|
130
|
+
// is `body: { modelName }` reported an empty manifest and no dynamic marker.
|
|
131
|
+
const keyed = (text, key) => {
|
|
132
|
+
const pattern = new RegExp(`(?:^|[{,\\s])["']?${key}["']?\\s*:(?!:)\\s*([^,}\\n]*)`, "g");
|
|
133
|
+
for (const match of text.matchAll(pattern)) {
|
|
134
|
+
const value = match[1];
|
|
135
|
+
const name = nameOf(value);
|
|
136
|
+
if (name !== null)
|
|
137
|
+
models.add(name);
|
|
138
|
+
else if (value.trim() !== "")
|
|
139
|
+
dynamicModels = true;
|
|
140
|
+
}
|
|
141
|
+
const shorthand = new RegExp(`[{,]\\s*${key}\\s*(?=[,}])`, "g");
|
|
142
|
+
if (shorthand.test(text))
|
|
143
|
+
dynamicModels = true;
|
|
144
|
+
};
|
|
145
|
+
keyed(bundle, "modelName");
|
|
146
|
+
// `model: <value>` is the document records PATH parameter, and only that:
|
|
147
|
+
// the same key names a provider model in an LLM call body, so it is read
|
|
148
|
+
// inside the argument list of a `.documents.records.<verb>(` call alone.
|
|
149
|
+
for (const call of bundle.matchAll(/\.documents\.records\.[A-Za-z_$][\w$]*\(/g)) {
|
|
150
|
+
keyed(argumentText(bundle, call.index + call[0].length), "model");
|
|
151
|
+
}
|
|
152
|
+
// `<anything>.api.<family>` and the ctx helpers.
|
|
153
|
+
for (const match of bundle.matchAll(/\.api\.([A-Za-z_$][\w$]*)/g)) {
|
|
154
|
+
families.add(match[1]);
|
|
155
|
+
}
|
|
156
|
+
const helpers = [
|
|
157
|
+
[/\.db\(/, "databases"],
|
|
158
|
+
// #3281 — the typed document handle, a binding over documents.records.*.
|
|
159
|
+
[/\.doc\(/, "documents"],
|
|
160
|
+
[/\.integrations\.call\(/, "integrations"],
|
|
161
|
+
[/\.prompts\.run\(/, "prompts"],
|
|
162
|
+
[/\.secret\(/, "secrets"],
|
|
163
|
+
[/\.configVar\(/, "configVars"],
|
|
164
|
+
[/\.users\.send\(/, "users"],
|
|
165
|
+
[/\.connections\.send\(/, "connections"],
|
|
166
|
+
[/\.channels\.(?:authorize|publish)\(/, "channels"],
|
|
167
|
+
];
|
|
168
|
+
for (const [pattern, family] of helpers) {
|
|
169
|
+
if (pattern.test(bundle))
|
|
170
|
+
families.add(family);
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
models: [...models].sort(),
|
|
174
|
+
families: [...families].sort(),
|
|
175
|
+
dynamicModels,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/** The line prefix the child frames its result with. */
|
|
179
|
+
const RESULT_SENTINEL = "__PRIMITIVE_COLLECT__";
|
|
180
|
+
/**
|
|
181
|
+
* The recording stub the collect build substitutes for
|
|
182
|
+
* `primitive-functions`.
|
|
183
|
+
*
|
|
184
|
+
* It records what was registered and does nothing else: `defineFunction` and
|
|
185
|
+
* every other export are inert, so a module that calls one at import time
|
|
186
|
+
* neither fails nor has an effect.
|
|
187
|
+
*/
|
|
188
|
+
export const COLLECT_STUB_SOURCE = `
|
|
189
|
+
const registry = (globalThis.__PRIMITIVE_COLLECT_REGISTRY__ ||= []);
|
|
190
|
+
|
|
191
|
+
// The default-coercion rule the SDK applies at registration (#3281,
|
|
192
|
+
// D3281-SO-005), spelled here too so a default the declared type cannot
|
|
193
|
+
// coerce is refused at PUSH — this stub is what push runs — rather than at
|
|
194
|
+
// the first invocation. The vendored grammar (\`coerceParamDefault\` in
|
|
195
|
+
// generated-config-surfaces.ts) is the same rule and re-checks the manifest.
|
|
196
|
+
const SCALAR_TYPES = ["string", "number", "boolean", "any"];
|
|
197
|
+
function coerceScalar(type, value) {
|
|
198
|
+
if (type === "number") {
|
|
199
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
200
|
+
if (typeof value === "boolean" || value === null || value === "" || !Number.isFinite(n)) {
|
|
201
|
+
return { ok: false, reason: "must be a number" };
|
|
202
|
+
}
|
|
203
|
+
return { ok: true, value: n };
|
|
204
|
+
}
|
|
205
|
+
if (type === "boolean") {
|
|
206
|
+
if (typeof value === "boolean") return { ok: true, value };
|
|
207
|
+
if (value === "true") return { ok: true, value: true };
|
|
208
|
+
if (value === "false") return { ok: true, value: false };
|
|
209
|
+
return { ok: false, reason: "must be a boolean" };
|
|
210
|
+
}
|
|
211
|
+
if (type === "string") {
|
|
212
|
+
if (typeof value !== "string") return { ok: false, reason: "must be a string" };
|
|
213
|
+
return { ok: true, value };
|
|
214
|
+
}
|
|
215
|
+
return { ok: true, value };
|
|
216
|
+
}
|
|
217
|
+
function coerceDefault(spec, value) {
|
|
218
|
+
if (spec.type === "array") {
|
|
219
|
+
if (!Array.isArray(value)) return { ok: false, reason: "must be an array" };
|
|
220
|
+
const itemType = spec.items && spec.items.type ? String(spec.items.type) : "any";
|
|
221
|
+
const out = [];
|
|
222
|
+
for (const element of value) {
|
|
223
|
+
const coerced = coerceScalar(itemType, element);
|
|
224
|
+
if (!coerced.ok) return { ok: false, reason: "every element " + coerced.reason };
|
|
225
|
+
out.push(coerced.value);
|
|
226
|
+
}
|
|
227
|
+
return { ok: true, value: out };
|
|
228
|
+
}
|
|
229
|
+
return coerceScalar(spec.type === undefined ? "any" : String(spec.type), value);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function record(kind, name, config) {
|
|
233
|
+
const c = config || {};
|
|
234
|
+
const params = {};
|
|
235
|
+
for (const [key, value] of Object.entries(c.params || {})) {
|
|
236
|
+
const spec = value && typeof value === "object" ? value : { type: String(value) };
|
|
237
|
+
const entry = {};
|
|
238
|
+
const fail = (message) => {
|
|
239
|
+
throw new Error("'" + name + "': parameter '" + key + "' " + message);
|
|
240
|
+
};
|
|
241
|
+
if (spec.type !== undefined) entry.type = String(spec.type);
|
|
242
|
+
if (entry.type === "array") {
|
|
243
|
+
if (spec.items !== undefined && spec.items !== null) {
|
|
244
|
+
const itemType =
|
|
245
|
+
spec.items && typeof spec.items === "object" ? String(spec.items.type ?? "") : "";
|
|
246
|
+
if (!SCALAR_TYPES.includes(itemType)) {
|
|
247
|
+
fail("declares an \`items\` type outside " + SCALAR_TYPES.join(", ") + ".");
|
|
248
|
+
}
|
|
249
|
+
entry.items = { type: itemType };
|
|
250
|
+
}
|
|
251
|
+
if (spec.caller === true) fail("is an array bound to $caller; \`caller\` is a scalar binding.");
|
|
252
|
+
}
|
|
253
|
+
if (spec.default !== undefined) {
|
|
254
|
+
const coerced = coerceDefault(entry, spec.default);
|
|
255
|
+
if (!coerced.ok) fail("has a default that " + coerced.reason + ".");
|
|
256
|
+
entry.default = coerced.value;
|
|
257
|
+
}
|
|
258
|
+
if (spec.caller === true || spec === "$caller" || spec.type === "$caller") {
|
|
259
|
+
entry.caller = true;
|
|
260
|
+
}
|
|
261
|
+
params[String(key)] = entry;
|
|
262
|
+
}
|
|
263
|
+
const declaredCaller = Object.values(params).some((p) => p.caller === true);
|
|
264
|
+
registry.push({
|
|
265
|
+
kind,
|
|
266
|
+
name: String(name),
|
|
267
|
+
models: Array.isArray(c.models) ? c.models.map(String) : [],
|
|
268
|
+
params,
|
|
269
|
+
cache:
|
|
270
|
+
c.cache && typeof c.cache === "object" && Number(c.cache.ttlMs) > 0
|
|
271
|
+
? { ttlMs: Number(c.cache.ttlMs) }
|
|
272
|
+
: null,
|
|
273
|
+
callerScoped: declaredCaller,
|
|
274
|
+
});
|
|
275
|
+
return async () => {
|
|
276
|
+
throw new Error(
|
|
277
|
+
"'" + name + "' was called during manifest collection; a registration's " +
|
|
278
|
+
"\`run\` only executes inside a real invocation."
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// The PUBLIC surface, all of it. An ESM import of a name a module does not
|
|
284
|
+
// export is a build error, so a stub missing one export refuses a tree the
|
|
285
|
+
// sandbox would have run — collection is mandatory, so that is a valid
|
|
286
|
+
// function that cannot be pushed at all (CR3187-007). The constants carry the
|
|
287
|
+
// runtime's own values so a registration computed from one collects the same
|
|
288
|
+
// way it will run.
|
|
289
|
+
export const SDK_STUB_VERSION = "collect";
|
|
290
|
+
export const MAX_QUERY_CACHE_TTL_MS = 60000;
|
|
291
|
+
export const PMAP_DEFAULT_CONCURRENCY = 8;
|
|
292
|
+
export function defineQuery(name, config) { return record("query", name, config); }
|
|
293
|
+
export function defineMutation(name, config) { return record("mutation", name, config); }
|
|
294
|
+
export function defineFunction(keyOrHandler, maybeHandler) {
|
|
295
|
+
// The KEYED form (#3281) returns a wrapper CARRYING its key, exactly as the
|
|
296
|
+
// baked SDK's does. That is what push reads: the child resolves the callable
|
|
297
|
+
// the bootstrap would select and compares THAT key to the file's
|
|
298
|
+
// (D3281-SO-006). The registry entry is the child's report of what the
|
|
299
|
+
// module scope did; it is not what the check consults, because a keyed
|
|
300
|
+
// handler an entry merely imports for composition registers here too.
|
|
301
|
+
if (typeof keyOrHandler === "string" || maybeHandler !== undefined) {
|
|
302
|
+
registry.push({ kind: "function", name: String(keyOrHandler) });
|
|
303
|
+
const wrapped = function (...args) {
|
|
304
|
+
return maybeHandler(...args);
|
|
305
|
+
};
|
|
306
|
+
wrapped.functionKey = String(keyOrHandler);
|
|
307
|
+
return wrapped;
|
|
308
|
+
}
|
|
309
|
+
return keyOrHandler;
|
|
310
|
+
}
|
|
311
|
+
export function pMap(items, mapper) { return Promise.all((items || []).map(mapper)); }
|
|
312
|
+
export function ulid() { return "00000000000000000000000000"; }
|
|
313
|
+
export const stepPolicy = new Proxy({}, { get: () => ({}) });
|
|
314
|
+
// #3482 — the runtime surface, and \`assertRuntime\` is INERT here on purpose.
|
|
315
|
+
// Collection has no runtime: this child process exists to learn what a tree
|
|
316
|
+
// registers, and there is nothing for an assertion to be about. A stub that
|
|
317
|
+
// threw would refuse exactly the functions the assertion exists for — and the
|
|
318
|
+
// placement the guide teaches is module scope, which collection runs.
|
|
319
|
+
export function assertRuntime() {}
|
|
320
|
+
export class FunctionRuntimeError extends Error {
|
|
321
|
+
constructor(message, runtime, required) {
|
|
322
|
+
super(message);
|
|
323
|
+
this.name = "FUNCTION_RUNTIME_REFUSED";
|
|
324
|
+
this.runtime = runtime;
|
|
325
|
+
this.required = required;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
export default {
|
|
329
|
+
SDK_STUB_VERSION,
|
|
330
|
+
defineFunction,
|
|
331
|
+
defineQuery,
|
|
332
|
+
defineMutation,
|
|
333
|
+
pMap,
|
|
334
|
+
ulid,
|
|
335
|
+
assertRuntime,
|
|
336
|
+
FunctionRuntimeError,
|
|
337
|
+
};
|
|
338
|
+
`;
|
|
339
|
+
/**
|
|
340
|
+
* The child's whole program: import the built bundle, report the registry and
|
|
341
|
+
* the key of the handler the entry EXPORTS.
|
|
342
|
+
*
|
|
343
|
+
* The module is kept rather than discarded (D3281-SO-006). Every keyed
|
|
344
|
+
* `defineFunction` anywhere in the import graph writes to the registry, so the
|
|
345
|
+
* registry alone cannot tell an entry that DECLARES a key from one that merely
|
|
346
|
+
* imports a keyed handler to compose with — and those are the two cases push
|
|
347
|
+
* has to answer differently. `handlerOf` is the bootstrap's own selection rule,
|
|
348
|
+
* spelled the same way here, so the callable this reports is the callable that
|
|
349
|
+
* would run.
|
|
350
|
+
*
|
|
351
|
+
* It is applied to the same VALUE the bootstrap applies it to, which is the
|
|
352
|
+
* DEFAULT EXPORT and not the module namespace (CR3281-002). The bootstrap
|
|
353
|
+
* binds `import entry from "./function.js"` and calls `handlerOf(entry)`, so
|
|
354
|
+
* for `export default { handler: defineFunction("other", …) }` it selects the
|
|
355
|
+
* keyed handler while `handlerOf(namespace)` selected nothing — the one shape
|
|
356
|
+
* where a handler keyed for another function would run and push could not see
|
|
357
|
+
* it. A module with no default export is one the sandbox cannot start at all
|
|
358
|
+
* (the loader refuses it by name), and there the namespace is still read, so
|
|
359
|
+
* a key declared on a named `handler` export is reported rather than lost.
|
|
360
|
+
*/
|
|
361
|
+
const RUNNER_SOURCE = `
|
|
362
|
+
const sentinel = ${JSON.stringify(RESULT_SENTINEL)};
|
|
363
|
+
const target = process.argv[2];
|
|
364
|
+
function handlerOf(mod) {
|
|
365
|
+
if (typeof mod === "function") return mod;
|
|
366
|
+
if (mod && typeof mod.default === "function") return mod.default;
|
|
367
|
+
if (mod && typeof mod.handler === "function") return mod.handler;
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
(async () => {
|
|
371
|
+
try {
|
|
372
|
+
const mod = await import(target);
|
|
373
|
+
const registry = globalThis.__PRIMITIVE_COLLECT_REGISTRY__ || [];
|
|
374
|
+
// What the bootstrap's \`import entry from "./function.js"\` binds.
|
|
375
|
+
const entry = mod && "default" in mod ? mod.default : mod;
|
|
376
|
+
const exported = handlerOf(entry);
|
|
377
|
+
const exportedKey =
|
|
378
|
+
exported && typeof exported.functionKey === "string" ? exported.functionKey : null;
|
|
379
|
+
process.stdout.write(
|
|
380
|
+
sentinel + JSON.stringify({ ok: true, registry, exportedKey }) + "\\n"
|
|
381
|
+
);
|
|
382
|
+
} catch (error) {
|
|
383
|
+
process.stdout.write(
|
|
384
|
+
sentinel +
|
|
385
|
+
JSON.stringify({
|
|
386
|
+
ok: false,
|
|
387
|
+
error: String((error && error.message) || error),
|
|
388
|
+
}) +
|
|
389
|
+
"\\n"
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
process.exit(0);
|
|
393
|
+
})();
|
|
394
|
+
`;
|
|
395
|
+
/**
|
|
396
|
+
* The environment the child gets: nothing but what Node needs to start.
|
|
397
|
+
*
|
|
398
|
+
* An explicit pass-through rather than a denylist, because the interesting
|
|
399
|
+
* variables are the ones nobody thought to name.
|
|
400
|
+
*/
|
|
401
|
+
function scrubbedEnv() {
|
|
402
|
+
const env = {
|
|
403
|
+
PATH: process.env.PATH ?? "/usr/bin:/bin",
|
|
404
|
+
NODE_ENV: "production",
|
|
405
|
+
};
|
|
406
|
+
// Windows needs these to resolve anything at all.
|
|
407
|
+
for (const key of ["SystemRoot", "TEMP", "TMP", "COMSPEC"]) {
|
|
408
|
+
if (process.env[key])
|
|
409
|
+
env[key] = process.env[key];
|
|
410
|
+
}
|
|
411
|
+
return env;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Build the collect bundle: the same tree, the same inlining, the recording
|
|
415
|
+
* stub in place of the SDK.
|
|
416
|
+
*
|
|
417
|
+
* The import boundary is not re-checked here — `buildFunctionBundle` has
|
|
418
|
+
* already refused an escaping tree by the time collection runs, and this build
|
|
419
|
+
* reads exactly the files that one did.
|
|
420
|
+
*/
|
|
421
|
+
async function buildCollectBundle(options) {
|
|
422
|
+
const stubPlugin = {
|
|
423
|
+
name: "primitive-functions-collect-stub",
|
|
424
|
+
setup(build) {
|
|
425
|
+
build.onResolve({ filter: /^primitive-functions$/ }, () => ({
|
|
426
|
+
path: PRIMITIVE_FUNCTIONS_MODULE,
|
|
427
|
+
namespace: "primitive-collect-stub",
|
|
428
|
+
}));
|
|
429
|
+
build.onLoad({ filter: /.*/, namespace: "primitive-collect-stub" }, () => ({ contents: COLLECT_STUB_SOURCE, loader: "js" }));
|
|
430
|
+
},
|
|
431
|
+
};
|
|
432
|
+
try {
|
|
433
|
+
const result = await esbuild.build({
|
|
434
|
+
entryPoints: [options.entry],
|
|
435
|
+
absWorkingDir: options.treeRoot,
|
|
436
|
+
bundle: true,
|
|
437
|
+
write: false,
|
|
438
|
+
format: "esm",
|
|
439
|
+
platform: "neutral",
|
|
440
|
+
target: "es2022",
|
|
441
|
+
plugins: [stubPlugin],
|
|
442
|
+
logLevel: "silent",
|
|
443
|
+
});
|
|
444
|
+
const output = result.outputFiles?.[0];
|
|
445
|
+
if (!output) {
|
|
446
|
+
throw new FunctionCollectError(`function '${options.functionKey}': manifest collection produced no output`);
|
|
447
|
+
}
|
|
448
|
+
return Buffer.from(output.contents).toString("utf-8");
|
|
449
|
+
}
|
|
450
|
+
catch (error) {
|
|
451
|
+
if (error instanceof FunctionCollectError)
|
|
452
|
+
throw error;
|
|
453
|
+
const messages = Array.isArray(error?.errors)
|
|
454
|
+
? error.errors.map((e) => ` ${e?.location?.file ?? options.entry}: ${e?.text ?? "build error"}`)
|
|
455
|
+
: [` ${options.entry}: ${error?.message ?? String(error)}`];
|
|
456
|
+
throw new FunctionCollectError(`function '${options.functionKey}': manifest collection could not build the tree:\n${messages.join("\n")}`);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Collect one function's manifest.
|
|
461
|
+
*
|
|
462
|
+
* Throws `FunctionCollectError` for every failure — a build error, a module
|
|
463
|
+
* that throws at import, a loop that outlives the bound, or output that is not
|
|
464
|
+
* the framed result — because a push whose manifest could not be collected is
|
|
465
|
+
* refused rather than pushed without one (D3187-SO-005: the manifest is part
|
|
466
|
+
* of the envelope, so "later" would mean a different version).
|
|
467
|
+
*/
|
|
468
|
+
export async function collectFunctionManifest(options) {
|
|
469
|
+
const treeRoot = resolve(options.configDir);
|
|
470
|
+
const timeoutMs = options.timeoutMs ?? COLLECT_TIMEOUT_MS;
|
|
471
|
+
const code = await buildCollectBundle({
|
|
472
|
+
treeRoot,
|
|
473
|
+
entry: options.entry,
|
|
474
|
+
functionKey: options.functionKey,
|
|
475
|
+
});
|
|
476
|
+
const scratch = mkdtempSync(join(tmpdir(), "primitive-collect-"));
|
|
477
|
+
const bundlePath = join(scratch, "bundle.mjs");
|
|
478
|
+
const runnerPath = join(scratch, "runner.mjs");
|
|
479
|
+
writeFileSync(bundlePath, code, "utf-8");
|
|
480
|
+
writeFileSync(runnerPath, RUNNER_SOURCE, "utf-8");
|
|
481
|
+
try {
|
|
482
|
+
const framed = await runCollectChild({
|
|
483
|
+
runnerPath,
|
|
484
|
+
bundlePath,
|
|
485
|
+
treeRoot,
|
|
486
|
+
timeoutMs,
|
|
487
|
+
functionKey: options.functionKey,
|
|
488
|
+
});
|
|
489
|
+
if (!framed.ok) {
|
|
490
|
+
throw new FunctionCollectError(`function '${options.functionKey}': manifest collection failed while ` +
|
|
491
|
+
`running the tree's module scope: ${framed.error}`);
|
|
492
|
+
}
|
|
493
|
+
return manifestFrom(framed.registry ?? [], options.functionKey, scanBundleForManifest(options.bundle ?? code), framed.exportedKey ?? null);
|
|
494
|
+
}
|
|
495
|
+
finally {
|
|
496
|
+
rmSync(scratch, { recursive: true, force: true });
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
function runCollectChild(options) {
|
|
500
|
+
return new Promise((resolvePromise, rejectPromise) => {
|
|
501
|
+
const child = spawn(process.execPath, [options.runnerPath, options.bundlePath], {
|
|
502
|
+
cwd: options.treeRoot,
|
|
503
|
+
env: scrubbedEnv(),
|
|
504
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
505
|
+
});
|
|
506
|
+
let stdout = "";
|
|
507
|
+
let stderr = "";
|
|
508
|
+
let settled = false;
|
|
509
|
+
const finish = (fn) => {
|
|
510
|
+
if (settled)
|
|
511
|
+
return;
|
|
512
|
+
settled = true;
|
|
513
|
+
clearTimeout(timer);
|
|
514
|
+
fn();
|
|
515
|
+
};
|
|
516
|
+
const timer = setTimeout(() => {
|
|
517
|
+
child.kill("SIGKILL");
|
|
518
|
+
finish(() => rejectPromise(new FunctionCollectError(`function '${options.functionKey}': manifest collection timed out ` +
|
|
519
|
+
`after ${options.timeoutMs}ms. Collection runs the tree's module ` +
|
|
520
|
+
"scope, so a loop or a blocking call at import time stops the " +
|
|
521
|
+
"push rather than hanging it.")));
|
|
522
|
+
}, options.timeoutMs);
|
|
523
|
+
child.stdout.on("data", (chunk) => (stdout += String(chunk)));
|
|
524
|
+
child.stderr.on("data", (chunk) => (stderr += String(chunk)));
|
|
525
|
+
child.on("error", (error) => finish(() => rejectPromise(new FunctionCollectError(`function '${options.functionKey}': manifest collection could not ` +
|
|
526
|
+
`start: ${error.message}`))));
|
|
527
|
+
child.on("close", () => finish(() => {
|
|
528
|
+
const line = stdout
|
|
529
|
+
.split("\n")
|
|
530
|
+
.reverse()
|
|
531
|
+
.find((entry) => entry.startsWith(RESULT_SENTINEL));
|
|
532
|
+
if (!line) {
|
|
533
|
+
rejectPromise(new FunctionCollectError(`function '${options.functionKey}': manifest collection reported ` +
|
|
534
|
+
"no result" +
|
|
535
|
+
(stderr.trim() ? `: ${stderr.trim().slice(0, 500)}` : ".")));
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
try {
|
|
539
|
+
resolvePromise(JSON.parse(line.slice(RESULT_SENTINEL.length)));
|
|
540
|
+
}
|
|
541
|
+
catch (error) {
|
|
542
|
+
rejectPromise(new FunctionCollectError(`function '${options.functionKey}': manifest collection reported ` +
|
|
543
|
+
`unreadable output: ${error.message}`));
|
|
544
|
+
}
|
|
545
|
+
}));
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
/** Normalize and validate what the child recorded, and merge in the scan. */
|
|
549
|
+
function manifestFrom(registry, functionKey, scanned, exportedKey) {
|
|
550
|
+
// #3281 — the key the entry's EXPORTED handler carries. The compiler holds
|
|
551
|
+
// the key to the TREE (an undeclared key does not compile); this holds it to
|
|
552
|
+
// the FILE, before any request is made, with the runtime value — a key
|
|
553
|
+
// computed at module scope is checked as what it evaluated to.
|
|
554
|
+
//
|
|
555
|
+
// The subject is the exported handler and nothing else (D3281-SO-006). A
|
|
556
|
+
// keyed handler an entry IMPORTS is registered in the same graph, so
|
|
557
|
+
// comparing every registration would refuse ordinary composition; accepting
|
|
558
|
+
// any matching registration would let a module export the wrong handler and
|
|
559
|
+
// run typed against another file's schemas. The callable the bootstrap would
|
|
560
|
+
// select is the one that answers "what did this file ship?".
|
|
561
|
+
//
|
|
562
|
+
// A null key is an unkeyed handler — there is nothing to disagree with.
|
|
563
|
+
if (exportedKey !== null && exportedKey !== functionKey) {
|
|
564
|
+
throw new FunctionCollectError(`function '${functionKey}': its entry exports defineFunction("${exportedKey}", …), ` +
|
|
565
|
+
`which is not this file's key. The key names functions/${functionKey}.toml, so ` +
|
|
566
|
+
`write defineFunction("${functionKey}", …) — or drop the key to use the unkeyed form.`);
|
|
567
|
+
}
|
|
568
|
+
const queries = [];
|
|
569
|
+
const seen = new Set();
|
|
570
|
+
for (const entry of registry) {
|
|
571
|
+
if (entry?.kind === "function")
|
|
572
|
+
continue;
|
|
573
|
+
const name = String(entry?.name ?? "");
|
|
574
|
+
if (!name) {
|
|
575
|
+
throw new FunctionCollectError(`function '${functionKey}': a registration has no name.`);
|
|
576
|
+
}
|
|
577
|
+
if (seen.has(name)) {
|
|
578
|
+
// The SDK throws on this at runtime too; refusing here means an author
|
|
579
|
+
// learns at push rather than at the first invocation.
|
|
580
|
+
throw new FunctionCollectError(`function '${functionKey}': '${name}' is registered twice. Every ` +
|
|
581
|
+
"registered query and mutation needs its own name.");
|
|
582
|
+
}
|
|
583
|
+
seen.add(name);
|
|
584
|
+
queries.push({
|
|
585
|
+
name,
|
|
586
|
+
kind: entry?.kind === "mutation" ? "mutation" : "query",
|
|
587
|
+
models: Array.isArray(entry?.models) ? entry.models.map(String) : [],
|
|
588
|
+
params: entry?.params && typeof entry.params === "object" ? entry.params : {},
|
|
589
|
+
cache: entry?.cache && Number(entry.cache.ttlMs) > 0
|
|
590
|
+
? { ttlMs: Number(entry.cache.ttlMs) }
|
|
591
|
+
: null,
|
|
592
|
+
callerScoped: entry?.callerScoped === true,
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
queries.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
596
|
+
// The registrations' declared models join the scanned ones: a registration
|
|
597
|
+
// is a statement about what a query touches, and the manifest is the union.
|
|
598
|
+
const models = new Set(scanned.models);
|
|
599
|
+
for (const query of queries)
|
|
600
|
+
for (const model of query.models)
|
|
601
|
+
models.add(model);
|
|
602
|
+
return {
|
|
603
|
+
schemaVersion: FUNCTION_MANIFEST_SCHEMA_VERSION,
|
|
604
|
+
queries,
|
|
605
|
+
models: [...models].sort(),
|
|
606
|
+
families: scanned.families,
|
|
607
|
+
dynamicModels: scanned.dynamicModels,
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
//# sourceMappingURL=function-collect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-collect.js","sourceRoot":"","sources":["../../../src/lib/function-collect.ts"],"names":[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