@osdk/client 2.4.0-beta.14 → 2.4.0-beta.16
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 +24 -0
- package/build/browser/observable/internal/ActionApplication.js +1 -1
- package/build/browser/observable/internal/ActionApplication.js.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js +4 -1
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-YGGF63LB.cjs → chunk-GLEZ4Z7K.cjs} +51 -51
- package/build/cjs/{chunk-YGGF63LB.cjs.map → chunk-GLEZ4Z7K.cjs.map} +1 -1
- package/build/cjs/{chunk-VDP26RI3.cjs → chunk-L3OU54Q5.cjs} +14 -19
- package/build/cjs/chunk-L3OU54Q5.cjs.map +1 -0
- package/build/cjs/chunk-Q7SFCCGT.cjs +11 -0
- package/build/cjs/chunk-Q7SFCCGT.cjs.map +1 -0
- package/build/cjs/delay-QK4T7RVX.cjs +74 -0
- package/build/cjs/delay-QK4T7RVX.cjs.map +1 -0
- package/build/cjs/index.cjs +7 -6
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/public/internal.cjs +13 -9
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.cjs +19 -72
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/esm/observable/internal/ActionApplication.js +1 -1
- package/build/esm/observable/internal/ActionApplication.js.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js +4 -1
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/observable/internal/ActionApplication.d.ts.map +1 -1
- package/package.json +8 -8
- package/build/cjs/chunk-VDP26RI3.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @osdk/client
|
|
2
2
|
|
|
3
|
+
## 2.4.0-beta.16
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c763807: Fix hydrate method for object rids to work with interfaces.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- @osdk/api@2.4.0-beta.16
|
|
12
|
+
- @osdk/client.unstable@2.4.0-beta.16
|
|
13
|
+
- @osdk/generator-converters@2.4.0-beta.16
|
|
14
|
+
|
|
15
|
+
## 2.4.0-beta.15
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- d2d36e1: Fix module resolution for node when importing unstable code
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- @osdk/api@2.4.0-beta.15
|
|
24
|
+
- @osdk/client.unstable@2.4.0-beta.15
|
|
25
|
+
- @osdk/generator-converters@2.4.0-beta.15
|
|
26
|
+
|
|
3
27
|
## 2.4.0-beta.14
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import delay from "delay";
|
|
18
17
|
import { runOptimisticJob } from "./OptimisticJob.js";
|
|
19
18
|
const ACTION_DELAY = process.env.NODE_ENV === "production" ? 0 : 1000;
|
|
20
19
|
export class ActionApplication {
|
|
@@ -51,6 +50,7 @@ export class ActionApplication {
|
|
|
51
50
|
if (process.env.NODE_ENV !== "production") {
|
|
52
51
|
if (ACTION_DELAY > 0) {
|
|
53
52
|
logger?.debug("action done, pausing", actionResults);
|
|
53
|
+
const delay = (await import("delay")).default;
|
|
54
54
|
await delay(ACTION_DELAY);
|
|
55
55
|
logger?.debug("action done, pausing done");
|
|
56
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionApplication.js","names":["
|
|
1
|
+
{"version":3,"file":"ActionApplication.js","names":["runOptimisticJob","ACTION_DELAY","process","env","NODE_ENV","ActionApplication","constructor","store","applyAction","action","args","optimisticUpdate","logger","child","methodName","removeOptimisticResult","Array","isArray","debug","results","client","batchApplyAction","$returnEdits","invalidateActionEditResponse","actionResults","delay","default","#invalidateActionEditResponse","deletedObjects","modifiedObjects","addedObjects","editedObjectTypes","type","changes","promisesToWait","list","obj","push","invalidateObject","objectType","primaryKey","batch","cacheKey","getCacheKey","peekQuery","deleteFromStore","Promise","all","apiName","invalidateObjectType"],"sources":["ActionApplication.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 ActionDefinition,\n ActionEditResponse,\n ActionReturnTypeForOptions,\n} from \"@osdk/api\";\nimport type { ActionSignatureFromDef } from \"../../actions/applyAction.js\";\nimport { type Changes } from \"./Changes.js\";\nimport type { ObjectCacheKey } from \"./ObjectQuery.js\";\nimport { runOptimisticJob } from \"./OptimisticJob.js\";\nimport type { Store } from \"./Store.js\";\n\nconst ACTION_DELAY = process.env.NODE_ENV === \"production\" ? 0 : 1000;\n\nexport class ActionApplication {\n constructor(private store: Store) {}\n\n applyAction: <Q extends ActionDefinition<any>>(\n action: Q,\n args:\n | Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]\n | Array<Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]>,\n opts?: Store.ApplyActionOptions,\n ) => Promise<ActionEditResponse> = async (\n action,\n args,\n { optimisticUpdate } = {},\n ) => {\n const logger = process.env.NODE_ENV !== \"production\"\n ? this.store.logger?.child({ methodName: \"applyAction\" })\n : this.store.logger;\n const removeOptimisticResult = runOptimisticJob(\n this.store,\n optimisticUpdate,\n );\n\n return await (async () => {\n try {\n if (Array.isArray(args)) {\n if (process.env.NODE_ENV !== \"production\") {\n logger?.debug(\"applying action to multiple args\", args);\n }\n\n const results: ActionReturnTypeForOptions<{ $returnEdits: true }> =\n await this.store\n .client(action).batchApplyAction(\n args,\n { $returnEdits: true },\n );\n\n await this.#invalidateActionEditResponse(results);\n\n return results;\n }\n\n // The types for client get confused when we dynamically applyAction so we\n // have to deal with the `any` here and force cast it to what it should be.\n // TODO: Update the types so this doesn't happen!\n\n const actionResults: ActionEditResponse = await this.store.client(\n action,\n ).applyAction(args as any, { $returnEdits: true });\n\n if (process.env.NODE_ENV !== \"production\") {\n if (ACTION_DELAY > 0) {\n logger?.debug(\"action done, pausing\", actionResults);\n const delay = (await import(\"delay\")).default;\n await delay(ACTION_DELAY);\n logger?.debug(\"action done, pausing done\");\n }\n }\n await this.#invalidateActionEditResponse(actionResults);\n return actionResults;\n } finally {\n if (process.env.NODE_ENV !== \"production\") {\n logger?.debug(\n \"optimistic action complete; remove the results\",\n );\n }\n // make sure this happens even if the action fails\n await removeOptimisticResult();\n }\n })();\n };\n\n #invalidateActionEditResponse = async (\n { deletedObjects, modifiedObjects, addedObjects, editedObjectTypes, type }:\n ActionEditResponse,\n ): Promise<void> => {\n let changes: Changes | undefined;\n if (type === \"edits\") {\n const promisesToWait: Promise<any>[] = [];\n\n for (const list of [deletedObjects, modifiedObjects, addedObjects]) {\n for (const obj of list ?? []) {\n promisesToWait.push(\n this.store.invalidateObject(obj.objectType, obj.primaryKey),\n );\n }\n }\n\n this.store.batch({}, (batch) => {\n for (const { objectType, primaryKey } of deletedObjects ?? []) {\n const cacheKey = this.store.getCacheKey<ObjectCacheKey>(\n \"object\",\n objectType,\n primaryKey,\n );\n this.store.peekQuery(cacheKey)?.deleteFromStore(\n \"loaded\", // this is probably not the best value to use\n batch,\n );\n }\n });\n await Promise.all(promisesToWait);\n } else {\n for (const apiName of editedObjectTypes) {\n await this.store.invalidateObjectType(apiName as string, changes);\n }\n }\n };\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -27,7 +27,10 @@ import { createObjectSet } from "../objectSet/createObjectSet.js";
|
|
|
27
27
|
export function hydrateObjectSetFromObjectRids(client, definition, rids) {
|
|
28
28
|
return createObjectSet(definition, client[additionalContext], {
|
|
29
29
|
type: "intersect",
|
|
30
|
-
objectSets: [{
|
|
30
|
+
objectSets: [definition.type === "interface" ? {
|
|
31
|
+
type: "interfaceBase",
|
|
32
|
+
interfaceType: definition.apiName
|
|
33
|
+
} : {
|
|
31
34
|
type: "base",
|
|
32
35
|
objectType: definition.apiName
|
|
33
36
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateObjectSetFromObjectRids.js","names":["additionalContext","createObjectSet","hydrateObjectSetFromObjectRids","client","definition","rids","type","objectSets","
|
|
1
|
+
{"version":3,"file":"hydrateObjectSetFromObjectRids.js","names":["additionalContext","createObjectSet","hydrateObjectSetFromObjectRids","client","definition","rids","type","objectSets","interfaceType","apiName","objectType","objects","asMutableArray","array"],"sources":["hydrateObjectSetFromObjectRids.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 { ObjectOrInterfaceDefinition, ObjectSet } from \"@osdk/api\";\nimport type { Client } from \"../Client.js\";\nimport { additionalContext } from \"../Client.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\n\n/**\n * Creates an OSDK object set from object RIDs.\n * @param client - An OSDK client.\n * @param definition - An OSDK object or interface definition.\n * @param rids - An array of object RIDs.\n * @returns An OSDK object set.\n */\nexport function hydrateObjectSetFromObjectRids<\n T extends ObjectOrInterfaceDefinition,\n>(client: Client, definition: T, rids: readonly string[]): ObjectSet<T> {\n return createObjectSet(definition, client[additionalContext], {\n type: \"intersect\",\n objectSets: [\n definition.type === \"interface\"\n ? { type: \"interfaceBase\", interfaceType: definition.apiName }\n : {\n type: \"base\",\n objectType: definition.apiName,\n },\n {\n type: \"static\",\n objects: asMutableArray(rids),\n },\n ],\n });\n}\n\nfunction asMutableArray<T>(array: readonly T[]): T[] {\n return array as T[];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,cAAc;AAChD,SAASC,eAAe,QAAQ,iCAAiC;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,8BAA8BA,CAE5CC,MAAc,EAAEC,UAAa,EAAEC,IAAuB,EAAgB;EACtE,OAAOJ,eAAe,CAACG,UAAU,EAAED,MAAM,CAACH,iBAAiB,CAAC,EAAE;IAC5DM,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,CACVH,UAAU,CAACE,IAAI,KAAK,WAAW,GAC3B;MAAEA,IAAI,EAAE,eAAe;MAAEE,aAAa,EAAEJ,UAAU,CAACK;IAAQ,CAAC,GAC5D;MACAH,IAAI,EAAE,MAAM;MACZI,UAAU,EAAEN,UAAU,CAACK;IACzB,CAAC,EACH;MACEH,IAAI,EAAE,QAAQ;MACdK,OAAO,EAAEC,cAAc,CAACP,IAAI;IAC9B,CAAC;EAEL,CAAC,CAAC;AACJ;AAEA,SAASO,cAAcA,CAAIC,KAAmB,EAAO;EACnD,OAAOA,KAAK;AACd","ignoreList":[]}
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export const USER_AGENT = `osdk-client/${"2.4.0-beta.
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.4.0-beta.
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.4.0-beta.16"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.4.0-beta.16"}`;
|
|
19
19
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkL3OU54Q5_cjs = require('./chunk-L3OU54Q5.cjs');
|
|
4
4
|
var unstable = require('@osdk/api/unstable');
|
|
5
5
|
var client_unstable = require('@osdk/client.unstable');
|
|
6
6
|
var invariant = require('tiny-invariant');
|
|
@@ -429,19 +429,19 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
429
429
|
return Promise.all(promiseArray);
|
|
430
430
|
}
|
|
431
431
|
if (isAttachmentUpload(value)) {
|
|
432
|
-
const attachment = await
|
|
432
|
+
const attachment = await chunkL3OU54Q5_cjs.Attachment_exports.upload(client, value.data, {
|
|
433
433
|
filename: value.name
|
|
434
434
|
});
|
|
435
435
|
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
436
436
|
}
|
|
437
437
|
if (isAttachmentFile(value)) {
|
|
438
|
-
const attachment = await
|
|
438
|
+
const attachment = await chunkL3OU54Q5_cjs.Attachment_exports.upload(client, value, {
|
|
439
439
|
filename: value.name
|
|
440
440
|
});
|
|
441
441
|
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
442
442
|
}
|
|
443
443
|
if (isMediaUpload(value)) {
|
|
444
|
-
const mediaRef = await
|
|
444
|
+
const mediaRef = await chunkL3OU54Q5_cjs.MediaReferenceProperty_exports.uploadMedia(client, await client.ontologyRid, actionMetadata.apiName, value.data, {
|
|
445
445
|
mediaItemPath: value.path,
|
|
446
446
|
preview: true
|
|
447
447
|
});
|
|
@@ -456,11 +456,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
456
456
|
if (isPoint(value)) {
|
|
457
457
|
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client, actionMetadata);
|
|
458
458
|
}
|
|
459
|
-
if (
|
|
459
|
+
if (chunkL3OU54Q5_cjs.isWireObjectSet(value)) {
|
|
460
460
|
return value;
|
|
461
461
|
}
|
|
462
|
-
if (
|
|
463
|
-
return
|
|
462
|
+
if (chunkL3OU54Q5_cjs.isObjectSet(value)) {
|
|
463
|
+
return chunkL3OU54Q5_cjs.getWireObjectSet(value);
|
|
464
464
|
}
|
|
465
465
|
if (isMediaReference(value)) {
|
|
466
466
|
return value;
|
|
@@ -483,11 +483,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
483
483
|
|
|
484
484
|
// src/actions/applyAction.ts
|
|
485
485
|
async function applyAction(client, action, parameters, options = {}) {
|
|
486
|
-
const clientWithHeaders =
|
|
486
|
+
const clientWithHeaders = chunkL3OU54Q5_cjs.addUserAgentAndRequestContextHeaders(chunkL3OU54Q5_cjs.augmentRequestContext(client, (_) => ({
|
|
487
487
|
finalMethodCall: "applyAction"
|
|
488
488
|
})), action);
|
|
489
489
|
if (Array.isArray(parameters)) {
|
|
490
|
-
const response = await
|
|
490
|
+
const response = await chunkL3OU54Q5_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
491
491
|
requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],
|
|
492
492
|
options: {
|
|
493
493
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
@@ -496,7 +496,7 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
496
496
|
const edits = response.edits;
|
|
497
497
|
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
498
498
|
} else {
|
|
499
|
-
const response = await
|
|
499
|
+
const response = await chunkL3OU54Q5_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
500
500
|
parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),
|
|
501
501
|
options: {
|
|
502
502
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -701,7 +701,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
async getLatestValue() {
|
|
704
|
-
const latestPointPromise =
|
|
704
|
+
const latestPointPromise = chunkL3OU54Q5_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
705
705
|
latestPointPromise.then(
|
|
706
706
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
707
707
|
// eslint-disable-next-line no-console
|
|
@@ -717,7 +717,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
717
717
|
return allPoints;
|
|
718
718
|
}
|
|
719
719
|
async *asyncIterValues(query) {
|
|
720
|
-
const streamPointsIterator = await
|
|
720
|
+
const streamPointsIterator = await chunkL3OU54Q5_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
721
721
|
range: getTimeRange(query)
|
|
722
722
|
} : {});
|
|
723
723
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -744,13 +744,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
744
744
|
this.#mediaReference = mediaReference;
|
|
745
745
|
}
|
|
746
746
|
async fetchContents() {
|
|
747
|
-
return
|
|
747
|
+
return chunkL3OU54Q5_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
748
748
|
preview: true
|
|
749
749
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
750
750
|
});
|
|
751
751
|
}
|
|
752
752
|
async fetchMetadata() {
|
|
753
|
-
const r = await
|
|
753
|
+
const r = await chunkL3OU54Q5_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
754
754
|
preview: true
|
|
755
755
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
756
756
|
});
|
|
@@ -774,10 +774,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
774
774
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
775
775
|
}
|
|
776
776
|
async getFirstPoint() {
|
|
777
|
-
return
|
|
777
|
+
return chunkL3OU54Q5_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
778
778
|
}
|
|
779
779
|
async getLastPoint() {
|
|
780
|
-
return
|
|
780
|
+
return chunkL3OU54Q5_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
781
781
|
}
|
|
782
782
|
async getAllPoints(query) {
|
|
783
783
|
const allPoints = [];
|
|
@@ -787,7 +787,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
787
787
|
return allPoints;
|
|
788
788
|
}
|
|
789
789
|
async *asyncIterPoints(query) {
|
|
790
|
-
const streamPointsIterator = await
|
|
790
|
+
const streamPointsIterator = await chunkL3OU54Q5_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
791
791
|
range: getTimeRange(query)
|
|
792
792
|
} : {});
|
|
793
793
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -815,7 +815,7 @@ var ClientRef = Symbol("ClientRef" );
|
|
|
815
815
|
|
|
816
816
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
817
817
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
818
|
-
const [objApiNamespace] =
|
|
818
|
+
const [objApiNamespace] = chunkL3OU54Q5_cjs.extractNamespace(interfaceDef.apiName);
|
|
819
819
|
return Object.freeze(Object.defineProperties({}, {
|
|
820
820
|
// first to minimize hidden classes
|
|
821
821
|
[UnderlyingOsdkObject]: {
|
|
@@ -865,7 +865,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
865
865
|
},
|
|
866
866
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
867
867
|
const objDef = underlying[ObjectDefRef];
|
|
868
|
-
const [apiNamespace, apiName] =
|
|
868
|
+
const [apiNamespace, apiName] = chunkL3OU54Q5_cjs.extractNamespace(p);
|
|
869
869
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
870
870
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
871
871
|
enumerable: targetPropName in underlying,
|
|
@@ -941,8 +941,8 @@ function get$link(holder) {
|
|
|
941
941
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
942
942
|
}).pivotTo(linkName);
|
|
943
943
|
const value = !linkDef.multiplicity ? {
|
|
944
|
-
fetchOne: (options) =>
|
|
945
|
-
fetchOneWithErrors: (options) =>
|
|
944
|
+
fetchOne: (options) => chunkL3OU54Q5_cjs.fetchSingle(client, objDef, options ?? {}, chunkL3OU54Q5_cjs.getWireObjectSet(objectSet)),
|
|
945
|
+
fetchOneWithErrors: (options) => chunkL3OU54Q5_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkL3OU54Q5_cjs.getWireObjectSet(objectSet))
|
|
946
946
|
} : objectSet;
|
|
947
947
|
return [linkName, value];
|
|
948
948
|
})));
|
|
@@ -1035,9 +1035,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1035
1035
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1036
1036
|
case "attachment":
|
|
1037
1037
|
if (Array.isArray(rawValue)) {
|
|
1038
|
-
return rawValue.map((a) =>
|
|
1038
|
+
return rawValue.map((a) => chunkL3OU54Q5_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1039
1039
|
} else {
|
|
1040
|
-
return
|
|
1040
|
+
return chunkL3OU54Q5_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1041
1041
|
}
|
|
1042
1042
|
default:
|
|
1043
1043
|
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
@@ -1053,9 +1053,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
if (propDef.type === "attachment") {
|
|
1055
1055
|
if (Array.isArray(rawValue)) {
|
|
1056
|
-
return rawValue.map((a) =>
|
|
1056
|
+
return rawValue.map((a) => chunkL3OU54Q5_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1057
1057
|
}
|
|
1058
|
-
return
|
|
1058
|
+
return chunkL3OU54Q5_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1059
1059
|
}
|
|
1060
1060
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1061
1061
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1275,11 +1275,11 @@ function deepFreeze(obj) {
|
|
|
1275
1275
|
return Object.freeze(obj);
|
|
1276
1276
|
}
|
|
1277
1277
|
async function loadActionMetadata(client, actionType) {
|
|
1278
|
-
const r = await
|
|
1278
|
+
const r = await chunkL3OU54Q5_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1279
1279
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1280
1280
|
}
|
|
1281
1281
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1282
|
-
const full = await
|
|
1282
|
+
const full = await chunkL3OU54Q5_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1283
1283
|
preview: true
|
|
1284
1284
|
});
|
|
1285
1285
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
@@ -1288,14 +1288,14 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1288
1288
|
};
|
|
1289
1289
|
}
|
|
1290
1290
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1291
|
-
const r = await
|
|
1291
|
+
const r = await chunkL3OU54Q5_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1292
1292
|
preview: true
|
|
1293
1293
|
});
|
|
1294
1294
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1295
1295
|
}
|
|
1296
1296
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1297
1297
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1298
|
-
const r = await
|
|
1298
|
+
const r = await chunkL3OU54Q5_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1299
1299
|
version
|
|
1300
1300
|
});
|
|
1301
1301
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
@@ -1352,11 +1352,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1352
1352
|
};
|
|
1353
1353
|
|
|
1354
1354
|
// src/util/UserAgent.ts
|
|
1355
|
-
var USER_AGENT = `osdk-client/${"2.4.0-beta.
|
|
1356
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.4.0-beta.
|
|
1355
|
+
var USER_AGENT = `osdk-client/${"2.4.0-beta.16"}`;
|
|
1356
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.4.0-beta.16"}`;
|
|
1357
1357
|
|
|
1358
1358
|
// src/createMinimalClient.ts
|
|
1359
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1359
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkL3OU54Q5_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1360
1360
|
if (process.env.NODE_ENV !== "production") {
|
|
1361
1361
|
try {
|
|
1362
1362
|
new URL(baseUrl);
|
|
@@ -1422,13 +1422,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1422
1422
|
switch (desiredType.type) {
|
|
1423
1423
|
case "attachment": {
|
|
1424
1424
|
if (isAttachmentUpload(value)) {
|
|
1425
|
-
const attachment = await
|
|
1425
|
+
const attachment = await chunkL3OU54Q5_cjs.Attachment_exports.upload(client, value.data, {
|
|
1426
1426
|
filename: value.name
|
|
1427
1427
|
});
|
|
1428
1428
|
return attachment.rid;
|
|
1429
1429
|
}
|
|
1430
1430
|
if (isAttachmentFile(value)) {
|
|
1431
|
-
const attachment = await
|
|
1431
|
+
const attachment = await chunkL3OU54Q5_cjs.Attachment_exports.upload(client, value, {
|
|
1432
1432
|
filename: value.name
|
|
1433
1433
|
});
|
|
1434
1434
|
return attachment.rid;
|
|
@@ -1459,11 +1459,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1459
1459
|
break;
|
|
1460
1460
|
}
|
|
1461
1461
|
case "objectSet": {
|
|
1462
|
-
if (
|
|
1462
|
+
if (chunkL3OU54Q5_cjs.isWireObjectSet(value)) {
|
|
1463
1463
|
return value;
|
|
1464
1464
|
}
|
|
1465
|
-
if (
|
|
1466
|
-
return
|
|
1465
|
+
if (chunkL3OU54Q5_cjs.isObjectSet(value)) {
|
|
1466
|
+
return chunkL3OU54Q5_cjs.getWireObjectSet(value);
|
|
1467
1467
|
}
|
|
1468
1468
|
break;
|
|
1469
1469
|
}
|
|
@@ -1505,7 +1505,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1505
1505
|
// src/queries/applyQuery.ts
|
|
1506
1506
|
async function applyQuery(client, query, params) {
|
|
1507
1507
|
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1508
|
-
const response = await
|
|
1508
|
+
const response = await chunkL3OU54Q5_cjs.Query_exports.execute(chunkL3OU54Q5_cjs.addUserAgentAndRequestContextHeaders(chunkL3OU54Q5_cjs.augmentRequestContext(client, (_) => ({
|
|
1509
1509
|
finalMethodCall: "applyQuery"
|
|
1510
1510
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1511
1511
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
@@ -1552,7 +1552,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1552
1552
|
return responseValue;
|
|
1553
1553
|
}
|
|
1554
1554
|
case "attachment": {
|
|
1555
|
-
return
|
|
1555
|
+
return chunkL3OU54Q5_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1556
1556
|
}
|
|
1557
1557
|
case "object": {
|
|
1558
1558
|
const def = definitions.get(responseDataType.object);
|
|
@@ -1567,7 +1567,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1567
1567
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1568
1568
|
}
|
|
1569
1569
|
if (typeof responseValue === "string") {
|
|
1570
|
-
return
|
|
1570
|
+
return chunkL3OU54Q5_cjs.createObjectSet(def, client, {
|
|
1571
1571
|
type: "intersect",
|
|
1572
1572
|
objectSets: [{
|
|
1573
1573
|
type: "base",
|
|
@@ -1578,7 +1578,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1578
1578
|
}]
|
|
1579
1579
|
});
|
|
1580
1580
|
}
|
|
1581
|
-
return
|
|
1581
|
+
return chunkL3OU54Q5_cjs.createObjectSet(def, client, responseValue);
|
|
1582
1582
|
}
|
|
1583
1583
|
case "struct": {
|
|
1584
1584
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1750,7 +1750,7 @@ function createClientInternal(objectSetFactory, transactionRid, baseUrl, ontolog
|
|
|
1750
1750
|
ontologyRid
|
|
1751
1751
|
}, baseUrl, tokenProvider, {
|
|
1752
1752
|
...options,
|
|
1753
|
-
logger: options?.logger ?? new
|
|
1753
|
+
logger: options?.logger ?? new chunkL3OU54Q5_cjs.MinimalLogger(),
|
|
1754
1754
|
transactionRid
|
|
1755
1755
|
}, fetchFn, objectSetFactory);
|
|
1756
1756
|
return createClientFromContext(clientCtx);
|
|
@@ -1772,7 +1772,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1772
1772
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1773
1773
|
return {
|
|
1774
1774
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
1775
|
-
return await
|
|
1775
|
+
return await chunkL3OU54Q5_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
1776
1776
|
}
|
|
1777
1777
|
};
|
|
1778
1778
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1784,7 +1784,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1784
1784
|
objectType,
|
|
1785
1785
|
propertyType
|
|
1786
1786
|
} = args;
|
|
1787
|
-
return await
|
|
1787
|
+
return await chunkL3OU54Q5_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1788
1788
|
mediaItemPath: fileName,
|
|
1789
1789
|
preview: true
|
|
1790
1790
|
});
|
|
@@ -1793,7 +1793,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1793
1793
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1794
1794
|
return {
|
|
1795
1795
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
1796
|
-
return await
|
|
1796
|
+
return await chunkL3OU54Q5_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
1797
1797
|
}
|
|
1798
1798
|
};
|
|
1799
1799
|
}
|
|
@@ -1805,13 +1805,13 @@ function createClientFromContext(clientCtx) {
|
|
|
1805
1805
|
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1806
1806
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1807
1807
|
const client = Object.defineProperties(clientFn, {
|
|
1808
|
-
[
|
|
1808
|
+
[chunkL3OU54Q5_cjs.symbolClientContext]: {
|
|
1809
1809
|
value: clientCtx
|
|
1810
1810
|
},
|
|
1811
1811
|
[symbolClientContext2]: {
|
|
1812
1812
|
value: clientCtx
|
|
1813
1813
|
},
|
|
1814
|
-
[
|
|
1814
|
+
[chunkL3OU54Q5_cjs.additionalContext]: {
|
|
1815
1815
|
value: clientCtx
|
|
1816
1816
|
},
|
|
1817
1817
|
fetchMetadata: {
|
|
@@ -1820,8 +1820,8 @@ function createClientFromContext(clientCtx) {
|
|
|
1820
1820
|
});
|
|
1821
1821
|
return client;
|
|
1822
1822
|
}
|
|
1823
|
-
var createClient = createClientInternal.bind(void 0,
|
|
1824
|
-
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(
|
|
1823
|
+
var createClient = createClientInternal.bind(void 0, chunkL3OU54Q5_cjs.createObjectSet, void 0);
|
|
1824
|
+
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(chunkL3OU54Q5_cjs.createObjectSet, transactionRid, ...args);
|
|
1825
1825
|
function createWithRid(rids) {
|
|
1826
1826
|
const withRid = {
|
|
1827
1827
|
type: "static",
|
|
@@ -1839,5 +1839,5 @@ exports.createAttachmentUpload = createAttachmentUpload;
|
|
|
1839
1839
|
exports.createClient = createClient;
|
|
1840
1840
|
exports.createClientFromContext = createClientFromContext;
|
|
1841
1841
|
exports.createClientWithTransaction = createClientWithTransaction;
|
|
1842
|
-
//# sourceMappingURL=chunk-
|
|
1843
|
-
//# sourceMappingURL=chunk-
|
|
1842
|
+
//# sourceMappingURL=chunk-GLEZ4Z7K.cjs.map
|
|
1843
|
+
//# sourceMappingURL=chunk-GLEZ4Z7K.cjs.map
|