@tailor-platform/sdk 1.15.0 → 1.15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#597](https://github.com/tailor-platform/sdk/pull/597) [`8d4f911`](https://github.com/tailor-platform/sdk/commit/8d4f9111645df049d91808c7083a054bb0ad656a) Thanks [@riku99](https://github.com/riku99)! - Show clear error when record/oldRecord/newRecord operand is used in gqlPermission
8
+
9
+ - [#609](https://github.com/tailor-platform/sdk/pull/609) [`50f0aee`](https://github.com/tailor-platform/sdk/commit/50f0aee0f17a05afde5bbce2a9f1b42f03cee0e5) Thanks [@riku99](https://github.com/riku99)! - Add `function logs` CLI command to list and view function execution logs
10
+
11
+ ## 1.15.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#608](https://github.com/tailor-platform/sdk/pull/608) [`17fbd24`](https://github.com/tailor-platform/sdk/commit/17fbd243bd2925d3c4b6fe0d61f0a3ab24c3bece) Thanks [@k1LoW](https://github.com/k1LoW)! - Add validation to require allowedEmailDomains when allowGoogleOauth is enabled
16
+
3
17
  ## 1.15.0
4
18
 
5
19
  ### Minor Changes
@@ -97634,13 +97634,21 @@ const TailorDBTypeSettingsSchema = z.object({
97634
97634
  bulkUpsert: z.boolean().optional(),
97635
97635
  gqlOperations: GqlOperationsSchema.optional()
97636
97636
  });
97637
+ const GQL_PERMISSION_INVALID_OPERAND_MESSAGE = "operand is not supported in gqlPermission. Use permission() for record-level conditions.";
97637
97638
  const GqlPermissionOperandSchema = z.union([
97638
- z.object({ user: z.string() }),
97639
+ z.object({ user: z.string() }).strict(),
97639
97640
  z.string(),
97640
97641
  z.boolean(),
97641
97642
  z.array(z.string()),
97642
97643
  z.array(z.boolean())
97643
- ]);
97644
+ ], { error: (issue) => {
97645
+ if (typeof issue.input === "object" && issue.input !== null) {
97646
+ const keys$1 = Object.keys(issue.input);
97647
+ if (keys$1.length === 1) return `"${keys$1[0]}" ${GQL_PERMISSION_INVALID_OPERAND_MESSAGE}`;
97648
+ return "Operand object must have exactly 1 key";
97649
+ }
97650
+ return "Invalid operand in gqlPermission";
97651
+ } });
97644
97652
  const RecordPermissionOperandSchema = z.union([
97645
97653
  GqlPermissionOperandSchema,
97646
97654
  z.object({ record: z.string() }),
@@ -97814,7 +97822,11 @@ function createTailorDBService(params) {
97814
97822
  for (const exportName of Object.keys(module$1)) {
97815
97823
  const exportedValue = module$1[exportName];
97816
97824
  const result = TailorDBTypeSchema.safeParse(exportedValue);
97817
- if (!result.success) continue;
97825
+ if (!result.success) {
97826
+ const gqlPermissionIssue = result.error.issues.find((i$1) => i$1.message.includes(GQL_PERMISSION_INVALID_OPERAND_MESSAGE));
97827
+ if (gqlPermissionIssue) throw new Error(gqlPermissionIssue.message);
97828
+ continue;
97829
+ }
97818
97830
  const relativePath = path$20.relative(process.cwd(), typeFile);
97819
97831
  logger.log(`Type: ${styles.successBright(`"${result.data.name}"`)} loaded from ${styles.path(relativePath)}`);
97820
97832
  rawTypes[typeFile][result.data.name] = result.data;
@@ -98382,6 +98394,9 @@ const IdPUserAuthPolicySchema = z.object({
98382
98394
  }).refine((data$1) => data$1.allowGoogleOauth === void 0 || data$1.allowGoogleOauth === false || !data$1.useNonEmailIdentifier, {
98383
98395
  message: "allowGoogleOauth cannot be set when useNonEmailIdentifier is true",
98384
98396
  path: ["allowGoogleOauth"]
98397
+ }).refine((data$1) => !data$1.allowGoogleOauth || data$1.allowedEmailDomains && data$1.allowedEmailDomains.length > 0, {
98398
+ message: "allowGoogleOauth requires allowedEmailDomains to be set",
98399
+ path: ["allowGoogleOauth"]
98385
98400
  });
98386
98401
  const IdPSchema = z.object({
98387
98402
  name: z.string(),
@@ -98576,4 +98591,4 @@ function defineApplication(params) {
98576
98591
 
98577
98592
  //#endregion
98578
98593
  export { ExecutorSchema as a, functionSchema as c, loadFilesWithIgnores as d, logger as f, createExecutorService as i, stringifyFunction as l, symbols as m, WorkflowJobSchema as n, OAuth2ClientSchema as o, styles as p, WorkflowSchema as r, ResolverSchema as s, defineApplication as t, tailorUserMap as u };
98579
- //# sourceMappingURL=application-DPunZ4lc.mjs.map
98594
+ //# sourceMappingURL=application-DLUgR1gv.mjs.map