@osdk/maker 0.14.0-beta.2 → 0.14.0-beta.4
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 +20 -0
- package/build/browser/api/defineAction.js +121 -413
- package/build/browser/api/defineAction.js.map +1 -1
- package/build/browser/api/defineCreateInterfaceObjectAction.js +69 -0
- package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -0
- package/build/browser/api/defineCreateObjectAction.js +76 -0
- package/build/browser/api/defineCreateObjectAction.js.map +1 -0
- package/build/browser/api/defineCreateOrModifyObjectAction.js +92 -0
- package/build/browser/api/defineCreateOrModifyObjectAction.js.map +1 -0
- package/build/browser/api/defineDeleteObjectAction.js +56 -0
- package/build/browser/api/defineDeleteObjectAction.js.map +1 -0
- package/build/browser/api/defineModifyInterfaceObjectAction.js +68 -0
- package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -0
- package/build/browser/api/defineModifyObjectAction.js +91 -0
- package/build/browser/api/defineModifyObjectAction.js.map +1 -0
- package/build/browser/api/test/actions.test.js +12014 -0
- package/build/browser/api/test/actions.test.js.map +1 -0
- package/build/browser/api/test/interfaces.test.js +924 -0
- package/build/browser/api/test/interfaces.test.js.map +1 -0
- package/build/browser/api/test/links.test.js +1974 -0
- package/build/browser/api/test/links.test.js.map +1 -0
- package/build/browser/api/{markingconstraint.test.js → test/markingconstraint.test.js} +28 -2
- package/build/browser/api/test/markingconstraint.test.js.map +1 -0
- package/build/browser/api/test/misc.test.js +1058 -0
- package/build/browser/api/test/misc.test.js.map +1 -0
- package/build/browser/api/{objectStatus.test.js → test/objectStatus.test.js} +2 -2
- package/build/browser/api/test/objectStatus.test.js.map +1 -0
- package/build/browser/api/test/objects.test.js +1494 -0
- package/build/browser/api/test/objects.test.js.map +1 -0
- package/build/browser/api/test/spt.test.js +387 -0
- package/build/browser/api/test/spt.test.js.map +1 -0
- package/build/browser/api/test/valueTypes.test.js +156 -0
- package/build/browser/api/test/valueTypes.test.js.map +1 -0
- package/build/browser/cli/main.js +1 -1
- package/build/browser/index.js +7 -1
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +561 -503
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +27 -13
- package/build/esm/api/defineAction.js +121 -413
- package/build/esm/api/defineAction.js.map +1 -1
- package/build/esm/api/defineCreateInterfaceObjectAction.js +69 -0
- package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -0
- package/build/esm/api/defineCreateObjectAction.js +76 -0
- package/build/esm/api/defineCreateObjectAction.js.map +1 -0
- package/build/esm/api/defineCreateOrModifyObjectAction.js +92 -0
- package/build/esm/api/defineCreateOrModifyObjectAction.js.map +1 -0
- package/build/esm/api/defineDeleteObjectAction.js +56 -0
- package/build/esm/api/defineDeleteObjectAction.js.map +1 -0
- package/build/esm/api/defineModifyInterfaceObjectAction.js +68 -0
- package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -0
- package/build/esm/api/defineModifyObjectAction.js +91 -0
- package/build/esm/api/defineModifyObjectAction.js.map +1 -0
- package/build/esm/api/test/actions.test.js +12014 -0
- package/build/esm/api/test/actions.test.js.map +1 -0
- package/build/esm/api/test/interfaces.test.js +924 -0
- package/build/esm/api/test/interfaces.test.js.map +1 -0
- package/build/esm/api/test/links.test.js +1974 -0
- package/build/esm/api/test/links.test.js.map +1 -0
- package/build/esm/api/{markingconstraint.test.js → test/markingconstraint.test.js} +28 -2
- package/build/esm/api/test/markingconstraint.test.js.map +1 -0
- package/build/esm/api/test/misc.test.js +1058 -0
- package/build/esm/api/test/misc.test.js.map +1 -0
- package/build/esm/api/{objectStatus.test.js → test/objectStatus.test.js} +2 -2
- package/build/esm/api/test/objectStatus.test.js.map +1 -0
- package/build/esm/api/test/objects.test.js +1494 -0
- package/build/esm/api/test/objects.test.js.map +1 -0
- package/build/esm/api/test/spt.test.js +387 -0
- package/build/esm/api/test/spt.test.js.map +1 -0
- package/build/esm/api/test/valueTypes.test.js +156 -0
- package/build/esm/api/test/valueTypes.test.js.map +1 -0
- package/build/esm/cli/main.js +1 -1
- package/build/esm/index.js +7 -1
- package/build/esm/index.js.map +1 -1
- package/build/types/api/defineAction.d.ts +22 -6
- package/build/types/api/defineAction.d.ts.map +1 -1
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts +3 -0
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -0
- package/build/types/api/defineCreateObjectAction.d.ts +3 -0
- package/build/types/api/defineCreateObjectAction.d.ts.map +1 -0
- package/build/types/api/defineCreateOrModifyObjectAction.d.ts +3 -0
- package/build/types/api/defineCreateOrModifyObjectAction.d.ts.map +1 -0
- package/build/types/api/defineDeleteObjectAction.d.ts +3 -0
- package/build/types/api/defineDeleteObjectAction.d.ts.map +1 -0
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts +3 -0
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -0
- package/build/types/api/defineModifyObjectAction.d.ts +3 -0
- package/build/types/api/defineModifyObjectAction.d.ts.map +1 -0
- package/build/types/api/test/actions.test.d.ts.map +1 -0
- package/build/types/api/test/interfaces.test.d.ts.map +1 -0
- package/build/types/api/test/links.test.d.ts.map +1 -0
- package/build/types/api/test/markingconstraint.test.d.ts +1 -0
- package/build/types/api/test/markingconstraint.test.d.ts.map +1 -0
- package/build/types/api/test/misc.test.d.ts +1 -0
- package/build/types/api/test/misc.test.d.ts.map +1 -0
- package/build/types/api/test/objectStatus.test.d.ts +1 -0
- package/build/types/api/test/objectStatus.test.d.ts.map +1 -0
- package/build/types/api/test/objects.test.d.ts +1 -0
- package/build/types/api/test/objects.test.d.ts.map +1 -0
- package/build/types/api/test/spt.test.d.ts +1 -0
- package/build/types/api/test/spt.test.d.ts.map +1 -0
- package/build/types/api/test/valueTypes.test.d.ts +1 -0
- package/build/types/api/test/valueTypes.test.d.ts.map +1 -0
- package/build/types/index.d.ts +7 -1
- package/build/types/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/build/browser/api/markingconstraint.test.js.map +0 -1
- package/build/browser/api/objectStatus.test.js.map +0 -1
- package/build/browser/api/overall.test.js +0 -14002
- package/build/browser/api/overall.test.js.map +0 -1
- package/build/esm/api/markingconstraint.test.js.map +0 -1
- package/build/esm/api/objectStatus.test.js.map +0 -1
- package/build/esm/api/overall.test.js +0 -14002
- package/build/esm/api/overall.test.js.map +0 -1
- package/build/types/api/markingconstraint.test.d.ts.map +0 -1
- package/build/types/api/objectStatus.test.d.ts.map +0 -1
- package/build/types/api/overall.test.d.ts.map +0 -1
- /package/build/types/api/{markingconstraint.test.d.ts → test/actions.test.d.ts} +0 -0
- /package/build/types/api/{objectStatus.test.d.ts → test/interfaces.test.d.ts} +0 -0
- /package/build/types/api/{overall.test.d.ts → test/links.test.d.ts} +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
18
|
+
import { defineObject } from "../defineObject.js";
|
|
19
|
+
import { defineOntology, dumpOntologyFullMetadata, dumpValueTypeWireType } from "../defineOntology.js";
|
|
20
|
+
import { defineValueType } from "../defineValueType.js";
|
|
21
|
+
describe("Value Types", () => {
|
|
22
|
+
beforeEach(async () => {
|
|
23
|
+
await defineOntology("com.palantir.", () => {}, "/tmp/");
|
|
24
|
+
});
|
|
25
|
+
it("Fails to define value type with incorrect semver", () => {
|
|
26
|
+
expect(() => defineValueType({
|
|
27
|
+
apiName: "apiName",
|
|
28
|
+
displayName: "displayName",
|
|
29
|
+
type: {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
constraints: [{
|
|
32
|
+
constraint: {
|
|
33
|
+
"allowedValues": ["TRUE_VALUE"]
|
|
34
|
+
}
|
|
35
|
+
}]
|
|
36
|
+
},
|
|
37
|
+
version: "not a version"
|
|
38
|
+
})).toThrowErrorMatchingInlineSnapshot("[Error: Invariant failed: Version is not a valid semver]");
|
|
39
|
+
});
|
|
40
|
+
it("Tests convertProperty function with valueType constraints for string", () => {
|
|
41
|
+
const testStringValueType = defineValueType({
|
|
42
|
+
apiName: "stringWithConstraints",
|
|
43
|
+
displayName: "String With Constraints",
|
|
44
|
+
description: "A string type with additional constraints",
|
|
45
|
+
type: {
|
|
46
|
+
"type": "string",
|
|
47
|
+
constraints: [{
|
|
48
|
+
constraint: {
|
|
49
|
+
type: "length",
|
|
50
|
+
length: {
|
|
51
|
+
minSize: 5,
|
|
52
|
+
maxSize: 20
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
failureMessage: {
|
|
56
|
+
message: "String must be between 5 and 20 characters"
|
|
57
|
+
}
|
|
58
|
+
}]
|
|
59
|
+
},
|
|
60
|
+
version: "1.0.0"
|
|
61
|
+
});
|
|
62
|
+
defineObject({
|
|
63
|
+
titlePropertyApiName: "constrainedString",
|
|
64
|
+
displayName: "Test Object",
|
|
65
|
+
pluralDisplayName: "Test Objects",
|
|
66
|
+
apiName: "testObject",
|
|
67
|
+
primaryKeyPropertyApiName: "constrainedString",
|
|
68
|
+
properties: {
|
|
69
|
+
"constrainedString": {
|
|
70
|
+
type: "string",
|
|
71
|
+
displayName: "Constrained String",
|
|
72
|
+
valueType: testStringValueType
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const ontology = dumpOntologyFullMetadata();
|
|
77
|
+
const objectPropertyType = ontology.ontology.objectTypes["com.palantir.testObject"].objectType.propertyTypes["constrainedString"];
|
|
78
|
+
expect(objectPropertyType.valueType).toEqual({
|
|
79
|
+
apiName: "stringWithConstraints",
|
|
80
|
+
version: "1.0.0",
|
|
81
|
+
packageNamespace: "com.palantir",
|
|
82
|
+
displayMetadata: {
|
|
83
|
+
displayName: "String With Constraints",
|
|
84
|
+
description: "A string type with additional constraints"
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
expect(objectPropertyType.dataConstraints).toBeDefined();
|
|
88
|
+
expect(objectPropertyType.dataConstraints?.propertyTypeConstraints).toHaveLength(1);
|
|
89
|
+
const constraintWrapper = objectPropertyType.dataConstraints?.propertyTypeConstraints[0];
|
|
90
|
+
expect(constraintWrapper?.constraints?.type).toBe("string");
|
|
91
|
+
expect((constraintWrapper?.constraints).string.length.minSize).toBe(5);
|
|
92
|
+
expect((constraintWrapper?.constraints).string.length.maxSize).toBe(20);
|
|
93
|
+
expect(constraintWrapper?.failureMessage?.message).toBe("String must be between 5 and 20 characters");
|
|
94
|
+
});
|
|
95
|
+
it("Correctly serializes a value type", () => {
|
|
96
|
+
defineValueType({
|
|
97
|
+
apiName: "apiName",
|
|
98
|
+
displayName: "displayName",
|
|
99
|
+
type: {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
constraints: [{
|
|
102
|
+
constraint: {
|
|
103
|
+
"allowedValues": ["TRUE_VALUE"]
|
|
104
|
+
}
|
|
105
|
+
}]
|
|
106
|
+
},
|
|
107
|
+
version: "0.1.0"
|
|
108
|
+
});
|
|
109
|
+
expect(dumpValueTypeWireType()).toMatchInlineSnapshot(`
|
|
110
|
+
{
|
|
111
|
+
"valueTypes": [
|
|
112
|
+
{
|
|
113
|
+
"metadata": {
|
|
114
|
+
"apiName": "apiName",
|
|
115
|
+
"displayMetadata": {
|
|
116
|
+
"description": "",
|
|
117
|
+
"displayName": "displayName",
|
|
118
|
+
},
|
|
119
|
+
"packageNamespace": "com.palantir",
|
|
120
|
+
"status": {
|
|
121
|
+
"active": {},
|
|
122
|
+
"type": "active",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
"versions": [
|
|
126
|
+
{
|
|
127
|
+
"baseType": {
|
|
128
|
+
"boolean": {},
|
|
129
|
+
"type": "boolean",
|
|
130
|
+
},
|
|
131
|
+
"constraints": [
|
|
132
|
+
{
|
|
133
|
+
"constraint": {
|
|
134
|
+
"constraint": {
|
|
135
|
+
"boolean": {
|
|
136
|
+
"allowedValues": [
|
|
137
|
+
"TRUE_VALUE",
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
"type": "boolean",
|
|
141
|
+
},
|
|
142
|
+
"failureMessage": undefined,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
"exampleValues": [],
|
|
147
|
+
"version": "0.1.0",
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
}
|
|
153
|
+
`);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
//# sourceMappingURL=valueTypes.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueTypes.test.js","names":["beforeEach","describe","expect","it","defineObject","defineOntology","dumpOntologyFullMetadata","dumpValueTypeWireType","defineValueType","apiName","displayName","type","constraints","constraint","version","toThrowErrorMatchingInlineSnapshot","testStringValueType","description","length","minSize","maxSize","failureMessage","message","titlePropertyApiName","pluralDisplayName","primaryKeyPropertyApiName","properties","valueType","ontology","objectPropertyType","objectTypes","objectType","propertyTypes","toEqual","packageNamespace","displayMetadata","dataConstraints","toBeDefined","propertyTypeConstraints","toHaveLength","constraintWrapper","toBe","string","toMatchInlineSnapshot"],"sources":["valueTypes.test.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 { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineObject } from \"../defineObject.js\";\nimport {\n defineOntology,\n dumpOntologyFullMetadata,\n dumpValueTypeWireType,\n} from \"../defineOntology.js\";\nimport { defineValueType } from \"../defineValueType.js\";\n\ndescribe(\"Value Types\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n it(\"Fails to define value type with incorrect semver\", () => {\n expect(() =>\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n type: {\n \"type\": \"boolean\",\n constraints: [{ constraint: { \"allowedValues\": [\"TRUE_VALUE\"] } }],\n },\n version: \"not a version\",\n })\n ).toThrowErrorMatchingInlineSnapshot(\n \"[Error: Invariant failed: Version is not a valid semver]\",\n );\n });\n\n it(\"Tests convertProperty function with valueType constraints for string\", () => {\n const testStringValueType = defineValueType({\n apiName: \"stringWithConstraints\",\n displayName: \"String With Constraints\",\n description: \"A string type with additional constraints\",\n type: {\n \"type\": \"string\",\n constraints: [\n {\n constraint: {\n type: \"length\",\n length: {\n minSize: 5,\n maxSize: 20,\n },\n },\n failureMessage: {\n message: \"String must be between 5 and 20 characters\",\n },\n },\n ],\n },\n version: \"1.0.0\",\n });\n\n const object = defineObject({\n titlePropertyApiName: \"constrainedString\",\n displayName: \"Test Object\",\n pluralDisplayName: \"Test Objects\",\n apiName: \"testObject\",\n primaryKeyPropertyApiName: \"constrainedString\",\n properties: {\n \"constrainedString\": {\n type: \"string\",\n displayName: \"Constrained String\",\n valueType: testStringValueType,\n },\n },\n });\n\n const ontology = dumpOntologyFullMetadata();\n const objectPropertyType =\n ontology.ontology.objectTypes[\"com.palantir.testObject\"]\n .objectType.propertyTypes[\"constrainedString\"];\n\n expect(objectPropertyType.valueType).toEqual({\n apiName: \"stringWithConstraints\",\n version: \"1.0.0\",\n packageNamespace: \"com.palantir\",\n displayMetadata: {\n displayName: \"String With Constraints\",\n description: \"A string type with additional constraints\",\n },\n });\n\n expect(objectPropertyType.dataConstraints).toBeDefined();\n expect(objectPropertyType.dataConstraints?.propertyTypeConstraints)\n .toHaveLength(1);\n\n const constraintWrapper = objectPropertyType.dataConstraints\n ?.propertyTypeConstraints[0];\n expect(constraintWrapper?.constraints?.type).toBe(\"string\");\n expect(\n (constraintWrapper?.constraints as {\n type: \"string\";\n string: { length: { minSize: number; maxSize: number } };\n }).string.length.minSize,\n ).toBe(5);\n expect(\n (constraintWrapper?.constraints as {\n type: \"string\";\n string: { length: { minSize: number; maxSize: number } };\n }).string.length.maxSize,\n ).toBe(20);\n expect(constraintWrapper?.failureMessage?.message).toBe(\n \"String must be between 5 and 20 characters\",\n );\n });\n\n it(\"Correctly serializes a value type\", () => {\n defineValueType({\n apiName: \"apiName\",\n displayName: \"displayName\",\n type: {\n \"type\": \"boolean\",\n constraints: [{ constraint: { \"allowedValues\": [\"TRUE_VALUE\"] } }],\n },\n version: \"0.1.0\",\n });\n expect(dumpValueTypeWireType()).toMatchInlineSnapshot(`\n {\n \"valueTypes\": [\n {\n \"metadata\": {\n \"apiName\": \"apiName\",\n \"displayMetadata\": {\n \"description\": \"\",\n \"displayName\": \"displayName\",\n },\n \"packageNamespace\": \"com.palantir\",\n \"status\": {\n \"active\": {},\n \"type\": \"active\",\n },\n },\n \"versions\": [\n {\n \"baseType\": {\n \"boolean\": {},\n \"type\": \"boolean\",\n },\n \"constraints\": [\n {\n \"constraint\": {\n \"constraint\": {\n \"boolean\": {\n \"allowedValues\": [\n \"TRUE_VALUE\",\n ],\n },\n \"type\": \"boolean\",\n },\n \"failureMessage\": undefined,\n },\n },\n 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G5B8B,MAAM,CAACxB,MAAM,CAACC,OACnB,CAAC,CAACsB,IAAI,CAAC,CAAC,CAAC;IACTvC,MAAM,CACJ,CAACsC,iBAAiB,EAAE5B,WAAW,EAG5B8B,MAAM,CAACxB,MAAM,CAACE,OACnB,CAAC,CAACqB,IAAI,CAAC,EAAE,CAAC;IACVvC,MAAM,CAACsC,iBAAiB,EAAEnB,cAAc,EAAEC,OAAO,CAAC,CAACmB,IAAI,CACrD,4CACF,CAAC;EACH,CAAC,CAAC;EAEFtC,EAAE,CAAC,mCAAmC,EAAE,MAAM;IAC5CK,eAAe,CAAC;MACdC,OAAO,EAAE,SAAS;MAClBC,WAAW,EAAE,aAAa;MAC1BC,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS;QACjBC,WAAW,EAAE,CAAC;UAAEC,UAAU,EAAE;YAAE,eAAe,EAAE,CAAC,YAAY;UAAE;QAAE,CAAC;MACnE,CAAC;MACDC,OAAO,EAAE;IACX,CAAC,CAAC;IACFZ,MAAM,CAACK,qBAAqB,CAAC,CAAC,CAAC,CAACoC,qBAAqB,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;EACN,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/build/esm/cli/main.js
CHANGED
|
@@ -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.4" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
|
|
28
28
|
input: {
|
|
29
29
|
alias: "i",
|
|
30
30
|
describe: "Input file",
|
package/build/esm/index.js
CHANGED
|
@@ -17,10 +17,16 @@
|
|
|
17
17
|
export { default } from "./cli/main.js";
|
|
18
18
|
export { addDependency } from "./api/addDependency.js";
|
|
19
19
|
export { OntologyEntityTypeEnum } from "./api/common/OntologyEntityTypeEnum.js";
|
|
20
|
-
export { CREATE_OR_MODIFY_OBJECT_PARAMETER, defineAction,
|
|
20
|
+
export { CREATE_INTERFACE_OBJECT_PARAMETER, CREATE_OR_MODIFY_OBJECT_PARAMETER, defineAction, MODIFY_INTERFACE_OBJECT_PARAMETER, MODIFY_OBJECT_PARAMETER } from "./api/defineAction.js";
|
|
21
|
+
export { defineCreateInterfaceObjectAction } from "./api/defineCreateInterfaceObjectAction.js";
|
|
22
|
+
export { defineCreateObjectAction } from "./api/defineCreateObjectAction.js";
|
|
23
|
+
export { defineCreateOrModifyObjectAction } from "./api/defineCreateOrModifyObjectAction.js";
|
|
24
|
+
export { defineDeleteObjectAction } from "./api/defineDeleteObjectAction.js";
|
|
21
25
|
export { defineInterface } from "./api/defineInterface.js";
|
|
22
26
|
export { defineInterfaceLinkConstraint } from "./api/defineInterfaceLinkConstraint.js";
|
|
23
27
|
export { defineLink } from "./api/defineLink.js";
|
|
28
|
+
export { defineModifyInterfaceObjectAction } from "./api/defineModifyInterfaceObjectAction.js";
|
|
29
|
+
export { defineModifyObjectAction } from "./api/defineModifyObjectAction.js";
|
|
24
30
|
export { convertToPluralDisplayName, defineObject, uppercaseFirstLetter as convertToDisplayName } from "./api/defineObject.js";
|
|
25
31
|
export { addNamespaceIfNone, defineOntology, dumpOntologyFullMetadata } from "./api/defineOntology.js";
|
|
26
32
|
export { defineSharedPropertyType } from "./api/defineSpt.js";
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","addDependency","OntologyEntityTypeEnum","CREATE_OR_MODIFY_OBJECT_PARAMETER","defineAction","defineCreateInterfaceObjectAction","defineCreateObjectAction","defineCreateOrModifyObjectAction","defineDeleteObjectAction","
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","addDependency","OntologyEntityTypeEnum","CREATE_INTERFACE_OBJECT_PARAMETER","CREATE_OR_MODIFY_OBJECT_PARAMETER","defineAction","MODIFY_INTERFACE_OBJECT_PARAMETER","MODIFY_OBJECT_PARAMETER","defineCreateInterfaceObjectAction","defineCreateObjectAction","defineCreateOrModifyObjectAction","defineDeleteObjectAction","defineInterface","defineInterfaceLinkConstraint","defineLink","defineModifyInterfaceObjectAction","defineModifyObjectAction","convertToPluralDisplayName","defineObject","uppercaseFirstLetter","convertToDisplayName","addNamespaceIfNone","defineOntology","dumpOntologyFullMetadata","defineSharedPropertyType","defineValueType","importOntologyEntity","importSharedPropertyType","wrapWithProxy","propertyTypeTypeToOntologyIrType","convertType"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2024 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\nexport { default as default } from \"./cli/main.js\";\n\nexport type { ActionParameterValidation } from \"./api/action/ActionParameter.js\";\nexport type {\n ActionParameterAllowedValues,\n} from \"./api/action/ActionParameterAllowedValues.js\";\nexport type { ActionParameterConditionalOverride } from \"./api/action/ActionParameterConditionalOverride.js\";\nexport type { ActionParameterConfiguration } from \"./api/action/ActionParameterConfiguration.js\";\nexport type { ActionSection } from \"./api/action/ActionSection.js\";\nexport type { ActionType } from \"./api/action/ActionType.js\";\nexport type { ConditionDefinition } from \"./api/action/ConditionDefinition.js\";\nexport type {\n CurrentTimeMappingValue,\n CurrentUserMappingValue,\n CustomMapping,\n MappingValue,\n UuidMappingValue,\n} from \"./api/action/MappingValue.js\";\nexport type { SectionConditionalOverride } from \"./api/action/SectionConditionalOverride.js\";\nexport type { SubmissionMetadata } from \"./api/action/SubmissionMetadata.js\";\nexport { addDependency } from \"./api/addDependency.js\";\nexport { OntologyEntityTypeEnum } from \"./api/common/OntologyEntityTypeEnum.js\";\nexport {\n CREATE_INTERFACE_OBJECT_PARAMETER,\n CREATE_OR_MODIFY_OBJECT_PARAMETER,\n defineAction,\n MODIFY_INTERFACE_OBJECT_PARAMETER,\n MODIFY_OBJECT_PARAMETER,\n} from \"./api/defineAction.js\";\nexport { defineCreateInterfaceObjectAction } from \"./api/defineCreateInterfaceObjectAction.js\";\nexport { defineCreateObjectAction } from \"./api/defineCreateObjectAction.js\";\nexport { defineCreateOrModifyObjectAction } from \"./api/defineCreateOrModifyObjectAction.js\";\nexport { defineDeleteObjectAction } from \"./api/defineDeleteObjectAction.js\";\nexport { defineInterface } from \"./api/defineInterface.js\";\nexport { defineInterfaceLinkConstraint } from \"./api/defineInterfaceLinkConstraint.js\";\nexport { defineLink } from \"./api/defineLink.js\";\nexport { defineModifyInterfaceObjectAction } from \"./api/defineModifyInterfaceObjectAction.js\";\nexport { defineModifyObjectAction } from \"./api/defineModifyObjectAction.js\";\nexport {\n convertToPluralDisplayName,\n defineObject,\n uppercaseFirstLetter as convertToDisplayName,\n} from \"./api/defineObject.js\";\nexport {\n addNamespaceIfNone,\n defineOntology,\n dumpOntologyFullMetadata,\n} from \"./api/defineOntology.js\";\nexport { defineSharedPropertyType } from \"./api/defineSpt.js\";\nexport { defineValueType } from \"./api/defineValueType.js\";\nexport { importOntologyEntity } from \"./api/importOntologyEntity.js\";\nexport { importSharedPropertyType } from \"./api/importSharedPropertyType.js\";\nexport type { InterfaceType } from \"./api/interface/InterfaceType.js\";\nexport type { LinkType } from \"./api/links/LinkType.js\";\nexport type { ObjectPropertyType } from \"./api/object/ObjectPropertyType.js\";\nexport type { ObjectType } from \"./api/object/ObjectType.js\";\nexport type { PropertyTypeType } from \"./api/properties/PropertyTypeType.js\";\nexport type { SharedPropertyType } from \"./api/properties/SharedPropertyType.js\";\nexport type { ValueTypeDefinitionVersion } from \"./api/values/ValueTypeDefinitionVersion.js\";\nexport { wrapWithProxy } from \"./api/wrapWithProxy.js\";\nexport { propertyTypeTypeToOntologyIrType as convertType } from \"./conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAkB,QAAQ,eAAe;AAoBlD,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,sBAAsB,QAAQ,wCAAwC;AAC/E,SACEC,iCAAiC,EACjCC,iCAAiC,EACjCC,YAAY,EACZC,iCAAiC,EACjCC,uBAAuB,QAClB,uBAAuB;AAC9B,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,wBAAwB,QAAQ,mCAAmC;AAC5E,SAASC,gCAAgC,QAAQ,2CAA2C;AAC5F,SAASC,wBAAwB,QAAQ,mCAAmC;AAC5E,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,6BAA6B,QAAQ,wCAAwC;AACtF,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,wBAAwB,QAAQ,mCAAmC;AAC5E,SACEC,0BAA0B,EAC1BC,YAAY,EACZC,oBAAoB,IAAIC,oBAAoB,QACvC,uBAAuB;AAC9B,SACEC,kBAAkB,EAClBC,cAAc,EACdC,wBAAwB,QACnB,yBAAyB;AAChC,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,wBAAwB,QAAQ,mCAAmC;AAQ5E,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,gCAAgC,IAAIC,WAAW,QAAQ,gEAAgE","ignoreList":[]}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import type { DisplayMetadataConfigurationDefaultLayout, DisplayMetadataConfigurationDisplayAndFormat, ParameterId } from "@osdk/client.unstable";
|
|
2
2
|
import type { ActionLevelValidationDefinition } from "./action/ActionLevelValidationDefinition.js";
|
|
3
|
+
import { type ActionParameter } from "./action/ActionParameter.js";
|
|
3
4
|
import type { ActionParameterConfiguration } from "./action/ActionParameterConfiguration.js";
|
|
4
5
|
import type { ActionSection } from "./action/ActionSection.js";
|
|
5
6
|
import type { ActionStatus } from "./action/ActionStatus.js";
|
|
6
7
|
import { type ActionType } from "./action/ActionType.js";
|
|
8
|
+
import type { ActionValidationRule } from "./action/ActionValidationRule.js";
|
|
7
9
|
import type { MappingValue } from "./action/MappingValue.js";
|
|
8
10
|
import type { SubmissionMetadata } from "./action/SubmissionMetadata.js";
|
|
9
11
|
import type { InterfaceType } from "./interface/InterfaceType.js";
|
|
12
|
+
import type { ObjectPropertyTypeUserDefinition } from "./object/ObjectPropertyTypeUserDefinition.js";
|
|
10
13
|
import type { ObjectTypeDefinition } from "./object/ObjectTypeDefinition.js";
|
|
14
|
+
import { type PropertyTypeType } from "./properties/PropertyTypeType.js";
|
|
15
|
+
import type { SharedPropertyType } from "./properties/SharedPropertyType.js";
|
|
11
16
|
export declare const MODIFY_OBJECT_PARAMETER: string;
|
|
12
17
|
export declare const CREATE_OR_MODIFY_OBJECT_PARAMETER: string;
|
|
18
|
+
export declare const CREATE_INTERFACE_OBJECT_PARAMETER: string;
|
|
19
|
+
export declare const MODIFY_INTERFACE_OBJECT_PARAMETER: string;
|
|
13
20
|
export type ActionTypeDefinition = Omit<ActionType, "__type">;
|
|
14
21
|
export type ActionTypeUserDefinition = {
|
|
15
22
|
objectType: ObjectTypeDefinition
|
|
@@ -31,13 +38,22 @@ export type ActionTypeUserDefinition = {
|
|
|
31
38
|
export type InterfaceActionTypeUserDefinition = {
|
|
32
39
|
interfaceType: InterfaceType
|
|
33
40
|
objectType?: ObjectTypeDefinition
|
|
41
|
+
apiName?: string
|
|
42
|
+
displayName?: string
|
|
43
|
+
status?: ActionStatus
|
|
44
|
+
parameterConfiguration?: Record<string, ActionParameterConfiguration>
|
|
45
|
+
nonParameterMappings?: Record<string, MappingValue>
|
|
34
46
|
validation?: ActionLevelValidationDefinition
|
|
35
47
|
excludedProperties?: Array<string>
|
|
48
|
+
parameterOrdering?: Array<string>
|
|
36
49
|
};
|
|
37
|
-
export declare function defineCreateInterfaceObjectAction(def: InterfaceActionTypeUserDefinition): ActionType;
|
|
38
|
-
export declare function defineCreateObjectAction(def: ActionTypeUserDefinition): ActionType;
|
|
39
|
-
export declare function defineModifyInterfaceObjectAction(def: InterfaceActionTypeUserDefinition): ActionType;
|
|
40
|
-
export declare function defineModifyObjectAction(def: ActionTypeUserDefinition): ActionType;
|
|
41
|
-
export declare function defineDeleteObjectAction(def: ActionTypeUserDefinition): ActionType;
|
|
42
|
-
export declare function defineCreateOrModifyObjectAction(def: ActionTypeUserDefinition): ActionType;
|
|
43
50
|
export declare function defineAction(actionDef: ActionTypeDefinition): ActionType;
|
|
51
|
+
export declare function isPropertyParameter(def: ActionTypeUserDefinition | InterfaceActionTypeUserDefinition, name: string, type: PropertyTypeType): boolean;
|
|
52
|
+
export declare function createParameters(def: ActionTypeUserDefinition | InterfaceActionTypeUserDefinition, propertyMap: Record<string, ObjectPropertyTypeUserDefinition> | Record<string, SharedPropertyType>, parameterSet: Set<string>, requiredMap?: Record<string, boolean>): Array<ActionParameter>;
|
|
53
|
+
export declare function kebab(s: string): string;
|
|
54
|
+
export declare function convertValidationRule(actionValidation: ActionLevelValidationDefinition, actionParameters?: ActionParameter[]): Array<ActionValidationRule>;
|
|
55
|
+
export declare function validateActionParameters(def: ActionTypeUserDefinition | InterfaceActionTypeUserDefinition, properties: Array<string>, name: string): void;
|
|
56
|
+
export declare function createDefaultParameterOrdering(def: ActionTypeUserDefinition | InterfaceActionTypeUserDefinition, properties: Array<string>, parameters: ActionParameter[], priorityId?: string): string[];
|
|
57
|
+
export declare function validateParameterOrdering(parameterOrdering: string[], parameterSet: Set<string>, actionApiName: string): void;
|
|
58
|
+
export declare function isTargetParameter(parameterId: string): boolean;
|
|
59
|
+
export declare function addNamespaceToActionDefinition(def: InterfaceActionTypeUserDefinition): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,2CACA,8CAEA,mBACK,uBAAwB;
|
|
1
|
+
{"mappings":"AAgBA,cACE,2CACA,8CAEA,mBACK,uBAAwB;AAG/B,cAAc,uCAAuC,6CAA8C;AACnG,cAAc,uBAAuB,6BAA8B;AAEnE,cAAc,oCAAoC,0CAA2C;AAM7F,cAAc,qBAAqB,2BAA4B;AAC/D,cAAc,oBAAoB,0BAA2B;AAC7D,cAAc,kBAAkB,wBAAyB;AACzD,cAAc,4BAA4B,kCAAmC;AAE7E,cAAc,oBAAoB,0BAA2B;AAC7D,cAAc,0BAA0B,gCAAiC;AAWzE,cAAc,qBAAqB,8BAA+B;AAElE,cAAc,wCAAwC,8CAA+C;AACrG,cAAc,4BAA4B,kCAAmC;AAC7E,cAEO,wBACA,kCAAmC;AAC1C,cAAc,0BAA0B,oCAAqC;AAE7E,OAAO,cAAMA;AAEb,OAAO,cAAMC;AAGb,OAAO,cAAMC;AAEb,OAAO,cAAMC;AAGb,YAAY,uBAAuB,KAAK,YAAY;AAEpD,YAAY,2BAA2B;CACrC,YAAY;CACZ;CACA;CACA,SAAS;CACT,yBAAyB,eAAe;CACxC,uBAAuB,eAAe;CACtC,wBAAwB;CACxB,qBAAqB,MAAM;CAC3B,WAAW,MAAM;CAEjB,gBAAgB;CAChB;CAEA,mBAAmB;CACnB,oBAAoB;CACpB,qBAAqB;CAErB,mBAAmB,kBAAkB;AACtC;AAED,YAAY,oCAAoC;CAC9C,eAAe;CACf,aAAa;CACb;CACA;CACA,SAAS;CACT,yBAAyB,eAAe;CACxC,uBAAuB,eAAe;CACtC,aAAa;CACb,qBAAqB;CACrB,oBAAoB;AACrB;AAED,OAAO,iBAAS,aAAaC,WAAW,uBAAuB;AAmI/D,OAAO,iBAAS,oBACdC,KAAK,2BAA2B,mCAChCC,cACAC,MAAM;AASR,OAAO,iBAAS,iBACdF,KAAK,2BAA2B,mCAChCG,aACI,eAAe,oCACf,eAAe,qBACnBC,cAAc,aACdC,cAAc,0BACb,MAAM;AAkbT,OAAO,iBAAS,MAAMC;AAYtB,OAAO,iBAAS,sBACdC,kBAAkB,iCAClBC,mBAAmB,oBAClB,MAAM;AAiJT,OAAO,iBAAS,yBACdR,KAAK,2BAA2B,mCAChCS,YAAY,eACZR;AA4BF,OAAO,iBAAS,+BACdD,KAAK,2BAA2B,mCAChCS,YAAY,eACZC,YAAY,mBACZC;AAaF,OAAO,iBAAS,0BACdC,6BACAR,cAAc,aACdS;AAgBF,OAAO,iBAAS,kBAAkBC;AAOlC,OAAO,iBAAS,+BACdC,KAAK","names":["MODIFY_OBJECT_PARAMETER: string","CREATE_OR_MODIFY_OBJECT_PARAMETER: string","CREATE_INTERFACE_OBJECT_PARAMETER: string","MODIFY_INTERFACE_OBJECT_PARAMETER: string","actionDef: ActionTypeDefinition","def: ActionTypeUserDefinition | InterfaceActionTypeUserDefinition","name: string","type: PropertyTypeType","propertyMap:\n | Record<string, ObjectPropertyTypeUserDefinition>\n | Record<string, SharedPropertyType>","parameterSet: Set<string>","requiredMap?: Record<string, boolean>","s: string","actionValidation: ActionLevelValidationDefinition","actionParameters?: ActionParameter[]","properties: Array<string>","parameters: ActionParameter[]","priorityId?: string","parameterOrdering: string[]","actionApiName: string","parameterId: string","def: InterfaceActionTypeUserDefinition"],"sources":["../../../src/api/defineAction.ts"],"version":3,"file":"defineAction.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAiBA,cAAc,kBAAkB,wBAAyB;AACzD,cAAc,yCAAyC,mBAAoB;AAiB3E,OAAO,iBAAS,kCACdA,KAAK,oCACJ","names":["def: InterfaceActionTypeUserDefinition"],"sources":["../../../src/api/defineCreateInterfaceObjectAction.ts"],"version":3,"file":"defineCreateInterfaceObjectAction.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAiBA,cAAc,kBAAkB,wBAAyB;AACzD,cAAc,gCAAgC,mBAAoB;AAYlE,OAAO,iBAAS,yBACdA,KAAK,2BACJ","names":["def: ActionTypeUserDefinition"],"sources":["../../../src/api/defineCreateObjectAction.ts"],"version":3,"file":"defineCreateObjectAction.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAiBA,cAAc,kBAAkB,wBAAyB;AACzD,cAAc,gCAAgC,mBAAoB;AAalE,OAAO,iBAAS,iCACdA,KAAK,2BACJ","names":["def: ActionTypeUserDefinition"],"sources":["../../../src/api/defineCreateOrModifyObjectAction.ts"],"version":3,"file":"defineCreateOrModifyObjectAction.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,kBAAkB,wBAAyB;AACzD,cAAc,gCAAgC,mBAAoB;AAGlE,OAAO,iBAAS,yBACdA,KAAK,2BACJ","names":["def: ActionTypeUserDefinition"],"sources":["../../../src/api/defineDeleteObjectAction.ts"],"version":3,"file":"defineDeleteObjectAction.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAiBA,cAAc,kBAAkB,wBAAyB;AACzD,cAAc,yCAAyC,mBAAoB;AAiB3E,OAAO,iBAAS,kCACdA,KAAK,oCACJ","names":["def: InterfaceActionTypeUserDefinition"],"sources":["../../../src/api/defineModifyInterfaceObjectAction.ts"],"version":3,"file":"defineModifyInterfaceObjectAction.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAiBA,cAAc,kBAAkB,wBAAyB;AACzD,cAAc,gCAAgC,mBAAoB;AAalE,OAAO,iBAAS,yBACdA,KAAK,2BACJ","names":["def: ActionTypeUserDefinition"],"sources":["../../../src/api/defineModifyObjectAction.ts"],"version":3,"file":"defineModifyObjectAction.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../src/api/test/actions.test.ts"],"version":3,"file":"actions.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../src/api/test/interfaces.test.ts"],"version":3,"file":"interfaces.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../src/api/test/links.test.ts"],"version":3,"file":"links.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../src/api/test/markingconstraint.test.ts"],"version":3,"file":"markingconstraint.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../src/api/test/misc.test.ts"],"version":3,"file":"misc.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../src/api/test/objectStatus.test.ts"],"version":3,"file":"objectStatus.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../src/api/test/objects.test.ts"],"version":3,"file":"objects.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../src/api/test/spt.test.ts"],"version":3,"file":"spt.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../src/api/test/valueTypes.test.ts"],"version":3,"file":"valueTypes.test.d.ts"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -11,10 +11,16 @@ export type { SectionConditionalOverride } from "./api/action/SectionConditional
|
|
|
11
11
|
export type { SubmissionMetadata } from "./api/action/SubmissionMetadata.js";
|
|
12
12
|
export { addDependency } from "./api/addDependency.js";
|
|
13
13
|
export { OntologyEntityTypeEnum } from "./api/common/OntologyEntityTypeEnum.js";
|
|
14
|
-
export { CREATE_OR_MODIFY_OBJECT_PARAMETER, defineAction,
|
|
14
|
+
export { CREATE_INTERFACE_OBJECT_PARAMETER, CREATE_OR_MODIFY_OBJECT_PARAMETER, defineAction, MODIFY_INTERFACE_OBJECT_PARAMETER, MODIFY_OBJECT_PARAMETER } from "./api/defineAction.js";
|
|
15
|
+
export { defineCreateInterfaceObjectAction } from "./api/defineCreateInterfaceObjectAction.js";
|
|
16
|
+
export { defineCreateObjectAction } from "./api/defineCreateObjectAction.js";
|
|
17
|
+
export { defineCreateOrModifyObjectAction } from "./api/defineCreateOrModifyObjectAction.js";
|
|
18
|
+
export { defineDeleteObjectAction } from "./api/defineDeleteObjectAction.js";
|
|
15
19
|
export { defineInterface } from "./api/defineInterface.js";
|
|
16
20
|
export { defineInterfaceLinkConstraint } from "./api/defineInterfaceLinkConstraint.js";
|
|
17
21
|
export { defineLink } from "./api/defineLink.js";
|
|
22
|
+
export { defineModifyInterfaceObjectAction } from "./api/defineModifyInterfaceObjectAction.js";
|
|
23
|
+
export { defineModifyObjectAction } from "./api/defineModifyObjectAction.js";
|
|
18
24
|
export { convertToPluralDisplayName, defineObject, uppercaseFirstLetter as convertToDisplayName } from "./api/defineObject.js";
|
|
19
25
|
export { addNamespaceIfNone, defineOntology, dumpOntologyFullMetadata } from "./api/defineOntology.js";
|
|
20
26
|
export { defineSharedPropertyType } from "./api/defineSpt.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,SAAS,eAA0B;AAEnC,cAAc,iCAAiC;AAC/C,cACE,oCACK;AACP,cAAc,0CAA0C;AACxD,cAAc,oCAAoC;AAClD,cAAc,qBAAqB;AACnC,cAAc,kBAAkB;AAChC,cAAc,2BAA2B;AACzC,cACE,yBACA,yBACA,eACA,cACA,wBACK;AACP,cAAc,kCAAkC;AAChD,cAAc,0BAA0B;AACxC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AACvC,SACE,mCACA,cACA,mCACA,
|
|
1
|
+
{"mappings":"AAgBA,SAAS,eAA0B;AAEnC,cAAc,iCAAiC;AAC/C,cACE,oCACK;AACP,cAAc,0CAA0C;AACxD,cAAc,oCAAoC;AAClD,cAAc,qBAAqB;AACnC,cAAc,kBAAkB;AAChC,cAAc,2BAA2B;AACzC,cACE,yBACA,yBACA,eACA,cACA,wBACK;AACP,cAAc,kCAAkC;AAChD,cAAc,0BAA0B;AACxC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AACvC,SACE,mCACA,mCACA,cACA,mCACA,+BACK;AACP,SAAS,yCAAyC;AAClD,SAAS,gCAAgC;AACzC,SAAS,wCAAwC;AACjD,SAAS,gCAAgC;AACzC,SAAS,uBAAuB;AAChC,SAAS,qCAAqC;AAC9C,SAAS,kBAAkB;AAC3B,SAAS,yCAAyC;AAClD,SAAS,gCAAgC;AACzC,SACE,4BACA,cACA,wBAAwB,4BACnB;AACP,SACE,oBACA,gBACA,gCACK;AACP,SAAS,gCAAgC;AACzC,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,gCAAgC;AACzC,cAAc,qBAAqB;AACnC,cAAc,gBAAgB;AAC9B,cAAc,0BAA0B;AACxC,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,kCAAkC;AAChD,SAAS,qBAAqB;AAC9B,SAAS,oCAAoC,mBAAmB","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/maker",
|
|
3
|
-
"version": "0.14.0-beta.
|
|
3
|
+
"version": "0.14.0-beta.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"tiny-invariant": "^1.3.3",
|
|
34
34
|
"ts-node": "^10.9.2",
|
|
35
35
|
"yargs": "^17.7.2",
|
|
36
|
-
"@osdk/api": "~2.6.0-beta.
|
|
36
|
+
"@osdk/api": "~2.6.0-beta.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^20.19.13",
|
|
40
40
|
"@types/yargs": "^17.0.33",
|
|
41
41
|
"typescript": "~5.5.4",
|
|
42
42
|
"vitest": "^3.2.4",
|
|
43
|
+
"@osdk/client.unstable": "~2.6.0-beta.2",
|
|
43
44
|
"@osdk/monorepo.api-extractor": "~0.5.0-beta.1",
|
|
44
|
-
"@osdk/client.unstable": "~2.6.0-beta.1",
|
|
45
45
|
"@osdk/monorepo.tsconfig": "~0.5.0-beta.1"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markingconstraint.test.js","names":["beforeEach","describe","expect","it","defineObject","defineOntology","dumpOntologyFullMetadata","titlePropertyApiName","displayName","pluralDisplayName","apiName","primaryKeyPropertyApiName","properties","type","markingType","markingInputGroupName","ontology","classificationConstraint","objectTypes","datasources","dataSecurity","markingGroupName","toEqual","markingConstraint","datasource","not","toHaveProperty"],"sources":["markingconstraint.test.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 { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineObject } from \"./defineObject.js\";\nimport { defineOntology, dumpOntologyFullMetadata } from \"./defineOntology.js\";\n\ndescribe(\"Marking Constraints\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n it(\"supports marking constraints with CBAC type and markingInputGroupName\", () => {\n const obj = defineObject({\n titlePropertyApiName: \"title\",\n displayName: \"Document\",\n pluralDisplayName: \"Documents\",\n apiName: \"document\",\n primaryKeyPropertyApiName: \"title\",\n properties: {\n \"title\": {\n type: \"string\",\n displayName: \"Title\",\n },\n \"classification\": {\n type: {\n type: \"marking\",\n markingType: \"CBAC\",\n markingInputGroupName: \"classificationGroup\",\n },\n displayName: \"Classification\",\n },\n },\n });\n\n const ontology = dumpOntologyFullMetadata();\n const classificationConstraint = ontology.ontology\n .objectTypes[\"com.palantir.document\"].datasources[0].dataSecurity\n ?.classificationConstraint!;\n expect(classificationConstraint.markingGroupName).toEqual(\n \"classificationGroup\",\n );\n });\n\n it(\"supports marking constraints with multiple markings\", () => {\n const obj = defineObject({\n titlePropertyApiName: \"title\",\n displayName: \"Document\",\n pluralDisplayName: \"Documents\",\n apiName: \"document\",\n primaryKeyPropertyApiName: \"title\",\n properties: {\n \"title\": {\n type: \"string\",\n displayName: \"Title\",\n },\n \"classification\": {\n type: {\n type: \"marking\",\n markingType: \"CBAC\",\n markingInputGroupName: \"classificationGroup\",\n },\n displayName: \"Classification\",\n },\n \"mandatory\": {\n type: {\n type: \"marking\",\n markingType: \"MANDATORY\",\n markingInputGroupName: \"mandatoryMarkingGroup\",\n },\n displayName: \"Classification\",\n },\n },\n });\n\n const ontology = dumpOntologyFullMetadata();\n const dataSecurity = ontology.ontology.objectTypes[\"com.palantir.document\"]\n .datasources[0].dataSecurity!;\n expect(dataSecurity.markingConstraint!.markingGroupName).toEqual(\n \"mandatoryMarkingGroup\",\n );\n expect(dataSecurity.classificationConstraint!.markingGroupName).toEqual(\n \"classificationGroup\",\n );\n });\n\n it(\"does not set security on objects if no marking props\", () => {\n const obj = defineObject({\n titlePropertyApiName: \"title\",\n displayName: \"Document\",\n pluralDisplayName: \"Documents\",\n apiName: \"document\",\n primaryKeyPropertyApiName: \"title\",\n properties: {\n \"title\": {\n type: \"string\",\n displayName: \"Title\",\n },\n \"string\": {\n type: \"string\",\n displayName: \"string\",\n },\n },\n });\n\n const ontology = dumpOntologyFullMetadata();\n const datasource =\n ontology.ontology.objectTypes[\"com.palantir.document\"].datasources[0];\n expect(datasource).not.toHaveProperty(\"dataSecurity\");\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,cAAc,EAAEC,wBAAwB,QAAQ,qBAAqB;AAE9EL,QAAQ,CAAC,qBAAqB,EAAE,MAAM;EACpCD,UAAU,CAAC,YAAY;IACrB,MAAMK,cAAc,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;EAC1D,CAAC,CAAC;EACFF,EAAE,CAAC,uEAAuE,EAAE,MAAM;IACpEC,YAAY,CAAC;MACvBG,oBAAoB,EAAE,OAAO;MAC7BC,WAAW,EAAE,UAAU;MACvBC,iBAAiB,EAAE,WAAW;MAC9BC,OAAO,EAAE,UAAU;MACnBC,yB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AAGJ,QAAQ,CAACA,QAAQ,CAACE,WAAW,CAAC,uBAAuB,CAAC,CACxEC,WAAW,CAAC,CAAC,CAAC,CAACC,YAAa;IAC/BlB,MAAM,CAACkB,YAAY,CAACG,iBAAiB,CAAEF,gBAAgB,CAAC,CAACC,OAAO,CAC9D,uBACF,CAAC;IACDpB,MAAM,CAACkB,YAAY,CAACH,wBAAwB,CAAEI,gBAAgB,CAAC,CAACC,OAAO,CACrE,qBACF,CAAC;EACH,CAAC,CAAC;EAEFnB,EAAE,CAAC,sDAAsD,EAAE,MAAM;IACnDC,YAAY,CAAC;MACvBG,oBAAoB,EAAE,OAAO;MAC7BC,WAAW,EAAE,UAAU;MACvBC,iBAAiB,EAAE,WAAW;MAC9BC,OAAO,EAAE,UAAU;MACnBC,yBAAyB,EAAE,OAAO;MAClCC,UAAU,EAAE;QACV,OAAO,EAAE;UACPC,IAAI,EAAE,QAAQ;UACdL,WAAW,EAAE;QACf,CAAC;QACD,QAAQ,EAAE;UACRK,IAAI,EAAE,QAAQ;UACdL,WAAW,EAAE;QACf;MACF;IACF,CAAC,CAAC;IAEF,MAAMQ,QAAQ,GAAGV,wBAAwB,CAAC,CAAC;IAC3C,MAAMkB,UAAU,GACdR,QAAQ,CAACA,QAAQ,CAACE,WAAW,CAAC,uBAAuB,CAAC,CAACC,WAAW,CAAC,CAAC,CAAC;IACvEjB,MAAM,CAACsB,UAAU,CAAC,CAACC,GAAG,CAACC,cAAc,CAAC,cAAc,CAAC;EACvD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectStatus.test.js","names":["beforeEach","describe","expect","it","defineObject","defineOntology","dumpOntologyFullMetadata","titlePropertyApiName","displayName","pluralDisplayName","apiName","primaryKeyPropertyApiName","status","properties","type","toThrowError","not","toThrow","metadata","ontology","objectTypes","objectType","toEqual","active","experimental","message","deadline","deprecated","replacedBy","undefined"],"sources":["objectStatus.test.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 { beforeEach, describe, expect, it } from \"vitest\";\nimport { defineObject } from \"./defineObject.js\";\nimport { defineOntology, dumpOntologyFullMetadata } from \"./defineOntology.js\";\nimport type { ObjectTypeStatus } from \"./object/ObjectTypeStatus.js\";\n\ndescribe(\"Object Status\", () => {\n beforeEach(async () => {\n await defineOntology(\"com.palantir.\", () => {}, \"/tmp/\");\n });\n\n describe(\"Object Status Validation\", () => {\n it(\"throws an error when object status is experimental and a property is active\", async () => {\n await defineOntology(\"com.palantir.\", () => {\n expect(() =>\n defineObject({\n titlePropertyApiName: \"bar\",\n displayName: \"ValidationTestObject\",\n pluralDisplayName: \"ValidationTestObjects\",\n apiName: \"validation-test\",\n primaryKeyPropertyApiName: \"bar\",\n status: \"experimental\" as ObjectTypeStatus,\n properties: {\n \"bar\": { type: \"string\", status: \"active\" as ObjectTypeStatus },\n },\n })\n ).toThrowError(\n /When object \"validation-test\" has experimental status, no properties can have \"active\" status/,\n );\n }, \"/tmp/\");\n });\n\n it(\"does not throw when object status is experimental and no properties have active status\", async () => {\n await defineOntology(\"com.palantir.\", () => {\n expect(() =>\n defineObject({\n titlePropertyApiName: \"bar\",\n displayName: \"ValidationTestObject2\",\n pluralDisplayName: \"ValidationTestObjects2\",\n apiName: \"validation-test-2\",\n primaryKeyPropertyApiName: \"bar\",\n status: \"experimental\" as ObjectTypeStatus,\n properties: {\n \"bar\": {\n type: \"string\",\n status: \"experimental\" as ObjectTypeStatus,\n },\n },\n })\n ).not.toThrow();\n }, \"/tmp/\");\n });\n });\n\n describe(\"Object Status Conversion\", () => {\n it(\"converts default status (undefined) to active\", async () => {\n await defineOntology(\"com.palantir.\", () => {\n const obj = defineObject({\n titlePropertyApiName: \"bar\",\n displayName: \"DefaultStatusObject\",\n pluralDisplayName: \"DefaultStatusObjects\",\n apiName: \"default-status\",\n primaryKeyPropertyApiName: \"bar\",\n properties: { \"bar\": { type: \"string\" } },\n });\n\n const metadata = dumpOntologyFullMetadata();\n expect(\n metadata.ontology.objectTypes[\"com.palantir.default-status\"]\n .objectType.status,\n ).toEqual({\n type: \"active\",\n active: {},\n });\n }, \"/tmp/\");\n });\n\n it(\"converts active status to proper format\", async () => {\n await defineOntology(\"com.palantir.\", () => {\n const obj = defineObject({\n titlePropertyApiName: \"bar\",\n displayName: \"ActiveStatusObject\",\n pluralDisplayName: \"ActiveStatusObjects\",\n apiName: \"active-status\",\n primaryKeyPropertyApiName: \"bar\",\n properties: { \"bar\": { type: \"string\" } },\n status: \"active\" as ObjectTypeStatus,\n });\n\n const metadata = dumpOntologyFullMetadata();\n expect(\n metadata.ontology.objectTypes[\"com.palantir.active-status\"]\n .objectType.status,\n ).toEqual({\n type: \"active\",\n active: {},\n });\n }, \"/tmp/\");\n });\n\n it(\"converts experimental status to proper format\", async () => {\n await defineOntology(\"com.palantir.\", () => {\n const obj = defineObject({\n titlePropertyApiName: \"bar\",\n displayName: \"ExperimentalStatusObject\",\n pluralDisplayName: \"ExperimentalStatusObjects\",\n apiName: \"experimental-status\",\n primaryKeyPropertyApiName: \"bar\",\n properties: { \"bar\": { type: \"string\" } },\n status: \"experimental\" as ObjectTypeStatus,\n });\n\n const metadata = dumpOntologyFullMetadata();\n expect(\n metadata.ontology.objectTypes[\"com.palantir.experimental-status\"]\n .objectType.status,\n ).toEqual({\n type: \"experimental\",\n experimental: {},\n });\n }, \"/tmp/\");\n });\n\n it(\"converts deprecated status to proper format\", async () => {\n await defineOntology(\"com.palantir.\", () => {\n const obj = defineObject({\n titlePropertyApiName: \"bar\",\n displayName: \"DeprecatedStatusObject\",\n pluralDisplayName: \"DeprecatedStatusObjects\",\n apiName: \"deprecated-status\",\n primaryKeyPropertyApiName: \"bar\",\n properties: { \"bar\": { type: \"string\" } },\n status: {\n type: \"deprecated\",\n message: \"This object is deprecated\",\n deadline: \"2023-01-01\",\n } as ObjectTypeStatus,\n });\n\n const metadata = dumpOntologyFullMetadata();\n expect(\n metadata.ontology.objectTypes[\"com.palantir.deprecated-status\"]\n .objectType.status,\n ).toEqual({\n type: \"deprecated\",\n deprecated: {\n message: \"This object is deprecated\",\n deadline: \"2023-01-01\",\n replacedBy: undefined,\n },\n });\n }, \"/tmp/\");\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACzD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,cAAc,EAAEC,wBAAwB,QAAQ,qBAAqB;AAG9EL,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC9BD,UAAU,CAAC,YAAY;IACrB,MAAMK,cAAc,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;EAC1D,CAAC,CAAC;EAEFJ,QAAQ,CAAC,0BAA0B,EAAE,MAAM;IACzCE,EAAE,CAAC,6EAA6E,EAAE,YAAY;MAC5F,MAAME,cAAc,CAAC,eAAe,EAAE,MAAM;QAC1CH,MAAM,CAAC,MACLE,YAAY,CAAC;UACXG,oBAAoB,EAAE,KAAK;UAC3BC,WAAW,EAAE,sBAAsB;UACnCC,iBAAiB,EAAE,uBAAuB;UAC1CC,OAAO,EAAE,iBAAiB;UAC1BC,yBAAyB,EAAE,KAAK;UAChCC,MAAM,EAAE,cAAkC;UAC1CC,UAAU,EAAE;YACV,KAAK,EAAE;cAAEC,IAAI,EAAE,QAAQ;cAA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