@openframe-org/criteria-set-protocol 2.0.4 → 2.0.6-beta.1

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 (35) hide show
  1. package/dist/v1/schemas/certification.d.ts +80 -80
  2. package/dist/v1/schemas/certification.js +7 -6
  3. package/dist/v1/schemas/common.d.ts +59 -90
  4. package/dist/v1/schemas/common.js +15 -14
  5. package/dist/v1/schemas/criteria-tree.d.ts +2017 -2866
  6. package/dist/v1/schemas/criteria-tree.js +2 -1
  7. package/dist/v1/schemas/criterion.d.ts +373 -520
  8. package/dist/v1/schemas/criterion.js +4 -3
  9. package/dist/v1/schemas/data-map.d.ts +2 -2
  10. package/dist/v1/schemas/data-map.js +2 -1
  11. package/dist/v1/schemas/index.d.ts +1 -0
  12. package/dist/v1/schemas/index.js +1 -0
  13. package/dist/v1/schemas/metadata.d.ts +18 -21
  14. package/dist/v1/schemas/metadata.js +7 -6
  15. package/dist/v1/schemas/request/matrix-body-schema.d.ts +7 -7
  16. package/dist/v1/schemas/request/matrix-body-schema.js +5 -4
  17. package/dist/v1/schemas/request/matrix-request-body-schema.d.ts +7 -7
  18. package/dist/v1/schemas/request/matrix-request-body-schema.js +5 -4
  19. package/dist/v1/schemas/request/tree-and-data-body-schema.d.ts +6 -6
  20. package/dist/v1/schemas/request/tree-and-data-body-schema.js +4 -3
  21. package/dist/v1/schemas/request/tree-and-data-request-body-schema.d.ts +6 -6
  22. package/dist/v1/schemas/request/tree-and-data-request-body-schema.js +4 -3
  23. package/dist/v1/schemas/response.d.ts +14 -17
  24. package/dist/v1/schemas/task-group.d.ts +266 -379
  25. package/dist/v1/schemas/task-group.js +5 -4
  26. package/dist/v1/schemas/task-item.d.ts +172 -218
  27. package/dist/v1/schemas/task-item.js +14 -13
  28. package/dist/v1/schemas/task.d.ts +172 -251
  29. package/dist/v1/schemas/task.js +4 -3
  30. package/dist/v1/schemas/theme.d.ts +499 -706
  31. package/dist/v1/schemas/theme.js +4 -3
  32. package/dist/v1/schemas/utils.d.ts +6 -0
  33. package/dist/v1/schemas/utils.js +14 -0
  34. package/dist/v1/utils.d.ts +293 -293
  35. package/package.json +1 -1
@@ -4,16 +4,17 @@ exports.themeSchema = exports.themeOptionsSchema = exports.themeStyleSchema = vo
4
4
  const zod_1 = require("zod");
5
5
  const criterion_1 = require("./criterion");
6
6
  const common_1 = require("./common");
7
+ const utils_1 = require("./utils");
7
8
  exports.themeStyleSchema = zod_1.z.object({
8
9
  primaryColor: common_1.colorSchema,
9
10
  secondaryColor: common_1.colorSchema,
10
11
  });
11
12
  exports.themeOptionsSchema = zod_1.z.object({
12
- hideCode: zod_1.z.boolean().optional(),
13
+ hideCode: (0, utils_1.optional)(zod_1.z.boolean()),
13
14
  });
14
15
  exports.themeSchema = common_1.abstractElementSchema.extend({
15
16
  type: zod_1.z.literal("theme"),
16
- style: exports.themeStyleSchema.optional(),
17
+ style: (0, utils_1.optional)(exports.themeStyleSchema),
17
18
  items: zod_1.z.array(criterion_1.criterionSchema),
18
- options: exports.themeOptionsSchema.optional(),
19
+ options: (0, utils_1.optional)(exports.themeOptionsSchema),
19
20
  });
@@ -0,0 +1,6 @@
1
+ import { z, ZodTypeDef } from "zod";
2
+ /**
3
+ * This function allows us to make a Zod schema optional both as a nullish value and as an undefined value. When parsing,
4
+ * it will transform null values to undefined.
5
+ */
6
+ export declare const optional: <T, O>(typeSchema: z.ZodType<T, z.ZodTypeDef, O>) => z.ZodType<T | null | undefined, z.ZodTypeDef, O | undefined>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.optional = void 0;
4
+ /**
5
+ * This function allows us to make a Zod schema optional both as a nullish value and as an undefined value. When parsing,
6
+ * it will transform null values to undefined.
7
+ */
8
+ const optional = (typeSchema) => {
9
+ return typeSchema
10
+ .nullish()
11
+ .transform((value) => (value === null ? undefined : value))
12
+ .pipe(typeSchema.optional());
13
+ };
14
+ exports.optional = optional;