@osdk/client 2.3.1 → 2.3.3
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 +18 -0
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/observable/internal/ActionApplication.js +1 -1
- package/build/browser/observable/internal/ActionApplication.js.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromRid.js +4 -1
- package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-T5KGTBH2.cjs → chunk-ERTC3NWZ.cjs} +14 -19
- package/build/cjs/chunk-ERTC3NWZ.cjs.map +1 -0
- package/build/cjs/chunk-Q7SFCCGT.cjs +11 -0
- package/build/cjs/chunk-Q7SFCCGT.cjs.map +1 -0
- package/build/cjs/{chunk-FWYXUSCF.cjs → chunk-QJKAH6UM.cjs} +50 -50
- package/build/cjs/{chunk-FWYXUSCF.cjs.map → chunk-QJKAH6UM.cjs.map} +1 -1
- package/build/cjs/delay-QK4T7RVX.cjs +74 -0
- package/build/cjs/delay-QK4T7RVX.cjs.map +1 -0
- package/build/cjs/index.cjs +7 -6
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/public/internal.cjs +13 -9
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.cjs +19 -72
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/observable/internal/ActionApplication.js +1 -1
- package/build/esm/observable/internal/ActionApplication.js.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromRid.js +4 -1
- package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/Client.d.ts +1 -1
- package/build/types/observable/internal/ActionApplication.d.ts.map +1 -1
- package/package.json +8 -8
- package/build/cjs/chunk-T5KGTBH2.cjs.map +0 -1
package/build/esm/Client.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
export const additionalContext = Symbol("additionalContext");
|
|
22
22
|
|
|
23
23
|
// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
24
|
-
const MaxOsdkVersion = "2.3.
|
|
24
|
+
const MaxOsdkVersion = "2.3.3";
|
|
25
25
|
// END: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
26
26
|
|
|
27
27
|
const ErrorMessage = Symbol("ErrorMessage");
|
package/build/esm/Client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.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\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\nimport type { SatisfiesSemver } from \"./SatisfiesSemver.js\";\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\ntype OldSharedClient = import(\"@osdk/shared.client\").SharedClient;\n\nexport type CheckVersionBound<Q> = Q extends VersionBound<infer V> ? (\n SatisfiesSemver<V, MaxOsdkVersion> extends true ? Q\n : Q & {\n [ErrorMessage]:\n `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\n }\n )\n : Q;\n\nexport interface Client extends SharedClient, OldSharedClient {\n <Q extends ObjectTypeDefinition>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? ObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends (InterfaceDefinition)>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? MinimalObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends ActionDefinition<any>>(\n o: Q,\n ): ActionSignatureFromDef<Q>;\n\n <Q extends QueryDefinition<any>>(\n o: Q,\n ): QuerySignatureFromDef<Q>;\n\n <Q extends Experiment<\"2.0.8\"> | Experiment<\"2.1.0\"> | Experiment<\"2.2.0\">>(\n experiment: Q,\n ): ExperimentFns<Q>;\n\n fetchMetadata<\n Q extends (\n | ObjectTypeDefinition\n | InterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n ),\n >(o: Q): Promise<\n Q extends ObjectTypeDefinition ? ObjectMetadata\n : Q extends InterfaceDefinition ? InterfaceMetadata\n : Q extends ActionDefinition<any> ? ActionMetadata\n : Q extends QueryDefinition<any> ? QueryMetadata\n : never\n >;\n\n /** @internal */\n [additionalContext]: MinimalClient;\n}\n\n// DO NOT EXPORT FROM PACKAGE\n/** @internal */\nexport const additionalContext: unique symbol = Symbol(\"additionalContext\");\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.3.
|
|
1
|
+
{"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.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\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\nimport type { SatisfiesSemver } from \"./SatisfiesSemver.js\";\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\ntype OldSharedClient = import(\"@osdk/shared.client\").SharedClient;\n\nexport type CheckVersionBound<Q> = Q extends VersionBound<infer V> ? (\n SatisfiesSemver<V, MaxOsdkVersion> extends true ? Q\n : Q & {\n [ErrorMessage]:\n `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\n }\n )\n : Q;\n\nexport interface Client extends SharedClient, OldSharedClient {\n <Q extends ObjectTypeDefinition>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? ObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends (InterfaceDefinition)>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? MinimalObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends ActionDefinition<any>>(\n o: Q,\n ): ActionSignatureFromDef<Q>;\n\n <Q extends QueryDefinition<any>>(\n o: Q,\n ): QuerySignatureFromDef<Q>;\n\n <Q extends Experiment<\"2.0.8\"> | Experiment<\"2.1.0\"> | Experiment<\"2.2.0\">>(\n experiment: Q,\n ): ExperimentFns<Q>;\n\n fetchMetadata<\n Q extends (\n | ObjectTypeDefinition\n | InterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n ),\n >(o: Q): Promise<\n Q extends ObjectTypeDefinition ? ObjectMetadata\n : Q extends InterfaceDefinition ? InterfaceMetadata\n : Q extends ActionDefinition<any> ? ActionMetadata\n : Q extends QueryDefinition<any> ? QueryMetadata\n : never\n >;\n\n /** @internal */\n [additionalContext]: MinimalClient;\n}\n\n// DO NOT EXPORT FROM PACKAGE\n/** @internal */\nexport const additionalContext: unique symbol = Symbol(\"additionalContext\");\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.3.3\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\nexport type MaxOsdkVersion = typeof MaxOsdkVersion;\nconst ErrorMessage: unique symbol = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;;AAsDA;AACA;AACA,OAAO,MAAMA,iBAAgC,GAAGC,MAAM,CAAC,mBAAmB,CAAC;;AAE3E;AACA,MAAMC,cAAc,GAAG,OAAO;AAC9B;;AAEA,MAAMC,YAA2B,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import delay from "delay";
|
|
18
17
|
import { runOptimisticJob } from "./OptimisticJob.js";
|
|
19
18
|
const ACTION_DELAY = process.env.NODE_ENV === "production" ? 0 : 1000;
|
|
20
19
|
export class ActionApplication {
|
|
@@ -51,6 +50,7 @@ export class ActionApplication {
|
|
|
51
50
|
if (process.env.NODE_ENV !== "production") {
|
|
52
51
|
if (ACTION_DELAY > 0) {
|
|
53
52
|
logger?.debug("action done, pausing", actionResults);
|
|
53
|
+
const delay = (await import("delay")).default;
|
|
54
54
|
await delay(ACTION_DELAY);
|
|
55
55
|
logger?.debug("action done, pausing done");
|
|
56
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionApplication.js","names":["
|
|
1
|
+
{"version":3,"file":"ActionApplication.js","names":["runOptimisticJob","ACTION_DELAY","process","env","NODE_ENV","ActionApplication","constructor","store","applyAction","action","args","optimisticUpdate","logger","child","methodName","removeOptimisticResult","Array","isArray","debug","results","client","batchApplyAction","$returnEdits","invalidateActionEditResponse","actionResults","delay","default","#invalidateActionEditResponse","deletedObjects","modifiedObjects","addedObjects","editedObjectTypes","type","changes","promisesToWait","list","obj","push","invalidateObject","objectType","primaryKey","batch","cacheKey","getCacheKey","peekQuery","deleteFromStore","Promise","all","apiName","invalidateObjectType"],"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 {\n ActionDefinition,\n ActionEditResponse,\n ActionReturnTypeForOptions,\n} from \"@osdk/api\";\nimport type { ActionSignatureFromDef } from \"../../actions/applyAction.js\";\nimport { type Changes } from \"./Changes.js\";\nimport type { ObjectCacheKey } from \"./ObjectQuery.js\";\nimport { runOptimisticJob } from \"./OptimisticJob.js\";\nimport type { Store } from \"./Store.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 return await (async () => {\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 const results: ActionReturnTypeForOptions<{ $returnEdits: true }> =\n await this.store\n .client(action).batchApplyAction(\n args,\n { $returnEdits: true },\n );\n\n await this.#invalidateActionEditResponse(results);\n\n return results;\n }\n\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\n const actionResults: ActionEditResponse = await this.store.client(\n action,\n ).applyAction(args as any, { $returnEdits: true });\n\n if (process.env.NODE_ENV !== \"production\") {\n if (ACTION_DELAY > 0) {\n logger?.debug(\"action done, pausing\", actionResults);\n const delay = (await import(\"delay\")).default;\n await delay(ACTION_DELAY);\n logger?.debug(\"action done, pausing done\");\n }\n }\n await this.#invalidateActionEditResponse(actionResults);\n return 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 };\n\n #invalidateActionEditResponse = async (\n { deletedObjects, modifiedObjects, addedObjects, editedObjectTypes, type }:\n ActionEditResponse,\n ): Promise<void> => {\n let changes: Changes | undefined;\n if (type === \"edits\") {\n const promisesToWait: Promise<any>[] = [];\n\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 this.store.batch({}, (batch) => {\n for (const { objectType, primaryKey } of deletedObjects ?? []) {\n const cacheKey = this.store.getCacheKey<ObjectCacheKey>(\n \"object\",\n objectType,\n primaryKey,\n );\n this.store.peekQuery(cacheKey)?.deleteFromStore(\n \"loaded\", // this is probably not the best value to use\n batch,\n );\n }\n });\n await Promise.all(promisesToWait);\n } else {\n for (const apiName of editedObjectTypes) {\n await this.store.invalidateObjectType(apiName as string, changes);\n }\n }\n };\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -27,7 +27,10 @@ import { createObjectSet } from "../objectSet/createObjectSet.js";
|
|
|
27
27
|
export function hydrateObjectSetFromRid(client, definition, rid) {
|
|
28
28
|
return createObjectSet(definition, client[additionalContext], {
|
|
29
29
|
type: "intersect",
|
|
30
|
-
objectSets: [{
|
|
30
|
+
objectSets: [definition.type === "interface" ? {
|
|
31
|
+
type: "interfaceBase",
|
|
32
|
+
interfaceType: definition.apiName
|
|
33
|
+
} : {
|
|
31
34
|
type: "base",
|
|
32
35
|
objectType: definition.apiName
|
|
33
36
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateObjectSetFromRid.js","names":["additionalContext","createObjectSet","hydrateObjectSetFromRid","client","definition","rid","type","objectSets","
|
|
1
|
+
{"version":3,"file":"hydrateObjectSetFromRid.js","names":["additionalContext","createObjectSet","hydrateObjectSetFromRid","client","definition","rid","type","objectSets","interfaceType","apiName","objectType","reference"],"sources":["hydrateObjectSetFromRid.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 { ObjectOrInterfaceDefinition, ObjectSet } from \"@osdk/api\";\nimport type { Client } from \"../Client.js\";\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<T extends ObjectOrInterfaceDefinition>(\n client: Client,\n definition: T,\n rid: string,\n): ObjectSet<T> {\n return createObjectSet(\n definition,\n client[additionalContext],\n {\n type: \"intersect\",\n objectSets: [\n definition.type === \"interface\"\n ? { type: \"interfaceBase\", interfaceType: definition.apiName }\n : {\n type: \"base\",\n objectType: definition.apiName,\n },\n {\n type: \"reference\",\n reference: rid,\n },\n ],\n },\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,cAAc;AAChD,SAASC,eAAe,QAAQ,iCAAiC;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,MAAc,EACdC,UAAa,EACbC,GAAW,EACG;EACd,OAAOJ,eAAe,CACpBG,UAAU,EACVD,MAAM,CAACH,iBAAiB,CAAC,EACzB;IACEM,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,CACVH,UAAU,CAACE,IAAI,KAAK,WAAW,GAC3B;MAAEA,IAAI,EAAE,eAAe;MAAEE,aAAa,EAAEJ,UAAU,CAACK;IAAQ,CAAC,GAC5D;MACAH,IAAI,EAAE,MAAM;MACZI,UAAU,EAAEN,UAAU,CAACK;IACzB,CAAC,EACH;MACEH,IAAI,EAAE,WAAW;MACjBK,SAAS,EAAEN;IACb,CAAC;EAEL,CACF,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.3.
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.3.
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.3.3"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.3.3"}`;
|
|
19
19
|
//# sourceMappingURL=UserAgent.js.map
|
package/build/types/Client.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface Client extends SharedClient, OldSharedClient {
|
|
|
16
16
|
<Q extends Experiment<"2.0.8"> | Experiment<"2.1.0"> | Experiment<"2.2.0">>(experiment: Q): ExperimentFns<Q>;
|
|
17
17
|
fetchMetadata<Q extends (ObjectTypeDefinition | InterfaceDefinition | ActionDefinition<any> | QueryDefinition<any>)>(o: Q): Promise<Q extends ObjectTypeDefinition ? ObjectMetadata : Q extends InterfaceDefinition ? InterfaceMetadata : Q extends ActionDefinition<any> ? ActionMetadata : Q extends QueryDefinition<any> ? QueryMetadata : never>;
|
|
18
18
|
}
|
|
19
|
-
declare const MaxOsdkVersion = "2.3.
|
|
19
|
+
declare const MaxOsdkVersion = "2.3.3";
|
|
20
20
|
export type MaxOsdkVersion = typeof MaxOsdkVersion;
|
|
21
21
|
declare const ErrorMessage: unique symbol;
|
|
22
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,kBACA,0BAEK,WAAY;
|
|
1
|
+
{"mappings":"AAgBA,cACE,kBACA,0BAEK,WAAY;AACnB,cAAc,8BAA8B,8BAA+B;AAI3E,cAAc,aAAa,YAAa;AAIxC,OAAO,cAAM,kBAAkB;;CACjB;CAAZ,YAAoBA,OAAO;CAE3B,cAAc,UAAU,uBACtBC,QAAQ,GACRC,MACI,WAAW,uBAAuB,GAAG,gBAAgB,KACrD,MAAM,WAAW,uBAAuB,GAAG,gBAAgB,KAC/DC,OAAO,MAAM,uBACV,QAAQ;AAkGd","names":["store: Store","action: Q","args:\n | Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]\n | Array<Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]>","opts?: Store.ApplyActionOptions"],"sources":["../../../../src/observable/internal/ActionApplication.ts"],"version":3,"file":"ActionApplication.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/client",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"tiny-invariant": "^1.3.1",
|
|
66
66
|
"type-fest": "^4.18.2",
|
|
67
67
|
"ws": "^8.18.0",
|
|
68
|
-
"@osdk/api": "~2.3.
|
|
69
|
-
"@osdk/client.unstable": "2.3.
|
|
70
|
-
"@osdk/generator-converters": "2.3.
|
|
71
|
-
"@osdk/shared.client.impl": "~1.3.0",
|
|
68
|
+
"@osdk/api": "~2.3.3",
|
|
69
|
+
"@osdk/client.unstable": "2.3.3",
|
|
70
|
+
"@osdk/generator-converters": "2.3.3",
|
|
72
71
|
"@osdk/shared.net.errors": "~2.3.0",
|
|
72
|
+
"@osdk/shared.client.impl": "~1.3.0",
|
|
73
73
|
"@osdk/shared.net.fetch": "~1.3.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
"ts-expect": "^1.3.0",
|
|
92
92
|
"typescript": "~5.5.4",
|
|
93
93
|
"zod": "^3.23.8",
|
|
94
|
-
"@osdk/client.test.ontology": "~2.3.
|
|
94
|
+
"@osdk/client.test.ontology": "~2.3.3",
|
|
95
|
+
"@osdk/monorepo.api-extractor": "~0.2.0",
|
|
95
96
|
"@osdk/monorepo.tsconfig": "~0.2.0",
|
|
96
|
-
"@osdk/shared.test": "~2.3.
|
|
97
|
-
"@osdk/monorepo.api-extractor": "~0.2.0"
|
|
97
|
+
"@osdk/shared.test": "~2.3.3"
|
|
98
98
|
},
|
|
99
99
|
"publishConfig": {
|
|
100
100
|
"access": "public"
|