@seamapi/react 2.1.4 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/elements.js +1040 -1033
- package/dist/elements.js.map +1 -1
- package/lib/seam/connect-webviews/use-create-connect-webview.js +10 -1
- package/lib/seam/connect-webviews/use-create-connect-webview.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/lib/seam/connect-webviews/use-create-connect-webview.ts +10 -1
- package/src/lib/version.ts +1 -1
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { useClientSession } from '../../../lib/seam/client-sessions/use-client-session.js';
|
|
2
3
|
import { NullSeamClientError, useSeamClient } from '../../../lib/seam/use-seam-client.js';
|
|
3
4
|
export function useCreateConnectWebview({ willNavigateToWebview = false, } = {}) {
|
|
4
5
|
const { client } = useSeamClient();
|
|
6
|
+
const { clientSession } = useClientSession();
|
|
5
7
|
return useMutation({
|
|
6
8
|
mutationFn: async (mutationParams) => {
|
|
7
9
|
if (client === null)
|
|
8
10
|
throw new NullSeamClientError();
|
|
9
|
-
return await client.connectWebviews.create(
|
|
11
|
+
return await client.connectWebviews.create({
|
|
12
|
+
custom_metadata: {
|
|
13
|
+
client_session_id: clientSession?.client_session_id ?? null,
|
|
14
|
+
user_identifier_key: clientSession?.user_identifier_key ?? null,
|
|
15
|
+
...mutationParams.custom_metadata,
|
|
16
|
+
},
|
|
17
|
+
...mutationParams,
|
|
18
|
+
});
|
|
10
19
|
},
|
|
11
20
|
onSuccess: ({ url }) => {
|
|
12
21
|
if (willNavigateToWebview && url != null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-create-connect-webview.js","sourceRoot":"","sources":["../../../src/lib/seam/connect-webviews/use-create-connect-webview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA0B,MAAM,uBAAuB,CAAA;AAQ3E,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAShF,MAAM,UAAU,uBAAuB,CAAC,EACtC,qBAAqB,GAAG,KAAK,MACI,EAAE;IAKnC,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"use-create-connect-webview.js","sourceRoot":"","sources":["../../../src/lib/seam/connect-webviews/use-create-connect-webview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA0B,MAAM,uBAAuB,CAAA;AAQ3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAA;AACjF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAShF,MAAM,UAAU,uBAAuB,CAAC,EACtC,qBAAqB,GAAG,KAAK,MACI,EAAE;IAKnC,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,aAAa,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAE5C,OAAO,WAAW,CAIhB;QACA,UAAU,EAAE,KAAK,EACf,cAAqD,EACrD,EAAE;YACF,IAAI,MAAM,KAAK,IAAI;gBAAE,MAAM,IAAI,mBAAmB,EAAE,CAAA;YACpD,OAAO,MAAM,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC;gBACzC,eAAe,EAAE;oBACf,iBAAiB,EAAE,aAAa,EAAE,iBAAiB,IAAI,IAAI;oBAC3D,mBAAmB,EAAE,aAAa,EAAE,mBAAmB,IAAI,IAAI;oBAC/D,GAAG,cAAc,CAAC,eAAe;iBAClC;gBACD,GAAG,cAAc;aAClB,CAAC,CAAA;QACJ,CAAC;QACD,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;YACrB,IAAI,qBAAqB,IAAI,GAAG,IAAI,IAAI,EAAE;gBACxC,UAAU,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAA;aAC/B;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const seamapiReactVersion = "2.
|
|
1
|
+
declare const seamapiReactVersion = "2.2.0";
|
|
2
2
|
export default seamapiReactVersion;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
SeamError,
|
|
7
7
|
} from 'seamapi'
|
|
8
8
|
|
|
9
|
+
import { useClientSession } from 'lib/seam/client-sessions/use-client-session.js'
|
|
9
10
|
import { NullSeamClientError, useSeamClient } from 'lib/seam/use-seam-client.js'
|
|
10
11
|
|
|
11
12
|
export interface UseCreateConnectWebviewParams {
|
|
@@ -23,6 +24,7 @@ export function useCreateConnectWebview({
|
|
|
23
24
|
UseCreateConnectWebviewMutationParams
|
|
24
25
|
> {
|
|
25
26
|
const { client } = useSeamClient()
|
|
27
|
+
const { clientSession } = useClientSession()
|
|
26
28
|
|
|
27
29
|
return useMutation<
|
|
28
30
|
ConnectWebviewCreateResponse['connect_webview'],
|
|
@@ -33,7 +35,14 @@ export function useCreateConnectWebview({
|
|
|
33
35
|
mutationParams: UseCreateConnectWebviewMutationParams
|
|
34
36
|
) => {
|
|
35
37
|
if (client === null) throw new NullSeamClientError()
|
|
36
|
-
return await client.connectWebviews.create(
|
|
38
|
+
return await client.connectWebviews.create({
|
|
39
|
+
custom_metadata: {
|
|
40
|
+
client_session_id: clientSession?.client_session_id ?? null,
|
|
41
|
+
user_identifier_key: clientSession?.user_identifier_key ?? null,
|
|
42
|
+
...mutationParams.custom_metadata,
|
|
43
|
+
},
|
|
44
|
+
...mutationParams,
|
|
45
|
+
})
|
|
37
46
|
},
|
|
38
47
|
onSuccess: ({ url }) => {
|
|
39
48
|
if (willNavigateToWebview && url != null) {
|
package/src/lib/version.ts
CHANGED