@tailor-platform/sdk 1.15.1 → 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,13 @@
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
+
3
11
  ## 1.15.1
4
12
 
5
13
  ### Patch 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;
@@ -98579,4 +98591,4 @@ function defineApplication(params) {
98579
98591
 
98580
98592
  //#endregion
98581
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 };
98582
- //# sourceMappingURL=application-B0TR65qY.mjs.map
98594
+ //# sourceMappingURL=application-DLUgR1gv.mjs.map