@osdk/client 2.2.0-beta.11 → 2.2.0-beta.13
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 +29 -0
- package/build/browser/actions/actions.test.js +1 -1
- package/build/browser/actions/actions.test.js.map +1 -1
- package/build/browser/index.js +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/logger/TestLogger.js +59 -0
- package/build/browser/logger/TestLogger.js.map +1 -0
- package/build/browser/object/attachment.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +44 -33
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js +4 -9
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +29 -25
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/fetchPage.js +4 -3
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/object.test.js +17 -1
- package/build/browser/object/object.test.js.map +1 -1
- package/build/browser/object/timeseries.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +98 -1
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +2 -2
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +2 -3
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +1 -0
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/internal/ActionApplication.js +4 -4
- package/build/browser/observable/internal/ActionApplication.js.map +1 -1
- package/build/browser/observable/internal/ObjectQuery.js +1 -1
- package/build/browser/observable/internal/ObjectQuery.js.map +1 -1
- package/build/browser/observable/internal/OptimisticJob.js +1 -1
- package/build/browser/observable/internal/OptimisticJob.js.map +1 -1
- package/build/browser/observable/internal/Store.js +2 -2
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/Store.test.js +173 -216
- package/build/browser/observable/internal/Store.test.js.map +1 -1
- package/build/browser/public/unstable-do-not-use.js +1 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/public-utils/osdkConfig.js +49 -0
- package/build/browser/public-utils/osdkConfig.js.map +1 -0
- package/build/browser/{object/createObjectSpecifierFromPrimaryKey.js → public-utils/vite-env.d.ts} +2 -3
- package/build/browser/queries/applyQuery.js +3 -3
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/extractRdpDefinition.js +87 -0
- package/build/browser/util/extractRdpDefinition.js.map +1 -0
- package/build/browser/util/extractRdpDefinition.test.js +144 -0
- package/build/browser/util/extractRdpDefinition.test.js.map +1 -0
- package/build/browser/util/objectSpecifierUtils.js +48 -0
- package/build/browser/util/objectSpecifierUtils.js.map +1 -0
- package/build/browser/util/objectSpecifierUtils.test.js +42 -0
- package/build/browser/util/objectSpecifierUtils.test.js.map +1 -0
- package/build/browser/util/toDataValueQueries.js +2 -4
- package/build/browser/util/toDataValueQueries.js.map +1 -1
- package/build/cjs/{chunk-EY52J5Z4.cjs → chunk-USHAX4EP.cjs} +89 -17
- package/build/cjs/chunk-USHAX4EP.cjs.map +1 -0
- package/build/cjs/{chunk-MCQVHD2F.cjs → chunk-VT3UM6EP.cjs} +17 -16
- package/build/cjs/chunk-VT3UM6EP.cjs.map +1 -0
- package/build/cjs/index.cjs +104 -95
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +11 -3
- package/build/cjs/public/internal.cjs +6 -7
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.cjs +103 -66
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +10 -1
- package/build/esm/actions/actions.test.js +1 -1
- package/build/esm/actions/actions.test.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/logger/TestLogger.js +59 -0
- package/build/esm/logger/TestLogger.js.map +1 -0
- package/build/esm/object/attachment.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +44 -33
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js +4 -9
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +29 -25
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/fetchPage.js +4 -3
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/object.test.js +17 -1
- package/build/esm/object/object.test.js.map +1 -1
- package/build/esm/object/timeseries.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +98 -1
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +2 -2
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +2 -3
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +1 -0
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/internal/ActionApplication.js +4 -4
- package/build/esm/observable/internal/ActionApplication.js.map +1 -1
- package/build/esm/observable/internal/ObjectQuery.js +1 -1
- package/build/esm/observable/internal/ObjectQuery.js.map +1 -1
- package/build/esm/observable/internal/OptimisticJob.js +1 -1
- package/build/esm/observable/internal/OptimisticJob.js.map +1 -1
- package/build/esm/observable/internal/Store.js +2 -2
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/Store.test.js +173 -216
- package/build/esm/observable/internal/Store.test.js.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +1 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/public-utils/osdkConfig.js +49 -0
- package/build/esm/public-utils/osdkConfig.js.map +1 -0
- package/build/esm/{object/createObjectSpecifierFromPrimaryKey.js → public-utils/vite-env.d.ts} +2 -3
- package/build/esm/queries/applyQuery.js +3 -3
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/extractRdpDefinition.js +87 -0
- package/build/esm/util/extractRdpDefinition.js.map +1 -0
- package/build/esm/util/extractRdpDefinition.test.js +144 -0
- package/build/esm/util/extractRdpDefinition.test.js.map +1 -0
- package/build/esm/util/objectSpecifierUtils.js +48 -0
- package/build/esm/util/objectSpecifierUtils.js.map +1 -0
- package/build/esm/util/objectSpecifierUtils.test.js +42 -0
- package/build/esm/util/objectSpecifierUtils.test.js.map +1 -0
- package/build/esm/util/toDataValueQueries.js +2 -4
- package/build/esm/util/toDataValueQueries.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/logger/TestLogger.d.ts +14 -0
- package/build/types/logger/TestLogger.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects.d.ts +4 -4
- package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -1
- package/build/types/object/fetchPage.d.ts.map +1 -1
- package/build/types/object/object.test.d.ts.map +1 -1
- package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
- package/build/types/observable/internal/ActionApplication.d.ts +2 -2
- package/build/types/observable/internal/ActionApplication.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 -2
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/public/unstable-do-not-use.d.ts +2 -0
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/build/types/public-utils/osdkConfig.d.ts +8 -0
- package/build/types/public-utils/osdkConfig.d.ts.map +1 -0
- package/build/types/public-utils/vite-env.d.d.ts +3 -0
- package/build/types/public-utils/vite-env.d.d.ts.map +1 -0
- package/build/types/queries/applyQuery.d.ts +2 -2
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/build/types/util/extractRdpDefinition.d.ts +4 -0
- package/build/types/util/extractRdpDefinition.d.ts.map +1 -0
- package/build/types/util/extractRdpDefinition.test.d.ts +1 -0
- package/build/types/util/extractRdpDefinition.test.d.ts.map +1 -0
- package/build/types/util/objectSpecifierUtils.d.ts +24 -0
- package/build/types/util/objectSpecifierUtils.d.ts.map +1 -0
- package/build/types/util/objectSpecifierUtils.test.d.ts +1 -0
- package/build/types/util/objectSpecifierUtils.test.d.ts.map +1 -0
- package/package.json +11 -11
- package/build/browser/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
- package/build/cjs/chunk-EY52J5Z4.cjs.map +0 -1
- package/build/cjs/chunk-MCQVHD2F.cjs.map +0 -1
- package/build/cjs/chunk-Q7SFCCGT.cjs +0 -11
- package/build/cjs/chunk-Q7SFCCGT.cjs.map +0 -1
- package/build/cjs/graphql-RGM5SRWV.cjs +0 -10532
- package/build/cjs/graphql-RGM5SRWV.cjs.map +0 -1
- package/build/esm/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
- package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts +0 -2
- package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts.map +0 -1
package/build/cjs/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionValidationResponse, AttachmentUpload,
|
|
1
|
+
import { ActionValidationResponse, AttachmentUpload, ObjectTypeDefinition, PrimaryKeyType, ObjectSpecifier } from '@osdk/api';
|
|
2
2
|
export { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, InterfaceDefinition, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Result, SingleLinkAccessor, VersionBound, WhereClause, isOk } from '@osdk/api';
|
|
3
3
|
export { PalantirApiError } from '@osdk/shared.net.errors';
|
|
4
4
|
import { C as Client } from './Client-DBTcM9gB.cjs';
|
|
@@ -51,8 +51,6 @@ declare function createPlatformClient(baseUrl: string, tokenProvider: () => Prom
|
|
|
51
51
|
|
|
52
52
|
declare function createAttachmentUpload(data: Blob, name: string): AttachmentUpload;
|
|
53
53
|
|
|
54
|
-
declare function createObjectSpecifierFromPrimaryKey<Q extends ObjectOrInterfaceDefinition>(def: Q, primaryKey: PrimaryKeyType<Q>): ObjectSpecifier<Q>;
|
|
55
|
-
|
|
56
54
|
type ResultOrError<T extends object> = ({
|
|
57
55
|
type: "ok";
|
|
58
56
|
err?: never;
|
|
@@ -62,6 +60,16 @@ type ResultOrError<T extends object> = ({
|
|
|
62
60
|
err?: unknown;
|
|
63
61
|
};
|
|
64
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,
|
|
65
|
+
* even when loading an interface object where primary key uniqueness is not guaranteed.
|
|
66
|
+
*
|
|
67
|
+
* @param objectDef - An Object Type Definition
|
|
68
|
+
* @param primaryKey - The value you want to use as the primary key
|
|
69
|
+
* @returns An Object Specifier
|
|
70
|
+
*/
|
|
71
|
+
declare function createObjectSpecifierFromPrimaryKey<Q extends ObjectTypeDefinition>(objectDef: Q, primaryKey: PrimaryKeyType<Q>): ObjectSpecifier<Q>;
|
|
72
|
+
|
|
65
73
|
/**
|
|
66
74
|
* Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.
|
|
67
75
|
*
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-Q7SFCCGT.cjs');
|
|
3
|
+
var chunkVT3UM6EP_cjs = require('../chunk-VT3UM6EP.cjs');
|
|
4
|
+
var chunkUSHAX4EP_cjs = require('../chunk-USHAX4EP.cjs');
|
|
6
5
|
|
|
7
6
|
// src/public-utils/createAndFetchTempObjectSetRid.ts
|
|
8
7
|
async function createAndFetchTempObjectSetRid(client, objectSet) {
|
|
9
|
-
const response = await
|
|
10
|
-
objectSet:
|
|
8
|
+
const response = await chunkUSHAX4EP_cjs.OntologyObjectSet_exports.createTemporary(client, await client[chunkUSHAX4EP_cjs.additionalContext].ontologyRid, {
|
|
9
|
+
objectSet: chunkVT3UM6EP_cjs.getWireObjectSet(objectSet)
|
|
11
10
|
});
|
|
12
11
|
return response.objectSetRid;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
// src/public-utils/hydrateObjectSetFromRid.ts
|
|
16
15
|
function hydrateObjectSetFromRid(client, definition, rid) {
|
|
17
|
-
return
|
|
16
|
+
return chunkVT3UM6EP_cjs.createObjectSet(definition, client[chunkUSHAX4EP_cjs.additionalContext], {
|
|
18
17
|
type: "intersect",
|
|
19
18
|
objectSets: [{
|
|
20
19
|
type: "base",
|
|
@@ -28,7 +27,7 @@ function hydrateObjectSetFromRid(client, definition, rid) {
|
|
|
28
27
|
|
|
29
28
|
Object.defineProperty(exports, "hydrateAttachmentFromRid", {
|
|
30
29
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkVT3UM6EP_cjs.hydrateAttachmentFromRid; }
|
|
32
31
|
});
|
|
33
32
|
exports.createAndFetchTempObjectSetRid = createAndFetchTempObjectSetRid;
|
|
34
33
|
exports.hydrateObjectSetFromRid = hydrateObjectSetFromRid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/public-utils/createAndFetchTempObjectSetRid.ts","../../../src/public-utils/hydrateObjectSetFromRid.ts"],"names":["OntologyObjectSet_exports","additionalContext","getWireObjectSet","createObjectSet"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/public-utils/createAndFetchTempObjectSetRid.ts","../../../src/public-utils/hydrateObjectSetFromRid.ts"],"names":["OntologyObjectSet_exports","additionalContext","getWireObjectSet","createObjectSet"],"mappings":";;;;;;AA2BA,eAAsB,8BAAA,CAA+B,QAAQ,SAAW,EAAA;AACtE,EAAM,MAAA,QAAA,GAAW,MAAMA,2CAAmB,CAAA,eAAA,CAAgB,QAAQ,MAAM,MAAA,CAAOC,mCAAiB,CAAA,CAAE,WAAa,EAAA;AAAA,IAC7G,SAAA,EAAWC,mCAAiB,SAAS;AAAA,GACtC,CAAA;AACD,EAAA,OAAO,QAAS,CAAA,YAAA;AAClB;;;ACNO,SAAS,uBAAA,CAAwB,MAAQ,EAAA,UAAA,EAAY,GAAK,EAAA;AAC/D,EAAA,OAAOC,iCAAgB,CAAA,UAAA,EAAY,MAAO,CAAAF,mCAAiB,CAAG,EAAA;AAAA,IAC5D,IAAM,EAAA,WAAA;AAAA,IACN,YAAY,CAAC;AAAA,MACX,IAAM,EAAA,MAAA;AAAA,MACN,YAAY,UAAW,CAAA;AAAA,KACtB,EAAA;AAAA,MACD,IAAM,EAAA,WAAA;AAAA,MACN,SAAW,EAAA;AAAA,KACZ;AAAA,GACF,CAAA;AACH","file":"internal.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OntologyObjectSets } from \"@osdk/foundry.ontologies\";\nimport { additionalContext } from \"../Client.js\";\nimport { getWireObjectSet } from \"../objectSet/createObjectSet.js\";\n\n/**\n * Fetches a temporary object set RID from the Foundry stack for the given object set.\n *\n * @param client - An OSDK client.\n * @param objectSet - The object set to fetch a RID for.\n * @returns A promise that resolves to the RID of the temporary object set.\n */\nexport async function createAndFetchTempObjectSetRid(client, objectSet) {\n const response = await OntologyObjectSets.createTemporary(client, await client[additionalContext].ontologyRid, {\n objectSet: getWireObjectSet(objectSet)\n });\n return response.objectSetRid;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { additionalContext } from \"../Client.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\n\n/**\n * Creates an OSDK object set from an object set RID.\n * @param client - An OSDK client.\n * @param definition - An OSDK object or interface definition.\n * @param rid - The RID of an object set.\n * @returns An OSDK object set.\n */\nexport function hydrateObjectSetFromRid(client, definition, rid) {\n return createObjectSet(definition, client[additionalContext], {\n type: \"intersect\",\n objectSets: [{\n type: \"base\",\n objectType: definition.apiName\n }, {\n type: \"reference\",\n reference: rid\n }]\n });\n}"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkT4NIFYZS_cjs = require('../chunk-T4NIFYZS.cjs');
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-Q7SFCCGT.cjs');
|
|
4
|
+
var chunkUSHAX4EP_cjs = require('../chunk-USHAX4EP.cjs');
|
|
6
5
|
var rxjs = require('rxjs');
|
|
7
6
|
var invariant2 = require('tiny-invariant');
|
|
8
7
|
var mnemonist = require('mnemonist');
|
|
@@ -33,58 +32,60 @@ var ObservableClientImpl = class {
|
|
|
33
32
|
process.env.NODE_ENV !== "production" && false;
|
|
34
33
|
var DEBUG_CACHE_KEYS = process.env.NODE_ENV !== "production" && false;
|
|
35
34
|
|
|
36
|
-
// ../../node_modules/.pnpm/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
switch (durationOrMode) {
|
|
66
|
-
case "infinite": {
|
|
67
|
-
delayTime = SET_TIMEOUT_MAX_ALLOWED_INT;
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
case "real": {
|
|
71
|
-
delayTime = getRealisticResponseTime();
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
default: {
|
|
75
|
-
throw new Error(`Failed to delay a response: unknown delay mode "${durationOrMode}". Please make sure you provide one of the supported modes ("real", "infinite") or a number.`);
|
|
35
|
+
// ../../node_modules/.pnpm/delay@6.0.0/node_modules/delay/index.js
|
|
36
|
+
var createAbortError = () => {
|
|
37
|
+
const error = new Error("Delay aborted");
|
|
38
|
+
error.name = "AbortError";
|
|
39
|
+
return error;
|
|
40
|
+
};
|
|
41
|
+
var clearMethods = /* @__PURE__ */ new WeakMap();
|
|
42
|
+
function createDelay({
|
|
43
|
+
clearTimeout: defaultClear,
|
|
44
|
+
setTimeout: defaultSet
|
|
45
|
+
} = {}) {
|
|
46
|
+
return (milliseconds, {
|
|
47
|
+
value,
|
|
48
|
+
signal
|
|
49
|
+
} = {}) => {
|
|
50
|
+
if (signal?.aborted) {
|
|
51
|
+
return Promise.reject(createAbortError());
|
|
52
|
+
}
|
|
53
|
+
let timeoutId;
|
|
54
|
+
let settle;
|
|
55
|
+
let rejectFunction;
|
|
56
|
+
const clear = defaultClear ?? clearTimeout;
|
|
57
|
+
const signalListener = () => {
|
|
58
|
+
clear(timeoutId);
|
|
59
|
+
rejectFunction(createAbortError());
|
|
60
|
+
};
|
|
61
|
+
const cleanup = () => {
|
|
62
|
+
if (signal) {
|
|
63
|
+
signal.removeEventListener("abort", signalListener);
|
|
76
64
|
}
|
|
65
|
+
};
|
|
66
|
+
const delayPromise = new Promise((resolve, reject) => {
|
|
67
|
+
settle = () => {
|
|
68
|
+
cleanup();
|
|
69
|
+
resolve(value);
|
|
70
|
+
};
|
|
71
|
+
rejectFunction = reject;
|
|
72
|
+
timeoutId = (defaultSet ?? setTimeout)(settle, milliseconds);
|
|
73
|
+
});
|
|
74
|
+
if (signal) {
|
|
75
|
+
signal.addEventListener("abort", signalListener, {
|
|
76
|
+
once: true
|
|
77
|
+
});
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
return new Promise((resolve) => setTimeout(resolve, delayTime));
|
|
79
|
+
clearMethods.set(delayPromise, () => {
|
|
80
|
+
clear(timeoutId);
|
|
81
|
+
timeoutId = null;
|
|
82
|
+
settle();
|
|
83
|
+
});
|
|
84
|
+
return delayPromise;
|
|
85
|
+
};
|
|
87
86
|
}
|
|
87
|
+
var delay = createDelay();
|
|
88
|
+
var delay_default = delay;
|
|
88
89
|
|
|
89
90
|
// src/observable/internal/CacheKey.ts
|
|
90
91
|
function DEBUG_ONLY__cacheKeyToString(x) {
|
|
@@ -190,12 +191,12 @@ var OptimisticJob = class {
|
|
|
190
191
|
return this;
|
|
191
192
|
},
|
|
192
193
|
createObject(type, pk, properties) {
|
|
193
|
-
const create = store.client[
|
|
194
|
+
const create = store.client[chunkUSHAX4EP_cjs.additionalContext].objectFactory2(store.client[chunkUSHAX4EP_cjs.additionalContext], [{
|
|
194
195
|
$primaryKey: pk,
|
|
195
196
|
$apiName: type.apiName,
|
|
196
197
|
$objectType: type.apiName,
|
|
197
198
|
...properties
|
|
198
|
-
}], undefined).then((objs) => {
|
|
199
|
+
}], undefined, {}).then((objs) => {
|
|
199
200
|
return objs[0];
|
|
200
201
|
});
|
|
201
202
|
addedObjectPromises.push(create);
|
|
@@ -228,22 +229,22 @@ var ActionApplication = class {
|
|
|
228
229
|
constructor(store) {
|
|
229
230
|
this.store = store;
|
|
230
231
|
}
|
|
231
|
-
applyAction = (action, args, {
|
|
232
|
+
applyAction = async (action, args, {
|
|
232
233
|
optimisticUpdate
|
|
233
234
|
} = {}) => {
|
|
234
235
|
const logger = process.env.NODE_ENV !== "production" ? this.store.logger?.child({
|
|
235
236
|
methodName: "applyAction"
|
|
236
237
|
}) : this.store.logger;
|
|
237
238
|
const removeOptimisticResult = runOptimisticJob(this.store, optimisticUpdate);
|
|
238
|
-
return (async () => {
|
|
239
|
+
return await (async () => {
|
|
239
240
|
try {
|
|
240
241
|
const actionResults = await this.store.client(action).applyAction(args, {
|
|
241
242
|
$returnEdits: true
|
|
242
243
|
});
|
|
243
244
|
if (process.env.NODE_ENV !== "production") {
|
|
244
245
|
if (ACTION_DELAY > 0) {
|
|
245
|
-
logger?.debug("action done, pausing");
|
|
246
|
-
await
|
|
246
|
+
logger?.debug("action done, pausing", actionResults);
|
|
247
|
+
await delay_default(ACTION_DELAY);
|
|
247
248
|
logger?.debug("action done, pausing done");
|
|
248
249
|
}
|
|
249
250
|
}
|
|
@@ -595,7 +596,7 @@ var BulkObjectLoader = class {
|
|
|
595
596
|
#maxEntries;
|
|
596
597
|
constructor(client, maxWait = 25, maxEntries = 100) {
|
|
597
598
|
this.#client = client;
|
|
598
|
-
this.#logger = client[
|
|
599
|
+
this.#logger = client[chunkUSHAX4EP_cjs.additionalContext].logger;
|
|
599
600
|
this.#maxWait = maxWait;
|
|
600
601
|
this.#maxEntries = maxEntries;
|
|
601
602
|
}
|
|
@@ -665,7 +666,7 @@ var Query = class {
|
|
|
665
666
|
this.cacheKey = cacheKey;
|
|
666
667
|
this.store = store;
|
|
667
668
|
this.#subject = observable;
|
|
668
|
-
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[
|
|
669
|
+
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkUSHAX4EP_cjs.additionalContext].logger : store.client[chunkUSHAX4EP_cjs.additionalContext].logger?.child({}, {
|
|
669
670
|
msgPrefix: process.env.NODE_ENV !== "production" ? `Query<${cacheKey.type}, ${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>` : "Query"
|
|
670
671
|
}));
|
|
671
672
|
}
|
|
@@ -772,7 +773,7 @@ var ObjectQuery = class extends Query {
|
|
|
772
773
|
#apiName;
|
|
773
774
|
#pk;
|
|
774
775
|
constructor(store, subject, type, pk, cacheKey, opts) {
|
|
775
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
776
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkUSHAX4EP_cjs.additionalContext].logger?.child({}, {
|
|
776
777
|
msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
777
778
|
}) : undefined);
|
|
778
779
|
this.#apiName = type;
|
|
@@ -799,7 +800,7 @@ var ObjectQuery = class extends Query {
|
|
|
799
800
|
if (process.env.NODE_ENV !== "production") {
|
|
800
801
|
this.logger?.child({
|
|
801
802
|
methodName: "_fetchAndStore"
|
|
802
|
-
}).info("calling
|
|
803
|
+
}).info("calling _fetchAndStore");
|
|
803
804
|
}
|
|
804
805
|
const obj = await getBulkObjectLoader(this.store.client).fetch(this.#apiName, this.#pk);
|
|
805
806
|
this.store.batch({}, (batch) => {
|
|
@@ -933,7 +934,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
933
934
|
#objectSet;
|
|
934
935
|
#sortFns;
|
|
935
936
|
constructor(store, subject, apiType, apiName, whereClause, orderBy, cacheKey, opts) {
|
|
936
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
937
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkUSHAX4EP_cjs.additionalContext].logger?.child({}, {
|
|
937
938
|
msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
938
939
|
}) : undefined);
|
|
939
940
|
this.#type = apiType;
|
|
@@ -1562,7 +1563,7 @@ var Store = class {
|
|
|
1562
1563
|
#finalizationRegistry;
|
|
1563
1564
|
constructor(client) {
|
|
1564
1565
|
this.client = client;
|
|
1565
|
-
this.logger = client[
|
|
1566
|
+
this.logger = client[chunkUSHAX4EP_cjs.additionalContext].logger?.child({}, {
|
|
1566
1567
|
msgPrefix: "Store"
|
|
1567
1568
|
});
|
|
1568
1569
|
this.#topLayer = this.#truthLayer;
|
|
@@ -1597,8 +1598,8 @@ var Store = class {
|
|
|
1597
1598
|
this.#queries.get(key)?.dispose();
|
|
1598
1599
|
this.#queries.delete(key);
|
|
1599
1600
|
};
|
|
1600
|
-
applyAction = (action, args, opts) => {
|
|
1601
|
-
return new ActionApplication(this).applyAction(action, args, opts);
|
|
1601
|
+
applyAction = async (action, args, opts) => {
|
|
1602
|
+
return await new ActionApplication(this).applyAction(action, args, opts);
|
|
1602
1603
|
};
|
|
1603
1604
|
removeLayer(layerId) {
|
|
1604
1605
|
!(layerId != null) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "undefined is the reserved layerId for the truth layer") : invariant2__default.default(false) : undefined;
|
|
@@ -1856,10 +1857,46 @@ function createObservableClient(client) {
|
|
|
1856
1857
|
return new ObservableClientImpl(new Store(client));
|
|
1857
1858
|
}
|
|
1858
1859
|
|
|
1860
|
+
// src/public-utils/osdkConfig.ts
|
|
1861
|
+
function getMetaTagContent(name) {
|
|
1862
|
+
const element = document.querySelector(`meta[name="${name}"]`);
|
|
1863
|
+
const val = element ? element.getAttribute("content") : null;
|
|
1864
|
+
if (val == null) {
|
|
1865
|
+
throw new Error(`Missing meta tag: ${name}`);
|
|
1866
|
+
}
|
|
1867
|
+
return val;
|
|
1868
|
+
}
|
|
1869
|
+
function getViteEnvVar(name) {
|
|
1870
|
+
const val = undefined[name];
|
|
1871
|
+
if (val == null) {
|
|
1872
|
+
throw new Error(`Missing environment variable: ${name}`);
|
|
1873
|
+
}
|
|
1874
|
+
return val;
|
|
1875
|
+
}
|
|
1876
|
+
function isProduction() {
|
|
1877
|
+
return process.env.NODE_ENV === "production";
|
|
1878
|
+
}
|
|
1879
|
+
function getConfigValue(metaTagName, viteEnvVarName) {
|
|
1880
|
+
return isProduction() ? getMetaTagContent(metaTagName) : getViteEnvVar(viteEnvVarName);
|
|
1881
|
+
}
|
|
1882
|
+
function getOntologyRid(ontologyRid) {
|
|
1883
|
+
return isProduction() ? getMetaTagContent("osdk-ontologyRid") : ontologyRid;
|
|
1884
|
+
}
|
|
1885
|
+
function getOsdkConfig(ontologyRid) {
|
|
1886
|
+
return {
|
|
1887
|
+
clientId: getConfigValue("osdk-clientId", "VITE_FOUNDRY_CLIENT_ID"),
|
|
1888
|
+
redirectUrl: getConfigValue("osdk-redirectUrl", "VITE_FOUNDRY_REDIRECT_URL"),
|
|
1889
|
+
foundryUrl: getConfigValue("osdk-foundryUrl", "VITE_FOUNDRY_API_URL"),
|
|
1890
|
+
ontologyRid: getOntologyRid(ontologyRid)
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1859
1894
|
Object.defineProperty(exports, "augment", {
|
|
1860
1895
|
enumerable: true,
|
|
1861
|
-
get: function () { return
|
|
1896
|
+
get: function () { return chunkUSHAX4EP_cjs.augment; }
|
|
1862
1897
|
});
|
|
1863
1898
|
exports.createObservableClient = createObservableClient;
|
|
1899
|
+
exports.getMetaTagContent = getMetaTagContent;
|
|
1900
|
+
exports.getOsdkConfig = getOsdkConfig;
|
|
1864
1901
|
//# sourceMappingURL=unstable-do-not-use.cjs.map
|
|
1865
1902
|
//# sourceMappingURL=unstable-do-not-use.cjs.map
|