@osdk/functions 1.4.0-rc.10 → 1.4.0-rc.11

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @osdk/functions
2
2
 
3
+ ## 1.4.0-rc.11
4
+
5
+ ### Patch Changes
6
+
7
+ - 3d7dc0a: introduce new token field, note readToken as deprecated
8
+ - @osdk/client@2.6.0-rc.17
9
+
3
10
  ## 1.4.0-rc.10
4
11
 
5
12
  ### Patch Changes
@@ -28,6 +28,7 @@ export async function uploadMedia(client, mediaUpload) {
28
28
  mediaItemRid: gatewayMediaRef.reference.mediaSetViewItem.mediaItemRid,
29
29
  mediaSetRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetRid,
30
30
  mediaSetViewRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetViewRid,
31
+ token: gatewayMediaRef.reference.mediaSetViewItem.token,
31
32
  readToken: gatewayMediaRef.reference.mediaSetViewItem.token
32
33
  }
33
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"uploadMedia.js","names":["MediaSets","uploadMedia","client","mediaUpload","gatewayMediaRef","data","filename","fileName","preview","mimeType","reference","type","mediaSetViewItem","mediaItemRid","mediaSetRid","mediaSetViewRid","readToken","token"],"sources":["uploadMedia.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 { Client, MediaReference, MediaUpload } from \"@osdk/client\";\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\n\nexport async function uploadMedia(\n client: Client,\n mediaUpload: MediaUpload,\n): Promise<MediaReference> {\n const gatewayMediaRef = await MediaSets.uploadMedia(\n client,\n mediaUpload.data,\n {\n filename: mediaUpload.fileName,\n preview: true,\n },\n );\n\n return {\n mimeType: gatewayMediaRef.mimeType,\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: gatewayMediaRef.reference.mediaSetViewItem.mediaItemRid,\n mediaSetRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetRid,\n mediaSetViewRid:\n gatewayMediaRef.reference.mediaSetViewItem.mediaSetViewRid,\n readToken: gatewayMediaRef.reference.mediaSetViewItem.token,\n },\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,SAAS,QAAQ,yBAAyB;AAEnD,OAAO,eAAeC,WAAWA,CAC/BC,MAAc,EACdC,WAAwB,EACC;EACzB,MAAMC,eAAe,GAAG,MAAMJ,SAAS,CAACC,WAAW,CACjDC,MAAM,EACNC,WAAW,CAACE,IAAI,EAChB;IACEC,QAAQ,EAAEH,WAAW,CAACI,QAAQ;IAC9BC,OAAO,EAAE;EACX,CACF,CAAC;EAED,OAAO;IACLC,QAAQ,EAAEL,eAAe,CAACK,QAAQ;IAClCC,SAAS,EAAE;MACTC,IAAI,EAAE,kBAAkB;MACxBC,gBAAgB,EAAE;QAChBC,YAAY,EAAET,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACC,YAAY;QACrEC,WAAW,EAAEV,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACE,WAAW;QACnEC,eAAe,EACbX,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACG,eAAe;QAC5DC,SAAS,EAAEZ,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACK;MACxD;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"uploadMedia.js","names":["MediaSets","uploadMedia","client","mediaUpload","gatewayMediaRef","data","filename","fileName","preview","mimeType","reference","type","mediaSetViewItem","mediaItemRid","mediaSetRid","mediaSetViewRid","token","readToken"],"sources":["uploadMedia.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 { Client, MediaReference, MediaUpload } from \"@osdk/client\";\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\n\nexport async function uploadMedia(\n client: Client,\n mediaUpload: MediaUpload,\n): Promise<MediaReference> {\n const gatewayMediaRef = await MediaSets.uploadMedia(\n client,\n mediaUpload.data,\n {\n filename: mediaUpload.fileName,\n preview: true,\n },\n );\n\n return {\n mimeType: gatewayMediaRef.mimeType,\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: gatewayMediaRef.reference.mediaSetViewItem.mediaItemRid,\n mediaSetRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetRid,\n mediaSetViewRid:\n gatewayMediaRef.reference.mediaSetViewItem.mediaSetViewRid,\n token: gatewayMediaRef.reference.mediaSetViewItem.token,\n readToken: gatewayMediaRef.reference.mediaSetViewItem.token,\n },\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,SAAS,QAAQ,yBAAyB;AAEnD,OAAO,eAAeC,WAAWA,CAC/BC,MAAc,EACdC,WAAwB,EACC;EACzB,MAAMC,eAAe,GAAG,MAAMJ,SAAS,CAACC,WAAW,CACjDC,MAAM,EACNC,WAAW,CAACE,IAAI,EAChB;IACEC,QAAQ,EAAEH,WAAW,CAACI,QAAQ;IAC9BC,OAAO,EAAE;EACX,CACF,CAAC;EAED,OAAO;IACLC,QAAQ,EAAEL,eAAe,CAACK,QAAQ;IAClCC,SAAS,EAAE;MACTC,IAAI,EAAE,kBAAkB;MACxBC,gBAAgB,EAAE;QAChBC,YAAY,EAAET,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACC,YAAY;QACrEC,WAAW,EAAEV,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACE,WAAW;QACnEC,eAAe,EACbX,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACG,eAAe;QAC5DC,KAAK,EAAEZ,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACI,KAAK;QACvDC,SAAS,EAAEb,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACI;MACxD;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -185,6 +185,7 @@ async function uploadMedia2(client, mediaUpload) {
185
185
  mediaItemRid: gatewayMediaRef.reference.mediaSetViewItem.mediaItemRid,
186
186
  mediaSetRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetRid,
187
187
  mediaSetViewRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetViewRid,
188
+ token: gatewayMediaRef.reference.mediaSetViewItem.token,
188
189
  readToken: gatewayMediaRef.reference.mediaSetViewItem.token
189
190
  }
