@beorchid-llc/thrivo-contracts 0.5.0 → 0.5.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/auth.d.ts +48 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +13 -0
- package/dist/auth.js.map +1 -1
- package/package.json +1 -1
package/dist/auth.d.ts
CHANGED
|
@@ -41,6 +41,49 @@ export declare const refreshPayloadSchema: z.ZodObject<{
|
|
|
41
41
|
refreshToken: string;
|
|
42
42
|
}>;
|
|
43
43
|
export type RefreshPayload = z.infer<typeof refreshPayloadSchema>;
|
|
44
|
+
/** Lightweight session facts for mobile cold-start restore (navigation guard). */
|
|
45
|
+
export declare const userSessionSchema: z.ZodObject<{
|
|
46
|
+
userId: z.ZodString;
|
|
47
|
+
accountStatus: z.ZodEnum<["dormant", "free_trial", "free_plan", "paid"]>;
|
|
48
|
+
isOnboarded: z.ZodBoolean;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
51
|
+
isOnboarded: boolean;
|
|
52
|
+
userId: string;
|
|
53
|
+
}, {
|
|
54
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
55
|
+
isOnboarded: boolean;
|
|
56
|
+
userId: string;
|
|
57
|
+
}>;
|
|
58
|
+
export type UserSession = z.infer<typeof userSessionSchema>;
|
|
59
|
+
export declare const userSessionResponseSchema: z.ZodObject<{
|
|
60
|
+
session: z.ZodObject<{
|
|
61
|
+
userId: z.ZodString;
|
|
62
|
+
accountStatus: z.ZodEnum<["dormant", "free_trial", "free_plan", "paid"]>;
|
|
63
|
+
isOnboarded: z.ZodBoolean;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
66
|
+
isOnboarded: boolean;
|
|
67
|
+
userId: string;
|
|
68
|
+
}, {
|
|
69
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
70
|
+
isOnboarded: boolean;
|
|
71
|
+
userId: string;
|
|
72
|
+
}>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
session: {
|
|
75
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
76
|
+
isOnboarded: boolean;
|
|
77
|
+
userId: string;
|
|
78
|
+
};
|
|
79
|
+
}, {
|
|
80
|
+
session: {
|
|
81
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
82
|
+
isOnboarded: boolean;
|
|
83
|
+
userId: string;
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
export type UserSessionResponse = z.infer<typeof userSessionResponseSchema>;
|
|
44
87
|
export declare const authRoutes: {
|
|
45
88
|
requestMagicLink: {
|
|
46
89
|
method: "POST";
|
|
@@ -62,6 +105,11 @@ export declare const authRoutes: {
|
|
|
62
105
|
path: "/api/v1/auth/logout";
|
|
63
106
|
auth: "public";
|
|
64
107
|
};
|
|
108
|
+
getSession: {
|
|
109
|
+
method: "GET";
|
|
110
|
+
path: "/api/v1/auth/session";
|
|
111
|
+
auth: "user";
|
|
112
|
+
};
|
|
65
113
|
googleStart: {
|
|
66
114
|
method: "GET";
|
|
67
115
|
path: "/api/v1/auth/google/start";
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,iGAAiG;AACjG,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAI5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,4CAA4C;AAC5C,eAAO,MAAM,6BAA6B;;;;;;EAExC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,2CAA2C;AAC3C,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,qDAAqD;AACrD,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,kFAAkF;AAClF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAI5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2C,CAAC;AAClF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BkB,CAAC"}
|
package/dist/auth.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { accountStatusSchema } from "./users";
|
|
2
3
|
/** Token pair returned to a client after a successful auth flow (magic-link or Google OAuth). */
|
|
3
4
|
export const authSessionSchema = z.object({
|
|
4
5
|
accessToken: z.string(),
|
|
@@ -17,6 +18,13 @@ export const magicLinkVerifyPayloadSchema = z.object({
|
|
|
17
18
|
export const refreshPayloadSchema = z.object({
|
|
18
19
|
refreshToken: z.string().min(1),
|
|
19
20
|
});
|
|
21
|
+
/** Lightweight session facts for mobile cold-start restore (navigation guard). */
|
|
22
|
+
export const userSessionSchema = z.object({
|
|
23
|
+
userId: z.string().uuid(),
|
|
24
|
+
accountStatus: accountStatusSchema,
|
|
25
|
+
isOnboarded: z.boolean(),
|
|
26
|
+
});
|
|
27
|
+
export const userSessionResponseSchema = z.object({ session: userSessionSchema });
|
|
20
28
|
export const authRoutes = {
|
|
21
29
|
requestMagicLink: {
|
|
22
30
|
method: "POST",
|
|
@@ -38,6 +46,11 @@ export const authRoutes = {
|
|
|
38
46
|
path: "/api/v1/auth/logout",
|
|
39
47
|
auth: "public",
|
|
40
48
|
},
|
|
49
|
+
getSession: {
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: "/api/v1/auth/session",
|
|
52
|
+
auth: "user",
|
|
53
|
+
},
|
|
41
54
|
googleStart: {
|
|
42
55
|
method: "GET",
|
|
43
56
|
path: "/api/v1/auth/google/start",
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,iGAAiG;AACjG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,WAAW;CAC1C,CAAC,CAAC;AAGH,4CAA4C;AAC5C,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,E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