@salsita-ai/sdk 0.50.0-develop.b5dfdd9774 → 0.50.0-develop.b65a5a9c66
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/dist/admin/common/admin-interface.d.ts +11 -1
- package/dist/admin/common/admin-interface.js +1 -1
- package/dist/admin/ui/layout/UserProfile.d.ts +1 -1
- package/dist/admin/ui/layout/UserProfile.js +1 -1
- package/dist/admin/ui/maintenance/ImportPresets.js +1 -1
- package/dist/application/mount-application.js +1 -1
- package/dist/application/mount-configurator.js +1 -1
- package/dist/application/studio-embedding.d.ts +6 -0
- package/dist/application/studio-embedding.js +1 -0
- package/dist/application-spec/core/enhanced-json-schema.d.ts +5 -6
- package/dist/application-spec/core/enhanced-json-schema.js +1 -1
- package/dist/application-spec/core/markers/index.d.ts +1 -0
- package/dist/application-spec/core/markers/index.js +1 -1
- package/dist/application-spec/core/markers/set-in-studio-marker.d.ts +15 -0
- package/dist/application-spec/core/markers/set-in-studio-marker.js +1 -0
- package/dist/application-spec/errors/diagnostic-codes.d.ts +14 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +14 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/domain-runtime-files.d.ts +3 -3
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +0 -12
- package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-config.d.ts +5 -1
- package/dist/application-spec/generate-application/code/templates/admin-config.js +4 -4
- package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -6
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +19 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +12 -12
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +12 -12
- package/dist/application-spec/generate-application/code/templates/globals.js +21 -12
- package/dist/application-spec/generate-application/code/templates/sign-in-page-options.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/sign-in-page-options.js +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/core/cli.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/custom-layout.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/sign-in.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/sign-in.js +19 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.js +32 -26
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/entry-and-environment.js +1 -3
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/publishing.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/session-fields.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/session-fields.js +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/webhooks.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/guide.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-subpath-imports.js +1 -1
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +3 -2
- package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/webhook-index.js +3 -7
- package/dist/application-spec/generate-application/code/webhook-safe-files.d.ts +3 -1
- package/dist/application-spec/generate-application/code/webhook-safe-files.js +1 -1
- package/dist/application-spec/parse-application-files/access/access-handler-kinds.d.ts +18 -0
- package/dist/application-spec/parse-application-files/access/access-handler-kinds.js +1 -0
- package/dist/application-spec/parse-application-files/access/analyzed-file.d.ts +7 -0
- package/dist/application-spec/parse-application-files/access/analyzed-file.js +1 -0
- package/dist/application-spec/parse-application-files/access/check-access-handler-files.d.ts +20 -0
- package/dist/application-spec/parse-application-files/access/check-access-handler-files.js +1 -0
- package/dist/application-spec/parse-application-files/access/check-auth-hook-files.d.ts +17 -0
- package/dist/application-spec/parse-application-files/access/check-auth-hook-files.js +1 -0
- package/dist/application-spec/parse-application-files/access/index.d.ts +5 -0
- package/dist/application-spec/parse-application-files/access/index.js +1 -0
- package/dist/application-spec/parse-application-files/access/sign-in-control.d.ts +7 -0
- package/dist/application-spec/parse-application-files/access/sign-in-control.js +1 -0
- package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +2 -1
- package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +30 -4
- package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/webhook-safety.js +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-app-metadata.d.ts +14 -1
- package/dist/application-spec/parse-application-files/merge/merged-app-metadata.js +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-spec.d.ts +7 -1
- package/dist/application-spec/parse-application-files/merge/merged-spec.js +1 -1
- package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
- package/dist/application-spec/parse-application-files/parse-common-admin-spec.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +6 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.d.ts +6 -0
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/index.d.ts +2 -1
- package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/session-data-schema.d.ts +5 -2
- package/dist/application-spec/parse-application-files/spec/model/session-data-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/session-fields/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/model/session-fields/index.js +1 -0
- package/dist/application-spec/parse-application-files/spec/model/session-fields/session-fields.d.ts +15 -0
- package/dist/application-spec/parse-application-files/spec/model/session-fields/session-fields.js +1 -0
- package/dist/application-spec/parse-application-files/spec/sections/app-metadata.js +1 -1
- package/dist/client/authenticated-client.d.ts +5 -1
- package/dist/client/authenticated-client.js +1 -1
- package/dist/client/authorized-client.d.ts +3 -1
- package/dist/client/authorized-client.js +1 -1
- package/dist/client/base-client.d.ts +15 -1
- package/dist/client/base-client.js +1 -1
- package/dist/client/contract.d.ts +25 -0
- package/dist/client/contract.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/phoenix-api.d.ts +941 -8
- package/dist/client/unauthenticated-client.d.ts +1 -0
- package/dist/client/unauthenticated-client.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +9 -3
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +11 -1
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/docs/index.json +1 -1
- package/dist/docs/phoenix/admin.mdx +5 -40
- package/dist/docs/phoenix/clerk-sign-in.mdx +9 -5
- package/dist/docs/phoenix/data-sources.mdx +25 -29
- package/dist/docs/phoenix/deployments.mdx +3 -3
- package/dist/docs/phoenix/finalization.mdx +0 -1
- package/dist/docs/phoenix/integration/authentication-external.mdx +5 -5
- package/dist/docs/phoenix/integration/authentication-internal.mdx +1 -1
- package/dist/docs/phoenix/integration/finalization-internal.mdx +1 -4
- package/dist/docs/phoenix/integration/integration-modes-internal.mdx +9 -0
- package/dist/docs/phoenix/phoenix-cli.mdx +4 -4
- package/dist/docs/phoenix/project-structure.mdx +13 -8
- package/dist/docs/phoenix/publishing.mdx +21 -28
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
- package/dist/docs/phoenix/sessions-and-access.mdx +169 -163
- package/dist/docs/phoenix/webhook-membership.mdx +3 -0
- package/dist/docs/phoenix/webhooks.mdx +90 -113
- package/dist/domain/application/access/access-handlers.d.ts +19 -0
- package/dist/domain/application/access/access-handlers.js +1 -0
- package/dist/domain/application/access/anonymous-handler.d.ts +16 -0
- package/dist/domain/application/access/anonymous-handler.js +1 -0
- package/dist/domain/application/access/chunk-scopes-handler.d.ts +27 -0
- package/dist/domain/application/access/chunk-scopes-handler.js +1 -0
- package/dist/domain/application/access/code-handler.d.ts +16 -0
- package/dist/domain/application/access/code-handler.js +1 -0
- package/dist/domain/application/access/index.d.ts +7 -0
- package/dist/domain/application/access/index.js +1 -0
- package/dist/domain/application/access/refresh-handler.d.ts +16 -0
- package/dist/domain/application/access/refresh-handler.js +1 -0
- package/dist/domain/application/access/signed-in-handler.d.ts +44 -0
- package/dist/domain/application/access/signed-in-handler.js +1 -0
- package/dist/domain/application/access/visitor-handler.d.ts +23 -0
- package/dist/domain/application/access/visitor-handler.js +1 -0
- package/dist/domain/application/application-config.d.ts +29 -0
- package/dist/domain/application/configurator-builder.d.ts +2 -0
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/index.d.ts +2 -1
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/standard-properties.d.ts +1 -1
- package/dist/domain/application/standard-properties.js +1 -1
- package/dist/domain/core/domain-factory.d.ts +6 -0
- package/dist/domain/core/domain-factory.js +1 -1
- package/dist/domain/core/fit-session-data.d.ts +16 -0
- package/dist/domain/core/fit-session-data.js +1 -0
- package/dist/domain/domain-runtime/domain-context/actions.d.ts +4 -0
- package/dist/domain/domain-runtime/domain-context/actions.js +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.d.ts +8 -0
- package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-context/types.d.ts +8 -4
- package/dist/domain/domain-runtime/domain-runtime.d.ts +8 -0
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +4 -0
- package/dist/domain/spec/sections/app-metadata.d.ts +10 -0
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/extras/clerk/index.d.ts +6 -0
- package/dist/extras/cognito/AccountAvatar.d.ts +7 -0
- package/dist/extras/cognito/AccountAvatar.js +1 -0
- package/dist/extras/cognito/AccountControl.d.ts +13 -0
- package/dist/extras/cognito/AccountControl.js +1 -0
- package/dist/extras/cognito/AdminSignInPage.d.ts +26 -0
- package/dist/extras/cognito/AdminSignInPage.js +1 -0
- package/dist/extras/cognito/CognitoSignInPage.d.ts +8 -2
- package/dist/extras/cognito/CognitoSignInPage.js +1 -1
- package/dist/extras/cognito/ConfiguratorSignInPage.d.ts +19 -0
- package/dist/extras/cognito/ConfiguratorSignInPage.js +1 -0
- package/dist/extras/cognito/SignInFailurePage.d.ts +11 -0
- package/dist/extras/cognito/SignInFailurePage.js +1 -0
- package/dist/extras/cognito/SignInGateLayout.d.ts +25 -0
- package/dist/extras/cognito/SignInGateLayout.js +1 -0
- package/dist/extras/cognito/SignInNotice.d.ts +8 -0
- package/dist/extras/cognito/SignInNotice.js +1 -0
- package/dist/extras/cognito/index.d.ts +4 -0
- package/dist/extras/cognito/index.js +1 -1
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +10 -3
- package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
- package/dist/phoenix/commands/deps/deps.js +2 -2
- package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
- package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
- package/dist/phoenix/services/prepare-development-environment.js +2 -2
- package/dist/phoenix/services/variant-file-session.js +1 -1
- package/dist/react-sdk/application-runtime/common-services/selectors.js +1 -1
- package/dist/react-sdk/application-runtime/domain-application-context/configuration-persist-system.d.ts +6 -0
- package/dist/react-sdk/application-runtime/domain-application-context/configuration-persist-system.js +1 -1
- package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +2 -2
- package/dist/react-sdk/application-runtime/integration/integration-mode.d.ts +30 -0
- package/dist/react-sdk/application-runtime/integration/integration-mode.js +1 -1
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +20 -6
- package/dist/react-sdk/application-runtime/session/actions.d.ts +2 -1
- package/dist/react-sdk/application-runtime/session/actions.js +1 -1
- package/dist/react-sdk/application-runtime/session/initialize.js +1 -1
- package/dist/react-sdk/application-runtime/session/selectors.d.ts +2 -0
- package/dist/react-sdk/application-runtime/session/selectors.js +1 -1
- package/dist/react-sdk/application-runtime/session/session-service.d.ts +34 -1
- package/dist/react-sdk/application-runtime/session/session-service.js +1 -1
- package/dist/react-sdk/application-runtime/session/session-token.d.ts +8 -0
- package/dist/react-sdk/application-runtime/session/session-token.js +1 -1
- package/dist/react-sdk/application-runtime/session/types.d.ts +6 -1
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
- package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -1
- package/dist/react-sdk/session/AccessDeniedAdminPage.d.ts +13 -0
- package/dist/react-sdk/session/AccessDeniedAdminPage.js +1 -0
- package/dist/react-sdk/session/AccessDeniedPage.d.ts +20 -0
- package/dist/react-sdk/session/AccessDeniedPage.js +1 -0
- package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
- package/dist/react-sdk/session/index.d.ts +3 -0
- package/dist/react-sdk/session/index.js +1 -1
- package/dist/react-sdk/session/sign-in-address.d.ts +13 -0
- package/dist/react-sdk/session/sign-in-address.js +1 -0
- package/dist/react-sdk/session/studio-frame.d.ts +7 -0
- package/dist/react-sdk/session/studio-frame.js +1 -0
- package/dist/react-sdk/session/use-sign-in.d.ts +50 -0
- package/dist/react-sdk/session/use-sign-in.js +1 -0
- package/dist/webhook/builders/auth-handler-builder.d.ts +21 -1
- package/dist/webhook/builders/auth-handler-builder.js +1 -1
- package/dist/webhook/builders/common.d.ts +9 -0
- package/dist/webhook/builders/webhook-builder.d.ts +13 -0
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +4 -4
|
@@ -34,7 +34,7 @@ pnpm phoenix dev
|
|
|
34
34
|
1. Refuses to run when a `spec/` folder already exists, so it never touches an existing project.
|
|
35
35
|
2. Writes a `package.json` when the folder has none, and an existing one is kept, as long as it depends on the SDK. Either way, `package.json` gains the entries it lacks, and an entry it already has stays as it is:
|
|
36
36
|
- the CLI's SDK version, in a new `package.json`;
|
|
37
|
-
- every package the SDK requires as a peer, at the version [`phoenix deps`](#phoenix-deps) writes: the lowest of the SDK's range, with the `@types/*` packages in `devDependencies`. A peer the project declares in any dependency field counts, whatever its version. `@clerk/clerk-react` is not among them, because the starter spec does not set `
|
|
37
|
+
- every package the SDK requires as a peer, at the version [`phoenix deps`](#phoenix-deps) writes: the lowest of the SDK's range, with the `@types/*` packages in `devDependencies`. A peer the project declares in any dependency field counts, whatever its version. `@clerk/clerk-react` is not among them, because the starter spec does not set `access: legacy-clerk`;
|
|
38
38
|
- `eslint` and `prettier` in `devDependencies`, at the versions the SDK runs itself, so an editor formats and lints with the same versions as `phoenix check`.
|
|
39
39
|
|
|
40
40
|
With these, the install gives the project everything `phoenix dev`, `build` and `check` need. `init` writes no `packageManager` field and no package-manager settings: a project that installs with pnpm 11 adds the settings in [Package manager](?path=/docs/phoenix-project-structure--docs#package-manager) itself.
|
|
@@ -241,7 +241,7 @@ These are automatically computed by the server and written to the generated env
|
|
|
241
241
|
| `DD_SERVICE_NAME` | Datadog service name |
|
|
242
242
|
| `TERRAFORM_BACKEND_BUCKET` | Terraform backend bucket |
|
|
243
243
|
|
|
244
|
-
**Conditional Clerk/OAuth variables** (generated when `
|
|
244
|
+
**Conditional Clerk/OAuth variables** (generated when `spec/application.yaml` sets `access: legacy-clerk`):
|
|
245
245
|
|
|
246
246
|
- `CLERK_PUBLISHABLE_KEY`
|
|
247
247
|
- `CLERK_API_KEY`
|
|
@@ -465,7 +465,7 @@ With the application-spec pipeline, sync never writes `package.json`. Before it
|
|
|
465
465
|
|
|
466
466
|
### `phoenix deps`
|
|
467
467
|
|
|
468
|
-
Brings `package.json` in line with the SDK's peer dependencies: the packages the SDK's code imports and the project installs next to it, so the project and the SDK share one copy. The `peerDependencies` of the installed `@salsita-ai/sdk` decide which packages and which versions. `@clerk/clerk-react` is needed only when the spec sets `
|
|
468
|
+
Brings `package.json` in line with the SDK's peer dependencies: the packages the SDK's code imports and the project installs next to it, so the project and the SDK share one copy. The `peerDependencies` of the installed `@salsita-ai/sdk` decide which packages and which versions. `@clerk/clerk-react` is needed only when the spec sets `access: legacy-clerk`.
|
|
469
469
|
|
|
470
470
|
```bash
|
|
471
471
|
pnpm phoenix deps
|
|
@@ -819,7 +819,7 @@ For CI, create an automation token on Studio's **Tokens** page and pass it in th
|
|
|
819
819
|
|
|
820
820
|
Deploys to the project chosen as described in [Which project `phoenix dev` develops in](#which-project-phoenix-dev-develops-in): `--project <slug>`, then `project` in `spec/application.yaml`, then the projects the sign-in or token can reach. The project is the slug of one the credential can manage, in whichever of your workspaces owns it; [`phoenix whoami`](#phoenix-whoami) lists those slugs. Deploy does not read `PROJECT_SLUG` or `--projectSlug`, so the `.env` block of a development environment cannot redirect it. An automation token and the older workspace-bound sign-in (`phoenix login <workspace>`) belong to one workspace: with them the project must belong to that workspace. In CI with a deploy token (`PHOENIX_API_TOKEN`), a token limited to one project needs nothing more; a token for a whole workspace with several projects needs the project named in the spec or with `--project`. The project's storage must be ready. For a project other than the workspace's initial one, which carries the workspace's slug, the CLI checks server API 1.61.0 or newer before uploading, so an older server cannot silently deploy it to the initial project. Studio build links retain the selected project.
|
|
821
821
|
|
|
822
|
-
A deploy builds into a **preview** of the project, never into production: production changes only when a preview build is promoted in Studio, or rolled back there to an earlier build. Without `--env` it builds into `preview`, which the deploy creates when the project has none (and says so), as long as the project
|
|
822
|
+
A deploy builds into a **preview** of the project, never into production: production changes only when a preview build is promoted in Studio, or rolled back there to an earlier build. Without `--env` it builds into `preview`, which the deploy creates when the project has none (and says so), as long as the project is below its workspace plan's preview limit (three on Trial, Basic and Beta). After `preview` is deleted, deploys without `--env` are refused until its removal has finished, so name another preview with `--env`. `--env <name>` builds into another preview of the project, which must exist: `--env` never creates one, and an unknown name, `production` or a preview being deleted stops the deploy before packing, with the project's previews. Automation tokens and older SDKs follow the same rule. The CLI needs server API 1.93.0 or newer, because an older server would build into production; it stops before packing otherwise.
|
|
823
823
|
|
|
824
824
|
Validates the spec, packs and uploads the project, starts its build on the server and follows it until the preview's configurator is live. Before packing it prints where the deploy goes and as whom: the server, the workspace with its slug, the project, the environment, the account and the credential source. A project the credential cannot reach stops the deploy there, with the project slugs it can reach in each workspace. A preview replaces a stored schema that changed under the same model version, because its saved configurations are test data; promoting such a build to production is refused, because production never replaces a schema, and needs a new model version and a [migration](?path=/docs/phoenix-migrations--docs). Before packing, it also refuses a `pnpm-workspace.yaml` whose `allowBuilds` leaves a package undecided, an entry that is neither `true` nor `false`, such as the placeholder pnpm 11 writes for a build script it skipped, because the platform build stops on it; the message names the packages. Builds of one preview run one at a time: a build started while another one of the preview runs waits, and the deploy prints `Build #54 is queued behind build #53 in preview` once, and again when the build ahead changes, then follows it as usual. At most three builds wait per environment; a further deploy is refused before the upload. Once the build starts it prints `Build #<n> started in <preview>` and `Follow the build in Studio: <url>`, the build's page in the Studio you signed in through; a sign-in stored by an older CLI has no Studio URL, so sign in again to get the link, and a deploy that runs with `PHOENIX_API_TOKEN` prints none. It prints `Your configurator is live at <url>` when deployment succeeds. The server is chosen as described in [Which server the CLI talks to](#which-server-the-cli-talks-to); `--no-wait` returns as soon as the build starts or joins the queue, after printing the queue line and the Studio link.
|
|
825
825
|
|
|
@@ -439,12 +439,15 @@ Handlers respond to application events and process backend tasks.
|
|
|
439
439
|
|
|
440
440
|
**Event Handlers** are application lifecycle handlers for frontend events. They include `createCollectFrontendDataHandler()` for finalization data collection, `createOnGoToIndexHandler()` for navigation interception, and other lifecycle hooks.
|
|
441
441
|
|
|
442
|
+
**Access Handlers** customise the sign-in the `access` mode builds into the webhook: `phx.access.createChunkScopesHandler()`, `createVisitorHandler()`, in `access: invited` and `public-with-sign-in` `createSignedInHandler()` and, in `access: custom`, `createCodeHandler()`, `createRefreshHandler()` and `createAnonymousHandler()`. See [Webhooks - Auth Hook](?path=/docs/phoenix-webhooks--docs#auth-hook).
|
|
443
|
+
|
|
442
444
|
**Webhook Handlers** are server-side task handlers for configuration finalization. Built with `phx.webhooks.finalizeHandlerBuilder`. They chain tasks like PDF generation, email sending, image rendering, and CSV export. These run on the backend after user submits configuration.
|
|
443
445
|
|
|
444
446
|
| Purpose | Location | Example Files |
|
|
445
447
|
| ---------------- | ------------------------ | ------------------------------------------------------- |
|
|
446
448
|
| Event Handlers | `src/handlers/` | `collect-frontend-data.ts`, `GetResourcesMapHandler.ts` |
|
|
447
|
-
|
|
|
449
|
+
| Access Handlers | `src/handlers/` | `chunk-scopes.ts`, `visitor.ts` |
|
|
450
|
+
| Webhook Handlers | `src/webhooks/handlers/` | finalize handlers |
|
|
448
451
|
|
|
449
452
|
### Admin Interface
|
|
450
453
|
|
|
@@ -574,12 +577,14 @@ The `application.yaml` file contains global application-level settings. These fi
|
|
|
574
577
|
|
|
575
578
|
### Authentication & Access Control
|
|
576
579
|
|
|
577
|
-
| Field | Type | Description
|
|
578
|
-
| --------------- | ---------- |
|
|
579
|
-
| `
|
|
580
|
-
| `
|
|
581
|
-
| `
|
|
582
|
-
| `
|
|
580
|
+
| Field | Type | Description |
|
|
581
|
+
| --------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
582
|
+
| `access` | `string` | Who can open the configurator and who signs its users in: `public` (default), `invited`, `public-with-sign-in`, `custom` or `legacy-clerk` |
|
|
583
|
+
| `useAuthHook` | `boolean` | Deprecated: `true` is replaced by `access: custom`, `false` by `access: public` |
|
|
584
|
+
| `useClerk` | `boolean` | Deprecated: replaced by `access: legacy-clerk` |
|
|
585
|
+
| `useCognito` | `boolean` | Deprecated: replaced by `access: invited`, or `access: public-with-sign-in` in a project with `src/webhooks/index.ts` |
|
|
586
|
+
| `acl` | `object` | Access control list defining permissions |
|
|
587
|
+
| `acl.canCreate` | `string[]` | Roles that can create configurations |
|
|
583
588
|
|
|
584
589
|
### Workspace & Data
|
|
585
590
|
|
|
@@ -688,7 +693,7 @@ availableLocales:
|
|
|
688
693
|
- de
|
|
689
694
|
- fr
|
|
690
695
|
|
|
691
|
-
|
|
696
|
+
access: legacy-clerk
|
|
692
697
|
sessionData:
|
|
693
698
|
type: object
|
|
694
699
|
properties:
|
|
@@ -87,7 +87,7 @@ $data:
|
|
|
87
87
|
|
|
88
88
|
### System Chunk
|
|
89
89
|
|
|
90
|
-
The `system` chunk is auto-generated with scope `"public"`. It contains presets and recipes, is always accessible, and cannot be defined by users. The auth
|
|
90
|
+
The `system` chunk is auto-generated with scope `"public"`. It contains presets and recipes, is always accessible, and cannot be defined by users. The auth hook **automatically adds** the system chunk scope to every successful session, even when the project has no chunk scopes handler.
|
|
91
91
|
|
|
92
92
|
### Publish Flow
|
|
93
93
|
|
|
@@ -201,8 +201,8 @@ Chunked publishing uses **scopes** to control which sessions can access which ch
|
|
|
201
201
|
|
|
202
202
|
```mermaid
|
|
203
203
|
flowchart LR
|
|
204
|
-
A["
|
|
205
|
-
|
|
204
|
+
A["Chunk scopes handler
|
|
205
|
+
src/handlers/"] --> B["Session JWT
|
|
206
206
|
chunkScopes field"]
|
|
207
207
|
B --> C["Chunk request"]
|
|
208
208
|
C --> D{Scope match?}
|
|
@@ -210,33 +210,26 @@ flowchart LR
|
|
|
210
210
|
D -->|No| F["403 Forbidden"]
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
###
|
|
213
|
+
### Chunk Scopes Handler
|
|
214
214
|
|
|
215
|
-
Register a scope resolver
|
|
215
|
+
Register a scope resolver in a file in `src/handlers/` that default-exports `phx.access.createChunkScopesHandler`. It applies in every access mode:
|
|
216
216
|
|
|
217
217
|
```typescript
|
|
218
|
-
// src/
|
|
219
|
-
export
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
success: true,
|
|
224
|
-
data: {},
|
|
225
|
-
role: 'anonymous',
|
|
226
|
-
}))
|
|
227
|
-
.withPublishedChunkScopes(({ role }) => {
|
|
228
|
-
if (role === 'admin' || role === 'superadmin') {
|
|
229
|
-
return ['dealer', 'admin']
|
|
230
|
-
}
|
|
218
|
+
// src/handlers/chunk-scopes.ts
|
|
219
|
+
export default phx.access.createChunkScopesHandler(({ role }) => {
|
|
220
|
+
if (role === 'admin' || role === 'superadmin') {
|
|
221
|
+
return ['dealer', 'admin']
|
|
222
|
+
}
|
|
231
223
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
.build()
|
|
224
|
+
return []
|
|
225
|
+
})
|
|
235
226
|
```
|
|
236
227
|
|
|
237
|
-
The resolver receives `{ role, data }
|
|
228
|
+
The resolver receives `{ role, data }`, the role the session was granted and its final session data, and returns `readonly string[]` of scope values. The returned scopes are stored in the session JWT as `chunkScopes`.
|
|
229
|
+
|
|
230
|
+
> **Note:** The system chunk scope (`"public"`) is automatically injected into every successful sign-in — you do not need to return it from the resolver. Every session always has access to the system chunk (presets and recipes).
|
|
238
231
|
|
|
239
|
-
|
|
232
|
+
A project on the deprecated `phx.webhooks.authHandlerBuilder` can still register the resolver with `withPublishedChunkScopes()`, which wins over a chunk scopes handler file.
|
|
240
233
|
|
|
241
234
|
**Scope resolver patterns:**
|
|
242
235
|
|
|
@@ -248,21 +241,21 @@ The resolver receives `{ role, data }` and returns `readonly string[]` of scope
|
|
|
248
241
|
|
|
249
242
|
### Studio Embedded Admin
|
|
250
243
|
|
|
251
|
-
The embedded admin in Studio does not use the project's
|
|
244
|
+
The embedded admin in Studio does not use the project's chunk scopes handler. Studio must be able to manage all published data configured by the project, so it uses the deployed embedded module as its source of truth:
|
|
252
245
|
|
|
253
246
|
1. Studio loads the embedded admin module and reads `config.chunks`, which is generated from the YAML `chunks` section.
|
|
254
247
|
2. Studio deduplicates every configured scope, including the generated `system` chunk's `"public"` scope.
|
|
255
248
|
3. The admin-only Studio endpoint generates both the Configurator and Admin session tokens with the complete scope set in `chunkScopes`.
|
|
256
249
|
4. Studio mounts the embedded admin only after both scoped tokens are available.
|
|
257
250
|
|
|
258
|
-
This behavior is specific to authenticated Studio admins. Configurator sessions continue to receive scopes from
|
|
251
|
+
This behavior is specific to authenticated Studio admins. Configurator sessions continue to receive scopes from the chunk scopes handler.
|
|
259
252
|
|
|
260
253
|
### Scope Matching
|
|
261
254
|
|
|
262
255
|
Access is granted when the session's `chunkScopes` array **includes** the chunk's scope string. This is a simple membership check, not hierarchical.
|
|
263
256
|
|
|
264
|
-
- If no
|
|
265
|
-
- The system chunk scope (`"public"`) is **always auto-injected** — every
|
|
257
|
+
- If no chunk scopes handler or resolver is configured, sessions contain only the automatically injected `"public"` scope
|
|
258
|
+
- The system chunk scope (`"public"`) is **always auto-injected** — every session can access the system chunk
|
|
266
259
|
- Scope values are arbitrary strings; the resolver controls the vocabulary
|
|
267
260
|
|
|
268
261
|
## Frontend Runtime
|
|
@@ -441,7 +434,7 @@ export default phx.domain.implementCustomExpressions({
|
|
|
441
434
|
- **`$data` requires chunks** — defining `$data` entries auto-enables chunked mode
|
|
442
435
|
- **Scopes** control access via simple membership check against session `chunkScopes`
|
|
443
436
|
- **System chunk** is auto-generated (`scope: "public"`) and contains presets/recipes — its scope is auto-injected into every session
|
|
444
|
-
- **`
|
|
437
|
+
- **`phx.access.createChunkScopesHandler()`** in `src/handlers/` assigns scopes to sessions (system chunk scope is always included automatically)
|
|
445
438
|
- **Studio embedded admin** receives every scope from the deployed YAML-generated `config.chunks`
|
|
446
439
|
- **`createFilterPublishedChunksHandler()`** overrides default scope-based frontend filtering
|
|
447
440
|
- **`initialPublishedData`** provides fallback data derived from domain spec `values`
|
|
@@ -90,7 +90,7 @@ pnpm phoenix deploy
|
|
|
90
90
|
pnpm phoenix deploy --env staging
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
`phoenix deploy` builds into a **preview**, never into production. Every new project has `production` and a preview called `preview`;
|
|
93
|
+
`phoenix deploy` builds into a **preview**, never into production. Every new project has `production` and a preview called `preview`; your workspace's plan sets how many previews it can have (three on Trial, Basic and Beta), and you create or delete them in Studio (the environment picker's **New preview**, or Project settings). Without `--env` the deploy builds into `preview`, and creates it when your project has none. `--env <name>` builds into another preview that already exists. Production changes only when you **promote** a preview build in Studio, or roll it back to an earlier build (see Roll back production below).
|
|
94
94
|
|
|
95
95
|
`phoenix deploy` goes through these steps:
|
|
96
96
|
|
|
@@ -130,7 +130,7 @@ Tell us what is broken, confusing or missing, from wherever you are:
|
|
|
130
130
|
|
|
131
131
|
- You can deploy and run `phoenix dev` once the selected project is set up, about a minute after it is created. Until then, both tell you the project is still being set up; if the setup failed, they tell you to retry it in Studio.
|
|
132
132
|
- The model of your first promotion is version 1 in production; there is nothing to migrate from. Only a project whose production was first deployed as the hello-world starter, in the early beta, has the starter's model as version 1: replacing it with your own model needs the starter's model kept as `v1` and a migration to version 2, and [Migrations](?path=/docs/phoenix-migrations--docs) shows the migration for replacing a model entirely.
|
|
133
|
-
- Each project has its `production`,
|
|
133
|
+
- Each project has its `production`, as many previews as its workspace's plan allows and a development environment per user. A deleted preview's name cannot be reused until its removal has finished. Staff can create projects in your workspace, and workspace superadmins create them in Studio; a project cannot move to another workspace.
|
|
134
134
|
- `phoenix deploy` deploys to the project `--project` or `project` of the application spec names, or else to one of the projects the sign-in can reach, as `phoenix dev` does; it does not read `PROJECT_SLUG`. `project: default` names no project. When a slug is in several of your workspaces, name the project as `<project>--<workspace>`. Targeting a project other than the workspace's initial one requires server API 1.61.0 or newer; the CLI stops before upload if the server cannot confirm support.
|
|
135
135
|
- Of the development commands, only `phoenix dev` works from the sign-in. `phoenix deployment:prepare-dev` still needs the `.env` block of a Studio development environment.
|
|
136
136
|
- Every deploy uploads the whole project; there are no incremental uploads.
|