@osdk/generator 2.8.0-beta.2 → 2.8.0-beta.21
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 +153 -0
- package/build/browser/shared/getInterfaceTypesFromQueryDataType.js +3 -0
- package/build/browser/shared/getInterfaceTypesFromQueryDataType.js.map +1 -1
- package/build/browser/shared/getObjectTypesFromQueryDataType.js +3 -0
- package/build/browser/shared/getObjectTypesFromQueryDataType.js.map +1 -1
- package/build/browser/util/test/TodoWireOntology.js +20 -10
- package/build/browser/util/test/TodoWireOntology.js.map +1 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.js +10 -3
- package/build/browser/v2.0/generatePerQueryDataFiles.js.map +1 -1
- package/build/browser/v2.0/getDescriptionIfPresent.js +4 -1
- package/build/browser/v2.0/getDescriptionIfPresent.js.map +1 -1
- package/build/cjs/index.cjs +19 -4
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/shared/getInterfaceTypesFromQueryDataType.js +3 -0
- package/build/esm/shared/getInterfaceTypesFromQueryDataType.js.map +1 -1
- package/build/esm/shared/getObjectTypesFromQueryDataType.js +3 -0
- package/build/esm/shared/getObjectTypesFromQueryDataType.js.map +1 -1
- package/build/esm/util/test/TodoWireOntology.js +20 -10
- package/build/esm/util/test/TodoWireOntology.js.map +1 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.js +10 -3
- package/build/esm/v2.0/generatePerQueryDataFiles.js.map +1 -1
- package/build/esm/v2.0/getDescriptionIfPresent.js +4 -1
- package/build/esm/v2.0/getDescriptionIfPresent.js.map +1 -1
- package/package.json +4 -4
- package/build/browser/generateClientSdkPackage.test.js +0 -68
- package/build/browser/generateClientSdkPackage.test.js.map +0 -1
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js +0 -47
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js.map +0 -1
- package/build/browser/shared/sanitizeMetadata.test.js +0 -46
- package/build/browser/shared/sanitizeMetadata.test.js.map +0 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +0 -472
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +0 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +0 -2603
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +0 -1
- package/build/browser/v2.0/generatePerActionDataFiles.test.js +0 -64
- package/build/browser/v2.0/generatePerActionDataFiles.test.js.map +0 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js +0 -519
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js.map +0 -1
- package/build/esm/generateClientSdkPackage.test.js +0 -68
- package/build/esm/generateClientSdkPackage.test.js.map +0 -1
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js +0 -47
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js.map +0 -1
- package/build/esm/shared/sanitizeMetadata.test.js +0 -46
- package/build/esm/shared/sanitizeMetadata.test.js.map +0 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +0 -472
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +0 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +0 -2603
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +0 -1
- package/build/esm/v2.0/generatePerActionDataFiles.test.js +0 -64
- package/build/esm/v2.0/generatePerActionDataFiles.test.js.map +0 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js +0 -519
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js.map +0 -1
- package/build/types/generateClientSdkPackage.test.d.ts +0 -1
- package/build/types/generateClientSdkPackage.test.d.ts.map +0 -1
- package/build/types/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +0 -1
- package/build/types/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +0 -1
- package/build/types/shared/sanitizeMetadata.test.d.ts +0 -1
- package/build/types/shared/sanitizeMetadata.test.d.ts.map +0 -1
- package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +0 -1
- package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +0 -1
- package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +0 -1
- package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +0 -1
- package/build/types/v2.0/generatePerActionDataFiles.test.d.ts +0 -1
- package/build/types/v2.0/generatePerActionDataFiles.test.d.ts.map +0 -1
- package/build/types/v2.0/generatePerQueryDataFiles.test.d.ts +0 -1
- package/build/types/v2.0/generatePerQueryDataFiles.test.d.ts.map +0 -1
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 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 { describe, expect, it } from "vitest";
|
|
18
|
-
import { startsWithApiNamespace } from "./startsWithApiNamespace.js";
|
|
19
|
-
describe(startsWithApiNamespace, () => {
|
|
20
|
-
describe("a name with periods", () => {
|
|
21
|
-
const partialNamespace = "a.b";
|
|
22
|
-
const fullNamespace = `${partialNamespace}.c`;
|
|
23
|
-
const fullApiName = `${fullNamespace}.${"Foo"}`;
|
|
24
|
-
it("returns false if only partial namespace is provided", () => {
|
|
25
|
-
expect(startsWithApiNamespace(fullApiName, partialNamespace)).toBe(false);
|
|
26
|
-
});
|
|
27
|
-
it("returns true if full namespace is provided", () => {
|
|
28
|
-
expect(startsWithApiNamespace(fullApiName, fullNamespace)).toBe(true);
|
|
29
|
-
});
|
|
30
|
-
it("returns false if a wrong namespace is provided", () => {
|
|
31
|
-
expect(startsWithApiNamespace(fullApiName, "incorrect.namespace")).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
it("return false if no namespace is provided", () => {
|
|
34
|
-
expect(startsWithApiNamespace(fullApiName, undefined)).toBe(false);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
describe("a name without periods", () => {
|
|
38
|
-
const apiNameOnly = "Foo";
|
|
39
|
-
it("returns false if any namespace is provided", () => {
|
|
40
|
-
expect(startsWithApiNamespace(apiNameOnly, "incorrect.namespace")).toBe(false);
|
|
41
|
-
});
|
|
42
|
-
it("returns true if no namespace is provided", () => {
|
|
43
|
-
expect(startsWithApiNamespace(apiNameOnly, undefined)).toBe(true);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=startsWithApiNamespace.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"startsWithApiNamespace.test.js","names":["describe","expect","it","startsWithApiNamespace","partialNamespace","fullNamespace","fullApiName","toBe","undefined","apiNameOnly"],"sources":["startsWithApiNamespace.test.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\nimport { describe, expect, it } from \"vitest\";\nimport { startsWithApiNamespace } from \"./startsWithApiNamespace.js\";\n\ndescribe(startsWithApiNamespace, () => {\n describe(\"a name with periods\", () => {\n const wrongNamespace = \"incorrect.namespace\";\n const partialNamespace = \"a.b\";\n const fullNamespace = `${partialNamespace}.c`;\n const apiNameOnly = \"Foo\";\n const fullApiName = `${fullNamespace}.${apiNameOnly}`;\n\n it(\"returns false if only partial namespace is provided\", () => {\n expect(startsWithApiNamespace(fullApiName, partialNamespace)).toBe(\n false,\n );\n });\n\n it(\"returns true if full namespace is provided\", () => {\n expect(startsWithApiNamespace(fullApiName, fullNamespace)).toBe(true);\n });\n\n it(\"returns false if a wrong namespace is provided\", () => {\n expect(startsWithApiNamespace(fullApiName, wrongNamespace)).toBe(false);\n });\n\n it(\"return false if no namespace is provided\", () => {\n expect(startsWithApiNamespace(fullApiName, undefined)).toBe(false);\n });\n });\n\n describe(\"a name without periods\", () => {\n const wrongNamespace = \"incorrect.namespace\";\n const apiNameOnly = \"Foo\";\n\n it(\"returns false if any namespace is provided\", () => {\n expect(startsWithApiNamespace(apiNameOnly, wrongNamespace)).toBe(\n false,\n );\n });\n\n it(\"returns true if no namespace is provided\", () => {\n expect(startsWithApiNamespace(apiNameOnly, undefined)).toBe(true);\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,sBAAsB,QAAQ,6BAA6B;AAEpEH,QAAQ,CAACG,sBAAsB,EAAE,MAAM;EACrCH,QAAQ,CAAC,qBAAqB,EAAE,MAAM;IAEpC,MAAMI,gBAAgB,GAAG,KAAK;IAC9B,MAAMC,aAAa,GAAG,GAAGD,gBAAgB,IAAI;IAE7C,MAAME,WAAW,GAAG,GAAGD,aAAa,IADhB,KAAK,EAC4B;IAErDH,EAAE,CAAC,qDAAqD,EAAE,MAAM;MAC9DD,MAAM,CAACE,sBAAsB,CAACG,WAAW,EAAEF,gBAAgB,CAAC,CAAC,CAACG,IAAI,CAChE,KACF,CAAC;IACH,CAAC,CAAC;IAEFL,EAAE,CAAC,4CAA4C,EAAE,MAAM;MACrDD,MAAM,CAACE,sBAAsB,CAACG,WAAW,EAAED,aAAa,CAAC,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;IACvE,CAAC,CAAC;IAEFL,EAAE,CAAC,gDAAgD,EAAE,MAAM;MACzDD,MAAM,CAACE,sBAAsB,CAACG,WAAW,EAjBpB,qBAiBoC,CAAC,CAAC,CAACC,IAAI,CAAC,KAAK,CAAC;IACzE,CAAC,CAAC;IAEFL,EAAE,CAAC,0CAA0C,EAAE,MAAM;MACnDD,MAAM,CAACE,sBAAsB,CAACG,WAAW,EAAEE,SAAS,CAAC,CAAC,CAACD,IAAI,CAAC,KAAK,CAAC;IACpE,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFP,QAAQ,CAAC,wBAAwB,EAAE,MAAM;IAEvC,MAAMS,WAAW,GAAG,KAAK;IAEzBP,EAAE,CAAC,4CAA4C,EAAE,MAAM;MACrDD,MAAM,CAACE,sBAAsB,CAACM,WAAW,EAJpB,qBAIoC,CAAC,CAAC,CAACF,IAAI,CAC9D,KACF,CAAC;IACH,CAAC,CAAC;IAEFL,EAAE,CAAC,0CAA0C,EAAE,MAAM;MACnDD,MAAM,CAACE,sBAAsB,CAACM,WAAW,EAAED,SAAS,CAAC,CAAC,CAACD,IAAI,CAAC,IAAI,CAAC;IACnE,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 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 { describe, expect, it } from "vitest";
|
|
18
|
-
import { sanitizeMetadata } from "./sanitizeMetadata.js";
|
|
19
|
-
describe(sanitizeMetadata, () => {
|
|
20
|
-
it("sanitized action apiNames", () => {
|
|
21
|
-
const sanitizedOntology = sanitizeMetadata({
|
|
22
|
-
objectTypes: {},
|
|
23
|
-
actionTypes: {
|
|
24
|
-
"kebab-case": {
|
|
25
|
-
apiName: "kebab-case",
|
|
26
|
-
operations: [],
|
|
27
|
-
parameters: {},
|
|
28
|
-
status: "ACTIVE",
|
|
29
|
-
rid: "ri.a.b.c.d"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
ontology: {
|
|
33
|
-
rid: "ri.a.b.c.d",
|
|
34
|
-
apiName: "ontology",
|
|
35
|
-
displayName: "",
|
|
36
|
-
description: ""
|
|
37
|
-
},
|
|
38
|
-
queryTypes: {},
|
|
39
|
-
interfaceTypes: {},
|
|
40
|
-
sharedPropertyTypes: {},
|
|
41
|
-
valueTypes: {}
|
|
42
|
-
});
|
|
43
|
-
expect(sanitizedOntology.actionTypes["kebabCase"].apiName).toEqual("kebabCase");
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=sanitizeMetadata.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeMetadata.test.js","names":["describe","expect","it","sanitizeMetadata","sanitizedOntology","objectTypes","actionTypes","apiName","operations","parameters","status","rid","ontology","displayName","description","queryTypes","interfaceTypes","sharedPropertyTypes","valueTypes","toEqual"],"sources":["sanitizeMetadata.test.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { describe, expect, it } from \"vitest\";\nimport { sanitizeMetadata } from \"./sanitizeMetadata.js\";\n\ndescribe(sanitizeMetadata, () => {\n it(\"sanitized action apiNames\", () => {\n const sanitizedOntology = sanitizeMetadata({\n objectTypes: {},\n actionTypes: {\n \"kebab-case\": {\n apiName: \"kebab-case\",\n operations: [],\n parameters: {},\n status: \"ACTIVE\",\n rid: \"ri.a.b.c.d\",\n },\n },\n ontology: {\n rid: \"ri.a.b.c.d\",\n apiName: \"ontology\",\n displayName: \"\",\n description: \"\",\n },\n queryTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {},\n valueTypes: {},\n });\n expect(sanitizedOntology.actionTypes[\"kebabCase\"].apiName).toEqual(\n \"kebabCase\",\n );\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,gBAAgB,QAAQ,uBAAuB;AAExDH,QAAQ,CAACG,gBAAgB,EAAE,MAAM;EAC/BD,EAAE,CAAC,2BAA2B,EAAE,MAAM;IACpC,MAAME,iBAAiB,GAAGD,gBAAgB,CAAC;MACzCE,WAAW,EAAE,CAAC,CAAC;MACfC,WAAW,EAAE;QACX,YAAY,EAAE;UACZC,OAAO,EAAE,YAAY;UACrBC,UAAU,EAAE,EAAE;UACdC,UAAU,EAAE,CAAC,CAAC;UACdC,MAAM,EAAE,QAAQ;UAChBC,GAAG,EAAE;QACP;MACF,CAAC;MACDC,QAAQ,EAAE;QACRD,GAAG,EAAE,YAAY;QACjBJ,OAAO,EAAE,UAAU;QACnBM,WAAW,EAAE,EAAE;QACfC,WAAW,EAAE;MACf,CAAC;MACDC,UAAU,EAAE,CAAC,CAAC;MACdC,cAAc,EAAE,CAAC,CAAC;MAClBC,mBAAmB,EAAE,CAAC,CAAC;MACvBC,UAAU,EAAE,CAAC;IACf,CAAC,CAAC;IACFjB,MAAM,CAACG,iBAAiB,CAACE,WAAW,CAAC,WAAW,CAAC,CAACC,OAAO,CAAC,CAACY,OAAO,CAChE,WACF,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,472 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "@osdk/generator-converters";
|
|
18
|
-
import { format } from "prettier";
|
|
19
|
-
import { describe, expect, it } from "vitest";
|
|
20
|
-
import { EnhancedInterfaceType } from "../GenerateContext/EnhancedInterfaceType.js";
|
|
21
|
-
import { enhanceOntology } from "../GenerateContext/enhanceOntology.js";
|
|
22
|
-
import { ForeignType } from "../GenerateContext/ForeignType.js";
|
|
23
|
-
import { deleteUndefineds } from "../util/deleteUndefineds.js";
|
|
24
|
-
import { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, getInvalidInterfaceProperties } from "./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js";
|
|
25
|
-
function simpleSpt(apiName, metadataLevel = 2) {
|
|
26
|
-
return {
|
|
27
|
-
apiName,
|
|
28
|
-
dataType: {
|
|
29
|
-
type: "integer"
|
|
30
|
-
},
|
|
31
|
-
rid: `${apiName}Rid`,
|
|
32
|
-
displayName: metadataLevel >= 1 ? `${apiName} property dn` : apiName,
|
|
33
|
-
description: metadataLevel >= 2 ? `${apiName} property desc` : undefined
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function simpleInterface(apiName, spts, parents, metadataLevel = 2, implementedByObjectTypes = []) {
|
|
37
|
-
const properties = Object.fromEntries(spts.map(spt => [spt.apiName, {
|
|
38
|
-
...spt,
|
|
39
|
-
required: true
|
|
40
|
-
}]));
|
|
41
|
-
return {
|
|
42
|
-
apiName,
|
|
43
|
-
rid: `${apiName}Rid`,
|
|
44
|
-
displayName: metadataLevel >= 1 ? `${apiName} interface dn` : apiName,
|
|
45
|
-
description: metadataLevel >= 2 ? `${apiName} interface desc` : undefined,
|
|
46
|
-
extendsInterfaces: parents,
|
|
47
|
-
links: {},
|
|
48
|
-
properties,
|
|
49
|
-
propertiesV2: {},
|
|
50
|
-
implementedByObjectTypes,
|
|
51
|
-
allExtendsInterfaces: parents,
|
|
52
|
-
allLinks: {},
|
|
53
|
-
allProperties: properties,
|
|
54
|
-
allPropertiesV2: {}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function simpleOntology(apiName, interfaces) {
|
|
58
|
-
const interfaceTypes = Object.fromEntries(interfaces.map(i => [i.apiName, i]));
|
|
59
|
-
const sharedPropertyTypes = Object.fromEntries(interfaces.flatMap(i => Object.entries(i.properties)));
|
|
60
|
-
return {
|
|
61
|
-
actionTypes: {},
|
|
62
|
-
interfaceTypes,
|
|
63
|
-
objectTypes: {},
|
|
64
|
-
ontology: {
|
|
65
|
-
apiName,
|
|
66
|
-
description: `${apiName} ontology desc`,
|
|
67
|
-
displayName: `${apiName} ontology dn`,
|
|
68
|
-
rid: `${apiName} ontology rid`
|
|
69
|
-
},
|
|
70
|
-
queryTypes: {},
|
|
71
|
-
sharedPropertyTypes,
|
|
72
|
-
valueTypes: {}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
|
|
76
|
-
it("Does not say (inherited) on properties locally defined", async () => {
|
|
77
|
-
const ontology = enhanceOntology({
|
|
78
|
-
sanitized: simpleOntology("ontology", [simpleInterface("Bar", [simpleSpt("bar", 0)], [], 0)]),
|
|
79
|
-
importExt: ""
|
|
80
|
-
});
|
|
81
|
-
expect(ontology.interfaceTypes.Bar instanceof EnhancedInterfaceType).toBe(true);
|
|
82
|
-
|
|
83
|
-
// type guard for below
|
|
84
|
-
if (ontology.interfaceTypes.Bar instanceof ForeignType) {
|
|
85
|
-
throw new Error("Expected Bar to be an EnhancedInterfaceType");
|
|
86
|
-
}
|
|
87
|
-
const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Bar, ontology, true, true), {
|
|
88
|
-
parser: "typescript",
|
|
89
|
-
printWidth: 100
|
|
90
|
-
});
|
|
91
|
-
expect(formattedCode).toMatchInlineSnapshot(`
|
|
92
|
-
"import type {
|
|
93
|
-
InterfaceDefinition as $InterfaceDefinition,
|
|
94
|
-
InterfaceMetadata as $InterfaceMetadata,
|
|
95
|
-
ObjectSet as $ObjectSet,
|
|
96
|
-
Osdk as $Osdk,
|
|
97
|
-
PropertyValueWireToClient as $PropType,
|
|
98
|
-
} from "@osdk/api";
|
|
99
|
-
|
|
100
|
-
export type OsdkObjectLinks$Bar = {};
|
|
101
|
-
|
|
102
|
-
export namespace Bar {
|
|
103
|
-
export type PropertyKeys = "bar";
|
|
104
|
-
|
|
105
|
-
export interface Props {
|
|
106
|
-
/**
|
|
107
|
-
* (no ontology metadata)
|
|
108
|
-
*/
|
|
109
|
-
readonly bar: $PropType["integer"] | undefined;
|
|
110
|
-
}
|
|
111
|
-
export type StrictProps = Props;
|
|
112
|
-
|
|
113
|
-
export interface ObjectSet extends $ObjectSet<Bar, Bar.ObjectSet> {}
|
|
114
|
-
|
|
115
|
-
export type OsdkInstance<
|
|
116
|
-
OPTIONS extends never | "$rid" = never,
|
|
117
|
-
K extends keyof Bar.Props = keyof Bar.Props,
|
|
118
|
-
> = $Osdk.Instance<Bar, OPTIONS, K>;
|
|
119
|
-
|
|
120
|
-
/** @deprecated use OsdkInstance */
|
|
121
|
-
export type OsdkObject<
|
|
122
|
-
OPTIONS extends never | "$rid" = never,
|
|
123
|
-
K extends keyof Bar.Props = keyof Bar.Props,
|
|
124
|
-
> = OsdkInstance<OPTIONS, K>;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface Bar extends $InterfaceDefinition {
|
|
128
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
129
|
-
type: "interface";
|
|
130
|
-
apiName: "Bar";
|
|
131
|
-
__DefinitionMetadata?: {
|
|
132
|
-
objectSet: Bar.ObjectSet;
|
|
133
|
-
props: Bar.Props;
|
|
134
|
-
linksType: OsdkObjectLinks$Bar;
|
|
135
|
-
strictProps: Bar.StrictProps;
|
|
136
|
-
apiName: "Bar";
|
|
137
|
-
description: undefined;
|
|
138
|
-
displayName: "Bar";
|
|
139
|
-
implementedBy: [];
|
|
140
|
-
implements: [];
|
|
141
|
-
links: {};
|
|
142
|
-
properties: {
|
|
143
|
-
/**
|
|
144
|
-
* (no ontology metadata)
|
|
145
|
-
*/
|
|
146
|
-
bar: $PropertyDef<"integer", "nullable", "single">;
|
|
147
|
-
};
|
|
148
|
-
rid: "BarRid";
|
|
149
|
-
type: "interface";
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export const Bar = {
|
|
154
|
-
type: "interface",
|
|
155
|
-
apiName: "Bar",
|
|
156
|
-
osdkMetadata: $osdkMetadata,
|
|
157
|
-
internalDoNotUseMetadata: {
|
|
158
|
-
rid: "BarRid",
|
|
159
|
-
},
|
|
160
|
-
} satisfies Bar & { internalDoNotUseMetadata: { rid: string } } as Bar;
|
|
161
|
-
"
|
|
162
|
-
`);
|
|
163
|
-
});
|
|
164
|
-
it("Generates properties for inherited SPTs", async () => {
|
|
165
|
-
const fooSpt = simpleSpt("foo");
|
|
166
|
-
const barSpt = simpleSpt("bar");
|
|
167
|
-
const ontology = enhanceOntology({
|
|
168
|
-
sanitized: simpleOntology("ontology", [simpleInterface("Foo", [fooSpt], ["Parent"]), simpleInterface("Parent", [barSpt], [])]),
|
|
169
|
-
importExt: ""
|
|
170
|
-
});
|
|
171
|
-
const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, true, true), {
|
|
172
|
-
parser: "typescript"
|
|
173
|
-
});
|
|
174
|
-
expect(formattedCode).toMatchInlineSnapshot(`
|
|
175
|
-
"import type {
|
|
176
|
-
InterfaceDefinition as $InterfaceDefinition,
|
|
177
|
-
InterfaceMetadata as $InterfaceMetadata,
|
|
178
|
-
ObjectSet as $ObjectSet,
|
|
179
|
-
Osdk as $Osdk,
|
|
180
|
-
PropertyValueWireToClient as $PropType,
|
|
181
|
-
} from "@osdk/api";
|
|
182
|
-
|
|
183
|
-
export type OsdkObjectLinks$Foo = {};
|
|
184
|
-
|
|
185
|
-
export namespace Foo {
|
|
186
|
-
export type PropertyKeys = "foo";
|
|
187
|
-
|
|
188
|
-
export interface Props {
|
|
189
|
-
/**
|
|
190
|
-
* display name: 'foo property dn',
|
|
191
|
-
*
|
|
192
|
-
* description: foo property desc
|
|
193
|
-
*/
|
|
194
|
-
readonly foo: $PropType["integer"] | undefined;
|
|
195
|
-
}
|
|
196
|
-
export type StrictProps = Props;
|
|
197
|
-
|
|
198
|
-
export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}
|
|
199
|
-
|
|
200
|
-
export type OsdkInstance<
|
|
201
|
-
OPTIONS extends never | "$rid" = never,
|
|
202
|
-
K extends keyof Foo.Props = keyof Foo.Props,
|
|
203
|
-
> = $Osdk.Instance<Foo, OPTIONS, K>;
|
|
204
|
-
|
|
205
|
-
/** @deprecated use OsdkInstance */
|
|
206
|
-
export type OsdkObject<
|
|
207
|
-
OPTIONS extends never | "$rid" = never,
|
|
208
|
-
K extends keyof Foo.Props = keyof Foo.Props,
|
|
209
|
-
> = OsdkInstance<OPTIONS, K>;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export interface Foo extends $InterfaceDefinition {
|
|
213
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
214
|
-
type: "interface";
|
|
215
|
-
apiName: "Foo";
|
|
216
|
-
__DefinitionMetadata?: {
|
|
217
|
-
objectSet: Foo.ObjectSet;
|
|
218
|
-
props: Foo.Props;
|
|
219
|
-
linksType: OsdkObjectLinks$Foo;
|
|
220
|
-
strictProps: Foo.StrictProps;
|
|
221
|
-
apiName: "Foo";
|
|
222
|
-
description: "Foo interface desc";
|
|
223
|
-
displayName: "Foo interface dn";
|
|
224
|
-
implementedBy: [];
|
|
225
|
-
implements: ["Parent"];
|
|
226
|
-
links: {};
|
|
227
|
-
properties: {
|
|
228
|
-
/**
|
|
229
|
-
* display name: 'foo property dn',
|
|
230
|
-
*
|
|
231
|
-
* description: foo property desc
|
|
232
|
-
*/
|
|
233
|
-
foo: $PropertyDef<"integer", "nullable", "single">;
|
|
234
|
-
};
|
|
235
|
-
rid: "FooRid";
|
|
236
|
-
type: "interface";
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export const Foo = {
|
|
241
|
-
type: "interface",
|
|
242
|
-
apiName: "Foo",
|
|
243
|
-
osdkMetadata: $osdkMetadata,
|
|
244
|
-
internalDoNotUseMetadata: {
|
|
245
|
-
rid: "FooRid",
|
|
246
|
-
},
|
|
247
|
-
} satisfies Foo & { internalDoNotUseMetadata: { rid: string } } as Foo;
|
|
248
|
-
"
|
|
249
|
-
`);
|
|
250
|
-
});
|
|
251
|
-
it("allows for SPT reuse if the same", async () => {
|
|
252
|
-
const fooSpt = simpleSpt("foo");
|
|
253
|
-
const barSpt = simpleSpt("bar");
|
|
254
|
-
const ontology = enhanceOntology({
|
|
255
|
-
sanitized: simpleOntology("ontology", [simpleInterface("Foo", [fooSpt, barSpt], ["Parent"]), simpleInterface("Parent", [barSpt], [])]),
|
|
256
|
-
importExt: ""
|
|
257
|
-
});
|
|
258
|
-
const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, true, true), {
|
|
259
|
-
parser: "typescript"
|
|
260
|
-
});
|
|
261
|
-
expect(formattedCode).toMatchInlineSnapshot(`
|
|
262
|
-
"import type {
|
|
263
|
-
InterfaceDefinition as $InterfaceDefinition,
|
|
264
|
-
InterfaceMetadata as $InterfaceMetadata,
|
|
265
|
-
ObjectSet as $ObjectSet,
|
|
266
|
-
Osdk as $Osdk,
|
|
267
|
-
PropertyValueWireToClient as $PropType,
|
|
268
|
-
} from "@osdk/api";
|
|
269
|
-
|
|
270
|
-
export type OsdkObjectLinks$Foo = {};
|
|
271
|
-
|
|
272
|
-
export namespace Foo {
|
|
273
|
-
export type PropertyKeys = "foo" | "bar";
|
|
274
|
-
|
|
275
|
-
export interface Props {
|
|
276
|
-
/**
|
|
277
|
-
* display name: 'bar property dn',
|
|
278
|
-
*
|
|
279
|
-
* description: bar property desc
|
|
280
|
-
*/
|
|
281
|
-
readonly bar: $PropType["integer"] | undefined;
|
|
282
|
-
/**
|
|
283
|
-
* display name: 'foo property dn',
|
|
284
|
-
*
|
|
285
|
-
* description: foo property desc
|
|
286
|
-
*/
|
|
287
|
-
readonly foo: $PropType["integer"] | undefined;
|
|
288
|
-
}
|
|
289
|
-
export type StrictProps = Props;
|
|
290
|
-
|
|
291
|
-
export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}
|
|
292
|
-
|
|
293
|
-
export type OsdkInstance<
|
|
294
|
-
OPTIONS extends never | "$rid" = never,
|
|
295
|
-
K extends keyof Foo.Props = keyof Foo.Props,
|
|
296
|
-
> = $Osdk.Instance<Foo, OPTIONS, K>;
|
|
297
|
-
|
|
298
|
-
/** @deprecated use OsdkInstance */
|
|
299
|
-
export type OsdkObject<
|
|
300
|
-
OPTIONS extends never | "$rid" = never,
|
|
301
|
-
K extends keyof Foo.Props = keyof Foo.Props,
|
|
302
|
-
> = OsdkInstance<OPTIONS, K>;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export interface Foo extends $InterfaceDefinition {
|
|
306
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
307
|
-
type: "interface";
|
|
308
|
-
apiName: "Foo";
|
|
309
|
-
__DefinitionMetadata?: {
|
|
310
|
-
objectSet: Foo.ObjectSet;
|
|
311
|
-
props: Foo.Props;
|
|
312
|
-
linksType: OsdkObjectLinks$Foo;
|
|
313
|
-
strictProps: Foo.StrictProps;
|
|
314
|
-
apiName: "Foo";
|
|
315
|
-
description: "Foo interface desc";
|
|
316
|
-
displayName: "Foo interface dn";
|
|
317
|
-
implementedBy: [];
|
|
318
|
-
implements: ["Parent"];
|
|
319
|
-
links: {};
|
|
320
|
-
properties: {
|
|
321
|
-
/**
|
|
322
|
-
* display name: 'bar property dn',
|
|
323
|
-
*
|
|
324
|
-
* description: bar property desc
|
|
325
|
-
*/
|
|
326
|
-
bar: $PropertyDef<"integer", "nullable", "single">;
|
|
327
|
-
/**
|
|
328
|
-
* display name: 'foo property dn',
|
|
329
|
-
*
|
|
330
|
-
* description: foo property desc
|
|
331
|
-
*/
|
|
332
|
-
foo: $PropertyDef<"integer", "nullable", "single">;
|
|
333
|
-
};
|
|
334
|
-
rid: "FooRid";
|
|
335
|
-
type: "interface";
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export const Foo = {
|
|
340
|
-
type: "interface",
|
|
341
|
-
apiName: "Foo",
|
|
342
|
-
osdkMetadata: $osdkMetadata,
|
|
343
|
-
internalDoNotUseMetadata: {
|
|
344
|
-
rid: "FooRid",
|
|
345
|
-
},
|
|
346
|
-
} satisfies Foo & { internalDoNotUseMetadata: { rid: string } } as Foo;
|
|
347
|
-
"
|
|
348
|
-
`);
|
|
349
|
-
});
|
|
350
|
-
it("Generates map for implementedBy", async () => {
|
|
351
|
-
const fooSpt = simpleSpt("foo");
|
|
352
|
-
const barSpt = simpleSpt("bar");
|
|
353
|
-
const ontology = enhanceOntology({
|
|
354
|
-
sanitized: simpleOntology("ontology", [simpleInterface("Foo", [fooSpt], ["Parent"], 2, ["childrenObject"]), simpleInterface("Parent", [barSpt], [])]),
|
|
355
|
-
importExt: ""
|
|
356
|
-
});
|
|
357
|
-
const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, true, true), {
|
|
358
|
-
parser: "typescript"
|
|
359
|
-
});
|
|
360
|
-
expect(formattedCode).toMatchInlineSnapshot(`
|
|
361
|
-
"import type {
|
|
362
|
-
InterfaceDefinition as $InterfaceDefinition,
|
|
363
|
-
InterfaceMetadata as $InterfaceMetadata,
|
|
364
|
-
ObjectSet as $ObjectSet,
|
|
365
|
-
Osdk as $Osdk,
|
|
366
|
-
PropertyValueWireToClient as $PropType,
|
|
367
|
-
} from "@osdk/api";
|
|
368
|
-
|
|
369
|
-
export type OsdkObjectLinks$Foo = {};
|
|
370
|
-
|
|
371
|
-
export namespace Foo {
|
|
372
|
-
export type PropertyKeys = "foo";
|
|
373
|
-
|
|
374
|
-
export interface Props {
|
|
375
|
-
/**
|
|
376
|
-
* display name: 'foo property dn',
|
|
377
|
-
*
|
|
378
|
-
* description: foo property desc
|
|
379
|
-
*/
|
|
380
|
-
readonly foo: $PropType["integer"] | undefined;
|
|
381
|
-
}
|
|
382
|
-
export type StrictProps = Props;
|
|
383
|
-
|
|
384
|
-
export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}
|
|
385
|
-
|
|
386
|
-
export type OsdkInstance<
|
|
387
|
-
OPTIONS extends never | "$rid" = never,
|
|
388
|
-
K extends keyof Foo.Props = keyof Foo.Props,
|
|
389
|
-
> = $Osdk.Instance<Foo, OPTIONS, K>;
|
|
390
|
-
|
|
391
|
-
/** @deprecated use OsdkInstance */
|
|
392
|
-
export type OsdkObject<
|
|
393
|
-
OPTIONS extends never | "$rid" = never,
|
|
394
|
-
K extends keyof Foo.Props = keyof Foo.Props,
|
|
395
|
-
> = OsdkInstance<OPTIONS, K>;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
export interface Foo extends $InterfaceDefinition {
|
|
399
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
400
|
-
type: "interface";
|
|
401
|
-
apiName: "Foo";
|
|
402
|
-
__DefinitionMetadata?: {
|
|
403
|
-
objectSet: Foo.ObjectSet;
|
|
404
|
-
props: Foo.Props;
|
|
405
|
-
linksType: OsdkObjectLinks$Foo;
|
|
406
|
-
strictProps: Foo.StrictProps;
|
|
407
|
-
apiName: "Foo";
|
|
408
|
-
description: "Foo interface desc";
|
|
409
|
-
displayName: "Foo interface dn";
|
|
410
|
-
implementedBy: ["childrenObject"];
|
|
411
|
-
implements: ["Parent"];
|
|
412
|
-
links: {};
|
|
413
|
-
properties: {
|
|
414
|
-
/**
|
|
415
|
-
* display name: 'foo property dn',
|
|
416
|
-
*
|
|
417
|
-
* description: foo property desc
|
|
418
|
-
*/
|
|
419
|
-
foo: $PropertyDef<"integer", "nullable", "single">;
|
|
420
|
-
};
|
|
421
|
-
rid: "FooRid";
|
|
422
|
-
type: "interface";
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
export const Foo = {
|
|
427
|
-
type: "interface",
|
|
428
|
-
apiName: "Foo",
|
|
429
|
-
osdkMetadata: $osdkMetadata,
|
|
430
|
-
internalDoNotUseMetadata: {
|
|
431
|
-
rid: "FooRid",
|
|
432
|
-
},
|
|
433
|
-
} satisfies Foo & { internalDoNotUseMetadata: { rid: string } } as Foo;
|
|
434
|
-
"
|
|
435
|
-
`);
|
|
436
|
-
});
|
|
437
|
-
it("sorts the implements array for stable output", async () => {
|
|
438
|
-
// Test with multiple parent interfaces in non-alphabetical order
|
|
439
|
-
const ontology = enhanceOntology({
|
|
440
|
-
sanitized: simpleOntology("ontology", [simpleInterface("Child", [simpleSpt("child")], ["ParentZ", "ParentA", "ParentC"]), simpleInterface("ParentZ", [simpleSpt("z")], []), simpleInterface("ParentA", [simpleSpt("a")], []), simpleInterface("ParentC", [simpleSpt("c")], [])]),
|
|
441
|
-
importExt: ""
|
|
442
|
-
});
|
|
443
|
-
const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Child, ontology, true, true), {
|
|
444
|
-
parser: "typescript"
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
// Extract the implements array from the generated code
|
|
448
|
-
const implementsMatch = formattedCode.match(/implements:\s*\[([^\]]+)\]/s);
|
|
449
|
-
expect(implementsMatch).not.toBeNull();
|
|
450
|
-
if (implementsMatch) {
|
|
451
|
-
const implementsStr = implementsMatch[1];
|
|
452
|
-
// Check that the array is sorted alphabetically
|
|
453
|
-
expect(implementsStr).toContain("\"ParentA\", \"ParentC\", \"ParentZ\"");
|
|
454
|
-
}
|
|
455
|
-
});
|
|
456
|
-
it("correctly identifies invalid properties", async () => {
|
|
457
|
-
const ontology = enhanceOntology({
|
|
458
|
-
sanitized: simpleOntology("ontology", [simpleInterface("Child", [simpleSpt("child")], []), simpleInterface("com.A.myChild", [simpleSpt("son"), simpleSpt("com.B.son"), simpleSpt("com.A.daughter")], []), simpleInterface("com.A.myChildNo", [simpleSpt("son"), simpleSpt("com.A.son"), simpleSpt("com.B.daughter")], [])]),
|
|
459
|
-
importExt: ""
|
|
460
|
-
});
|
|
461
|
-
const interfaceDefNoNamespace = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(ontology.interfaceTypes.Child.raw, false));
|
|
462
|
-
const interfaceDefWithNamespaceOk = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(ontology.interfaceTypes["com.A.myChild"].raw, false));
|
|
463
|
-
const interfaceDefWithNamespaceNotOk = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(ontology.interfaceTypes["com.A.myChildNo"].raw, false));
|
|
464
|
-
const noBadProperties = getInvalidInterfaceProperties(ontology.interfaceTypes.Child, interfaceDefNoNamespace);
|
|
465
|
-
expect(noBadProperties.length).toBe(0);
|
|
466
|
-
const noBadProperties2 = getInvalidInterfaceProperties(ontology.interfaceTypes["com.A.myChild"], interfaceDefWithNamespaceOk);
|
|
467
|
-
expect(noBadProperties2.length).toBe(0);
|
|
468
|
-
const badProperties = getInvalidInterfaceProperties(ontology.interfaceTypes["com.A.myChildNo"], interfaceDefWithNamespaceNotOk);
|
|
469
|
-
expect(badProperties.length).toBe(1);
|
|
470
|
-
});
|
|
471
|
-
});
|
|
472
|
-
//# sourceMappingURL=UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js","names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","format","describe","expect","it","EnhancedInterfaceType","enhanceOntology","ForeignType","deleteUndefineds","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","getInvalidInterfaceProperties","simpleSpt","apiName","metadataLevel","dataType","type","rid","displayName","description","undefined","simpleInterface","spts","parents","implementedByObjectTypes","properties","Object","fromEntries","map","spt","required","extendsInterfaces","links","propertiesV2","allExtendsInterfaces","allLinks","allProperties","allPropertiesV2","simpleOntology","interfaces","interfaceTypes","i","sharedPropertyTypes","flatMap","entries","actionTypes","objectTypes","ontology","queryTypes","valueTypes","sanitized","importExt","Bar","toBe","Error","formattedCode","parser","printWidth","toMatchInlineSnapshot","fooSpt","barSpt","Foo","Child","implementsMatch","match","not","toBeNull","implementsStr","toContain","interfaceDefNoNamespace","raw","interfaceDefWithNamespaceOk","interfaceDefWithNamespaceNotOk","noBadProperties","length","noBadProperties2","badProperties"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.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\nimport type {\n InterfaceType,\n SharedPropertyType,\n} from \"@osdk/foundry.ontologies\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport { format } from \"prettier\";\nimport { describe, expect, it } from \"vitest\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport type { WireOntologyDefinition } from \"../WireOntologyDefinition.js\";\nimport {\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst,\n getInvalidInterfaceProperties,\n} from \"./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js\";\n\nfunction simpleSpt<T extends string>(apiName: T, metadataLevel: 0 | 1 | 2 = 2) {\n return {\n apiName,\n dataType: {\n type: \"integer\",\n },\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} property dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} property desc` : undefined,\n } as const satisfies SharedPropertyType;\n}\n\nfunction simpleInterface<T extends string, Q extends SharedPropertyType>(\n apiName: T,\n spts: Q[],\n parents: string[],\n metadataLevel: 0 | 1 | 2 = 2,\n implementedByObjectTypes: string[] = [],\n) {\n const properties = Object.fromEntries(\n spts.map(spt => [spt.apiName, { ...spt, required: true }]),\n );\n\n return {\n apiName,\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} interface dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} interface desc` : undefined,\n extendsInterfaces: parents,\n links: {},\n properties,\n propertiesV2: {},\n implementedByObjectTypes,\n allExtendsInterfaces: parents,\n allLinks: {},\n allProperties: properties,\n allPropertiesV2: {},\n } as const satisfies InterfaceType;\n}\n\nfunction simpleOntology<I extends InterfaceType>(\n apiName: string,\n interfaces: I[],\n) {\n const interfaceTypes: Record<I[\"apiName\"], I> = Object\n .fromEntries(\n interfaces.map(i => [i.apiName, i]),\n ) as Record<string, I>;\n\n const sharedPropertyTypes: Record<string, I[\"properties\"][string]> = Object\n .fromEntries(\n interfaces.flatMap(i => Object.entries(i.properties)),\n ) as Record<string, I[\"properties\"][string]>;\n\n return {\n actionTypes: {},\n interfaceTypes,\n objectTypes: {},\n ontology: {\n apiName,\n description: `${apiName} ontology desc`,\n displayName: `${apiName} ontology dn`,\n rid: `${apiName} ontology rid`,\n },\n queryTypes: {},\n sharedPropertyTypes,\n valueTypes: {},\n } as const satisfies WireOntologyDefinition;\n}\n\ndescribe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {\n it(\"Does not say (inherited) on properties locally defined\", async () => {\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Bar\", [simpleSpt(\"bar\", 0)], [], 0),\n ]),\n importExt: \"\",\n });\n\n expect(ontology.interfaceTypes.Bar instanceof EnhancedInterfaceType).toBe(\n true,\n );\n\n // type guard for below\n if (ontology.interfaceTypes.Bar instanceof ForeignType) {\n throw new Error(\"Expected Bar to be an EnhancedInterfaceType\");\n }\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Bar,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n printWidth: 100,\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Bar = {};\n\n export namespace Bar {\n export type PropertyKeys = \"bar\";\n\n export interface Props {\n /**\n * (no ontology metadata)\n */\n readonly bar: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Bar, Bar.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = $Osdk.Instance<Bar, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Bar extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Bar\";\n __DefinitionMetadata?: {\n objectSet: Bar.ObjectSet;\n props: Bar.Props;\n linksType: OsdkObjectLinks$Bar;\n strictProps: Bar.StrictProps;\n apiName: \"Bar\";\n description: undefined;\n displayName: \"Bar\";\n implementedBy: [];\n implements: [];\n links: {};\n properties: {\n /**\n * (no ontology metadata)\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"BarRid\";\n type: \"interface\";\n };\n }\n\n export const Bar = {\n type: \"interface\",\n apiName: \"Bar\",\n osdkMetadata: $osdkMetadata,\n internalDoNotUseMetadata: {\n rid: \"BarRid\",\n },\n } satisfies Bar & { internalDoNotUseMetadata: { rid: string } } as Bar;\n \"\n `);\n });\n\n it(\"Generates properties for inherited SPTs\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\";\n\n export interface Props {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n internalDoNotUseMetadata: {\n rid: \"FooRid\",\n },\n } satisfies Foo & { internalDoNotUseMetadata: { rid: string } } as Foo;\n \"\n `);\n });\n\n it(\"allows for SPT reuse if the same\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt, barSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\" | \"bar\";\n\n export interface Props {\n /**\n * display name: 'bar property dn',\n *\n * description: bar property desc\n */\n readonly bar: $PropType[\"integer\"] | undefined;\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'bar property dn',\n *\n * description: bar property desc\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n internalDoNotUseMetadata: {\n rid: \"FooRid\",\n },\n } satisfies Foo & { internalDoNotUseMetadata: { rid: string } } as Foo;\n \"\n `);\n });\n it(\"Generates map for implementedBy\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"], 2, [\"childrenObject\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\";\n\n export interface Props {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [\"childrenObject\"];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n internalDoNotUseMetadata: {\n rid: \"FooRid\",\n },\n } satisfies Foo & { internalDoNotUseMetadata: { rid: string } } as Foo;\n \"\n `);\n });\n\n it(\"sorts the implements array for stable output\", async () => {\n // Test with multiple parent interfaces in non-alphabetical order\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Child\", [simpleSpt(\"child\")], [\n \"ParentZ\",\n \"ParentA\",\n \"ParentC\",\n ]),\n simpleInterface(\"ParentZ\", [simpleSpt(\"z\")], []),\n simpleInterface(\"ParentA\", [simpleSpt(\"a\")], []),\n simpleInterface(\"ParentC\", [simpleSpt(\"c\")], []),\n ]),\n importExt: \"\",\n });\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Child as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n\n // Extract the implements array from the generated code\n const implementsMatch = formattedCode.match(/implements:\\s*\\[([^\\]]+)\\]/s);\n expect(implementsMatch).not.toBeNull();\n\n if (implementsMatch) {\n const implementsStr = implementsMatch[1];\n // Check that the array is sorted alphabetically\n expect(implementsStr).toContain(\"\\\"ParentA\\\", \\\"ParentC\\\", \\\"ParentZ\\\"\");\n }\n });\n it(\"correctly identifies invalid properties\", async () => {\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Child\", [simpleSpt(\"child\")], []),\n simpleInterface(\"com.A.myChild\", [\n simpleSpt(\"son\"),\n simpleSpt(\"com.B.son\"),\n simpleSpt(\"com.A.daughter\"),\n ], []),\n simpleInterface(\"com.A.myChildNo\", [\n simpleSpt(\"son\"),\n simpleSpt(\"com.A.son\"),\n simpleSpt(\"com.B.daughter\"),\n ], []),\n ]),\n importExt: \"\",\n });\n\n const interfaceDefNoNamespace = deleteUndefineds(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n (ontology.interfaceTypes.Child as EnhancedInterfaceType).raw,\n false,\n ),\n );\n\n const interfaceDefWithNamespaceOk = deleteUndefineds(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n (ontology.interfaceTypes[\"com.A.myChild\"] as EnhancedInterfaceType).raw,\n false,\n ),\n );\n\n const interfaceDefWithNamespaceNotOk = deleteUndefineds(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n (ontology.interfaceTypes[\"com.A.myChildNo\"] as EnhancedInterfaceType)\n .raw,\n false,\n ),\n );\n\n const noBadProperties = getInvalidInterfaceProperties(\n ontology.interfaceTypes.Child as EnhancedInterfaceType,\n interfaceDefNoNamespace,\n );\n\n expect(noBadProperties.length).toBe(0);\n\n const noBadProperties2 = getInvalidInterfaceProperties(\n ontology.interfaceTypes[\"com.A.myChild\"] as EnhancedInterfaceType,\n interfaceDefWithNamespaceOk,\n );\n\n expect(noBadProperties2.length).toBe(0);\n\n const badProperties = getInvalidInterfaceProperties(\n ontology.interfaceTypes[\"com.A.myChildNo\"] as EnhancedInterfaceType,\n interfaceDefWithNamespaceNotOk,\n );\n\n expect(badProperties.length).toBe(1);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,SAASA,mDAAmD,QAAQ,4BAA4B;AAChG,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,qBAAqB,QAAQ,6CAA6C;AACnF,SAASC,eAAe,QAAQ,uCAAuC;AACvE,SAASC,WAAW,QAAQ,mCAAmC;AAC/D,SAASC,gBAAgB,QAAQ,6BAA6B;AAE9D,SACEC,8CAA8C,EAC9CC,6BAA6B,QACxB,mDAAmD;AAE1D,SAASC,SAASA,CAAmBC,OAAU,EAAEC,aAAwB,GAAG,CAAC,EAAE;EAC7E,OAAO;IACLD,OAAO;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EAAE;IACd,CACF,CAAC;IACDrD,MAAM,CAACmD,aAAa,CAAC,CAACG,qBAAqB,CAAC;AAChD;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;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,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFrD,EAAE,CAAC,yCAAyC,EAAE,YAAY;IACxD,MAAMsD,MAAM,GAAG/C,SAAS,CAAC,KAAK,CAAC;IAC/B,MAAMgD,MAAM,GAAGhD,SAAS,CAAC,KAAK,CAAC;IAE/B,MAAMmC,QAAQ,GAAGxC,eAAe,CAC9B;MACE2C,SAAS,EAAEZ,cAAc,CAAC,UAAU,EAAE,CACpCjB,eAAe,CAAC,KAAK,EAAE,CAACsC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAC5CtC,eAAe,CAAC,QAAQ,EAAE,CAACuC,MAAM,CAAC,EAAE,EAAE,CAAC,CACxC,CAAC;MAEFT,SAAS,EAAE;IACb,CACF,CAAC;IAED,MAAMI,aAAa,GAAG,MAAMrD,MAAM,CAChCQ,8CAA8C,CAC5CqC,QAAQ,CAACP,cAAc,CAACqB,GAAG,EAC3Bd,QAAQ,EACR,IAAI,EACJ,IACF,CAAC,EACD;MACES,MAAM,EAAE;IACV,CACF,CAAC;IACDpD,MAAM,CAACmD,aAAa,CAAC,CAACG,qBAAqB,CAAC;AAChD;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;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,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFrD,EAAE,CAAC,kCAAkC,EAAE,YAAY;IACjD,MAAMsD,MAAM,GAAG/C,SAAS,CAAC,KAAK,CAAC;IAC/B,MAAMgD,MAAM,GAAGhD,SAAS,CAAC,KAAK,CAAC;IAE/B,MAAMmC,QAAQ,GAAGxC,eAAe,CAC9B;MACE2C,SAAS,EAAEZ,cAAc,CAAC,UAAU,EAAE,CACpCjB,eAAe,CAAC,KAAK,EAAE,CAACsC,MAAM,EAAEC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EACpDvC,eAAe,CAAC,QAAQ,EAAE,CAACuC,MAAM,CAAC,EAAE,EAAE,CAAC,CACxC,CAAC;MACFT,SAAS,EAAE;IACb,CACF,CAAC;IAED,MAAMI,aAAa,GAAG,MAAMrD,MAAM,CAChCQ,8CAA8C,CAC5CqC,QAAQ,CAACP,cAAc,CAACqB,GAAG,EAC3Bd,QAAQ,EACR,IAAI,EACJ,IACF,CAAC,EACD;MACES,MAAM,EAAE;IACV,CACF,CAAC;IACDpD,MAAM,CAACmD,aAAa,CAAC,CAACG,qBAAqB,CAAC;AAChD;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;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,KAAK,CAAC;EACJ,CAAC,CAAC;EACFrD,EAAE,CAAC,iCAAiC,EAAE,YAAY;IAChD,MAAMsD,MAAM,GAAG/C,SAAS,CAAC,KAAK,CAAC;IAC/B,MAAMgD,MAAM,GAAGhD,SAAS,CAAC,KAAK,CAAC;IAE/B,MAAMmC,QAAQ,GAAGxC,eAAe,CAC9B;MACE2C,SAAS,EAAEZ,cAAc,CAAC,UAAU,EAAE,CACpCjB,eAAe,CAAC,KAAK,EAAE,CAACsC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,EACnEtC,eAAe,CAAC,QAAQ,EAAE,CAACuC,MAAM,CAAC,EAAE,EAAE,CAAC,CACxC,CAAC;MAEFT,SAAS,EAAE;IACb,CACF,CAAC;IAED,MAAMI,aAAa,GAAG,MAAMrD,MAAM,CAChCQ,8CAA8C,CAC5CqC,QAAQ,CAACP,cAAc,CAACqB,GAAG,EAC3Bd,QAAQ,EACR,IAAI,EACJ,IACF,CAAC,EACD;MACES,MAAM,EAAE;IACV,CACF,CAAC;IACDpD,MAAM,CAACmD,aAAa,CAAC,CAACG,qBAAqB,CAAC;AAChD;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;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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