@osdk/functions 1.5.0-beta.2 → 1.5.0-beta.4

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/build/browser/public/experimental.js +2 -0
  3. package/build/browser/public/experimental.js.map +1 -0
  4. package/build/browser/public/unstable-do-not-use.js +1 -0
  5. package/build/browser/public/unstable-do-not-use.js.map +1 -1
  6. package/build/browser/transactions/EditRequestManager.js +20 -1
  7. package/build/browser/transactions/EditRequestManager.js.map +1 -1
  8. package/build/browser/transactions/EditRequestManager.test.js +130 -0
  9. package/build/browser/transactions/EditRequestManager.test.js.map +1 -1
  10. package/build/browser/transactions/WriteableClient.js.map +1 -1
  11. package/build/browser/transactions/createWriteableClient.js +5 -5
  12. package/build/browser/transactions/createWriteableClient.js.map +1 -1
  13. package/build/browser/transactions/flushEdits.js +21 -0
  14. package/build/browser/transactions/flushEdits.js.map +1 -0
  15. package/build/cjs/index.cjs +1 -1
  16. package/build/cjs/index.cjs.map +1 -1
  17. package/build/cjs/public/experimental.cjs +4 -0
  18. package/build/cjs/public/experimental.cjs.map +1 -0
  19. package/build/cjs/public/experimental.d.cts +35 -0
  20. package/build/cjs/public/unstable-do-not-use.cjs +34 -7
  21. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
  22. package/build/cjs/public/unstable-do-not-use.d.cts +7 -19
  23. package/build/esm/public/experimental.js +2 -0
  24. package/build/esm/public/experimental.js.map +1 -0
  25. package/build/esm/public/unstable-do-not-use.js +1 -0
  26. package/build/esm/public/unstable-do-not-use.js.map +1 -1
  27. package/build/esm/transactions/EditRequestManager.js +20 -1
  28. package/build/esm/transactions/EditRequestManager.js.map +1 -1
  29. package/build/esm/transactions/EditRequestManager.test.js +130 -0
  30. package/build/esm/transactions/EditRequestManager.test.js.map +1 -1
  31. package/build/esm/transactions/WriteableClient.js.map +1 -1
  32. package/build/esm/transactions/createWriteableClient.js +5 -5
  33. package/build/esm/transactions/createWriteableClient.js.map +1 -1
  34. package/build/esm/transactions/flushEdits.js +21 -0
  35. package/build/esm/transactions/flushEdits.js.map +1 -0
  36. package/build/types/public/experimental.d.ts +1 -0
  37. package/build/types/public/experimental.d.ts.map +1 -0
  38. package/build/types/public/unstable-do-not-use.d.ts +1 -0
  39. package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
  40. package/build/types/transactions/EditRequestManager.d.ts +1 -0
  41. package/build/types/transactions/EditRequestManager.d.ts.map +1 -1
  42. package/build/types/transactions/WriteableClient.d.ts +3 -1
  43. package/build/types/transactions/WriteableClient.d.ts.map +1 -1
  44. package/build/types/transactions/createWriteableClient.d.ts +2 -2
  45. package/build/types/transactions/createWriteableClient.d.ts.map +1 -1
  46. package/build/types/transactions/flushEdits.d.ts +2 -0
  47. package/build/types/transactions/flushEdits.d.ts.map +1 -0
  48. package/experimental.d.ts +17 -0
  49. package/package.json +18 -9
@@ -18,10 +18,9 @@ import { createClientWithTransaction } from "@osdk/client/unstable-do-not-use";
18
18
  import { EditRequestManager } from "./EditRequestManager.js";
19
19
  import { toPropertyDataValue } from "./toPropertyDataValue.js";
20
20
  import { writeableClientContext } from "./WriteableClient.js";
