@osdk/client 2.1.0-beta.2 → 2.1.0-beta.21
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 +297 -0
- package/build/browser/Client.d.ts +6 -22
- package/build/browser/Client.d.ts.map +1 -1
- package/build/browser/Client.js +3 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/MinimalClientContext.d.ts +1 -1
- package/build/browser/MinimalClientContext.d.ts.map +1 -1
- package/build/browser/__unstable/ConjureSupport.js +5 -5
- package/build/browser/__unstable/ConjureSupport.js.map +1 -1
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts +1 -6
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -1
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js +2 -2
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -1
- package/build/browser/actions/actions.test.js +28 -0
- package/build/browser/actions/actions.test.js.map +1 -1
- package/build/browser/actions/applyAction.js +1 -1
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.d.ts +1 -1
- package/build/browser/createClient.d.ts.map +1 -1
- package/build/browser/createClient.js +41 -19
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createClient.test.js +24 -0
- package/build/browser/createClient.test.js.map +1 -1
- package/build/browser/createGeotimeSeriesProperty.d.ts +1 -1
- package/build/browser/createGeotimeSeriesProperty.d.ts.map +1 -1
- package/build/browser/createGeotimeSeriesProperty.js +4 -1
- package/build/browser/createGeotimeSeriesProperty.js.map +1 -1
- package/build/browser/createMinimalClient.js +9 -4
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/createPlatformClient.d.ts +1 -1
- package/build/browser/createPlatformClient.d.ts.map +1 -1
- package/build/browser/createTimeseriesProperty.d.ts.map +1 -1
- package/build/browser/fetchMetadata.test.js +14 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.d.ts +2 -2
- package/build/browser/index.d.ts.map +1 -1
- package/build/browser/index.js +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/intellisense.test.js +1 -1
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js +1 -1
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +11 -3
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +208 -7
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/browser/object/AttachmentUpload.d.ts.map +1 -1
- package/build/browser/object/AttachmentUpload.js +5 -7
- package/build/browser/object/AttachmentUpload.js.map +1 -1
- package/build/browser/object/aggregate.js +4 -5
- package/build/browser/object/aggregate.js.map +1 -1
- package/build/browser/object/aggregate.test.js +6 -9
- package/build/browser/object/aggregate.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +1 -10
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts +0 -7
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js +4 -3
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +41 -85
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.js +0 -6
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +60 -89
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js +2 -2
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js +14 -38
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js +42 -6
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +177 -45
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/fetchPage.d.ts.map +1 -1
- package/build/browser/object/fetchPage.js +34 -23
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/fetchPage.test.js +75 -1
- package/build/browser/object/fetchPage.test.js.map +1 -1
- package/build/browser/object/object.test.d.ts.map +1 -1
- package/build/browser/object/object.test.js +25 -1
- package/build/browser/object/object.test.js.map +1 -1
- package/build/browser/object/timeseries.test.js +10 -0
- package/build/browser/object/timeseries.test.js.map +1 -1
- package/build/browser/objectSet/InterfaceObjectSet.test.d.ts +2 -0
- package/build/browser/objectSet/InterfaceObjectSet.test.d.ts.map +1 -0
- package/build/browser/objectSet/InterfaceObjectSet.test.js +61 -0
- package/build/browser/objectSet/InterfaceObjectSet.test.js.map +1 -0
- package/build/browser/objectSet/ObjectSet.test.js +162 -48
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +136 -74
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +150 -42
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +10 -8
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/objectSet/toConjureObjectSet.js +2 -0
- package/build/browser/objectSet/toConjureObjectSet.js.map +1 -1
- package/build/browser/ontology/makeConjureContext.d.ts +1 -1
- package/build/browser/ontology/makeConjureContext.d.ts.map +1 -1
- package/build/browser/public/internal.d.ts +4 -0
- package/build/browser/public/internal.d.ts.map +1 -0
- package/build/browser/public/internal.js +19 -0
- package/build/browser/public/internal.js.map +1 -0
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.d.ts +11 -0
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.d.ts.map +1 -0
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.js +32 -0
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.js.map +1 -0
- package/build/browser/public-utils/hydrateAttachmentFromRid.d.ts +10 -0
- package/build/browser/public-utils/hydrateAttachmentFromRid.d.ts.map +1 -0
- package/build/{esm/createAttachmentFromRid.js → browser/public-utils/hydrateAttachmentFromRid.js} +9 -4
- package/build/browser/public-utils/hydrateAttachmentFromRid.js.map +1 -0
- package/build/browser/public-utils/hydrateObjectSetFromRid.d.ts +11 -0
- package/build/browser/public-utils/hydrateObjectSetFromRid.d.ts.map +1 -0
- package/build/browser/public-utils/hydrateObjectSetFromRid.js +37 -0
- package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -0
- package/build/browser/queries/applyQuery.d.ts.map +1 -1
- package/build/browser/queries/applyQuery.js +3 -4
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/queries/queries.test.js +30 -2
- package/build/browser/queries/queries.test.js.map +1 -1
- package/build/browser/tsserver.js +1 -1
- package/build/browser/tsserver.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/datetimeConverters.d.ts +22 -0
- package/build/browser/util/datetimeConverters.d.ts.map +1 -0
- package/build/browser/util/datetimeConverters.js +55 -0
- package/build/browser/util/datetimeConverters.js.map +1 -0
- package/build/browser/util/datetimeConverters.test.d.ts +2 -0
- package/build/browser/util/datetimeConverters.test.d.ts.map +1 -0
- package/build/browser/util/datetimeConverters.test.js +75 -0
- package/build/browser/util/datetimeConverters.test.js.map +1 -0
- package/build/browser/util/objectSetUtils.d.ts +4 -0
- package/build/browser/util/objectSetUtils.d.ts.map +1 -0
- package/build/browser/util/objectSetUtils.js +25 -0
- package/build/browser/util/objectSetUtils.js.map +1 -0
- package/build/browser/util/timeseriesUtils.d.ts +1 -1
- package/build/browser/util/timeseriesUtils.d.ts.map +1 -1
- package/build/browser/util/timeseriesUtils.js +1 -1
- package/build/browser/util/timeseriesUtils.js.map +1 -1
- package/build/browser/util/toDataValue.js +6 -0
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +9 -1
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/browser/util/toDataValueQueries.js +6 -0
- package/build/browser/util/toDataValueQueries.js.map +1 -1
- package/build/esm/Client.d.ts +6 -22
- package/build/esm/Client.d.ts.map +1 -1
- package/build/esm/Client.js +3 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/MinimalClientContext.d.ts +1 -1
- package/build/esm/MinimalClientContext.d.ts.map +1 -1
- package/build/esm/__unstable/ConjureSupport.js +5 -5
- package/build/esm/__unstable/ConjureSupport.js.map +1 -1
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts +1 -6
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -1
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js +2 -2
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -1
- package/build/esm/actions/actions.test.js +28 -0
- package/build/esm/actions/actions.test.js.map +1 -1
- package/build/esm/actions/applyAction.js +1 -1
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.d.ts +1 -1
- package/build/esm/createClient.d.ts.map +1 -1
- package/build/esm/createClient.js +41 -19
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createClient.test.js +24 -0
- package/build/esm/createClient.test.js.map +1 -1
- package/build/esm/createGeotimeSeriesProperty.d.ts +1 -1
- package/build/esm/createGeotimeSeriesProperty.d.ts.map +1 -1
- package/build/esm/createGeotimeSeriesProperty.js +4 -1
- package/build/esm/createGeotimeSeriesProperty.js.map +1 -1
- package/build/esm/createMinimalClient.js +9 -4
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/createPlatformClient.d.ts +1 -1
- package/build/esm/createPlatformClient.d.ts.map +1 -1
- package/build/esm/createTimeseriesProperty.d.ts.map +1 -1
- package/build/esm/fetchMetadata.test.js +14 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.d.ts +2 -2
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/intellisense.test.js +1 -1
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js +1 -1
- package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +11 -3
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +208 -7
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/esm/object/AttachmentUpload.d.ts.map +1 -1
- package/build/esm/object/AttachmentUpload.js +5 -7
- package/build/esm/object/AttachmentUpload.js.map +1 -1
- package/build/esm/object/aggregate.js +4 -5
- package/build/esm/object/aggregate.js.map +1 -1
- package/build/esm/object/aggregate.test.js +6 -9
- package/build/esm/object/aggregate.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +1 -10
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts +0 -7
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js +4 -3
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +41 -85
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.js +0 -6
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +60 -89
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +2 -2
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +14 -38
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js +42 -6
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +177 -45
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/fetchPage.d.ts.map +1 -1
- package/build/esm/object/fetchPage.js +34 -23
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/fetchPage.test.js +75 -1
- package/build/esm/object/fetchPage.test.js.map +1 -1
- package/build/esm/object/object.test.d.ts.map +1 -1
- package/build/esm/object/object.test.js +25 -1
- package/build/esm/object/object.test.js.map +1 -1
- package/build/esm/object/timeseries.test.js +10 -0
- package/build/esm/object/timeseries.test.js.map +1 -1
- package/build/esm/objectSet/InterfaceObjectSet.test.d.ts +2 -0
- package/build/esm/objectSet/InterfaceObjectSet.test.d.ts.map +1 -0
- package/build/esm/objectSet/InterfaceObjectSet.test.js +61 -0
- package/build/esm/objectSet/InterfaceObjectSet.test.js.map +1 -0
- package/build/esm/objectSet/ObjectSet.test.js +162 -48
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +136 -77
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +150 -42
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +10 -8
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/objectSet/toConjureObjectSet.js +2 -0
- package/build/esm/objectSet/toConjureObjectSet.js.map +1 -1
- package/build/esm/ontology/makeConjureContext.d.ts +1 -1
- package/build/esm/ontology/makeConjureContext.d.ts.map +1 -1
- package/build/esm/public/internal.d.ts +4 -0
- package/build/esm/public/internal.d.ts.map +1 -0
- package/build/esm/public/internal.js +19 -0
- package/build/esm/public/internal.js.map +1 -0
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.d.ts +11 -0
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.d.ts.map +1 -0
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.js +32 -0
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.js.map +1 -0
- package/build/esm/public-utils/hydrateAttachmentFromRid.d.ts +10 -0
- package/build/esm/public-utils/hydrateAttachmentFromRid.d.ts.map +1 -0
- package/build/{browser/createAttachmentFromRid.js → esm/public-utils/hydrateAttachmentFromRid.js} +9 -4
- package/build/esm/public-utils/hydrateAttachmentFromRid.js.map +1 -0
- package/build/esm/public-utils/hydrateObjectSetFromRid.d.ts +11 -0
- package/build/esm/public-utils/hydrateObjectSetFromRid.d.ts.map +1 -0
- package/build/esm/public-utils/hydrateObjectSetFromRid.js +37 -0
- package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -0
- package/build/esm/queries/applyQuery.d.ts.map +1 -1
- package/build/esm/queries/applyQuery.js +3 -4
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/queries/queries.test.js +30 -2
- package/build/esm/queries/queries.test.js.map +1 -1
- package/build/esm/tsserver.js +1 -1
- package/build/esm/tsserver.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/datetimeConverters.d.ts +22 -0
- package/build/esm/util/datetimeConverters.d.ts.map +1 -0
- package/build/esm/util/datetimeConverters.js +55 -0
- package/build/esm/util/datetimeConverters.js.map +1 -0
- package/build/esm/util/datetimeConverters.test.d.ts +2 -0
- package/build/esm/util/datetimeConverters.test.d.ts.map +1 -0
- package/build/esm/util/datetimeConverters.test.js +75 -0
- package/build/esm/util/datetimeConverters.test.js.map +1 -0
- package/build/esm/util/objectSetUtils.d.ts +4 -0
- package/build/esm/util/objectSetUtils.d.ts.map +1 -0
- package/build/esm/util/objectSetUtils.js +25 -0
- package/build/esm/util/objectSetUtils.js.map +1 -0
- package/build/esm/util/timeseriesUtils.d.ts +1 -1
- package/build/esm/util/timeseriesUtils.d.ts.map +1 -1
- package/build/esm/util/timeseriesUtils.js +1 -1
- package/build/esm/util/timeseriesUtils.js.map +1 -1
- package/build/esm/util/toDataValue.js +6 -0
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +9 -1
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/esm/util/toDataValueQueries.js +6 -0
- package/build/esm/util/toDataValueQueries.js.map +1 -1
- package/package.json +23 -19
- package/build/browser/createAttachmentFromRid.d.ts +0 -10
- package/build/browser/createAttachmentFromRid.d.ts.map +0 -1
- package/build/browser/createAttachmentFromRid.js.map +0 -1
- package/build/esm/createAttachmentFromRid.d.ts +0 -10
- package/build/esm/createAttachmentFromRid.d.ts.map +0 -1
- package/build/esm/createAttachmentFromRid.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsserver.js","names":["execaNode","findUpMultiple","EventEmitter","fs","path","pLocate","pMap","invariant","server","s","TsServerImpl","tsServerPath","nextSeq","subprocess","logger","constructor","start","ipc","serialization","isLevelEnabled","on","req","trace","info","emit","stop","connected","disconnect","getOneMessage","filter","requestFactory","#requestFactory","command","isResponse","args","makeRequest","sendOpenRequest","protocol","CommandTypes","Open","sendQuickInfoRequest","Quickinfo","isQuickInfoResponse","#makeRequest","seq","type","arguments","sendMessage","resp","undefined","startTsServer","getTsServerPath","nodeModuleDirs","cwd","import","meta","url","possibleTsServerPaths","dir","join","c","stat","isFile","e","isEvent","m","isProjectLoadingStart","event","isProjectLoadingEnd","requestSeq","request_seq"],"sources":["tsserver.js"],"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 */\nimport { execaNode } from \"execa\";\nimport { findUpMultiple } from \"find-up\";\nimport { EventEmitter } from \"node:events\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport pLocate from \"p-locate\";\nimport pMap from \"p-map\";\nimport invariant from \"tiny-invariant\";\nimport { server as s } from \"typescript\";\nclass TsServerImpl extends EventEmitter {\n #tsServerPath;\n #nextSeq = 1;\n #subprocess;\n #logger;\n constructor(tsServerPath, logger) {\n super();\n this.#tsServerPath = tsServerPath;\n this.#logger = logger;\n }\n get subprocess() {\n return this.#subprocess;\n }\n async start() {\n this.#subprocess = execaNode({\n ipc: true,\n serialization: \"json\",\n }) `${this.#tsServerPath} --useNodeIpc`;\n if (this.#logger.isLevelEnabled(\"trace\")) {\n this.#subprocess.on(\"message\", (req) => {\n this.#logger.trace({ req }, \"message received\");\n });\n }\n this.#subprocess.on(\"exit\", () => {\n this.#logger.info(\"tsserver exited\");\n this.emit(\"exit\");\n });\n return this;\n }\n stop() {\n if (this.#subprocess?.connected) {\n this.#subprocess?.disconnect();\n }\n }\n async getOneMessage(filter) {\n return await this.subprocess.getOneMessage({ filter });\n }\n #requestFactory = (command, isResponse) => async (args) => {\n return await this.#makeRequest(command, args, isResponse);\n };\n sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);\n sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);\n async #makeRequest(command, args, isResponse) {\n const seq = this.#nextSeq++;\n const req = {\n type: \"request\",\n command,\n arguments: args,\n seq,\n };\n this.#logger.trace({ req }, \"requesting\");\n await this.#subprocess?.sendMessage(req);\n if (isResponse) {\n return {\n req,\n resp: await this.#subprocess?.getOneMessage({\n filter: isResponse,\n }),\n };\n }\n return { req, resp: undefined };\n }\n}\nexport async function startTsServer(logger) {\n const tsServerPath = await getTsServerPath();\n invariant(tsServerPath != null);\n return new TsServerImpl(tsServerPath, logger).start();\n}\nasync function getTsServerPath() {\n const nodeModuleDirs = await findUpMultiple(\"node_modules\", {\n cwd: import.meta.url,\n type: \"directory\",\n });\n const possibleTsServerPaths = await pMap(nodeModuleDirs, (dir) => path.join(dir, \"typescript\", \"lib\", \"tsserver.js\"));\n const tsServerPath = await pLocate([\"no\", ...possibleTsServerPaths], async (dir) => {\n try {\n const c = await fs.stat(dir);\n return c.isFile();\n }\n catch (e) {\n return false;\n }\n });\n return tsServerPath;\n}\nexport function isEvent(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"event\");\n}\nexport function isResponse(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"response\");\n}\nexport function isProjectLoadingStart(m) {\n return isEvent(m) && m.event === \"projectLoadingStart\";\n}\nexport function isProjectLoadingEnd(m) {\n return isEvent(m) && m.event === \"projectLoadingFinish\";\n}\nexport function isQuickInfoResponse(m, requestSeq) {\n return isResponse(m) && m.command === s.protocol.CommandTypes.Quickinfo\n && (requestSeq == null || m.request_seq === requestSeq);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SA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AU,EAAEe,aAAa,CAAC;UACxCC,MAAM,EAAEI;QACZ,CAAC;MACL,CAAC;IACL;IACA,OAAO;MAAEZ,GAAG;MAAE2B,IAAI,EAAEC;IAAU,CAAC;EACnC;AACJ;AACA,OAAO,eAAeC,aAAaA,CAACpC,MAAM,EAAE;EACxC,MAAMH,YAAY,GAAG,MAAMwC,eAAe,CAAC,CAAC;EAC5C,EAAUxC,YAAY,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"tsserver.js","names":["execaNode","findUpMultiple","EventEmitter","fs","path","pLocate","pMap","invariant","server","s","TsServerImpl","tsServerPath","nextSeq","subprocess","logger","constructor","start","ipc","serialization","isLevelEnabled","on","req","trace","info","emit","stop","connected","disconnect","getOneMessage","filter","requestFactory","#requestFactory","command","isResponse","args","makeRequest","sendOpenRequest","protocol","CommandTypes","Open","sendQuickInfoRequest","Quickinfo","isQuickInfoResponse","#makeRequest","seq","type","arguments","sendMessage","resp","undefined","startTsServer","getTsServerPath","process","env","NODE_ENV","nodeModuleDirs","cwd","import","meta","url","possibleTsServerPaths","dir","join","c","stat","isFile","e","isEvent","m","isProjectLoadingStart","event","isProjectLoadingEnd","requestSeq","request_seq"],"sources":["tsserver.js"],"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 */\nimport { execaNode } from \"execa\";\nimport { findUpMultiple } from \"find-up\";\nimport { EventEmitter } from \"node:events\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport pLocate from \"p-locate\";\nimport pMap from \"p-map\";\nimport invariant from \"tiny-invariant\";\nimport { server as s } from \"typescript\";\nclass TsServerImpl extends EventEmitter {\n #tsServerPath;\n #nextSeq = 1;\n #subprocess;\n #logger;\n constructor(tsServerPath, logger) {\n super();\n this.#tsServerPath = tsServerPath;\n this.#logger = logger;\n }\n get subprocess() {\n return this.#subprocess;\n }\n async start() {\n this.#subprocess = execaNode({\n ipc: true,\n serialization: \"json\",\n }) `${this.#tsServerPath} --useNodeIpc`;\n if (this.#logger.isLevelEnabled(\"trace\")) {\n this.#subprocess.on(\"message\", (req) => {\n this.#logger.trace({ req }, \"message received\");\n });\n }\n this.#subprocess.on(\"exit\", () => {\n this.#logger.info(\"tsserver exited\");\n this.emit(\"exit\");\n });\n return this;\n }\n stop() {\n if (this.#subprocess?.connected) {\n this.#subprocess?.disconnect();\n }\n }\n async getOneMessage(filter) {\n return await this.subprocess.getOneMessage({ filter });\n }\n #requestFactory = (command, isResponse) => async (args) => {\n return await this.#makeRequest(command, args, isResponse);\n };\n sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);\n sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);\n async #makeRequest(command, args, isResponse) {\n const seq = this.#nextSeq++;\n const req = {\n type: \"request\",\n command,\n arguments: args,\n seq,\n };\n this.#logger.trace({ req }, \"requesting\");\n await this.#subprocess?.sendMessage(req);\n if (isResponse) {\n return {\n req,\n resp: await this.#subprocess?.getOneMessage({\n filter: isResponse,\n }),\n };\n }\n return { req, resp: undefined };\n }\n}\nexport async function startTsServer(logger) {\n const tsServerPath = await getTsServerPath();\n invariant(tsServerPath != null);\n return new TsServerImpl(tsServerPath, logger).start();\n}\nasync function getTsServerPath() {\n const nodeModuleDirs = await findUpMultiple(\"node_modules\", {\n cwd: import.meta.url,\n type: \"directory\",\n });\n const possibleTsServerPaths = await pMap(nodeModuleDirs, (dir) => path.join(dir, \"typescript\", \"lib\", \"tsserver.js\"));\n const tsServerPath = await pLocate([\"no\", ...possibleTsServerPaths], async (dir) => {\n try {\n const c = await fs.stat(dir);\n return c.isFile();\n }\n catch (e) {\n return false;\n }\n });\n return tsServerPath;\n}\nexport function isEvent(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"event\");\n}\nexport function isResponse(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"response\");\n}\nexport function isProjectLoadingStart(m) {\n return isEvent(m) && m.event === \"projectLoadingStart\";\n}\nexport function isProjectLoadingEnd(m) {\n return isEvent(m) && m.event === \"projectLoadingFinish\";\n}\nexport function isQuickInfoResponse(m, requestSeq) {\n return isResponse(m) && m.command === s.protocol.CommandTypes.Quickinfo\n && (requestSeq == null || m.request_seq === requestSeq);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,OAAO,MAAM,UAAU;AAC9B,OAAOC,IAAI,MAAM,OAAO;AACxB,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,MAAM,IAAIC,CAAC,QAAQ,YAAY;AACxC,MAAMC,YAAY,SAASR,YAAY,CAAC;EACpC,CAACS,YAAY;EACb,CAACC,OAAO,GAAG,CAAC;EACZ,CAACC,UAAU;EACX,CAACC,MAAM;EACPC,WAAWA,CAACJ,YAAY,EAAEG,MAAM,EAAE;IAC9B,KAAK,CAAC,CAAC;IACP,IAAI,CAAC,CAACH,YAAY,GAAGA,YAAY;IACjC,IAAI,CAAC,CAACG,MAAM,GAAGA,MAAM;EACzB;EACA,IAAID,UAAUA,CAAA,EAAG;IACb,OAAO,IAAI,CAAC,CAACA,UAAU;EAC3B;EACA,MAAMG,KAAKA,CAAA,EAAG;IACV,IAAI,CA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I,IAAI,IAAIJ,CAAC,CAACK,WAAW,KAAKD,UAAU,CAAC;AAC/D","ignoreList":[]}
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export const USER_AGENT = `osdk-client/${"2.1.0-beta.
|
|
16
|
+
export const USER_AGENT = `osdk-client/${"2.1.0-beta.21"}`;
|
|
17
17
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["USER_AGENT"],"sources":["UserAgent.js"],"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 */\nexport const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["USER_AGENT"],"sources":["UserAgent.js"],"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 */\nexport const USER_AGENT = `osdk-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gCAA4C","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.
|
|
3
|
+
*
|
|
4
|
+
* @param dateTime An ISO 8601 formatted date time string
|
|
5
|
+
* @returns The date part of the input string
|
|
6
|
+
*/
|
|
7
|
+
export declare const extractDate: (dateTime: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in UTC time.
|
|
10
|
+
*
|
|
11
|
+
* @param date
|
|
12
|
+
* @returns The date part of a ISO 8601 formatted date time string
|
|
13
|
+
*/
|
|
14
|
+
export declare const extractDateInUTC: (date: Date) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in the local time zone.
|
|
17
|
+
*
|
|
18
|
+
* @param date
|
|
19
|
+
* @returns The date part of a ISO 8601 formatted date time string
|
|
20
|
+
*/
|
|
21
|
+
export declare const extractDateInLocalTime: (date: Date) => string;
|
|
22
|
+
//# sourceMappingURL=datetimeConverters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetimeConverters.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aAAc,MAAM,WAU3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,IAAI,WAE1C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAAU,IAAI,WAEhD,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import invariant from "tiny-invariant";
|
|
17
|
+
const isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
|
|
18
|
+
/**
|
|
19
|
+
* Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.
|
|
20
|
+
*
|
|
21
|
+
* @param dateTime An ISO 8601 formatted date time string
|
|
22
|
+
* @returns The date part of the input string
|
|
23
|
+
*/
|
|
24
|
+
export const extractDate = dateTime => {
|
|
25
|
+
!(dateTime.length < 33) ? process.env.NODE_ENV !== "production" ? invariant(false, "Invalid date format. Provided input is too long.") : invariant(false) : void 0;
|
|
26
|
+
!isoRegex.test(dateTime) ? process.env.NODE_ENV !== "production" ? invariant(false, `Invalid date format. Expected ISO 8601 format, but received ${dateTime}`) : invariant(false) : void 0;
|
|
27
|
+
return extractDateFromIsoString(dateTime);
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in UTC time.
|
|
31
|
+
*
|
|
32
|
+
* @param date
|
|
33
|
+
* @returns The date part of a ISO 8601 formatted date time string
|
|
34
|
+
*/
|
|
35
|
+
export const extractDateInUTC = date => {
|
|
36
|
+
return extractDateFromIsoString(date.toISOString());
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in the local time zone.
|
|
40
|
+
*
|
|
41
|
+
* @param date
|
|
42
|
+
* @returns The date part of a ISO 8601 formatted date time string
|
|
43
|
+
*/
|
|
44
|
+
export const extractDateInLocalTime = date => {
|
|
45
|
+
return extractDateFromIsoString(generateOffsetUtcString(date));
|
|
46
|
+
};
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const generateOffsetUtcString = date => {
|
|
49
|
+
const offsetMs = date.getTimezoneOffset() * 60 * 1000;
|
|
50
|
+
return new Date(date.getTime() - offsetMs).toISOString();
|
|
51
|
+
};
|
|
52
|
+
const extractDateFromIsoString = dateTime => {
|
|
53
|
+
return dateTime.split("T")[0];
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=datetimeConverters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetimeConverters.js","names":["invariant","isoRegex","extractDate","dateTime","length","process","env","NODE_ENV","test","extractDateFromIsoString","extractDateInUTC","date","toISOString","extractDateInLocalTime","generateOffsetUtcString","offsetMs","getTimezoneOffset","Date","getTime","split"],"sources":["datetimeConverters.js"],"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 */\nimport invariant from \"tiny-invariant\";\nconst isoRegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})?$/;\n/**\n * Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.\n *\n * @param dateTime An ISO 8601 formatted date time string\n * @returns The date part of the input string\n */\nexport const extractDate = (dateTime) => {\n invariant(dateTime.length < 33, \"Invalid date format. Provided input is too long.\");\n invariant(isoRegex.test(dateTime), `Invalid date format. Expected ISO 8601 format, but received ${dateTime}`);\n return extractDateFromIsoString(dateTime);\n};\n/**\n * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in UTC time.\n *\n * @param date\n * @returns The date part of a ISO 8601 formatted date time string\n */\nexport const extractDateInUTC = (date) => {\n return extractDateFromIsoString(date.toISOString());\n};\n/**\n * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in the local time zone.\n *\n * @param date\n * @returns The date part of a ISO 8601 formatted date time string\n */\nexport const extractDateInLocalTime = (date) => {\n return extractDateFromIsoString(generateOffsetUtcString(date));\n};\n/** @internal */\nexport const generateOffsetUtcString = (date) => {\n const offsetMs = date.getTimezoneOffset() * 60 * 1000;\n return new Date(date.getTime() - offsetMs).toISOString();\n};\nconst extractDateFromIsoString = (dateTime) => {\n return dateTime.split(\"T\")[0];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,MAAMC,QAAQ,GAAG,uEAAuE;AACxF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAIC,QAAQ,IAAK;EACrC,EAAUA,QAAQ,CAACC,MAAM,GAAG,EAAE,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAA9BP,SAAS,QAAuB,kDAAkD,IAAlFA,SAAS;EACT,CAAUC,QAAQ,CAACO,IAAI,CAACL,QAAQ,CAAC,GAAAE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAjCP,SAAS,QAA0B,+DAA+DG,QAAQ,EAAE,IAA5GH,SAAS;EACT,OAAOS,wBAAwB,CAACN,QAAQ,CAAC;AAC7C,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,gBAAgB,GAAIC,IAAI,IAAK;EACtC,OAAOF,wBAAwB,CAACE,IAAI,CAACC,WAAW,CAAC,CAAC,CAAC;AACvD,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAIF,IAAI,IAAK;EAC5C,OAAOF,wBAAwB,CAACK,uBAAuB,CAACH,IAAI,CAAC,CAAC;AAClE,CAAC;AACD;AACA,OAAO,MAAMG,uBAAuB,GAAIH,IAAI,IAAK;EAC7C,MAAMI,QAAQ,GAAGJ,IAAI,CAACK,iBAAiB,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI;EACrD,OAAO,IAAIC,IAAI,CAACN,IAAI,CAACO,OAAO,CAAC,CAAC,GAAGH,QAAQ,CAAC,CAACH,WAAW,CAAC,CAAC;AAC5D,CAAC;AACD,MAAMH,wBAAwB,GAAIN,QAAQ,IAAK;EAC3C,OAAOA,QAAQ,CAACgB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetimeConverters.test.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { register, unregister } from "timezone-mock";
|
|
17
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
18
|
+
import { extractDate, extractDateInLocalTime, extractDateInUTC, generateOffsetUtcString } from "./datetimeConverters.js";
|
|
19
|
+
describe("test datetime converters", () => {
|
|
20
|
+
beforeAll(() => {
|
|
21
|
+
register("Etc/GMT+5");
|
|
22
|
+
});
|
|
23
|
+
afterAll(() => {
|
|
24
|
+
unregister();
|
|
25
|
+
});
|
|
26
|
+
describe("test extractDate", () => {
|
|
27
|
+
it("should error if the date is not in UTC format", () => {
|
|
28
|
+
expect(() => extractDate("2021-01-01")).toThrowError("Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01");
|
|
29
|
+
expect(() => extractDate("2021-01-01T00:0000.000Z")).toThrowError("Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01");
|
|
30
|
+
});
|
|
31
|
+
it("should return the date part of the input string", () => {
|
|
32
|
+
const result = extractDate("2021-01-01T00:00:00.000Z");
|
|
33
|
+
expect(result).toBe("2021-01-01");
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe("test extractDateInUTC", () => {
|
|
37
|
+
it("should return the date in UTC given Date constructed with UTC time", () => {
|
|
38
|
+
const date = new Date("2021-01-01T00:00:00.000Z");
|
|
39
|
+
expect(date.getDate()).toBe(31);
|
|
40
|
+
expect(date.getUTCDate()).toBe(1);
|
|
41
|
+
const result = extractDateInUTC(date);
|
|
42
|
+
expect(result).toBe("2021-01-01");
|
|
43
|
+
});
|
|
44
|
+
it("should return the date in UTC given Date constructed with a local time", () => {
|
|
45
|
+
const date = new Date("2020-12-31T23:00:00.000");
|
|
46
|
+
expect(date.getDate()).toBe(31);
|
|
47
|
+
expect(date.getUTCDate()).toBe(1);
|
|
48
|
+
const result = extractDateInUTC(date);
|
|
49
|
+
expect(result).toBe("2021-01-01");
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe("test extractDateInLocalTime", () => {
|
|
53
|
+
it("should return the date in local time given Date constructed with local time", () => {
|
|
54
|
+
const date = new Date("2020-12-31T23:00:00.000");
|
|
55
|
+
expect(date.getDate()).toBe(31);
|
|
56
|
+
const result = extractDateInLocalTime(date);
|
|
57
|
+
expect(result).toBe("2020-12-31");
|
|
58
|
+
});
|
|
59
|
+
describe("test generating ISO String", () => {
|
|
60
|
+
it("should return a correct ISO 8601 string that is offset correctly", () => {
|
|
61
|
+
const date = new Date("2021-01-01T00:00:00.000Z");
|
|
62
|
+
expect(date.getDate()).toBe(31);
|
|
63
|
+
const result = generateOffsetUtcString(date);
|
|
64
|
+
expect(result).toBe("2020-12-31T19:00:00.000Z");
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
it("should return the date in local time given Date constructed with UTC time", () => {
|
|
68
|
+
const date = new Date("2021-01-01T00:00:00.000Z");
|
|
69
|
+
expect(date.getDate()).toBe(31);
|
|
70
|
+
const result = extractDateInLocalTime(date);
|
|
71
|
+
expect(result).toBe("2020-12-31");
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=datetimeConverters.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetimeConverters.test.js","names":["register","unregister","afterAll","beforeAll","describe","expect","it","extractDate","extractDateInLocalTime","extractDateInUTC","generateOffsetUtcString","toThrowError","result","toBe","date","Date","getDate","getUTCDate"],"sources":["datetimeConverters.test.js"],"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 */\nimport { register, unregister } from \"timezone-mock\";\nimport { afterAll, beforeAll, describe, expect, it } from \"vitest\";\nimport { extractDate, extractDateInLocalTime, extractDateInUTC, generateOffsetUtcString, } from \"./datetimeConverters.js\";\ndescribe(\"test datetime converters\", () => {\n beforeAll(() => {\n register(\"Etc/GMT+5\");\n });\n afterAll(() => {\n unregister();\n });\n describe(\"test extractDate\", () => {\n it(\"should error if the date is not in UTC format\", () => {\n expect(() => extractDate(\"2021-01-01\")).toThrowError(\"Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01\");\n expect(() => extractDate(\"2021-01-01T00:0000.000Z\")).toThrowError(\"Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01\");\n });\n it(\"should return the date part of the input string\", () => {\n const result = extractDate(\"2021-01-01T00:00:00.000Z\");\n expect(result).toBe(\"2021-01-01\");\n });\n });\n describe(\"test extractDateInUTC\", () => {\n it(\"should return the date in UTC given Date constructed with UTC time\", () => {\n const date = new Date(\"2021-01-01T00:00:00.000Z\");\n expect(date.getDate()).toBe(31);\n expect(date.getUTCDate()).toBe(1);\n const result = extractDateInUTC(date);\n expect(result).toBe(\"2021-01-01\");\n });\n it(\"should return the date in UTC given Date constructed with a local time\", () => {\n const date = new Date(\"2020-12-31T23:00:00.000\");\n expect(date.getDate()).toBe(31);\n expect(date.getUTCDate()).toBe(1);\n const result = extractDateInUTC(date);\n expect(result).toBe(\"2021-01-01\");\n });\n });\n describe(\"test extractDateInLocalTime\", () => {\n it(\"should return the date in local time given Date constructed with local time\", () => {\n const date = new Date(\"2020-12-31T23:00:00.000\");\n expect(date.getDate()).toBe(31);\n const result = extractDateInLocalTime(date);\n expect(result).toBe(\"2020-12-31\");\n });\n describe(\"test generating ISO String\", () => {\n it(\"should return a correct ISO 8601 string that is offset correctly\", () => {\n const date = new Date(\"2021-01-01T00:00:00.000Z\");\n expect(date.getDate()).toBe(31);\n const result = generateOffsetUtcString(date);\n expect(result).toBe(\"2020-12-31T19:00:00.000Z\");\n });\n });\n it(\"should return the date in local time given Date constructed with UTC time\", () => {\n const date = new Date(\"2021-01-01T00:00:00.000Z\");\n expect(date.getDate()).toBe(31);\n const result = extractDateInLocalTime(date);\n expect(result).toBe(\"2020-12-31\");\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,eAAe;AACpD,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAClE,SAASC,WAAW,EAAEC,sBAAsB,EAAEC,gBAAgB,EAAEC,uBAAuB,QAAS,yBAAyB;AACzHN,QAAQ,CAAC,0BAA0B,EAAE,MAAM;EACvCD,SAAS,CAAC,MAAM;IACZH,QAAQ,CAAC,WAAW,CAAC;EACzB,CAAC,CAAC;EACFE,QAAQ,CAAC,MAAM;IACXD,UAAU,CAAC,CAAC;EAChB,CAAC,CAAC;EACFG,QAAQ,CAAC,kBAAkB,EAAE,MAAM;IAC/BE,EAAE,CAAC,+CAA+C,EAAE,MAAM;MACtDD,MAAM,CAAC,MAAME,WAAW,CAAC,YAAY,CAAC,CAAC,CAACI,YAAY,CAAC,0FAA0F,CAAC;MAChJN,MAAM,CAAC,MAAME,WAAW,CAAC,yBAAyB,CAAC,CAAC,CAACI,YAAY,CAAC,0FAA0F,CAAC;IACjK,CAAC,CAAC;IACFL,EAAE,CAAC,iDAAiD,EAAE,MAAM;MACxD,MAAMM,MAAM,GAAGL,WAAW,CAAC,0BAA0B,CAAC;MACtDF,MAAM,CAACO,MAAM,CAAC,CAACC,IAAI,CAAC,YAAY,CAAC;IACrC,CAAC,CAAC;EACN,CA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C,CAAC;IACFT,QAAQ,CAAC,4BAA4B,EAAE,MAAM;MACzCE,EAAE,CAAC,kEAAkE,EAAE,MAAM;QACzE,MAAMQ,IAAI,GAAG,IAAIC,IAAI,CAAC,0BAA0B,CAAC;QACjDV,MAAM,CAACS,IAAI,CAACE,OAAO,CAAC,CAAC,CAAC,CAACH,IAAI,CAAC,EAAE,CAAC;QAC/B,MAAMD,MAAM,GAAGF,uBAAuB,CAACI,IAAI,CAAC;QAC5CT,MAAM,CAACO,MAAM,CAAC,CAACC,IAAI,CAAC,0BAA0B,CAAC;MACnD,CAAC,CAAC;IACN,CAAC,CAAC;IACFP,EAAE,CAAC,2EAA2E,EAAE,MAAM;MAClF,MAAMQ,IAAI,GAAG,IAAIC,IAAI,CAAC,0BAA0B,CAAC;MACjDV,MAAM,CAACS,IAAI,CAACE,OAAO,CAAC,CAAC,CAAC,CAACH,IAAI,CAAC,EAAE,CAAC;MAC/B,MAAMD,MAAM,GAAGJ,sBAAsB,CAACM,IAAI,CAAC;MAC3CT,MAAM,CAACO,MAAM,CAAC,CAACC,IAAI,CAAC,YAAY,CAAC;IACrC,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
|
+
import type { ObjectSet as WireObjectSet } from "@osdk/internal.foundry.core";
|
|
3
|
+
export declare function resolveBaseObjectSetType(objectType: ObjectOrInterfaceDefinition): WireObjectSet;
|
|
4
|
+
//# sourceMappingURL=objectSetUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectSetUtils.d.ts","sourceRoot":"","sources":["../../../src/util/objectSetUtils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE9E,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,2BAA2B,GACtC,aAAa,CAUf"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export function resolveBaseObjectSetType(objectType) {
|
|
17
|
+
return objectType.type === "interface" ? {
|
|
18
|
+
type: "interfaceBase",
|
|
19
|
+
interfaceType: objectType["apiName"]
|
|
20
|
+
} : {
|
|
21
|
+
type: "base",
|
|
22
|
+
objectType: objectType["apiName"]
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=objectSetUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectSetUtils.js","names":["resolveBaseObjectSetType","objectType","type","interfaceType"],"sources":["objectSetUtils.js"],"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 */\nexport function resolveBaseObjectSetType(objectType) {\n return objectType.type === \"interface\"\n ? {\n type: \"interfaceBase\",\n interfaceType: objectType[\"apiName\"],\n }\n : {\n type: \"base\",\n objectType: objectType[\"apiName\"],\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,wBAAwBA,CAACC,UAAU,EAAE;EACjD,OAAOA,UAAU,CAACC,IAAI,KAAK,WAAW,GAChC;IACEA,IAAI,EAAE,eAAe;IACrBC,aAAa,EAAEF,UAAU,CAAC,SAAS;EACvC,CAAC,GACC;IACEC,IAAI,EAAE,MAAM;IACZD,UAAU,EAAEA,UAAU,CAAC,SAAS;EACpC,CAAC;AACT","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TimeSeriesQuery } from "@osdk/api";
|
|
2
2
|
import type { TimeRange } from "@osdk/internal.foundry.core";
|
|
3
3
|
export declare function getTimeRange(body: TimeSeriesQuery): TimeRange;
|
|
4
|
-
export declare function asyncIterPointsHelper<T extends number | string | GeoJSON.Point>(iterator:
|
|
4
|
+
export declare function asyncIterPointsHelper<T extends number | string | GeoJSON.Point>(iterator: Response): AsyncGenerator<{
|
|
5
5
|
time: any;
|
|
6
6
|
value: T;
|
|
7
7
|
}, void, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeseriesUtils.d.ts","sourceRoot":"","sources":["../../../src/util/timeseriesUtils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"timeseriesUtils.d.ts","sourceRoot":"","sources":["../../../src/util/timeseriesUtils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAG7D,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,CAyB7D;AAED,wBAAuB,qBAAqB,CAC1C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,EAEzC,QAAQ,EAAE,QAAQ;;WAQQ,CAAC;kBAG5B"}
|
|
@@ -40,7 +40,7 @@ export function getTimeRange(body) {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
export async function* asyncIterPointsHelper(iterator) {
|
|
43
|
-
const reader = iterator.
|
|
43
|
+
const reader = iterator.body?.getReader();
|
|
44
44
|
for await (const point of parseStreamedResponse(iterateReadableStream(reader))) {
|
|
45
45
|
yield {
|
|
46
46
|
time: point.time,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeseriesUtils.js","names":["TimeseriesDurationMapping","iterateReadableStream","parseStreamedResponse","getTimeRange","body","type","startTime","$startTime","endTime","$endTime","$before","when","value","unit","$unit","$after","asyncIterPointsHelper","iterator","reader","
|
|
1
|
+
{"version":3,"file":"timeseriesUtils.js","names":["TimeseriesDurationMapping","iterateReadableStream","parseStreamedResponse","getTimeRange","body","type","startTime","$startTime","endTime","$endTime","$before","when","value","unit","$unit","$after","asyncIterPointsHelper","iterator","reader","getReader","point","time"],"sources":["timeseriesUtils.js"],"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 */\nimport { TimeseriesDurationMapping } from \"@osdk/api\";\nimport { iterateReadableStream, parseStreamedResponse } from \"./streamutils.js\";\nexport function getTimeRange(body) {\n if (\"$startTime\" in body || \"$endTime\" in body) {\n return {\n type: \"absolute\",\n startTime: body.$startTime,\n endTime: body.$endTime,\n };\n }\n return body.$before\n ? {\n type: \"relative\",\n startTime: {\n when: \"BEFORE\",\n value: body.$before,\n unit: TimeseriesDurationMapping[body.$unit],\n },\n }\n : {\n type: \"relative\",\n endTime: {\n when: \"AFTER\",\n value: body.$after,\n unit: TimeseriesDurationMapping[body.$unit],\n },\n };\n}\nexport async function* asyncIterPointsHelper(iterator) {\n const reader = iterator.body?.getReader();\n for await (const point of parseStreamedResponse(iterateReadableStream(reader))) {\n yield {\n time: point.time,\n value: point.value,\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,yBAAyB,QAAQ,WAAW;AACrD,SAASC,qBAAqB,EAAEC,qBAAqB,QAAQ,kBAAkB;AAC/E,OAAO,SAASC,YAAYA,CAACC,IAAI,EAAE;EAC/B,IAAI,YAAY,IAAIA,IAAI,IAAI,UAAU,IAAIA,IAAI,EAAE;IAC5C,OAAO;MACHC,IAAI,EAAE,UAAU;MAChBC,SAAS,EAAEF,IAAI,CAACG,UAAU;MAC1BC,OAAO,EAAEJ,IAAI,CAACK;IAClB,CAAC;EACL;EACA,OAAOL,IAAI,CAACM,OAAO,GACb;IACEL,IAAI,EAAE,UAAU;IAChBC,SAAS,EAAE;MACPK,IAAI,EAAE,QAAQ;MACdC,KAAK,EAAER,IAAI,CAACM,OAAO;MACnBG,IAAI,EAAEb,yBAAyB,CAACI,IAAI,CAACU,KAAK;IAC9C;EACJ,CAAC,GACC;IACET,IAAI,EAAE,UAAU;IAChBG,OAAO,EAAE;MACLG,IAAI,EAAE,OAAO;MACbC,KAAK,EAAER,IAAI,CAACW,MAAM;MAClBF,IAAI,EAAEb,yBAAyB,CAACI,IAAI,CAACU,KAAK;IAC9C;EACJ,CAAC;AACT;AACA,OAAO,gBAAgBE,qBAAqBA,CAACC,QAAQ,EAAE;EACnD,MAAMC,MAAM,GAAGD,QAAQ,CAACb,IAAI,EAAEe,SAAS,CAAC,CAAC;EACzC,WAAW,MAAMC,KAAK,IAAIlB,qBAAqB,CAACD,qBAAqB,CAACiB,MAAM,CAAC,CAAC,EAAE;IAC5E,MAAM;MACFG,IAAI,EAAED,KAAK,CAACC,IAAI;MAChBT,KAAK,EAAEQ,KAAK,CAACR;IACjB,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -37,6 +37,12 @@ export async function toDataValue(value, client) {
|
|
|
37
37
|
}
|
|
38
38
|
// For uploads, we need to upload ourselves first to get the RID of the attachment
|
|
39
39
|
if (isAttachmentUpload(value)) {
|
|
40
|
+
const attachment = await OntologiesV2.Attachments.upload(client, value.data, {
|
|
41
|
+
filename: value.name
|
|
42
|
+
});
|
|
43
|
+
return await toDataValue(attachment.rid, client);
|
|
44
|
+
}
|
|
45
|
+
if (typeof value === "object" && value instanceof Blob && "name" in value) {
|
|
40
46
|
const attachment = await OntologiesV2.Attachments.upload(client, value, {
|
|
41
47
|
filename: value.name
|
|
42
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDataValue.js","names":["OntologiesV2","isAttachmentUpload","getWireObjectSet","isObjectSet","isOntologyObjectV2","isOsdkBaseObject","isWireObjectSet","toDataValue","value","client","Array","isArray","Set","promiseArray","from","innerValue","Promise","all","attachment","Attachments","upload","filename","name","rid","__primaryKey","$primaryKey","Object","entries","reduce","promisedAcc","key","structValue","acc","resolve"],"sources":["toDataValue.js"],"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 */\nimport * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isOsdkBaseObject } from \"./isOsdkObject.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\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(value, client) {\n if (value == null) {\n // typeof null is 'object' so do this first\n return value;\n }\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));\n return Promise.all(promiseArray);\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(client, value, {\n filename: value.name,\n });\n return await toDataValue(attachment.rid, client);\n }\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return await toDataValue(value.__primaryKey, client);\n }\n if (isOsdkBaseObject(value)) {\n return await toDataValue(value.$primaryKey, client);\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 // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce(async (promisedAcc, [key, structValue]) => {\n const acc = await promisedAcc;\n acc[key] = await toDataValue(structValue, client);\n return acc;\n }, Promise.resolve({}));\n }\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp\n return value;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,YAAY,MAAM,qCAAqC;AACnE,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,gBAAgB,EAAEC,WAAW,QAAQ,iCAAiC;AAC/E,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,eAAe,QAAQ,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,WAAWA,CAACC,KAAK,EAAEC,MAAM,EAAE;EAC7C,IAAID,KAAK,IAAI,IAAI,EAAE;IACf;IACA,OAAOA,KAAK;EAChB;EACA;EACA,IAAIE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,IAAIA,KAAK,YAAYI,GAAG,EAAE;IAC9C,MAAMC,YAAY,GAAGH,KAAK,CAACI,IAAI,CAACN,KAAK,EAAE,MAAOO,UAAU,IAAK,MAAMR,WAAW,CAACQ,UAAU,EAAEN,MAAM,CAAC,CAAC;IACnG,OAAOO,OAAO,CAACC,GAAG,CAACJ,YAAY,CAAC;EACpC;EACA;EACA,IAAIZ,kBAAkB,CAACO,KAAK,CAAC,EAAE;IAC3B,MAAMU,UAAU,GAAG,MAAMlB,YAAY,CAACmB,WAAW,CAACC,MAAM,CAACX,MAAM,EAAED,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"toDataValue.js","names":["OntologiesV2","isAttachmentUpload","getWireObjectSet","isObjectSet","isOntologyObjectV2","isOsdkBaseObject","isWireObjectSet","toDataValue","value","client","Array","isArray","Set","promiseArray","from","innerValue","Promise","all","attachment","Attachments","upload","data","filename","name","rid","Blob","__primaryKey","$primaryKey","Object","entries","reduce","promisedAcc","key","structValue","acc","resolve"],"sources":["toDataValue.js"],"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 */\nimport * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOntologyObjectV2 } from \"./isOntologyObjectV2.js\";\nimport { isOsdkBaseObject } from \"./isOsdkObject.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\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(value, client) {\n if (value == null) {\n // typeof null is 'object' so do this first\n return value;\n }\n // arrays and sets are both sent over the wire as arrays\n if (Array.isArray(value) || value instanceof Set) {\n const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));\n return Promise.all(promiseArray);\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(client, value.data, {\n filename: value.name,\n });\n return await toDataValue(attachment.rid, client);\n }\n if (typeof value === \"object\" && value instanceof Blob && \"name\" in value) {\n const attachment = await OntologiesV2.Attachments.upload(client, value, {\n filename: value.name,\n });\n return await toDataValue(attachment.rid, client);\n }\n // objects just send the JSON'd primaryKey\n if (isOntologyObjectV2(value)) {\n return await toDataValue(value.__primaryKey, client);\n }\n if (isOsdkBaseObject(value)) {\n return await toDataValue(value.$primaryKey, client);\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 // TODO (during queries implementation)\n // two dimensional aggregation\n // three dimensional aggregation\n // struct\n if (typeof value === \"object\") {\n return Object.entries(value).reduce(async (promisedAcc, [key, structValue]) => {\n const acc = await promisedAcc;\n acc[key] = await toDataValue(structValue, client);\n return acc;\n }, Promise.resolve({}));\n }\n // expected to pass through - boolean, byte, date, decimal, float, double, integer, long, short, string, timestamp\n return value;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,YAAY,MAAM,qCAAqC;AACnE,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,gBAAgB,EAAEC,WAAW,QAAQ,iCAAiC;AAC/E,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,eAAe,QAAQ,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,WAAWA,CAACC,KAAK,EAAEC,MAAM,EAAE;EAC7C,IAAID,KAAK,IAAI,IAAI,EAAE;IACf;IACA,OAAOA,KAAK;EAChB;EACA;EACA,IAAIE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,IAAIA,KAAK,YAAYI,GAAG,EAAE;IAC9C,MAAMC,YAAY,GAAGH,KAAK,CAACI,IAAI,CAACN,KAAK,EAAE,MAAOO,UAAU,IAAK,MAAMR,WAAW,CAACQ,UAAU,EAAEN,MAAM,CAAC,CAAC;IACnG,OAAOO,OAAO,CAACC,GAAG,CAACJ,YAAY,CAAC;EACpC;EACA;EACA,IAAIZ,kBAAkB,CAACO,KAAK,CAAC,EAAE;IAC3B,MAAMU,UAAU,GAAG,MAAMlB,YAAY,CAACmB,WAAW,CAACC,MAAM,CAACX,MAAM,EAAED,KAAK,CAACa,IAAI,EAAE;MACzEC,QAAQ,EAAEd,KAAK,CAACe;IACpB,CAAC,CAAC;IACF,OAAO,MAAMhB,WAAW,CAACW,UAAU,CAACM,GAAG,EAAEf,MAAM,CAAC;EACpD;EACA,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAIA,KAAK,YAAYiB,IAAI,IAAI,MAAM,IAAIjB,KAAK,EAAE;IACvE,MAAMU,UAAU,GAAG,MAAMlB,YAAY,CAACmB,WAAW,CAACC,MAAM,CAACX,MAAM,EAAED,KAAK,EAAE;MACpEc,QAAQ,EAAEd,KAAK,CAACe;IACpB,CAAC,CAAC;IACF,OAAO,MAAMhB,WAAW,CAACW,UAAU,CAACM,GAAG,EAAEf,MAAM,CAAC;EACpD;EACA;EACA,IAAIL,kBAAkB,CAACI,KAAK,CAAC,EAAE;IAC3B,OAAO,MAAMD,WAAW,CAACC,KAAK,CAACkB,YAAY,EAAEjB,MAAM,CAAC;EACxD;EACA,IAAIJ,gBAAgB,CAACG,KAAK,CAAC,EAAE;IACzB,OAAO,MAAMD,WAAW,CAACC,KAAK,CAACmB,WAAW,EAAElB,MAAM,CAAC;EACvD;EACA;EACA,IAAIH,eAAe,CAACE,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK;EAChB;EACA,IAAIL,WAAW,CAACK,KAAK,CAAC,EAAE;IACpB,OAAON,gBAAgB,CAACM,KAAK,CAAC;EAClC;EACA;EACA;EACA;EACA;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOoB,MAAM,CAACC,OAAO,CAACrB,KAAK,CAAC,CAACsB,MAAM,CAAC,OAAOC,WAAW,EAAE,CAACC,GAAG,EAAEC,WAAW,CAAC,KAAK;MAC3E,MAAMC,GAAG,GAAG,MAAMH,WAAW;MAC7BG,GAAG,CAACF,GAAG,CAAC,GAAG,MAAMzB,WAAW,CAAC0B,WAAW,EAAExB,MAAM,CAAC;MACjD,OAAOyB,GAAG;IACd,CAAC,EAAElB,OAAO,CAACmB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;EAC3B;EACA;EACA,OAAO3B,KAAK;AAChB","ignoreList":[]}
|
|
@@ -107,11 +107,19 @@ describe(toDataValue, () => {
|
|
|
107
107
|
const definitionConversion = await toDataValue(definition, clientCtx);
|
|
108
108
|
expect(definitionConversion).toMatchInlineSnapshot(expected);
|
|
109
109
|
});
|
|
110
|
-
it("converts attachment uploads correctly", async () => {
|
|
110
|
+
it("converts blob attachment uploads correctly", async () => {
|
|
111
111
|
const blob = stubData.attachmentUploadRequestBody[stubData.localAttachment1.filename];
|
|
112
112
|
const attachmentUpload = createAttachmentUpload(blob, "file1.txt");
|
|
113
113
|
const converted = await toDataValue(attachmentUpload, clientCtx);
|
|
114
114
|
expect(converted).toEqual("ri.attachments.main.attachment.86016861-707f-4292-b258-6a7108915a75");
|
|
115
115
|
});
|
|
116
|
+
it("converts file attachment uploads correctly", async () => {
|
|
117
|
+
// 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
|
|
118
|
+
const file = Object.assign(stubData.attachmentUploadRequestBody[stubData.localAttachment1.filename], {
|
|
119
|
+
name: "file1.txt"
|
|
120
|
+
});
|
|
121
|
+
const converted = await toDataValue(file, clientCtx);
|
|
122
|
+
expect(converted).toEqual("ri.attachments.main.attachment.86016861-707f-4292-b258-6a7108915a75");
|
|
123
|
+
});
|
|
116
124
|
});
|
|
117
125
|
//# sourceMappingURL=toDataValue.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDataValue.test.js","names":["$ontologyRid","Employee","Task","apiServer","MockOntology","stubData","afterAll","beforeAll","describe","expect","it","vi","createClient","createMinimalClient","createAttachmentUpload","getWireObjectSet","toDataValue","client","clientCtx","fn","listen","metadata","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","attachmentUploadRequestBody","localAttachment1","filename","attachmentUpload","converted"],"sources":["toDataValue.test.js"],"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 */\nimport { $ontologyRid, Employee, Task } from \"@osdk/client.test.ontology\";\nimport { apiServer, MockOntology, stubData } from \"@osdk/shared.test\";\nimport { afterAll, beforeAll, describe, expect, it, vi } from \"vitest\";\nimport { createClient } from \"../createClient.js\";\nimport { createMinimalClient } from \"../createMinimalClient.js\";\nimport { createAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { toDataValue } from \"./toDataValue.js\";\ndescribe(toDataValue, () => {\n let client;\n let clientCtx;\n const mockFetch = vi.fn();\n beforeAll(async () => {\n apiServer.listen();\n client = createClient(\"https://stack.palantir.com\", $ontologyRid, async () => \"myAccessToken\");\n clientCtx = createMinimalClient(MockOntology.metadata, \"https://stack.palantir.com\", async () => \"myAccessToken\", {});\n });\n afterAll(() => {\n apiServer.close();\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(basic, clientCtx);\n expect(convertedBasic).toEqual(basic);\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 const recursiveConversion = await toDataValue({\n attachment,\n attachmentArray,\n attachmentSet,\n }, clientCtx);\n expect(recursiveConversion).toEqual({\n attachment: \"rid\",\n attachmentArray: [\"rid\"],\n attachmentSet: [\"rid\"],\n });\n });\n it(\"recursively handles structs\", async () => {\n const struct = {\n inner: {\n attachment: \"rid\",\n },\n };\n const recursiveConversion = await toDataValue(struct, clientCtx);\n expect(recursiveConversion).toEqual({\n inner: { attachment: \"rid\" },\n });\n });\n it(\"maps an ontology object into just its primary key\", async () => {\n const employee = stubData.employee1;\n const ontologyConversion = await toDataValue(employee, clientCtx);\n expect(ontologyConversion).toEqual(stubData.employee1.__primaryKey);\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(task, clientCtx);\n expect(ontologyConversion).toEqual(task.$primaryKey);\n });\n it(\"passes through object set definitions\", async () => {\n const clientObjectSet = client(Task).where({ id: 0 });\n const definition = getWireObjectSet(clientObjectSet);\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(clientObjectSet, clientCtx);\n expect(objectSetConversion).toMatchInlineSnapshot(expected);\n const definitionConversion = await toDataValue(definition, clientCtx);\n expect(definitionConversion).toMatchInlineSnapshot(expected);\n });\n it(\"converts attachment uploads correctly\", async () => {\n const blob = stubData.attachmentUploadRequestBody[stubData.localAttachment1.filename];\n const attachmentUpload = createAttachmentUpload(blob, \"file1.txt\");\n const converted = await toDataValue(attachmentUpload, clientCtx);\n expect(converted).toEqual(\"ri.attachments.main.attachment.86016861-707f-4292-b258-6a7108915a75\");\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,4BAA4B;AACzE,SAASC,SAAS,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,mBAAmB;AACrE,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EA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AY;IACpD,MAAMoC,eAAe,GAAG7B,MAAM,CAACf,IAAI,CAAC,CAAC6C,KAAK,CAAC;MAAEC,EAAE,EAAE;IAAE,CAAC,CAAC;IACrD,MAAMC,UAAU,GAAGlC,gBAAgB,CAAC+B,eAAe,CAAC;IACpD,MAAMI,QAAQ,GAAG;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;IACK,MAAMC,mBAAmB,GAAG,MAAMnC,WAAW,CAAC8B,eAAe,EAAE5B,SAAS,CAAC;IACzET,MAAM,CAAC0C,mBAAmB,CAAC,CAACC,qBAAqB,CAACF,QAAQ,CAAC;IAC3D,MAAMG,oBAAoB,GAAG,MAAMrC,WAAW,CAACiC,UAAU,EAAE/B,SAAS,CAAC;IACrET,MAAM,CAAC4C,oBAAoB,CAAC,CAACD,qBAAqB,CAACF,QAAQ,CAAC;EAChE,CAAC,CAAC;EACFxC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"toDataValue.test.js","names":["$ontologyRid","Employee","Task","apiServer","MockOntology","stubData","afterAll","beforeAll","describe","expect","it","vi","createClient","createMinimalClient","createAttachmentUpload","getWireObjectSet","toDataValue","client","clientCtx","fn","listen","metadata","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","attachmentUploadRequestBody","localAttachment1","filename","attachmentUpload","converted","file","Object","assign","name"],"sources":["toDataValue.test.js"],"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 */\nimport { $ontologyRid, Employee, Task } from \"@osdk/client.test.ontology\";\nimport { apiServer, MockOntology, stubData } from \"@osdk/shared.test\";\nimport { afterAll, beforeAll, describe, expect, it, vi } from \"vitest\";\nimport { createClient } from \"../createClient.js\";\nimport { createMinimalClient } from \"../createMinimalClient.js\";\nimport { createAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { toDataValue } from \"./toDataValue.js\";\ndescribe(toDataValue, () => {\n let client;\n let clientCtx;\n const mockFetch = vi.fn();\n beforeAll(async () => {\n apiServer.listen();\n client = createClient(\"https://stack.palantir.com\", $ontologyRid, async () => \"myAccessToken\");\n clientCtx = createMinimalClient(MockOntology.metadata, \"https://stack.palantir.com\", async () => \"myAccessToken\", {});\n });\n afterAll(() => {\n apiServer.close();\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(basic, clientCtx);\n expect(convertedBasic).toEqual(basic);\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 const recursiveConversion = await toDataValue({\n attachment,\n attachmentArray,\n attachmentSet,\n }, clientCtx);\n expect(recursiveConversion).toEqual({\n attachment: \"rid\",\n attachmentArray: [\"rid\"],\n attachmentSet: [\"rid\"],\n });\n });\n it(\"recursively handles structs\", async () => {\n const struct = {\n inner: {\n attachment: \"rid\",\n },\n };\n const recursiveConversion = await toDataValue(struct, clientCtx);\n expect(recursiveConversion).toEqual({\n inner: { attachment: \"rid\" },\n });\n });\n it(\"maps an ontology object into just its primary key\", async () => {\n const employee = stubData.employee1;\n const ontologyConversion = await toDataValue(employee, clientCtx);\n expect(ontologyConversion).toEqual(stubData.employee1.__primaryKey);\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(task, clientCtx);\n expect(ontologyConversion).toEqual(task.$primaryKey);\n });\n it(\"passes through object set definitions\", async () => {\n const clientObjectSet = client(Task).where({ id: 0 });\n const definition = getWireObjectSet(clientObjectSet);\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(clientObjectSet, clientCtx);\n expect(objectSetConversion).toMatchInlineSnapshot(expected);\n const definitionConversion = await toDataValue(definition, clientCtx);\n expect(definitionConversion).toMatchInlineSnapshot(expected);\n });\n it(\"converts blob attachment uploads correctly\", async () => {\n const blob = stubData.attachmentUploadRequestBody[stubData.localAttachment1.filename];\n const attachmentUpload = createAttachmentUpload(blob, \"file1.txt\");\n const converted = await toDataValue(attachmentUpload, clientCtx);\n expect(converted).toEqual(\"ri.attachments.main.attachment.86016861-707f-4292-b258-6a7108915a75\");\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(stubData.attachmentUploadRequestBody[stubData.localAttachment1.filename], { name: \"file1.txt\" });\n const converted = await toDataValue(file, clientCtx);\n expect(converted).toEqual(\"ri.attachments.main.attachment.86016861-707f-4292-b258-6a7108915a75\");\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,4BAA4B;AACzE,SAASC,SAAS,EAAEC,YAAY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,CAAC;IAC3H,MAAMJ,SAAS,GAAG,MAAM3C,WAAW,CAAC4C,IAAI,EAAE1C,SAAS,CAAC;IACpDT,MAAM,CAACkD,SAAS,CAAC,CAAC3B,OAAO,CAAC,qEAAqE,CAAC;EACpG,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -36,6 +36,12 @@ export async function toDataValueQueries(value, client, desiredType) {
|
|
|
36
36
|
case "attachment":
|
|
37
37
|
{
|
|
38
38
|
if (isAttachmentUpload(value)) {
|
|
39
|
+
const attachment = await OntologiesV2.Attachments.upload(client, value.data, {
|
|
40
|
+
filename: value.name
|
|
41
|
+
});
|
|
42
|
+
return attachment.rid;
|
|
43
|
+
}
|
|
44
|
+
if (typeof value === "object" && value instanceof Blob && "name" in value) {
|
|
39
45
|
const attachment = await OntologiesV2.Attachments.upload(client, value, {
|
|
40
46
|
filename: value.name
|
|
41
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDataValueQueries.js","names":["OntologiesV2","isAttachmentUpload","getWireObjectSet","isObjectSet","isOsdkBaseObject","isWireObjectSet","toDataValueQueries","value","client","desiredType","Array","isArray","multiplicity","promiseArray","from","innerValue","Promise","all","type","attachment","Attachments","upload","filename","name","rid","groups","Set","$primaryKey","structMap","key","structValue","Object","entries"],"sources":["toDataValueQueries.js"],"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 */\nimport * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOsdkBaseObject } from \"./isOsdkBaseObject.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\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 toDataValueQueries(value, client, desiredType) {\n if (value == null) {\n return value;\n }\n if (Array.isArray(value) && desiredType.multiplicity) {\n const promiseArray = Array.from(value, async (innerValue) => await toDataValueQueries(innerValue, client, desiredType));\n return Promise.all(promiseArray);\n }\n switch (desiredType.type) {\n case \"attachment\": {\n if (isAttachmentUpload(value)) {\n const attachment = await OntologiesV2.Attachments.upload(client, value, {\n filename: value.name,\n });\n return attachment.rid;\n }\n // If it's not an upload, it's just an attachment rid string which we can pass through\n return value;\n }\n case \"twoDimensionalAggregation\": {\n return {\n groups: value,\n };\n }\n case \"threeDimensionalAggregation\": {\n return {\n groups: value,\n };\n }\n case \"set\": {\n if (value instanceof Set) {\n const promiseArray = Array.from(value, async (innerValue) => await toDataValueQueries(innerValue, client, desiredType[\"set\"]));\n return Promise.all(promiseArray);\n }\n break;\n }\n case \"object\": {\n if (isOsdkBaseObject(value)) {\n return value.$primaryKey;\n }\n break;\n }\n case \"objectSet\": {\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 break;\n }\n case \"struct\": {\n if (typeof value === \"object\") {\n const structMap = {};\n for (const [key, structValue] of Object.entries(value)) {\n structMap[key] = await toDataValueQueries(structValue, client, desiredType[\"struct\"][key]);\n }\n return structMap;\n }\n }\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return value;\n }\n return value;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,YAAY,MAAM,qCAAqC;AACnE,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,gBAAgB,EAAEC,WAAW,QAAQ,iCAAiC;AAC/E,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,eAAe,QAAQ,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,kBAAkBA,CAACC,KAAK,EAAEC,MAAM,EAAEC,WAAW,EAAE;EACjE,IAAIF,KAAK,IAAI,IAAI,EAAE;IACf,OAAOA,KAAK;EAChB;EACA,IAAIG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,IAAIE,WAAW,CAACG,YAAY,EAAE;IAClD,MAAMC,YAAY,GAAGH,KAAK,CAACI,IAAI,CAACP,KAAK,EAAE,MAAOQ,UAAU,IAAK,MAAMT,kBAAkB,CAACS,UAAU,EAAEP,MAAM,EAAEC,WAAW,CAAC,CAAC;IACvH,OAAOO,OAAO,CAACC,GAAG,CAACJ,YAAY,CAAC;EACpC;EACA,QAAQJ,WAAW,CAACS,IAAI;IACpB,KAAK,YAAY;MAAE;QACf,IAAIjB,kBAAkB,CAACM,KAAK,CAAC,EAAE;UAC3B,MAAMY,UAAU,GAAG,MAAMnB,YAAY,CAACoB,WAAW,CAACC,MAAM,CAACb,MAAM,EAAED,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"toDataValueQueries.js","names":["OntologiesV2","isAttachmentUpload","getWireObjectSet","isObjectSet","isOsdkBaseObject","isWireObjectSet","toDataValueQueries","value","client","desiredType","Array","isArray","multiplicity","promiseArray","from","innerValue","Promise","all","type","attachment","Attachments","upload","data","filename","name","rid","Blob","groups","Set","$primaryKey","structMap","key","structValue","Object","entries"],"sources":["toDataValueQueries.js"],"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 */\nimport * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { isAttachmentUpload } from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOsdkBaseObject } from \"./isOsdkBaseObject.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\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 toDataValueQueries(value, client, desiredType) {\n if (value == null) {\n return value;\n }\n if (Array.isArray(value) && desiredType.multiplicity) {\n const promiseArray = Array.from(value, async (innerValue) => await toDataValueQueries(innerValue, client, desiredType));\n return Promise.all(promiseArray);\n }\n switch (desiredType.type) {\n case \"attachment\": {\n if (isAttachmentUpload(value)) {\n const attachment = await OntologiesV2.Attachments.upload(client, value.data, {\n filename: value.name,\n });\n return attachment.rid;\n }\n if (typeof value === \"object\" && value instanceof Blob && \"name\" in value) {\n const attachment = await OntologiesV2.Attachments.upload(client, value, {\n filename: value.name,\n });\n return attachment.rid;\n }\n // If it's not an upload, it's just an attachment rid string which we can pass through\n return value;\n }\n case \"twoDimensionalAggregation\": {\n return {\n groups: value,\n };\n }\n case \"threeDimensionalAggregation\": {\n return {\n groups: value,\n };\n }\n case \"set\": {\n if (value instanceof Set) {\n const promiseArray = Array.from(value, async (innerValue) => await toDataValueQueries(innerValue, client, desiredType[\"set\"]));\n return Promise.all(promiseArray);\n }\n break;\n }\n case \"object\": {\n if (isOsdkBaseObject(value)) {\n return value.$primaryKey;\n }\n break;\n }\n case \"objectSet\": {\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 break;\n }\n case \"struct\": {\n if (typeof value === \"object\") {\n const structMap = {};\n for (const [key, structValue] of Object.entries(value)) {\n structMap[key] = await toDataValueQueries(structValue, client, desiredType[\"struct\"][key]);\n }\n return structMap;\n }\n }\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return value;\n }\n return value;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,YAAY,MAAM,qCAAqC;AACnE,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,gBAAgB,EAAEC,WAAW,QAAQ,iCAAiC;AAC/E,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,eAAe,QAAQ,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,kBAAkBA,CAACC,KAAK,EAAEC,MAAM,EAAEC,WAAW,EAAE;EACjE,IAAIF,KAAK,IAAI,IAAI,EAAE;IACf,OAAOA,KAAK;EAChB;EACA,IAAIG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,IAAIE,WAAW,CAACG,YAAY,EAAE;IAClD,MAAMC,YAAY,GAAGH,KAAK,CAACI,IAAI,CAACP,KAAK,EAAE,MAAOQ,UAAU,IAAK,MAAMT,kBAAkB,CAACS,UAAU,EAAEP,MAAM,EAAEC,WAAW,CAAC,CAAC;IACvH,OAAOO,OAAO,CAACC,GAAG,CAACJ,YAAY,CAAC;EACpC;EACA,QAAQJ,WAAW,CAACS,IAAI;IACpB,KAAK,YAAY;MAAE;QACf,IAAIjB,kBAAkB,CAACM,KAAK,CAAC,EAAE;UAC3B,MAAMY,UAAU,GAAG,MAAMnB,YAAY,CAACoB,WAAW,CAACC,MAAM,CAACb,MAAM,EAAED,KAAK,CAACe,IAAI,EAAE;YACzEC,QAAQ,EAA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B,SAAS,GAAG,CAAC,CAAC;UACpB,KAAK,MAAM,CAACC,GAAG,EAAEC,WAAW,CAAC,IAAIC,MAAM,CAACC,OAAO,CAAC3B,KAAK,CAAC,EAAE;YACpDuB,SAAS,CAACC,GAAG,CAAC,GAAG,MAAMzB,kBAAkB,CAAC0B,WAAW,EAAExB,MAAM,EAAEC,WAAW,CAAC,QAAQ,CAAC,CAACsB,GAAG,CAAC,CAAC;UAC9F;UACA,OAAOD,SAAS;QACpB;MACJ;IACA,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,WAAW;MACZ,OAAOvB,KAAK;EACpB;EACA,OAAOA,KAAK;AAChB","ignoreList":[]}
|
package/build/esm/Client.d.ts
CHANGED
|
@@ -1,36 +1,20 @@
|
|
|
1
|
-
import type { ActionDefinition, ActionMetadata, CompileTimeMetadata, InterfaceDefinition, InterfaceMetadata, ObjectMetadata,
|
|
2
|
-
import type {
|
|
3
|
-
import type { SharedClient } from "@osdk/shared.client";
|
|
4
|
-
import type {
|
|
1
|
+
import type { ActionDefinition, ActionMetadata, CompileTimeMetadata, InterfaceDefinition, InterfaceMetadata, ObjectMetadata, ObjectSet, ObjectTypeDefinition, QueryDefinition, QueryMetadata, VersionBound } from "@osdk/api";
|
|
2
|
+
import type { Experiment, ExperimentFns, MinimalObjectSet } from "@osdk/api/unstable";
|
|
3
|
+
import type { SharedClient as OldSharedClient } from "@osdk/shared.client";
|
|
4
|
+
import type { SharedClient } from "@osdk/shared.client2";
|
|
5
5
|
import type { ActionSignatureFromDef } from "./actions/applyAction.js";
|
|
6
|
-
import type { MinimalClient } from "./MinimalClientContext.js";
|
|
7
6
|
import type { QuerySignatureFromDef } from "./queries/types.js";
|
|
8
7
|
import type { SatisfiesSemver } from "./SatisfiesSemver.js";
|
|
9
8
|
export type CheckVersionBound<Q> = Q extends VersionBound<infer V> ? (SatisfiesSemver<V, MaxOsdkVersion> extends true ? Q : Q & {
|
|
10
9
|
[ErrorMessage]: `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;
|
|
11
10
|
}) : Q;
|
|
12
|
-
export interface Client extends SharedClient
|
|
11
|
+
export interface Client extends SharedClient, OldSharedClient {
|
|
13
12
|
<Q extends ObjectTypeDefinition>(o: Q): unknown extends CompileTimeMetadata<Q>["objectSet"] ? ObjectSet<Q> : CompileTimeMetadata<Q>["objectSet"];
|
|
14
13
|
<Q extends (InterfaceDefinition)>(o: Q): unknown extends CompileTimeMetadata<Q>["objectSet"] ? MinimalObjectSet<Q> : CompileTimeMetadata<Q>["objectSet"];
|
|
15
14
|
<Q extends ActionDefinition<any>>(o: Q): ActionSignatureFromDef<Q>;
|
|
16
15
|
<Q extends QueryDefinition<any>>(o: Q): QuerySignatureFromDef<Q>;
|
|
16
|
+
<Q extends Experiment<"2.0.8"> | Experiment<"2.1.0">>(experiment: Q): ExperimentFns<Q>;
|
|
17
17
|
fetchMetadata<Q extends (ObjectTypeDefinition | InterfaceDefinition | ActionDefinition<any> | QueryDefinition<any>)>(o: Q): Promise<Q extends ObjectTypeDefinition ? ObjectMetadata : Q extends InterfaceDefinition ? InterfaceMetadata : Q extends ActionDefinition<any> ? ActionMetadata : Q extends QueryDefinition<any> ? QueryMetadata : never>;
|
|
18
|
-
/**
|
|
19
|
-
* WARNING. THIS METHOD IS EXPERIMENTAL AND NOT SUPPORTED YET.
|
|
20
|
-
*
|
|
21
|
-
* It may change at any time and does not follow semantic versioning. Use at your own risk.
|
|
22
|
-
*
|
|
23
|
-
* @alpha
|
|
24
|
-
*/
|
|
25
|
-
readonly [__EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet]: <T extends ObjectOrInterfaceDefinition>(type: T, rid: string) => ObjectSet<T>;
|
|
26
|
-
/**
|
|
27
|
-
* WARNING. THIS METHOD IS EXPERIMENTAL AND NOT SUPPORTED YET.
|
|
28
|
-
*
|
|
29
|
-
* It may change at any time and does not follow semantic versioning. Use at your own risk.
|
|
30
|
-
*
|
|
31
|
-
* @alpha
|
|
32
|
-
*/
|
|
33
|
-
readonly [__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks]: <T extends ObjectOrInterfaceDefinition>(objs: Osdk<T>[], links: string[]) => AsyncGenerator<BulkLinkResult, void, undefined>;
|
|
34
18
|
}
|
|
35
19
|
declare const MaxOsdkVersion = "2.1.0";
|
|
36
20
|
export type MaxOsdkVersion = typeof MaxOsdkVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI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AAO,CACd,CAAC,SAAS,oBAAoB,GAAG,cAAc,GAC3C,CAAC,SAAS,mBAAmB,GAAG,iBAAiB,GACjD,CAAC,SAAS,gBAAgB,CAAC,GAAG,CAAC,GAAG,cAAc,GAChD,CAAC,SAAS,eAAe,CAAC,GAAG,CAAC,GAAG,aAAa,GAC9C,KAAK,CACV,CAAC;CAIH;AAOD,QAAA,MAAM,cAAc,UAAU,CAAC;AAE/B,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AACnD,QAAA,MAAM,YAAY,eAAyB,CAAC"}
|
package/build/esm/Client.js
CHANGED
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
// DO NOT EXPORT FROM PACKAGE
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const additionalContext = Symbol("additionalContext");
|
|
16
19
|
// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
17
20
|
const MaxOsdkVersion = "2.1.0";
|
|
18
21
|
const ErrorMessage = Symbol("ErrorMessage");
|
|
19
|
-
export {};
|
|
20
22
|
//# sourceMappingURL=Client.js.map
|