@osdk/maker 0.15.0-beta.6 → 0.15.0-beta.8
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 +22 -0
- package/README.md +26 -22
- package/build/browser/api/action/ActionParameter.js.map +1 -1
- package/build/browser/api/action/ActionParameterConfiguration.js.map +1 -1
- package/build/browser/api/defineAction.js +65 -22
- package/build/browser/api/defineAction.js.map +1 -1
- package/build/browser/api/defineCreateInterfaceObjectAction.js +28 -8
- package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineInterface.js +40 -34
- package/build/browser/api/defineInterface.js.map +1 -1
- package/build/browser/api/defineModifyInterfaceObjectAction.js +31 -8
- package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineObject.js +13 -9
- package/build/browser/api/defineObject.js.map +1 -1
- package/build/browser/api/defineOntology.js +6 -0
- package/build/browser/api/defineOntology.js.map +1 -1
- package/build/browser/api/defineSpt.js.map +1 -1
- package/build/browser/api/defineValueType.js +17 -4
- package/build/browser/api/defineValueType.js.map +1 -1
- package/build/browser/api/interface/InterfacePropertyType.js +22 -1
- package/build/browser/api/interface/InterfacePropertyType.js.map +1 -1
- package/build/browser/api/interface/InterfaceType.js.map +1 -1
- package/build/browser/api/interface/getFlattenedInterfaceProperties.js +9 -3
- package/build/browser/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
- package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
- package/build/browser/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
- package/build/browser/api/links/LinkType.js.map +1 -1
- package/build/browser/api/object/ObjectType.js.map +1 -1
- package/build/browser/api/object/ObjectTypeDefinition.js.map +1 -1
- package/build/browser/api/object/ObjectTypeStatus.js.map +1 -1
- package/build/browser/api/properties/PropertyTypeType.js +1 -1
- package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
- package/build/browser/api/properties/SharedPropertyType.js.map +1 -1
- package/build/browser/api/test/actions.test.js +6105 -5850
- package/build/browser/api/test/actions.test.js.map +1 -1
- package/build/browser/api/test/interfaces.test.js +757 -492
- package/build/browser/api/test/interfaces.test.js.map +1 -1
- package/build/browser/api/test/links.test.js +1334 -1325
- package/build/browser/api/test/links.test.js.map +1 -1
- package/build/browser/api/test/misc.test.js +262 -11
- package/build/browser/api/test/misc.test.js.map +1 -1
- package/build/browser/api/test/objects.test.js +1019 -960
- package/build/browser/api/test/objects.test.js.map +1 -1
- package/build/browser/api/test/spt.test.js +250 -103
- package/build/browser/api/test/spt.test.js.map +1 -1
- package/build/browser/api/test/valueTypes.test.js +69 -0
- package/build/browser/api/test/valueTypes.test.js.map +1 -1
- package/build/browser/cli/main.js +1 -1
- package/build/browser/conversion/toMarketplace/convertActionValidation.js +1 -1
- package/build/browser/conversion/toMarketplace/convertActionValidation.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertInterface.js +2 -2
- package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
- package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertLink.js +30 -4
- package/build/browser/conversion/toMarketplace/convertLink.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertMappingValue.js +35 -0
- package/build/browser/conversion/toMarketplace/convertMappingValue.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertObject.js +4 -2
- package/build/browser/conversion/toMarketplace/convertObject.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertSpt.js +4 -2
- package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -1
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +444 -117
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +53 -17
- package/build/esm/api/action/ActionParameter.js.map +1 -1
- package/build/esm/api/action/ActionParameterConfiguration.js.map +1 -1
- package/build/esm/api/defineAction.js +65 -22
- package/build/esm/api/defineAction.js.map +1 -1
- package/build/esm/api/defineCreateInterfaceObjectAction.js +28 -8
- package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineInterface.js +40 -34
- package/build/esm/api/defineInterface.js.map +1 -1
- package/build/esm/api/defineModifyInterfaceObjectAction.js +31 -8
- package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineObject.js +13 -9
- package/build/esm/api/defineObject.js.map +1 -1
- package/build/esm/api/defineOntology.js +6 -0
- package/build/esm/api/defineOntology.js.map +1 -1
- package/build/esm/api/defineSpt.js.map +1 -1
- package/build/esm/api/defineValueType.js +17 -4
- package/build/esm/api/defineValueType.js.map +1 -1
- package/build/esm/api/interface/InterfacePropertyType.js +22 -1
- package/build/esm/api/interface/InterfacePropertyType.js.map +1 -1
- package/build/esm/api/interface/InterfaceType.js.map +1 -1
- package/build/esm/api/interface/getFlattenedInterfaceProperties.js +9 -3
- package/build/esm/api/interface/getFlattenedInterfaceProperties.js.map +1 -1
- package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js +5 -0
- package/build/esm/api/interface/mapSimplifiedStatusToInterfaceTypeStatus.js.map +1 -1
- package/build/esm/api/links/LinkType.js.map +1 -1
- package/build/esm/api/object/ObjectType.js.map +1 -1
- package/build/esm/api/object/ObjectTypeDefinition.js.map +1 -1
- package/build/esm/api/object/ObjectTypeStatus.js.map +1 -1
- package/build/esm/api/properties/PropertyTypeType.js +1 -1
- package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
- package/build/esm/api/properties/SharedPropertyType.js.map +1 -1
- package/build/esm/api/test/actions.test.js +6105 -5850
- package/build/esm/api/test/actions.test.js.map +1 -1
- package/build/esm/api/test/interfaces.test.js +757 -492
- package/build/esm/api/test/interfaces.test.js.map +1 -1
- package/build/esm/api/test/links.test.js +1334 -1325
- package/build/esm/api/test/links.test.js.map +1 -1
- package/build/esm/api/test/misc.test.js +262 -11
- package/build/esm/api/test/misc.test.js.map +1 -1
- package/build/esm/api/test/objects.test.js +1019 -960
- package/build/esm/api/test/objects.test.js.map +1 -1
- package/build/esm/api/test/spt.test.js +250 -103
- package/build/esm/api/test/spt.test.js.map +1 -1
- package/build/esm/api/test/valueTypes.test.js +69 -0
- package/build/esm/api/test/valueTypes.test.js.map +1 -1
- package/build/esm/cli/main.js +1 -1
- package/build/esm/conversion/toMarketplace/convertActionValidation.js +1 -1
- package/build/esm/conversion/toMarketplace/convertActionValidation.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertInterface.js +2 -2
- package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js +66 -0
- package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertLink.js +30 -4
- package/build/esm/conversion/toMarketplace/convertLink.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertMappingValue.js +35 -0
- package/build/esm/conversion/toMarketplace/convertMappingValue.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertObject.js +4 -2
- package/build/esm/conversion/toMarketplace/convertObject.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +2 -1
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertSpt.js +4 -2
- package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -1
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +143 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/types/api/action/ActionParameter.d.ts +2 -1
- package/build/types/api/action/ActionParameter.d.ts.map +1 -1
- package/build/types/api/action/ActionParameterConfiguration.d.ts +2 -1
- package/build/types/api/action/ActionParameterConfiguration.d.ts.map +1 -1
- package/build/types/api/defineAction.d.ts +4 -3
- package/build/types/api/defineAction.d.ts.map +1 -1
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineInterface.d.ts +7 -5
- package/build/types/api/defineInterface.d.ts.map +1 -1
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineObject.d.ts.map +1 -1
- package/build/types/api/defineOntology.d.ts.map +1 -1
- package/build/types/api/defineSpt.d.ts +3 -0
- package/build/types/api/defineSpt.d.ts.map +1 -1
- package/build/types/api/defineValueType.d.ts +9 -0
- package/build/types/api/defineValueType.d.ts.map +1 -1
- package/build/types/api/interface/InterfacePropertyType.d.ts +12 -2
- package/build/types/api/interface/InterfacePropertyType.d.ts.map +1 -1
- package/build/types/api/interface/InterfaceType.d.ts +3 -2
- package/build/types/api/interface/InterfaceType.d.ts.map +1 -1
- package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts +1 -1
- package/build/types/api/interface/getFlattenedInterfaceProperties.d.ts.map +1 -1
- package/build/types/api/links/LinkType.d.ts +16 -4
- package/build/types/api/links/LinkType.d.ts.map +1 -1
- package/build/types/api/object/ObjectType.d.ts +1 -0
- package/build/types/api/object/ObjectType.d.ts.map +1 -1
- package/build/types/api/object/ObjectTypeDefinition.d.ts +1 -0
- package/build/types/api/object/ObjectTypeDefinition.d.ts.map +1 -1
- package/build/types/api/object/ObjectTypeStatus.d.ts +1 -1
- package/build/types/api/object/ObjectTypeStatus.d.ts.map +1 -1
- package/build/types/api/properties/PropertyTypeType.d.ts +1 -0
- package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
- package/build/types/api/properties/SharedPropertyType.d.ts +1 -0
- package/build/types/api/properties/SharedPropertyType.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertInterface.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts +3 -0
- package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertLink.d.ts +3 -2
- package/build/types/conversion/toMarketplace/convertLink.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertMappingValue.d.ts +2 -1
- package/build/types/conversion/toMarketplace/convertMappingValue.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertObject.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertSpt.d.ts +1 -1
- package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts +3 -0
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts.map +1 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @osdk/maker
|
|
2
2
|
|
|
3
|
+
## 0.15.0-beta.8
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c773e8f: Expose more status options on OAC
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [bb9d25c]
|
|
12
|
+
- @osdk/api@2.7.0-beta.12
|
|
13
|
+
|
|
14
|
+
## 0.15.0-beta.7
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 8381ac2: Alias and render hint overrides for oac
|
|
19
|
+
- c95f3bc: Support IDPs in OAC
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- @osdk/api@2.7.0-beta.9
|
|
24
|
+
|
|
3
25
|
## 0.15.0-beta.6
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -239,10 +239,10 @@ const personInterface = defineInterface({
|
|
|
239
239
|
displayName: "Person",
|
|
240
240
|
description: "Represents a person",
|
|
241
241
|
properties: {
|
|
242
|
-
firstName: "string",
|
|
243
|
-
lastName: "string",
|
|
244
|
-
email: "string",
|
|
245
|
-
age: "integer",
|
|
242
|
+
firstName: { type: "string" }, // creates an interface defined property
|
|
243
|
+
lastName: { type: "string" },
|
|
244
|
+
email: { type: "string" },
|
|
245
|
+
age: { type: "integer" },
|
|
246
246
|
},
|
|
247
247
|
});
|
|
248
248
|
|
|
@@ -254,10 +254,10 @@ const employeeInterface = defineInterface({
|
|
|
254
254
|
properties: {
|
|
255
255
|
firstName: nameProperty, // Using previously defined SPT
|
|
256
256
|
lastName: nameProperty, // Using previously defined SPT
|
|
257
|
-
employeeId: "string",
|
|
258
|
-
department: "string",
|
|
259
|
-
hireDate: "date",
|
|
260
|
-
isActive: "boolean",
|
|
257
|
+
employeeId: { type: "string" },
|
|
258
|
+
department: { type: "string" },
|
|
259
|
+
hireDate: { type: "date" },
|
|
260
|
+
isActive: { type: "boolean" },
|
|
261
261
|
},
|
|
262
262
|
});
|
|
263
263
|
```
|
|
@@ -269,12 +269,16 @@ const customerInterface = defineInterface({
|
|
|
269
269
|
apiName: "Customer",
|
|
270
270
|
displayName: "Customer",
|
|
271
271
|
properties: {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
// Define an optional interface defined property
|
|
273
|
+
name: {
|
|
274
|
+
type: "string",
|
|
275
|
+
required: false,
|
|
276
|
+
},
|
|
277
|
+
email: { type: "string" },
|
|
278
|
+
// Define an optional interface SPT
|
|
275
279
|
phoneNumber: {
|
|
276
280
|
required: false,
|
|
277
|
-
|
|
281
|
+
sharedPropertyType: phoneNumber, // Using previously defined SPT
|
|
278
282
|
},
|
|
279
283
|
},
|
|
280
284
|
});
|
|
@@ -288,8 +292,8 @@ const managerInterface = defineInterface({
|
|
|
288
292
|
apiName: "Manager",
|
|
289
293
|
displayName: "Manager",
|
|
290
294
|
properties: {
|
|
291
|
-
managementLevel: "string",
|
|
292
|
-
directReports: "integer",
|
|
295
|
+
managementLevel: { type: "string" },
|
|
296
|
+
directReports: { type: "integer" },
|
|
293
297
|
},
|
|
294
298
|
extends: [employeeInterface], // Extends the Employee interface
|
|
295
299
|
});
|
|
@@ -299,7 +303,7 @@ const executiveInterface = defineInterface({
|
|
|
299
303
|
apiName: "Executive",
|
|
300
304
|
displayName: "Executive",
|
|
301
305
|
properties: {
|
|
302
|
-
stockOptions: "boolean",
|
|
306
|
+
stockOptions: { type: "boolean" },
|
|
303
307
|
},
|
|
304
308
|
extends: ["Manager"], // Extends using apiName
|
|
305
309
|
});
|
|
@@ -316,9 +320,9 @@ const productInterface = defineInterface({
|
|
|
316
320
|
color: "#007bff",
|
|
317
321
|
},
|
|
318
322
|
properties: {
|
|
319
|
-
name: "string",
|
|
320
|
-
sku: "string",
|
|
321
|
-
price: "decimal",
|
|
323
|
+
name: { type: "string" },
|
|
324
|
+
sku: { type: "string" },
|
|
325
|
+
price: { type: "decimal" },
|
|
322
326
|
},
|
|
323
327
|
});
|
|
324
328
|
```
|
|
@@ -330,8 +334,8 @@ const legacyInterface = defineInterface({
|
|
|
330
334
|
apiName: "LegacySystem",
|
|
331
335
|
displayName: "Legacy System",
|
|
332
336
|
properties: {
|
|
333
|
-
systemName: "string",
|
|
334
|
-
version: "string",
|
|
337
|
+
systemName: { type: "string" },
|
|
338
|
+
version: { type: "string" },
|
|
335
339
|
},
|
|
336
340
|
status: {
|
|
337
341
|
type: "deprecated",
|
|
@@ -344,8 +348,8 @@ const experimentalInterface = defineInterface({
|
|
|
344
348
|
apiName: "ExperimentalFeature",
|
|
345
349
|
displayName: "Experimental Feature",
|
|
346
350
|
properties: {
|
|
347
|
-
featureName: "string",
|
|
348
|
-
enabled: "boolean",
|
|
351
|
+
featureName: { type: "string" },
|
|
352
|
+
enabled: { type: "boolean" },
|
|
349
353
|
},
|
|
350
354
|
status: {
|
|
351
355
|
type: "experimental",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionParameter.js","names":[],"sources":["ActionParameter.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n OntologyIrParameterPrefill,\n ParameterId,\n} from \"@osdk/client.unstable\";\nimport type { TypeClass } from \"../common/TypeClass.js\";\nimport type { ActionParameterConfiguration } from \"./ActionParameterConfiguration.js\";\nimport type { ActionParameterType } from \"./ActionParameterType.js\";\n\nexport interface ActionParameter {\n id: ParameterId;\n displayName: string;\n type: ActionParameterType;\n validation: ActionParameterValidation;\n description?: string;\n typeClasses?: Array<TypeClass>;\n defaultValue?: OntologyIrParameterPrefill;\n}\nexport type ActionParameterValidation = Omit<\n ActionParameterConfiguration,\n \"displayName\" | \"defaultValue\"\n>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ActionParameter.js","names":[],"sources":["ActionParameter.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n OntologyIrParameterPrefill,\n ParameterId,\n ParameterRenderHint,\n} from \"@osdk/client.unstable\";\nimport type { TypeClass } from \"../common/TypeClass.js\";\nimport type { ActionParameterConfiguration } from \"./ActionParameterConfiguration.js\";\nimport type { ActionParameterType } from \"./ActionParameterType.js\";\n\nexport interface ActionParameter {\n id: ParameterId;\n displayName: string;\n type: ActionParameterType;\n validation: ActionParameterValidation;\n description?: string;\n typeClasses?: Array<TypeClass>;\n defaultValue?: OntologyIrParameterPrefill;\n renderHint?: ParameterRenderHint;\n}\nexport type ActionParameterValidation = Omit<\n ActionParameterConfiguration,\n \"displayName\" | \"defaultValue\"\n>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionParameterConfiguration.js","names":[],"sources":["ActionParameterConfiguration.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"ActionParameterConfiguration.js","names":[],"sources":["ActionParameterConfiguration.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n OntologyIrParameterPrefill,\n ParameterRenderHint,\n} from \"@osdk/client.unstable\";\nimport type { ActionParameterAllowedValues } from \"./ActionParameterAllowedValues.js\";\nimport type { ActionParameterConditionalOverride } from \"./ActionParameterConditionalOverride.js\";\nimport type { ActionParameterType } from \"./ActionParameterType.js\";\n\nexport interface ActionParameterConfiguration {\n allowedValues?: ActionParameterAllowedValues;\n required?: ActionParameterRequirementConstraint;\n defaultVisibility?: \"editable\" | \"disabled\" | \"hidden\";\n conditionalOverrides?: Array<ActionParameterConditionalOverride>;\n defaultValue?: OntologyIrParameterPrefill;\n renderHint?: ParameterRenderHint;\n displayName?: string;\n description?: string;\n // should only be used on non-property parameters\n customParameterType?: ActionParameterType;\n}\n\nexport type ActionParameterRequirementConstraint =\n | boolean\n | { listLength: { min?: number; max?: number } };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -19,8 +19,9 @@ import { convertConditionDefinition } from "../conversion/toMarketplace/convertC
|
|
|
19
19
|
import { isActionParameterTypePrimitive } from "./action/ActionParameterType.js";
|
|
20
20
|
import { OntologyEntityTypeEnum } from "./common/OntologyEntityTypeEnum.js";
|
|
21
21
|
import { uppercaseFirstLetter } from "./defineObject.js";
|
|
22
|
-
import { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology } from "./defineOntology.js";
|
|
22
|
+
import { addNamespaceIfNone, importedTypes, namespace, ontologyDefinition, updateOntology, withoutNamespace } from "./defineOntology.js";
|
|
23
23
|
import { getFlattenedInterfaceProperties } from "./interface/getFlattenedInterfaceProperties.js";
|
|
24
|
+
import { getInterfacePropertyTypeType, isInterfaceSharedPropertyType } from "./interface/InterfacePropertyType.js";
|
|
24
25
|
import { isStruct } from "./properties/PropertyTypeType.js";
|
|
25
26
|
export const MODIFY_OBJECT_PARAMETER = "objectToModifyParameter";
|
|
26
27
|
export const CREATE_OR_MODIFY_OBJECT_PARAMETER = "objectToCreateOrModifyParameter";
|
|
@@ -89,29 +90,39 @@ export function defineAction(actionDef) {
|
|
|
89
90
|
return fullAction;
|
|
90
91
|
}
|
|
91
92
|
export function isPropertyParameter(def, name, type) {
|
|
92
|
-
|
|
93
|
+
if ("interfaceType" in def) {
|
|
94
|
+
return Object.keys(getFlattenedInterfaceProperties(def.interfaceType)).includes(name) && !Object.keys(def.nonParameterMappings ?? {}).includes(name) && !isStruct(type) && !def.excludedProperties?.includes(name);
|
|
95
|
+
}
|
|
96
|
+
return Object.keys(def.objectType.properties ?? {}).includes(name) && !Object.keys(def.nonParameterMappings ?? {}).includes(name) && !isStruct(type) && !def.excludedProperties?.includes(name);
|
|
93
97
|
}
|
|
94
98
|
export function createParameters(def, propertyMap, parameterSet, requiredMap) {
|
|
95
99
|
const targetParams = getTargetParameters(def, parameterSet);
|
|
96
|
-
return [...targetParams, ...Array.from(parameterSet).map(id =>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} :
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
100
|
+
return [...targetParams, ...Array.from(parameterSet).map(id => {
|
|
101
|
+
let propertyMetadata = undefined;
|
|
102
|
+
if (id in propertyMap) {
|
|
103
|
+
propertyMetadata = "sharedPropertyType" in propertyMap[id] ? propertyMap[id].sharedPropertyType : propertyMap[id];
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
id,
|
|
107
|
+
displayName: def.parameterConfiguration?.[id]?.displayName ?? propertyMetadata?.displayName ?? uppercaseFirstLetter(id),
|
|
108
|
+
type: def.parameterConfiguration?.[id]?.customParameterType ?? extractActionParameterType(propertyMetadata),
|
|
109
|
+
validation: def.parameterConfiguration?.[id] !== undefined ? {
|
|
110
|
+
...def.parameterConfiguration?.[id],
|
|
111
|
+
allowedValues: def.parameterConfiguration?.[id].allowedValues ?? (def.parameterConfiguration?.[id].customParameterType ? extractAllowedValuesFromActionParameterType(def.parameterConfiguration?.[id].customParameterType) : extractAllowedValuesFromPropertyType(propertyMetadata.type)),
|
|
112
|
+
required: def.parameterConfiguration?.[id].required ?? propertyMetadata?.nullability?.noNulls ?? false
|
|
113
|
+
} : {
|
|
114
|
+
required: propertyMetadata.array ?? false ? {
|
|
115
|
+
listLength: propertyMetadata.nullability?.noEmptyCollections ? {
|
|
116
|
+
min: 1
|
|
117
|
+
} : {}
|
|
118
|
+
} : requiredMap?.[id] ?? propertyMetadata?.nullability?.noNulls ?? false,
|
|
119
|
+
allowedValues: extractAllowedValuesFromPropertyType(propertyMetadata?.type)
|
|
120
|
+
},
|
|
121
|
+
defaultValue: def.parameterConfiguration?.[id]?.defaultValue,
|
|
122
|
+
description: def.parameterConfiguration?.[id]?.description,
|
|
123
|
+
renderHint: def.parameterConfiguration?.[id]?.renderHint
|
|
124
|
+
};
|
|
125
|
+
})];
|
|
115
126
|
}
|
|
116
127
|
function getTargetParameters(def, parameterSet) {
|
|
117
128
|
const targetParams = [];
|
|
@@ -675,7 +686,7 @@ export function validateActionParameters(def, properties, name) {
|
|
|
675
686
|
!(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || def.parameterConfiguration?.[id].customParameterType !== undefined || isTargetParameter(id)) ? process.env.NODE_ENV !== "production" ? invariant(false, `Parameter ${id} does not exist as a property on ${name} and its type is not explicitly defined`) : invariant(false) : void 0;
|
|
676
687
|
});
|
|
677
688
|
[...Object.keys(def.nonParameterMappings ?? {}), ...(def.excludedProperties ?? [])].forEach(id => {
|
|
678
|
-
!(properties.includes(id) || properties.includes(addNamespaceIfNone(id))) ? process.env.NODE_ENV !== "production" ? invariant(false, `Property ${id} does not exist as a property on ${name}`) : invariant(false) : void 0;
|
|
689
|
+
!(properties.includes(id) || properties.includes(addNamespaceIfNone(id)) || properties.includes(withoutNamespace(id))) ? process.env.NODE_ENV !== "production" ? invariant(false, `Property ${id} does not exist as a property on ${name}`) : invariant(false) : void 0;
|
|
679
690
|
});
|
|
680
691
|
}
|
|
681
692
|
|
|
@@ -713,4 +724,36 @@ export function getInterfaceParameterName(def, parameter) {
|
|
|
713
724
|
export function getNonNamespacedParameterName(def, parameter) {
|
|
714
725
|
return def.conflictingParameterOverrides?.[parameter] ?? (parameter.split(".").pop() || parameter);
|
|
715
726
|
}
|
|
727
|
+
export function createInterfacePropertyLogicRuleValue(id, def, actionDef) {
|
|
728
|
+
const type = getInterfacePropertyTypeType(def);
|
|
729
|
+
const array = isInterfaceSharedPropertyType(def) ? def.sharedPropertyType.array : def.array;
|
|
730
|
+
const parameterId = actionDef.useNonNamespacedParameters ? getNonNamespacedParameterName(actionDef, id) : id;
|
|
731
|
+
if (isStruct(type)) {
|
|
732
|
+
return {
|
|
733
|
+
type: "structLogicRuleValue",
|
|
734
|
+
structLogicRuleValue: Object.fromEntries(Object.entries(type.structDefinition).map(([apiName, fieldValue]) => {
|
|
735
|
+
return [apiName, array ? {
|
|
736
|
+
type: "structListParameterFieldValue",
|
|
737
|
+
structListParameterFieldValue: {
|
|
738
|
+
parameterId: parameterId,
|
|
739
|
+
structFieldApiName: apiName
|
|
740
|
+
}
|
|
741
|
+
} : {
|
|
742
|
+
type: "structParameterFieldValue",
|
|
743
|
+
structParameterFieldValue: {
|
|
744
|
+
parameterId: parameterId,
|
|
745
|
+
structFieldApiName: apiName
|
|
746
|
+
}
|
|
747
|
+
}];
|
|
748
|
+
}))
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
return {
|
|
752
|
+
type: "logicRuleValue",
|
|
753
|
+
logicRuleValue: {
|
|
754
|
+
type: "parameterId",
|
|
755
|
+
parameterId: parameterId
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
}
|
|
716
759
|
//# sourceMappingURL=defineAction.js.map
|