@vention/vention-cli 0.9.0 → 0.10.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 +101 -21
- package/cli.esm.js +4488 -41
- package/package.json +1 -1
- package/src/config.d.ts +6 -1
- package/src/sso-auth.d.ts +30 -0
- package/src/sso-constants.d.ts +7 -0
package/package.json
CHANGED
package/src/config.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export interface SessionData {
|
|
2
2
|
environment: "local" | "demo" | "prod";
|
|
3
|
-
ventionSession
|
|
3
|
+
ventionSession?: string;
|
|
4
4
|
stytchSessionJwt?: string;
|
|
5
5
|
ventionIdpSession?: string;
|
|
6
|
+
oauth?: {
|
|
7
|
+
accessToken: string;
|
|
8
|
+
refreshToken?: string;
|
|
9
|
+
expiresAt?: number;
|
|
10
|
+
};
|
|
6
11
|
}
|
|
7
12
|
export declare const getConfigPath: () => string;
|
|
8
13
|
export declare const saveSession: (data: SessionData) => Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SessionData } from "./config";
|
|
2
|
+
export interface OAuthTokens {
|
|
3
|
+
accessToken: string;
|
|
4
|
+
refreshToken?: string;
|
|
5
|
+
expiresInSeconds?: number;
|
|
6
|
+
}
|
|
7
|
+
interface SsoConfig {
|
|
8
|
+
clientId: string;
|
|
9
|
+
authorizeUrl: string;
|
|
10
|
+
tokenUrl: string;
|
|
11
|
+
revokeUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const exchangeAuthorizationCodeForTokens: (config: SsoConfig, code: string, codeVerifier: string, redirectUri: string) => Promise<{
|
|
14
|
+
accessToken: string;
|
|
15
|
+
refreshToken: string | undefined;
|
|
16
|
+
expiresInSeconds: number | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const refreshAccessToken: (config: SsoConfig, refreshToken: string) => Promise<{
|
|
19
|
+
accessToken: string;
|
|
20
|
+
refreshToken: string;
|
|
21
|
+
expiresInSeconds: number | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const revokeToken: (config: SsoConfig, token: string, tokenType?: "access_token" | "refresh_token") => Promise<void>;
|
|
24
|
+
export declare const loginWithSso: (environment: SessionData["environment"]) => Promise<{
|
|
25
|
+
accessToken: string;
|
|
26
|
+
refreshToken: string | undefined;
|
|
27
|
+
expiresInSeconds: number | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const getSsoEnvironmentConfig: (environment: SessionData["environment"]) => SsoConfig;
|
|
30
|
+
export {};
|