@osdk/client 2.5.0-beta.3 → 2.5.0-beta.5
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 +29 -4
- package/build/browser/index.js +2 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/object/Cache.test.js +1 -1
- package/build/browser/object/Cache.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +1 -0
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +6 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js +20 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +2 -0
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/observable/internal/CacheKeys.js.map +1 -1
- package/build/browser/observable/internal/Changes.js.map +1 -1
- package/build/browser/observable/internal/KnownCacheKey.js.map +1 -1
- package/build/browser/observable/internal/OrderByCanonicalizer.js +1 -37
- package/build/browser/observable/internal/OrderByCanonicalizer.js.map +1 -1
- package/build/browser/observable/internal/Store.js +1 -1
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/Store.test.js +1 -1
- package/build/browser/observable/internal/Store.test.js.map +1 -1
- package/build/browser/observable/internal/WeakRefTrie.js +61 -0
- package/build/browser/observable/internal/WeakRefTrie.js.map +1 -0
- package/build/browser/observable/internal/actions/ActionApplication.js.map +1 -0
- package/build/browser/observable/internal/{OptimisticJob.js → actions/OptimisticJob.js} +2 -2
- package/build/browser/observable/internal/actions/OptimisticJob.js.map +1 -0
- package/build/browser/observable/internal/base-list/BaseCollectionQuery.js.map +1 -0
- package/build/browser/observable/internal/base-list/BaseListQuery.js +414 -0
- package/build/browser/observable/internal/base-list/BaseListQuery.js.map +1 -0
- package/build/browser/observable/internal/base-list/createCollectionConnectable.js.map +1 -0
- package/build/{esm/observable/internal → browser/observable/internal/base-list}/createCollectionConnectable.test.js +1 -1
- package/build/browser/observable/internal/base-list/createCollectionConnectable.test.js.map +1 -0
- package/build/browser/observable/internal/base-list/removeDuplicates.js.map +1 -0
- package/build/browser/observable/internal/links/SpecificLinkCacheKey.js.map +1 -1
- package/build/browser/observable/internal/links/SpecificLinkQuery.js +1 -1
- package/build/browser/observable/internal/links/SpecificLinkQuery.js.map +1 -1
- package/build/browser/observable/internal/{ListCacheKey.js.map → list/ListCacheKey.js.map} +1 -1
- package/build/browser/observable/internal/{ListQuery.js → list/ListQuery.js} +7 -416
- package/build/browser/observable/internal/list/ListQuery.js.map +1 -0
- package/build/browser/observable/internal/list/ListQueryOptions.js +2 -0
- package/build/browser/observable/internal/list/ListQueryOptions.js.map +1 -0
- package/build/browser/observable/internal/list/ListsHelper.js +1 -1
- package/build/browser/observable/internal/list/ListsHelper.js.map +1 -1
- package/build/browser/observable/internal/object/ObjectCacheKey.js +2 -0
- package/build/browser/observable/internal/object/ObjectCacheKey.js.map +1 -0
- package/build/browser/observable/internal/{ObjectQuery.js → object/ObjectQuery.js} +4 -20
- package/build/browser/observable/internal/object/ObjectQuery.js.map +1 -0
- package/build/browser/observable/internal/object/ObjectsHelper.js +15 -1
- package/build/browser/observable/internal/object/ObjectsHelper.js.map +1 -1
- package/build/browser/observable/internal/sorting/SortingStrategy.js.map +1 -1
- package/build/browser/observable/internal/testUtils/invalidateList.js.map +1 -1
- package/build/browser/observable/internal/testUtils.js +1 -2
- package/build/browser/observable/internal/testUtils.js.map +1 -1
- package/build/browser/queries/applyQuery.js +1 -1
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/extractObjectOrInterfaceType.js +9 -1
- package/build/browser/util/extractObjectOrInterfaceType.js.map +1 -1
- package/build/browser/util/extractObjectOrInterfaceType.test.js +2 -2
- package/build/browser/util/extractObjectOrInterfaceType.test.js.map +1 -1
- package/build/cjs/{chunk-BL56QBYG.cjs → chunk-ELAA4C2C.cjs} +29 -17
- package/build/cjs/chunk-ELAA4C2C.cjs.map +1 -0
- package/build/cjs/{chunk-AOGMSVFN.cjs → chunk-KCMGIMVC.cjs} +91 -69
- package/build/cjs/chunk-KCMGIMVC.cjs.map +1 -0
- package/build/cjs/index.cjs +7 -7
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +568 -572
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/esm/index.js +2 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/object/Cache.test.js +1 -1
- package/build/esm/object/Cache.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +1 -0
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +6 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +20 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +2 -0
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/observable/internal/CacheKeys.js.map +1 -1
- package/build/esm/observable/internal/Changes.js.map +1 -1
- package/build/esm/observable/internal/KnownCacheKey.js.map +1 -1
- package/build/esm/observable/internal/OrderByCanonicalizer.js +1 -37
- package/build/esm/observable/internal/OrderByCanonicalizer.js.map +1 -1
- package/build/esm/observable/internal/Store.js +1 -1
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/Store.test.js +1 -1
- package/build/esm/observable/internal/Store.test.js.map +1 -1
- package/build/esm/observable/internal/WeakRefTrie.js +61 -0
- package/build/esm/observable/internal/WeakRefTrie.js.map +1 -0
- package/build/esm/observable/internal/actions/ActionApplication.js.map +1 -0
- package/build/esm/observable/internal/{OptimisticJob.js → actions/OptimisticJob.js} +2 -2
- package/build/esm/observable/internal/actions/OptimisticJob.js.map +1 -0
- package/build/esm/observable/internal/base-list/BaseCollectionQuery.js.map +1 -0
- package/build/esm/observable/internal/base-list/BaseListQuery.js +414 -0
- package/build/esm/observable/internal/base-list/BaseListQuery.js.map +1 -0
- package/build/esm/observable/internal/base-list/createCollectionConnectable.js.map +1 -0
- package/build/{browser/observable/internal → esm/observable/internal/base-list}/createCollectionConnectable.test.js +1 -1
- package/build/esm/observable/internal/base-list/createCollectionConnectable.test.js.map +1 -0
- package/build/esm/observable/internal/base-list/removeDuplicates.js.map +1 -0
- package/build/esm/observable/internal/links/SpecificLinkCacheKey.js.map +1 -1
- package/build/esm/observable/internal/links/SpecificLinkQuery.js +1 -1
- package/build/esm/observable/internal/links/SpecificLinkQuery.js.map +1 -1
- package/build/esm/observable/internal/{ListCacheKey.js.map → list/ListCacheKey.js.map} +1 -1
- package/build/esm/observable/internal/{ListQuery.js → list/ListQuery.js} +7 -416
- package/build/esm/observable/internal/list/ListQuery.js.map +1 -0
- package/build/esm/observable/internal/list/ListQueryOptions.js +2 -0
- package/build/esm/observable/internal/list/ListQueryOptions.js.map +1 -0
- package/build/esm/observable/internal/list/ListsHelper.js +1 -1
- package/build/esm/observable/internal/list/ListsHelper.js.map +1 -1
- package/build/esm/observable/internal/object/ObjectCacheKey.js +2 -0
- package/build/esm/observable/internal/object/ObjectCacheKey.js.map +1 -0
- package/build/esm/observable/internal/{ObjectQuery.js → object/ObjectQuery.js} +4 -20
- package/build/esm/observable/internal/object/ObjectQuery.js.map +1 -0
- package/build/esm/observable/internal/object/ObjectsHelper.js +15 -1
- package/build/esm/observable/internal/object/ObjectsHelper.js.map +1 -1
- package/build/esm/observable/internal/sorting/SortingStrategy.js.map +1 -1
- package/build/esm/observable/internal/testUtils/invalidateList.js.map +1 -1
- package/build/esm/observable/internal/testUtils.js +1 -2
- package/build/esm/observable/internal/testUtils.js.map +1 -1
- package/build/esm/queries/applyQuery.js +1 -1
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/extractObjectOrInterfaceType.js +9 -1
- package/build/esm/util/extractObjectOrInterfaceType.js.map +1 -1
- package/build/esm/util/extractObjectOrInterfaceType.test.js +2 -2
- package/build/esm/util/extractObjectOrInterfaceType.test.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/observable/internal/Changes.d.ts +2 -2
- package/build/types/observable/internal/Changes.d.ts.map +1 -1
- package/build/types/observable/internal/KnownCacheKey.d.ts +2 -2
- package/build/types/observable/internal/KnownCacheKey.d.ts.map +1 -1
- package/build/types/observable/internal/OrderByCanonicalizer.d.ts +0 -7
- package/build/types/observable/internal/OrderByCanonicalizer.d.ts.map +1 -1
- package/build/types/observable/internal/WeakRefTrie.d.ts +13 -0
- package/build/types/observable/internal/WeakRefTrie.d.ts.map +1 -0
- package/build/types/observable/internal/{ActionApplication.d.ts → actions/ActionApplication.d.ts} +2 -2
- package/build/types/observable/internal/{ActionApplication.d.ts.map → actions/ActionApplication.d.ts.map} +1 -1
- package/build/types/observable/internal/{OptimisticJob.d.ts → actions/OptimisticJob.d.ts} +4 -4
- package/build/types/observable/internal/actions/OptimisticJob.d.ts.map +1 -0
- package/build/types/observable/internal/{BaseCollectionQuery.d.ts → base-list/BaseCollectionQuery.d.ts} +4 -4
- package/build/types/observable/internal/base-list/BaseCollectionQuery.d.ts.map +1 -0
- package/build/types/observable/internal/{ListQuery.d.ts → base-list/BaseListQuery.d.ts} +8 -91
- package/build/types/observable/internal/base-list/BaseListQuery.d.ts.map +1 -0
- package/build/types/observable/internal/{createCollectionConnectable.d.ts → base-list/createCollectionConnectable.d.ts} +3 -3
- package/build/types/observable/internal/base-list/createCollectionConnectable.d.ts.map +1 -0
- package/build/types/observable/internal/base-list/createCollectionConnectable.test.d.ts.map +1 -0
- package/build/types/observable/internal/{removeDuplicates.d.ts → base-list/removeDuplicates.d.ts} +2 -2
- package/build/types/observable/internal/base-list/removeDuplicates.d.ts.map +1 -0
- package/build/types/observable/internal/links/SpecificLinkCacheKey.d.ts +1 -1
- package/build/types/observable/internal/links/SpecificLinkCacheKey.d.ts.map +1 -1
- package/build/types/observable/internal/links/SpecificLinkQuery.d.ts +1 -1
- package/build/types/observable/internal/links/SpecificLinkQuery.d.ts.map +1 -1
- package/build/types/observable/internal/{ListCacheKey.d.ts → list/ListCacheKey.d.ts} +4 -4
- package/build/types/observable/internal/list/ListCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/list/ListQuery.d.ts +73 -0
- package/build/types/observable/internal/list/ListQuery.d.ts.map +1 -0
- package/build/types/observable/internal/list/ListQueryOptions.d.ts +4 -0
- package/build/types/observable/internal/list/ListQueryOptions.d.ts.map +1 -0
- package/build/types/observable/internal/list/ListsHelper.d.ts +1 -1
- package/build/types/observable/internal/list/ListsHelper.d.ts.map +1 -1
- package/build/types/observable/internal/object/ObjectCacheKey.d.ts +5 -0
- package/build/types/observable/internal/object/ObjectCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/{ObjectQuery.d.ts → object/ObjectQuery.d.ts} +8 -10
- package/build/types/observable/internal/object/ObjectQuery.d.ts.map +1 -0
- package/build/types/observable/internal/object/ObjectsHelper.d.ts +1 -1
- package/build/types/observable/internal/object/ObjectsHelper.d.ts.map +1 -1
- package/build/types/observable/internal/sorting/SortingStrategy.d.ts +1 -1
- package/build/types/observable/internal/sorting/SortingStrategy.d.ts.map +1 -1
- package/build/types/observable/internal/testUtils.d.ts +1 -1
- package/build/types/observable/internal/testUtils.d.ts.map +1 -1
- package/package.json +23 -23
- package/build/browser/observable/internal/ActionApplication.js.map +0 -1
- package/build/browser/observable/internal/BaseCollectionQuery.js.map +0 -1
- package/build/browser/observable/internal/ListQuery.js.map +0 -1
- package/build/browser/observable/internal/ObjectQuery.js.map +0 -1
- package/build/browser/observable/internal/OptimisticJob.js.map +0 -1
- package/build/browser/observable/internal/createCollectionConnectable.js.map +0 -1
- package/build/browser/observable/internal/createCollectionConnectable.test.js.map +0 -1
- package/build/browser/observable/internal/removeDuplicates.js.map +0 -1
- package/build/cjs/chunk-AOGMSVFN.cjs.map +0 -1
- package/build/cjs/chunk-BL56QBYG.cjs.map +0 -1
- package/build/esm/observable/internal/ActionApplication.js.map +0 -1
- package/build/esm/observable/internal/BaseCollectionQuery.js.map +0 -1
- package/build/esm/observable/internal/ListQuery.js.map +0 -1
- package/build/esm/observable/internal/ObjectQuery.js.map +0 -1
- package/build/esm/observable/internal/OptimisticJob.js.map +0 -1
- package/build/esm/observable/internal/createCollectionConnectable.js.map +0 -1
- package/build/esm/observable/internal/createCollectionConnectable.test.js.map +0 -1
- package/build/esm/observable/internal/removeDuplicates.js.map +0 -1
- package/build/types/observable/internal/BaseCollectionQuery.d.ts.map +0 -1
- package/build/types/observable/internal/ListCacheKey.d.ts.map +0 -1
- package/build/types/observable/internal/ListQuery.d.ts.map +0 -1
- package/build/types/observable/internal/ObjectQuery.d.ts.map +0 -1
- package/build/types/observable/internal/OptimisticJob.d.ts.map +0 -1
- package/build/types/observable/internal/createCollectionConnectable.d.ts.map +0 -1
- package/build/types/observable/internal/createCollectionConnectable.test.d.ts.map +0 -1
- package/build/types/observable/internal/removeDuplicates.d.ts.map +0 -1
- /package/build/browser/observable/internal/{ActionApplication.js → actions/ActionApplication.js} +0 -0
- /package/build/browser/observable/internal/{BaseCollectionQuery.js → base-list/BaseCollectionQuery.js} +0 -0
- /package/build/browser/observable/internal/{createCollectionConnectable.js → base-list/createCollectionConnectable.js} +0 -0
- /package/build/browser/observable/internal/{removeDuplicates.js → base-list/removeDuplicates.js} +0 -0
- /package/build/browser/observable/internal/{ListCacheKey.js → list/ListCacheKey.js} +0 -0
- /package/build/esm/observable/internal/{ActionApplication.js → actions/ActionApplication.js} +0 -0
- /package/build/esm/observable/internal/{BaseCollectionQuery.js → base-list/BaseCollectionQuery.js} +0 -0
- /package/build/esm/observable/internal/{createCollectionConnectable.js → base-list/createCollectionConnectable.js} +0 -0
- /package/build/esm/observable/internal/{removeDuplicates.js → base-list/removeDuplicates.js} +0 -0
- /package/build/esm/observable/internal/{ListCacheKey.js → list/ListCacheKey.js} +0 -0
- /package/build/types/observable/internal/{createCollectionConnectable.test.d.ts → base-list/createCollectionConnectable.test.d.ts} +0 -0
|
@@ -59,6 +59,14 @@ export async function extractObjectOrInterfaceType(clientCtx, objectSet) {
|
|
|
59
59
|
case "nearestNeighbors":
|
|
60
60
|
return extractObjectOrInterfaceType(clientCtx, objectSet.objectSet);
|
|
61
61
|
case "intersect":
|
|
62
|
+
{
|
|
63
|
+
const objectSets = objectSet.objectSets;
|
|
64
|
+
const objectSetTypes = await Promise.all(objectSets.map(os => extractObjectOrInterfaceType(clientCtx, os)));
|
|
65
|
+
const filteredObjectTypes = objectSetTypes.filter(Boolean);
|
|
66
|
+
const firstInterfaceType = filteredObjectTypes.find(val => val?.type === "interface");
|
|
67
|
+
!firstInterfaceType ? process.env.NODE_ENV !== "production" ? invariant(false, `Missing interface type in intersect objectset scope'`) : invariant(false) : void 0;
|
|
68
|
+
return firstInterfaceType;
|
|
69
|
+
}
|
|
62
70
|
case "subtract":
|
|
63
71
|
case "union":
|
|
64
72
|
const objectSets = objectSet.objectSets;
|
|
@@ -67,7 +75,7 @@ export async function extractObjectOrInterfaceType(clientCtx, objectSet) {
|
|
|
67
75
|
const firstObjectType = filteredObjectTypes[0];
|
|
68
76
|
!filteredObjectTypes.every(val => {
|
|
69
77
|
return val?.apiName === firstObjectType?.apiName && val?.type === firstObjectType?.type;
|
|
70
|
-
}) ? process.env.NODE_ENV !== "production" ? invariant(false, "Can only have one object type when doing
|
|
78
|
+
}) ? process.env.NODE_ENV !== "production" ? invariant(false, "Can only have one object type when doing subtract, union") : invariant(false) : void 0;
|
|
71
79
|
return filteredObjectTypes[0];
|
|
72
80
|
case "static":
|
|
73
81
|
case "reference":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractObjectOrInterfaceType.js","names":["invariant","extractObjectOrInterfaceType","clientCtx","objectSet","type","def","undefined","objOrInterfaceDef","ontologyProvider","getObjectDefinition","apiName","getInterfaceDefinition","linkDef","links","link","process","env","NODE_ENV","targetType","targetTypeApiName","objectType","interfaceType","objectSets","objectSetTypes","Promise","all","map","os","filteredObjectTypes","filter","Boolean","
|
|
1
|
+
{"version":3,"file":"extractObjectOrInterfaceType.js","names":["invariant","extractObjectOrInterfaceType","clientCtx","objectSet","type","def","undefined","objOrInterfaceDef","ontologyProvider","getObjectDefinition","apiName","getInterfaceDefinition","linkDef","links","link","process","env","NODE_ENV","targetType","targetTypeApiName","objectType","interfaceType","objectSets","objectSetTypes","Promise","all","map","os","filteredObjectTypes","filter","Boolean","firstInterfaceType","find","val","firstObjectType","every","interfaceLink"],"sources":["extractObjectOrInterfaceType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectOrInterfaceDefinition } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\n\n/* @internal\n* Returns the resultant interface or object type of the object set\n*/\nexport async function extractObjectOrInterfaceType(\n clientCtx: MinimalClient,\n objectSet: ObjectSet,\n): Promise<\n ObjectOrInterfaceDefinition | undefined\n> {\n switch (objectSet.type) {\n case \"searchAround\": {\n const def = await extractObjectOrInterfaceType(\n clientCtx,\n objectSet.objectSet,\n );\n if (def === undefined) {\n return undefined;\n }\n const objOrInterfaceDef = def.type === \"object\"\n ? await clientCtx.ontologyProvider.getObjectDefinition(\n def.apiName,\n )\n : await clientCtx.ontologyProvider.getInterfaceDefinition(\n def.apiName,\n );\n const linkDef = objOrInterfaceDef.links[objectSet.link];\n invariant(linkDef, `Missing link definition for '${objectSet.link}'`);\n\n return objOrInterfaceDef.type === \"object\"\n ? {\n apiName: objOrInterfaceDef.links[objectSet.link].targetType,\n type: \"object\",\n }\n : {\n apiName: objOrInterfaceDef.links[objectSet.link].targetTypeApiName,\n type: objOrInterfaceDef.links[objectSet.link].targetType,\n };\n }\n case \"withProperties\": {\n return extractObjectOrInterfaceType(\n clientCtx,\n objectSet.objectSet,\n );\n }\n case \"methodInput\":\n return undefined;\n case \"base\":\n return { type: \"object\", apiName: objectSet.objectType };\n case \"interfaceBase\":\n return { type: \"interface\", apiName: objectSet.interfaceType };\n case \"filter\":\n case \"asBaseObjectTypes\":\n case \"asType\":\n case \"nearestNeighbors\":\n return extractObjectOrInterfaceType(\n clientCtx,\n objectSet.objectSet,\n );\n case \"intersect\": {\n const objectSets = objectSet.objectSets;\n const objectSetTypes = await Promise.all(\n objectSets.map((os) =>\n extractObjectOrInterfaceType(\n clientCtx,\n os,\n )\n ),\n );\n\n const filteredObjectTypes = objectSetTypes.filter(Boolean);\n const firstInterfaceType = filteredObjectTypes.find(val =>\n val?.type === \"interface\"\n );\n\n invariant(\n firstInterfaceType,\n `Missing interface type in intersect objectset scope'`,\n );\n return firstInterfaceType;\n }\n case \"subtract\":\n case \"union\":\n const objectSets = objectSet.objectSets;\n const objectSetTypes = await Promise.all(\n objectSets.map((os) =>\n extractObjectOrInterfaceType(\n clientCtx,\n os,\n )\n ),\n );\n\n const filteredObjectTypes = objectSetTypes.filter(Boolean);\n const firstObjectType = filteredObjectTypes[0];\n invariant(\n filteredObjectTypes.every(val => {\n return val?.apiName === firstObjectType?.apiName\n && val?.type === firstObjectType?.type;\n }),\n \"Can only have one object type when doing subtract, union\",\n );\n\n return filteredObjectTypes[0];\n case \"static\":\n case \"reference\":\n // Static and reference object sets are always intersected with a base object set, so we can just return undefined.\n return undefined;\n case \"interfaceLinkSearchAround\":\n const def = await extractObjectOrInterfaceType(\n clientCtx,\n objectSet.objectSet,\n );\n if (def === undefined) {\n return undefined;\n }\n const objOrInterfaceDef = def.type === \"object\"\n ? await clientCtx.ontologyProvider.getObjectDefinition(\n def.apiName,\n )\n : await clientCtx.ontologyProvider.getInterfaceDefinition(\n def.apiName,\n );\n const linkDef = objOrInterfaceDef.links[objectSet.interfaceLink];\n invariant(\n linkDef,\n `Missing link definition for '${objectSet.interfaceLink}'`,\n );\n return objOrInterfaceDef.type === \"object\"\n ? {\n apiName: objOrInterfaceDef.links[objectSet.interfaceLink].targetType,\n type: \"object\",\n }\n : {\n apiName:\n objOrInterfaceDef.links[objectSet.interfaceLink].targetTypeApiName,\n type: objOrInterfaceDef.links[objectSet.interfaceLink].targetType,\n };\n // We don't have to worry about new object sets being added and doing a runtime break and breaking people since the OSDK is always constructing these.\n default:\n const _: never = objectSet;\n invariant(\n false,\n `Unsupported object set type for deriving object or interface type,`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,SAAS,MAAM,gBAAgB;AAGtC;AACA;AACA;AACA,OAAO,eAAeC,4BAA4BA,CAChDC,SAAwB,EACxBC,SAAoB,EAGpB;EACA,QAAQA,SAAS,CAACC,IAAI;IACpB,KAAK,cAAc;MAAE;QACnB,MAAMC,GAAG,GAAG,MAAMJ,4BAA4B,CAC5CC,SAAS,EACTC,SAAS,CAACA,SACZ,CAAC;QACD,IAAIE,GAAG,KAAKC,SAAS,EAAE;UACrB,OAAOA,SAAS;QAClB;QACA,MAAMC,iBAAiB,GAAGF,GAAG,CAACD,IAA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AAK,2BAA2B;MAC9B,MAAMD,GAAG,GAAG,MAAMJ,4BAA4B,CAC5CC,SAAS,EACTC,SAAS,CAACA,SACZ,CAAC;MACD,IAAIE,GAAG,KAAKC,SAAS,EAAE;QACrB,OAAOA,SAAS;MAClB;MACA,MAAMC,iBAAiB,GAAGF,GAAG,CAACD,IAAI,KAAK,QAAQ,GAC3C,MAAMF,SAAS,CAACM,gBAAgB,CAACC,mBAAmB,CACpDJ,GAAG,CAACK,OACN,CAAC,GACC,MAAMR,SAAS,CAACM,gBAAgB,CAACG,sBAAsB,CACvDN,GAAG,CAACK,OACN,CAAC;MACH,MAAME,OAAO,GAAGL,iBAAiB,CAACM,KAAK,CAACV,SAAS,CAACiC,aAAa,CAAC;MAChE,CACExB,OAAO,GAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADTjB,SAAS,QAEP,gCAAgCG,SAAS,CAACiC,aAAa,GAAG,IAF5DpC,SAAS;MAIT,OAAOO,iBAAiB,CAACH,IAAI,KAAK,QAAQ,GACtC;QACAM,OAAO,EAAEH,iBAAiB,CAACM,KAAK,CAACV,SAAS,CAACiC,aAAa,CAAC,CAAClB,UAAU;QACpEd,IAAI,EAAE;MACR,CAAC,GACC;QACAM,OAAO,EACLH,iBAAiB,CAACM,KAAK,CAACV,SAAS,CAACiC,aAAa,CAAC,CAACjB,iBAAiB;QACpEf,IAAI,EAAEG,iBAAiB,CAACM,KAAK,CAACV,SAAS,CAACiC,aAAa,CAAC,CAAClB;MACzD,CAAC;IACL;IACA;MAEEH,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAjB,SAAS,QAEP,oEAAoE,IAFtEA,SAAS;EAIb;AACF","ignoreList":[]}
|
|
@@ -117,7 +117,7 @@ describe("extractRdpDefinition", () => {
|
|
|
117
117
|
});
|
|
118
118
|
it("throes with intersect, subtract, or union having different child object types", async () => {
|
|
119
119
|
await expect(extractObjectOrInterfaceType(mockClientCtx, {
|
|
120
|
-
type: "
|
|
120
|
+
type: "union",
|
|
121
121
|
objectSets: [{
|
|
122
122
|
type: "interfaceLinkSearchAround",
|
|
123
123
|
objectSet: {
|
|
@@ -129,7 +129,7 @@ describe("extractRdpDefinition", () => {
|
|
|
129
129
|
type: "interfaceBase",
|
|
130
130
|
interfaceType: "interface1"
|
|
131
131
|
}]
|
|
132
|
-
})).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Can only have one object type when doing
|
|
132
|
+
})).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Can only have one object type when doing subtract, union]`);
|
|
133
133
|
});
|
|
134
134
|
});
|
|
135
135
|
//# sourceMappingURL=extractObjectOrInterfaceType.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractObjectOrInterfaceType.test.js","names":["describe","expect","it","extractObjectOrInterfaceType","mockClientCtx","ontologyProvider","getObjectDefinition","objectType","links","testLink1","targetType","testLink2","properties","testProperty","type","Error","getInterfaceDefinition","interfaceType","linkToInterface2","targetTypeApiName","multiplicity","linkToInterface1","objectSetInterfaceToInterface","objectSet","interfaceLink","result","toEqual","apiName","objectSets","rejects","toThrowErrorMatchingInlineSnapshot"],"sources":["extractObjectOrInterfaceType.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { InterfaceMetadata, ObjectMetadata } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport { describe, expect, it } from \"vitest\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { extractObjectOrInterfaceType } from \"./extractObjectOrInterfaceType.js\";\n\ndescribe(\"extractRdpDefinition\", () => {\n const mockClientCtx = {\n ontologyProvider: {\n getObjectDefinition: (objectType: string) => {\n if (objectType === \"BaseType\") {\n return {\n links: {\n testLink1: {\n targetType: \"SecondType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"SecondType\") {\n return {\n links: {\n testLink2: {\n targetType: \"ThirdType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"ThirdType\") {\n return {\n properties: {\n testProperty: {\n type: \"attachment\",\n } satisfies ObjectMetadata.Property,\n },\n };\n } else {\n throw new Error(`Missing definition for '${objectType}'`);\n }\n },\n getInterfaceDefinition: (interfaceType: string) => {\n if (interfaceType === \"interface1\") {\n return {\n links: {\n linkToInterface2: {\n targetType: \"interface\",\n targetTypeApiName: \"interface2\",\n multiplicity: false,\n } satisfies InterfaceMetadata.Link<any, any>,\n },\n };\n } else if (interfaceType === \"interface1\") {\n return {\n links: {\n linkToInterface1: {\n targetType: \"interface\",\n targetTypeApiName: \"interface1\",\n multiplicity: false,\n } satisfies InterfaceMetadata.Link<any, any>,\n },\n };\n } else {\n throw new Error(`Missing definition for '${interfaceType}'`);\n }\n },\n } as any,\n } as MinimalClient;\n\n const objectSetInterfaceToInterface: ObjectSet = {\n type: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n };\n\n it(\"handles 'withProperties' object set type\", async () => {\n const result = await extractObjectOrInterfaceType(\n mockClientCtx,\n objectSetInterfaceToInterface,\n );\n\n expect(result).toEqual({ apiName: \"interface2\", type: \"interface\" });\n });\n\n it(\"handles `intersection` object set type and nested static and reference object sets\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"intersect\",\n objectSets: [\n {\n type: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n },\n { type: \"static\", \"objects\": [\"object1\", \"object2\"] },\n { type: \"reference\", \"reference\": \"rid.os.1234\" },\n ],\n };\n\n const result = await extractObjectOrInterfaceType(\n mockClientCtx,\n intersectionObjectSet,\n );\n\n expect(result).toEqual({ apiName: \"interface2\", type: \"interface\" });\n });\n\n it(\"throes with intersect, subtract, or union having different child object types\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"
|
|
1
|
+
{"version":3,"file":"extractObjectOrInterfaceType.test.js","names":["describe","expect","it","extractObjectOrInterfaceType","mockClientCtx","ontologyProvider","getObjectDefinition","objectType","links","testLink1","targetType","testLink2","properties","testProperty","type","Error","getInterfaceDefinition","interfaceType","linkToInterface2","targetTypeApiName","multiplicity","linkToInterface1","objectSetInterfaceToInterface","objectSet","interfaceLink","result","toEqual","apiName","objectSets","rejects","toThrowErrorMatchingInlineSnapshot"],"sources":["extractObjectOrInterfaceType.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { InterfaceMetadata, ObjectMetadata } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport { describe, expect, it } from \"vitest\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { extractObjectOrInterfaceType } from \"./extractObjectOrInterfaceType.js\";\n\ndescribe(\"extractRdpDefinition\", () => {\n const mockClientCtx = {\n ontologyProvider: {\n getObjectDefinition: (objectType: string) => {\n if (objectType === \"BaseType\") {\n return {\n links: {\n testLink1: {\n targetType: \"SecondType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"SecondType\") {\n return {\n links: {\n testLink2: {\n targetType: \"ThirdType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"ThirdType\") {\n return {\n properties: {\n testProperty: {\n type: \"attachment\",\n } satisfies ObjectMetadata.Property,\n },\n };\n } else {\n throw new Error(`Missing definition for '${objectType}'`);\n }\n },\n getInterfaceDefinition: (interfaceType: string) => {\n if (interfaceType === \"interface1\") {\n return {\n links: {\n linkToInterface2: {\n targetType: \"interface\",\n targetTypeApiName: \"interface2\",\n multiplicity: false,\n } satisfies InterfaceMetadata.Link<any, any>,\n },\n };\n } else if (interfaceType === \"interface1\") {\n return {\n links: {\n linkToInterface1: {\n targetType: \"interface\",\n targetTypeApiName: \"interface1\",\n multiplicity: false,\n } satisfies InterfaceMetadata.Link<any, any>,\n },\n };\n } else {\n throw new Error(`Missing definition for '${interfaceType}'`);\n }\n },\n } as any,\n } as MinimalClient;\n\n const objectSetInterfaceToInterface: ObjectSet = {\n type: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n };\n\n it(\"handles 'withProperties' object set type\", async () => {\n const result = await extractObjectOrInterfaceType(\n mockClientCtx,\n objectSetInterfaceToInterface,\n );\n\n expect(result).toEqual({ apiName: \"interface2\", type: \"interface\" });\n });\n\n it(\"handles `intersection` object set type and nested static and reference object sets\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"intersect\",\n objectSets: [\n {\n type: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n },\n { type: \"static\", \"objects\": [\"object1\", \"object2\"] },\n { type: \"reference\", \"reference\": \"rid.os.1234\" },\n ],\n };\n\n const result = await extractObjectOrInterfaceType(\n mockClientCtx,\n intersectionObjectSet,\n );\n\n expect(result).toEqual({ apiName: \"interface2\", type: \"interface\" });\n });\n\n it(\"throes with intersect, subtract, or union having different child object types\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"union\",\n objectSets: [\n {\n type: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n },\n { type: \"interfaceBase\", interfaceType: \"interface1\" },\n ],\n };\n\n await expect(\n extractObjectOrInterfaceType(mockClientCtx, intersectionObjectSet),\n ).rejects.toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: Can only have one object type when doing subtract, union]`,\n );\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAE7C,SAASC,4BAA4B,QAAQ,mCAAmC;AAEhFH,QAAQ,CAAC,sBAAsB,EAAE,MAAM;EACrC,MAAMI,aAAa,GAAG;IACpBC,gBAAgB,EAAE;MAChBC,mBAAmB,EAAGC,UAAkB,IAAK;QAC3C,IAAIA,UAAU,KAAK,UAAU,EAAE;UAC7B,OAAO;YACLC,KAAK,EAAE;cACLC,SAAS,EAAE;gBACTC,UAAU,EAAE,YAAY;gBACxB,cAAc,EAAE;cAClB;YACF;UACF,CAAC;QACH,CAAC,MAAM,IAAIH,UAAU,KAAK,YAAY,EAAE;UACtC,OAAO;YACLC,KAAK,EAAE;cACLG,SAAS,EAAE;gBACTD,UAAU,EAAE,WAAW;gBACvB,cAAc,EAAE;cAClB;YACF;UACF,CAAC;QACH,CAAC,MAAM,IAAIH,UAAU,KAAK,WAAW,EAAE;UACrC,OAAO;YACLK,UAAU,EAAE;cACVC,YAAY,EAAE;gBACZC,IAAI,EAAE;cACR;YACF;UACF,CAA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;UACTT,IAAI,EAAE,eAAe;UACrBG,aAAa,EAAE;QACjB,CAAC;QACDO,aAAa,EAAE;MACjB,CAAC,EACD;QAAEV,IAAI,EAAE,QAAQ;QAAE,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS;MAAE,CAAC,EACrD;QAAEA,IAAI,EAAE,WAAW;QAAE,WAAW,EAAE;MAAc,CAAC;IAErD,CAKA,CAAC;IAEDb,MAAM,CAACwB,MAAM,CAAC,CAACC,OAAO,CAAC;MAAEC,OAAO,EAAE,YAAY;MAAEb,IAAI,EAAE;IAAY,CAAC,CAAC;EACtE,CAAC,CAAC;EAEFZ,EAAE,CAAC,+EAA+E,EAAE,YAAY;IAgB9F,MAAMD,MAAM,CACVE,4BAA4B,CAACC,aAAa,EAhBH;MACvCU,IAAI,EAAE,OAAO;MACbc,UAAU,EAAE,CACV;QACEd,IAAI,EAAE,2BAA2B;QACjCS,SAAS,EAAE;UACTT,IAAI,EAAE,eAAe;UACrBG,aAAa,EAAE;QACjB,CAAC;QACDO,aAAa,EAAE;MACjB,CAAC,EACD;QAAEV,IAAI,EAAE,eAAe;QAAEG,aAAa,EAAE;MAAa,CAAC;IAE1D,CAGmE,CACnE,CAAC,CAACY,OAAO,CAACC,kCAAkC,CAC1C,qFACF,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CompileTimeMetadata, InterfaceDefinition, InterfaceMetadata, Logger, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectCreatePropertyType, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, VersionBound, WhereClause } from "@osdk/api";
|
|
2
1
|
export { isOk, NULL_VALUE } from "@osdk/api";
|
|
2
|
+
export type { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CompileTimeMetadata, InterfaceDefinition, InterfaceMetadata, Logger, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectCreatePropertyType, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, VersionBound, WhereClause } 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";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AAkBA,SAAS,MAAM,kBAAkB;AACjC,cACE,kBACA,oBACA,gBACA,aACA,4BACA,0BACA,oBACA,yBACA,YACA,qBACA,qBACA,mBACA,QACA,gBACA,WACA,iBACA,sBACA,MACA,YACA,8BACA,wBACA,YACA,aACA,cACA,2BACA,iBACA,YACA,aACA,OACA,QACA,oBACA,6BACA,2BACA,cACA,mBACK;AACP,SAAS,wBAAwB;AAEjC,SAAS,6BAA6B;AACtC,cAAc,cAAc;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,cAAc,sBAAsB;AACpC,SAAS,8BAA8B;AACvC,cAAc,qBAAqB;AAEnC,SACE,aACA,wBACA,wBACK;AAEP,SAAS,2CAA2C","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MultiMap } from "mnemonist";
|
|
2
2
|
import type { ObjectHolder } from "../../object/convertWireToOsdkObjects/ObjectHolder.js";
|
|
3
3
|
import type { SpecificLinkCacheKey } from "./links/SpecificLinkCacheKey.js";
|
|
4
|
-
import type { ListCacheKey } from "./ListCacheKey.js";
|
|
5
|
-
import type { ObjectCacheKey } from "./
|
|
4
|
+
import type { ListCacheKey } from "./list/ListCacheKey.js";
|
|
5
|
+
import type { ObjectCacheKey } from "./object/ObjectCacheKey.js";
|
|
6
6
|
export declare class Changes {
|
|
7
7
|
modifiedObjects: MultiMap<string, ObjectHolder>;
|
|
8
8
|
addedObjects: MultiMap<string, ObjectHolder>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,SAAS,gBAAgB,WAAY;AACrC,cAAc,oBAAoB,uDAAwD;AAG1F,cAAc,4BAA4B,iCAAkC;AAC5E,cAAc,oBAAoB,
|
|
1
|
+
{"mappings":"AAgBA,SAAS,gBAAgB,WAAY;AACrC,cAAc,oBAAoB,uDAAwD;AAG1F,cAAc,4BAA4B,iCAAkC;AAC5E,cAAc,oBAAoB,wBAAyB;AAC3D,cAAc,sBAAsB,4BAA6B;AAEjE,OAAO,cAAM,QAAQ;CACnB,iBAAiB,iBAAiB;CAClC,cAAc,iBAAiB;CAE/B,OAAO,IAAI,eAAe,iBAAiB;CAC3C,UAAU,IAAI,eAAe,iBAAiB;CAE9C,SAAS,IAAI,eAAe,iBAAiB;CAG7C,iBACEA,UAAU,gBACVC,MAAM,cACNC;CAMF,eAAgBF,UAAU;CAI1B,eAAgBG,KAAK;CAIrB,eAAgBC,UAAU;CAI1B,aAAcA,UAAU;CAIxB;AASD;AAED,OAAO,iBAAS,wBAAwB;AAIxC,OAAO,iBAAS,4BAA4BC,SAAS","names":["cacheKey: ObjectCacheKey","data: ObjectHolder","isNew: boolean","key: ListCacheKey","cacheKey: SpecificLinkCacheKey","changes: Changes"],"sources":["../../../../src/observable/internal/Changes.ts"],"version":3,"file":"Changes.d.ts"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SpecificLinkCacheKey } from "./links/SpecificLinkCacheKey.js";
|
|
2
|
-
import type { ListCacheKey } from "./ListCacheKey.js";
|
|
3
|
-
import type { ObjectCacheKey } from "./
|
|
2
|
+
import type { ListCacheKey } from "./list/ListCacheKey.js";
|
|
3
|
+
import type { ObjectCacheKey } from "./object/ObjectCacheKey.js";
|
|
4
4
|
export type KnownCacheKey = ObjectCacheKey | SpecificLinkCacheKey | ListCacheKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,4BAA4B,iCAAkC;AAC5E,cAAc,oBAAoB,
|
|
1
|
+
{"mappings":"AAgBA,cAAc,4BAA4B,iCAAkC;AAC5E,cAAc,oBAAoB,wBAAyB;AAC3D,cAAc,sBAAsB,4BAA6B;AAEjE,YAAY,gBACR,iBACA,uBACA","names":[],"sources":["../../../../src/observable/internal/KnownCacheKey.ts"],"version":3,"file":"KnownCacheKey.d.ts"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import type { Canonical } from "./Canonical.js";
|
|
2
|
-
export declare class WeakRefTrie<X extends object> {
|
|
3
|
-
#private;
|
|
4
|
-
constructor(makeData?: (array: any[]) => X);
|
|
5
|
-
lookupArray<T extends IArguments | any[]>(array: T): X;
|
|
6
|
-
peekArray<T extends IArguments | any[]>(array: T): X | undefined;
|
|
7
|
-
removeArray<T extends IArguments | any[]>(array: T): X | undefined;
|
|
8
|
-
}
|
|
9
2
|
export declare class OrderByCanonicalizer {
|
|
10
3
|
#private;
|
|
11
4
|
canonicalize: (orderBy: Record<string, "asc" | "desc" | undefined>) => Canonical<Record<string, "asc" | "desc" | undefined>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AAkBA,cAAc,iBAAiB,gBAAiB;AAGhD,OAAO,cAAM,qBAAqB;;CA0BhC,eACEA,SAAS,eAAe,QAAQ,wBAC7B,UAAU,eAAe,QAAQ;AAMvC","names":["orderBy: Record<string, \"asc\" | \"desc\" | undefined>"],"sources":["../../../../src/observable/internal/OrderByCanonicalizer.ts"],"version":3,"file":"OrderByCanonicalizer.d.ts"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `WeakRefTrie` class uses weak references to store data, allowing for automatic garbage collection
|
|
3
|
+
* of entries that are no longer in use.
|
|
4
|
+
*
|
|
5
|
+
* The original trie from @wry/trie does not do automatic cleanup of old entries.
|
|
6
|
+
*/
|
|
7
|
+
export declare class WeakRefTrie<X extends object> {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(makeData?: (array: any[]) => X);
|
|
10
|
+
lookupArray<T extends IArguments | any[]>(array: T): X;
|
|
11
|
+
peekArray<T extends IArguments | any[]>(array: T): X | undefined;
|
|
12
|
+
removeArray<T extends IArguments | any[]>(array: T): X | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;AA0BA,OAAO,cAAM,YAAY,kBAAkB;;CAWzC,YAAYA,YAAWC,iBAAiB;CAWxC,YAAY,UAAU,oBAAoBC,OAAO,IAAI;CAWrD,UAAU,UAAU,oBAAoBA,OAAO,IAAI;CAUnD,YAAY,UAAU,oBAAoBA,OAAO,IAAI;AAGtD","names":["makeData: (array: any[]) => X","array: any[]","array: T"],"sources":["../../../../src/observable/internal/WeakRefTrie.ts"],"version":3,"file":"WeakRefTrie.d.ts"}
|
package/build/types/observable/internal/{ActionApplication.d.ts → actions/ActionApplication.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ActionDefinition, ActionEditResponse } from "@osdk/api";
|
|
2
|
-
import type { ActionSignatureFromDef } from "
|
|
3
|
-
import type { Store } from "
|
|
2
|
+
import type { ActionSignatureFromDef } from "../../../actions/applyAction.js";
|
|
3
|
+
import type { Store } from "../Store.js";
|
|
4
4
|
export declare class ActionApplication {
|
|
5
5
|
#private;
|
|
6
6
|
private store;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,kBACA,0BAEK,WAAY;AACnB,cAAc,8BAA8B,
|
|
1
|
+
{"mappings":"AAgBA,cACE,kBACA,0BAEK,WAAY;AACnB,cAAc,8BAA8B,iCAAkC;AAG9E,cAAc,aAAa,aAAc;AAKzC,OAAO,cAAM,kBAAkB;;CACjB;CAAZ,YAAoBA,OAAO;CAE3B,cAAc,UAAU,uBACtBC,QAAQ,GACRC,MACI,WAAW,uBAAuB,GAAG,gBAAgB,KACrD,MAAM,WAAW,uBAAuB,GAAG,gBAAgB,KAC/DC,OAAO,MAAM,uBACV,QAAQ;AAkGd","names":["store: Store","action: Q","args:\n | Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]\n | Array<Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]>","opts?: Store.ApplyActionOptions"],"sources":["../../../../../src/observable/internal/actions/ActionApplication.ts"],"version":3,"file":"ActionApplication.d.ts"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { OptimisticBuilder } from "
|
|
2
|
-
import { type Changes } from "
|
|
3
|
-
import { type OptimisticId } from "
|
|
4
|
-
import type { Store } from "
|
|
1
|
+
import type { OptimisticBuilder } from "../../OptimisticBuilder.js";
|
|
2
|
+
import { type Changes } from "../Changes.js";
|
|
3
|
+
import { type OptimisticId } from "../OptimisticId.js";
|
|
4
|
+
import type { Store } from "../Store.js";
|
|
5
5
|
export declare class OptimisticJob {
|
|
6
6
|
#private;
|
|
7
7
|
context: OptimisticBuilder;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAkBA,cAAc,yBAAyB,4BAA6B;AACpE,cAAc,eAAe,eAAgB;AAC7C,cAAkC,oBAAoB,oBAAqB;AAC3E,cAAc,aAAa,aAAc;AAEzC,OAAO,cAAM,cAAc;;CACzB,SAAS;CACT,iBAAiB,QAAQ;CAGzB,YAAYA,OAAO,OAAOC,cAAc;AAqFzC;AAED,OAAO,iBAAS,iBACdD,OAAO,OACPE,gCAAgCC,KAAK,oCAC9B","names":["store: Store","optimisticId: OptimisticId","optimisticUpdate: undefined | ((ctx: OptimisticBuilder) => void)","ctx: OptimisticBuilder"],"sources":["../../../../../src/observable/internal/actions/OptimisticJob.ts"],"version":3,"file":"OptimisticJob.d.ts"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { InterfaceHolder } from "
|
|
2
|
-
import type { ObjectHolder } from "
|
|
3
|
-
import type { Status } from "
|
|
4
|
-
import { type ObjectCacheKey } from "
|
|
1
|
+
import type { InterfaceHolder } from "../../../object/convertWireToOsdkObjects/InterfaceHolder.js";
|
|
2
|
+
import type { ObjectHolder } from "../../../object/convertWireToOsdkObjects/ObjectHolder.js";
|
|
3
|
+
import type { Status } from "../../ObservableClient/common.js";
|
|
4
|
+
import { type ObjectCacheKey } from "../object/ObjectCacheKey.js";
|
|
5
5
|
/**
|
|
6
6
|
* Abstract base for ListQuery and SpecificLinkQuery.
|
|
7
7
|
* - Stores object references, not duplicates
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,uBAAuB,6DAA8D;AACnG,cAAc,oBAAoB,0DAA2D;AAC7F,cAAc,cAAc,kCAAmC;AAC/D,cAAc,sBAAsB,6BAA8B;;;;;;;AAQlE,iBAAiB,sBAAsB;CACrC,MAAM;AACP;;;;;AAMD,iBAAiB,sBAAsB;;;;CAIrC,cAAc,MAAM,eAAe;;;;CAKnC;;;;CAKA,iBAAiB;;;;CAKjB;;;;CAKA,QAAQ;;;;CAKR;AACD;;;;AAKD,iBAAiB,4BAA4B;;;;CAI3C;;;;CAKA;;;;CAKA,QAAQ;;;;CAKR;AACD","names":[],"sources":["../../../../../src/observable/internal/base-list/BaseCollectionQuery.ts"],"version":3,"file":"BaseCollectionQuery.d.ts"}
|
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
import type { Osdk, PageResult } from "@osdk/api";
|
|
2
|
-
import type { Connectable, Observable
|
|
3
|
-
import type {
|
|
4
|
-
import type
|
|
5
|
-
import type {
|
|
6
|
-
import
|
|
2
|
+
import type { Connectable, Observable } from "rxjs";
|
|
3
|
+
import type { CommonObserveOptions, Status } from "../../ObservableClient/common.js";
|
|
4
|
+
import { type CacheKey } from "../CacheKey.js";
|
|
5
|
+
import type { Entry } from "../Layer.js";
|
|
6
|
+
import { type ObjectCacheKey } from "../object/ObjectCacheKey.js";
|
|
7
|
+
import { Query } from "../Query.js";
|
|
8
|
+
import type { SortingStrategy } from "../sorting/SortingStrategy.js";
|
|
9
|
+
import type { BatchContext, SubjectPayload } from "../Store.js";
|
|
7
10
|
import type { CollectionConnectableParams, CollectionStorageData } from "./BaseCollectionQuery.js";
|
|
8
|
-
import { type CacheKey } from "./CacheKey.js";
|
|
9
|
-
import type { Canonical } from "./Canonical.js";
|
|
10
|
-
import { type Changes } from "./Changes.js";
|
|
11
|
-
import type { Entry } from "./Layer.js";
|
|
12
|
-
import { type ObjectCacheKey } from "./ObjectQuery.js";
|
|
13
|
-
import type { OptimisticId } from "./OptimisticId.js";
|
|
14
|
-
import { Query } from "./Query.js";
|
|
15
|
-
import type { SimpleWhereClause } from "./SimpleWhereClause.js";
|
|
16
|
-
import type { SortingStrategy } from "./sorting/SortingStrategy.js";
|
|
17
|
-
import type { BatchContext, Store, SubjectPayload } from "./Store.js";
|
|
18
|
-
export interface ListStorageData extends CollectionStorageData {}
|
|
19
|
-
export interface ListCacheKey extends CacheKey<"list", ListStorageData, ListQuery, [type: "object" | "interface", apiName: string, whereClause: Canonical<SimpleWhereClause>, orderByClause: Canonical<Record<string, "asc" | "desc" | undefined>>]> {}
|
|
20
|
-
export interface BaseListCacheKey<
|
|
21
|
-
T_Type extends string,
|
|
22
|
-
T_Query extends Query<any, any, any>,
|
|
23
|
-
T_KeyFactoryArgs extends any[] = any[]
|
|
24
|
-
> extends CacheKey<T_Type, ListStorageData, T_Query, T_KeyFactoryArgs> {}
|
|
25
|
-
export declare const API_NAME_IDX = 1;
|
|
26
|
-
export declare const TYPE_IDX = 0;
|
|
27
|
-
export declare const WHERE_IDX = 2;
|
|
28
|
-
export declare const ORDER_BY_IDX = 3;
|
|
29
|
-
export interface ListQueryOptions extends CommonObserveOptions {
|
|
30
|
-
pageSize?: number;
|
|
31
|
-
}
|
|
32
|
-
type ExtractRelevantObjectsResult = Record<"added" | "modified", {
|
|
33
|
-
all: (ObjectHolder | InterfaceHolder)[]
|
|
34
|
-
strictMatches: Set<(ObjectHolder | InterfaceHolder)>
|
|
35
|
-
sortaMatches: Set<(ObjectHolder | InterfaceHolder)>
|
|
36
|
-
}>;
|
|
37
11
|
/**
|
|
38
12
|
* Base class for collection-based queries (lists and links)
|
|
39
13
|
* Provides common functionality for working with collections of objects
|
|
@@ -82,15 +56,6 @@ export declare abstract class BaseListQuery<
|
|
|
82
56
|
* Implemented by subclasses to handle specific change registration
|
|
83
57
|
*/
|
|
84
58
|
protected abstract registerCacheChanges(batch: BatchContext): void;
|
|
85
|
-
/**
|
|
86
|
-
* Common method to store objects in the cache and return their cache keys
|
|
87
|
-
* Used by collection queries when storing object references
|
|
88
|
-
*
|
|
89
|
-
* @param objects Array of objects to store
|
|
90
|
-
* @param batch The batch context to use
|
|
91
|
-
* @returns Array of cache keys for the stored objects
|
|
92
|
-
*/
|
|
93
|
-
protected storeObjects(objects: Array<Osdk.Instance<any>>, batch: BatchContext): Array<ObjectCacheKey>;
|
|
94
59
|
_dispose(): void;
|
|
95
60
|
/**
|
|
96
61
|
* Creates a payload from collection parameters
|
|
@@ -177,51 +142,3 @@ export declare abstract class BaseListQuery<
|
|
|
177
142
|
status: Status
|
|
178
143
|
}, batch: BatchContext): Entry<KEY>;
|
|
179
144
|
}
|
|
180
|
-
/**
|
|
181
|
-
* Implements filtered and sorted object collection queries.
|
|
182
|
-
* - Handles where clause filtering and orderBy sorting
|
|
183
|
-
* - Manages pagination through fetchMore
|
|
184
|
-
* - Auto-updates when matching objects change
|
|
185
|
-
* - Uses canonicalized cache keys for consistency
|
|
186
|
-
*/
|
|
187
|
-
export declare class ListQuery extends BaseListQuery<ListCacheKey, ListPayload, ListQueryOptions> {
|
|
188
|
-
#private;
|
|
189
|
-
/**
|
|
190
|
-
* Register changes to the cache specific to ListQuery
|
|
191
|
-
*/
|
|
192
|
-
protected registerCacheChanges(batch: BatchContext): void;
|
|
193
|
-
constructor(store: Store, subject: Observable<SubjectPayload<ListCacheKey>>, apiType: "object" | "interface", apiName: string, whereClause: Canonical<SimpleWhereClause>, orderBy: Canonical<Record<string, "asc" | "desc" | undefined>>, cacheKey: ListCacheKey, opts: ListQueryOptions);
|
|
194
|
-
get canonicalWhere(): Canonical<SimpleWhereClause>;
|
|
195
|
-
/**
|
|
196
|
-
* Implements fetchPageData from BaseCollectionQuery template method
|
|
197
|
-
* Fetches a page of data
|
|
198
|
-
*/
|
|
199
|
-
protected fetchPageData(signal: AbortSignal | undefined): Promise<PageResult<Osdk.Instance<any>>>;
|
|
200
|
-
/**
|
|
201
|
-
* Handle fetch errors by setting appropriate error state and notifying subscribers
|
|
202
|
-
*/
|
|
203
|
-
protected handleFetchError(error: unknown, _status: Status, batch: BatchContext): Entry<ListCacheKey>;
|
|
204
|
-
/**
|
|
205
|
-
* Will revalidate the list if its query is affected by invalidating the
|
|
206
|
-
* apiName of the object type passed in.
|
|
207
|
-
*
|
|
208
|
-
* @param apiName to invalidate
|
|
209
|
-
* @returns
|
|
210
|
-
*/
|
|
211
|
-
revalidateObjectType: (apiName: string) => Promise<void>;
|
|
212
|
-
invalidateObjectType: (objectType: string, changes: Changes | undefined) => Promise<void>;
|
|
213
|
-
/**
|
|
214
|
-
* Note: This method is not async because I want it to return right after it
|
|
215
|
-
* finishes the synchronous updates. The promise that is returned
|
|
216
|
-
* will resolve after the revalidation is complete.
|
|
217
|
-
* @param changes
|
|
218
|
-
* @param optimisticId
|
|
219
|
-
* @returns If revalidation is needed, a promise that resolves after the
|
|
220
|
-
* revalidation is complete. Otherwise, undefined.
|
|
221
|
-
*/
|
|
222
|
-
maybeUpdateAndRevalidate: (changes: Changes, optimisticId: OptimisticId | undefined) => Promise<void> | undefined;
|
|
223
|
-
protected _extractRelevantObjects(changes: Changes): ExtractRelevantObjectsResult;
|
|
224
|
-
registerStreamUpdates(sub: Subscription): void;
|
|
225
|
-
}
|
|
226
|
-
export declare function isListCacheKey(cacheKey: CacheKey): cacheKey is ListCacheKey;
|
|
227
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,MAAM,kBAAkB,WAAY;AAElD,cAAc,aAAa,kBAAkB,MAAO;AACpD,cACE,sBACA,cACK,kCAAmC;AAC1C,cAAc,gBAA+C,gBAAiB;AAE9E,cAAc,aAAa,aAAc;AACzC,cAAc,sBAAsB,6BAA8B;AAClE,SAAS,aAAa,aAAc;AACpC,cAAc,uBAAuB,+BAAgC;AAErE,cAAc,cAAc,sBAAsB,aAAc;AAChE,cACE,6BACA,6BACK,0BAA2B;;;;;AAQlC,OAAO,uBAAe;CACpB,YAAY,cAAc;CAC1B;CACA,UAAU;UACF,MAAM,KAAK,SAAS,GAAG;;;;;;CAK/B,UAAU,iBAAiB;;;;;CAO3B,UAAU;;;;;CAMV,UAAU,mBAAmB;;;;;;;;;;;CAgB7B,AAAO,YAAY,UAAU,iBAAiB,KAAK,eACjDA,OAAO,KACPC,QAAQ,QACRC,OAAO,cACPC,mBACC,MAAM;;;;;;;CAwCT,aACEC,MAAM,uBACNH,QAAQ,QACRC,OAAO,eACN,MAAM;;;;;CAwCT,mBAAmB,qBAAqBA,OAAO;CA2C/C;;;;;;;;;CAqBA,UAAU,cACRG,QAAQ,8BACP;;;;;;;;CAkBH,UAAU,mBACRC,SAAS,WAAW,eAAe,QAClC,YAAY;;;;CAWf,UAAU;;;;;CASV,iBAAgB;;;;;;CAmChB,UAAU;;;;;;CAOV,UAAgB,kBAAkB;;;;;;;;;CAyClC,UAAgB,mBACdL,QAAQ,QACRM,QAAQ,0BACP,QAAQ,MAAM;;;;;;;CA+DjB,mBAAmB,cACjBA,QAAQ,0BACP,QAAQ,WAAW,KAAK;;;;;;;;;;CAW3B,UAAU,iBACRC,iBACAC,SAAS,QACTP,OAAO,eACN,MAAM;;;;;;;CAYT,UAAU,eACRQ,iBAAiB,kBACjBR,OAAO,eACN;;;;;;;;;;CAaH,UAAU,iBAAiB,UAAU,iBAAiB,KAAK,eACzDF,OAAO,KACPW,SAAS;EACP;EACA,QAAQ;CACT,GACDT,OAAO,eACN,MAAM;AA4CV","names":["items: T[]","status: Status","batch: BatchContext","append: boolean","data: CollectionStorageData","params: CollectionConnectableParams","subject: Observable<SubjectPayload<KEY>>","signal: AbortSignal | undefined","_error: unknown","_status: Status","objectCacheKeys: ObjectCacheKey[]","options: {\n append?: boolean;\n status: Status;\n }"],"sources":["../../../../../src/observable/internal/base-list/BaseListQuery.ts"],"version":3,"file":"BaseListQuery.d.ts"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Connectable, type Observable } from "rxjs";
|
|
2
|
-
import type { Status } from "
|
|
3
|
-
import type { CacheKey } from "
|
|
4
|
-
import type { Store, SubjectPayload } from "
|
|
2
|
+
import type { Status } from "../../ObservableClient/common.js";
|
|
3
|
+
import type { CacheKey } from "../CacheKey.js";
|
|
4
|
+
import type { Store, SubjectPayload } from "../Store.js";
|
|
5
5
|
/**
|
|
6
6
|
* Common parameters available for constructing a collection payload
|
|
7
7
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAGO,kBAIA,kBAKA,MAAO;AACd,cAAc,cAAc,kCAAmC;AAC/D,cAAc,gBAAgB,gBAAiB;AAE/C,cAAc,OAAO,sBAAsB,aAAc;;;;UAK/C,4BAA4B;;;;CAIpC;;;;CAKA;;;;CAKA,QAAQ;;;;CAKR;AACD;;;;;;;;;AAUD,OAAO,iBAAS;CACd,UAAU;CACV;EAEAA,SAAS,WAAW,eAAe,KACnCC,OAAO,OACPC,gBAAgBC,QAAQ,gCAAgC,IACvD,YAAY","names":["subject: Observable<SubjectPayload<K>>","store: Store","createPayload: (params: CollectionConnectableParams) => P","params: CollectionConnectableParams"],"sources":["../../../../../src/observable/internal/base-list/createCollectionConnectable.ts"],"version":3,"file":"createCollectionConnectable.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../../../src/observable/internal/base-list/createCollectionConnectable.test.ts"],"version":3,"file":"createCollectionConnectable.test.d.ts"}
|
package/build/types/observable/internal/{removeDuplicates.d.ts → base-list/removeDuplicates.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ObjectCacheKey } from "
|
|
2
|
-
import type { BatchContext } from "
|
|
1
|
+
import type { ObjectCacheKey } from "../object/ObjectCacheKey.js";
|
|
2
|
+
import type { BatchContext } from "../Store.js";
|
|
3
3
|
/**
|
|
4
4
|
* Removes duplicate object cache keys from an array while maintaining order.
|
|
5
5
|
* Also reads each key from the batch context (for side effects).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,sBAAsB,6BAA8B;AAClE,cAAc,oBAAoB,aAAc;;;;;;;;;AAUhD,OAAO,iBAAS,iBACdA,iBAAiB,kBACjBC,OAAO,eACN","names":["objectCacheKeys: ObjectCacheKey[]","batch: BatchContext"],"sources":["../../../../../src/observable/internal/base-list/removeDuplicates.ts"],"version":3,"file":"removeDuplicates.d.ts"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ObjectTypeDefinition, PrimaryKeyType } from "@osdk/api";
|
|
2
|
-
import type { CollectionStorageData } from "../BaseCollectionQuery.js";
|
|
2
|
+
import type { CollectionStorageData } from "../base-list/BaseCollectionQuery.js";
|
|
3
3
|
import type { CacheKey } from "../CacheKey.js";
|
|
4
4
|
import type { Canonical } from "../Canonical.js";
|
|
5
5
|
import type { SimpleWhereClause } from "../SimpleWhereClause.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,sBAAsB,sBAAsB,WAAY;AACtE,cAAc,6BAA6B,
|
|
1
|
+
{"mappings":"AAgBA,cAAc,sBAAsB,sBAAsB,WAAY;AACtE,cAAc,6BAA6B,qCAAsC;AACjF,cAAc,gBAAgB,gBAAiB;AAC/C,cAAc,iBAAiB,iBAAkB;AACjD,cAAc,yBAAyB,yBAA0B;AACjE,cAAc,yBAAyB,wBAAyB;;;;AAKhE,iBAAiB,wBAAwB,sBAAsB,CAC9D;;;;;;;AAQD,iBAAiB,6BACf,SACE,gBACA,iBACA,oBAEE,0BACA,UAAU,eAAe,uBACzB,kBACA,aAAa,UAAU,oBACvB,eAAe,UAAU,eAAe,QAAQ,uBAGtD,CACC","names":[],"sources":["../../../../../src/observable/internal/links/SpecificLinkCacheKey.ts"],"version":3,"file":"SpecificLinkCacheKey.d.ts"}
|
|
@@ -3,10 +3,10 @@ import { type Subject } from "rxjs";
|
|
|
3
3
|
import type { SpecificLinkPayload } from "../../LinkPayload.js";
|
|
4
4
|
import type { Status } from "../../ObservableClient/common.js";
|
|
5
5
|
import type { ObserveLinks } from "../../ObservableClient/ObserveLink.js";
|
|
6
|
+
import { BaseListQuery } from "../base-list/BaseListQuery.js";
|
|
6
7
|
import type { CacheKey } from "../CacheKey.js";
|
|
7
8
|
import type { Changes } from "../Changes.js";
|
|
8
9
|
import type { Entry } from "../Layer.js";
|
|
9
|
-
import { BaseListQuery } from "../ListQuery.js";
|
|
10
10
|
import type { OptimisticId } from "../OptimisticId.js";
|
|
11
11
|
import type { BatchContext, Store, SubjectPayload } from "../Store.js";
|
|
12
12
|
import type { SpecificLinkCacheKey } from "./SpecificLinkCacheKey.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,sBACA,MACA,kBAGK,WAAY;AAEnB,cAAc,eAAe,MAAO;AAEpC,cAAc,2BAA2B,sBAAuB;AAChE,cAAc,cAAc,kCAAmC;AAC/D,cAAc,oBAAoB,uCAAwC;AAC1E,cAAc,gBAAgB,gBAAiB;AAE/C,cAAc,eAAe,eAAgB;AAC7C,cAAc,aAAa,aAAc;AACzC,
|
|
1
|
+
{"mappings":"AAgBA,cACE,sBACA,MACA,kBAGK,WAAY;AAEnB,cAAc,eAAe,MAAO;AAEpC,cAAc,2BAA2B,sBAAuB;AAChE,cAAc,cAAc,kCAAmC;AAC/D,cAAc,oBAAoB,uCAAwC;AAC1E,SAAS,qBAAqB,+BAAgC;AAC9D,cAAc,gBAAgB,gBAAiB;AAE/C,cAAc,eAAe,eAAgB;AAC7C,cAAc,aAAa,aAAc;AACzC,cAAc,oBAAoB,oBAAqB;AAGvD,cAAc,cAAc,OAAO,sBAAsB,aAAc;AAEvE,cAAc,4BAA4B,2BAA4B;;;;;;;;AAStE,OAAO,cAAM,0BAA0B,cACrC,sBACA,qBACA,aAAa,QAAQ,+BACrB;;;;;CAUA,UAAU,qBAAqBA,OAAO;CAItC,YACEC,OAAO,OACPC,SAAS,QAAQ,eAAe,wBAChCC,UAAU,sBACVC,MAAM,aAAa,QACjB;;;;;CAyCJ,UAAgB,cACdC,QAAQ,0BACP,QAAQ,WAAW,KAAK;;;;CAuD3B,gBACEC,QAAQ,QACRN,OAAO,eACN,MAAM;;;;CAgCT,2BACEO,SAAS,SACTC,eAAe,6BACd;CAcH,uBACEC,oBACAC,SAAS,wBACR;AA4BJ;;;;AAKD,OAAO,iBAAS,uBACdC,KAAK,WACJ,OAAO","names":["batch: BatchContext","store: Store","subject: Subject<SubjectPayload<SpecificLinkCacheKey>>","cacheKey: SpecificLinkCacheKey","opts: ObserveLinks.Options<\n ObjectTypeDefinition,\n string\n >","signal: AbortSignal | undefined","status: Status","changes: Changes","_optimisticId: OptimisticId | undefined","objectType: string","changes: Changes | undefined","key: CacheKey"],"sources":["../../../../../src/observable/internal/links/SpecificLinkQuery.ts"],"version":3,"file":"SpecificLinkQuery.d.ts"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CollectionStorageData } from "
|
|
2
|
-
import type { CacheKey } from "
|
|
3
|
-
import type { Canonical } from "
|
|
1
|
+
import type { CollectionStorageData } from "../base-list/BaseCollectionQuery.js";
|
|
2
|
+
import type { CacheKey } from "../CacheKey.js";
|
|
3
|
+
import type { Canonical } from "../Canonical.js";
|
|
4
|
+
import type { SimpleWhereClause } from "../SimpleWhereClause.js";
|
|
4
5
|
import type { ListQuery } from "./ListQuery.js";
|
|
5
|
-
import type { SimpleWhereClause } from "./SimpleWhereClause.js";
|
|
6
6
|
export interface ListStorageData extends CollectionStorageData {}
|
|
7
7
|
export interface ListCacheKey extends CacheKey<"list", ListStorageData, ListQuery, [type: "object" | "interface", apiName: string, whereClause: Canonical<SimpleWhereClause>, orderByClause: Canonical<Record<string, "asc" | "desc" | undefined>>]> {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,6BAA6B,qCAAsC;AACjF,cAAc,gBAAgB,gBAAiB;AAC/C,cAAc,iBAAiB,iBAAkB;AACjD,cAAc,yBAAyB,yBAA0B;AACjE,cAAc,iBAAiB,gBAAiB;AAEhD,iBAAiB,wBAAwB,sBAAsB,CAAE;AAEjE,iBAAiB,qBACf,SACE,QACA,iBACA,YAEE,MAAM,WAAW,aACjB,iBACA,aAAa,UAAU,oBACvB,eAAe,UAAU,eAAe,QAAQ,uBAGtD,CACC","names":[],"sources":["../../../../../src/observable/internal/list/ListCacheKey.ts"],"version":3,"file":"ListCacheKey.d.ts"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Osdk, PageResult } from "@osdk/api";
|
|
2
|
+
import type { Observable, Subscription } from "rxjs";
|
|
3
|
+
import type { InterfaceHolder } from "../../../object/convertWireToOsdkObjects/InterfaceHolder.js";
|
|
4
|
+
import type { ObjectHolder } from "../../../object/convertWireToOsdkObjects/ObjectHolder.js";
|
|
5
|
+
import type { ListPayload } from "../../ListPayload.js";
|
|
6
|
+
import type { Status } from "../../ObservableClient/common.js";
|
|
7
|
+
import { BaseListQuery } from "../base-list/BaseListQuery.js";
|
|
8
|
+
import { type CacheKey } from "../CacheKey.js";
|
|
9
|
+
import type { Canonical } from "../Canonical.js";
|
|
10
|
+
import { type Changes } from "../Changes.js";
|
|
11
|
+
import type { Entry } from "../Layer.js";
|
|
12
|
+
import type { OptimisticId } from "../OptimisticId.js";
|
|
13
|
+
import type { SimpleWhereClause } from "../SimpleWhereClause.js";
|
|
14
|
+
import type { BatchContext, Store, SubjectPayload } from "../Store.js";
|
|
15
|
+
import type { ListCacheKey } from "./ListCacheKey.js";
|
|
16
|
+
import type { ListQueryOptions } from "./ListQueryOptions.js";
|
|
17
|
+
export declare const API_NAME_IDX = 1;
|
|
18
|
+
export declare const TYPE_IDX = 0;
|
|
19
|
+
export declare const WHERE_IDX = 2;
|
|
20
|
+
export declare const ORDER_BY_IDX = 3;
|
|
21
|
+
type ExtractRelevantObjectsResult = Record<"added" | "modified", {
|
|
22
|
+
all: (ObjectHolder | InterfaceHolder)[]
|
|
23
|
+
strictMatches: Set<(ObjectHolder | InterfaceHolder)>
|
|
24
|
+
sortaMatches: Set<(ObjectHolder | InterfaceHolder)>
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Implements filtered and sorted object collection queries.
|
|
28
|
+
* - Handles where clause filtering and orderBy sorting
|
|
29
|
+
* - Manages pagination through fetchMore
|
|
30
|
+
* - Auto-updates when matching objects change
|
|
31
|
+
* - Uses canonicalized cache keys for consistency
|
|
32
|
+
*/
|
|
33
|
+
export declare class ListQuery extends BaseListQuery<ListCacheKey, ListPayload, ListQueryOptions> {
|
|
34
|
+
#private;
|
|
35
|
+
/**
|
|
36
|
+
* Register changes to the cache specific to ListQuery
|
|
37
|
+
*/
|
|
38
|
+
protected registerCacheChanges(batch: BatchContext): void;
|
|
39
|
+
constructor(store: Store, subject: Observable<SubjectPayload<ListCacheKey>>, apiType: "object" | "interface", apiName: string, whereClause: Canonical<SimpleWhereClause>, orderBy: Canonical<Record<string, "asc" | "desc" | undefined>>, cacheKey: ListCacheKey, opts: ListQueryOptions);
|
|
40
|
+
get canonicalWhere(): Canonical<SimpleWhereClause>;
|
|
41
|
+
/**
|
|
42
|
+
* Implements fetchPageData from BaseCollectionQuery template method
|
|
43
|
+
* Fetches a page of data
|
|
44
|
+
*/
|
|
45
|
+
protected fetchPageData(signal: AbortSignal | undefined): Promise<PageResult<Osdk.Instance<any>>>;
|
|
46
|
+
/**
|
|
47
|
+
* Handle fetch errors by setting appropriate error state and notifying subscribers
|
|
48
|
+
*/
|
|
49
|
+
protected handleFetchError(error: unknown, _status: Status, batch: BatchContext): Entry<ListCacheKey>;
|
|
50
|
+
/**
|
|
51
|
+
* Will revalidate the list if its query is affected by invalidating the
|
|
52
|
+
* apiName of the object type passed in.
|
|
53
|
+
*
|
|
54
|
+
* @param apiName to invalidate
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
revalidateObjectType: (apiName: string) => Promise<void>;
|
|
58
|
+
invalidateObjectType: (objectType: string, changes: Changes | undefined) => Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Note: This method is not async because I want it to return right after it
|
|
61
|
+
* finishes the synchronous updates. The promise that is returned
|
|
62
|
+
* will resolve after the revalidation is complete.
|
|
63
|
+
* @param changes
|
|
64
|
+
* @param optimisticId
|
|
65
|
+
* @returns If revalidation is needed, a promise that resolves after the
|
|
66
|
+
* revalidation is complete. Otherwise, undefined.
|
|
67
|
+
*/
|
|
68
|
+
maybeUpdateAndRevalidate: (changes: Changes, optimisticId: OptimisticId | undefined) => Promise<void> | undefined;
|
|
69
|
+
protected _extractRelevantObjects(changes: Changes): ExtractRelevantObjectsResult;
|
|
70
|
+
registerStreamUpdates(sub: Subscription): void;
|
|
71
|
+
}
|
|
72
|
+
export declare function isListCacheKey(cacheKey: CacheKey): cacheKey is ListCacheKey;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAKE,MACA,kBAEK,WAAY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S,eACdC,UAAU,WACT,YAAY","names":["batch: BatchContext","store: Store","subject: Observable<SubjectPayload<ListCacheKey>>","apiType: \"object\" | \"interface\"","apiName: string","whereClause: Canonical<SimpleWhereClause>","orderBy: Canonical<Record<string, \"asc\" | \"desc\" | undefined>>","cacheKey: ListCacheKey","opts: ListQueryOptions","signal: AbortSignal | undefined","error: unknown","_status: Status","objectType: string","changes: Changes | undefined","changes: Changes","optimisticId: OptimisticId | undefined","sub: Subscription","cacheKey: CacheKey"],"sources":["../../../../../src/observable/internal/list/ListQuery.ts"],"version":3,"file":"ListQuery.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,4BAA4B,kCAAmC;AAE7E,iBAAiB,yBAAyB,qBAAqB;CAC7D;AACD","names":[],"sources":["../../../../../src/observable/internal/list/ListQueryOptions.ts"],"version":3,"file":"ListQueryOptions.d.ts"}
|
|
@@ -3,11 +3,11 @@ import type { ListPayload } from "../../ListPayload.js";
|
|
|
3
3
|
import type { ObserveListOptions } from "../../ObservableClient.js";
|
|
4
4
|
import type { Observer } from "../../ObservableClient/common.js";
|
|
5
5
|
import { AbstractHelper } from "../AbstractHelper.js";
|
|
6
|
-
import { ListQuery } from "../ListQuery.js";
|
|
7
6
|
import type { OrderByCanonicalizer } from "../OrderByCanonicalizer.js";
|
|
8
7
|
import type { QuerySubscription } from "../QuerySubscription.js";
|
|
9
8
|
import type { Store } from "../Store.js";
|
|
10
9
|
import type { WhereClauseCanonicalizer } from "../WhereClauseCanonicalizer.js";
|
|
10
|
+
import { ListQuery } from "./ListQuery.js";
|
|
11
11
|
export declare class ListsHelper extends AbstractHelper<ListQuery, ObserveListOptions<ObjectTypeDefinition | InterfaceDefinition>> {
|
|
12
12
|
whereCanonicalizer: WhereClauseCanonicalizer;
|
|
13
13
|
orderByCanonicalizer: OrderByCanonicalizer;
|