@osdk/react 0.10.0-beta.1 → 0.10.0-beta.10
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/AGENTS.md +46 -221
- package/CHANGELOG.md +132 -0
- package/build/browser/new/makeExternalStore.js +61 -0
- package/build/browser/new/makeExternalStore.js.map +1 -1
- package/build/browser/new/useLinks.js +11 -4
- package/build/browser/new/useLinks.js.map +1 -1
- package/build/browser/new/useObjectSet.js +42 -18
- package/build/browser/new/useObjectSet.js.map +1 -1
- package/build/browser/new/useOsdkAction.js +2 -2
- package/build/browser/new/useOsdkAction.js.map +1 -1
- package/build/browser/new/useOsdkAggregation.js +65 -27
- package/build/browser/new/useOsdkAggregation.js.map +1 -1
- package/build/browser/new/useOsdkFunction.js +17 -12
- package/build/browser/new/useOsdkFunction.js.map +1 -1
- package/build/browser/new/useOsdkObject.js +44 -26
- package/build/browser/new/useOsdkObject.js.map +1 -1
- package/build/browser/new/useOsdkObjects.js +28 -19
- package/build/browser/new/useOsdkObjects.js.map +1 -1
- package/build/browser/{intellisense.test.helpers/useOsdkObjectsWithPivot.js → public/experimental/admin.js} +4 -19
- package/build/browser/public/experimental/admin.js.map +1 -0
- package/build/browser/public/experimental.js +0 -3
- package/build/browser/public/experimental.js.map +1 -1
- package/build/browser/useOsdkMetadata.js.map +1 -1
- package/build/cjs/{chunk-V32JHU3O.cjs → chunk-OVBG5VXE.cjs} +3 -8
- package/build/cjs/chunk-OVBG5VXE.cjs.map +1 -0
- package/build/cjs/chunk-SVVMLSKN.cjs +111 -0
- package/build/cjs/chunk-SVVMLSKN.cjs.map +1 -0
- package/build/cjs/index.cjs +4 -4
- package/build/cjs/index.d.cts +1 -1
- package/build/cjs/public/experimental/admin.cjs +146 -0
- package/build/cjs/public/experimental/admin.cjs.map +1 -0
- package/build/cjs/public/experimental/admin.d.cts +118 -0
- package/build/cjs/public/experimental.cjs +253 -492
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.d.cts +106 -138
- package/build/cjs/useOsdkMetadata-BElt3F5s.d.cts +15 -0
- package/build/esm/new/makeExternalStore.js +61 -0
- package/build/esm/new/makeExternalStore.js.map +1 -1
- package/build/esm/new/useLinks.js +11 -4
- package/build/esm/new/useLinks.js.map +1 -1
- package/build/esm/new/useObjectSet.js +42 -18
- package/build/esm/new/useObjectSet.js.map +1 -1
- package/build/esm/new/useOsdkAction.js +2 -2
- package/build/esm/new/useOsdkAction.js.map +1 -1
- package/build/esm/new/useOsdkAggregation.js +65 -27
- package/build/esm/new/useOsdkAggregation.js.map +1 -1
- package/build/esm/new/useOsdkFunction.js +17 -12
- package/build/esm/new/useOsdkFunction.js.map +1 -1
- package/build/esm/new/useOsdkObject.js +44 -26
- package/build/esm/new/useOsdkObject.js.map +1 -1
- package/build/esm/new/useOsdkObjects.js +28 -19
- package/build/esm/new/useOsdkObjects.js.map +1 -1
- package/build/esm/{intellisense.test.helpers/useOsdkObjectsWithPivot.js → public/experimental/admin.js} +4 -19
- package/build/esm/public/experimental/admin.js.map +1 -0
- package/build/esm/public/experimental.js +0 -3
- package/build/esm/public/experimental.js.map +1 -1
- package/build/esm/useOsdkMetadata.js.map +1 -1
- package/build/types/new/makeExternalStore.d.ts +11 -0
- package/build/types/new/makeExternalStore.d.ts.map +1 -1
- package/build/types/new/useLinks.d.ts +19 -0
- package/build/types/new/useLinks.d.ts.map +1 -1
- package/build/types/new/useObjectSet.d.ts +10 -4
- package/build/types/new/useObjectSet.d.ts.map +1 -1
- package/build/types/new/useOsdkAggregation.d.ts +41 -3
- package/build/types/new/useOsdkAggregation.d.ts.map +1 -1
- package/build/types/new/useOsdkFunction.d.ts +11 -5
- package/build/types/new/useOsdkFunction.d.ts.map +1 -1
- package/build/types/new/useOsdkObject.d.ts +18 -7
- package/build/types/new/useOsdkObject.d.ts.map +1 -1
- package/build/types/new/useOsdkObjects.d.ts +26 -2
- package/build/types/new/useOsdkObjects.d.ts.map +1 -1
- package/build/types/public/experimental/admin.d.ts +3 -0
- package/build/types/public/experimental/admin.d.ts.map +1 -0
- package/build/types/public/experimental.d.ts +0 -3
- package/build/types/public/experimental.d.ts.map +1 -1
- package/build/types/useOsdkMetadata.d.ts +5 -4
- package/build/types/useOsdkMetadata.d.ts.map +1 -1
- package/docs/querying-data.md +19 -0
- package/{build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js → experimental/admin.d.ts} +1 -18
- package/package.json +29 -8
- package/build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
- package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js +0 -34
- package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
- package/build/browser/intellisense.test.js +0 -148
- package/build/browser/intellisense.test.js.map +0 -1
- package/build/cjs/chunk-V32JHU3O.cjs.map +0 -1
- package/build/cjs/useOsdkMetadata-DFZhnhGZ.d.cts +0 -14
- package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
- package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
- package/build/esm/intellisense.test.js +0 -148
- package/build/esm/intellisense.test.js.map +0 -1
- package/build/types/intellisense.test.d.ts +0 -1
- package/build/types/intellisense.test.d.ts.map +0 -1
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts +0 -1
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts.map +0 -1
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts +0 -1
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts.map +0 -1
|
@@ -24,13 +24,21 @@ import { OsdkContext2 } from "./OsdkContext2.js";
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Loads an object by type and primary key.
|
|
27
|
+
* Loads an object or interface instance by type and primary key.
|
|
28
28
|
*
|
|
29
|
-
* @param type
|
|
30
|
-
* @param primaryKey
|
|
29
|
+
* @param type The object type or interface definition
|
|
30
|
+
* @param primaryKey The primary key of the object
|
|
31
31
|
* @param enabled Enable or disable the query (defaults to true)
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Loads an object or interface instance by type and primary key with options.
|
|
36
|
+
*
|
|
37
|
+
* @param type The object type or interface definition
|
|
38
|
+
* @param primaryKey The primary key of the object
|
|
39
|
+
* @param options Options including $select and enabled
|
|
40
|
+
*/
|
|
41
|
+
|
|
34
42
|
/*
|
|
35
43
|
Implementation of useOsdkObject
|
|
36
44
|
*/
|
|
@@ -44,13 +52,17 @@ export function useOsdkObject(...args) {
|
|
|
44
52
|
// so we must use type assertions after runtime discrimination
|
|
45
53
|
const isInstanceSignature = "$objectType" in args[0];
|
|
46
54
|
|
|
47
|
-
// Extract
|
|
48
|
-
const
|
|
55
|
+
// Extract options object if provided (3rd arg is an object with $select or enabled)
|
|
56
|
+
const optionsArg = !isInstanceSignature && args[2] != null && typeof args[2] === "object" ? args[2] : undefined;
|
|
49
57
|
|
|
50
|
-
//
|
|
58
|
+
// Extract enabled flag - 2nd param for instance signature, 3rd for type signature
|
|
59
|
+
const enabled = isInstanceSignature ? typeof args[1] === "boolean" ? args[1] : true : optionsArg ? optionsArg.enabled ?? true : typeof args[2] === "boolean" ? args[2] : true;
|
|
60
|
+
const selectArg = optionsArg?.$select;
|
|
51
61
|
const mode = isInstanceSignature ? "offline" : undefined;
|
|
52
|
-
const
|
|
62
|
+
const typeOrApiName = isInstanceSignature ? args[0].$objectType : args[0];
|
|
53
63
|
const primaryKey = isInstanceSignature ? args[0].$primaryKey : args[1];
|
|
64
|
+
const apiNameString = typeof typeOrApiName === "string" ? typeOrApiName : typeOrApiName.apiName;
|
|
65
|
+
const stableSelect = React.useMemo(() => selectArg, [JSON.stringify(selectArg)]);
|
|
54
66
|
const {
|
|
55
67
|
subscribe,
|
|
56
68
|
getSnapShot
|
|
@@ -58,27 +70,33 @@ export function useOsdkObject(...args) {
|
|
|
58
70
|
if (!enabled) {
|
|
59
71
|
return makeExternalStore(() => ({
|
|
60
72
|
unsubscribe: () => {}
|
|
61
|
-
}), `object ${
|
|
73
|
+
}), `object ${apiNameString} ${primaryKey} [DISABLED]`);
|
|
62
74
|
}
|
|
63
|
-
return makeExternalStore(observer => observableClient.observeObject(
|
|
64
|
-
mode
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
return makeExternalStore(observer => observableClient.observeObject(typeOrApiName, primaryKey, {
|
|
76
|
+
mode,
|
|
77
|
+
...(stableSelect ? {
|
|
78
|
+
select: stableSelect
|
|
79
|
+
} : {})
|
|
80
|
+
}, observer), `object ${apiNameString} ${primaryKey}`);
|
|
81
|
+
}, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect]);
|
|
67
82
|
const payload = React.useSyncExternalStore(subscribe, getSnapShot);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
error
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
isOptimistic: !!payload?.isOptimistic,
|
|
78
|
-
error,
|
|
79
|
-
forceUpdate: () => {
|
|
80
|
-
throw new Error("not implemented");
|
|
83
|
+
const forceUpdate = React.useCallback(() => {
|
|
84
|
+
throw new Error("not implemented");
|
|
85
|
+
}, []);
|
|
86
|
+
return React.useMemo(() => {
|
|
87
|
+
let error;
|
|
88
|
+
if (payload && "error" in payload && payload.error) {
|
|
89
|
+
error = payload.error;
|
|
90
|
+
} else if (payload?.status === "error") {
|
|
91
|
+
error = new Error("Failed to load object");
|
|
81
92
|
}
|
|
82
|
-
|
|
93
|
+
return {
|
|
94
|
+
object: payload?.object,
|
|
95
|
+
isLoading: enabled ? payload?.status === "loading" || payload?.status === "init" || !payload : false,
|
|
96
|
+
isOptimistic: !!payload?.isOptimistic,
|
|
97
|
+
error,
|
|
98
|
+
forceUpdate
|
|
99
|
+
};
|
|
100
|
+
}, [payload, enabled, forceUpdate]);
|
|
83
101
|
}
|
|
84
102
|
//# sourceMappingURL=useOsdkObject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOsdkObject.js","names":["React","makeExternalStore","OsdkContext2","useOsdkObject","args","observableClient","useContext","isInstanceSignature","
|
|
1
|
+
{"version":3,"file":"useOsdkObject.js","names":["React","makeExternalStore","OsdkContext2","useOsdkObject","args","observableClient","useContext","isInstanceSignature","optionsArg","undefined","enabled","selectArg","$select","mode","typeOrApiName","$objectType","primaryKey","$primaryKey","apiNameString","apiName","stableSelect","useMemo","JSON","stringify","subscribe","getSnapShot","unsubscribe","observer","observeObject","select","payload","useSyncExternalStore","forceUpdate","useCallback","Error","error","status","object","isLoading","isOptimistic"],"sources":["useOsdkObject.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 {\n ObjectOrInterfaceDefinition,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n} from \"@osdk/api\";\nimport type { ObserveObjectCallbackArgs } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\nexport interface UseOsdkObjectResult<\n Q extends ObjectOrInterfaceDefinition,\n> {\n object: Osdk.Instance<Q> | undefined;\n isLoading: boolean;\n\n error: Error | undefined;\n\n /**\n * Refers to whether the object is optimistic or not.\n */\n isOptimistic: boolean;\n forceUpdate: () => void;\n}\n\n/**\n * @param obj an existing `Osdk.Instance` object to get metadata for.\n * @param enabled Enable or disable the query (defaults to true)\n */\nexport function useOsdkObject<\n Q extends ObjectOrInterfaceDefinition,\n>(\n obj: Osdk.Instance<Q>,\n enabled?: boolean,\n): UseOsdkObjectResult<Q>;\n/**\n * Loads an object or interface instance by type and primary key.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param enabled Enable or disable the query (defaults to true)\n */\nexport function useOsdkObject<\n Q extends ObjectOrInterfaceDefinition,\n>(\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n enabled?: boolean,\n): UseOsdkObjectResult<Q>;\n/**\n * Loads an object or interface instance by type and primary key with options.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param options Options including $select and enabled\n */\nexport function useOsdkObject<\n Q extends ObjectOrInterfaceDefinition,\n>(\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n options?: { $select?: readonly PropertyKeys<Q>[]; enabled?: boolean },\n): UseOsdkObjectResult<Q>;\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject<\n Q extends ObjectOrInterfaceDefinition,\n>(\n ...args:\n | [obj: Osdk.Instance<Q>, enabled?: boolean]\n | [type: Q, primaryKey: PrimaryKeyType<Q>, enabled?: boolean]\n | [\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n options?: { $select?: readonly PropertyKeys<Q>[]; enabled?: boolean },\n ]\n): UseOsdkObjectResult<Q> {\n const { observableClient } = React.useContext(OsdkContext2);\n\n // Check if first arg is an instance to discriminate signatures\n // TypeScript cannot narrow rest parameter unions with optional parameters,\n // so we must use type assertions after runtime discrimination\n const isInstanceSignature = \"$objectType\" in args[0];\n\n // Extract options object if provided (3rd arg is an object with $select or enabled)\n const optionsArg = !isInstanceSignature\n && args[2] != null\n && typeof args[2] === \"object\"\n ? args[2] as { $select?: readonly string[]; enabled?: boolean }\n : undefined;\n\n // Extract enabled flag - 2nd param for instance signature, 3rd for type signature\n const enabled = isInstanceSignature\n ? (typeof args[1] === \"boolean\" ? args[1] : true)\n : optionsArg\n ? (optionsArg.enabled ?? true)\n : (typeof args[2] === \"boolean\" ? args[2] : true);\n\n const selectArg = optionsArg?.$select;\n\n const mode = isInstanceSignature ? \"offline\" : undefined;\n\n const typeOrApiName = isInstanceSignature\n ? (args[0] as Osdk.Instance<Q>).$objectType\n : (args[0] as Q);\n\n const primaryKey = isInstanceSignature\n ? (args[0] as Osdk.Instance<Q>).$primaryKey\n : (args[1] as PrimaryKeyType<Q>);\n\n const apiNameString = typeof typeOrApiName === \"string\"\n ? typeOrApiName\n : typeOrApiName.apiName;\n\n const stableSelect = React.useMemo(\n () => selectArg,\n [JSON.stringify(selectArg)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<ObserveObjectCallbackArgs<Q>>(\n () => ({ unsubscribe: () => {} }),\n `object ${apiNameString} ${primaryKey} [DISABLED]`,\n );\n }\n return makeExternalStore<ObserveObjectCallbackArgs<Q>>(\n (observer) =>\n observableClient.observeObject(\n typeOrApiName,\n primaryKey,\n {\n mode,\n ...(stableSelect ? { select: stableSelect } : {}),\n },\n observer,\n ),\n `object ${apiNameString} ${primaryKey}`,\n );\n },\n [\n enabled,\n observableClient,\n typeOrApiName,\n apiNameString,\n primaryKey,\n mode,\n stableSelect,\n ],\n );\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const forceUpdate = React.useCallback(() => {\n throw new Error(\"not implemented\");\n }, []);\n\n return React.useMemo(() => {\n let error: Error | undefined;\n if (payload && \"error\" in payload && payload.error) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(\"Failed to load object\");\n }\n\n return {\n object: payload?.object as Osdk.Instance<Q> | undefined,\n isLoading: enabled\n ? (payload?.status === \"loading\" || payload?.status === \"init\"\n || !payload)\n : false,\n isOptimistic: !!payload?.isOptimistic,\n error,\n forceUpdate,\n };\n }, [payload, enabled, forceUpdate]);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAK,GAAGL,OAAO,CAACK,KAAK;IACvB,CAAC,MAAM,IAAIL,OAAO,EAAEM,MAAM,KAAK,OAAO,EAAE;MACtCD,KAAK,GAAG,IAAID,KAAK,CAAC,uBAAuB,CAAC;IAC5C;IAEA,OAAO;MACLG,MAAM,EAAEP,OAAO,EAAEO,MAAsC;MACvDC,SAAS,EAAE5B,OAAO,GACboB,OAAO,EAAEM,MAAM,KAAK,SAAS,IAAIN,OAAO,EAAEM,MAAM,KAAK,MAAM,IACzD,CAACN,OAAO,GACX,KAAK;MACTS,YAAY,EAAE,CAAC,CAACT,OAAO,EAAES,YAAY;MACrCJ,KAAK;MACLH;IACF,CAAC;EACH,CAAC,EAAE,CAACF,OAAO,EAAEpB,OAAO,EAAEsB,WAAW,CAAC,CAAC;AACrC","ignoreList":[]}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
import { makeExternalStore } from "./makeExternalStore.js";
|
|
19
19
|
import { OsdkContext2 } from "./OsdkContext2.js";
|
|
20
|
+
const EMPTY_WHERE = {};
|
|
20
21
|
export function useOsdkObjects(type, options) {
|
|
21
22
|
const {
|
|
22
23
|
observableClient
|
|
@@ -32,13 +33,16 @@ export function useOsdkObjects(type, options) {
|
|
|
32
33
|
streamUpdates,
|
|
33
34
|
autoFetchMore,
|
|
34
35
|
intersectWith,
|
|
35
|
-
pivotTo
|
|
36
|
+
pivotTo,
|
|
37
|
+
$select
|
|
36
38
|
} = options ?? {};
|
|
37
|
-
const canonWhere = observableClient.canonicalizeWhereClause(where ??
|
|
39
|
+
const canonWhere = observableClient.canonicalizeWhereClause(where ?? EMPTY_WHERE);
|
|
40
|
+
const stableCanonWhere = React.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);
|
|
38
41
|
const stableRids = React.useMemo(() => rids, [JSON.stringify(rids)]);
|
|
39
42
|
const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);
|
|
40
43
|
const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);
|
|
41
44
|
const stableOrderBy = React.useMemo(() => orderBy, [JSON.stringify(orderBy)]);
|
|
45
|
+
const stableSelect = React.useMemo(() => $select, [JSON.stringify($select)]);
|
|
42
46
|
const {
|
|
43
47
|
subscribe,
|
|
44
48
|
getSnapShot
|
|
@@ -51,7 +55,7 @@ export function useOsdkObjects(type, options) {
|
|
|
51
55
|
return makeExternalStore(observer => observableClient.observeList({
|
|
52
56
|
type,
|
|
53
57
|
rids: stableRids,
|
|
54
|
-
where:
|
|
58
|
+
where: stableCanonWhere,
|
|
55
59
|
dedupeInterval: dedupeIntervalMs ?? 2_000,
|
|
56
60
|
pageSize,
|
|
57
61
|
orderBy: stableOrderBy,
|
|
@@ -63,23 +67,28 @@ export function useOsdkObjects(type, options) {
|
|
|
63
67
|
} : {}),
|
|
64
68
|
...(pivotTo ? {
|
|
65
69
|
pivotTo
|
|
70
|
+
} : {}),
|
|
71
|
+
...(stableSelect ? {
|
|
72
|
+
select: stableSelect
|
|
66
73
|
} : {})
|
|
67
|
-
}, observer), process.env.NODE_ENV !== "production" ? `list ${type.apiName} ${stableRids ? `[${stableRids.length} rids]` : ""} ${JSON.stringify(
|
|
68
|
-
}, [enabled, observableClient, type, stableRids,
|
|
74
|
+
}, observer), process.env.NODE_ENV !== "production" ? `list ${type.apiName} ${stableRids ? `[${stableRids.length} rids]` : ""} ${JSON.stringify(stableCanonWhere)}` : void 0);
|
|
75
|
+
}, [enabled, observableClient, type.apiName, type.type, stableRids, stableCanonWhere, dedupeIntervalMs, pageSize, stableOrderBy, streamUpdates, stableWithProperties, autoFetchMore, stableIntersectWith, pivotTo, stableSelect]);
|
|
69
76
|
const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
error
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
return React.useMemo(() => {
|
|
78
|
+
let error;
|
|
79
|
+
if (listPayload && "error" in listPayload && listPayload.error) {
|
|
80
|
+
error = listPayload.error;
|
|
81
|
+
} else if (listPayload?.status === "error") {
|
|
82
|
+
error = new Error("Failed to load objects");
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,
|
|
86
|
+
error,
|
|
87
|
+
data: listPayload?.resolvedList,
|
|
88
|
+
isLoading: enabled ? listPayload?.status === "loading" || listPayload?.status === "init" || !listPayload : false,
|
|
89
|
+
isOptimistic: listPayload?.isOptimistic ?? false,
|
|
90
|
+
totalCount: listPayload?.totalCount
|
|
91
|
+
};
|
|
92
|
+
}, [listPayload, enabled]);
|
|
84
93
|
}
|
|
85
94
|
//# sourceMappingURL=useOsdkObjects.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOsdkObjects.js","names":["React","makeExternalStore","OsdkContext2","useOsdkObjects","type","options","observableClient","useContext","pageSize","dedupeIntervalMs","withProperties","enabled","rids","where","orderBy","streamUpdates","autoFetchMore","intersectWith","pivotTo","canonWhere","canonicalizeWhereClause","stableRids","useMemo","JSON","stringify","stableWithProperties","stableIntersectWith","stableOrderBy","subscribe","getSnapShot","unsubscribe","process","env","NODE_ENV","apiName","observer","observeList","dedupeInterval","length","listPayload","useSyncExternalStore","error","status","Error","fetchMore","hasMore","undefined","data","resolvedList","isLoading","isOptimistic","totalCount"],"sources":["useOsdkObjects.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 {\n DerivedProperty,\n LinkedType,\n LinkNames,\n ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { ObserveObjectsCallbackArgs } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\nexport interface UseOsdkObjectsOptions<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Fetch objects by their RIDs (Resource Identifiers).\n * When provided, starts with a static objectset containing these RIDs.\n * Can be combined with `where` to filter the RID set, and with `orderBy` to sort results.\n *\n * @example\n * // Fetch specific objects by RID\n * useOsdkObjects(Employee, { rids: ['ri.foo.123', 'ri.foo.456'] })\n *\n * @example\n * // Fetch specific objects by RID, filtered by status\n * useOsdkObjects(Employee, {\n * rids: ['ri.foo.123', 'ri.foo.456', 'ri.foo.789'],\n * where: { status: 'active' }\n * })\n */\n rids?: readonly string[];\n\n /**\n * Standard OSDK Where clause with RDP support.\n * When used with `rids`, filters the RID set.\n * When used alone, filters all objects of the type.\n */\n where?: WhereClause<T, RDPs>;\n\n /**\n * Sort results by one or more properties.\n */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /**\n * Define derived properties (RDPs) to be computed server-side and attached to each object.\n * These properties will be available on the returned objects alongside their regular properties.\n */\n withProperties?: { [K in keyof RDPs]: DerivedProperty.Creator<T, RDPs[K]> };\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkObjects` with the same parameters will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute. It will still\n * return any cached data, but will not fetch from the server.\n *\n * @default true\n */\n enabled?: boolean;\n\n /**\n * Intersect the results with additional object sets.\n * Each element defines a where clause for an object set to intersect with.\n * The final result will only include objects that match ALL conditions.\n */\n intersectWith?: Array<{\n where: WhereClause<T, RDPs>;\n }>;\n\n /**\n * Pivot to related objects through a link.\n * This changes the return type from T to the linked object type.\n */\n pivotTo?: LinkNames<T>;\n\n /**\n * Causes the list to automatically fetch more as soon as the previous page\n * has been loaded. If a number is provided, it will continue to automatically\n * fetch more until the list is at least that long.\n *\n * - `true`: Fetch all available pages automatically\n * - `number`: Fetch pages until at least this many items are loaded\n * - `undefined` (default): Only fetch the first page, user must call fetchMore()\n */\n autoFetchMore?: boolean | number;\n\n streamUpdates?: boolean;\n}\n\nexport interface UseOsdkListResult<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Function to fetch more pages (undefined if no more pages)\n */\n fetchMore: (() => Promise<void>) | undefined;\n\n /**\n * The fetched data with derived properties\n */\n data:\n | Osdk.Instance<T, \"$allBaseProperties\", PropertyKeys<T>, RDPs>[]\n | undefined;\n\n /**\n * Whether data is currently being loaded\n */\n isLoading: boolean;\n\n /**\n * Any error that occurred during fetching\n */\n error: Error | undefined;\n\n /**\n * Refers to whether the ordered list of objects (only considering the $primaryKey)\n * is optimistic or not.\n *\n * If you need to know if the contents of the list are optimistic you can\n * do that on a per object basis with useOsdkObject\n */\n isOptimistic: boolean;\n\n /**\n * The total count of objects matching the query (if available from the API)\n */\n totalCount?: string;\n}\n\ndeclare const process: {\n env: {\n NODE_ENV: \"development\" | \"production\";\n };\n};\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q> & { pivotTo: L },\n): UseOsdkListResult<LinkedType<Q, L>>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, RDPs>,\n): UseOsdkListResult<Q, RDPs>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, RDPs>,\n):\n | UseOsdkListResult<Q, RDPs>\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>>\n{\n const { observableClient } = React.useContext(OsdkContext2);\n\n const {\n pageSize,\n dedupeIntervalMs,\n withProperties,\n enabled = true,\n rids,\n where,\n orderBy,\n streamUpdates,\n autoFetchMore,\n intersectWith,\n pivotTo,\n } = options ?? {};\n\n const canonWhere = observableClient.canonicalizeWhereClause<\n Q,\n RDPs\n >(where ?? {});\n\n const stableRids = React.useMemo(\n () => rids,\n [JSON.stringify(rids)],\n );\n\n const stableWithProperties = React.useMemo(\n () => withProperties,\n [JSON.stringify(withProperties)],\n );\n\n const stableIntersectWith = React.useMemo(\n () => intersectWith,\n [JSON.stringify(intersectWith)],\n );\n\n const stableOrderBy = React.useMemo(\n () => orderBy,\n [JSON.stringify(orderBy)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<\n ObserveObjectsCallbackArgs<Q, RDPs>\n >(\n () => ({ unsubscribe: () => {} }),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} [DISABLED]`\n : void 0,\n );\n }\n\n return makeExternalStore<\n ObserveObjectsCallbackArgs<Q, RDPs>\n >(\n (observer) =>\n observableClient.observeList({\n type,\n rids: stableRids,\n where: canonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy: stableOrderBy,\n streamUpdates,\n withProperties: stableWithProperties,\n autoFetchMore,\n ...(stableIntersectWith\n ? { intersectWith: stableIntersectWith }\n : {}),\n ...(pivotTo ? { pivotTo } : {}),\n }, observer),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} ${\n stableRids ? `[${stableRids.length} rids]` : \"\"\n } ${JSON.stringify(canonWhere)}`\n : void 0,\n );\n },\n [\n enabled,\n observableClient,\n type,\n stableRids,\n canonWhere,\n dedupeIntervalMs,\n pageSize,\n stableOrderBy,\n streamUpdates,\n stableWithProperties,\n autoFetchMore,\n stableIntersectWith,\n pivotTo,\n ],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n let error: Error | undefined;\n if (listPayload && \"error\" in listPayload && listPayload.error) {\n error = listPayload.error;\n } else if (listPayload?.status === \"error\") {\n error = new Error(\"Failed to load objects\");\n }\n\n return {\n fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,\n error,\n data: listPayload?.resolvedList,\n isLoading: enabled\n ? (listPayload?.status === \"loading\" || listPayload?.status === \"init\"\n || !listPayload)\n : false,\n isOptimistic: listPayload?.isOptimistic ?? false,\n totalCount: listPayload?.totalCount,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;AA+JhD,OAAO,SAASC,cAAcA,CAI5BC,IAAO,EACPC,OAAwC,EAI1C;EACE,MAAM;IAAEC;EAAiB,CAAC,GAAGN,KAAK,CAACO,UAAU,CAACL,YAAY,CAAC;EAE3D,MAAM;IACJM,QAAQ;IACRC,gBAAgB;IAChBC,cAAc;IACdC,OAAO,GAAG,IAAI;IACdC,IAAI;IACJC,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,aAAa;IACbC,aAAa;IACbC;EACF,CAAC,GAAGb,OAAO,IAAI,CAAC,CAAC;EAEjB,MAAMc,UAAU,GAAGb,gBAAgB,CAACc,uBAAuB,CAGzDP,KAAK,IAAI,CAAC,CAAC,CAAC;EAEd,MAAMQ,UAAU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"useOsdkObjects.js","names":["React","makeExternalStore","OsdkContext2","EMPTY_WHERE","useOsdkObjects","type","options","observableClient","useContext","pageSize","dedupeIntervalMs","withProperties","enabled","rids","where","orderBy","streamUpdates","autoFetchMore","intersectWith","pivotTo","$select","canonWhere","canonicalizeWhereClause","stableCanonWhere","useMemo","JSON","stringify","stableRids","stableWithProperties","stableIntersectWith","stableOrderBy","stableSelect","subscribe","getSnapShot","unsubscribe","process","env","NODE_ENV","apiName","observer","observeList","dedupeInterval","select","length","listPayload","useSyncExternalStore","error","status","Error","fetchMore","hasMore","undefined","data","resolvedList","isLoading","isOptimistic","totalCount"],"sources":["useOsdkObjects.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 {\n DerivedProperty,\n LinkedType,\n LinkNames,\n ObjectOrInterfaceDefinition,\n Osdk,\n PropertyKeys,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { ObserveObjectsCallbackArgs } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\nexport interface UseOsdkObjectsOptions<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Fetch objects by their RIDs (Resource Identifiers).\n * When provided, starts with a static objectset containing these RIDs.\n * Can be combined with `where` to filter the RID set, and with `orderBy` to sort results.\n *\n * @example\n * // Fetch specific objects by RID\n * useOsdkObjects(Employee, { rids: ['ri.foo.123', 'ri.foo.456'] })\n *\n * @example\n * // Fetch specific objects by RID, filtered by status\n * useOsdkObjects(Employee, {\n * rids: ['ri.foo.123', 'ri.foo.456', 'ri.foo.789'],\n * where: { status: 'active' }\n * })\n */\n rids?: readonly string[];\n\n /**\n * Standard OSDK Where clause with RDP support.\n * When used with `rids`, filters the RID set.\n * When used alone, filters all objects of the type.\n */\n where?: WhereClause<T, RDPs>;\n\n /**\n * Sort results by one or more properties.\n */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /**\n * Define derived properties (RDPs) to be computed server-side and attached to each object.\n * These properties will be available on the returned objects alongside their regular properties.\n */\n withProperties?: { [K in keyof RDPs]: DerivedProperty.Creator<T, RDPs[K]> };\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkObjects` with the same parameters will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute. It will still\n * return any cached data, but will not fetch from the server.\n *\n * @default true\n */\n enabled?: boolean;\n\n /**\n * Intersect the results with additional object sets.\n * Each element defines a where clause for an object set to intersect with.\n * The final result will only include objects that match ALL conditions.\n */\n intersectWith?: Array<{\n where: WhereClause<T, RDPs>;\n }>;\n\n /**\n * Pivot to related objects through a link.\n * This changes the return type from T to the linked object type.\n */\n pivotTo?: LinkNames<T>;\n\n /**\n * Causes the list to automatically fetch more as soon as the previous page\n * has been loaded. If a number is provided, it will continue to automatically\n * fetch more until the list is at least that long.\n *\n * - `true`: Fetch all available pages automatically\n * - `number`: Fetch pages until at least this many items are loaded\n * - `undefined` (default): Only fetch the first page, user must call fetchMore()\n */\n autoFetchMore?: boolean | number;\n\n streamUpdates?: boolean;\n\n /**\n * Restrict which properties are returned for each object.\n * When provided, only the specified properties will be fetched,\n * reducing payload sizes for list views.\n *\n * @example\n * // Only fetch name and status properties\n * useOsdkObjects(Employee, { $select: [\"name\", \"status\"] })\n */\n $select?: readonly PropertyKeys<T>[];\n}\n\nexport interface UseOsdkListResult<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n EXTRA_OPTIONS extends never | \"$rid\" = never,\n> {\n /**\n * Function to fetch more pages (undefined if no more pages)\n */\n fetchMore: (() => Promise<void>) | undefined;\n\n /**\n * The fetched data with derived properties\n */\n data:\n | Osdk.Instance<\n T,\n \"$allBaseProperties\" | EXTRA_OPTIONS,\n PropertyKeys<T>,\n RDPs\n >[]\n | undefined;\n\n /**\n * Whether data is currently being loaded\n */\n isLoading: boolean;\n\n /**\n * Any error that occurred during fetching\n */\n error: Error | undefined;\n\n /**\n * Refers to whether the ordered list of objects (only considering the $primaryKey)\n * is optimistic or not.\n *\n * If you need to know if the contents of the list are optimistic you can\n * do that on a per object basis with useOsdkObject\n */\n isOptimistic: boolean;\n\n /**\n * The total count of objects matching the query (if available from the API)\n */\n totalCount?: string;\n}\n\nconst EMPTY_WHERE = {};\n\ndeclare const process: {\n env: {\n NODE_ENV: \"development\" | \"production\";\n };\n};\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q> & { pivotTo: L; rids: readonly string[] },\n): UseOsdkListResult<LinkedType<Q, L>, {}, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q> & { pivotTo: L },\n): UseOsdkListResult<LinkedType<Q, L>>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, RDPs> & { rids: readonly string[] },\n): UseOsdkListResult<Q, RDPs, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, RDPs>,\n): UseOsdkListResult<Q, RDPs>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, RDPs>,\n):\n | UseOsdkListResult<Q, RDPs>\n | UseOsdkListResult<Q, RDPs, \"$rid\">\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>>\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>, {}, \"$rid\">\n{\n const { observableClient } = React.useContext(OsdkContext2);\n\n const {\n pageSize,\n dedupeIntervalMs,\n withProperties,\n enabled = true,\n rids,\n where,\n orderBy,\n streamUpdates,\n autoFetchMore,\n intersectWith,\n pivotTo,\n $select,\n } = options ?? {};\n\n const canonWhere = observableClient.canonicalizeWhereClause<\n Q,\n RDPs\n >(where ?? EMPTY_WHERE);\n\n const stableCanonWhere = React.useMemo(\n () => canonWhere,\n [JSON.stringify(canonWhere)],\n );\n\n const stableRids = React.useMemo(\n () => rids,\n [JSON.stringify(rids)],\n );\n\n const stableWithProperties = React.useMemo(\n () => withProperties,\n [JSON.stringify(withProperties)],\n );\n\n const stableIntersectWith = React.useMemo(\n () => intersectWith,\n [JSON.stringify(intersectWith)],\n );\n\n const stableOrderBy = React.useMemo(\n () => orderBy,\n [JSON.stringify(orderBy)],\n );\n\n const stableSelect = React.useMemo(\n () => $select,\n [JSON.stringify($select)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<\n ObserveObjectsCallbackArgs<Q, RDPs>\n >(\n () => ({ unsubscribe: () => {} }),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} [DISABLED]`\n : void 0,\n );\n }\n\n return makeExternalStore<\n ObserveObjectsCallbackArgs<Q, RDPs>\n >(\n (observer) =>\n observableClient.observeList({\n type,\n rids: stableRids,\n where: stableCanonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy: stableOrderBy,\n streamUpdates,\n withProperties: stableWithProperties,\n autoFetchMore,\n ...(stableIntersectWith\n ? { intersectWith: stableIntersectWith }\n : {}),\n ...(pivotTo ? { pivotTo } : {}),\n ...(stableSelect ? { select: stableSelect } : {}),\n }, observer),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} ${\n stableRids ? `[${stableRids.length} rids]` : \"\"\n } ${JSON.stringify(stableCanonWhere)}`\n : void 0,\n );\n },\n [\n enabled,\n observableClient,\n type.apiName,\n type.type,\n stableRids,\n stableCanonWhere,\n dedupeIntervalMs,\n pageSize,\n stableOrderBy,\n streamUpdates,\n stableWithProperties,\n autoFetchMore,\n stableIntersectWith,\n pivotTo,\n stableSelect,\n ],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n return React.useMemo(() => {\n let error: Error | undefined;\n if (listPayload && \"error\" in listPayload && listPayload.error) {\n error = listPayload.error;\n } else if (listPayload?.status === \"error\") {\n error = new Error(\"Failed to load objects\");\n }\n\n return {\n fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,\n error,\n data: listPayload?.resolvedList,\n isLoading: enabled\n ? (listPayload?.status === \"loading\" || listPayload?.status === \"init\"\n || !listPayload)\n : false,\n isOptimistic: listPayload?.isOptimistic ?? false,\n totalCount: listPayload?.totalCount,\n };\n }, [listPayload, enabled]);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;AA0JhD,MAAMC,WAAW,GAAG,CAAC,CAAC;AAwCtB,OAAO,SAASC,cAAcA,CAI5BC,IAAO,EACPC,OAAwC,EAM1C;EACE,MAAM;IAA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Y,CAEhB,CAAC;EAED,MAAMa,WAAW,GAAG5C,KAAK,CAAC6C,oBAAoB,CAACb,SAAS,EAAEC,WAAW,CAAC;EAEtE,OAAOjC,KAAK,CAACwB,OAAO,CAAC,MAAM;IACzB,IAAIsB,KAAwB;IAC5B,IAAIF,WAAW,IAAI,OAAO,IAAIA,WAAW,IAAIA,WAAW,CAACE,KAAK,EAAE;MAC9DA,KAAK,GAAGF,WAAW,CAACE,KAAK;IAC3B,CAAC,MAAM,IAAIF,WAAW,EAAEG,MAAM,KAAK,OAAO,EAAE;MAC1CD,KAAK,GAAG,IAAIE,KAAK,CAAC,wBAAwB,CAAC;IAC7C;IAEA,OAAO;MACLC,SAAS,EAAEL,WAAW,EAAEM,OAAO,GAAGN,WAAW,CAACK,SAAS,GAAGE,SAAS;MACnEL,KAAK;MACLM,IAAI,EAAER,WAAW,EAAES,YAAY;MAC/BC,SAAS,EAAE1C,OAAO,GACbgC,WAAW,EAAEG,MAAM,KAAK,SAAS,IAAIH,WAAW,EAAEG,MAAM,KAAK,MAAM,IACjE,CAACH,WAAW,GACf,KAAK;MACTW,YAAY,EAAEX,WAAW,EAAEW,YAAY,IAAI,KAAK;MAChDC,UAAU,EAAEZ,WAAW,EAAEY;IAC3B,CAAC;EACH,CAAC,EAAE,CAACZ,WAAW,EAAEhC,OAAO,CAAC,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -14,22 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import { Employee } from "@osdk/client.test.ontology";
|
|
23
|
-
import { useOsdkObjects } from "@osdk/react/experimental";
|
|
24
|
-
function TestComponent() {
|
|
25
|
-
const {
|
|
26
|
-
data
|
|
27
|
-
} = useOsdkObjects(Employee, {
|
|
28
|
-
pivotTo: "lead"
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// Line 31: Check that data has the correct pivoted type
|
|
32
|
-
data?.[0];
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=useOsdkObjectsWithPivot.js.map
|
|
17
|
+
export { useCurrentFoundryUser } from "../../new/platform-apis/admin/useCurrentFoundryUser.js";
|
|
18
|
+
export { useFoundryUser } from "../../new/platform-apis/admin/useFoundryUser.js";
|
|
19
|
+
export { useFoundryUsersList } from "../../new/platform-apis/admin/useFoundryUsersList.js";
|
|
20
|
+
//# sourceMappingURL=admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.js","names":["useCurrentFoundryUser","useFoundryUser","useFoundryUsersList"],"sources":["admin.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\nexport { useCurrentFoundryUser } from \"../../new/platform-apis/admin/useCurrentFoundryUser.js\";\nexport { useFoundryUser } from \"../../new/platform-apis/admin/useFoundryUser.js\";\nexport { useFoundryUsersList } from \"../../new/platform-apis/admin/useFoundryUsersList.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,qBAAqB,QAAQ,wDAAwD;AAC9F,SAASC,cAAc,QAAQ,iDAAiD;AAChF,SAASC,mBAAmB,QAAQ,sDAAsD","ignoreList":[]}
|
|
@@ -15,9 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export { OsdkProvider2 } from "../new/OsdkProvider2.js";
|
|
18
|
-
export { useCurrentFoundryUser } from "../new/platform-apis/admin/useCurrentFoundryUser.js";
|
|
19
|
-
export { useFoundryUser } from "../new/platform-apis/admin/useFoundryUser.js";
|
|
20
|
-
export { useFoundryUsersList } from "../new/platform-apis/admin/useFoundryUsersList.js";
|
|
21
18
|
export { useLinks } from "../new/useLinks.js";
|
|
22
19
|
export { useObjectSet } from "../new/useObjectSet.js";
|
|
23
20
|
export { useOsdkAction } from "../new/useOsdkAction.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.js","names":["OsdkProvider2","
|
|
1
|
+
{"version":3,"file":"experimental.js","names":["OsdkProvider2","useLinks","useObjectSet","useOsdkAction","useOsdkAggregation","useOsdkFunction","useOsdkObject","useOsdkObjects","useOsdkClient","useOsdkMetadata","useDebouncedCallback"],"sources":["experimental.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\nexport { OsdkProvider2 } from \"../new/OsdkProvider2.js\";\nexport { useLinks } from \"../new/useLinks.js\";\nexport { useObjectSet } from \"../new/useObjectSet.js\";\nexport { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport type { UseOsdkAggregationResult } from \"../new/useOsdkAggregation.js\";\nexport { useOsdkAggregation } from \"../new/useOsdkAggregation.js\";\nexport type {\n UseOsdkFunctionOptions,\n UseOsdkFunctionResult,\n} from \"../new/useOsdkFunction.js\";\nexport { useOsdkFunction } from \"../new/useOsdkFunction.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport type {\n UseOsdkListResult,\n UseOsdkObjectsOptions,\n} from \"../new/useOsdkObjects.js\";\nexport { useOsdkObjects } from \"../new/useOsdkObjects.js\";\nexport { useOsdkClient } from \"../useOsdkClient.js\";\nexport { useOsdkMetadata } from \"../useOsdkMetadata.js\";\nexport type { UseOsdkMetadataResult } from \"../useOsdkMetadata.js\";\nexport { useDebouncedCallback } from \"../utils/useDebouncedCallback.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,kBAAkB,QAAQ,8BAA8B;AAKjE,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,aAAa,QAAQ,yBAAyB;AAKvD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,SAASC,oBAAoB,QAAQ,kCAAkC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOsdkMetadata.js","names":["React","useOsdkClient","useOsdkMetadata","type","client","metadata","setMetadata","useState","undefined","error","setError","fetchMetadata","then","fetchedMetadata","catch","errorMessage","Error","message","String","loading"],"sources":["useOsdkMetadata.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\nimport React from \"react\";\nimport { useOsdkClient } from \"./useOsdkClient.js\";\n\ntype MetadataFor<T extends
|
|
1
|
+
{"version":3,"file":"useOsdkMetadata.js","names":["React","useOsdkClient","useOsdkMetadata","type","client","metadata","setMetadata","useState","undefined","error","setError","fetchMetadata","then","fetchedMetadata","catch","errorMessage","Error","message","String","loading"],"sources":["useOsdkMetadata.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\nimport React from \"react\";\nimport { useOsdkClient } from \"./useOsdkClient.js\";\n\ntype MetadataFetchableDefinition =\n | ObjectOrInterfaceDefinition\n | ActionDefinition<any>;\n\ntype MetadataFor<T extends MetadataFetchableDefinition> = T extends\n ObjectTypeDefinition ? ObjectMetadata\n : T extends InterfaceDefinition ? InterfaceMetadata\n : T extends ActionDefinition<any> ? ActionMetadata\n : never;\n\nexport interface UseOsdkMetadataResult<T extends MetadataFetchableDefinition> {\n loading: boolean;\n metadata?: MetadataFor<T>;\n error?: string;\n}\n\nexport function useOsdkMetadata<T extends MetadataFetchableDefinition>(\n type: T,\n): UseOsdkMetadataResult<T> {\n const client = useOsdkClient();\n const [metadata, setMetadata] = React.useState<\n MetadataFor<T> | undefined\n >(undefined);\n const [error, setError] = React.useState<UseOsdkMetadataResult<T>[\"error\"]>();\n\n if (!metadata && !error) {\n client.fetchMetadata(type).then((fetchedMetadata) => {\n setMetadata(fetchedMetadata as MetadataFor<T>);\n }).catch((error: unknown) => {\n const errorMessage = error instanceof Error\n ? error.message\n : String(error);\n setError(errorMessage);\n });\n return { loading: true };\n }\n\n return { loading: false, metadata, error };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,oBAAoB;AAkBlD,OAAO,SAASC,eAAeA,CAC7BC,IAAO,EACmB;EAC1B,MAAMC,MAAM,GAAGH,aAAa,CAAC,CAAC;EAC9B,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAE5CC,SAAS,CAAC;EACZ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGV,KAAK,CAACO,QAAQ,CAAoC,CAAC;EAE7E,IAAI,CAACF,QAAQ,IAAI,CAACI,KAAK,EAAE;IACvBL,MAAM,CAACO,aAAa,CAACR,IAAI,CAAC,CAACS,IAAI,CAAEC,eAAe,IAAK;MACnDP,WAAW,CAACO,eAAiC,CAAC;IAChD,CAAC,CAAC,CAACC,KAAK,CAAEL,KAAc,IAAK;MAC3B,MAAMM,YAAY,GAAGN,KAAK,YAAYO,KAAK,GACvCP,KAAK,CAACQ,OAAO,GACbC,MAAM,CAACT,KAAK,CAAC;MACjBC,QAAQ,CAACK,YAAY,CAAC;IACxB,CAAC,CAAC;IACF,OAAO;MAAEI,OAAO,EAAE;IAAK,CAAC;EAC1B;EAEA,OAAO;IAAEA,OAAO,EAAE,KAAK;IAAEd,QAAQ;IAAEI;EAAM,CAAC;AAC5C","ignoreList":[]}
|
|
@@ -8,3 +8,14 @@ export declare function makeExternalStore<X>(createObservation: (callback: Obser
|
|
|
8
8
|
subscribe: (notifyUpdate: () => void) => () => void
|
|
9
9
|
getSnapShot: () => Snapshot<X>
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Like makeExternalStore but for async subscription creation.
|
|
13
|
+
*
|
|
14
|
+
* Uses an isActive flag to handle race conditions:
|
|
15
|
+
* If cleanup runs before promise resolves, the stale subscription is
|
|
16
|
+
* immediately unsubscribed when it eventually resolves
|
|
17
|
+
*/
|
|
18
|
+
export declare function makeExternalStoreAsync<X>(createObservation: (callback: Observer<X | undefined>) => Promise<Unsubscribable>, _name?: string, initialValue?: Snapshot<X>): {
|
|
19
|
+
subscribe: (notifyUpdate: () => void) => () => void
|
|
20
|
+
getSnapShot: () => Snapshot<X>
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,UACA,sBACK,kCAAmC;AAE1C,YAAY,SAAS,KACjB,IAAI;CAAE,QAAQ;AAAO,KACpB,QAAQ,KAAK;CAAE,QAAQ;AAAO;AAGnC,OAAO,iBAAS,kBAAkB,GAChCA,oBAAoBC,UAAU,SAAS,mBAAmB,gBAC1DC,gBACAC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B","names":["createObservation: (callback: Observer<X | undefined>) => Unsubscribable","callback: Observer<X | undefined>","_name?: string","initialValue?: Snapshot<X>","notifyUpdate: () => void"],"sources":["../../../src/new/makeExternalStore.ts"],"version":3,"file":"makeExternalStore.d.ts"}
|
|
1
|
+
{"mappings":"AAgBA,cACE,UACA,sBACK,kCAAmC;AAE1C,YAAY,SAAS,KACjB,IAAI;CAAE,QAAQ;AAAO,KACpB,QAAQ,KAAK;CAAE,QAAQ;AAAO;AAGnC,OAAO,iBAAS,kBAAkB,GAChCA,oBAAoBC,UAAU,SAAS,mBAAmB,gBAC1DC,gBACAC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B;;;;;;;;AAyCD,OAAO,iBAAS,uBAAuB,GACrCC,oBACEJ,UAAU,SAAS,mBAChB,QAAQ,iBACbC,gBACAC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B","names":["createObservation: (callback: Observer<X | undefined>) => Unsubscribable","callback: Observer<X | undefined>","_name?: string","initialValue?: Snapshot<X>","notifyUpdate: () => void","createObservation: (\n callback: Observer<X | undefined>,\n ) => Promise<Unsubscribable>"],"sources":["../../../src/new/makeExternalStore.ts"],"version":3,"file":"makeExternalStore.d.ts"}
|
|
@@ -12,6 +12,12 @@ export interface UseLinksOptions<T extends ObjectOrInterfaceDefinition> {
|
|
|
12
12
|
/** Sorting options for the linked objects */
|
|
13
13
|
orderBy?: { [K in PropertyKeys<T>]? : "asc" | "desc" };
|
|
14
14
|
/**
|
|
15
|
+
* Restrict which properties are returned for each linked object.
|
|
16
|
+
* When provided, only the specified properties will be fetched,
|
|
17
|
+
* reducing payload sizes for list views.
|
|
18
|
+
*/
|
|
19
|
+
$select?: readonly PropertyKeys<T>[];
|
|
20
|
+
/**
|
|
15
21
|
* The mode to use for fetching data.
|
|
16
22
|
* - undefined: Fetch data if not already in cache
|
|
17
23
|
* - "force": Always fetch fresh data
|
|
@@ -19,6 +25,13 @@ export interface UseLinksOptions<T extends ObjectOrInterfaceDefinition> {
|
|
|
19
25
|
*/
|
|
20
26
|
mode?: "force" | "offline";
|
|
21
27
|
/**
|
|
28
|
+
* The number of milliseconds to wait after the last observed link change.
|
|
29
|
+
*
|
|
30
|
+
* Two uses of `useLinks` with the same parameters will only trigger one
|
|
31
|
+
* network request if the second is within `dedupeIntervalMs`.
|
|
32
|
+
*/
|
|
33
|
+
dedupeIntervalMs?: number;
|
|
34
|
+
/**
|
|
22
35
|
* Enable or disable the query.
|
|
23
36
|
*
|
|
24
37
|
* When `false`, the query will not automatically execute. It will still
|
|
@@ -41,6 +54,12 @@ export interface UseLinksOptions<T extends ObjectOrInterfaceDefinition> {
|
|
|
41
54
|
}
|
|
42
55
|
export interface UseLinksResult<Q extends ObjectOrInterfaceDefinition> {
|
|
43
56
|
links: Osdk.Instance<Q>[] | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Maps each source object's primary key to its linked object instances.
|
|
59
|
+
* Useful when observing links from multiple source objects to determine
|
|
60
|
+
* which source links to which targets.
|
|
61
|
+
*/
|
|
62
|
+
linkedObjectsBySourcePrimaryKey: ReadonlyMap<string | number, ReadonlyArray<Osdk.Instance<Q>>>;
|
|
44
63
|
isLoading: boolean;
|
|
45
64
|
error: Error | undefined;
|
|
46
65
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,YACA,WACA,mCACK,WAAY;AACnB,cAAc,MAAM,cAAc,mBAAmB,cAAe;AAMpE,iBAAiB,gBACf,UAAU,6BACV;;;;CAIA,QAAQ,YAAY;;;;CAKpB;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;;;
|
|
1
|
+
{"mappings":"AAgBA,cACE,YACA,WACA,mCACK,WAAY;AACnB,cAAc,MAAM,cAAc,mBAAmB,cAAe;AAMpE,iBAAiB,gBACf,UAAU,6BACV;;;;CAIA,QAAQ,YAAY;;;;CAKpB;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;;CAQnC,mBAAmB,aAAa;;;;;;;CAQhC,OAAO,UAAU;;;;;;;CAQjB;;;;;;;;;;;;;;;;;;;;CAqBA;AACD;AAED,iBAAiB,eACf,UAAU,6BACV;CACA,OAAO,KAAK,SAAS;;;;;;CAOrB,iCAAiC,6BAE/B,cAAc,KAAK,SAAS;CAG9B;CACA,OAAO;;;;CAKP;;;;CAKA,kBAAkB;;;;CAKlB;AACD;;;;;;;;;AAaD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,SAAS,KAAK,SAAS,KAAK,MAAM,KAAK,SAAS,iBAChDC,UAAU,GACVC,UAAS,gBAAgB,WAAW,GAAG,MACtC,eAAe,WAAW,GAAG","names":["objects: Osdk.Instance<T> | Array<Osdk.Instance<T>> | undefined","linkName: L","options: UseLinksOptions<LinkedType<T, L>>"],"sources":["../../../src/new/useLinks.ts"],"version":3,"file":"useLinks.d.ts"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DerivedProperty, LinkNames,
|
|
1
|
+
import type { DerivedProperty, LinkNames, ObjectOrInterfaceDefinition, ObjectSet, Osdk, PropertyKeys, SimplePropertyDef, WhereClause } from "@osdk/api";
|
|
2
2
|
export interface UseObjectSetOptions<
|
|
3
|
-
Q extends
|
|
3
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
4
4
|
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
5
5
|
> {
|
|
6
6
|
/**
|
|
@@ -56,6 +56,12 @@ export interface UseObjectSetOptions<
|
|
|
56
56
|
*/
|
|
57
57
|
streamUpdates?: boolean;
|
|
58
58
|
/**
|
|
59
|
+
* Restrict which properties are returned for each object.
|
|
60
|
+
* When provided, only the specified properties will be fetched,
|
|
61
|
+
* reducing payload sizes for list views.
|
|
62
|
+
*/
|
|
63
|
+
$select?: readonly PropertyKeys<Q>[];
|
|
64
|
+
/**
|
|
59
65
|
* Enable or disable the query.
|
|
60
66
|
*
|
|
61
67
|
* When `false`, the query will not automatically execute. It will still
|
|
@@ -77,7 +83,7 @@ export interface UseObjectSetOptions<
|
|
|
77
83
|
enabled?: boolean;
|
|
78
84
|
}
|
|
79
85
|
export interface UseObjectSetResult<
|
|
80
|
-
Q extends
|
|
86
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
81
87
|
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
82
88
|
> {
|
|
83
89
|
/**
|
|
@@ -117,7 +123,7 @@ export interface UseObjectSetResult<
|
|
|
117
123
|
* @returns Object set data with both existing and new derived properties
|
|
118
124
|
*/
|
|
119
125
|
export declare function useObjectSet<
|
|
120
|
-
Q extends
|
|
126
|
+
Q extends ObjectOrInterfaceDefinition,
|
|
121
127
|
BaseRDPs extends Record<string, SimplePropertyDef> = never,
|
|
122
128
|
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
123
129
|
>(baseObjectSet: ObjectSet<Q, BaseRDPs>, options?: UseObjectSetOptions<Q, RDPs>): UseObjectSetResult<Q, RDPs>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,iBACA,WACA,WACA,
|
|
1
|
+
{"mappings":"AAgBA,cACE,iBACA,WACA,6BACA,WACA,MACA,cACA,mBACA,mBACK,WAAY;AAUnB,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,QAAQ,YAAY,GAAG;;;;CAKvB,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;CAKtE,QAAQ,UAAU;;;;CAKlB,YAAY,UAAU;;;;CAKtB,WAAW,UAAU;;;;CAKrB,UAAU,UAAU;;;;CAKpB;;;;CAKA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;CAMnC;;;;;;;;CASA;;;;;;;;CASA;;;;;;CAOA,mBAAmB,aAAa;;;;;;;;;;;;;;;;;;;;CAqBhC;AACD;AAED,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,MACI,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;;;;CAM5D;;;;CAKA,OAAO;;;;CAKP,kBAAkB;;;;CAKlB,WAAW,UAAU,GAAG;;;;CAKxB;AACD;;;;;;;;;;;;AAoBD,OAAO,iBAAS;CACd,UAAU;CACV,iBAAiB,eAAe;CAChC,aAAa,eAAe,qBAAqB,CAAE;EAEnDA,eAAe,UAAU,GAAG,WAC5BC,UAAS,oBAAoB,GAAG,QAC/B,mBAAmB,GAAG","names":["baseObjectSet: ObjectSet<Q, BaseRDPs>","options: UseObjectSetOptions<Q, RDPs>"],"sources":["../../../src/new/useObjectSet.tsx"],"version":3,"file":"useObjectSet.d.ts"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { AggregateOpts, AggregationsResults, DerivedProperty, ObjectOrInterfaceDefinition, SimplePropertyDef, WhereClause } from "@osdk/api";
|
|
2
|
-
|
|
1
|
+
import type { AggregateOpts, AggregationsResults, DerivedProperty, ObjectOrInterfaceDefinition, ObjectSet, SimplePropertyDef, WhereClause } from "@osdk/api";
|
|
2
|
+
import type { ObjectTypeDefinition } from "@osdk/client";
|
|
3
|
+
interface UseOsdkAggregationBaseOptions<
|
|
3
4
|
T extends ObjectOrInterfaceDefinition,
|
|
4
5
|
A extends AggregateOpts<T>,
|
|
5
6
|
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
@@ -14,6 +15,14 @@ export interface UseOsdkAggregationOptions<
|
|
|
14
15
|
*/
|
|
15
16
|
withProperties?: { [K in keyof RDPs] : DerivedProperty.Creator<T, RDPs[K]> };
|
|
16
17
|
/**
|
|
18
|
+
* Intersect the main query with additional filtered object sets.
|
|
19
|
+
* Each entry creates a separate object set with its own where clause,
|
|
20
|
+
* and the final result is the intersection of all sets.
|
|
21
|
+
*/
|
|
22
|
+
intersectWith?: Array<{
|
|
23
|
+
where: WhereClause<T, RDPs>
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
17
26
|
* Aggregation options including groupBy and select
|
|
18
27
|
*/
|
|
19
28
|
aggregate: A;
|
|
@@ -25,6 +34,21 @@ export interface UseOsdkAggregationOptions<
|
|
|
25
34
|
*/
|
|
26
35
|
dedupeIntervalMs?: number;
|
|
27
36
|
}
|
|
37
|
+
export interface UseOsdkAggregationOptions<
|
|
38
|
+
T extends ObjectOrInterfaceDefinition,
|
|
39
|
+
A extends AggregateOpts<T>,
|
|
40
|
+
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
41
|
+
> extends UseOsdkAggregationBaseOptions<T, A, RDPs> {}
|
|
42
|
+
export interface UseOsdkAggregationOptionsWithObjectSet<
|
|
43
|
+
T extends ObjectTypeDefinition,
|
|
44
|
+
A extends AggregateOpts<T>,
|
|
45
|
+
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
46
|
+
> extends UseOsdkAggregationBaseOptions<T, A, RDPs> {
|
|
47
|
+
/**
|
|
48
|
+
* The ObjectSet to aggregate on. Enables aggregation on pivoted, filtered, or composed ObjectSets.
|
|
49
|
+
*/
|
|
50
|
+
objectSet: ObjectSet<T>;
|
|
51
|
+
}
|
|
28
52
|
export interface UseOsdkAggregationResult<
|
|
29
53
|
T extends ObjectOrInterfaceDefinition,
|
|
30
54
|
A extends AggregateOpts<T>
|
|
@@ -46,6 +70,7 @@ export interface UseOsdkAggregationResult<
|
|
|
46
70
|
*
|
|
47
71
|
* @example
|
|
48
72
|
* ```tsx
|
|
73
|
+
* // Basic aggregation without ObjectSet
|
|
49
74
|
* const { data, isLoading, error } = useOsdkAggregation(Employee, {
|
|
50
75
|
* where: { department: "Engineering" },
|
|
51
76
|
* aggregate: {
|
|
@@ -56,10 +81,23 @@ export interface UseOsdkAggregationResult<
|
|
|
56
81
|
* }
|
|
57
82
|
* }
|
|
58
83
|
* });
|
|
84
|
+
*
|
|
85
|
+
* // With a pivoted ObjectSet
|
|
86
|
+
* const pivotedSet = useMemo(() => $(Employee).pivotTo("primaryOffice"), []);
|
|
87
|
+
* const { data } = useOsdkAggregation(Office, {
|
|
88
|
+
* objectSet: pivotedSet,
|
|
89
|
+
* aggregate: { $select: { $count: "unordered" } }
|
|
90
|
+
* });
|
|
59
91
|
* ```
|
|
60
92
|
*/
|
|
61
93
|
export declare function useOsdkAggregation<
|
|
62
94
|
Q extends ObjectOrInterfaceDefinition,
|
|
63
95
|
const A extends AggregateOpts<Q>,
|
|
64
96
|
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
65
|
-
>(type: Q,
|
|
97
|
+
>(type: Q, options: UseOsdkAggregationOptions<Q, A, RDPs>): UseOsdkAggregationResult<Q, A>;
|
|
98
|
+
export declare function useOsdkAggregation<
|
|
99
|
+
Q extends ObjectTypeDefinition,
|
|
100
|
+
const A extends AggregateOpts<Q>,
|
|
101
|
+
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
102
|
+
>(type: Q, options: UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>): UseOsdkAggregationResult<Q, A>;
|
|
103
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,eACA,qBACA,iBACA,6BACA,mBACA,mBACK,WAAY;
|
|
1
|
+
{"mappings":"AAgBA,cACE,eACA,qBACA,iBACA,6BACA,WACA,mBACA,mBACK,WAAY;AACnB,cAAc,4BAA4B,cAAe;UAU/C;CACR,UAAU;CACV,UAAU,cAAc;CACxB,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,QAAQ,YAAY,GAAG;;;;;CAMvB,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;;;CAOtE,gBAAgB,MAAM;EACpB,OAAO,YAAY,GAAG;CACvB;;;;CAKD,WAAW;;;;;;;CAQX;AACD;AAED,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;CACxB,aAAa,eAAe,qBAAqB,CAAE;UAC3C,8BAA8B,GAAG,GAAG,MAAM,CAAE;AAEtD,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;CACxB,aAAa,eAAe,qBAAqB,CAAE;UAC3C,8BAA8B,GAAG,GAAG,MAAM;;;;CAIlD,WAAW,UAAU;AACtB;AAID,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;EACxB;CACA,MAAM,oBAAoB,GAAG;CAC7B;CACA,OAAO;CACP;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCD,OAAO,iBAAS;CACd,UAAU;OACJ,UAAU,cAAc;CAC9B,aAAa,eAAe,qBAAqB,CAAE;EAEnDA,MAAM,GACNC,SAAS,0BAA0B,GAAG,GAAG,QACxC,yBAAyB,GAAG;AAC/B,OAAO,iBAAS;CACd,UAAU;OACJ,UAAU,cAAc;CAC9B,aAAa,eAAe,qBAAqB,CAAE;EAEnDD,MAAM,GACNE,SAAS,uCAAuC,GAAG,GAAG,QACrD,yBAAyB,GAAG","names":["type: Q","options: UseOsdkAggregationOptions<Q, A, RDPs>","options: UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>"],"sources":["../../../src/new/useOsdkAggregation.ts"],"version":3,"file":"useOsdkAggregation.d.ts"}
|