@osdk/client 2.2.0-rc.24 → 2.3.0-beta.2
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 +4 -9
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +41 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js +145 -12
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js +93 -0
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
- package/build/browser/objectSet/ObjectSet.test.js +85 -106
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-GTDO4U7H.cjs → chunk-JEHRAVC5.cjs} +143 -31
- package/build/cjs/chunk-JEHRAVC5.cjs.map +1 -0
- package/build/cjs/{chunk-W5PFESFR.cjs → chunk-ZV5KKQ4R.cjs} +2 -2
- package/build/cjs/{chunk-W5PFESFR.cjs.map → chunk-ZV5KKQ4R.cjs.map} +1 -1
- package/build/cjs/index.cjs +47 -47
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +8 -8
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +41 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js +145 -12
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js +93 -0
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
- package/build/esm/objectSet/ObjectSet.test.js +85 -106
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts +1 -0
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts.map +1 -0
- package/package.json +11 -11
- package/build/cjs/chunk-GTDO4U7H.cjs.map +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZV5KKQ4R_cjs = require('./chunk-ZV5KKQ4R.cjs');
|
|
4
4
|
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
5
|
-
var
|
|
5
|
+
var invariant3 = require('tiny-invariant');
|
|
6
6
|
var api = require('@osdk/api');
|
|
7
7
|
var WebSocket = require('isomorphic-ws');
|
|
8
8
|
|
|
9
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var invariant3__default = /*#__PURE__*/_interopDefault(invariant3);
|
|
12
12
|
var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
|
|
13
13
|
|
|
14
14
|
// src/public-utils/hydrateAttachmentFromRid.ts
|
|
15
15
|
function hydrateAttachmentFromRid(client, rid) {
|
|
16
|
-
return hydrateAttachmentFromRidInternal(client[
|
|
16
|
+
return hydrateAttachmentFromRidInternal(client[chunkZV5KKQ4R_cjs.additionalContext], rid);
|
|
17
17
|
}
|
|
18
18
|
function hydrateAttachmentFromRidInternal(client, rid) {
|
|
19
19
|
return {
|
|
20
20
|
rid,
|
|
21
21
|
async fetchContents() {
|
|
22
|
-
return
|
|
22
|
+
return chunkZV5KKQ4R_cjs.Attachment_exports.read(client, rid);
|
|
23
23
|
},
|
|
24
24
|
async fetchMetadata() {
|
|
25
|
-
const r = await
|
|
25
|
+
const r = await chunkZV5KKQ4R_cjs.Attachment_exports.get(client, rid);
|
|
26
26
|
return {
|
|
27
27
|
...r,
|
|
28
28
|
sizeBytes: Number(r.sizeBytes)
|
|
@@ -98,7 +98,7 @@ var MinimalLogger = class _MinimalLogger extends BaseLogger {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
async function fetchSingle(client, objectType, args, objectSet) {
|
|
101
|
-
const result = await
|
|
101
|
+
const result = await chunkZV5KKQ4R_cjs.fetchPage(client, objectType, {
|
|
102
102
|
...args,
|
|
103
103
|
$pageSize: 1
|
|
104
104
|
}, objectSet);
|
|
@@ -193,7 +193,7 @@ function makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field
|
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
function handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector) {
|
|
196
|
-
!(filter != null) ? process.env.NODE_ENV !== "production" ?
|
|
196
|
+
!(filter != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Defined key values are only allowed when they are not undefined.") : invariant3__default.default(false) : void 0;
|
|
197
197
|
const propertyIdentifier = structFieldSelector != null ? {
|
|
198
198
|
type: "structField",
|
|
199
199
|
...structFieldSelector,
|
|
@@ -212,10 +212,10 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
|
|
|
212
212
|
}
|
|
213
213
|
const keysOfFilter = Object.keys(filter);
|
|
214
214
|
const hasDollarSign = keysOfFilter.some((key) => key.startsWith("$"));
|
|
215
|
-
!(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
215
|
+
!(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.") : invariant3__default.default(false) : void 0;
|
|
216
216
|
if (!hasDollarSign) {
|
|
217
217
|
const structFilter = Object.entries(filter);
|
|
218
|
-
!(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
218
|
+
!(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant3__default.default(false) : void 0;
|
|
219
219
|
const structFieldApiName = keysOfFilter[0];
|
|
220
220
|
return handleWherePair(Object.entries(filter)[0], objectOrInterface, {
|
|
221
221
|
propertyApiName: fieldName,
|
|
@@ -223,7 +223,7 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
const firstKey = keysOfFilter[0];
|
|
226
|
-
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ?
|
|
226
|
+
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false) : invariant3__default.default(false) : void 0;
|
|
227
227
|
if (firstKey === "$ne") {
|
|
228
228
|
return {
|
|
229
229
|
type: "not",
|
|
@@ -305,6 +305,79 @@ function fullyQualifyPropName(fieldName, objectOrInterface) {
|
|
|
305
305
|
}
|
|
306
306
|
return fieldName;
|
|
307
307
|
}
|
|
308
|
+
function derivedPropertyDefinitionFactory(wireDefinition, definitionMap) {
|
|
309
|
+
const definition = {
|
|
310
|
+
abs() {
|
|
311
|
+
return derivedPropertyDefinitionFactory({
|
|
312
|
+
type: "absoluteValue",
|
|
313
|
+
property: wireDefinition
|
|
314
|
+
}, definitionMap);
|
|
315
|
+
},
|
|
316
|
+
negate() {
|
|
317
|
+
return derivedPropertyDefinitionFactory({
|
|
318
|
+
type: "negate",
|
|
319
|
+
property: wireDefinition
|
|
320
|
+
}, definitionMap);
|
|
321
|
+
},
|
|
322
|
+
max(value) {
|
|
323
|
+
return derivedPropertyDefinitionFactory({
|
|
324
|
+
type: "greatest",
|
|
325
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
326
|
+
}, definitionMap);
|
|
327
|
+
},
|
|
328
|
+
min(value) {
|
|
329
|
+
return derivedPropertyDefinitionFactory({
|
|
330
|
+
type: "least",
|
|
331
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
332
|
+
}, definitionMap);
|
|
333
|
+
},
|
|
334
|
+
add(value) {
|
|
335
|
+
return derivedPropertyDefinitionFactory({
|
|
336
|
+
type: "add",
|
|
337
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
338
|
+
}, definitionMap);
|
|
339
|
+
},
|
|
340
|
+
subtract(value) {
|
|
341
|
+
return derivedPropertyDefinitionFactory({
|
|
342
|
+
"type": "subtract",
|
|
343
|
+
"left": wireDefinition,
|
|
344
|
+
"right": getDefinitionFromMap(value, definitionMap)
|
|
345
|
+
}, definitionMap);
|
|
346
|
+
},
|
|
347
|
+
multiply(value) {
|
|
348
|
+
return derivedPropertyDefinitionFactory({
|
|
349
|
+
type: "multiply",
|
|
350
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
351
|
+
}, definitionMap);
|
|
352
|
+
},
|
|
353
|
+
divide(value) {
|
|
354
|
+
return derivedPropertyDefinitionFactory({
|
|
355
|
+
"type": "subtract",
|
|
356
|
+
"left": wireDefinition,
|
|
357
|
+
"right": getDefinitionFromMap(value, definitionMap)
|
|
358
|
+
}, definitionMap);
|
|
359
|
+
},
|
|
360
|
+
extractPart: (part) => {
|
|
361
|
+
return derivedPropertyDefinitionFactory({
|
|
362
|
+
type: "extract",
|
|
363
|
+
part,
|
|
364
|
+
property: wireDefinition
|
|
365
|
+
}, definitionMap);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
definitionMap.set(definition, wireDefinition);
|
|
369
|
+
return definition;
|
|
370
|
+
}
|
|
371
|
+
var getDefinitionFromMap = (arg, definitionMap) => {
|
|
372
|
+
if (typeof arg === "object") {
|
|
373
|
+
const definition = definitionMap.get(arg);
|
|
374
|
+
!definition ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Derived Property is not defined") : invariant3__default.default(false) : void 0;
|
|
375
|
+
return definition;
|
|
376
|
+
} else if (typeof arg === "number") {
|
|
377
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Literals for derived properties are not yet supported") : invariant3__default.default(false) ;
|
|
378
|
+
}
|
|
379
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Invalid argument type for a derived property") : invariant3__default.default(false) ;
|
|
380
|
+
};
|
|
308
381
|
|
|
309
382
|
// src/derivedProperties/createWithPropertiesObjectSet.ts
|
|
310
383
|
function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fromBaseObjectSet = false) {
|
|
@@ -325,7 +398,7 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
|
|
|
325
398
|
},
|
|
326
399
|
aggregate: (aggregation, opt) => {
|
|
327
400
|
const splitAggregation = aggregation.split(":");
|
|
328
|
-
!(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ?
|
|
401
|
+
!(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Invalid aggregation format") : invariant3__default.default(false) : void 0;
|
|
329
402
|
const [aggregationPropertyName, aggregationOperation] = splitAggregation;
|
|
330
403
|
let aggregationOperationDefinition;
|
|
331
404
|
switch (aggregationOperation) {
|
|
@@ -363,16 +436,55 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
|
|
|
363
436
|
break;
|
|
364
437
|
}
|
|
365
438
|
default:
|
|
366
|
-
process.env.NODE_ENV !== "production" ?
|
|
439
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Invalid aggregation operation " + aggregationOperation) : invariant3__default.default(false) ;
|
|
367
440
|
}
|
|
368
441
|
const wrappedObjectSet = {
|
|
369
442
|
type: "selection",
|
|
370
443
|
objectSet,
|
|
371
444
|
operation: aggregationOperationDefinition
|
|
372
445
|
};
|
|
373
|
-
const selectorResult =
|
|
446
|
+
const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);
|
|
374
447
|
definitionMap.set(selectorResult, wrappedObjectSet);
|
|
375
448
|
return selectorResult;
|
|
449
|
+
},
|
|
450
|
+
selectProperty: (name) => {
|
|
451
|
+
if (fromBaseObjectSet) {
|
|
452
|
+
const wrappedObjectSet2 = {
|
|
453
|
+
type: "property",
|
|
454
|
+
apiName: name
|
|
455
|
+
};
|
|
456
|
+
const selectorResult2 = derivedPropertyDefinitionFactory(wrappedObjectSet2, definitionMap);
|
|
457
|
+
definitionMap.set(selectorResult2, wrappedObjectSet2);
|
|
458
|
+
return selectorResult2;
|
|
459
|
+
}
|
|
460
|
+
const wrappedObjectSet = {
|
|
461
|
+
type: "selection",
|
|
462
|
+
objectSet,
|
|
463
|
+
operation: {
|
|
464
|
+
type: "get",
|
|
465
|
+
selectedPropertyApiName: name
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);
|
|
469
|
+
definitionMap.set(selectorResult, wrappedObjectSet);
|
|
470
|
+
return selectorResult;
|
|
471
|
+
},
|
|
472
|
+
constant: {
|
|
473
|
+
double: (value) => {
|
|
474
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Not supported") : invariant3__default.default(false) ;
|
|
475
|
+
},
|
|
476
|
+
integer: (value) => {
|
|
477
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Not supported") : invariant3__default.default(false) ;
|
|
478
|
+
},
|
|
479
|
+
long: (value) => {
|
|
480
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Not supported") : invariant3__default.default(false) ;
|
|
481
|
+
},
|
|
482
|
+
datetime: (value) => {
|
|
483
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Not supported") : invariant3__default.default(false) ;
|
|
484
|
+
},
|
|
485
|
+
timestamp: (value) => {
|
|
486
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Not supported") : invariant3__default.default(false) ;
|
|
487
|
+
}
|
|
376
488
|
}
|
|
377
489
|
};
|
|
378
490
|
}
|
|
@@ -382,7 +494,7 @@ function legacyToModernSingleAggregationResult(entry) {
|
|
|
382
494
|
if (parts[0] === "count") {
|
|
383
495
|
return accumulator;
|
|
384
496
|
}
|
|
385
|
-
!(parts.length === 2) ? process.env.NODE_ENV !== "production" ?
|
|
497
|
+
!(parts.length === 2) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "assumed we were getting a `${key}.${type}`") : invariant3__default.default(false) : void 0;
|
|
386
498
|
const property = parts[0];
|
|
387
499
|
const metricType = parts[1];
|
|
388
500
|
if (!(property in accumulator)) {
|
|
@@ -468,21 +580,21 @@ function convertRange(range) {
|
|
|
468
580
|
}
|
|
469
581
|
|
|
470
582
|
// src/object/aggregate.ts
|
|
471
|
-
async function aggregate(clientCtx, objectType, objectSet =
|
|
472
|
-
|
|
583
|
+
async function aggregate(clientCtx, objectType, objectSet = chunkZV5KKQ4R_cjs.resolveBaseObjectSetType(objectType), req) {
|
|
584
|
+
chunkZV5KKQ4R_cjs.resolveBaseObjectSetType(objectType);
|
|
473
585
|
const body = {
|
|
474
586
|
aggregation: modernToLegacyAggregationClause(req.$select),
|
|
475
587
|
groupBy: []};
|
|
476
588
|
if (req.$groupBy) {
|
|
477
589
|
body.groupBy = modernToLegacyGroupByClause(req.$groupBy);
|
|
478
590
|
}
|
|
479
|
-
const result = await
|
|
591
|
+
const result = await chunkZV5KKQ4R_cjs.OntologyObjectSet_exports.aggregate(chunkZV5KKQ4R_cjs.addUserAgentAndRequestContextHeaders(clientCtx, objectType), await clientCtx.ontologyRid, {
|
|
480
592
|
objectSet,
|
|
481
593
|
groupBy: body.groupBy,
|
|
482
594
|
aggregation: body.aggregation
|
|
483
595
|
});
|
|
484
596
|
if (!req.$groupBy) {
|
|
485
|
-
!(result.data.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
597
|
+
!(result.data.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "no group by clause should mean only one data result") : invariant3__default.default(false) : void 0;
|
|
486
598
|
return {
|
|
487
599
|
...aggregationToCountResult(result.data[0]),
|
|
488
600
|
...legacyToModernSingleAggregationResult(result.data[0])
|
|
@@ -578,7 +690,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
578
690
|
this.#logger = client.logger?.child({}, {
|
|
579
691
|
msgPrefix: "<OSW> "
|
|
580
692
|
});
|
|
581
|
-
!(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ?
|
|
693
|
+
!(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Stack must be a URL") : invariant3__default.default(false) : void 0;
|
|
582
694
|
}
|
|
583
695
|
async subscribe(objectType, objectSet, listener, properties = []) {
|
|
584
696
|
const objOrInterfaceDef = objectType.type === "object" ? await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName) : await this.#client.ontologyProvider.getInterfaceDefinition(objectType.apiName);
|
|
@@ -760,7 +872,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
760
872
|
return;
|
|
761
873
|
}
|
|
762
874
|
default:
|
|
763
|
-
process.env.NODE_ENV !== "production" ?
|
|
875
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Unexpected message type") : invariant3__default.default(false) ;
|
|
764
876
|
}
|
|
765
877
|
};
|
|
766
878
|
#handleMessage_objectSetChanged = async (payload) => {
|
|
@@ -825,7 +937,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
825
937
|
}
|
|
826
938
|
#handleMessage_refreshObjectSet = (payload) => {
|
|
827
939
|
const sub = this.#subscriptions.get(payload.id);
|
|
828
|
-
!sub ? process.env.NODE_ENV !== "production" ?
|
|
940
|
+
!sub ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `Expected subscription id ${payload.id}`) : invariant3__default.default(false) : void 0;
|
|
829
941
|
try {
|
|
830
942
|
sub.listener.onOutOfDate();
|
|
831
943
|
} catch (error) {
|
|
@@ -839,7 +951,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
839
951
|
responses
|
|
840
952
|
} = payload;
|
|
841
953
|
const subs = this.#pendingSubscriptions.get(id);
|
|
842
|
-
!subs ? process.env.NODE_ENV !== "production" ?
|
|
954
|
+
!subs ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `should have a pending subscription for ${id}`) : invariant3__default.default(false) : void 0;
|
|
843
955
|
this.#pendingSubscriptions.delete(id);
|
|
844
956
|
for (let i = 0; i < responses.length; i++) {
|
|
845
957
|
const sub = subs[i];
|
|
@@ -881,7 +993,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
881
993
|
#handleMessage_subscriptionClosed(payload) {
|
|
882
994
|
const sub = this.#subscriptions.get(payload.id);
|
|
883
995
|
if (sub == null && this.#endedSubscriptions.has(payload.id)) return;
|
|
884
|
-
!sub ? process.env.NODE_ENV !== "production" ?
|
|
996
|
+
!sub ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `Expected subscription id ${payload.id}`) : invariant3__default.default(false) : void 0;
|
|
885
997
|
this.#tryCatchOnError(sub, true, payload.cause);
|
|
886
998
|
this.#unsubscribe(sub, "error");
|
|
887
999
|
}
|
|
@@ -906,7 +1018,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
906
1018
|
if (this.#subscriptions.size > 0) {
|
|
907
1019
|
if (process.env.NODE_ENV !== "production") {
|
|
908
1020
|
for (const s of this.#subscriptions.values()) {
|
|
909
|
-
!(s.status !== "done" && s.status !== "error") ? process.env.NODE_ENV !== "production" ?
|
|
1021
|
+
!(s.status !== "done" && s.status !== "error") ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "should not have done/error subscriptions still") : invariant3__default.default(false) : void 0;
|
|
910
1022
|
}
|
|
911
1023
|
}
|
|
912
1024
|
for (const s of this.#subscriptions.values()) {
|
|
@@ -955,15 +1067,15 @@ function getWireObjectSet(objectSet) {
|
|
|
955
1067
|
return objectSetDefinitions.get(objectSet);
|
|
956
1068
|
}
|
|
957
1069
|
var objectSetDefinitions = /* @__PURE__ */ new WeakMap();
|
|
958
|
-
function createObjectSet(objectType, clientCtx, objectSet =
|
|
1070
|
+
function createObjectSet(objectType, clientCtx, objectSet = chunkZV5KKQ4R_cjs.resolveBaseObjectSetType(objectType)) {
|
|
959
1071
|
const base = {
|
|
960
1072
|
aggregate: aggregate.bind(globalThis, augmentRequestContext(clientCtx, (_) => ({
|
|
961
1073
|
finalMethodCall: "aggregate"
|
|
962
1074
|
})), objectType, objectSet),
|
|
963
|
-
fetchPage:
|
|
1075
|
+
fetchPage: chunkZV5KKQ4R_cjs.fetchPageInternal.bind(globalThis, augmentRequestContext(clientCtx, (_) => ({
|
|
964
1076
|
finalMethodCall: "fetchPage"
|
|
965
1077
|
})), objectType, objectSet),
|
|
966
|
-
fetchPageWithErrors:
|
|
1078
|
+
fetchPageWithErrors: chunkZV5KKQ4R_cjs.fetchPageWithErrorsInternal.bind(globalThis, augmentRequestContext(clientCtx, (_) => ({
|
|
967
1079
|
finalMethodCall: "fetchPageWithErrors"
|
|
968
1080
|
})), objectType, objectSet),
|
|
969
1081
|
where: (clause) => {
|
|
@@ -997,7 +1109,7 @@ function createObjectSet(objectType, clientCtx, objectSet = chunkW5PFESFR_cjs.re
|
|
|
997
1109
|
asyncIter: async function* (args) {
|
|
998
1110
|
let $nextPageToken = void 0;
|
|
999
1111
|
do {
|
|
1000
|
-
const result = await
|
|
1112
|
+
const result = await chunkZV5KKQ4R_cjs.fetchPageInternal(augmentRequestContext(clientCtx, (_) => ({
|
|
1001
1113
|
finalMethodCall: "asyncIter"
|
|
1002
1114
|
})), objectType, objectSet, {
|
|
1003
1115
|
...args,
|
|
@@ -1083,5 +1195,5 @@ exports.hydrateAttachmentFromRid = hydrateAttachmentFromRid;
|
|
|
1083
1195
|
exports.hydrateAttachmentFromRidInternal = hydrateAttachmentFromRidInternal;
|
|
1084
1196
|
exports.isObjectSet = isObjectSet;
|
|
1085
1197
|
exports.isWireObjectSet = isWireObjectSet;
|
|
1086
|
-
//# sourceMappingURL=chunk-
|
|
1087
|
-
//# sourceMappingURL=chunk-
|
|
1198
|
+
//# sourceMappingURL=chunk-JEHRAVC5.cjs.map
|
|
1199
|
+
//# sourceMappingURL=chunk-JEHRAVC5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/public-utils/hydrateAttachmentFromRid.ts","../../src/logger/BaseLogger.ts","../../src/logger/MinimalLogger.ts","../../src/object/fetchSingle.ts","../../src/internal/conversions/modernToLegacyWhereClause.ts","../../src/derivedProperties/derivedPropertyDefinitionFactory.ts","../../src/derivedProperties/createWithPropertiesObjectSet.ts","../../src/internal/conversions/legacyToModernSingleAggregationResult.ts","../../src/internal/conversions/modernToLegacyAggregationClause.ts","../../src/internal/conversions/modernToLegacyGroupByClause.ts","../../src/object/aggregate.ts","../../src/util/augmentRequestContext.ts","../../src/util/WireObjectSet.ts","../../src/objectSet/ObjectSetListenerWebsocket.ts","../../src/objectSet/createObjectSet.ts"],"names":["additionalContext","Attachment_exports","fetchPage","PalantirApiError","invariant","DistanceUnitMapping","wrappedObjectSet","selectorResult","DurationMapping","resolveBaseObjectSetType","OntologyObjectSet_exports","addUserAgentAndRequestContextHeaders","WebSocket","fetchPageInternal","fetchPageWithErrorsInternal"],"mappings":";;;;;;;;;;;;;;AAwBO,SAAS,wBAAA,CAAyB,QAAQ,GAAK,EAAA;AACpD,EAAA,OAAO,gCAAiC,CAAA,MAAA,CAAOA,mCAAiB,CAAA,EAAG,GAAG,CAAA;AACxE;AAGO,SAAS,gCAAA,CAAiC,QAAQ,GAAK,EAAA;AAC5D,EAAO,OAAA;AAAA,IACL,GAAA;A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A,CAAkB,GAAG,CAAA,GAAI,aAAc,CAAA,GAAA,CAAI,yBAAyB,CAAA;AAAA;AAEtE,MAAO,OAAA,SAAA,CAAU,gBAAiB,CAAA,UAAA,EAAY,SAAW,EAAA;AAAA,QACvD,IAAM,EAAA,gBAAA;AAAA,QACN,iBAAA;AAAA,QACA;AAAA,OACD,CAAA;AAAA,KACH;AAAA,IACA,mBAAqB,EAAA;AAAA,MACnB,GAAK,EAAA;AAAA;AACP,GACF;AACA,EAAA,SAAS,mBAAmB,IAAM,EAAA;AAChC,IAAA,OAAO,MAAM;AACX,MAAO,OAAA,SAAA,CAAU,gBAAiB,CAAA,UAAA,EAAY,SAAW,EAAA;AAAA,QACvD,IAAM,EAAA,cAAA;AAAA,QACN,SAAA;AAAA,QACA;AAAA,OACD,CAAA;AAAA,KACH;AAAA;AAEF,EAAqB,oBAAA,CAAA,GAAA,CAAI,MAAM,SAAS,CAAA;AAIxC,EAAO,OAAA,IAAA;AACT;AACA,eAAe,YAAa,CAAA,SAAA,EAAW,UAAY,EAAA,SAAA,EAAW,UAAY,EAAA;AACxE,EAAA,MAAM,SAAS,MAAM,SAAA,CAAU,gBAAiB,CAAA,mBAAA,CAAoB,WAAW,OAAO,CAAA;AACtF,EAAA,MAAM,MAAS,GAAA;AAAA,IACb,IAAM,EAAA,QAAA;AAAA,IACN,SAAA;AAAA,IACA,KAAO,EAAA;AAAA,MACL,IAAM,EAAA,IAAA;AAAA,MACN,OAAO,MAAO,CAAA,iBAAA;AAAA,MACd,KAAO,EAAA;AAAA;AACT,GACF;AACA,EAAO,OAAA,MAAA;AACT","file":"chunk-JEHRAVC5.cjs","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 * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport { additionalContext } from \"../Client.js\";\n/**\n * Helper function to create an attachment type from a rid\n * @param client - An OSDK client.\n * @param rid - The rid of attachment in Foundry.\n * @returns An OSDK attachment object\n */\nexport function hydrateAttachmentFromRid(client, rid) {\n return hydrateAttachmentFromRidInternal(client[additionalContext], rid);\n}\n\n/** @internal */\nexport function hydrateAttachmentFromRidInternal(client, rid) {\n return {\n rid,\n async fetchContents() {\n return OntologiesV2.Attachments.read(client, rid);\n },\n async fetchMetadata() {\n const r = await OntologiesV2.Attachments.get(client, rid);\n return {\n ...r,\n sizeBytes: Number(r.sizeBytes)\n };\n }\n };\n}","/*\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 function noop() {}\nconst levels = {\n trace: 10,\n debug: 20,\n info: 30,\n warn: 40,\n error: 50,\n fatal: 60\n};\nexport class BaseLogger {\n #factory;\n constructor(bindings, options = {}, factory) {\n this.bindings = bindings;\n this.options = options;\n this.#factory = factory;\n for (const k of [\"trace\", \"debug\", \"info\", \"warn\", \"error\", \"fatal\"]) {\n if (this.options?.level && !this.isLevelEnabled(k)) {\n continue;\n }\n this[k] = this.createLogMethod(k, bindings);\n }\n }\n trace = noop;\n debug = noop;\n warn = noop;\n info = noop;\n error = noop;\n fatal = noop;\n child(bindings, options) {\n return new this.#factory({\n ...this.bindings,\n ...bindings\n }, {\n level: (options ?? this.options)?.level,\n msgPrefix: [this.options?.msgPrefix, options?.msgPrefix].filter(x => x).join(\" \")\n });\n }\n isLevelEnabled(level) {\n const ourLevel = this.options?.level ?? \"info\";\n return level in levels && ourLevel in levels && levels[level] >= levels[ourLevel];\n }\n}","/*\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 { BaseLogger } from \"./BaseLogger.js\";\nexport class MinimalLogger extends BaseLogger {\n constructor(bindings = {}, options = {}) {\n super(bindings, {\n ...options,\n level: options.level ?? \"error\"\n }, MinimalLogger);\n }\n createLogMethod(name, bindings) {\n const msgs = [name];\n if (this.options?.msgPrefix) {\n msgs.push(this.options.msgPrefix);\n }\n if (typeof bindings === \"object\" && \"methodName\" in bindings) {\n msgs.push(`.${bindings.methodName}()`);\n }\n return (...args) => {\n // eslint-disable-next-line no-console\n console[name === \"fatal\" ? \"error\" : name](msgs.join(\" \"), ...args);\n };\n }\n}","/*\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 { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport { fetchPage } from \"./fetchPage.js\";\n\n/** @internal */\nexport async function fetchSingle(client, objectType, args, objectSet) {\n const result = await fetchPage(client, objectType, {\n ...args,\n $pageSize: 1\n }, objectSet);\n if (result.data.length !== 1 || result.nextPageToken != null) {\n throw new PalantirApiError(`Expected a single result but got ${result.data.length} instead${result.nextPageToken != null ? \" with nextPageToken set\" : \"\"}`);\n }\n return result.data[0];\n}\n\n/** @internal */\nexport async function fetchSingleWithErrors(client, objectType, args, objectSet) {\n try {\n const result = await fetchSingle(client, objectType, args, objectSet);\n return {\n value: result\n };\n } catch (e) {\n if (e instanceof Error) {\n return {\n error: e\n };\n }\n return {\n error: e\n };\n }\n}","/*\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\nimport { DistanceUnitMapping } from \"@osdk/api\";\nimport invariant from \"tiny-invariant\";\nexport function extractNamespace(fqApiName) {\n const last = fqApiName.lastIndexOf(\".\");\n if (last === -1) return [undefined, fqApiName];\n return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];\n}\n\n/** @internal */\nexport function modernToLegacyWhereClause(whereClause, objectOrInterface) {\n if (\"$and\" in whereClause) {\n return {\n type: \"and\",\n value: whereClause.$and.map(clause => modernToLegacyWhereClause(clause, objectOrInterface))\n };\n } else if (\"$or\" in whereClause) {\n return {\n type: \"or\",\n value: whereClause.$or.map(clause => modernToLegacyWhereClause(clause, objectOrInterface))\n };\n } else if (\"$not\" in whereClause) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(whereClause.$not, objectOrInterface)\n };\n }\n const parts = Object.entries(whereClause);\n if (parts.length === 1) {\n return handleWherePair(parts[0], objectOrInterface);\n }\n return {\n type: \"and\",\n value: parts.map(v => handleWherePair(v, objectOrInterface))\n };\n}\nfunction makeGeoFilterBbox(bbox, filterType, propertyIdentifier, field) {\n return {\n type: filterType === \"$within\" ? \"withinBoundingBox\" : \"intersectsBoundingBox\",\n /**\n * This is a bit ugly, but did this so that propertyIdentifier only shows up in the return object if its defined,\n * this makes it so we don't need to go update our entire test bed either to include a field which may change in near future.\n * Once we solidify that this is the way forward, I can remove field and clean this up\n */\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: {\n topLeft: {\n type: \"Point\",\n coordinates: [bbox[0], bbox[3]]\n },\n bottomRight: {\n type: \"Point\",\n coordinates: [bbox[2], bbox[1]]\n }\n }\n };\n}\nfunction makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field) {\n return {\n type: filterType,\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: {\n type: \"Polygon\",\n coordinates\n }\n };\n}\nfunction handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector) {\n !(filter != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Defined key values are only allowed when they are not undefined.\") : invariant(false) : void 0;\n const propertyIdentifier = structFieldSelector != null ? {\n type: \"structField\",\n ...structFieldSelector,\n propertyApiName: fullyQualifyPropName(structFieldSelector.propertyApiName, objectOrInterface)\n } : undefined;\n const field = structFieldSelector == null ? fullyQualifyPropName(fieldName, objectOrInterface) : undefined;\n if (typeof filter === \"string\" || typeof filter === \"number\" || typeof filter === \"boolean\") {\n propertyIdentifier;\n return {\n type: \"eq\",\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: filter\n };\n }\n const keysOfFilter = Object.keys(filter);\n\n // If any of the keys start with `$` then they must be the only one.\n // e.g. `where({ name: { $eq: \"foo\", $ne: \"bar\" } })` is invalid currently\n const hasDollarSign = keysOfFilter.some(key => key.startsWith(\"$\"));\n !(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.\") : invariant(false) : void 0;\n if (!hasDollarSign) {\n const structFilter = Object.entries(filter);\n !(structFilter.length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Cannot filter on more than one struct field in the same clause, need to use an and clause\") : invariant(false) : void 0;\n const structFieldApiName = keysOfFilter[0];\n return handleWherePair(Object.entries(filter)[0], objectOrInterface, {\n propertyApiName: fieldName,\n structFieldApiName\n });\n }\n const firstKey = keysOfFilter[0];\n !(filter[firstKey] != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false) : invariant(false) : void 0;\n if (firstKey === \"$ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: filter[firstKey]\n }\n };\n }\n if (firstKey === \"$within\") {\n const withinBody = filter[firstKey];\n if (Array.isArray(withinBody)) {\n return makeGeoFilterBbox(withinBody, firstKey, propertyIdentifier, field);\n } else if (\"$bbox\" in withinBody && withinBody.$bbox != null) {\n return makeGeoFilterBbox(withinBody.$bbox, firstKey, propertyIdentifier, field);\n } else if (\"$distance\" in withinBody && \"$of\" in withinBody && withinBody.$distance != null && withinBody.$of != null) {\n return {\n type: \"withinDistanceOf\",\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: {\n center: Array.isArray(withinBody.$of) ? {\n type: \"Point\",\n coordinates: withinBody.$of\n } : withinBody.$of,\n distance: {\n value: withinBody.$distance[0],\n unit: DistanceUnitMapping[withinBody.$distance[1]]\n }\n }\n };\n } else {\n const coordinates = \"$polygon\" in withinBody ? withinBody.$polygon : withinBody.coordinates;\n return makeGeoFilterPolygon(coordinates, \"withinPolygon\", propertyIdentifier, fieldName);\n }\n }\n if (firstKey === \"$intersects\") {\n const intersectsBody = filter[firstKey];\n if (Array.isArray(intersectsBody)) {\n return makeGeoFilterBbox(intersectsBody, firstKey, propertyIdentifier, field);\n } else if (\"$bbox\" in intersectsBody && intersectsBody.$bbox != null) {\n return makeGeoFilterBbox(intersectsBody.$bbox, firstKey, propertyIdentifier, field);\n } else {\n const coordinates = \"$polygon\" in intersectsBody ? intersectsBody.$polygon : intersectsBody.coordinates;\n return makeGeoFilterPolygon(coordinates, \"intersectsPolygon\", propertyIdentifier, field);\n }\n }\n if (firstKey === \"$containsAllTerms\" || firstKey === \"$containsAnyTerm\") {\n return {\n type: firstKey.substring(1),\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: typeof filter[firstKey] === \"string\" ? filter[firstKey] : filter[firstKey][\"term\"],\n fuzzy: typeof filter[firstKey] === \"string\" ? false : filter[firstKey][\"fuzzySearch\"] ?? false\n };\n }\n return {\n type: firstKey.substring(1),\n ...(propertyIdentifier != null && {\n propertyIdentifier\n }),\n field,\n value: filter[firstKey]\n };\n}\nfunction fullyQualifyPropName(fieldName, objectOrInterface) {\n if (objectOrInterface.type === \"interface\") {\n const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);\n const [fieldApiNamespace, fieldShortName] = extractNamespace(fieldName);\n return fieldApiNamespace == null && objApiNamespace != null ? `${objApiNamespace}.${fieldShortName}` : fieldName;\n }\n return fieldName;\n}","/*\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 invariant from \"tiny-invariant\";\n\n/** @internal */\nexport function derivedPropertyDefinitionFactory(wireDefinition, definitionMap) {\n const definition = {\n abs() {\n return derivedPropertyDefinitionFactory({\n type: \"absoluteValue\",\n property: wireDefinition\n }, definitionMap);\n },\n negate() {\n return derivedPropertyDefinitionFactory({\n type: \"negate\",\n property: wireDefinition\n }, definitionMap);\n },\n max(value) {\n return derivedPropertyDefinitionFactory({\n type: \"greatest\",\n properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]\n }, definitionMap);\n },\n min(value) {\n return derivedPropertyDefinitionFactory({\n type: \"least\",\n properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]\n }, definitionMap);\n },\n add(value) {\n return derivedPropertyDefinitionFactory({\n type: \"add\",\n properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]\n }, definitionMap);\n },\n subtract(value) {\n return derivedPropertyDefinitionFactory({\n \"type\": \"subtract\",\n \"left\": wireDefinition,\n \"right\": getDefinitionFromMap(value, definitionMap)\n }, definitionMap);\n },\n multiply(value) {\n return derivedPropertyDefinitionFactory({\n type: \"multiply\",\n properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]\n }, definitionMap);\n },\n divide(value) {\n return derivedPropertyDefinitionFactory({\n \"type\": \"subtract\",\n \"left\": wireDefinition,\n \"right\": getDefinitionFromMap(value, definitionMap)\n }, definitionMap);\n },\n extractPart: part => {\n return derivedPropertyDefinitionFactory({\n type: \"extract\",\n part,\n property: wireDefinition\n }, definitionMap);\n }\n };\n definitionMap.set(definition, wireDefinition);\n return definition;\n}\nconst getDefinitionFromMap = (arg, definitionMap) => {\n if (typeof arg === \"object\") {\n const definition = definitionMap.get(arg);\n !definition ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Derived Property is not defined\") : invariant(false) : void 0;\n return definition;\n } else if (typeof arg === \"number\") {\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Literals for derived properties are not yet supported\") : invariant(false) : void 0;\n }\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Invalid argument type for a derived property\") : invariant(false) : void 0;\n};","/*\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 invariant from \"tiny-invariant\";\nimport { modernToLegacyWhereClause } from \"../internal/conversions/modernToLegacyWhereClause.js\";\nimport { derivedPropertyDefinitionFactory } from \"./derivedPropertyDefinitionFactory.js\";\n/** @internal */\nexport function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fromBaseObjectSet = false) {\n return {\n pivotTo: link => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"searchAround\",\n objectSet,\n link\n }, definitionMap);\n },\n where: clause => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause, objectType)\n }, definitionMap);\n },\n aggregate: (aggregation, opt) => {\n const splitAggregation = aggregation.split(\":\");\n !(splitAggregation.length === 2 || splitAggregation[0] === \"$count\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Invalid aggregation format\") : invariant(false) : void 0;\n const [aggregationPropertyName, aggregationOperation] = splitAggregation;\n let aggregationOperationDefinition;\n switch (aggregationOperation) {\n case \"sum\":\n case \"avg\":\n case \"min\":\n case \"max\":\n case \"exactDistinct\":\n case \"approximateDistinct\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName\n };\n break;\n case \"approximatePercentile\":\n aggregationOperationDefinition = {\n type: \"approximatePercentile\",\n selectedPropertyApiName: aggregationPropertyName,\n approximatePercentile: opt?.percentile ?? .5\n };\n break;\n case \"collectSet\":\n case \"collectList\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n limit: opt?.limit ?? 100\n };\n break;\n case undefined:\n if (aggregationPropertyName === \"$count\") {\n aggregationOperationDefinition = {\n type: \"count\"\n };\n break;\n }\n default:\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Invalid aggregation operation \" + aggregationOperation) : invariant(false) : void 0;\n }\n const wrappedObjectSet = {\n type: \"selection\",\n objectSet: objectSet,\n operation: aggregationOperationDefinition\n };\n const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult;\n },\n selectProperty: name => {\n if (fromBaseObjectSet) {\n const wrappedObjectSet = {\n type: \"property\",\n apiName: name\n };\n const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult;\n }\n const wrappedObjectSet = {\n type: \"selection\",\n objectSet: objectSet,\n operation: {\n type: \"get\",\n selectedPropertyApiName: name\n }\n };\n const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult;\n },\n constant: {\n double: value => {\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Not supported\") : invariant(false) : void 0;\n },\n integer: value => {\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Not supported\") : invariant(false) : void 0;\n },\n long: value => {\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Not supported\") : invariant(false) : void 0;\n },\n datetime: value => {\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Not supported\") : invariant(false) : void 0;\n },\n timestamp: value => {\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Not supported\") : invariant(false) : void 0;\n }\n }\n };\n}","/*\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\nimport invariant from \"tiny-invariant\";\n/** @internal */\nexport function legacyToModernSingleAggregationResult(entry) {\n return entry.metrics.reduce((accumulator, curValue) => {\n const parts = curValue.name.split(\".\");\n if (parts[0] === \"count\") {\n return accumulator;\n }\n !(parts.length === 2) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"assumed we were getting a `${key}.${type}`\") : invariant(false) : void 0;\n const property = parts[0];\n const metricType = parts[1];\n if (!(property in accumulator)) {\n accumulator[property] = {}; // fixme?\n }\n accumulator[property][metricType] = curValue.value; // fixme?\n\n return accumulator;\n }, {});\n}","/*\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\nconst directionFieldMap = dir => dir === \"asc\" ? \"ASC\" : dir === \"desc\" ? \"DESC\" : undefined;\n\n/** @internal */\nexport function modernToLegacyAggregationClause(select) {\n return Object.entries(select).flatMap(([propAndMetric, aggregationType]) => {\n if (propAndMetric === \"$count\") {\n return {\n type: \"count\",\n name: \"count\",\n direction: directionFieldMap(aggregationType)\n };\n }\n const colonPos = propAndMetric.lastIndexOf(\":\");\n const property = propAndMetric.slice(0, colonPos);\n const metric = propAndMetric.slice(colonPos + 1);\n return [{\n type: metric,\n name: `${property}.${metric}`,\n direction: directionFieldMap(aggregationType),\n field: property\n }];\n });\n}","/*\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\nimport { DurationMapping } from \"@osdk/api\";\n/** @internal */\nexport function modernToLegacyGroupByClause(groupByClause) {\n if (!groupByClause) return [];\n return Object.entries(groupByClause).flatMap(([field, type]) => {\n if (type === \"exact\") {\n return [{\n type,\n field\n }];\n } else if (\"$exactWithLimit\" in type) {\n {\n return [{\n type: \"exact\",\n field,\n maxGroupCount: type.$exactWithLimit\n }];\n }\n } else if (\"$exact\" in type) {\n return [{\n type: \"exact\",\n field,\n maxGroupCount: type.$exact?.$limit ?? undefined,\n defaultValue: type.$exact.$defaultValue ?? undefined\n }];\n } else if (\"$fixedWidth\" in type) {\n return [{\n type: \"fixedWidth\",\n field,\n fixedWidth: type.$fixedWidth\n }];\n } else if (\"$ranges\" in type) {\n return [{\n type: \"ranges\",\n field,\n ranges: type.$ranges.map(range => convertRange(range))\n }];\n } else if (\"$duration\" in type) {\n return [{\n type: \"duration\",\n field,\n value: type.$duration[0],\n unit: DurationMapping[type.$duration[1]]\n }];\n } else return [];\n });\n}\nfunction convertRange(range) {\n return {\n startValue: range[0],\n endValue: range[1]\n };\n}","/*\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\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { legacyToModernSingleAggregationResult } from \"../internal/conversions/legacyToModernSingleAggregationResult.js\";\nimport { modernToLegacyAggregationClause } from \"../internal/conversions/modernToLegacyAggregationClause.js\";\nimport { modernToLegacyGroupByClause } from \"../internal/conversions/modernToLegacyGroupByClause.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { resolveBaseObjectSetType } from \"../util/objectSetUtils.js\";\n\n/** @internal */\nexport async function aggregate(clientCtx, objectType, objectSet = resolveBaseObjectSetType(objectType), req) {\n const resolvedObjectSet = resolveBaseObjectSetType(objectType);\n const body = {\n aggregation: modernToLegacyAggregationClause(req.$select),\n groupBy: [],\n where: undefined\n };\n if (req.$groupBy) {\n body.groupBy = modernToLegacyGroupByClause(req.$groupBy);\n }\n const result = await OntologiesV2.OntologyObjectSets.aggregate(addUserAgentAndRequestContextHeaders(clientCtx, objectType), await clientCtx.ontologyRid, {\n objectSet,\n groupBy: body.groupBy,\n aggregation: body.aggregation\n });\n if (!req.$groupBy) {\n !(result.data.length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"no group by clause should mean only one data result\") : invariant(false) : void 0;\n return {\n ...aggregationToCountResult(result.data[0]),\n ...legacyToModernSingleAggregationResult(result.data[0])\n };\n }\n const ret = result.data.map(entry => {\n return {\n $group: entry.group,\n ...aggregationToCountResult(entry),\n ...legacyToModernSingleAggregationResult(entry)\n };\n }); // fixme\n\n return ret; // FIXME\n}\nfunction aggregationToCountResult(entry) {\n for (const aggregateResult of entry.metrics) {\n if (aggregateResult.name === \"count\") {\n return {\n $count: aggregateResult.value\n };\n }\n }\n}","/*\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\n/**\nReturns a client with its `requestContext` merged with the result of applying\n`augment` to its `requestContext`.\n\nThe second argument is an `Partial<RequestContext>`-returning `augment` function\ninstead of a `RequestContext` object to make referencing the current request\ncontext easier. For example, modifying the `fetchPage` function to add its name\nto the object set's called method chain could look like:\n```\naugmentRequestContext(\n clientContext,\n ctx => ({ methodChain: [...ctx.methodChain, \"fetchPage\"] })\n)\n```\nor\n```\naugmentRequestContext(\n clientContext,\n ({ methodChain }) => ({ methodChain: [...methodChain, \"fetchPage\"] })\n)\n```\ninstead of\n```\naugmentRequestContext(\n clientContext,\n { methodChain: [...clientContext.requestContext.methodChain, \"fetchPage\"] }\n)\n```\n*/\nexport const augmentRequestContext = (client, augment) => ({\n ...client,\n requestContext: {\n ...client.requestContext,\n ...augment(client.requestContext)\n }\n});","/*\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\nconst WIRE_OBJECT_SET_TYPES = new Set([\"base\", \"filter\", \"intersect\", \"reference\", \"searchAround\", \"static\", \"subtract\", \"union\"]);\n\n/** @internal */\nexport function isWireObjectSet(o) {\n return o != null && typeof o === \"object\" && WIRE_OBJECT_SET_TYPES.has(o.type);\n}","/*\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\nimport WebSocket from \"isomorphic-ws\";\nimport invariant from \"tiny-invariant\";\nconst MINIMUM_RECONNECT_DELAY_MS = 5 * 1000;\n\n/** Noop function to reduce conditional checks */\nfunction doNothing() {}\n\n/**\n * Converts an ObjectSetListener to one where all the functions are defined.\n */\nfunction fillOutListener({\n onChange = doNothing,\n onError = doNothing,\n onOutOfDate = doNothing,\n onSuccessfulSubscription = doNothing\n}) {\n return {\n onChange,\n onError,\n onOutOfDate,\n onSuccessfulSubscription\n };\n}\nfunction isReady(sub) {\n return sub.isReady != null;\n}\nfunction subscriptionIsDone(sub) {\n return sub.status === \"done\" || sub.status === \"error\";\n}\n\n/** @internal */\nexport class ObjectSetListenerWebsocket {\n static #instances = new WeakMap();\n // FIXME\n static getInstance(client) {\n let instance = ObjectSetListenerWebsocket.#instances.get(client.clientCacheKey);\n if (instance == null) {\n instance = new ObjectSetListenerWebsocket(client);\n ObjectSetListenerWebsocket.#instances.set(client.clientCacheKey, instance);\n }\n return instance;\n }\n #ws;\n #lastWsConnect = 0;\n #client;\n #logger;\n\n /**\n * map of requestId to all active subscriptions at the time of the request\n */\n #pendingSubscriptions = new Map();\n\n /**\n * Map of subscriptionId to Subscription. Note: the subscriptionId may be\n * temporary and not the actual subscriptionId from the server.\n */\n #subscriptions = new Map();\n #endedSubscriptions = new Set();\n #maybeDisconnectTimeout;\n\n // DO NOT CONSTRUCT DIRECTLY. ONLY EXPOSED AS A TESTING SEAM\n constructor(client, {\n minimumReconnectDelayMs = MINIMUM_RECONNECT_DELAY_MS\n } = {}) {\n this.MINIMUM_RECONNECT_DELAY_MS = minimumReconnectDelayMs;\n this.#client = client;\n this.#logger = client.logger?.child({}, {\n msgPrefix: \"<OSW> \"\n });\n !(client.baseUrl.startsWith(\"https://\") || client.baseUrl.startsWith(\"http://\")) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Stack must be a URL\") : invariant(false) : void 0;\n }\n async subscribe(objectType, objectSet, listener, properties = []) {\n const objOrInterfaceDef = objectType.type === \"object\" ? await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName) : await this.#client.ontologyProvider.getInterfaceDefinition(objectType.apiName);\n let objectProperties = [];\n let referenceProperties = [];\n if (properties.length === 0) {\n properties = Object.keys(objOrInterfaceDef.properties);\n }\n objectProperties = properties.filter(p => objOrInterfaceDef.properties[p].type !== \"geotimeSeriesReference\");\n referenceProperties = properties.filter(p => objOrInterfaceDef.properties[p].type === \"geotimeSeriesReference\");\n const sub = {\n listener: fillOutListener(listener),\n objectSet,\n primaryKeyPropertyName: objOrInterfaceDef.type === \"interface\" ? undefined : objOrInterfaceDef.primaryKeyApiName,\n requestedProperties: objectProperties,\n requestedReferenceProperties: referenceProperties,\n status: \"preparing\",\n // Since we don't have a real subscription id yet but we need to keep\n // track of this reference, we can just use a random uuid.\n subscriptionId: `TMP-${nextUuid()}}`,\n interfaceApiName: objOrInterfaceDef.type === \"object\" ? undefined : objOrInterfaceDef.apiName\n };\n this.#subscriptions.set(sub.subscriptionId, sub);\n\n // actually prepares the subscription, ensures the ws is ready, and sends\n // a subscribe message. We don't want to block on this.\n void this.#initiateSubscribe(sub);\n return () => {\n this.#unsubscribe(sub);\n };\n }\n\n /**\n * Called at least once for every subscription.\n *\n * - Resets pending expiry\n * - Recreates temporary object set\n * - Triggers a full subscribe message\n *\n * @returns\n */\n async #initiateSubscribe(sub) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.debug(\"#initiateSubscribe()\");\n }\n try {\n await this.#ensureWebsocket();\n\n // the consumer may have already unsubscribed before we are ready to request a subscription\n // so we have to acquire the pendingSubscription after the await.\n if (subscriptionIsDone(sub)) {\n return;\n }\n sub.isReady = true;\n // if we aren't open, then this happens after we #onConnect\n if (this.#ws?.readyState === WebSocket.OPEN) {\n this.#sendSubscribeMessage();\n }\n } catch (error) {\n this.#logger?.error(error, \"Error in #initiateSubscribe\");\n this.#tryCatchOnError(sub, true, error);\n }\n }\n #sendSubscribeMessage() {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.debug(\"#sendSubscribeMessage()\");\n }\n // If two calls to `.subscribe()` happen at once (or if the connection is reset),\n // we may have multiple subscriptions that don't have a subscriptionId yet,\n // so we filter those out.\n const readySubs = [...this.#subscriptions.values()].filter(isReady);\n const id = nextUuid();\n // responses come back as an array of subIds, so we need to know the sources\n this.#pendingSubscriptions.set(id, readySubs);\n\n // every subscribe message \"overwrites\" the previous ones that are not\n // re-included, so we have to reconstitute the entire list of subscriptions\n const subscribe = {\n id,\n requests: readySubs.map(({\n objectSet,\n requestedProperties,\n requestedReferenceProperties,\n interfaceApiName\n }) => {\n return {\n objectSet: objectSet,\n propertySet: requestedProperties,\n referenceSet: requestedReferenceProperties\n };\n })\n };\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.debug({\n payload: subscribe\n }, \"sending subscribe message\");\n }\n this.#ws?.send(JSON.stringify(subscribe));\n }\n #unsubscribe(sub, newStatus = \"done\") {\n if (subscriptionIsDone(sub)) {\n // if we are already done, we don't need to do anything\n return;\n }\n sub.status = newStatus;\n\n // make sure listeners do nothing now\n sub.listener = fillOutListener({});\n this.#subscriptions.delete(sub.subscriptionId);\n this.#endedSubscriptions.add(sub.subscriptionId);\n this.#sendSubscribeMessage();\n\n // If we have no more subscriptions, we can disconnect the websocket\n // however we should wait a bit to see if we get any more subscriptions.\n // For example, when switching between react views, you may unsubscribe\n // in the old view and subscribe in the new view. We don't need to re-establish\n // the websocket connection in that case.\n if (this.#maybeDisconnectTimeout) {\n // We reset the timeout on every unsubscribe so its always at least 15s from\n // the last time we are empty. E.g.:\n // - 0s: Subscribe(A)\n // - 10s: Unsubscribe(A)\n // - 11s: Subscribe(B)\n // - 20s: Unsubscribe(B)\n // If we do not clear out the timeout we would disconnect at 25s but that would only be\n // 5s after the last subscription was removed instead of at 35s for the desired 15s.\n clearTimeout(this.#maybeDisconnectTimeout);\n }\n this.#maybeDisconnectTimeout = setTimeout(() => {\n this.#maybeDisconnectTimeout = undefined;\n if (this.#subscriptions.size === 0) {\n this.#cycleWebsocket();\n }\n }, 15_000 /* ms */);\n }\n async #ensureWebsocket() {\n if (this.#ws == null) {\n const {\n baseUrl,\n tokenProvider\n } = this.#client;\n const url = constructWebsocketUrl(baseUrl, await this.#client.ontologyRid);\n const token = await tokenProvider();\n\n // tokenProvider is async, there could potentially be a race to create the websocket.\n // Only the first call to reach here will find a null this.#ws, the rest will bail out\n if (this.#ws == null) {\n // TODO this can probably be exponential backoff with jitter\n // don't reconnect more quickly than MINIMUM_RECONNECT_DELAY\n const nextConnectTime = (this.#lastWsConnect ?? 0) + this.MINIMUM_RECONNECT_DELAY_MS;\n if (nextConnectTime > Date.now()) {\n await new Promise(resolve => {\n setTimeout(resolve, nextConnectTime - Date.now());\n });\n }\n this.#lastWsConnect = Date.now();\n\n // we again may have lost the race after our minimum backoff time\n if (this.#ws == null) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.debug(\"Creating websocket\");\n }\n this.#ws = new WebSocket(url, [`Bearer-${token}`]);\n this.#ws.addEventListener(\"close\", this.#onClose);\n this.#ws.addEventListener(\"message\", this.#onMessage);\n this.#ws.addEventListener(\"open\", this.#onOpen);\n }\n }\n // Allow await-ing the websocket open event if it isn't open already.\n // This needs to happen even for callers that didn't just create this.#ws\n if (this.#ws.readyState === WebSocket.CONNECTING) {\n const ws = this.#ws;\n return new Promise((resolve, reject) => {\n function cleanup() {\n ws.removeEventListener(\"open\", open);\n ws.removeEventListener(\"error\", error);\n ws.removeEventListener(\"close\", cleanup);\n }\n function open() {\n cleanup();\n resolve();\n }\n function error(evt) {\n cleanup();\n reject(evt);\n }\n ws.addEventListener(\"open\", open);\n ws.addEventListener(\"error\", error);\n ws.addEventListener(\"close\", cleanup);\n });\n }\n }\n }\n #onOpen = () => {\n // resubscribe all of the listeners\n this.#sendSubscribeMessage();\n };\n #onMessage = async message => {\n const data = JSON.parse(message.data.toString());\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.debug({\n payload: data\n }, \"received message from ws\");\n }\n switch (data.type) {\n case \"objectSetChanged\":\n await this.#handleMessage_objectSetChanged(data);\n return;\n case \"refreshObjectSet\":\n this.#handleMessage_refreshObjectSet(data);\n return;\n case \"subscribeResponses\":\n this.#handleMessage_subscribeResponses(data);\n return;\n case \"subscriptionClosed\":\n {\n this.#handleMessage_subscriptionClosed(data);\n return;\n }\n default:\n const _ = data;\n !false ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Unexpected message type\") : invariant(false) : void 0;\n }\n };\n #handleMessage_objectSetChanged = async payload => {\n const sub = this.#subscriptions.get(payload.id);\n if (sub == null) return;\n const objectUpdates = payload.updates.filter(update => update.type === \"object\");\n const referenceUpdates = payload.updates.filter(update => update.type === \"reference\");\n const osdkObjectsWithReferenceUpdates = await Promise.all(referenceUpdates.map(async o => {\n const osdkObjectArray = await this.#client.objectFactory2(this.#client, [{\n __apiName: o.objectType,\n __primaryKey: sub.primaryKeyPropertyName != null ? o.primaryKey[sub.primaryKeyPropertyName] : undefined,\n ...o.primaryKey,\n [o.property]: o.value\n }], sub.interfaceApiName, {}, false, undefined, false, await this.#fetchInterfaceMapping(o.objectType, sub.interfaceApiName));\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null ? {\n object: singleOsdkObject,\n state: \"ADDED_OR_UPDATED\"\n } : undefined;\n }));\n for (const update of osdkObjectsWithReferenceUpdates) {\n if (update != null) {\n try {\n sub.listener.onChange?.(update);\n } catch (error) {\n this.#logger?.error(error, \"Error in onChange callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n }\n }\n const osdkObjects = await Promise.all(objectUpdates.map(async o => {\n const keysToDelete = Object.keys(o.object).filter(key => sub.requestedReferenceProperties.includes(key));\n for (const key of keysToDelete) {\n delete o.object[key];\n }\n const osdkObjectArray = await this.#client.objectFactory2(this.#client, [o.object], sub.interfaceApiName, {}, false, undefined, false, await this.#fetchInterfaceMapping(o.object.__apiName, sub.interfaceApiName));\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null ? {\n object: singleOsdkObject,\n state: o.state\n } : undefined;\n }));\n for (const osdkObject of osdkObjects) {\n if (osdkObject != null) {\n try {\n sub.listener.onChange?.(osdkObject);\n } catch (error) {\n this.#logger?.error(error, \"Error in onChange callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n }\n }\n };\n async #fetchInterfaceMapping(objectTypeApiName, interfaceApiName) {\n if (interfaceApiName == null) return {};\n const interfaceMap = (await this.#client.ontologyProvider.getObjectDefinition(objectTypeApiName)).interfaceMap;\n return {\n [interfaceApiName]: {\n [objectTypeApiName]: interfaceMap[interfaceApiName]\n }\n };\n }\n #handleMessage_refreshObjectSet = payload => {\n const sub = this.#subscriptions.get(payload.id);\n !sub ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Expected subscription id ${payload.id}`) : invariant(false) : void 0;\n try {\n sub.listener.onOutOfDate();\n } catch (error) {\n this.#logger?.error(error, \"Error in onOutOfDate callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n };\n #handleMessage_subscribeResponses = payload => {\n const {\n id,\n responses\n } = payload;\n const subs = this.#pendingSubscriptions.get(id);\n !subs ? process.env.NODE_ENV !== \"production\" ? invariant(false, `should have a pending subscription for ${id}`) : invariant(false) : void 0;\n this.#pendingSubscriptions.delete(id);\n for (let i = 0; i < responses.length; i++) {\n const sub = subs[i];\n const response = responses[i];\n switch (response.type) {\n case \"error\":\n this.#tryCatchOnError(sub, true, response.errors);\n this.#unsubscribe(sub, \"error\");\n break;\n case \"qos\":\n // the server has requested that we tear down our websocket and reconnect to help load balance\n this.#cycleWebsocket();\n break;\n case \"success\":\n // `\"preparing\"` should only be the status on an initial subscribe.\n const shouldFireOutOfDate = sub.status === \"expired\" || sub.status === \"reconnecting\";\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.debug({\n shouldFireOutOfDate\n }, \"success\");\n }\n sub.status = \"subscribed\";\n if (sub.subscriptionId !== response.id) {\n // might be the temporary one\n this.#subscriptions.delete(sub.subscriptionId);\n sub.subscriptionId = response.id;\n this.#subscriptions.set(sub.subscriptionId, sub); // future messages come by this subId\n }\n try {\n if (shouldFireOutOfDate) sub.listener.onOutOfDate();else sub.listener.onSuccessfulSubscription();\n } catch (error) {\n this.#logger?.error(error, \"Error in onOutOfDate or onSuccessfulSubscription callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n break;\n default:\n this.#tryCatchOnError(sub, true, response);\n }\n }\n };\n #handleMessage_subscriptionClosed(payload) {\n const sub = this.#subscriptions.get(payload.id);\n if (sub == null && this.#endedSubscriptions.has(payload.id)) return;\n !sub ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Expected subscription id ${payload.id}`) : invariant(false) : void 0;\n this.#tryCatchOnError(sub, true, payload.cause);\n this.#unsubscribe(sub, \"error\");\n }\n #onClose = event => {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.debug({\n event\n }, \"Received close event from ws\", event);\n }\n // TODO we should probably throttle this so we don't abuse the backend\n this.#cycleWebsocket();\n };\n #cycleWebsocket = () => {\n if (this.#ws) {\n this.#ws.removeEventListener(\"open\", this.#onOpen);\n this.#ws.removeEventListener(\"message\", this.#onMessage);\n this.#ws.removeEventListener(\"close\", this.#onClose);\n if (this.#ws.readyState !== WebSocket.CLOSING && this.#ws.readyState !== WebSocket.CLOSED) {\n this.#ws.close();\n }\n this.#ws = undefined;\n }\n\n // if we have any listeners that are still depending on us, go ahead and reopen the websocket\n if (this.#subscriptions.size > 0) {\n if (process.env.NODE_ENV !== \"production\") {\n for (const s of this.#subscriptions.values()) {\n !(s.status !== \"done\" && s.status !== \"error\") ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"should not have done/error subscriptions still\") : invariant(false) : void 0;\n }\n }\n for (const s of this.#subscriptions.values()) {\n if (s.status === \"subscribed\") s.status = \"reconnecting\";\n }\n\n // we don't care about the result of this (we want cycleWebsocket to be fire and forget)\n // just that it happens\n void this.#ensureWebsocket();\n }\n };\n #tryCatchOnError = (sub, subscriptionClosed, error) => {\n try {\n sub.listener.onError({\n subscriptionClosed: subscriptionClosed,\n error\n });\n } catch (onErrorError) {\n // eslint-disable-next-line no-console\n console.error(`Error encountered in an onError callback for an OSDK subscription`, onErrorError);\n // eslint-disable-next-line no-console\n console.error(`This onError call was triggered by an error in another callback`, error);\n // eslint-disable-next-line no-console\n console.error(`The subscription has been closed.`, error);\n if (!subscriptionClosed) {\n this.#logger?.error(error, \"Error in onError callback\");\n this.#unsubscribe(sub, \"error\");\n this.#tryCatchOnError(sub, true, onErrorError);\n }\n }\n };\n}\n\n/** @internal */\nexport function constructWebsocketUrl(baseUrl, ontologyRid) {\n const base = new URL(baseUrl);\n const url = new URL(`api/v2/ontologySubscriptions/ontologies/${ontologyRid}/streamSubscriptions`, base);\n url.protocol = url.protocol.replace(\"https\", \"wss\");\n return url;\n}\nlet uuidCounter = 0;\nfunction nextUuid() {\n return `00000000-0000-0000-0000-${(uuidCounter++).toString().padStart(12, \"0\")}`;\n}","/*\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\nimport { createWithPropertiesObjectSet } from \"../derivedProperties/createWithPropertiesObjectSet.js\";\nimport { modernToLegacyWhereClause } from \"../internal/conversions/modernToLegacyWhereClause.js\";\nimport { aggregate } from \"../object/aggregate.js\";\nimport { fetchPageInternal, fetchPageWithErrorsInternal } from \"../object/fetchPage.js\";\nimport { fetchSingle, fetchSingleWithErrors } from \"../object/fetchSingle.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport { resolveBaseObjectSetType } from \"../util/objectSetUtils.js\";\nimport { isWireObjectSet } from \"../util/WireObjectSet.js\";\nimport { ObjectSetListenerWebsocket } from \"./ObjectSetListenerWebsocket.js\";\nfunction isObjectTypeDefinition(def) {\n return def.type === \"object\";\n}\n\n/* @internal */\nexport function isObjectSet(o) {\n return o != null && typeof o === \"object\" && isWireObjectSet(objectSetDefinitions.get(o));\n}\n\n/** @internal */\nexport function getWireObjectSet(objectSet) {\n return objectSetDefinitions.get(objectSet);\n}\nconst objectSetDefinitions = new WeakMap();\n\n/** @internal */\nexport function createObjectSet(objectType, clientCtx, objectSet = resolveBaseObjectSetType(objectType)) {\n const base = {\n aggregate: aggregate.bind(globalThis, augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"aggregate\"\n })), objectType, objectSet),\n fetchPage: fetchPageInternal.bind(globalThis, augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"fetchPage\"\n })), objectType, objectSet),\n fetchPageWithErrors: fetchPageWithErrorsInternal.bind(globalThis, augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"fetchPageWithErrors\"\n })), objectType, objectSet),\n where: clause => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause, objectType)\n });\n },\n pivotTo: function (type) {\n return createSearchAround(type)();\n },\n union: (...objectSets) => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"union\",\n objectSets: [objectSet, ...objectSets.map(os => objectSetDefinitions.get(os))]\n });\n },\n intersect: (...objectSets) => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"intersect\",\n objectSets: [objectSet, ...objectSets.map(os => objectSetDefinitions.get(os))]\n });\n },\n subtract: (...objectSets) => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"subtract\",\n objectSets: [objectSet, ...objectSets.map(os => objectSetDefinitions.get(os))]\n });\n },\n asyncIter: async function* (args) {\n let $nextPageToken = undefined;\n do {\n const result = await fetchPageInternal(augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"asyncIter\"\n })), objectType, objectSet, {\n ...args,\n $pageSize: 10000,\n $nextPageToken\n });\n $nextPageToken = result.nextPageToken;\n for (const obj of result.data) {\n yield obj;\n }\n } while ($nextPageToken != null);\n },\n fetchOne: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {\n return await fetchSingle(augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"fetchOne\"\n })), objectType, options, await createWithPk(clientCtx, objectType, objectSet, primaryKey));\n } : undefined,\n fetchOneWithErrors: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {\n return await fetchSingleWithErrors(augmentRequestContext(clientCtx, _ => ({\n finalMethodCall: \"fetchOneWithErrors\"\n })), objectType, options, await createWithPk(clientCtx, objectType, objectSet, primaryKey));\n } : undefined,\n subscribe: (listener, opts) => {\n const pendingSubscribe = ObjectSetListenerWebsocket.getInstance(clientCtx).subscribe(objectType, objectSet, listener, opts?.properties);\n return {\n unsubscribe: async () => (await pendingSubscribe)()\n };\n },\n withProperties: clause => {\n const definitionMap = new Map();\n const derivedProperties = {};\n for (const key of Object.keys(clause)) {\n const derivedPropertyDefinition = clause[key](createWithPropertiesObjectSet(objectType, {\n type: \"methodInput\"\n }, definitionMap, true));\n derivedProperties[key] = definitionMap.get(derivedPropertyDefinition);\n }\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"withProperties\",\n derivedProperties: derivedProperties,\n objectSet: objectSet\n });\n },\n $objectSetInternals: {\n def: objectType\n }\n };\n function createSearchAround(link) {\n return () => {\n return clientCtx.objectSetFactory(objectType, clientCtx, {\n type: \"searchAround\",\n objectSet,\n link\n });\n };\n }\n objectSetDefinitions.set(base, objectSet);\n\n // we are using a type assertion because the marker symbol defined in BaseObjectSet isn't actually used\n // at runtime.\n return base;\n}\nasync function createWithPk(clientCtx, objectType, objectSet, primaryKey) {\n const objDef = await clientCtx.ontologyProvider.getObjectDefinition(objectType.apiName);\n const withPk = {\n type: \"filter\",\n objectSet: objectSet,\n where: {\n type: \"eq\",\n field: objDef.primaryKeyApiName,\n value: primaryKey\n }\n };\n return withPk;\n}"]}
|
|
@@ -600,5 +600,5 @@ exports.fetchPageInternal = fetchPageInternal;
|
|
|
600
600
|
exports.fetchPageWithErrorsInternal = fetchPageWithErrorsInternal;
|
|
601
601
|
exports.resolveBaseObjectSetType = resolveBaseObjectSetType;
|
|
602
602
|
exports.symbolClientContext = symbolClientContext;
|
|
603
|
-
//# sourceMappingURL=chunk-
|
|
604
|
-
//# sourceMappingURL=chunk-
|
|
603
|
+
//# sourceMappingURL=chunk-ZV5KKQ4R.cjs.map
|
|
604
|
+
//# sourceMappingURL=chunk-ZV5KKQ4R.cjs.map
|