@purpleschool/gptbot 0.18.7 → 0.18.8

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.
@@ -0,0 +1,5 @@
1
+ export declare const APP_LOGIN_CONTROLLER = "app-login";
2
+ export declare const APP_LOGIN_ROUTES: {
3
+ readonly CODE: 'code';
4
+ readonly REDEEM: 'redeem';
5
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APP_LOGIN_ROUTES = exports.APP_LOGIN_CONTROLLER = void 0;
4
+ exports.APP_LOGIN_CONTROLLER = 'app-login';
5
+ exports.APP_LOGIN_ROUTES = { CODE: 'code', REDEEM: 'redeem' };
@@ -86,3 +86,4 @@ export * from './canvas-var-generation';
86
86
  export * from './photo-session';
87
87
  export * from './photo-studio';
88
88
  export * from './canvas-template';
89
+ export * from './app-login';
@@ -102,3 +102,4 @@ __exportStar(require("./canvas-var-generation"), exports);
102
102
  __exportStar(require("./photo-session"), exports);
103
103
  __exportStar(require("./photo-studio"), exports);
104
104
  __exportStar(require("./canvas-template"), exports);
105
+ __exportStar(require("./app-login"), exports);
@@ -6,6 +6,7 @@ export declare const USER_ROUTES: {
6
6
  readonly PATCH_DIGITAL_PROCESSING_CONSENT: 'me/digital-processing-consent';
7
7
  readonly POST: 'up-balance';
8
8
  readonly CHECK_EMAIL: 'check-email';
9
+ readonly LOGIN_METHOD: 'login-method';
9
10
  readonly FIND_BY_CRITERIA: 'criteria';
10
11
  readonly FIND_BY_UUID: (uuid: string) => string;
11
12
  readonly GET_BALANCE: (uuid: string) => string;
@@ -9,6 +9,7 @@ exports.USER_ROUTES = {
9
9
  PATCH_DIGITAL_PROCESSING_CONSENT: 'me/digital-processing-consent',
10
10
  POST: 'up-balance',
11
11
  CHECK_EMAIL: 'check-email',
12
+ LOGIN_METHOD: 'login-method',
12
13
  FIND_BY_CRITERIA: 'criteria',
13
14
  FIND_BY_UUID: (uuid) => `${uuid}`,
14
15
  GET_BALANCE: (uuid) => `balance/${uuid}`,
@@ -1,5 +1,9 @@
1
1
  export declare const ROOT: '/api';
2
2
  export declare const REST_API: {
3
+ readonly APP_LOGIN: {
4
+ readonly CODE: "/api/app-login/code";
5
+ readonly REDEEM: "/api/app-login/redeem";
6
+ };
3
7
  readonly AUTH: {
4
8
  readonly REGISTER: "/api/auth/register";
5
9
  readonly LOGIN: "/api/auth/login";
@@ -18,6 +22,7 @@ export declare const REST_API: {
18
22
  readonly GET_CLIENT_COUNTRY_CODE: "/api/users/country-code";
19
23
  readonly PATCH_LOCALE: "/api/users/me/locale";
20
24
  readonly POST: "/api/users/up-balance";
25
+ readonly LOGIN_METHOD: "/api/users/login-method";
21
26
  readonly CHECK_EMAIL: "/api/users/check-email";
22
27
  readonly FIND_BY_CRITERIA: "/api/users/criteria";
23
28
  readonly FIND_BY_UUID: (uuid: string) => string;
@@ -38,6 +38,10 @@ const constants_1 = require("../constants");
38
38
  const CONTROLLERS = __importStar(require("./controllers"));
39
39
  exports.ROOT = '/api';
40
40
  exports.REST_API = {
41
+ APP_LOGIN: {
42
+ CODE: `${exports.ROOT}/${CONTROLLERS.APP_LOGIN_CONTROLLER}/${CONTROLLERS.APP_LOGIN_ROUTES.CODE}`,
43
+ REDEEM: `${exports.ROOT}/${CONTROLLERS.APP_LOGIN_CONTROLLER}/${CONTROLLERS.APP_LOGIN_ROUTES.REDEEM}`,
44
+ },
41
45
  AUTH: {
42
46
  REGISTER: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.REGISTER}`,
43
47
  LOGIN: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.LOGIN}`,
@@ -56,6 +60,7 @@ exports.REST_API = {
56
60
  GET_CLIENT_COUNTRY_CODE: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_CLIENT_COUNTRY_CODE}`,
57
61
  PATCH_LOCALE: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.PATCH_LOCALE}`,
58
62
  POST: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.POST}`,
63
+ LOGIN_METHOD: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.LOGIN_METHOD}`,
59
64
  CHECK_EMAIL: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.CHECK_EMAIL}`,
60
65
  FIND_BY_CRITERIA: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_CRITERIA}`,
61
66
  FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_UUID(uuid)}`,
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetLoginMethodCommand {
3
+ const RequestSchema: z.ZodObject<{
4
+ email: z.ZodPipe<z.ZodString, z.ZodEmail>;
5
+ }, z.core.$strip>;
6
+ type Request = z.infer<typeof RequestSchema>;
7
+ const ResponseSchema: z.ZodObject<{
8
+ data: z.ZodDiscriminatedUnion<[z.ZodObject<{
9
+ exists: z.ZodLiteral<false>;
10
+ }, z.core.$strip>, z.ZodObject<{
11
+ exists: z.ZodLiteral<true>;
12
+ isProviderUser: z.ZodBoolean;
13
+ }, z.core.$strip>], "exists">;
14
+ }, z.core.$strip>;
15
+ type Response = z.infer<typeof ResponseSchema>;
16
+ }
17
+ export declare namespace IssueAppLoginCodeCommand {
18
+ const RequestSchema: z.ZodDefault<z.ZodObject<{
19
+ reissue: z.ZodOptional<z.ZodBoolean>;
20
+ }, z.core.$strip>>;
21
+ type Request = z.infer<typeof RequestSchema>;
22
+ const ResponseSchema: z.ZodObject<{
23
+ data: z.ZodObject<{
24
+ code: z.ZodOptional<z.ZodString>;
25
+ expiresAt: z.ZodISODateTime;
26
+ nextIssueAt: z.ZodISODateTime;
27
+ }, z.core.$strip>;
28
+ }, z.core.$strip>;
29
+ type Response = z.infer<typeof ResponseSchema>;
30
+ }
31
+ export declare namespace RedeemAppLoginCodeCommand {
32
+ const RequestSchema: z.ZodObject<{
33
+ email: z.ZodPipe<z.ZodString, z.ZodEmail>;
34
+ code: z.ZodString;
35
+ }, z.core.$strip>;
36
+ type Request = z.infer<typeof RequestSchema>;
37
+ const ResponseSchema: z.ZodObject<{
38
+ data: z.ZodObject<{
39
+ accessToken: z.ZodString;
40
+ }, z.core.$strip>;
41
+ }, z.core.$strip>;
42
+ type Response = z.infer<typeof ResponseSchema>;
43
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RedeemAppLoginCodeCommand = exports.IssueAppLoginCodeCommand = exports.GetLoginMethodCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const emailSchema = zod_1.z.string().trim().toLowerCase().pipe(zod_1.z.email());
6
+ var GetLoginMethodCommand;
7
+ (function (GetLoginMethodCommand) {
8
+ GetLoginMethodCommand.RequestSchema = zod_1.z.object({ email: emailSchema });
9
+ GetLoginMethodCommand.ResponseSchema = zod_1.z.object({
10
+ data: zod_1.z.discriminatedUnion('exists', [
11
+ zod_1.z.object({ exists: zod_1.z.literal(false) }),
12
+ zod_1.z.object({ exists: zod_1.z.literal(true), isProviderUser: zod_1.z.boolean() }),
13
+ ]),
14
+ });
15
+ })(GetLoginMethodCommand || (exports.GetLoginMethodCommand = GetLoginMethodCommand = {}));
16
+ var IssueAppLoginCodeCommand;
17
+ (function (IssueAppLoginCodeCommand) {
18
+ IssueAppLoginCodeCommand.RequestSchema = zod_1.z.object({ reissue: zod_1.z.boolean().optional() }).default({});
19
+ IssueAppLoginCodeCommand.ResponseSchema = zod_1.z.object({
20
+ data: zod_1.z.object({
21
+ code: zod_1.z
22
+ .string()
23
+ .regex(/^\d{6}$/)
24
+ .optional(),
25
+ expiresAt: zod_1.z.iso.datetime(),
26
+ nextIssueAt: zod_1.z.iso.datetime(),
27
+ }),
28
+ });
29
+ })(IssueAppLoginCodeCommand || (exports.IssueAppLoginCodeCommand = IssueAppLoginCodeCommand = {}));
30
+ var RedeemAppLoginCodeCommand;
31
+ (function (RedeemAppLoginCodeCommand) {
32
+ RedeemAppLoginCodeCommand.RequestSchema = zod_1.z.object({
33
+ email: emailSchema,
34
+ code: zod_1.z.string().regex(/^\d{6}$/),
35
+ });
36
+ RedeemAppLoginCodeCommand.ResponseSchema = zod_1.z.object({ data: zod_1.z.object({ accessToken: zod_1.z.string() }) });
37
+ })(RedeemAppLoginCodeCommand || (exports.RedeemAppLoginCodeCommand = RedeemAppLoginCodeCommand = {}));
@@ -58,3 +58,4 @@ export * from './user-profile';
58
58
  export * from './team-account';
59
59
  export * from './team-to-subscription';
60
60
  export * from './team-to-product';
61
+ export * from './app-login';
@@ -74,3 +74,4 @@ __exportStar(require("./user-profile"), exports);
74
74
  __exportStar(require("./team-account"), exports);
75
75
  __exportStar(require("./team-to-subscription"), exports);
76
76
  __exportStar(require("./team-to-product"), exports);
77
+ __exportStar(require("./app-login"), exports);
@@ -4,8 +4,8 @@ exports.LOYALTY_LEVELS = void 0;
4
4
  const enums_1 = require("./enums");
5
5
  exports.LOYALTY_LEVELS = [
6
6
  { level: enums_1.LOYALTY_LEVEL.NONE, thresholdMonths: 0, renewalBonusPercent: 0 },
7
- { level: enums_1.LOYALTY_LEVEL.BRONZE, thresholdMonths: 3, renewalBonusPercent: 5 },
8
- { level: enums_1.LOYALTY_LEVEL.SILVER, thresholdMonths: 6, renewalBonusPercent: 10 },
9
- { level: enums_1.LOYALTY_LEVEL.GOLD, thresholdMonths: 12, renewalBonusPercent: 15 },
10
- { level: enums_1.LOYALTY_LEVEL.PLATINUM, thresholdMonths: 24, renewalBonusPercent: 20 },
7
+ { level: enums_1.LOYALTY_LEVEL.BRONZE, thresholdMonths: 3, renewalBonusPercent: 0 },
8
+ { level: enums_1.LOYALTY_LEVEL.SILVER, thresholdMonths: 6, renewalBonusPercent: 0 },
9
+ { level: enums_1.LOYALTY_LEVEL.GOLD, thresholdMonths: 12, renewalBonusPercent: 0 },
10
+ { level: enums_1.LOYALTY_LEVEL.PLATINUM, thresholdMonths: 24, renewalBonusPercent: 0 },
11
11
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.18.7",
3
+ "version": "0.18.8",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "author": "",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
- "@purpleschool/rugpt-lib-common": "^0.0.95",
18
+ "@purpleschool/rugpt-lib-common": "^0.0.96",
19
19
  "zod": "^4.4.3"
20
20
  }
21
21
  }