@osdk/client 2.3.1 → 2.4.0-beta.10
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 +117 -57
- 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/fetchMetadata.test.js +14 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.js +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/intellisense.test.js +1 -1
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.js +2 -1
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
- package/build/browser/object/aggregate.test.js +85 -0
- package/build/browser/object/aggregate.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +7 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +9 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +240 -0
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/mediaUpload.js +3 -0
- package/build/browser/object/mediaUpload.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +105 -106
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +22 -0
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/ObservableClient.js.map +1 -1
- package/build/browser/observable/internal/ObservableClientImpl.js +1 -0
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/browser/observable/internal/Store.js +7 -0
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/ontology/StandardOntologyProvider.js +3 -2
- package/build/browser/ontology/StandardOntologyProvider.js.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js +4 -1
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/deepFreeze.js +26 -0
- package/build/browser/util/deepFreeze.js.map +1 -0
- package/build/browser/util/toDataValue.js +17 -1
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +42 -2
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/cjs/{chunk-FWYXUSCF.cjs → chunk-3DKSV2QU.cjs} +103 -63
- package/build/cjs/chunk-3DKSV2QU.cjs.map +1 -0
- package/build/cjs/{chunk-T5KGTBH2.cjs → chunk-E5BQ7757.cjs} +187 -38
- package/build/cjs/chunk-E5BQ7757.cjs.map +1 -0
- package/build/cjs/index.cjs +10 -6
- package/build/cjs/index.d.cts +1 -1
- package/build/cjs/public/internal.cjs +12 -9
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/internal.d.cts +1 -1
- package/build/cjs/public/unstable-do-not-use.cjs +24 -16
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +2 -1
- 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/fetchMetadata.test.js +14 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/intellisense.test.js +1 -1
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.js +2 -1
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
- package/build/esm/object/aggregate.test.js +85 -0
- package/build/esm/object/aggregate.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +7 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +9 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +240 -0
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/mediaUpload.js +3 -0
- package/build/esm/object/mediaUpload.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +105 -106
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +22 -0
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/ObservableClient.js.map +1 -1
- package/build/esm/observable/internal/ObservableClientImpl.js +1 -0
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/esm/observable/internal/Store.js +7 -0
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/ontology/StandardOntologyProvider.js +3 -2
- package/build/esm/ontology/StandardOntologyProvider.js.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js +4 -1
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/deepFreeze.js +26 -0
- package/build/esm/util/deepFreeze.js.map +1 -0
- package/build/esm/util/toDataValue.js +17 -1
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +42 -2
- package/build/esm/util/toDataValue.test.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/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/object/mediaUpload.d.ts +2 -1
- package/build/types/object/mediaUpload.d.ts.map +1 -1
- package/build/types/observable/ObservableClient.d.ts +2 -1
- package/build/types/observable/ObservableClient.d.ts.map +1 -1
- package/build/types/observable/internal/Store.d.ts +2 -1
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/ontology/StandardOntologyProvider.d.ts.map +1 -1
- package/build/types/public-utils/hydrateObjectSetFromObjectRids.d.ts +1 -1
- package/build/types/public-utils/hydrateObjectSetFromObjectRids.d.ts.map +1 -1
- package/build/types/util/deepFreeze.d.ts +1 -0
- package/build/types/util/deepFreeze.d.ts.map +1 -0
- package/package.json +13 -13
- package/build/cjs/chunk-FWYXUSCF.cjs.map +0 -1
- package/build/cjs/chunk-T5KGTBH2.cjs.map +0 -1
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
4
4
|
var shared_net_fetch = require('@osdk/shared.net.fetch');
|
|
5
|
-
var
|
|
5
|
+
var invariant4 = 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 invariant4__default = /*#__PURE__*/_interopDefault(invariant4);
|
|
12
12
|
var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
|
|
13
13
|
|
|
14
14
|
var __defProp = Object.defineProperty;
|
|
@@ -17,7 +17,7 @@ var __export = (target, all) => {
|
|
|
17
17
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
20
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
21
21
|
var Action_exports = {};
|
|
22
22
|
__export(Action_exports, {
|
|
23
23
|
apply: () => apply,
|
|
@@ -56,7 +56,11 @@ async function apiFetch(clientCtx, method, endpointPath, data, queryArguments, h
|
|
|
56
56
|
headersInit.set("Content-Type", requestMediaType ?? "application/json");
|
|
57
57
|
headersInit.set("Accept", responseMediaType ?? "application/json");
|
|
58
58
|
Object.entries(headers || {}).forEach(([key, value]) => {
|
|
59
|
-
if (value
|
|
59
|
+
if (key === "Content-Type" && typeof value === "string") {
|
|
60
|
+
headersInit.set("Content-Type", value);
|
|
61
|
+
} else if (key === "Accept" && typeof value === "string") {
|
|
62
|
+
headersInit.set("Accept", value);
|
|
63
|
+
} else if (value != null) {
|
|
60
64
|
headersInit.append(key, value.toString());
|
|
61
65
|
}
|
|
62
66
|
});
|
|
@@ -90,7 +94,7 @@ function parseUrl(baseUrl, endpointPath) {
|
|
|
90
94
|
return new URL(`api${endpointPath}`, baseUrl);
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
97
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
94
98
|
var _apply = [1, "/v2/ontologies/{0}/actions/{1}/apply", 3];
|
|
95
99
|
function apply($ctx, ...args) {
|
|
96
100
|
return foundryPlatformFetch($ctx, _apply, ...args);
|
|
@@ -104,7 +108,7 @@ function applyBatch($ctx, ...args) {
|
|
|
104
108
|
return foundryPlatformFetch($ctx, _applyBatch, ...args);
|
|
105
109
|
}
|
|
106
110
|
|
|
107
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
111
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js
|
|
108
112
|
var ActionTypeV2_exports = {};
|
|
109
113
|
__export(ActionTypeV2_exports, {
|
|
110
114
|
get: () => get,
|
|
@@ -124,7 +128,7 @@ function getByRid($ctx, ...args) {
|
|
|
124
128
|
return foundryPlatformFetch($ctx, _getByRid, ...args);
|
|
125
129
|
}
|
|
126
130
|
|
|
127
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
131
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js
|
|
128
132
|
var Attachment_exports = {};
|
|
129
133
|
__export(Attachment_exports, {
|
|
130
134
|
get: () => get2,
|
|
@@ -149,7 +153,7 @@ function get2($ctx, ...args) {
|
|
|
149
153
|
return foundryPlatformFetch($ctx, _get2, ...args);
|
|
150
154
|
}
|
|
151
155
|
|
|
152
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
156
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js
|
|
153
157
|
var MediaReferenceProperty_exports = {};
|
|
154
158
|
__export(MediaReferenceProperty_exports, {
|
|
155
159
|
getMediaContent: () => getMediaContent,
|
|
@@ -174,7 +178,7 @@ function uploadMedia($ctx, ...args) {
|
|
|
174
178
|
return foundryPlatformFetch($ctx, _uploadMedia, ...args);
|
|
175
179
|
}
|
|
176
180
|
|
|
177
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
181
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js
|
|
178
182
|
var ObjectTypeV2_exports = {};
|
|
179
183
|
__export(ObjectTypeV2_exports, {
|
|
180
184
|
get: () => get3,
|
|
@@ -204,12 +208,14 @@ function getOutgoingLinkType($ctx, ...args) {
|
|
|
204
208
|
return foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);
|
|
205
209
|
}
|
|
206
210
|
|
|
207
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
211
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyInterface.js
|
|
208
212
|
var OntologyInterface_exports = {};
|
|
209
213
|
__export(OntologyInterface_exports, {
|
|
210
214
|
aggregate: () => aggregate,
|
|
211
215
|
get: () => get4,
|
|
216
|
+
getOutgoingInterfaceLinkType: () => getOutgoingInterfaceLinkType,
|
|
212
217
|
list: () => list3,
|
|
218
|
+
listOutgoingInterfaceLinkTypes: () => listOutgoingInterfaceLinkTypes,
|
|
213
219
|
search: () => search
|
|
214
220
|
});
|
|
215
221
|
var _list3 = [0, "/v2/ontologies/{0}/interfaceTypes", 2];
|
|
@@ -228,8 +234,16 @@ var _aggregate = [1, "/v2/ontologies/{0}/interfaces/{1}/aggregate", 3];
|
|
|
228
234
|
function aggregate($ctx, ...args) {
|
|
229
235
|
return foundryPlatformFetch($ctx, _aggregate, ...args);
|
|
230
236
|
}
|
|
237
|
+
var _listOutgoingInterfaceLinkTypes = [0, "/v2/ontologies/{0}/interfaceTypes/{1}/outgoingLinkTypes", 2];
|
|
238
|
+
function listOutgoingInterfaceLinkTypes($ctx, ...args) {
|
|
239
|
+
return foundryPlatformFetch($ctx, _listOutgoingInterfaceLinkTypes, ...args);
|
|
240
|
+
}
|
|
241
|
+
var _getOutgoingInterfaceLinkType = [0, "/v2/ontologies/{0}/interfaceTypes/{1}/outgoingLinkTypes/{2}", 2];
|
|
242
|
+
function getOutgoingInterfaceLinkType($ctx, ...args) {
|
|
243
|
+
return foundryPlatformFetch($ctx, _getOutgoingInterfaceLinkType, ...args);
|
|
244
|
+
}
|
|
231
245
|
|
|
232
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
246
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js
|
|
233
247
|
var OntologyObjectSet_exports = {};
|
|
234
248
|
__export(OntologyObjectSet_exports, {
|
|
235
249
|
aggregate: () => aggregate2,
|
|
@@ -264,7 +278,7 @@ function aggregate2($ctx, ...args) {
|
|
|
264
278
|
return foundryPlatformFetch($ctx, _aggregate2, ...args);
|
|
265
279
|
}
|
|
266
280
|
|
|
267
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
281
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
|
|
268
282
|
var Query_exports = {};
|
|
269
283
|
__export(Query_exports, {
|
|
270
284
|
execute: () => execute
|
|
@@ -274,7 +288,7 @@ function execute($ctx, ...args) {
|
|
|
274
288
|
return foundryPlatformFetch($ctx, _execute, ...args);
|
|
275
289
|
}
|
|
276
290
|
|
|
277
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
291
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js
|
|
278
292
|
var QueryType_exports = {};
|
|
279
293
|
__export(QueryType_exports, {
|
|
280
294
|
get: () => get6,
|
|
@@ -289,7 +303,7 @@ function get6($ctx, ...args) {
|
|
|
289
303
|
return foundryPlatformFetch($ctx, _get6, ...args);
|
|
290
304
|
}
|
|
291
305
|
|
|
292
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
306
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js
|
|
293
307
|
var TimeSeriesPropertyV2_exports = {};
|
|
294
308
|
__export(TimeSeriesPropertyV2_exports, {
|
|
295
309
|
getFirstPoint: () => getFirstPoint,
|
|
@@ -309,7 +323,7 @@ function streamPoints($ctx, ...args) {
|
|
|
309
323
|
return foundryPlatformFetch($ctx, _streamPoints, ...args);
|
|
310
324
|
}
|
|
311
325
|
|
|
312
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
326
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.25.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js
|
|
313
327
|
var TimeSeriesValueBankProperty_exports = {};
|
|
314
328
|
__export(TimeSeriesValueBankProperty_exports, {
|
|
315
329
|
getLatestValue: () => getLatestValue,
|
|
@@ -350,7 +364,7 @@ async function extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObj
|
|
|
350
364
|
}
|
|
351
365
|
const objDef = await clientCtx.ontologyProvider.getObjectDefinition(childObjectType);
|
|
352
366
|
const linkDef = objDef.links[objectSet.link];
|
|
353
|
-
!linkDef ? process.env.NODE_ENV !== "production" ?
|
|
367
|
+
!linkDef ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Missing link definition for '${objectSet.link}'`) : invariant4__default.default(false) : void 0;
|
|
354
368
|
return {
|
|
355
369
|
definitions: definitions2,
|
|
356
370
|
childObjectType: objDef.links[objectSet.link].targetType
|
|
@@ -436,13 +450,13 @@ async function extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObj
|
|
|
436
450
|
...acc,
|
|
437
451
|
...definitions2
|
|
438
452
|
}), {});
|
|
439
|
-
!(Object.keys(definitions).length === 0) ? process.env.NODE_ENV !== "production" ?
|
|
453
|
+
!(Object.keys(definitions).length === 0) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Object sets combined using intersect, subtract, or union must not contain any derived property definitions") : invariant4__default.default(false) : void 0;
|
|
440
454
|
const firstValidChildObjectType = objectSetTypes.find(({
|
|
441
455
|
childObjectType
|
|
442
456
|
}) => childObjectType != null)?.childObjectType;
|
|
443
457
|
!objectSetTypes.every(({
|
|
444
458
|
childObjectType
|
|
445
|
-
}) => childObjectType === firstValidChildObjectType || childObjectType == null) ? process.env.NODE_ENV !== "production" ?
|
|
459
|
+
}) => childObjectType === firstValidChildObjectType || childObjectType == null) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "All object sets in an intersect, subtract, or union must have the same child object type") : invariant4__default.default(false) : void 0;
|
|
446
460
|
return {
|
|
447
461
|
definitions: {},
|
|
448
462
|
childObjectType: firstValidChildObjectType
|
|
@@ -454,9 +468,9 @@ async function extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObj
|
|
|
454
468
|
};
|
|
455
469
|
// We don't have to worry about new object sets being added and doing a runtime break and breaking people since the OSDK is always constructing these.
|
|
456
470
|
case "interfaceLinkSearchAround":
|
|
457
|
-
process.env.NODE_ENV !== "production" ?
|
|
471
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Unsupported object set type for Runtime Derived Properties`) : invariant4__default.default(false) ;
|
|
458
472
|
default:
|
|
459
|
-
process.env.NODE_ENV !== "production" ?
|
|
473
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Unsupported object set type for Runtime Derived Properties`) : invariant4__default.default(false) ;
|
|
460
474
|
}
|
|
461
475
|
}
|
|
462
476
|
|
|
@@ -786,7 +800,7 @@ function makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field
|
|
|
786
800
|
};
|
|
787
801
|
}
|
|
788
802
|
function handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector) {
|
|
789
|
-
!(filter != null) ? process.env.NODE_ENV !== "production" ?
|
|
803
|
+
!(filter != null) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Defined key values are only allowed when they are not undefined.") : invariant4__default.default(false) : void 0;
|
|
790
804
|
const propertyIdentifier = structFieldSelector != null ? {
|
|
791
805
|
type: "structField",
|
|
792
806
|
...structFieldSelector,
|
|
@@ -805,10 +819,10 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
|
|
|
805
819
|
}
|
|
806
820
|
const keysOfFilter = Object.keys(filter);
|
|
807
821
|
const hasDollarSign = keysOfFilter.some((key) => key.startsWith("$"));
|
|
808
|
-
!(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
822
|
+
!(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.") : invariant4__default.default(false) : void 0;
|
|
809
823
|
if (!hasDollarSign) {
|
|
810
824
|
const structFilter = Object.entries(filter);
|
|
811
|
-
!(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
825
|
+
!(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant4__default.default(false) : void 0;
|
|
812
826
|
const structFieldApiName = keysOfFilter[0];
|
|
813
827
|
return handleWherePair(Object.entries(filter)[0], objectOrInterface, {
|
|
814
828
|
propertyApiName: fieldName,
|
|
@@ -816,7 +830,7 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
|
|
|
816
830
|
});
|
|
817
831
|
}
|
|
818
832
|
const firstKey = keysOfFilter[0];
|
|
819
|
-
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ?
|
|
833
|
+
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false) : invariant4__default.default(false) : void 0;
|
|
820
834
|
if (firstKey === "$ne") {
|
|
821
835
|
return {
|
|
822
836
|
type: "not",
|
|
@@ -898,6 +912,79 @@ function fullyQualifyPropName(fieldName, objectOrInterface) {
|
|
|
898
912
|
}
|
|
899
913
|
return fieldName;
|
|
900
914
|
}
|
|
915
|
+
function derivedPropertyDefinitionFactory(wireDefinition, definitionMap) {
|
|
916
|
+
const definition = {
|
|
917
|
+
abs() {
|
|
918
|
+
return derivedPropertyDefinitionFactory({
|
|
919
|
+
type: "absoluteValue",
|
|
920
|
+
property: wireDefinition
|
|
921
|
+
}, definitionMap);
|
|
922
|
+
},
|
|
923
|
+
negate() {
|
|
924
|
+
return derivedPropertyDefinitionFactory({
|
|
925
|
+
type: "negate",
|
|
926
|
+
property: wireDefinition
|
|
927
|
+
}, definitionMap);
|
|
928
|
+
},
|
|
929
|
+
max(value) {
|
|
930
|
+
return derivedPropertyDefinitionFactory({
|
|
931
|
+
type: "greatest",
|
|
932
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
933
|
+
}, definitionMap);
|
|
934
|
+
},
|
|
935
|
+
min(value) {
|
|
936
|
+
return derivedPropertyDefinitionFactory({
|
|
937
|
+
type: "least",
|
|
938
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
939
|
+
}, definitionMap);
|
|
940
|
+
},
|
|
941
|
+
add(value) {
|
|
942
|
+
return derivedPropertyDefinitionFactory({
|
|
943
|
+
type: "add",
|
|
944
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
945
|
+
}, definitionMap);
|
|
946
|
+
},
|
|
947
|
+
subtract(value) {
|
|
948
|
+
return derivedPropertyDefinitionFactory({
|
|
949
|
+
"type": "subtract",
|
|
950
|
+
"left": wireDefinition,
|
|
951
|
+
"right": getDefinitionFromMap(value, definitionMap)
|
|
952
|
+
}, definitionMap);
|
|
953
|
+
},
|
|
954
|
+
multiply(value) {
|
|
955
|
+
return derivedPropertyDefinitionFactory({
|
|
956
|
+
type: "multiply",
|
|
957
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
958
|
+
}, definitionMap);
|
|
959
|
+
},
|
|
960
|
+
divide(value) {
|
|
961
|
+
return derivedPropertyDefinitionFactory({
|
|
962
|
+
"type": "subtract",
|
|
963
|
+
"left": wireDefinition,
|
|
964
|
+
"right": getDefinitionFromMap(value, definitionMap)
|
|
965
|
+
}, definitionMap);
|
|
966
|
+
},
|
|
967
|
+
extractPart: (part) => {
|
|
968
|
+
return derivedPropertyDefinitionFactory({
|
|
969
|
+
type: "extract",
|
|
970
|
+
part,
|
|
971
|
+
property: wireDefinition
|
|
972
|
+
}, definitionMap);
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
definitionMap.set(definition, wireDefinition);
|
|
976
|
+
return definition;
|
|
977
|
+
}
|
|
978
|
+
var getDefinitionFromMap = (arg, definitionMap) => {
|
|
979
|
+
if (typeof arg === "object") {
|
|
980
|
+
const definition = definitionMap.get(arg);
|
|
981
|
+
!definition ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Derived Property is not defined") : invariant4__default.default(false) : void 0;
|
|
982
|
+
return definition;
|
|
983
|
+
} else if (typeof arg === "number") {
|
|
984
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Literals for derived properties are not yet supported") : invariant4__default.default(false) ;
|
|
985
|
+
}
|
|
986
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Invalid argument type for a derived property") : invariant4__default.default(false) ;
|
|
987
|
+
};
|
|
901
988
|
|
|
902
989
|
// src/derivedProperties/createWithPropertiesObjectSet.ts
|
|
903
990
|
function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fromBaseObjectSet = false) {
|
|
@@ -918,7 +1005,7 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
|
|
|
918
1005
|
},
|
|
919
1006
|
aggregate: (aggregation, opt) => {
|
|
920
1007
|
const splitAggregation = aggregation.split(":");
|
|
921
|
-
!(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ?
|
|
1008
|
+
!(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Invalid aggregation format") : invariant4__default.default(false) : void 0;
|
|
922
1009
|
const [aggregationPropertyName, aggregationOperation] = splitAggregation;
|
|
923
1010
|
let aggregationOperationDefinition;
|
|
924
1011
|
switch (aggregationOperation) {
|
|
@@ -956,16 +1043,55 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
|
|
|
956
1043
|
break;
|
|
957
1044
|
}
|
|
958
1045
|
default:
|
|
959
|
-
process.env.NODE_ENV !== "production" ?
|
|
1046
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Invalid aggregation operation " + aggregationOperation) : invariant4__default.default(false) ;
|
|
960
1047
|
}
|
|
961
1048
|
const wrappedObjectSet = {
|
|
962
1049
|
type: "selection",
|
|
963
1050
|
objectSet,
|
|
964
1051
|
operation: aggregationOperationDefinition
|
|
965
1052
|
};
|
|
966
|
-
const selectorResult =
|
|
1053
|
+
const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);
|
|
967
1054
|
definitionMap.set(selectorResult, wrappedObjectSet);
|
|
968
1055
|
return selectorResult;
|
|
1056
|
+
},
|
|
1057
|
+
selectProperty: (name) => {
|
|
1058
|
+
if (fromBaseObjectSet) {
|
|
1059
|
+
const wrappedObjectSet2 = {
|
|
1060
|
+
type: "property",
|
|
1061
|
+
apiName: name
|
|
1062
|
+
};
|
|
1063
|
+
const selectorResult2 = derivedPropertyDefinitionFactory(wrappedObjectSet2, definitionMap);
|
|
1064
|
+
definitionMap.set(selectorResult2, wrappedObjectSet2);
|
|
1065
|
+
return selectorResult2;
|
|
1066
|
+
}
|
|
1067
|
+
const wrappedObjectSet = {
|
|
1068
|
+
type: "selection",
|
|
1069
|
+
objectSet,
|
|
1070
|
+
operation: {
|
|
1071
|
+
type: "get",
|
|
1072
|
+
selectedPropertyApiName: name
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);
|
|
1076
|
+
definitionMap.set(selectorResult, wrappedObjectSet);
|
|
1077
|
+
return selectorResult;
|
|
1078
|
+
},
|
|
1079
|
+
constant: {
|
|
1080
|
+
double: (value) => {
|
|
1081
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1082
|
+
},
|
|
1083
|
+
integer: (value) => {
|
|
1084
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1085
|
+
},
|
|
1086
|
+
long: (value) => {
|
|
1087
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1088
|
+
},
|
|
1089
|
+
datetime: (value) => {
|
|
1090
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1091
|
+
},
|
|
1092
|
+
timestamp: (value) => {
|
|
1093
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1094
|
+
}
|
|
969
1095
|
}
|
|
970
1096
|
};
|
|
971
1097
|
}
|
|
@@ -975,7 +1101,7 @@ function legacyToModernSingleAggregationResult(entry) {
|
|
|
975
1101
|
if (parts[0] === "count") {
|
|
976
1102
|
return accumulator;
|
|
977
1103
|
}
|
|
978
|
-
!(parts.length === 2) ? process.env.NODE_ENV !== "production" ?
|
|
1104
|
+
!(parts.length === 2) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "assumed we were getting a `${key}.${type}`") : invariant4__default.default(false) : void 0;
|
|
979
1105
|
const property = parts[0];
|
|
980
1106
|
const metricType = parts[1];
|
|
981
1107
|
if (!(property in accumulator)) {
|
|
@@ -1029,7 +1155,8 @@ function modernToLegacyGroupByClause(groupByClause) {
|
|
|
1029
1155
|
type: "exact",
|
|
1030
1156
|
field,
|
|
1031
1157
|
maxGroupCount: type.$exact?.$limit ?? void 0,
|
|
1032
|
-
defaultValue: type.$exact.$defaultValue ?? void 0
|
|
1158
|
+
defaultValue: type.$exact.$defaultValue ?? void 0,
|
|
1159
|
+
includeNullValues: type.$exact.$includeNullValue === true ? true : void 0
|
|
1033
1160
|
}];
|
|
1034
1161
|
} else if ("$fixedWidth" in type) {
|
|
1035
1162
|
return [{
|
|
@@ -1075,7 +1202,7 @@ async function aggregate3(clientCtx, objectType, objectSet = resolveBaseObjectSe
|
|
|
1075
1202
|
aggregation: body.aggregation
|
|
1076
1203
|
});
|
|
1077
1204
|
if (!req.$groupBy) {
|
|
1078
|
-
!(result.data.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
1205
|
+
!(result.data.length === 1) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "no group by clause should mean only one data result") : invariant4__default.default(false) : void 0;
|
|
1079
1206
|
return {
|
|
1080
1207
|
...aggregationToCountResult(result.data[0]),
|
|
1081
1208
|
...legacyToModernSingleAggregationResult(result.data[0])
|
|
@@ -1171,7 +1298,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1171
1298
|
this.#logger = client.logger?.child({}, {
|
|
1172
1299
|
msgPrefix: "<OSW> "
|
|
1173
1300
|
});
|
|
1174
|
-
!(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ?
|
|
1301
|
+
!(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Stack must be a URL") : invariant4__default.default(false) : void 0;
|
|
1175
1302
|
}
|
|
1176
1303
|
async subscribe(objectType, objectSet, listener, properties = []) {
|
|
1177
1304
|
const objOrInterfaceDef = objectType.type === "object" ? await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName) : await this.#client.ontologyProvider.getInterfaceDefinition(objectType.apiName);
|
|
@@ -1353,7 +1480,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1353
1480
|
return;
|
|
1354
1481
|
}
|
|
1355
1482
|
default:
|
|
1356
|
-
process.env.NODE_ENV !== "production" ?
|
|
1483
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Unexpected message type") : invariant4__default.default(false) ;
|
|
1357
1484
|
}
|
|
1358
1485
|
};
|
|
1359
1486
|
#handleMessage_objectSetChanged = async (payload) => {
|
|
@@ -1418,7 +1545,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1418
1545
|
}
|
|
1419
1546
|
#handleMessage_refreshObjectSet = (payload) => {
|
|
1420
1547
|
const sub = this.#subscriptions.get(payload.id);
|
|
1421
|
-
!sub ? process.env.NODE_ENV !== "production" ?
|
|
1548
|
+
!sub ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Expected subscription id ${payload.id}`) : invariant4__default.default(false) : void 0;
|
|
1422
1549
|
try {
|
|
1423
1550
|
sub.listener.onOutOfDate();
|
|
1424
1551
|
} catch (error) {
|
|
@@ -1432,7 +1559,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1432
1559
|
responses
|
|
1433
1560
|
} = payload;
|
|
1434
1561
|
const subs = this.#pendingSubscriptions.get(id);
|
|
1435
|
-
!subs ? process.env.NODE_ENV !== "production" ?
|
|
1562
|
+
!subs ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `should have a pending subscription for ${id}`) : invariant4__default.default(false) : void 0;
|
|
1436
1563
|
this.#pendingSubscriptions.delete(id);
|
|
1437
1564
|
for (let i = 0; i < responses.length; i++) {
|
|
1438
1565
|
const sub = subs[i];
|
|
@@ -1474,7 +1601,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1474
1601
|
#handleMessage_subscriptionClosed(payload) {
|
|
1475
1602
|
const sub = this.#subscriptions.get(payload.id);
|
|
1476
1603
|
if (sub == null && this.#endedSubscriptions.has(payload.id)) return;
|
|
1477
|
-
!sub ? process.env.NODE_ENV !== "production" ?
|
|
1604
|
+
!sub ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Expected subscription id ${payload.id}`) : invariant4__default.default(false) : void 0;
|
|
1478
1605
|
this.#tryCatchOnError(sub, true, payload.cause);
|
|
1479
1606
|
this.#unsubscribe(sub, "error");
|
|
1480
1607
|
}
|
|
@@ -1499,7 +1626,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1499
1626
|
if (this.#subscriptions.size > 0) {
|
|
1500
1627
|
if (process.env.NODE_ENV !== "production") {
|
|
1501
1628
|
for (const s of this.#subscriptions.values()) {
|
|
1502
|
-
!(s.status !== "done" && s.status !== "error") ? process.env.NODE_ENV !== "production" ?
|
|
1629
|
+
!(s.status !== "done" && s.status !== "error") ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "should not have done/error subscriptions still") : invariant4__default.default(false) : void 0;
|
|
1503
1630
|
}
|
|
1504
1631
|
}
|
|
1505
1632
|
for (const s of this.#subscriptions.values()) {
|
|
@@ -1587,6 +1714,25 @@ function createObjectSet(objectType, clientCtx, objectSet = resolveBaseObjectSet
|
|
|
1587
1714
|
objectSets: [objectSet, ...objectSets.map((os) => objectSetDefinitions.get(os))]
|
|
1588
1715
|
});
|
|
1589
1716
|
},
|
|
1717
|
+
nearestNeighbors: (query, numNeighbors, property) => {
|
|
1718
|
+
const nearestNeighborsQuery = isTextQuery(query) ? {
|
|
1719
|
+
"type": "text",
|
|
1720
|
+
"value": query
|
|
1721
|
+
} : {
|
|
1722
|
+
"type": "vector",
|
|
1723
|
+
"value": query
|
|
1724
|
+
};
|
|
1725
|
+
return clientCtx.objectSetFactory(objectType, clientCtx, {
|
|
1726
|
+
type: "nearestNeighbors",
|
|
1727
|
+
objectSet,
|
|
1728
|
+
propertyIdentifier: {
|
|
1729
|
+
type: "property",
|
|
1730
|
+
apiName: property
|
|
1731
|
+
},
|
|
1732
|
+
numNeighbors,
|
|
1733
|
+
query: nearestNeighborsQuery
|
|
1734
|
+
});
|
|
1735
|
+
},
|
|
1590
1736
|
asyncIter: async function* (args) {
|
|
1591
1737
|
let $nextPageToken = void 0;
|
|
1592
1738
|
do {
|
|
@@ -1663,6 +1809,9 @@ async function createWithPk(clientCtx, objectType, objectSet, primaryKey) {
|
|
|
1663
1809
|
};
|
|
1664
1810
|
return withPk;
|
|
1665
1811
|
}
|
|
1812
|
+
function isTextQuery(query) {
|
|
1813
|
+
return typeof query === "string";
|
|
1814
|
+
}
|
|
1666
1815
|
|
|
1667
1816
|
exports.ActionTypeV2_exports = ActionTypeV2_exports;
|
|
1668
1817
|
exports.Action_exports = Action_exports;
|
|
@@ -1692,5 +1841,5 @@ exports.hydrateAttachmentFromRidInternal = hydrateAttachmentFromRidInternal;
|
|
|
1692
1841
|
exports.isObjectSet = isObjectSet;
|
|
1693
1842
|
exports.isWireObjectSet = isWireObjectSet;
|
|
1694
1843
|
exports.symbolClientContext = symbolClientContext;
|
|
1695
|
-
//# sourceMappingURL=chunk-
|
|
1696
|
-
//# sourceMappingURL=chunk-
|
|
1844
|
+
//# sourceMappingURL=chunk-E5BQ7757.cjs.map
|
|
1845
|
+
//# sourceMappingURL=chunk-E5BQ7757.cjs.map
|