@purpleschool/gptbot 0.19.12-stage-2 → 0.19.14-stage-2

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.
@@ -89,3 +89,4 @@ export * from './canvas-template';
89
89
  export * from './app-login';
90
90
  export * from './greetings';
91
91
  export * from './motion-control';
92
+ export * from './onboarding';
@@ -105,3 +105,4 @@ __exportStar(require("./canvas-template"), exports);
105
105
  __exportStar(require("./app-login"), exports);
106
106
  __exportStar(require("./greetings"), exports);
107
107
  __exportStar(require("./motion-control"), exports);
108
+ __exportStar(require("./onboarding"), exports);
@@ -0,0 +1,5 @@
1
+ export declare const ONBOARDING_PRIVATE_CONTROLLER: 'private/onboarding';
2
+ export declare const ONBOARDING_ROUTES: {
3
+ readonly GET: '';
4
+ readonly ACK: 'notifications/ack';
5
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ONBOARDING_ROUTES = exports.ONBOARDING_PRIVATE_CONTROLLER = void 0;
4
+ exports.ONBOARDING_PRIVATE_CONTROLLER = 'private/onboarding';
5
+ exports.ONBOARDING_ROUTES = {
6
+ GET: '',
7
+ ACK: 'notifications/ack',
8
+ };
@@ -1,5 +1,9 @@
1
1
  export declare const ROOT: '/api';
2
2
  export declare const REST_API: {
3
+ readonly ONBOARDING_PRIVATE: {
4
+ readonly GET: "/api/private/onboarding";
5
+ readonly ACK: "/api/private/onboarding/notifications/ack";
6
+ };
3
7
  readonly APP_LOGIN: {
4
8
  readonly CODE: "/api/app-login/code";
5
9
  readonly REDEEM: "/api/app-login/redeem";
@@ -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
+ ONBOARDING_PRIVATE: {
42
+ GET: `${exports.ROOT}/${CONTROLLERS.ONBOARDING_PRIVATE_CONTROLLER}`,
43
+ ACK: `${exports.ROOT}/${CONTROLLERS.ONBOARDING_PRIVATE_CONTROLLER}/${CONTROLLERS.ONBOARDING_ROUTES.ACK}`,
44
+ },
41
45
  APP_LOGIN: {
42
46
  CODE: `${exports.ROOT}/${CONTROLLERS.APP_LOGIN_CONTROLLER}/${CONTROLLERS.APP_LOGIN_ROUTES.CODE}`,
43
47
  REDEEM: `${exports.ROOT}/${CONTROLLERS.APP_LOGIN_CONTROLLER}/${CONTROLLERS.APP_LOGIN_ROUTES.REDEEM}`,
@@ -60,3 +60,4 @@ export * from './team-to-subscription';
60
60
  export * from './team-to-product';
61
61
  export * from './app-login';
62
62
  export * from './partner-codes';
63
+ export * from './onboarding';
@@ -76,3 +76,4 @@ __exportStar(require("./team-to-subscription"), exports);
76
76
  __exportStar(require("./team-to-product"), exports);
77
77
  __exportStar(require("./app-login"), exports);
78
78
  __exportStar(require("./partner-codes"), exports);
79
+ __exportStar(require("./onboarding"), exports);
@@ -0,0 +1,122 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetOnboardingCommand {
3
+ type Request = void;
4
+ const ResponseSchema: z.ZodObject<{
5
+ data: z.ZodObject<{
6
+ visible: z.ZodBoolean;
7
+ canParticipate: z.ZodBoolean;
8
+ blockedReason: z.ZodNullable<z.ZodLiteral<"email_confirmation_required">>;
9
+ visibleUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
10
+ completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
11
+ tasks: z.ZodArray<z.ZodObject<{
12
+ code: z.ZodEnum<{
13
+ first_chat: "first_chat";
14
+ first_image: "first_image";
15
+ first_photo: "first_photo";
16
+ first_video: "first_video";
17
+ first_voice: "first_voice";
18
+ }>;
19
+ title: z.ZodString;
20
+ description: z.ZodString;
21
+ action: z.ZodObject<{
22
+ type: z.ZodEnum<{
23
+ chat: "chat";
24
+ "image-editor": "image-editor";
25
+ "image-generation": "image-generation";
26
+ tts: "tts";
27
+ video: "video";
28
+ }>;
29
+ }, z.core.$strict>;
30
+ rewardStars: z.ZodNumber;
31
+ completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
32
+ awardedStars: z.ZodNumber;
33
+ }, z.core.$strip>>;
34
+ completedCount: z.ZodNumber;
35
+ totalCount: z.ZodNumber;
36
+ earnedStars: z.ZodNumber;
37
+ totalRewardStars: z.ZodNumber;
38
+ currentStepCode: z.ZodNullable<z.ZodEnum<{
39
+ first_chat: "first_chat";
40
+ first_image: "first_image";
41
+ first_photo: "first_photo";
42
+ first_video: "first_video";
43
+ first_voice: "first_voice";
44
+ }>>;
45
+ unseenCompletions: z.ZodArray<z.ZodObject<{
46
+ id: z.ZodUUID;
47
+ taskCode: z.ZodEnum<{
48
+ first_chat: "first_chat";
49
+ first_image: "first_image";
50
+ first_photo: "first_photo";
51
+ first_video: "first_video";
52
+ first_voice: "first_voice";
53
+ }>;
54
+ awardedStars: z.ZodNumber;
55
+ completedAt: z.ZodCoercedDate<unknown>;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>;
58
+ }, z.core.$strip>;
59
+ type Response = z.infer<typeof ResponseSchema>;
60
+ }
61
+ export declare namespace AckOnboardingNotificationsCommand {
62
+ const RequestSchema: z.ZodObject<{
63
+ ids: z.ZodArray<z.ZodUUID>;
64
+ }, z.core.$strict>;
65
+ type Request = z.infer<typeof RequestSchema>;
66
+ const ResponseSchema: z.ZodObject<{
67
+ data: z.ZodObject<{
68
+ visible: z.ZodBoolean;
69
+ canParticipate: z.ZodBoolean;
70
+ blockedReason: z.ZodNullable<z.ZodLiteral<"email_confirmation_required">>;
71
+ visibleUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
72
+ completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
73
+ tasks: z.ZodArray<z.ZodObject<{
74
+ code: z.ZodEnum<{
75
+ first_chat: "first_chat";
76
+ first_image: "first_image";
77
+ first_photo: "first_photo";
78
+ first_video: "first_video";
79
+ first_voice: "first_voice";
80
+ }>;
81
+ title: z.ZodString;
82
+ description: z.ZodString;
83
+ action: z.ZodObject<{
84
+ type: z.ZodEnum<{
85
+ chat: "chat";
86
+ "image-editor": "image-editor";
87
+ "image-generation": "image-generation";
88
+ tts: "tts";
89
+ video: "video";
90
+ }>;
91
+ }, z.core.$strict>;
92
+ rewardStars: z.ZodNumber;
93
+ completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
94
+ awardedStars: z.ZodNumber;
95
+ }, z.core.$strip>>;
96
+ completedCount: z.ZodNumber;
97
+ totalCount: z.ZodNumber;
98
+ earnedStars: z.ZodNumber;
99
+ totalRewardStars: z.ZodNumber;
100
+ currentStepCode: z.ZodNullable<z.ZodEnum<{
101
+ first_chat: "first_chat";
102
+ first_image: "first_image";
103
+ first_photo: "first_photo";
104
+ first_video: "first_video";
105
+ first_voice: "first_voice";
106
+ }>>;
107
+ unseenCompletions: z.ZodArray<z.ZodObject<{
108
+ id: z.ZodUUID;
109
+ taskCode: z.ZodEnum<{
110
+ first_chat: "first_chat";
111
+ first_image: "first_image";
112
+ first_photo: "first_photo";
113
+ first_video: "first_video";
114
+ first_voice: "first_voice";
115
+ }>;
116
+ awardedStars: z.ZodNumber;
117
+ completedAt: z.ZodCoercedDate<unknown>;
118
+ }, z.core.$strip>>;
119
+ }, z.core.$strip>;
120
+ }, z.core.$strip>;
121
+ type Response = GetOnboardingCommand.Response;
122
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AckOnboardingNotificationsCommand = exports.GetOnboardingCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const onboarding_schema_1 = require("../../models/onboarding.schema");
6
+ var GetOnboardingCommand;
7
+ (function (GetOnboardingCommand) {
8
+ GetOnboardingCommand.ResponseSchema = zod_1.z.object({ data: onboarding_schema_1.OnboardingStateSchema });
9
+ })(GetOnboardingCommand || (exports.GetOnboardingCommand = GetOnboardingCommand = {}));
10
+ var AckOnboardingNotificationsCommand;
11
+ (function (AckOnboardingNotificationsCommand) {
12
+ AckOnboardingNotificationsCommand.RequestSchema = zod_1.z.object({ ids: zod_1.z.array(zod_1.z.uuid()).min(1).max(100) }).strict();
13
+ AckOnboardingNotificationsCommand.ResponseSchema = GetOnboardingCommand.ResponseSchema;
14
+ })(AckOnboardingNotificationsCommand || (exports.AckOnboardingNotificationsCommand = AckOnboardingNotificationsCommand = {}));
@@ -2,6 +2,10 @@ import { z } from 'zod';
2
2
  import { SIGNUP_METHOD, USER_STATUS } from '../../constants';
3
3
  import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
4
  export declare namespace GetMeCommand {
5
+ const OnboardingAccessSchema: z.ZodObject<{
6
+ visibleUntil: z.ZodNullable<z.ZodISODateTime>;
7
+ }, z.core.$strip>;
8
+ type OnboardingAccess = z.infer<typeof OnboardingAccessSchema>;
5
9
  const RequestSchema: z.ZodObject<{}, z.core.$strip>;
6
10
  type Request = z.infer<typeof RequestSchema>;
7
11
  const ResponseSchema: z.ZodObject<{
@@ -43,6 +47,9 @@ export declare namespace GetMeCommand {
43
47
  renewalBonusPercent: z.ZodNumber;
44
48
  }, z.core.$strip>>;
45
49
  }, z.core.$strip>;
50
+ onboarding: z.ZodOptional<z.ZodObject<{
51
+ visibleUntil: z.ZodNullable<z.ZodISODateTime>;
52
+ }, z.core.$strip>>;
46
53
  }, z.core.$strip>;
47
54
  }, z.core.$strip>;
48
55
  type Response = z.infer<typeof ResponseSchema>;
@@ -7,6 +7,9 @@ const models_1 = require("../../models");
7
7
  const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
8
8
  var GetMeCommand;
9
9
  (function (GetMeCommand) {
10
+ GetMeCommand.OnboardingAccessSchema = zod_1.z.object({
11
+ visibleUntil: zod_1.z.iso.datetime().nullable(),
12
+ });
10
13
  GetMeCommand.RequestSchema = zod_1.z.object({});
11
14
  GetMeCommand.ResponseSchema = zod_1.z.object({
12
15
  data: zod_1.z.object({
@@ -22,6 +25,8 @@ var GetMeCommand;
22
25
  digitalProcessingConsent: zod_1.z.boolean(),
23
26
  profile: models_1.UserProfileResponseSchema,
24
27
  loyaltyStatus: models_1.UserLoyaltyStatusResponseSchema,
28
+ // Optional for compatibility with API versions deployed before onboarding.
29
+ onboarding: GetMeCommand.OnboardingAccessSchema.optional(),
25
30
  }),
26
31
  });
27
32
  })(GetMeCommand || (exports.GetMeCommand = GetMeCommand = {}));
@@ -2,3 +2,4 @@ export * from './singup-method.enum';
2
2
  export * from './user-status';
3
3
  export * from './user-sort-by.enum';
4
4
  export * from './sort-order.enum';
5
+ export * from './registration-platform.enum';
@@ -18,3 +18,4 @@ __exportStar(require("./singup-method.enum"), exports);
18
18
  __exportStar(require("./user-status"), exports);
19
19
  __exportStar(require("./user-sort-by.enum"), exports);
20
20
  __exportStar(require("./sort-order.enum"), exports);
21
+ __exportStar(require("./registration-platform.enum"), exports);
@@ -0,0 +1,5 @@
1
+ export declare enum REGISTRATION_PLATFORM {
2
+ WEB = "web",
3
+ IOS = "ios",
4
+ ANDROID = "android"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REGISTRATION_PLATFORM = void 0;
4
+ var REGISTRATION_PLATFORM;
5
+ (function (REGISTRATION_PLATFORM) {
6
+ REGISTRATION_PLATFORM["WEB"] = "web";
7
+ REGISTRATION_PLATFORM["IOS"] = "ios";
8
+ REGISTRATION_PLATFORM["ANDROID"] = "android";
9
+ })(REGISTRATION_PLATFORM || (exports.REGISTRATION_PLATFORM = REGISTRATION_PLATFORM = {}));
@@ -84,3 +84,4 @@ export * from './team-account';
84
84
  export * from './partner-codes';
85
85
  export * from './canvas-template.schema';
86
86
  export * from './user-loyalty-status.schema';
87
+ export * from './onboarding.schema';
@@ -100,3 +100,4 @@ __exportStar(require("./team-account"), exports);
100
100
  __exportStar(require("./partner-codes"), exports);
101
101
  __exportStar(require("./canvas-template.schema"), exports);
102
102
  __exportStar(require("./user-loyalty-status.schema"), exports);
103
+ __exportStar(require("./onboarding.schema"), exports);
@@ -0,0 +1,124 @@
1
+ import { z } from 'zod';
2
+ export declare const OnboardingTaskCodeSchema: z.ZodEnum<{
3
+ first_chat: "first_chat";
4
+ first_image: "first_image";
5
+ first_photo: "first_photo";
6
+ first_video: "first_video";
7
+ first_voice: "first_voice";
8
+ }>;
9
+ export declare const OnboardingConditionSchema: z.ZodEnum<{
10
+ chat_completed: "chat_completed";
11
+ image_completed: "image_completed";
12
+ photo_completed: "photo_completed";
13
+ tts_completed: "tts_completed";
14
+ video_completed: "video_completed";
15
+ }>;
16
+ export declare const OnboardingActionTypeSchema: z.ZodEnum<{
17
+ chat: "chat";
18
+ "image-editor": "image-editor";
19
+ "image-generation": "image-generation";
20
+ tts: "tts";
21
+ video: "video";
22
+ }>;
23
+ export declare const OnboardingActionSchema: z.ZodObject<{
24
+ type: z.ZodEnum<{
25
+ chat: "chat";
26
+ "image-editor": "image-editor";
27
+ "image-generation": "image-generation";
28
+ tts: "tts";
29
+ video: "video";
30
+ }>;
31
+ }, z.core.$strict>;
32
+ export declare const OnboardingTaskSchema: z.ZodObject<{
33
+ code: z.ZodEnum<{
34
+ first_chat: "first_chat";
35
+ first_image: "first_image";
36
+ first_photo: "first_photo";
37
+ first_video: "first_video";
38
+ first_voice: "first_voice";
39
+ }>;
40
+ title: z.ZodString;
41
+ description: z.ZodString;
42
+ action: z.ZodObject<{
43
+ type: z.ZodEnum<{
44
+ chat: "chat";
45
+ "image-editor": "image-editor";
46
+ "image-generation": "image-generation";
47
+ tts: "tts";
48
+ video: "video";
49
+ }>;
50
+ }, z.core.$strict>;
51
+ rewardStars: z.ZodNumber;
52
+ completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
53
+ awardedStars: z.ZodNumber;
54
+ }, z.core.$strip>;
55
+ export declare const OnboardingCompletionSchema: z.ZodObject<{
56
+ id: z.ZodUUID;
57
+ taskCode: z.ZodEnum<{
58
+ first_chat: "first_chat";
59
+ first_image: "first_image";
60
+ first_photo: "first_photo";
61
+ first_video: "first_video";
62
+ first_voice: "first_voice";
63
+ }>;
64
+ awardedStars: z.ZodNumber;
65
+ completedAt: z.ZodCoercedDate<unknown>;
66
+ }, z.core.$strip>;
67
+ export declare const OnboardingStateSchema: z.ZodObject<{
68
+ visible: z.ZodBoolean;
69
+ canParticipate: z.ZodBoolean;
70
+ blockedReason: z.ZodNullable<z.ZodLiteral<"email_confirmation_required">>;
71
+ visibleUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
72
+ completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
73
+ tasks: z.ZodArray<z.ZodObject<{
74
+ code: z.ZodEnum<{
75
+ first_chat: "first_chat";
76
+ first_image: "first_image";
77
+ first_photo: "first_photo";
78
+ first_video: "first_video";
79
+ first_voice: "first_voice";
80
+ }>;
81
+ title: z.ZodString;
82
+ description: z.ZodString;
83
+ action: z.ZodObject<{
84
+ type: z.ZodEnum<{
85
+ chat: "chat";
86
+ "image-editor": "image-editor";
87
+ "image-generation": "image-generation";
88
+ tts: "tts";
89
+ video: "video";
90
+ }>;
91
+ }, z.core.$strict>;
92
+ rewardStars: z.ZodNumber;
93
+ completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
94
+ awardedStars: z.ZodNumber;
95
+ }, z.core.$strip>>;
96
+ completedCount: z.ZodNumber;
97
+ totalCount: z.ZodNumber;
98
+ earnedStars: z.ZodNumber;
99
+ totalRewardStars: z.ZodNumber;
100
+ currentStepCode: z.ZodNullable<z.ZodEnum<{
101
+ first_chat: "first_chat";
102
+ first_image: "first_image";
103
+ first_photo: "first_photo";
104
+ first_video: "first_video";
105
+ first_voice: "first_voice";
106
+ }>>;
107
+ unseenCompletions: z.ZodArray<z.ZodObject<{
108
+ id: z.ZodUUID;
109
+ taskCode: z.ZodEnum<{
110
+ first_chat: "first_chat";
111
+ first_image: "first_image";
112
+ first_photo: "first_photo";
113
+ first_video: "first_video";
114
+ first_voice: "first_voice";
115
+ }>;
116
+ awardedStars: z.ZodNumber;
117
+ completedAt: z.ZodCoercedDate<unknown>;
118
+ }, z.core.$strip>>;
119
+ }, z.core.$strip>;
120
+ export type OnboardingTaskCode = z.infer<typeof OnboardingTaskCodeSchema>;
121
+ export type OnboardingCondition = z.infer<typeof OnboardingConditionSchema>;
122
+ export type OnboardingActionType = z.infer<typeof OnboardingActionTypeSchema>;
123
+ export type OnboardingTask = z.infer<typeof OnboardingTaskSchema>;
124
+ export type OnboardingState = z.infer<typeof OnboardingStateSchema>;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OnboardingStateSchema = exports.OnboardingCompletionSchema = exports.OnboardingTaskSchema = exports.OnboardingActionSchema = exports.OnboardingActionTypeSchema = exports.OnboardingConditionSchema = exports.OnboardingTaskCodeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.OnboardingTaskCodeSchema = zod_1.z.enum([
6
+ 'first_chat',
7
+ 'first_image',
8
+ 'first_photo',
9
+ 'first_voice',
10
+ 'first_video',
11
+ ]);
12
+ exports.OnboardingConditionSchema = zod_1.z.enum([
13
+ 'chat_completed',
14
+ 'image_completed',
15
+ 'photo_completed',
16
+ 'tts_completed',
17
+ 'video_completed',
18
+ ]);
19
+ exports.OnboardingActionTypeSchema = zod_1.z.enum([
20
+ 'chat',
21
+ 'image-generation',
22
+ 'image-editor',
23
+ 'tts',
24
+ 'video',
25
+ ]);
26
+ exports.OnboardingActionSchema = zod_1.z.object({ type: exports.OnboardingActionTypeSchema }).strict();
27
+ exports.OnboardingTaskSchema = zod_1.z.object({
28
+ code: exports.OnboardingTaskCodeSchema,
29
+ title: zod_1.z.string(),
30
+ description: zod_1.z.string(),
31
+ action: exports.OnboardingActionSchema,
32
+ rewardStars: zod_1.z.number().int().nonnegative(),
33
+ completedAt: zod_1.z.coerce.date().nullable(),
34
+ awardedStars: zod_1.z.number().int().nonnegative(),
35
+ });
36
+ exports.OnboardingCompletionSchema = zod_1.z.object({
37
+ id: zod_1.z.uuid(),
38
+ taskCode: exports.OnboardingTaskCodeSchema,
39
+ awardedStars: zod_1.z.number().int().nonnegative(),
40
+ completedAt: zod_1.z.coerce.date(),
41
+ });
42
+ exports.OnboardingStateSchema = zod_1.z.object({
43
+ visible: zod_1.z.boolean(),
44
+ canParticipate: zod_1.z.boolean(),
45
+ blockedReason: zod_1.z.literal('email_confirmation_required').nullable(),
46
+ visibleUntil: zod_1.z.coerce.date().nullable(),
47
+ completedAt: zod_1.z.coerce.date().nullable(),
48
+ tasks: zod_1.z.array(exports.OnboardingTaskSchema),
49
+ completedCount: zod_1.z.number().int().nonnegative(),
50
+ totalCount: zod_1.z.number().int().nonnegative(),
51
+ earnedStars: zod_1.z.number().int().nonnegative(),
52
+ totalRewardStars: zod_1.z.number().int().nonnegative(),
53
+ currentStepCode: exports.OnboardingTaskCodeSchema.nullable(),
54
+ unseenCompletions: zod_1.z.array(exports.OnboardingCompletionSchema),
55
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.19.12-stage-2",
3
+ "version": "0.19.14-stage-2",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",