@osdk/maker 0.14.0-beta.4 → 0.14.0-beta.6
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 +17 -0
- package/build/browser/api/action/DefaultFormat.js +2 -0
- package/build/browser/api/action/DefaultFormat.js.map +1 -0
- package/build/browser/api/action/TableConfiguration.js +2 -0
- package/build/browser/api/action/TableConfiguration.js.map +1 -0
- package/build/browser/api/defineAction.js +11 -2
- package/build/browser/api/defineAction.js.map +1 -1
- package/build/browser/api/defineCreateInterfaceObjectAction.js +22 -6
- package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineCreateObjectAction.js +4 -2
- package/build/browser/api/defineCreateObjectAction.js.map +1 -1
- package/build/browser/api/defineCreateOrModifyObjectAction.js +4 -2
- package/build/browser/api/defineCreateOrModifyObjectAction.js.map +1 -1
- package/build/browser/api/defineModifyInterfaceObjectAction.js +22 -6
- package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineModifyObjectAction.js +4 -2
- package/build/browser/api/defineModifyObjectAction.js.map +1 -1
- package/build/browser/api/test/actions.test.js +3261 -4027
- package/build/browser/api/test/actions.test.js.map +1 -1
- package/build/browser/cli/main.js +1 -1
- package/build/cjs/index.cjs +64 -17
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +19 -4
- package/build/esm/api/action/DefaultFormat.js +2 -0
- package/build/esm/api/action/DefaultFormat.js.map +1 -0
- package/build/esm/api/action/TableConfiguration.js +2 -0
- package/build/esm/api/action/TableConfiguration.js.map +1 -0
- package/build/esm/api/defineAction.js +11 -2
- package/build/esm/api/defineAction.js.map +1 -1
- package/build/esm/api/defineCreateInterfaceObjectAction.js +22 -6
- package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineCreateObjectAction.js +4 -2
- package/build/esm/api/defineCreateObjectAction.js.map +1 -1
- package/build/esm/api/defineCreateOrModifyObjectAction.js +4 -2
- package/build/esm/api/defineCreateOrModifyObjectAction.js.map +1 -1
- package/build/esm/api/defineModifyInterfaceObjectAction.js +22 -6
- package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineModifyObjectAction.js +4 -2
- package/build/esm/api/defineModifyObjectAction.js.map +1 -1
- package/build/esm/api/test/actions.test.js +3261 -4027
- package/build/esm/api/test/actions.test.js.map +1 -1
- package/build/esm/cli/main.js +1 -1
- package/build/types/api/action/DefaultFormat.d.ts +1 -0
- package/build/types/api/action/DefaultFormat.d.ts.map +1 -0
- package/build/types/api/action/TableConfiguration.d.ts +8 -0
- package/build/types/api/action/TableConfiguration.d.ts.map +1 -0
- package/build/types/api/defineAction.d.ts +12 -4
- package/build/types/api/defineAction.d.ts.map +1 -1
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -24,7 +24,7 @@ import { defineOntology } from "../api/defineOntology.js";
|
|
|
24
24
|
const apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/;
|
|
25
25
|
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
26
26
|
export default async function main(args = process.argv) {
|
|
27
|
-
const commandLineOpts = await yargs(hideBin(args)).version("0.14.0-beta.
|
|
27
|
+
const commandLineOpts = await yargs(hideBin(args)).version("0.14.0-beta.6" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
|
|
28
28
|
input: {
|
|
29
29
|
alias: "i",
|
|
30
30
|
describe: "Input file",
|
package/build/cjs/index.cjs
CHANGED
|
@@ -1705,7 +1705,7 @@ function addNamespaceIfNone(apiName) {
|
|
|
1705
1705
|
var apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/;
|
|
1706
1706
|
var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
1707
1707
|
async function main(args = process.argv) {
|
|
1708
|
-
const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.14.0-beta.
|
|
1708
|
+
const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.14.0-beta.6").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
|
|
1709
1709
|
input: {
|
|
1710
1710
|
alias: "i",
|
|
1711
1711
|
describe: "Input file",
|
|
@@ -2375,9 +2375,16 @@ function isTargetParameter(parameterId) {
|
|
|
2375
2375
|
return parameterId === MODIFY_OBJECT_PARAMETER || parameterId === CREATE_OR_MODIFY_OBJECT_PARAMETER || parameterId === CREATE_INTERFACE_OBJECT_PARAMETER || parameterId === MODIFY_INTERFACE_OBJECT_PARAMETER;
|
|
2376
2376
|
}
|
|
2377
2377
|
function addNamespaceToActionDefinition(def) {
|
|
2378
|
-
def.parameterConfiguration = Object.fromEntries(Object.entries(def.parameterConfiguration ?? {}).map(([id, config]) => [
|
|
2378
|
+
def.parameterConfiguration = Object.fromEntries(Object.entries(def.parameterConfiguration ?? {}).map(([id, config]) => [getInterfaceParameterName(def, id), config]));
|
|
2379
2379
|
def.nonParameterMappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [addNamespaceIfNone(id), value]));
|
|
2380
|
-
def.excludedProperties = def.excludedProperties ?? [].map((id) => addNamespaceIfNone(id));
|
|
2380
|
+
def.excludedProperties = (def.excludedProperties ?? []).map((id) => addNamespaceIfNone(id));
|
|
2381
|
+
def.sections = def.sections?.map((section) => ({
|
|
2382
|
+
...section,
|
|
2383
|
+
parameters: section.parameters.map((p) => getInterfaceParameterName(def, p))
|
|
2384
|
+
}));
|
|
2385
|
+
}
|
|
2386
|
+
function getInterfaceParameterName(def, parameter) {
|
|
2387
|
+
return isTargetParameter(parameter) || !Object.keys(def.interfaceType.propertiesV2).includes(addNamespaceIfNone(parameter)) ? parameter : addNamespaceIfNone(parameter);
|
|
2381
2388
|
}
|
|
2382
2389
|
function convertMappingValue(value) {
|
|
2383
2390
|
switch (value.type) {
|
|
@@ -2410,7 +2417,7 @@ function defineCreateInterfaceObjectAction(def) {
|
|
|
2410
2417
|
validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);
|
|
2411
2418
|
const propertyParameters = Object.keys(allProperties).filter((apiName) => isPropertyParameter(def, apiName, allProperties[apiName].sharedPropertyType.type));
|
|
2412
2419
|
const parameterNames = new Set(propertyParameters);
|
|
2413
|
-
Object.keys(def.parameterConfiguration ?? {}).forEach((param) => parameterNames.add(
|
|
2420
|
+
Object.keys(def.parameterConfiguration ?? {}).forEach((param) => parameterNames.add(getInterfaceParameterName(def, param)));
|
|
2414
2421
|
parameterNames.add(CREATE_INTERFACE_OBJECT_PARAMETER);
|
|
2415
2422
|
const actionApiName = def.apiName ?? `create-${kebab(def.interfaceType.apiName.split(".").pop() ?? def.interfaceType.apiName)}${def.objectType === void 0 ? "" : `-${kebab(def.objectType.apiName.split(".").pop() ?? def.objectType.apiName)}`}`;
|
|
2416
2423
|
if (def.parameterOrdering) {
|
|
@@ -2447,9 +2454,26 @@ function defineCreateInterfaceObjectAction(def) {
|
|
|
2447
2454
|
}
|
|
2448
2455
|
}],
|
|
2449
2456
|
parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(allProperties), parameters, CREATE_INTERFACE_OBJECT_PARAMETER),
|
|
2450
|
-
...def.
|
|
2451
|
-
validation: convertValidationRule(def.
|
|
2452
|
-
} : {}
|
|
2457
|
+
...def.actionLevelValidation ? {
|
|
2458
|
+
validation: convertValidationRule(def.actionLevelValidation, parameters)
|
|
2459
|
+
} : {},
|
|
2460
|
+
...def.defaultFormat && {
|
|
2461
|
+
defaultFormat: def.defaultFormat
|
|
2462
|
+
},
|
|
2463
|
+
...def.enableLayoutSwitch && {
|
|
2464
|
+
enableLayoutSwitch: def.enableLayoutSwitch
|
|
2465
|
+
},
|
|
2466
|
+
...def.tableConfiguration && {
|
|
2467
|
+
displayAndFormat: {
|
|
2468
|
+
table: def.tableConfiguration
|
|
2469
|
+
}
|
|
2470
|
+
},
|
|
2471
|
+
...def.sections && {
|
|
2472
|
+
sections: Object.fromEntries(def.sections.map((section) => [section.id, section]))
|
|
2473
|
+
},
|
|
2474
|
+
...def.submissionMetadata && {
|
|
2475
|
+
submissionMetadata: def.submissionMetadata
|
|
2476
|
+
}
|
|
2453
2477
|
});
|
|
2454
2478
|
}
|
|
2455
2479
|
|
|
@@ -2500,8 +2524,10 @@ function defineCreateObjectAction(def) {
|
|
|
2500
2524
|
...def.enableLayoutSwitch && {
|
|
2501
2525
|
enableLayoutSwitch: def.enableLayoutSwitch
|
|
2502
2526
|
},
|
|
2503
|
-
...def.
|
|
2504
|
-
displayAndFormat:
|
|
2527
|
+
...def.tableConfiguration && {
|
|
2528
|
+
displayAndFormat: {
|
|
2529
|
+
table: def.tableConfiguration
|
|
2530
|
+
}
|
|
2505
2531
|
},
|
|
2506
2532
|
...def.sections && {
|
|
2507
2533
|
sections: Object.fromEntries(def.sections.map((section) => [section.id, section]))
|
|
@@ -2574,8 +2600,10 @@ function defineCreateOrModifyObjectAction(def) {
|
|
|
2574
2600
|
...def.enableLayoutSwitch && {
|
|
2575
2601
|
enableLayoutSwitch: def.enableLayoutSwitch
|
|
2576
2602
|
},
|
|
2577
|
-
...def.
|
|
2578
|
-
displayAndFormat:
|
|
2603
|
+
...def.tableConfiguration && {
|
|
2604
|
+
displayAndFormat: {
|
|
2605
|
+
table: def.tableConfiguration
|
|
2606
|
+
}
|
|
2579
2607
|
},
|
|
2580
2608
|
...def.sections && {
|
|
2581
2609
|
sections: Object.fromEntries(def.sections.map((section) => [section.id, section]))
|
|
@@ -2848,7 +2876,7 @@ function defineModifyInterfaceObjectAction(def) {
|
|
|
2848
2876
|
validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);
|
|
2849
2877
|
const propertyParameters = Object.keys(allProperties).filter((apiName) => isPropertyParameter(def, apiName, allProperties[apiName].sharedPropertyType.type));
|
|
2850
2878
|
const parameterNames = new Set(propertyParameters);
|
|
2851
|
-
Object.keys(def.parameterConfiguration ?? {}).forEach((param) => parameterNames.add(
|
|
2879
|
+
Object.keys(def.parameterConfiguration ?? {}).forEach((param) => parameterNames.add(getInterfaceParameterName(def, param)));
|
|
2852
2880
|
parameterNames.add(MODIFY_INTERFACE_OBJECT_PARAMETER);
|
|
2853
2881
|
const actionApiName = def.apiName ?? `modify-${kebab(def.interfaceType.apiName.split(".").pop() ?? def.interfaceType.apiName)}${def.objectType === void 0 ? "" : `-${kebab(def.objectType.apiName.split(".").pop() ?? def.objectType.apiName)}`}`;
|
|
2854
2882
|
if (def.parameterOrdering) {
|
|
@@ -2884,9 +2912,26 @@ function defineModifyInterfaceObjectAction(def) {
|
|
|
2884
2912
|
}
|
|
2885
2913
|
}],
|
|
2886
2914
|
parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Object.keys(allProperties), parameters, MODIFY_INTERFACE_OBJECT_PARAMETER),
|
|
2887
|
-
...def.
|
|
2888
|
-
validation: convertValidationRule(def.
|
|
2889
|
-
} : {}
|
|
2915
|
+
...def.actionLevelValidation ? {
|
|
2916
|
+
validation: convertValidationRule(def.actionLevelValidation, parameters)
|
|
2917
|
+
} : {},
|
|
2918
|
+
...def.defaultFormat && {
|
|
2919
|
+
defaultFormat: def.defaultFormat
|
|
2920
|
+
},
|
|
2921
|
+
...def.enableLayoutSwitch && {
|
|
2922
|
+
enableLayoutSwitch: def.enableLayoutSwitch
|
|
2923
|
+
},
|
|
2924
|
+
...def.tableConfiguration && {
|
|
2925
|
+
displayAndFormat: {
|
|
2926
|
+
table: def.tableConfiguration
|
|
2927
|
+
}
|
|
2928
|
+
},
|
|
2929
|
+
...def.sections && {
|
|
2930
|
+
sections: Object.fromEntries(def.sections.map((section) => [section.id, section]))
|
|
2931
|
+
},
|
|
2932
|
+
...def.submissionMetadata && {
|
|
2933
|
+
submissionMetadata: def.submissionMetadata
|
|
2934
|
+
}
|
|
2890
2935
|
});
|
|
2891
2936
|
}
|
|
2892
2937
|
|
|
@@ -2952,8 +2997,10 @@ function defineModifyObjectAction(def) {
|
|
|
2952
2997
|
...def.enableLayoutSwitch && {
|
|
2953
2998
|
enableLayoutSwitch: def.enableLayoutSwitch
|
|
2954
2999
|
},
|
|
2955
|
-
...def.
|
|
2956
|
-
displayAndFormat:
|
|
3000
|
+
...def.tableConfiguration && {
|
|
3001
|
+
displayAndFormat: {
|
|
3002
|
+
table: def.tableConfiguration
|
|
3003
|
+
}
|
|
2957
3004
|
},
|
|
2958
3005
|
...def.sections && {
|
|
2959
3006
|
sections: Object.fromEntries(def.sections.map((section) => [section.id, section]))
|