@tailor-platform/sdk 1.55.0 → 1.55.2

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/application-D6znmyMd.mjs +4 -0
  3. package/dist/{application-DzUlASfA.mjs → application-MY7YJJ-C.mjs} +13 -17
  4. package/dist/application-MY7YJJ-C.mjs.map +1 -0
  5. package/dist/cli/index.mjs +98 -35
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.d.mts +10 -10
  8. package/dist/cli/lib.mjs +2 -2
  9. package/dist/configure/index.d.mts +3 -3
  10. package/dist/configure/index.mjs +2 -8
  11. package/dist/configure/index.mjs.map +1 -1
  12. package/dist/{index-BLsnrEtc.d.mts → index-1APcOP9X.d.mts} +3 -3
  13. package/dist/{index-BE-fpxIo.d.mts → index-CPRnOjjt.d.mts} +2 -2
  14. package/dist/{index-S6-FtUpA.d.mts → index-CQZVJ5SX.d.mts} +2 -2
  15. package/dist/{index-D9xG-a6Y.d.mts → index-CfRFkXIO.d.mts} +2 -2
  16. package/dist/{index-cHqh66cF.d.mts → index-DUupuPhZ.d.mts} +2 -2
  17. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  18. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  19. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  20. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  21. package/dist/{plugin-BuE5ZOnW.d.mts → plugin-C_FyVSdl.d.mts} +3 -3
  22. package/dist/{runtime-BZsl7Mh9.mjs → runtime-DH5F_z8A.mjs} +117 -40
  23. package/dist/runtime-DH5F_z8A.mjs.map +1 -0
  24. package/dist/utils/test/index.d.mts +2 -2
  25. package/dist/{workflow.generated-CQg1_Ami.d.mts → workflow.generated-BGLDYJOq.d.mts} +2 -2
  26. package/docs/cli-reference.md +12 -0
  27. package/docs/services/auth.md +11 -0
  28. package/package.json +11 -11
  29. package/dist/application-DM8q9GDI.mjs +0 -4
  30. package/dist/application-DzUlASfA.mjs.map +0 -1
  31. package/dist/runtime-BZsl7Mh9.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.55.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1190](https://github.com/tailor-platform/sdk/pull/1190) [`6f891e8`](https://github.com/tailor-platform/sdk/commit/6f891e8a0f948ca2b58bb7e1d4ad19efc31cc38c) Thanks [@toiroakr](https://github.com/toiroakr)! - Validate auth service configuration during `deploy` / `generate`, consistent with how IdP, TailorDB, and static websites are already handled. Configs that set both `userProfile` and `machineUserAttributes` now fail with a clearer message: "Specify either `userProfile` or `machineUserAttributes`, not both."
8
+
9
+ - [#1332](https://github.com/tailor-platform/sdk/pull/1332) [`aa898b7`](https://github.com/tailor-platform/sdk/commit/aa898b7f369c441077973848a92a09152f6bed4f) Thanks [@dqn](https://github.com/dqn)! - Fix `executor get --json` to include typed event trigger metadata such as event types, namespaces, target names, and conditions.
10
+
11
+ ## 1.55.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1333](https://github.com/tailor-platform/sdk/pull/1333) [`46a0f78`](https://github.com/tailor-platform/sdk/commit/46a0f78481f4718a470a2cb5a15298db8015f452) Thanks [@toiroakr](https://github.com/toiroakr)! - Fix `tailor-sdk api` injecting a duplicate `workspaceId` when `--body` supplies the field in snake_case. The auto-injection guard only checked the camelCase key, so a body such as `{"workspace_id": "..."}` slipped past it and the SDK appended a second `workspaceId`, which the server rejected with a duplicate-field error. Body keys are now converged to each field's canonical (camelCase) name before injection, so snake_case and JSON aliases are recognized.
16
+
17
+ - [#1325](https://github.com/tailor-platform/sdk/pull/1325) [`8bd51e6`](https://github.com/tailor-platform/sdk/commit/8bd51e64143a2877dcdc821a57b8b6b82cf61363) Thanks [@dqn](https://github.com/dqn)! - Fix `--json` output for CLI commands that returned human-readable text or empty stdout instead of parseable JSON.
18
+
19
+ - [#1276](https://github.com/tailor-platform/sdk/pull/1276) [`f1536d6`](https://github.com/tailor-platform/sdk/commit/f1536d64d182c9456692165397a74ad8c0257d30) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update oxc
20
+
21
+ - [#1312](https://github.com/tailor-platform/sdk/pull/1312) [`00c9b07`](https://github.com/tailor-platform/sdk/commit/00c9b07fdec9b6fa59026f6d4451d43f04114c55) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update @inquirer to v8.5.2
22
+
23
+ - [#1316](https://github.com/tailor-platform/sdk/pull/1316) [`b7f0389`](https://github.com/tailor-platform/sdk/commit/b7f0389270573ba5cf6accca31acdea027974c8d) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency tsx to v4.22.4
24
+
25
+ - [#1318](https://github.com/tailor-platform/sdk/pull/1318) [`c48aeb6`](https://github.com/tailor-platform/sdk/commit/c48aeb6e72a644b056a48e57d39799cae386461e) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency type-fest to v5.7.0
26
+
27
+ - [#1328](https://github.com/tailor-platform/sdk/pull/1328) [`8473a4d`](https://github.com/tailor-platform/sdk/commit/8473a4d284cea998759584c151e12c6cb9b7bc67) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency graphql to v16.14.1
28
+
3
29
  ## 1.55.0
4
30
 
5
31
  ### Minor Changes
@@ -0,0 +1,4 @@
1
+
2
+ import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-MY7YJJ-C.mjs";
3
+
4
+ export { defineApplication };
@@ -3651,6 +3651,7 @@ const TenantProviderSchema = z.object({
3651
3651
  signatureField: z.string().describe("Field used as the tenant signature")
3652
3652
  });
3653
3653
  const UserProfileSchema = z.object({
3654
+ namespace: z.string().optional().describe("TailorDB namespace where the user type is defined"),
3654
3655
  type: z.object({
3655
3656
  name: z.string(),
3656
3657
  fields: z.any(),
@@ -3693,16 +3694,17 @@ const AuthConfigBaseSchema = z.object({
3693
3694
  connections: z.record(z.string(), AuthConnectionConfigSchema).optional().describe("Auth connection definitions for external OAuth2 providers"),
3694
3695
  publishSessionEvents: z.boolean().optional().describe("Enable publishing session events")
3695
3696
  });
3696
- const AuthConfigSchema = z.union([AuthConfigBaseSchema.extend({
3697
- userProfile: z.undefined().optional(),
3698
- machineUserAttributes: z.undefined().optional()
3699
- }), z.xor([AuthConfigBaseSchema.extend({
3700
- userProfile: UserProfileSchema,
3697
+ const AuthConfigSchema = z.xor([AuthConfigBaseSchema.extend({
3698
+ userProfile: UserProfileSchema.optional().describe("User profile configuration"),
3701
3699
  machineUserAttributes: z.undefined().optional()
3702
3700
  }), AuthConfigBaseSchema.extend({
3703
3701
  userProfile: z.undefined().optional(),
3704
- machineUserAttributes: z.record(z.string(), TailorFieldSchema)
3705
- })])]).brand("AuthConfig");
3702
+ machineUserAttributes: z.record(z.string(), TailorFieldSchema).describe("Machine user attribute fields")
3703
+ })], { error: (iss) => {
3704
+ if (iss.code !== "invalid_union") return void 0;
3705
+ if (iss.errors.length < 2) return void 0;
3706
+ if (iss.errors.every((variantErrors) => variantErrors.every((e) => e.path.length === 1 && (e.path[0] === "userProfile" || e.path[0] === "machineUserAttributes")))) return "Specify either `userProfile` or `machineUserAttributes`, not both.";
3707
+ } }).brand("AuthConfig");
3706
3708
 
3707
3709
  //#endregion
3708
3710
  //#region src/cli/services/auth/service.ts
@@ -3714,18 +3716,12 @@ const AuthConfigSchema = z.union([AuthConfigBaseSchema.extend({
3714
3716
  * @returns A new AuthService instance
3715
3717
  */
3716
3718
  function createAuthService(config, tailorDBServices, externalTailorDBNamespaces) {
3717
- const parsedConfig = {
3718
- ...config,
3719
- idProvider: IdProviderSchema.optional().parse(config.idProvider)
3720
- };
3721
- const connections = {};
3722
- if (config.connections) for (const [name, connConfig] of Object.entries(config.connections)) connections[name] = AuthConnectionConfigSchema.parse(connConfig);
3719
+ const connections = config.connections ? { ...config.connections } : {};
3723
3720
  let userProfile;
3724
3721
  return {
3725
3722
  config,
3726
3723
  tailorDBServices,
3727
3724
  externalTailorDBNamespaces,
3728
- parsedConfig,
3729
3725
  connections,
3730
3726
  get userProfile() {
3731
3727
  return userProfile;
@@ -5473,7 +5469,7 @@ function defineAuth(config, tailorDBServices, externalTailorDBNamespaces) {
5473
5469
  subgraphs
5474
5470
  };
5475
5471
  let authService;
5476
- if (!("external" in config)) authService = createAuthService(config, tailorDBServices, externalTailorDBNamespaces);
5472
+ if (!("external" in config)) authService = createAuthService(AuthConfigSchema.parse(config), tailorDBServices, externalTailorDBNamespaces);
5477
5473
  subgraphs.push({
5478
5474
  Type: "auth",
5479
5475
  Name: config.name
@@ -5716,5 +5712,5 @@ async function loadApplication(params) {
5716
5712
  }
5717
5713
 
5718
5714
  //#endregion
5719
- export { loadAccessToken as C, resolveTokens as D, readPlatformConfig as E, saveUserTokens as O, fetchLatestToken as S, loadWorkspaceId as T, createBundleCache as _, WorkflowJobSchema as a, loadConfig as b, createExecutorService as c, buildExecutorArgsExpr as d, buildResolverOperationHookExpr as f, loadFilesWithIgnores as g, stringifyFunction as h, resolveInlineSourcemap as i, writePlatformConfig as k, ExecutorSchema as l, TailorDBTypeSchema as m, generatePluginFilesIfNeeded as n, ResolverSchema as o, OAuth2ClientSchema as p, loadApplication as r, HTTP_METHODS as s, defineApplication as t, INVOKER_EXPR as u, getDistDir as v, loadConfigPath as w, deleteUserTokens as x, hashFile as y };
5720
- //# sourceMappingURL=application-DzUlASfA.mjs.map
5715
+ export { loadConfigPath as C, saveUserTokens as D, resolveTokens as E, writePlatformConfig as O, loadAccessToken as S, readPlatformConfig as T, getDistDir as _, WorkflowJobSchema as a, deleteUserTokens as b, createExecutorService as c, buildExecutorArgsExpr as d, buildResolverOperationHookExpr as f, createBundleCache as g, loadFilesWithIgnores as h, resolveInlineSourcemap as i, ExecutorSchema as l, stringifyFunction as m, generatePluginFilesIfNeeded as n, ResolverSchema as o, TailorDBTypeSchema as p, loadApplication as r, HTTP_METHODS as s, defineApplication as t, INVOKER_EXPR as u, hashFile as v, loadWorkspaceId as w, fetchLatestToken as x, loadConfig as y };
5716
+ //# sourceMappingURL=application-MY7YJJ-C.mjs.map