@osdk/client 2.2.1 → 2.3.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 +94 -134
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js +6 -1
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -1
- package/build/browser/actions/ActionValidationError.js.map +1 -1
- package/build/browser/actions/applyAction.js +9 -8
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.js +8 -1
- package/build/browser/createClient.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/logger/BaseLogger.js +1 -1
- package/build/browser/logger/BaseLogger.js.map +1 -1
- package/build/browser/object/fetchPage.js +9 -7
- package/build/browser/object/fetchPage.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 +85 -106
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +1 -1
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/ObservableClient.js +17 -1
- package/build/browser/observable/ObservableClient.js.map +1 -1
- package/build/browser/observable/OptimisticBuilder.js.map +1 -1
- package/build/browser/observable/internal/ActionApplication.js +31 -30
- package/build/browser/observable/internal/ActionApplication.js.map +1 -1
- package/build/browser/observable/internal/Changes.js +5 -1
- package/build/browser/observable/internal/Changes.js.map +1 -1
- package/build/browser/observable/internal/ListQuery.js +24 -22
- package/build/browser/observable/internal/ListQuery.js.map +1 -1
- package/build/browser/observable/internal/ObjectQuery.js +30 -1
- package/build/browser/observable/internal/ObjectQuery.js.map +1 -1
- package/build/browser/observable/internal/ObservableClientImpl.js +1 -2
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/browser/observable/internal/OptimisticJob.js +8 -0
- package/build/browser/observable/internal/OptimisticJob.js.map +1 -1
- package/build/browser/observable/internal/Query.js +2 -2
- package/build/browser/observable/internal/Query.js.map +1 -1
- package/build/browser/observable/internal/Store.js +4 -0
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/Store.test.js +45 -5
- package/build/browser/observable/internal/Store.test.js.map +1 -1
- package/build/browser/observable/internal/testUtils.js.map +1 -1
- package/build/browser/observable/internal/tombstone.js +18 -0
- package/build/browser/observable/internal/tombstone.js.map +1 -0
- package/build/browser/public/internal.js +1 -0
- package/build/browser/public/internal.js.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js +39 -0
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -0
- package/build/browser/queries/applyQuery.js +8 -4
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/extractRdpDefinition.js +2 -0
- package/build/browser/util/extractRdpDefinition.js.map +1 -1
- package/build/browser/util/toDataValue.js +20 -10
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +50 -11
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/cjs/chunk-VZ57PNLC.cjs +1808 -0
- package/build/cjs/chunk-VZ57PNLC.cjs.map +1 -0
- package/build/cjs/{chunk-LPYAXRWJ.cjs → chunk-YGJRXE4F.cjs} +757 -36
- package/build/cjs/chunk-YGJRXE4F.cjs.map +1 -0
- package/build/cjs/index.cjs +16 -1764
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +4 -3
- package/build/cjs/public/internal.cjs +22 -8
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/internal.d.cts +10 -1
- package/build/cjs/public/unstable-do-not-use.cjs +182 -123
- 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/__unstable/createBulkLinksAsyncIterFactory.js +6 -1
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -1
- package/build/esm/actions/ActionValidationError.js.map +1 -1
- package/build/esm/actions/applyAction.js +9 -8
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.js +8 -1
- package/build/esm/createClient.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/logger/BaseLogger.js +1 -1
- package/build/esm/logger/BaseLogger.js.map +1 -1
- package/build/esm/object/fetchPage.js +9 -7
- package/build/esm/object/fetchPage.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 +85 -106
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +1 -1
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/ObservableClient.js +17 -1
- package/build/esm/observable/ObservableClient.js.map +1 -1
- package/build/esm/observable/OptimisticBuilder.js.map +1 -1
- package/build/esm/observable/internal/ActionApplication.js +31 -30
- package/build/esm/observable/internal/ActionApplication.js.map +1 -1
- package/build/esm/observable/internal/Changes.js +5 -1
- package/build/esm/observable/internal/Changes.js.map +1 -1
- package/build/esm/observable/internal/ListQuery.js +24 -22
- package/build/esm/observable/internal/ListQuery.js.map +1 -1
- package/build/esm/observable/internal/ObjectQuery.js +30 -1
- package/build/esm/observable/internal/ObjectQuery.js.map +1 -1
- package/build/esm/observable/internal/ObservableClientImpl.js +1 -2
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/esm/observable/internal/OptimisticJob.js +8 -0
- package/build/esm/observable/internal/OptimisticJob.js.map +1 -1
- package/build/esm/observable/internal/Query.js +2 -2
- package/build/esm/observable/internal/Query.js.map +1 -1
- package/build/esm/observable/internal/Store.js +4 -0
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/Store.test.js +45 -5
- package/build/esm/observable/internal/Store.test.js.map +1 -1
- package/build/esm/observable/internal/testUtils.js.map +1 -1
- package/build/esm/observable/internal/tombstone.js +18 -0
- package/build/esm/observable/internal/tombstone.js.map +1 -0
- package/build/esm/public/internal.js +1 -0
- package/build/esm/public/internal.js.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js +39 -0
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -0
- package/build/esm/queries/applyQuery.js +8 -4
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/extractRdpDefinition.js +2 -0
- package/build/esm/util/extractRdpDefinition.js.map +1 -1
- package/build/esm/util/toDataValue.js +20 -10
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +50 -11
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/build/types/actions/ActionValidationError.d.ts +1 -1
- package/build/types/actions/ActionValidationError.d.ts.map +1 -1
- package/build/types/actions/applyAction.d.ts.map +1 -1
- package/build/types/createClient.d.ts.map +1 -1
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts +1 -0
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts.map +1 -0
- 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 -2
- package/build/types/observable/ObservableClient.d.ts.map +1 -1
- package/build/types/observable/OptimisticBuilder.d.ts +1 -0
- package/build/types/observable/OptimisticBuilder.d.ts.map +1 -1
- package/build/types/observable/internal/ActionApplication.d.ts +1 -1
- package/build/types/observable/internal/ActionApplication.d.ts.map +1 -1
- package/build/types/observable/internal/Changes.d.ts +2 -0
- package/build/types/observable/internal/Changes.d.ts.map +1 -1
- package/build/types/observable/internal/ListQuery.d.ts.map +1 -1
- package/build/types/observable/internal/ObjectQuery.d.ts +1 -0
- package/build/types/observable/internal/ObjectQuery.d.ts.map +1 -1
- package/build/types/observable/internal/OptimisticJob.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/observable/internal/testUtils.d.ts +1 -1
- package/build/types/observable/internal/testUtils.d.ts.map +1 -1
- package/build/types/observable/internal/tombstone.d.ts +1 -0
- package/build/types/observable/internal/tombstone.d.ts.map +1 -0
- package/build/types/public/internal.d.ts +1 -0
- package/build/types/public/internal.d.ts.map +1 -1
- package/build/types/public-utils/hydrateObjectSetFromObjectRids.d.ts +10 -0
- package/build/types/public-utils/hydrateObjectSetFromObjectRids.d.ts.map +1 -0
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/build/types/util/UserAgent.d.ts +1 -0
- package/build/types/util/UserAgent.d.ts.map +1 -1
- package/package.json +14 -14
- package/build/cjs/chunk-LPYAXRWJ.cjs.map +0 -1
- package/build/cjs/chunk-T4NIFYZS.cjs +0 -14
- package/build/cjs/chunk-T4NIFYZS.cjs.map +0 -1
- package/build/cjs/chunk-UCW7RLKM.cjs +0 -615
- package/build/cjs/chunk-UCW7RLKM.cjs.map +0 -1
|
@@ -1,28 +1,621 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var chunkUCW7RLKM_cjs = require('./chunk-UCW7RLKM.cjs');
|
|
4
3
|
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
5
|
-
var
|
|
4
|
+
var shared_net_fetch = require('@osdk/shared.net.fetch');
|
|
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
|
+
var __defProp = Object.defineProperty;
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
21
|
+
var Action_exports = {};
|
|
22
|
+
__export(Action_exports, {
|
|
23
|
+
apply: () => apply,
|
|
24
|
+
applyAsync: () => applyAsync,
|
|
25
|
+
applyBatch: () => applyBatch
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// ../../node_modules/.pnpm/@osdk+shared.client@1.0.1/node_modules/@osdk/shared.client/index.js
|
|
29
|
+
var symbolClientContext = Symbol("ClientContext");
|
|
30
|
+
|
|
31
|
+
// ../../node_modules/.pnpm/@osdk+shared.client2@1.0.0/node_modules/@osdk/shared.client2/index.js
|
|
32
|
+
var symbolClientContext2 = "__osdkClientContext";
|
|
33
|
+
async function foundryPlatformFetch(client, [httpMethodNum, origPath, flags, contentType, responseContentType], ...args) {
|
|
34
|
+
const path = origPath.replace(/\{([^}]+)\}/g, () => encodeURIComponent(args.shift()));
|
|
35
|
+
const body = flags & 1 ? args.shift() : void 0;
|
|
36
|
+
const queryArgs = flags & 2 ? args.shift() : void 0;
|
|
37
|
+
const headerArgs = flags & 4 ? args.shift() : void 0;
|
|
38
|
+
const method = ["GET", "POST", "PUT", "DELETE", "PATCH"][httpMethodNum];
|
|
39
|
+
return await apiFetch(client[symbolClientContext2] ?? client[symbolClientContext] ?? client, method, path, body, queryArgs, headerArgs, contentType, responseContentType);
|
|
40
|
+
}
|
|
41
|
+
async function apiFetch(clientCtx, method, endpointPath, data, queryArguments, headers, requestMediaType, responseMediaType) {
|
|
42
|
+
const url = parseUrl(clientCtx.baseUrl, endpointPath);
|
|
43
|
+
for (const [key, value] of Object.entries(queryArguments || {})) {
|
|
44
|
+
if (value == null) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (Array.isArray(value)) {
|
|
48
|
+
for (const item of value) {
|
|
49
|
+
url.searchParams.append(key, item);
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
url.searchParams.append(key, value);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const headersInit = new Headers();
|
|
56
|
+
headersInit.set("Content-Type", requestMediaType ?? "application/json");
|
|
57
|
+
headersInit.set("Accept", responseMediaType ?? "application/json");
|
|
58
|
+
Object.entries(headers || {}).forEach(([key, value]) => {
|
|
59
|
+
if (value != null) {
|
|
60
|
+
headersInit.append(key, value.toString());
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const body = data == null || data instanceof globalThis.Blob ? data : JSON.stringify(data);
|
|
64
|
+
const response = await clientCtx.fetch(url.toString(), {
|
|
65
|
+
body,
|
|
66
|
+
method,
|
|
67
|
+
headers: headersInit
|
|
68
|
+
});
|
|
69
|
+
if (!response.ok) {
|
|
70
|
+
try {
|
|
71
|
+
const convertedError = await response.json();
|
|
72
|
+
return new shared_net_errors.PalantirApiError(convertedError.message, convertedError.errorName, convertedError.errorCode, response.status, convertedError.errorInstanceId, convertedError.parameters);
|
|
73
|
+
} catch (e) {
|
|
74
|
+
if (e instanceof Error) {
|
|
75
|
+
return new shared_net_errors.UnknownError(e.message, "UNKNOWN");
|
|
76
|
+
}
|
|
77
|
+
return new shared_net_errors.UnknownError("Unable to parse error response", "UNKNOWN");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (response.status === 204) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (responseMediaType == null || responseMediaType === "application/json") {
|
|
84
|
+
return await response.json();
|
|
85
|
+
}
|
|
86
|
+
return response;
|
|
87
|
+
}
|
|
88
|
+
function parseUrl(baseUrl, endpointPath) {
|
|
89
|
+
baseUrl += baseUrl.endsWith("/") ? "" : "/";
|
|
90
|
+
return new URL(`api${endpointPath}`, baseUrl);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
94
|
+
var _apply = [1, "/v2/ontologies/{0}/actions/{1}/apply", 3];
|
|
95
|
+
function apply($ctx, ...args) {
|
|
96
|
+
return foundryPlatformFetch($ctx, _apply, ...args);
|
|
97
|
+
}
|
|
98
|
+
var _applyAsync = [1, "/v2/ontologies/{0}/actions/{1}/applyAsync", 3];
|
|
99
|
+
function applyAsync($ctx, ...args) {
|
|
100
|
+
return foundryPlatformFetch($ctx, _applyAsync, ...args);
|
|
101
|
+
}
|
|
102
|
+
var _applyBatch = [1, "/v2/ontologies/{0}/actions/{1}/applyBatch", 3];
|
|
103
|
+
function applyBatch($ctx, ...args) {
|
|
104
|
+
return foundryPlatformFetch($ctx, _applyBatch, ...args);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js
|
|
108
|
+
var ActionTypeV2_exports = {};
|
|
109
|
+
__export(ActionTypeV2_exports, {
|
|
110
|
+
get: () => get,
|
|
111
|
+
getByRid: () => getByRid,
|
|
112
|
+
list: () => list
|
|
113
|
+
});
|
|
114
|
+
var _list = [0, "/v2/ontologies/{0}/actionTypes", 2];
|
|
115
|
+
function list($ctx, ...args) {
|
|
116
|
+
return foundryPlatformFetch($ctx, _list, ...args);
|
|
117
|
+
}
|
|
118
|
+
var _get = [0, "/v2/ontologies/{0}/actionTypes/{1}", 2];
|
|
119
|
+
function get($ctx, ...args) {
|
|
120
|
+
return foundryPlatformFetch($ctx, _get, ...args);
|
|
121
|
+
}
|
|
122
|
+
var _getByRid = [0, "/v2/ontologies/{0}/actionTypes/byRid/{1}", 2];
|
|
123
|
+
function getByRid($ctx, ...args) {
|
|
124
|
+
return foundryPlatformFetch($ctx, _getByRid, ...args);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js
|
|
128
|
+
var Attachment_exports = {};
|
|
129
|
+
__export(Attachment_exports, {
|
|
130
|
+
get: () => get2,
|
|
131
|
+
read: () => read,
|
|
132
|
+
upload: () => upload
|
|
133
|
+
});
|
|
134
|
+
var _upload = [1, "/v2/ontologies/attachments/upload", 7, "*/*"];
|
|
135
|
+
function upload($ctx, ...args) {
|
|
136
|
+
const headerParams = {
|
|
137
|
+
...args[2],
|
|
138
|
+
"Content-Type": args[2]?.["Content-Type"] ?? args[0].type,
|
|
139
|
+
"Content-Length": args[0].size.toString()
|
|
140
|
+
};
|
|
141
|
+
return foundryPlatformFetch($ctx, _upload, args[0], args[1], headerParams);
|
|
142
|
+
}
|
|
143
|
+
var _read = [0, "/v2/ontologies/attachments/{0}/content", , , "*/*"];
|
|
144
|
+
function read($ctx, ...args) {
|
|
145
|
+
return foundryPlatformFetch($ctx, _read, ...args);
|
|
146
|
+
}
|
|
147
|
+
var _get2 = [0, "/v2/ontologies/attachments/{0}"];
|
|
148
|
+
function get2($ctx, ...args) {
|
|
149
|
+
return foundryPlatformFetch($ctx, _get2, ...args);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js
|
|
153
|
+
var MediaReferenceProperty_exports = {};
|
|
154
|
+
__export(MediaReferenceProperty_exports, {
|
|
155
|
+
getMediaContent: () => getMediaContent,
|
|
156
|
+
getMediaMetadata: () => getMediaMetadata,
|
|
157
|
+
upload: () => upload2,
|
|
158
|
+
uploadMedia: () => uploadMedia
|
|
159
|
+
});
|
|
160
|
+
var _getMediaContent = [0, "/v2/ontologies/{0}/objects/{1}/{2}/media/{3}/content", 2, , "*/*"];
|
|
161
|
+
function getMediaContent($ctx, ...args) {
|
|
162
|
+
return foundryPlatformFetch($ctx, _getMediaContent, ...args);
|
|
163
|
+
}
|
|
164
|
+
var _getMediaMetadata = [0, "/v2/ontologies/{0}/objects/{1}/{2}/media/{3}/metadata", 2];
|
|
165
|
+
function getMediaMetadata($ctx, ...args) {
|
|
166
|
+
return foundryPlatformFetch($ctx, _getMediaMetadata, ...args);
|
|
167
|
+
}
|
|
168
|
+
var _upload2 = [1, "/v2/ontologies/{0}/objectTypes/{1}/media/{2}/upload", 3, "*/*"];
|
|
169
|
+
function upload2($ctx, ...args) {
|
|
170
|
+
return foundryPlatformFetch($ctx, _upload2, ...args);
|
|
171
|
+
}
|
|
172
|
+
var _uploadMedia = [1, "/v2/ontologies/{0}/actions/{1}/media/upload", 3, "*/*"];
|
|
173
|
+
function uploadMedia($ctx, ...args) {
|
|
174
|
+
return foundryPlatformFetch($ctx, _uploadMedia, ...args);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js
|
|
178
|
+
var ObjectTypeV2_exports = {};
|
|
179
|
+
__export(ObjectTypeV2_exports, {
|
|
180
|
+
get: () => get3,
|
|
181
|
+
getFullMetadata: () => getFullMetadata,
|
|
182
|
+
getOutgoingLinkType: () => getOutgoingLinkType,
|
|
183
|
+
list: () => list2,
|
|
184
|
+
listOutgoingLinkTypes: () => listOutgoingLinkTypes
|
|
185
|
+
});
|
|
186
|
+
var _list2 = [0, "/v2/ontologies/{0}/objectTypes", 2];
|
|
187
|
+
function list2($ctx, ...args) {
|
|
188
|
+
return foundryPlatformFetch($ctx, _list2, ...args);
|
|
189
|
+
}
|
|
190
|
+
var _get3 = [0, "/v2/ontologies/{0}/objectTypes/{1}", 2];
|
|
191
|
+
function get3($ctx, ...args) {
|
|
192
|
+
return foundryPlatformFetch($ctx, _get3, ...args);
|
|
193
|
+
}
|
|
194
|
+
var _getFullMetadata = [0, "/v2/ontologies/{0}/objectTypes/{1}/fullMetadata", 2];
|
|
195
|
+
function getFullMetadata($ctx, ...args) {
|
|
196
|
+
return foundryPlatformFetch($ctx, _getFullMetadata, ...args);
|
|
197
|
+
}
|
|
198
|
+
var _listOutgoingLinkTypes = [0, "/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkTypes", 2];
|
|
199
|
+
function listOutgoingLinkTypes($ctx, ...args) {
|
|
200
|
+
return foundryPlatformFetch($ctx, _listOutgoingLinkTypes, ...args);
|
|
201
|
+
}
|
|
202
|
+
var _getOutgoingLinkType = [0, "/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkTypes/{2}", 2];
|
|
203
|
+
function getOutgoingLinkType($ctx, ...args) {
|
|
204
|
+
return foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyInterface.js
|
|
208
|
+
var OntologyInterface_exports = {};
|
|
209
|
+
__export(OntologyInterface_exports, {
|
|
210
|
+
aggregate: () => aggregate,
|
|
211
|
+
get: () => get4,
|
|
212
|
+
list: () => list3,
|
|
213
|
+
search: () => search
|
|
214
|
+
});
|
|
215
|
+
var _list3 = [0, "/v2/ontologies/{0}/interfaceTypes", 2];
|
|
216
|
+
function list3($ctx, ...args) {
|
|
217
|
+
return foundryPlatformFetch($ctx, _list3, ...args);
|
|
218
|
+
}
|
|
219
|
+
var _get4 = [0, "/v2/ontologies/{0}/interfaceTypes/{1}", 2];
|
|
220
|
+
function get4($ctx, ...args) {
|
|
221
|
+
return foundryPlatformFetch($ctx, _get4, ...args);
|
|
222
|
+
}
|
|
223
|
+
var _search = [1, "/v2/ontologies/{0}/interfaces/{1}/search", 3];
|
|
224
|
+
function search($ctx, ...args) {
|
|
225
|
+
return foundryPlatformFetch($ctx, _search, ...args);
|
|
226
|
+
}
|
|
227
|
+
var _aggregate = [1, "/v2/ontologies/{0}/interfaces/{1}/aggregate", 3];
|
|
228
|
+
function aggregate($ctx, ...args) {
|
|
229
|
+
return foundryPlatformFetch($ctx, _aggregate, ...args);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js
|
|
233
|
+
var OntologyObjectSet_exports = {};
|
|
234
|
+
__export(OntologyObjectSet_exports, {
|
|
235
|
+
aggregate: () => aggregate2,
|
|
236
|
+
createTemporary: () => createTemporary,
|
|
237
|
+
get: () => get5,
|
|
238
|
+
load: () => load,
|
|
239
|
+
loadMultipleObjectTypes: () => loadMultipleObjectTypes,
|
|
240
|
+
loadObjectsOrInterfaces: () => loadObjectsOrInterfaces
|
|
241
|
+
});
|
|
242
|
+
var _createTemporary = [1, "/v2/ontologies/{0}/objectSets/createTemporary", 1];
|
|
243
|
+
function createTemporary($ctx, ...args) {
|
|
244
|
+
return foundryPlatformFetch($ctx, _createTemporary, ...args);
|
|
245
|
+
}
|
|
246
|
+
var _get5 = [0, "/v2/ontologies/{0}/objectSets/{1}"];
|
|
247
|
+
function get5($ctx, ...args) {
|
|
248
|
+
return foundryPlatformFetch($ctx, _get5, ...args);
|
|
249
|
+
}
|
|
250
|
+
var _load = [1, "/v2/ontologies/{0}/objectSets/loadObjects", 3];
|
|
251
|
+
function load($ctx, ...args) {
|
|
252
|
+
return foundryPlatformFetch($ctx, _load, ...args);
|
|
253
|
+
}
|
|
254
|
+
var _loadMultipleObjectTypes = [1, "/v2/ontologies/{0}/objectSets/loadObjectsMultipleObjectTypes", 3];
|
|
255
|
+
function loadMultipleObjectTypes($ctx, ...args) {
|
|
256
|
+
return foundryPlatformFetch($ctx, _loadMultipleObjectTypes, ...args);
|
|
257
|
+
}
|
|
258
|
+
var _loadObjectsOrInterfaces = [1, "/v2/ontologies/{0}/objectSets/loadObjectsOrInterfaces", 3];
|
|
259
|
+
function loadObjectsOrInterfaces($ctx, ...args) {
|
|
260
|
+
return foundryPlatformFetch($ctx, _loadObjectsOrInterfaces, ...args);
|
|
261
|
+
}
|
|
262
|
+
var _aggregate2 = [1, "/v2/ontologies/{0}/objectSets/aggregate", 3];
|
|
263
|
+
function aggregate2($ctx, ...args) {
|
|
264
|
+
return foundryPlatformFetch($ctx, _aggregate2, ...args);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
|
|
268
|
+
var Query_exports = {};
|
|
269
|
+
__export(Query_exports, {
|
|
270
|
+
execute: () => execute
|
|
271
|
+
});
|
|
272
|
+
var _execute = [1, "/v2/ontologies/{0}/queries/{1}/execute", 3];
|
|
273
|
+
function execute($ctx, ...args) {
|
|
274
|
+
return foundryPlatformFetch($ctx, _execute, ...args);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js
|
|
278
|
+
var QueryType_exports = {};
|
|
279
|
+
__export(QueryType_exports, {
|
|
280
|
+
get: () => get6,
|
|
281
|
+
list: () => list4
|
|
282
|
+
});
|
|
283
|
+
var _list4 = [0, "/v2/ontologies/{0}/queryTypes", 2];
|
|
284
|
+
function list4($ctx, ...args) {
|
|
285
|
+
return foundryPlatformFetch($ctx, _list4, ...args);
|
|
286
|
+
}
|
|
287
|
+
var _get6 = [0, "/v2/ontologies/{0}/queryTypes/{1}", 2];
|
|
288
|
+
function get6($ctx, ...args) {
|
|
289
|
+
return foundryPlatformFetch($ctx, _get6, ...args);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js
|
|
293
|
+
var TimeSeriesPropertyV2_exports = {};
|
|
294
|
+
__export(TimeSeriesPropertyV2_exports, {
|
|
295
|
+
getFirstPoint: () => getFirstPoint,
|
|
296
|
+
getLastPoint: () => getLastPoint,
|
|
297
|
+
streamPoints: () => streamPoints
|
|
298
|
+
});
|
|
299
|
+
var _getFirstPoint = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/firstPoint", 2];
|
|
300
|
+
function getFirstPoint($ctx, ...args) {
|
|
301
|
+
return foundryPlatformFetch($ctx, _getFirstPoint, ...args);
|
|
302
|
+
}
|
|
303
|
+
var _getLastPoint = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/lastPoint", 2];
|
|
304
|
+
function getLastPoint($ctx, ...args) {
|
|
305
|
+
return foundryPlatformFetch($ctx, _getLastPoint, ...args);
|
|
306
|
+
}
|
|
307
|
+
var _streamPoints = [1, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamPoints", 3, , "*/*"];
|
|
308
|
+
function streamPoints($ctx, ...args) {
|
|
309
|
+
return foundryPlatformFetch($ctx, _streamPoints, ...args);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.24.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js
|
|
313
|
+
var TimeSeriesValueBankProperty_exports = {};
|
|
314
|
+
__export(TimeSeriesValueBankProperty_exports, {
|
|
315
|
+
getLatestValue: () => getLatestValue,
|
|
316
|
+
streamValues: () => streamValues
|
|
317
|
+
});
|
|
318
|
+
var _getLatestValue = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/latestValue", 2];
|
|
319
|
+
function getLatestValue($ctx, ...args) {
|
|
320
|
+
return foundryPlatformFetch($ctx, _getLatestValue, ...args);
|
|
321
|
+
}
|
|
322
|
+
var _streamValues = [1, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamValues", 3, , "*/*"];
|
|
323
|
+
function streamValues($ctx, ...args) {
|
|
324
|
+
return foundryPlatformFetch($ctx, _streamValues, ...args);
|
|
325
|
+
}
|
|
326
|
+
var addUserAgentAndRequestContextHeaders = (client, withMetadata) => ({
|
|
327
|
+
...client,
|
|
328
|
+
fetch: shared_net_fetch.createFetchHeaderMutator(client.fetch, (headers) => {
|
|
329
|
+
headers.set("X-OSDK-Request-Context", JSON.stringify(client.requestContext));
|
|
330
|
+
if (withMetadata.osdkMetadata) {
|
|
331
|
+
headers.set("Fetch-User-Agent", withMetadata.osdkMetadata.extraUserAgent);
|
|
332
|
+
}
|
|
333
|
+
return headers;
|
|
334
|
+
})
|
|
335
|
+
});
|
|
336
|
+
async function extractRdpDefinition(clientCtx, objectSet) {
|
|
337
|
+
return (await extractRdpDefinitionInternal(clientCtx, objectSet, void 0)).definitions;
|
|
338
|
+
}
|
|
339
|
+
async function extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObjectType) {
|
|
340
|
+
switch (objectSet.type) {
|
|
341
|
+
case "searchAround": {
|
|
342
|
+
const {
|
|
343
|
+
definitions: definitions2,
|
|
344
|
+
childObjectType
|
|
345
|
+
} = await extractRdpDefinitionInternal(clientCtx, objectSet.objectSet, methodInputObjectType);
|
|
346
|
+
if (childObjectType === void 0 || childObjectType === "") {
|
|
347
|
+
return {
|
|
348
|
+
definitions: {}
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
const objDef = await clientCtx.ontologyProvider.getObjectDefinition(childObjectType);
|
|
352
|
+
const linkDef = objDef.links[objectSet.link];
|
|
353
|
+
!linkDef ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Missing link definition for '${objectSet.link}'`) : invariant4__default.default(false) : void 0;
|
|
354
|
+
return {
|
|
355
|
+
definitions: definitions2,
|
|
356
|
+
childObjectType: objDef.links[objectSet.link].targetType
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
case "withProperties": {
|
|
360
|
+
const {
|
|
361
|
+
definitions: definitions2,
|
|
362
|
+
childObjectType
|
|
363
|
+
} = await extractRdpDefinitionInternal(clientCtx, objectSet.objectSet, methodInputObjectType);
|
|
364
|
+
if (childObjectType === void 0 || childObjectType === "") {
|
|
365
|
+
return {
|
|
366
|
+
definitions: {}
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
for (const [name, definition] of Object.entries(objectSet.derivedProperties)) {
|
|
370
|
+
if (definition.type !== "selection") {
|
|
371
|
+
definitions2[name] = {
|
|
372
|
+
selectedOrCollectedPropertyType: void 0,
|
|
373
|
+
definition
|
|
374
|
+
};
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
switch (definition.operation.type) {
|
|
378
|
+
case "collectList":
|
|
379
|
+
case "collectSet":
|
|
380
|
+
case "get":
|
|
381
|
+
const {
|
|
382
|
+
childObjectType: operationLevelObjectType
|
|
383
|
+
} = await extractRdpDefinitionInternal(clientCtx, definition.objectSet, childObjectType);
|
|
384
|
+
if (operationLevelObjectType === void 0 || operationLevelObjectType === "") {
|
|
385
|
+
return {
|
|
386
|
+
definitions: {}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
const objDef = await clientCtx.ontologyProvider.getObjectDefinition(operationLevelObjectType);
|
|
390
|
+
definitions2[name] = {
|
|
391
|
+
selectedOrCollectedPropertyType: objDef.properties[definition.operation.selectedPropertyApiName],
|
|
392
|
+
definition
|
|
393
|
+
};
|
|
394
|
+
break;
|
|
395
|
+
default:
|
|
396
|
+
definitions2[name] = {
|
|
397
|
+
selectedOrCollectedPropertyType: void 0,
|
|
398
|
+
definition
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
definitions: definitions2,
|
|
404
|
+
childObjectType
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
case "methodInput":
|
|
408
|
+
return {
|
|
409
|
+
definitions: {},
|
|
410
|
+
childObjectType: methodInputObjectType
|
|
411
|
+
};
|
|
412
|
+
case "base":
|
|
413
|
+
return {
|
|
414
|
+
definitions: {},
|
|
415
|
+
childObjectType: objectSet.objectType
|
|
416
|
+
};
|
|
417
|
+
case "interfaceBase":
|
|
418
|
+
return {
|
|
419
|
+
definitions: {},
|
|
420
|
+
childObjectType: objectSet.interfaceType
|
|
421
|
+
};
|
|
422
|
+
case "filter":
|
|
423
|
+
case "asBaseObjectTypes":
|
|
424
|
+
case "asType":
|
|
425
|
+
case "nearestNeighbors":
|
|
426
|
+
return extractRdpDefinitionInternal(clientCtx, objectSet.objectSet, methodInputObjectType);
|
|
427
|
+
// These will throw in OSS so we should throw here so no request is made
|
|
428
|
+
case "intersect":
|
|
429
|
+
case "subtract":
|
|
430
|
+
case "union":
|
|
431
|
+
const objectSets = objectSet.objectSets;
|
|
432
|
+
const objectSetTypes = await Promise.all(objectSets.map((os) => extractRdpDefinitionInternal(clientCtx, os, methodInputObjectType)));
|
|
433
|
+
const definitions = objectSetTypes.reduce((acc, {
|
|
434
|
+
definitions: definitions2
|
|
435
|
+
}) => ({
|
|
436
|
+
...acc,
|
|
437
|
+
...definitions2
|
|
438
|
+
}), {});
|
|
439
|
+
!(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
|
+
const firstValidChildObjectType = objectSetTypes.find(({
|
|
441
|
+
childObjectType
|
|
442
|
+
}) => childObjectType != null)?.childObjectType;
|
|
443
|
+
!objectSetTypes.every(({
|
|
444
|
+
childObjectType
|
|
445
|
+
}) => 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
|
+
return {
|
|
447
|
+
definitions: {},
|
|
448
|
+
childObjectType: firstValidChildObjectType
|
|
449
|
+
};
|
|
450
|
+
case "static":
|
|
451
|
+
case "reference":
|
|
452
|
+
return {
|
|
453
|
+
definitions: {}
|
|
454
|
+
};
|
|
455
|
+
// 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
|
+
case "interfaceLinkSearchAround":
|
|
457
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Unsupported object set type for Runtime Derived Properties`) : invariant4__default.default(false) ;
|
|
458
|
+
default:
|
|
459
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Unsupported object set type for Runtime Derived Properties`) : invariant4__default.default(false) ;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// src/util/objectSetUtils.ts
|
|
464
|
+
function resolveBaseObjectSetType(objectType) {
|
|
465
|
+
return objectType.type === "interface" ? {
|
|
466
|
+
type: "interfaceBase",
|
|
467
|
+
interfaceType: objectType["apiName"]
|
|
468
|
+
} : {
|
|
469
|
+
type: "base",
|
|
470
|
+
objectType: objectType["apiName"]
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// src/object/fetchPage.ts
|
|
475
|
+
function augment(type, ...properties) {
|
|
476
|
+
return {
|
|
477
|
+
[type.apiName]: properties
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
function objectSetToSearchJsonV2(objectSet, expectedApiName, existingWhere = void 0) {
|
|
481
|
+
if (objectSet.type === "base" || objectSet.type === "interfaceBase") {
|
|
482
|
+
if (objectSet.type === "base" && objectSet.objectType !== expectedApiName) {
|
|
483
|
+
throw new Error(`Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.objectType}`);
|
|
484
|
+
}
|
|
485
|
+
if (objectSet.type === "interfaceBase" && objectSet.interfaceType !== expectedApiName) {
|
|
486
|
+
throw new Error(`Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.interfaceType}`);
|
|
487
|
+
}
|
|
488
|
+
return existingWhere;
|
|
489
|
+
}
|
|
490
|
+
if (objectSet.type === "filter") {
|
|
491
|
+
return objectSetToSearchJsonV2(objectSet.objectSet, expectedApiName, existingWhere == null ? objectSet.where : {
|
|
492
|
+
type: "and",
|
|
493
|
+
value: [existingWhere, objectSet.where]
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
throw new Error(`Unsupported objectSet type: ${objectSet.type}`);
|
|
497
|
+
}
|
|
498
|
+
function resolveInterfaceObjectSet(objectSet, interfaceTypeApiName, args) {
|
|
499
|
+
return args?.$includeAllBaseObjectProperties ? {
|
|
500
|
+
type: "intersect",
|
|
501
|
+
objectSets: [objectSet, {
|
|
502
|
+
type: "interfaceBase",
|
|
503
|
+
interfaceType: interfaceTypeApiName,
|
|
504
|
+
includeAllBaseObjectProperties: true
|
|
505
|
+
}]
|
|
506
|
+
} : objectSet;
|
|
507
|
+
}
|
|
508
|
+
async function fetchInterfacePage(client, interfaceType, args, objectSet, useSnapshot = false) {
|
|
509
|
+
if (args.$__UNSTABLE_useOldInterfaceApis) {
|
|
510
|
+
const result2 = await OntologyInterface_exports.search(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {
|
|
511
|
+
augmentedProperties: {},
|
|
512
|
+
augmentedSharedPropertyTypes: {},
|
|
513
|
+
otherInterfaceTypes: [],
|
|
514
|
+
selectedObjectTypes: [],
|
|
515
|
+
selectedSharedPropertyTypes: args.$select ?? [],
|
|
516
|
+
where: objectSetToSearchJsonV2(objectSet, interfaceType.apiName)
|
|
517
|
+
}), {
|
|
518
|
+
preview: true
|
|
519
|
+
});
|
|
520
|
+
result2.data = await client.objectFactory(
|
|
521
|
+
client,
|
|
522
|
+
result2.data,
|
|
523
|
+
// drop readonly
|
|
524
|
+
interfaceType.apiName,
|
|
525
|
+
!args.$includeRid,
|
|
526
|
+
await extractRdpDefinition(client, objectSet)
|
|
527
|
+
);
|
|
528
|
+
return result2;
|
|
529
|
+
}
|
|
530
|
+
const result = await OntologyObjectSet_exports.loadMultipleObjectTypes(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, applyFetchArgs(args, {
|
|
531
|
+
objectSet: resolveInterfaceObjectSet(objectSet, interfaceType.apiName, args),
|
|
532
|
+
select: args?.$select ?? [],
|
|
533
|
+
excludeRid: !args?.$includeRid,
|
|
534
|
+
snapshot: useSnapshot
|
|
535
|
+
}), {
|
|
536
|
+
preview: true
|
|
537
|
+
});
|
|
538
|
+
return Promise.resolve({
|
|
539
|
+
data: await client.objectFactory2(client, result.data, interfaceType.apiName, {}, !args.$includeRid, args.$select, false, result.interfaceToObjectTypeMappings),
|
|
540
|
+
nextPageToken: result.nextPageToken,
|
|
541
|
+
totalCount: result.totalCount
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
async function fetchPageInternal(client, objectType, objectSet, args = {}, useSnapshot = false) {
|
|
545
|
+
if (objectType.type === "interface") {
|
|
546
|
+
return await fetchInterfacePage(client, objectType, args, objectSet, useSnapshot);
|
|
547
|
+
} else {
|
|
548
|
+
return await fetchObjectPage(client, objectType, args, objectSet, useSnapshot);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
async function fetchPageWithErrorsInternal(client, objectType, objectSet, args = {}) {
|
|
552
|
+
try {
|
|
553
|
+
const result = await fetchPageInternal(client, objectType, objectSet, args);
|
|
554
|
+
return {
|
|
555
|
+
value: result
|
|
556
|
+
};
|
|
557
|
+
} catch (e) {
|
|
558
|
+
if (e instanceof Error) {
|
|
559
|
+
return {
|
|
560
|
+
error: e
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
return {
|
|
564
|
+
error: e
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
async function fetchPage(client, objectType, args, objectSet = resolveBaseObjectSetType(objectType)) {
|
|
569
|
+
return fetchPageInternal(client, objectType, objectSet, args);
|
|
570
|
+
}
|
|
571
|
+
function applyFetchArgs(args, body) {
|
|
572
|
+
if (args?.$nextPageToken) {
|
|
573
|
+
body.pageToken = args.$nextPageToken;
|
|
574
|
+
}
|
|
575
|
+
if (args?.$pageSize != null) {
|
|
576
|
+
body.pageSize = args.$pageSize;
|
|
577
|
+
}
|
|
578
|
+
if (args?.$orderBy != null) {
|
|
579
|
+
body.orderBy = {
|
|
580
|
+
fields: Object.entries(args.$orderBy).map(([field, direction]) => ({
|
|
581
|
+
field,
|
|
582
|
+
direction
|
|
583
|
+
}))
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
return body;
|
|
587
|
+
}
|
|
588
|
+
async function fetchObjectPage(client, objectType, args, objectSet, useSnapshot = false) {
|
|
589
|
+
const r = await OntologyObjectSet_exports.load(addUserAgentAndRequestContextHeaders(client, objectType), await client.ontologyRid, applyFetchArgs(args, {
|
|
590
|
+
objectSet,
|
|
591
|
+
// We have to do the following case because LoadObjectSetRequestV2 isn't readonly
|
|
592
|
+
select: args?.$select ?? [],
|
|
593
|
+
// FIXME?
|
|
594
|
+
excludeRid: !args?.$includeRid,
|
|
595
|
+
snapshot: useSnapshot
|
|
596
|
+
}));
|
|
597
|
+
return Promise.resolve({
|
|
598
|
+
data: await client.objectFactory(client, r.data, void 0, void 0, await extractRdpDefinition(client, objectSet), args.$select),
|
|
599
|
+
nextPageToken: r.nextPageToken,
|
|
600
|
+
totalCount: r.totalCount
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// src/Client.ts
|
|
605
|
+
var additionalContext = Symbol("additionalContext");
|
|
606
|
+
|
|
14
607
|
// src/public-utils/hydrateAttachmentFromRid.ts
|
|
15
608
|
function hydrateAttachmentFromRid(client, rid) {
|
|
16
|
-
return hydrateAttachmentFromRidInternal(client[
|
|
609
|
+
return hydrateAttachmentFromRidInternal(client[additionalContext], rid);
|
|
17
610
|
}
|
|
18
611
|
function hydrateAttachmentFromRidInternal(client, rid) {
|
|
19
612
|
return {
|
|
20
613
|
rid,
|
|
21
614
|
async fetchContents() {
|
|
22
|
-
return
|
|
615
|
+
return Attachment_exports.read(client, rid);
|
|
23
616
|
},
|
|
24
617
|
async fetchMetadata() {
|
|
25
|
-
const r = await
|
|
618
|
+
const r = await Attachment_exports.get(client, rid);
|
|
26
619
|
return {
|
|
27
620
|
...r,
|
|
28
621
|
sizeBytes: Number(r.sizeBytes)
|
|
@@ -66,7 +659,7 @@ var BaseLogger = class {
|
|
|
66
659
|
...this.bindings,
|
|
67
660
|
...bindings
|
|
68
661
|
}, {
|
|
69
|
-
level:
|
|
662
|
+
level: options?.level ?? this.options?.level,
|
|
70
663
|
msgPrefix: [this.options?.msgPrefix, options?.msgPrefix].filter((x) => x).join(" ")
|
|
71
664
|
});
|
|
72
665
|
}
|
|
@@ -98,7 +691,7 @@ var MinimalLogger = class _MinimalLogger extends BaseLogger {
|
|
|
98
691
|
}
|
|
99
692
|
};
|
|
100
693
|
async function fetchSingle(client, objectType, args, objectSet) {
|
|
101
|
-
const result = await
|
|
694
|
+
const result = await fetchPage(client, objectType, {
|
|
102
695
|
...args,
|
|
103
696
|
$pageSize: 1
|
|
104
697
|
}, objectSet);
|
|
@@ -193,7 +786,7 @@ function makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field
|
|
|
193
786
|
};
|
|
194
787
|
}
|
|
195
788
|
function handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector) {
|
|
196
|
-
!(filter != null) ? process.env.NODE_ENV !== "production" ?
|
|
789
|
+
!(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;
|
|
197
790
|
const propertyIdentifier = structFieldSelector != null ? {
|
|
198
791
|
type: "structField",
|
|
199
792
|
...structFieldSelector,
|
|
@@ -212,10 +805,10 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
|
|
|
212
805
|
}
|
|
213
806
|
const keysOfFilter = Object.keys(filter);
|
|
214
807
|
const hasDollarSign = keysOfFilter.some((key) => key.startsWith("$"));
|
|
215
|
-
!(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
808
|
+
!(!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;
|
|
216
809
|
if (!hasDollarSign) {
|
|
217
810
|
const structFilter = Object.entries(filter);
|
|
218
|
-
!(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
811
|
+
!(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;
|
|
219
812
|
const structFieldApiName = keysOfFilter[0];
|
|
220
813
|
return handleWherePair(Object.entries(filter)[0], objectOrInterface, {
|
|
221
814
|
propertyApiName: fieldName,
|
|
@@ -223,7 +816,7 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
|
|
|
223
816
|
});
|
|
224
817
|
}
|
|
225
818
|
const firstKey = keysOfFilter[0];
|
|
226
|
-
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ?
|
|
819
|
+
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false) : invariant4__default.default(false) : void 0;
|
|
227
820
|
if (firstKey === "$ne") {
|
|
228
821
|
return {
|
|
229
822
|
type: "not",
|
|
@@ -305,6 +898,79 @@ function fullyQualifyPropName(fieldName, objectOrInterface) {
|
|
|
305
898
|
}
|
|
306
899
|
return fieldName;
|
|
307
900
|
}
|
|
901
|
+
function derivedPropertyDefinitionFactory(wireDefinition, definitionMap) {
|
|
902
|
+
const definition = {
|
|
903
|
+
abs() {
|
|
904
|
+
return derivedPropertyDefinitionFactory({
|
|
905
|
+
type: "absoluteValue",
|
|
906
|
+
property: wireDefinition
|
|
907
|
+
}, definitionMap);
|
|
908
|
+
},
|
|
909
|
+
negate() {
|
|
910
|
+
return derivedPropertyDefinitionFactory({
|
|
911
|
+
type: "negate",
|
|
912
|
+
property: wireDefinition
|
|
913
|
+
}, definitionMap);
|
|
914
|
+
},
|
|
915
|
+
max(value) {
|
|
916
|
+
return derivedPropertyDefinitionFactory({
|
|
917
|
+
type: "greatest",
|
|
918
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
919
|
+
}, definitionMap);
|
|
920
|
+
},
|
|
921
|
+
min(value) {
|
|
922
|
+
return derivedPropertyDefinitionFactory({
|
|
923
|
+
type: "least",
|
|
924
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
925
|
+
}, definitionMap);
|
|
926
|
+
},
|
|
927
|
+
add(value) {
|
|
928
|
+
return derivedPropertyDefinitionFactory({
|
|
929
|
+
type: "add",
|
|
930
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
931
|
+
}, definitionMap);
|
|
932
|
+
},
|
|
933
|
+
subtract(value) {
|
|
934
|
+
return derivedPropertyDefinitionFactory({
|
|
935
|
+
"type": "subtract",
|
|
936
|
+
"left": wireDefinition,
|
|
937
|
+
"right": getDefinitionFromMap(value, definitionMap)
|
|
938
|
+
}, definitionMap);
|
|
939
|
+
},
|
|
940
|
+
multiply(value) {
|
|
941
|
+
return derivedPropertyDefinitionFactory({
|
|
942
|
+
type: "multiply",
|
|
943
|
+
properties: [wireDefinition, getDefinitionFromMap(value, definitionMap)]
|
|
944
|
+
}, definitionMap);
|
|
945
|
+
},
|
|
946
|
+
divide(value) {
|
|
947
|
+
return derivedPropertyDefinitionFactory({
|
|
948
|
+
"type": "subtract",
|
|
949
|
+
"left": wireDefinition,
|
|
950
|
+
"right": getDefinitionFromMap(value, definitionMap)
|
|
951
|
+
}, definitionMap);
|
|
952
|
+
},
|
|
953
|
+
extractPart: (part) => {
|
|
954
|
+
return derivedPropertyDefinitionFactory({
|
|
955
|
+
type: "extract",
|
|
956
|
+
part,
|
|
957
|
+
property: wireDefinition
|
|
958
|
+
}, definitionMap);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
definitionMap.set(definition, wireDefinition);
|
|
962
|
+
return definition;
|
|
963
|
+
}
|
|
964
|
+
var getDefinitionFromMap = (arg, definitionMap) => {
|
|
965
|
+
if (typeof arg === "object") {
|
|
966
|
+
const definition = definitionMap.get(arg);
|
|
967
|
+
!definition ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Derived Property is not defined") : invariant4__default.default(false) : void 0;
|
|
968
|
+
return definition;
|
|
969
|
+
} else if (typeof arg === "number") {
|
|
970
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Literals for derived properties are not yet supported") : invariant4__default.default(false) ;
|
|
971
|
+
}
|
|
972
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Invalid argument type for a derived property") : invariant4__default.default(false) ;
|
|
973
|
+
};
|
|
308
974
|
|
|
309
975
|
// src/derivedProperties/createWithPropertiesObjectSet.ts
|
|
310
976
|
function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fromBaseObjectSet = false) {
|
|
@@ -325,7 +991,7 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
|
|
|
325
991
|
},
|
|
326
992
|
aggregate: (aggregation, opt) => {
|
|
327
993
|
const splitAggregation = aggregation.split(":");
|
|
328
|
-
!(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ?
|
|
994
|
+
!(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Invalid aggregation format") : invariant4__default.default(false) : void 0;
|
|
329
995
|
const [aggregationPropertyName, aggregationOperation] = splitAggregation;
|
|
330
996
|
let aggregationOperationDefinition;
|
|
331
997
|
switch (aggregationOperation) {
|
|
@@ -363,16 +1029,55 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
|
|
|
363
1029
|
break;
|
|
364
1030
|
}
|
|
365
1031
|
default:
|
|
366
|
-
process.env.NODE_ENV !== "production" ?
|
|
1032
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Invalid aggregation operation " + aggregationOperation) : invariant4__default.default(false) ;
|
|
367
1033
|
}
|
|
368
1034
|
const wrappedObjectSet = {
|
|
369
1035
|
type: "selection",
|
|
370
1036
|
objectSet,
|
|
371
1037
|
operation: aggregationOperationDefinition
|
|
372
1038
|
};
|
|
373
|
-
const selectorResult =
|
|
1039
|
+
const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);
|
|
374
1040
|
definitionMap.set(selectorResult, wrappedObjectSet);
|
|
375
1041
|
return selectorResult;
|
|
1042
|
+
},
|
|
1043
|
+
selectProperty: (name) => {
|
|
1044
|
+
if (fromBaseObjectSet) {
|
|
1045
|
+
const wrappedObjectSet2 = {
|
|
1046
|
+
type: "property",
|
|
1047
|
+
apiName: name
|
|
1048
|
+
};
|
|
1049
|
+
const selectorResult2 = derivedPropertyDefinitionFactory(wrappedObjectSet2, definitionMap);
|
|
1050
|
+
definitionMap.set(selectorResult2, wrappedObjectSet2);
|
|
1051
|
+
return selectorResult2;
|
|
1052
|
+
}
|
|
1053
|
+
const wrappedObjectSet = {
|
|
1054
|
+
type: "selection",
|
|
1055
|
+
objectSet,
|
|
1056
|
+
operation: {
|
|
1057
|
+
type: "get",
|
|
1058
|
+
selectedPropertyApiName: name
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);
|
|
1062
|
+
definitionMap.set(selectorResult, wrappedObjectSet);
|
|
1063
|
+
return selectorResult;
|
|
1064
|
+
},
|
|
1065
|
+
constant: {
|
|
1066
|
+
double: (value) => {
|
|
1067
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1068
|
+
},
|
|
1069
|
+
integer: (value) => {
|
|
1070
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1071
|
+
},
|
|
1072
|
+
long: (value) => {
|
|
1073
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1074
|
+
},
|
|
1075
|
+
datetime: (value) => {
|
|
1076
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1077
|
+
},
|
|
1078
|
+
timestamp: (value) => {
|
|
1079
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Not supported") : invariant4__default.default(false) ;
|
|
1080
|
+
}
|
|
376
1081
|
}
|
|
377
1082
|
};
|
|
378
1083
|
}
|
|
@@ -382,7 +1087,7 @@ function legacyToModernSingleAggregationResult(entry) {
|
|
|
382
1087
|
if (parts[0] === "count") {
|
|
383
1088
|
return accumulator;
|
|
384
1089
|
}
|
|
385
|
-
!(parts.length === 2) ? process.env.NODE_ENV !== "production" ?
|
|
1090
|
+
!(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;
|
|
386
1091
|
const property = parts[0];
|
|
387
1092
|
const metricType = parts[1];
|
|
388
1093
|
if (!(property in accumulator)) {
|
|
@@ -468,21 +1173,21 @@ function convertRange(range) {
|
|
|
468
1173
|
}
|
|
469
1174
|
|
|
470
1175
|
// src/object/aggregate.ts
|
|
471
|
-
async function
|
|
472
|
-
|
|
1176
|
+
async function aggregate3(clientCtx, objectType, objectSet = resolveBaseObjectSetType(objectType), req) {
|
|
1177
|
+
resolveBaseObjectSetType(objectType);
|
|
473
1178
|
const body = {
|
|
474
1179
|
aggregation: modernToLegacyAggregationClause(req.$select),
|
|
475
1180
|
groupBy: []};
|
|
476
1181
|
if (req.$groupBy) {
|
|
477
1182
|
body.groupBy = modernToLegacyGroupByClause(req.$groupBy);
|
|
478
1183
|
}
|
|
479
|
-
const result = await
|
|
1184
|
+
const result = await OntologyObjectSet_exports.aggregate(addUserAgentAndRequestContextHeaders(clientCtx, objectType), await clientCtx.ontologyRid, {
|
|
480
1185
|
objectSet,
|
|
481
1186
|
groupBy: body.groupBy,
|
|
482
1187
|
aggregation: body.aggregation
|
|
483
1188
|
});
|
|
484
1189
|
if (!req.$groupBy) {
|
|
485
|
-
!(result.data.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
1190
|
+
!(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;
|
|
486
1191
|
return {
|
|
487
1192
|
...aggregationToCountResult(result.data[0]),
|
|
488
1193
|
...legacyToModernSingleAggregationResult(result.data[0])
|
|
@@ -508,11 +1213,11 @@ function aggregationToCountResult(entry) {
|
|
|
508
1213
|
}
|
|
509
1214
|
|
|
510
1215
|
// src/util/augmentRequestContext.ts
|
|
511
|
-
var augmentRequestContext = (client,
|
|
1216
|
+
var augmentRequestContext = (client, augment2) => ({
|
|
512
1217
|
...client,
|
|
513
1218
|
requestContext: {
|
|
514
1219
|
...client.requestContext,
|
|
515
|
-
...
|
|
1220
|
+
...augment2(client.requestContext)
|
|
516
1221
|
}
|
|
517
1222
|
});
|
|
518
1223
|
|
|
@@ -578,7 +1283,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
578
1283
|
this.#logger = client.logger?.child({}, {
|
|
579
1284
|
msgPrefix: "<OSW> "
|
|
580
1285
|
});
|
|
581
|
-
!(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ?
|
|
1286
|
+
!(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;
|
|
582
1287
|
}
|
|
583
1288
|
async subscribe(objectType, objectSet, listener, properties = []) {
|
|
584
1289
|
const objOrInterfaceDef = objectType.type === "object" ? await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName) : await this.#client.ontologyProvider.getInterfaceDefinition(objectType.apiName);
|
|
@@ -760,7 +1465,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
760
1465
|
return;
|
|
761
1466
|
}
|
|
762
1467
|
default:
|
|
763
|
-
process.env.NODE_ENV !== "production" ?
|
|
1468
|
+
process.env.NODE_ENV !== "production" ? invariant4__default.default(false, "Unexpected message type") : invariant4__default.default(false) ;
|
|
764
1469
|
}
|
|
765
1470
|
};
|
|
766
1471
|
#handleMessage_objectSetChanged = async (payload) => {
|
|
@@ -825,7 +1530,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
825
1530
|
}
|
|
826
1531
|
#handleMessage_refreshObjectSet = (payload) => {
|
|
827
1532
|
const sub = this.#subscriptions.get(payload.id);
|
|
828
|
-
!sub ? process.env.NODE_ENV !== "production" ?
|
|
1533
|
+
!sub ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Expected subscription id ${payload.id}`) : invariant4__default.default(false) : void 0;
|
|
829
1534
|
try {
|
|
830
1535
|
sub.listener.onOutOfDate();
|
|
831
1536
|
} catch (error) {
|
|
@@ -839,7 +1544,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
839
1544
|
responses
|
|
840
1545
|
} = payload;
|
|
841
1546
|
const subs = this.#pendingSubscriptions.get(id);
|
|
842
|
-
!subs ? process.env.NODE_ENV !== "production" ?
|
|
1547
|
+
!subs ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `should have a pending subscription for ${id}`) : invariant4__default.default(false) : void 0;
|
|
843
1548
|
this.#pendingSubscriptions.delete(id);
|
|
844
1549
|
for (let i = 0; i < responses.length; i++) {
|
|
845
1550
|
const sub = subs[i];
|
|
@@ -881,7 +1586,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
881
1586
|
#handleMessage_subscriptionClosed(payload) {
|
|
882
1587
|
const sub = this.#subscriptions.get(payload.id);
|
|
883
1588
|
if (sub == null && this.#endedSubscriptions.has(payload.id)) return;
|
|
884
|
-
!sub ? process.env.NODE_ENV !== "production" ?
|
|
1589
|
+
!sub ? process.env.NODE_ENV !== "production" ? invariant4__default.default(false, `Expected subscription id ${payload.id}`) : invariant4__default.default(false) : void 0;
|
|
885
1590
|
this.#tryCatchOnError(sub, true, payload.cause);
|
|
886
1591
|
this.#unsubscribe(sub, "error");
|
|
887
1592
|
}
|
|
@@ -906,7 +1611,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
906
1611
|
if (this.#subscriptions.size > 0) {
|
|
907
1612
|
if (process.env.NODE_ENV !== "production") {
|
|
908
1613
|
for (const s of this.#subscriptions.values()) {
|
|
909
|
-
!(s.status !== "done" && s.status !== "error") ? process.env.NODE_ENV !== "production" ?
|
|
1614
|
+
!(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;
|
|
910
1615
|
}
|
|
911
1616
|
}
|
|
912
1617
|
for (const s of this.#subscriptions.values()) {
|
|
@@ -955,15 +1660,15 @@ function getWireObjectSet(objectSet) {
|
|
|
955
1660
|
return objectSetDefinitions.get(objectSet);
|
|
956
1661
|
}
|
|
957
1662
|
var objectSetDefinitions = /* @__PURE__ */ new WeakMap();
|
|
958
|
-
function createObjectSet(objectType, clientCtx, objectSet =
|
|
1663
|
+
function createObjectSet(objectType, clientCtx, objectSet = resolveBaseObjectSetType(objectType)) {
|
|
959
1664
|
const base = {
|
|
960
|
-
aggregate:
|
|
1665
|
+
aggregate: aggregate3.bind(globalThis, augmentRequestContext(clientCtx, (_) => ({
|
|
961
1666
|
finalMethodCall: "aggregate"
|
|
962
1667
|
})), objectType, objectSet),
|
|
963
|
-
fetchPage:
|
|
1668
|
+
fetchPage: fetchPageInternal.bind(globalThis, augmentRequestContext(clientCtx, (_) => ({
|
|
964
1669
|
finalMethodCall: "fetchPage"
|
|
965
1670
|
})), objectType, objectSet),
|
|
966
|
-
fetchPageWithErrors:
|
|
1671
|
+
fetchPageWithErrors: fetchPageWithErrorsInternal.bind(globalThis, augmentRequestContext(clientCtx, (_) => ({
|
|
967
1672
|
finalMethodCall: "fetchPageWithErrors"
|
|
968
1673
|
})), objectType, objectSet),
|
|
969
1674
|
where: (clause) => {
|
|
@@ -997,13 +1702,13 @@ function createObjectSet(objectType, clientCtx, objectSet = chunkUCW7RLKM_cjs.re
|
|
|
997
1702
|
asyncIter: async function* (args) {
|
|
998
1703
|
let $nextPageToken = void 0;
|
|
999
1704
|
do {
|
|
1000
|
-
const result = await
|
|
1705
|
+
const result = await fetchPageInternal(augmentRequestContext(clientCtx, (_) => ({
|
|
1001
1706
|
finalMethodCall: "asyncIter"
|
|
1002
1707
|
})), objectType, objectSet, {
|
|
1003
1708
|
...args,
|
|
1004
1709
|
$pageSize: 1e4,
|
|
1005
1710
|
$nextPageToken
|
|
1006
|
-
});
|
|
1711
|
+
}, true);
|
|
1007
1712
|
$nextPageToken = result.nextPageToken;
|
|
1008
1713
|
for (const obj of result.data) {
|
|
1009
1714
|
yield obj;
|
|
@@ -1071,11 +1776,26 @@ async function createWithPk(clientCtx, objectType, objectSet, primaryKey) {
|
|
|
1071
1776
|
return withPk;
|
|
1072
1777
|
}
|
|
1073
1778
|
|
|
1779
|
+
exports.ActionTypeV2_exports = ActionTypeV2_exports;
|
|
1780
|
+
exports.Action_exports = Action_exports;
|
|
1781
|
+
exports.Attachment_exports = Attachment_exports;
|
|
1074
1782
|
exports.BaseLogger = BaseLogger;
|
|
1783
|
+
exports.MediaReferenceProperty_exports = MediaReferenceProperty_exports;
|
|
1075
1784
|
exports.MinimalLogger = MinimalLogger;
|
|
1785
|
+
exports.ObjectTypeV2_exports = ObjectTypeV2_exports;
|
|
1786
|
+
exports.OntologyInterface_exports = OntologyInterface_exports;
|
|
1787
|
+
exports.OntologyObjectSet_exports = OntologyObjectSet_exports;
|
|
1788
|
+
exports.QueryType_exports = QueryType_exports;
|
|
1789
|
+
exports.Query_exports = Query_exports;
|
|
1790
|
+
exports.TimeSeriesPropertyV2_exports = TimeSeriesPropertyV2_exports;
|
|
1791
|
+
exports.TimeSeriesValueBankProperty_exports = TimeSeriesValueBankProperty_exports;
|
|
1792
|
+
exports.addUserAgentAndRequestContextHeaders = addUserAgentAndRequestContextHeaders;
|
|
1793
|
+
exports.additionalContext = additionalContext;
|
|
1794
|
+
exports.augment = augment;
|
|
1076
1795
|
exports.augmentRequestContext = augmentRequestContext;
|
|
1077
1796
|
exports.createObjectSet = createObjectSet;
|
|
1078
1797
|
exports.extractNamespace = extractNamespace;
|
|
1798
|
+
exports.fetchPage = fetchPage;
|
|
1079
1799
|
exports.fetchSingle = fetchSingle;
|
|
1080
1800
|
exports.fetchSingleWithErrors = fetchSingleWithErrors;
|
|
1081
1801
|
exports.getWireObjectSet = getWireObjectSet;
|
|
@@ -1083,5 +1803,6 @@ exports.hydrateAttachmentFromRid = hydrateAttachmentFromRid;
|
|
|
1083
1803
|
exports.hydrateAttachmentFromRidInternal = hydrateAttachmentFromRidInternal;
|
|
1084
1804
|
exports.isObjectSet = isObjectSet;
|
|
1085
1805
|
exports.isWireObjectSet = isWireObjectSet;
|
|
1086
|
-
|
|
1087
|
-
//# sourceMappingURL=chunk-
|
|
1806
|
+
exports.symbolClientContext = symbolClientContext;
|
|
1807
|
+
//# sourceMappingURL=chunk-YGJRXE4F.cjs.map
|
|
1808
|
+
//# sourceMappingURL=chunk-YGJRXE4F.cjs.map
|