@takeshape/schema 8.35.1 → 8.35.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 (75) hide show
  1. package/es/index.js +3 -3
  2. package/es/migration/index.js +82 -0
  3. package/es/migration/to/v3.0.0.js +245 -0
  4. package/es/{migration-utils.js → migration/to/v3.1.0.js} +40 -8
  5. package/es/migration/to/v3.10.0.js +56 -0
  6. package/es/migration/to/v3.11.0.js +99 -0
  7. package/es/migration/to/v3.2.0.js +10 -0
  8. package/es/migration/to/v3.3.0.js +16 -0
  9. package/es/migration/to/v3.4.0.js +10 -0
  10. package/es/migration/to/v3.5.0.js +10 -0
  11. package/es/migration/to/v3.5.1.js +10 -0
  12. package/es/migration/to/v3.6.0.js +10 -0
  13. package/es/migration/to/v3.7.0.js +10 -0
  14. package/es/migration/to/v3.8.0.js +10 -0
  15. package/es/migration/to/v3.9.0.js +83 -0
  16. package/es/migration/types.js +1 -0
  17. package/es/migration/utils.js +23 -0
  18. package/lib/index.d.ts +3 -3
  19. package/lib/index.d.ts.map +1 -1
  20. package/lib/index.js +13 -36
  21. package/lib/migration/index.d.ts +7 -0
  22. package/lib/migration/index.d.ts.map +1 -0
  23. package/lib/migration/index.js +128 -0
  24. package/lib/migration/to/v3.0.0.d.ts +4 -0
  25. package/lib/migration/to/v3.0.0.d.ts.map +1 -0
  26. package/lib/migration/to/v3.0.0.js +260 -0
  27. package/lib/migration/to/v3.1.0.d.ts +5 -0
  28. package/lib/migration/to/v3.1.0.d.ts.map +1 -0
  29. package/lib/{migration-utils.js → migration/to/v3.1.0.js} +40 -10
  30. package/lib/migration/to/v3.10.0.d.ts +4 -0
  31. package/lib/migration/to/v3.10.0.d.ts.map +1 -0
  32. package/lib/migration/to/v3.10.0.js +66 -0
  33. package/lib/migration/to/v3.11.0.d.ts +5 -0
  34. package/lib/migration/to/v3.11.0.d.ts.map +1 -0
  35. package/lib/migration/to/v3.11.0.js +109 -0
  36. package/lib/migration/to/v3.2.0.d.ts +4 -0
  37. package/lib/migration/to/v3.2.0.d.ts.map +1 -0
  38. package/lib/migration/to/v3.2.0.js +18 -0
  39. package/lib/migration/to/v3.3.0.d.ts +5 -0
  40. package/lib/migration/to/v3.3.0.d.ts.map +1 -0
  41. package/lib/migration/to/v3.3.0.js +24 -0
  42. package/lib/migration/to/v3.4.0.d.ts +4 -0
  43. package/lib/migration/to/v3.4.0.d.ts.map +1 -0
  44. package/lib/migration/to/v3.4.0.js +18 -0
  45. package/lib/migration/to/v3.5.0.d.ts +4 -0
  46. package/lib/migration/to/v3.5.0.d.ts.map +1 -0
  47. package/lib/migration/to/v3.5.0.js +18 -0
  48. package/lib/migration/to/v3.5.1.d.ts +4 -0
  49. package/lib/migration/to/v3.5.1.d.ts.map +1 -0
  50. package/lib/migration/to/v3.5.1.js +18 -0
  51. package/lib/migration/to/v3.6.0.d.ts +4 -0
  52. package/lib/migration/to/v3.6.0.d.ts.map +1 -0
  53. package/lib/migration/to/v3.6.0.js +18 -0
  54. package/lib/migration/to/v3.7.0.d.ts +4 -0
  55. package/lib/migration/to/v3.7.0.d.ts.map +1 -0
  56. package/lib/migration/to/v3.7.0.js +18 -0
  57. package/lib/migration/to/v3.8.0.d.ts +4 -0
  58. package/lib/migration/to/v3.8.0.d.ts.map +1 -0
  59. package/lib/migration/to/v3.8.0.js +18 -0
  60. package/lib/migration/to/v3.9.0.d.ts +4 -0
  61. package/lib/migration/to/v3.9.0.d.ts.map +1 -0
  62. package/lib/migration/to/v3.9.0.js +91 -0
  63. package/lib/migration/types.d.ts +14 -0
  64. package/lib/migration/types.d.ts.map +1 -0
  65. package/lib/migration/types.js +5 -0
  66. package/lib/migration/utils.d.ts +5 -0
  67. package/lib/migration/utils.d.ts.map +1 -0
  68. package/lib/migration/utils.js +34 -0
  69. package/package.json +4 -4
  70. package/es/migration.js +0 -677
  71. package/lib/migration-utils.d.ts +0 -18
  72. package/lib/migration-utils.d.ts.map +0 -1
  73. package/lib/migration.d.ts +0 -59
  74. package/lib/migration.d.ts.map +0 -1
  75. package/lib/migration.js +0 -739
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatDate = formatDate;
7
+ exports.getRelationshipSchema = getRelationshipSchema;
8
+ exports.normalizeSchemaVersion = normalizeSchemaVersion;
9
+
10
+ function formatDate(timestamp) {
11
+ return (timestamp ? new Date(timestamp) : new Date()).toISOString();
12
+ }
13
+
14
+ function getRelationshipSchema(relationship) {
15
+ const itemSchema = {
16
+ $ref: '#/shapes/TSRelationship/schema'
17
+ };
18
+
19
+ if (relationship.type === 'multiple') {
20
+ return {
21
+ type: 'array',
22
+ items: itemSchema,
23
+ '@relationship': relationship
24
+ };
25
+ }
26
+
27
+ return { ...itemSchema,
28
+ '@relationship': relationship
29
+ };
30
+ }
31
+
32
+ function normalizeSchemaVersion(version) {
33
+ return version === undefined ? '1' : version;
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/schema",
3
- "version": "8.35.1",
3
+ "version": "8.35.2",
4
4
  "description": "TakeShape Schema",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -21,9 +21,9 @@
21
21
  "examples"
22
22
  ],
23
23
  "dependencies": {
24
- "@takeshape/errors": "8.35.1",
25
- "@takeshape/json-schema": "8.35.1",
26
- "@takeshape/util": "8.35.1",
24
+ "@takeshape/errors": "8.35.2",
25
+ "@takeshape/json-schema": "8.35.2",
26
+ "@takeshape/util": "8.35.2",
27
27
  "ajv": "^7.0.4",
28
28
  "ajv-formats": "^1.5.1",
29
29
  "lodash": "^4.17.20",