@descope/react-sdk 2.18.0 → 2.18.1
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/dist/cjs/constants.js +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/index.d.ts +6 -144
- package/dist/index.umd.js +2 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/types/sdk.d.ts +12 -414
- package/package.json +11 -11
package/dist/cjs/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e="undefined"!=typeof window;exports.IS_BROWSER=e,exports.baseHeaders={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.18.
|
|
1
|
+
"use strict";const e="undefined"!=typeof window;exports.IS_BROWSER=e,exports.baseHeaders={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.18.1"};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.18.
|
|
1
|
+
const e={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.18.1"},d="undefined"!=typeof window;export{d as IS_BROWSER,e as baseHeaders};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ interface IAuthProviderProps {
|
|
|
31
31
|
}
|
|
32
32
|
declare const AuthProvider: FC<IAuthProviderProps>;
|
|
33
33
|
|
|
34
|
-
declare const createSdkWrapper: <P extends
|
|
34
|
+
declare const createSdkWrapper: <P extends {
|
|
35
35
|
projectId: string;
|
|
36
36
|
logger?: {
|
|
37
37
|
error: {
|
|
@@ -53,20 +53,14 @@ declare const createSdkWrapper: <P extends Omit<{
|
|
|
53
53
|
};
|
|
54
54
|
baseUrl?: string;
|
|
55
55
|
hooks?: {
|
|
56
|
-
beforeRequest?: (config: _1.RequestConfig) => _1.RequestConfig;
|
|
57
|
-
afterRequest?: (req: _1.RequestConfig, res: Response) => void | Promise<void
|
|
56
|
+
beforeRequest?: ((config: _1.RequestConfig) => _1.RequestConfig) | ((config: _1.RequestConfig) => _1.RequestConfig)[];
|
|
57
|
+
afterRequest?: ((req: _1.RequestConfig, res: Response) => void | Promise<void>) | ((req: _1.RequestConfig, res: Response) => void | Promise<void>)[];
|
|
58
58
|
transformResponse?: (mutableResponse: _1.ExtendedResponse) => Promise<_1.ExtendedResponse>;
|
|
59
59
|
};
|
|
60
60
|
cookiePolicy?: RequestCredentials;
|
|
61
61
|
baseHeaders?: HeadersInit;
|
|
62
62
|
refreshCookieName?: string;
|
|
63
63
|
fetch?: typeof fetch;
|
|
64
|
-
}, "hooks"> & {
|
|
65
|
-
hooks?: {
|
|
66
|
-
beforeRequest?: ((config: _1.RequestConfig) => _1.RequestConfig) | ((config: _1.RequestConfig) => _1.RequestConfig)[];
|
|
67
|
-
afterRequest?: ((req: _1.RequestConfig, res: Response) => void | Promise<void>) | ((req: _1.RequestConfig, res: Response) => void | Promise<void>)[];
|
|
68
|
-
transformResponse?: (mutableResponse: _1.ExtendedResponse) => Promise<_1.ExtendedResponse>;
|
|
69
|
-
};
|
|
70
64
|
} & {
|
|
71
65
|
oidcConfig?: _descope_web_js_sdk.OidcConfig;
|
|
72
66
|
getExternalToken?: () => Promise<string>;
|
|
@@ -710,51 +704,7 @@ declare const createSdkWrapper: <P extends Omit<{
|
|
|
710
704
|
getJwtPermissions: (token: string, tenant?: string) => string[];
|
|
711
705
|
getJwtRoles: (token: string, tenant?: string) => string[];
|
|
712
706
|
getCurrentTenant: (token: string) => string;
|
|
713
|
-
httpClient:
|
|
714
|
-
get: (path: string, config?: {
|
|
715
|
-
headers?: HeadersInit;
|
|
716
|
-
queryParams?: {
|
|
717
|
-
[key: string]: string;
|
|
718
|
-
};
|
|
719
|
-
token?: string;
|
|
720
|
-
}) => Promise<Response>;
|
|
721
|
-
post: (path: string, body?: any, config?: {
|
|
722
|
-
headers?: HeadersInit;
|
|
723
|
-
queryParams?: {
|
|
724
|
-
[key: string]: string;
|
|
725
|
-
};
|
|
726
|
-
token?: string;
|
|
727
|
-
}) => Promise<Response>;
|
|
728
|
-
patch: (path: string, body?: any, config?: {
|
|
729
|
-
headers?: HeadersInit;
|
|
730
|
-
queryParams?: {
|
|
731
|
-
[key: string]: string;
|
|
732
|
-
};
|
|
733
|
-
token?: string;
|
|
734
|
-
}) => Promise<Response>;
|
|
735
|
-
put: (path: string, body?: any, config?: {
|
|
736
|
-
headers?: HeadersInit;
|
|
737
|
-
queryParams?: {
|
|
738
|
-
[key: string]: string;
|
|
739
|
-
};
|
|
740
|
-
token?: string;
|
|
741
|
-
}) => Promise<Response>;
|
|
742
|
-
delete: (path: string, config?: {
|
|
743
|
-
headers?: HeadersInit;
|
|
744
|
-
queryParams?: {
|
|
745
|
-
[key: string]: string;
|
|
746
|
-
};
|
|
747
|
-
token?: string;
|
|
748
|
-
}) => Promise<Response>;
|
|
749
|
-
hooks?: {
|
|
750
|
-
beforeRequest?: (config: _1.RequestConfig) => _1.RequestConfig;
|
|
751
|
-
afterRequest?: (req: _1.RequestConfig, res: Response) => void | Promise<void>;
|
|
752
|
-
transformResponse?: (mutableResponse: _1.ExtendedResponse) => Promise<_1.ExtendedResponse>;
|
|
753
|
-
};
|
|
754
|
-
buildUrl: (path: string, queryParams?: {
|
|
755
|
-
[key: string]: string;
|
|
756
|
-
}) => string;
|
|
757
|
-
};
|
|
707
|
+
httpClient: _1.HttpClient;
|
|
758
708
|
} | {
|
|
759
709
|
refresh: (token?: string) => Promise<_1.SdkResponse<_1.JWTResponse>>;
|
|
760
710
|
logout: (token?: string) => Promise<_1.SdkResponse<never>>;
|
|
@@ -1382,51 +1332,7 @@ declare const createSdkWrapper: <P extends Omit<{
|
|
|
1382
1332
|
getJwtPermissions: (token: string, tenant?: string) => string[];
|
|
1383
1333
|
getJwtRoles: (token: string, tenant?: string) => string[];
|
|
1384
1334
|
getCurrentTenant: (token: string) => string;
|
|
1385
|
-
httpClient:
|
|
1386
|
-
get: (path: string, config?: {
|
|
1387
|
-
headers?: HeadersInit;
|
|
1388
|
-
queryParams?: {
|
|
1389
|
-
[key: string]: string;
|
|
1390
|
-
};
|
|
1391
|
-
token?: string;
|
|
1392
|
-
}) => Promise<Response>;
|
|
1393
|
-
post: (path: string, body?: any, config?: {
|
|
1394
|
-
headers?: HeadersInit;
|
|
1395
|
-
queryParams?: {
|
|
1396
|
-
[key: string]: string;
|
|
1397
|
-
};
|
|
1398
|
-
token?: string;
|
|
1399
|
-
}) => Promise<Response>;
|
|
1400
|
-
patch: (path: string, body?: any, config?: {
|
|
1401
|
-
headers?: HeadersInit;
|
|
1402
|
-
queryParams?: {
|
|
1403
|
-
[key: string]: string;
|
|
1404
|
-
};
|
|
1405
|
-
token?: string;
|
|
1406
|
-
}) => Promise<Response>;
|
|
1407
|
-
put: (path: string, body?: any, config?: {
|
|
1408
|
-
headers?: HeadersInit;
|
|
1409
|
-
queryParams?: {
|
|
1410
|
-
[key: string]: string;
|
|
1411
|
-
};
|
|
1412
|
-
token?: string;
|
|
1413
|
-
}) => Promise<Response>;
|
|
1414
|
-
delete: (path: string, config?: {
|
|
1415
|
-
headers?: HeadersInit;
|
|
1416
|
-
queryParams?: {
|
|
1417
|
-
[key: string]: string;
|
|
1418
|
-
};
|
|
1419
|
-
token?: string;
|
|
1420
|
-
}) => Promise<Response>;
|
|
1421
|
-
hooks?: {
|
|
1422
|
-
beforeRequest?: (config: _1.RequestConfig) => _1.RequestConfig;
|
|
1423
|
-
afterRequest?: (req: _1.RequestConfig, res: Response) => void | Promise<void>;
|
|
1424
|
-
transformResponse?: (mutableResponse: _1.ExtendedResponse) => Promise<_1.ExtendedResponse>;
|
|
1425
|
-
};
|
|
1426
|
-
buildUrl: (path: string, queryParams?: {
|
|
1427
|
-
[key: string]: string;
|
|
1428
|
-
}) => string;
|
|
1429
|
-
};
|
|
1335
|
+
httpClient: _1.HttpClient;
|
|
1430
1336
|
} | {
|
|
1431
1337
|
refresh: (token?: string) => Promise<_1.SdkResponse<_1.JWTResponse>>;
|
|
1432
1338
|
logout: (token?: string) => Promise<_1.SdkResponse<never>>;
|
|
@@ -2054,51 +1960,7 @@ declare const createSdkWrapper: <P extends Omit<{
|
|
|
2054
1960
|
getJwtPermissions: (token: string, tenant?: string) => string[];
|
|
2055
1961
|
getJwtRoles: (token: string, tenant?: string) => string[];
|
|
2056
1962
|
getCurrentTenant: (token: string) => string;
|
|
2057
|
-
httpClient:
|
|
2058
|
-
get: (path: string, config?: {
|
|
2059
|
-
headers?: HeadersInit;
|
|
2060
|
-
queryParams?: {
|
|
2061
|
-
[key: string]: string;
|
|
2062
|
-
};
|
|
2063
|
-
token?: string;
|
|
2064
|
-
}) => Promise<Response>;
|
|
2065
|
-
post: (path: string, body?: any, config?: {
|
|
2066
|
-
headers?: HeadersInit;
|
|
2067
|
-
queryParams?: {
|
|
2068
|
-
[key: string]: string;
|
|
2069
|
-
};
|
|
2070
|
-
token?: string;
|
|
2071
|
-
}) => Promise<Response>;
|
|
2072
|
-
patch: (path: string, body?: any, config?: {
|
|
2073
|
-
headers?: HeadersInit;
|
|
2074
|
-
queryParams?: {
|
|
2075
|
-
[key: string]: string;
|
|
2076
|
-
};
|
|
2077
|
-
token?: string;
|
|
2078
|
-
}) => Promise<Response>;
|
|
2079
|
-
put: (path: string, body?: any, config?: {
|
|
2080
|
-
headers?: HeadersInit;
|
|
2081
|
-
queryParams?: {
|
|
2082
|
-
[key: string]: string;
|
|
2083
|
-
};
|
|
2084
|
-
token?: string;
|
|
2085
|
-
}) => Promise<Response>;
|
|
2086
|
-
delete: (path: string, config?: {
|
|
2087
|
-
headers?: HeadersInit;
|
|
2088
|
-
queryParams?: {
|
|
2089
|
-
[key: string]: string;
|
|
2090
|
-
};
|
|
2091
|
-
token?: string;
|
|
2092
|
-
}) => Promise<Response>;
|
|
2093
|
-
hooks?: {
|
|
2094
|
-
beforeRequest?: (config: _1.RequestConfig) => _1.RequestConfig;
|
|
2095
|
-
afterRequest?: (req: _1.RequestConfig, res: Response) => void | Promise<void>;
|
|
2096
|
-
transformResponse?: (mutableResponse: _1.ExtendedResponse) => Promise<_1.ExtendedResponse>;
|
|
2097
|
-
};
|
|
2098
|
-
buildUrl: (path: string, queryParams?: {
|
|
2099
|
-
[key: string]: string;
|
|
2100
|
-
}) => string;
|
|
2101
|
-
};
|
|
1963
|
+
httpClient: _1.HttpClient;
|
|
2102
1964
|
}) & {
|
|
2103
1965
|
onSessionTokenChange: (cb: (data: string) => void) => () => any[];
|
|
2104
1966
|
onUserChange: (cb: (data: _1.UserResponse) => void) => () => any[];
|