@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":"createClient.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","
|
|
1
|
+
{"version":3,"file":"createClient.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe","symbolClientContext","oldSymbolClientContext","createBulkLinksAsyncIterFactory","applyAction","additionalContext","createMinimalClient","fetchMetadataInternal","fetchSingle","createObjectSet","getWireObjectSet","ObjectSetListenerWebsocket","applyQuery","ActionInvoker","constructor","clientCtx","actionDef","bind","undefined","batchApplyAction","QueryInvoker","queryDef","executeFunction","createClientInternal","objectSetFactory","baseUrl","ontologyRid","tokenProvider","options","fetchFn","fetch","startsWith","Error","then","fetchMetadata","client","Object","defineProperties","o","type","name","getBulkLinks","subscribe","objectSet","listener","opts","pendingSubscribe","getInstance","$objectSetInternals","def","properties","unsubscribe","fetchOneByRid","objectType","rid","createWithRid","value","createClient"],"sources":["createClient.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 { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe, } from \"@osdk/api/unstable\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { symbolClientContext } from \"@osdk/shared.client2\";\nimport { createBulkLinksAsyncIterFactory } from \"./__unstable/createBulkLinksAsyncIterFactory.js\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { fetchSingle } from \"./object/fetchSingle.js\";\nimport { createObjectSet, getWireObjectSet, } from \"./objectSet/createObjectSet.js\";\nimport { ObjectSetListenerWebsocket } from \"./objectSet/ObjectSetListenerWebsocket.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\nclass ActionInvoker {\n constructor(clientCtx, actionDef) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n applyAction;\n batchApplyAction;\n}\nclass QueryInvoker {\n constructor(clientCtx, queryDef) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n executeFunction;\n}\n/** @internal */\nexport function createClientInternal(objectSetFactory, // first so i can bind\nbaseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n if (typeof ontologyRid === \"string\") {\n if (!ontologyRid.startsWith(\"ri.\")) {\n throw new Error(\"Invalid ontology RID\");\n }\n }\n else {\n ontologyRid.then((ontologyRid) => {\n if (!ontologyRid.startsWith(\"ri.\")) {\n throw new Error(\"Invalid ontology RID\");\n }\n });\n }\n const clientCtx = createMinimalClient({ ontologyRid }, baseUrl, tokenProvider, options, fetchFn, objectSetFactory);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n return objectSetFactory(o, clientCtx);\n }\n else if (o.type === \"action\") {\n return new ActionInvoker(clientCtx, o); // then as any for dealing with the conditional return value\n }\n else if (o.type === \"query\") {\n return new QueryInvoker(clientCtx, o);\n }\n else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: createBulkLinksAsyncIterFactory(clientCtx),\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe.name:\n return {\n subscribe: (objectSet, listener, opts) => {\n const pendingSubscribe = ObjectSetListenerWebsocket.getInstance(clientCtx).subscribe(objectSet.$objectSetInternals?.def, getWireObjectSet(objectSet), listener, opts?.properties);\n return { unsubscribe: async () => (await pendingSubscribe)() };\n },\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:\n return {\n fetchOneByRid: async (objectType, rid, options) => {\n return await fetchSingle(clientCtx, objectType, options, createWithRid(rid));\n },\n };\n }\n throw new Error(\"not implemented\");\n }\n else {\n throw new Error(\"not implemented\");\n }\n }\n const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);\n const client = Object.defineProperties(clientFn, {\n [oldSymbolClientContext]: {\n value: clientCtx,\n },\n [symbolClientContext]: {\n value: clientCtx,\n },\n [additionalContext]: {\n value: clientCtx,\n },\n fetchMetadata: {\n value: fetchMetadata,\n },\n });\n return client;\n}\nexport const createClient = createClientInternal.bind(undefined, createObjectSet);\nfunction createWithRid(rid) {\n const withRid = {\n type: \"static\",\n \"objects\": [rid],\n };\n return withRid;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gDAAgD,EAAEC,+CAA+C,EAAEC,2CAA2C,QAAS,oBAAoB;AACpL,SAASC,mBAAmB,IAAIC,sBAAsB,QAAQ,qBAAqB;AACnF,SAASD,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASE,+BAA+B,QAAQ,iDAAiD;AACjG,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,eAAe,EAAEC,gBAAgB,QAAS,gCAAgC;AACnF,SAASC,0BAA0B,QAAQ,2CAA2C;AACtF,SAASC,UAAU,QAAQ,yBAAyB;AACpD,MAAMC,aAAa,CAAC;EAChBC,WAAWA,CAACC,SAAS,EAAEC,SAAS,EAAE;IAC9B;IACA;IACA;IACA;IACA,IAAI,CAACZ,WAAW,GAAGA,WAAW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AItB,KAAK,CAAC,iBAAiB,CAAC;IACtC,CAAC,MACI;MACD,MAAM,IAAIA,KAAK,CAAC,iBAAiB,CAAC;IACtC;EACJ,CAAC,EAEgD;IAC7C,CAAC9B,sBAAsB,GAAG;MACtBsD,KAAK,EAAEzC;IACX,CAAC;IACD,CAACd,mBAAmB,GAAG;MACnBuD,KAAK,EAAEzC;IACX,CAAC;IACD,CAACV,iBAAiB,GAAG;MACjBmD,KAAK,EAAEzC;IACX,CAAC;IACDmB,aAAa,EAAE;MACXsB,KAAK,EAAEtB;IACX;EACJ,CAAC,CAAC;EACF,OAAOC,MAAM;AACjB;AACA,OAAO,MAAMsB,YAAY,GAAGlC,oBAAoB,CAACN,IAAI,CAACC,SAAS,EAAET,eAAe,CAAC;AACjF,SAAS8C,aAAaA,CAACD,GAAG,EAAE;EAKxB,OAJgB;IACZf,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAACe,GAAG;EACnB,CAAC;AAEL","ignoreList":[]}
|
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Task } from "@osdk/client.test.ontology";
|
|
17
|
+
import * as SharedClientContext from "@osdk/shared.client.impl";
|
|
17
18
|
import { mockFetchResponse, MockOntology } from "@osdk/shared.test";
|
|
18
19
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
20
|
+
import { metadataCacheClient } from "./__unstable/ConjureSupport.js";
|
|
19
21
|
import { createClient } from "./createClient.js";
|
|
22
|
+
import * as MakeConjureContext from "./ontology/makeConjureContext.js";
|
|
20
23
|
import { USER_AGENT } from "./util/UserAgent.js";
|
|
21
24
|
describe(createClient, () => {
|
|
22
25
|
let fetchFunction;
|
|
@@ -41,5 +44,26 @@ describe(createClient, () => {
|
|
|
41
44
|
expect(parts).toEqual([...Task.osdkMetadata.extraUserAgent.split(" "), USER_AGENT]);
|
|
42
45
|
});
|
|
43
46
|
});
|
|
47
|
+
describe("check url formatting", () => {
|
|
48
|
+
it("urls are correctly formatted", async () => {
|
|
49
|
+
const spy = vi.spyOn(SharedClientContext, "createSharedClientContext");
|
|
50
|
+
const client = createClient("https://mock.com", MockOntology.metadata.ontologyRid, async () => "Token", undefined, fetchFunction);
|
|
51
|
+
expect(spy.mock.calls[0][0]).toBe("https://mock.com/");
|
|
52
|
+
createClient("https://mock1.com/", MockOntology.metadata.ontologyRid, async () => "Token", undefined, fetchFunction);
|
|
53
|
+
expect(spy.mock.calls[1][0]).toBe("https://mock1.com/");
|
|
54
|
+
createClient("https://mock2.com/stuff/first/foo", MockOntology.metadata.ontologyRid, async () => "Token", undefined, fetchFunction);
|
|
55
|
+
expect(spy.mock.calls[2][0]).toBe("https://mock2.com/stuff/first/foo/");
|
|
56
|
+
createClient("https://mock3.com/stuff/first/foo/", MockOntology.metadata.ontologyRid, async () => "Token", undefined, fetchFunction);
|
|
57
|
+
expect(spy.mock.calls[3][0]).toBe("https://mock3.com/stuff/first/foo/");
|
|
58
|
+
const conjureContextSpy = vi.spyOn(MakeConjureContext, "makeConjureContext");
|
|
59
|
+
metadataCacheClient({
|
|
60
|
+
baseUrl: "https://mock4.com/",
|
|
61
|
+
ontologyProvider: {
|
|
62
|
+
getObjectDefinition: async () => ({})
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
expect(conjureContextSpy.mock.results[0].value["baseUrl"] + conjureContextSpy.mock.results[0].value["servicePath"]).toBe("https://mock4.com/ontology-metadata/api");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
44
68
|
});
|
|
45
69
|
//# sourceMappingURL=createClient.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createClient.test.js","names":["Task","mockFetchResponse","MockOntology","beforeEach","describe","expect","it","vi","createClient","USER_AGENT","fetchFunction","client","fn","metadata","ontologyRid","undefined","data","getUserAgentPartsFromMockedFetch","userAgent","mock","calls","headers","get","parts","split","fetchPage","toHaveBeenCalledTimes","toEqual","osdkMetadata","extraUserAgent"],"sources":["createClient.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 { Task } from \"@osdk/client.test.ontology\";\nimport { mockFetchResponse, MockOntology } from \"@osdk/shared.test\";\nimport { beforeEach, describe, expect, it, vi } from \"vitest\";\nimport { createClient } from \"./createClient.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\ndescribe(createClient, () => {\n const validOlderVersion = \"0.13.0\";\n const validCurrentVersion = \"0.14.0\";\n const invalidFutureVersion = \"100.100.100\";\n let fetchFunction;\n let client;\n beforeEach(() => {\n fetchFunction = vi.fn();\n client = createClient(\"https://mock.com\", MockOntology.metadata.ontologyRid, async () => \"Token\", undefined, fetchFunction);\n mockFetchResponse(fetchFunction, { data: [] });\n });\n describe(\"user agent passing\", () => {\n function getUserAgentPartsFromMockedFetch() {\n const userAgent = (fetchFunction.mock.calls[0][1]?.headers)\n .get(\"Fetch-User-Agent\");\n const parts = userAgent?.split(\" \") ?? [];\n return parts;\n }\n it(\"works for objects\", async () => {\n await client(Task).fetchPage();\n expect(fetchFunction).toHaveBeenCalledTimes(1);\n const parts = getUserAgentPartsFromMockedFetch();\n expect(parts).toEqual([\n ...Task.osdkMetadata\n .extraUserAgent\n .split(\" \"),\n USER_AGENT,\n ]);\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,4BAA4B;AACjD,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,mBAAmB;AACnE,SAASC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAQ,QAAQ;AAC7D,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,UAAU,QAAQ,qBAAqB;
|
|
1
|
+
{"version":3,"file":"createClient.test.js","names":["Task","SharedClientContext","mockFetchResponse","MockOntology","beforeEach","describe","expect","it","vi","metadataCacheClient","createClient","MakeConjureContext","USER_AGENT","fetchFunction","client","fn","metadata","ontologyRid","undefined","data","getUserAgentPartsFromMockedFetch","userAgent","mock","calls","headers","get","parts","split","fetchPage","toHaveBeenCalledTimes","toEqual","osdkMetadata","extraUserAgent","spy","spyOn","toBe","conjureContextSpy","baseUrl","ontologyProvider","getObjectDefinition","results","value"],"sources":["createClient.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 { Task } from \"@osdk/client.test.ontology\";\nimport * as SharedClientContext from \"@osdk/shared.client.impl\";\nimport { mockFetchResponse, MockOntology } from \"@osdk/shared.test\";\nimport { beforeEach, describe, expect, it, vi } from \"vitest\";\nimport { metadataCacheClient } from \"./__unstable/ConjureSupport.js\";\nimport { createClient } from \"./createClient.js\";\nimport * as MakeConjureContext from \"./ontology/makeConjureContext.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\ndescribe(createClient, () => {\n const validOlderVersion = \"0.13.0\";\n const validCurrentVersion = \"0.14.0\";\n const invalidFutureVersion = \"100.100.100\";\n let fetchFunction;\n let client;\n beforeEach(() => {\n fetchFunction = vi.fn();\n client = createClient(\"https://mock.com\", MockOntology.metadata.ontologyRid, async () => \"Token\", undefined, fetchFunction);\n mockFetchResponse(fetchFunction, { data: [] });\n });\n describe(\"user agent passing\", () => {\n function getUserAgentPartsFromMockedFetch() {\n const userAgent = (fetchFunction.mock.calls[0][1]?.headers)\n .get(\"Fetch-User-Agent\");\n const parts = userAgent?.split(\" \") ?? [];\n return parts;\n }\n it(\"works for objects\", async () => {\n await client(Task).fetchPage();\n expect(fetchFunction).toHaveBeenCalledTimes(1);\n const parts = getUserAgentPartsFromMockedFetch();\n expect(parts).toEqual([\n ...Task.osdkMetadata\n .extraUserAgent\n .split(\" \"),\n USER_AGENT,\n ]);\n });\n });\n describe(\"check url formatting\", () => {\n it(\"urls are correctly formatted\", async () => {\n const spy = vi.spyOn(SharedClientContext, \"createSharedClientContext\");\n const client = createClient(\"https://mock.com\", MockOntology.metadata.ontologyRid, async () => \"Token\", undefined, fetchFunction);\n expect(spy.mock.calls[0][0]).toBe(\"https://mock.com/\");\n createClient(\"https://mock1.com/\", MockOntology.metadata.ontologyRid, async () => \"Token\", undefined, fetchFunction);\n expect(spy.mock.calls[1][0]).toBe(\"https://mock1.com/\");\n createClient(\"https://mock2.com/stuff/first/foo\", MockOntology.metadata.ontologyRid, async () => \"Token\", undefined, fetchFunction);\n expect(spy.mock.calls[2][0]).toBe(\"https://mock2.com/stuff/first/foo/\");\n createClient(\"https://mock3.com/stuff/first/foo/\", MockOntology.metadata.ontologyRid, async () => \"Token\", undefined, fetchFunction);\n expect(spy.mock.calls[3][0]).toBe(\"https://mock3.com/stuff/first/foo/\");\n const conjureContextSpy = vi.spyOn(MakeConjureContext, \"makeConjureContext\");\n metadataCacheClient({\n baseUrl: \"https://mock4.com/\",\n ontologyProvider: { getObjectDefinition: async () => ({}) },\n });\n expect(conjureContextSpy.mock.results[0].value[\"baseUrl\"]\n + conjureContextSpy.mock.results[0].value[\"servicePath\"]).toBe(\"https://mock4.com/ontology-metadata/api\");\n });\n });\n});\n"],"mappings":"AAAA;AACA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EAAEP,YAAY,CAACa,QAAQ,CAACC,WAAW,EAAE,YAAY,OAAO,EAAEC,SAAS,EAAEL,aAAa,CAAC;MACpIP,MAAM,CAAC2B,GAAG,CAACX,IAAI,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACY,IAAI,CAAC,oCAAoC,CAAC;MACvE,MAAMC,iBAAiB,GAAG5B,EAAE,CAAC0B,KAAK,CAACvB,kBAAkB,EAAE,oBAAoB,CAAC;MAC5EF,mBAAmB,CAAC;QAChB4B,OAAO,EAAE,oBAAoB;QAC7BC,gBAAgB,EAAE;UAAEC,mBAAmB,EAAE,MAAAA,CAAA,MAAa,CAAC,CAAC;QAAE;MAC9D,CAAC,CAAC;MACFjC,MAAM,CAAC8B,iBAAiB,CAACd,IAAI,CAACkB,OAAO,CAAC,CAAC,CAAC,CAACC,KAAK,CAAC,SAAS,CAAC,GACnDL,iBAAiB,CAACd,IAAI,CAACkB,OAAO,CAAC,CAAC,CAAC,CAACC,KAAK,CAAC,aAAa,CAAC,CAAC,CAACN,IAAI,CAAC,yCAAyC,CAAC;IACjH,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@ import type { MinimalClient } from "./MinimalClientContext.js";
|
|
|
3
3
|
export declare class GeotimeSeriesPropertyImpl<T extends GeoJSON.Point> implements GeotimeSeriesProperty<T> {
|
|
4
4
|
#private;
|
|
5
5
|
lastFetchedValue: TimeSeriesPoint<T> | undefined;
|
|
6
|
-
constructor(client: MinimalClient, objectApiName: string, primaryKey: any, propertyName: string);
|
|
6
|
+
constructor(client: MinimalClient, objectApiName: string, primaryKey: any, propertyName: string, initialValue?: TimeSeriesPoint<T>);
|
|
7
7
|
getLatestValue(): Promise<TimeSeriesPoint<T> | undefined>;
|
|
8
8
|
getAllValues(query?: TimeSeriesQuery): Promise<TimeSeriesPoint<T>[]>;
|
|
9
9
|
asyncIterValues(query?: TimeSeriesQuery): AsyncGenerator<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGeotimeSeriesProperty.d.ts","sourceRoot":"","sources":["../../src/createGeotimeSeriesProperty.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,
|
|
1
|
+
{"version":3,"file":"createGeotimeSeriesProperty.d.ts","sourceRoot":"","sources":["../../src/createGeotimeSeriesProperty.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EACf,eAAe,EAChB,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D,qBAAa,yBAAyB,CAAC,CAAC,SAAS,OAAO,CAAC,KAAK,CAC5D,YAAW,qBAAqB,CAAC,CAAC,CAAC;;IAInC,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;gBAG/C,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,GAAG,EACf,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;IAStB,cAAc,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAWzD,YAAY,CAAC,KAAK,CAAC,EAAE,eAAe;IASnC,eAAe,CAC3B,KAAK,CAAC,EAAE,eAAe;;;;CAgB1B"}
|
|
@@ -19,9 +19,12 @@ export class GeotimeSeriesPropertyImpl {
|
|
|
19
19
|
#triplet;
|
|
20
20
|
#client;
|
|
21
21
|
lastFetchedValue;
|
|
22
|
-
constructor(client, objectApiName, primaryKey, propertyName) {
|
|
22
|
+
constructor(client, objectApiName, primaryKey, propertyName, initialValue) {
|
|
23
23
|
this.#client = client;
|
|
24
24
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
25
|
+
if (initialValue != null) {
|
|
26
|
+
this.lastFetchedValue = initialValue;
|
|
27
|
+
}
|
|
25
28
|
}
|
|
26
29
|
async getLatestValue() {
|
|
27
30
|
const latestPointPromise = OntologiesV2.TimeSeriesValueBankProperties.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGeotimeSeriesProperty.js","names":["OntologiesV2","asyncIterPointsHelper","getTimeRange","GeotimeSeriesPropertyImpl","triplet","client","lastFetchedValue","constructor","objectApiName","primaryKey","propertyName","getLatestValue","latestPointPromise","TimeSeriesValueBankProperties","ontologyRid","then","latestPoint","getAllValues","query","allPoints","point","asyncIterValues","push","streamPointsIterator","streamValues","range","timeseriesPoint"],"sources":["createGeotimeSeriesProperty.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 { asyncIterPointsHelper, getTimeRange } from \"./util/timeseriesUtils.js\";\nexport class GeotimeSeriesPropertyImpl {\n #triplet;\n #client;\n lastFetchedValue;\n constructor(client, objectApiName, primaryKey, propertyName) {\n this.#client = client;\n this.#triplet = [objectApiName, primaryKey, propertyName];\n }\n async getLatestValue() {\n const latestPointPromise = OntologiesV2.TimeSeriesValueBankProperties\n .getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);\n latestPointPromise.then(latestPoint => this.lastFetchedValue = latestPoint);\n return latestPointPromise;\n }\n async getAllValues(query) {\n const allPoints = [];\n for await (const point of this.asyncIterValues(query)) {\n allPoints.push(point);\n }\n return allPoints;\n }\n async *asyncIterValues(query) {\n const streamPointsIterator = await OntologiesV2\n .TimeSeriesValueBankProperties.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? { range: getTimeRange(query) } : {});\n for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {\n yield timeseriesPoint;\n }\n }\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,qBAAqB,EAAEC,YAAY,QAAQ,2BAA2B;AAC/E,OAAO,MAAMC,yBAAyB,CAAC;EACnC,CAACC,OAAO;EACR,CAACC,MAAM;EACPC,gBAAgB;EAChBC,WAAWA,CAACF,MAAM,EAAEG,aAAa,EAAEC,UAAU,EAAEC,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"createGeotimeSeriesProperty.js","names":["OntologiesV2","asyncIterPointsHelper","getTimeRange","GeotimeSeriesPropertyImpl","triplet","client","lastFetchedValue","constructor","objectApiName","primaryKey","propertyName","initialValue","getLatestValue","latestPointPromise","TimeSeriesValueBankProperties","ontologyRid","then","latestPoint","getAllValues","query","allPoints","point","asyncIterValues","push","streamPointsIterator","streamValues","range","timeseriesPoint"],"sources":["createGeotimeSeriesProperty.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 { asyncIterPointsHelper, getTimeRange } from \"./util/timeseriesUtils.js\";\nexport class GeotimeSeriesPropertyImpl {\n #triplet;\n #client;\n lastFetchedValue;\n constructor(client, objectApiName, primaryKey, propertyName, initialValue) {\n this.#client = client;\n this.#triplet = [objectApiName, primaryKey, propertyName];\n if (initialValue != null) {\n this.lastFetchedValue = initialValue;\n }\n }\n async getLatestValue() {\n const latestPointPromise = OntologiesV2.TimeSeriesValueBankProperties\n .getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);\n latestPointPromise.then(latestPoint => this.lastFetchedValue = latestPoint);\n return latestPointPromise;\n }\n async getAllValues(query) {\n const allPoints = [];\n for await (const point of this.asyncIterValues(query)) {\n allPoints.push(point);\n }\n return allPoints;\n }\n async *asyncIterValues(query) {\n const streamPointsIterator = await OntologiesV2\n .TimeSeriesValueBankProperties.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? { range: getTimeRange(query) } : {});\n for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {\n yield timeseriesPoint;\n }\n }\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,qBAAqB,EAAEC,YAAY,QAAQ,2BAA2B;AAC/E,OAAO,MAAMC,yBAAyB,CAAC;EACnC,CAACC,OAAO;EACR,CAACC,MAAM;EACPC,gBAAgB;EAChBC,WAAWA,CAACF,MAAM,EAAEG,aAAa,EAAEC,UAAU,EAAEC,YAAY,EAAEC,YAAY,EAAE;IACvE,IAAI,CAAC,CAACN,MAAM,GAAGA,MAAM;IACrB,IAAI,CAAC,CAACD,OAAO,GAAG,CAACI,aAAa,EAAEC,UAAU,EAAEC,YAAY,CAAC;IACzD,IAAIC,YAAY,IAAI,IAAI,EAAE;MACtB,IAAI,CAACL,gBAAgB,GAAGK,YAAY;IACxC;EACJ;EACA,MAAMC,cAAcA,CAAA,EAAG;IACnB,MAAMC,kBAAkB,GAAGb,YAAY,CAACc,6BAA6B,CAChEF,cAAc,CAAC,IAAI,CAAC,CAACP,MAAM,EAAE,MAAM,IAAI,CAAC,CAACA,MAAM,CAACU,WAAW,EAAE,GAAG,IAAI,CAAC,CAACX,OAAO,CAAC;IACnFS,kBAAkB,CAACG,IAAI,CAACC,WAAW,IAAI,IAAI,CAACX,gBAAgB,GAAGW,WAAW,CAAC;IAC3E,OAAOJ,kBAAkB;EAC7B;EACA,MAAMK,YAAYA,CAACC,KAAK,EAAE;IACtB,MAAMC,SAAS,GAAG,EAAE;IACpB,WAAW,MAAMC,KAAK,IAAI,IAAI,CAACC,eAAe,CAACH,KAAK,CAAC,EAAE;MACnDC,SAAS,CAACG,IAAI,CAACF,KAAK,CAAC;IACzB;IACA,OAAOD,SAAS;EACpB;EACA,OAAOE,eAAeA,CAACH,KAAK,EAAE;IAC1B,MAAMK,oBAAoB,GAAG,MAAMxB,YAAY,CAC1Cc,6BAA6B,CAACW,YAAY,CAAC,IAAI,CAAC,CAACpB,MAAM,EAAE,MAAM,IAAI,CAAC,CAACA,MAAM,CAACU,WAAW,EAAE,GAAG,IAAI,CAAC,CAACX,OAAO,EAAEe,KAAK,GAAG;MAAEO,KAAK,EAAExB,YAAY,CAACiB,KAAK;IAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5J,WAAW,MAAMQ,eAAe,IAAI1B,qBAAqB,CAACuB,oBAAoB,CAAC,EAAE;MAC7E,MAAMG,eAAe;IACzB;EACJ;AACJ","ignoreList":[]}
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { createSharedClientContext } from "@osdk/shared.client.impl";
|
|
17
|
+
import { convertWireToOsdkObjects, convertWireToOsdkObjects2 } from "./object/convertWireToOsdkObjects.js";
|
|
17
18
|
import { createObjectSet } from "./objectSet/createObjectSet.js";
|
|
18
19
|
import { createStandardOntologyProviderFactory } from "./ontology/StandardOntologyProvider.js";
|
|
19
20
|
import { USER_AGENT } from "./util/UserAgent.js";
|
|
20
21
|
/** @internal */
|
|
21
22
|
export function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {
|
|
22
|
-
if (process
|
|
23
|
+
if (process.env.NODE_ENV !== "production") {
|
|
23
24
|
try {
|
|
24
25
|
new URL(baseUrl);
|
|
25
26
|
} catch (e) {
|
|
@@ -27,16 +28,20 @@ export function createMinimalClient(metadata, baseUrl, tokenProvider, options =
|
|
|
27
28
|
throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
31
|
+
const processedBaseUrl = new URL(baseUrl);
|
|
32
|
+
processedBaseUrl.pathname += processedBaseUrl.pathname.endsWith("/") ? "" : "/";
|
|
30
33
|
const minimalClient = {
|
|
31
|
-
...createSharedClientContext(
|
|
34
|
+
...createSharedClientContext(processedBaseUrl.toString(), tokenProvider, USER_AGENT, fetchFn),
|
|
32
35
|
objectSetFactory,
|
|
36
|
+
objectFactory: convertWireToOsdkObjects,
|
|
37
|
+
objectFactory2: convertWireToOsdkObjects2,
|
|
33
38
|
ontologyRid: metadata.ontologyRid,
|
|
34
39
|
logger: options.logger,
|
|
35
40
|
clientCacheKey: {},
|
|
36
41
|
requestContext: {}
|
|
37
42
|
};
|
|
38
|
-
return Object.assign(minimalClient, {
|
|
43
|
+
return Object.freeze(Object.assign(minimalClient, {
|
|
39
44
|
ontologyProvider: createStandardOntologyProviderFactory(options)(minimalClient)
|
|
40
|
-
});
|
|
45
|
+
}));
|
|
41
46
|
}
|
|
42
47
|
//# sourceMappingURL=createMinimalClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMinimalClient.js","names":["createSharedClientContext","createObjectSet","createStandardOntologyProviderFactory","USER_AGENT","createMinimalClient","metadata","baseUrl","tokenProvider","options","fetchFn","global","fetch","objectSetFactory","process","env","NODE_ENV","URL","e","hint","startsWith","Error","minimalClient","ontologyRid","logger","clientCacheKey","requestContext","Object","assign","ontologyProvider"],"sources":["createMinimalClient.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 { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport { createStandardOntologyProviderFactory, } from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\n/** @internal */\nexport function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {\n if (process
|
|
1
|
+
{"version":3,"file":"createMinimalClient.js","names":["createSharedClientContext","convertWireToOsdkObjects","convertWireToOsdkObjects2","createObjectSet","createStandardOntologyProviderFactory","USER_AGENT","createMinimalClient","metadata","baseUrl","tokenProvider","options","fetchFn","global","fetch","objectSetFactory","process","env","NODE_ENV","URL","e","hint","startsWith","Error","processedBaseUrl","pathname","endsWith","minimalClient","toString","objectFactory","objectFactory2","ontologyRid","logger","clientCacheKey","requestContext","Object","freeze","assign","ontologyProvider"],"sources":["createMinimalClient.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 { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport { convertWireToOsdkObjects, convertWireToOsdkObjects2, } from \"./object/convertWireToOsdkObjects.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport { createStandardOntologyProviderFactory, } from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\n/** @internal */\nexport function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n new URL(baseUrl);\n }\n catch (e) {\n const hint = !baseUrl.startsWith(\"http://\") || !baseUrl.startsWith(\"https://\")\n ? \". Did you forget to add 'http://' or 'https://'?\"\n : \"\";\n throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);\n }\n }\n const processedBaseUrl = new URL(baseUrl);\n processedBaseUrl.pathname += processedBaseUrl.pathname.endsWith(\"/\")\n ? \"\"\n : \"/\";\n const minimalClient = {\n ...createSharedClientContext(processedBaseUrl.toString(), tokenProvider, USER_AGENT, fetchFn),\n objectSetFactory,\n objectFactory: convertWireToOsdkObjects,\n objectFactory2: convertWireToOsdkObjects2,\n ontologyRid: metadata.ontologyRid,\n logger: options.logger,\n clientCacheKey: {},\n requestContext: {},\n };\n return Object.freeze(Object.assign(minimalClient, {\n ontologyProvider: createStandardOntologyProviderFactory(options)(minimalClient),\n }));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,yBAAyB,QAAQ,0BAA0B;AACpE,SAASC,wBAAwB,EAAEC,yBAAyB,QAAS,sCAAsC;AAC3G,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,qCAAqC,QAAS,wCAAwC;AAC/F,SAASC,UAAU,QAAQ,qBAAqB;AAChD;AACA,OAAO,SAASC,mBAAmBA,CAACC,QAAQ,EAAEC,OAAO,EAAEC,a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version":3,"file":"createPlatformClient.d.ts","sourceRoot":"","sources":["../../src/createPlatformClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createPlatformClient.d.ts","sourceRoot":"","sources":["../../src/createPlatformClient.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,MAAM,WAAW,cAAe,SAAQ,mBAAmB;CAAG;AAE9D;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACpC,OAAO,GAAE,SAAqB,EAC9B,OAAO,GAAE,OAAO,UAAU,CAAC,KAAa,GACvC,cAAc,CAOhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTimeseriesProperty.d.ts","sourceRoot":"","sources":["../../src/createTimeseriesProperty.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,eAAe,EAChB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"createTimeseriesProperty.d.ts","sourceRoot":"","sources":["../../src/createTimeseriesProperty.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,eAAe,EAChB,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D,qBAAa,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAC3D,YAAW,kBAAkB,CAAC,CAAC,CAAC;;gBAM9B,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,GAAG,EACf,YAAY,EAAE,MAAM;IAMT,aAAa;IAQb,YAAY;IAQZ,YAAY,CAAC,KAAK,CAAC,EAAE,eAAe;IASnC,eAAe,CAC3B,KAAK,CAAC,EAAE,eAAe;;;;CAgB1B"}
|
|
@@ -72,6 +72,13 @@ describe("FetchMetadata", () => {
|
|
|
72
72
|
"primaryKeyApiName": "employeeId",
|
|
73
73
|
"primaryKeyType": "integer",
|
|
74
74
|
"properties": {
|
|
75
|
+
"class": {
|
|
76
|
+
"description": "",
|
|
77
|
+
"displayName": undefined,
|
|
78
|
+
"multiplicity": false,
|
|
79
|
+
"nullable": true,
|
|
80
|
+
"type": "string",
|
|
81
|
+
},
|
|
75
82
|
"employeeId": {
|
|
76
83
|
"description": undefined,
|
|
77
84
|
"displayName": undefined,
|
|
@@ -86,6 +93,13 @@ describe("FetchMetadata", () => {
|
|
|
86
93
|
"nullable": true,
|
|
87
94
|
"type": "geotimeSeriesReference",
|
|
88
95
|
},
|
|
96
|
+
"employeeSensor": {
|
|
97
|
+
"description": "TimeSeries sensor of the status of the employee",
|
|
98
|
+
"displayName": undefined,
|
|
99
|
+
"multiplicity": false,
|
|
100
|
+
"nullable": true,
|
|
101
|
+
"type": "sensorTimeseries",
|
|
102
|
+
},
|
|
89
103
|
"employeeStatus": {
|
|
90
104
|
"description": "TimeSeries of the status of the employee",
|
|
91
105
|
"displayName": undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchMetadata.test.js","names":["$Actions","$Interfaces","$Objects","$ontologyRid","$Queries","apiServer","afterAll","beforeAll","describe","expect","expectTypeOf","it","createClient","client","listen","close","objectMetadata","fetchMetadata","Employee","toEqualTypeOf","toMatchInlineSnapshot","interfaceMetadata","FooInterface","actionMetadata","moveOffice","queryMetadata","queryAcceptsObject"],"sources":["fetchMetadata.test.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 { $Actions, $Interfaces, $Objects, $ontologyRid, $Queries, } from \"@osdk/client.test.ontology\";\nimport { apiServer } from \"@osdk/shared.test\";\nimport { afterAll, beforeAll, describe, expect, expectTypeOf, it, } from \"vitest\";\nimport { createClient } from \"./createClient.js\";\ndescribe(\"FetchMetadata\", () => {\n let client;\n beforeAll(async () => {\n apiServer.listen();\n client = createClient(\"https://stack.palantir.com\", $ontologyRid, async () => \"myAccessToken\");\n });\n afterAll(() => {\n apiServer.close();\n });\n it(\"fetches object metadata correctly\", async () => {\n const objectMetadata = await client.fetchMetadata($Objects.Employee);\n expectTypeOf(objectMetadata).toEqualTypeOf();\n expect(objectMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"Employee\",\n \"description\": \"A full-time or part-time \n\n employee of our firm\",\n \"displayName\": \"Employee\",\n \"icon\": {\n \"color\": \"blue\",\n \"name\": \"person\",\n \"type\": \"blueprint\",\n },\n \"implements\": [\n \"FooInterface\",\n ],\n \"interfaceMap\": {\n \"FooInterface\": {\n \"fooSpt\": \"fullName\",\n },\n },\n \"inverseInterfaceMap\": {\n \"FooInterface\": {\n \"fullName\": \"fooSpt\",\n },\n },\n \"links\": {\n \"lead\": {\n \"multiplicity\": false,\n \"targetType\": \"Employee\",\n },\n \"officeLink\": {\n \"multiplicity\": false,\n \"targetType\": \"Office\",\n },\n \"peeps\": {\n \"multiplicity\": true,\n \"targetType\": \"Employee\",\n },\n },\n \"pluralDisplayName\": \"Employees\",\n \"primaryKeyApiName\": \"employeeId\",\n \"primaryKeyType\": \"integer\",\n \"properties\": {\n \"employeeId\": {\n \"description\": undefined,\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": false,\n \"type\": \"integer\",\n },\n \"employeeLocation\": {\n \"description\": \"Geotime series reference of the location of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"geotimeSeriesReference\",\n },\n \"employeeStatus\": {\n \"description\": \"TimeSeries of the status of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"stringTimeseries\",\n },\n \"fullName\": {\n \"description\": undefined,\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"office\": {\n \"description\": \"The unique \"ID\" of the employee's \\\\\"primary\\\\\" assigned office.\n This is some more text.\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"startDate\": {\n \"description\": \"The date the employee was hired (most recently, if they were re-hired)\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"datetime\",\n },\n },\n \"rid\": \"ri.ontology.main.object-type.401ac022-89eb-4591-8b7e-0a912b9efb44\",\n \"status\": \"ACTIVE\",\n \"titleProperty\": \"fullName\",\n \"type\": \"object\",\n \"visibility\": \"NORMAL\",\n }\n `);\n });\n it(\"fetches interface metadata correctly\", async () => {\n const interfaceMetadata = await client.fetchMetadata($Interfaces.FooInterface);\n expectTypeOf(interfaceMetadata).toEqualTypeOf();\n expect(interfaceMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"FooInterface\",\n \"description\": \"Interface for Foo\",\n \"displayName\": \"Foo Interface\",\n \"implements\": [],\n \"links\": {},\n \"properties\": {\n \"fooSpt\": {\n \"description\": \"A foo\",\n \"displayName\": \"Foo\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n },\n \"rid\": \"ri.interface.main.interface.1\",\n \"type\": \"interface\",\n }\n `);\n });\n it(\"fetches action metadata correctly\", async () => {\n const actionMetadata = await client.fetchMetadata($Actions.moveOffice);\n expectTypeOf(actionMetadata).toEqualTypeOf();\n expect(actionMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"moveOffice\",\n \"description\": \"Update an office's physical location\",\n \"displayName\": \"move-office\",\n \"modifiedEntities\": {\n \"Office\": {\n \"created\": false,\n \"modified\": true,\n },\n },\n \"parameters\": {\n \"newAddress\": {\n \"description\": \"The office's new physical address (not necessarily shipping address)\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"newCapacity\": {\n \"description\": \"The maximum seated-at-desk capacity of the new office (maximum fire-safe capacity may be higher)\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"integer\",\n },\n \"officeId\": {\n \"description\": undefined,\n \"multiplicity\": false,\n \"nullable\": false,\n \"type\": \"string\",\n },\n \"officeNames\": {\n \"description\": \"A list of all office names\",\n \"multiplicity\": true,\n \"nullable\": true,\n \"type\": \"integer\",\n },\n },\n \"rid\": \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n \"status\": \"ACTIVE\",\n \"type\": \"action\",\n }\n `);\n });\n it(\"fetches query metadata correctly\", async () => {\n const queryMetadata = await client.fetchMetadata($Queries.queryAcceptsObject);\n expectTypeOf(queryMetadata).toEqualTypeOf();\n expect(queryMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"queryAcceptsObject\",\n \"description\": \"description of the query that takes object types\",\n \"displayName\": \"QueryAcceptsObject\",\n \"output\": {\n \"nullable\": false,\n \"object\": \"Employee\",\n \"type\": \"object\",\n },\n \"parameters\": {\n \"object\": {\n \"description\": undefined,\n \"nullable\": false,\n \"object\": \"Employee\",\n \"type\": \"object\",\n },\n },\n \"rid\": \"ri.function-registry.main.function.9b55870a-63c7-4d48-8f06-9627c0805968\",\n \"type\": \"query\",\n \"version\": \"0.11.0\",\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,QAAQ,QAAS,4BAA4B;AACrG,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,YAAY,EAAEC,EAAE,QAAS,QAAQ;AACjF,SAASC,YAAY,QAAQ,mBAAmB;AAChDJ,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC5B,IAAIK,MAAM;EACVN,SAAS,CAAC,YAAY;IAClBF,SAAS,CAACS,MAAM,CAAC,CAAC;IAClBD,MAAM,GAAGD,YAAY,CAAC,4BAA4B,EAAET,YAAY,EAAE,YAAY,eAAe,CAAC;EAClG,CAAC,CAAC;EACFG,QAAQ,CAAC,MAAM;IACXD,SAAS,CAACU,KAAK,CAAC,CAAC;EACrB,CAAC,CAAC;EACFJ,EAAE,CAAC,mCAAmC,EAAE,YAAY;IAChD,MAAMK,cAAc,GAAG,MAAMH,MAAM,CAACI,aAAa,CAACf,QAAQ,CAACgB,QAAQ,CAAC;IACpER,YAAY,CAACM,cAAc,CAAC,CAACG,aAAa,CAAC,CAAC;IAC5CV,MAAM,CAACO,cAAc,CAAC,CAACI,qBAAqB,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFT,EAAE,CAAC,sCAAsC,EAAE,YAAY;IACnD,MAAMU,iBAAiB,GAAG,MAAMR,MAAM,CAACI,aAAa,CAAChB,WAAW,CAACqB,YAAY,CAAC;IAC9EZ,YAAY,CAACW,iBAAiB,CAAC,CAACF,aAAa,CAAC,CAAC;IAC/CV,MAAM,CAACY,iBAAiB,CAAC,CAACD,qBAAqB,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFT,EAAE,CAAC,mCAAmC,EAAE,YAAY;IAChD,MAAMY,cAAc,GAAG,MAAMV,MAAM,CAACI,aAAa,CAACjB,QAAQ,CAACwB,UAAU,CAAC;IACtEd,YAAY,CAACa,cAAc,CAAC,CAACJ,aAAa,CAAC,CAAC;IAC5CV,MAAM,CAACc,cAAc,CAAC,CAACH,qBAAqB,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFT,EAAE,CAAC,kCAAkC,EAAE,YAAY;IAC/C,MAAMc,aAAa,GAAG,MAAMZ,MAAM,CAACI,aAAa,CAACb,QAAQ,CAACsB,kBAAkB,CAAC;IAC7EhB,YAAY,CAACe,aAAa,CAAC,CAACN,aAAa,CAAC,CAAC;IAC3CV,MAAM,CAACgB,aAAa,CAAC,CAACL,qBAAqB,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"fetchMetadata.test.js","names":["$Actions","$Interfaces","$Objects","$ontologyRid","$Queries","apiServer","afterAll","beforeAll","describe","expect","expectTypeOf","it","createClient","client","listen","close","objectMetadata","fetchMetadata","Employee","toEqualTypeOf","toMatchInlineSnapshot","interfaceMetadata","FooInterface","actionMetadata","moveOffice","queryMetadata","queryAcceptsObject"],"sources":["fetchMetadata.test.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 { $Actions, $Interfaces, $Objects, $ontologyRid, $Queries, } from \"@osdk/client.test.ontology\";\nimport { apiServer } from \"@osdk/shared.test\";\nimport { afterAll, beforeAll, describe, expect, expectTypeOf, it, } from \"vitest\";\nimport { createClient } from \"./createClient.js\";\ndescribe(\"FetchMetadata\", () => {\n let client;\n beforeAll(async () => {\n apiServer.listen();\n client = createClient(\"https://stack.palantir.com\", $ontologyRid, async () => \"myAccessToken\");\n });\n afterAll(() => {\n apiServer.close();\n });\n it(\"fetches object metadata correctly\", async () => {\n const objectMetadata = await client.fetchMetadata($Objects.Employee);\n expectTypeOf(objectMetadata).toEqualTypeOf();\n expect(objectMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"Employee\",\n \"description\": \"A full-time or part-time \n\n employee of our firm\",\n \"displayName\": \"Employee\",\n \"icon\": {\n \"color\": \"blue\",\n \"name\": \"person\",\n \"type\": \"blueprint\",\n },\n \"implements\": [\n \"FooInterface\",\n ],\n \"interfaceMap\": {\n \"FooInterface\": {\n \"fooSpt\": \"fullName\",\n },\n },\n \"inverseInterfaceMap\": {\n \"FooInterface\": {\n \"fullName\": \"fooSpt\",\n },\n },\n \"links\": {\n \"lead\": {\n \"multiplicity\": false,\n \"targetType\": \"Employee\",\n },\n \"officeLink\": {\n \"multiplicity\": false,\n \"targetType\": \"Office\",\n },\n \"peeps\": {\n \"multiplicity\": true,\n \"targetType\": \"Employee\",\n },\n },\n \"pluralDisplayName\": \"Employees\",\n \"primaryKeyApiName\": \"employeeId\",\n \"primaryKeyType\": \"integer\",\n \"properties\": {\n \"class\": {\n \"description\": \"\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"employeeId\": {\n \"description\": undefined,\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": false,\n \"type\": \"integer\",\n },\n \"employeeLocation\": {\n \"description\": \"Geotime series reference of the location of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"geotimeSeriesReference\",\n },\n \"employeeSensor\": {\n \"description\": \"TimeSeries sensor of the status of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"sensorTimeseries\",\n },\n \"employeeStatus\": {\n \"description\": \"TimeSeries of the status of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"stringTimeseries\",\n },\n \"fullName\": {\n \"description\": undefined,\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"office\": {\n \"description\": \"The unique \"ID\" of the employee's \\\\\"primary\\\\\" assigned office.\n This is some more text.\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"startDate\": {\n \"description\": \"The date the employee was hired (most recently, if they were re-hired)\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"datetime\",\n },\n },\n \"rid\": \"ri.ontology.main.object-type.401ac022-89eb-4591-8b7e-0a912b9efb44\",\n \"status\": \"ACTIVE\",\n \"titleProperty\": \"fullName\",\n \"type\": \"object\",\n \"visibility\": \"NORMAL\",\n }\n `);\n });\n it(\"fetches interface metadata correctly\", async () => {\n const interfaceMetadata = await client.fetchMetadata($Interfaces.FooInterface);\n expectTypeOf(interfaceMetadata).toEqualTypeOf();\n expect(interfaceMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"FooInterface\",\n \"description\": \"Interface for Foo\",\n \"displayName\": \"Foo Interface\",\n \"implements\": [],\n \"links\": {},\n \"properties\": {\n \"fooSpt\": {\n \"description\": \"A foo\",\n \"displayName\": \"Foo\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n },\n \"rid\": \"ri.interface.main.interface.1\",\n \"type\": \"interface\",\n }\n `);\n });\n it(\"fetches action metadata correctly\", async () => {\n const actionMetadata = await client.fetchMetadata($Actions.moveOffice);\n expectTypeOf(actionMetadata).toEqualTypeOf();\n expect(actionMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"moveOffice\",\n \"description\": \"Update an office's physical location\",\n \"displayName\": \"move-office\",\n \"modifiedEntities\": {\n \"Office\": {\n \"created\": false,\n \"modified\": true,\n },\n },\n \"parameters\": {\n \"newAddress\": {\n \"description\": \"The office's new physical address (not necessarily shipping address)\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"newCapacity\": {\n \"description\": \"The maximum seated-at-desk capacity of the new office (maximum fire-safe capacity may be higher)\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"integer\",\n },\n \"officeId\": {\n \"description\": undefined,\n \"multiplicity\": false,\n \"nullable\": false,\n \"type\": \"string\",\n },\n \"officeNames\": {\n \"description\": \"A list of all office names\",\n \"multiplicity\": true,\n \"nullable\": true,\n \"type\": \"integer\",\n },\n },\n \"rid\": \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n \"status\": \"ACTIVE\",\n \"type\": \"action\",\n }\n `);\n });\n it(\"fetches query metadata correctly\", async () => {\n const queryMetadata = await client.fetchMetadata($Queries.queryAcceptsObject);\n expectTypeOf(queryMetadata).toEqualTypeOf();\n expect(queryMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"queryAcceptsObject\",\n \"description\": \"description of the query that takes object types\",\n \"displayName\": \"QueryAcceptsObject\",\n \"output\": {\n \"nullable\": false,\n \"object\": \"Employee\",\n \"type\": \"object\",\n },\n \"parameters\": {\n \"object\": {\n \"description\": undefined,\n \"nullable\": false,\n \"object\": \"Employee\",\n \"type\": \"object\",\n },\n },\n \"rid\": \"ri.function-registry.main.function.9b55870a-63c7-4d48-8f06-9627c0805968\",\n \"type\": \"query\",\n \"version\": \"0.11.0\",\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,QAAQ,QAAS,4BAA4B;AACrG,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,YAAY,EAAEC,EAAE,QAAS,QAAQ;AACjF,SAASC,YAAY,QAAQ,mBAAmB;AAChDJ,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC5B,IAAIK,MAAM;EACVN,SAAS,CAAC,YAAY;IAClBF,SAAS,CAACS,MAAM,CAAC,CAAC;IAClBD,MAAM,GAAGD,YAAY,CAAC,4BAA4B,EAAET,YAAY,EAAE,YAAY,eAAe,CAAC;EAClG,CAAC,CAAC;EACFG,QAAQ,CAAC,MAAM;IACXD,SAAS,CAACU,KAAK,CAAC,CAAC;EACrB,CAAC,CAAC;EACFJ,EAAE,CAAC,mCAAmC,EAAE,YAAY;IAChD,MAAMK,cAAc,GAAG,MAAMH,MAAM,CAACI,aAAa,CAACf,QAAQ,CAACgB,QAAQ,CAAC;IACpER,YAAY,CAACM,cAAc,CAAC,CAACG,aAAa,CAAC,CAAC;IAC5CV,MAAM,CAACO,cAAc,CAAC,CAACI,qBAAqB,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFT,EAAE,CAAC,sCAAsC,EAAE,YAAY;IACnD,MAAMU,iBAAiB,GAAG,MAAMR,MAAM,CAACI,aAAa,CAAChB,WAAW,CAACqB,YAAY,CAAC;IAC9EZ,YAAY,CAACW,iBAAiB,CAAC,CAACF,aAAa,CAAC,CAAC;IAC/CV,MAAM,CAACY,iBAAiB,CAAC,CAACD,qBAAqB,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFT,EAAE,CAAC,mCAAmC,EAAE,YAAY;IAChD,MAAMY,cAAc,GAAG,MAAMV,MAAM,CAACI,aAAa,CAACjB,QAAQ,CAACwB,UAAU,CAAC;IACtEd,YAAY,CAACa,cAAc,CAAC,CAACJ,aAAa,CAAC,CAAC;IAC5CV,MAAM,CAACc,cAAc,CAAC,CAACH,qBAAqB,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;EACFT,EAAE,CAAC,kCAAkC,EAAE,YAAY;IAC/C,MAAMc,aAAa,GAAG,MAAMZ,MAAM,CAACI,aAAa,CAACb,QAAQ,CAACsB,kBAAkB,CAAC;IAC7EhB,YAAY,CAACe,aAAa,CAAC,CAACN,aAAa,CAAC,CAAC;IAC3CV,MAAM,CAACgB,aAAa,CAAC,CAACL,qBAAqB,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
package/build/esm/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export type { ActionEditResponse, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, ObjectSet, Osdk, OsdkObject, PageResult, Result, WhereClause, } from "@osdk/api";
|
|
1
|
+
export type { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, InterfaceDefinition, ObjectMetadata, ObjectSet, ObjectTypeDefinition, Osdk, OsdkObject, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Result, SingleLinkAccessor, VersionBound, WhereClause, } from "@osdk/api";
|
|
2
2
|
export { isOk } from "@osdk/api";
|
|
3
3
|
export { PalantirApiError } from "@osdk/shared.net.errors";
|
|
4
4
|
export { ActionValidationError } from "./actions/ActionValidationError.js";
|
|
5
5
|
export type { Client } from "./Client.js";
|
|
6
|
-
export { createAttachmentFromRid } from "./createAttachmentFromRid.js";
|
|
7
6
|
export { createClient } from "./createClient.js";
|
|
8
7
|
export { createPlatformClient } from "./createPlatformClient.js";
|
|
9
8
|
export type { PlatformClient } from "./createPlatformClient.js";
|
|
10
9
|
export type { Logger } from "./Logger.js";
|
|
11
10
|
export { createAttachmentUpload } from "./object/AttachmentUpload.js";
|
|
12
11
|
export type { ResultOrError } from "./ResultOrError.js";
|
|
12
|
+
export { extractDate, extractDateInLocalTime, extractDateInUTC, } from "./util/datetimeConverters.js";
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/build/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,UAAU,EACV,WAAW,EACX,MAAM,EACN,kBAAkB,EAClB,YAAY,EACZ,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,8BAA8B,CAAC"}
|
package/build/esm/index.js
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
export { isOk } from "@osdk/api";
|
|
17
17
|
export { PalantirApiError } from "@osdk/shared.net.errors";
|
|
18
18
|
export { ActionValidationError } from "./actions/ActionValidationError.js";
|
|
19
|
-
export { createAttachmentFromRid } from "./createAttachmentFromRid.js";
|
|
20
19
|
export { createClient } from "./createClient.js";
|
|
21
20
|
export { createPlatformClient } from "./createPlatformClient.js";
|
|
22
21
|
export { createAttachmentUpload } from "./object/AttachmentUpload.js";
|
|
22
|
+
export { extractDate, extractDateInLocalTime, extractDateInUTC } from "./util/datetimeConverters.js";
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","
|
|
1
|
+
{"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC"],"sources":["index.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 { isOk } from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport { extractDate, extractDateInLocalTime, extractDateInUTC, } from \"./util/datetimeConverters.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,WAAW;AAChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,WAAW,EAAEC,sBAAsB,EAAEC,gBAAgB,QAAS,8BAA8B","ignoreList":[]}
|
|
@@ -52,7 +52,7 @@ describe("intellisense", () => {
|
|
|
52
52
|
const clientsPackageJson = findUpSync("package.json", {
|
|
53
53
|
cwd: import.meta.url
|
|
54
54
|
});
|
|
55
|
-
!(clientsPackageJson != null) ? invariant(false) : void 0;
|
|
55
|
+
!(clientsPackageJson != null) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
|
|
56
56
|
packagesDir = path.join(path.dirname(clientsPackageJson), "..");
|
|
57
57
|
clientPackagePath = path.join(packagesDir, "client");
|
|
58
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intellisense.test.js","names":["findUpSync","path","invariant","ts","afterEach","beforeAll","beforeEach","describe","expect","it","vi","startTsServer","rootLogger","hoisted","pino","pinoPretty","EventEmitter","Promise","resolve","level","build","sync","timestampKey","undefined","errorLikeObjectKeys","errorProps","ignore","destination","write","a","at","slice","console","log","packagesDir","clientPackagePath","clientsPackageJson","cwd","import","meta","url","join","dirname","tsServer","intellisenseFilePath","task","name","sys","fileExists","toBeTruthy","sendOpenRequest","file","stop","timeout","resp","sendQuickInfoRequest","line","offset","body","documentation","toMatchInlineSnapshot"],"sources":["intellisense.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 { findUpSync } from \"find-up\";\nimport * as path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport * as ts from \"typescript\";\nimport { afterEach, beforeAll, beforeEach, describe, expect, it, vi, } from \"vitest\";\nimport { startTsServer } from \"./tsserver.js\";\n// it needs to be hoisted because its referenced from our mocked WebSocket\n// which must be hoisted to work\nconst rootLogger = await vi.hoisted(async () => {\n const pino = (await import(\"pino\")).pino;\n const pinoPretty = await import(\"pino-pretty\");\n const { EventEmitter } = await import(\"node:events\");\n class PinoConsoleLogDestination extends EventEmitter {\n write(a) {\n // remove trailing newline since console.log adds one\n if (a.at(-1) === \"\\n\")\n a = a.slice(0, -1);\n // This lets the test framework aggregate the logs per test, whereas direct to stdout does not\n console.log(a);\n }\n }\n return Promise.resolve(pino({ level: \"info\" }, (pinoPretty.build)({\n sync: true,\n timestampKey: undefined,\n errorLikeObjectKeys: [\"error\", \"err\", \"exception\"],\n errorProps: \"stack,cause,properties\",\n ignore: \"time,hostname,pid\",\n destination: new PinoConsoleLogDestination(),\n })));\n});\ndescribe(\"intellisense\", () => {\n let packagesDir;\n let clientPackagePath;\n beforeAll(() => {\n const clientsPackageJson = findUpSync(\"package.json\", {\n cwd: import.meta.url,\n });\n invariant(clientsPackageJson != null);\n packagesDir = path.join(path.dirname(clientsPackageJson), \"..\");\n clientPackagePath = path.join(packagesDir, \"client\");\n });\n let tsServer;\n let intellisenseFilePath;\n beforeEach(async (a) => {\n intellisenseFilePath = path.join(clientPackagePath, \"src\", \"intellisense.test.helpers\", `${a.task.name}.ts`);\n expect(ts.sys.fileExists(intellisenseFilePath)).toBeTruthy();\n tsServer = await startTsServer(rootLogger);\n await tsServer.sendOpenRequest({ file: intellisenseFilePath });\n });\n afterEach(async () => {\n tsServer.stop();\n tsServer = undefined;\n });\n it(\"callsQueryAcceptsObject\", { timeout: 20_000 }, async () => {\n const { resp } = await tsServer.sendQuickInfoRequest({\n file: intellisenseFilePath,\n line: 27,\n offset: 6,\n });\n expect(resp.body?.documentation).toMatchInlineSnapshot(`\"(no ontology metadata)\"`);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,SAAS;AACpC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,SAAS,MAAM,gBAAgB;AACtC,OAAO,KAAKC,EAAE,MAAM,YAAY;AAChC,SAASC,SAAS,EAAEC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAS,QAAQ;AACpF,SAASC,aAAa,QAAQ,eAAe;AAC7C;AACA;AACA,MAAMC,UAAU,GAAG,MAAMF,EAAE,CAACG,OAAO,CAAC,YAAY;EAC5C,MAAMC,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,EAAEA,IAAI;EACxC,MAAMC,UAAU,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;EAC9C,MAAM;IAAEC;EAAa,CAAC,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;EAUpD,OAAOC,OAAO,CAACC,OAAO,CAACJ,IAAI,CAAC;IAAEK,KAAK,EAAE;EAAO,CAAC,EAAGJ,UAAU,CAACK,KAAK,CAAE;IAC9DC,IAAI,EAAE,IAAI;IACVC,YAAY,EAAEC,SAAS;IACvBC,mBAAmB,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC;IAClDC,UAAU,EAAE,wBAAwB;IACpCC,MAAM,EAAE,mBAAmB;IAC3BC,WAAW,EAAE,IAfjB,cAAwCX,YAAY,CAAC;MACjDY,KAAKA,CAACC,CAAC,EAAE;QACL;QACA,IAAIA,CAAC,CAACC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EACjBD,CAAC,GAAGA,CAAC,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtB;QACAC,OAAO,CAACC,GAAG,CAACJ,CAAC,CAAC;MAClB;IACJ,CAAC,CAO8C;EAC/C,CAAC,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AACFtB,QAAQ,CAAC,cAAc,EAAE,MAAM;EAC3B,IAAI2B,WAAW;EACf,IAAIC,iBAAiB;EACrB9B,SAAS,CAAC,MAAM;IACZ,MAAM+B,kBAAkB,GAAGpC,UAAU,CAAC,cAAc,EAAE;MAClDqC,GAAG,EAAEC,MAAM,CAACC,IAAI,CAACC;IACrB,CAAC,CAAC;IACF,EAAUJ,kBAAkB,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"intellisense.test.js","names":["findUpSync","path","invariant","ts","afterEach","beforeAll","beforeEach","describe","expect","it","vi","startTsServer","rootLogger","hoisted","pino","pinoPretty","EventEmitter","Promise","resolve","level","build","sync","timestampKey","undefined","errorLikeObjectKeys","errorProps","ignore","destination","write","a","at","slice","console","log","packagesDir","clientPackagePath","clientsPackageJson","cwd","import","meta","url","process","env","NODE_ENV","join","dirname","tsServer","intellisenseFilePath","task","name","sys","fileExists","toBeTruthy","sendOpenRequest","file","stop","timeout","resp","sendQuickInfoRequest","line","offset","body","documentation","toMatchInlineSnapshot"],"sources":["intellisense.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 { findUpSync } from \"find-up\";\nimport * as path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport * as ts from \"typescript\";\nimport { afterEach, beforeAll, beforeEach, describe, expect, it, vi, } from \"vitest\";\nimport { startTsServer } from \"./tsserver.js\";\n// it needs to be hoisted because its referenced from our mocked WebSocket\n// which must be hoisted to work\nconst rootLogger = await vi.hoisted(async () => {\n const pino = (await import(\"pino\")).pino;\n const pinoPretty = await import(\"pino-pretty\");\n const { EventEmitter } = await import(\"node:events\");\n class PinoConsoleLogDestination extends EventEmitter {\n write(a) {\n // remove trailing newline since console.log adds one\n if (a.at(-1) === \"\\n\")\n a = a.slice(0, -1);\n // This lets the test framework aggregate the logs per test, whereas direct to stdout does not\n console.log(a);\n }\n }\n return Promise.resolve(pino({ level: \"info\" }, (pinoPretty.build)({\n sync: true,\n timestampKey: undefined,\n errorLikeObjectKeys: [\"error\", \"err\", \"exception\"],\n errorProps: \"stack,cause,properties\",\n ignore: \"time,hostname,pid\",\n destination: new PinoConsoleLogDestination(),\n })));\n});\ndescribe(\"intellisense\", () => {\n let packagesDir;\n let clientPackagePath;\n beforeAll(() => {\n const clientsPackageJson = findUpSync(\"package.json\", {\n cwd: import.meta.url,\n });\n invariant(clientsPackageJson != null);\n packagesDir = path.join(path.dirname(clientsPackageJson), \"..\");\n clientPackagePath = path.join(packagesDir, \"client\");\n });\n let tsServer;\n let intellisenseFilePath;\n beforeEach(async (a) => {\n intellisenseFilePath = path.join(clientPackagePath, \"src\", \"intellisense.test.helpers\", `${a.task.name}.ts`);\n expect(ts.sys.fileExists(intellisenseFilePath)).toBeTruthy();\n tsServer = await startTsServer(rootLogger);\n await tsServer.sendOpenRequest({ file: intellisenseFilePath });\n });\n afterEach(async () => {\n tsServer.stop();\n tsServer = undefined;\n });\n it(\"callsQueryAcceptsObject\", { timeout: 20_000 }, async () => {\n const { resp } = await tsServer.sendQuickInfoRequest({\n file: intellisenseFilePath,\n line: 27,\n offset: 6,\n });\n expect(resp.body?.documentation).toMatchInlineSnapshot(`\"(no ontology metadata)\"`);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,SAAS;AACpC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,SAAS,MAAM,gBAAgB;AACtC,OAAO,KAAKC,EAAE,MAAM,YAAY;AAChC,SAASC,SAAS,EAAEC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAS,QAAQ;AACpF,SAASC,aAAa,QAAQ,eAAe;AAC7C;AACA;AACA,MAAMC,UAAU,GAAG,MAAMF,EAAE,CAACG,OAAO,CAAC,YAAY;EAC5C,MAAMC,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,EAAEA,IAAI;EACxC,MAAMC,UAAU,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;EAC9C,MAAM;IAAEC;EA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EACZ,IAAIC,oBAAoB;EACxBzC,UAAU,CAAC,MAAOuB,CAAC,IAAK;IACpBkB,oBAAoB,GAAG9C,IAAI,CAAC2C,IAAI,CAACT,iBAAiB,EAAE,KAAK,EAAE,2BAA2B,EAAE,GAAGN,CAAC,CAACmB,IAAI,CAACC,IAAI,KAAK,CAAC;IAC5GzC,MAAM,CAACL,EAAE,CAAC+C,GAAG,CAACC,UAAU,CAACJ,oBAAoB,CAAC,CAAC,CAACK,UAAU,CAAC,CAAC;IAC5DN,QAAQ,GAAG,MAAMnC,aAAa,CAACC,UAAU,CAAC;IAC1C,MAAMkC,QAAQ,CAACO,eAAe,CAAC;MAAEC,IAAI,EAAEP;IAAqB,CAAC,CAAC;EAClE,CAAC,CAAC;EACF3C,SAAS,CAAC,YAAY;IAClB0C,QAAQ,CAACS,IAAI,CAAC,CAAC;IACfT,QAAQ,GAAGvB,SAAS;EACxB,CAAC,CAAC;EACFd,EAAE,CAAC,yBAAyB,EAAE;IAAE+C,OAAO,EAAE;EAAO,CAAC,EAAE,YAAY;IAC3D,MAAM;MAAEC;IAAK,CAAC,GAAG,MAAMX,QAAQ,CAACY,oBAAoB,CAAC;MACjDJ,IAAI,EAAEP,oBAAoB;MAC1BY,IAAI,EAAE,EAAE;MACRC,MAAM,EAAE;IACZ,CAAC,CAAC;IACFpD,MAAM,CAACiD,IAAI,CAACI,IAAI,EAAEC,aAAa,CAAC,CAACC,qBAAqB,CAAC,0BAA0B,CAAC;EACtF,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -21,7 +21,7 @@ export function legacyToModernSingleAggregationResult(entry) {
|
|
|
21
21
|
if (parts[0] === "count") {
|
|
22
22
|
return accumulator;
|
|
23
23
|
}
|
|
24
|
-
!(parts.length === 2) ? invariant(false, "assumed we were getting a `${key}.${type}`") : void 0;
|
|
24
|
+
!(parts.length === 2) ? process.env.NODE_ENV !== "production" ? invariant(false, "assumed we were getting a `${key}.${type}`") : invariant(false) : void 0;
|
|
25
25
|
const property = parts[0];
|
|
26
26
|
const metricType = parts[1];
|
|
27
27
|
if (!(property in accumulator)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacyToModernSingleAggregationResult.js","names":["invariant","legacyToModernSingleAggregationResult","entry","metrics","reduce","accumulator","curValue","parts","name","split","length","property","metricType","value"],"sources":["legacyToModernSingleAggregationResult.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 invariant from \"tiny-invariant\";\n/** @internal */\nexport function legacyToModernSingleAggregationResult(entry) {\n return entry.metrics.reduce((accumulator, curValue) => {\n const parts = curValue.name.split(\".\");\n if (parts[0] === \"count\") {\n return accumulator;\n }\n invariant(parts.length === 2, \"assumed we were getting a `${key}.${type}`\");\n const property = parts[0];\n const metricType = parts[1];\n if (!(property in accumulator)) {\n accumulator[property] = {}; // fixme?\n }\n accumulator[property][metricType] = curValue.value; // fixme?\n return accumulator;\n }, {});\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC;AACA,OAAO,SAASC,qCAAqCA,CAACC,KAAK,EAAE;EACzD,OAAOA,KAAK,CAACC,OAAO,CAACC,MAAM,CAAC,CAACC,WAAW,EAAEC,QAAQ,KAAK;IACnD,MAAMC,KAAK,GAAGD,QAAQ,CAACE,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC;IACtC,IAAIF,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;MACtB,OAAOF,WAAW;IACtB;IACA,EAAUE,KAAK,CAACG,MAAM,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"legacyToModernSingleAggregationResult.js","names":["invariant","legacyToModernSingleAggregationResult","entry","metrics","reduce","accumulator","curValue","parts","name","split","length","process","env","NODE_ENV","property","metricType","value"],"sources":["legacyToModernSingleAggregationResult.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 invariant from \"tiny-invariant\";\n/** @internal */\nexport function legacyToModernSingleAggregationResult(entry) {\n return entry.metrics.reduce((accumulator, curValue) => {\n const parts = curValue.name.split(\".\");\n if (parts[0] === \"count\") {\n return accumulator;\n }\n invariant(parts.length === 2, \"assumed we were getting a `${key}.${type}`\");\n const property = parts[0];\n const metricType = parts[1];\n if (!(property in accumulator)) {\n accumulator[property] = {}; // fixme?\n }\n accumulator[property][metricType] = curValue.value; // fixme?\n return accumulator;\n }, {});\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC;AACA,OAAO,SAASC,qCAAqCA,CAACC,KAAK,EAAE;EACzD,OAAOA,KAAK,CAACC,OAAO,CAACC,MAAM,CAAC,CAACC,WAAW,EAAEC,QAAQ,KAAK;IACnD,MAAMC,KAAK,GAAGD,QAAQ,CAACE,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC;IACtC,IAAIF,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;MACtB,OAAOF,WAAW;IACtB;IACA,EAAUE,KAAK,CAACG,MAAM,KAAK,CAAC,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAA5Bb,SAAS,QAAqB,4CAA4C,IAA1EA,SAAS;IACT,MAAMc,QAAQ,GAAGP,KAAK,CAAC,CAAC,CAAC;IACzB,MAAMQ,UAAU,GAAGR,KAAK,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAEO,QAAQ,IAAIT,WAAW,CAAC,EAAE;MAC5BA,WAAW,CAACS,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChC;IACAT,WAAW,CAACS,QAAQ,CAAC,CAACC,UAAU,CAAC,GAAGT,QAAQ,CAACU,KAAK,CAAC,CAAC;IACpD,OAAOX,WAAW;EACtB,CAAC,EAAE,CAAC,CAAC,CAAC;AACV","ignoreList":[]}
|
|
@@ -74,7 +74,7 @@ function makeGeoFilterPolygon(field, coordinates, filterType) {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
function handleWherePair([field, filter], objectOrInterface) {
|
|
77
|
-
!(filter != null) ? invariant(false, "Defined key values are only allowed when they are not undefined.") : void 0;
|
|
77
|
+
!(filter != null) ? process.env.NODE_ENV !== "production" ? invariant(false, "Defined key values are only allowed when they are not undefined.") : invariant(false) : void 0;
|
|
78
78
|
if (typeof filter === "string" || typeof filter === "number" || typeof filter === "boolean") {
|
|
79
79
|
if (objectOrInterface.type === "interface") {
|
|
80
80
|
const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);
|
|
@@ -93,13 +93,13 @@ function handleWherePair([field, filter], objectOrInterface) {
|
|
|
93
93
|
// If any of the keys start with `$` then they must be the only one.
|
|
94
94
|
// e.g. `where({ name: { $eq: "foo", $ne: "bar" } })` is invalid currently
|
|
95
95
|
const hasDollarSign = keysOfFilter.some(key => key.startsWith("$"));
|
|
96
|
-
!(!hasDollarSign || keysOfFilter.length === 1) ? invariant(false, "WhereClause Filter with multiple clauses isn't allowed") : void 0;
|
|
96
|
+
!(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant(false, "WhereClause Filter with multiple clauses isn't allowed") : invariant(false) : void 0;
|
|
97
97
|
if (!hasDollarSign) {
|
|
98
98
|
// Future case for structs
|
|
99
99
|
throw new Error(`Unsupported filter. Did you forget to use a $-prefixed filter? (${JSON.stringify(filter)})`);
|
|
100
100
|
}
|
|
101
101
|
const firstKey = keysOfFilter[0];
|
|
102
|
-
!(filter[firstKey] != null) ? invariant(false) : void 0;
|
|
102
|
+
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
|
|
103
103
|
if (firstKey === "$ne") {
|
|
104
104
|
return {
|
|
105
105
|
type: "not",
|
|
@@ -147,6 +147,14 @@ function handleWherePair([field, filter], objectOrInterface) {
|
|
|
147
147
|
return makeGeoFilterPolygon(field, coordinates, "intersectsPolygon");
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
+
if (firstKey === "$containsAllTerms" || firstKey === "$containsAnyTerm") {
|
|
151
|
+
return {
|
|
152
|
+
type: firstKey.substring(1),
|
|
153
|
+
field,
|
|
154
|
+
value: typeof filter[firstKey] === "string" ? filter[firstKey] : filter[firstKey]["term"],
|
|
155
|
+
fuzzy: typeof filter[firstKey] === "string" ? false : filter[firstKey]["fuzzySearch"] ?? false
|
|
156
|
+
};
|
|
157
|
+
}
|
|
150
158
|
return {
|
|
151
159
|
type: firstKey.substring(1),
|
|
152
160
|
field,
|