@osdk/client 2.16.0 → 2.17.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 +13 -0
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-KSARRFLR.cjs → chunk-4JJZ7QXU.cjs} +2 -2
- package/build/cjs/{chunk-KSARRFLR.cjs.map → chunk-4JJZ7QXU.cjs.map} +1 -1
- package/build/cjs/{chunk-V2FALIB7.cjs → chunk-LVNIU5CO.cjs} +71 -71
- package/build/cjs/{chunk-V2FALIB7.cjs.map → chunk-LVNIU5CO.cjs.map} +1 -1
- package/build/cjs/{chunk-KA2HNXIJ.cjs → chunk-OUBJPIXZ.cjs} +40 -40
- package/build/cjs/{chunk-KA2HNXIJ.cjs.map → chunk-OUBJPIXZ.cjs.map} +1 -1
- package/build/cjs/index.cjs +10 -10
- package/build/cjs/public/internal.cjs +9 -9
- package/build/cjs/public/observable.cjs +4 -4
- package/build/cjs/public/unstable-do-not-use.cjs +9 -9
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/Client.d.ts +1 -1
- package/build/types/createClient.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4JJZ7QXU_cjs = require('./chunk-4JJZ7QXU.cjs');
|
|
4
4
|
var chunkZPLXXOU6_cjs = require('./chunk-ZPLXXOU6.cjs');
|
|
5
5
|
var chunkDOXHU27E_cjs = require('./chunk-DOXHU27E.cjs');
|
|
6
6
|
var chunkD26YLHTV_cjs = require('./chunk-D26YLHTV.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 chunk4JJZ7QXU_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 chunk4JJZ7QXU_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 (chunk4JJZ7QXU_cjs.isWireObjectSet(value)) {
|
|
152
152
|
return value;
|
|
153
153
|
}
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
154
|
+
if (chunk4JJZ7QXU_cjs.isObjectSet(value)) {
|
|
155
|
+
return chunk4JJZ7QXU_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 = chunk4JJZ7QXU_cjs.addUserAgentAndRequestContextHeaders(chunk4JJZ7QXU_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) => chunk4JJZ7QXU_cjs.fetchSingle(client, objDef, options ?? {}, chunk4JJZ7QXU_cjs.getWireObjectSet(objectSet)),
|
|
907
|
+
fetchOneWithErrors: (options) => chunk4JJZ7QXU_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunk4JJZ7QXU_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) => chunk4JJZ7QXU_cjs.fetchSingle(client, linkTargetDef, options ?? {}, chunk4JJZ7QXU_cjs.getWireObjectSet(objectSet)),
|
|
931
|
+
fetchOneWithErrors: (options) => chunk4JJZ7QXU_cjs.fetchSingleWithErrors(client, linkTargetDef, options ?? {}, chunk4JJZ7QXU_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] = chunk4JJZ7QXU_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] = chunk4JJZ7QXU_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) => chunk4JJZ7QXU_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1178
1178
|
} else {
|
|
1179
|
-
return
|
|
1179
|
+
return chunk4JJZ7QXU_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) => chunk4JJZ7QXU_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1196
1196
|
}
|
|
1197
|
-
return
|
|
1197
|
+
return chunk4JJZ7QXU_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 chunk4JJZ7QXU_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.
|
|
1610
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.
|
|
1609
|
+
var USER_AGENT = `osdk-client/${"2.17.0"}`;
|
|
1610
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.17.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 = chunk4JJZ7QXU_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1614
1614
|
if (process.env.NODE_ENV !== "production") {
|
|
1615
1615
|
try {
|
|
1616
1616
|
new URL(baseUrl);
|
|
@@ -2218,13 +2218,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
2218
2218
|
switch (desiredType.type) {
|
|
2219
2219
|
case "attachment": {
|
|
2220
2220
|
if (isAttachmentUpload(value)) {
|
|
2221
|
-
const attachment = await
|
|
2221
|
+
const attachment = await chunk4JJZ7QXU_cjs.upload(client, value.data, {
|
|
2222
2222
|
filename: value.name
|
|
2223
2223
|
});
|
|
2224
2224
|
return attachment.rid;
|
|
2225
2225
|
}
|
|
2226
2226
|
if (isAttachmentFile(value)) {
|
|
2227
|
-
const attachment = await
|
|
2227
|
+
const attachment = await chunk4JJZ7QXU_cjs.upload(client, value, {
|
|
2228
2228
|
filename: value.name
|
|
2229
2229
|
});
|
|
2230
2230
|
return attachment.rid;
|
|
@@ -2280,11 +2280,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
2280
2280
|
}
|
|
2281
2281
|
case "objectSet":
|
|
2282
2282
|
case "interfaceObjectSet": {
|
|
2283
|
-
if (
|
|
2283
|
+
if (chunk4JJZ7QXU_cjs.isWireObjectSet(value)) {
|
|
2284
2284
|
return value;
|
|
2285
2285
|
}
|
|
2286
|
-
if (
|
|
2287
|
-
return
|
|
2286
|
+
if (chunk4JJZ7QXU_cjs.isObjectSet(value)) {
|
|
2287
|
+
return chunk4JJZ7QXU_cjs.getWireObjectSet(value);
|
|
2288
2288
|
}
|
|
2289
2289
|
break;
|
|
2290
2290
|
}
|
|
@@ -2329,7 +2329,7 @@ async function applyQuery(client, query, params) {
|
|
|
2329
2329
|
if (client.flushEdits != null) {
|
|
2330
2330
|
await client.flushEdits();
|
|
2331
2331
|
}
|
|
2332
|
-
const response = await execute(
|
|
2332
|
+
const response = await execute(chunk4JJZ7QXU_cjs.addUserAgentAndRequestContextHeaders(chunk4JJZ7QXU_cjs.augmentRequestContext(client, (_) => ({
|
|
2333
2333
|
finalMethodCall: "applyQuery"
|
|
2334
2334
|
})), query), await client.ontologyRid, query.apiName, {
|
|
2335
2335
|
parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}
|
|
@@ -2374,10 +2374,10 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2374
2374
|
return responseValue;
|
|
2375
2375
|
}
|
|
2376
2376
|
case "attachment": {
|
|
2377
|
-
return
|
|
2377
|
+
return chunk4JJZ7QXU_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
2378
2378
|
}
|
|
2379
2379
|
case "mediaReference": {
|
|
2380
|
-
return
|
|
2380
|
+
return chunk4JJZ7QXU_cjs.createMediaFromReference(client, responseValue);
|
|
2381
2381
|
}
|
|
2382
2382
|
case "object": {
|
|
2383
2383
|
const def = definitions.get(responseDataType.object);
|
|
@@ -2399,7 +2399,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2399
2399
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
2400
2400
|
}
|
|
2401
2401
|
if (typeof responseValue === "string") {
|
|
2402
|
-
return
|
|
2402
|
+
return chunk4JJZ7QXU_cjs.createObjectSet(def, client, {
|
|
2403
2403
|
type: "intersect",
|
|
2404
2404
|
objectSets: [{
|
|
2405
2405
|
type: "base",
|
|
@@ -2410,7 +2410,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2410
2410
|
}]
|
|
2411
2411
|
});
|
|
2412
2412
|
}
|
|
2413
|
-
return
|
|
2413
|
+
return chunk4JJZ7QXU_cjs.createObjectSet(def, client, responseValue);
|
|
2414
2414
|
}
|
|
2415
2415
|
case "struct": {
|
|
2416
2416
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -2605,7 +2605,7 @@ function createClientInternal(objectSetFactory, transactionRid, flushEdits, base
|
|
|
2605
2605
|
ontologyRid
|
|
2606
2606
|
}, baseUrl, tokenProvider, {
|
|
2607
2607
|
...options,
|
|
2608
|
-
logger: options?.logger ?? new
|
|
2608
|
+
logger: options?.logger ?? new chunk4JJZ7QXU_cjs.MinimalLogger(),
|
|
2609
2609
|
transactionId: transactionRid,
|
|
2610
2610
|
flushEdits,
|
|
2611
2611
|
branch: options?.UNSTABLE_DO_NOT_USE_BRANCH
|
|
@@ -2634,7 +2634,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2634
2634
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
2635
2635
|
return {
|
|
2636
2636
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
2637
|
-
return await
|
|
2637
|
+
return await chunk4JJZ7QXU_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
2638
2638
|
}
|
|
2639
2639
|
};
|
|
2640
2640
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -2658,10 +2658,10 @@ function createClientFromContext(clientCtx) {
|
|
|
2658
2658
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
2659
2659
|
return {
|
|
2660
2660
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
2661
|
-
return await
|
|
2661
|
+
return await chunk4JJZ7QXU_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
2662
2662
|
},
|
|
2663
2663
|
fetchPageByRidNoType: async (rids, options) => {
|
|
2664
|
-
return await
|
|
2664
|
+
return await chunk4JJZ7QXU_cjs.fetchStaticRidPage(clientCtx, rids, options ?? {});
|
|
2665
2665
|
}
|
|
2666
2666
|
};
|
|
2667
2667
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__transformAndWait.name:
|
|
@@ -2693,7 +2693,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2693
2693
|
[symbolClientContext2]: {
|
|
2694
2694
|
value: clientCtx
|
|
2695
2695
|
},
|
|
2696
|
-
[
|
|
2696
|
+
[chunk4JJZ7QXU_cjs.additionalContext]: {
|
|
2697
2697
|
value: clientCtx
|
|
2698
2698
|
},
|
|
2699
2699
|
fetchMetadata: {
|
|
@@ -2702,8 +2702,8 @@ function createClientFromContext(clientCtx) {
|
|
|
2702
2702
|
});
|
|
2703
2703
|
return client;
|
|
2704
2704
|
}
|
|
2705
|
-
var createClient = createClientInternal.bind(void 0,
|
|
2706
|
-
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(
|
|
2705
|
+
var createClient = createClientInternal.bind(void 0, chunk4JJZ7QXU_cjs.createObjectSet, void 0, void 0);
|
|
2706
|
+
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(chunk4JJZ7QXU_cjs.createObjectSet, transactionRid, flushEdits, ...args);
|
|
2707
2707
|
function createWithRid(rids) {
|
|
2708
2708
|
const withRid = {
|
|
2709
2709
|
type: "static",
|
|
@@ -2728,5 +2728,5 @@ exports.createOsdkObject = createOsdkObject;
|
|
|
2728
2728
|
exports.extractPrimaryKeyFromObjectSpecifier = extractPrimaryKeyFromObjectSpecifier;
|
|
2729
2729
|
exports.getDefType = getDefType;
|
|
2730
2730
|
exports.isObjectSpecifiersObject = isObjectSpecifiersObject;
|
|
2731
|
-
//# sourceMappingURL=chunk-
|
|
2732
|
-
//# sourceMappingURL=chunk-
|
|
2731
|
+
//# sourceMappingURL=chunk-OUBJPIXZ.cjs.map
|
|
2732
|
+
//# sourceMappingURL=chunk-OUBJPIXZ.cjs.map
|