@osdk/client 2.6.0-beta.7 → 2.6.0-beta.8
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 +15 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +13 -15
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +62 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/browser/object/mediaUpload.js +1 -1
- package/build/browser/object/mediaUpload.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/toDataValue.js +3 -2
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +1 -1
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/cjs/{chunk-3LMKH6RS.cjs → chunk-HJV24UL2.cjs} +25 -35
- package/build/cjs/chunk-HJV24UL2.cjs.map +1 -0
- package/build/cjs/{chunk-4ZOXOCQX.cjs → chunk-PCNVSZXT.cjs} +133 -67
- package/build/cjs/chunk-PCNVSZXT.cjs.map +1 -0
- package/build/cjs/index.cjs +8 -8
- package/build/cjs/index.d.cts +1 -1
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +32 -32
- package/build/esm/index.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +13 -15
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +62 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/esm/object/mediaUpload.js +1 -1
- package/build/esm/object/mediaUpload.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/toDataValue.js +3 -2
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +1 -1
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/package.json +10 -9
- package/build/cjs/chunk-3LMKH6RS.cjs.map +0 -1
- package/build/cjs/chunk-4ZOXOCQX.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDataValue.js","names":["NULL_VALUE","OntologiesV2","isAttachmentFile","isAttachmentUpload","isMediaReference","isMediaUpload","getWireObjectSet","isObjectSet","isInterfaceActionParam","isObjectSpecifiersObject","isOntologyObjectV2","isPoint","isWireObjectSet","toDataValue","value","client","actionMetadata","Array","isArray","Set","values","from","some","dataValue","converted","push","promiseArray","innerValue","Promise","all","attachment","Attachments","upload","data","filename","name","rid","mediaRef","
|
|
1
|
+
{"version":3,"file":"toDataValue.js","names":["NULL_VALUE","MediaSets","OntologiesV2","isAttachmentFile","isAttachmentUpload","isMediaReference","isMediaUpload","getWireObjectSet","isObjectSet","isInterfaceActionParam","isObjectSpecifiersObject","isOntologyObjectV2","isPoint","isWireObjectSet","toDataValue","value","client","actionMetadata","Array","isArray","Set","values","from","some","dataValue","converted","push","promiseArray","innerValue","Promise","all","attachment","Attachments","upload","data","filename","name","rid","mediaRef","uploadMedia","fileName","preview","__primaryKey","$primaryKey","coordinates","objectTypeApiName","$objectType","primaryKeyValue","Object","entries","reduce","promisedAcc","key","structValue","acc","resolve"],"sources":["toDataValue.ts"],"sourcesContent":["/*\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 */\n\nimport { NULL_VALUE } from \"@osdk/api\";\nimport type { ActionMetadata } from \"@osdk/api\";\nimport { MediaSets } from \"@osdk/foundry.mediasets\";\nimport { type DataValue } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport {\n isAttachmentFile,\n isAttachmentUpload,\n} from \"../object/AttachmentUpload.js\";\nimport { isMediaReference, isMediaUpload } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isInterfaceActionParam } from \"./interfaceUtils.js\";\nimport { isObjectSpecifiersObject } from \"./isObjectSpecifiersObject.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isPoint } from \"./isPoint.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n * @internal\n */\nexport async function toDataValue(\n value: unknown,\n client: MinimalClient,\n actionMetadata: ActionMetadata,\n): Promise<DataValue> {\n if (value == null) {\n // typeof null is 'object' so do this first\n // Sending null over the wire clears the data, whereas undefined is dropped at request time.\n // Null values are not allowed with OSDK types, but leaving here as an override.\n return value;\n }\n\n if (value === NULL_VALUE) {\n return null;\n }\n\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n const values = Array.from(value);\n if (\n values.some((dataValue) =>\n isAttachmentUpload(dataValue) || isAttachmentFile(dataValue)\n )\n ) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValue(value, client, actionMetadata));\n }\n return converted;\n }\n const promiseArray = Array.from(\n value,\n async (innerValue) =>\n await toDataValue(innerValue, client, actionMetadata),\n );\n return Promise.all(promiseArray);\n }\n\n // For uploads, we need to upload ourselves first to get the RID of the attachment\n if (isAttachmentUpload(value)) {\n const attachment = await OntologiesV2.Attachments.upload(\n client,\n value.data,\n {\n filename: value.name,\n },\n );\n return await toDataValue(attachment.rid, client, actionMetadata);\n }\n\n if (isAttachmentFile(value)) {\n const attachment = await OntologiesV2.Attachments.upload(\n client,\n value,\n {\n filename: value.name as string,\n },\n );\n return await toDataValue(attachment.rid, client, actionMetadata);\n }\n\n // new media item upload interface, very similar to how attachments work above\n\n if (isMediaUpload(value)) {\n const mediaRef = await MediaSets.uploadMedia(\n client,\n value.data,\n {\n filename: value.fileName,\n preview: true,\n },\n );\n return await toDataValue(mediaRef, client, actionMetadata);\n }\n\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return await toDataValue(value.__primaryKey, client, actionMetadata);\n }\n\n if (isObjectSpecifiersObject(value)) {\n return await toDataValue(value.$primaryKey, client, actionMetadata);\n }\n\n if (isPoint(value)) {\n return await toDataValue(\n `${value.coordinates[1]},${value.coordinates[0]}`,\n client,\n actionMetadata,\n );\n }\n\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n\n if (isMediaReference(value)) {\n return value;\n }\n\n if (isInterfaceActionParam(value)) {\n return {\n objectTypeApiName: value.$objectType,\n primaryKeyValue: value.$primaryKey,\n };\n }\n\n // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce(\n async (promisedAcc, [key, structValue]) => {\n const acc = await promisedAcc;\n acc[key] = await toDataValue(structValue, client, actionMetadata);\n return acc;\n },\n Promise.resolve({} as { [key: string]: DataValue }),\n );\n }\n\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp, object type reference\n return value;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,WAAW;AAEtC,SAASC,SAAS,QAAQ,yBAAyB;AAEnD,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AAExD,SAC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E;IAClB,OAAO,MAAMD,WAAW,CACtB,GAAGC,KAAK,CAAC6B,WAAW,CAAC,CAAC,CAAC,IAAI7B,KAAK,CAAC6B,WAAW,CAAC,CAAC,CAAC,EAAE,EACjD5B,MAAM,EACNC,cACF,CAAC;EACH;;EAEA;EACA,IAAIJ,eAAe,CAACE,KAAK,CAAC,EAAE;IAC1B,OAAOA,KAAK;EACd;EACA,IAAIP,WAAW,CAACO,KAAK,CAAC,EAAE;IACtB,OAAOR,gBAAgB,CAACQ,KAAK,CAAC;EAChC;EAEA,IAAIV,gBAAgB,CAACU,KAAK,CAAC,EAAE;IAC3B,OAAOA,KAAK;EACd;EAEA,IAAIN,sBAAsB,CAACM,KAAK,CAAC,EAAE;IACjC,OAAO;MACL8B,iBAAiB,EAAE9B,KAAK,CAAC+B,WAAW;MACpCC,eAAe,EAAEhC,KAAK,CAAC4B;IACzB,CAAC;EACH;;EAEA;EACA;EACA;;EAEA;EACA,IAAI,OAAO5B,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOiC,MAAM,CAACC,OAAO,CAAClC,KAAK,CAAC,CAACmC,MAAM,CACjC,OAAOC,WAAW,EAAE,CAACC,GAAG,EAAEC,WAAW,CAAC,KAAK;MACzC,MAAMC,GAAG,GAAG,MAAMH,WAAW;MAC7BG,GAAG,CAACF,GAAG,CAAC,GAAG,MAAMtC,WAAW,CAACuC,WAAW,EAAErC,MAAM,EAAEC,cAAc,CAAC;MACjE,OAAOqC,GAAG;IACZ,CAAC,EACDzB,OAAO,CAAC0B,OAAO,CAAC,CAAC,CAAiC,CACpD,CAAC;EACH;;EAEA;EACA,OAAOxC,KAAK;AACd","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDataValue.test.js","names":["NULL_VALUE","Employee","Task","LegacyFauxFoundry","MockOntologiesV2","startNodeApiServer","stubData","beforeAll","describe","expect","it","vi","createClient","createMinimalClient","createAttachmentUpload","isMediaReference","getWireObjectSet","toDataValue","client","clientCtx","mockActionMetadata","apiServer","fn","testSetup","ontologyRid","fauxFoundry","defaultOntologyRid","baseUrl","auth","apiName","close","basic","null","undefined","boolean","date","integer","string","timestamp","convertedBasic","toEqual","attachment","attachmentArray","attachmentSet","Set","recursiveConversion","inner","employee","employee1","ontologyConversion","__primaryKey","task","fetchOne","$primaryKey","clientObjectSet","where","id","definition","expected","objectSetConversion","toMatchInlineSnapshot","definitionConversion","blob","Blob","JSON","stringify","attachmentUpload","converted","toMatch","file","Object","assign","name","type","data","path","boundary","use","MediaReferenceProperties","uploadMedia","mimeType","reference","mediaSetViewItem","mediaItemRid","mediaSetRid","mediaSetViewRid","toBe","mediaReference","toBeNull","Symbol","for"],"sources":["toDataValue.test.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { NULL_VALUE } from \"@osdk/api\";\nimport type { ActionMetadata, MediaUpload } from \"@osdk/api\";\nimport { Employee, Task } from \"@osdk/client.test.ontology\";\nimport type { MediaReference } from \"@osdk/foundry.core\";\nimport type { SetupServer } from \"@osdk/shared.test\";\nimport {\n LegacyFauxFoundry,\n MockOntologiesV2,\n startNodeApiServer,\n stubData,\n} from \"@osdk/shared.test\";\nimport type { MockedFunction } from \"vitest\";\nimport { beforeAll, describe, expect, it, vi } from \"vitest\";\nimport type { Client } from \"../Client.js\";\nimport { createClient } from \"../createClient.js\";\nimport { createMinimalClient } from \"../createMinimalClient.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { createAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { isMediaReference } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { toDataValue } from \"./toDataValue.js\";\n\ndescribe(toDataValue, () => {\n let client: Client;\n let clientCtx: MinimalClient;\n let mockActionMetadata: ActionMetadata;\n let apiServer: SetupServer;\n\n const mockFetch: MockedFunction<typeof globalThis.fetch> = vi.fn();\n\n beforeAll(() => {\n const testSetup = startNodeApiServer(new LegacyFauxFoundry(), createClient);\n ({ client } = testSetup);\n\n apiServer = testSetup.apiServer;\n\n clientCtx = createMinimalClient(\n { ontologyRid: testSetup.fauxFoundry.defaultOntologyRid },\n testSetup.fauxFoundry.baseUrl,\n testSetup.auth,\n {},\n );\n\n // toDataValue only needs the apiName right now, update this if that changes\n const fakeActionMetadata = {\n apiName: \"createUnstructuredImageExampleObject\",\n };\n mockActionMetadata = fakeActionMetadata as ActionMetadata;\n\n return () => {\n testSetup.apiServer.close();\n };\n });\n\n it(\"converts passthrough values correctly\", async () => {\n // basic pass through types\n const basic = {\n null: undefined,\n boolean: false,\n date: \"2024-01-01\",\n integer: 0,\n string: \"string\",\n timestamp: \"2024-01-01T00:00:00Z\",\n };\n const convertedBasic = await toDataValue(\n basic,\n clientCtx,\n mockActionMetadata,\n );\n expect(convertedBasic).toEqual(basic);\n });\n\n it(\"recursively converts arrays and sets into array types\", async () => {\n const attachment = \"rid\";\n const attachmentArray = [attachment];\n const attachmentSet = new Set(attachmentArray);\n\n const recursiveConversion = await toDataValue(\n {\n attachment,\n attachmentArray,\n attachmentSet,\n },\n clientCtx,\n mockActionMetadata,\n );\n\n expect(recursiveConversion).toEqual({\n attachment: \"rid\",\n attachmentArray: [\"rid\"],\n attachmentSet: [\"rid\"],\n });\n });\n\n it(\"recursively handles structs\", async () => {\n const struct = {\n inner: {\n attachment: \"rid\",\n },\n };\n\n const recursiveConversion = await toDataValue(\n struct,\n clientCtx,\n mockActionMetadata,\n );\n\n expect(recursiveConversion).toEqual({\n inner: { attachment: \"rid\" },\n });\n });\n\n it(\"maps an ontology object into just its primary key\", async () => {\n const employee = stubData.employee1;\n const ontologyConversion = await toDataValue(\n employee,\n clientCtx,\n mockActionMetadata,\n );\n expect(ontologyConversion).toEqual(\n stubData.employee1.__primaryKey,\n );\n });\n\n it(\"maps an ontology object into just its primary key with osdk wrapper\", async () => {\n const task = await client(Employee).fetchOne(50030);\n const ontologyConversion = await toDataValue(\n task,\n clientCtx,\n mockActionMetadata,\n );\n expect(ontologyConversion).toEqual(\n task.$primaryKey,\n );\n });\n\n it(\"passes through object set definitions\", async () => {\n const clientObjectSet = client(Task).where({ id: 0 });\n const definition = getWireObjectSet(clientObjectSet);\n\n const expected = `\n {\n \"objectSet\": {\n \"objectType\": \"Task\",\n \"type\": \"base\",\n },\n \"type\": \"filter\",\n \"where\": {\n \"field\": \"id\",\n \"type\": \"eq\",\n \"value\": 0,\n },\n }\n `;\n const objectSetConversion = await toDataValue(\n clientObjectSet,\n clientCtx,\n mockActionMetadata,\n );\n expect(objectSetConversion).toMatchInlineSnapshot(\n expected,\n );\n\n const definitionConversion = await toDataValue(\n definition,\n clientCtx,\n mockActionMetadata,\n );\n expect(definitionConversion).toMatchInlineSnapshot(expected);\n });\n\n it(\"converts blob attachment uploads correctly\", async () => {\n const blob = new Blob([JSON.stringify({ \"hi\": \"mom\" })]);\n const attachmentUpload = createAttachmentUpload(blob, \"file1.txt\");\n const converted = await toDataValue(\n attachmentUpload,\n clientCtx,\n mockActionMetadata,\n );\n\n expect(converted).toMatch(/ri\\.attachments.main.attachment\\.[a-z0-9\\-]+/i);\n });\n\n it(\"converts file attachment uploads correctly\", async () => {\n // Mimics the Web file API (https://developer.mozilla.org/en-US/docs/Web/API/File). The File constructor is only available in Node 19.2.0 and above\n const file = Object.assign(\n new Blob([\n JSON.stringify({ name: \"Hello World\" }, null, 2),\n ], {\n type: \"application/json\",\n }),\n { name: \"file1.txt\" },\n );\n\n const converted = await toDataValue(file, clientCtx, mockActionMetadata);\n expect(converted).toMatch(/ri\\.attachments.main.attachment\\.[a-z0-9\\-]+/i);\n });\n\n it(\"converts media uploads correctly\", async () => {\n const file: MediaUpload = {\n data: new Blob([\n JSON.stringify({ name: \"Hello World\" }, null, 2),\n ], {\n type: \"application/json\",\n }),\n path: \"file.txt\",\n };\n\n // TODO: Mock MediaUpload properly in FauxFoundry\n apiServer.boundary(async () => {\n apiServer.use(\n MockOntologiesV2.MediaReferenceProperties.uploadMedia(\n \"https://stack.palantir.com\",\n () => {\n return {\n mimeType: \"application/json\",\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: \"media-item-rid\",\n mediaSetRid: \"media-set-rid\",\n mediaSetViewRid: \"media-set-view-rid\",\n },\n },\n };\n },\n ),\n );\n const converted = await toDataValue(file, clientCtx, mockActionMetadata);\n expect(isMediaReference(converted)).toBe(true);\n });\n });\n\n it(\"converts media reference correctly\", async () => {\n const mediaReference: MediaReference = {\n mimeType: \"application/json\",\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: \"media-item-rid\",\n mediaSetRid: \"media-set-rid\",\n mediaSetViewRid: \"media-set-view-rid\",\n },\n },\n };\n\n const converted = await toDataValue(\n mediaReference,\n clientCtx,\n mockActionMetadata,\n );\n expect(converted).toEqual(mediaReference);\n });\n\n it(\"Converts NULL_VALUE to null\", async () => {\n const converted = await toDataValue(\n NULL_VALUE,\n clientCtx,\n mockActionMetadata,\n );\n expect(converted).toBeNull();\n });\n\n it(\"Converts NULL_VALUE equivalents to null\", async () => {\n const clearData = Symbol.for(\"NULL_VALUE\") as symbol & {\n __type: \"NULL_VALUE\";\n };\n const converted = await toDataValue(\n clearData,\n clientCtx,\n mockActionMetadata,\n );\n expect(converted).toEqual(null);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,WAAW;AAEtC,SAASC,QAAQ,EAAE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CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"toDataValue.test.js","names":["NULL_VALUE","Employee","Task","LegacyFauxFoundry","MockOntologiesV2","startNodeApiServer","stubData","beforeAll","describe","expect","it","vi","createClient","createMinimalClient","createAttachmentUpload","isMediaReference","getWireObjectSet","toDataValue","client","clientCtx","mockActionMetadata","apiServer","fn","testSetup","ontologyRid","fauxFoundry","defaultOntologyRid","baseUrl","auth","apiName","close","basic","null","undefined","boolean","date","integer","string","timestamp","convertedBasic","toEqual","attachment","attachmentArray","attachmentSet","Set","recursiveConversion","inner","employee","employee1","ontologyConversion","__primaryKey","task","fetchOne","$primaryKey","clientObjectSet","where","id","definition","expected","objectSetConversion","toMatchInlineSnapshot","definitionConversion","blob","Blob","JSON","stringify","attachmentUpload","converted","toMatch","file","Object","assign","name","type","data","fileName","boundary","use","MediaReferenceProperties","uploadMedia","mimeType","reference","mediaSetViewItem","mediaItemRid","mediaSetRid","mediaSetViewRid","toBe","mediaReference","toBeNull","Symbol","for"],"sources":["toDataValue.test.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { NULL_VALUE } from \"@osdk/api\";\nimport type { ActionMetadata, MediaUpload } from \"@osdk/api\";\nimport { Employee, Task } from \"@osdk/client.test.ontology\";\nimport type { MediaReference } from \"@osdk/foundry.core\";\nimport type { SetupServer } from \"@osdk/shared.test\";\nimport {\n LegacyFauxFoundry,\n MockOntologiesV2,\n startNodeApiServer,\n stubData,\n} from \"@osdk/shared.test\";\nimport type { MockedFunction } from \"vitest\";\nimport { beforeAll, describe, expect, it, vi } from \"vitest\";\nimport type { Client } from \"../Client.js\";\nimport { createClient } from \"../createClient.js\";\nimport { createMinimalClient } from \"../createMinimalClient.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { createAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { isMediaReference } from \"../object/mediaUpload.js\";\nimport { getWireObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { toDataValue } from \"./toDataValue.js\";\n\ndescribe(toDataValue, () => {\n let client: Client;\n let clientCtx: MinimalClient;\n let mockActionMetadata: ActionMetadata;\n let apiServer: SetupServer;\n\n const mockFetch: MockedFunction<typeof globalThis.fetch> = vi.fn();\n\n beforeAll(() => {\n const testSetup = startNodeApiServer(new LegacyFauxFoundry(), createClient);\n ({ client } = testSetup);\n\n apiServer = testSetup.apiServer;\n\n clientCtx = createMinimalClient(\n { ontologyRid: testSetup.fauxFoundry.defaultOntologyRid },\n testSetup.fauxFoundry.baseUrl,\n testSetup.auth,\n {},\n );\n\n // toDataValue only needs the apiName right now, update this if that changes\n const fakeActionMetadata = {\n apiName: \"createUnstructuredImageExampleObject\",\n };\n mockActionMetadata = fakeActionMetadata as ActionMetadata;\n\n return () => {\n testSetup.apiServer.close();\n };\n });\n\n it(\"converts passthrough values correctly\", async () => {\n // basic pass through types\n const basic = {\n null: undefined,\n boolean: false,\n date: \"2024-01-01\",\n integer: 0,\n string: \"string\",\n timestamp: \"2024-01-01T00:00:00Z\",\n };\n const convertedBasic = await toDataValue(\n basic,\n clientCtx,\n mockActionMetadata,\n );\n expect(convertedBasic).toEqual(basic);\n });\n\n it(\"recursively converts arrays and sets into array types\", async () => {\n const attachment = \"rid\";\n const attachmentArray = [attachment];\n const attachmentSet = new Set(attachmentArray);\n\n const recursiveConversion = await toDataValue(\n {\n attachment,\n attachmentArray,\n attachmentSet,\n },\n clientCtx,\n mockActionMetadata,\n );\n\n expect(recursiveConversion).toEqual({\n attachment: \"rid\",\n attachmentArray: [\"rid\"],\n attachmentSet: [\"rid\"],\n });\n });\n\n it(\"recursively handles structs\", async () => {\n const struct = {\n inner: {\n attachment: \"rid\",\n },\n };\n\n const recursiveConversion = await toDataValue(\n struct,\n clientCtx,\n mockActionMetadata,\n );\n\n expect(recursiveConversion).toEqual({\n inner: { attachment: \"rid\" },\n });\n });\n\n it(\"maps an ontology object into just its primary key\", async () => {\n const employee = stubData.employee1;\n const ontologyConversion = await toDataValue(\n employee,\n clientCtx,\n mockActionMetadata,\n );\n expect(ontologyConversion).toEqual(\n stubData.employee1.__primaryKey,\n );\n });\n\n it(\"maps an ontology object into just its primary key with osdk wrapper\", async () => {\n const task = await client(Employee).fetchOne(50030);\n const ontologyConversion = await toDataValue(\n task,\n clientCtx,\n mockActionMetadata,\n );\n expect(ontologyConversion).toEqual(\n task.$primaryKey,\n );\n });\n\n it(\"passes through object set definitions\", async () => {\n const clientObjectSet = client(Task).where({ id: 0 });\n const definition = getWireObjectSet(clientObjectSet);\n\n const expected = `\n {\n \"objectSet\": {\n \"objectType\": \"Task\",\n \"type\": \"base\",\n },\n \"type\": \"filter\",\n \"where\": {\n \"field\": \"id\",\n \"type\": \"eq\",\n \"value\": 0,\n },\n }\n `;\n const objectSetConversion = await toDataValue(\n clientObjectSet,\n clientCtx,\n mockActionMetadata,\n );\n expect(objectSetConversion).toMatchInlineSnapshot(\n expected,\n );\n\n const definitionConversion = await toDataValue(\n definition,\n clientCtx,\n mockActionMetadata,\n );\n expect(definitionConversion).toMatchInlineSnapshot(expected);\n });\n\n it(\"converts blob attachment uploads correctly\", async () => {\n const blob = new Blob([JSON.stringify({ \"hi\": \"mom\" })]);\n const attachmentUpload = createAttachmentUpload(blob, \"file1.txt\");\n const converted = await toDataValue(\n attachmentUpload,\n clientCtx,\n mockActionMetadata,\n );\n\n expect(converted).toMatch(/ri\\.attachments.main.attachment\\.[a-z0-9\\-]+/i);\n });\n\n it(\"converts file attachment uploads correctly\", async () => {\n // Mimics the Web file API (https://developer.mozilla.org/en-US/docs/Web/API/File). The File constructor is only available in Node 19.2.0 and above\n const file = Object.assign(\n new Blob([\n JSON.stringify({ name: \"Hello World\" }, null, 2),\n ], {\n type: \"application/json\",\n }),\n { name: \"file1.txt\" },\n );\n\n const converted = await toDataValue(file, clientCtx, mockActionMetadata);\n expect(converted).toMatch(/ri\\.attachments.main.attachment\\.[a-z0-9\\-]+/i);\n });\n\n it(\"converts media uploads correctly\", async () => {\n const file: MediaUpload = {\n data: new Blob([\n JSON.stringify({ name: \"Hello World\" }, null, 2),\n ], {\n type: \"application/json\",\n }),\n fileName: \"file.txt\",\n };\n\n // TODO: Mock MediaUpload properly in FauxFoundry\n apiServer.boundary(async () => {\n apiServer.use(\n MockOntologiesV2.MediaReferenceProperties.uploadMedia(\n \"https://stack.palantir.com\",\n () => {\n return {\n mimeType: \"application/json\",\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: \"media-item-rid\",\n mediaSetRid: \"media-set-rid\",\n mediaSetViewRid: \"media-set-view-rid\",\n },\n },\n };\n },\n ),\n );\n const converted = await toDataValue(file, clientCtx, mockActionMetadata);\n expect(isMediaReference(converted)).toBe(true);\n });\n });\n\n it(\"converts media reference correctly\", async () => {\n const mediaReference: MediaReference = {\n mimeType: \"application/json\",\n reference: {\n type: \"mediaSetViewItem\",\n mediaSetViewItem: {\n mediaItemRid: \"media-item-rid\",\n mediaSetRid: \"media-set-rid\",\n mediaSetViewRid: \"media-set-view-rid\",\n },\n },\n };\n\n const converted = await toDataValue(\n mediaReference,\n clientCtx,\n mockActionMetadata,\n );\n expect(converted).toEqual(mediaReference);\n });\n\n it(\"Converts NULL_VALUE to null\", async () => {\n const converted = await toDataValue(\n NULL_VALUE,\n clientCtx,\n mockActionMetadata,\n );\n expect(converted).toBeNull();\n });\n\n it(\"Converts NULL_VALUE equivalents to null\", async () => {\n const clearData = Symbol.for(\"NULL_VALUE\") as symbol & {\n __type: \"NULL_VALUE\";\n };\n const converted = await toDataValue(\n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,SAAS,GAAG,MAAMlD,WAAW,CAHjBwE,MAAM,CAACC,GAAG,CAAC,YAAY,CAAC,EAKxCvE,SAAS,EACTC,kBACF,CAAC;IACDX,MAAM,CAAC0D,SAAS,CAAC,CAAC3B,OAAO,CAAC,IAAI,CAAC;EACjC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
12
12
|
var invariant3__default = /*#__PURE__*/_interopDefault(invariant3);
|
|
13
13
|
var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
|
|
14
14
|
|
|
15
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
15
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
16
16
|
var Action_exports = {};
|
|
17
17
|
chunkQ7SFCCGT_cjs.__export(Action_exports, {
|
|
18
18
|
apply: () => apply,
|
|
@@ -89,7 +89,7 @@ function parseUrl(baseUrl, endpointPath) {
|
|
|
89
89
|
return new URL(`api${endpointPath}`, baseUrl);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
92
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
93
93
|
var _apply = [1, "/v2/ontologies/{0}/actions/{1}/apply", 3];
|
|
94
94
|
function apply($ctx, ...args) {
|
|
95
95
|
return foundryPlatformFetch($ctx, _apply, ...args);
|
|
@@ -103,7 +103,7 @@ function applyBatch($ctx, ...args) {
|
|
|
103
103
|
return foundryPlatformFetch($ctx, _applyBatch, ...args);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
106
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js
|
|
107
107
|
var ActionTypeV2_exports = {};
|
|
108
108
|
chunkQ7SFCCGT_cjs.__export(ActionTypeV2_exports, {
|
|
109
109
|
get: () => get,
|
|
@@ -123,7 +123,7 @@ function getByRid($ctx, ...args) {
|
|
|
123
123
|
return foundryPlatformFetch($ctx, _getByRid, ...args);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
126
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js
|
|
127
127
|
var Attachment_exports = {};
|
|
128
128
|
chunkQ7SFCCGT_cjs.__export(Attachment_exports, {
|
|
129
129
|
get: () => get2,
|
|
@@ -148,13 +148,12 @@ function get2($ctx, ...args) {
|
|
|
148
148
|
return foundryPlatformFetch($ctx, _get2, ...args);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
151
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js
|
|
152
152
|
var MediaReferenceProperty_exports = {};
|
|
153
153
|
chunkQ7SFCCGT_cjs.__export(MediaReferenceProperty_exports, {
|
|
154
154
|
getMediaContent: () => getMediaContent,
|
|
155
155
|
getMediaMetadata: () => getMediaMetadata,
|
|
156
|
-
upload: () => upload2
|
|
157
|
-
uploadMedia: () => uploadMedia
|
|
156
|
+
upload: () => upload2
|
|
158
157
|
});
|
|
159
158
|
var _getMediaContent = [0, "/v2/ontologies/{0}/objects/{1}/{2}/media/{3}/content", 2, , "*/*"];
|
|
160
159
|
function getMediaContent($ctx, ...args) {
|
|
@@ -168,12 +167,8 @@ var _upload2 = [1, "/v2/ontologies/{0}/objectTypes/{1}/media/{2}/upload", 3, "*/
|
|
|
168
167
|
function upload2($ctx, ...args) {
|
|
169
168
|
return foundryPlatformFetch($ctx, _upload2, ...args);
|
|
170
169
|
}
|
|
171
|
-
var _uploadMedia = [1, "/v2/ontologies/{0}/actions/{1}/media/upload", 3, "*/*"];
|
|
172
|
-
function uploadMedia($ctx, ...args) {
|
|
173
|
-
return foundryPlatformFetch($ctx, _uploadMedia, ...args);
|
|
174
|
-
}
|
|
175
170
|
|
|
176
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
171
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js
|
|
177
172
|
var ObjectTypeV2_exports = {};
|
|
178
173
|
chunkQ7SFCCGT_cjs.__export(ObjectTypeV2_exports, {
|
|
179
174
|
get: () => get3,
|
|
@@ -203,7 +198,7 @@ function getOutgoingLinkType($ctx, ...args) {
|
|
|
203
198
|
return foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);
|
|
204
199
|
}
|
|
205
200
|
|
|
206
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
201
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyInterface.js
|
|
207
202
|
var OntologyInterface_exports = {};
|
|
208
203
|
chunkQ7SFCCGT_cjs.__export(OntologyInterface_exports, {
|
|
209
204
|
aggregate: () => aggregate,
|
|
@@ -248,7 +243,7 @@ function listInterfaceLinkedObjects($ctx, ...args) {
|
|
|
248
243
|
return foundryPlatformFetch($ctx, _listInterfaceLinkedObjects, ...args);
|
|
249
244
|
}
|
|
250
245
|
|
|
251
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
246
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js
|
|
252
247
|
var OntologyObjectSet_exports = {};
|
|
253
248
|
chunkQ7SFCCGT_cjs.__export(OntologyObjectSet_exports, {
|
|
254
249
|
aggregate: () => aggregate2,
|
|
@@ -283,7 +278,7 @@ function aggregate2($ctx, ...args) {
|
|
|
283
278
|
return foundryPlatformFetch($ctx, _aggregate2, ...args);
|
|
284
279
|
}
|
|
285
280
|
|
|
286
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
281
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
|
|
287
282
|
var Query_exports = {};
|
|
288
283
|
chunkQ7SFCCGT_cjs.__export(Query_exports, {
|
|
289
284
|
execute: () => execute
|
|
@@ -293,7 +288,7 @@ function execute($ctx, ...args) {
|
|
|
293
288
|
return foundryPlatformFetch($ctx, _execute, ...args);
|
|
294
289
|
}
|
|
295
290
|
|
|
296
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
291
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js
|
|
297
292
|
var QueryType_exports = {};
|
|
298
293
|
chunkQ7SFCCGT_cjs.__export(QueryType_exports, {
|
|
299
294
|
get: () => get6,
|
|
@@ -308,7 +303,7 @@ function get6($ctx, ...args) {
|
|
|
308
303
|
return foundryPlatformFetch($ctx, _get6, ...args);
|
|
309
304
|
}
|
|
310
305
|
|
|
311
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
306
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js
|
|
312
307
|
var TimeSeriesPropertyV2_exports = {};
|
|
313
308
|
chunkQ7SFCCGT_cjs.__export(TimeSeriesPropertyV2_exports, {
|
|
314
309
|
getFirstPoint: () => getFirstPoint,
|
|
@@ -328,7 +323,7 @@ function streamPoints($ctx, ...args) {
|
|
|
328
323
|
return foundryPlatformFetch($ctx, _streamPoints, ...args);
|
|
329
324
|
}
|
|
330
325
|
|
|
331
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
326
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.38.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js
|
|
332
327
|
var TimeSeriesValueBankProperty_exports = {};
|
|
333
328
|
chunkQ7SFCCGT_cjs.__export(TimeSeriesValueBankProperty_exports, {
|
|
334
329
|
getLatestValue: () => getLatestValue,
|
|
@@ -1070,6 +1065,15 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
|
|
|
1070
1065
|
}
|
|
1071
1066
|
const firstKey = keysOfFilter[0];
|
|
1072
1067
|
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false) : invariant3__default.default(false) : void 0;
|
|
1068
|
+
if (firstKey === "$contains" && filter[firstKey] instanceof Object) {
|
|
1069
|
+
const structFilter = Object.entries(filter[firstKey]);
|
|
1070
|
+
!(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant3__default.default(false) : void 0;
|
|
1071
|
+
const structFieldApiName = structFilter[0][0];
|
|
1072
|
+
return handleWherePair(structFilter[0], objectOrInterface, {
|
|
1073
|
+
propertyApiName: fieldName,
|
|
1074
|
+
structFieldApiName
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1073
1077
|
if (firstKey === "$ne") {
|
|
1074
1078
|
return {
|
|
1075
1079
|
type: "not",
|
|
@@ -1100,21 +1104,6 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
|
|
|
1100
1104
|
fuzzy: typeof filter[firstKey] === "string" ? false : filter[firstKey]["fuzzySearch"] ?? false
|
|
1101
1105
|
};
|
|
1102
1106
|
}
|
|
1103
|
-
if (firstKey === "$contains" && filter[firstKey] instanceof Object) {
|
|
1104
|
-
const structFilter = Object.entries(filter[firstKey]);
|
|
1105
|
-
!(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant3__default.default(false) : void 0;
|
|
1106
|
-
const structFieldApiName = structFilter[0][0];
|
|
1107
|
-
!(structFilter[0][1] != null && Object.keys(structFilter[0][1]).length === 1 && "$eq" in structFilter[0][1]) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Cannot filter on a struct field in an array with anything other than a single $eq") : invariant3__default.default(false) : void 0;
|
|
1108
|
-
return {
|
|
1109
|
-
type: "contains",
|
|
1110
|
-
propertyIdentifier: {
|
|
1111
|
-
type: "structField",
|
|
1112
|
-
propertyApiName: fieldName,
|
|
1113
|
-
structFieldApiName
|
|
1114
|
-
},
|
|
1115
|
-
value: structFilter[0][1]["$eq"]
|
|
1116
|
-
};
|
|
1117
|
-
}
|
|
1118
1107
|
return {
|
|
1119
1108
|
type: firstKey.substring(1),
|
|
1120
1109
|
...propertyIdentifier != null && {
|
|
@@ -2135,11 +2124,12 @@ exports.fetchPage = fetchPage;
|
|
|
2135
2124
|
exports.fetchSingle = fetchSingle;
|
|
2136
2125
|
exports.fetchSingleWithErrors = fetchSingleWithErrors;
|
|
2137
2126
|
exports.fetchStaticRidPage = fetchStaticRidPage;
|
|
2127
|
+
exports.foundryPlatformFetch = foundryPlatformFetch;
|
|
2138
2128
|
exports.getWireObjectSet = getWireObjectSet;
|
|
2139
2129
|
exports.hydrateAttachmentFromRid = hydrateAttachmentFromRid;
|
|
2140
2130
|
exports.hydrateAttachmentFromRidInternal = hydrateAttachmentFromRidInternal;
|
|
2141
2131
|
exports.isObjectSet = isObjectSet;
|
|
2142
2132
|
exports.isWireObjectSet = isWireObjectSet;
|
|
2143
2133
|
exports.symbolClientContext = symbolClientContext;
|
|
2144
|
-
//# sourceMappingURL=chunk-
|
|
2145
|
-
//# sourceMappingURL=chunk-
|
|
2134
|
+
//# sourceMappingURL=chunk-HJV24UL2.cjs.map
|
|
2135
|
+
//# sourceMappingURL=chunk-HJV24UL2.cjs.map
|