190
191
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/edits/types.ts","../../src/edits/createEditBatch.ts","../../src/errors/UserFacingError.ts","../../../../node_modules/.pnpm/@osdk+foundry.mediasets@2.42.0/node_modules/@osdk/foundry.mediasets/build/esm/public/MediaSet.js","../../src/helpers/uploadMedia.ts"],"names":["__export","foundryPlatformFetch","uploadMedia"],"mappings":";;;;;AAmBO,SAAS,mBAAmB,GAAK,EAAA;AACtC,EAAA,OAAO,GAAO,IAAA,IAAA,IAAQ,OAAO,GAAA,KAAQ,YAAY,OAAO,GAAA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M,YAAY,CAAC,CAAA,EAAG,kEAAoE,EAAA,CAAA,IAAI,KAAK,CAAA;AAW5F,SAAS,QAAA,CAAS,SAAS,IAAM,EAAA;AACtC,EAAA,OAAOA,sCAAsB,CAAA,IAAA,EAAM,SAAW,EAAA,GAAG,IAAI,CAAA;AACvD;AACA,IAAM,YAAe,GAAA,CAAC,CAAG,EAAA,4BAAA,EAA8B,GAAG,KAAK,CAAA;AAcxD,SAAS,WAAA,CAAY,SAAS,IAAM,EAAA;AACzC,EAAA,OAAOA,sCAAsB,CAAA,IAAA,EAAM,YAAc,EAAA,GAAG,IAAI,CAAA;AAC1D;;;ACxJA,eAAsBC,YAAAA,CAAY,QAAQ,WAAa,EAAA;AACrD,EAAA,MAAM,kBAAkB,MAAM,gBAAA,CAAU,WAAY,CAAA,MAAA,EAAQ,YAAY,IAAM,EAAA;AAAA,IAC5E,UAAU,WAAY,CAAA,QAAA;AAAA,IACtB,OAAS,EAAA;AAAA,GACV,CAAA;AACD,EAAO,OAAA;AAAA,IACL,UAAU,eAAgB,CAAA,QAAA;AAAA,IAC1B,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,kBAAA;AAAA,MACN,gBAAkB,EAAA;AAAA,QAChB,YAAA,EAAc,eAAgB,CAAA,SAAA,CAAU,gBAAiB,CAAA,YAAA;AAAA,QACzD,WAAA,EAAa,eAAgB,CAAA,SAAA,CAAU,gBAAiB,CAAA,WAAA;AAAA,QACxD,eAAA,EAAiB,eAAgB,CAAA,SAAA,CAAU,gBAAiB,CAAA,eAAA;AAAA,QAC5D,SAAA,EAAW,eAAgB,CAAA,SAAA,CAAU,gBAAiB,CAAA;AAAA;AACxD;AACF,GACF;AACF","file":"index.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 */\nexport let Edits;\n// Check if locator is for an interface by comparing $apiName and $objectType.\n// Both object types and interfaces store the object type API name in $objectType,\n// but interfaces store the interface API name in $apiName.\nexport function isInterfaceLocator(obj) {\n return obj != null && typeof obj === \"object\" && typeof obj.$objectType === \"string\" && typeof obj.$apiName === \"string\" && obj.$apiName !== obj.$objectType;\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 { isInterfaceLocator } from \"./types.js\";\nclass InMemoryEditBatch {\n edits = [];\n link(source, apiName, target) {\n if (!Array.isArray(target)) {\n this.edits.push({\n type: \"addLink\",\n source,\n apiName,\n target\n });\n return;\n }\n for (const elem of target) {\n this.edits.push({\n type: \"addLink\",\n source,\n apiName,\n target: elem\n });\n }\n }\n unlink(source, apiName, target) {\n if (!Array.isArray(target)) {\n this.edits.push({\n type: \"removeLink\",\n source,\n apiName,\n target\n });\n return;\n }\n for (const elem of target) {\n this.edits.push({\n type: \"removeLink\",\n source,\n apiName,\n target: elem\n });\n }\n }\n create(objectOrInterfaceType, properties) {\n if (objectOrInterfaceType.type === \"interface\") {\n this.edits.push({\n type: \"createObjectForInterface\",\n int: objectOrInterfaceType,\n properties\n });\n return;\n }\n this.edits.push({\n type: \"createObject\",\n obj: objectOrInterfaceType,\n properties\n });\n }\n delete(obj) {\n if (isInterfaceLocator(obj)) {\n this.edits.push({\n type: \"deleteObjectForInterface\",\n obj\n });\n return;\n }\n this.edits.push({\n type: \"deleteObject\",\n obj\n });\n }\n update(obj, properties) {\n if (isInterfaceLocator(obj)) {\n this.edits.push({\n type: \"updateObjectForInterface\",\n obj,\n properties\n });\n return;\n }\n this.edits.push({\n type: \"updateObject\",\n obj,\n properties\n });\n }\n getEdits() {\n return [...this.edits];\n }\n}\nexport function createEditBatch(_client) {\n return new InMemoryEditBatch();\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\nexport class UserFacingError extends Error {\n constructor(message) {\n super(message);\n }\n}","/*\n * Copyright 2024 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 */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _abort = [1, \"/v2/mediasets/{0}/transactions/{1}/abort\", 2];\n/**\n * Aborts an open transaction. Items uploaded to the media set during this transaction will be deleted.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/abort\n */\nexport function abort($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _abort, ...args);\n}\nconst _calculate = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/calculate\", 6];\n/**\n * Starts calculation of a thumbnail for a given image.\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/calculate\n */\nexport function calculate($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _calculate, ...args);\n}\nconst _commit = [1, \"/v2/mediasets/{0}/transactions/{1}/commit\", 2];\n/**\n * Commits an open transaction. On success, items uploaded to the media set during this transaction will become available.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/commit\n */\nexport function commit($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _commit, ...args);\n}\nconst _create = [1, \"/v2/mediasets/{0}/transactions\", 2];\n/**\n * Creates a new transaction. Items uploaded to the media set while this transaction is open will not be reflected until the transaction is committed.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions\n */\nexport function create($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _create, ...args);\n}\nconst _info = [0, \"/v2/mediasets/{0}/items/{1}\", 6];\n/**\n * Gets information about the media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}\n */\nexport function info($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _info, ...args);\n}\nconst _reference = [0, \"/v2/mediasets/{0}/items/{1}/reference\", 6];\n/**\n * Gets the [media reference](https://www.palantir.com/docs/foundry/data-integration/media-sets/#media-references) for this media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/reference\n */\nexport function reference($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _reference, ...args);\n}\nconst _getRidByPath = [0, \"/v2/mediasets/{0}/items/getRidByPath\", 2];\n/**\n * Returns the media item RID for the media item with the specified path.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/getRidByPath\n */\nexport function getRidByPath($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getRidByPath, ...args);\n}\nconst _upload = [1, \"/v2/mediasets/{0}/items\", 3, \"*/*\"];\n/**\n * Uploads a media item to an existing media set.\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * A branch name, or branch rid, or view rid may optionally be specified. If none is specified, the item will be uploaded to the default branch. If more than one is specified, an error is thrown.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/items\n */\nexport function upload($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _upload, ...args);\n}\nconst _read = [0, \"/v2/mediasets/{0}/items/{1}/content\", 6,, \"*/*\"];\n/**\n * Gets the content of a media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/content\n */\nexport function read($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _read, ...args);\n}\nconst _readOriginal = [0, \"/v2/mediasets/{0}/items/{1}/original\", 6,, \"*/*\"];\n/**\n * Gets the content of an original file uploaded to the media item, even if it was transformed on upload due to being an additional input format.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/original\n */\nexport function readOriginal($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _readOriginal, ...args);\n}\nconst _retrieve = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/retrieve\", 6,, \"*/*\"];\n/**\n * Retrieves a successfully calculated thumbnail for a given image.\n *\n * Thumbnails are 200px wide in the format of `image/webp`\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/retrieve\n */\nexport function retrieve($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _retrieve, ...args);\n}\nconst _uploadMedia = [2, \"/v2/mediasets/media/upload\", 7, \"*/*\"];\n/**\n * Uploads a temporary media item. If the media item isn't persisted within 1 hour, the item will be deleted.\n *\n * If multiple resources are attributed to, usage will be attributed to the first one in the list.\n *\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * Third-party applications using this endpoint via OAuth2 must request the following operation scopes: `api:ontologies-read api:ontologies-write`.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/mediasets/media/upload\n */\nexport function uploadMedia($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _uploadMedia, ...args);\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 { MediaSets } from \"@osdk/foundry.mediasets\";\nexport async function uploadMedia(client, mediaUpload) {\n const gatewayMediaRef = await MediaSets.uploadMedia(client, mediaUpload.data, {\n filename: mediaUpload.fileName,\n preview: true\n });\n return {\n mimeType: gatewayMediaRef.mimeType,\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: gatewayMediaRef.reference.mediaSetViewItem.mediaItemRid,\n mediaSetRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetRid,\n mediaSetViewRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetViewRid,\n readToken: gatewayMediaRef.reference.mediaSetViewItem.token\n }\n }\n };\n}"]}
1
+ {"version":3,"sources":["../../src/edits/types.ts","../../src/edits/createEditBatch.ts","../../src/errors/UserFacingError.ts","../../../../node_modules/.pnpm/@osdk+foundry.mediasets@2.42.0/node_modules/@osdk/foundry.mediasets/build/esm/public/MediaSet.js","../../src/helpers/uploadMedia.ts"],"names":["__export","foundryPlatformFetch","uploadMedia"],"mappings":";;;;;AAmBO,SAAS,mBAAmB,GAAK,EAAA;AACtC,EAAA,OAAO,GAAO,IAAA,IAAA,IAAQ,OAAO,GAAA,KAAQ,YAAY,OAAO,GAAA,CAAI,WAAgB,KAAA,QAAA,IAAY,OAAO,GAAI,CAAA,QAAA,KAAa,QAAY,IAAA,GAAA,CAAI,aAAa,GAAI,CAAA,WAAA;AACnJ;;;ACJA,IAAM,oBAAN,MAAwB;AAAA,EACtB,QAAQ,EAAC;AAAA,EACT,IAAA,CAAK,MAAQ,EAAA,OAAA,EAAS,MAAQ,EAAA;AAC5B,IAAA,IAAI,CAAC,KAAA,CAAM,OAAQ,CAAA,MAAM,CAAG,EAAA;AAC1B,MAAA,IAAA,CAAK,MAAM,IAAK,CAAA;AAAA,QACd,IAAM,EAAA,SAAA;AAAA,QACN,MAAA;AAAA,QACA,OAAA;AAAA,QACA;AAAA,OACD,CAAA;AACD,MAAA;AAAA;AAEF,IAAA,KAAA,MAAW,QAAQ,MAAQ,EAAA;AACzB,MAAA,IAAA,CAAK,MAAM,IAAK,CAAA;AAAA,QACd,IAAM,EAAA,SAAA;AAAA,QACN,MAAA;AAAA,QACA,OAAA;AAAA,QACA,MAAQ,EAAA;AAAA,OACT,CAAA;AAAA;AACH;AACF,EACA,MAAA,CAAO,MAAQ,EAAA,OAAA,EAAS,MAAQ,EAAA;AAC9B,IAAA,IAAI,CAAC,KAAA,CAAM,OAAQ,CAAA,MAAM,CAAG,EAAA;AAC1B,MAAA,IAAA,CAAK,MAAM,IAAK,CAAA;AAAA,QACd,IAAM,EAAA,YAAA;AAAA,QACN,MAAA;AAAA,QACA,OAAA;AAAA,QACA;AAAA,OACD,CAAA;AACD,MAAA;AAAA;AAEF,IAAA,K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eAAA;AAAA,QAC5D,KAAA,EAAO,eAAgB,CAAA,SAAA,CAAU,gBAAiB,CAAA,KAAA;AAAA,QAClD,SAAA,EAAW,eAAgB,CAAA,SAAA,CAAU,gBAAiB,CAAA;AAAA;AACxD;AACF,GACF;AACF","file":"index.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 */\nexport let Edits;\n// Check if locator is for an interface by comparing $apiName and $objectType.\n// Both object types and interfaces store the object type API name in $objectType,\n// but interfaces store the interface API name in $apiName.\nexport function isInterfaceLocator(obj) {\n return obj != null && typeof obj === \"object\" && typeof obj.$objectType === \"string\" && typeof obj.$apiName === \"string\" && obj.$apiName !== obj.$objectType;\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 { isInterfaceLocator } from \"./types.js\";\nclass InMemoryEditBatch {\n edits = [];\n link(source, apiName, target) {\n if (!Array.isArray(target)) {\n this.edits.push({\n type: \"addLink\",\n source,\n apiName,\n target\n });\n return;\n }\n for (const elem of target) {\n this.edits.push({\n type: \"addLink\",\n source,\n apiName,\n target: elem\n });\n }\n }\n unlink(source, apiName, target) {\n if (!Array.isArray(target)) {\n this.edits.push({\n type: \"removeLink\",\n source,\n apiName,\n target\n });\n return;\n }\n for (const elem of target) {\n this.edits.push({\n type: \"removeLink\",\n source,\n apiName,\n target: elem\n });\n }\n }\n create(objectOrInterfaceType, properties) {\n if (objectOrInterfaceType.type === \"interface\") {\n this.edits.push({\n type: \"createObjectForInterface\",\n int: objectOrInterfaceType,\n properties\n });\n return;\n }\n this.edits.push({\n type: \"createObject\",\n obj: objectOrInterfaceType,\n properties\n });\n }\n delete(obj) {\n if (isInterfaceLocator(obj)) {\n this.edits.push({\n type: \"deleteObjectForInterface\",\n obj\n });\n return;\n }\n this.edits.push({\n type: \"deleteObject\",\n obj\n });\n }\n update(obj, properties) {\n if (isInterfaceLocator(obj)) {\n this.edits.push({\n type: \"updateObjectForInterface\",\n obj,\n properties\n });\n return;\n }\n this.edits.push({\n type: \"updateObject\",\n obj,\n properties\n });\n }\n getEdits() {\n return [...this.edits];\n }\n}\nexport function createEditBatch(_client) {\n return new InMemoryEditBatch();\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\nexport class UserFacingError extends Error {\n constructor(message) {\n super(message);\n }\n}","/*\n * Copyright 2024 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 */\nimport { foundryPlatformFetch as $foundryPlatformFetch } from \"@osdk/shared.net.platformapi\";\n//\nconst _abort = [1, \"/v2/mediasets/{0}/transactions/{1}/abort\", 2];\n/**\n * Aborts an open transaction. Items uploaded to the media set during this transaction will be deleted.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/abort\n */\nexport function abort($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _abort, ...args);\n}\nconst _calculate = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/calculate\", 6];\n/**\n * Starts calculation of a thumbnail for a given image.\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/calculate\n */\nexport function calculate($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _calculate, ...args);\n}\nconst _commit = [1, \"/v2/mediasets/{0}/transactions/{1}/commit\", 2];\n/**\n * Commits an open transaction. On success, items uploaded to the media set during this transaction will become available.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions/{transactionId}/commit\n */\nexport function commit($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _commit, ...args);\n}\nconst _create = [1, \"/v2/mediasets/{0}/transactions\", 2];\n/**\n * Creates a new transaction. Items uploaded to the media set while this transaction is open will not be reflected until the transaction is committed.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/transactions\n */\nexport function create($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _create, ...args);\n}\nconst _info = [0, \"/v2/mediasets/{0}/items/{1}\", 6];\n/**\n * Gets information about the media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}\n */\nexport function info($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _info, ...args);\n}\nconst _reference = [0, \"/v2/mediasets/{0}/items/{1}/reference\", 6];\n/**\n * Gets the [media reference](https://www.palantir.com/docs/foundry/data-integration/media-sets/#media-references) for this media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/reference\n */\nexport function reference($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _reference, ...args);\n}\nconst _getRidByPath = [0, \"/v2/mediasets/{0}/items/getRidByPath\", 2];\n/**\n * Returns the media item RID for the media item with the specified path.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/getRidByPath\n */\nexport function getRidByPath($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _getRidByPath, ...args);\n}\nconst _upload = [1, \"/v2/mediasets/{0}/items\", 3, \"*/*\"];\n/**\n * Uploads a media item to an existing media set.\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * A branch name, or branch rid, or view rid may optionally be specified. If none is specified, the item will be uploaded to the default branch. If more than one is specified, an error is thrown.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-write]\n * URL: /v2/mediasets/{mediaSetRid}/items\n */\nexport function upload($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _upload, ...args);\n}\nconst _read = [0, \"/v2/mediasets/{0}/items/{1}/content\", 6,, \"*/*\"];\n/**\n * Gets the content of a media item.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/content\n */\nexport function read($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _read, ...args);\n}\nconst _readOriginal = [0, \"/v2/mediasets/{0}/items/{1}/original\", 6,, \"*/*\"];\n/**\n * Gets the content of an original file uploaded to the media item, even if it was transformed on upload due to being an additional input format.\n *\n * @beta\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/original\n */\nexport function readOriginal($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _readOriginal, ...args);\n}\nconst _retrieve = [0, \"/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/retrieve\", 6,, \"*/*\"];\n/**\n * Retrieves a successfully calculated thumbnail for a given image.\n *\n * Thumbnails are 200px wide in the format of `image/webp`\n *\n * @alpha\n *\n * Required Scopes: [api:mediasets-read]\n * URL: /v2/mediasets/{mediaSetRid}/items/{mediaItemRid}/transform/imagery/thumbnail/retrieve\n */\nexport function retrieve($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _retrieve, ...args);\n}\nconst _uploadMedia = [2, \"/v2/mediasets/media/upload\", 7, \"*/*\"];\n/**\n * Uploads a temporary media item. If the media item isn't persisted within 1 hour, the item will be deleted.\n *\n * If multiple resources are attributed to, usage will be attributed to the first one in the list.\n *\n * The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.\n * Third-party applications using this endpoint via OAuth2 must request the following operation scopes: `api:ontologies-read api:ontologies-write`.\n *\n * @beta\n *\n * Required Scopes: [api:ontologies-read, api:ontologies-write]\n * URL: /v2/mediasets/media/upload\n */\nexport function uploadMedia($ctx, ...args) {\n return $foundryPlatformFetch($ctx, _uploadMedia, ...args);\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 { MediaSets } from \"@osdk/foundry.mediasets\";\nexport async function uploadMedia(client, mediaUpload) {\n const gatewayMediaRef = await MediaSets.uploadMedia(client, mediaUpload.data, {\n filename: mediaUpload.fileName,\n preview: true\n });\n return {\n mimeType: gatewayMediaRef.mimeType,\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: gatewayMediaRef.reference.mediaSetViewItem.mediaItemRid,\n mediaSetRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetRid,\n mediaSetViewRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetViewRid,\n token: gatewayMediaRef.reference.mediaSetViewItem.token,\n readToken: gatewayMediaRef.reference.mediaSetViewItem.token\n }\n }\n };\n}"]}
@@ -28,6 +28,7 @@ export async function uploadMedia(client, mediaUpload) {
28
28
  mediaItemRid: gatewayMediaRef.reference.mediaSetViewItem.mediaItemRid,
29
29
  mediaSetRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetRid,
30
30
  mediaSetViewRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetViewRid,
31
+ token: gatewayMediaRef.reference.mediaSetViewItem.token,
31
32
  readToken: gatewayMediaRef.reference.mediaSetViewItem.token
32
33
  }
