@osdk/client 2.8.0-beta.29 → 2.8.0-beta.30
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/object/convertWireToOsdkObjects/getDollarLink.js +9 -2
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +30 -10
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/extractRdpDefinition.js +15 -0
- package/build/browser/util/extractRdpDefinition.js.map +1 -1
- package/build/cjs/{chunk-XYZOCIVH.cjs → chunk-3QMUE6AG.cjs} +46 -39
- package/build/cjs/chunk-3QMUE6AG.cjs.map +1 -0
- package/build/cjs/{chunk-KGWUPXAM.cjs → chunk-ZZ6DP3W4.cjs} +22 -7
- package/build/cjs/chunk-ZZ6DP3W4.cjs.map +1 -0
- package/build/cjs/index.cjs +10 -10
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +67 -67
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +9 -2
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +30 -10
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/extractRdpDefinition.js +15 -0
- package/build/esm/util/extractRdpDefinition.js.map +1 -1
- package/build/types/objectSet/createObjectSet.d.ts.map +1 -1
- package/package.json +7 -7
- package/build/cjs/chunk-KGWUPXAM.cjs.map +0 -1
- package/build/cjs/chunk-XYZOCIVH.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk3QMUE6AG_cjs = require('../chunk-3QMUE6AG.cjs');
|
|
4
|
+
var chunkZZ6DP3W4_cjs = require('../chunk-ZZ6DP3W4.cjs');
|
|
5
5
|
require('../chunk-GSVXEVM4.cjs');
|
|
6
6
|
require('../chunk-D26YLHTV.cjs');
|
|
7
7
|
require('../chunk-YJG67XL4.cjs');
|
|
@@ -145,7 +145,7 @@ var WhereClauseCanonicalizer = class {
|
|
|
145
145
|
var whereCanonicalizer = new WhereClauseCanonicalizer();
|
|
146
146
|
var orderByCanonicalizer = new OrderByCanonicalizer();
|
|
147
147
|
function computeObjectSetCacheKey(objectSet, options) {
|
|
148
|
-
const keyParts = ["objectSet",
|
|
148
|
+
const keyParts = ["objectSet", chunkZZ6DP3W4_cjs.getWireObjectSet(objectSet)];
|
|
149
149
|
if (!options) {
|
|
150
150
|
return JSON.stringify(keyParts);
|
|
151
151
|
}
|
|
@@ -157,13 +157,13 @@ function computeObjectSetCacheKey(objectSet, options) {
|
|
|
157
157
|
keyParts.push("props", propKeys);
|
|
158
158
|
}
|
|
159
159
|
if (options.union && options.union.length > 0) {
|
|
160
|
-
keyParts.push("union", options.union.map((os) =>
|
|
160
|
+
keyParts.push("union", options.union.map((os) => chunkZZ6DP3W4_cjs.getWireObjectSet(os)));
|
|
161
161
|
}
|
|
162
162
|
if (options.intersect && options.intersect.length > 0) {
|
|
163
|
-
keyParts.push("intersect", options.intersect.map((os) =>
|
|
163
|
+
keyParts.push("intersect", options.intersect.map((os) => chunkZZ6DP3W4_cjs.getWireObjectSet(os)));
|
|
164
164
|
}
|
|
165
165
|
if (options.subtract && options.subtract.length > 0) {
|
|
166
|
-
keyParts.push("subtract", options.subtract.map((os) =>
|
|
166
|
+
keyParts.push("subtract", options.subtract.map((os) => chunkZZ6DP3W4_cjs.getWireObjectSet(os)));
|
|
167
167
|
}
|
|
168
168
|
if (options.pivotTo) {
|
|
169
169
|
keyParts.push("pivotTo", options.pivotTo);
|
|
@@ -230,8 +230,8 @@ var ObservableClientImpl = class {
|
|
|
230
230
|
const instances = [];
|
|
231
231
|
const objectSetWires = [];
|
|
232
232
|
for (const item of options.dependsOnObjects ?? []) {
|
|
233
|
-
if (
|
|
234
|
-
objectSetWires.push(
|
|
233
|
+
if (chunkZZ6DP3W4_cjs.isObjectSet(item)) {
|
|
234
|
+
objectSetWires.push(chunkZZ6DP3W4_cjs.getWireObjectSet(item));
|
|
235
235
|
} else {
|
|
236
236
|
instances.push({
|
|
237
237
|
$apiName: item.$objectType ?? item.$apiName,
|
|
@@ -239,7 +239,7 @@ var ObservableClientImpl = class {
|
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
const objectSetTypesPromise = objectSetWires.length > 0 ? Promise.all(objectSetWires.map((wire) =>
|
|
242
|
+
const objectSetTypesPromise = objectSetWires.length > 0 ? Promise.all(objectSetWires.map((wire) => chunkZZ6DP3W4_cjs.extractObjectOrInterfaceType(this.__experimentalStore.client[chunkZZ6DP3W4_cjs.additionalContext], wire))).then((types) => types.filter((t) => t != null).map((t) => t.apiName)) : void 0;
|
|
243
243
|
return this.__experimentalStore.functions.observe({
|
|
244
244
|
...options,
|
|
245
245
|
queryDef,
|
|
@@ -302,7 +302,7 @@ var ObservableClientImpl = class {
|
|
|
302
302
|
if (!arr || arr.length === 0) {
|
|
303
303
|
return arr;
|
|
304
304
|
}
|
|
305
|
-
const wireStrings = arr.map((os) => JSON.stringify(
|
|
305
|
+
const wireStrings = arr.map((os) => JSON.stringify(chunkZZ6DP3W4_cjs.getWireObjectSet(os)));
|
|
306
306
|
const canonKey = canonicalize(wireStrings);
|
|
307
307
|
let cached = cache.get(canonKey);
|
|
308
308
|
if (!cached) {
|
|
@@ -497,7 +497,7 @@ var OptimisticJob = class {
|
|
|
497
497
|
return this;
|
|
498
498
|
},
|
|
499
499
|
createObject(type, pk, properties) {
|
|
500
|
-
const create = store.client[
|
|
500
|
+
const create = store.client[chunkZZ6DP3W4_cjs.additionalContext].objectFactory2(store.client[chunkZZ6DP3W4_cjs.additionalContext], [{
|
|
501
501
|
$primaryKey: pk,
|
|
502
502
|
$apiName: type.apiName,
|
|
503
503
|
$objectType: type.apiName,
|
|
@@ -964,7 +964,7 @@ var Query = class {
|
|
|
964
964
|
this.store = store;
|
|
965
965
|
this.cacheKeys = store.cacheKeys;
|
|
966
966
|
this.#subject = observable;
|
|
967
|
-
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[
|
|
967
|
+
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkZZ6DP3W4_cjs.additionalContext].logger : store.client[chunkZZ6DP3W4_cjs.additionalContext].logger?.child({}, {
|
|
968
968
|
msgPrefix: process.env.NODE_ENV !== "production" ? `Query<${cacheKey.type}, ${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>` : "Query"
|
|
969
969
|
}));
|
|
970
970
|
}
|
|
@@ -1126,7 +1126,7 @@ var AggregationQuery = class extends Query {
|
|
|
1126
1126
|
#invalidationTypes;
|
|
1127
1127
|
#invalidationTypesPromise;
|
|
1128
1128
|
constructor(store, subject, cacheKey, opts) {
|
|
1129
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1129
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkZZ6DP3W4_cjs.additionalContext].logger?.child({}, {
|
|
1130
1130
|
msgPrefix: `AggregationQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1131
1131
|
}) : void 0);
|
|
1132
1132
|
this.apiName = cacheKey.otherKeys[API_NAME_IDX];
|
|
@@ -1144,7 +1144,7 @@ var AggregationQuery = class extends Query {
|
|
|
1144
1144
|
try {
|
|
1145
1145
|
const {
|
|
1146
1146
|
invalidationSet
|
|
1147
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
1147
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkZZ6DP3W4_cjs.additionalContext], wireObjectSet);
|
|
1148
1148
|
return /* @__PURE__ */ new Set([this.apiName, ...invalidationSet]);
|
|
1149
1149
|
} catch (error) {
|
|
1150
1150
|
this.store.logger?.error("Failed to compute invalidation types for aggregation, falling back to base type only", error);
|
|
@@ -1215,7 +1215,7 @@ var ObjectAggregationQuery = class extends AggregationQuery {
|
|
|
1215
1215
|
};
|
|
1216
1216
|
let objectSet;
|
|
1217
1217
|
if (this.parsedWireObjectSet) {
|
|
1218
|
-
objectSet =
|
|
1218
|
+
objectSet = chunkZZ6DP3W4_cjs.createObjectSet(objectTypeDef, this.store.client[chunkZZ6DP3W4_cjs.additionalContext], this.parsedWireObjectSet);
|
|
1219
1219
|
} else {
|
|
1220
1220
|
objectSet = this.store.client(objectTypeDef);
|
|
1221
1221
|
}
|
|
@@ -1257,7 +1257,7 @@ var AggregationsHelper = class extends AbstractHelper {
|
|
|
1257
1257
|
return this.getOrCreateQuery(options, void 0);
|
|
1258
1258
|
}
|
|
1259
1259
|
getQueryWithObjectSet(options) {
|
|
1260
|
-
const serializedObjectSet = JSON.stringify(
|
|
1260
|
+
const serializedObjectSet = JSON.stringify(chunkZZ6DP3W4_cjs.getWireObjectSet(options.objectSet));
|
|
1261
1261
|
return this.getOrCreateQuery(options, serializedObjectSet);
|
|
1262
1262
|
}
|
|
1263
1263
|
getOrCreateQuery(options, serializedObjectSet) {
|
|
@@ -1580,7 +1580,7 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1580
1580
|
path.push("$:map_end");
|
|
1581
1581
|
return arr;
|
|
1582
1582
|
}
|
|
1583
|
-
if (
|
|
1583
|
+
if (chunk3QMUE6AG_cjs.isObjectSpecifiersObject(value)) {
|
|
1584
1584
|
const objectType = value.$objectType ?? value.$apiName;
|
|
1585
1585
|
path.push("$:osdk", objectType, value.$primaryKey);
|
|
1586
1586
|
return {
|
|
@@ -1588,8 +1588,8 @@ var FunctionParamsCanonicalizer = class {
|
|
|
1588
1588
|
$primaryKey: value.$primaryKey
|
|
1589
1589
|
};
|
|
1590
1590
|
}
|
|
1591
|
-
if (
|
|
1592
|
-
const wire =
|
|
1591
|
+
if (chunkZZ6DP3W4_cjs.isObjectSet(value)) {
|
|
1592
|
+
const wire = chunkZZ6DP3W4_cjs.getWireObjectSet(value);
|
|
1593
1593
|
path.push("$:objectset", wire);
|
|
1594
1594
|
return wire;
|
|
1595
1595
|
}
|
|
@@ -1649,7 +1649,7 @@ var FunctionQuery = class extends Query {
|
|
|
1649
1649
|
#dependsOnObjects;
|
|
1650
1650
|
#queryDef;
|
|
1651
1651
|
constructor(store, subject, queryDef, params, cacheKey, opts, objectSetTypesPromise) {
|
|
1652
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1652
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkZZ6DP3W4_cjs.additionalContext].logger?.child({}, {
|
|
1653
1653
|
msgPrefix: `FunctionQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1654
1654
|
}) : void 0);
|
|
1655
1655
|
this.#apiName = queryDef.apiName;
|
|
@@ -1706,7 +1706,7 @@ var FunctionQuery = class extends Query {
|
|
|
1706
1706
|
}).debug("calling _fetchAndStore");
|
|
1707
1707
|
}
|
|
1708
1708
|
try {
|
|
1709
|
-
const result = await
|
|
1709
|
+
const result = await chunk3QMUE6AG_cjs.applyQuery(this.store.client[chunkZZ6DP3W4_cjs.additionalContext], this.#queryDef, this.#params);
|
|
1710
1710
|
const executedAt = Date.now();
|
|
1711
1711
|
this.store.batch({}, (batch) => {
|
|
1712
1712
|
this.writeToStore({
|
|
@@ -2920,7 +2920,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2920
2920
|
batch.changes.modified.add(this.cacheKey);
|
|
2921
2921
|
}
|
|
2922
2922
|
constructor(store, subject, cacheKey, opts) {
|
|
2923
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
2923
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkZZ6DP3W4_cjs.additionalContext].logger?.child({}, {
|
|
2924
2924
|
msgPrefix: `SpecificLinkQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
2925
2925
|
}) : void 0);
|
|
2926
2926
|
[this.#sourceApiName, this.#sourceTypeKind, this.#sourceUnderlyingObjectType, this.#sourcePk, this.#linkName, this.#whereClause, this.#orderBy] = cacheKey.otherKeys;
|
|
@@ -2934,7 +2934,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
2934
2934
|
*/
|
|
2935
2935
|
async fetchPageData(signal) {
|
|
2936
2936
|
const client = this.store.client;
|
|
2937
|
-
const ontologyProvider = client[
|
|
2937
|
+
const ontologyProvider = client[chunkZZ6DP3W4_cjs.additionalContext].ontologyProvider;
|
|
2938
2938
|
const isInterface = this.#sourceTypeKind === "interface";
|
|
2939
2939
|
if (this.#orderBy && Object.keys(this.#orderBy).length > 0) {
|
|
2940
2940
|
let targetTypeApiName;
|
|
@@ -3045,7 +3045,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
3045
3045
|
}
|
|
3046
3046
|
return (async () => {
|
|
3047
3047
|
try {
|
|
3048
|
-
const ontologyProvider = this.store.client[
|
|
3048
|
+
const ontologyProvider = this.store.client[chunkZZ6DP3W4_cjs.additionalContext].ontologyProvider;
|
|
3049
3049
|
if (this.#sourceTypeKind === "interface") {
|
|
3050
3050
|
const objectMetadata = await ontologyProvider.getObjectDefinition(objectType);
|
|
3051
3051
|
if (this.#sourceApiName in objectMetadata.interfaceMap) {
|
|
@@ -3220,7 +3220,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
3220
3220
|
batch.changes.registerList(this.cacheKey);
|
|
3221
3221
|
}
|
|
3222
3222
|
constructor(store, subject, apiName, cacheKey, opts) {
|
|
3223
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
3223
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkZZ6DP3W4_cjs.additionalContext].logger?.child({}, {
|
|
3224
3224
|
msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
3225
3225
|
}) : void 0);
|
|
3226
3226
|
this.apiName = apiName;
|
|
@@ -3262,10 +3262,10 @@ var ListQuery = class extends BaseListQuery {
|
|
|
3262
3262
|
async fetchPageData(signal) {
|
|
3263
3263
|
const needsResultType = Object.keys(this.#orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy) || this.#pivotInfo != null && this.#intersectWith != null && this.#intersectWith.length > 0 && !this.#pivotIntersectApplied;
|
|
3264
3264
|
if (needsResultType) {
|
|
3265
|
-
const wireObjectSet =
|
|
3265
|
+
const wireObjectSet = chunkZZ6DP3W4_cjs.getWireObjectSet(this.#objectSet);
|
|
3266
3266
|
const {
|
|
3267
3267
|
resultType
|
|
3268
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
3268
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkZZ6DP3W4_cjs.additionalContext], wireObjectSet);
|
|
3269
3269
|
if (Object.keys(this.#orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
3270
3270
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#orderBy);
|
|
3271
3271
|
}
|
|
@@ -3540,7 +3540,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3540
3540
|
type,
|
|
3541
3541
|
apiName: this.apiName
|
|
3542
3542
|
};
|
|
3543
|
-
const clientCtx = store.client[
|
|
3543
|
+
const clientCtx = store.client[chunkZZ6DP3W4_cjs.additionalContext];
|
|
3544
3544
|
let objectSet;
|
|
3545
3545
|
if (rids != null) {
|
|
3546
3546
|
objectSet = clientCtx.objectSetFactory(objectTypeDef, clientCtx, {
|
|
@@ -3579,7 +3579,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3579
3579
|
}
|
|
3580
3580
|
extractRelevantObjects(changes) {
|
|
3581
3581
|
const matchesApiName = ([, object]) => {
|
|
3582
|
-
return this.apiName in object[
|
|
3582
|
+
return this.apiName in object[chunk3QMUE6AG_cjs.ObjectDefRef].interfaceMap;
|
|
3583
3583
|
};
|
|
3584
3584
|
const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
3585
3585
|
const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
@@ -3598,7 +3598,7 @@ var InterfaceListQuery = class extends ListQuery {
|
|
|
3598
3598
|
}
|
|
3599
3599
|
};
|
|
3600
3600
|
function createSourceSetForPivot(store, pivotInfo, rids) {
|
|
3601
|
-
const clientCtx = store.client[
|
|
3601
|
+
const clientCtx = store.client[chunkZZ6DP3W4_cjs.additionalContext];
|
|
3602
3602
|
if (rids != null) {
|
|
3603
3603
|
return clientCtx.objectSetFactory({
|
|
3604
3604
|
type: "object",
|
|
@@ -3653,7 +3653,7 @@ var ObjectListQuery = class extends ListQuery {
|
|
|
3653
3653
|
const intersectWith = this.cacheKey.otherKeys[INTERSECT_IDX2];
|
|
3654
3654
|
const pivotInfo = this.cacheKey.otherKeys[PIVOT_IDX];
|
|
3655
3655
|
const rids = this.cacheKey.otherKeys[RIDS_IDX];
|
|
3656
|
-
const clientCtx = store.client[
|
|
3656
|
+
const clientCtx = store.client[chunkZZ6DP3W4_cjs.additionalContext];
|
|
3657
3657
|
const typeDefinition = {
|
|
3658
3658
|
type: "object",
|
|
3659
3659
|
apiName: this.apiName
|
|
@@ -3799,8 +3799,8 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3799
3799
|
if (rdpFields.size === 0) {
|
|
3800
3800
|
return value;
|
|
3801
3801
|
}
|
|
3802
|
-
const underlying = value[
|
|
3803
|
-
const objectDef = value[
|
|
3802
|
+
const underlying = value[chunk3QMUE6AG_cjs.UnderlyingOsdkObject];
|
|
3803
|
+
const objectDef = value[chunk3QMUE6AG_cjs.ObjectDefRef];
|
|
3804
3804
|
const newProps = {
|
|
3805
3805
|
$apiName: underlying.$apiName,
|
|
3806
3806
|
$objectType: underlying.$objectType,
|
|
@@ -3813,7 +3813,7 @@ function stripRdpFields(value, rdpFields) {
|
|
|
3813
3813
|
newProps[key] = underlying[key];
|
|
3814
3814
|
}
|
|
3815
3815
|
}
|
|
3816
|
-
return
|
|
3816
|
+
return chunk3QMUE6AG_cjs.createOsdkObject(value[chunk3QMUE6AG_cjs.ClientRef], objectDef, newProps);
|
|
3817
3817
|
}
|
|
3818
3818
|
function isSuperset(superset, subset) {
|
|
3819
3819
|
for (const field of subset) {
|
|
@@ -3824,8 +3824,8 @@ function isSuperset(superset, subset) {
|
|
|
3824
3824
|
return true;
|
|
3825
3825
|
}
|
|
3826
3826
|
function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
3827
|
-
const underlying = value[
|
|
3828
|
-
const objectDef = value[
|
|
3827
|
+
const underlying = value[chunk3QMUE6AG_cjs.UnderlyingOsdkObject];
|
|
3828
|
+
const objectDef = value[chunk3QMUE6AG_cjs.ObjectDefRef];
|
|
3829
3829
|
const newProps = {
|
|
3830
3830
|
$apiName: underlying.$apiName,
|
|
3831
3831
|
$objectType: underlying.$objectType,
|
|
@@ -3841,12 +3841,12 @@ function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
|
|
|
3841
3841
|
}
|
|
3842
3842
|
}
|
|
3843
3843
|
}
|
|
3844
|
-
return
|
|
3844
|
+
return chunk3QMUE6AG_cjs.createOsdkObject(value[chunk3QMUE6AG_cjs.ClientRef], objectDef, newProps);
|
|
3845
3845
|
}
|
|
3846
3846
|
function mergeSelectFields(sourceValue, selectFields, existingValue) {
|
|
3847
|
-
const sourceUnderlying = sourceValue[
|
|
3848
|
-
const existingUnderlying = existingValue[
|
|
3849
|
-
const objectDef = sourceValue[
|
|
3847
|
+
const sourceUnderlying = sourceValue[chunk3QMUE6AG_cjs.UnderlyingOsdkObject];
|
|
3848
|
+
const existingUnderlying = existingValue[chunk3QMUE6AG_cjs.UnderlyingOsdkObject];
|
|
3849
|
+
const objectDef = sourceValue[chunk3QMUE6AG_cjs.ObjectDefRef];
|
|
3850
3850
|
const newProps = {
|
|
3851
3851
|
$apiName: sourceUnderlying.$apiName,
|
|
3852
3852
|
$objectType: sourceUnderlying.$objectType,
|
|
@@ -3864,7 +3864,7 @@ function mergeSelectFields(sourceValue, selectFields, existingValue) {
|
|
|
3864
3864
|
newProps[key] = sourceUnderlying[key];
|
|
3865
3865
|
}
|
|
3866
3866
|
}
|
|
3867
|
-
return
|
|
3867
|
+
return chunk3QMUE6AG_cjs.createOsdkObject(sourceValue[chunk3QMUE6AG_cjs.ClientRef], objectDef, newProps);
|
|
3868
3868
|
}
|
|
3869
3869
|
function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, targetCurrentValue) {
|
|
3870
3870
|
if (targetRdpFields.size === 0) {
|
|
@@ -3876,8 +3876,8 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3876
3876
|
}
|
|
3877
3877
|
return filterToRdpFields(sourceValue, targetRdpFields, sourceRdpFields);
|
|
3878
3878
|
}
|
|
3879
|
-
const sourceUnderlying = sourceValue[
|
|
3880
|
-
const objectDef = sourceValue[
|
|
3879
|
+
const sourceUnderlying = sourceValue[chunk3QMUE6AG_cjs.UnderlyingOsdkObject];
|
|
3880
|
+
const objectDef = sourceValue[chunk3QMUE6AG_cjs.ObjectDefRef];
|
|
3881
3881
|
const newProps = {
|
|
3882
3882
|
$apiName: sourceUnderlying.$apiName,
|
|
3883
3883
|
$objectType: sourceUnderlying.$objectType,
|
|
@@ -3891,7 +3891,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3891
3891
|
}
|
|
3892
3892
|
}
|
|
3893
3893
|
if (targetCurrentValue) {
|
|
3894
|
-
const targetUnderlying = targetCurrentValue[
|
|
3894
|
+
const targetUnderlying = targetCurrentValue[chunk3QMUE6AG_cjs.UnderlyingOsdkObject];
|
|
3895
3895
|
for (const field of targetRdpFields) {
|
|
3896
3896
|
if (field in targetUnderlying) {
|
|
3897
3897
|
if (!sourceRdpFields.has(field) || newProps[field] === void 0) {
|
|
@@ -3900,7 +3900,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
|
|
|
3900
3900
|
}
|
|
3901
3901
|
}
|
|
3902
3902
|
}
|
|
3903
|
-
return
|
|
3903
|
+
return chunk3QMUE6AG_cjs.createOsdkObject(sourceValue[chunk3QMUE6AG_cjs.ClientRef], objectDef, newProps);
|
|
3904
3904
|
}
|
|
3905
3905
|
|
|
3906
3906
|
// src/observable/internal/object/ObjectCacheKeyRegistry.ts
|
|
@@ -4055,7 +4055,7 @@ var BulkObjectLoader = class {
|
|
|
4055
4055
|
#maxEntries;
|
|
4056
4056
|
constructor(client, maxWait = 25, maxEntries = 100) {
|
|
4057
4057
|
this.#client = client;
|
|
4058
|
-
this.#logger = client[
|
|
4058
|
+
this.#logger = client[chunkZZ6DP3W4_cjs.additionalContext].logger;
|
|
4059
4059
|
this.#maxWait = maxWait;
|
|
4060
4060
|
this.#maxEntries = maxEntries;
|
|
4061
4061
|
}
|
|
@@ -4205,7 +4205,7 @@ var ObjectQuery = class extends Query {
|
|
|
4205
4205
|
#loadPropertySecurityMetadata;
|
|
4206
4206
|
#implementingTypes;
|
|
4207
4207
|
constructor(store, subject, type, pk, cacheKey, opts, defType = "object", select, loadPropertySecurityMetadata) {
|
|
4208
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
4208
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkZZ6DP3W4_cjs.additionalContext].logger?.child({}, {
|
|
4209
4209
|
msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
4210
4210
|
}) : void 0);
|
|
4211
4211
|
this.#apiName = type;
|
|
@@ -4307,7 +4307,7 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
4307
4307
|
select,
|
|
4308
4308
|
$loadPropertySecurityMetadata
|
|
4309
4309
|
} = options;
|
|
4310
|
-
const defType =
|
|
4310
|
+
const defType = chunk3QMUE6AG_cjs.getDefType(options.apiName);
|
|
4311
4311
|
const objectCacheKey = this.cacheKeys.get("object", apiName, pk, rdpConfig ?? void 0);
|
|
4312
4312
|
return this.store.queries.get(objectCacheKey, () => new ObjectQuery(this.store, this.store.subjects.get(objectCacheKey), apiName, pk, objectCacheKey, {
|
|
4313
4313
|
dedupeInterval: 0
|
|
@@ -4345,7 +4345,7 @@ var ObjectsHelper = class extends AbstractHelper {
|
|
|
4345
4345
|
if (valueToWrite !== tombstone && existing?.value && this.isObjectHolder(existing.value)) {
|
|
4346
4346
|
const expectedRdpFields = this.store.objectCacheKeyRegistry.getRdpFieldSet(sourceCacheKey);
|
|
4347
4347
|
if (expectedRdpFields.size > 0) {
|
|
4348
|
-
const underlying = valueToWrite[
|
|
4348
|
+
const underlying = valueToWrite[chunk3QMUE6AG_cjs.UnderlyingOsdkObject];
|
|
4349
4349
|
const actualRdpFields = /* @__PURE__ */ new Set();
|
|
4350
4350
|
for (const field of expectedRdpFields) {
|
|
4351
4351
|
if (underlying && field in underlying) {
|
|
@@ -4415,7 +4415,7 @@ var ObjectSetQuery = class _ObjectSetQuery extends BaseListQuery {
|
|
|
4415
4415
|
#requiresServerEvaluation;
|
|
4416
4416
|
#resultTypeApiName;
|
|
4417
4417
|
constructor(store, subject, baseObjectSetWire, operations, cacheKey, opts) {
|
|
4418
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
4418
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkZZ6DP3W4_cjs.additionalContext].logger?.child({}, {
|
|
4419
4419
|
msgPrefix: `ObjectSetQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
4420
4420
|
}) : void 0);
|
|
4421
4421
|
this.#baseObjectSetWire = baseObjectSetWire;
|
|
@@ -4483,7 +4483,7 @@ var ObjectSetQuery = class _ObjectSetQuery extends BaseListQuery {
|
|
|
4483
4483
|
return;
|
|
4484
4484
|
}
|
|
4485
4485
|
for (const os of sets) {
|
|
4486
|
-
const typeName = _ObjectSetQuery.#extractTypeFromWireObjectSet(
|
|
4486
|
+
const typeName = _ObjectSetQuery.#extractTypeFromWireObjectSet(chunkZZ6DP3W4_cjs.getWireObjectSet(os));
|
|
4487
4487
|
if (typeName) {
|
|
4488
4488
|
types.add(typeName);
|
|
4489
4489
|
}
|
|
@@ -4510,10 +4510,10 @@ var ObjectSetQuery = class _ObjectSetQuery extends BaseListQuery {
|
|
|
4510
4510
|
*/
|
|
4511
4511
|
async fetchPageData(signal) {
|
|
4512
4512
|
if (this.#operations.orderBy && Object.keys(this.#operations.orderBy).length > 0 && !(this.sortingStrategy instanceof OrderBySortingStrategy)) {
|
|
4513
|
-
const wireObjectSet =
|
|
4513
|
+
const wireObjectSet = chunkZZ6DP3W4_cjs.getWireObjectSet(this.#composedObjectSet);
|
|
4514
4514
|
const {
|
|
4515
4515
|
resultType
|
|
4516
|
-
} = await getObjectTypesThatInvalidate(this.store.client[
|
|
4516
|
+
} = await getObjectTypesThatInvalidate(this.store.client[chunkZZ6DP3W4_cjs.additionalContext], wireObjectSet);
|
|
4517
4517
|
this.sortingStrategy = new OrderBySortingStrategy(resultType.apiName, this.#operations.orderBy);
|
|
4518
4518
|
}
|
|
4519
4519
|
const resp = await this.#composedObjectSet.fetchPage({
|
|
@@ -4734,7 +4734,7 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
4734
4734
|
const {
|
|
4735
4735
|
baseObjectSet
|
|
4736
4736
|
} = options;
|
|
4737
|
-
const baseObjectSetWire = JSON.stringify(
|
|
4737
|
+
const baseObjectSetWire = JSON.stringify(chunkZZ6DP3W4_cjs.getWireObjectSet(baseObjectSet));
|
|
4738
4738
|
const operations = this.buildCanonicalizedOperations(options);
|
|
4739
4739
|
const objectSetCacheKey = this.cacheKeys.get("objectSet", baseObjectSetWire, operations);
|
|
4740
4740
|
return this.store.queries.get(objectSetCacheKey, () => {
|
|
@@ -4750,13 +4750,13 @@ var ObjectSetHelper = class extends AbstractHelper {
|
|
|
4750
4750
|
operations.withProperties = this.rdpCanonicalizer.canonicalize(options.withProperties);
|
|
4751
4751
|
}
|
|
4752
4752
|
if (options.union && options.union.length > 0) {
|
|
4753
|
-
operations.union = this.objectSetArrayCanonicalizer.canonicalizeUnion(options.union.map((os) => JSON.stringify(
|
|
4753
|
+
operations.union = this.objectSetArrayCanonicalizer.canonicalizeUnion(options.union.map((os) => JSON.stringify(chunkZZ6DP3W4_cjs.getWireObjectSet(os))));
|
|
4754
4754
|
}
|
|
4755
4755
|
if (options.intersect && options.intersect.length > 0) {
|
|
4756
|
-
operations.intersect = this.objectSetArrayCanonicalizer.canonicalizeIntersect(options.intersect.map((os) => JSON.stringify(
|
|
4756
|
+
operations.intersect = this.objectSetArrayCanonicalizer.canonicalizeIntersect(options.intersect.map((os) => JSON.stringify(chunkZZ6DP3W4_cjs.getWireObjectSet(os))));
|
|
4757
4757
|
}
|
|
4758
4758
|
if (options.subtract && options.subtract.length > 0) {
|
|
4759
|
-
operations.subtract = this.objectSetArrayCanonicalizer.canonicalizeSubtract(options.subtract.map((os) => JSON.stringify(
|
|
4759
|
+
operations.subtract = this.objectSetArrayCanonicalizer.canonicalizeSubtract(options.subtract.map((os) => JSON.stringify(chunkZZ6DP3W4_cjs.getWireObjectSet(os))));
|
|
4760
4760
|
}
|
|
4761
4761
|
if (options.pivotTo) {
|
|
4762
4762
|
operations.pivotTo = options.pivotTo;
|
|
@@ -4849,7 +4849,7 @@ var RdpCanonicalizer = class extends CachingCanonicalizer {
|
|
|
4849
4849
|
apiName: "__rdp_canonicalizer_holder__"
|
|
4850
4850
|
};
|
|
4851
4851
|
for (const [key, rdpFunction] of Object.entries(rdp)) {
|
|
4852
|
-
const builder =
|
|
4852
|
+
const builder = chunkZZ6DP3W4_cjs.createWithPropertiesObjectSet(
|
|
4853
4853
|
objectTypeHolder,
|
|
4854
4854
|
{
|
|
4855
4855
|
type: "methodInput"
|
|
@@ -4948,7 +4948,7 @@ var Store = class {
|
|
|
4948
4948
|
subjects = this.layers.subjects;
|
|
4949
4949
|
// these are hopefully temporary
|
|
4950
4950
|
constructor(client) {
|
|
4951
|
-
this.logger = client[
|
|
4951
|
+
this.logger = client[chunkZZ6DP3W4_cjs.additionalContext].logger?.child({}, {
|
|
4952
4952
|
msgPrefix: "Store"
|
|
4953
4953
|
});
|
|
4954
4954
|
this.client = client;
|
|
@@ -5246,10 +5246,10 @@ var Store = class {
|
|
|
5246
5246
|
|
|
5247
5247
|
// src/observable/ObservableClient.ts
|
|
5248
5248
|
function createObservableClient(client) {
|
|
5249
|
-
const tweakedClient =
|
|
5250
|
-
...client[
|
|
5251
|
-
fetch: shared_net_fetch.createFetchHeaderMutator(client[
|
|
5252
|
-
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"),
|
|
5249
|
+
const tweakedClient = chunk3QMUE6AG_cjs.createClientFromContext({
|
|
5250
|
+
...client[chunkZZ6DP3W4_cjs.additionalContext],
|
|
5251
|
+
fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkZZ6DP3W4_cjs.additionalContext].fetch, (headers) => {
|
|
5252
|
+
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunk3QMUE6AG_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
|
|
5253
5253
|
return headers;
|
|
5254
5254
|
})
|
|
5255
5255
|
});
|
|
@@ -5292,19 +5292,19 @@ function getOsdkConfig(ontologyRid) {
|
|
|
5292
5292
|
|
|
5293
5293
|
Object.defineProperty(exports, "createClientWithTransaction", {
|
|
5294
5294
|
enumerable: true,
|
|
5295
|
-
get: function () { return
|
|
5295
|
+
get: function () { return chunk3QMUE6AG_cjs.createClientWithTransaction; }
|
|
5296
5296
|
});
|
|
5297
5297
|
Object.defineProperty(exports, "augment", {
|
|
5298
5298
|
enumerable: true,
|
|
5299
|
-
get: function () { return
|
|
5299
|
+
get: function () { return chunkZZ6DP3W4_cjs.augment; }
|
|
5300
5300
|
});
|
|
5301
5301
|
Object.defineProperty(exports, "getWireObjectSet", {
|
|
5302
5302
|
enumerable: true,
|
|
5303
|
-
get: function () { return
|
|
5303
|
+
get: function () { return chunkZZ6DP3W4_cjs.getWireObjectSet; }
|
|
5304
5304
|
});
|
|
5305
5305
|
Object.defineProperty(exports, "isObjectSet", {
|
|
5306
5306
|
enumerable: true,
|
|
5307
|
-
get: function () { return
|
|
5307
|
+
get: function () { return chunkZZ6DP3W4_cjs.isObjectSet; }
|
|
5308
5308
|
});
|
|
5309
5309
|
exports.computeObjectSetCacheKey = computeObjectSetCacheKey;
|
|
5310
5310
|
exports.createObservableClient = createObservableClient;
|
|
@@ -46,9 +46,16 @@ export function get$linkForInterface(holder) {
|
|
|
46
46
|
const objectSet = client.objectSetFactory(interfaceDef, client).intersect(client.objectSetFactory(objDef, client).where({
|
|
47
47
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
48
48
|
})).pivotTo(linkName);
|
|
49
|
+
const linkTargetDef = linkDef.targetType === "object" ? {
|
|
50
|
+
type: "object",
|
|
51
|
+
apiName: linkDef.targetTypeApiName
|
|
52
|
+
} : {
|
|
53
|
+
type: "interface",
|
|
54
|
+
apiName: linkDef.targetTypeApiName
|
|
55
|
+
};
|
|
49
56
|
const value = !linkDef.multiplicity ? {
|
|
50
|
-
fetchOne: options => fetchSingle(client,
|
|
51
|
-
fetchOneWithErrors: options => fetchSingleWithErrors(client,
|
|
57
|
+
fetchOne: options => fetchSingle(client, linkTargetDef, options ?? {}, getWireObjectSet(objectSet)),
|
|
58
|
+
fetchOneWithErrors: options => fetchSingleWithErrors(client, linkTargetDef, options ?? {}, getWireObjectSet(objectSet))
|
|
52
59
|
} : objectSet;
|
|
53
60
|
return [linkName, value];
|
|
54
61
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDollarLink.js","names":["getWireObjectSet","fetchSingle","fetchSingleWithErrors","ClientRef","InterfaceDefRef","ObjectDefRef","UnderlyingOsdkObject","get$link","holder","client","objDef","rawObj","Object","freeze","fromEntries","keys","links","map","linkName","linkDef","objectSet","objectSetFactory","where","primaryKeyApiName","$primaryKey","pivotTo","value","multiplicity","fetchOne","options","fetchOneWithErrors","get$linkForInterface","interfaceDef","intersect"],"sources":["getDollarLink.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectSet,\n OsdkObjectLinksObject,\n SelectArg,\n SingleLinkAccessor,\n WhereClause,\n} from \"@osdk/api\";\nimport { getWireObjectSet } from \"../../objectSet/createObjectSet.js\";\nimport { fetchSingle, fetchSingleWithErrors } from \"../fetchSingle.js\";\nimport type { InterfaceHolder } from \"./InterfaceHolder.js\";\nimport {\n ClientRef,\n InterfaceDefRef,\n ObjectDefRef,\n UnderlyingOsdkObject,\n} from \"./InternalSymbols.js\";\nimport type { ObjectHolder } from \"./ObjectHolder.js\";\n\n/** @internal */\nexport function get$link(\n holder: ObjectHolder,\n): OsdkObjectLinksObject<any> {\n const client = holder[ClientRef];\n const objDef = holder[ObjectDefRef];\n const rawObj = holder[UnderlyingOsdkObject];\n return Object.freeze(Object.fromEntries(\n Object.keys(objDef.links).map(\n (linkName) => {\n const linkDef = objDef.links[linkName as keyof typeof objDef.links];\n const objectSet =\n (client.objectSetFactory(objDef, client) as ObjectSet<any>)\n .where({\n [objDef.primaryKeyApiName]: rawObj.$primaryKey,\n } as WhereClause<any>)\n .pivotTo(linkName);\n\n const value = !linkDef.multiplicity\n ? {\n fetchOne: <A extends SelectArg<any, any, any, any>>(\n options?: A,\n ) =>\n fetchSingle(\n client,\n objDef,\n options ?? {},\n getWireObjectSet(objectSet),\n ),\n fetchOneWithErrors: <A extends SelectArg<any, any, any, any>>(\n options?: A,\n ) =>\n fetchSingleWithErrors(\n client,\n objDef,\n options ?? {},\n getWireObjectSet(objectSet),\n ),\n } as SingleLinkAccessor<any>\n : objectSet;\n\n return [linkName, value];\n },\n ),\n ));\n}\n\n/** @internal */\nexport function get$linkForInterface(\n holder: InterfaceHolder,\n): OsdkObjectLinksObject<any> {\n const client = holder[UnderlyingOsdkObject][ClientRef];\n const objDef = holder[UnderlyingOsdkObject][ObjectDefRef];\n const interfaceDef = holder[InterfaceDefRef];\n const rawObj = holder[UnderlyingOsdkObject];\n return Object.freeze(Object.fromEntries(\n Object.keys(interfaceDef.links).map(\n (linkName) => {\n const linkDef =\n interfaceDef.links[linkName as keyof typeof objDef.links];\n const objectSet =\n (client.objectSetFactory(interfaceDef, client) as ObjectSet<any>)\n .intersect(\n (client.objectSetFactory(objDef, client) as ObjectSet<any>)\n .where({\n [objDef.primaryKeyApiName]: rawObj.$primaryKey,\n } as WhereClause<any>),\n )\n .pivotTo(linkName);\n\n const value = !linkDef.multiplicity\n ? {\n fetchOne: <A extends SelectArg<any, any, any, any>>(\n options?: A,\n ) =>\n fetchSingle(\n client,\n
|
|
1
|
+
{"version":3,"file":"getDollarLink.js","names":["getWireObjectSet","fetchSingle","fetchSingleWithErrors","ClientRef","InterfaceDefRef","ObjectDefRef","UnderlyingOsdkObject","get$link","holder","client","objDef","rawObj","Object","freeze","fromEntries","keys","links","map","linkName","linkDef","objectSet","objectSetFactory","where","primaryKeyApiName","$primaryKey","pivotTo","value","multiplicity","fetchOne","options","fetchOneWithErrors","get$linkForInterface","interfaceDef","intersect","linkTargetDef","targetType","type","apiName","targetTypeApiName"],"sources":["getDollarLink.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectSet,\n OsdkObjectLinksObject,\n SelectArg,\n SingleLinkAccessor,\n WhereClause,\n} from \"@osdk/api\";\nimport { getWireObjectSet } from \"../../objectSet/createObjectSet.js\";\nimport { fetchSingle, fetchSingleWithErrors } from \"../fetchSingle.js\";\nimport type { InterfaceHolder } from \"./InterfaceHolder.js\";\nimport {\n ClientRef,\n InterfaceDefRef,\n ObjectDefRef,\n UnderlyingOsdkObject,\n} from \"./InternalSymbols.js\";\nimport type { ObjectHolder } from \"./ObjectHolder.js\";\n\n/** @internal */\nexport function get$link(\n holder: ObjectHolder,\n): OsdkObjectLinksObject<any> {\n const client = holder[ClientRef];\n const objDef = holder[ObjectDefRef];\n const rawObj = holder[UnderlyingOsdkObject];\n return Object.freeze(Object.fromEntries(\n Object.keys(objDef.links).map(\n (linkName) => {\n const linkDef = objDef.links[linkName as keyof typeof objDef.links];\n const objectSet =\n (client.objectSetFactory(objDef, client) as ObjectSet<any>)\n .where({\n [objDef.primaryKeyApiName]: rawObj.$primaryKey,\n } as WhereClause<any>)\n .pivotTo(linkName);\n\n const value = !linkDef.multiplicity\n ? {\n fetchOne: <A extends SelectArg<any, any, any, any>>(\n options?: A,\n ) =>\n fetchSingle(\n client,\n objDef,\n options ?? {},\n getWireObjectSet(objectSet),\n ),\n fetchOneWithErrors: <A extends SelectArg<any, any, any, any>>(\n options?: A,\n ) =>\n fetchSingleWithErrors(\n client,\n objDef,\n options ?? {},\n getWireObjectSet(objectSet),\n ),\n } as SingleLinkAccessor<any>\n : objectSet;\n\n return [linkName, value];\n },\n ),\n ));\n}\n\n/** @internal */\nexport function get$linkForInterface(\n holder: InterfaceHolder,\n): OsdkObjectLinksObject<any> {\n const client = holder[UnderlyingOsdkObject][ClientRef];\n const objDef = holder[UnderlyingOsdkObject][ObjectDefRef];\n const interfaceDef = holder[InterfaceDefRef];\n const rawObj = holder[UnderlyingOsdkObject];\n return Object.freeze(Object.fromEntries(\n Object.keys(interfaceDef.links).map(\n (linkName) => {\n const linkDef =\n interfaceDef.links[linkName as keyof typeof objDef.links];\n const objectSet =\n (client.objectSetFactory(interfaceDef, client) as ObjectSet<any>)\n .intersect(\n (client.objectSetFactory(objDef, client) as ObjectSet<any>)\n .where({\n [objDef.primaryKeyApiName]: rawObj.$primaryKey,\n } as WhereClause<any>),\n )\n .pivotTo(linkName);\n\n const linkTargetDef = linkDef.targetType === \"object\"\n ? { type: \"object\" as const, apiName: linkDef.targetTypeApiName }\n : { type: \"interface\" as const, apiName: linkDef.targetTypeApiName };\n\n const value = !linkDef.multiplicity\n ? {\n fetchOne: <A extends SelectArg<any, any, any, any>>(\n options?: A,\n ) =>\n fetchSingle(\n client,\n linkTargetDef,\n options ?? {},\n getWireObjectSet(objectSet),\n ),\n fetchOneWithErrors: <A extends SelectArg<any, any, any, any>>(\n options?: A,\n ) =>\n fetchSingleWithErrors(\n client,\n linkTargetDef,\n options ?? {},\n getWireObjectSet(objectSet),\n ),\n } as SingleLinkAccessor<any>\n : objectSet;\n\n return [linkName, value];\n },\n ),\n ));\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -24,6 +24,26 @@ import { augmentRequestContext } from "../util/augmentRequestContext.js";
|
|
|
24
24
|
import { resolveBaseObjectSetType } from "../util/objectSetUtils.js";
|
|
25
25
|
import { isWireObjectSet } from "../util/WireObjectSet.js";
|
|
26
26
|
import { fetchLinksPage } from "./fetchLinksPage.js";
|
|
27
|
+
const a = {
|
|
28
|
+
"type": "interfaceLinkSearchAround",
|
|
29
|
+
"interfaceLink": "lead",
|
|
30
|
+
"objectSet": {
|
|
31
|
+
"type": "asType",
|
|
32
|
+
"entityType": "Person",
|
|
33
|
+
"objectSet": {
|
|
34
|
+
"type": "filter",
|
|
35
|
+
"objectSet": {
|
|
36
|
+
"type": "base",
|
|
37
|
+
"objectType": "Employee"
|
|
38
|
+
},
|
|
39
|
+
"where": {
|
|
40
|
+
"type": "eq",
|
|
41
|
+
"field": "employeeNumber",
|
|
42
|
+
"value": "657495107"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
27
47
|
function isObjectTypeDefinition(def) {
|
|
28
48
|
return def.type === "object";
|
|
29
49
|
}
|
|
@@ -52,11 +72,11 @@ export function createObjectSet(objectType, clientCtx, objectSet = resolveBaseOb
|
|
|
52
72
|
where: clause => {
|
|
53
73
|
return clientCtx.objectSetFactory(objectType, clientCtx, {
|
|
54
74
|
type: "filter",
|
|
55
|
-
objectSet
|
|
75
|
+
objectSet,
|
|
56
76
|
where: modernToLegacyWhereClause(clause, objectType)
|
|
57
77
|
});
|
|
58
78
|
},
|
|
59
|
-
pivotTo
|
|
79
|
+
pivotTo(type) {
|
|
60
80
|
return createSearchAround(type)();
|
|
61
81
|
},
|
|
62
82
|
union: (...objectSets) => {
|
|
@@ -96,8 +116,8 @@ export function createObjectSet(objectType, clientCtx, objectSet = resolveBaseOb
|
|
|
96
116
|
query: nearestNeighborsQuery
|
|
97
117
|
});
|
|
98
118
|
},
|
|
99
|
-
|
|
100
|
-
let $nextPageToken
|
|
119
|
+
async *asyncIter(args) {
|
|
120
|
+
let $nextPageToken;
|
|
101
121
|
do {
|
|
102
122
|
const result = await fetchPageInternal(augmentRequestContext(clientCtx, () => ({
|
|
103
123
|
finalMethodCall: "asyncIter"
|
|
@@ -141,8 +161,8 @@ export function createObjectSet(objectType, clientCtx, objectSet = resolveBaseOb
|
|
|
141
161
|
}
|
|
142
162
|
return clientCtx.objectSetFactory(objectType, clientCtx, {
|
|
143
163
|
type: "withProperties",
|
|
144
|
-
derivedProperties
|
|
145
|
-
objectSet
|
|
164
|
+
derivedProperties,
|
|
165
|
+
objectSet
|
|
146
166
|
});
|
|
147
167
|
},
|
|
148
168
|
narrowToType: objectTypeDef => {
|
|
@@ -151,12 +171,12 @@ export function createObjectSet(objectType, clientCtx, objectSet = resolveBaseOb
|
|
|
151
171
|
clientCtx.narrowTypeInterfaceOrObjectMapping[objectTypeDef.apiName] = objectTypeDef.type;
|
|
152
172
|
return clientCtx.objectSetFactory(objectTypeDef, clientCtx, {
|
|
153
173
|
type: "asType",
|
|
154
|
-
objectSet
|
|
174
|
+
objectSet,
|
|
155
175
|
entityType: objectTypeDef.apiName
|
|
156
176
|
});
|
|
157
177
|
},
|
|
158
|
-
|
|
159
|
-
let $nextPageToken
|
|
178
|
+
async *experimental_asyncIterLinks(links) {
|
|
179
|
+
let $nextPageToken;
|
|
160
180
|
do {
|
|
161
181
|
const result = await fetchLinksPage(augmentRequestContext(clientCtx, () => ({
|
|
162
182
|
finalMethodCall: "asyncIterLinks"
|
|
@@ -194,7 +214,7 @@ async function createWithPk(clientCtx, objectType, objectSet, primaryKey) {
|
|
|
194
214
|
const objDef = await clientCtx.ontologyProvider.getObjectDefinition(objectType.apiName);
|
|
195
215
|
const withPk = {
|
|
196
216
|
type: "filter",
|
|
197
|
-
objectSet
|
|
217
|
+
objectSet,
|
|
198
218
|
where: {
|
|
199
219
|
type: "eq",
|
|
200
220
|
field: objDef.primaryKeyApiName,
|