@osdk/client 2.24.0-main-4e2a115a796e8664c3972548bb02e707baafa912 → 2.24.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 +8 -7
- package/build/browser/observable/internal/actions/ActionApplication.js +8 -4
- package/build/browser/observable/internal/actions/ActionApplication.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-6VP7QD7Y.cjs → chunk-SIXWQYN6.cjs} +4 -4
- package/build/cjs/chunk-SIXWQYN6.cjs.map +1 -0
- package/build/cjs/{chunk-ZUUX3CI6.cjs → chunk-ULY5PPR2.cjs} +26 -22
- package/build/cjs/chunk-ULY5PPR2.cjs.map +1 -0
- package/build/cjs/index.cjs +4 -4
- package/build/cjs/public/experimental.cjs +3 -3
- package/build/cjs/public/observable.cjs +3 -3
- package/build/cjs/public/unstable-do-not-use.cjs +4 -4
- package/build/esm/observable/internal/actions/ActionApplication.js +8 -4
- package/build/esm/observable/internal/actions/ActionApplication.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/observable/internal/actions/ActionApplication.d.ts.map +1 -1
- package/package.json +6 -6
- package/build/cjs/chunk-6VP7QD7Y.cjs.map +0 -1
- package/build/cjs/chunk-ZUUX3CI6.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
# @osdk/client
|
|
2
2
|
|
|
3
|
-
## 2.24.0
|
|
3
|
+
## 2.24.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- a492285: Add $title and $primaryKey special property filters to where clauses
|
|
8
|
+
- 60aff19: Bump `@osdk/foundry.*` and `@osdk/internal.foundry.*` catalog entries from `2.57.0` to `2.61.0`. Includes type-fixups for the new `applyScenario` / `scenarioReference` discriminated-union variants and the now-required `QueryParameterV2.required` field.
|
|
9
|
+
- 35ad6d1: Resolve action applications before broad cache invalidation refreshes complete.
|
|
10
|
+
- 6923158: Fix empty filter case
|
|
8
11
|
|
|
9
12
|
### Patch Changes
|
|
10
13
|
|
|
11
|
-
- 60aff19: Bump `@osdk/foundry.*` and `@osdk/internal.foundry.*` catalog entries from `2.57.0` to `2.61.0`. Includes type-fixups for the new `applyScenario` / `scenarioReference` discriminated-union variants and the now-required `QueryParameterV2.required` field.
|
|
12
|
-
- 6923158: Fix empty filter case
|
|
13
14
|
- Updated dependencies [a492285]
|
|
14
15
|
- Updated dependencies [60aff19]
|
|
15
|
-
- @osdk/api@2.24.0
|
|
16
|
-
- @osdk/generator-converters@2.24.0
|
|
17
|
-
- @osdk/shared.test@2.
|
|
18
|
-
- @osdk/client.unstable@2.24.0
|
|
16
|
+
- @osdk/api@2.24.0
|
|
17
|
+
- @osdk/generator-converters@2.24.0
|
|
18
|
+
- @osdk/shared.test@2.19.0
|
|
19
|
+
- @osdk/client.unstable@2.24.0
|
|
19
20
|
|
|
20
21
|
## 2.23.0
|
|
21
22
|
|
|
@@ -53,10 +53,14 @@ export class ActionApplication {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
await this.#invalidatePerObjectEdits(actionResults);
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
|
|
56
|
+
// Per-type invalidation can fan out into expensive list/object-set
|
|
57
|
+
// aggregation refetches. Start it after the precise per-object updates,
|
|
58
|
+
// but do not block the action result on those background refreshes.
|
|
59
|
+
void this.#invalidatePerTypeEdits(actionResults).catch(e => {
|
|
60
|
+
logger?.warn({
|
|
61
|
+
err: e
|
|
62
|
+
}, "Error while invalidating action edits by object type");
|
|
63
|
+
});
|
|
60
64
|
} finally {
|
|
61
65
|
if (process.env.NODE_ENV !== "production") {
|
|
62
66
|
logger?.debug("optimistic action complete; remove the results");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionApplication.js","names":["API_NAME_IDX","runOptimisticJob","ACTION_DELAY","process","env","NODE_ENV","ActionApplication","constructor","store","applyAction","action","args","optimisticUpdate","logger","child","methodName","removeOptimisticResult","actionResults","Array","isArray","debug","client","batchApplyAction","$returnEdits","Promise","resolve","setTimeout","invalidatePerObjectEdits","invalidatePerTypeEdits","actionEditResponse","type","deletedObjects","modifiedObjects","addedObjects","promisesToWait","list","obj","push","invalidateObject","objectType","primaryKey","batch","cacheKey","objectCacheKeyRegistry","getVariants","queries","peek","deleteFromStore","all","editedObjectTypeSet","Set","add","apiName","editedObjectTypes","size","isEditsBranch","promises","keys","query","otherKeys","invalidateObjectType","undefined","allSettled"],"sources":["ActionApplication.ts"],"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 type { ActionDefinition, ActionEditResponse } from \"@osdk/api\";\nimport type { ActionSignatureFromDef } from \"../../../actions/applyAction.js\";\nimport { API_NAME_IDX } from \"../list/ListCacheKey.js\";\nimport type { Store } from \"../Store.js\";\nimport { runOptimisticJob } from \"./OptimisticJob.js\";\n\nconst ACTION_DELAY = process.env.NODE_ENV === \"production\" ? 0 : 1000;\n\nexport class ActionApplication {\n constructor(private store: Store) {}\n\n applyAction: <Q extends ActionDefinition<any>>(\n action: Q,\n args:\n | Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]\n | Array<Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]>,\n opts?: Store.ApplyActionOptions,\n ) => Promise<ActionEditResponse> = async (\n action,\n args,\n { optimisticUpdate } = {},\n ) => {\n const logger = process.env.NODE_ENV !== \"production\"\n ? this.store.logger?.child({ methodName: \"applyAction\" })\n : this.store.logger;\n const removeOptimisticResult = runOptimisticJob(\n this.store,\n optimisticUpdate,\n );\n\n let actionResults: ActionEditResponse;\n try {\n if (Array.isArray(args)) {\n if (process.env.NODE_ENV !== \"production\") {\n logger?.debug(\"applying action to multiple args\", args);\n }\n\n actionResults = await this.store.client(action).batchApplyAction(\n args,\n { $returnEdits: true },\n );\n } else {\n // The types for client get confused when we dynamically applyAction so we\n // have to deal with the `any` here and force cast it to what it should be.\n // TODO: Update the types so this doesn't happen!\n actionResults = await this.store.client(action).applyAction(\n args as any,\n { $returnEdits: true },\n );\n\n if (process.env.NODE_ENV !== \"production\") {\n if (ACTION_DELAY > 0) {\n logger?.debug(\"action done, pausing\", actionResults);\n await new Promise<void>(resolve =>\n setTimeout(resolve, ACTION_DELAY)\n );\n logger?.debug(\"action done, pausing done\");\n }\n }\n }\n\n await this.#invalidatePerObjectEdits(actionResults);\n // Inside the try so refetches land in truth while the optimistic layer\n // is still on top; the removal below then drops to fresh truth in one\n // visible transition.\n await this.#invalidatePerTypeEdits(actionResults);\n } finally {\n if (process.env.NODE_ENV !== \"production\") {\n logger?.debug(\n \"optimistic action complete; remove the results\",\n );\n }\n // make sure this happens even if the action fails\n await removeOptimisticResult();\n }\n\n return actionResults;\n };\n\n #invalidatePerObjectEdits = async (\n actionEditResponse: ActionEditResponse | undefined,\n ): Promise<void> => {\n if (actionEditResponse == null || actionEditResponse.type !== \"edits\") {\n return;\n }\n const { deletedObjects, modifiedObjects, addedObjects } =\n actionEditResponse;\n\n const promisesToWait: Promise<unknown>[] = [];\n for (const list of [deletedObjects, modifiedObjects, addedObjects]) {\n for (const obj of list ?? []) {\n promisesToWait.push(\n this.store.invalidateObject(obj.objectType, obj.primaryKey),\n );\n }\n }\n\n // Use the registry to find all RDP variant cache keys for each deleted object.\n this.store.batch({}, (batch) => {\n for (const { objectType, primaryKey } of deletedObjects ?? []) {\n for (\n const cacheKey of this.store.objectCacheKeyRegistry.getVariants(\n objectType,\n primaryKey,\n )\n ) {\n this.store.queries.peek(cacheKey)?.deleteFromStore(\n \"loaded\", // this is probably not the best value to use\n batch,\n );\n }\n }\n });\n await Promise.all(promisesToWait);\n };\n\n #invalidatePerTypeEdits = async (\n actionEditResponse: ActionEditResponse | undefined,\n ): Promise<void> => {\n if (actionEditResponse == null) {\n return;\n }\n\n const editedObjectTypeSet = new Set<string>();\n if (actionEditResponse.type === \"edits\") {\n const { deletedObjects, modifiedObjects, addedObjects } =\n actionEditResponse;\n for (const list of [deletedObjects, modifiedObjects, addedObjects]) {\n for (const obj of list ?? []) {\n editedObjectTypeSet.add(obj.objectType);\n }\n }\n } else {\n for (const apiName of actionEditResponse.editedObjectTypes) {\n editedObjectTypeSet.add(apiName as string);\n }\n }\n\n if (editedObjectTypeSet.size === 0) {\n return;\n }\n\n // Walk the cache once and dispatch per (query, editedType) pair. The two\n // skips below mean each query is touched at most once on the path that's\n // right for it: ObjectQueries via the per-PK pass, primary-type lists via\n // Subject reactions from that refetch, and everything else (RDP-traversed\n // lists, FunctionQueries with dependsOn) via this walk.\n const isEditsBranch = actionEditResponse.type === \"edits\";\n const promises: Promise<unknown>[] = [];\n for (const cacheKey of this.store.queries.keys()) {\n if (isEditsBranch && cacheKey.type === \"object\") {\n continue;\n }\n const query = this.store.queries.peek(cacheKey);\n if (!query) {\n continue;\n }\n for (const apiName of editedObjectTypeSet) {\n if (\n isEditsBranch\n && cacheKey.type === \"list\"\n && cacheKey.otherKeys[API_NAME_IDX] === apiName\n ) {\n continue;\n }\n promises.push(query.invalidateObjectType(apiName, undefined));\n }\n }\n await Promise.allSettled(promises);\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,YAAY,QAAQ,yBAAyB;AAEtD,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAMC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,QAAQ,CAACZ,IAAI,KAAK,QAAQ,EAAE;QAC/C;MACF;MACA,MAAM4B,KAAK,GAAG,IAAI,CAAClD,KAAK,CAACqC,OAAO,CAACC,IAAI,CAACJ,QAAQ,CAAC;MAC/C,IAAI,CAACgB,KAAK,EAAE;QACV;MACF;MACA,KAAK,MAAMN,OAAO,IAAIH,mBAAmB,EAAE;QACzC,IACEM,aAAa,IACVb,QAAQ,CAACZ,IAAI,KAAK,MAAM,IACxBY,QAAQ,CAACiB,SAAS,CAAC3D,YAAY,CAAC,KAAKoD,OAAO,EAC/C;UACA;QACF;QACAI,QAAQ,CAACnB,IAAI,CAACqB,KAAK,CAACE,oBAAoB,CAACR,OAAO,EAAES,SAAS,CAAC,CAAC;MAC/D;IACF;IACA,MAAMrC,OAAO,CAACsC,UAAU,CAACN,QAAQ,CAAC;EACpC,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ActionApplication.js","names":["API_NAME_IDX","runOptimisticJob","ACTION_DELAY","process","env","NODE_ENV","ActionApplication","constructor","store","applyAction","action","args","optimisticUpdate","logger","child","methodName","removeOptimisticResult","actionResults","Array","isArray","debug","client","batchApplyAction","$returnEdits","Promise","resolve","setTimeout","invalidatePerObjectEdits","invalidatePerTypeEdits","catch","e","warn","err","actionEditResponse","type","deletedObjects","modifiedObjects","addedObjects","promisesToWait","list","obj","push","invalidateObject","objectType","primaryKey","batch","cacheKey","objectCacheKeyRegistry","getVariants","queries","peek","deleteFromStore","all","editedObjectTypeSet","Set","add","apiName","editedObjectTypes","size","isEditsBranch","promises","keys","query","otherKeys","invalidateObjectType","undefined","allSettled"],"sources":["ActionApplication.ts"],"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 type { ActionDefinition, ActionEditResponse } from \"@osdk/api\";\nimport type { ActionSignatureFromDef } from \"../../../actions/applyAction.js\";\nimport { API_NAME_IDX } from \"../list/ListCacheKey.js\";\nimport type { Store } from \"../Store.js\";\nimport { runOptimisticJob } from \"./OptimisticJob.js\";\n\nconst ACTION_DELAY = process.env.NODE_ENV === \"production\" ? 0 : 1000;\n\nexport class ActionApplication {\n constructor(private store: Store) {}\n\n applyAction: <Q extends ActionDefinition<any>>(\n action: Q,\n args:\n | Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]\n | Array<Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]>,\n opts?: Store.ApplyActionOptions,\n ) => Promise<ActionEditResponse> = async (\n action,\n args,\n { optimisticUpdate } = {},\n ) => {\n const logger = process.env.NODE_ENV !== \"production\"\n ? this.store.logger?.child({ methodName: \"applyAction\" })\n : this.store.logger;\n const removeOptimisticResult = runOptimisticJob(\n this.store,\n optimisticUpdate,\n );\n\n let actionResults: ActionEditResponse;\n try {\n if (Array.isArray(args)) {\n if (process.env.NODE_ENV !== \"production\") {\n logger?.debug(\"applying action to multiple args\", args);\n }\n\n actionResults = await this.store.client(action).batchApplyAction(\n args,\n { $returnEdits: true },\n );\n } else {\n // The types for client get confused when we dynamically applyAction so we\n // have to deal with the `any` here and force cast it to what it should be.\n // TODO: Update the types so this doesn't happen!\n actionResults = await this.store.client(action).applyAction(\n args as any,\n { $returnEdits: true },\n );\n\n if (process.env.NODE_ENV !== \"production\") {\n if (ACTION_DELAY > 0) {\n logger?.debug(\"action done, pausing\", actionResults);\n await new Promise<void>(resolve =>\n setTimeout(resolve, ACTION_DELAY)\n );\n logger?.debug(\"action done, pausing done\");\n }\n }\n }\n\n await this.#invalidatePerObjectEdits(actionResults);\n // Per-type invalidation can fan out into expensive list/object-set\n // aggregation refetches. Start it after the precise per-object updates,\n // but do not block the action result on those background refreshes.\n void this.#invalidatePerTypeEdits(actionResults).catch((e: unknown) => {\n logger?.warn(\n { err: e },\n \"Error while invalidating action edits by object type\",\n );\n });\n } finally {\n if (process.env.NODE_ENV !== \"production\") {\n logger?.debug(\n \"optimistic action complete; remove the results\",\n );\n }\n // make sure this happens even if the action fails\n await removeOptimisticResult();\n }\n\n return actionResults;\n };\n\n #invalidatePerObjectEdits = async (\n actionEditResponse: ActionEditResponse | undefined,\n ): Promise<void> => {\n if (actionEditResponse == null || actionEditResponse.type !== \"edits\") {\n return;\n }\n const { deletedObjects, modifiedObjects, addedObjects } =\n actionEditResponse;\n\n const promisesToWait: Promise<unknown>[] = [];\n for (const list of [deletedObjects, modifiedObjects, addedObjects]) {\n for (const obj of list ?? []) {\n promisesToWait.push(\n this.store.invalidateObject(obj.objectType, obj.primaryKey),\n );\n }\n }\n\n // Use the registry to find all RDP variant cache keys for each deleted object.\n this.store.batch({}, (batch) => {\n for (const { objectType, primaryKey } of deletedObjects ?? []) {\n for (\n const cacheKey of this.store.objectCacheKeyRegistry.getVariants(\n objectType,\n primaryKey,\n )\n ) {\n this.store.queries.peek(cacheKey)?.deleteFromStore(\n \"loaded\", // this is probably not the best value to use\n batch,\n );\n }\n }\n });\n await Promise.all(promisesToWait);\n };\n\n #invalidatePerTypeEdits = async (\n actionEditResponse: ActionEditResponse | undefined,\n ): Promise<void> => {\n if (actionEditResponse == null) {\n return;\n }\n\n const editedObjectTypeSet = new Set<string>();\n if (actionEditResponse.type === \"edits\") {\n const { deletedObjects, modifiedObjects, addedObjects } =\n actionEditResponse;\n for (const list of [deletedObjects, modifiedObjects, addedObjects]) {\n for (const obj of list ?? []) {\n editedObjectTypeSet.add(obj.objectType);\n }\n }\n } else {\n for (const apiName of actionEditResponse.editedObjectTypes) {\n editedObjectTypeSet.add(apiName as string);\n }\n }\n\n if (editedObjectTypeSet.size === 0) {\n return;\n }\n\n // Walk the cache once and dispatch per (query, editedType) pair. The two\n // skips below mean each query is touched at most once on the path that's\n // right for it: ObjectQueries via the per-PK pass, primary-type lists via\n // Subject reactions from that refetch, and everything else (RDP-traversed\n // lists, FunctionQueries with dependsOn) via this walk.\n const isEditsBranch = actionEditResponse.type === \"edits\";\n const promises: Promise<unknown>[] = [];\n for (const cacheKey of this.store.queries.keys()) {\n if (isEditsBranch && cacheKey.type === \"object\") {\n continue;\n }\n const query = this.store.queries.peek(cacheKey);\n if (!query) {\n continue;\n }\n for (const apiName of editedObjectTypeSet) {\n if (\n isEditsBranch\n && cacheKey.type === \"list\"\n && cacheKey.otherKeys[API_NAME_IDX] === apiName\n ) {\n continue;\n }\n promises.push(query.invalidateObjectType(apiName, undefined));\n }\n }\n await Promise.allSettled(promises);\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,YAAY,QAAQ,yBAAyB;AAEtD,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAMC,YAAY,GAAGC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAAG,CAAC,GAAG,IAAI;AAErE,OAAO,MAAMC,iBAAiB,CAAC;EAC7BC,WAAWA,CAASC,KAAY,EAAE;IAAA,KAAdA,KAAY,GAAZA,KAAY;EAAG;EAEnCC,WAAW,GAMwB,MAAAA,CACjCC,MAAM,EACNC,IAAI,EACJ;IAAEC;EAAiB,CAAC,GAAG,CAAC,CAAC,KACtB;IACH,MAAMC,MAAM,GAAGV,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAChD,IAAI,CAACG,KAAK,CAACK,MAAM,EAAEC,KAAK,CAAC;MAAEC,UAAU,EAAE;IAAc,CAAC,CAAC,GACvD,IAAI,CAACP,KAAK,CAACK,MAAM;IACrB,MAAMG,sBAAsB,GAAGf,gBAAgB,CAC7C,IAAI,CAACO,KAAK,EACVI,gBACF,CAA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AES,SAAS,CAAC,CAAC;MAC/D;IACF;IACA,MAAMzC,OAAO,CAAC0C,UAAU,CAACN,QAAQ,CAAC;EACpC,CAAC;AACH","ignoreList":[]}
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export const USER_AGENT = `osdk-client/${"2.24.0
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.24.0
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.24.0"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.24.0"}`;
|
|
19
19
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2023 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\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2023 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\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,yBAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,oCAAuD","ignoreList":[]}
|
|
@@ -1454,8 +1454,8 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1454
1454
|
};
|
|
1455
1455
|
|
|
1456
1456
|
// src/util/UserAgent.ts
|
|
1457
|
-
var USER_AGENT = `osdk-client/${"2.24.0
|
|
1458
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.24.0
|
|
1457
|
+
var USER_AGENT = `osdk-client/${"2.24.0"}`;
|
|
1458
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.24.0"}`;
|
|
1459
1459
|
|
|
1460
1460
|
// src/createMinimalClient.ts
|
|
1461
1461
|
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkPBTN7Q2O_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
@@ -2205,5 +2205,5 @@ exports.createClient = createClient;
|
|
|
2205
2205
|
exports.createClientFromContext = createClientFromContext;
|
|
2206
2206
|
exports.createClientWithTransaction = createClientWithTransaction;
|
|
2207
2207
|
exports.createOsdkObject = createOsdkObject;
|
|
2208
|
-
//# sourceMappingURL=chunk-
|
|
2209
|
-
//# sourceMappingURL=chunk-
|
|
2208
|
+
//# sourceMappingURL=chunk-SIXWQYN6.cjs.map
|
|
2209
|
+
//# sourceMappingURL=chunk-SIXWQYN6.cjs.map
|