@osdk/react 0.4.0-beta.2 → 0.4.0-beta.4

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/build/browser/new/OsdkContext2.js +1 -1
  3. package/build/browser/new/OsdkContext2.js.map +1 -1
  4. package/build/browser/new/OsdkProvider2.js +5 -3
  5. package/build/browser/new/OsdkProvider2.js.map +1 -1
  6. package/build/browser/new/makeExternalStore.js +13 -3
  7. package/build/browser/new/makeExternalStore.js.map +1 -1
  8. package/build/browser/new/useOsdkAction.js +3 -3
  9. package/build/browser/new/useOsdkAction.js.map +1 -1
  10. package/build/browser/new/useOsdkObject.js +5 -4
  11. package/build/browser/new/useOsdkObject.js.map +1 -1
  12. package/build/browser/new/{useOsdkList.js → useOsdkObjects.js} +11 -10
  13. package/build/browser/new/useOsdkObjects.js.map +1 -0
  14. package/build/browser/public/experimental.js +1 -1
  15. package/build/browser/public/experimental.js.map +1 -1
  16. package/build/cjs/public/experimental.cjs +57 -43
  17. package/build/cjs/public/experimental.cjs.map +1 -1
  18. package/build/cjs/public/experimental.d.cts +33 -32
  19. package/build/esm/new/OsdkContext2.js +1 -1
  20. package/build/esm/new/OsdkContext2.js.map +1 -1
  21. package/build/esm/new/OsdkProvider2.js +5 -3
  22. package/build/esm/new/OsdkProvider2.js.map +1 -1
  23. package/build/esm/new/makeExternalStore.js +13 -3
  24. package/build/esm/new/makeExternalStore.js.map +1 -1
  25. package/build/esm/new/useOsdkAction.js +3 -3
  26. package/build/esm/new/useOsdkAction.js.map +1 -1
  27. package/build/esm/new/useOsdkObject.js +5 -4
  28. package/build/esm/new/useOsdkObject.js.map +1 -1
  29. package/build/esm/new/{useOsdkList.js → useOsdkObjects.js} +11 -10
  30. package/build/esm/new/useOsdkObjects.js.map +1 -0
  31. package/build/esm/public/experimental.js +1 -1
  32. package/build/esm/public/experimental.js.map +1 -1
  33. package/build/types/new/OsdkContext2.d.ts +1 -1
  34. package/build/types/new/OsdkContext2.d.ts.map +1 -1
  35. package/build/types/new/OsdkProvider2.d.ts +3 -3
  36. package/build/types/new/OsdkProvider2.d.ts.map +1 -1
  37. package/build/types/new/makeExternalStore.d.ts +6 -3
  38. package/build/types/new/makeExternalStore.d.ts.map +1 -1
  39. package/build/types/new/useOsdkObject.d.ts +1 -0
  40. package/build/types/new/useOsdkObject.d.ts.map +1 -1
  41. package/build/types/new/{useOsdkList.d.ts → useOsdkObjects.d.ts} +7 -7
  42. package/build/types/new/useOsdkObjects.d.ts.map +1 -0
  43. package/build/types/public/experimental.d.ts +1 -1
  44. package/build/types/public/experimental.d.ts.map +1 -1
  45. package/package.json +3 -3
  46. package/build/browser/new/useOsdkList.js.map +0 -1
  47. package/build/esm/new/useOsdkList.js.map +0 -1
  48. package/build/types/new/useOsdkList.d.ts.map +0 -1
@@ -1,15 +1,15 @@
1
- import { Client, ActionDefinition, ActionValidationError, ObjectTypeDefinition, WhereClause, PropertyKeys, Osdk } from '@osdk/client';
1
+ import { Client, ActionDefinition, ActionValidationError, ObjectTypeDefinition as ObjectTypeDefinition$1, InterfaceDefinition, WhereClause, PropertyKeys, Osdk as Osdk$1 } from '@osdk/client';
2
2
  import { ObservableClient, ActionSignatureFromDef } from '@osdk/client/unstable-do-not-use';
3
3
  import React from 'react';
4
- import { ObjectTypeDefinition as ObjectTypeDefinition$1, Osdk as Osdk$1, PrimaryKeyType } from '@osdk/api';
4
+ import { ObjectTypeDefinition, Osdk, PrimaryKeyType } from '@osdk/api';
5
5
  export { u as useOsdkClient } from '../useOsdkClient-B4iwHO1H.cjs';
6
6
 
7
7
  interface OsdkProviderOptions {
8
8
  children: React.ReactNode;
9
9
  client: Client;
10
- store: ObservableClient;
10
+ observableClient?: ObservableClient;
11
11
  }
12
- declare function OsdkProvider2({ children, client, store, }: OsdkProviderOptions): React.JSX.Element;
12
+ declare function OsdkProvider2({ children, client, observableClient, }: OsdkProviderOptions): React.JSX.Element;
13
13
 
