@getpara/react-core 3.18.0 → 3.20.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/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/mutations.d.ts +2 -0
- package/dist/mutations.js +3 -0
- package/dist/provider/actions/getEmbeddedAccount.d.ts +9 -1
- package/dist/provider/actions/getEmbeddedAccount.js +13 -5
- package/dist/provider/actions/index.d.ts +9 -1
- package/dist/provider/actions/index.js +15 -0
- package/dist/provider/actions/permissions.d.ts +35 -0
- package/dist/provider/actions/permissions.js +192 -0
- package/dist/provider/hooks/mutations/index.d.ts +2 -0
- package/dist/provider/hooks/mutations/index.js +4 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithCustomOAuth.d.ts +94 -0
- package/dist/provider/hooks/mutations/useAuthenticateWithCustomOAuth.js +39 -0
- package/dist/provider/hooks/permissions/mutations.d.ts +33 -0
- package/dist/provider/hooks/permissions/mutations.js +61 -0
- package/dist/provider/hooks/permissions/queries.d.ts +25 -0
- package/dist/provider/hooks/permissions/queries.js +70 -0
- package/dist/provider/hooks/permissions/utils.d.ts +6 -0
- package/dist/provider/hooks/permissions/utils.js +67 -0
- package/dist/provider/hooks/queries/index.d.ts +1 -0
- package/dist/provider/hooks/queries/index.js +1 -0
- package/dist/queries.d.ts +1 -0
- package/dist/queries.js +1 -0
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from './provider/hooks/mu
|
|
|
32
32
|
export { useRequestFaucet, REQUEST_FAUCET_KEY } from './provider/hooks/mutations/useRequestFaucet.js';
|
|
33
33
|
export { useAuthenticateWithEmailOrPhone } from './provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js';
|
|
34
34
|
export { useAuthenticateWithOAuth } from './provider/hooks/mutations/useAuthenticateWithOAuth.js';
|
|
35
|
+
export { useAuthenticateWithCustomOAuth } from './provider/hooks/mutations/useAuthenticateWithCustomOAuth.js';
|
|
35
36
|
export { useLoginExternalWallet } from './provider/hooks/mutations/useLoginExternalWallet.js';
|
|
36
37
|
export { useVerifyExternalWallet } from './provider/hooks/mutations/useVerifyExternalWallet.js';
|
|
37
38
|
export { useVerifyOAuth } from './provider/hooks/mutations/useVerifyOAuth.js';
|
|
@@ -40,3 +41,6 @@ export { useVerifyTelegram } from './provider/hooks/mutations/useVerifyTelegram.
|
|
|
40
41
|
export { useWaitForLogin } from './provider/hooks/mutations/useWaitForLogin.js';
|
|
41
42
|
export { useWaitForSignup } from './provider/hooks/mutations/useWaitForSignup.js';
|
|
42
43
|
export { useWaitForWalletCreation } from './provider/hooks/mutations/useWaitForWalletCreation.js';
|
|
44
|
+
export * from './provider/actions/permissions.js';
|
|
45
|
+
export * from './provider/hooks/permissions/queries.js';
|
|
46
|
+
export * from './provider/hooks/permissions/mutations.js';
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ import { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from "./provider/hooks/mu
|
|
|
30
30
|
import { useRequestFaucet, REQUEST_FAUCET_KEY } from "./provider/hooks/mutations/useRequestFaucet.js";
|
|
31
31
|
import { useAuthenticateWithEmailOrPhone } from "./provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js";
|
|
32
32
|
import { useAuthenticateWithOAuth } from "./provider/hooks/mutations/useAuthenticateWithOAuth.js";
|
|
33
|
+
import { useAuthenticateWithCustomOAuth } from "./provider/hooks/mutations/useAuthenticateWithCustomOAuth.js";
|
|
33
34
|
import { useLoginExternalWallet } from "./provider/hooks/mutations/useLoginExternalWallet.js";
|
|
34
35
|
import { useVerifyExternalWallet } from "./provider/hooks/mutations/useVerifyExternalWallet.js";
|
|
35
36
|
import { useVerifyOAuth } from "./provider/hooks/mutations/useVerifyOAuth.js";
|
|
@@ -38,11 +39,15 @@ import { useVerifyTelegram } from "./provider/hooks/mutations/useVerifyTelegram.
|
|
|
38
39
|
import { useWaitForLogin } from "./provider/hooks/mutations/useWaitForLogin.js";
|
|
39
40
|
import { useWaitForSignup } from "./provider/hooks/mutations/useWaitForSignup.js";
|
|
40
41
|
import { useWaitForWalletCreation } from "./provider/hooks/mutations/useWaitForWalletCreation.js";
|
|
42
|
+
export * from "./provider/actions/permissions.js";
|
|
43
|
+
export * from "./provider/hooks/permissions/queries.js";
|
|
44
|
+
export * from "./provider/hooks/permissions/mutations.js";
|
|
41
45
|
export {
|
|
42
46
|
ChainId,
|
|
43
47
|
EXPORT_PRIVATE_KEY_KEY,
|
|
44
48
|
REQUEST_FAUCET_KEY,
|
|
45
49
|
useAccount,
|
|
50
|
+
useAuthenticateWithCustomOAuth,
|
|
46
51
|
useAuthenticateWithEmailOrPhone,
|
|
47
52
|
useAuthenticateWithOAuth,
|
|
48
53
|
useClaimPregenWallets,
|
package/dist/mutations.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { useIssueJwt } from './provider/hooks/mutations/useIssueJwt.js';
|
|
|
20
20
|
export { useResendVerificationCode } from './provider/hooks/mutations/useResendVerificationCode.js';
|
|
21
21
|
export { useAuthenticateWithEmailOrPhone } from './provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js';
|
|
22
22
|
export { useAuthenticateWithOAuth } from './provider/hooks/mutations/useAuthenticateWithOAuth.js';
|
|
23
|
+
export { useAuthenticateWithCustomOAuth } from './provider/hooks/mutations/useAuthenticateWithCustomOAuth.js';
|
|
23
24
|
export { useLoginExternalWallet } from './provider/hooks/mutations/useLoginExternalWallet.js';
|
|
24
25
|
export { useVerifyExternalWallet } from './provider/hooks/mutations/useVerifyExternalWallet.js';
|
|
25
26
|
export { useVerifyOAuth } from './provider/hooks/mutations/useVerifyOAuth.js';
|
|
@@ -30,3 +31,4 @@ export { useWaitForSignup } from './provider/hooks/mutations/useWaitForSignup.js
|
|
|
30
31
|
export { useWaitForWalletCreation } from './provider/hooks/mutations/useWaitForWalletCreation.js';
|
|
31
32
|
export { useExportPrivateKey } from './provider/hooks/mutations/useExportPrivateKey.js';
|
|
32
33
|
export { useRequestFaucet } from './provider/hooks/mutations/useRequestFaucet.js';
|
|
34
|
+
export * from './provider/hooks/permissions/mutations.js';
|
package/dist/mutations.js
CHANGED
|
@@ -20,6 +20,7 @@ import { useIssueJwt } from "./provider/hooks/mutations/useIssueJwt.js";
|
|
|
20
20
|
import { useResendVerificationCode } from "./provider/hooks/mutations/useResendVerificationCode.js";
|
|
21
21
|
import { useAuthenticateWithEmailOrPhone } from "./provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js";
|
|
22
22
|
import { useAuthenticateWithOAuth } from "./provider/hooks/mutations/useAuthenticateWithOAuth.js";
|
|
23
|
+
import { useAuthenticateWithCustomOAuth } from "./provider/hooks/mutations/useAuthenticateWithCustomOAuth.js";
|
|
23
24
|
import { useLoginExternalWallet } from "./provider/hooks/mutations/useLoginExternalWallet.js";
|
|
24
25
|
import { useVerifyExternalWallet } from "./provider/hooks/mutations/useVerifyExternalWallet.js";
|
|
25
26
|
import { useVerifyOAuth } from "./provider/hooks/mutations/useVerifyOAuth.js";
|
|
@@ -30,7 +31,9 @@ import { useWaitForSignup } from "./provider/hooks/mutations/useWaitForSignup.js
|
|
|
30
31
|
import { useWaitForWalletCreation } from "./provider/hooks/mutations/useWaitForWalletCreation.js";
|
|
31
32
|
import { useExportPrivateKey } from "./provider/hooks/mutations/useExportPrivateKey.js";
|
|
32
33
|
import { useRequestFaucet } from "./provider/hooks/mutations/useRequestFaucet.js";
|
|
34
|
+
export * from "./provider/hooks/permissions/mutations.js";
|
|
33
35
|
export {
|
|
36
|
+
useAuthenticateWithCustomOAuth,
|
|
34
37
|
useAuthenticateWithEmailOrPhone,
|
|
35
38
|
useAuthenticateWithOAuth,
|
|
36
39
|
useClaimPregenWallets,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type ParaCore from '@getpara/core-sdk';
|
|
2
|
-
import type { AuthMethod, PrimaryAuthInfo } from '@getpara/core-sdk';
|
|
2
|
+
import type { AuthMethod, LoginMethod, PrimaryAuthInfo } from '@getpara/core-sdk';
|
|
3
3
|
type AccountValue = PrimaryAuthInfo & {
|
|
4
4
|
email?: string;
|
|
5
5
|
phone?: `+${number}`;
|
|
@@ -9,6 +9,14 @@ type AccountValue = PrimaryAuthInfo & {
|
|
|
9
9
|
wallets: ParaCore['availableWallets'];
|
|
10
10
|
userId?: string;
|
|
11
11
|
authMethods?: Set<AuthMethod>;
|
|
12
|
+
/** The factor the user logged in with (email/google/…/CUSTOM_OIDC). Prefer over the deprecated `authType`. */
|
|
13
|
+
loginMethod?: LoginMethod;
|
|
14
|
+
/** Custom OAuth/OIDC only: the connection's human-readable label (e.g. "Acme SSO"). */
|
|
15
|
+
connectionLabel?: string;
|
|
16
|
+
/** Readable display name from the provider (name / @handle), when available. */
|
|
17
|
+
displayName?: string;
|
|
18
|
+
/** Profile picture URL from the provider, when available. */
|
|
19
|
+
pfpUrl?: string;
|
|
12
20
|
};
|
|
13
21
|
export type Account = ({
|
|
14
22
|
isConnected: false;
|
|
@@ -38,16 +38,24 @@ const getEmbeddedAccount = (para, isFullyLoggedIn) => __async(null, null, functi
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
const authInfo = para.authInfo;
|
|
41
|
-
let authMethods;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
let authMethods = /* @__PURE__ */ new Set();
|
|
42
|
+
if (authInfo) {
|
|
43
|
+
try {
|
|
44
|
+
authMethods = yield para.supportedUserAuthMethods();
|
|
45
|
+
} catch (e) {
|
|
46
|
+
authMethods = /* @__PURE__ */ new Set();
|
|
47
|
+
}
|
|
46
48
|
}
|
|
47
49
|
const value = {
|
|
48
50
|
auth: authInfo == null ? void 0 : authInfo.auth,
|
|
49
51
|
authType: authInfo == null ? void 0 : authInfo.authType,
|
|
50
52
|
identifier: authInfo == null ? void 0 : authInfo.identifier,
|
|
53
|
+
// The v2 factor + connection label from the backend identity block — prefer these over authType/identifier.
|
|
54
|
+
loginMethod: authInfo == null ? void 0 : authInfo.loginMethod,
|
|
55
|
+
connectionLabel: authInfo == null ? void 0 : authInfo.connectionLabel,
|
|
56
|
+
// Readable display name + pfp from the provider (persisted on the authoritative auth factor's metadata).
|
|
57
|
+
displayName: authInfo == null ? void 0 : authInfo.displayName,
|
|
58
|
+
pfpUrl: authInfo == null ? void 0 : authInfo.pfpUrl,
|
|
51
59
|
userId: para.userId,
|
|
52
60
|
wallets: para.availableWallets,
|
|
53
61
|
isConnected: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type ParaCore from '@getpara/core-sdk';
|
|
2
|
-
import type { SignUpOrLogInParams, SignUpOrLogInResponse, WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, WaitForWalletCreationResponse, VerifyOAuthProcessParams, OAuthResponse, VerifyFarcasterParams, VerifyTelegramParams, LoginExternalWalletParams, LoginExternalWalletResponse, VerifyExternalWalletParams, VerifyExternalWalletResponse, Setup2faResponse, Enable2faParams, Verify2faParams, Verify2faResponse, EnrollMfaResponse, VerifyMfaParams, VerifyMfaResult, LogoutParams, ResendVerificationCodeParams, ResendVerificationCodeResponse, CreateWalletParams, CreateWalletResponse, CreateWalletPerTypeParams, CreateWalletPerTypeResponse, CreatePregenWalletParams, CreatePregenWalletResponse, CreatePregenWalletPerTypeParams, CreatePregenWalletPerTypeResponse, ClaimPregenWalletsParams, ClaimPregenWalletsResponse, HasPregenWalletParams, UpdatePregenWalletIdentifierParams, CreateGuestWalletsResponse, SignMessageParams, SignTransactionParams, FullSignatureRes, GetWalletBalanceParams, IssueJwtParams, IssueJwtResponse, GetLinkedAccountsParams, GetLinkedAccountsResponse, AddCredentialParams, ExportPrivateKeyParams, ExportPrivateKeyResponse, RequestFaucetParams, RequestFaucetResponse, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse } from '@getpara/core-sdk';
|
|
2
|
+
import type { SignUpOrLogInParams, SignUpOrLogInResponse, WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, WaitForWalletCreationResponse, VerifyOAuthProcessParams, OAuthResponse, VerifyFarcasterParams, VerifyTelegramParams, LoginExternalWalletParams, LoginExternalWalletResponse, VerifyExternalWalletParams, VerifyExternalWalletResponse, Setup2faResponse, Enable2faParams, Verify2faParams, Verify2faResponse, EnrollMfaResponse, VerifyMfaParams, VerifyMfaResult, LogoutParams, ResendVerificationCodeParams, ResendVerificationCodeResponse, CreateWalletParams, CreateWalletResponse, CreateWalletPerTypeParams, CreateWalletPerTypeResponse, CreatePregenWalletParams, CreatePregenWalletResponse, CreatePregenWalletPerTypeParams, CreatePregenWalletPerTypeResponse, ClaimPregenWalletsParams, ClaimPregenWalletsResponse, HasPregenWalletParams, UpdatePregenWalletIdentifierParams, CreateGuestWalletsResponse, SignMessageParams, SignTransactionParams, FullSignatureRes, GetWalletBalanceParams, IssueJwtParams, IssueJwtResponse, GetLinkedAccountsParams, GetLinkedAccountsResponse, GetAuthFactorsResponse, AddAuthFactorParams, AddAuthFactorResponse, AddOAuthFactorParams, AddOAuthFactorResponse, AddExternalWalletFactorParams, AddExternalWalletFactorResponse, ContinueAuthFactorLinkParams, ContinueAuthFactorLinkResponse, UnlinkAuthFactorParams, AddCredentialParams, ExportPrivateKeyParams, ExportPrivateKeyResponse, RequestFaucetParams, RequestFaucetResponse, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse, AuthenticateWithCustomOAuthParams, AuthenticateWithCustomOAuthResponse } from '@getpara/core-sdk';
|
|
3
3
|
export { generateCoreAction, type CoreAction } from './utils.js';
|
|
4
4
|
export { getEmbeddedAccount, type Account } from './getEmbeddedAccount.js';
|
|
5
5
|
export { getWallet } from './getWallet.js';
|
|
@@ -34,8 +34,16 @@ export declare const signTransaction: (para?: ParaCore, args?: SignTransactionPa
|
|
|
34
34
|
export declare const getWalletBalance: (para?: ParaCore, args?: GetWalletBalanceParams) => Promise<string>;
|
|
35
35
|
export declare const issueJwt: (para?: ParaCore, args?: IssueJwtParams) => Promise<IssueJwtResponse>;
|
|
36
36
|
export declare const getLinkedAccounts: (para?: ParaCore, args?: GetLinkedAccountsParams) => Promise<GetLinkedAccountsResponse>;
|
|
37
|
+
export declare const getAuthFactors: (para?: ParaCore) => Promise<GetAuthFactorsResponse>;
|
|
38
|
+
export declare const addAuthFactor: (para?: ParaCore, args?: AddAuthFactorParams) => Promise<AddAuthFactorResponse>;
|
|
39
|
+
export declare const addOAuthFactor: (para?: ParaCore, args?: AddOAuthFactorParams) => Promise<AddOAuthFactorResponse>;
|
|
40
|
+
export declare const addExternalWalletFactor: (para?: ParaCore, args?: AddExternalWalletFactorParams) => Promise<AddExternalWalletFactorResponse>;
|
|
41
|
+
export declare const continueAuthFactorLink: (para?: ParaCore, args?: ContinueAuthFactorLinkParams) => Promise<ContinueAuthFactorLinkResponse>;
|
|
42
|
+
export declare const unlinkAuthFactor: (para?: ParaCore, args?: UnlinkAuthFactorParams) => Promise<GetAuthFactorsResponse>;
|
|
37
43
|
export declare const addCredential: (para?: ParaCore, args?: AddCredentialParams) => Promise<string>;
|
|
38
44
|
export declare const exportPrivateKey: (para?: ParaCore, args?: ExportPrivateKeyParams) => Promise<ExportPrivateKeyResponse>;
|
|
39
45
|
export declare const requestFaucet: (para?: ParaCore, args?: RequestFaucetParams) => Promise<RequestFaucetResponse>;
|
|
40
46
|
export declare const authenticateWithEmailOrPhone: (para?: ParaCore, args?: AuthenticateWithEmailOrPhoneParams) => Promise<AuthenticateWithEmailOrPhoneResponse>;
|
|
41
47
|
export declare const authenticateWithOAuth: (para?: ParaCore, args?: AuthenticateWithOAuthParams) => Promise<AuthenticateWithOAuthResponse>;
|
|
48
|
+
export declare const authenticateWithCustomOAuth: (para?: ParaCore, args?: AuthenticateWithCustomOAuthParams) => Promise<AuthenticateWithCustomOAuthResponse>;
|
|
49
|
+
export * from './permissions.js';
|
|
@@ -33,16 +33,29 @@ const signTransaction = generateCoreAction("signTransaction");
|
|
|
33
33
|
const getWalletBalance = generateCoreAction("getWalletBalance");
|
|
34
34
|
const issueJwt = generateCoreAction("issueJwt");
|
|
35
35
|
const getLinkedAccounts = generateCoreAction("getLinkedAccounts");
|
|
36
|
+
const getAuthFactors = generateCoreAction("getAuthFactors");
|
|
37
|
+
const addAuthFactor = generateCoreAction("addAuthFactor");
|
|
38
|
+
const addOAuthFactor = generateCoreAction("addOAuthFactor");
|
|
39
|
+
const addExternalWalletFactor = generateCoreAction("addExternalWalletFactor");
|
|
40
|
+
const continueAuthFactorLink = generateCoreAction("continueAuthFactorLink");
|
|
41
|
+
const unlinkAuthFactor = generateCoreAction("unlinkAuthFactor");
|
|
36
42
|
const addCredential = generateCoreAction("addCredential");
|
|
37
43
|
const exportPrivateKey = generateCoreAction("exportPrivateKey");
|
|
38
44
|
const requestFaucet = generateCoreAction("requestFaucet");
|
|
39
45
|
const authenticateWithEmailOrPhone = generateCoreAction("authenticateWithEmailOrPhone");
|
|
40
46
|
const authenticateWithOAuth = generateCoreAction("authenticateWithOAuth");
|
|
47
|
+
const authenticateWithCustomOAuth = generateCoreAction("authenticateWithCustomOAuth");
|
|
48
|
+
export * from "./permissions.js";
|
|
41
49
|
export {
|
|
50
|
+
addAuthFactor,
|
|
42
51
|
addCredential,
|
|
52
|
+
addExternalWalletFactor,
|
|
53
|
+
addOAuthFactor,
|
|
54
|
+
authenticateWithCustomOAuth,
|
|
43
55
|
authenticateWithEmailOrPhone,
|
|
44
56
|
authenticateWithOAuth,
|
|
45
57
|
claimPregenWallets,
|
|
58
|
+
continueAuthFactorLink,
|
|
46
59
|
createGuestWallets,
|
|
47
60
|
createPregenWallet,
|
|
48
61
|
createPregenWalletPerType,
|
|
@@ -52,6 +65,7 @@ export {
|
|
|
52
65
|
enrollMfa,
|
|
53
66
|
exportPrivateKey,
|
|
54
67
|
generateCoreAction2 as generateCoreAction,
|
|
68
|
+
getAuthFactors,
|
|
55
69
|
getEmbeddedAccount,
|
|
56
70
|
getLinkedAccounts,
|
|
57
71
|
getWallet,
|
|
@@ -67,6 +81,7 @@ export {
|
|
|
67
81
|
signMessage,
|
|
68
82
|
signTransaction,
|
|
69
83
|
signUpOrLogIn,
|
|
84
|
+
unlinkAuthFactor,
|
|
70
85
|
updatePregenWalletIdentifier,
|
|
71
86
|
verify2fa,
|
|
72
87
|
verifyExternalWallet,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type ParaCore from '@getpara/core-sdk';
|
|
2
|
+
export declare const listPolicies: (para: ParaCore | undefined, ...args: Parameters<ParaCore["listPolicies"]>) => ReturnType<ParaCore["listPolicies"]>;
|
|
3
|
+
export declare const getPolicy: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getPolicy"]>) => ReturnType<ParaCore["getPolicy"]>;
|
|
4
|
+
export declare const listApplicablePolicies: (para: ParaCore | undefined, ...args: Parameters<ParaCore["listApplicablePolicies"]>) => ReturnType<ParaCore["listApplicablePolicies"]>;
|
|
5
|
+
export declare const getApplicablePolicy: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getApplicablePolicy"]>) => ReturnType<ParaCore["getApplicablePolicy"]>;
|
|
6
|
+
export declare const listUserPolicyConsents: (para: ParaCore | undefined, ...args: Parameters<ParaCore["listUserPolicyConsents"]>) => ReturnType<ParaCore["listUserPolicyConsents"]>;
|
|
7
|
+
export declare const getUserPolicyConsent: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getUserPolicyConsent"]>) => ReturnType<ParaCore["getUserPolicyConsent"]>;
|
|
8
|
+
export declare const listUserAdjustablePolicies: (para: ParaCore | undefined, ...args: Parameters<ParaCore["listUserAdjustablePolicies"]>) => ReturnType<ParaCore["listUserAdjustablePolicies"]>;
|
|
9
|
+
export declare const getUserPolicyParameters: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getUserPolicyParameters"]>) => ReturnType<ParaCore["getUserPolicyParameters"]>;
|
|
10
|
+
export declare const updateUserPolicyParameters: (para: ParaCore | undefined, ...args: Parameters<ParaCore["updateUserPolicyParameters"]>) => ReturnType<ParaCore["updateUserPolicyParameters"]>;
|
|
11
|
+
export declare const resetUserPolicyParameters: (para: ParaCore | undefined, ...args: Parameters<ParaCore["resetUserPolicyParameters"]>) => ReturnType<ParaCore["resetUserPolicyParameters"]>;
|
|
12
|
+
export declare const listUserPolicyParameterHistory: (para: ParaCore | undefined, ...args: Parameters<ParaCore["listUserPolicyParameterHistory"]>) => ReturnType<ParaCore["listUserPolicyParameterHistory"]>;
|
|
13
|
+
export declare const listConfigurableApprovalRequirements: (para: ParaCore | undefined, ...args: Parameters<ParaCore["listConfigurableApprovalRequirements"]>) => ReturnType<ParaCore["listConfigurableApprovalRequirements"]>;
|
|
14
|
+
export declare const getConfigurableApprovalRequirement: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getConfigurableApprovalRequirement"]>) => ReturnType<ParaCore["getConfigurableApprovalRequirement"]>;
|
|
15
|
+
export declare const getApprovalConfiguration: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getApprovalConfiguration"]>) => ReturnType<ParaCore["getApprovalConfiguration"]>;
|
|
16
|
+
export declare const getEffectiveApprovalConfiguration: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getEffectiveApprovalConfiguration"]>) => ReturnType<ParaCore["getEffectiveApprovalConfiguration"]>;
|
|
17
|
+
export declare const updateApprovalConfiguration: (para: ParaCore | undefined, ...args: Parameters<ParaCore["updateApprovalConfiguration"]>) => ReturnType<ParaCore["updateApprovalConfiguration"]>;
|
|
18
|
+
export declare const resetApprovalConfiguration: (para: ParaCore | undefined, ...args: Parameters<ParaCore["resetApprovalConfiguration"]>) => ReturnType<ParaCore["resetApprovalConfiguration"]>;
|
|
19
|
+
export declare const listApprovalConfigurationHistory: (para: ParaCore | undefined, ...args: Parameters<ParaCore["listApprovalConfigurationHistory"]>) => ReturnType<ParaCore["listApprovalConfigurationHistory"]>;
|
|
20
|
+
export declare const getUserApprovalAssignments: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getUserApprovalAssignments"]>) => ReturnType<ParaCore["getUserApprovalAssignments"]>;
|
|
21
|
+
export declare const getUserApprovalCapabilities: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getUserApprovalCapabilities"]>) => ReturnType<ParaCore["getUserApprovalCapabilities"]>;
|
|
22
|
+
export declare const listAccessibleApprovalCases: (para: ParaCore | undefined, ...args: Parameters<ParaCore["listAccessibleApprovalCases"]>) => ReturnType<ParaCore["listAccessibleApprovalCases"]>;
|
|
23
|
+
export declare const getAccessibleApprovalCase: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getAccessibleApprovalCase"]>) => ReturnType<ParaCore["getAccessibleApprovalCase"]>;
|
|
24
|
+
export declare const listInitiatedApprovalCases: (para: ParaCore | undefined, ...args: Parameters<ParaCore["listInitiatedApprovalCases"]>) => ReturnType<ParaCore["listInitiatedApprovalCases"]>;
|
|
25
|
+
export declare const getInitiatedApprovalCase: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getInitiatedApprovalCase"]>) => ReturnType<ParaCore["getInitiatedApprovalCase"]>;
|
|
26
|
+
export declare const approveApprovalCase: (para: ParaCore | undefined, ...args: Parameters<ParaCore["approveApprovalCase"]>) => ReturnType<ParaCore["approveApprovalCase"]>;
|
|
27
|
+
export declare const rejectApprovalCase: (para: ParaCore | undefined, ...args: Parameters<ParaCore["rejectApprovalCase"]>) => ReturnType<ParaCore["rejectApprovalCase"]>;
|
|
28
|
+
export declare const createApprovalSignatureCollection: (para: ParaCore | undefined, ...args: Parameters<ParaCore["createApprovalSignatureCollection"]>) => ReturnType<ParaCore["createApprovalSignatureCollection"]>;
|
|
29
|
+
export declare const getApprovalSigningPayload: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getApprovalSigningPayload"]>) => ReturnType<ParaCore["getApprovalSigningPayload"]>;
|
|
30
|
+
export declare const submitApprovalSignature: (para: ParaCore | undefined, ...args: Parameters<ParaCore["submitApprovalSignature"]>) => ReturnType<ParaCore["submitApprovalSignature"]>;
|
|
31
|
+
export declare const getApprovalSignatures: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getApprovalSignatures"]>) => ReturnType<ParaCore["getApprovalSignatures"]>;
|
|
32
|
+
export declare const getUserPolicyUsage: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getUserPolicyUsage"]>) => ReturnType<ParaCore["getUserPolicyUsage"]>;
|
|
33
|
+
export declare const signApprovalTransaction: (para: ParaCore | undefined, ...args: Parameters<ParaCore["signApprovalTransaction"]>) => ReturnType<ParaCore["signApprovalTransaction"]>;
|
|
34
|
+
export declare const getPolicyConsentUrl: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getPolicyConsentUrl"]>) => ReturnType<ParaCore["getPolicyConsentUrl"]>;
|
|
35
|
+
export declare const getApprovalCaseReviewUrl: (para: ParaCore | undefined, ...args: Parameters<ParaCore["getApprovalCaseReviewUrl"]>) => ReturnType<ParaCore["getApprovalCaseReviewUrl"]>;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const listPolicies = (para, ...args) => __async(null, null, function* () {
|
|
22
|
+
if (!para) throw new Error("no para instance");
|
|
23
|
+
return para.listPolicies(...args);
|
|
24
|
+
});
|
|
25
|
+
const getPolicy = (para, ...args) => __async(null, null, function* () {
|
|
26
|
+
if (!para) throw new Error("no para instance");
|
|
27
|
+
return para.getPolicy(...args);
|
|
28
|
+
});
|
|
29
|
+
const listApplicablePolicies = (para, ...args) => __async(null, null, function* () {
|
|
30
|
+
if (!para) throw new Error("no para instance");
|
|
31
|
+
return para.listApplicablePolicies(...args);
|
|
32
|
+
});
|
|
33
|
+
const getApplicablePolicy = (para, ...args) => __async(null, null, function* () {
|
|
34
|
+
if (!para) throw new Error("no para instance");
|
|
35
|
+
return para.getApplicablePolicy(...args);
|
|
36
|
+
});
|
|
37
|
+
const listUserPolicyConsents = (para, ...args) => __async(null, null, function* () {
|
|
38
|
+
if (!para) throw new Error("no para instance");
|
|
39
|
+
return para.listUserPolicyConsents(...args);
|
|
40
|
+
});
|
|
41
|
+
const getUserPolicyConsent = (para, ...args) => __async(null, null, function* () {
|
|
42
|
+
if (!para) throw new Error("no para instance");
|
|
43
|
+
return para.getUserPolicyConsent(...args);
|
|
44
|
+
});
|
|
45
|
+
const listUserAdjustablePolicies = (para, ...args) => __async(null, null, function* () {
|
|
46
|
+
if (!para) throw new Error("no para instance");
|
|
47
|
+
return para.listUserAdjustablePolicies(...args);
|
|
48
|
+
});
|
|
49
|
+
const getUserPolicyParameters = (para, ...args) => __async(null, null, function* () {
|
|
50
|
+
if (!para) throw new Error("no para instance");
|
|
51
|
+
return para.getUserPolicyParameters(...args);
|
|
52
|
+
});
|
|
53
|
+
const updateUserPolicyParameters = (para, ...args) => __async(null, null, function* () {
|
|
54
|
+
if (!para) throw new Error("no para instance");
|
|
55
|
+
return para.updateUserPolicyParameters(...args);
|
|
56
|
+
});
|
|
57
|
+
const resetUserPolicyParameters = (para, ...args) => __async(null, null, function* () {
|
|
58
|
+
if (!para) throw new Error("no para instance");
|
|
59
|
+
return para.resetUserPolicyParameters(...args);
|
|
60
|
+
});
|
|
61
|
+
const listUserPolicyParameterHistory = (para, ...args) => __async(null, null, function* () {
|
|
62
|
+
if (!para) throw new Error("no para instance");
|
|
63
|
+
return para.listUserPolicyParameterHistory(...args);
|
|
64
|
+
});
|
|
65
|
+
const listConfigurableApprovalRequirements = (para, ...args) => __async(null, null, function* () {
|
|
66
|
+
if (!para) throw new Error("no para instance");
|
|
67
|
+
return para.listConfigurableApprovalRequirements(...args);
|
|
68
|
+
});
|
|
69
|
+
const getConfigurableApprovalRequirement = (para, ...args) => __async(null, null, function* () {
|
|
70
|
+
if (!para) throw new Error("no para instance");
|
|
71
|
+
return para.getConfigurableApprovalRequirement(...args);
|
|
72
|
+
});
|
|
73
|
+
const getApprovalConfiguration = (para, ...args) => __async(null, null, function* () {
|
|
74
|
+
if (!para) throw new Error("no para instance");
|
|
75
|
+
return para.getApprovalConfiguration(...args);
|
|
76
|
+
});
|
|
77
|
+
const getEffectiveApprovalConfiguration = (para, ...args) => __async(null, null, function* () {
|
|
78
|
+
if (!para) throw new Error("no para instance");
|
|
79
|
+
return para.getEffectiveApprovalConfiguration(...args);
|
|
80
|
+
});
|
|
81
|
+
const updateApprovalConfiguration = (para, ...args) => __async(null, null, function* () {
|
|
82
|
+
if (!para) throw new Error("no para instance");
|
|
83
|
+
return para.updateApprovalConfiguration(...args);
|
|
84
|
+
});
|
|
85
|
+
const resetApprovalConfiguration = (para, ...args) => __async(null, null, function* () {
|
|
86
|
+
if (!para) throw new Error("no para instance");
|
|
87
|
+
return para.resetApprovalConfiguration(...args);
|
|
88
|
+
});
|
|
89
|
+
const listApprovalConfigurationHistory = (para, ...args) => __async(null, null, function* () {
|
|
90
|
+
if (!para) throw new Error("no para instance");
|
|
91
|
+
return para.listApprovalConfigurationHistory(...args);
|
|
92
|
+
});
|
|
93
|
+
const getUserApprovalAssignments = (para, ...args) => __async(null, null, function* () {
|
|
94
|
+
if (!para) throw new Error("no para instance");
|
|
95
|
+
return para.getUserApprovalAssignments(...args);
|
|
96
|
+
});
|
|
97
|
+
const getUserApprovalCapabilities = (para, ...args) => __async(null, null, function* () {
|
|
98
|
+
if (!para) throw new Error("no para instance");
|
|
99
|
+
return para.getUserApprovalCapabilities(...args);
|
|
100
|
+
});
|
|
101
|
+
const listAccessibleApprovalCases = (para, ...args) => __async(null, null, function* () {
|
|
102
|
+
if (!para) throw new Error("no para instance");
|
|
103
|
+
return para.listAccessibleApprovalCases(...args);
|
|
104
|
+
});
|
|
105
|
+
const getAccessibleApprovalCase = (para, ...args) => __async(null, null, function* () {
|
|
106
|
+
if (!para) throw new Error("no para instance");
|
|
107
|
+
return para.getAccessibleApprovalCase(...args);
|
|
108
|
+
});
|
|
109
|
+
const listInitiatedApprovalCases = (para, ...args) => __async(null, null, function* () {
|
|
110
|
+
if (!para) throw new Error("no para instance");
|
|
111
|
+
return para.listInitiatedApprovalCases(...args);
|
|
112
|
+
});
|
|
113
|
+
const getInitiatedApprovalCase = (para, ...args) => __async(null, null, function* () {
|
|
114
|
+
if (!para) throw new Error("no para instance");
|
|
115
|
+
return para.getInitiatedApprovalCase(...args);
|
|
116
|
+
});
|
|
117
|
+
const approveApprovalCase = (para, ...args) => __async(null, null, function* () {
|
|
118
|
+
if (!para) throw new Error("no para instance");
|
|
119
|
+
return para.approveApprovalCase(...args);
|
|
120
|
+
});
|
|
121
|
+
const rejectApprovalCase = (para, ...args) => __async(null, null, function* () {
|
|
122
|
+
if (!para) throw new Error("no para instance");
|
|
123
|
+
return para.rejectApprovalCase(...args);
|
|
124
|
+
});
|
|
125
|
+
const createApprovalSignatureCollection = (para, ...args) => __async(null, null, function* () {
|
|
126
|
+
if (!para) throw new Error("no para instance");
|
|
127
|
+
return para.createApprovalSignatureCollection(...args);
|
|
128
|
+
});
|
|
129
|
+
const getApprovalSigningPayload = (para, ...args) => __async(null, null, function* () {
|
|
130
|
+
if (!para) throw new Error("no para instance");
|
|
131
|
+
return para.getApprovalSigningPayload(...args);
|
|
132
|
+
});
|
|
133
|
+
const submitApprovalSignature = (para, ...args) => __async(null, null, function* () {
|
|
134
|
+
if (!para) throw new Error("no para instance");
|
|
135
|
+
return para.submitApprovalSignature(...args);
|
|
136
|
+
});
|
|
137
|
+
const getApprovalSignatures = (para, ...args) => __async(null, null, function* () {
|
|
138
|
+
if (!para) throw new Error("no para instance");
|
|
139
|
+
return para.getApprovalSignatures(...args);
|
|
140
|
+
});
|
|
141
|
+
const getUserPolicyUsage = (para, ...args) => __async(null, null, function* () {
|
|
142
|
+
if (!para) throw new Error("no para instance");
|
|
143
|
+
return para.getUserPolicyUsage(...args);
|
|
144
|
+
});
|
|
145
|
+
const signApprovalTransaction = (para, ...args) => __async(null, null, function* () {
|
|
146
|
+
if (!para) throw new Error("no para instance");
|
|
147
|
+
return para.signApprovalTransaction(...args);
|
|
148
|
+
});
|
|
149
|
+
const getPolicyConsentUrl = (para, ...args) => __async(null, null, function* () {
|
|
150
|
+
if (!para) throw new Error("no para instance");
|
|
151
|
+
return para.getPolicyConsentUrl(...args);
|
|
152
|
+
});
|
|
153
|
+
const getApprovalCaseReviewUrl = (para, ...args) => __async(null, null, function* () {
|
|
154
|
+
if (!para) throw new Error("no para instance");
|
|
155
|
+
return para.getApprovalCaseReviewUrl(...args);
|
|
156
|
+
});
|
|
157
|
+
export {
|
|
158
|
+
approveApprovalCase,
|
|
159
|
+
createApprovalSignatureCollection,
|
|
160
|
+
getAccessibleApprovalCase,
|
|
161
|
+
getApplicablePolicy,
|
|
162
|
+
getApprovalCaseReviewUrl,
|
|
163
|
+
getApprovalConfiguration,
|
|
164
|
+
getApprovalSignatures,
|
|
165
|
+
getApprovalSigningPayload,
|
|
166
|
+
getConfigurableApprovalRequirement,
|
|
167
|
+
getEffectiveApprovalConfiguration,
|
|
168
|
+
getInitiatedApprovalCase,
|
|
169
|
+
getPolicy,
|
|
170
|
+
getPolicyConsentUrl,
|
|
171
|
+
getUserApprovalAssignments,
|
|
172
|
+
getUserApprovalCapabilities,
|
|
173
|
+
getUserPolicyConsent,
|
|
174
|
+
getUserPolicyParameters,
|
|
175
|
+
getUserPolicyUsage,
|
|
176
|
+
listAccessibleApprovalCases,
|
|
177
|
+
listApplicablePolicies,
|
|
178
|
+
listApprovalConfigurationHistory,
|
|
179
|
+
listConfigurableApprovalRequirements,
|
|
180
|
+
listInitiatedApprovalCases,
|
|
181
|
+
listPolicies,
|
|
182
|
+
listUserAdjustablePolicies,
|
|
183
|
+
listUserPolicyConsents,
|
|
184
|
+
listUserPolicyParameterHistory,
|
|
185
|
+
rejectApprovalCase,
|
|
186
|
+
resetApprovalConfiguration,
|
|
187
|
+
resetUserPolicyParameters,
|
|
188
|
+
signApprovalTransaction,
|
|
189
|
+
submitApprovalSignature,
|
|
190
|
+
updateApprovalConfiguration,
|
|
191
|
+
updateUserPolicyParameters
|
|
192
|
+
};
|
|
@@ -23,6 +23,7 @@ export { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from './useExportPrivateK
|
|
|
23
23
|
export { useRequestFaucet, REQUEST_FAUCET_KEY } from './useRequestFaucet.js';
|
|
24
24
|
export { useAuthenticateWithEmailOrPhone, AUTHENTICATE_EMAIL_OR_PHONE_KEY } from './useAuthenticateWithEmailOrPhone.js';
|
|
25
25
|
export { useAuthenticateWithOAuth, AUTHENTICATE_OAUTH_KEY } from './useAuthenticateWithOAuth.js';
|
|
26
|
+
export { useAuthenticateWithCustomOAuth, AUTHENTICATE_CUSTOM_OAUTH_KEY } from './useAuthenticateWithCustomOAuth.js';
|
|
26
27
|
export { useLoginExternalWallet, LOGIN_EXTERNAL_WALLET_KEY } from './useLoginExternalWallet.js';
|
|
27
28
|
export { useVerifyExternalWallet, VERIFY_EXTERNAL_WALLET_KEY } from './useVerifyExternalWallet.js';
|
|
28
29
|
export { useVerifyOAuth, VERIFY_OAUTH_KEY } from './useVerifyOAuth.js';
|
|
@@ -31,3 +32,4 @@ export { useVerifyTelegram, VERIFY_TELEGRAM_KEY } from './useVerifyTelegram.js';
|
|
|
31
32
|
export { useWaitForLogin, WAIT_FOR_LOG_IN_KEY } from './useWaitForLogin.js';
|
|
32
33
|
export { useWaitForSignup, WAIT_FOR_SIGN_UP_KEY } from './useWaitForSignup.js';
|
|
33
34
|
export { useWaitForWalletCreation, WAIT_FOR_WALLET_CREATION_KEY } from './useWaitForWalletCreation.js';
|
|
35
|
+
export * from '../permissions/mutations.js';
|
|
@@ -23,6 +23,7 @@ import { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from "./useExportPrivateK
|
|
|
23
23
|
import { useRequestFaucet, REQUEST_FAUCET_KEY } from "./useRequestFaucet.js";
|
|
24
24
|
import { useAuthenticateWithEmailOrPhone, AUTHENTICATE_EMAIL_OR_PHONE_KEY } from "./useAuthenticateWithEmailOrPhone.js";
|
|
25
25
|
import { useAuthenticateWithOAuth, AUTHENTICATE_OAUTH_KEY } from "./useAuthenticateWithOAuth.js";
|
|
26
|
+
import { useAuthenticateWithCustomOAuth, AUTHENTICATE_CUSTOM_OAUTH_KEY } from "./useAuthenticateWithCustomOAuth.js";
|
|
26
27
|
import { useLoginExternalWallet, LOGIN_EXTERNAL_WALLET_KEY } from "./useLoginExternalWallet.js";
|
|
27
28
|
import { useVerifyExternalWallet, VERIFY_EXTERNAL_WALLET_KEY } from "./useVerifyExternalWallet.js";
|
|
28
29
|
import { useVerifyOAuth, VERIFY_OAUTH_KEY } from "./useVerifyOAuth.js";
|
|
@@ -31,7 +32,9 @@ import { useVerifyTelegram, VERIFY_TELEGRAM_KEY } from "./useVerifyTelegram.js";
|
|
|
31
32
|
import { useWaitForLogin, WAIT_FOR_LOG_IN_KEY } from "./useWaitForLogin.js";
|
|
32
33
|
import { useWaitForSignup, WAIT_FOR_SIGN_UP_KEY } from "./useWaitForSignup.js";
|
|
33
34
|
import { useWaitForWalletCreation, WAIT_FOR_WALLET_CREATION_KEY } from "./useWaitForWalletCreation.js";
|
|
35
|
+
export * from "../permissions/mutations.js";
|
|
34
36
|
export {
|
|
37
|
+
AUTHENTICATE_CUSTOM_OAUTH_KEY,
|
|
35
38
|
AUTHENTICATE_EMAIL_OR_PHONE_KEY,
|
|
36
39
|
AUTHENTICATE_OAUTH_KEY,
|
|
37
40
|
CLAIM_PREGEN_WALLETS_KEY,
|
|
@@ -65,6 +68,7 @@ export {
|
|
|
65
68
|
WAIT_FOR_LOG_IN_KEY,
|
|
66
69
|
WAIT_FOR_SIGN_UP_KEY,
|
|
67
70
|
WAIT_FOR_WALLET_CREATION_KEY,
|
|
71
|
+
useAuthenticateWithCustomOAuth,
|
|
68
72
|
useAuthenticateWithEmailOrPhone,
|
|
69
73
|
useAuthenticateWithOAuth,
|
|
70
74
|
useClaimPregenWallets,
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { AuthenticateWithCustomOAuthParams } from '@getpara/core-sdk';
|
|
2
|
+
export declare const AUTHENTICATE_CUSTOM_OAUTH_KEY = "AUTHENTICATE_CUSTOM_OAUTH";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `authenticateWithCustomOAuth` mutation — logging in through a partner's custom
|
|
5
|
+
* OAuth2/OIDC connection (the v2 rail). Standard providers use `useAuthenticateWithOAuth` instead.
|
|
6
|
+
*
|
|
7
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
8
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
9
|
+
* - `authenticateWithCustomOAuth`: function to trigger the mutation (same as `mutate`)
|
|
10
|
+
* - `authenticateWithCustomOAuthAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const { authenticateWithCustomOAuth, authenticateWithCustomOAuthAsync } = useAuthenticateWithCustomOAuth();
|
|
14
|
+
* authenticateWithCustomOAuth({ provider: 'CUSTOM_OIDC', providerConfigHandle: 'acme-sso' });
|
|
15
|
+
* // or
|
|
16
|
+
* await authenticateWithCustomOAuthAsync({ provider: 'CUSTOM_OAUTH', providerConfigHandle: 'spotify' });
|
|
17
|
+
*/
|
|
18
|
+
export declare const useAuthenticateWithCustomOAuth: () => {
|
|
19
|
+
data: undefined;
|
|
20
|
+
variables: undefined;
|
|
21
|
+
error: null;
|
|
22
|
+
isError: false;
|
|
23
|
+
isIdle: true;
|
|
24
|
+
isPending: false;
|
|
25
|
+
isSuccess: false;
|
|
26
|
+
status: "idle";
|
|
27
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
28
|
+
reset: () => void;
|
|
29
|
+
context: unknown;
|
|
30
|
+
failureCount: number;
|
|
31
|
+
failureReason: Error;
|
|
32
|
+
isPaused: boolean;
|
|
33
|
+
submittedAt: number;
|
|
34
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
35
|
+
authenticateWithCustomOAuth: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
36
|
+
authenticateWithCustomOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
37
|
+
} | {
|
|
38
|
+
data: undefined;
|
|
39
|
+
variables: AuthenticateWithCustomOAuthParams;
|
|
40
|
+
error: null;
|
|
41
|
+
isError: false;
|
|
42
|
+
isIdle: false;
|
|
43
|
+
isPending: true;
|
|
44
|
+
isSuccess: false;
|
|
45
|
+
status: "pending";
|
|
46
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
47
|
+
reset: () => void;
|
|
48
|
+
context: unknown;
|
|
49
|
+
failureCount: number;
|
|
50
|
+
failureReason: Error;
|
|
51
|
+
isPaused: boolean;
|
|
52
|
+
submittedAt: number;
|
|
53
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
54
|
+
authenticateWithCustomOAuth: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
55
|
+
authenticateWithCustomOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
56
|
+
} | {
|
|
57
|
+
data: undefined;
|
|
58
|
+
error: Error;
|
|
59
|
+
variables: AuthenticateWithCustomOAuthParams;
|
|
60
|
+
isError: true;
|
|
61
|
+
isIdle: false;
|
|
62
|
+
isPending: false;
|
|
63
|
+
isSuccess: false;
|
|
64
|
+
status: "error";
|
|
65
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
66
|
+
reset: () => void;
|
|
67
|
+
context: unknown;
|
|
68
|
+
failureCount: number;
|
|
69
|
+
failureReason: Error;
|
|
70
|
+
isPaused: boolean;
|
|
71
|
+
submittedAt: number;
|
|
72
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
73
|
+
authenticateWithCustomOAuth: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
74
|
+
authenticateWithCustomOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
75
|
+
} | {
|
|
76
|
+
data: import("@getpara/core-sdk").AuthenticateResponse;
|
|
77
|
+
error: null;
|
|
78
|
+
variables: AuthenticateWithCustomOAuthParams;
|
|
79
|
+
isError: false;
|
|
80
|
+
isIdle: false;
|
|
81
|
+
isPending: false;
|
|
82
|
+
isSuccess: true;
|
|
83
|
+
status: "success";
|
|
84
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
85
|
+
reset: () => void;
|
|
86
|
+
context: unknown;
|
|
87
|
+
failureCount: number;
|
|
88
|
+
failureReason: Error;
|
|
89
|
+
isPaused: boolean;
|
|
90
|
+
submittedAt: number;
|
|
91
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
92
|
+
authenticateWithCustomOAuth: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
93
|
+
authenticateWithCustomOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthenticateResponse, Error, AuthenticateWithCustomOAuthParams, unknown>;
|
|
94
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { authenticateWithCustomOAuth } from "../../actions/index.js";
|
|
25
|
+
const AUTHENTICATE_CUSTOM_OAUTH_KEY = "AUTHENTICATE_CUSTOM_OAUTH";
|
|
26
|
+
const useAuthenticateWithCustomOAuth = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [AUTHENTICATE_CUSTOM_OAUTH_KEY],
|
|
30
|
+
mutationFn: (params) => __async(null, null, function* () {
|
|
31
|
+
return authenticateWithCustomOAuth(para, params);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(mutation, "authenticateWithCustomOAuth");
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
AUTHENTICATE_CUSTOM_OAUTH_KEY,
|
|
38
|
+
useAuthenticateWithCustomOAuth
|
|
39
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type ParaCore from '@getpara/core-sdk';
|
|
2
|
+
import { type PermissionsMutationResult } from './utils.js';
|
|
3
|
+
export interface UpdateUserPolicyParametersVariables {
|
|
4
|
+
policyId: Parameters<ParaCore['updateUserPolicyParameters']>[0];
|
|
5
|
+
body: Parameters<ParaCore['updateUserPolicyParameters']>[1];
|
|
6
|
+
}
|
|
7
|
+
export declare const useUpdateUserPolicyParameters: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["updateUserPolicyParameters"]>>, UpdateUserPolicyParametersVariables, "updateUserPolicyParameters">;
|
|
8
|
+
export interface ResetUserPolicyParametersVariables {
|
|
9
|
+
policyId: Parameters<ParaCore['resetUserPolicyParameters']>[0];
|
|
10
|
+
body: Parameters<ParaCore['resetUserPolicyParameters']>[1];
|
|
11
|
+
}
|
|
12
|
+
export declare const useResetUserPolicyParameters: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["resetUserPolicyParameters"]>>, ResetUserPolicyParametersVariables, "resetUserPolicyParameters">;
|
|
13
|
+
export interface UpdateApprovalConfigurationVariables {
|
|
14
|
+
reference: Parameters<ParaCore['updateApprovalConfiguration']>[0];
|
|
15
|
+
body: Parameters<ParaCore['updateApprovalConfiguration']>[1];
|
|
16
|
+
}
|
|
17
|
+
export declare const useUpdateApprovalConfiguration: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["updateApprovalConfiguration"]>>, UpdateApprovalConfigurationVariables, "updateApprovalConfiguration">;
|
|
18
|
+
export interface ResetApprovalConfigurationVariables {
|
|
19
|
+
reference: Parameters<ParaCore['resetApprovalConfiguration']>[0];
|
|
20
|
+
expectedRevision: Parameters<ParaCore['resetApprovalConfiguration']>[1];
|
|
21
|
+
}
|
|
22
|
+
export declare const useResetApprovalConfiguration: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["resetApprovalConfiguration"]>>, ResetApprovalConfigurationVariables, "resetApprovalConfiguration">;
|
|
23
|
+
export declare const useApproveApprovalCase: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["approveApprovalCase"]>>, Parameters<ParaCore["approveApprovalCase"]>[0], "approveApprovalCase">;
|
|
24
|
+
export declare const useRejectApprovalCase: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["rejectApprovalCase"]>>, Parameters<ParaCore["rejectApprovalCase"]>[0], "rejectApprovalCase">;
|
|
25
|
+
export declare const useCreateApprovalSignatureCollection: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["createApprovalSignatureCollection"]>>, Parameters<ParaCore["createApprovalSignatureCollection"]>[0], "createApprovalSignatureCollection">;
|
|
26
|
+
export interface SubmitApprovalSignatureVariables {
|
|
27
|
+
caseId: Parameters<ParaCore['submitApprovalSignature']>[0];
|
|
28
|
+
body: Parameters<ParaCore['submitApprovalSignature']>[1];
|
|
29
|
+
}
|
|
30
|
+
export declare const useSubmitApprovalSignature: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["submitApprovalSignature"]>>, SubmitApprovalSignatureVariables, "submitApprovalSignature">;
|
|
31
|
+
export declare const useSignApprovalTransaction: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["signApprovalTransaction"]>>, Parameters<ParaCore["signApprovalTransaction"]>[0], "signApprovalTransaction">;
|
|
32
|
+
export declare const useGetPolicyConsentUrl: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["getPolicyConsentUrl"]>>, Parameters<ParaCore["getPolicyConsentUrl"]>[0], "getPolicyConsentUrl">;
|
|
33
|
+
export declare const useGetApprovalCaseReviewUrl: () => PermissionsMutationResult<Awaited<ReturnType<ParaCore["getApprovalCaseReviewUrl"]>>, Parameters<ParaCore["getApprovalCaseReviewUrl"]>[0], "getApprovalCaseReviewUrl">;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as actions from "../../actions/permissions.js";
|
|
2
|
+
import { usePermissionsMutation } from "./utils.js";
|
|
3
|
+
const useUpdateUserPolicyParameters = () => usePermissionsMutation(
|
|
4
|
+
"updateUserPolicyParameters",
|
|
5
|
+
(client, variables) => actions.updateUserPolicyParameters(client, variables.policyId, variables.body)
|
|
6
|
+
);
|
|
7
|
+
const useResetUserPolicyParameters = () => usePermissionsMutation(
|
|
8
|
+
"resetUserPolicyParameters",
|
|
9
|
+
(client, variables) => actions.resetUserPolicyParameters(client, variables.policyId, variables.body)
|
|
10
|
+
);
|
|
11
|
+
const useUpdateApprovalConfiguration = () => usePermissionsMutation(
|
|
12
|
+
"updateApprovalConfiguration",
|
|
13
|
+
(client, variables) => actions.updateApprovalConfiguration(client, variables.reference, variables.body)
|
|
14
|
+
);
|
|
15
|
+
const useResetApprovalConfiguration = () => usePermissionsMutation(
|
|
16
|
+
"resetApprovalConfiguration",
|
|
17
|
+
(client, variables) => actions.resetApprovalConfiguration(client, variables.reference, variables.expectedRevision)
|
|
18
|
+
);
|
|
19
|
+
const useApproveApprovalCase = () => usePermissionsMutation(
|
|
20
|
+
"approveApprovalCase",
|
|
21
|
+
(client, variables) => actions.approveApprovalCase(client, variables)
|
|
22
|
+
);
|
|
23
|
+
const useRejectApprovalCase = () => usePermissionsMutation(
|
|
24
|
+
"rejectApprovalCase",
|
|
25
|
+
(client, variables) => actions.rejectApprovalCase(client, variables)
|
|
26
|
+
);
|
|
27
|
+
const useCreateApprovalSignatureCollection = () => usePermissionsMutation(
|
|
28
|
+
"createApprovalSignatureCollection",
|
|
29
|
+
(client, variables) => actions.createApprovalSignatureCollection(client, variables)
|
|
30
|
+
);
|
|
31
|
+
const useSubmitApprovalSignature = () => usePermissionsMutation(
|
|
32
|
+
"submitApprovalSignature",
|
|
33
|
+
(client, variables) => actions.submitApprovalSignature(client, variables.caseId, variables.body)
|
|
34
|
+
);
|
|
35
|
+
const useSignApprovalTransaction = () => usePermissionsMutation(
|
|
36
|
+
"signApprovalTransaction",
|
|
37
|
+
(client, variables) => actions.signApprovalTransaction(client, variables)
|
|
38
|
+
);
|
|
39
|
+
const useGetPolicyConsentUrl = () => usePermissionsMutation(
|
|
40
|
+
"getPolicyConsentUrl",
|
|
41
|
+
(client, variables) => actions.getPolicyConsentUrl(client, variables),
|
|
42
|
+
false
|
|
43
|
+
);
|
|
44
|
+
const useGetApprovalCaseReviewUrl = () => usePermissionsMutation(
|
|
45
|
+
"getApprovalCaseReviewUrl",
|
|
46
|
+
(client, variables) => actions.getApprovalCaseReviewUrl(client, variables),
|
|
47
|
+
false
|
|
48
|
+
);
|
|
49
|
+
export {
|
|
50
|
+
useApproveApprovalCase,
|
|
51
|
+
useCreateApprovalSignatureCollection,
|
|
52
|
+
useGetApprovalCaseReviewUrl,
|
|
53
|
+
useGetPolicyConsentUrl,
|
|
54
|
+
useRejectApprovalCase,
|
|
55
|
+
useResetApprovalConfiguration,
|
|
56
|
+
useResetUserPolicyParameters,
|
|
57
|
+
useSignApprovalTransaction,
|
|
58
|
+
useSubmitApprovalSignature,
|
|
59
|
+
useUpdateApprovalConfiguration,
|
|
60
|
+
useUpdateUserPolicyParameters
|
|
61
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type ParaCore from '@getpara/core-sdk';
|
|
3
|
+
export declare const usePolicies: (...args: Parameters<ParaCore["listPolicies"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["listPolicies"]>>, Error>;
|
|
4
|
+
export declare const usePolicy: (...args: Parameters<ParaCore["getPolicy"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getPolicy"]>>, Error>;
|
|
5
|
+
export declare const useApplicablePolicies: (...args: Parameters<ParaCore["listApplicablePolicies"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["listApplicablePolicies"]>>, Error>;
|
|
6
|
+
export declare const useApplicablePolicy: (...args: Parameters<ParaCore["getApplicablePolicy"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getApplicablePolicy"]>>, Error>;
|
|
7
|
+
export declare const useUserPolicyConsents: (...args: Parameters<ParaCore["listUserPolicyConsents"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["listUserPolicyConsents"]>>, Error>;
|
|
8
|
+
export declare const useUserPolicyConsent: (...args: Parameters<ParaCore["getUserPolicyConsent"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getUserPolicyConsent"]>>, Error>;
|
|
9
|
+
export declare const useUserAdjustablePolicies: (...args: Parameters<ParaCore["listUserAdjustablePolicies"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["listUserAdjustablePolicies"]>>, Error>;
|
|
10
|
+
export declare const useUserPolicyParameters: (...args: Parameters<ParaCore["getUserPolicyParameters"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getUserPolicyParameters"]>>, Error>;
|
|
11
|
+
export declare const useUserPolicyParameterHistory: (...args: Parameters<ParaCore["listUserPolicyParameterHistory"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["listUserPolicyParameterHistory"]>>, Error>;
|
|
12
|
+
export declare const useConfigurableApprovalRequirements: (...args: Parameters<ParaCore["listConfigurableApprovalRequirements"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["listConfigurableApprovalRequirements"]>>, Error>;
|
|
13
|
+
export declare const useConfigurableApprovalRequirement: (...args: Parameters<ParaCore["getConfigurableApprovalRequirement"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getConfigurableApprovalRequirement"]>>, Error>;
|
|
14
|
+
export declare const useApprovalConfiguration: (...args: Parameters<ParaCore["getApprovalConfiguration"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getApprovalConfiguration"]>>, Error>;
|
|
15
|
+
export declare const useEffectiveApprovalConfiguration: (...args: Parameters<ParaCore["getEffectiveApprovalConfiguration"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getEffectiveApprovalConfiguration"]>>, Error>;
|
|
16
|
+
export declare const useApprovalConfigurationHistory: (...args: Parameters<ParaCore["listApprovalConfigurationHistory"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["listApprovalConfigurationHistory"]>>, Error>;
|
|
17
|
+
export declare const useUserApprovalAssignments: (...args: Parameters<ParaCore["getUserApprovalAssignments"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getUserApprovalAssignments"]>>, Error>;
|
|
18
|
+
export declare const useUserApprovalCapabilities: (...args: Parameters<ParaCore["getUserApprovalCapabilities"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getUserApprovalCapabilities"]>>, Error>;
|
|
19
|
+
export declare const useAccessibleApprovalCases: (...args: Parameters<ParaCore["listAccessibleApprovalCases"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["listAccessibleApprovalCases"]>>, Error>;
|
|
20
|
+
export declare const useAccessibleApprovalCase: (...args: Parameters<ParaCore["getAccessibleApprovalCase"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getAccessibleApprovalCase"]>>, Error>;
|
|
21
|
+
export declare const useInitiatedApprovalCases: (...args: Parameters<ParaCore["listInitiatedApprovalCases"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["listInitiatedApprovalCases"]>>, Error>;
|
|
22
|
+
export declare const useInitiatedApprovalCase: (...args: Parameters<ParaCore["getInitiatedApprovalCase"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getInitiatedApprovalCase"]>>, Error>;
|
|
23
|
+
export declare const useApprovalSigningPayload: (...args: Parameters<ParaCore["getApprovalSigningPayload"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getApprovalSigningPayload"]>>, Error>;
|
|
24
|
+
export declare const useApprovalSignatures: (...args: Parameters<ParaCore["getApprovalSignatures"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getApprovalSignatures"]>>, Error>;
|
|
25
|
+
export declare const useUserPolicyUsage: (...args: Parameters<ParaCore["getUserPolicyUsage"]>) => UseQueryResult<Awaited<ReturnType<ParaCore["getUserPolicyUsage"]>>, Error>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as actions from "../../actions/permissions.js";
|
|
2
|
+
import { usePermissionsQuery } from "./utils.js";
|
|
3
|
+
const usePolicies = (...args) => usePermissionsQuery("listPolicies", args, (client) => actions.listPolicies(client, ...args), true);
|
|
4
|
+
const usePolicy = (...args) => usePermissionsQuery("getPolicy", args, (client) => actions.getPolicy(client, ...args), true);
|
|
5
|
+
const useApplicablePolicies = (...args) => usePermissionsQuery("listApplicablePolicies", args, (client) => actions.listApplicablePolicies(client, ...args));
|
|
6
|
+
const useApplicablePolicy = (...args) => usePermissionsQuery("getApplicablePolicy", args, (client) => actions.getApplicablePolicy(client, ...args));
|
|
7
|
+
const useUserPolicyConsents = (...args) => usePermissionsQuery("listUserPolicyConsents", args, (client) => actions.listUserPolicyConsents(client, ...args));
|
|
8
|
+
const useUserPolicyConsent = (...args) => usePermissionsQuery("getUserPolicyConsent", args, (client) => actions.getUserPolicyConsent(client, ...args));
|
|
9
|
+
const useUserAdjustablePolicies = (...args) => usePermissionsQuery("listUserAdjustablePolicies", args, (client) => actions.listUserAdjustablePolicies(client, ...args));
|
|
10
|
+
const useUserPolicyParameters = (...args) => usePermissionsQuery("getUserPolicyParameters", args, (client) => actions.getUserPolicyParameters(client, ...args));
|
|
11
|
+
const useUserPolicyParameterHistory = (...args) => usePermissionsQuery(
|
|
12
|
+
"listUserPolicyParameterHistory",
|
|
13
|
+
args,
|
|
14
|
+
(client) => actions.listUserPolicyParameterHistory(client, ...args)
|
|
15
|
+
);
|
|
16
|
+
const useConfigurableApprovalRequirements = (...args) => usePermissionsQuery(
|
|
17
|
+
"listConfigurableApprovalRequirements",
|
|
18
|
+
args,
|
|
19
|
+
(client) => actions.listConfigurableApprovalRequirements(client, ...args)
|
|
20
|
+
);
|
|
21
|
+
const useConfigurableApprovalRequirement = (...args) => usePermissionsQuery(
|
|
22
|
+
"getConfigurableApprovalRequirement",
|
|
23
|
+
args,
|
|
24
|
+
(client) => actions.getConfigurableApprovalRequirement(client, ...args)
|
|
25
|
+
);
|
|
26
|
+
const useApprovalConfiguration = (...args) => usePermissionsQuery("getApprovalConfiguration", args, (client) => actions.getApprovalConfiguration(client, ...args));
|
|
27
|
+
const useEffectiveApprovalConfiguration = (...args) => usePermissionsQuery(
|
|
28
|
+
"getEffectiveApprovalConfiguration",
|
|
29
|
+
args,
|
|
30
|
+
(client) => actions.getEffectiveApprovalConfiguration(client, ...args)
|
|
31
|
+
);
|
|
32
|
+
const useApprovalConfigurationHistory = (...args) => usePermissionsQuery(
|
|
33
|
+
"listApprovalConfigurationHistory",
|
|
34
|
+
args,
|
|
35
|
+
(client) => actions.listApprovalConfigurationHistory(client, ...args)
|
|
36
|
+
);
|
|
37
|
+
const useUserApprovalAssignments = (...args) => usePermissionsQuery("getUserApprovalAssignments", args, (client) => actions.getUserApprovalAssignments(client, ...args));
|
|
38
|
+
const useUserApprovalCapabilities = (...args) => usePermissionsQuery("getUserApprovalCapabilities", args, (client) => actions.getUserApprovalCapabilities(client, ...args));
|
|
39
|
+
const useAccessibleApprovalCases = (...args) => usePermissionsQuery("listAccessibleApprovalCases", args, (client) => actions.listAccessibleApprovalCases(client, ...args));
|
|
40
|
+
const useAccessibleApprovalCase = (...args) => usePermissionsQuery("getAccessibleApprovalCase", args, (client) => actions.getAccessibleApprovalCase(client, ...args));
|
|
41
|
+
const useInitiatedApprovalCases = (...args) => usePermissionsQuery("listInitiatedApprovalCases", args, (client) => actions.listInitiatedApprovalCases(client, ...args));
|
|
42
|
+
const useInitiatedApprovalCase = (...args) => usePermissionsQuery("getInitiatedApprovalCase", args, (client) => actions.getInitiatedApprovalCase(client, ...args));
|
|
43
|
+
const useApprovalSigningPayload = (...args) => usePermissionsQuery("getApprovalSigningPayload", args, (client) => actions.getApprovalSigningPayload(client, ...args));
|
|
44
|
+
const useApprovalSignatures = (...args) => usePermissionsQuery("getApprovalSignatures", args, (client) => actions.getApprovalSignatures(client, ...args));
|
|
45
|
+
const useUserPolicyUsage = (...args) => usePermissionsQuery("getUserPolicyUsage", args, (client) => actions.getUserPolicyUsage(client, ...args));
|
|
46
|
+
export {
|
|
47
|
+
useAccessibleApprovalCase,
|
|
48
|
+
useAccessibleApprovalCases,
|
|
49
|
+
useApplicablePolicies,
|
|
50
|
+
useApplicablePolicy,
|
|
51
|
+
useApprovalConfiguration,
|
|
52
|
+
useApprovalConfigurationHistory,
|
|
53
|
+
useApprovalSignatures,
|
|
54
|
+
useApprovalSigningPayload,
|
|
55
|
+
useConfigurableApprovalRequirement,
|
|
56
|
+
useConfigurableApprovalRequirements,
|
|
57
|
+
useEffectiveApprovalConfiguration,
|
|
58
|
+
useInitiatedApprovalCase,
|
|
59
|
+
useInitiatedApprovalCases,
|
|
60
|
+
usePolicies,
|
|
61
|
+
usePolicy,
|
|
62
|
+
useUserAdjustablePolicies,
|
|
63
|
+
useUserApprovalAssignments,
|
|
64
|
+
useUserApprovalCapabilities,
|
|
65
|
+
useUserPolicyConsent,
|
|
66
|
+
useUserPolicyConsents,
|
|
67
|
+
useUserPolicyParameterHistory,
|
|
68
|
+
useUserPolicyParameters,
|
|
69
|
+
useUserPolicyUsage
|
|
70
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type ParaCore from '@getpara/core-sdk';
|
|
2
|
+
import { type UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { renameMutations } from '../../utils/renameMutations.js';
|
|
4
|
+
export declare function usePermissionsQuery<T>(method: string, args: readonly unknown[], read: (client: ParaCore | undefined) => Promise<T>, isPublic?: boolean): UseQueryResult<T, Error>;
|
|
5
|
+
export type PermissionsMutationResult<T, V, N extends string> = ReturnType<typeof renameMutations<T, Error, V, readonly unknown[], N>>;
|
|
6
|
+
export declare function usePermissionsMutation<T, V, N extends string>(name: N, write: (client: ParaCore | undefined, variables: V) => Promise<T>, invalidateReads?: boolean): PermissionsMutationResult<T, V, N>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/useClient.js";
|
|
23
|
+
import { useIsFullyLoggedIn } from "../queries/useIsFullyLoggedIn.js";
|
|
24
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
25
|
+
const PERMISSIONS_KEY = "PARA_PERMISSIONS";
|
|
26
|
+
const clients = /* @__PURE__ */ new WeakMap();
|
|
27
|
+
let nextClientId = 0;
|
|
28
|
+
function clientKey(client) {
|
|
29
|
+
if (!client) return null;
|
|
30
|
+
if (!clients.has(client)) clients.set(client, ++nextClientId);
|
|
31
|
+
return clients.get(client);
|
|
32
|
+
}
|
|
33
|
+
function usePermissionsQuery(method, args, read, isPublic = false) {
|
|
34
|
+
const client = useClient();
|
|
35
|
+
const { data: loggedIn } = useIsFullyLoggedIn();
|
|
36
|
+
const identity = isPublic ? "public" : loggedIn ? client == null ? void 0 : client.userId : null;
|
|
37
|
+
return useQuery({
|
|
38
|
+
queryKey: [PERMISSIONS_KEY, clientKey(client), identity != null ? identity : null, method, ...args],
|
|
39
|
+
enabled: !!client && (isPublic || !!loggedIn && !!client.userId),
|
|
40
|
+
queryFn: () => read(client)
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function usePermissionsMutation(name, write, invalidateReads = true) {
|
|
44
|
+
var _a;
|
|
45
|
+
const client = useClient();
|
|
46
|
+
const { data: loggedIn } = useIsFullyLoggedIn();
|
|
47
|
+
const queryClient = useQueryClient();
|
|
48
|
+
const scope = [PERMISSIONS_KEY, clientKey(client), (_a = client == null ? void 0 : client.userId) != null ? _a : null];
|
|
49
|
+
const mutation = useMutation({
|
|
50
|
+
mutationKey: [...scope, name],
|
|
51
|
+
onMutate: () => scope,
|
|
52
|
+
mutationFn: (variables) => {
|
|
53
|
+
if (!client) throw new Error("no para instance");
|
|
54
|
+
if (!loggedIn || !client.userId) throw new Error("User must be authenticated");
|
|
55
|
+
return write(client, variables);
|
|
56
|
+
},
|
|
57
|
+
// Values, consent, capabilities, and cases can depend on each other.
|
|
58
|
+
onSuccess: (_data, _variables, originalScope) => __async(null, null, function* () {
|
|
59
|
+
if (invalidateReads) yield queryClient.invalidateQueries({ queryKey: originalScope });
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
return renameMutations(mutation, name);
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
usePermissionsMutation,
|
|
66
|
+
usePermissionsQuery
|
|
67
|
+
};
|
|
@@ -3,3 +3,4 @@ export { useParaStatus, createParaStatusHook, type ParaStatusBase } from './useP
|
|
|
3
3
|
export { useAccount, EMBEDDED_ACCOUNT_BASE_KEY, type Account } from './useAccount.js';
|
|
4
4
|
export { useWallet, WALLET_BASE_KEY } from './useWallet.js';
|
|
5
5
|
export { createAccountHook, ACCOUNT_BASE_KEY, type ConnectionType, type ExternalWalletState, type UseAccountReturn, } from './createAccountHook.js';
|
|
6
|
+
export * from '../permissions/queries.js';
|
package/dist/queries.d.ts
CHANGED
package/dist/queries.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.0",
|
|
4
4
|
"description": "Platform-agnostic ParaProvider, hooks, and store for Para SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -89,18 +89,18 @@
|
|
|
89
89
|
"test": "vitest run"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@getpara/core-sdk": "3.
|
|
92
|
+
"@getpara/core-sdk": "3.20.0",
|
|
93
93
|
"zustand": "^5.0.0"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@cosmjs/amino": "^0.32.0",
|
|
97
97
|
"@cosmjs/proto-signing": "^0.32.0",
|
|
98
|
-
"@getpara/cosmjs-v0-integration": "3.
|
|
99
|
-
"@getpara/ethers-v6-integration": "3.
|
|
100
|
-
"@getpara/solana-signers-v2-integration": "3.
|
|
101
|
-
"@getpara/stellar-sdk-v14-integration": "3.
|
|
102
|
-
"@getpara/sui-sdk-integration": "3.
|
|
103
|
-
"@getpara/viem-v2-integration": "3.
|
|
98
|
+
"@getpara/cosmjs-v0-integration": "3.20.0",
|
|
99
|
+
"@getpara/ethers-v6-integration": "3.20.0",
|
|
100
|
+
"@getpara/solana-signers-v2-integration": "3.20.0",
|
|
101
|
+
"@getpara/stellar-sdk-v14-integration": "3.20.0",
|
|
102
|
+
"@getpara/sui-sdk-integration": "3.20.0",
|
|
103
|
+
"@getpara/viem-v2-integration": "3.20.0",
|
|
104
104
|
"@solana/signers": "^2.0.0",
|
|
105
105
|
"@tanstack/react-query": "^5.74.0",
|
|
106
106
|
"@testing-library/dom": "^10.4.0",
|
|
@@ -146,5 +146,5 @@
|
|
|
146
146
|
"optional": true
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
|
-
"gitHead": "
|
|
149
|
+
"gitHead": "0a7224c678bc2b172bd41cce75637a8783869a93"
|
|
150
150
|
}
|