21
- export function createWriteableClient(...args) {
22
- const transactionRid = args[0];
23
- const ontologyRid = args[2];
24
- const client = createClientWithTransaction(...args);
21
+ export function createWriteableClient(transactionId, ...args) {
22
+ const ontologyRid = args[1];
23
+ const client = createClientWithTransaction(transactionId, async () => {}, ...args);
25
24
  const editRequestManager = new EditRequestManager(client) // This cast is safe because we create the writeable client properties below.
26
25
  ;
27
26
 
@@ -114,7 +113,8 @@ export function createWriteableClient(...args) {
114
113
  [writeableClientContext]: {
115
114
  value: {
116
115
  ontologyRid,
117
- transactionRid
116
+ transactionId,
117
+ editRequestManager
118
118
  }
119
119
  }
120
120
  });
@@ -1 +1 @@
1
- {"version":3,"file":"createWriteableClient.js","names":["createClientWithTransaction","EditRequestManager","toPropertyDataValue","writeableClientContext","createWriteableClient","args","transactionRid","ontologyRid","client","editRequestManager","writeableClient","Object","defineProperties","link","value","source","apiName","target","Array","isArray","postEdit","type","objectType","$apiName","primaryKey","$primaryKey","linkType","linkedObjectPrimaryKey","promises","elem","push","Promise","all","then","undefined","unlink","create","obj","properties","propertyMap","key","entries","update","locator","delete"],"sources":["createWriteableClient.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 { createClientWithTransaction } from \"@osdk/client/unstable-do-not-use\";\n\nimport type { Client } from \"@osdk/client\";\nimport type {\n AddLinkApiNames,\n AddLinkSources,\n AddLinkTargets,\n CreatableObjectOrInterfaceTypeProperties,\n CreatableObjectOrInterfaceTypes,\n DeletableObjectOrInterfaceLocators,\n RemoveLinkApiNames,\n RemoveLinkSources,\n RemoveLinkTargets,\n UpdatableObjectOrInterfaceLocatorProperties,\n UpdatableObjectOrInterfaceLocators,\n} from \"../edits/EditBatch.js\";\nimport type { AnyEdit } from \"../edits/types.js\";\nimport { EditRequestManager } from \"./EditRequestManager.js\";\nimport { toPropertyDataValue } from \"./toPropertyDataValue.js\";\nimport type {\n WriteableClient,\n WriteableClientContext,\n WriteMethods,\n} from \"./WriteableClient.js\";\nimport { writeableClientContext } from \"./WriteableClient.js\";\n\nexport function createWriteableClient<\n X extends AnyEdit = never,\n>(\n ...args: Parameters<typeof createClientWithTransaction>\n): WriteableClient<X> {\n const transactionRid = args[0];\n const ontologyRid = args[2];\n\n const client = createClientWithTransaction(...args);\n\n const editRequestManager = new EditRequestManager(\n client as WriteableClient<any>, // This cast is safe because we create the writeable client properties below.\n );\n\n // We use define properties because the client has non-enumerable properties that we want to preserve.\n const writeableClient = Object.defineProperties<Client>(\n client,\n {\n link: {\n value: function<\n SOL extends AddLinkSources<X>,\n A extends AddLinkApiNames<X, SOL>,\n >(\n source: SOL,\n apiName: A,\n target: AddLinkTargets<X, SOL, A>,\n ): Promise<void> {\n if (!Array.isArray(target)) {\n return editRequestManager.postEdit({\n type: \"addLink\",\n objectType: source.$apiName,\n primaryKey: source.$primaryKey,\n linkType: apiName,\n linkedObjectPrimaryKey: target.$primaryKey,\n });\n }\n const promises: Promise<void>[] = [];\n\n for (const elem of target) {\n promises.push(\n editRequestManager.postEdit({\n type: \"addLink\",\n objectType: source.$apiName,\n primaryKey: source.$primaryKey,\n linkType: apiName,\n linkedObjectPrimaryKey: elem.$primaryKey,\n }),\n );\n }\n return Promise.all(promises).then(() => undefined);\n },\n },\n unlink: {\n value: function<\n SOL extends RemoveLinkSources<X>,\n A extends RemoveLinkApiNames<X, SOL>,\n >(\n source: SOL,\n apiName: A,\n target: RemoveLinkTargets<X, SOL, A>,\n ): Promise<void> {\n if (!Array.isArray(target)) {\n return editRequestManager.postEdit({\n type: \"removeLink\",\n objectType: source.$apiName,\n primaryKey: source.$primaryKey,\n linkType: apiName,\n linkedObjectPrimaryKey: target.$primaryKey,\n });\n }\n const promises: Promise<void>[] = [];\n for (const elem of target) {\n promises.push(editRequestManager.postEdit({\n type: \"removeLink\",\n objectType: source.$apiName,\n primaryKey: source.$primaryKey,\n linkType: apiName,\n linkedObjectPrimaryKey: elem.$primaryKey,\n }));\n }\n return Promise.all(promises).then(() => undefined);\n },\n },\n create: {\n value: async function<OTD extends CreatableObjectOrInterfaceTypes<X>>(\n obj: OTD,\n properties: CreatableObjectOrInterfaceTypeProperties<X, OTD>,\n ): Promise<void> {\n const propertyMap: { [propertyName: string]: unknown } = {};\n for (const [key, value] of Object.entries(properties)) {\n propertyMap[key] = toPropertyDataValue(value);\n }\n return editRequestManager.postEdit({\n type: \"addObject\",\n objectType: obj.apiName,\n properties: propertyMap,\n });\n },\n },\n update: {\n value: function<\n SOL extends UpdatableObjectOrInterfaceLocators<X>,\n OTD extends UpdatableObjectOrInterfaceLocatorProperties<X, SOL>,\n >(\n locator: SOL,\n properties: OTD,\n ): Promise<void> {\n const propertyMap: { [propertyName: string]: unknown } = {};\n for (const [key, value] of Object.entries(properties)) {\n propertyMap[key] = toPropertyDataValue(value);\n }\n return editRequestManager.postEdit({\n type: \"modifyObject\",\n objectType: locator.$apiName,\n primaryKey: locator.$primaryKey,\n properties: propertyMap,\n });\n },\n },\n delete: {\n value: function<OL extends DeletableObjectOrInterfaceLocators<X>>(\n obj: OL,\n ): Promise<void> {\n return editRequestManager.postEdit({\n type: \"deleteObject\",\n objectType: obj.$apiName,\n primaryKey: obj.$primaryKey,\n });\n },\n },\n [writeableClientContext]: {\n value: {\n ontologyRid,\n transactionRid,\n } satisfies WriteableClientContext,\n },\n } satisfies Record<\n keyof WriteMethods<any> | typeof writeableClientContext,\n PropertyDescriptor\n >,\n ) as WriteableClient<X>;\n\n return writeableClient;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,2BAA2B,QAAQ,kCAAkC;AAiB9E,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,mBAAmB,QAAQ,0BAA0B;AAM9D,SAASC,sBAAsB,QAAQ,sBAAsB;AAE7D,OAAO,SAASC,qBAAqBA,CAGnC,GAAGC,IAAoD,EACnC;EACpB,MAAMC,cAAc,GAAGD,IAAI,CAAC,CAAC,CAAC;EAC9B,MAAME,WAAW,GAAGF,IAAI,CAAC,CAAC,CAAC;EAE3B,MAAMG,MAAM,GAAGR,2BAA2B,CAAC,GAAGK,IAAI,CAAC;EAEnD,MAAMI,kBAAkB,GAAG,IAAIR,kBAAkB,CAC/CO,MACF,CAAC,CADiC;EACjC;;EAED;EACA,MAAME,e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,CAACW,QAAQ,CAAC;UACjCC,IAAI,EAAE,cAAc;UACpBC,UAAU,EAAEqB,OAAO,CAACpB,QAAQ;UAC5BC,UAAU,EAAEmB,OAAO,CAAClB,WAAW;UAC/Ba,UAAU,EAAEC;QACd,CAAC,CAAC;MACJ;IACF,CAAC;IACDK,MAAM,EAAE;MACN9B,KAAK,EAAE,SAAAA,CACLuB,GAAO,EACQ;QACf,OAAO5B,kBAAkB,CAACW,QAAQ,CAAC;UACjCC,IAAI,EAAE,cAAc;UACpBC,UAAU,EAAEe,GAAG,CAACd,QAAQ;UACxBC,UAAU,EAAEa,GAAG,CAACZ;QAClB,CAAC,CAAC;MACJ;IACF,CAAC;IACD,CAACtB,sBAAsB,GAAG;MACxBW,KAAK,EAAE;QACLP,WAAW;QACXD;MACF;IACF;EACF,CAIF,CAAuB;EAEvB,OAAOI,eAAe;AACxB","ignoreList":[]}
1
+ {"version":3,"file":"createWriteableClient.js","names":["createClientWithTransaction","EditRequestManager","toPropertyDataValue","writeableClientContext","createWriteableClient","transactionId","args","ontologyRid","client","editRequestManager","writeableClient","Object","defineProperties","link","value","source","apiName","target","Array","isArray","postEdit","type","objectType","$apiName","primaryKey","$primaryKey","linkType","linkedObjectPrimaryKey","promises","elem","push","Promise","all","then","undefined","unlink","create","obj","properties","propertyMap","key","entries","update","locator","delete"],"sources":["createWriteableClient.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 { createClientWithTransaction } from \"@osdk/client/unstable-do-not-use\";\n\nimport type { Client, createClient } from \"@osdk/client\";\nimport type {\n AddLinkApiNames,\n AddLinkSources,\n AddLinkTargets,\n CreatableObjectOrInterfaceTypeProperties,\n CreatableObjectOrInterfaceTypes,\n DeletableObjectOrInterfaceLocators,\n RemoveLinkApiNames,\n RemoveLinkSources,\n RemoveLinkTargets,\n UpdatableObjectOrInterfaceLocatorProperties,\n UpdatableObjectOrInterfaceLocators,\n} from \"../edits/EditBatch.js\";\nimport type { AnyEdit } from \"../edits/types.js\";\nimport { EditRequestManager } from \"./EditRequestManager.js\";\nimport { toPropertyDataValue } from \"./toPropertyDataValue.js\";\nimport type {\n WriteableClient,\n WriteableClientContext,\n WriteMethods,\n} from \"./WriteableClient.js\";\nimport { writeableClientContext } from \"./WriteableClient.js\";\n\nexport function createWriteableClient<\n X extends AnyEdit = never,\n>(\n transactionId: string,\n ...args: Parameters<typeof createClient>\n): WriteableClient<X> {\n const ontologyRid = args[1];\n\n const client = createClientWithTransaction(\n transactionId,\n async () => {},\n ...args,\n ) as Client;\n\n const editRequestManager = new EditRequestManager(\n client as WriteableClient<any>, // This cast is safe because we create the writeable client properties below.\n );\n\n // We use define properties because the client has non-enumerable properties that we want to preserve.\n const writeableClient = Object.defineProperties<Client>(\n client,\n {\n link: {\n value: function<\n SOL extends AddLinkSources<X>,\n A extends AddLinkApiNames<X, SOL>,\n >(\n source: SOL,\n apiName: A,\n target: AddLinkTargets<X, SOL, A>,\n ): Promise<void> {\n if (!Array.isArray(target)) {\n return editRequestManager.postEdit({\n type: \"addLink\",\n objectType: source.$apiName,\n primaryKey: source.$primaryKey,\n linkType: apiName,\n linkedObjectPrimaryKey: target.$primaryKey,\n });\n }\n const promises: Promise<void>[] = [];\n\n for (const elem of target) {\n promises.push(\n editRequestManager.postEdit({\n type: \"addLink\",\n objectType: source.$apiName,\n primaryKey: source.$primaryKey,\n linkType: apiName,\n linkedObjectPrimaryKey: elem.$primaryKey,\n }),\n );\n }\n return Promise.all(promises).then(() => undefined);\n },\n },\n unlink: {\n value: function<\n SOL extends RemoveLinkSources<X>,\n A extends RemoveLinkApiNames<X, SOL>,\n >(\n source: SOL,\n apiName: A,\n target: RemoveLinkTargets<X, SOL, A>,\n ): Promise<void> {\n if (!Array.isArray(target)) {\n return editRequestManager.postEdit({\n type: \"removeLink\",\n objectType: source.$apiName,\n primaryKey: source.$primaryKey,\n linkType: apiName,\n linkedObjectPrimaryKey: target.$primaryKey,\n });\n }\n const promises: Promise<void>[] = [];\n for (const elem of target) {\n promises.push(editRequestManager.postEdit({\n type: \"removeLink\",\n objectType: source.$apiName,\n primaryKey: source.$primaryKey,\n linkType: apiName,\n linkedObjectPrimaryKey: elem.$primaryKey,\n }));\n }\n return Promise.all(promises).then(() => undefined);\n },\n },\n create: {\n value: async function<OTD extends CreatableObjectOrInterfaceTypes<X>>(\n obj: OTD,\n properties: CreatableObjectOrInterfaceTypeProperties<X, OTD>,\n ): Promise<void> {\n const propertyMap: { [propertyName: string]: unknown } = {};\n for (const [key, value] of Object.entries(properties)) {\n propertyMap[key] = toPropertyDataValue(value);\n }\n return editRequestManager.postEdit({\n type: \"addObject\",\n objectType: obj.apiName,\n properties: propertyMap,\n });\n },\n },\n update: {\n value: function<\n SOL extends UpdatableObjectOrInterfaceLocators<X>,\n OTD extends UpdatableObjectOrInterfaceLocatorProperties<X, SOL>,\n >(\n locator: SOL,\n properties: OTD,\n ): Promise<void> {\n const propertyMap: { [propertyName: string]: unknown } = {};\n for (const [key, value] of Object.entries(properties)) {\n propertyMap[key] = toPropertyDataValue(value);\n }\n return editRequestManager.postEdit({\n type: \"modifyObject\",\n objectType: locator.$apiName,\n primaryKey: locator.$primaryKey,\n properties: propertyMap,\n });\n },\n },\n delete: {\n value: function<OL extends DeletableObjectOrInterfaceLocators<X>>(\n obj: OL,\n ): Promise<void> {\n return editRequestManager.postEdit({\n type: \"deleteObject\",\n objectType: obj.$apiName,\n primaryKey: obj.$primaryKey,\n });\n },\n },\n [writeableClientContext]: {\n value: {\n ontologyRid,\n transactionId,\n editRequestManager,\n } satisfies WriteableClientContext,\n },\n } satisfies Record<\n keyof WriteMethods<any> | typeof writeableClientContext,\n PropertyDescriptor\n >,\n ) as WriteableClient<X>;\n\n return writeableClient;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,2BAA2B,QAAQ,kCAAkC;AAiB9E,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,mBAAmB,QAAQ,0BAA0B;AAM9D,SAASC,sBAAsB,QAAQ,sBAAsB;AAE7D,OAAO,SAASC,qBAAqBA,CAGnCC,aAAqB,EACrB,GAAGC,IAAqC,EACpB;EACpB,MAAMC,WAAW,GAAGD,IAAI,CAAC,CAAC,CAAC;EAE3B,MAAME,MAAM,GAAGR,2BAA2B,CACxCK,aAAa,EACb,YAAY,CAAC,CAAC,EACd,GAAGC,IACL,CAAW;EAEX,MAAMG,kBAAkB,GAAG,IAAIR,kBAAkB,CAC/CO,MACF,CAAC,CADiC;EACjC;;EAED;EACA,MAAME,eAAe,GAAGC,MAAM,CAACC,gBAAgB,CAC7CJ,MAAM,EACN;IACEK,IAAI,EAAE;MACJC,KAAK,EAAE,SAAAA,CAILC,MAAW,EACXC,OAAU,EACVC,MAAiC,EAClB;QACf,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,EAAE;UAC1B,OAAOR,kBAAkB,CAACW,QAAQ,CAAC;YACjCC,IAAI,EAAE,SAAS;YACfC,UAAU,EAAEP,MAAM,CAACQ,QAAQ;YAC3BC,UAAU,EAAET,MAAM,CAACU,WAAW;YAC9BC,QAAQ,EAAEV,OAAO;YACjBW,sBAAsB,EAAEV,MAAM,CAACQ;UACjC,CAAC,CAAC;QACJ;QACA,MAAMG,QAAyB,GAAG,EAAE;QAEpC,KAAK,MAAMC,IAAI,IAAIZ,MAAM,EAAE;UACzBW,QAAQ,CAACE,IAAI,CACXrB,kBAAkB,CAACW,QAAQ,CAAC;YA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 +1,21 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { writeableClientContext } from "./WriteableClient.js";
18
+ export async function flushEdits(client) {
19
+ await client[writeableClientContext].editRequestManager.flushPendingEdits();
20
+ }
21
+ //# sourceMappingURL=flushEdits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flushEdits.js","names":["writeableClientContext","flushEdits","client","editRequestManager","flushPendingEdits"],"sources":["flushEdits.ts"],"sourcesContent":["/*\n * Copyright 2026 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 {\n type WriteableClient,\n writeableClientContext,\n} from \"./WriteableClient.js\";\n\nexport async function flushEdits(client: WriteableClient<any>): Promise<void> {\n await client[writeableClientContext].editRequestManager.flushPendingEdits();\n return;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAEEA,sBAAsB,QACjB,sBAAsB;AAE7B,OAAO,eAAeC,UAAUA,CAACC,MAA4B,EAAiB;EAC5E,MAAMA,MAAM,CAACF,sBAAsB,CAAC,CAACG,kBAAkB,CAACC,iBAAiB,CAAC,CAAC;AAE7E","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export type { WriteableClient } from "../transactions/WriteableClient.js";
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cAAc,uBAAuB","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
@@ -1,3 +1,4 @@
1
1
  export { createWriteableClient } from "../transactions/createWriteableClient.js";
2
+ export { flushEdits } from "../transactions/flushEdits.js";
2
3
  export type { WriteableClient } from "../transactions/WriteableClient.js";
3
4
  export { getApiGatewayBaseUrl } from "../utils/getApiGatewayBaseUrl.js";
@@ -1 +1 @@
1
- {"mappings":"AAgBA,SAAS,6BAA6B;AACtC,cAAc,uBAAuB;AACrC,SAAS,4BAA4B","names":[],"sources":["../../../src/public/unstable-do-not-use.ts"],"version":3,"file":"unstable-do-not-use.d.ts"}
1
+ {"mappings":"AAgBA,SAAS,6BAA6B;AACtC,SAAS,kBAAkB;AAC3B,cAAc,uBAAuB;AACrC,SAAS,4BAA4B","names":[],"sources":["../../../src/public/unstable-do-not-use.ts"],"version":3,"file":"unstable-do-not-use.d.ts"}
@@ -10,4 +10,5 @@ export declare class EditRequestManager {
10
10
  postEdit(edit: TransactionEdit): Promise<void>;
11
11
  private createInitialPromiseWithTimeout;
12
12
  private dispatchRequest;
13
+ flushPendingEdits(): Promise<void>;
13
14
  }
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAEO,uBACA,0BAA2B;AAClC,cAAc,uBAAuB,sBAAuB;AAG5D,OAAO,cAAM,mBAAmB;CAC9B,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,QAAQ;CAER,AAAO,YAAYA,QAAQ;CAI3B,AAAO,SAASC,MAAM,kBAAkB;CA2BxC,QAAQ;CAgBR,QAAc;AAWf","names":["client: WriteableClient<any>","edit: TransactionEdit"],"sources":["../../../src/transactions/EditRequestManager.ts"],"version":3,"file":"EditRequestManager.d.ts"}
1
+ {"mappings":"AAgBA,cAEO,uBACA,0BAA2B;AAClC,cAAc,uBAAuB,sBAAuB;AAG5D,OAAO,cAAM,mBAAmB;CAC9B,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,QAAQ;CAER,AAAO,YAAYA,QAAQ;CAI3B,AAAO,SAASC,MAAM,kBAAkB;CA2BxC,QAAQ;CAgBR,QAAc;CAYd,AAAa,qBAAqB;AAuBnC","names":["client: WriteableClient<any>","edit: TransactionEdit"],"sources":["../../../src/transactions/EditRequestManager.ts"],"version":3,"file":"EditRequestManager.d.ts"}
@@ -1,9 +1,11 @@
1
1
  import type { Client } from "@osdk/client";
2
2
  import type { AddLinkApiNames, AddLinkSources, AddLinkTargets, CreatableObjectOrInterfaceTypeProperties, CreatableObjectOrInterfaceTypes, DeletableObjectOrInterfaceLocators, RemoveLinkApiNames, RemoveLinkSources, RemoveLinkTargets, UpdatableObjectOrInterfaceLocatorProperties, UpdatableObjectOrInterfaceLocators } from "../edits/EditBatch.js";
3
3
  import type { AnyEdit } from "../edits/types.js";
4
+ import type { EditRequestManager } from "./EditRequestManager.js";
4
5
  export interface WriteableClientContext {
5
6
  ontologyRid: string | Promise<string>;
6
- transactionRid: string;
7
+ transactionId: string;
8
+ editRequestManager: EditRequestManager;
7
9
  }
8
10
  export interface WriteableClient<X extends AnyEdit> extends Client, WriteMethods<X> {
9
11
  [writeableClientContext]: WriteableClientContext;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,cAAc,cAAe;AAE3C,cACE,iBACA,gBACA,gBACA,0CACA,iCACA,oCACA,oBACA,mBACA,mBACA,6CACA,0CACK,uBAAwB;AAC/B,cAAc,eAAe,mBAAoB;AAOjD,iBAAiB,uBAAuB;CACtC,sBAAsB;CACtB;AACD;AAED,iBAAiB,gBAAgB,UAAU,iBACjC,QAAQ,aAAa,GAC/B;EACG,yBAAyB;AAC3B;AAED,iBAAiB,aAAa,UAAU,SAAS;CAC/C;EACE,YAAY,eAAe;EAC3B,UAAU,gBAAgB,GAAG;GAE7BA,QAAQ,KACRC,SAAS,GACTC,QAAQ,eAAe,GAAG,KAAK,OAC5B;CAEL;EACE,YAAY,kBAAkB;EAC9B,UAAU,mBAAmB,GAAG;GAEhCF,QAAQ,KACRC,SAAS,GACTE,QAAQ,kBAAkB,GAAG,KAAK,OAC/B;CAEL,SAAS,YAAY,gCAAgC,IACnDC,KAAK,KACLC,YAAY,yCAAyC,GAAG,SACrD;CAEL,SAAS,WAAW,mCAAmC,IACrDC,KAAK,OACF;CAEL,SAAS,WAAW,mCAAmC,IACrDA,KAAK,IACLC,YAAY,4CAA4C,GAAG,QACxD;AACN","names":["source: SOL","apiName: A","target: AddLinkTargets<X, SOL, A>","target: RemoveLinkTargets<X, SOL, A>","obj: OTD","properties: CreatableObjectOrInterfaceTypeProperties<X, OTD>","obj: OL","properties: UpdatableObjectOrInterfaceLocatorProperties<X, OL>"],"sources":["../../../src/transactions/WriteableClient.ts"],"version":3,"file":"WriteableClient.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,cAAc,cAAe;AAE3C,cACE,iBACA,gBACA,gBACA,0CACA,iCACA,oCACA,oBACA,mBACA,mBACA,6CACA,0CACK,uBAAwB;AAC/B,cAAc,eAAe,mBAAoB;AACjD,cAAc,0BAA0B,yBAA0B;AAOlE,iBAAiB,uBAAuB;CACtC,sBAAsB;CACtB;CACA,oBAAoB;AACrB;AAED,iBAAiB,gBAAgB,UAAU,iBACjC,QAAQ,aAAa,GAC/B;EACG,yBAAyB;AAC3B;AAED,iBAAiB,aAAa,UAAU,SAAS;CAC/C;EACE,YAAY,eAAe;EAC3B,UAAU,gBAAgB,GAAG;GAE7BA,QAAQ,KACRC,SAAS,GACTC,QAAQ,eAAe,GAAG,KAAK,OAC5B;CAEL;EACE,YAAY,kBAAkB;EAC9B,UAAU,mBAAmB,GAAG;GAEhCF,QAAQ,KACRC,SAAS,GACTE,QAAQ,kBAAkB,GAAG,KAAK,OAC/B;CAEL,SAAS,YAAY,gCAAgC,IACnDC,KAAK,KACLC,YAAY,yCAAyC,GAAG,SACrD;CAEL,SAAS,WAAW,mCAAmC,IACrDC,KAAK,OACF;CAEL,SAAS,WAAW,mCAAmC,IACrDA,KAAK,IACLC,YAAY,4CAA4C,GAAG,QACxD;AACN","names":["source: SOL","apiName: A","target: AddLinkTargets<X, SOL, A>","target: RemoveLinkTargets<X, SOL, A>","obj: OTD","properties: CreatableObjectOrInterfaceTypeProperties<X, OTD>","obj: OL","properties: UpdatableObjectOrInterfaceLocatorProperties<X, OL>"],"sources":["../../../src/transactions/WriteableClient.ts"],"version":3,"file":"WriteableClient.d.ts"}
@@ -1,4 +1,4 @@
1
- import { createClientWithTransaction } from "@osdk/client/unstable-do-not-use";
1
+ import type { createClient } from "@osdk/client";
2
2
  import type { AnyEdit } from "../edits/types.js";
3
3
  import type { WriteableClient } from "./WriteableClient.js";
4
- export declare function createWriteableClient<X extends AnyEdit = never>(...args: Parameters<typeof createClientWithTransaction>): WriteableClient<X>;
4
+ export declare function createWriteableClient<X extends AnyEdit = never>(transactionId: string, ...args: Parameters<typeof createClient>): WriteableClient<X>;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,SAAS,mCAAmC,kCAAmC;AAgB/E,cAAc,eAAe,mBAAoB;AAGjD,cACE,uBAGK,sBAAuB;AAG9B,OAAO,iBAAS,sBACd,UAAU,iBAEV,GAAG,MAAM,kBAAkB,+BAC1B,gBAAgB","names":[],"sources":["../../../src/transactions/createWriteableClient.ts"],"version":3,"file":"createWriteableClient.d.ts"}
1
+ {"mappings":"AAkBA,cAAsB,oBAAoB,cAAe;AAczD,cAAc,eAAe,mBAAoB;AAGjD,cACE,uBAGK,sBAAuB;AAG9B,OAAO,iBAAS,sBACd,UAAU,iBAEVA,uBACA,GAAG,MAAM,kBAAkB,gBAC1B,gBAAgB","names":["transactionId: string"],"sources":["../../../src/transactions/createWriteableClient.ts"],"version":3,"file":"createWriteableClient.d.ts"}
@@ -0,0 +1,2 @@
1
+ import { type WriteableClient } from "./WriteableClient.js";
2
+ export declare function flushEdits(client: WriteableClient<any>): Promise<void>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cACO,uBAEA,sBAAuB;AAE9B,OAAO,iBAAe,WAAWA,QAAQ,uBAAuB","names":["client: WriteableClient<any>"],"sources":["../../../src/transactions/flushEdits.ts"],"version":3,"file":"flushEdits.d.ts"}
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export * from "./build/cjs/public/experimental.cjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/functions",
3
- "version": "1.5.0-beta.2",
3
+ "version": "1.5.0-beta.4",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -18,6 +18,15 @@
18
18
  "require": "./build/cjs/index.cjs",
19
19
  "default": "./build/browser/index.js"
20
20
  },
21
+ "./experimental": {
22
+ "browser": "./build/browser/public/experimental.js",
23
+ "import": {
24
+ "types": "./build/types/public/experimental.d.ts",
25
+ "default": "./build/esm/public/experimental.js"
26
+ },
27
+ "require": "./build/cjs/public/experimental.cjs",
28
+ "default": "./build/browser/public/experimental.js"
29
+ },
21
30
  "./internal": {
22
31
  "browser": "./build/browser/public/internal.js",
23
32
  "import": {
@@ -47,14 +56,14 @@
47
56
  }
48
57
  },
49
58
  "dependencies": {
50
- "@osdk/foundry.core": "^2.42.0",
51
- "@osdk/foundry.mediasets": "^2.42.0",
52
- "@osdk/foundry.ontologies": "^2.42.0",
59
+ "@osdk/foundry.core": "^2.44.0",
60
+ "@osdk/foundry.mediasets": "^2.44.0",
61
+ "@osdk/foundry.ontologies": "^2.44.0",
53
62
  "@types/geojson": "^7946.0.16",
54
63
  "yaml": "^2.8.1"
55
64
  },
56
65
  "peerDependencies": {
57
- "@osdk/client": "^2.7.0-beta.3"
66
+ "@osdk/client": "^2.7.0-beta.8"
58
67
  },
59
68
  "devDependencies": {
60
69
  "@microsoft/api-documenter": "^7.26.32",
@@ -64,10 +73,10 @@
64
73
  "p-defer": "^4.0.1",
65
74
  "ts-expect": "^1.3.0",
66
75
  "typescript": "~5.5.4",
67
- "@osdk/monorepo.api-extractor": "~0.6.0-beta.1",
68
- "@osdk/client.test.ontology": "~2.7.0-beta.3",
69
- "@osdk/shared.test": "~2.7.0-beta.2",
70
- "@osdk/monorepo.tsconfig": "~0.6.0-beta.1"
76
+ "@osdk/client.test.ontology": "~2.7.0-beta.8",
77
+ "@osdk/monorepo.tsconfig": "~0.6.0-beta.1",
78
+ "@osdk/shared.test": "~2.7.0-beta.3",
79
+ "@osdk/monorepo.api-extractor": "~0.6.0-beta.1"
71
80
  },
72
81
  "publishConfig": {
73
82
  "access": "public"