@osdk/react 0.12.0 → 0.12.1-main-6b2c638658dbe4aad3cb1b827607371baec6fb32

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 (40) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/browser/new/OsdkProvider2.js +15 -4
  3. package/build/browser/new/OsdkProvider2.js.map +1 -1
  4. package/build/browser/new/UserAgentContext.js +19 -0
  5. package/build/browser/new/UserAgentContext.js.map +1 -0
  6. package/build/browser/new/core/useOnMount.js +31 -0
  7. package/build/browser/new/core/useOnMount.js.map +1 -0
  8. package/build/browser/new/useRegisterUserAgent.js +26 -0
  9. package/build/browser/new/useRegisterUserAgent.js.map +1 -0
  10. package/build/browser/public/experimental.js +1 -0
  11. package/build/browser/public/experimental.js.map +1 -1
  12. package/build/browser/util/UserAgent.js +18 -0
  13. package/build/browser/util/UserAgent.js.map +1 -0
  14. package/build/cjs/public/experimental.cjs +98 -73
  15. package/build/cjs/public/experimental.cjs.map +1 -1
  16. package/build/cjs/public/experimental.d.cts +3 -1
  17. package/build/esm/new/OsdkProvider2.js +15 -4
  18. package/build/esm/new/OsdkProvider2.js.map +1 -1
  19. package/build/esm/new/UserAgentContext.js +19 -0
  20. package/build/esm/new/UserAgentContext.js.map +1 -0
  21. package/build/esm/new/core/useOnMount.js +31 -0
  22. package/build/esm/new/core/useOnMount.js.map +1 -0
  23. package/build/esm/new/useRegisterUserAgent.js +26 -0
  24. package/build/esm/new/useRegisterUserAgent.js.map +1 -0
  25. package/build/esm/public/experimental.js +1 -0
  26. package/build/esm/public/experimental.js.map +1 -1
  27. package/build/esm/util/UserAgent.js +18 -0
  28. package/build/esm/util/UserAgent.js.map +1 -0
  29. package/build/types/new/OsdkProvider2.d.ts.map +1 -1
  30. package/build/types/new/UserAgentContext.d.ts +3 -0
  31. package/build/types/new/UserAgentContext.d.ts.map +1 -0
  32. package/build/types/new/core/useOnMount.d.ts +9 -0
  33. package/build/types/new/core/useOnMount.d.ts.map +1 -0
  34. package/build/types/new/useRegisterUserAgent.d.ts +1 -0
  35. package/build/types/new/useRegisterUserAgent.d.ts.map +1 -0
  36. package/build/types/public/experimental.d.ts +1 -0
  37. package/build/types/public/experimental.d.ts.map +1 -1
  38. package/build/types/util/UserAgent.d.ts +1 -0
  39. package/build/types/util/UserAgent.d.ts.map +1 -0
  40. package/package.json +9 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @osdkkit/react
2
2
 
3
+ ## 0.12.1-main-6b2c638658dbe4aad3cb1b827607371baec6fb32
4
+
5
+ ### Patch Changes
6
+
7
+ - 58248f8: Move @osdk/client.test.ontology from peerDependencies to devDependencies to fix npm resolution errors in consuming repos
8
+ - e456da5: Add Fetch-User-Agent tracing headers for React layer network calls
9
+ - Updated dependencies [58248f8]
10
+ - Updated dependencies [e456da5]
11
+ - @osdk/client@2.10.1-main-6b2c638658dbe4aad3cb1b827607371baec6fb32
12
+ - @osdk/api@2.10.1-main-6b2c638658dbe4aad3cb1b827607371baec6fb32
13
+
3
14
  ## 0.12.0
4
15
 
5
16
  ### Minor Changes
@@ -15,11 +15,13 @@
15
15
  */
16
16
 
17
17
  import { createObservableClient } from "@osdk/client/unstable-do-not-use";
18
- import React, { useMemo } from "react";
18
+ import React, { useCallback, useMemo, useRef } from "react";
19
19
  import { OsdkContext } from "../OsdkContext.js";
20
20
  import { getRegisteredDevTools } from "../public/devtools-registry.js";
