@mintmcp/hosted-cli 0.0.15 → 0.0.17
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/auth.d.ts +95 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +659 -0
- package/dist/auth.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +125 -116
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/auth.ts +945 -0
- package/src/index.ts +196 -151
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const EnvSchema: z.ZodEnum<["staging", "production"]>;
|
|
3
|
+
export type Env = z.infer<typeof EnvSchema>;
|
|
4
|
+
declare const StoredSessionSchema: z.ZodObject<{
|
|
5
|
+
userId: z.ZodString;
|
|
6
|
+
email: z.ZodString;
|
|
7
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
10
|
+
currentOrganizationId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
lastUsedAt: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
email: string;
|
|
14
|
+
userId: string;
|
|
15
|
+
firstName?: string | null | undefined;
|
|
16
|
+
lastName?: string | null | undefined;
|
|
17
|
+
refreshToken?: string | undefined;
|
|
18
|
+
currentOrganizationId?: string | undefined;
|
|
19
|
+
lastUsedAt?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
email: string;
|
|
22
|
+
userId: string;
|
|
23
|
+
firstName?: string | null | undefined;
|
|
24
|
+
lastName?: string | null | undefined;
|
|
25
|
+
refreshToken?: string | undefined;
|
|
26
|
+
currentOrganizationId?: string | undefined;
|
|
27
|
+
lastUsedAt?: string | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
declare const StoredOrgAccessSchema: z.ZodObject<{
|
|
30
|
+
userId: z.ZodString;
|
|
31
|
+
organizationId: z.ZodString;
|
|
32
|
+
accessToken: z.ZodString;
|
|
33
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
34
|
+
lastUsedAt: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
accessToken: string;
|
|
37
|
+
organizationId: string;
|
|
38
|
+
userId: string;
|
|
39
|
+
lastUsedAt?: string | undefined;
|
|
40
|
+
expiresAt?: string | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
accessToken: string;
|
|
43
|
+
organizationId: string;
|
|
44
|
+
userId: string;
|
|
45
|
+
lastUsedAt?: string | undefined;
|
|
46
|
+
expiresAt?: string | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
declare const StoredAuthAccountSchema: z.ZodObject<{
|
|
49
|
+
env: z.ZodEnum<["staging", "production"]>;
|
|
50
|
+
userId: z.ZodString;
|
|
51
|
+
organizationId: z.ZodString;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
organizationId: string;
|
|
54
|
+
userId: string;
|
|
55
|
+
env: "staging" | "production";
|
|
56
|
+
}, {
|
|
57
|
+
organizationId: string;
|
|
58
|
+
userId: string;
|
|
59
|
+
env: "staging" | "production";
|
|
60
|
+
}>;
|
|
61
|
+
type StoredSession = z.infer<typeof StoredSessionSchema>;
|
|
62
|
+
type StoredOrgAccess = z.infer<typeof StoredOrgAccessSchema>;
|
|
63
|
+
export type StoredAuthAccount = z.infer<typeof StoredAuthAccountSchema>;
|
|
64
|
+
export type Auth = StoredSession & StoredOrgAccess;
|
|
65
|
+
export type AuthRecord = {
|
|
66
|
+
account: StoredAuthAccount;
|
|
67
|
+
auth: Auth;
|
|
68
|
+
};
|
|
69
|
+
export declare function sameStoredAuthAccount(left: StoredAuthAccount, right: StoredAuthAccount): boolean;
|
|
70
|
+
export declare function getTokenClaims(accessToken: string): {
|
|
71
|
+
exp: number | undefined;
|
|
72
|
+
org_id: string | undefined;
|
|
73
|
+
sid: string | undefined;
|
|
74
|
+
sub: string | undefined;
|
|
75
|
+
};
|
|
76
|
+
export declare function formatAuthSummary(auth: Auth): string;
|
|
77
|
+
export declare function listAuthRecords(env: Env): Promise<AuthRecord[]>;
|
|
78
|
+
export declare function requestAndStoreAuth(env: Env): Promise<Auth>;
|
|
79
|
+
export declare function clearAllAuth(env: Env): Promise<void>;
|
|
80
|
+
export declare function clearSelectedAuth(env: Env): Promise<Auth | null>;
|
|
81
|
+
export declare function getCurrentAuthAccount(env: Env): Promise<StoredAuthAccount | null>;
|
|
82
|
+
export declare function getAuth(env: Env, options?: {
|
|
83
|
+
forceRefresh?: boolean;
|
|
84
|
+
}): Promise<Auth>;
|
|
85
|
+
export declare function getSelectedAuth(env: Env): Promise<Auth | null>;
|
|
86
|
+
export declare function useAuth(env: Env, options: {
|
|
87
|
+
userId?: string;
|
|
88
|
+
email?: string;
|
|
89
|
+
organizationId?: string;
|
|
90
|
+
}): Promise<{
|
|
91
|
+
auth: Auth;
|
|
92
|
+
mode: "selected" | "switched";
|
|
93
|
+
}>;
|
|
94
|
+
export {};
|
|
95
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS,sCAAoC,CAAC;AAC3D,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AA4B5C,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;EAQvB,CAAC;AAEH,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EAMzB,CAAC;AAOH,QAAA,MAAM,uBAAuB;;;;;;;;;;;;EAI3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