{"version":3,"sources":["../../src/aliases/index.ts","../../src/aliases/types.ts","../../src/aliases/environment.ts","../../src/aliases/loaders.ts","../../src/aliases/custom.ts","../../src/aliases/model.ts","../../src/aliases/source.ts","../../src/edits/types.ts","../../src/edits/createEditBatch.ts","../../src/errors/UserFacingError.ts","../../../../node_modules/.pnpm/@osdk+foundry.mediasets@2.44.0/node_modules/@osdk/foundry.mediasets/build/esm/public/MediaSet.js","../../src/helpers/uploadMedia.ts"],"names":["__export","AliasEnvironment","fs","custom","model","source","foundryPlatformFetch","uploadMedia","createMediaFromReference"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,eAAA,GAAA;AAAAA,0BAAA,CAAA,eAAA,EAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,MAAA,EAAA,MAAA;AAAA,CAAA,CAAA;;;ACoBO,IAAI,gBAAA,6BAA0CC,iBAAAA,EAAkB;AACrE,EAAAA,iBAAAA,CAAiB,WAAW,CAAA,GAAI,WAAA;AAChC,EAAAA,iBAAAA,CAAiB,cAAc,CAAA,GAAI,cAAA;AACnC,EAAA,OAAOA,iBAAAA;AACT,CAAA,EAAE,EAAE,CAAA;;;ACPG,IAAM,yBAAA,GAA4B,mBAAA;AAClC,IAAM,2BAAA,GAA8B,qBAAA;AACpC,SAAS,iBAAA,GAAoB;AAClC,EAAA,MAAM,cAAA,GAAiB,6BAA6B,OAAA,CAAQ,GAAA;AAC5D,EAAA,MAAM,gBAAA,GAAmB,+BAA+B,OAAA,CAAQ,GAAA;AAChE,EAAA,IAAI,kBAAkB,gBAAA,EAAkB;AACtC,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,oCAAA,EAAuC,yBAAyB,CAAA,KAAA,EAAa,2BAA2B,CAAA,wCAAA,CAA0C,CAAA;AAAA,EACpK;AACA,EAAA,IAAI,cAAA,EAAgB;AAClB,IAAA,OAAO,gBAAA,CAAiB,S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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 * from \"./custom.js\";\nexport * from \"./model.js\";\nexport * from \"./source.js\";","/*\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\n// Types relevant to OSDK APIs\n\n// Environment\n\nexport let AliasEnvironment = /*#__PURE__*/function (AliasEnvironment) {\n  AliasEnvironment[\"PUBLISHED\"] = \"PUBLISHED\";\n  AliasEnvironment[\"LIVE_PREVIEW\"] = \"LIVE_PREVIEW\";\n  return AliasEnvironment;\n}({});\n\n// Live preview mode types (resources.json)\n\n// Published mode types (aliases.json)","/*\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 { AliasEnvironment } from \"./types.js\";\nexport const ALIASES_JSON_FILE_ENV_VAR = \"ALIASES_JSON_FILE\";\nexport const RESOURCES_JSON_FILE_ENV_VAR = \"RESOURCES_JSON_FILE\";\nexport function detectEnvironment() {\n  const aliasesFileSet = ALIASES_JSON_FILE_ENV_VAR in process.env;\n  const resourcesFileSet = RESOURCES_JSON_FILE_ENV_VAR in process.env;\n  if (aliasesFileSet && resourcesFileSet) {\n    throw new Error(`Ambiguous alias configuration: both ${ALIASES_JSON_FILE_ENV_VAR} and ` + `${RESOURCES_JSON_FILE_ENV_VAR} are set. Only one should be configured.`);\n  }\n  if (aliasesFileSet) {\n    return AliasEnvironment.PUBLISHED;\n  }\n  if (resourcesFileSet) {\n    return AliasEnvironment.LIVE_PREVIEW;\n  }\n  throw new Error(`Unknown alias environment: neither ${ALIASES_JSON_FILE_ENV_VAR} nor ${RESOURCES_JSON_FILE_ENV_VAR} is set.`);\n}\nexport function getAliasesFilePath() {\n  const path = process.env[ALIASES_JSON_FILE_ENV_VAR];\n  if (path == null) {\n    throw new Error(`${ALIASES_JSON_FILE_ENV_VAR} environment variable is not set`);\n  }\n  return path;\n}\nexport function getResourcesFilePath() {\n  const path = process.env[RESOURCES_JSON_FILE_ENV_VAR];\n  if (path == null) {\n    throw new Error(`${RESOURCES_JSON_FILE_ENV_VAR} environment variable is not set`);\n  }\n  return path;\n}","/*\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 * as fs from \"fs\";\nimport { detectEnvironment, getAliasesFilePath, getResourcesFilePath } from \"./environment.js\";\nimport { AliasEnvironment } from \"./types.js\";\nlet cachedPublishedAliases;\nfunction loadPublishedAliases() {\n  if (cachedPublishedAliases !== undefined) {\n    return cachedPublishedAliases;\n  }\n  const aliasesPath = getAliasesFilePath();\n  if (!fs.existsSync(aliasesPath)) {\n    throw new Error(`Aliases file not found at ${aliasesPath}`);\n  }\n  const data = fs.readFileSync(aliasesPath, \"utf-8\");\n  const aliasesFile = JSON.parse(data);\n  cachedPublishedAliases = {\n    custom: loadCustom(aliasesFile.defaults.custom),\n    models: loadPublishedModels(aliasesFile.defaults.models),\n    sources: loadPublishedSources(aliasesFile.defaults.egressConnections)\n  };\n  return cachedPublishedAliases;\n}\nfunction loadPreviewAliases() {\n  const resourcesPath = getResourcesFilePath();\n  if (!fs.existsSync(resourcesPath)) {\n    throw new Error(`Resources file not found at ${resourcesPath}`);\n  }\n  const data = fs.readFileSync(resourcesPath, \"utf-8\");\n  const resourcesFile = JSON.parse(data);\n  return {\n    custom: loadCustom(resourcesFile.resources.custom),\n    models: loadPreviewModels(resourcesFile.resources.models),\n    sources: loadPreviewSources(resourcesFile.egress.connections)\n  };\n}\nfunction loadCustom(custom) {\n  return custom;\n}\nfunction loadPublishedModels(models) {\n  return Object.fromEntries(Object.entries(models).map(([alias, {\n    id: identifier\n  }]) => [alias, identifier]));\n}\nfunction loadPublishedSources(egressConnections) {\n  return Object.fromEntries(Object.entries(egressConnections).map(([alias, {\n    id: identifier\n  }]) => [alias, identifier]));\n}\nfunction loadPreviewModels(models) {\n  return Object.fromEntries(models.filter(model => model.alias != null).map(({\n    alias,\n    identifier\n  }) => [alias, identifier]));\n}\nfunction loadPreviewSources(connections) {\n  return Object.fromEntries(connections.filter(connection => connection.alias != null).map(({\n    alias,\n    rid\n  }) => [alias, {\n    rid\n  }]));\n}\nexport function resetPublishedCache() {\n  cachedPublishedAliases = undefined;\n}\nexport function loadResolvedAliases() {\n  const environment = detectEnvironment();\n  switch (environment) {\n    case AliasEnvironment.PUBLISHED:\n      return loadPublishedAliases();\n    case AliasEnvironment.LIVE_PREVIEW:\n      return loadPreviewAliases();\n  }\n}","/*\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 { loadResolvedAliases } from \"./loaders.js\";\nexport function custom(alias) {\n  const resolvedAliases = loadResolvedAliases();\n  if (!(alias in resolvedAliases.custom)) {\n    const available = Object.keys(resolvedAliases.custom);\n    throw new Error(`Custom alias '${alias}' not found. Available aliases: [${available.join(\", \")}]`);\n  }\n  return resolvedAliases.custom[alias];\n}","/*\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 { loadResolvedAliases } from \"./loaders.js\";\nexport function model(alias) {\n  const resolvedAliases = loadResolvedAliases();\n  if (!(alias in resolvedAliases.models)) {\n    const available = Object.keys(resolvedAliases.models);\n    throw new Error(`Model alias '${alias}' not found. Available aliases: [${available.join(\", \")}]`);\n  }\n  return resolvedAliases.models[alias];\n}","/*\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 { loadResolvedAliases } from \"./loaders.js\";\nexport function source(alias) {\n  const resolvedAliases = loadResolvedAliases();\n  if (!(alias in resolvedAliases.sources)) {\n    const available = Object.keys(resolvedAliases.sources);\n    throw new Error(`Source alias '${alias}' not found. Available aliases: [${available.join(\", \")}]`);\n  }\n  return resolvedAliases.sources[alias];\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 */\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 { createMediaFromReference } from \"@osdk/client/internal\";\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 createMediaFromReference(client, {\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}"]}