21
+ import { REACT_USER_AGENT } from "../util/UserAgent.js";
21
22
  import { OsdkContext2 } from "./OsdkContext2.js";
22
23
  import { useDevToolsClient } from "./useDevToolsClient.js";
24
+ import { UserAgentContext } from "./UserAgentContext.js";
23
25
  const __DEV__ = typeof process === "undefined" || process.env.NODE_ENV !== "production";
24
26
  export function OsdkProvider2({
25
27
  children,
@@ -28,7 +30,14 @@ export function OsdkProvider2({
28
30
  enableDevTools
29
31
  }) {
30
32
  const devtoolsEnabled = __DEV__ && (enableDevTools ?? getRegisteredDevTools() != null);
31
- const baseObservableClient = useMemo(() => observableClient ?? createObservableClient(client), [client, observableClient]);
33
+ const userAgentsRef = useRef(new Set([REACT_USER_AGENT]));
34
+ const addUserAgent = useCallback(agent => {
35
+ userAgentsRef.current.add(agent);
36
+ return () => {
37
+ userAgentsRef.current.delete(agent);
38
+ };
39
+ }, []);
40
+ const baseObservableClient = useMemo(() => observableClient ?? createObservableClient(client, () => [...userAgentsRef.current]), [client, observableClient]);
32
41
  const {
33
42
  client: devToolsClient,
34
43
  wrapChildren
@@ -39,12 +48,14 @@ export function OsdkProvider2({
39
48
  observableClient: devToolsClient,
40
49
  devtoolsEnabled
41
50
  }), [client, devToolsClient, devtoolsEnabled]);
42
- return /*#__PURE__*/React.createElement(OsdkContext2.Provider, {
51
+ return /*#__PURE__*/React.createElement(UserAgentContext.Provider, {
52
+ value: addUserAgent
53
+ }, /*#__PURE__*/React.createElement(OsdkContext2.Provider, {
43
54
  value: contextValue
44
55
  }, /*#__PURE__*/React.createElement(OsdkContext.Provider, {
45
56
  value: {
46
57
  client
47
58
  }
48
- }, content));
59
+ }, content)));
49
60
  }
50
61
  //# sourceMappingURL=OsdkProvider2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkProvider2.js","names":["createObservableClient","React","useMemo","OsdkContext","getRegisteredDevTools","OsdkContext2","useDevToolsClient","__DEV__","process","env","NODE_ENV","OsdkProvider2","children","client","observableClient","enableDevTools","devtoolsEnabled","baseObservableClient","devToolsClient","wrapChildren","content","contextValue","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 { OsdkContext } from \"../OsdkContext.js\";\nimport { getRegisteredDevTools } from \"../public/devtools-registry.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nimport { useDevToolsClient } from \"./useDevToolsClient.js\";\n\ndeclare const process: { env: { NODE_ENV: string } };\nconst __DEV__ = typeof process === \"undefined\"\n || process.env.NODE_ENV !== \"production\";\n\ninterface OsdkProviderOptions {\n children: React.ReactNode;\n client: Client;\n observableClient?: ObservableClient;\n enableDevTools?: boolean;\n}\n\nexport function OsdkProvider2({\n children,\n client,\n observableClient,\n enableDevTools,\n}: OsdkProviderOptions): React.JSX.Element {\n const devtoolsEnabled = __DEV__\n && (enableDevTools ?? getRegisteredDevTools() != null);\n\n const baseObservableClient = useMemo(\n () => observableClient ?? createObservableClient(client),\n [client, observableClient],\n );\n\n const { client: devToolsClient, wrapChildren } = useDevToolsClient(\n baseObservableClient,\n devtoolsEnabled,\n );\n\n const content = wrapChildren?.(children) ?? children;\n\n const contextValue = useMemo(\n () => ({ client, observableClient: devToolsClient, devtoolsEnabled }),\n [client, devToolsClient, devtoolsEnabled],\n );\n\n return (\n <OsdkContext2.Provider\n value={contextValue}\n >\n <OsdkContext.Provider value={{ client }}>\n {content}\n </OsdkContext.Provider>\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,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,iBAAiB,QAAQ,wBAAwB;AAG1D,MAAMC,OAAO,GAAG,OAAOC,OAAO,KAAK,WAAW,IACzCA,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY;AAS1C,OAAO,SAASC,aAAaA,CAAC;EAC5BC,QAAQ;EACRC,MAAM;EACNC,gBAAgB;EAChBC;AACmB,CAAC,EAAqB;EACzC,MAAMC,eAAe,GAAGT,OAAO,KACzBQ,cAAc,IAAIX,qBAAqB,CAAC,CAAC,IAAI,IAAI,CAAC;EAExD,MAAMa,oBAAoB,GAAGf,OAAO,CAClC,MAAMY,gBAAgB,IAAId,sBAAsB,CAACa,MAAM,CAAC,EACxD,CAACA,MAAM,EAAEC,gBAAgB,CAC3B,CAAC;EAED,MAAM;IAAED,MAAM,EAAEK,cAAc;IAAEC;EAAa,CAAC,GAAGb,iBAAiB,CAChEW,oBAAoB,EACpBD,eACF,CAAC;EAED,MAAMI,OAAO,GAAGD,YAAY,GAAGP,QAAQ,CAAC,IAAIA,QAAQ;EAEpD,MAAMS,YAAY,GAAGnB,OAAO,CAC1B,OAAO;IAAEW,MAAM;IAAEC,gBAAgB,EAAEI,cAAc;IAAEF;EAAgB,CAAC,CAAC,EACrE,CAACH,MAAM,EAAEK,cAAc,EAAEF,eAAe,CAC1C,CAAC;EAED,oBACEf,KAAA,CAAAqB,aAAA,CAACjB,YAAY,CAACkB,QAAQ;IACpBC,KAAK,EAAEH;EAAa,gBAEpBpB,KAAA,CAAAqB,aAAA,CAACnB,WAAW,CAACoB,QAAQ;IAACC,KAAK,EAAE;MAAEX;IAAO;EAAE,GACrCO,OACmB,CACD,CAAC;AAE5B","ignoreList":[]}
1
+ {"version":3,"file":"OsdkProvider2.js","names":["createObservableClient","React","useCallback","useMemo","useRef","OsdkContext","getRegisteredDevTools","REACT_USER_AGENT","OsdkContext2","useDevToolsClient","UserAgentContext","__DEV__","process","env","NODE_ENV","OsdkProvider2","children","client","observableClient","enableDevTools","devtoolsEnabled","userAgentsRef","Set","addUserAgent","agent","current","add","delete","baseObservableClient","devToolsClient","wrapChildren","content","contextValue","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, { useCallback, useMemo, useRef } from \"react\";\nimport { OsdkContext } from \"../OsdkContext.js\";\nimport { getRegisteredDevTools } from \"../public/devtools-registry.js\";\nimport { REACT_USER_AGENT } from \"../util/UserAgent.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nimport { useDevToolsClient } from \"./useDevToolsClient.js\";\nimport { UserAgentContext } from \"./UserAgentContext.js\";\n\ndeclare const process: { env: { NODE_ENV: string } };\nconst __DEV__ = typeof process === \"undefined\"\n || process.env.NODE_ENV !== \"production\";\n\ninterface OsdkProviderOptions {\n children: React.ReactNode;\n client: Client;\n observableClient?: ObservableClient;\n enableDevTools?: boolean;\n}\n\nexport function OsdkProvider2({\n children,\n client,\n observableClient,\n enableDevTools,\n}: OsdkProviderOptions): React.JSX.Element {\n const devtoolsEnabled = __DEV__\n && (enableDevTools ?? getRegisteredDevTools() != null);\n\n const userAgentsRef = useRef(new Set<string>([REACT_USER_AGENT]));\n\n const addUserAgent = useCallback((agent: string) => {\n userAgentsRef.current.add(agent);\n return () => {\n userAgentsRef.current.delete(agent);\n };\n }, []);\n\n const baseObservableClient = useMemo(\n () =>\n observableClient\n ?? createObservableClient(\n client,\n () => [...userAgentsRef.current],\n ),\n [client, observableClient],\n );\n\n const { client: devToolsClient, wrapChildren } = useDevToolsClient(\n baseObservableClient,\n devtoolsEnabled,\n );\n\n const content = wrapChildren?.(children) ?? children;\n\n const contextValue = useMemo(\n () => ({ client, observableClient: devToolsClient, devtoolsEnabled }),\n [client, devToolsClient, devtoolsEnabled],\n );\n\n return (\n <UserAgentContext.Provider value={addUserAgent}>\n <OsdkContext2.Provider\n value={contextValue}\n >\n <OsdkContext.Provider value={{ client }}>\n {content}\n </OsdkContext.Provider>\n </OsdkContext2.Provider>\n </UserAgentContext.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,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC3D,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,gBAAgB,QAAQ,uBAAuB;AAGxD,MAAMC,OAAO,GAAG,OAAOC,OAAO,KAAK,WAAW,IACzCA,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY;AAS1C,OAAO,SAASC,aAAaA,CAAC;EAC5BC,QAAQ;EACRC,MAAM;EACNC,gBAAgB;EAChBC;AACmB,CAAC,EAAqB;EACzC,MAAMC,eAAe,GAAGT,OAAO,KACzBQ,cAAc,IAAIb,qBAAqB,CAAC,CAAC,IAAI,IAAI,CAAC;EAExD,MAAMe,aAAa,GAAGjB,MAAM,CAAC,IAAIkB,GAAG,CAAS,CAACf,gBAAgB,CAAC,CAAC,CAAC;EAEjE,MAAMgB,YAAY,GAAGrB,WAAW,CAAEsB,KAAa,IAAK;IAClDH,aAAa,CAACI,OAAO,CAACC,GAAG,CAACF,KAAK,CAAC;IAChC,OAAO,MAAM;MACXH,aAAa,CAACI,OAAO,CAACE,MAAM,CAACH,KAAK,CAAC;IACrC,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMI,oBAAoB,GAAGzB,OAAO,CAClC,MACEe,gBAAgB,IACXlB,sBAAsB,CACvBiB,MAAM,EACN,MAAM,CAAC,GAAGI,aAAa,CAACI,OAAO,CACjC,CAAC,EACL,CAACR,MAAM,EAAEC,gBAAgB,CAC3B,CAAC;EAED,MAAM;IAAED,MAAM,EAAEY,cAAc;IAAEC;EAAa,CAAC,GAAGrB,iBAAiB,CAChEmB,oBAAoB,EACpBR,eACF,CAAC;EAED,MAAMW,OAAO,GAAGD,YAAY,GAAGd,QAAQ,CAAC,IAAIA,QAAQ;EAEpD,MAAMgB,YAAY,GAAG7B,OAAO,CAC1B,OAAO;IAAEc,MAAM;IAAEC,gBAAgB,EAAEW,cAAc;IAAET;EAAgB,CAAC,CAAC,EACrE,CAACH,MAAM,EAAEY,cAAc,EAAET,eAAe,CAC1C,CAAC;EAED,oBACEnB,KAAA,CAAAgC,aAAA,CAACvB,gBAAgB,CAACwB,QAAQ;IAACC,KAAK,EAAEZ;EAAa,gBAC7CtB,KAAA,CAAAgC,aAAA,CAACzB,YAAY,CAAC0B,QAAQ;IACpBC,KAAK,EAAEH;EAAa,gBAEpB/B,KAAA,CAAAgC,aAAA,CAAC5B,WAAW,CAAC6B,QAAQ;IAACC,KAAK,EAAE;MAAElB;IAAO;EAAE,GACrCc,OACmB,CACD,CACE,CAAC;AAEhC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ export const UserAgentContext = /*#__PURE__*/React.createContext(() => () => {});
19
+ //# sourceMappingURL=UserAgentContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserAgentContext.js","names":["React","UserAgentContext","createContext"],"sources":["UserAgentContext.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 React from \"react\";\n\nexport type AddUserAgent = (agent: string) => () => void;\n\nexport const UserAgentContext: React.Context<AddUserAgent> = React\n .createContext<AddUserAgent>(\n () => () => {},\n );\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAIzB,OAAO,MAAMC,gBAA6C,gBAAGD,KAAK,CAC/DE,aAAa,CACZ,MAAM,MAAM,CAAC,CACf,CAAC","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { useEffect } from "react";
18
+
19
+ /**
20
+ * Runs an effect exactly once on mount. The callback's return value
21
+ * is used as the cleanup function, just like `useEffect`.
22
+ *
23
+ * This is a semantic wrapper around `useEffect(() => …, [])` that
24
+ * makes the intent explicit and avoids needing an eslint-disable
25
+ * for `react-hooks/exhaustive-deps`.
26
+ */
27
+ export function useOnMount(effect) {
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
29
+ useEffect(effect, []);
30
+ }
31
+ //# sourceMappingURL=useOnMount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnMount.js","names":["useEffect","useOnMount","effect"],"sources":["useOnMount.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { useEffect } from \"react\";\n\n/**\n * Runs an effect exactly once on mount. The callback's return value\n * is used as the cleanup function, just like `useEffect`.\n *\n * This is a semantic wrapper around `useEffect(() => …, [])` that\n * makes the intent explicit and avoids needing an eslint-disable\n * for `react-hooks/exhaustive-deps`.\n */\nexport function useOnMount(effect: () => void | (() => void)): void {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(effect, []);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,QAAQ,OAAO;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,MAAiC,EAAQ;EAClE;EACAF,SAAS,CAACE,MAAM,EAAE,EAAE,CAAC;AACvB","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ import { useOnMount } from "./core/useOnMount.js";
19
+ import { UserAgentContext } from "./UserAgentContext.js";
20
+ export function useRegisterUserAgent(agent) {
21
+ const addUserAgent = React.useContext(UserAgentContext);
22
+ useOnMount(() => {
23
+ return addUserAgent(agent);
24
+ });
25
+ }
26
+ //# sourceMappingURL=useRegisterUserAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRegisterUserAgent.js","names":["React","useOnMount","UserAgentContext","useRegisterUserAgent","agent","addUserAgent","useContext"],"sources":["useRegisterUserAgent.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 React from \"react\";\nimport { useOnMount } from \"./core/useOnMount.js\";\nimport { UserAgentContext } from \"./UserAgentContext.js\";\n\nexport function useRegisterUserAgent(agent: string): void {\n const addUserAgent = React.useContext(UserAgentContext);\n useOnMount(() => {\n return addUserAgent(agent);\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAO,SAASC,oBAAoBA,CAACC,KAAa,EAAQ;EACxD,MAAMC,YAAY,GAAGL,KAAK,CAACM,UAAU,CAACJ,gBAAgB,CAAC;EACvDD,UAAU,CAAC,MAAM;IACf,OAAOI,YAAY,CAACD,KAAK,CAAC;EAC5B,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -23,6 +23,7 @@ export { useOsdkFunction } from "../new/useOsdkFunction.js";
23
23
  export { useOsdkFunctions } from "../new/useOsdkFunctions.js";
24
24
  export { useOsdkObject } from "../new/useOsdkObject.js";
25
25
  export { useOsdkObjects } from "../new/useOsdkObjects.js";
26
+ export { useRegisterUserAgent } from "../new/useRegisterUserAgent.js";
26
27
  export { useOsdkClient } from "../useOsdkClient.js";
27
28
  export { useOsdkMetadata } from "../useOsdkMetadata.js";
28
29
  export { useDebouncedCallback } from "../utils/useDebouncedCallback.js";
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","names":["OsdkProvider2","useLinks","useObjectSet","useOsdkAction","useOsdkAggregation","useOsdkFunction","useOsdkFunctions","useOsdkObject","useOsdkObjects","useOsdkClient","useOsdkMetadata","useDebouncedCallback","getRegisteredDevTools","registerDevTools"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OsdkProvider2 } from \"../new/OsdkProvider2.js\";\nexport { useLinks } from \"../new/useLinks.js\";\nexport { useObjectSet } from \"../new/useObjectSet.js\";\nexport { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport type { UseOsdkAggregationResult } from \"../new/useOsdkAggregation.js\";\nexport { useOsdkAggregation } from \"../new/useOsdkAggregation.js\";\nexport type {\n UseOsdkFunctionOptions,\n UseOsdkFunctionResult,\n} from \"../new/useOsdkFunction.js\";\nexport { useOsdkFunction } from \"../new/useOsdkFunction.js\";\nexport { useOsdkFunctions } from \"../new/useOsdkFunctions.js\";\nexport type {\n FunctionQueryParams,\n UseOsdkFunctionsProps,\n UseOsdkFunctionsResult,\n} from \"../new/useOsdkFunctions.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport type {\n UseOsdkListResult,\n UseOsdkObjectsOptions,\n} from \"../new/useOsdkObjects.js\";\nexport { useOsdkObjects } from \"../new/useOsdkObjects.js\";\nexport { useOsdkClient } from \"../useOsdkClient.js\";\nexport { useOsdkMetadata } from \"../useOsdkMetadata.js\";\nexport type { UseOsdkMetadataResult } from \"../useOsdkMetadata.js\";\nexport { useDebouncedCallback } from \"../utils/useDebouncedCallback.js\";\nexport type { DevToolsRegistry } from \"./devtools-registry.js\";\nexport {\n getRegisteredDevTools,\n registerDevTools,\n} from \"./devtools-registry.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,kBAAkB,QAAQ,8BAA8B;AAKjE,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,gBAAgB,QAAQ,4BAA4B;AAM7D,SAASC,aAAa,QAAQ,yBAAyB;AAKvD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,SAASC,oBAAoB,QAAQ,kCAAkC;AAEvE,SACEC,qBAAqB,EACrBC,gBAAgB,QACX,wBAAwB","ignoreList":[]}
1
+ {"version":3,"file":"experimental.js","names":["OsdkProvider2","useLinks","useObjectSet","useOsdkAction","useOsdkAggregation","useOsdkFunction","useOsdkFunctions","useOsdkObject","useOsdkObjects","useRegisterUserAgent","useOsdkClient","useOsdkMetadata","useDebouncedCallback","getRegisteredDevTools","registerDevTools"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OsdkProvider2 } from \"../new/OsdkProvider2.js\";\nexport { useLinks } from \"../new/useLinks.js\";\nexport { useObjectSet } from \"../new/useObjectSet.js\";\nexport { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport type { UseOsdkAggregationResult } from \"../new/useOsdkAggregation.js\";\nexport { useOsdkAggregation } from \"../new/useOsdkAggregation.js\";\nexport type {\n UseOsdkFunctionOptions,\n UseOsdkFunctionResult,\n} from \"../new/useOsdkFunction.js\";\nexport { useOsdkFunction } from \"../new/useOsdkFunction.js\";\nexport { useOsdkFunctions } from \"../new/useOsdkFunctions.js\";\nexport type {\n FunctionQueryParams,\n UseOsdkFunctionsProps,\n UseOsdkFunctionsResult,\n} from \"../new/useOsdkFunctions.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport type {\n UseOsdkListResult,\n UseOsdkObjectsOptions,\n} from \"../new/useOsdkObjects.js\";\nexport { useOsdkObjects } from \"../new/useOsdkObjects.js\";\nexport { useRegisterUserAgent } from \"../new/useRegisterUserAgent.js\";\nexport { useOsdkClient } from \"../useOsdkClient.js\";\nexport { useOsdkMetadata } from \"../useOsdkMetadata.js\";\nexport type { UseOsdkMetadataResult } from \"../useOsdkMetadata.js\";\nexport { useDebouncedCallback } from \"../utils/useDebouncedCallback.js\";\nexport type { DevToolsRegistry } from \"./devtools-registry.js\";\nexport {\n getRegisteredDevTools,\n registerDevTools,\n} from \"./devtools-registry.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,kBAAkB,QAAQ,8BAA8B;AAKjE,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,gBAAgB,QAAQ,4BAA4B;AAM7D,SAASC,aAAa,QAAQ,yBAAyB;AAKvD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,SAASC,oBAAoB,QAAQ,kCAAkC;AAEvE,SACEC,qBAAqB,EACrBC,gBAAgB,QACX,wBAAwB","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export const REACT_USER_AGENT = `osdk-react/${"0.12.1-main-6b2c638658dbe4aad3cb1b827607371baec6fb32"}`;
18
+ //# sourceMappingURL=UserAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserAgent.js","names":["REACT_USER_AGENT"],"sources":["UserAgent.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 const REACT_USER_AGENT: string =\n `osdk-react/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,gBAAwB,GACnC,sEAA2C","ignoreList":[]}