@tailor-platform/sdk 1.35.1 → 1.36.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/application-BB5TqXWY.mjs +4 -0
  3. package/dist/{application-BnJRroGX.mjs → application-BwboBFcU.mjs} +102 -17
  4. package/dist/application-BwboBFcU.mjs.map +1 -0
  5. package/dist/cli/index.mjs +303 -17
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.d.mts +190 -6
  8. package/dist/cli/lib.mjs +3 -3
  9. package/dist/{client-BmQP4kKS.mjs → client-B6icVEv4.mjs} +1 -1
  10. package/dist/{client-CA2NM_4R.mjs → client-CN15WgW2.mjs} +25 -8
  11. package/dist/client-CN15WgW2.mjs.map +1 -0
  12. package/dist/configure/index.d.mts +5 -5
  13. package/dist/configure/index.mjs +38 -9
  14. package/dist/configure/index.mjs.map +1 -1
  15. package/dist/{crash-report-Bd2T8BhU.mjs → crash-report-CB1UtT3O.mjs} +1 -1
  16. package/dist/{crash-report-CPkI2-cp.mjs → crash-report-CdxPj_SW.mjs} +2 -2
  17. package/dist/{crash-report-CPkI2-cp.mjs.map → crash-report-CdxPj_SW.mjs.map} +1 -1
  18. package/dist/{env-MSlwZt8l.d.mts → env-_ce3IYbl.d.mts} +2 -2
  19. package/dist/{index-B1Fgxi8D.d.mts → index-C7vIBAg8.d.mts} +2 -2
  20. package/dist/{index-wCoQup4y.d.mts → index-CYaunQeL.d.mts} +76 -6
  21. package/dist/{index-D-tMAFVp.d.mts → index-CxSLivW7.d.mts} +2 -2
  22. package/dist/{index-BG7YCyXF.d.mts → index-DDCyefuU.d.mts} +2 -2
  23. package/dist/{index-BBlE_vQF.d.mts → index-DZN1QFLM.d.mts} +2 -2
  24. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  25. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  26. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  27. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  28. package/dist/plugin/index.d.mts +2 -2
  29. package/dist/{plugin-CZaJ3_QR.d.mts → plugin-CiPUxkyN.d.mts} +3 -2
  30. package/dist/{runtime-D4O-RfcH.mjs → runtime-C7RRDaB3.mjs} +230 -22
  31. package/dist/runtime-C7RRDaB3.mjs.map +1 -0
  32. package/dist/utils/test/index.d.mts +2 -2
  33. package/dist/{workflow.generated-IZ3kLjC_.d.mts → workflow.generated-8BeGQsVU.d.mts} +212 -4
  34. package/docs/cli/function.md +2 -2
  35. package/docs/services/idp.md +50 -0
  36. package/docs/services/resolver.md +1 -1
  37. package/docs/services/secret.md +25 -0
  38. package/docs/services/workflow.md +48 -0
  39. package/package.json +9 -8
  40. package/dist/application-BnJRroGX.mjs.map +0 -1
  41. package/dist/application-mGasp_EX.mjs +0 -4
  42. package/dist/client-CA2NM_4R.mjs.map +0 -1
  43. package/dist/runtime-D4O-RfcH.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.36.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#920](https://github.com/tailor-platform/sdk/pull/920) [`1b64d8e`](https://github.com/tailor-platform/sdk/commit/1b64d8e07c4b8b2c8bcfaded5210b8774d4556ff) Thanks [@dqn](https://github.com/dqn)! - Show original source locations and code snippets in `function test-run` errors using inline sourcemaps
