@osdk/react 0.9.3 → 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 +109 -51
- 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 +6 -3
- 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 +36 -17
- 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 +217 -478
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.d.cts +88 -127
- 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 +6 -3
- 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 +36 -17
- 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 +6 -0
- 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 +12 -1
- package/build/types/new/useOsdkObject.d.ts.map +1 -1
- package/build/types/new/useOsdkObjects.d.ts +10 -0
- 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.helpers/useOsdkObjectsWithRids.js +0 -37
- package/build/browser/intellisense.test.helpers/useOsdkObjectsWithRids.js.map +0 -1
- package/build/browser/intellisense.test.js +0 -172
- 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.helpers/useOsdkObjectsWithRids.js +0 -37
- package/build/esm/intellisense.test.helpers/useOsdkObjectsWithRids.js.map +0 -1
- package/build/esm/intellisense.test.js +0 -172
- 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
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithRids.d.ts +0 -1
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithRids.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/usePlatformQuery.ts","../../../../src/new/platform-apis/admin/useCurrentFoundryUser.ts","../../../../src/new/platform-apis/admin/useFoundryUser.ts","../../../../src/new/platform-apis/admin/useFoundryUsersList.ts"],"names":["React","makeExternalStore","OsdkContext2","Users"],"mappings":";;;;;;;;;;AAkBO,SAAS,gBAAiB,CAAA;AAAA,EAC/B,KAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAU,GAAA;AACZ,CAAG,EAAA;AACD,EAAM,MAAA,WAAA,GAAcA,uBAAM,MAAO,EAAA;AACjC,EAAM,MAAA,WAAA,GAAcA,sBAAM,CAAA,WAAA,CAAY,MAAM;AAC1C,IAAA,MAAM,WAAW,WAAY,CAAA,OAAA;AAC7B,IAAA,IAAI,YAAY,IAAM,EAAA;AACtB,IAAA,QAAA,CAAS,IAAK,CAAA;AAAA,MACZ,MAAQ,EAAA,SAAA;AAAA,MACR,IAAM,EAAA;AAAA,KACP,CAAA;AACD,IAAM,KAAA,EAAA,CAAE,KAAK,CAAQ,IAAA,KAAA;AACnB,MAAA,QAAA,CAAS,IAAK,CAAA;AAAA,QACZ,MAAQ,EAAA,SAAA;AAAA,QACR;AAAA,OACD,CAAA;AAAA,KACF,CAAE,CAAA,KAAA,CAAM,CAAO,GAAA,KAAA;AACd,MAAA,QAAA,CAAS,MAAM,GAAG,CAAA;AAAA,KACnB,CAAA;AAAA,GACH,EAAG,CAAC,KAAK,CAAC,CAAA;AACV,EAAM,MAAA;AAAA,IACJ,SAAA;AAAA,IACA;AAAA,GACF,GAAIA,sBAAM,CAAA,OAAA,CAAQ,MAAM;AACtB,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAA,OAAOC,oCAAkB,OAAO;AAAA,QAC9B,aAAa,MAAM;AAAA;AAAC,OACtB,CAAA,EAAI,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EAAM,MAAA;AAAA,IACJ;AAAA,GACF,GAAIH,sBAAM,CAAA,UAAA,CAAWE,8BAAY,CAAA;AACjC,EAAM,MAAA,WAAA,GAAcF,sBAAM,CAAA,WAAA,CAAY,MAAM;AAC1C,IAAOG,OAAAA,mBAAAA,CAAM,KAAK,MAAQ,EAAA;AAAA,MACxB,OAAA;AAAA,MACA,QAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA,KACA,CAAC,MAAA,EAAQ,OAAS,EAAA,QAAA,EAAU,SAAS,CAAC,CAAA;AACzC,EAAA,MAAM,QAAQ,gBAAiB,CAAA;AAAA,IAC7B,KAAO,EAAA,WAAA;AAAA,IACP,OAAA;AAAA,IACA,SAAW,EAAA;AAAA,GACZ,CAAA;AACD,EAAO,OAAA;AAAA,IACL,KAAA,EAAO,MAAM,IAAM,EAAA,IAAA;AAAA,IACnB,aAAA,EAAe,MAAM,IAAM,EAAA,aAAA;AAAA,IAC3B,WAAW,KAAM,CAAA,SAAA;AAAA,IACjB,OAAO,KAAM,CAAA,KAAA;AAAA,IACb,SAAS,KAAM,CAAA;AAAA,GACjB;AACF","file":"admin.cjs","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 React from \"react\";\nimport { makeExternalStore } from \"../new/makeExternalStore.js\";\nexport function usePlatformQuery({\n query,\n queryName,\n enabled = true\n}) {\n const observerRef = React.useRef();\n const handleQuery = React.useCallback(() => {\n const observer = observerRef.current;\n if (observer == null) return;\n observer.next({\n status: \"loading\",\n data: undefined\n });\n query().then(data => {\n observer.next({\n status: \"success\",\n data\n });\n }).catch(err => {\n observer.error(err);\n });\n }, [query]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `${queryName} Query [DISABLED]` : undefined);\n }\n return makeExternalStore(observer => {\n observerRef.current = observer;\n handleQuery();\n return {\n unsubscribe: () => {\n observerRef.current = undefined;\n }\n };\n }, queryName);\n }, [enabled, queryName, handleQuery]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n let error;\n if (payload && \"error\" in payload && payload.error != null) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(`Failed to query platform API: ${queryName}`);\n }\n return {\n data: payload?.data,\n isLoading: enabled ? payload?.status === \"loading\" || !payload : false,\n error,\n refetch: handleQuery\n };\n}","/*\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 { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Get the currently signed in User.\n * @param options Options to control the query.\n */\nexport function useCurrentFoundryUser({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => Users.getCurrent(client), [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-current-user\"\n });\n return {\n currentUser: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\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 { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Get the User with the specified id.\n * @param userId A Foundry User ID.\n * @param options Options to control the query.\n */\nexport function useFoundryUser(userId, {\n enabled = true,\n status = \"ACTIVE\"\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => {\n return Users.get(client, userId, {\n status\n });\n }, [client, userId, status]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-user\"\n });\n return {\n user: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\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 { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Lists all Users. This is a paged endpoint. Each page may be smaller or larger than the requested page size.\n * @param options Options to control the query.\n */\nexport function useFoundryUsersList({\n enabled = true,\n include = \"ACTIVE\",\n pageSize = 1000,\n pageToken\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => {\n return Users.list(client, {\n include,\n pageSize,\n pageToken\n });\n }, [client, include, pageSize, pageToken]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-users-list\"\n });\n return {\n users: query.data?.data,\n nextPageToken: query.data?.nextPageToken,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}"]}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { User, ListUsersResponse } from '@osdk/foundry.admin';
|
|
2
|
+
import { UserStatus } from '@osdk/foundry.core';
|
|
3
|
+
|
|
4
|
+
interface UseCurrentFoundryUserOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Enable or disable the query.
|
|
7
|
+
*
|
|
8
|
+
* When `false`, the query will not automatically execute.
|
|
9
|
+
*
|
|
10
|
+
* This is useful for:
|
|
11
|
+
* - Lazy/on-demand queries that should wait for user interaction
|
|
12
|
+
* - Dependent queries that need data from another query first
|
|
13
|
+
* - Conditional queries based on component state
|
|
14
|
+
*
|
|
15
|
+
* @default true
|
|
16
|
+
* });
|
|
17
|
+
*/
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface UseCurrentFoundryUserResult {
|
|
21
|
+
currentUser: User | undefined;
|
|
22
|
+
isLoading: boolean;
|
|
23
|
+
error: Error | undefined;
|
|
24
|
+
refetch: () => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the currently signed in User.
|
|
28
|
+
* @param options Options to control the query.
|
|
29
|
+
*/
|
|
30
|
+
declare function useCurrentFoundryUser({ enabled }?: UseCurrentFoundryUserOptions): UseCurrentFoundryUserResult;
|
|
31
|
+
|
|
32
|
+
interface UseFoundryUserOptions {
|
|
33
|
+
/**
|
|
34
|
+
* Enable or disable the query.
|
|
35
|
+
*
|
|
36
|
+
* When `false`, the query will not automatically execute.
|
|
37
|
+
*
|
|
38
|
+
* This is useful for:
|
|
39
|
+
* - Lazy/on-demand queries that should wait for user interaction
|
|
40
|
+
* - Dependent queries that need data from another query first
|
|
41
|
+
* - Conditional queries based on component state
|
|
42
|
+
*
|
|
43
|
+
* @default true
|
|
44
|
+
* });
|
|
45
|
+
*/
|
|
46
|
+
enabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The default status of the users returned in the list.
|
|
49
|
+
*
|
|
50
|
+
* @default "ACTIVE"
|
|
51
|
+
*/
|
|
52
|
+
status?: UserStatus;
|
|
53
|
+
}
|
|
54
|
+
interface UseFoundryUserResult {
|
|
55
|
+
user: User | undefined;
|
|
56
|
+
isLoading: boolean;
|
|
57
|
+
error: Error | undefined;
|
|
58
|
+
refetch: () => void;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get the User with the specified id.
|
|
62
|
+
* @param userId A Foundry User ID.
|
|
63
|
+
* @param options Options to control the query.
|
|
64
|
+
*/
|
|
65
|
+
declare function useFoundryUser(userId: string, { enabled, status }?: UseFoundryUserOptions): UseFoundryUserResult;
|
|
66
|
+
|
|
67
|
+
interface UseFoundryUsersListOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Enable or disable the query.
|
|
70
|
+
*
|
|
71
|
+
* When `false`, the query will not automatically execute.
|
|
72
|
+
*
|
|
73
|
+
* This is useful for:
|
|
74
|
+
* - Lazy/on-demand queries that should wait for user interaction
|
|
75
|
+
* - Dependent queries that need data from another query first
|
|
76
|
+
* - Conditional queries based on component state
|
|
77
|
+
*
|
|
78
|
+
* @default true
|
|
79
|
+
* });
|
|
80
|
+
*/
|
|
81
|
+
enabled?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* The default status of the users returned in the list.
|
|
84
|
+
*
|
|
85
|
+
* @default "ACTIVE"
|
|
86
|
+
*/
|
|
87
|
+
include?: UserStatus;
|
|
88
|
+
/**
|
|
89
|
+
* The preferred page size for the list.
|
|
90
|
+
*
|
|
91
|
+
* @default 1000
|
|
92
|
+
*/
|
|
93
|
+
pageSize?: number;
|
|
94
|
+
/**
|
|
95
|
+
* The page token indicates where to start paging. This should be omitted from the first page's request.
|
|
96
|
+
* To fetch the next page, clients should take the value from the nextPageToken field of the previous
|
|
97
|
+
* response and use it to populate the pageToken field of the next request.
|
|
98
|
+
*/
|
|
99
|
+
pageToken?: string;
|
|
100
|
+
}
|
|
101
|
+
interface UseFoundryUsersListResult {
|
|
102
|
+
users: ListUsersResponse["data"] | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* The page token to be used for the next page of users. If this is undefined, there are no more
|
|
105
|
+
* pages of users to load.
|
|
106
|
+
*/
|
|
107
|
+
nextPageToken: string | undefined;
|
|
108
|
+
isLoading: boolean;
|
|
109
|
+
error: Error | undefined;
|
|
110
|
+
refetch: () => void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Lists all Users. This is a paged endpoint. Each page may be smaller or larger than the requested page size.
|
|
114
|
+
* @param options Options to control the query.
|
|
115
|
+
*/
|
|
116
|
+
declare function useFoundryUsersList({ enabled, include, pageSize, pageToken }?: UseFoundryUsersListOptions): UseFoundryUsersListResult;
|
|
117
|
+
|
|
118
|
+
export { useCurrentFoundryUser, useFoundryUser, useFoundryUsersList };
|