@vention/vention-cli 0.38.27 → 0.38.29
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/main.esm.js +2760 -5352
- package/package.json +1 -1
- package/src/config.d.ts +0 -13
- package/src/digital-twin-connection/local.d.ts +1 -0
- package/src/platform-auth.d.ts +1 -1
- package/src/digital-twin-connection/rails-api.d.ts +0 -6
- package/src/feature-flags.d.ts +0 -10
- package/src/rails-client.d.ts +0 -21
- package/src/rails-client.msw.d.ts +0 -16
- package/src/rails-client.stub.d.ts +0 -2
- package/src/sso-auth.d.ts +0 -29
- package/src/sso-constants.d.ts +0 -7
package/package.json
CHANGED
package/src/config.d.ts
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import type { StoredGatewayToken } from "@ventionco/auth-strategy-bearer";
|
|
2
|
-
export interface FeatureFlagCache {
|
|
3
|
-
fetchedAt: number;
|
|
4
|
-
values: Record<string, boolean>;
|
|
5
|
-
}
|
|
6
2
|
export interface SessionData {
|
|
7
3
|
environment: "local" | "demo" | "prod";
|
|
8
|
-
stytchSessionJwt?: string;
|
|
9
|
-
ventionIdpSession?: string;
|
|
10
|
-
oauth?: {
|
|
11
|
-
accessToken: string;
|
|
12
|
-
refreshToken?: string;
|
|
13
|
-
expiresAt?: number;
|
|
14
|
-
};
|
|
15
|
-
email?: string;
|
|
16
|
-
featureFlags?: FeatureFlagCache;
|
|
17
4
|
gatewayToken?: StoredGatewayToken & {
|
|
18
5
|
environment: SessionData["environment"];
|
|
19
6
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { DigitalTwinConnection, Design } from "./types";
|
|
2
|
+
export declare const LOCAL_DIGITAL_TWIN_URL = "http://localhost:3101";
|
|
2
3
|
export declare const resolveConnection: () => Promise<DigitalTwinConnection>;
|
|
3
4
|
export declare const listDesigns: () => Promise<Design[]>;
|
package/src/platform-auth.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { type GatewayTokenStore } from "@ventionco/auth-strategy-bearer";
|
|
|
2
2
|
import { SessionData } from "./config";
|
|
3
3
|
export declare const getPlatformAuthOrigin: (environment: SessionData["environment"]) => string | undefined;
|
|
4
4
|
export declare const gatewayTokenStore: (session: SessionData) => GatewayTokenStore;
|
|
5
|
-
export declare const loginToPlatform: (
|
|
5
|
+
export declare const loginToPlatform: (environment: SessionData["environment"]) => Promise<void>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SessionData } from "../config";
|
|
2
|
-
import type { DigitalTwinConnection, Design } from "./types";
|
|
3
|
-
export declare const getDigitalTwinUrl: (environment: SessionData["environment"], sessionId: string) => string;
|
|
4
|
-
export declare const buildConnection: (environment: SessionData["environment"], designId: number, sessionId: string) => DigitalTwinConnection;
|
|
5
|
-
export declare const resolveConnection: (session: SessionData, designId: number) => Promise<DigitalTwinConnection | undefined>;
|
|
6
|
-
export declare const listDesigns: (session: SessionData) => Promise<Design[]>;
|
package/src/feature-flags.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SessionData } from "./config";
|
|
2
|
-
export interface FeatureFlag {
|
|
3
|
-
key: string;
|
|
4
|
-
override?: string;
|
|
5
|
-
defaultValue: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const DIGITAL_TWIN_V3: FeatureFlag;
|
|
8
|
-
export declare const refreshFeatureFlags: () => Promise<void>;
|
|
9
|
-
export declare const isFeatureEnabled: (session: SessionData, flag: FeatureFlag) => boolean;
|
|
10
|
-
export declare const isDigitalTwinV3Enabled: (session: SessionData) => boolean;
|
package/src/rails-client.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SessionData } from "./config";
|
|
2
|
-
export interface AllocationResponse {
|
|
3
|
-
cookie: {
|
|
4
|
-
originalMaxAge: number;
|
|
5
|
-
expires: string;
|
|
6
|
-
httpOnly: boolean;
|
|
7
|
-
path: string;
|
|
8
|
-
};
|
|
9
|
-
sessionId: string;
|
|
10
|
-
tabId: string;
|
|
11
|
-
userId: string;
|
|
12
|
-
allocatedResourceId: string;
|
|
13
|
-
allocationCreationTime: number;
|
|
14
|
-
allocatedResourceLastAccessTime: number;
|
|
15
|
-
allocationType: "regular" | "custom";
|
|
16
|
-
designName: string;
|
|
17
|
-
designId: number;
|
|
18
|
-
}
|
|
19
|
-
export declare const getBaseRailsUrl: (environment: SessionData["environment"]) => "http://localhost:3000" | "https://vention.foo" | "https://vention.com";
|
|
20
|
-
export type GetAllocationsSuccessResponse = AllocationResponse[];
|
|
21
|
-
export declare const getUserAllocations: (session: SessionData) => Promise<GetAllocationsSuccessResponse>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type HttpHandler, type RequestHandlerOptions, type HttpResponseResolver } from "msw";
|
|
2
|
-
import { AllocationResponse, GetAllocationsSuccessResponse } from "./rails-client";
|
|
3
|
-
import { HandlerParams, RawRequestSpyOptions } from "./test-setup/msw-helpers";
|
|
4
|
-
export type GetAllocationsTypes = {
|
|
5
|
-
Request: never;
|
|
6
|
-
Response: GetAllocationsSuccessResponse | string;
|
|
7
|
-
Resolver: HttpResponseResolver<never, GetAllocationsTypes["Request"], GetAllocationsTypes["Response"]>;
|
|
8
|
-
};
|
|
9
|
-
export declare const GetAllocations: {
|
|
10
|
-
readonly Handler: ({ resolver, remoteHost }: HandlerParams<GetAllocationsTypes["Resolver"]>, mswOptions?: RequestHandlerOptions) => HttpHandler;
|
|
11
|
-
readonly SuccessResolver: ({ allocations, requestSpy, }?: {
|
|
12
|
-
allocations?: AllocationResponse[];
|
|
13
|
-
} & RawRequestSpyOptions) => GetAllocationsTypes["Resolver"];
|
|
14
|
-
readonly UnauthorizedResolver: () => GetAllocationsTypes["Resolver"];
|
|
15
|
-
readonly NetworkErrorResolver: () => GetAllocationsTypes["Resolver"];
|
|
16
|
-
};
|
package/src/sso-auth.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { SessionData } from "./config";
|
|
2
|
-
export interface OAuthTokens {
|
|
3
|
-
accessToken: string;
|
|
4
|
-
refreshToken?: string;
|
|
5
|
-
expiresInSeconds?: number;
|
|
6
|
-
email?: string;
|
|
7
|
-
}
|
|
8
|
-
interface SsoConfig {
|
|
9
|
-
clientId: string;
|
|
10
|
-
authorizeUrl: string;
|
|
11
|
-
tokenUrl: string;
|
|
12
|
-
revokeUrl?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const exchangeAuthorizationCodeForTokens: (config: SsoConfig, code: string, codeVerifier: string, redirectUri: string) => Promise<{
|
|
15
|
-
accessToken: string;
|
|
16
|
-
refreshToken: string | undefined;
|
|
17
|
-
expiresInSeconds: number | undefined;
|
|
18
|
-
email: string | undefined;
|
|
19
|
-
}>;
|
|
20
|
-
export declare const refreshAccessToken: (config: SsoConfig, refreshToken: string) => Promise<{
|
|
21
|
-
accessToken: string;
|
|
22
|
-
refreshToken: string;
|
|
23
|
-
expiresInSeconds: number | undefined;
|
|
24
|
-
}>;
|
|
25
|
-
export declare const revokeToken: (config: SsoConfig, token: string, tokenType?: "access_token" | "refresh_token") => Promise<void>;
|
|
26
|
-
export declare const revokeRefreshToken: ({ environment, oauth }: SessionData) => Promise<void>;
|
|
27
|
-
export declare const loginWithSso: (environment: SessionData["environment"]) => Promise<OAuthTokens>;
|
|
28
|
-
export declare const getSsoEnvironmentConfig: (environment: SessionData["environment"]) => SsoConfig;
|
|
29
|
-
export {};
|