@osdk/client 2.12.0-main-19b791320004e4dd08af9a4e4d30e8fc1f7e721a → 2.12.0
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 +11 -7
- package/build/browser/createMediaFromReference.js +0 -7
- package/build/browser/createMediaFromReference.js.map +1 -1
- package/build/browser/public/internal.js +1 -0
- package/build/browser/public/internal.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-YK5RVTEC.cjs → chunk-4J6HDU2R.cjs} +40 -73
- package/build/cjs/chunk-4J6HDU2R.cjs.map +1 -0
- package/build/cjs/{chunk-O4KK7ULK.cjs → chunk-MAG62XQ4.cjs} +37 -2
- package/build/cjs/chunk-MAG62XQ4.cjs.map +1 -0
- package/build/cjs/index.cjs +10 -10
- package/build/cjs/public/internal.cjs +13 -8
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/internal.d.cts +52 -3
- package/build/cjs/public/unstable-do-not-use.cjs +74 -74
- package/build/esm/createMediaFromReference.js +0 -7
- package/build/esm/createMediaFromReference.js.map +1 -1
- package/build/esm/public/internal.js +1 -0
- package/build/esm/public/internal.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/createMediaFromReference.d.ts +3 -1
- package/build/types/createMediaFromReference.d.ts.map +1 -1
- package/build/types/public/internal.d.ts +1 -0
- package/build/types/public/internal.d.ts.map +1 -1
- package/package.json +7 -7
- package/build/cjs/chunk-O4KK7ULK.cjs.map +0 -1
- package/build/cjs/chunk-YK5RVTEC.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @osdk/client
|
|
2
2
|
|
|
3
|
-
## 2.12.0
|
|
3
|
+
## 2.12.0
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- 19b7913: fix link query refresh for per-pk invalidation and interface-typed targets
|
|
8
8
|
- kick `specificLink` queries from `Store.invalidateObject` so per-pk invalidation refreshes link queries (was only handled at type-level)
|
|
@@ -11,14 +11,18 @@
|
|
|
11
11
|
|
|
12
12
|
- 01fbb74: fix infinite re-render loop when passing inline withProperties RDPs to useOsdkObjects, useObjectSet, and useOsdkAggregation
|
|
13
13
|
- df1a4f8: Normalize `baseUrl` inside `createSharedClientContext` so it always ends with `/`, enabling RFC 3986-correct URL resolution at call sites. `createPlatformClient` and `createMinimalClient` rely on this normalization instead of duplicating it.
|
|
14
|
+
- 46a00bc: Export `createMediaFromReference` from `@osdk/client/internal` for hydrating a `Media` object from a `MediaReference` outside of an object property context.
|
|
14
15
|
- 267f324: warn and ignore streamUpdates when combined with withProperties
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
15
19
|
- Updated dependencies [91f34a9]
|
|
16
20
|
- Updated dependencies [df1a4f8]
|
|
17
|
-
- @osdk/api@2.12.0
|
|
18
|
-
- @osdk/shared.client.impl@1.
|
|
19
|
-
- @osdk/generator-converters@2.12.0
|
|
20
|
-
- @osdk/shared.test@2.
|
|
21
|
-
- @osdk/client.unstable@2.12.0
|
|
21
|
+
- @osdk/api@2.12.0
|
|
22
|
+
- @osdk/shared.client.impl@1.11.0
|
|
23
|
+
- @osdk/generator-converters@2.12.0
|
|
24
|
+
- @osdk/shared.test@2.10.0
|
|
25
|
+
- @osdk/client.unstable@2.12.0
|
|
22
26
|
|
|
23
27
|
## 2.11.0
|
|
24
28
|
|
|
@@ -16,13 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
import { MediaSets } from "@osdk/foundry.mediasets";
|
|
18
18
|
import invariant from "tiny-invariant";
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
* Creates a Media object from a MediaReference for query results.
|
|
22
|
-
* Unlike MediaReferencePropertyImpl, this doesn't require object context
|
|
23
|
-
* and directly accesses the media set APIs. This is intended for MediaReferences returned
|
|
24
|
-
* from query results or to be used by the functions runtime,
|
|
25
|
-
*/
|
|
26
19
|
export function createMediaFromReference(client, mediaReference) {
|
|
27
20
|
const {
|
|
28
21
|
mediaSetRid,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMediaFromReference.js","names":["MediaSets","invariant","createMediaFromReference","client","mediaReference","mediaSetRid","mediaItemRid","reference","mediaSetViewItem","token","fetchContents","read","preview","ReadToken","undefined","fetchMetadata","info","sizeBytes","process","env","NODE_ENV","mimeType","path","mediaType","getMediaReference"],"sources":["createMediaFromReference.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 { Media, MediaMetadata, MediaReference } from \"@osdk/api\";\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\n\
|
|
1
|
+
{"version":3,"file":"createMediaFromReference.js","names":["MediaSets","invariant","createMediaFromReference","client","mediaReference","mediaSetRid","mediaItemRid","reference","mediaSetViewItem","token","fetchContents","read","preview","ReadToken","undefined","fetchMetadata","info","sizeBytes","process","env","NODE_ENV","mimeType","path","mediaType","getMediaReference"],"sources":["createMediaFromReference.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 { Media, MediaMetadata, MediaReference } from \"@osdk/api\";\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\n\nexport function createMediaFromReference(\n client: MinimalClient,\n mediaReference: MediaReference,\n): Media {\n const { mediaSetRid, mediaItemRid } =\n mediaReference.reference.mediaSetViewItem;\n const token = mediaReference.reference.mediaSetViewItem.token;\n return {\n async fetchContents(): Promise<Response> {\n return MediaSets.read(\n client,\n mediaSetRid,\n mediaItemRid,\n { preview: true },\n token ? { ReadToken: token } : undefined,\n );\n },\n\n async fetchMetadata(): Promise<MediaMetadata> {\n const info = await MediaSets.info(\n client,\n mediaSetRid,\n mediaItemRid,\n { preview: true },\n token ? { ReadToken: token } : undefined,\n );\n\n invariant(info.sizeBytes != null, \"Expected sizeBytes in media info\");\n invariant(info.mimeType != null, \"Expected mimeType in media info\");\n\n return {\n path: info.path,\n sizeBytes: info.sizeBytes,\n mediaType: info.mimeType,\n };\n },\n\n getMediaReference(): MediaReference {\n return mediaReference;\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,SAAS,QAAQ,yBAAyB;AACnD,OAAOC,SAAS,MAAM,gBAAgB;AAGtC,OAAO,SAASC,wBAAwBA,CACtCC,MAAqB,EACrBC,cAA8B,EACvB;EACP,MAAM;IAAEC,WAAW;IAAEC;EAAa,CAAC,GACjCF,cAAc,CAACG,SAAS,CAACC,gBAAgB;EAC3C,MAAMC,KAAK,GAAGL,cAAc,CAACG,SAAS,CAACC,gBAAgB,CAACC,KAAK;EAC7D,OAAO;IACL,MAAMC,aAAaA,CAAA,EAAsB;MACvC,OAAOV,SAAS,CAACW,IAAI,CACnBR,MAAM,EACNE,WAAW,EACXC,YAAY,EACZ;QAAEM,OAAO,EAAE;MAAK,CAAC,EACjBH,KAAK,GAAG;QAAEI,SAAS,EAAEJ;MAAM,CAAC,GAAGK,SACjC,CAAC;IACH,CAAC;IAED,MAAMC,aAAaA,CAAA,EAA2B;MAC5C,MAAMC,IAAI,GAAG,MAAMhB,SAAS,CAACgB,IAAI,CAC/Bb,MAAM,EACNE,WAAW,EACXC,YAAY,EACZ;QAAEM,OAAO,EAAE;MAAK,CAAC,EACjBH,KAAK,GAAG;QAAEI,SAAS,EAAEJ;MAAM,CAAC,GAAGK,SACjC,CAAC;MAED,EAAUE,IAAI,CAACC,SAAS,IAAI,IAAI,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAhCnB,SAAS,QAAyB,kCAAkC,IAApEA,SAAS;MACT,EAAUe,IAAI,CAACK,QAAQ,IAAI,IAAI,IAAAH,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAA/BnB,SAAS,QAAwB,iCAAiC,IAAlEA,SAAS;MAET,OAAO;QACLqB,IAAI,EAAEN,IAAI,CAACM,IAAI;QACfL,SAAS,EAAED,IAAI,CAACC,SAAS;QACzBM,SAAS,EAAEP,IAAI,CAACK;MAClB,CAAC;IACH,CAAC;IAEDG,iBAAiBA,CAAA,EAAmB;MAClC,OAAOpB,cAAc;IACvB;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
export { createMediaFromReference } from "../createMediaFromReference.js";
|
|
17
18
|
export { createAndFetchTempObjectSetRid } from "../public-utils/createAndFetchTempObjectSetRid.js";
|
|
18
19
|
export { hydrateAttachmentFromRid } from "../public-utils/hydrateAttachmentFromRid.js";
|
|
19
20
|
export { hydrateObjectSetFromObjectRids } from "../public-utils/hydrateObjectSetFromObjectRids.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","names":["createAndFetchTempObjectSetRid","hydrateAttachmentFromRid","hydrateObjectSetFromObjectRids","hydrateObjectSetFromRid","BrowserLogger","MinimalLogger"],"sources":["internal.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\nexport { createAndFetchTempObjectSetRid } from \"../public-utils/createAndFetchTempObjectSetRid.js\";\nexport { hydrateAttachmentFromRid } from \"../public-utils/hydrateAttachmentFromRid.js\";\nexport { hydrateObjectSetFromObjectRids } from \"../public-utils/hydrateObjectSetFromObjectRids.js\";\nexport { hydrateObjectSetFromRid } from \"../public-utils/hydrateObjectSetFromRid.js\";\n\nexport { BrowserLogger } from \"../logger/BrowserLogger.js\";\nexport { MinimalLogger } from \"../logger/MinimalLogger.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,8BAA8B,QAAQ,mDAAmD;AAClG,SAASC,wBAAwB,QAAQ,6CAA6C;AACtF,SAASC,8BAA8B,QAAQ,mDAAmD;AAClG,SAASC,uBAAuB,QAAQ,4CAA4C;AAEpF,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,aAAa,QAAQ,4BAA4B","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"internal.js","names":["createMediaFromReference","createAndFetchTempObjectSetRid","hydrateAttachmentFromRid","hydrateObjectSetFromObjectRids","hydrateObjectSetFromRid","BrowserLogger","MinimalLogger"],"sources":["internal.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\nexport { createMediaFromReference } from \"../createMediaFromReference.js\";\nexport { createAndFetchTempObjectSetRid } from \"../public-utils/createAndFetchTempObjectSetRid.js\";\nexport { hydrateAttachmentFromRid } from \"../public-utils/hydrateAttachmentFromRid.js\";\nexport { hydrateObjectSetFromObjectRids } from \"../public-utils/hydrateObjectSetFromObjectRids.js\";\nexport { hydrateObjectSetFromRid } from \"../public-utils/hydrateObjectSetFromRid.js\";\n\nexport { BrowserLogger } from \"../logger/BrowserLogger.js\";\nexport { MinimalLogger } from \"../logger/MinimalLogger.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,wBAAwB,QAAQ,gCAAgC;AACzE,SAASC,8BAA8B,QAAQ,mDAAmD;AAClG,SAASC,wBAAwB,QAAQ,6CAA6C;AACtF,SAASC,8BAA8B,QAAQ,mDAAmD;AAClG,SAASC,uBAAuB,QAAQ,4CAA4C;AAEpF,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,aAAa,QAAQ,4BAA4B","ignoreList":[]}
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export const USER_AGENT = `osdk-client/${"2.12.0
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.12.0
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.12.0"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.12.0"}`;
|
|
19
19
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.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\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.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\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,yBAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,oCAAuD","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMAG62XQ4_cjs = require('./chunk-MAG62XQ4.cjs');
|
|
4
4
|
var chunkDOXHU27E_cjs = require('./chunk-DOXHU27E.cjs');
|
|
5
5
|
var chunkYJG67XL4_cjs = require('./chunk-YJG67XL4.cjs');
|
|
6
6
|
var chunkZPLXXOU6_cjs = require('./chunk-ZPLXXOU6.cjs');
|
|
@@ -115,13 +115,13 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
115
115
|
return Promise.all(promiseArray);
|
|
116
116
|
}
|
|
117
117
|
if (isAttachmentUpload(value)) {
|
|
118
|
-
const attachment = await
|
|
118
|
+
const attachment = await chunkMAG62XQ4_cjs.upload(client, value.data, {
|
|
119
119
|
filename: value.name
|
|
120
120
|
});
|
|
121
121
|
return await toDataValue(attachment.rid, client);
|
|
122
122
|
}
|
|
123
123
|
if (isAttachmentFile(value)) {
|
|
124
|
-
const attachment = await
|
|
124
|
+
const attachment = await chunkMAG62XQ4_cjs.upload(client, value, {
|
|
125
125
|
filename: value.name
|
|
126
126
|
});
|
|
127
127
|
return await toDataValue(attachment.rid, client);
|
|
@@ -148,11 +148,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
148
148
|
if (isPoint(value)) {
|
|
149
149
|
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client);
|
|
150
150
|
}
|
|
151
|
-
if (
|
|
151
|
+
if (chunkMAG62XQ4_cjs.isWireObjectSet(value)) {
|
|
152
152
|
return value;
|
|
153
153
|
}
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
154
|
+
if (chunkMAG62XQ4_cjs.isObjectSet(value)) {
|
|
155
|
+
return chunkMAG62XQ4_cjs.getWireObjectSet(value);
|
|
156
156
|
}
|
|
157
157
|
if (isInterfaceActionParam(value)) {
|
|
158
158
|
return {
|
|
@@ -172,7 +172,7 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
172
172
|
|
|
173
173
|
// src/actions/applyAction.ts
|
|
174
174
|
async function applyAction(client, action, parameters, options = {}) {
|
|
175
|
-
const clientWithHeaders =
|
|
175
|
+
const clientWithHeaders = chunkMAG62XQ4_cjs.addUserAgentAndRequestContextHeaders(chunkMAG62XQ4_cjs.augmentRequestContext(client, (_) => ({
|
|
176
176
|
finalMethodCall: "applyAction"
|
|
177
177
|
})), action);
|
|
178
178
|
if (Array.isArray(parameters)) {
|
|
@@ -903,8 +903,8 @@ function get$link(holder) {
|
|
|
903
903
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
904
904
|
}).pivotTo(linkName);
|
|
905
905
|
const value = !linkDef.multiplicity ? {
|
|
906
|
-
fetchOne: (options) =>
|
|
907
|
-
fetchOneWithErrors: (options) =>
|
|
906
|
+
fetchOne: (options) => chunkMAG62XQ4_cjs.fetchSingle(client, objDef, options ?? {}, chunkMAG62XQ4_cjs.getWireObjectSet(objectSet)),
|
|
907
|
+
fetchOneWithErrors: (options) => chunkMAG62XQ4_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkMAG62XQ4_cjs.getWireObjectSet(objectSet))
|
|
908
908
|
} : objectSet;
|
|
909
909
|
return [linkName, value];
|
|
910
910
|
})));
|
|
@@ -927,8 +927,8 @@ function get$linkForInterface(holder) {
|
|
|
927
927
|
apiName: linkDef.targetTypeApiName
|
|
928
928
|
};
|
|
929
929
|
const value = !linkDef.multiplicity ? {
|
|
930
|
-
fetchOne: (options) =>
|
|
931
|
-
fetchOneWithErrors: (options) =>
|
|
930
|
+
fetchOne: (options) => chunkMAG62XQ4_cjs.fetchSingle(client, linkTargetDef, options ?? {}, chunkMAG62XQ4_cjs.getWireObjectSet(objectSet)),
|
|
931
|
+
fetchOneWithErrors: (options) => chunkMAG62XQ4_cjs.fetchSingleWithErrors(client, linkTargetDef, options ?? {}, chunkMAG62XQ4_cjs.getWireObjectSet(objectSet))
|
|
932
932
|
} : objectSet;
|
|
933
933
|
return [linkName, value];
|
|
934
934
|
})));
|
|
@@ -936,7 +936,7 @@ function get$linkForInterface(holder) {
|
|
|
936
936
|
|
|
937
937
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
938
938
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
939
|
-
const [objApiNamespace] =
|
|
939
|
+
const [objApiNamespace] = chunkMAG62XQ4_cjs.extractNamespace(interfaceDef.apiName);
|
|
940
940
|
return Object.freeze(Object.defineProperties({}, {
|
|
941
941
|
// first to minimize hidden classes
|
|
942
942
|
[UnderlyingOsdkObject]: {
|
|
@@ -999,7 +999,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
999
999
|
},
|
|
1000
1000
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
1001
1001
|
const objDef = underlying[ObjectDefRef];
|
|
1002
|
-
const [apiNamespace, apiName] =
|
|
1002
|
+
const [apiNamespace, apiName] = chunkMAG62XQ4_cjs.extractNamespace(p);
|
|
1003
1003
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
1004
1004
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
1005
1005
|
enumerable: targetPropName in underlying,
|
|
@@ -1174,9 +1174,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1174
1174
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1175
1175
|
case "attachment":
|
|
1176
1176
|
if (Array.isArray(rawValue)) {
|
|
1177
|
-
return rawValue.map((a) =>
|
|
1177
|
+
return rawValue.map((a) => chunkMAG62XQ4_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1178
1178
|
} else {
|
|
1179
|
-
return
|
|
1179
|
+
return chunkMAG62XQ4_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1180
1180
|
}
|
|
1181
1181
|
default:
|
|
1182
1182
|
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
@@ -1192,9 +1192,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
if (propDef.type === "attachment") {
|
|
1194
1194
|
if (Array.isArray(rawValue)) {
|
|
1195
|
-
return rawValue.map((a) =>
|
|
1195
|
+
return rawValue.map((a) => chunkMAG62XQ4_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1196
1196
|
}
|
|
1197
|
-
return
|
|
1197
|
+
return chunkMAG62XQ4_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1198
1198
|
}
|
|
1199
1199
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1200
1200
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1527,7 +1527,7 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1527
1527
|
|
|
1528
1528
|
// src/ontology/loadInterfaceMetadata.ts
|
|
1529
1529
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1530
|
-
const r = await
|
|
1530
|
+
const r = await chunkMAG62XQ4_cjs.get(client, await client.ontologyRid, objectType, {
|
|
1531
1531
|
preview: true,
|
|
1532
1532
|
branch: client.branch
|
|
1533
1533
|
});
|
|
@@ -1606,11 +1606,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1606
1606
|
};
|
|
1607
1607
|
|
|
1608
1608
|
// src/util/UserAgent.ts
|
|
1609
|
-
var USER_AGENT = `osdk-client/${"2.12.0
|
|
1610
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.12.0
|
|
1609
|
+
var USER_AGENT = `osdk-client/${"2.12.0"}`;
|
|
1610
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.12.0"}`;
|
|
1611
1611
|
|
|
1612
1612
|
// src/createMinimalClient.ts
|
|
1613
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1613
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkMAG62XQ4_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1614
1614
|
if (process.env.NODE_ENV !== "production") {
|
|
1615
1615
|
try {
|
|
1616
1616
|
new URL(baseUrl);
|
|
@@ -2197,39 +2197,6 @@ var _execute = [1, "/v2/ontologies/{0}/queries/{1}/execute", 7];
|
|
|
2197
2197
|
function execute($ctx, ...args) {
|
|
2198
2198
|
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _execute, ...args);
|
|
2199
2199
|
}
|
|
2200
|
-
function createMediaFromReference(client, mediaReference) {
|
|
2201
|
-
const {
|
|
2202
|
-
mediaSetRid,
|
|
2203
|
-
mediaItemRid
|
|
2204
|
-
} = mediaReference.reference.mediaSetViewItem;
|
|
2205
|
-
const token = mediaReference.reference.mediaSetViewItem.token;
|
|
2206
|
-
return {
|
|
2207
|
-
async fetchContents() {
|
|
2208
|
-
return chunkZPLXXOU6_cjs.MediaSet_exports.read(client, mediaSetRid, mediaItemRid, {
|
|
2209
|
-
preview: true
|
|
2210
|
-
}, token ? {
|
|
2211
|
-
ReadToken: token
|
|
2212
|
-
} : void 0);
|
|
2213
|
-
},
|
|
2214
|
-
async fetchMetadata() {
|
|
2215
|
-
const info = await chunkZPLXXOU6_cjs.MediaSet_exports.info(client, mediaSetRid, mediaItemRid, {
|
|
2216
|
-
preview: true
|
|
2217
|
-
}, token ? {
|
|
2218
|
-
ReadToken: token
|
|
2219
|
-
} : void 0);
|
|
2220
|
-
!(info.sizeBytes != null) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected sizeBytes in media info") : invariant__default.default(false) : void 0;
|
|
2221
|
-
!(info.mimeType != null) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected mimeType in media info") : invariant__default.default(false) : void 0;
|
|
2222
|
-
return {
|
|
2223
|
-
path: info.path,
|
|
2224
|
-
sizeBytes: info.sizeBytes,
|
|
2225
|
-
mediaType: info.mimeType
|
|
2226
|
-
};
|
|
2227
|
-
},
|
|
2228
|
-
getMediaReference() {
|
|
2229
|
-
return mediaReference;
|
|
2230
|
-
}
|
|
2231
|
-
};
|
|
2232
|
-
}
|
|
2233
2200
|
|
|
2234
2201
|
// src/util/toDataValueQueries.ts
|
|
2235
2202
|
async function toDataValueQueries(value, client, desiredType) {
|
|
@@ -2251,13 +2218,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
2251
2218
|
switch (desiredType.type) {
|
|
2252
2219
|
case "attachment": {
|
|
2253
2220
|
if (isAttachmentUpload(value)) {
|
|
2254
|
-
const attachment = await
|
|
2221
|
+
const attachment = await chunkMAG62XQ4_cjs.upload(client, value.data, {
|
|
2255
2222
|
filename: value.name
|
|
2256
2223
|
});
|
|
2257
2224
|
return attachment.rid;
|
|
2258
2225
|
}
|
|
2259
2226
|
if (isAttachmentFile(value)) {
|
|
2260
|
-
const attachment = await
|
|
2227
|
+
const attachment = await chunkMAG62XQ4_cjs.upload(client, value, {
|
|
2261
2228
|
filename: value.name
|
|
2262
2229
|
});
|
|
2263
2230
|
return attachment.rid;
|
|
@@ -2313,11 +2280,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
2313
2280
|
}
|
|
2314
2281
|
case "objectSet":
|
|
2315
2282
|
case "interfaceObjectSet": {
|
|
2316
|
-
if (
|
|
2283
|
+
if (chunkMAG62XQ4_cjs.isWireObjectSet(value)) {
|
|
2317
2284
|
return value;
|
|
2318
2285
|
}
|
|
2319
|
-
if (
|
|
2320
|
-
return
|
|
2286
|
+
if (chunkMAG62XQ4_cjs.isObjectSet(value)) {
|
|
2287
|
+
return chunkMAG62XQ4_cjs.getWireObjectSet(value);
|
|
2321
2288
|
}
|
|
2322
2289
|
break;
|
|
2323
2290
|
}
|
|
@@ -2362,7 +2329,7 @@ async function applyQuery(client, query, params) {
|
|
|
2362
2329
|
if (client.flushEdits != null) {
|
|
2363
2330
|
await client.flushEdits();
|
|
2364
2331
|
}
|
|
2365
|
-
const response = await execute(
|
|
2332
|
+
const response = await execute(chunkMAG62XQ4_cjs.addUserAgentAndRequestContextHeaders(chunkMAG62XQ4_cjs.augmentRequestContext(client, (_) => ({
|
|
2366
2333
|
finalMethodCall: "applyQuery"
|
|
2367
2334
|
})), query), await client.ontologyRid, query.apiName, {
|
|
2368
2335
|
parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}
|
|
@@ -2407,10 +2374,10 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2407
2374
|
return responseValue;
|
|
2408
2375
|
}
|
|
2409
2376
|
case "attachment": {
|
|
2410
|
-
return
|
|
2377
|
+
return chunkMAG62XQ4_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
2411
2378
|
}
|
|
2412
2379
|
case "mediaReference": {
|
|
2413
|
-
return createMediaFromReference(client, responseValue);
|
|
2380
|
+
return chunkMAG62XQ4_cjs.createMediaFromReference(client, responseValue);
|
|
2414
2381
|
}
|
|
2415
2382
|
case "object": {
|
|
2416
2383
|
const def = definitions.get(responseDataType.object);
|
|
@@ -2432,7 +2399,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2432
2399
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
2433
2400
|
}
|
|
2434
2401
|
if (typeof responseValue === "string") {
|
|
2435
|
-
return
|
|
2402
|
+
return chunkMAG62XQ4_cjs.createObjectSet(def, client, {
|
|
2436
2403
|
type: "intersect",
|
|
2437
2404
|
objectSets: [{
|
|
2438
2405
|
type: "base",
|
|
@@ -2443,7 +2410,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2443
2410
|
}]
|
|
2444
2411
|
});
|
|
2445
2412
|
}
|
|
2446
|
-
return
|
|
2413
|
+
return chunkMAG62XQ4_cjs.createObjectSet(def, client, responseValue);
|
|
2447
2414
|
}
|
|
2448
2415
|
case "struct": {
|
|
2449
2416
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -2638,7 +2605,7 @@ function createClientInternal(objectSetFactory, transactionRid, flushEdits, base
|
|
|
2638
2605
|
ontologyRid
|
|
2639
2606
|
}, baseUrl, tokenProvider, {
|
|
2640
2607
|
...options,
|
|
2641
|
-
logger: options?.logger ?? new
|
|
2608
|
+
logger: options?.logger ?? new chunkMAG62XQ4_cjs.MinimalLogger(),
|
|
2642
2609
|
transactionId: transactionRid,
|
|
2643
2610
|
flushEdits,
|
|
2644
2611
|
branch: options?.UNSTABLE_DO_NOT_USE_BRANCH
|
|
@@ -2667,7 +2634,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2667
2634
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
2668
2635
|
return {
|
|
2669
2636
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
2670
|
-
return await
|
|
2637
|
+
return await chunkMAG62XQ4_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
2671
2638
|
}
|
|
2672
2639
|
};
|
|
2673
2640
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -2691,10 +2658,10 @@ function createClientFromContext(clientCtx) {
|
|
|
2691
2658
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
2692
2659
|
return {
|
|
2693
2660
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
2694
|
-
return await
|
|
2661
|
+
return await chunkMAG62XQ4_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
2695
2662
|
},
|
|
2696
2663
|
fetchPageByRidNoType: async (rids, options) => {
|
|
2697
|
-
return await
|
|
2664
|
+
return await chunkMAG62XQ4_cjs.fetchStaticRidPage(clientCtx, rids, options ?? {});
|
|
2698
2665
|
}
|
|
2699
2666
|
};
|
|
2700
2667
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__transformAndWait.name:
|
|
@@ -2726,7 +2693,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2726
2693
|
[symbolClientContext2]: {
|
|
2727
2694
|
value: clientCtx
|
|
2728
2695
|
},
|
|
2729
|
-
[
|
|
2696
|
+
[chunkMAG62XQ4_cjs.additionalContext]: {
|
|
2730
2697
|
value: clientCtx
|
|
2731
2698
|
},
|
|
2732
2699
|
fetchMetadata: {
|
|
@@ -2735,8 +2702,8 @@ function createClientFromContext(clientCtx) {
|
|
|
2735
2702
|
});
|
|
2736
2703
|
return client;
|
|
2737
2704
|
}
|
|
2738
|
-
var createClient = createClientInternal.bind(void 0,
|
|
2739
|
-
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(
|
|
2705
|
+
var createClient = createClientInternal.bind(void 0, chunkMAG62XQ4_cjs.createObjectSet, void 0, void 0);
|
|
2706
|
+
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(chunkMAG62XQ4_cjs.createObjectSet, transactionRid, flushEdits, ...args);
|
|
2740
2707
|
function createWithRid(rids) {
|
|
2741
2708
|
const withRid = {
|
|
2742
2709
|
type: "static",
|
|
@@ -2761,5 +2728,5 @@ exports.createOsdkObject = createOsdkObject;
|
|
|
2761
2728
|
exports.extractPrimaryKeyFromObjectSpecifier = extractPrimaryKeyFromObjectSpecifier;
|
|
2762
2729
|
exports.getDefType = getDefType;
|
|
2763
2730
|
exports.isObjectSpecifiersObject = isObjectSpecifiersObject;
|
|
2764
|
-
//# sourceMappingURL=chunk-
|
|
2765
|
-
//# sourceMappingURL=chunk-
|
|
2731
|
+
//# sourceMappingURL=chunk-4J6HDU2R.cjs.map
|
|
2732
|
+
//# sourceMappingURL=chunk-4J6HDU2R.cjs.map
|