14
14
  type ApplyActionParams<Q extends ActionDefinition<any>> = Parameters<ActionSignatureFromDef<Q>["applyAction"]>[0] & {
15
15
  [K in keyof ObservableClient.ApplyActionOptions as `$${K}`]: ObservableClient.ApplyActionOptions[K];
@@ -25,7 +25,29 @@ interface UseOsdkActionResult<Q extends ActionDefinition<any>> {
25
25
  }
26
26
  declare function useOsdkAction<Q extends ActionDefinition<any>>(actionDef: Q): UseOsdkActionResult<Q>;
27
27
 
28
- interface UseOsdkListOptions<T extends ObjectTypeDefinition> {
28
+ interface UseOsdkObjectResult<Q extends ObjectTypeDefinition> {
29
+ object: Osdk.Instance<Q> | undefined;
30
+ isLoading: boolean;
31
+ error: Error | undefined;
32
+ /**
33
+ * Refers to whether the object is optimistic or not.
34
+ */
35
+ isOptimistic: boolean;
36
+ forceUpdate: () => void;
37
+ }
38
+ /**
39
+ * @param obj an existing `Osdk.Instance` object to get metadata for.
40
+ */
41
+ declare function useOsdkObject<Q extends ObjectTypeDefinition>(obj: Osdk.Instance<Q>): UseOsdkObjectResult<Q>;
42
+ /**
43
+ * Loads an object by type and primary key.
44
+ *
45
+ * @param type
46
+ * @param primaryKey
47
+ */
48
+ declare function useOsdkObject<Q extends ObjectTypeDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>): UseOsdkObjectResult<Q>;
49
+
50
+ interface UseOsdkObjectsOptions<T extends ObjectTypeDefinition$1 | InterfaceDefinition> {
29
51
  /**
30
52
  * Standard OSDK Where
31
53
  */
@@ -65,7 +87,7 @@ interface UseOsdkListOptions<T extends ObjectTypeDefinition> {
65
87
  /**
66
88
  * The number of milliseconds to wait after the last observed list change.
67
89
  *
68
- * Two uses of `useOsdkList` with the where clause will only trigger one
90
+ * Two uses of `useOsdkObjects` with the where clause will only trigger one
69
91
  * network request if the second is within `dedupeIntervalMs`.
70
92
  */
71
93
  dedupeIntervalMs?: number;
@@ -77,11 +99,11 @@ interface UseOsdkListOptions<T extends ObjectTypeDefinition> {
77
99
  */
78
100
  streamUpdates?: boolean;
79
101
  }
80
- interface UseOsdkListResult<T extends ObjectTypeDefinition> {
102
+ interface UseOsdkListResult<T extends ObjectTypeDefinition$1 | InterfaceDefinition> {
81
103
  fetchMore: (() => Promise<unknown>) | undefined;
82
- data: Osdk.Instance<T>[];
104
+ data: Osdk$1.Instance<T>[] | undefined;
83
105
  isLoading: boolean;
84
- error: undefined;
106
+ error: Error | undefined;
85
107
  /**
86
108
  * Refers to whether the ordered list of objects (only considering the $primaryKey)
87
109
  * is optimistic or not.
@@ -91,27 +113,6 @@ interface UseOsdkListResult<T extends ObjectTypeDefinition> {
91
113
  */
92
114
  isOptimistic: boolean;
93
115
  }
94
- declare function useOsdkList<T extends ObjectTypeDefinition>(objectType: T, { pageSize, orderBy, dedupeIntervalMs, where, streamUpdates }: UseOsdkListOptions<T>): UseOsdkListResult<T>;
95
-
96
- interface UseOsdkObjectResult<Q extends ObjectTypeDefinition$1> {
97
- object: Osdk$1.Instance<Q> | undefined;
98
- isLoading: boolean;
99
- /**
100
- * Refers to whether the object is optimistic or not.
101
- */
102
- isOptimistic: boolean;
103
- forceUpdate: () => void;
104
- }
105
- /**
106
- * @param obj an existing `Osdk.Instance` object to get metadata for.
107
- */
108
- declare function useOsdkObject<Q extends ObjectTypeDefinition$1>(obj: Osdk$1.Instance<Q>): UseOsdkObjectResult<Q>;
109
- /**
110
- * Loads an object by type and primary key.
111
- *
112
- * @param type
113
- * @param primaryKey
114
- */
115
- declare function useOsdkObject<Q extends ObjectTypeDefinition$1>(type: Q, primaryKey: PrimaryKeyType<Q>): UseOsdkObjectResult<Q>;
116
+ declare function useOsdkObjects<Q extends ObjectTypeDefinition$1 | InterfaceDefinition>(type: Q, { pageSize, orderBy, dedupeIntervalMs, where, streamUpdates, }?: UseOsdkObjectsOptions<Q>): UseOsdkListResult<Q>;
116
117
 
117
- export { OsdkProvider2, useOsdkAction, useOsdkList, useOsdkObject };
118
+ export { OsdkProvider2, useOsdkAction, useOsdkObject, useOsdkObjects };
@@ -23,6 +23,6 @@ const fakeClient = Object.assign(fakeClientFn, {
23
23
  });
24
24
  export const OsdkContext2 = /*#__PURE__*/React.createContext({
25
25
  client: fakeClient,
26
- store: undefined
26
+ observableClient: undefined
27
27
  });
28
28
  //# sourceMappingURL=OsdkContext2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkContext2.js","names":["React","fakeClientFn","_args","Error","fakeClient","Object","assign","fetchMetadata","OsdkContext2","createContext","client","store","undefined"],"sources":["OsdkContext2.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 { Client } from \"@osdk/client\";\nimport type { ObservableClient } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\n\nfunction fakeClientFn(..._args: any[]) {\n throw new Error(\n \"This is not a real client. Did you forget to <OsdkContext.Provider>?\",\n );\n}\n\nconst fakeClient = Object.assign(fakeClientFn, {\n fetchMetadata: fakeClientFn,\n} as Client);\n\ninterface OsdkContextContents {\n client: Client;\n // keeping the old name for now intentionally\n // in case i need both for a while\n // in the future we can just make\n // this `client: ObservableClient`\n store: ObservableClient;\n}\n\nexport const OsdkContext2: React.Context<OsdkContextContents> = React\n .createContext<OsdkContextContents>({\n client: fakeClient,\n store: undefined!,\n });\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAYA,CAAC,GAAGC,KAAY,EAAE;EACrC,MAAM,IAAIC,KAAK,CACb,sEACF,CAAC;AACH;AAEA,MAAMC,UAAU,GAAGC,MAAM,CAACC,MAAM,CAACL,YAAY,EAAE;EAC7CM,aAAa,EAAEN;AACjB,CAAW,CAAC;AAWZ,OAAO,MAAMO,YAAgD,gBAAGR,KAAK,CAClES,aAAa,CAAsB;EAClCC,MAAM,EAAEN,UAAU;EAClBO,KAAK,EAAEC;AACT,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"OsdkContext2.js","names":["React","fakeClientFn","_args","Error","fakeClient","Object","assign","fetchMetadata","OsdkContext2","createContext","client","observableClient","undefined"],"sources":["OsdkContext2.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 { Client } from \"@osdk/client\";\nimport type { ObservableClient } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\n\nfunction fakeClientFn(..._args: any[]) {\n throw new Error(\n \"This is not a real client. Did you forget to <OsdkContext.Provider>?\",\n );\n}\n\nconst fakeClient = Object.assign(fakeClientFn, {\n fetchMetadata: fakeClientFn,\n} as Client);\n\ninterface OsdkContextContents {\n client: Client;\n // keeping the old name for now intentionally\n // in case i need both for a while\n // in the future we can just make\n // this `client: ObservableClient`\n observableClient: ObservableClient;\n}\n\nexport const OsdkContext2: React.Context<OsdkContextContents> = React\n .createContext<OsdkContextContents>({\n client: fakeClient,\n observableClient: undefined!,\n });\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAYA,CAAC,GAAGC,KAAY,EAAE;EACrC,MAAM,IAAIC,KAAK,CACb,sEACF,CAAC;AACH;AAEA,MAAMC,UAAU,GAAGC,MAAM,CAACC,MAAM,CAACL,YAAY,EAAE;EAC7CM,aAAa,EAAEN;AACjB,CAAW,CAAC;AAWZ,OAAO,MAAMO,YAAgD,gBAAGR,KAAK,CAClES,aAAa,CAAsB;EAClCC,MAAM,EAAEN,UAAU;EAClBO,gBAAgB,EAAEC;AACpB,CAAC,CAAC","ignoreList":[]}
@@ -14,17 +14,19 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import React from "react";
17
+ import { createObservableClient } from "@osdk/client/unstable-do-not-use";
18
+ import React, { useMemo } from "react";
18
19
  import { OsdkContext2 } from "./OsdkContext2.js";
19
20
  export function OsdkProvider2({
20
21
  children,
21
22
  client,
22
- store
23
+ observableClient
23
24
  }) {
25
+ observableClient = useMemo(() => observableClient ?? createObservableClient(client), [client, observableClient]);
24
26
  return /*#__PURE__*/React.createElement(OsdkContext2.Provider, {
25
27
  value: {
26
28
  client,
27
- store
29
+ observableClient
28
30
  }
29
31
  }, children);
30
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkProvider2.js","names":["React","OsdkContext2","OsdkProvider2","children","client","store","createElement","Provider","value"],"sources":["OsdkProvider2.tsx"],"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 { Client } from \"@osdk/client\";\nimport type { ObservableClient } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\ninterface OsdkProviderOptions {\n children: React.ReactNode;\n client: Client;\n store: ObservableClient;\n}\n\nexport function OsdkProvider2({\n children,\n client,\n store,\n}: OsdkProviderOptions): React.JSX.Element {\n return (\n <OsdkContext2.Provider value={{ client, store }}>\n {children}\n </OsdkContext2.Provider>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,mBAAmB;AAQhD,OAAO,SAASC,aAAaA,CAAC;EAC5BC,QAAQ;EACRC,MAAM;EACNC;AACmB,CAAC,EAAqB;EACzC,oBACEL,KAAA,CAAAM,aAAA,CAACL,YAAY,CAACM,QAAQ;IAACC,KAAK,EAAE;MAAEJ,MAAM;MAAEC;IAAM;EAAE,GAC7CF,QACoB,CAAC;AAE5B","ignoreList":[]}
1
+ {"version":3,"file":"OsdkProvider2.js","names":["createObservableClient","React","useMemo","OsdkContext2","OsdkProvider2","children","client","observableClient","createElement","Provider","value"],"sources":["OsdkProvider2.tsx"],"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 { Client } from \"@osdk/client\";\nimport {\n createObservableClient,\n type ObservableClient,\n} from \"@osdk/client/unstable-do-not-use\";\nimport React, { useMemo } from \"react\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\ninterface OsdkProviderOptions {\n children: React.ReactNode;\n client: Client;\n observableClient?: ObservableClient;\n}\n\nexport function OsdkProvider2({\n children,\n client,\n observableClient,\n}: OsdkProviderOptions): React.JSX.Element {\n observableClient = useMemo(\n () => observableClient ?? createObservableClient(client),\n [client, observableClient],\n );\n return (\n <OsdkContext2.Provider value={{ client, observableClient }}>\n {children}\n </OsdkContext2.Provider>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SACEA,sBAAsB,QAEjB,kCAAkC;AACzC,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,YAAY,QAAQ,mBAAmB;AAQhD,OAAO,SAASC,aAAaA,CAAC;EAC5BC,QAAQ;EACRC,MAAM;EACNC;AACmB,CAAC,EAAqB;EACzCA,gBAAgB,GAAGL,OAAO,CACxB,MAAMK,gBAAgB,IAAIP,sBAAsB,CAACM,MAAM,CAAC,EACxD,CAACA,MAAM,EAAEC,gBAAgB,CAC3B,CAAC;EACD,oBACEN,KAAA,CAAAO,aAAA,CAACL,YAAY,CAACM,QAAQ;IAACC,KAAK,EAAE;MAAEJ,MAAM;MAAEC;IAAiB;EAAE,GACxDF,QACoB,CAAC;AAE5B","ignoreList":[]}
@@ -21,9 +21,19 @@ export function makeExternalStore(createObservation) {
21
21
  }
22
22
  return {
23
23
  subscribe: function subscribe(notifyUpdate) {
24
- const obs = createObservation(payload => {
25
- lastResult = payload;
26
- notifyUpdate();
24
+ const obs = createObservation({
25
+ next: payload => {
26
+ lastResult = payload;
27
+ notifyUpdate();
28
+ },
29
+ error: error => {
30
+ lastResult = {
31
+ ...(lastResult ?? {}),
32
+ error: error instanceof Error ? error : new Error(String(error))
33
+ };
34
+ notifyUpdate();
35
+ },
36
+ complete: () => {}
27
37
  });
28
38
  return () => {
29
39
  obs.unsubscribe();
@@ -1 +1 @@
1
- {"version":3,"file":"makeExternalStore.js","names":["makeExternalStore","createObservation","lastResult","getSnapShot","subscribe","notifyUpdate","obs","payload","unsubscribe"],"sources":["makeExternalStore.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 { Unsubscribable } from \"@osdk/client/unstable-do-not-use\";\n\nexport function makeExternalStore<X>(\n createObservation: (callback: (x: X | undefined) => void) => Unsubscribable,\n name?: string,\n): {\n subscribe: (notifyUpdate: () => void) => () => void;\n getSnapShot: () => X | undefined;\n} {\n let lastResult: X | undefined;\n\n function getSnapShot(): X | undefined {\n return lastResult;\n }\n\n function subscribe(notifyUpdate: () => void) {\n const obs = createObservation((payload) => {\n lastResult = payload;\n notifyUpdate();\n });\n\n return (): void => {\n obs.unsubscribe();\n };\n }\n\n return {\n subscribe,\n getSnapShot,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,iBAAiBA,CAC/BC,iBAA2E,EAK3E;EACA,IAAIC,UAAyB;EAE7B,SAASC,WAAWA,CAAA,EAAkB;IACpC,OAAOD,UAAU;EACnB;EAaA,OAAO;IACLE,SAAS,EAZX,SAASA,SAASA,CAACC,YAAwB,EAAE;MAC3C,MAAMC,GAAG,GAAGL,iBAAiB,CAAEM,OAAO,IAAK;QACzCL,UAAU,GAAGK,OAAO;QACpBF,YAAY,CAAC,CAAC;MAChB,CAAC,CAAC;MAEF,OAAO,MAAY;QACjBC,GAAG,CAACE,WAAW,CAAC,CAAC;MACnB,CAAC;IACH,CAGW;IACTL;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"makeExternalStore.js","names":["makeExternalStore","createObservation","lastResult","getSnapShot","subscribe","notifyUpdate","obs","next","payload","error","Error","String","complete","unsubscribe"],"sources":["makeExternalStore.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 Observer,\n Unsubscribable,\n} from \"@osdk/client/unstable-do-not-use\";\n\nexport type Snapshot<X> =\n | X\n | (Partial<X> & { error: Error })\n | undefined;\n\nexport function makeExternalStore<X>(\n createObservation: (callback: Observer<X | undefined>) => Unsubscribable,\n name?: string,\n): {\n subscribe: (notifyUpdate: () => void) => () => void;\n getSnapShot: () => Snapshot<X>;\n} {\n let lastResult: Snapshot<X>;\n\n function getSnapShot(): Snapshot<X> {\n return lastResult;\n }\n\n function subscribe(notifyUpdate: () => void) {\n const obs = createObservation({\n next: (payload) => {\n lastResult = payload;\n notifyUpdate();\n },\n error: (error: unknown) => {\n lastResult = {\n ...(lastResult ?? {}),\n error: error instanceof Error ? error : new Error(String(error)),\n } as Snapshot<X>;\n notifyUpdate();\n },\n complete: () => {},\n });\n\n return (): void => {\n obs.unsubscribe();\n };\n }\n\n return {\n subscribe,\n getSnapShot,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,OAAO,SAASA,iBAAiBA,CAC/BC,iBAAwE,EAKxE;EACA,IAAIC,UAAuB;EAE3B,SAASC,WAAWA,CAAA,EAAgB;IAClC,OAAOD,UAAU;EACnB;EAuBA,OAAO;IACLE,SAAS,EAtBX,SAASA,SAASA,CAACC,YAAwB,EAAE;MAC3C,MAAMC,GAAG,GAAGL,iBAAiB,CAAC;QAC5BM,IAAI,EAAGC,OAAO,IAAK;UACjBN,UAAU,GAAGM,OAAO;UACpBH,YAAY,CAAC,CAAC;QAChB,CAAC;QACDI,KAAK,EAAGA,KAAc,IAAK;UACzBP,UAAU,GAAG;YACX,IAAIA,UAAU,IAAI,CAAC,CAAC,CAAC;YACrBO,KAAK,EAAEA,KAAK,YAAYC,KAAK,GAAGD,KAAK,GAAG,IAAIC,KAAK,CAACC,MAAM,CAACF,KAAK,CAAC;UACjE,CAAgB;UAChBJ,YAAY,CAAC,CAAC;QAChB,CAAC;QACDO,QAAQ,EAAEA,CAAA,KAAM,CAAC;MACnB,CAAC,CAAC;MAEF,OAAO,MAAY;QACjBN,GAAG,CAACO,WAAW,CAAC,CAAC;MACnB,CAAC;IACH,CAGW;IACTV;EACF,CAAC;AACH","ignoreList":[]}
@@ -19,7 +19,7 @@ import React from "react";
19
19
  import { OsdkContext2 } from "./OsdkContext2.js";
20
20
  export function useOsdkAction(actionDef) {
21
21
  const {
22
- store
22
+ observableClient
23
23
  } = React.useContext(OsdkContext2);
24
24
  const [error, setError] = React.useState();
25
25
  const [data, setData] = React.useState();
@@ -32,7 +32,7 @@ export function useOsdkAction(actionDef) {
32
32
  try {
33
33
  setPending(true);
34
34
  setError(undefined);
35
- const r = await store.applyAction(actionDef, args, {
35
+ const r = await observableClient.applyAction(actionDef, args, {
36
36
  optimisticUpdate: $optimisticUpdate
37
37
  });
38
38
  setData(r);
@@ -50,7 +50,7 @@ export function useOsdkAction(actionDef) {
50
50
  } finally {
51
51
  setPending(false);
52
52
  }
53
- }, [store, setError]);
53
+ }, [observableClient, setError]);
54
54
  return {
55
55
  applyAction,
56
56
  error,
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkAction.js","names":["ActionValidationError","React","OsdkContext2","useOsdkAction","actionDef","store","useContext","error","setError","useState","data","setData","isPending","setPending","applyAction","useCallback","hookArgs","$optimisticUpdate","args","undefined","r","optimisticUpdate","e","actionValidation","unknown"],"sources":["useOsdkAction.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 { ActionDefinition } from \"@osdk/client\";\nimport { ActionValidationError } from \"@osdk/client\";\nimport type {\n ActionSignatureFromDef,\n ObservableClient,\n} from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\ntype ApplyActionParams<Q extends ActionDefinition<any>> =\n & Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]\n & {\n [K in keyof ObservableClient.ApplyActionOptions as `$${K}`]:\n ObservableClient.ApplyActionOptions[K];\n };\n\nexport interface UseOsdkActionResult<Q extends ActionDefinition<any>> {\n applyAction: (\n args: ApplyActionParams<Q>,\n ) => Promise<unknown>;\n\n error:\n | undefined\n | Partial<{\n actionValidation: ActionValidationError;\n unknown: unknown;\n }>;\n data: unknown;\n\n isPending: boolean;\n}\n\nexport function useOsdkAction<Q extends ActionDefinition<any>>(\n actionDef: Q,\n): UseOsdkActionResult<Q> {\n const { store } = React.useContext(OsdkContext2);\n const [error, setError] = React.useState<UseOsdkActionResult<Q>[\"error\"]>();\n const [data, setData] = React.useState<unknown>();\n const [isPending, setPending] = React.useState(false);\n\n const applyAction = React.useCallback(async function applyAction(\n hookArgs: ApplyActionParams<Q>,\n ) {\n const { $optimisticUpdate, ...args } = hookArgs;\n try {\n setPending(true);\n setError(undefined);\n const r = await store.applyAction(actionDef, args, {\n optimisticUpdate: $optimisticUpdate,\n });\n setData(r);\n return r;\n } catch (e) {\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e,\n });\n } else {\n setError({ unknown: e });\n }\n } finally {\n setPending(false);\n }\n }, [store, setError]);\n\n return { applyAction, error, data, isPending };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,qBAAqB,QAAQ,cAAc;AAKpD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,mBAAmB;AAyBhD,OAAO,SAASC,aAAaA,CAC3BC,SAAY,EACY;EACxB,MAAM;IAAEC;EAAM,CAAC,GAAGJ,KAAK,CAACK,UAAU,CAACJ,YAAY,CAAC;EAChD,MAAM,CAACK,KAAK,EAAEC,QAAQ,CAAC,GAAGP,KAAK,CAACQ,QAAQ,CAAkC,CAAC;EAC3E,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGV,KAAK,CAACQ,QAAQ,CAAU,CAAC;EACjD,MAAM,CAACG,SAAS,EAAEC,UAAU,CAAC,GAAGZ,KAAK,CAACQ,QAAQ,CAAC,KAAK,CAAC;EAErD,MAAMK,WAAW,GAAGb,KAAK,CAACc,WAAW,CAAC,gBACpCC,QAA8B,EAC9B;IACA,MAAM;MAAEC,iBAAiB;MAAE,GAAGC;IAAK,CAAC,GAAGF,QAAQ;IAC/C,IAAI;MACFH,UAAU,CAAC,IAAI,CAAC;MAChBL,QAAQ,CAACW,SAAS,CAAC;MACnB,MAAMC,CAAC,GAAG,MAAMf,KAAK,CAACS,WAAW,CAACV,SAAS,EAAEc,IAAI,EAAE;QACjDG,gBAAgB,EAAEJ;MACpB,CAAC,CAAC;MACFN,OAAO,CAACS,CAAC,CAAC;MACV,OAAOA,CAAC;IACV,CAAC,CAAC,OAAOE,CAAC,EAAE;MACV,IAAIA,CAAC,YAAYtB,qBAAqB,EAAE;QACtCQ,QAAQ,CAAC;UACPe,gBAAgB,EAAED;QACpB,CAAC,CAAC;MACJ,CAAC,MAAM;QACLd,QAAQ,CAAC;UAAEgB,OAAO,EAAEF;QAAE,CAAC,CAAC;MAC1B;IACF,CAAC,SAAS;MACRT,UAAU,CAAC,KAAK,CAAC;IACnB;EACF,CAAC,EAAE,CAACR,KAAK,EAAEG,QAAQ,CAAC,CAAC;EAErB,OAAO;IAAEM,WAAW;IAAEP,KAAK;IAAEG,IAAI;IAAEE;EAAU,CAAC;AAChD","ignoreList":[]}
1
+ {"version":3,"file":"useOsdkAction.js","names":["ActionValidationError","React","OsdkContext2","useOsdkAction","actionDef","observableClient","useContext","error","setError","useState","data","setData","isPending","setPending","applyAction","useCallback","hookArgs","$optimisticUpdate","args","undefined","r","optimisticUpdate","e","actionValidation","unknown"],"sources":["useOsdkAction.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 { ActionDefinition } from \"@osdk/client\";\nimport { ActionValidationError } from \"@osdk/client\";\nimport type {\n ActionSignatureFromDef,\n ObservableClient,\n} from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\ntype ApplyActionParams<Q extends ActionDefinition<any>> =\n & Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]\n & {\n [K in keyof ObservableClient.ApplyActionOptions as `$${K}`]:\n ObservableClient.ApplyActionOptions[K];\n };\n\nexport interface UseOsdkActionResult<Q extends ActionDefinition<any>> {\n applyAction: (\n args: ApplyActionParams<Q>,\n ) => Promise<unknown>;\n\n error:\n | undefined\n | Partial<{\n actionValidation: ActionValidationError;\n unknown: unknown;\n }>;\n data: unknown;\n\n isPending: boolean;\n}\n\nexport function useOsdkAction<Q extends ActionDefinition<any>>(\n actionDef: Q,\n): UseOsdkActionResult<Q> {\n const { observableClient } = React.useContext(OsdkContext2);\n const [error, setError] = React.useState<UseOsdkActionResult<Q>[\"error\"]>();\n const [data, setData] = React.useState<unknown>();\n const [isPending, setPending] = React.useState(false);\n\n const applyAction = React.useCallback(async function applyAction(\n hookArgs: ApplyActionParams<Q>,\n ) {\n const { $optimisticUpdate, ...args } = hookArgs;\n try {\n setPending(true);\n setError(undefined);\n const r = await observableClient.applyAction(actionDef, args, {\n optimisticUpdate: $optimisticUpdate,\n });\n setData(r);\n return r;\n } catch (e) {\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e,\n });\n } else {\n setError({ unknown: e });\n }\n } finally {\n setPending(false);\n }\n }, [observableClient, setError]);\n\n return { applyAction, error, data, isPending };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,qBAAqB,QAAQ,cAAc;AAKpD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,mBAAmB;AAyBhD,OAAO,SAASC,aAAaA,CAC3BC,SAAY,EACY;EACxB,MAAM;IAAEC;EAAiB,CAAC,GAAGJ,KAAK,CAACK,UAAU,CAACJ,YAAY,CAAC;EAC3D,MAAM,CAACK,KAAK,EAAEC,QAAQ,CAAC,GAAGP,KAAK,CAACQ,QAAQ,CAAkC,CAAC;EAC3E,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGV,KAAK,CAACQ,QAAQ,CAAU,CAAC;EACjD,MAAM,CAACG,SAAS,EAAEC,UAAU,CAAC,GAAGZ,KAAK,CAACQ,QAAQ,CAAC,KAAK,CAAC;EAErD,MAAMK,WAAW,GAAGb,KAAK,CAACc,WAAW,CAAC,gBACpCC,QAA8B,EAC9B;IACA,MAAM;MAAEC,iBAAiB;MAAE,GAAGC;IAAK,CAAC,GAAGF,QAAQ;IAC/C,IAAI;MACFH,UAAU,CAAC,IAAI,CAAC;MAChBL,QAAQ,CAACW,SAAS,CAAC;MACnB,MAAMC,CAAC,GAAG,MAAMf,gBAAgB,CAACS,WAAW,CAACV,SAAS,EAAEc,IAAI,EAAE;QAC5DG,gBAAgB,EAAEJ;MACpB,CAAC,CAAC;MACFN,OAAO,CAACS,CAAC,CAAC;MACV,OAAOA,CAAC;IACV,CAAC,CAAC,OAAOE,CAAC,EAAE;MACV,IAAIA,CAAC,YAAYtB,qBAAqB,EAAE;QACtCQ,QAAQ,CAAC;UACPe,gBAAgB,EAAED;QACpB,CAAC,CAAC;MACJ,CAAC,MAAM;QACLd,QAAQ,CAAC;UAAEgB,OAAO,EAAEF;QAAE,CAAC,CAAC;MAC1B;IACF,CAAC,SAAS;MACRT,UAAU,CAAC,KAAK,CAAC;IACnB;EACF,CAAC,EAAE,CAACR,gBAAgB,EAAEG,QAAQ,CAAC,CAAC;EAEhC,OAAO;IAAEM,WAAW;IAAEP,KAAK;IAAEG,IAAI;IAAEE;EAAU,CAAC;AAChD","ignoreList":[]}
@@ -34,7 +34,7 @@ import { OsdkContext2 } from "./OsdkContext2.js";
34
34
  */
35
35
  export function useOsdkObject(...args) {
36
36
  const {
37
- store
37
+ observableClient
38
38
  } = React.useContext(OsdkContext2);
39
39
 
40
40
  // TODO: Figure out what the correct default behavior is for the various scenarios
@@ -44,14 +44,15 @@ export function useOsdkObject(...args) {
44
44
  const {
45
45
  subscribe,
46
46
  getSnapShot
47
- } = React.useMemo(() => makeExternalStore(payload => store.observeObject(objectType, primaryKey, {
47
+ } = React.useMemo(() => makeExternalStore(observer => observableClient.observeObject(objectType, primaryKey, {
48
48
  mode
49
- }, payload), `object ${objectType} ${primaryKey}`), [store, objectType, primaryKey, mode]);
49
+ }, observer), `object ${objectType} ${primaryKey}`), [observableClient, objectType, primaryKey, mode]);
50
50
  const payload = React.useSyncExternalStore(subscribe, getSnapShot);
51
51
  return {
52
52
  object: payload?.object,
53
53
  isLoading: payload?.status === "loading",
54
- isOptimistic: payload?.isOptimistic ?? false,
54
+ isOptimistic: !!payload?.isOptimistic,
55
+ error: payload && "error" in payload ? payload.error : undefined,
55
56
  forceUpdate: () => {
56
57
  throw "not implemented";
57
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkObject.js","names":["React","makeExternalStore","OsdkContext2","useOsdkObject","args","store","useContext","mode","length","undefined","objectType","$objectType","apiName","primaryKey","$primaryKey","subscribe","getSnapShot","useMemo","payload","observeObject","useSyncExternalStore","object","isLoading","status","isOptimistic","forceUpdate"],"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 { ObjectTypeDefinition, Osdk, PrimaryKeyType } from \"@osdk/api\";\nimport type { ObjectPayload } 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<Q extends ObjectTypeDefinition> {\n object: Osdk.Instance<Q> | undefined;\n isLoading: boolean;\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 */\nexport function useOsdkObject<Q extends ObjectTypeDefinition>(\n obj: Osdk.Instance<Q>,\n): UseOsdkObjectResult<Q>;\n/**\n * Loads an object by type and primary key.\n *\n * @param type\n * @param primaryKey\n */\nexport function useOsdkObject<Q extends ObjectTypeDefinition>(\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n): UseOsdkObjectResult<Q>;\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject<Q extends ObjectTypeDefinition>(\n ...args: [obj: Osdk.Instance<Q>] | [type: Q, primaryKey: PrimaryKeyType<Q>]\n): UseOsdkObjectResult<Q> {\n const { store } = React.useContext(OsdkContext2);\n\n // TODO: Figure out what the correct default behavior is for the various scenarios\n const mode = args.length === 1 ? \"offline\" : undefined;\n const objectType = args.length === 1 ? args[0].$objectType : args[0].apiName;\n const primaryKey = args.length === 1 ? args[0].$primaryKey : args[1];\n\n const { subscribe, getSnapShot } = React.useMemo(\n () =>\n makeExternalStore<ObjectPayload>((payload) =>\n store.observeObject(\n objectType,\n primaryKey,\n {\n mode,\n },\n payload,\n ), `object ${objectType} ${primaryKey}`),\n [store, objectType, primaryKey, mode],\n );\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n return {\n object: payload?.object as Osdk.Instance<Q> | undefined,\n isLoading: payload?.status === \"loading\",\n isOptimistic: payload?.isOptimistic ?? false,\n forceUpdate: () => {\n throw \"not implemented\";\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;;AAahD;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAC3B,GAAGC,IAAwE,EACnD;EACxB,MAAM;IAAEC;EAAM,CAAC,GAAGL,KAAK,CAACM,UAAU,CAACJ,YAAY,CAAC;;EAEhD;EACA,MAAMK,IAAI,GAAGH,IAAI,CAACI,MAAM,KAAK,CAAC,GAAG,SAAS,GAAGC,SAAS;EACtD,MAAMC,UAAU,GAAGN,IAAI,CAACI,MAAM,KAAK,CAAC,GAAGJ,IAAI,CAAC,CAAC,CAAC,CAACO,WAAW,GAAGP,IAAI,CAAC,CAAC,CAAC,CAACQ,OAAO;EAC5E,MAAMC,UAAU,GAAGT,IAAI,CAACI,MAAM,KAAK,CAAC,GAAGJ,IAAI,CAAC,CAAC,CAAC,CAACU,WAAW,GAAGV,IAAI,CAAC,CAAC,CAAC;EAEpE,MAAM;IAAEW,SAAS;IAAEC;EAAY,CAAC,GAAGhB,KAAK,CAACiB,OAAO,CAC9C,MACEhB,iBAAiB,CAAiBiB,OAAO,IACvCb,KAAK,CAACc,aAAa,CACjBT,UAAU,EACVG,UAAU,EACV;IACEN;EACF,CAAC,EACDW,OACF,CAAC,EAAE,UAAUR,UAAU,IAAIG,UAAU,EAAE,CAAC,EAC5C,CAACR,KAAK,EAAEK,UAAU,EAAEG,UAAU,EAAEN,IAAI,CACtC,CAAC;EAED,MAAMW,OAAO,GAAGlB,KAAK,CAACoB,oBAAoB,CAACL,SAAS,EAAEC,WAAW,CAAC;EAElE,OAAO;IACLK,MAAM,EAAEH,OAAO,EAAEG,MAAsC;IACvDC,SAAS,EAAEJ,OAAO,EAAEK,MAAM,KAAK,SAAS;IACxCC,YAAY,EAAEN,OAAO,EAAEM,YAAY,IAAI,KAAK;IAC5CC,WAAW,EAAEA,CAAA,KAAM;MACjB,MAAM,iBAAiB;IACzB;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"useOsdkObject.js","names":["React","makeExternalStore","OsdkContext2","useOsdkObject","args","observableClient","useContext","mode","length","undefined","objectType","$objectType","apiName","primaryKey","$primaryKey","subscribe","getSnapShot","useMemo","observer","observeObject","payload","useSyncExternalStore","object","isLoading","status","isOptimistic","error","forceUpdate"],"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 { ObjectTypeDefinition, Osdk, PrimaryKeyType } from \"@osdk/api\";\nimport type { ObserveObjectArgs } 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<Q extends ObjectTypeDefinition> {\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 */\nexport function useOsdkObject<Q extends ObjectTypeDefinition>(\n obj: Osdk.Instance<Q>,\n): UseOsdkObjectResult<Q>;\n/**\n * Loads an object by type and primary key.\n *\n * @param type\n * @param primaryKey\n */\nexport function useOsdkObject<Q extends ObjectTypeDefinition>(\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n): UseOsdkObjectResult<Q>;\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject<Q extends ObjectTypeDefinition>(\n ...args: [obj: Osdk.Instance<Q>] | [type: Q, primaryKey: PrimaryKeyType<Q>]\n): UseOsdkObjectResult<Q> {\n const { observableClient } = React.useContext(OsdkContext2);\n\n // TODO: Figure out what the correct default behavior is for the various scenarios\n const mode = args.length === 1 ? \"offline\" : undefined;\n const objectType = args.length === 1 ? args[0].$objectType : args[0].apiName;\n const primaryKey = args.length === 1 ? args[0].$primaryKey : args[1];\n\n const { subscribe, getSnapShot } = React.useMemo(\n () =>\n makeExternalStore<ObserveObjectArgs<Q>>(\n (observer) =>\n observableClient.observeObject(\n objectType,\n primaryKey,\n {\n mode,\n },\n observer,\n ),\n `object ${objectType} ${primaryKey}`,\n ),\n [observableClient, objectType, primaryKey, mode],\n );\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n return {\n object: payload?.object as Osdk.Instance<Q> | undefined,\n isLoading: payload?.status === \"loading\",\n isOptimistic: !!payload?.isOptimistic,\n error: payload && \"error\" in payload ? payload.error : undefined,\n forceUpdate: () => {\n throw \"not implemented\";\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;;AAehD;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAC3B,GAAGC,IAAwE,EACnD;EACxB,MAAM;IAAEC;EAAiB,CAAC,GAAGL,KAAK,CAACM,UAAU,CAACJ,YAAY,CAAC;;EAE3D;EACA,MAAMK,IAAI,GAAGH,IAAI,CAACI,MAAM,KAAK,CAAC,GAAG,SAAS,GAAGC,SAAS;EACtD,MAAMC,UAAU,GAAGN,IAAI,CAACI,MAAM,KAAK,CAAC,GAAGJ,IAAI,CAAC,CAAC,CAAC,CAACO,WAAW,GAAGP,IAAI,CAAC,CAAC,CAAC,CAACQ,OAAO;EAC5E,MAAMC,UAAU,GAAGT,IAAI,CAACI,MAAM,KAAK,CAAC,GAAGJ,IAAI,CAAC,CAAC,CAAC,CAACU,WAAW,GAAGV,IAAI,CAAC,CAAC,CAAC;EAEpE,MAAM;IAAEW,SAAS;IAAEC;EAAY,CAAC,GAAGhB,KAAK,CAACiB,OAAO,CAC9C,MACEhB,iBAAiB,CACdiB,QAAQ,IACPb,gBAAgB,CAACc,aAAa,CAC5BT,UAAU,EACVG,UAAU,EACV;IACEN;EACF,CAAC,EACDW,QACF,CAAC,EACH,UAAUR,UAAU,IAAIG,UAAU,EACpC,CAAC,EACH,CAACR,gBAAgB,EAAEK,UAAU,EAAEG,UAAU,EAAEN,IAAI,CACjD,CAAC;EAED,MAAMa,OAAO,GAAGpB,KAAK,CAACqB,oBAAoB,CAACN,SAAS,EAAEC,WAAW,CAAC;EAElE,OAAO;IACLM,MAAM,EAAEF,OAAO,EAAEE,MAAsC;IACvDC,SAAS,EAAEH,OAAO,EAAEI,MAAM,KAAK,SAAS;IACxCC,YAAY,EAAE,CAAC,CAACL,OAAO,EAAEK,YAAY;IACrCC,KAAK,EAAEN,OAAO,IAAI,OAAO,IAAIA,OAAO,GAAGA,OAAO,CAACM,KAAK,GAAGjB,SAAS;IAChEkB,WAAW,EAAEA,CAAA,KAAM;MACjB,MAAM,iBAAiB;IACzB;EACF,CAAC;AACH","ignoreList":[]}
@@ -17,40 +17,41 @@
17
17
  import React from "react";
18
18
  import { makeExternalStore } from "./makeExternalStore.js";
19
19
  import { OsdkContext2 } from "./OsdkContext2.js";
20
- export function useOsdkList(objectType, {
20
+ export function useOsdkObjects(type, {
21
21
  pageSize,
22
22
  orderBy,
23
23
  dedupeIntervalMs,
24
- where,
24
+ where = {},
25
25
  streamUpdates
26
- }) {
26
+ } = {}) {
27
27
  const {
28
- store
28
+ observableClient
29
29
  } = React.useContext(OsdkContext2);
30
30
 
31
31
  /* We want the canonical where clause so that the use of `React.useMemo`
32
32
  is stable. No real added cost as we canonicalize internal to
33
33
  the ObservableClient anyway.
34
34
  */
35
- const canonWhere = store.canonicalizeWhereClause(where ?? {});
35
+ const canonWhere = observableClient.canonicalizeWhereClause(where ?? {});
36
36
  const {
37
37
  subscribe,
38
38
  getSnapShot
39
- } = React.useMemo(() => makeExternalStore(x => store.observeList({
40
- objectType,
39
+ } = React.useMemo(() => makeExternalStore(observer => observableClient.observeList({
40
+ type,
41
41
  where: canonWhere,
42
42
  dedupeInterval: dedupeIntervalMs ?? 2_000,
43
43
  pageSize,
44
44
  orderBy,
45
45
  streamUpdates
46
- }, x), process.env.NODE_ENV !== "production" ? `list ${objectType.apiName} ${JSON.stringify(canonWhere)}` : void 0), [store, objectType, canonWhere, dedupeIntervalMs]);
46
+ }, observer), process.env.NODE_ENV !== "production" ? `list ${type.apiName} ${JSON.stringify(canonWhere)}` : void 0), [observableClient, type, canonWhere, dedupeIntervalMs]);
47
47
  const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);
48
+ // TODO: we need to expose the error in the result
48
49
  return {
49
50
  fetchMore: listPayload?.fetchMore,
51
+ error: listPayload && "error" in listPayload ? listPayload?.error : undefined,
50
52
  data: listPayload?.resolvedList,
51
53
  isLoading: listPayload?.status === "loading",
52
- error: undefined,
53
54
  isOptimistic: listPayload?.isOptimistic ?? false
54
55
  };
55
56
  }
56
- //# sourceMappingURL=useOsdkList.js.map
57
+ //# sourceMappingURL=useOsdkObjects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOsdkObjects.js","names":["React","makeExternalStore","OsdkContext2","useOsdkObjects","type","pageSize","orderBy","dedupeIntervalMs","where","streamUpdates","observableClient","useContext","canonWhere","canonicalizeWhereClause","subscribe","getSnapShot","useMemo","observer","observeList","dedupeInterval","process","env","NODE_ENV","apiName","JSON","stringify","listPayload","useSyncExternalStore","fetchMore","error","undefined","data","resolvedList","isLoading","status","isOptimistic"],"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 InterfaceDefinition,\n ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n WhereClause,\n} from \"@osdk/client\";\nimport type { ObserveObjectsArgs } 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 ObjectTypeDefinition | InterfaceDefinition,\n> {\n /**\n * Standard OSDK Where\n */\n where?: WhereClause<T>;\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /** */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\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 // autoFetchMore?: boolean | number;\n\n /**\n * Upon a list being revalidated, this option determines how the component\n * will be re-rendered with the data.\n *\n * An example to help understand the options:\n *\n * Suppose pageSize is 10 and we have called `fetchMore()` twice. The list is\n * now 30 items long.\n *\n * Upon revalidation, we get the first 10 items of the list. The options behave\n * as follows:\n *\n * - `\"in-place\"`: The first 10 items of the list are replaced with the new 10\n * items. The list is now 30 items long, but only the first 10 items are valid.\n * - `\"wait\"`: The old list is returned until after the next 20 items are loaded\n * (which will happen automatically). The list is now 30 items long.\n * - `\"reset\"`: The entire list is replaced with the new 10 items. The list is\n * now 10 items long.\n */\n // invalidationMode?: \"in-place\" | \"wait\" | \"reset\";\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkObjects` with the where clause will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * If provided, the list will be considered this length for the purposes of\n * `invalidationMode` when using the `wait` option. If not provided,\n * the internal expectedLength will be determined by the number of times\n * `fetchMore` has been called.\n */\n // expectedLength?: number | undefined;\n\n streamUpdates?: boolean;\n}\n\nexport interface UseOsdkListResult<\n T extends ObjectTypeDefinition | InterfaceDefinition,\n> {\n fetchMore: (() => Promise<unknown>) | undefined;\n data: Osdk.Instance<T>[] | undefined;\n isLoading: boolean;\n\n // FIXME populate error!\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\ndeclare const process: {\n env: {\n NODE_ENV: \"development\" | \"production\";\n };\n};\n\nexport function useOsdkObjects<\n Q extends ObjectTypeDefinition | InterfaceDefinition,\n>(\n type: Q,\n {\n pageSize,\n orderBy,\n dedupeIntervalMs,\n where = {},\n streamUpdates,\n }: UseOsdkObjectsOptions<Q> = {},\n): UseOsdkListResult<Q> {\n const { observableClient } = React.useContext(OsdkContext2);\n\n /* We want the canonical where clause so that the use of `React.useMemo`\n is stable. No real added cost as we canonicalize internal to\n the ObservableClient anyway.\n */\n const canonWhere = observableClient.canonicalizeWhereClause(where ?? {});\n\n const { subscribe, getSnapShot } = React.useMemo(\n () =>\n makeExternalStore<ObserveObjectsArgs<Q>>(\n (observer) =>\n observableClient.observeList({\n type,\n where: canonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy,\n streamUpdates,\n }, observer),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} ${JSON.stringify(canonWhere)}`\n : void 0,\n ),\n [observableClient, type, canonWhere, dedupeIntervalMs],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n // TODO: we need to expose the error in the result\n return {\n fetchMore: listPayload?.fetchMore,\n error: listPayload && \"error\" in listPayload\n ? listPayload?.error\n : undefined,\n data: listPayload?.resolvedList as Osdk.Instance<Q>[],\n isLoading: listPayload?.status === \"loading\",\n isOptimistic: listPayload?.isOptimistic ?? false,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;AA6FhD,OAAO,SAASC,cAAcA,CAG5BC,IAAO,EACP;EACEC,QAAQ;EACRC,OAAO;EACPC,gBAAgB;EAChBC,KAAK,GAAG,CAAC,CAAC;EACVC;AACwB,CAAC,GAAG,CAAC,CAAC,EACV;EACtB,MAAM;IAAEC;EAAiB,CAAC,GAAGV,KAAK,CAACW,UAAU,CAACT,YAAY,CAAC;;EAE3D;AACF;AACA;AACA;EACE,MAAMU,UAAU,GAAGF,gBAAgB,CAACG,uBAAuB,CAACL,KAAK,IAAI,CAAC,CAAC,CAAC;EAExE,MAAM;IAAEM,SAAS;IAAEC;EAAY,CAAC,GAAGf,KAAK,CAACgB,OAAO,CAC9C,MACEf,iBAAiB,CACdgB,QAAQ,IACPP,gBAAgB,CAACQ,WAAW,CAAC;IAC3Bd,IAAI;IACJI,KAAK,EAAEI,UAAU;IACjBO,cAAc,EAAEZ,gBAAgB,IAAI,KAAK;IACzCF,QAAQ;IACRC,OAAO;IACPG;EACF,CAAC,EAAEQ,QAAQ,CAAC,EACdG,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACjC,QAAQlB,IAAI,CAACmB,OAAO,IAAIC,IAAI,CAACC,SAAS,CAACb,UAAU,CAAC,EAAE,GACpD,KAAK,CACX,CAAC,EACH,CAACF,gBAAgB,EAAEN,IAAI,EAAEQ,UAAU,EAAEL,gBAAgB,CACvD,CAAC;EAED,MAAMmB,WAAW,GAAG1B,KAAK,CAAC2B,oBAAoB,CAACb,SAAS,EAAEC,WAAW,CAAC;EACtE;EACA,OAAO;IACLa,SAAS,EAAEF,WAAW,EAAEE,SAAS;IACjCC,KAAK,EAAEH,WAAW,IAAI,OAAO,IAAIA,WAAW,GACxCA,WAAW,EAAEG,KAAK,GAClBC,SAAS;IACbC,IAAI,EAAEL,WAAW,EAAEM,YAAkC;IACrDC,SAAS,EAAEP,WAAW,EAAEQ,MAAM,KAAK,SAAS;IAC5CC,YAAY,EAAET,WAAW,EAAES,YAAY,IAAI;EAC7C,CAAC;AACH","ignoreList":[]}
@@ -16,7 +16,7 @@
16
16
 
17
17
  export { OsdkProvider2 } from "../new/OsdkProvider2.js";
18
18
  export { useOsdkAction } from "../new/useOsdkAction.js";
19
- export { useOsdkList } from "../new/useOsdkList.js";
20
19
  export { useOsdkObject } from "../new/useOsdkObject.js";
20
+ export { useOsdkObjects } from "../new/useOsdkObjects.js";
21
21
  export { useOsdkClient } from "../useOsdkClient.js";
22
22
  //# sourceMappingURL=experimental.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","names":["OsdkProvider2","useOsdkAction","useOsdkList","useOsdkObject","useOsdkClient"],"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 { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport { useOsdkList } from \"../new/useOsdkList.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport { useOsdkClient } from \"../useOsdkClient.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,aAAa,QAAQ,yBAAyB;AACvD,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,aAAa,QAAQ,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"experimental.js","names":["OsdkProvider2","useOsdkAction","useOsdkObject","useOsdkObjects","useOsdkClient"],"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 { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport { useOsdkObjects } from \"../new/useOsdkObjects.js\";\nexport { useOsdkClient } from \"../useOsdkClient.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,aAAa,QAAQ,yBAAyB;AACvD,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,aAAa,QAAQ,qBAAqB","ignoreList":[]}
@@ -3,7 +3,7 @@ import type { ObservableClient } from "@osdk/client/unstable-do-not-use";
3
3
  import React from "react";
4
4
  interface OsdkContextContents {
5
5
  client: Client;
6
- store: ObservableClient;
6
+ observableClient: ObservableClient;
7
7
  }
8
8
  export declare const OsdkContext2: React.Context<OsdkContextContents>;
9
9
  export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,cAAc,cAAe;AAC3C,cAAc,wBAAwB,kCAAmC;AACzE,OAAO,WAAW,OAAQ;UAYhB,oBAAoB;CAC5B,QAAQ;CAKR,OAAO;AACR;AAED,OAAO,cAAMA,cAAc,MAAM,QAAQ","names":["OsdkContext2: React.Context<OsdkContextContents>"],"sources":["../../../src/new/OsdkContext2.ts"],"version":3,"file":"OsdkContext2.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,cAAc,cAAe;AAC3C,cAAc,wBAAwB,kCAAmC;AACzE,OAAO,WAAW,OAAQ;UAYhB,oBAAoB;CAC5B,QAAQ;CAKR,kBAAkB;AACnB;AAED,OAAO,cAAMA,cAAc,MAAM,QAAQ","names":["OsdkContext2: React.Context<OsdkContextContents>"],"sources":["../../../src/new/OsdkContext2.ts"],"version":3,"file":"OsdkContext2.d.ts"}
@@ -1,10 +1,10 @@
1
1
  import type { Client } from "@osdk/client";
2
- import type { ObservableClient } from "@osdk/client/unstable-do-not-use";
2
+ import { type ObservableClient } from "@osdk/client/unstable-do-not-use";
3
3
  import React from "react";
4
4
  interface OsdkProviderOptions {
5
5
  children: React.ReactNode;
6
6
  client: Client;
7
- store: ObservableClient;
7
+ observableClient?: ObservableClient;
8
8
  }
9
- export declare function OsdkProvider2({ children, client, store }: OsdkProviderOptions): React.JSX.Element;
9
+ export declare function OsdkProvider2({ children, client, observableClient }: OsdkProviderOptions): React.JSX.Element;
10
10
  export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,cAAc,cAAe;AAC3C,cAAc,wBAAwB,kCAAmC;AACzE,OAAO,WAAW,OAAQ;UAGhB,oBAAoB;CAC5B,UAAU,MAAM;CAChB,QAAQ;CACR,OAAO;AACR;AAED,OAAO,iBAAS,cAAc,EAC5B,UACA,QACA,OACoB,EAAnB,sBAAsB,MAAM,IAAI","names":[],"sources":["../../../src/new/OsdkProvider2.tsx"],"version":3,"file":"OsdkProvider2.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,cAAc,cAAe;AAC3C,cAEO,wBACA,kCAAmC;AAC1C,OAAO,WAAwB,OAAQ;UAG7B,oBAAoB;CAC5B,UAAU,MAAM;CAChB,QAAQ;CACR,mBAAmB;AACpB;AAED,OAAO,iBAAS,cAAc,EAC5B,UACA,QACA,kBACoB,EAAnB,sBAAsB,MAAM,IAAI","names":[],"sources":["../../../src/new/OsdkProvider2.tsx"],"version":3,"file":"OsdkProvider2.d.ts"}
@@ -1,5 +1,8 @@
1
- import type { Unsubscribable } from "@osdk/client/unstable-do-not-use";
2
- export declare function makeExternalStore<X>(createObservation: (callback: (x: X | undefined) => void) => Unsubscribable, name?: string): {
1
+ import type { Observer, Unsubscribable } from "@osdk/client/unstable-do-not-use";
2
+ export type Snapshot<X> = X | (Partial<X> & {
3
+ error: Error
4
+ }) | undefined;
5
+ export declare function makeExternalStore<X>(createObservation: (callback: Observer<X | undefined>) => Unsubscribable, name?: string): {
3
6
  subscribe: (notifyUpdate: () => void) => () => void
4
- getSnapShot: () => X | undefined
7
+ getSnapShot: () => Snapshot<X>
5
8
  };
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,sBAAsB,kCAAmC;AAEvE,OAAO,iBAAS,kBAAkB,GAChCA,oBAAoBC,WAAWC,GAAG,2BAA2B,gBAC7DC,gBACC;CACD,YAAYC;CACZ,mBAAmB;AACpB","names":["createObservation: (callback: (x: X | undefined) => void) => Unsubscribable","callback: (x: X | undefined) => void","x: X | undefined","name?: string","notifyUpdate: () => void"],"sources":["../../../src/new/makeExternalStore.ts"],"version":3,"file":"makeExternalStore.d.ts"}
1
+ {"mappings":"AAgBA,cACE,UACA,sBACK,kCAAmC;AAE1C,YAAY,SAAS,KACjB,KACC,QAAQ,KAAK;CAAE,OAAO;AAAO;AAGlC,OAAO,iBAAS,kBAAkB,GAChCA,oBAAoBC,UAAU,SAAS,mBAAmB,gBAC1DC,gBACC;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B","names":["createObservation: (callback: Observer<X | undefined>) => Unsubscribable","callback: Observer<X | undefined>","name?: string","notifyUpdate: () => void"],"sources":["../../../src/new/makeExternalStore.ts"],"version":3,"file":"makeExternalStore.d.ts"}
@@ -2,6 +2,7 @@ import type { ObjectTypeDefinition, Osdk, PrimaryKeyType } from "@osdk/api";
2
2
  export interface UseOsdkObjectResult<Q extends ObjectTypeDefinition> {
3
3
  object: Osdk.Instance<Q> | undefined;
4
4
  isLoading: boolean;
5
+ error: Error | undefined;
5
6
  /**
6
7
  * Refers to whether the object is optimistic or not.
7
8
  */
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,sBAAsB,MAAM,sBAAsB,WAAY;AAM5E,iBAAiB,oBAAoB,UAAU,sBAAsB;CACnE,QAAQ,KAAK,SAAS;CACtB;;;;CAKA;CACA;AACD;;;;AAKD,OAAO,iBAAS,cAAc,UAAU,sBACtCA,KAAK,KAAK,SAAS,KAClB,oBAAoB;;;;;;;AAOvB,OAAO,iBAAS,cAAc,UAAU,sBACtCC,MAAM,GACNC,YAAY,eAAe,KAC1B,oBAAoB","names":["obj: Osdk.Instance<Q>","type: Q","primaryKey: PrimaryKeyType<Q>"],"sources":["../../../src/new/useOsdkObject.ts"],"version":3,"file":"useOsdkObject.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,sBAAsB,MAAM,sBAAsB,WAAY;AAM5E,iBAAiB,oBAAoB,UAAU,sBAAsB;CACnE,QAAQ,KAAK,SAAS;CACtB;CAEA,OAAO;;;;CAKP;CACA;AACD;;;;AAKD,OAAO,iBAAS,cAAc,UAAU,sBACtCA,KAAK,KAAK,SAAS,KAClB,oBAAoB;;;;;;;AAOvB,OAAO,iBAAS,cAAc,UAAU,sBACtCC,MAAM,GACNC,YAAY,eAAe,KAC1B,oBAAoB","names":["obj: Osdk.Instance<Q>","type: Q","primaryKey: PrimaryKeyType<Q>"],"sources":["../../../src/new/useOsdkObject.ts"],"version":3,"file":"useOsdkObject.d.ts"}
@@ -1,5 +1,5 @@
1
- import type { ObjectTypeDefinition, Osdk, PropertyKeys, WhereClause } from "@osdk/client";
2
- export interface UseOsdkListOptions<T extends ObjectTypeDefinition> {
1
+ import type { InterfaceDefinition, ObjectTypeDefinition, Osdk, PropertyKeys, WhereClause } from "@osdk/client";
2
+ export interface UseOsdkObjectsOptions<T extends ObjectTypeDefinition | InterfaceDefinition> {
3
3
  /**
4
4
  * Standard OSDK Where
5
5
  */
@@ -37,7 +37,7 @@ export interface UseOsdkListOptions<T extends ObjectTypeDefinition> {
37
37
  /**
38
38
  * The number of milliseconds to wait after the last observed list change.
39
39
  *
40
- * Two uses of `useOsdkList` with the where clause will only trigger one
40
+ * Two uses of `useOsdkObjects` with the where clause will only trigger one
41
41
  * network request if the second is within `dedupeIntervalMs`.
42
42
  */
43
43
  dedupeIntervalMs?: number;
@@ -49,11 +49,11 @@ export interface UseOsdkListOptions<T extends ObjectTypeDefinition> {
49
49
  */
50
50
  streamUpdates?: boolean;
51
51
  }
52
- export interface UseOsdkListResult<T extends ObjectTypeDefinition> {
52
+ export interface UseOsdkListResult<T extends ObjectTypeDefinition | InterfaceDefinition> {
53
53
  fetchMore: (() => Promise<unknown>) | undefined;
54
- data: Osdk.Instance<T>[];
54
+ data: Osdk.Instance<T>[] | undefined;
55
55
  isLoading: boolean;
56
- error: undefined;
56
+ error: Error | undefined;
57
57
  /**
58
58
  * Refers to whether the ordered list of objects (only considering the $primaryKey)
59
59
  * is optimistic or not.
@@ -63,4 +63,4 @@ export interface UseOsdkListResult<T extends ObjectTypeDefinition> {
63
63
  */
64
64
  isOptimistic: boolean;
65
65
  }
66
- export declare function useOsdkList<T extends ObjectTypeDefinition>(objectType: T, { pageSize, orderBy, dedupeIntervalMs, where, streamUpdates }: UseOsdkListOptions<T>): UseOsdkListResult<T>;
66
+ export declare function useOsdkObjects<Q extends ObjectTypeDefinition | InterfaceDefinition>(type: Q, { pageSize, orderBy, dedupeIntervalMs, where, streamUpdates }?: UseOsdkObjectsOptions<Q>): UseOsdkListResult<Q>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cACE,qBACA,sBACA,MACA,cACA,mBACK,cAAe;AAMtB,iBAAiB,sBACf,UAAU,uBAAuB,qBACjC;;;;CAIA,QAAQ,YAAY;;;;CAKpB;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCnC;;;;;;;CAUA;AACD;AAED,iBAAiB,kBACf,UAAU,uBAAuB,qBACjC;CACA,kBAAkB;CAClB,MAAM,KAAK,SAAS;CACpB;CAGA,OAAO;;;;;;;;CASP;AACD;AAQD,OAAO,iBAAS,eACd,UAAU,uBAAuB,qBAEjCA,MAAM,GACN,EACE,UACA,SACA,kBACA,OACA,eACyB,GAAxB,sBAAsB,KACxB,kBAAkB","names":["type: Q"],"sources":["../../../src/new/useOsdkObjects.ts"],"version":3,"file":"useOsdkObjects.d.ts"}
@@ -1,5 +1,5 @@
1
1
  export { OsdkProvider2 } from "../new/OsdkProvider2.js";
2
2
  export { useOsdkAction } from "../new/useOsdkAction.js";
3
- export { useOsdkList } from "../new/useOsdkList.js";
4
3
  export { useOsdkObject } from "../new/useOsdkObject.js";
4
+ export { useOsdkObjects } from "../new/useOsdkObjects.js";
5
5
  export { useOsdkClient } from "../useOsdkClient.js";
@@ -1 +1 @@
1
- {"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
1
+ {"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/react",
3
- "version": "0.4.0-beta.2",
3
+ "version": "0.4.0-beta.4",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,8 +49,8 @@
49
49
  "p-defer": "^4.0.1",
50
50
  "react": "^18.0.0",
51
51
  "typescript": "~5.5.4",
52
- "@osdk/api": "2.2.0-beta.4",
53
- "@osdk/client": "2.2.0-beta.4",
52
+ "@osdk/api": "2.2.0-beta.9",
53
+ "@osdk/client": "2.2.0-beta.9",
54
54
  "@osdk/monorepo.tsconfig": "~0.1.0-beta.1",
55
55
  "@osdk/monorepo.api-extractor": "~0.1.0-beta.1"
56
56
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOsdkList.js","names":["React","makeExternalStore","OsdkContext2","useOsdkList","objectType","pageSize","orderBy","dedupeIntervalMs","where","streamUpdates","store","useContext","canonWhere","canonicalizeWhereClause","subscribe","getSnapShot","useMemo","x","observeList","dedupeInterval","process","env","NODE_ENV","apiName","JSON","stringify","listPayload","useSyncExternalStore","fetchMore","data","resolvedList","isLoading","status","error","undefined","isOptimistic"],"sources":["useOsdkList.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 ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n WhereClause,\n} from \"@osdk/client\";\nimport type { ListPayload } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\nexport interface UseOsdkListOptions<T extends ObjectTypeDefinition> {\n /**\n * Standard OSDK Where\n */\n where?: WhereClause<T>;\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /** */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\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 // autoFetchMore?: boolean | number;\n\n /**\n * Upon a list being revalidated, this option determines how the component\n * will be re-rendered with the data.\n *\n * An example to help understand the options:\n *\n * Suppose pageSize is 10 and we have called `fetchMore()` twice. The list is\n * now 30 items long.\n *\n * Upon revalidation, we get the first 10 items of the list. The options behave\n * as follows:\n *\n * - `\"in-place\"`: The first 10 items of the list are replaced with the new 10\n * items. The list is now 30 items long, but only the first 10 items are valid.\n * - `\"wait\"`: The old list is returned until after the next 20 items are loaded\n * (which will happen automatically). The list is now 30 items long.\n * - `\"reset\"`: The entire list is replaced with the new 10 items. The list is\n * now 10 items long.\n */\n // invalidationMode?: \"in-place\" | \"wait\" | \"reset\";\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkList` with the where clause will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * If provided, the list will be considered this length for the purposes of\n * `invalidationMode` when using the `wait` option. If not provided,\n * the internal expectedLength will be determined by the number of times\n * `fetchMore` has been called.\n */\n // expectedLength?: number | undefined;\n\n streamUpdates?: boolean;\n}\n\nexport interface UseOsdkListResult<T extends ObjectTypeDefinition> {\n fetchMore: (() => Promise<unknown>) | undefined;\n data: Osdk.Instance<T>[];\n isLoading: boolean;\n\n // FIXME populate error!\n 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\ndeclare const process: {\n env: {\n NODE_ENV: \"development\" | \"production\";\n };\n};\n\nexport function useOsdkList<T extends ObjectTypeDefinition>(\n objectType: T,\n { pageSize, orderBy, dedupeIntervalMs, where, streamUpdates }:\n UseOsdkListOptions<T>,\n): UseOsdkListResult<T> {\n const { store } = React.useContext(OsdkContext2);\n\n /* We want the canonical where clause so that the use of `React.useMemo`\n is stable. No real added cost as we canonicalize internal to\n the ObservableClient anyway.\n */\n const canonWhere = store.canonicalizeWhereClause(where ?? {});\n\n const { subscribe, getSnapShot } = React.useMemo(\n () =>\n makeExternalStore<ListPayload>(\n (x) =>\n store.observeList({\n objectType,\n where: canonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy,\n streamUpdates,\n }, x),\n process.env.NODE_ENV !== \"production\"\n ? `list ${objectType.apiName} ${JSON.stringify(canonWhere)}`\n : void 0,\n ),\n [store, objectType, canonWhere, dedupeIntervalMs],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n return {\n fetchMore: listPayload?.fetchMore,\n data: listPayload?.resolvedList as Osdk.Instance<T>[],\n isLoading: listPayload?.status === \"loading\",\n error: undefined,\n isOptimistic: listPayload?.isOptimistic ?? false,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;AAyFhD,OAAO,SAASC,WAAWA,CACzBC,UAAa,EACb;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,gBAAgB;EAAEC,KAAK;EAAEC;AACxB,CAAC,EACD;EACtB,MAAM;IAAEC;EAAM,CAAC,GAAGV,KAAK,CAACW,UAAU,CAACT,YAAY,CAAC;;EAEhD;AACF;AACA;AACA;EACE,MAAMU,UAAU,GAAGF,KAAK,CAACG,uBAAuB,CAACL,KAAK,IAAI,CAAC,CAAC,CAAC;EAE7D,MAAM;IAAEM,SAAS;IAAEC;EAAY,CAAC,GAAGf,KAAK,CAACgB,OAAO,CAC9C,MACEf,iBAAiB,CACdgB,CAAC,IACAP,KAAK,CAACQ,WAAW,CAAC;IAChBd,UAAU;IACVI,KAAK,EAAEI,UAAU;IACjBO,cAAc,EAAEZ,gBAAgB,IAAI,KAAK;IACzCF,QAAQ;IACRC,OAAO;IACPG;EACF,CAAC,EAAEQ,CAAC,CAAC,EACPG,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACjC,QAAQlB,UAAU,CAACmB,OAAO,IAAIC,IAAI,CAACC,SAAS,CAACb,UAAU,CAAC,EAAE,GAC1D,KAAK,CACX,CAAC,EACH,CAACF,KAAK,EAAEN,UAAU,EAAEQ,UAAU,EAAEL,gBAAgB,CAClD,CAAC;EAED,MAAMmB,WAAW,GAAG1B,KAAK,CAAC2B,oBAAoB,CAACb,SAAS,EAAEC,WAAW,CAAC;EAEtE,OAAO;IACLa,SAAS,EAAEF,WAAW,EAAEE,SAAS;IACjCC,IAAI,EAAEH,WAAW,EAAEI,YAAkC;IACrDC,SAAS,EAAEL,WAAW,EAAEM,MAAM,KAAK,SAAS;IAC5CC,KAAK,EAAEC,SAAS;IAChBC,YAAY,EAAET,WAAW,EAAES,YAAY,IAAI;EAC7C,CAAC;AACH","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOsdkList.js","names":["React","makeExternalStore","OsdkContext2","useOsdkList","objectType","pageSize","orderBy","dedupeIntervalMs","where","streamUpdates","store","useContext","canonWhere","canonicalizeWhereClause","subscribe","getSnapShot","useMemo","x","observeList","dedupeInterval","process","env","NODE_ENV","apiName","JSON","stringify","listPayload","useSyncExternalStore","fetchMore","data","resolvedList","isLoading","status","error","undefined","isOptimistic"],"sources":["useOsdkList.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 ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n WhereClause,\n} from \"@osdk/client\";\nimport type { ListPayload } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\nexport interface UseOsdkListOptions<T extends ObjectTypeDefinition> {\n /**\n * Standard OSDK Where\n */\n where?: WhereClause<T>;\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /** */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\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 // autoFetchMore?: boolean | number;\n\n /**\n * Upon a list being revalidated, this option determines how the component\n * will be re-rendered with the data.\n *\n * An example to help understand the options:\n *\n * Suppose pageSize is 10 and we have called `fetchMore()` twice. The list is\n * now 30 items long.\n *\n * Upon revalidation, we get the first 10 items of the list. The options behave\n * as follows:\n *\n * - `\"in-place\"`: The first 10 items of the list are replaced with the new 10\n * items. The list is now 30 items long, but only the first 10 items are valid.\n * - `\"wait\"`: The old list is returned until after the next 20 items are loaded\n * (which will happen automatically). The list is now 30 items long.\n * - `\"reset\"`: The entire list is replaced with the new 10 items. The list is\n * now 10 items long.\n */\n // invalidationMode?: \"in-place\" | \"wait\" | \"reset\";\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkList` with the where clause will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * If provided, the list will be considered this length for the purposes of\n * `invalidationMode` when using the `wait` option. If not provided,\n * the internal expectedLength will be determined by the number of times\n * `fetchMore` has been called.\n */\n // expectedLength?: number | undefined;\n\n streamUpdates?: boolean;\n}\n\nexport interface UseOsdkListResult<T extends ObjectTypeDefinition> {\n fetchMore: (() => Promise<unknown>) | undefined;\n data: Osdk.Instance<T>[];\n isLoading: boolean;\n\n // FIXME populate error!\n 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\ndeclare const process: {\n env: {\n NODE_ENV: \"development\" | \"production\";\n };\n};\n\nexport function useOsdkList<T extends ObjectTypeDefinition>(\n objectType: T,\n { pageSize, orderBy, dedupeIntervalMs, where, streamUpdates }:\n UseOsdkListOptions<T>,\n): UseOsdkListResult<T> {\n const { store } = React.useContext(OsdkContext2);\n\n /* We want the canonical where clause so that the use of `React.useMemo`\n is stable. No real added cost as we canonicalize internal to\n the ObservableClient anyway.\n */\n const canonWhere = store.canonicalizeWhereClause(where ?? {});\n\n const { subscribe, getSnapShot } = React.useMemo(\n () =>\n makeExternalStore<ListPayload>(\n (x) =>\n store.observeList({\n objectType,\n where: canonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy,\n streamUpdates,\n }, x),\n process.env.NODE_ENV !== \"production\"\n ? `list ${objectType.apiName} ${JSON.stringify(canonWhere)}`\n : void 0,\n ),\n [store, objectType, canonWhere, dedupeIntervalMs],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n return {\n fetchMore: listPayload?.fetchMore,\n data: listPayload?.resolvedList as Osdk.Instance<T>[],\n isLoading: listPayload?.status === \"loading\",\n error: undefined,\n isOptimistic: listPayload?.isOptimistic ?? false,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;AAyFhD,OAAO,SAASC,WAAWA,CACzBC,UAAa,EACb;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,gBAAgB;EAAEC,KAAK;EAAEC;AACxB,CAAC,EACD;EACtB,MAAM;IAAEC;EAAM,CAAC,GAAGV,KAAK,CAACW,UAAU,CAACT,YAAY,CAAC;;EAEhD;AACF;AACA;AACA;EACE,MAAMU,UAAU,GAAGF,KAAK,CAACG,uBAAuB,CAACL,KAAK,IAAI,CAAC,CAAC,CAAC;EAE7D,MAAM;IAAEM,SAAS;IAAEC;EAAY,CAAC,GAAGf,KAAK,CAACgB,OAAO,CAC9C,MACEf,iBAAiB,CACdgB,CAAC,IACAP,KAAK,CAACQ,WAAW,CAAC;IAChBd,UAAU;IACVI,KAAK,EAAEI,UAAU;IACjBO,cAAc,EAAEZ,gBAAgB,IAAI,KAAK;IACzCF,QAAQ;IACRC,OAAO;IACPG;EACF,CAAC,EAAEQ,CAAC,CAAC,EACPG,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACjC,QAAQlB,UAAU,CAACmB,OAAO,IAAIC,IAAI,CAACC,SAAS,CAACb,UAAU,CAAC,EAAE,GAC1D,KAAK,CACX,CAAC,EACH,CAACF,KAAK,EAAEN,UAAU,EAAEQ,UAAU,EAAEL,gBAAgB,CAClD,CAAC;EAED,MAAMmB,WAAW,GAAG1B,KAAK,CAAC2B,oBAAoB,CAACb,SAAS,EAAEC,WAAW,CAAC;EAEtE,OAAO;IACLa,SAAS,EAAEF,WAAW,EAAEE,SAAS;IACjCC,IAAI,EAAEH,WAAW,EAAEI,YAAkC;IACrDC,SAAS,EAAEL,WAAW,EAAEM,MAAM,KAAK,SAAS;IAC5CC,KAAK,EAAEC,SAAS;IAChBC,YAAY,EAAET,WAAW,EAAES,YAAY,IAAI;EAC7C,CAAC;AACH","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"mappings":"AAgBA,cACE,sBACA,MACA,cACA,mBACK,cAAe;AAMtB,iBAAiB,mBAAmB,UAAU,sBAAsB;;;;CAIlE,QAAQ,YAAY;;;;CAKpB;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCnC;;;;;;;CAUA;AACD;AAED,iBAAiB,kBAAkB,UAAU,sBAAsB;CACjE,kBAAkB;CAClB,MAAM,KAAK,SAAS;CACpB;CAGA;;;;;;;;CASA;AACD;AAQD,OAAO,iBAAS,YAAY,UAAU,sBACpCA,YAAY,GACZ,EAAE,UAAU,SAAS,kBAAkB,OAAO,eACvB,EAArB,mBAAmB,KACpB,kBAAkB","names":["objectType: T"],"sources":["../../../src/new/useOsdkList.ts"],"version":3,"file":"useOsdkList.d.ts"}