@osdk/client 2.23.0 → 2.23.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/MinimalClientContext.js.map +1 -1
- package/build/browser/actions/applyAction.js +3 -1
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.js +7 -3
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createMinimalClient.js +10 -0
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +3 -0
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +30 -10
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/browser/object/aggregate.js +2 -1
- package/build/browser/object/aggregate.js.map +1 -1
- package/build/browser/object/fetchPage.js +6 -3
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +3 -0
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/public/unstable-do-not-use.js +2 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/queries/applyQuery.js +1 -0
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/scenarios/ScenarioClient.js +202 -0
- package/build/browser/scenarios/ScenarioClient.js.map +1 -0
- package/build/browser/scenarios/createScenario.js +55 -0
- package/build/browser/scenarios/createScenario.js.map +1 -0
- package/build/browser/scenarios/withScenario.js +42 -0
- package/build/browser/scenarios/withScenario.js.map +1 -0
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/toDataValue.js +4 -0
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/cjs/MediaReferenceProperty-CBPMMD73.cjs +22 -0
- package/build/cjs/{MediaReferenceProperty-Y6R5ASNW.cjs.map → MediaReferenceProperty-CBPMMD73.cjs.map} +1 -1
- package/build/cjs/{applyStreamingQuery-F77N7EOP.cjs → applyStreamingQuery-G2PA2SM7.cjs} +11 -11
- package/build/cjs/{applyStreamingQuery-F77N7EOP.cjs.map → applyStreamingQuery-G2PA2SM7.cjs.map} +1 -1
- package/build/cjs/{chunk-KILPUOJP.cjs → chunk-BV6P25ZM.cjs} +51 -21
- package/build/cjs/chunk-BV6P25ZM.cjs.map +1 -0
- package/build/cjs/{chunk-3DMI6Z4B.cjs → chunk-IWAZIBOK.cjs} +75 -75
- package/build/cjs/{chunk-3DMI6Z4B.cjs.map → chunk-IWAZIBOK.cjs.map} +1 -1
- package/build/cjs/{chunk-MURBAIS4.cjs → chunk-NFD4IH4H.cjs} +17 -16
- package/build/cjs/chunk-NFD4IH4H.cjs.map +1 -0
- package/build/cjs/{chunk-5WD6SB7R.cjs → chunk-WBINM4RT.cjs} +297 -100
- package/build/cjs/chunk-WBINM4RT.cjs.map +1 -0
- package/build/cjs/{chunk-DOXHU27E.cjs → chunk-YP43NHIA.cjs} +3 -3
- package/build/cjs/{chunk-DOXHU27E.cjs.map → chunk-YP43NHIA.cjs.map} +1 -1
- package/build/cjs/{chunk-ZPLXXOU6.cjs → chunk-ZFNHWPQA.cjs} +3 -3
- package/build/cjs/{chunk-ZPLXXOU6.cjs.map → chunk-ZFNHWPQA.cjs.map} +1 -1
- package/build/cjs/index.cjs +13 -13
- package/build/cjs/public/experimental.cjs +8 -8
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/observable.cjs +7 -7
- package/build/cjs/public/unstable-do-not-use.cjs +37 -12
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +167 -4
- package/build/cjs/{transformAndWaitInternal-F3UV33FN.cjs → transformAndWaitInternal-2GORZXPK.cjs} +6 -6
- package/build/cjs/{transformAndWaitInternal-F3UV33FN.cjs.map → transformAndWaitInternal-2GORZXPK.cjs.map} +1 -1
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/MinimalClientContext.js.map +1 -1
- package/build/esm/actions/applyAction.js +3 -1
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.js +7 -3
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createMinimalClient.js +10 -0
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +3 -0
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +30 -10
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/esm/object/aggregate.js +2 -1
- package/build/esm/object/aggregate.js.map +1 -1
- package/build/esm/object/fetchPage.js +6 -3
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +3 -0
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +2 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/queries/applyQuery.js +1 -0
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/scenarios/ScenarioClient.js +202 -0
- package/build/esm/scenarios/ScenarioClient.js.map +1 -0
- package/build/esm/scenarios/createScenario.js +55 -0
- package/build/esm/scenarios/createScenario.js.map +1 -0
- package/build/esm/scenarios/withScenario.js +42 -0
- package/build/esm/scenarios/withScenario.js.map +1 -0
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/toDataValue.js +4 -0
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/build/types/MinimalClientContext.d.ts +1 -0
- package/build/types/MinimalClientContext.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/public/unstable-do-not-use.d.ts +3 -0
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/build/types/scenarios/ScenarioClient.d.ts +131 -0
- package/build/types/scenarios/ScenarioClient.d.ts.map +1 -0
- package/build/types/scenarios/createScenario.d.ts +21 -0
- package/build/types/scenarios/createScenario.d.ts.map +1 -0
- package/build/types/scenarios/withScenario.d.ts +23 -0
- package/build/types/scenarios/withScenario.d.ts.map +1 -0
- package/package.json +14 -14
- package/build/cjs/MediaReferenceProperty-Y6R5ASNW.cjs +0 -22
- package/build/cjs/chunk-5WD6SB7R.cjs.map +0 -1
- package/build/cjs/chunk-KILPUOJP.cjs.map +0 -1
- package/build/cjs/chunk-MURBAIS4.cjs.map +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNFD4IH4H_cjs = require('./chunk-NFD4IH4H.cjs');
|
|
4
4
|
var chunkYJG67XL4_cjs = require('./chunk-YJG67XL4.cjs');
|
|
5
5
|
var chunkTQUNF2DZ_cjs = require('./chunk-TQUNF2DZ.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var chunkBV6P25ZM_cjs = require('./chunk-BV6P25ZM.cjs');
|
|
7
|
+
var chunkZFNHWPQA_cjs = require('./chunk-ZFNHWPQA.cjs');
|
|
8
8
|
var chunkCEBSLQQC_cjs = require('./chunk-CEBSLQQC.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkYP43NHIA_cjs = require('./chunk-YP43NHIA.cjs');
|
|
10
10
|
var chunkD26YLHTV_cjs = require('./chunk-D26YLHTV.cjs');
|
|
11
|
+
var chunk74HV6NQQ_cjs = require('./chunk-74HV6NQQ.cjs');
|
|
11
12
|
var unstable = require('@osdk/api/unstable');
|
|
12
13
|
var invariant2 = require('tiny-invariant');
|
|
13
14
|
var shared_client_impl = require('@osdk/shared.client.impl');
|
|
@@ -25,7 +26,7 @@ var ActionValidationError = class extends Error {
|
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
28
|
|
|
28
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
29
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
29
30
|
var _apply = [1, "/v2/ontologies/{0}/actions/{1}/apply", 7];
|
|
30
31
|
function apply($ctx, ...args) {
|
|
31
32
|
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _apply, ...args);
|
|
@@ -35,6 +36,231 @@ function applyBatch($ctx, ...args) {
|
|
|
35
36
|
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _applyBatch, ...args);
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js
|
|
40
|
+
var _get = [0, "/v2/ontologies/{0}/actionTypes/{1}", 2];
|
|
41
|
+
function get($ctx, ...args) {
|
|
42
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _get, ...args);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js
|
|
46
|
+
var _getFullMetadata = [0, "/v2/ontologies/{0}/objectTypes/{1}/fullMetadata", 2];
|
|
47
|
+
function getFullMetadata($ctx, ...args) {
|
|
48
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getFullMetadata, ...args);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyInterface.js
|
|
52
|
+
var _get2 = [0, "/v2/ontologies/{0}/interfaceTypes/{1}", 2];
|
|
53
|
+
function get2($ctx, ...args) {
|
|
54
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _get2, ...args);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyScenario.js
|
|
58
|
+
var OntologyScenario_exports = {};
|
|
59
|
+
chunk74HV6NQQ_cjs.__export(OntologyScenario_exports, {
|
|
60
|
+
createScenario: () => createScenario,
|
|
61
|
+
listScenarioEditedEntityTypes: () => listScenarioEditedEntityTypes,
|
|
62
|
+
listScenarioEditedLinkTypes: () => listScenarioEditedLinkTypes,
|
|
63
|
+
listScenarioEditedLinks: () => listScenarioEditedLinks,
|
|
64
|
+
listScenarioEditedObjectTypes: () => listScenarioEditedObjectTypes,
|
|
65
|
+
listScenarioEditedObjects: () => listScenarioEditedObjects
|
|
66
|
+
});
|
|
67
|
+
var _createScenario = [1, "/v2/ontologies/{0}/scenarios/create", 1];
|
|
68
|
+
function createScenario($ctx, ...args) {
|
|
69
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _createScenario, ...args);
|
|
70
|
+
}
|
|
71
|
+
var _listScenarioEditedObjectTypes = [0, "/v2/ontologies/{0}/scenarios/{1}/objectTypes/edited"];
|
|
72
|
+
function listScenarioEditedObjectTypes($ctx, ...args) {
|
|
73
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _listScenarioEditedObjectTypes, ...args);
|
|
74
|
+
}
|
|
75
|
+
var _listScenarioEditedLinkTypes = [0, "/v2/ontologies/{0}/scenarios/{1}/objectTypes/{2}/outgoingLinkTypes/edited"];
|
|
76
|
+
function listScenarioEditedLinkTypes($ctx, ...args) {
|
|
77
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _listScenarioEditedLinkTypes, ...args);
|
|
78
|
+
}
|
|
79
|
+
var _listScenarioEditedEntityTypes = [0, "/v2/ontologies/{0}/scenarios/{1}/editedEntityTypes"];
|
|
80
|
+
function listScenarioEditedEntityTypes($ctx, ...args) {
|
|
81
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _listScenarioEditedEntityTypes, ...args);
|
|
82
|
+
}
|
|
83
|
+
var _listScenarioEditedObjects = [0, "/v2/ontologies/{0}/scenarios/{1}/objects/{2}/edited", 2];
|
|
84
|
+
function listScenarioEditedObjects($ctx, ...args) {
|
|
85
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _listScenarioEditedObjects, ...args);
|
|
86
|
+
}
|
|
87
|
+
var _listScenarioEditedLinks = [0, "/v2/ontologies/{0}/scenarios/{1}/objects/{2}/links/{3}/edited", 2];
|
|
88
|
+
function listScenarioEditedLinks($ctx, ...args) {
|
|
89
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _listScenarioEditedLinks, ...args);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js
|
|
93
|
+
var _get3 = [0, "/v2/ontologies/{0}/queryTypes/{1}", 2];
|
|
94
|
+
function get3($ctx, ...args) {
|
|
95
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _get3, ...args);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js
|
|
99
|
+
var _getFirstPoint = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/firstPoint", 2];
|
|
100
|
+
function getFirstPoint($ctx, ...args) {
|
|
101
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getFirstPoint, ...args);
|
|
102
|
+
}
|
|
103
|
+
var _getLastPoint = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/lastPoint", 2];
|
|
104
|
+
function getLastPoint($ctx, ...args) {
|
|
105
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getLastPoint, ...args);
|
|
106
|
+
}
|
|
107
|
+
var _streamPoints = [1, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamPoints", 3, , "*/*"];
|
|
108
|
+
function streamPoints($ctx, ...args) {
|
|
109
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _streamPoints, ...args);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.61.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js
|
|
113
|
+
var _getLatestValue = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/latestValue", 2];
|
|
114
|
+
function getLatestValue($ctx, ...args) {
|
|
115
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getLatestValue, ...args);
|
|
116
|
+
}
|
|
117
|
+
var _streamValues = [1, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamValues", 3, , "*/*"];
|
|
118
|
+
function streamValues($ctx, ...args) {
|
|
119
|
+
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _streamValues, ...args);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// src/scenarios/ScenarioClient.ts
|
|
123
|
+
function isScenarioClient(value) {
|
|
124
|
+
return value != null && (typeof value === "object" || typeof value === "function") && typeof value.getScenarioReference === "function";
|
|
125
|
+
}
|
|
126
|
+
function buildScenarioClient(parent, scenarioRid) {
|
|
127
|
+
const ctx = parent[chunkBV6P25ZM_cjs.additionalContext];
|
|
128
|
+
if (ctx.transactionId != null) {
|
|
129
|
+
throw new Error("withScenario / createScenario: the supplied client already has an active transaction. Scenarios cannot be nested on transactions.");
|
|
130
|
+
}
|
|
131
|
+
if (ctx.scenarioRid != null) {
|
|
132
|
+
throw new Error("withScenario / createScenario: the supplied client already has an active scenario. Scenarios cannot be nested.");
|
|
133
|
+
}
|
|
134
|
+
const inner = createClientWithScenario(scenarioRid, ctx.baseUrl, ctx.ontologyRid, ctx.tokenProvider, {
|
|
135
|
+
logger: ctx.logger,
|
|
136
|
+
UNSTABLE_DO_NOT_USE_BRANCH: ctx.branch
|
|
137
|
+
}, ctx.fetch);
|
|
138
|
+
const innerCtx = inner[chunkBV6P25ZM_cjs.additionalContext];
|
|
139
|
+
async function getEditedEntityTypes() {
|
|
140
|
+
const ontologyRid = await innerCtx.ontologyRid;
|
|
141
|
+
const response = await OntologyScenario_exports.listScenarioEditedEntityTypes(innerCtx, ontologyRid, scenarioRid);
|
|
142
|
+
return {
|
|
143
|
+
objectTypes: response.objectTypes,
|
|
144
|
+
linkTypes: response.linkTypes
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
async function getEditedEntities(objectType, options) {
|
|
148
|
+
const ontologyRid = await innerCtx.ontologyRid;
|
|
149
|
+
const response = await OntologyScenario_exports.listScenarioEditedObjects(innerCtx, ontologyRid, scenarioRid, objectType.apiName, {
|
|
150
|
+
pageSize: options?.pageSize,
|
|
151
|
+
pageToken: options?.pageToken
|
|
152
|
+
});
|
|
153
|
+
const data = response.data.map((entry) => {
|
|
154
|
+
const wire = entry;
|
|
155
|
+
return {
|
|
156
|
+
$apiName: wire.__apiName,
|
|
157
|
+
$primaryKey: wire.__primaryKey
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
return {
|
|
161
|
+
data,
|
|
162
|
+
nextPageToken: response.nextPageToken
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
async function* editedEntitiesAsyncIter(objectType, options) {
|
|
166
|
+
const seen = /* @__PURE__ */ new Set();
|
|
167
|
+
let pageToken;
|
|
168
|
+
do {
|
|
169
|
+
const page = await getEditedEntities(objectType, {
|
|
170
|
+
pageSize: options?.pageSize,
|
|
171
|
+
pageToken
|
|
172
|
+
});
|
|
173
|
+
for (const obj of page.data) {
|
|
174
|
+
const key = obj.$primaryKey;
|
|
175
|
+
if (seen.has(key)) continue;
|
|
176
|
+
seen.add(key);
|
|
177
|
+
yield obj;
|
|
178
|
+
}
|
|
179
|
+
pageToken = page.nextPageToken;
|
|
180
|
+
} while (pageToken != null);
|
|
181
|
+
}
|
|
182
|
+
async function getEditedLinkTypes(sourceObjectType) {
|
|
183
|
+
const ontologyRid = await innerCtx.ontologyRid;
|
|
184
|
+
const response = await OntologyScenario_exports.listScenarioEditedLinkTypes(innerCtx, ontologyRid, scenarioRid, sourceObjectType.apiName);
|
|
185
|
+
return response.data;
|
|
186
|
+
}
|
|
187
|
+
async function getEditedLinks(sourceObjectType, linkType, options) {
|
|
188
|
+
const ontologyRid = await innerCtx.ontologyRid;
|
|
189
|
+
const response = await OntologyScenario_exports.listScenarioEditedLinks(innerCtx, ontologyRid, scenarioRid, sourceObjectType.apiName, linkType, {
|
|
190
|
+
pageSize: options?.pageSize,
|
|
191
|
+
pageToken: options?.pageToken
|
|
192
|
+
});
|
|
193
|
+
const data = [];
|
|
194
|
+
for (const entry of response.data) {
|
|
195
|
+
const sourceWire = entry.sourceObject;
|
|
196
|
+
if (sourceWire?.__apiName == null || sourceWire.__primaryKey == null) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
const source = {
|
|
200
|
+
$apiName: sourceWire.__apiName,
|
|
201
|
+
$primaryKey: sourceWire.__primaryKey
|
|
202
|
+
};
|
|
203
|
+
for (const linked of entry.linkedObjects) {
|
|
204
|
+
const targetWire = linked.targetObject;
|
|
205
|
+
if (targetWire?.__apiName == null || targetWire.__primaryKey == null) {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
const target = {
|
|
209
|
+
$apiName: targetWire.__apiName,
|
|
210
|
+
$primaryKey: targetWire.__primaryKey
|
|
211
|
+
};
|
|
212
|
+
data.push({
|
|
213
|
+
source,
|
|
214
|
+
target,
|
|
215
|
+
linkType: linked.linkType ?? linkType
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
data,
|
|
221
|
+
nextPageToken: response.nextPageToken
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
async function* editedLinksAsyncIter(sourceObjectType, linkType, options) {
|
|
225
|
+
let pageToken;
|
|
226
|
+
do {
|
|
227
|
+
const page = await getEditedLinks(sourceObjectType, linkType, {
|
|
228
|
+
pageSize: options?.pageSize,
|
|
229
|
+
pageToken
|
|
230
|
+
});
|
|
231
|
+
for (const link of page.data) {
|
|
232
|
+
yield link;
|
|
233
|
+
}
|
|
234
|
+
pageToken = page.nextPageToken;
|
|
235
|
+
} while (pageToken != null);
|
|
236
|
+
}
|
|
237
|
+
return Object.defineProperties(inner, {
|
|
238
|
+
getScenarioReference: {
|
|
239
|
+
value: () => ({
|
|
240
|
+
scenarioRid
|
|
241
|
+
})
|
|
242
|
+
},
|
|
243
|
+
getEditedEntityTypes: {
|
|
244
|
+
value: getEditedEntityTypes
|
|
245
|
+
},
|
|
246
|
+
getEditedEntities: {
|
|
247
|
+
value: getEditedEntities
|
|
248
|
+
},
|
|
249
|
+
editedEntitiesAsyncIter: {
|
|
250
|
+
value: editedEntitiesAsyncIter
|
|
251
|
+
},
|
|
252
|
+
getEditedLinkTypes: {
|
|
253
|
+
value: getEditedLinkTypes
|
|
254
|
+
},
|
|
255
|
+
getEditedLinks: {
|
|
256
|
+
value: getEditedLinks
|
|
257
|
+
},
|
|
258
|
+
editedLinksAsyncIter: {
|
|
259
|
+
value: editedLinksAsyncIter
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
38
264
|
// src/util/isOntologyObjectV2.ts
|
|
39
265
|
function isOntologyObjectV2(o) {
|
|
40
266
|
return o && typeof o === "object" && typeof o.__apiName === "string" && o.__primaryKey != null;
|
|
@@ -52,7 +278,7 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
52
278
|
}
|
|
53
279
|
if (Array.isArray(value) || value instanceof Set) {
|
|
54
280
|
const values = Array.from(value);
|
|
55
|
-
if (values.some((dataValue) =>
|
|
281
|
+
if (values.some((dataValue) => chunkNFD4IH4H_cjs.isAttachmentUpload(dataValue) || chunkNFD4IH4H_cjs.isAttachmentFile(dataValue))) {
|
|
56
282
|
const converted = [];
|
|
57
283
|
for (const value2 of values) {
|
|
58
284
|
converted.push(await toDataValue(value2, client));
|
|
@@ -62,52 +288,55 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
62
288
|
const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));
|
|
63
289
|
return Promise.all(promiseArray);
|
|
64
290
|
}
|
|
65
|
-
if (
|
|
66
|
-
const attachment = await
|
|
291
|
+
if (chunkNFD4IH4H_cjs.isAttachmentUpload(value)) {
|
|
292
|
+
const attachment = await chunkBV6P25ZM_cjs.upload(client, value.data, {
|
|
67
293
|
filename: value.name
|
|
68
294
|
});
|
|
69
295
|
return await toDataValue(attachment.rid, client);
|
|
70
296
|
}
|
|
71
|
-
if (
|
|
72
|
-
const attachment = await
|
|
297
|
+
if (chunkNFD4IH4H_cjs.isAttachmentFile(value)) {
|
|
298
|
+
const attachment = await chunkBV6P25ZM_cjs.upload(client, value, {
|
|
73
299
|
filename: value.name
|
|
74
300
|
});
|
|
75
301
|
return await toDataValue(attachment.rid, client);
|
|
76
302
|
}
|
|
77
|
-
if (
|
|
78
|
-
const mediaRef = await
|
|
303
|
+
if (chunkNFD4IH4H_cjs.isMediaUpload(value)) {
|
|
304
|
+
const mediaRef = await chunkZFNHWPQA_cjs.MediaSet_exports.uploadMedia(client, value.data, {
|
|
79
305
|
filename: value.fileName,
|
|
80
306
|
preview: true
|
|
81
307
|
});
|
|
82
308
|
return await toDataValue(mediaRef, client);
|
|
83
309
|
}
|
|
84
|
-
if (
|
|
310
|
+
if (chunkNFD4IH4H_cjs.isMedia(value)) {
|
|
85
311
|
return value.getMediaReference();
|
|
86
312
|
}
|
|
87
|
-
if (
|
|
313
|
+
if (chunkNFD4IH4H_cjs.isMediaReference(value)) {
|
|
88
314
|
return value;
|
|
89
315
|
}
|
|
90
316
|
if (isOntologyObjectV2(value)) {
|
|
91
317
|
return await toDataValue(value.__primaryKey, client);
|
|
92
318
|
}
|
|
93
|
-
if (
|
|
319
|
+
if (chunkNFD4IH4H_cjs.isObjectSpecifiersObject(value)) {
|
|
94
320
|
return await toDataValue(value.$primaryKey, client);
|
|
95
321
|
}
|
|
96
322
|
if (isPoint(value)) {
|
|
97
323
|
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client);
|
|
98
324
|
}
|
|
99
|
-
if (
|
|
325
|
+
if (chunkBV6P25ZM_cjs.isWireObjectSet(value)) {
|
|
100
326
|
return value;
|
|
101
327
|
}
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
328
|
+
if (chunkBV6P25ZM_cjs.isObjectSet(value)) {
|
|
329
|
+
return chunkBV6P25ZM_cjs.getWireObjectSet(value);
|
|
104
330
|
}
|
|
105
|
-
if (
|
|
331
|
+
if (chunkNFD4IH4H_cjs.isInterfaceActionParam(value)) {
|
|
106
332
|
return {
|
|
107
333
|
objectTypeApiName: value.$objectType,
|
|
108
334
|
primaryKeyValue: value.$primaryKey
|
|
109
335
|
};
|
|
110
336
|
}
|
|
337
|
+
if (isScenarioClient(value)) {
|
|
338
|
+
return value.getScenarioReference().scenarioRid;
|
|
339
|
+
}
|
|
111
340
|
if (typeof value === "object") {
|
|
112
341
|
return Object.entries(value).reduce(async (promisedAcc, [key, structValue]) => {
|
|
113
342
|
const acc = await promisedAcc;
|
|
@@ -120,11 +349,12 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
120
349
|
|
|
121
350
|
// src/actions/applyAction.ts
|
|
122
351
|
async function applyAction(client, action, parameters, options = {}) {
|
|
123
|
-
const clientWithHeaders =
|
|
352
|
+
const clientWithHeaders = chunkBV6P25ZM_cjs.addUserAgentAndRequestContextHeaders(chunkBV6P25ZM_cjs.augmentRequestContext(client, (_) => ({
|
|
124
353
|
finalMethodCall: "applyAction"
|
|
125
354
|
})), action);
|
|
126
355
|
if (Array.isArray(parameters)) {
|
|
127
356
|
!(client.transactionId == null) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "Batch actions are not supported for staged edit functions or when supplying a transaction ID") : invariant2__default.default(false) : void 0;
|
|
357
|
+
!(client.scenarioRid == null) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "Batch actions are not supported when scoped to a scenario") : invariant2__default.default(false) : void 0;
|
|
128
358
|
const response = await applyBatch(clientWithHeaders, await client.ontologyRid, action.unsanitizedApiName ?? action.apiName, {
|
|
129
359
|
requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.unsanitizedApiName ?? action.apiName)) : [],
|
|
130
360
|
options: {
|
|
@@ -144,7 +374,8 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
144
374
|
}
|
|
145
375
|
}, {
|
|
146
376
|
branch: client.branch,
|
|
147
|
-
transactionId: client.transactionId
|
|
377
|
+
transactionId: client.transactionId,
|
|
378
|
+
scenarioRid: client.scenarioRid
|
|
148
379
|
});
|
|
149
380
|
if (options?.$validateOnly) {
|
|
150
381
|
return response.validation;
|
|
@@ -224,16 +455,6 @@ function remapActionResponse(response) {
|
|
|
224
455
|
return remappedActionResponse;
|
|
225
456
|
}
|
|
226
457
|
}
|
|
227
|
-
|
|
228
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.57.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js
|
|
229
|
-
var _getLatestValue = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/latestValue", 2];
|
|
230
|
-
function getLatestValue($ctx, ...args) {
|
|
231
|
-
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getLatestValue, ...args);
|
|
232
|
-
}
|
|
233
|
-
var _streamValues = [1, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamValues", 3, , "*/*"];
|
|
234
|
-
function streamValues($ctx, ...args) {
|
|
235
|
-
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _streamValues, ...args);
|
|
236
|
-
}
|
|
237
458
|
function getTimeRange(body) {
|
|
238
459
|
if ("$startTime" in body || "$endTime" in body) {
|
|
239
460
|
return {
|
|
@@ -260,7 +481,7 @@ function getTimeRange(body) {
|
|
|
260
481
|
}
|
|
261
482
|
async function* asyncIterPointsHelper(iterator) {
|
|
262
483
|
const reader = iterator.body?.getReader();
|
|
263
|
-
for await (const point of
|
|
484
|
+
for await (const point of chunkNFD4IH4H_cjs.parseStreamedResponse(chunkNFD4IH4H_cjs.iterateReadableStream(reader))) {
|
|
264
485
|
yield {
|
|
265
486
|
time: point.time,
|
|
266
487
|
value: point.value
|
|
@@ -323,13 +544,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
323
544
|
this.#mediaReference = mediaReference;
|
|
324
545
|
}
|
|
325
546
|
async fetchContents() {
|
|
326
|
-
return
|
|
547
|
+
return chunkYP43NHIA_cjs.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
327
548
|
preview: true
|
|
328
549
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
329
550
|
});
|
|
330
551
|
}
|
|
331
552
|
async fetchMetadata() {
|
|
332
|
-
const r = await
|
|
553
|
+
const r = await chunkYP43NHIA_cjs.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
333
554
|
preview: true
|
|
334
555
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
335
556
|
});
|
|
@@ -344,20 +565,6 @@ var MediaReferencePropertyImpl = class {
|
|
|
344
565
|
}
|
|
345
566
|
};
|
|
346
567
|
|
|
347
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.57.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js
|
|
348
|
-
var _getFirstPoint = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/firstPoint", 2];
|
|
349
|
-
function getFirstPoint($ctx, ...args) {
|
|
350
|
-
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getFirstPoint, ...args);
|
|
351
|
-
}
|
|
352
|
-
var _getLastPoint = [0, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/lastPoint", 2];
|
|
353
|
-
function getLastPoint($ctx, ...args) {
|
|
354
|
-
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getLastPoint, ...args);
|
|
355
|
-
}
|
|
356
|
-
var _streamPoints = [1, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/streamPoints", 3, , "*/*"];
|
|
357
|
-
function streamPoints($ctx, ...args) {
|
|
358
|
-
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _streamPoints, ...args);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
568
|
// src/createTimeseriesProperty.ts
|
|
362
569
|
var TimeSeriesPropertyImpl = class {
|
|
363
570
|
#triplet;
|
|
@@ -778,8 +985,8 @@ function get$link(holder) {
|
|
|
778
985
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
779
986
|
}).pivotTo(linkName);
|
|
780
987
|
const value = !linkDef.multiplicity ? {
|
|
781
|
-
fetchOne: (options) =>
|
|
782
|
-
fetchOneWithErrors: (options) =>
|
|
988
|
+
fetchOne: (options) => chunkBV6P25ZM_cjs.fetchSingle(client, objDef, options ?? {}, chunkBV6P25ZM_cjs.getWireObjectSet(objectSet)),
|
|
989
|
+
fetchOneWithErrors: (options) => chunkBV6P25ZM_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkBV6P25ZM_cjs.getWireObjectSet(objectSet))
|
|
783
990
|
} : objectSet;
|
|
784
991
|
return [linkName, value];
|
|
785
992
|
})));
|
|
@@ -802,8 +1009,8 @@ function get$linkForInterface(holder) {
|
|
|
802
1009
|
apiName: linkDef.targetTypeApiName
|
|
803
1010
|
};
|
|
804
1011
|
const value = !linkDef.multiplicity ? {
|
|
805
|
-
fetchOne: (options) =>
|
|
806
|
-
fetchOneWithErrors: (options) =>
|
|
1012
|
+
fetchOne: (options) => chunkBV6P25ZM_cjs.fetchSingle(client, linkTargetDef, options ?? {}, chunkBV6P25ZM_cjs.getWireObjectSet(objectSet)),
|
|
1013
|
+
fetchOneWithErrors: (options) => chunkBV6P25ZM_cjs.fetchSingleWithErrors(client, linkTargetDef, options ?? {}, chunkBV6P25ZM_cjs.getWireObjectSet(objectSet))
|
|
807
1014
|
} : objectSet;
|
|
808
1015
|
return [linkName, value];
|
|
809
1016
|
})));
|
|
@@ -811,7 +1018,7 @@ function get$linkForInterface(holder) {
|
|
|
811
1018
|
|
|
812
1019
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
813
1020
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
814
|
-
const [objApiNamespace] =
|
|
1021
|
+
const [objApiNamespace] = chunkBV6P25ZM_cjs.extractNamespace(interfaceDef.apiName);
|
|
815
1022
|
return Object.freeze(Object.defineProperties({}, {
|
|
816
1023
|
// first to minimize hidden classes
|
|
817
1024
|
[UnderlyingOsdkObject]: {
|
|
@@ -874,7 +1081,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
874
1081
|
},
|
|
875
1082
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
876
1083
|
const objDef = underlying[ObjectDefRef];
|
|
877
|
-
const [apiNamespace, apiName] =
|
|
1084
|
+
const [apiNamespace, apiName] = chunkBV6P25ZM_cjs.extractNamespace(p);
|
|
878
1085
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
879
1086
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
880
1087
|
enumerable: targetPropName in underlying,
|
|
@@ -914,7 +1121,7 @@ function remapPropertySecuritiesForInterface(underlyingSecurities, objDef, inter
|
|
|
914
1121
|
}
|
|
915
1122
|
const interfacePropName = inverseMap[objPropName];
|
|
916
1123
|
if (interfacePropName == null) continue;
|
|
917
|
-
const [apiNamespace, apiName] =
|
|
1124
|
+
const [apiNamespace, apiName] = chunkBV6P25ZM_cjs.extractNamespace(interfacePropName);
|
|
918
1125
|
const key = apiNamespace === objApiNamespace ? apiName : interfacePropName;
|
|
919
1126
|
remapped[key] = underlyingSecurities[objPropName];
|
|
920
1127
|
}
|
|
@@ -995,7 +1202,7 @@ var basePropDefs = {
|
|
|
995
1202
|
"$objectSpecifier": {
|
|
996
1203
|
get() {
|
|
997
1204
|
const rawObj = this[UnderlyingOsdkObject];
|
|
998
|
-
return
|
|
1205
|
+
return chunkNFD4IH4H_cjs.createObjectSpecifierFromPrimaryKey(this[ObjectDefRef], rawObj.$primaryKey);
|
|
999
1206
|
},
|
|
1000
1207
|
enumerable: true
|
|
1001
1208
|
},
|
|
@@ -1067,9 +1274,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1067
1274
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1068
1275
|
case "attachment":
|
|
1069
1276
|
if (Array.isArray(rawValue)) {
|
|
1070
|
-
return rawValue.map((a) =>
|
|
1277
|
+
return rawValue.map((a) => chunkBV6P25ZM_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1071
1278
|
} else {
|
|
1072
|
-
return
|
|
1279
|
+
return chunkBV6P25ZM_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1073
1280
|
}
|
|
1074
1281
|
default:
|
|
1075
1282
|
process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant2__default.default(false) ;
|
|
@@ -1085,9 +1292,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1085
1292
|
}
|
|
1086
1293
|
if (propDef.type === "attachment") {
|
|
1087
1294
|
if (Array.isArray(rawValue)) {
|
|
1088
|
-
return rawValue.map((a) =>
|
|
1295
|
+
return rawValue.map((a) => chunkBV6P25ZM_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1089
1296
|
}
|
|
1090
|
-
return
|
|
1297
|
+
return chunkBV6P25ZM_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1091
1298
|
}
|
|
1092
1299
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1093
1300
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1329,12 +1536,6 @@ function deepFreeze(obj) {
|
|
|
1329
1536
|
return Object.freeze(obj);
|
|
1330
1537
|
}
|
|
1331
1538
|
|
|
1332
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.57.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js
|
|
1333
|
-
var _get = [0, "/v2/ontologies/{0}/actionTypes/{1}", 2];
|
|
1334
|
-
function get($ctx, ...args) {
|
|
1335
|
-
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _get, ...args);
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
1539
|
// src/ontology/loadActionMetadata.ts
|
|
1339
1540
|
async function loadActionMetadata(client, actionType) {
|
|
1340
1541
|
const r = await get(client, await client.ontologyRid, actionType, {
|
|
@@ -1346,12 +1547,6 @@ async function loadActionMetadata(client, actionType) {
|
|
|
1346
1547
|
return wireActionTypeV2ToSdkActionMetadata(r);
|
|
1347
1548
|
}
|
|
1348
1549
|
|
|
1349
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.57.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js
|
|
1350
|
-
var _getFullMetadata = [0, "/v2/ontologies/{0}/objectTypes/{1}/fullMetadata", 2];
|
|
1351
|
-
function getFullMetadata($ctx, ...args) {
|
|
1352
|
-
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _getFullMetadata, ...args);
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
1550
|
// src/ontology/loadFullObjectMetadata.ts
|
|
1356
1551
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1357
1552
|
const full = await getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
@@ -1367,12 +1562,6 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1367
1562
|
};
|
|
1368
1563
|
}
|
|
1369
1564
|
|
|
1370
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.57.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyInterface.js
|
|
1371
|
-
var _get2 = [0, "/v2/ontologies/{0}/interfaceTypes/{1}", 2];
|
|
1372
|
-
function get2($ctx, ...args) {
|
|
1373
|
-
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _get2, ...args);
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1376
1565
|
// src/ontology/loadInterfaceMetadata.ts
|
|
1377
1566
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1378
1567
|
const r = await get2(client, await client.ontologyRid, objectType, {
|
|
@@ -1385,12 +1574,6 @@ async function loadInterfaceMetadata(client, objectType) {
|
|
|
1385
1574
|
return wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1386
1575
|
}
|
|
1387
1576
|
|
|
1388
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.57.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js
|
|
1389
|
-
var _get3 = [0, "/v2/ontologies/{0}/queryTypes/{1}", 2];
|
|
1390
|
-
function get3($ctx, ...args) {
|
|
1391
|
-
return chunkD26YLHTV_cjs.foundryPlatformFetch($ctx, _get3, ...args);
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
1577
|
// src/ontology/loadQueryMetadata.ts
|
|
1395
1578
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1396
1579
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
@@ -1454,11 +1637,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1454
1637
|
};
|
|
1455
1638
|
|
|
1456
1639
|
// src/util/UserAgent.ts
|
|
1457
|
-
var USER_AGENT = `osdk-client/${"2.23.
|
|
1458
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.23.
|
|
1640
|
+
var USER_AGENT = `osdk-client/${"2.23.1-beta.2"}`;
|
|
1641
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.23.1-beta.2"}`;
|
|
1459
1642
|
|
|
1460
1643
|
// src/createMinimalClient.ts
|
|
1461
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1644
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkBV6P25ZM_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1462
1645
|
if (process.env.NODE_ENV !== "production") {
|
|
1463
1646
|
try {
|
|
1464
1647
|
new URL(baseUrl);
|
|
@@ -1467,6 +1650,15 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
|
|
|
1467
1650
|
throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);
|
|
1468
1651
|
}
|
|
1469
1652
|
}
|
|
1653
|
+
const originalFetchFn = fetchFn;
|
|
1654
|
+
fetchFn = async (input, init) => {
|
|
1655
|
+
const url = new URL(typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url);
|
|
1656
|
+
if (/\/scenarios(\/|$)/.test(url.pathname) && !url.searchParams.has("preview")) {
|
|
1657
|
+
url.searchParams.set("preview", "true");
|
|
1658
|
+
return originalFetchFn(url, init);
|
|
1659
|
+
}
|
|
1660
|
+
return originalFetchFn(input, init);
|
|
1661
|
+
};
|
|
1470
1662
|
const minimalClient = {
|
|
1471
1663
|
...shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, USER_AGENT, fetchFn, options.headers),
|
|
1472
1664
|
objectSetFactory,
|
|
@@ -1474,6 +1666,7 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
|
|
|
1474
1666
|
ontologyRid: metadata.ontologyRid,
|
|
1475
1667
|
logger: options.logger,
|
|
1476
1668
|
transactionId: options.transactionId,
|
|
1669
|
+
scenarioRid: options.scenarioRid,
|
|
1477
1670
|
clientCacheKey: {},
|
|
1478
1671
|
requestContext: {},
|
|
1479
1672
|
branch: options.branch,
|
|
@@ -2048,10 +2241,10 @@ var ActionInvoker = class {
|
|
|
2048
2241
|
};
|
|
2049
2242
|
var QueryInvoker = class {
|
|
2050
2243
|
constructor(clientCtx, queryDef) {
|
|
2051
|
-
this.executeFunction =
|
|
2244
|
+
this.executeFunction = chunkNFD4IH4H_cjs.applyQuery.bind(void 0, clientCtx, queryDef);
|
|
2052
2245
|
}
|
|
2053
2246
|
};
|
|
2054
|
-
function createClientInternal(objectSetFactory, transactionRid, flushEdits, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
2247
|
+
function createClientInternal(objectSetFactory, transactionRid, flushEdits, scenarioRid, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
2055
2248
|
if (typeof ontologyRid === "string") {
|
|
2056
2249
|
if (!ontologyRid.startsWith("ri.")) {
|
|
2057
2250
|
throw new Error("Invalid ontology RID");
|
|
@@ -2070,6 +2263,7 @@ function createClientInternal(objectSetFactory, transactionRid, flushEdits, base
|
|
|
2070
2263
|
logger: options?.logger ?? new chunkTQUNF2DZ_cjs.MinimalLogger(),
|
|
2071
2264
|
transactionId: transactionRid,
|
|
2072
2265
|
flushEdits,
|
|
2266
|
+
scenarioRid,
|
|
2073
2267
|
branch: options?.UNSTABLE_DO_NOT_USE_BRANCH
|
|
2074
2268
|
}, fetchFn, objectSetFactory);
|
|
2075
2269
|
return createClientFromContext(clientCtx);
|
|
@@ -2089,7 +2283,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2089
2283
|
async *executeStreamingFunction(query, params) {
|
|
2090
2284
|
const {
|
|
2091
2285
|
applyStreamingQuery
|
|
2092
|
-
} = await import('./applyStreamingQuery-
|
|
2286
|
+
} = await import('./applyStreamingQuery-G2PA2SM7.cjs');
|
|
2093
2287
|
yield* applyStreamingQuery(clientCtx, query, params);
|
|
2094
2288
|
}
|
|
2095
2289
|
};
|
|
@@ -2105,7 +2299,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2105
2299
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
2106
2300
|
return {
|
|
2107
2301
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
2108
|
-
return await
|
|
2302
|
+
return await chunkBV6P25ZM_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
2109
2303
|
}
|
|
2110
2304
|
};
|
|
2111
2305
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -2119,7 +2313,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2119
2313
|
} = args;
|
|
2120
2314
|
const {
|
|
2121
2315
|
upload: upload2
|
|
2122
|
-
} = await import('./MediaReferenceProperty-
|
|
2316
|
+
} = await import('./MediaReferenceProperty-CBPMMD73.cjs');
|
|
2123
2317
|
return await upload2(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
2124
2318
|
mediaItemPath: fileName,
|
|
2125
2319
|
preview: true
|
|
@@ -2129,10 +2323,10 @@ function createClientFromContext(clientCtx) {
|
|
|
2129
2323
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
2130
2324
|
return {
|
|
2131
2325
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
2132
|
-
return await
|
|
2326
|
+
return await chunkBV6P25ZM_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
2133
2327
|
},
|
|
2134
2328
|
fetchPageByRidNoType: async (rids, options) => {
|
|
2135
|
-
return await
|
|
2329
|
+
return await chunkBV6P25ZM_cjs.fetchStaticRidPage(clientCtx, rids, options ?? {});
|
|
2136
2330
|
}
|
|
2137
2331
|
};
|
|
2138
2332
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__subscribeToNoTypeObjectSet.name:
|
|
@@ -2152,7 +2346,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2152
2346
|
transformAndWait: async (args) => {
|
|
2153
2347
|
const {
|
|
2154
2348
|
transformAndWaitInternal
|
|
2155
|
-
} = await import('./transformAndWaitInternal-
|
|
2349
|
+
} = await import('./transformAndWaitInternal-2GORZXPK.cjs');
|
|
2156
2350
|
const {
|
|
2157
2351
|
mediaSetRid,
|
|
2158
2352
|
mediaItemRid,
|
|
@@ -2176,7 +2370,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2176
2370
|
[symbolClientContext2]: {
|
|
2177
2371
|
value: clientCtx
|
|
2178
2372
|
},
|
|
2179
|
-
[
|
|
2373
|
+
[chunkBV6P25ZM_cjs.additionalContext]: {
|
|
2180
2374
|
value: clientCtx
|
|
2181
2375
|
},
|
|
2182
2376
|
fetchMetadata: {
|
|
@@ -2185,8 +2379,9 @@ function createClientFromContext(clientCtx) {
|
|
|
2185
2379
|
});
|
|
2186
2380
|
return client;
|
|
2187
2381
|
}
|
|
2188
|
-
var createClient = createClientInternal.bind(void 0,
|
|
2189
|
-
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(
|
|
2382
|
+
var createClient = createClientInternal.bind(void 0, chunkBV6P25ZM_cjs.createObjectSet, void 0, void 0, void 0);
|
|
2383
|
+
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(chunkBV6P25ZM_cjs.createObjectSet, transactionRid, flushEdits, void 0, ...args);
|
|
2384
|
+
var createClientWithScenario = (scenarioRid, ...args) => createClientInternal(chunkBV6P25ZM_cjs.createObjectSet, void 0, void 0, scenarioRid, ...args);
|
|
2190
2385
|
function createWithRid(rids) {
|
|
2191
2386
|
const withRid = {
|
|
2192
2387
|
type: "static",
|
|
@@ -2199,11 +2394,13 @@ exports.ActionValidationError = ActionValidationError;
|
|
|
2199
2394
|
exports.ClientRef = ClientRef;
|
|
2200
2395
|
exports.OBSERVABLE_USER_AGENT = OBSERVABLE_USER_AGENT;
|
|
2201
2396
|
exports.ObjectDefRef = ObjectDefRef;
|
|
2397
|
+
exports.OntologyScenario_exports = OntologyScenario_exports;
|
|
2202
2398
|
exports.USER_AGENT = USER_AGENT;
|
|
2203
2399
|
exports.UnderlyingOsdkObject = UnderlyingOsdkObject;
|
|
2400
|
+
exports.buildScenarioClient = buildScenarioClient;
|
|
2204
2401
|
exports.createClient = createClient;
|
|
2205
2402
|
exports.createClientFromContext = createClientFromContext;
|
|
2206
2403
|
exports.createClientWithTransaction = createClientWithTransaction;
|
|
2207
2404
|
exports.createOsdkObject = createOsdkObject;
|
|
2208
|
-
//# sourceMappingURL=chunk-
|
|
2209
|
-
//# sourceMappingURL=chunk-
|
|
2405
|
+
//# sourceMappingURL=chunk-WBINM4RT.cjs.map
|
|
2406
|
+
//# sourceMappingURL=chunk-WBINM4RT.cjs.map
|