@osdk/client 2.7.0-beta.3 → 2.7.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 +13 -0
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +13 -0
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/objectSet/fetchLinksPage.js +57 -0
- package/build/browser/objectSet/fetchLinksPage.js.map +1 -0
- package/build/browser/objectSet/fetchLinksPage.test.js +102 -0
- package/build/browser/objectSet/fetchLinksPage.test.js.map +1 -0
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-WEN63HAL.cjs → chunk-ESGXYLZT.cjs} +65 -65
- package/build/cjs/{chunk-WEN63HAL.cjs.map → chunk-ESGXYLZT.cjs.map} +1 -1
- package/build/cjs/{chunk-C47MWNFV.cjs → chunk-MXNJ2KQH.cjs} +52 -2
- package/build/cjs/chunk-MXNJ2KQH.cjs.map +1 -0
- package/build/cjs/index.cjs +8 -8
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +33 -33
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +13 -0
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/objectSet/fetchLinksPage.js +57 -0
- package/build/esm/objectSet/fetchLinksPage.js.map +1 -0
- package/build/esm/objectSet/fetchLinksPage.test.js +102 -0
- package/build/esm/objectSet/fetchLinksPage.test.js.map +1 -0
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/objectSet/fetchLinksPage.d.ts +1 -0
- package/build/types/objectSet/fetchLinksPage.d.ts.map +1 -0
- package/build/types/objectSet/fetchLinksPage.test.d.ts +1 -0
- package/build/types/objectSet/fetchLinksPage.test.d.ts.map +1 -0
- package/package.json +5 -5
- package/build/cjs/chunk-C47MWNFV.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchLinksPage.js","names":["OntologiesV2","fetchLinksPage","client","objectType","objectSet","links","type","Error","ontologyProvider","getObjectDefinition","apiName","catch","result","OntologyObjectSets","loadLinks","ontologyRid","branch","preview","remapLinksPage","wireLinksPage","data","flatMap","sourceObject","linkedObjects","map","targetObject","linkType","source","remapObjectLocator","target","wireObjectLocator","$apiName","__apiName","$primaryKey","__primaryKey"],"sources":["fetchLinksPage.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n FetchLinksPageResult,\n LinkTypeApiNamesFor,\n ObjectIdentifiers,\n ObjectOrInterfaceDefinition,\n} from \"@osdk/api\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\n\n/** @internal */\nexport const fetchLinksPage = async <\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPES extends LinkTypeApiNamesFor<Q>,\n>(\n client: MinimalClient,\n objectType: Q,\n objectSet: OntologiesV2.ObjectSet,\n links: LINK_TYPES[],\n): Promise<FetchLinksPageResult<Q, LINK_TYPES>> => {\n if (objectType.type === \"interface\") {\n throw new Error(\"Interface object sets are not supported yet.\");\n }\n\n void client.ontologyProvider.getObjectDefinition(objectType.apiName).catch(\n () => {},\n );\n\n const result = await OntologiesV2.OntologyObjectSets.loadLinks(\n client,\n await client.ontologyRid,\n {\n objectSet,\n links,\n },\n { branch: client.branch, preview: true },\n );\n\n return remapLinksPage(result);\n};\n\n/** @internal */\nexport const remapLinksPage = <\n Q extends ObjectOrInterfaceDefinition,\n LINK_TYPES extends LinkTypeApiNamesFor<Q>,\n>(\n wireLinksPage: OntologiesV2.LoadObjectSetLinksResponseV2,\n): FetchLinksPageResult<Q, LINK_TYPES> => {\n return {\n ...wireLinksPage,\n data: wireLinksPage.data.flatMap(({ sourceObject, linkedObjects }) =>\n linkedObjects.map(({ targetObject, linkType }) => ({\n source: remapObjectLocator(sourceObject!),\n target: remapObjectLocator(targetObject!),\n linkType: linkType! as LINK_TYPES,\n }))\n ),\n };\n};\n\n/** @internal */\nexport const remapObjectLocator = <Q extends ObjectOrInterfaceDefinition>(\n wireObjectLocator: OntologiesV2.OntologyObjectV2,\n): ObjectIdentifiers<Q> => ({\n $apiName: wireObjectLocator.__apiName,\n $primaryKey: wireObjectLocator.__primaryKey,\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAO,KAAKA,YAAY,MAAM,0BAA0B;AAGxD;AACA,OAAO,MAAMC,cAAc,GAAG,MAAAA,CAI5BC,MAAqB,EACrBC,UAAa,EACbC,SAAiC,EACjCC,KAAmB,KAC8B;EACjD,IAAIF,UAAU,CAACG,IAAI,KAAK,WAAW,EAAE;IACnC,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EACjE;EAEA,KAAKL,MAAM,CAACM,gBAAgB,CAACC,mBAAmB,CAACN,UAAU,CAACO,OAAO,CAAC,CAACC,KAAK,CACxE,MAAM,CAAC,CACT,CAAC;EAED,MAAMC,MAAM,GAAG,MAAMZ,YAAY,CAACa,kBAAkB,CAACC,SAAS,CAC5DZ,MAAM,EACN,MAAMA,MAAM,CAACa,WAAW,EACxB;IACEX,SAAS;IACTC;EACF,CAAC,EACD;IAAEW,MAAM,EAAEd,MAAM,CAACc,MAAM;IAAEC,OAAO,EAAE;EAAK,CACzC,CAAC;EAED,OAAOC,cAAc,CAACN,MAAM,CAAC;AAC/B,CAAC;;AAED;AACA,OAAO,MAAMM,cAAc,GAIzBC,aAAwD,IAChB;EACxC,OAAO;IACL,GAAGA,aAAa;IAChBC,IAAI,EAAED,aAAa,CAACC,IAAI,CAACC,OAAO,CAAC,CAAC;MAAEC,YAAY;MAAEC;IAAc,CAAC,KAC/DA,aAAa,CAACC,GAAG,CAAC,CAAC;MAAEC,YAAY;MAAEC;IAAS,CAAC,MAAM;MACjDC,MAAM,EAAEC,kBAAkB,CAACN,YAAa,CAAC;MACzCO,MAAM,EAAED,kBAAkB,CAACH,YAAa,CAAC;MACzCC,QAAQ,EAAEA;IACZ,CAAC,CAAC,CACJ;EACF,CAAC;AACH,CAAC;;AAED;AACA,OAAO,MAAME,kBAAkB,GAC7BE,iBAAgD,KACtB;EAC1BC,QAAQ,EAAED,iBAAiB,CAACE,SAAS;EACrCC,WAAW,EAAEH,iBAAiB,CAACI;AACjC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
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 { describe, expect, it } from "vitest";
|
|
18
|
+
import { remapLinksPage, remapObjectLocator } from "./fetchLinksPage.js";
|
|
19
|
+
describe("remapObjectLocator", () => {
|
|
20
|
+
it("works", () => {
|
|
21
|
+
expect(remapObjectLocator({
|
|
22
|
+
__apiName: "Foo",
|
|
23
|
+
__primaryKey: "bar",
|
|
24
|
+
prop: "BAZ"
|
|
25
|
+
})).toEqual({
|
|
26
|
+
$apiName: "Foo",
|
|
27
|
+
$primaryKey: "bar"
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe("remapLinksPage", () => {
|
|
32
|
+
it("works", () => {
|
|
33
|
+
expect(remapLinksPage({
|
|
34
|
+
nextPageToken: "foo",
|
|
35
|
+
data: [{
|
|
36
|
+
sourceObject: {
|
|
37
|
+
__apiName: "Object",
|
|
38
|
+
__primaryKey: 0
|
|
39
|
+
},
|
|
40
|
+
linkedObjects: [{
|
|
41
|
+
targetObject: {
|
|
42
|
+
__apiName: "LinkedObject",
|
|
43
|
+
__primaryKey: 1
|
|
44
|
+
},
|
|
45
|
+
linkType: "link"
|
|
46
|
+
}]
|
|
47
|
+
}, {
|
|
48
|
+
sourceObject: {
|
|
49
|
+
__apiName: "Object",
|
|
50
|
+
__primaryKey: 1
|
|
51
|
+
},
|
|
52
|
+
linkedObjects: [{
|
|
53
|
+
targetObject: {
|
|
54
|
+
__apiName: "LinkedObject",
|
|
55
|
+
__primaryKey: 2
|
|
56
|
+
},
|
|
57
|
+
linkType: "link"
|
|
58
|
+
}, {
|
|
59
|
+
targetObject: {
|
|
60
|
+
__apiName: "LinkedObject",
|
|
61
|
+
__primaryKey: 3
|
|
62
|
+
},
|
|
63
|
+
linkType: "link"
|
|
64
|
+
}]
|
|
65
|
+
}]
|
|
66
|
+
})).toEqual({
|
|
67
|
+
nextPageToken: "foo",
|
|
68
|
+
data: [{
|
|
69
|
+
source: {
|
|
70
|
+
$apiName: "Object",
|
|
71
|
+
$primaryKey: 0
|
|
72
|
+
},
|
|
73
|
+
target: {
|
|
74
|
+
$apiName: "LinkedObject",
|
|
75
|
+
$primaryKey: 1
|
|
76
|
+
},
|
|
77
|
+
linkType: "link"
|
|
78
|
+
}, {
|
|
79
|
+
source: {
|
|
80
|
+
$apiName: "Object",
|
|
81
|
+
$primaryKey: 1
|
|
82
|
+
},
|
|
83
|
+
target: {
|
|
84
|
+
$apiName: "LinkedObject",
|
|
85
|
+
$primaryKey: 2
|
|
86
|
+
},
|
|
87
|
+
linkType: "link"
|
|
88
|
+
}, {
|
|
89
|
+
source: {
|
|
90
|
+
$apiName: "Object",
|
|
91
|
+
$primaryKey: 1
|
|
92
|
+
},
|
|
93
|
+
target: {
|
|
94
|
+
$apiName: "LinkedObject",
|
|
95
|
+
$primaryKey: 3
|
|
96
|
+
},
|
|
97
|
+
linkType: "link"
|
|
98
|
+
}]
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=fetchLinksPage.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchLinksPage.test.js","names":["describe","expect","it","remapLinksPage","remapObjectLocator","__apiName","__primaryKey","prop","toEqual","$apiName","$primaryKey","nextPageToken","data","sourceObject","linkedObjects","targetObject","linkType","source","target"],"sources":["fetchLinksPage.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 { describe, expect, it } from \"vitest\";\nimport { remapLinksPage, remapObjectLocator } from \"./fetchLinksPage.js\";\n\ndescribe(\"remapObjectLocator\", () => {\n it(\"works\", () => {\n expect(\n remapObjectLocator({\n __apiName: \"Foo\",\n __primaryKey: \"bar\",\n prop: \"BAZ\",\n }),\n ).toEqual({ $apiName: \"Foo\", $primaryKey: \"bar\" });\n });\n});\n\ndescribe(\"remapLinksPage\", () => {\n it(\"works\", () => {\n expect(\n remapLinksPage({\n nextPageToken: \"foo\",\n data: [\n {\n sourceObject: { __apiName: \"Object\", __primaryKey: 0 },\n linkedObjects: [\n {\n targetObject: { __apiName: \"LinkedObject\", __primaryKey: 1 },\n linkType: \"link\",\n },\n ],\n },\n {\n sourceObject: { __apiName: \"Object\", __primaryKey: 1 },\n linkedObjects: [\n {\n targetObject: { __apiName: \"LinkedObject\", __primaryKey: 2 },\n linkType: \"link\",\n },\n {\n targetObject: { __apiName: \"LinkedObject\", __primaryKey: 3 },\n linkType: \"link\",\n },\n ],\n },\n ],\n }),\n ).toEqual({\n nextPageToken: \"foo\",\n data: [\n {\n source: { $apiName: \"Object\", $primaryKey: 0 },\n target: { $apiName: \"LinkedObject\", $primaryKey: 1 },\n linkType: \"link\",\n },\n {\n source: { $apiName: \"Object\", $primaryKey: 1 },\n target: { $apiName: \"LinkedObject\", $primaryKey: 2 },\n linkType: \"link\",\n },\n {\n source: { $apiName: \"Object\", $primaryKey: 1 },\n target: { $apiName: \"LinkedObject\", $primaryKey: 3 },\n linkType: \"link\",\n },\n ],\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,cAAc,EAAEC,kBAAkB,QAAQ,qBAAqB;AAExEJ,QAAQ,CAAC,oBAAoB,EAAE,MAAM;EACnCE,EAAE,CAAC,OAAO,EAAE,MAAM;IAChBD,MAAM,CACJG,kBAAkB,CAAC;MACjBC,SAAS,EAAE,KAAK;MAChBC,YAAY,EAAE,KAAK;MACnBC,IAAI,EAAE;IACR,CAAC,CACH,CAAC,CAACC,OAAO,CAAC;MAAEC,QAAQ,EAAE,KAAK;MAAEC,WAAW,EAAE;IAAM,CAAC,CAAC;EACpD,CAAC,CAAC;AACJ,CAAC,CAAC;AAEFV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AEC,WAAW,EAAE;QAAE,CAAC;QAC9CQ,MAAM,EAAE;UAAET,QAAQ,EAAE,cAAc;UAAEC,WAAW,EAAE;QAAE,CAAC;QACpDM,QAAQ,EAAE;MACZ,CAAC;IAEL,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export const USER_AGENT = `osdk-client/${"2.7.0-beta.
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.7.0-beta.
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.7.0-beta.4"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.7.0-beta.4"}`;
|
|
19
19
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../src/objectSet/fetchLinksPage.ts"],"version":3,"file":"fetchLinksPage.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../src/objectSet/fetchLinksPage.test.ts"],"version":3,"file":"fetchLinksPage.test.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/client",
|
|
3
|
-
"version": "2.7.0-beta.
|
|
3
|
+
"version": "2.7.0-beta.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"tiny-invariant": "^1.3.3",
|
|
76
76
|
"type-fest": "^4.41.0",
|
|
77
77
|
"ws": "^8.18.3",
|
|
78
|
-
"@osdk/api": "2.7.0-beta.
|
|
79
|
-
"@osdk/client.unstable": "2.7.0-beta.
|
|
78
|
+
"@osdk/api": "2.7.0-beta.4",
|
|
79
|
+
"@osdk/client.unstable": "2.7.0-beta.4",
|
|
80
80
|
"@osdk/shared.client.impl": "~1.7.0-beta.1",
|
|
81
|
-
"@osdk/generator-converters": "2.7.0-beta.
|
|
81
|
+
"@osdk/generator-converters": "2.7.0-beta.4",
|
|
82
82
|
"@osdk/shared.net.errors": "~2.7.0-beta.1",
|
|
83
83
|
"@osdk/shared.net.fetch": "~1.7.0-beta.1"
|
|
84
84
|
},
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"typescript": "~5.5.4",
|
|
103
103
|
"zod": "^3.25.76",
|
|
104
104
|
"@osdk/monorepo.api-extractor": "~0.6.0-beta.1",
|
|
105
|
-
"@osdk/client.test.ontology": "~2.7.0-beta.
|
|
105
|
+
"@osdk/client.test.ontology": "~2.7.0-beta.4",
|
|
106
106
|
"@osdk/monorepo.tsconfig": "~0.6.0-beta.1",
|
|
107
107
|
"@osdk/shared.test": "~2.7.0-beta.2"
|
|
108
108
|
},
|