@osdk/maker 0.12.2 → 0.13.0-beta.10
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 +77 -52
- package/build/browser/api/defineAction.js +21 -19
- package/build/browser/api/defineAction.js.map +1 -1
- package/build/browser/api/defineObject.js +2 -0
- package/build/browser/api/defineObject.js.map +1 -1
- package/build/browser/api/defineOntology.js +33 -109
- package/build/browser/api/defineOntology.js.map +1 -1
- package/build/browser/api/defineSpt.js.map +1 -1
- package/build/browser/api/defineValueType.js +2 -1
- package/build/browser/api/defineValueType.js.map +1 -1
- package/build/browser/api/markingconstraint.test.js +3 -3
- package/build/browser/api/markingconstraint.test.js.map +1 -1
- package/build/browser/api/objectStatus.test.js +4 -4
- package/build/browser/api/objectStatus.test.js.map +1 -1
- package/build/browser/api/overall.test.js +841 -310
- package/build/browser/api/overall.test.js.map +1 -1
- package/build/browser/api/propertyConversionUtils.js +3 -1
- package/build/browser/api/propertyConversionUtils.js.map +1 -1
- package/build/browser/api/types.js.map +1 -1
- package/build/browser/cli/main.js +5 -5
- package/build/browser/cli/main.js.map +1 -1
- package/build/cjs/index.cjs +67 -136
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +8 -10
- package/build/esm/api/defineAction.js +21 -19
- package/build/esm/api/defineAction.js.map +1 -1
- package/build/esm/api/defineObject.js +2 -0
- package/build/esm/api/defineObject.js.map +1 -1
- package/build/esm/api/defineOntology.js +33 -109
- package/build/esm/api/defineOntology.js.map +1 -1
- package/build/esm/api/defineSpt.js.map +1 -1
- package/build/esm/api/defineValueType.js +2 -1
- package/build/esm/api/defineValueType.js.map +1 -1
- package/build/esm/api/markingconstraint.test.js +3 -3
- package/build/esm/api/markingconstraint.test.js.map +1 -1
- package/build/esm/api/objectStatus.test.js +4 -4
- package/build/esm/api/objectStatus.test.js.map +1 -1
- package/build/esm/api/overall.test.js +841 -310
- package/build/esm/api/overall.test.js.map +1 -1
- package/build/esm/api/propertyConversionUtils.js +3 -1
- package/build/esm/api/propertyConversionUtils.js.map +1 -1
- package/build/esm/api/types.js.map +1 -1
- package/build/esm/cli/main.js +5 -5
- package/build/esm/cli/main.js.map +1 -1
- package/build/types/api/defineAction.d.ts.map +1 -1
- package/build/types/api/defineObject.d.ts.map +1 -1
- package/build/types/api/defineOntology.d.ts +1 -6
- package/build/types/api/defineOntology.d.ts.map +1 -1
- package/build/types/api/defineSpt.d.ts +2 -2
- package/build/types/api/defineSpt.d.ts.map +1 -1
- package/build/types/api/propertyConversionUtils.d.ts +2 -2
- package/build/types/api/propertyConversionUtils.d.ts.map +1 -1
- package/build/types/api/types.d.ts +6 -14
- package/build/types/api/types.d.ts.map +1 -1
- package/package.json +10 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,76 +1,101 @@
|
|
|
1
1
|
# @osdk/maker
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.13.0-beta.10
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 11fd3fb: Add api name validation for object types
|
|
4
8
|
|
|
5
9
|
### Patch Changes
|
|
6
10
|
|
|
7
|
-
- @osdk/api@2.
|
|
11
|
+
- @osdk/api@2.5.0-beta.10
|
|
12
|
+
|
|
13
|
+
## 0.13.0-beta.9
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
- 1b60527: Remove foundry.ontologies dependency
|
|
10
18
|
|
|
11
19
|
### Patch Changes
|
|
12
20
|
|
|
13
|
-
-
|
|
14
|
-
|
|
21
|
+
- @osdk/api@2.5.0-beta.9
|
|
22
|
+
|
|
23
|
+
## 0.13.0-beta.8
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- f9b6dc4: Write value types to ontology IR file
|
|
28
|
+
- b1c99bf: Revert .js -> .ts extension for codegen
|
|
17
29
|
|
|
18
30
|
### Patch Changes
|
|
19
31
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
- b0955ef: Action parameter defaults and table forms
|
|
29
|
-
- 8bb08eb: Turn on module cache
|
|
30
|
-
- 367cc04: Add default value and constraint overrides to OAC action parameters
|
|
31
|
-
- 666787f: fix text allowed values name
|
|
32
|
-
- 45ed433: Target objects are configurable and default parameter ordering is better in OAC actions
|
|
33
|
-
- ed41359: Action sections in OAC
|
|
34
|
-
- a1736f3: Actions can have properties that are not mapped to parameters
|
|
35
|
-
- a01b8d4: Revert import block data changes
|
|
36
|
-
- 641bc0c: Fix create-or-modify non parameter mapped property bug
|
|
37
|
-
- c621638: Create or Modify actions in OAC
|
|
38
|
-
- 283905f: Better error message for invalid parameter ordering on actions
|
|
39
|
-
- e62a890: Custom submission options for OAC actions
|
|
40
|
-
- 25bae67: OAC modify object actions set parameter defaults to match the selected object
|
|
41
|
-
- defc2cf: change parameterLevelValidations to parameterConfiguration
|
|
42
|
-
- 94beece: Enable "other" option for oneOf constraints on OAC actions
|
|
43
|
-
- 5994895: Interface struct properties are skipped in crud actions
|
|
44
|
-
- d384b4c: Add custom display names and descriptions for action parameters in OAC
|
|
45
|
-
- 02be685: Remove jiti
|
|
46
|
-
- 764e5f1: Add marking constraints
|
|
47
|
-
- 5c76e33: Trim value type before putting it in SPT IR
|
|
48
|
-
- Updated dependencies [322c5bc]
|
|
49
|
-
- Updated dependencies [4bc848b]
|
|
50
|
-
- Updated dependencies [9f4fe9e]
|
|
51
|
-
- Updated dependencies [29d2ada]
|
|
52
|
-
- Updated dependencies [8dd6229]
|
|
53
|
-
- Updated dependencies [8c95154]
|
|
54
|
-
- Updated dependencies [c32dcf2]
|
|
55
|
-
- Updated dependencies [722c89a]
|
|
56
|
-
- Updated dependencies [9101bad]
|
|
57
|
-
- Updated dependencies [44bbbe0]
|
|
58
|
-
- @osdk/api@2.4.0
|
|
32
|
+
- Updated dependencies [ca1fabe]
|
|
33
|
+
- @osdk/api@2.5.0-beta.8
|
|
34
|
+
|
|
35
|
+
## 0.13.0-beta.7
|
|
36
|
+
|
|
37
|
+
### Minor Changes
|
|
38
|
+
|
|
39
|
+
- 6da8fd2: Write value type IR correctly
|
|
59
40
|
|
|
60
|
-
## 0.
|
|
41
|
+
## 0.13.0-beta.6
|
|
42
|
+
|
|
43
|
+
### Minor Changes
|
|
44
|
+
|
|
45
|
+
- 07083e1: Action submission conditions can have custom metadata
|
|
61
46
|
|
|
62
47
|
### Patch Changes
|
|
63
48
|
|
|
64
|
-
-
|
|
65
|
-
|
|
49
|
+
- @osdk/api@2.5.0-beta.7
|
|
50
|
+
|
|
51
|
+
## 0.13.0-beta.5
|
|
52
|
+
|
|
53
|
+
### Minor Changes
|
|
54
|
+
|
|
55
|
+
- cbcf2ad: Add branching support
|
|
56
|
+
- 04fe946: Use block data type for imports
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- @osdk/api@2.5.0-beta.6
|
|
61
|
+
|
|
62
|
+
## 0.13.0-beta.4
|
|
63
|
+
|
|
64
|
+
### Minor Changes
|
|
65
|
+
|
|
66
|
+
- a00d2ed: Update Platform SDK dependencies
|
|
67
|
+
- a96d89e: Update Platform SDK dependencies
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- @osdk/api@2.5.0-beta.4
|
|
72
|
+
|
|
73
|
+
## 0.13.0-beta.3
|
|
74
|
+
|
|
75
|
+
### Minor Changes
|
|
76
|
+
|
|
77
|
+
- 7bdac45: Update Platform SDK dependency
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- Updated dependencies [7bdac45]
|
|
82
|
+
- Updated dependencies [20962bc]
|
|
83
|
+
- Updated dependencies [e48be06]
|
|
84
|
+
- @osdk/api@2.5.0-beta.3
|
|
85
|
+
|
|
86
|
+
## 0.13.0-beta.2
|
|
87
|
+
|
|
88
|
+
### Minor Changes
|
|
66
89
|
|
|
67
|
-
|
|
90
|
+
- 7cdab1d: Update platform sdk dependencies
|
|
91
|
+
- 40d43c2: Make codegen TS compiler friendly
|
|
92
|
+
- 5f72188: Fix object action param optionality for non-array props
|
|
68
93
|
|
|
69
94
|
### Patch Changes
|
|
70
95
|
|
|
71
|
-
- Updated dependencies [
|
|
72
|
-
- Updated dependencies [
|
|
73
|
-
- @osdk/api@2.
|
|
96
|
+
- Updated dependencies [7160276]
|
|
97
|
+
- Updated dependencies [76905f5]
|
|
98
|
+
- @osdk/api@2.5.0-beta.2
|
|
74
99
|
|
|
75
100
|
## 0.12.0-beta.21
|
|
76
101
|
|
|
@@ -86,7 +86,7 @@ export function defineCreateInterfaceObjectAction(interfaceType, objectType, val
|
|
|
86
86
|
}
|
|
87
87
|
}],
|
|
88
88
|
...(validation ? {
|
|
89
|
-
validation:
|
|
89
|
+
validation: convertValidationRule(validation)
|
|
90
90
|
} : {})
|
|
91
91
|
});
|
|
92
92
|
}
|
|
@@ -99,7 +99,7 @@ export function defineCreateObjectAction(def) {
|
|
|
99
99
|
if (def.parameterOrdering) {
|
|
100
100
|
validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);
|
|
101
101
|
}
|
|
102
|
-
const parameters = createParameters(def, parameterNames
|
|
102
|
+
const parameters = createParameters(def, parameterNames);
|
|
103
103
|
const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [id, convertMappingValue(value)]));
|
|
104
104
|
return defineAction({
|
|
105
105
|
apiName: actionApiName,
|
|
@@ -128,7 +128,7 @@ export function defineCreateObjectAction(def) {
|
|
|
128
128
|
}],
|
|
129
129
|
parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, parameters),
|
|
130
130
|
...(def.actionLevelValidation ? {
|
|
131
|
-
validation:
|
|
131
|
+
validation: convertValidationRule(def.actionLevelValidation)
|
|
132
132
|
} : {}),
|
|
133
133
|
...(def.defaultFormat && {
|
|
134
134
|
defaultFormat: def.defaultFormat
|
|
@@ -211,7 +211,7 @@ export function defineModifyInterfaceObjectAction(interfaceType, objectType, val
|
|
|
211
211
|
}
|
|
212
212
|
}],
|
|
213
213
|
...(validation ? {
|
|
214
|
-
validation:
|
|
214
|
+
validation: convertValidationRule(validation)
|
|
215
215
|
} : {})
|
|
216
216
|
});
|
|
217
217
|
}
|
|
@@ -228,7 +228,7 @@ export function defineModifyObjectAction(def) {
|
|
|
228
228
|
}
|
|
229
229
|
validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);
|
|
230
230
|
}
|
|
231
|
-
const parameters = createParameters(def, parameterNames
|
|
231
|
+
const parameters = createParameters(def, parameterNames);
|
|
232
232
|
parameters.forEach(p => {
|
|
233
233
|
if (p.id !== MODIFY_OBJECT_PARAMETER && p.defaultValue === undefined) {
|
|
234
234
|
p.defaultValue = {
|
|
@@ -268,7 +268,7 @@ export function defineModifyObjectAction(def) {
|
|
|
268
268
|
},
|
|
269
269
|
parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, parameters, MODIFY_OBJECT_PARAMETER),
|
|
270
270
|
...(def.actionLevelValidation ? {
|
|
271
|
-
validation:
|
|
271
|
+
validation: convertValidationRule(def.actionLevelValidation)
|
|
272
272
|
} : {}),
|
|
273
273
|
...(def.defaultFormat && {
|
|
274
274
|
defaultFormat: def.defaultFormat
|
|
@@ -321,7 +321,7 @@ export function defineDeleteObjectAction(def) {
|
|
|
321
321
|
typeGroups: []
|
|
322
322
|
},
|
|
323
323
|
...(def.actionLevelValidation ? {
|
|
324
|
-
validation:
|
|
324
|
+
validation: convertValidationRule(def.actionLevelValidation)
|
|
325
325
|
} : {})
|
|
326
326
|
});
|
|
327
327
|
}
|
|
@@ -338,7 +338,7 @@ export function defineCreateOrModifyObjectAction(def) {
|
|
|
338
338
|
}
|
|
339
339
|
validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);
|
|
340
340
|
}
|
|
341
|
-
const parameters = createParameters(def, parameterNames
|
|
341
|
+
const parameters = createParameters(def, parameterNames);
|
|
342
342
|
parameters.forEach(p => {
|
|
343
343
|
if (p.id !== CREATE_OR_MODIFY_OBJECT_PARAMETER && p.defaultValue === undefined) {
|
|
344
344
|
p.defaultValue = {
|
|
@@ -378,7 +378,7 @@ export function defineCreateOrModifyObjectAction(def) {
|
|
|
378
378
|
},
|
|
379
379
|
parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, parameters, CREATE_OR_MODIFY_OBJECT_PARAMETER),
|
|
380
380
|
...(def.actionLevelValidation ? {
|
|
381
|
-
validation:
|
|
381
|
+
validation: convertValidationRule(def.actionLevelValidation)
|
|
382
382
|
} : {}),
|
|
383
383
|
...(def.defaultFormat && {
|
|
384
384
|
defaultFormat: def.defaultFormat
|
|
@@ -435,7 +435,7 @@ export function defineAction(actionDef) {
|
|
|
435
435
|
updateOntology(fullAction);
|
|
436
436
|
return fullAction;
|
|
437
437
|
}
|
|
438
|
-
function createParameters(def, parameterSet
|
|
438
|
+
function createParameters(def, parameterSet) {
|
|
439
439
|
const targetParam = [];
|
|
440
440
|
parameterSet.forEach(name => {
|
|
441
441
|
if (name === MODIFY_OBJECT_PARAMETER) {
|
|
@@ -497,13 +497,13 @@ function createParameters(def, parameterSet, defaultRequired) {
|
|
|
497
497
|
validation: def.parameterConfiguration?.[id] !== undefined ? {
|
|
498
498
|
...def.parameterConfiguration?.[id],
|
|
499
499
|
allowedValues: def.parameterConfiguration?.[id].allowedValues ?? (def.parameterConfiguration?.[id].customParameterType ? extractAllowedValuesFromActionParameterType(def.parameterConfiguration?.[id].customParameterType) : extractAllowedValuesFromPropertyType(def.objectType.properties?.[id].type)),
|
|
500
|
-
required: def.parameterConfiguration?.[id].required ??
|
|
500
|
+
required: def.parameterConfiguration?.[id].required ?? def.objectType.properties?.[id]?.nullability?.noNulls ?? false
|
|
501
501
|
} : {
|
|
502
502
|
required: def.objectType.properties?.[id].array ?? false ? {
|
|
503
503
|
listLength: def.objectType.properties?.[id].nullability?.noEmptyCollections ? {
|
|
504
504
|
min: 1
|
|
505
505
|
} : {}
|
|
506
|
-
} : def.objectType.properties?.[id].nullability?.noNulls ??
|
|
506
|
+
} : def.objectType.properties?.[id].nullability?.noNulls ?? false,
|
|
507
507
|
allowedValues: extractAllowedValuesFromPropertyType(def.objectType.properties?.[id].type)
|
|
508
508
|
},
|
|
509
509
|
defaultValue: def.parameterConfiguration?.[id]?.defaultValue,
|
|
@@ -788,13 +788,15 @@ function sanitize(s) {
|
|
|
788
788
|
return s.includes(".") ? s : namespace + s;
|
|
789
789
|
}
|
|
790
790
|
function convertValidationRule(actionValidation) {
|
|
791
|
-
return {
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
791
|
+
return actionValidation.map(rule => {
|
|
792
|
+
return {
|
|
793
|
+
condition: convertConditionDefinition(rule.condition),
|
|
794
|
+
displayMetadata: rule.displayMetadata ?? {
|
|
795
|
+
failureMessage: "Did not satisfy validation",
|
|
796
|
+
typeClasses: []
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
});
|
|
798
800
|
}
|
|
799
801
|
function validateActionConfiguration(action) {
|
|
800
802
|
const seenParameterIds = new Set();
|