@osdk/client 2.87.0-main-1fd9dc45c62080a4e08f07409af63a8565eb85b4 → 2.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -7
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +21 -2
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{applyStreamingQuery-GG6YRECI.cjs → applyStreamingQuery-OFE276IY.cjs} +11 -11
- package/build/cjs/{applyStreamingQuery-GG6YRECI.cjs.map → applyStreamingQuery-OFE276IY.cjs.map} +1 -1
- package/build/cjs/{chunk-NJFXSQ4X.cjs → chunk-B4UCZI2Z.cjs} +13 -9
- package/build/cjs/chunk-B4UCZI2Z.cjs.map +1 -0
- package/build/cjs/{chunk-XCQOINFF.cjs → chunk-FRZNF77P.cjs} +38 -116
- package/build/cjs/chunk-FRZNF77P.cjs.map +1 -0
- package/build/cjs/{chunk-I536YZL7.cjs → chunk-HL7TDBEU.cjs} +5 -5
- package/build/cjs/{chunk-I536YZL7.cjs.map → chunk-HL7TDBEU.cjs.map} +1 -1
- package/build/cjs/{chunk-JVTQVCST.cjs → chunk-JPO5C5QG.cjs} +18 -18
- package/build/cjs/{chunk-JVTQVCST.cjs.map → chunk-JPO5C5QG.cjs.map} +1 -1
- package/build/cjs/{chunk-F7VOYQZZ.cjs → chunk-PPEWTL53.cjs} +83 -83
- package/build/cjs/{chunk-F7VOYQZZ.cjs.map → chunk-PPEWTL53.cjs.map} +1 -1
- package/build/cjs/{chunk-6NHMELIG.cjs → chunk-US5WI5KS.cjs} +8 -8
- package/build/cjs/{chunk-6NHMELIG.cjs.map → chunk-US5WI5KS.cjs.map} +1 -1
- package/build/cjs/{chunk-JILZ2BLD.cjs → chunk-VK37CUQE.cjs} +98 -98
- package/build/cjs/chunk-VK37CUQE.cjs.map +1 -0
- package/build/cjs/index.cjs +13 -13
- package/build/cjs/public/experimental.cjs +11 -11
- package/build/cjs/public/internal.cjs +11 -11
- package/build/cjs/public/observable.cjs +7 -7
- package/build/cjs/public/unstable-do-not-use.cjs +18 -18
- package/build/cjs/{transformAndWaitInternal-MXF3R6YX.cjs → transformAndWaitInternal-J3XOTTQ2.cjs} +6 -6
- package/build/cjs/{transformAndWaitInternal-MXF3R6YX.cjs.map → transformAndWaitInternal-J3XOTTQ2.cjs.map} +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +21 -2
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/package.json +14 -14
- package/build/cjs/chunk-JILZ2BLD.cjs.map +0 -1
- package/build/cjs/chunk-NJFXSQ4X.cjs.map +0 -1
- package/build/cjs/chunk-XCQOINFF.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkB4UCZI2Z_cjs = require('./chunk-B4UCZI2Z.cjs');
|
|
4
4
|
var shared_client_impl = require('@osdk/shared.client.impl');
|
|
5
5
|
var shared_net_fetch = require('@osdk/shared.net.fetch');
|
|
6
|
-
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
7
6
|
var invariant6 = require('tiny-invariant');
|
|
8
7
|
var api = require('@osdk/api');
|
|
8
|
+
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
@@ -20,123 +20,27 @@ var addUserAgentHeader = (client, withMetadata) => ({
|
|
|
20
20
|
return headers;
|
|
21
21
|
})
|
|
22
22
|
});
|
|
23
|
-
async function* sseStream(response) {
|
|
24
|
-
if (!response.body) {
|
|
25
|
-
throw new shared_net_errors.UnknownError("Expected a text/event-stream body, but the response had none", "UNKNOWN", void 0, response.status);
|
|
26
|
-
}
|
|
27
|
-
const stream = response.body.pipeThrough(new TextDecoderStream()).pipeThrough(new chunkNJFXSQ4X_cjs.EventSourceParserStream({
|
|
28
|
-
onError: "terminate"
|
|
29
|
-
}));
|
|
30
|
-
for await (const event of stream) {
|
|
31
|
-
if (event.data === "") continue;
|
|
32
|
-
let data;
|
|
33
|
-
try {
|
|
34
|
-
data = JSON.parse(event.data);
|
|
35
|
-
} catch (e) {
|
|
36
|
-
throw new shared_net_errors.UnknownError(`Unable to parse event data as JSON: ${truncate(event.data)}`, "UNKNOWN", e instanceof Error ? e : void 0, response.status);
|
|
37
|
-
}
|
|
38
|
-
if (isSseErrorEvent(data)) {
|
|
39
|
-
throw new shared_net_errors.PalantirApiError(data.errorDescription ?? data.errorName ?? "Streaming request failed", data.errorName, data.errorCode, data.errorDescription, response.status, data.errorInstanceId, data.parameters);
|
|
40
|
-
}
|
|
41
|
-
yield data;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function isSseErrorEvent(data) {
|
|
45
|
-
return typeof data === "object" && data != null && data.type === "error";
|
|
46
|
-
}
|
|
47
|
-
function truncate(data) {
|
|
48
|
-
return data.length > 512 ? `${data.slice(0, 512)}\u2026` : data;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// ../../node_modules/.pnpm/@osdk+shared.net.platformapi@1.9.0/node_modules/@osdk/shared.net.platformapi/build/esm/foundryPlatformFetch.js
|
|
52
|
-
async function foundryPlatformFetch(client, [httpMethodNum, origPath, flags, contentType, responseContentType], ...args) {
|
|
53
|
-
const path = origPath.replace(/\{([^}]+)\}/g, () => encodeURIComponent(args.shift()));
|
|
54
|
-
const body = flags & 1 ? args.shift() : void 0;
|
|
55
|
-
const queryArgs = flags & 2 ? args.shift() : void 0;
|
|
56
|
-
const headerArgs = flags & 4 ? args.shift() : void 0;
|
|
57
|
-
const method = ["GET", "POST", "PUT", "DELETE", "PATCH"][httpMethodNum];
|
|
58
|
-
return await apiFetch(client[chunkNJFXSQ4X_cjs.symbolClientContext2] ?? client[chunkNJFXSQ4X_cjs.symbolClientContext] ?? client, method, path, body, queryArgs, headerArgs, contentType, responseContentType);
|
|
59
|
-
}
|
|
60
|
-
async function apiFetch(clientCtx, method, endpointPath, data, queryArguments, headers, requestMediaType, responseMediaType) {
|
|
61
|
-
const url = parseUrl(clientCtx.baseUrl, endpointPath);
|
|
62
|
-
for (const [key, value] of Object.entries(queryArguments || {})) {
|
|
63
|
-
if (value == null) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (Array.isArray(value)) {
|
|
67
|
-
for (const item of value) {
|
|
68
|
-
url.searchParams.append(key, item);
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
url.searchParams.append(key, value);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const headersInit = new Headers();
|
|
75
|
-
const resolvedRequestMediaType = requestMediaType === "*/*" && data instanceof globalThis.Blob ? data.type || "application/octet-stream" : requestMediaType ?? "application/json";
|
|
76
|
-
headersInit.set("Content-Type", resolvedRequestMediaType);
|
|
77
|
-
headersInit.set("Accept", responseMediaType ?? "application/json");
|
|
78
|
-
Object.entries(headers || {}).forEach(([key, value]) => {
|
|
79
|
-
if (key === "Content-Type" && typeof value === "string") {
|
|
80
|
-
headersInit.set("Content-Type", value);
|
|
81
|
-
} else if (key === "Accept" && typeof value === "string") {
|
|
82
|
-
headersInit.set("Accept", value);
|
|
83
|
-
} else if (value != null) {
|
|
84
|
-
headersInit.append(key, value.toString());
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
const body = data == null || data instanceof globalThis.Blob ? data : JSON.stringify(data);
|
|
88
|
-
const response = await clientCtx.fetch(url.toString(), {
|
|
89
|
-
body,
|
|
90
|
-
method,
|
|
91
|
-
headers: headersInit
|
|
92
|
-
});
|
|
93
|
-
if (!response.ok) {
|
|
94
|
-
try {
|
|
95
|
-
const convertedError = await response.json();
|
|
96
|
-
return new shared_net_errors.PalantirApiError(convertedError.message, convertedError.errorName, convertedError.errorCode, convertedError.errorDescription, response.status, convertedError.errorInstanceId, convertedError.parameters);
|
|
97
|
-
} catch (e) {
|
|
98
|
-
if (e instanceof Error) {
|
|
99
|
-
return new shared_net_errors.UnknownError(e.message, "UNKNOWN");
|
|
100
|
-
}
|
|
101
|
-
return new shared_net_errors.UnknownError("Unable to parse error response", "UNKNOWN");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (response.status === 204) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
if (responseMediaType === "text/event-stream") {
|
|
108
|
-
return sseStream(response);
|
|
109
|
-
}
|
|
110
|
-
if (responseMediaType == null || responseMediaType === "application/json") {
|
|
111
|
-
return await response.json();
|
|
112
|
-
}
|
|
113
|
-
return response;
|
|
114
|
-
}
|
|
115
|
-
function parseUrl(baseUrl, endpointPath) {
|
|
116
|
-
baseUrl += baseUrl.endsWith("/") ? "" : "/";
|
|
117
|
-
return new URL(`api${endpointPath}`, baseUrl);
|
|
118
|
-
}
|
|
119
23
|
|
|
120
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
24
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.87.0/node_modules/@osdk/foundry.ontologies/build/esm/v2/public/OntologyObjectSet.js
|
|
121
25
|
var _createTemporary = [1, "/v2/ontologies/{0}/objectSets/createTemporary", 7];
|
|
122
26
|
function createTemporary($ctx, ...args) {
|
|
123
|
-
return foundryPlatformFetch($ctx, _createTemporary, ...args);
|
|
27
|
+
return chunkB4UCZI2Z_cjs.foundryPlatformFetch($ctx, _createTemporary, ...args);
|
|
124
28
|
}
|
|
125
29
|
var _load = [1, "/v2/ontologies/{0}/objectSets/loadObjects", 7];
|
|
126
30
|
function load($ctx, ...args) {
|
|
127
|
-
return foundryPlatformFetch($ctx, _load, ...args);
|
|
31
|
+
return chunkB4UCZI2Z_cjs.foundryPlatformFetch($ctx, _load, ...args);
|
|
128
32
|
}
|
|
129
33
|
var _loadMultipleObjectTypes = [1, "/v2/ontologies/{0}/objectSets/loadObjectsMultipleObjectTypes", 7];
|
|
130
34
|
function loadMultipleObjectTypes($ctx, ...args) {
|
|
131
|
-
return foundryPlatformFetch($ctx, _loadMultipleObjectTypes, ...args);
|
|
35
|
+
return chunkB4UCZI2Z_cjs.foundryPlatformFetch($ctx, _loadMultipleObjectTypes, ...args);
|
|
132
36
|
}
|
|
133
37
|
var _aggregate = [1, "/v2/ontologies/{0}/objectSets/aggregate", 7];
|
|
134
38
|
function aggregate($ctx, ...args) {
|
|
135
|
-
return foundryPlatformFetch($ctx, _aggregate, ...args);
|
|
39
|
+
return chunkB4UCZI2Z_cjs.foundryPlatformFetch($ctx, _aggregate, ...args);
|
|
136
40
|
}
|
|
137
41
|
var _loadLinks = [1, "/v2/ontologies/{0}/objectSets/loadLinks", 7];
|
|
138
42
|
function loadLinks($ctx, ...args) {
|
|
139
|
-
return foundryPlatformFetch($ctx, _loadLinks, ...args);
|
|
43
|
+
return chunkB4UCZI2Z_cjs.foundryPlatformFetch($ctx, _loadLinks, ...args);
|
|
140
44
|
}
|
|
141
45
|
|
|
142
46
|
// src/internal/conversions/extractNamespace.ts
|
|
@@ -1078,14 +982,33 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
|
|
|
1078
982
|
return makeGeoFilterIntersects(filter[firstKey], propertyIdentifier, field);
|
|
1079
983
|
}
|
|
1080
984
|
if (firstKey === "$containsAllTerms" || firstKey === "$containsAnyTerm") {
|
|
985
|
+
const searchOptions = filter[firstKey];
|
|
986
|
+
!(typeof searchOptions === "string" || !(searchOptions.fuzzySearch === true && searchOptions.phoneticSearch === true)) ? process.env.NODE_ENV !== "production" ? invariant6__default.default(false, "fuzzySearch and phoneticSearch cannot both be true.") : invariant6__default.default(false) : void 0;
|
|
1081
987
|
return {
|
|
1082
988
|
type: firstKey.substring(1),
|
|
1083
989
|
...propertyIdentifier != null && {
|
|
1084
990
|
propertyIdentifier
|
|
1085
991
|
},
|
|
1086
992
|
field,
|
|
1087
|
-
value: typeof
|
|
1088
|
-
fuzzy: typeof
|
|
993
|
+
value: typeof searchOptions === "string" ? searchOptions : searchOptions.term,
|
|
994
|
+
fuzzy: typeof searchOptions === "string" ? false : searchOptions.fuzzySearch ?? false,
|
|
995
|
+
...typeof searchOptions !== "string" && searchOptions.phoneticSearch === true && {
|
|
996
|
+
analyzerSelection: "PHONETIC_ANALYZER"
|
|
997
|
+
}
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
if (firstKey === "$startsWith" || firstKey === "$containsAllTermsInOrder") {
|
|
1001
|
+
const searchOptions = filter[firstKey];
|
|
1002
|
+
return {
|
|
1003
|
+
type: firstKey.substring(1),
|
|
1004
|
+
...propertyIdentifier != null && {
|
|
1005
|
+
propertyIdentifier
|
|
1006
|
+
},
|
|
1007
|
+
field,
|
|
1008
|
+
value: typeof searchOptions === "string" ? searchOptions : searchOptions.term,
|
|
1009
|
+
...typeof searchOptions !== "string" && searchOptions.phoneticSearch === true && {
|
|
1010
|
+
analyzerSelection: "PHONETIC_ANALYZER"
|
|
1011
|
+
}
|
|
1089
1012
|
};
|
|
1090
1013
|
}
|
|
1091
1014
|
if (firstKey === "$matchesRegex") {
|
|
@@ -1686,7 +1609,7 @@ function isTextQuery(query) {
|
|
|
1686
1609
|
return typeof query === "string";
|
|
1687
1610
|
}
|
|
1688
1611
|
|
|
1689
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
1612
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.87.0/node_modules/@osdk/foundry.ontologies/build/esm/v2/public/Attachment.js
|
|
1690
1613
|
var _upload = [1, "/v2/ontologies/attachments/upload", 7, "*/*"];
|
|
1691
1614
|
function upload($ctx, ...args) {
|
|
1692
1615
|
const headerParams = {
|
|
@@ -1694,15 +1617,15 @@ function upload($ctx, ...args) {
|
|
|
1694
1617
|
"Content-Type": args[2]?.["Content-Type"] ?? args[0].type,
|
|
1695
1618
|
"Content-Length": args[0].size.toString()
|
|
1696
1619
|
};
|
|
1697
|
-
return foundryPlatformFetch($ctx, _upload, args[0], args[1], headerParams);
|
|
1620
|
+
return chunkB4UCZI2Z_cjs.foundryPlatformFetch($ctx, _upload, args[0], args[1], headerParams);
|
|
1698
1621
|
}
|
|
1699
1622
|
var _read = [0, "/v2/ontologies/attachments/{0}/content", , , "*/*"];
|
|
1700
1623
|
function read($ctx, ...args) {
|
|
1701
|
-
return foundryPlatformFetch($ctx, _read, ...args);
|
|
1624
|
+
return chunkB4UCZI2Z_cjs.foundryPlatformFetch($ctx, _read, ...args);
|
|
1702
1625
|
}
|
|
1703
1626
|
var _get = [0, "/v2/ontologies/attachments/{0}"];
|
|
1704
1627
|
function get($ctx, ...args) {
|
|
1705
|
-
return foundryPlatformFetch($ctx, _get, ...args);
|
|
1628
|
+
return chunkB4UCZI2Z_cjs.foundryPlatformFetch($ctx, _get, ...args);
|
|
1706
1629
|
}
|
|
1707
1630
|
|
|
1708
1631
|
// src/Client.ts
|
|
@@ -1779,12 +1702,12 @@ function createMediaFromReferenceInternal(client, mediaReference) {
|
|
|
1779
1702
|
// TODO(oxc type-aware): the type-aware typescript/require-await rule does not flag this (it returns a Promise); remove this disable once type-aware linting is enabled.
|
|
1780
1703
|
// oxlint-disable-next-line require-await -- intentionally async: returns a Promise to satisfy its declared/contract type; no await needed
|
|
1781
1704
|
async fetchContents() {
|
|
1782
|
-
return
|
|
1705
|
+
return chunkB4UCZI2Z_cjs.MediaSet_exports.read(client, mediaSetRid, mediaItemRid, token ? {
|
|
1783
1706
|
ReadToken: token
|
|
1784
1707
|
} : void 0);
|
|
1785
1708
|
},
|
|
1786
1709
|
async fetchMetadata() {
|
|
1787
|
-
const info = await
|
|
1710
|
+
const info = await chunkB4UCZI2Z_cjs.MediaSet_exports.info(client, mediaSetRid, mediaItemRid, token ? {
|
|
1788
1711
|
ReadToken: token
|
|
1789
1712
|
} : void 0);
|
|
1790
1713
|
const sizeBytes = getMediaSizeBytes(info);
|
|
@@ -1796,7 +1719,7 @@ function createMediaFromReferenceInternal(client, mediaReference) {
|
|
|
1796
1719
|
};
|
|
1797
1720
|
},
|
|
1798
1721
|
async fetchFullMetadata() {
|
|
1799
|
-
const raw = await
|
|
1722
|
+
const raw = await chunkB4UCZI2Z_cjs.MediaSet_exports.metadata(client, mediaSetRid, mediaItemRid, token ? {
|
|
1800
1723
|
ReadToken: token
|
|
1801
1724
|
} : void 0);
|
|
1802
1725
|
return {
|
|
@@ -1824,7 +1747,6 @@ exports.fetchPage = fetchPage;
|
|
|
1824
1747
|
exports.fetchSingle = fetchSingle;
|
|
1825
1748
|
exports.fetchSingleWithErrors = fetchSingleWithErrors;
|
|
1826
1749
|
exports.fetchStaticRidPage = fetchStaticRidPage;
|
|
1827
|
-
exports.foundryPlatformFetch = foundryPlatformFetch;
|
|
1828
1750
|
exports.getWireObjectSet = getWireObjectSet;
|
|
1829
1751
|
exports.hasWithProperties = hasWithProperties;
|
|
1830
1752
|
exports.hydrateAttachmentFromRid = hydrateAttachmentFromRid;
|
|
@@ -1834,5 +1756,5 @@ exports.isWireObjectSet = isWireObjectSet;
|
|
|
1834
1756
|
exports.normalizeInterfaceLinkSearchArounds = normalizeInterfaceLinkSearchArounds;
|
|
1835
1757
|
exports.upload = upload;
|
|
1836
1758
|
exports.validateMediaItemMetadata = validateMediaItemMetadata;
|
|
1837
|
-
//# sourceMappingURL=chunk-
|
|
1838
|
-
//# sourceMappingURL=chunk-
|
|
1759
|
+
//# sourceMappingURL=chunk-FRZNF77P.cjs.map
|
|
1760
|
+
//# sourceMappingURL=chunk-FRZNF77P.cjs.map
|