@osdk/client 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/chunk-GOBQUVQZ.mjs +1138 -0
- package/build/js/chunk-GOBQUVQZ.mjs.map +1 -0
- package/build/js/chunk-LK4VDWCG.cjs +1151 -0
- package/build/js/chunk-LK4VDWCG.cjs.map +1 -0
- package/build/js/index.cjs +101 -636
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +99 -634
- package/build/js/index.mjs.map +1 -1
- package/build/js/public/objects.cjs +5 -5
- package/build/js/public/objects.mjs +1 -1
- package/build/types/Client.d.ts +11 -5
- package/build/types/MinimalClientContext.d.ts +13 -0
- package/build/types/ObjectSetCreator.d.ts +6 -4
- package/build/types/OsdkObjectFrom.d.ts +11 -11
- package/build/types/actions/Actions.d.ts +5 -4
- package/build/types/actions/applyAction.d.ts +2 -2
- package/build/types/actions/createActionInvoker.d.ts +5 -4
- package/build/types/createClient.d.ts +5 -2
- package/build/types/createMinimalClient.d.ts +3 -0
- package/build/types/definitions/LinkDefinitions.d.ts +8 -12
- package/build/types/generatedNoCheck/Ontology.d.ts +5 -5
- package/build/types/generatedNoCheck/index.d.ts +3 -0
- package/build/types/generatedNoCheck/ontology/actions/actionTakesAttachment.d.ts +1 -1
- package/build/types/generatedNoCheck/ontology/actions/actionTakesObjectSet.d.ts +2 -2
- package/build/types/generatedNoCheck/ontology/actions/createOffice.d.ts +4 -4
- package/build/types/generatedNoCheck/ontology/actions/createOfficeAndEmployee.d.ts +5 -5
- package/build/types/generatedNoCheck/ontology/actions/moveOffice.d.ts +4 -4
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployee.d.ts +3 -3
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployeeObject.d.ts +4 -4
- package/build/types/generatedNoCheck/ontology/objects/Employee.d.ts +13 -37
- package/build/types/generatedNoCheck/ontology/objects/ObjectWithTimestampPrimaryKey.d.ts +6 -15
- package/build/types/generatedNoCheck/ontology/objects/Office.d.ts +10 -29
- package/build/types/generatedNoCheck/ontology/objects/equipment.d.ts +6 -16
- package/build/types/generatedNoCheck/ontology/objects/objectTypeWithAllPropertyTypes.d.ts +34 -155
- package/build/types/index.d.ts +3 -1
- package/build/types/object/Cache.d.ts +33 -0
- package/build/types/object/aggregate.d.ts +11 -0
- package/build/types/object/convertWireToOsdkObjects.d.ts +2 -3
- package/build/types/object/fetchPage.d.ts +22 -0
- package/build/types/object/fetchPage.test.d.ts +1 -0
- package/build/types/object/fetchSingle.d.ts +6 -0
- package/build/types/object/index.d.ts +2 -2
- package/build/types/objectSet/LinkUtils.d.ts +3 -0
- package/build/types/objectSet/ObjectSet.d.ts +18 -10
- package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +4 -4
- package/build/types/objectSet/createObjectSet.d.ts +4 -3
- package/build/types/ontology/OntologyProvider.d.ts +20 -0
- package/build/types/ontology/loadFullObjectMetadata.d.ts +3 -0
- package/build/types/ontology/providers/StandardOntologyProvider.d.ts +5 -0
- package/build/types/ontology/providers/StandardOntologyProvider.test.d.ts +1 -0
- package/build/types/query/WhereClause.d.ts +2 -1
- package/build/types/query/aggregations/AggregatableKeys.d.ts +1 -1
- package/build/types/query/aggregations/AggregateOpts.d.ts +3 -3
- package/build/types/query/aggregations/AggregationResultsWithGroups.d.ts +9 -4
- package/build/types/query/aggregations/AggregationResultsWithoutGroups.d.ts +4 -1
- package/build/types/query/aggregations/AggregationsClause.d.ts +5 -2
- package/build/types/query/aggregations/AggregationsClause.test.d.ts +2 -0
- package/build/types/query/aggregations/AggregationsResults.d.ts +3 -2
- package/build/types/query/aggregations/GroupByClause.d.ts +8 -0
- package/build/types/query/aggregations/GroupByClause.test.d.ts +1 -0
- package/build/types/query/aggregations/GroupByMapper.d.ts +7 -1
- package/build/types/util/test/mockOntology.d.ts +3 -0
- package/changelog/0.11.0/pr-100.v2.yml +5 -0
- package/changelog/0.11.0/pr-67.v2.yml +5 -0
- package/changelog/0.11.0/pr-83.v2.yml +5 -0
- package/changelog/0.11.0/pr-84.v2.yml +5 -0
- package/changelog/0.11.0/pr-86.v2.yml +5 -0
- package/changelog/0.11.0/pr-88.v2.yml +5 -0
- package/changelog/0.11.0/pr-89.v2.yml +5 -0
- package/changelog/0.11.0/pr-91.v2.yml +5 -0
- package/changelog/0.11.0/pr-95.v2.yml +5 -0
- package/changelog/0.11.0/pr-96.v2.yml +5 -0
- package/changelog/0.11.0/pr-99.v2.yml +5 -0
- package/package.json +8 -6
- package/build/js/chunk-MVO52VHK.cjs +0 -458
- package/build/js/chunk-MVO52VHK.cjs.map +0 -1
- package/build/js/chunk-XI2O777X.mjs +0 -447
- package/build/js/chunk-XI2O777X.mjs.map +0 -1
- package/build/types/createCachedOntologyTransform.d.ts +0 -7
- package/build/types/object/aggregateOrThrow.d.ts +0 -6
- package/build/types/object/fetchPageOrThrow.d.ts +0 -19
- package/build/types/object/getLinkedObjectByPkOrThrow.d.ts +0 -5
- package/build/types/object/getLinkedObjectOrThrow.d.ts +0 -7
- package/build/types/object/pageLinkedObjectsOrThrow.d.ts +0 -7
- package/build/types/objectSet/LinkTypesFrom.d.ts +0 -2
- /package/build/types/object/{aggregateOrThrow.test.d.ts → aggregate.test.d.ts} +0 -0
package/build/js/index.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { object_exports as Objects } from './chunk-
|
|
1
|
+
import { createObjectSet, createAsyncCache, createBaseObjectSet, isAttachment } from './chunk-GOBQUVQZ.mjs';
|
|
2
|
+
export { object_exports as Objects } from './chunk-GOBQUVQZ.mjs';
|
|
3
|
+
import { getObjectTypeV2, applyActionV2, listOutgoingLinkTypesV2 } from '@osdk/gateway/requests';
|
|
3
4
|
import { createClientContext, createOpenApiRequest } from '@osdk/shared.net';
|
|
4
5
|
export { createClientContext, isOk } from '@osdk/shared.net';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import invariant from 'tiny-invariant';
|
|
8
|
-
import { conjureFetch } from 'conjure-lite';
|
|
6
|
+
import deepEqual from 'fast-deep-equal';
|
|
7
|
+
import { wireObjectTypeFullMetadataToSdkObjectTypeDefinition } from '@osdk/generator-converters';
|
|
9
8
|
|
|
10
9
|
// src/util/isOntologyObjectV2.ts
|
|
11
10
|
function isOntologyObjectV2(o) {
|
|
@@ -88,23 +87,26 @@ function remapActionParams(params) {
|
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
// src/actions/createActionInvoker.ts
|
|
91
|
-
function createActionInvoker(client) {
|
|
90
|
+
function createActionInvoker(client, action) {
|
|
91
|
+
return function(...args) {
|
|
92
|
+
return applyAction(client, action, ...args);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function createOldActionInvoker(client, ontology) {
|
|
92
96
|
const proxy = new Proxy({}, {
|
|
93
97
|
get: (_target, p, _receiver) => {
|
|
94
98
|
if (typeof p === "string") {
|
|
95
|
-
return
|
|
96
|
-
return applyAction(client, client.ontology.actions[p], ...args);
|
|
97
|
-
};
|
|
99
|
+
return createActionInvoker(client, ontology.actions[p]);
|
|
98
100
|
}
|
|
99
101
|
return void 0;
|
|
100
102
|
},
|
|
101
103
|
ownKeys(_target) {
|
|
102
|
-
return Object.keys(
|
|
104
|
+
return Object.keys(ontology.actions);
|
|
103
105
|
},
|
|
104
106
|
getOwnPropertyDescriptor(_target, p) {
|
|
105
107
|
if (typeof p === "string") {
|
|
106
108
|
return {
|
|
107
|
-
enumerable:
|
|
109
|
+
enumerable: ontology.actions[p] != null,
|
|
108
110
|
configurable: true,
|
|
109
111
|
value: proxy[p]
|
|
110
112
|
};
|
|
@@ -113,666 +115,129 @@ function createActionInvoker(client) {
|
|
|
113
115
|
});
|
|
114
116
|
return proxy;
|
|
115
117
|
}
|
|
116
|
-
async function
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
118
|
+
async function loadAllOutgoingLinkTypes(client, objtype) {
|
|
119
|
+
const linkTypes = [];
|
|
120
|
+
let pageToken;
|
|
121
|
+
do {
|
|
122
|
+
const result = await listOutgoingLinkTypesV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, objtype, {
|
|
123
|
+
pageToken
|
|
124
|
+
});
|
|
125
|
+
pageToken = result.nextPageToken;
|
|
126
|
+
linkTypes.push(...result.data);
|
|
127
|
+
} while (pageToken != null);
|
|
128
|
+
return linkTypes;
|
|
124
129
|
}
|
|
125
|
-
async function
|
|
126
|
-
|
|
130
|
+
async function loadFullObjectMetadata(client, objtype) {
|
|
131
|
+
const {
|
|
132
|
+
ontologyApiName
|
|
133
|
+
} = client.ontology.metadata;
|
|
134
|
+
const [objectType, linkTypes] = await Promise.all([getObjectTypeV2(createOpenApiRequest(client.stack, client.fetch), ontologyApiName, objtype), loadAllOutgoingLinkTypes(client, objtype)]);
|
|
135
|
+
const full = {
|
|
136
|
+
implementsInterfaces: [],
|
|
137
|
+
// FIXME
|
|
138
|
+
linkTypes,
|
|
139
|
+
objectType,
|
|
140
|
+
sharedPropertyTypeMapping: {}
|
|
141
|
+
// FIXME
|
|
142
|
+
};
|
|
143
|
+
return wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);
|
|
127
144
|
}
|
|
128
145
|
|
|
129
|
-
// src/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
provenance: void 0
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
case "reference":
|
|
148
|
-
return {
|
|
149
|
-
type: "referenced",
|
|
150
|
-
referenced: {
|
|
151
|
-
objectSetRid: objectSet.reference
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
case "filter":
|
|
155
|
-
return {
|
|
156
|
-
type: "filtered",
|
|
157
|
-
filtered: {
|
|
158
|
-
objectSet: toConjureObjectSet(objectSet.objectSet, objectPropertyMapping),
|
|
159
|
-
runtimeDerivedProperties: void 0,
|
|
160
|
-
filter: mapWhereClauseToObjectSetFilter(objectSet.where, objectPropertyMapping)
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
case "union":
|
|
164
|
-
return {
|
|
165
|
-
type: "unioned",
|
|
166
|
-
unioned: {
|
|
167
|
-
objectSets: objectSet.objectSets.map((os) => toConjureObjectSet(os, objectPropertyMapping))
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
case "intersect":
|
|
171
|
-
return {
|
|
172
|
-
type: "intersected",
|
|
173
|
-
intersected: {
|
|
174
|
-
objectSets: objectSet.objectSets.map((os) => toConjureObjectSet(os, objectPropertyMapping))
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
case "subtract":
|
|
178
|
-
return {
|
|
179
|
-
type: "subtracted",
|
|
180
|
-
subtracted: {
|
|
181
|
-
objectSets: objectSet.objectSets.map((os) => toConjureObjectSet(os, objectPropertyMapping))
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
case "searchAround":
|
|
185
|
-
throw new Error("not implemented");
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
async function getObjectSetBaseType(objectSet) {
|
|
189
|
-
switch (objectSet.type) {
|
|
190
|
-
case "base":
|
|
191
|
-
return objectSet.objectType;
|
|
192
|
-
case "static":
|
|
193
|
-
throw new Error("not implemented");
|
|
194
|
-
case "reference":
|
|
195
|
-
throw new Error("not implemented");
|
|
196
|
-
case "filter":
|
|
197
|
-
return getObjectSetBaseType(objectSet.objectSet);
|
|
198
|
-
case "union":
|
|
199
|
-
return getObjectSetBaseType(objectSet.objectSets[0]);
|
|
200
|
-
case "intersect":
|
|
201
|
-
return getObjectSetBaseType(objectSet.objectSets[0]);
|
|
202
|
-
case "subtract":
|
|
203
|
-
return getObjectSetBaseType(objectSet.objectSets[0]);
|
|
204
|
-
case "searchAround":
|
|
205
|
-
throw new Error("not implemented");
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function mapWhereClauseToObjectSetFilter(objectSetFilter, propertyMapping) {
|
|
209
|
-
switch (objectSetFilter.type) {
|
|
210
|
-
case "lt":
|
|
211
|
-
return {
|
|
212
|
-
type: "range",
|
|
213
|
-
range: {
|
|
214
|
-
propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
|
|
215
|
-
lt: objectSetFilter.value,
|
|
216
|
-
lte: void 0,
|
|
217
|
-
gt: void 0,
|
|
218
|
-
gte: void 0
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
case "gt":
|
|
222
|
-
return {
|
|
223
|
-
type: "range",
|
|
224
|
-
range: {
|
|
225
|
-
propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
|
|
226
|
-
gt: objectSetFilter.value,
|
|
227
|
-
lte: void 0,
|
|
228
|
-
lt: void 0,
|
|
229
|
-
gte: void 0
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
case "lte":
|
|
233
|
-
return {
|
|
234
|
-
type: "range",
|
|
235
|
-
range: {
|
|
236
|
-
propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
|
|
237
|
-
lte: objectSetFilter.value,
|
|
238
|
-
lt: void 0,
|
|
239
|
-
gt: void 0,
|
|
240
|
-
gte: void 0
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
case "gte":
|
|
244
|
-
return {
|
|
245
|
-
type: "range",
|
|
246
|
-
range: {
|
|
247
|
-
propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
|
|
248
|
-
gte: objectSetFilter.value,
|
|
249
|
-
lt: void 0,
|
|
250
|
-
lte: void 0,
|
|
251
|
-
gt: void 0
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
case "eq":
|
|
255
|
-
return {
|
|
256
|
-
type: "exactMatch",
|
|
257
|
-
exactMatch: {
|
|
258
|
-
propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field],
|
|
259
|
-
terms: []
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
case "and":
|
|
263
|
-
return {
|
|
264
|
-
type: "and",
|
|
265
|
-
and: {
|
|
266
|
-
filters: objectSetFilter.value.map((filter) => mapWhereClauseToObjectSetFilter(filter, propertyMapping))
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
case "or":
|
|
270
|
-
return {
|
|
271
|
-
type: "or",
|
|
272
|
-
or: {
|
|
273
|
-
filters: objectSetFilter.value.map((filter) => mapWhereClauseToObjectSetFilter(filter, propertyMapping))
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
case "isNull":
|
|
277
|
-
return {
|
|
278
|
-
type: "not",
|
|
279
|
-
not: {
|
|
280
|
-
filter: {
|
|
281
|
-
type: "hasProperty",
|
|
282
|
-
hasProperty: {
|
|
283
|
-
propertyId: propertyMapping.propertyApiNameToIdMapping[objectSetFilter.field]
|
|
284
|
-
}
|
|
146
|
+
// src/ontology/providers/StandardOntologyProvider.ts
|
|
147
|
+
var alwaysRevalidateDefault = false;
|
|
148
|
+
var createStandardOntologyProviderFactory = (client) => {
|
|
149
|
+
const alwaysRevalidate = client.alwaysRevalidate ?? alwaysRevalidateDefault;
|
|
150
|
+
return (client2) => {
|
|
151
|
+
const objectCache = createAsyncCache(loadFullObjectMetadata);
|
|
152
|
+
return {
|
|
153
|
+
getObjectOrInterfaceDefinition: async (apiName) => {
|
|
154
|
+
const n = alwaysRevalidate ? await loadFullObjectMetadata(client2, apiName) : await objectCache.get(client2, apiName);
|
|
155
|
+
if (alwaysRevalidate) {
|
|
156
|
+
const og = objectCache.getOrUndefined(client2, apiName);
|
|
157
|
+
if (deepEqual(og, n)) {
|
|
158
|
+
return og;
|
|
159
|
+
} else {
|
|
160
|
+
return objectCache.set(client2, apiName, n);
|
|
285
161
|
}
|
|
286
162
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
type: "not",
|
|
291
|
-
not: {
|
|
292
|
-
filter: mapWhereClauseToObjectSetFilter(objectSetFilter.value, propertyMapping)
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
case "contains":
|
|
296
|
-
case "startsWith":
|
|
297
|
-
case "containsAllTermsInOrder":
|
|
298
|
-
case "containsAnyTerm":
|
|
299
|
-
case "containsAllTerms":
|
|
300
|
-
case "withinDistanceOf":
|
|
301
|
-
case "withinBoundingBox":
|
|
302
|
-
case "intersectsBoundingBox":
|
|
303
|
-
case "doesNotIntersectBoundingBox":
|
|
304
|
-
case "withinPolygon":
|
|
305
|
-
case "intersectsPolygon":
|
|
306
|
-
case "doesNotIntersectPolygon":
|
|
307
|
-
case "containsAllTermsInOrderPrefixLastTerm":
|
|
308
|
-
throw new Error("not implemented");
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
// src/objectSet/ObjectSetListenerWebsocket.ts
|
|
313
|
-
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
314
|
-
var MINIMUM_RECONNECT_DELAY_MS = 5 * 1e3;
|
|
315
|
-
var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
316
|
-
static #instances = /* @__PURE__ */ new WeakMap();
|
|
317
|
-
static getInstance(client) {
|
|
318
|
-
let instance = _ObjectSetListenerWebsocket.#instances.get(client);
|
|
319
|
-
if (instance == null) {
|
|
320
|
-
instance = new _ObjectSetListenerWebsocket(client);
|
|
321
|
-
_ObjectSetListenerWebsocket.#instances.set(client, instance);
|
|
322
|
-
}
|
|
323
|
-
return instance;
|
|
324
|
-
}
|
|
325
|
-
#ws;
|
|
326
|
-
#lastWsConnect = 0;
|
|
327
|
-
#client;
|
|
328
|
-
/** map of listenerId to listener */
|
|
329
|
-
#listeners = /* @__PURE__ */ new Map();
|
|
330
|
-
/** map of subscriptionId to listenerId */
|
|
331
|
-
#subscriptionToRequestId = /* @__PURE__ */ new Map();
|
|
332
|
-
#conjureContext;
|
|
333
|
-
#metadataContext;
|
|
334
|
-
#ossContext;
|
|
335
|
-
constructor(client) {
|
|
336
|
-
this.#client = client;
|
|
337
|
-
const stackUrl = new URL(client.stack);
|
|
338
|
-
this.#conjureContext = {
|
|
339
|
-
baseUrl: stackUrl.origin,
|
|
340
|
-
servicePath: "/object-set-watcher/api",
|
|
341
|
-
fetchFn: client.fetch,
|
|
342
|
-
tokenProvider: async () => await client.tokenProvider()
|
|
343
|
-
};
|
|
344
|
-
this.#ossContext = {
|
|
345
|
-
baseUrl: stackUrl.origin,
|
|
346
|
-
servicePath: "/object-set-service/api",
|
|
347
|
-
fetchFn: client.fetch,
|
|
348
|
-
tokenProvider: async () => await client.tokenProvider()
|
|
349
|
-
};
|
|
350
|
-
this.#metadataContext = {
|
|
351
|
-
baseUrl: stackUrl.origin,
|
|
352
|
-
servicePath: "/ontology-metadata/api",
|
|
353
|
-
fetchFn: client.fetch,
|
|
354
|
-
tokenProvider: async () => await client.tokenProvider()
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
subscribe(objectSet, listener) {
|
|
358
|
-
const requestId = crypto.randomUUID();
|
|
359
|
-
const expiry = setTimeout(() => {
|
|
360
|
-
this.#expire(requestId);
|
|
361
|
-
}, ONE_DAY_MS);
|
|
362
|
-
this.#listeners.set(requestId, {
|
|
363
|
-
listener,
|
|
364
|
-
objectSet,
|
|
365
|
-
expiry
|
|
366
|
-
});
|
|
367
|
-
this.#subscribe(requestId, objectSet);
|
|
368
|
-
return () => {
|
|
369
|
-
this.#unsubscribe(requestId);
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
async #subscribe(requestId, objectSet) {
|
|
373
|
-
try {
|
|
374
|
-
const [temporaryObjectSet] = await Promise.all([
|
|
375
|
-
// create a time-bounded object set representation for watching
|
|
376
|
-
this.#createTemporaryObjectSet(objectSet),
|
|
377
|
-
this.#ensureWebsocket(),
|
|
378
|
-
// look up the object type's rid and ensure that we have enabled object set watcher for that rid
|
|
379
|
-
// TODO ???
|
|
380
|
-
getObjectSetBaseType(objectSet).then((baseType) => getObjectTypeV2(createOpenApiRequest(this.#client.stack, this.#client.fetch), this.#client.ontology.metadata.ontologyApiName, baseType)).then((objectType) => this.#enableObjectSetsWatcher([objectType.rid]))
|
|
381
|
-
]);
|
|
382
|
-
if (!this.#listeners.has(requestId)) {
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
const subscribe = {
|
|
386
|
-
id: requestId,
|
|
387
|
-
requests: [{
|
|
388
|
-
objectSet: temporaryObjectSet.objectSetRid,
|
|
389
|
-
objectSetContext: {
|
|
390
|
-
objectSetFilterContext: {
|
|
391
|
-
parameterOverrides: {}
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
watchAllLinks: false
|
|
395
|
-
}]
|
|
396
|
-
};
|
|
397
|
-
this.#ws?.send(JSON.stringify(subscribe));
|
|
398
|
-
} catch (error) {
|
|
399
|
-
this.#getCallbackByRequestId(requestId, "onError")?.(error);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
#expire(requestId) {
|
|
403
|
-
const state = this.#listeners.get(requestId);
|
|
404
|
-
if (state) {
|
|
405
|
-
const {
|
|
406
|
-
subscriptionId,
|
|
407
|
-
objectSet
|
|
408
|
-
} = state;
|
|
409
|
-
if (subscriptionId) {
|
|
410
|
-
state.subscriptionId = void 0;
|
|
411
|
-
this.#subscriptionToRequestId.delete(subscriptionId);
|
|
412
|
-
}
|
|
413
|
-
this.#subscribe(requestId, objectSet);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
#unsubscribe(requestId) {
|
|
417
|
-
const data = this.#listeners.get(requestId);
|
|
418
|
-
if (data == null) {
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
this.#listeners.delete(requestId);
|
|
422
|
-
clearTimeout(data.expiry);
|
|
423
|
-
const {
|
|
424
|
-
subscriptionId
|
|
425
|
-
} = data;
|
|
426
|
-
if (subscriptionId != null) {
|
|
427
|
-
this.#subscriptionToRequestId.delete(subscriptionId);
|
|
428
|
-
}
|
|
429
|
-
if (this.#listeners.size === 0) {
|
|
430
|
-
this.#destroyWebsocket();
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
async #ensureWebsocket() {
|
|
434
|
-
if (this.#ws == null) {
|
|
435
|
-
const {
|
|
436
|
-
stack,
|
|
437
|
-
tokenProvider
|
|
438
|
-
} = this.#client;
|
|
439
|
-
const base = new URL(stack);
|
|
440
|
-
const url = `wss://${base.host}/object-set-watcher/ws/subscriptions`;
|
|
441
|
-
const token = await tokenProvider();
|
|
442
|
-
if (this.#ws == null) {
|
|
443
|
-
const nextConnectTime = (this.#lastWsConnect ?? 0) + MINIMUM_RECONNECT_DELAY_MS;
|
|
444
|
-
if (nextConnectTime > Date.now()) {
|
|
445
|
-
await new Promise((resolve) => {
|
|
446
|
-
setTimeout(resolve, nextConnectTime - Date.now());
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
this.#lastWsConnect = Date.now();
|
|
450
|
-
if (this.#ws == null) {
|
|
451
|
-
this.#ws = new WebSocket(url, [`Bearer-${token}`]);
|
|
452
|
-
this.#ws.addEventListener("close", this.#onClose);
|
|
453
|
-
this.#ws.addEventListener("message", this.#onMessage);
|
|
454
|
-
this.#ws.addEventListener("open", this.#onOpen);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
if (this.#ws.readyState === WebSocket.CONNECTING) {
|
|
458
|
-
return new Promise((resolve, reject) => {
|
|
459
|
-
this.#ws.addEventListener("open", () => {
|
|
460
|
-
resolve();
|
|
461
|
-
});
|
|
462
|
-
this.#ws.addEventListener("error", (event) => {
|
|
463
|
-
reject(new Error(event.toString()));
|
|
464
|
-
});
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
#onOpen = () => {
|
|
470
|
-
for (const [requestId, state] of this.#listeners) {
|
|
471
|
-
this.#subscribe(requestId, state.objectSet);
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
#onMessage = async (message) => {
|
|
475
|
-
const data = JSON.parse(message.data.toString());
|
|
476
|
-
switch (data.type) {
|
|
477
|
-
case "objectSetChanged": {
|
|
478
|
-
if (data.objectSetChanged.confidenceValue) {
|
|
479
|
-
this.#getCallback(data.objectSetChanged.id, "onOutOfDate")?.();
|
|
480
|
-
break;
|
|
481
|
-
}
|
|
482
|
-
const {
|
|
483
|
-
id: subscriptionId,
|
|
484
|
-
objects
|
|
485
|
-
} = data.objectSetChanged;
|
|
486
|
-
const callback = this.#getCallback(subscriptionId, "onChange");
|
|
487
|
-
if (callback) {
|
|
488
|
-
callback(await convertFoundryToOsdkObjects(this.#client, this.#metadataContext, objects));
|
|
489
|
-
}
|
|
490
|
-
break;
|
|
491
|
-
}
|
|
492
|
-
case "refreshObjectSet": {
|
|
493
|
-
const {
|
|
494
|
-
id: subscriptionId
|
|
495
|
-
} = data.refreshObjectSet;
|
|
496
|
-
this.#getCallback(subscriptionId, "onOutOfDate")?.();
|
|
497
|
-
break;
|
|
498
|
-
}
|
|
499
|
-
case "subscribeResponses": {
|
|
500
|
-
const {
|
|
501
|
-
id: requestId,
|
|
502
|
-
responses
|
|
503
|
-
} = data.subscribeResponses;
|
|
504
|
-
const listenerData = this.#listeners.get(requestId);
|
|
505
|
-
if (listenerData == null) {
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
if (responses.length !== 1) {
|
|
509
|
-
throw new Error("Got more than one response but we only expect a single one");
|
|
510
|
-
}
|
|
511
|
-
const response = responses[0];
|
|
512
|
-
switch (response.type) {
|
|
513
|
-
case "error":
|
|
514
|
-
this.#getCallbackByRequestId(requestId, "onError")?.(response.error);
|
|
515
|
-
this.#unsubscribe(requestId);
|
|
516
|
-
return;
|
|
517
|
-
case "qos":
|
|
518
|
-
this.#destroyWebsocket();
|
|
519
|
-
this.#ensureWebsocket();
|
|
520
|
-
return;
|
|
521
|
-
case "success":
|
|
522
|
-
const {
|
|
523
|
-
id: subscriptionId
|
|
524
|
-
} = response.success;
|
|
525
|
-
listenerData.subscriptionId = subscriptionId;
|
|
526
|
-
this.#subscriptionToRequestId.set(subscriptionId, requestId);
|
|
527
|
-
this.#getCallbackByRequestId(requestId, "onOutOfDate")?.();
|
|
528
|
-
break;
|
|
529
|
-
default:
|
|
530
|
-
this.#getCallbackByRequestId(requestId, "onError")?.(response);
|
|
531
|
-
}
|
|
532
|
-
break;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
};
|
|
536
|
-
#onClose = () => {
|
|
537
|
-
this.#destroyWebsocket();
|
|
538
|
-
};
|
|
539
|
-
async #enableObjectSetsWatcher(objectTypeRids) {
|
|
540
|
-
return batchEnableWatcher(this.#conjureContext, {
|
|
541
|
-
requests: objectTypeRids
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
async #createTemporaryObjectSet(objectSet) {
|
|
545
|
-
const objectSetBaseType = await getObjectSetBaseType(objectSet);
|
|
546
|
-
const mapping = await getOntologyPropertyMappingForApiName(this.#client, this.#metadataContext, objectSetBaseType);
|
|
547
|
-
const temporaryObjectSet = await createTemporaryObjectSet(this.#ossContext, {
|
|
548
|
-
objectSet: toConjureObjectSet(objectSet, mapping),
|
|
549
|
-
timeToLive: "ONE_DAY",
|
|
550
|
-
objectSetFilterContext: {
|
|
551
|
-
parameterOverrides: {}
|
|
163
|
+
return n;
|
|
164
|
+
},
|
|
165
|
+
maybeSeed(definition) {
|
|
552
166
|
}
|
|
553
|
-
});
|
|
554
|
-
return {
|
|
555
|
-
objectSetRid: temporaryObjectSet.objectSetRid
|
|
556
167
|
};
|
|
557
|
-
}
|
|
558
|
-
#destroyWebsocket = () => {
|
|
559
|
-
if (this.#ws) {
|
|
560
|
-
this.#ws.removeEventListener("open", this.#onOpen);
|
|
561
|
-
this.#ws.removeEventListener("message", this.#onMessage);
|
|
562
|
-
this.#ws.removeEventListener("close", this.#onClose);
|
|
563
|
-
if (this.#ws.readyState !== WebSocket.CLOSING && this.#ws.readyState !== WebSocket.CLOSED) {
|
|
564
|
-
this.#ws.close();
|
|
565
|
-
}
|
|
566
|
-
this.#ws = void 0;
|
|
567
|
-
}
|
|
568
|
-
this.#subscriptionToRequestId.clear();
|
|
569
|
-
for (const state of this.#listeners.values()) {
|
|
570
|
-
state.subscriptionId = void 0;
|
|
571
|
-
}
|
|
572
|
-
if (this.#listeners.size > 0) {
|
|
573
|
-
this.#ensureWebsocket();
|
|
574
|
-
}
|
|
575
168
|
};
|
|
576
|
-
#getCallbackByRequestId(requestId, type) {
|
|
577
|
-
const maybeListener = this.#listeners.get(requestId);
|
|
578
|
-
return maybeListener?.listener?.[type];
|
|
579
|
-
}
|
|
580
|
-
#getCallback(subscriptionId, type) {
|
|
581
|
-
const requestId = this.#subscriptionToRequestId.get(subscriptionId);
|
|
582
|
-
if (requestId) {
|
|
583
|
-
return this.#getCallbackByRequestId(requestId, type);
|
|
584
|
-
}
|
|
585
|
-
return;
|
|
586
|
-
}
|
|
587
169
|
};
|
|
588
|
-
async function convertFoundryToOsdkObjects(client, ctx, objects) {
|
|
589
|
-
const osdkObjects = await Promise.all(objects.map(async (object) => {
|
|
590
|
-
const propertyMapping = await getOntologyPropertyMappingForRid(ctx, client.ontology.metadata.ontologyRid, object.type);
|
|
591
|
-
const convertedObject = Object.fromEntries([...Object.entries(object.properties).map(([key, value]) => {
|
|
592
|
-
return [propertyMapping?.propertyIdToApiNameMapping[key], value];
|
|
593
|
-
}), [propertyMapping?.propertyIdToApiNameMapping[Object.entries(object.key)[0][0]], Object.entries(object.key)[0][1]], ["__apiName", propertyMapping?.apiName], ["$apiName", propertyMapping?.apiName]]);
|
|
594
|
-
return convertedObject;
|
|
595
|
-
}));
|
|
596
|
-
convertWireToOsdkObjects(client, osdkObjects);
|
|
597
|
-
return osdkObjects;
|
|
598
|
-
}
|
|
599
|
-
var objectTypeMapping = /* @__PURE__ */ new WeakMap();
|
|
600
|
-
var objectApiNameToRid = /* @__PURE__ */ new Map();
|
|
601
|
-
async function getOntologyPropertyMappingForApiName(client, ctx, objectApiName) {
|
|
602
|
-
if (objectApiNameToRid.has(objectApiName)) {
|
|
603
|
-
return objectTypeMapping.get(ctx)?.get(objectApiNameToRid.get(objectApiName));
|
|
604
|
-
}
|
|
605
|
-
const wireObjectType = await getObjectTypeV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, objectApiName);
|
|
606
|
-
return getOntologyPropertyMappingForRid(ctx, client.ontology.metadata.ontologyRid, wireObjectType.rid);
|
|
607
|
-
}
|
|
608
|
-
var cachedAllOntologies;
|
|
609
|
-
async function getOntologyVersionForRid(ctx, ontologyRid) {
|
|
610
|
-
cachedAllOntologies ??= await loadAllOntologies(ctx, {});
|
|
611
|
-
!cachedAllOntologies.ontologies[ontologyRid] ? process.env.NODE_ENV !== "production" ? invariant(false, "ontology should be loaded") : invariant(false) : void 0;
|
|
612
|
-
return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;
|
|
613
|
-
}
|
|
614
|
-
async function getOntologyPropertyMappingForRid(ctx, ontologyRid, objectRid) {
|
|
615
|
-
if (!objectTypeMapping.has(ctx)) {
|
|
616
|
-
objectTypeMapping.set(ctx, /* @__PURE__ */ new Map());
|
|
617
|
-
}
|
|
618
|
-
if (!objectTypeMapping.get(ctx).has(objectRid)) {
|
|
619
|
-
const ontologyVersion = await getOntologyVersionForRid(ctx, ontologyRid);
|
|
620
|
-
const body = {
|
|
621
|
-
objectTypeVersions: {
|
|
622
|
-
// TODO: Undefined drops this in the body
|
|
623
|
-
[objectRid]: ontologyVersion
|
|
624
|
-
},
|
|
625
|
-
linkTypeVersions: {},
|
|
626
|
-
loadRedacted: false,
|
|
627
|
-
includeObjectTypesWithoutSearchableDatasources: true
|
|
628
|
-
};
|
|
629
|
-
const entities = await loadOntologyEntities(ctx, body);
|
|
630
|
-
!entities.objectTypes[objectRid] ? process.env.NODE_ENV !== "production" ? invariant(false, "object type should be loaded") : invariant(false) : void 0;
|
|
631
|
-
const propertyIdToApiNameMapping = Object.fromEntries(Object.values(entities.objectTypes[objectRid].propertyTypes).map((property) => {
|
|
632
|
-
return [property.id, property.apiName];
|
|
633
|
-
}));
|
|
634
|
-
const propertyApiNameToIdMapping = Object.fromEntries(Object.values(entities.objectTypes[objectRid].propertyTypes).map((property) => {
|
|
635
|
-
return [property.id, property.apiName];
|
|
636
|
-
}));
|
|
637
|
-
objectTypeMapping.get(ctx)?.set(objectRid, {
|
|
638
|
-
apiName: entities.objectTypes[objectRid].apiName,
|
|
639
|
-
id: entities.objectTypes[objectRid].id,
|
|
640
|
-
propertyIdToApiNameMapping,
|
|
641
|
-
propertyApiNameToIdMapping
|
|
642
|
-
});
|
|
643
|
-
objectApiNameToRid.set(entities.objectTypes[objectRid].apiName, objectRid);
|
|
644
|
-
}
|
|
645
|
-
return objectTypeMapping.get(ctx)?.get(objectRid);
|
|
646
|
-
}
|
|
647
170
|
|
|
648
|
-
// src/
|
|
649
|
-
var
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
// >(req: {
|
|
660
|
-
// select: AC;
|
|
661
|
-
// where?: WhereClause<ObjectTypeDefinitionFrom<O, K>>;
|
|
662
|
-
// groupBy?: GBC;
|
|
663
|
-
// }) => {
|
|
664
|
-
// throw "TODO";
|
|
665
|
-
// },
|
|
666
|
-
aggregateOrThrow: async (req) => {
|
|
667
|
-
return aggregateOrThrow(clientCtx, objectType, objectSet, req);
|
|
668
|
-
},
|
|
669
|
-
// fetchPage: async (args?: { nextPageToken?: string }) => {
|
|
670
|
-
// throw "TODO";
|
|
671
|
-
// },
|
|
672
|
-
fetchPageOrThrow: async (args) => {
|
|
673
|
-
return fetchPageOrThrow(clientCtx, objectType, args ?? {}, objectSet);
|
|
674
|
-
},
|
|
675
|
-
// asyncIter: () => {
|
|
676
|
-
// throw "";
|
|
677
|
-
// },
|
|
678
|
-
where: (clause) => {
|
|
679
|
-
return createObjectSet2(objectType, clientCtx, {
|
|
680
|
-
type: "filter",
|
|
681
|
-
objectSet,
|
|
682
|
-
where: modernToLegacyWhereClause(clause)
|
|
683
|
-
});
|
|
684
|
-
},
|
|
685
|
-
// [Symbol.asyncIterator]: () => {
|
|
686
|
-
// throw "";
|
|
687
|
-
// },
|
|
688
|
-
pivotTo: function(type) {
|
|
689
|
-
return createSearchAround(type)();
|
|
690
|
-
},
|
|
691
|
-
union: (...objectSets) => {
|
|
692
|
-
return createObjectSet2(objectType, clientCtx, {
|
|
693
|
-
type: "union",
|
|
694
|
-
objectSets: [objectSet, ...objectSets.map((os) => os.definition)]
|
|
695
|
-
});
|
|
696
|
-
},
|
|
697
|
-
intersect: (...objectSets) => {
|
|
698
|
-
return createObjectSet2(objectType, clientCtx, {
|
|
699
|
-
type: "intersect",
|
|
700
|
-
objectSets: [objectSet, ...objectSets.map((os) => os.definition)]
|
|
701
|
-
});
|
|
702
|
-
},
|
|
703
|
-
subtract: (...objectSets) => {
|
|
704
|
-
return createObjectSet2(objectType, clientCtx, {
|
|
705
|
-
type: "subtract",
|
|
706
|
-
objectSets: [objectSet, ...objectSets.map((os) => os.definition)]
|
|
707
|
-
});
|
|
708
|
-
},
|
|
709
|
-
subscribe(listener) {
|
|
710
|
-
const instance = ObjectSetListenerWebsocket.getInstance(clientCtx);
|
|
711
|
-
return instance.subscribe(objectSet, listener);
|
|
712
|
-
}
|
|
713
|
-
};
|
|
714
|
-
function createSearchAround(link) {
|
|
715
|
-
return () => {
|
|
716
|
-
return createObjectSet2(objectType, clientCtx, {
|
|
717
|
-
type: "searchAround",
|
|
718
|
-
objectSet,
|
|
719
|
-
link
|
|
720
|
-
});
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
return new Proxy(base, {
|
|
724
|
-
get(target, p, receiver) {
|
|
725
|
-
if (typeof p === "string" && p.startsWith(searchAroundPrefix)) {
|
|
726
|
-
return createSearchAround(p.substring(searchAroundPrefix.length));
|
|
727
|
-
}
|
|
728
|
-
return target[p];
|
|
729
|
-
}
|
|
730
|
-
});
|
|
171
|
+
// src/util/UserAgent.ts
|
|
172
|
+
var USER_AGENT = `osdk-client/${"0.11.0"}`;
|
|
173
|
+
|
|
174
|
+
// src/createMinimalClient.ts
|
|
175
|
+
function createMinimalClient(metadata, stack, tokenProvider, ontologyCachingOptions = {}, fetchFn = global.fetch) {
|
|
176
|
+
const clientCtx = createClientContext({
|
|
177
|
+
metadata,
|
|
178
|
+
provider: void 0
|
|
179
|
+
}, stack, tokenProvider, USER_AGENT, fetchFn);
|
|
180
|
+
clientCtx.ontology.provider = createStandardOntologyProviderFactory(ontologyCachingOptions)(clientCtx);
|
|
181
|
+
return clientCtx;
|
|
731
182
|
}
|
|
732
183
|
|
|
733
184
|
// src/ObjectSetCreator.ts
|
|
734
|
-
function createObjectSetCreator(client,
|
|
185
|
+
function createObjectSetCreator(client, ontology) {
|
|
735
186
|
return new Proxy({}, {
|
|
736
187
|
get: (target, p, receiver) => {
|
|
737
|
-
if (typeof p === "string")
|
|
738
|
-
return client.
|
|
188
|
+
if (typeof p === "string") {
|
|
189
|
+
return client(ontology.objects[p] ?? ontology.interfaces?.[p]);
|
|
190
|
+
}
|
|
739
191
|
return void 0;
|
|
740
192
|
},
|
|
741
193
|
ownKeys(target) {
|
|
742
|
-
return Object.keys(
|
|
194
|
+
return Object.keys(ontology.objects);
|
|
743
195
|
},
|
|
744
196
|
getOwnPropertyDescriptor(target, p) {
|
|
745
197
|
if (typeof p === "string") {
|
|
746
198
|
return {
|
|
747
|
-
enumerable:
|
|
199
|
+
enumerable: ontology.objects[p] != null,
|
|
748
200
|
configurable: true,
|
|
749
|
-
|
|
201
|
+
get: () => client(ontology.objects[p] ?? ontology.interfaces?.[p])
|
|
750
202
|
};
|
|
751
203
|
}
|
|
752
204
|
}
|
|
753
205
|
});
|
|
754
206
|
}
|
|
755
207
|
|
|
756
|
-
// src/util/UserAgent.ts
|
|
757
|
-
var USER_AGENT = `osdk-client/${"0.10.0"}`;
|
|
758
|
-
|
|
759
208
|
// src/createClient.ts
|
|
760
|
-
function
|
|
761
|
-
const clientCtx =
|
|
762
|
-
|
|
763
|
-
|
|
209
|
+
function createFutureClientPlus(metadata, stack, tokenProvider, ontologyCachingOptions = {}, fetchFn = fetch) {
|
|
210
|
+
const clientCtx = createMinimalClient(metadata, stack, tokenProvider, ontologyCachingOptions, fetchFn);
|
|
211
|
+
function clientFn(o) {
|
|
212
|
+
if (o.type === "object" || o.type === "interface") {
|
|
213
|
+
clientCtx.ontology.provider.maybeSeed(o);
|
|
214
|
+
return createBaseObjectSet(o, clientCtx);
|
|
215
|
+
} else if (o.type === "action") {
|
|
216
|
+
clientCtx.ontology.provider.maybeSeed(o);
|
|
217
|
+
return createActionInvoker(clientCtx, o);
|
|
218
|
+
} else {
|
|
219
|
+
throw new Error("Unknown definition: " + JSON.stringify(o));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return [clientCtx, clientFn];
|
|
223
|
+
}
|
|
224
|
+
function createClient(ontology, stack, tokenProvider, ontologyCachingOptions = {}, fetchFn = fetch) {
|
|
225
|
+
const [clientCtx, clientFn] = createFutureClientPlus(ontology.metadata, stack, tokenProvider, ontologyCachingOptions, fetchFn);
|
|
226
|
+
const objectSetFactory = (type) => createBaseObjectSet(ontology["objects"][type] ?? ontology["interfaces"]?.[type], clientCtx);
|
|
227
|
+
const oldActionInvoker = createOldActionInvoker(clientCtx, ontology);
|
|
228
|
+
const client = Object.defineProperties(clientFn, {
|
|
764
229
|
objectSet: {
|
|
765
230
|
get: () => objectSetFactory
|
|
766
231
|
},
|
|
767
232
|
objects: {
|
|
768
|
-
get: () => createObjectSetCreator(client,
|
|
233
|
+
get: () => createObjectSetCreator(client, ontology)
|
|
769
234
|
},
|
|
770
235
|
actions: {
|
|
771
|
-
get: () =>
|
|
236
|
+
get: () => oldActionInvoker
|
|
772
237
|
},
|
|
773
238
|
__UNSTABLE_preexistingObjectSet: {
|
|
774
239
|
get: () => (objectType, rid) => {
|
|
775
|
-
return
|
|
240
|
+
return createObjectSet(ontology["interfaces"]?.[objectType] ?? ontology["objects"][objectType], clientCtx, {
|
|
776
241
|
type: "intersect",
|
|
777
242
|
objectSets: [{
|
|
778
243
|
type: "base",
|
|
@@ -788,6 +253,6 @@ function createClient(ontology, stack, tokenProvider, fetchFn = fetch) {
|
|
|
788
253
|
return client;
|
|
789
254
|
}
|
|
790
255
|
|
|
791
|
-
export { ActionValidationError, createClient };
|
|
256
|
+
export { ActionValidationError, createClient, createMinimalClient };
|
|
792
257
|
//# sourceMappingURL=out.js.map
|
|
793
258
|
//# sourceMappingURL=index.mjs.map
|