8
+
9
+ - [#931](https://github.com/tailor-platform/sdk/pull/931) [`a1dab54`](https://github.com/tailor-platform/sdk/commit/a1dab54dfec4c7eb69348ab94a82de9d22231c45) Thanks [@toiroakr](https://github.com/toiroakr)! - Add `ignoreNullishValues` option to `defineSecretManager` to skip secrets with nullish values during deploy
10
+
11
+ - [#965](https://github.com/tailor-platform/sdk/pull/965) [`c273be3`](https://github.com/tailor-platform/sdk/commit/c273be330071a9e3d2d2ebc65ef9b17e9c995ddc) Thanks [@haru0017](https://github.com/haru0017)! - Add `defaultRedirectURL` to SAML IdP config for handling SAML ACS responses with empty RelayState
12
+
13
+ ### Patch Changes
14
+
15
+ - [#911](https://github.com/tailor-platform/sdk/pull/911) [`3cf9975`](https://github.com/tailor-platform/sdk/commit/3cf997591ac06c18a973cd16b3c6bc70b05f6793) Thanks [@k1LoW](https://github.com/k1LoW)! - Add `permission` option to `defineIdp()` for per-operation permission policies on IdP users (create, read, update, delete, sendPasswordResetEmail)
16
+
17
+ - [#947](https://github.com/tailor-platform/sdk/pull/947) [`19f95c2`](https://github.com/tailor-platform/sdk/commit/19f95c27e22027037457fcfcd9adca360f62553d) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency oxlint to v1.59.0
18
+
19
+ - [#956](https://github.com/tailor-platform/sdk/pull/956) [`391c53d`](https://github.com/tailor-platform/sdk/commit/391c53d32dd7108aead8917abb12a2b928df792a) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): lock file maintenance
20
+
21
+ - [#957](https://github.com/tailor-platform/sdk/pull/957) [`cc14d77`](https://github.com/tailor-platform/sdk/commit/cc14d773c1f62b9e14c935cf4541983ed514fe90) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update actions/upload-artifact action to v7.0.1
22
+
23
+ - [#958](https://github.com/tailor-platform/sdk/pull/958) [`32e6b1f`](https://github.com/tailor-platform/sdk/commit/32e6b1fa67a582db685f8268dbbb38c0ac45b101) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update anthropics/claude-code-action action to v1.0.93
24
+
25
+ - [#959](https://github.com/tailor-platform/sdk/pull/959) [`61b60c9`](https://github.com/tailor-platform/sdk/commit/61b60c9b0e8af467a50bc4ee06ada89fba76a653) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency knip to v6.3.1
26
+
27
+ - [#960](https://github.com/tailor-platform/sdk/pull/960) [`9e0ce60`](https://github.com/tailor-platform/sdk/commit/9e0ce60b2d5c662c6983c60a377f5ce7c3dea7df) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency turbo to v2.9.5
28
+
29
+ - [#962](https://github.com/tailor-platform/sdk/pull/962) [`dd74185`](https://github.com/tailor-platform/sdk/commit/dd74185d593be00122a173ca427c238292a627bf) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update marocchino/sticky-pull-request-comment action to v3.0.4
30
+
31
+ ## 1.35.2
32
+
33
+ ### Patch Changes
34
+
35
+ - [#925](https://github.com/tailor-platform/sdk/pull/925) [`ce5b766`](https://github.com/tailor-platform/sdk/commit/ce5b76662951cbe89779d45512a57c80cf4a2984) Thanks [@toiroakr](https://github.com/toiroakr)! - `function test-run` resolver arg no longer requires the `input` wrapper key — pass input fields directly (e.g. `-a '{"a":1}'`). The old `{"input":{...}}` format is detected via schema validation and emits a deprecation warning. When no input schema is defined, `--arg` is ignored with a warning.
36
+
37
+ - [#945](https://github.com/tailor-platform/sdk/pull/945) [`4d9892e`](https://github.com/tailor-platform/sdk/commit/4d9892e6e40c6eb4852714b8437339080e935189) Thanks [@anukiransolur](https://github.com/anukiransolur)! - chore(docs): added requirements for deterministic execution that the workflow must satisfy
38
+
39
+ - [#890](https://github.com/tailor-platform/sdk/pull/890) [`f0e03f2`](https://github.com/tailor-platform/sdk/commit/f0e03f267435094e88ec3cedd0af22bb4655264c) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency oxfmt to v0.43.0
40
+
41
+ - [#927](https://github.com/tailor-platform/sdk/pull/927) [`dc699f3`](https://github.com/tailor-platform/sdk/commit/dc699f386b68d9647a77961f5ff34910f1b67939) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency @typescript/native-preview to v7.0.0-dev.20260406.1
42
+
43
+ - [#936](https://github.com/tailor-platform/sdk/pull/936) [`7a1f37b`](https://github.com/tailor-platform/sdk/commit/7a1f37bd376736a47f367ac06fdbb3fbb5fa1446) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency oxc-parser to v0.123.0
44
+
45
+ - [#943](https://github.com/tailor-platform/sdk/pull/943) [`14af922`](https://github.com/tailor-platform/sdk/commit/14af922e82d945c76b8c864d1bb177eb9fae26f6) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update anthropics/claude-code-action action to v1.0.92
46
+
47
+ - [#944](https://github.com/tailor-platform/sdk/pull/944) [`f0070a9`](https://github.com/tailor-platform/sdk/commit/f0070a9f41a15c9802b9c5caf201cf802e19a589) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency @inquirer/core to v11.1.8
48
+
49
+ - [#946](https://github.com/tailor-platform/sdk/pull/946) [`c06dd0e`](https://github.com/tailor-platform/sdk/commit/c06dd0e16688b7863a4c85e569ed4e2e60bba971) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency oxfmt to v0.44.0
50
+
51
+ - [#948](https://github.com/tailor-platform/sdk/pull/948) [`d5f365f`](https://github.com/tailor-platform/sdk/commit/d5f365ff1153d34362b743d8d9019183f67b668a) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency @inquirer/prompts to v8.4.0
52
+
53
+ - [#950](https://github.com/tailor-platform/sdk/pull/950) [`0dc96f9`](https://github.com/tailor-platform/sdk/commit/0dc96f9e2fde7088cef29142ce7917694dee5fca) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency oxc-parser to v0.124.0
54
+
3
55
  ## 1.35.1
4
56
 
5
57
  ### Patch Changes
@@ -0,0 +1,4 @@
1
+
2
+ import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-BwboBFcU.mjs";
3
+
4
+ export { defineApplication };
@@ -1,5 +1,5 @@
1
1
 
2
- import { l as initOAuth2Client } from "./client-CA2NM_4R.mjs";
2
+ import { l as initOAuth2Client } from "./client-CN15WgW2.mjs";
3
3
  import { n as isSdkBranded } from "./brand-0SscafcY.mjs";
4
4
  import { n as logger, r as styles } from "./logger-qz-Y4sBV.mjs";
5
5
  import { t as readPackageJson } from "./package-json-CfUqjJaQ.mjs";
@@ -3201,7 +3201,8 @@ const SAMLSchema = z.object({
3201
3201
  kind: z.literal("SAML"),
3202
3202
  enableSignRequest: z.boolean().default(false).describe("Enable signing of SAML requests"),
3203
3203
  metadataURL: z.string().optional().describe("URL to fetch SAML metadata (mutually exclusive with rawMetadata)"),
3204
- rawMetadata: z.string().optional().describe("Raw SAML metadata XML (mutually exclusive with metadataURL)")
3204
+ rawMetadata: z.string().optional().describe("Raw SAML metadata XML (mutually exclusive with metadataURL)"),
3205
+ defaultRedirectURL: z.string().optional().describe("URL to redirect to when SAML ACS receives a response with an empty RelayState.")
3205
3206
  }).refine((value) => {
3206
3207
  return value.metadataURL !== void 0 !== (value.rawMetadata !== void 0);
3207
3208
  }, "Provide either metadataURL or rawMetadata");
@@ -4644,6 +4645,68 @@ const IdPEmailConfigSchema = z.object({
4644
4645
  fromName: emailFieldSchema.optional().describe("Default sender display name for emails"),
4645
4646
  passwordResetSubject: emailFieldSchema.optional().describe("Default subject for password reset emails")
4646
4647
  }).describe("Namespace-level email configuration defaults");
4648
+ const IdPPermissionOperandSchema = z.union([
4649
+ z.string(),
4650
+ z.boolean(),
4651
+ z.array(z.string()).readonly(),
4652
+ z.array(z.boolean()).readonly(),
4653
+ z.object({ user: z.string() }),
4654
+ z.object({ idpUser: z.enum([
4655
+ "id",
4656
+ "name",
4657
+ "disabled"
4658
+ ]) }),
4659
+ z.object({ oldIdpUser: z.enum([
4660
+ "id",
4661
+ "name",
4662
+ "disabled"
4663
+ ]) }),
4664
+ z.object({ newIdpUser: z.enum([
4665
+ "id",
4666
+ "name",
4667
+ "disabled"
4668
+ ]) })
4669
+ ]);
4670
+ const IdPPermissionOperatorSchema = z.enum([
4671
+ "=",
4672
+ "!=",
4673
+ "in",
4674
+ "not in"
4675
+ ]);
4676
+ const IdPPermissionConditionSchema = z.tuple([
4677
+ IdPPermissionOperandSchema,
4678
+ IdPPermissionOperatorSchema,
4679
+ IdPPermissionOperandSchema
4680
+ ]).readonly();
4681
+ const IdPActionPermissionSchema = z.union([
4682
+ z.object({
4683
+ conditions: z.union([IdPPermissionConditionSchema, z.array(IdPPermissionConditionSchema).readonly()]),
4684
+ description: z.string().optional(),
4685
+ permit: z.boolean().optional()
4686
+ }),
4687
+ z.tuple([
4688
+ IdPPermissionOperandSchema,
4689
+ IdPPermissionOperatorSchema,
4690
+ IdPPermissionOperandSchema
4691
+ ]).readonly(),
4692
+ z.tuple([
4693
+ IdPPermissionOperandSchema,
4694
+ IdPPermissionOperatorSchema,
4695
+ IdPPermissionOperandSchema,
4696
+ z.boolean()
4697
+ ]).readonly(),
4698
+ z.array(z.union([IdPPermissionConditionSchema, z.boolean()])).refine((arr) => {
4699
+ const boolIndex = arr.findIndex((item) => typeof item === "boolean");
4700
+ return boolIndex === -1 || boolIndex === arr.length - 1;
4701
+ }, { message: "Boolean permit flag must only appear at the end" }).readonly()
4702
+ ]);
4703
+ const IdPPermissionSchema = z.object({
4704
+ create: z.array(IdPActionPermissionSchema).readonly(),
4705
+ read: z.array(IdPActionPermissionSchema).readonly(),
4706
+ update: z.array(IdPActionPermissionSchema).readonly(),
4707
+ delete: z.array(IdPActionPermissionSchema).readonly(),
4708
+ sendPasswordResetEmail: z.array(IdPActionPermissionSchema).readonly()
4709
+ }).describe("Per-operation permission policies for IdP users");
4647
4710
  const IdPSchema = z.object({
4648
4711
  name: z.string().describe("IdP service name"),
4649
4712
  authorization: z.union([
@@ -4656,14 +4719,18 @@ const IdPSchema = z.object({
4656
4719
  userAuthPolicy: IdPUserAuthPolicySchema.transform((input) => IdPUserAuthPolicySchema.parse(input ?? {})).optional().describe("User authentication policy configuration"),
4657
4720
  publishUserEvents: z.boolean().optional().describe("Enable publishing user lifecycle events"),
4658
4721
  gqlOperations: IdPGqlOperationsSchema.optional().describe("Configure which GraphQL operations are enabled"),
4659
- emailConfig: IdPEmailConfigSchema.optional().describe("Namespace-level email configuration defaults")
4722
+ emailConfig: IdPEmailConfigSchema.optional().describe("Namespace-level email configuration defaults"),
4723
+ permission: IdPPermissionSchema.optional().describe("Per-operation permission policies for IdP users")
4660
4724
  }).brand("IdPConfig");
4661
4725
 
4662
4726
  //#endregion
4663
4727
  //#region src/parser/service/secrets/schema.ts
4664
4728
  const nameSchema = z.string().regex(/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/);
4665
- const secretsVaultSchema = z.record(nameSchema, z.string());
4666
- const SecretsSchema = z.record(nameSchema, secretsVaultSchema);
4729
+ const secretsVaultSchema = z.record(nameSchema, z.string().nullish());
4730
+ const SecretsSchema = z.object({
4731
+ vaults: z.record(nameSchema, secretsVaultSchema),
4732
+ options: z.object({ ignoreNullishValues: z.boolean() })
4733
+ });
4667
4734
 
4668
4735
  //#endregion
4669
4736
  //#region src/parser/service/staticwebsite/schema.ts
@@ -4789,27 +4856,43 @@ function defineStaticWebsites(websites) {
4789
4856
  });
4790
4857
  return staticWebsiteServices;
4791
4858
  }
4792
- function defineSecretManager(config) {
4793
- if (!config) return [];
4794
- const data = Object.fromEntries(Object.entries(config));
4795
- const parsed = SecretsSchema.parse(data);
4796
- return Object.entries(parsed).map(([vaultName, vaultSecrets]) => ({
4859
+ function parseSecretManager(config) {
4860
+ if (!config) return {
4861
+ secrets: [],
4862
+ ignoreNullishValues: false
4863
+ };
4864
+ const parsed = SecretsSchema.parse(config);
4865
+ const { ignoreNullishValues } = parsed.options;
4866
+ const secrets = Object.entries(parsed.vaults).map(([vaultName, vaultSecrets]) => ({
4797
4867
  vaultName,
4798
4868
  secrets: Object.entries(vaultSecrets).map(([name, value]) => ({
4799
4869
  name,
4800
4870
  value
4801
4871
  }))
4802
4872
  }));
4873
+ if (!ignoreNullishValues) {
4874
+ for (const vault of secrets) for (const secret of vault.secrets) if (secret.value == null) throw new Error(`Secret "${vault.vaultName}/${secret.name}" has no value. Use { ignoreNullishValues: true } option in defineSecretManager() to skip secrets without values.`);
4875
+ }
4876
+ return {
4877
+ secrets,
4878
+ ignoreNullishValues
4879
+ };
4803
4880
  }
4804
4881
  function defineServices(config, pluginManager) {
4805
4882
  const tailordbResult = defineTailorDB(config.db, pluginManager);
4883
+ const resolverResult = defineResolver(config.resolver);
4884
+ const idpResult = defineIdp(config.idp);
4885
+ const authResult = defineAuth(config.auth, tailordbResult.tailorDBServices, tailordbResult.externalTailorDBNamespaces);
4886
+ const staticWebsiteServices = defineStaticWebsites(config.staticWebsites);
4887
+ const { secrets, ignoreNullishValues } = parseSecretManager(config.secrets);
4806
4888
  return {
4807
4889
  tailordbResult,
4808
- resolverResult: defineResolver(config.resolver),
4809
- idpResult: defineIdp(config.idp),
4810
- authResult: defineAuth(config.auth, tailordbResult.tailorDBServices, tailordbResult.externalTailorDBNamespaces),
4811
- staticWebsiteServices: defineStaticWebsites(config.staticWebsites),
4812
- secrets: defineSecretManager(config.secrets)
4890
+ resolverResult,
4891
+ idpResult,
4892
+ authResult,
4893
+ staticWebsiteServices,
4894
+ secrets,
4895
+ ignoreNullishValues
4813
4896
  };
4814
4897
  }
4815
4898
  function buildApplication(params) {
@@ -4831,6 +4914,7 @@ function buildApplication(params) {
4831
4914
  workflowService: params.workflowService,
4832
4915
  staticWebsiteServices: params.staticWebsiteServices,
4833
4916
  secrets: params.secrets,
4917
+ ignoreNullishValues: params.ignoreNullishValues,
4834
4918
  env: params.env,
4835
4919
  get applications() {
4836
4920
  return [application];
@@ -4893,7 +4977,7 @@ function generatePluginFilesIfNeeded(pluginManager, tailorDBServices, configPath
4893
4977
  */
4894
4978
  async function loadApplication(params) {
4895
4979
  const { config, pluginManager, bundleCache } = params;
4896
- const { tailordbResult, resolverResult, idpResult, authResult, staticWebsiteServices, secrets } = defineServices(config, pluginManager);
4980
+ const { tailordbResult, resolverResult, idpResult, authResult, staticWebsiteServices, secrets, ignoreNullishValues } = defineServices(config, pluginManager);
4897
4981
  for (const tailordb of tailordbResult.tailorDBServices) {
4898
4982
  await tailordb.loadTypes();
4899
4983
  await tailordb.processNamespacePlugins();
@@ -4956,6 +5040,7 @@ async function loadApplication(params) {
4956
5040
  workflowService,
4957
5041
  staticWebsiteServices,
4958
5042
  secrets,
5043
+ ignoreNullishValues,
4959
5044
  env: config.env ?? {}
4960
5045
  }),
4961
5046
  workflowBuildResult,
@@ -4965,4 +5050,4 @@ async function loadApplication(params) {
4965
5050
 
4966
5051
  //#endregion
4967
5052
  export { resolveTokens as C, readPlatformConfig as S, writePlatformConfig as T, hashFile as _, loadConfig as a, loadAccessToken as b, createExecutorService as c, TailorDBTypeSchema as d, stringifyFunction as f, getDistDir as g, createBundleCache as h, resolveInlineSourcemap as i, ExecutorSchema as l, loadFilesWithIgnores as m, generatePluginFilesIfNeeded as n, WorkflowJobSchema as o, tailorUserMap as p, loadApplication as r, ResolverSchema as s, defineApplication as t, OAuth2ClientSchema as u, deleteUserTokens as v, saveUserTokens as w, loadWorkspaceId as x, fetchLatestToken as y };
4968
- //# sourceMappingURL=application-BnJRroGX.mjs.map
5053
+ //# sourceMappingURL=application-BwboBFcU.mjs.map