33
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"uploadMedia.js","names":["MediaSets","uploadMedia","client","mediaUpload","gatewayMediaRef","data","filename","fileName","preview","mimeType","reference","type","mediaSetViewItem","mediaItemRid","mediaSetRid","mediaSetViewRid","readToken","token"],"sources":["uploadMedia.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 { Client, MediaReference, MediaUpload } from \"@osdk/client\";\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\n\nexport async function uploadMedia(\n client: Client,\n mediaUpload: MediaUpload,\n): Promise<MediaReference> {\n const gatewayMediaRef = await MediaSets.uploadMedia(\n client,\n mediaUpload.data,\n {\n filename: mediaUpload.fileName,\n preview: true,\n },\n );\n\n return {\n mimeType: gatewayMediaRef.mimeType,\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: gatewayMediaRef.reference.mediaSetViewItem.mediaItemRid,\n mediaSetRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetRid,\n mediaSetViewRid:\n gatewayMediaRef.reference.mediaSetViewItem.mediaSetViewRid,\n readToken: gatewayMediaRef.reference.mediaSetViewItem.token,\n },\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,SAAS,QAAQ,yBAAyB;AAEnD,OAAO,eAAeC,WAAWA,CAC/BC,MAAc,EACdC,WAAwB,EACC;EACzB,MAAMC,eAAe,GAAG,MAAMJ,SAAS,CAACC,WAAW,CACjDC,MAAM,EACNC,WAAW,CAACE,IAAI,EAChB;IACEC,QAAQ,EAAEH,WAAW,CAACI,QAAQ;IAC9BC,OAAO,EAAE;EACX,CACF,CAAC;EAED,OAAO;IACLC,QAAQ,EAAEL,eAAe,CAACK,QAAQ;IAClCC,SAAS,EAAE;MACTC,IAAI,EAAE,kBAAkB;MACxBC,gBAAgB,EAAE;QAChBC,YAAY,EAAET,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACC,YAAY;QACrEC,WAAW,EAAEV,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACE,WAAW;QACnEC,eAAe,EACbX,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACG,eAAe;QAC5DC,SAAS,EAAEZ,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACK;MACxD;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"uploadMedia.js","names":["MediaSets","uploadMedia","client","mediaUpload","gatewayMediaRef","data","filename","fileName","preview","mimeType","reference","type","mediaSetViewItem","mediaItemRid","mediaSetRid","mediaSetViewRid","token","readToken"],"sources":["uploadMedia.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 { Client, MediaReference, MediaUpload } from \"@osdk/client\";\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\n\nexport async function uploadMedia(\n client: Client,\n mediaUpload: MediaUpload,\n): Promise<MediaReference> {\n const gatewayMediaRef = await MediaSets.uploadMedia(\n client,\n mediaUpload.data,\n {\n filename: mediaUpload.fileName,\n preview: true,\n },\n );\n\n return {\n mimeType: gatewayMediaRef.mimeType,\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: gatewayMediaRef.reference.mediaSetViewItem.mediaItemRid,\n mediaSetRid: gatewayMediaRef.reference.mediaSetViewItem.mediaSetRid,\n mediaSetViewRid:\n gatewayMediaRef.reference.mediaSetViewItem.mediaSetViewRid,\n token: gatewayMediaRef.reference.mediaSetViewItem.token,\n readToken: gatewayMediaRef.reference.mediaSetViewItem.token,\n },\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,SAAS,QAAQ,yBAAyB;AAEnD,OAAO,eAAeC,WAAWA,CAC/BC,MAAc,EACdC,WAAwB,EACC;EACzB,MAAMC,eAAe,GAAG,MAAMJ,SAAS,CAACC,WAAW,CACjDC,MAAM,EACNC,WAAW,CAACE,IAAI,EAChB;IACEC,QAAQ,EAAEH,WAAW,CAACI,QAAQ;IAC9BC,OAAO,EAAE;EACX,CACF,CAAC;EAED,OAAO;IACLC,QAAQ,EAAEL,eAAe,CAACK,QAAQ;IAClCC,SAAS,EAAE;MACTC,IAAI,EAAE,kBAAkB;MACxBC,gBAAgB,EAAE;QAChBC,YAAY,EAAET,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACC,YAAY;QACrEC,WAAW,EAAEV,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACE,WAAW;QACnEC,eAAe,EACbX,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACG,eAAe;QAC5DC,KAAK,EAAEZ,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACI,KAAK;QACvDC,SAAS,EAAEb,eAAe,CAACM,SAAS,CAACE,gBAAgB,CAACI;MACxD;IACF;EACF,CAAC;AACH","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/functions",
3
- "version": "1.4.0-rc.10",
3
+ "version": "1.4.0-rc.11",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -54,7 +54,7 @@
54
54
  "yaml": "^2.8.1"
55
55
  },
56
56
  "peerDependencies": {
57
- "@osdk/client": "^2.6.0-rc.14"
57
+ "@osdk/client": "^2.6.0-rc.17"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@microsoft/api-documenter": "^7.26.32",
@@ -64,10 +64,10 @@
64
64
  "p-defer": "^4.0.1",
65
65
  "ts-expect": "^1.3.0",
66
66
  "typescript": "~5.5.4",
67
- "@osdk/client.test.ontology": "~2.6.0-rc.14",
68
- "@osdk/monorepo.tsconfig": "~0.5.0-beta.1",
67
+ "@osdk/client.test.ontology": "~2.6.0-rc.17",
68
+ "@osdk/monorepo.api-extractor": "~0.5.0-beta.1",
69
69
  "@osdk/shared.test": "~2.6.0-rc.6",
70
- "@osdk/monorepo.api-extractor": "~0.5.0-beta.1"
70
+ "@osdk/monorepo.tsconfig": "~0.5.0-beta.1"
71
71
  },
72
72
  "publishConfig": {
73
73
  "access": "public"