@purpleschool/gptbot 0.13.4 → 0.13.5
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/api/controllers/http/index.ts +1 -0
- package/api/controllers/http/support-feedback.ts +7 -0
- package/api/routes.ts +8 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/controllers/http/support-feedback.js +9 -0
- package/build/api/routes.js +8 -0
- package/build/commands/index.js +1 -0
- package/build/commands/support-feedback/check-support-feedback.command.js +24 -0
- package/build/commands/support-feedback/index.js +18 -0
- package/build/commands/support-feedback/upsert-support-feedback.command.js +18 -0
- package/build/models/index.js +1 -0
- package/build/models/support-feedback.schema.js +14 -0
- package/commands/index.ts +1 -0
- package/commands/support-feedback/check-support-feedback.command.ts +26 -0
- package/commands/support-feedback/index.ts +2 -0
- package/commands/support-feedback/upsert-support-feedback.command.ts +20 -0
- package/models/index.ts +1 -0
- package/models/support-feedback.schema.ts +12 -0
- package/package.json +1 -1
package/api/routes.ts
CHANGED
|
@@ -483,6 +483,14 @@ export const REST_API = {
|
|
|
483
483
|
UPDATE: (uuid: string) => `${ROOT}/${CONTROLLERS.FEEDBACK_CONTROLLER_PUBLIC}/${uuid}`,
|
|
484
484
|
CHECK_IF_USER_READY_FOR_FEEDBACK: `${ROOT}/${CONTROLLERS.FEEDBACK_CONTROLLER_PUBLIC}/${CONTROLLERS.FEEDBACK_ROUTES.CHECK_IF_USER_READY_FOR_FEEDBACK}`,
|
|
485
485
|
},
|
|
486
|
+
SUPPORT_FEEDBACK_PRIVATE: {
|
|
487
|
+
CREATE: `${ROOT}/${CONTROLLERS.SUPPORT_FEEDBACK_CONTROLLER_PRIVATE}/${CONTROLLERS.SUPPORT_FEEDBACK_ROUTES.CREATE}`,
|
|
488
|
+
CHECK: `${ROOT}/${CONTROLLERS.SUPPORT_FEEDBACK_CONTROLLER_PRIVATE}/${CONTROLLERS.SUPPORT_FEEDBACK_ROUTES.CHECK}`,
|
|
489
|
+
},
|
|
490
|
+
SUPPORT_FEEDBACK_PUBLIC: {
|
|
491
|
+
CREATE: `${ROOT}/${CONTROLLERS.SUPPORT_FEEDBACK_CONTROLLER_PUBLIC}/${CONTROLLERS.SUPPORT_FEEDBACK_ROUTES.CREATE}`,
|
|
492
|
+
CHECK: `${ROOT}/${CONTROLLERS.SUPPORT_FEEDBACK_CONTROLLER_PUBLIC}/${CONTROLLERS.SUPPORT_FEEDBACK_ROUTES.CHECK}`,
|
|
493
|
+
},
|
|
486
494
|
DAILY_STREAK_PRIVATE: {
|
|
487
495
|
GET: `${ROOT}/${CONTROLLERS.DAILY_STREAK_PRIVATE_CONTROLLER}/${CONTROLLERS.DAILY_STREAK_ROUTES.GET}`,
|
|
488
496
|
COLLECT: `${ROOT}/${CONTROLLERS.DAILY_STREAK_PRIVATE_CONTROLLER}/${CONTROLLERS.DAILY_STREAK_ROUTES.COLLECT}`,
|
|
@@ -43,6 +43,7 @@ __exportStar(require("./product"), exports);
|
|
|
43
43
|
__exportStar(require("./question"), exports);
|
|
44
44
|
__exportStar(require("./stt"), exports);
|
|
45
45
|
__exportStar(require("./subscription"), exports);
|
|
46
|
+
__exportStar(require("./support-feedback"), exports);
|
|
46
47
|
__exportStar(require("./task"), exports);
|
|
47
48
|
__exportStar(require("./telegram-auth"), exports);
|
|
48
49
|
__exportStar(require("./telegram-connect"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SUPPORT_FEEDBACK_ROUTES = exports.SUPPORT_FEEDBACK_CONTROLLER_PUBLIC = exports.SUPPORT_FEEDBACK_CONTROLLER_PRIVATE = void 0;
|
|
4
|
+
exports.SUPPORT_FEEDBACK_CONTROLLER_PRIVATE = 'private/support-feedback';
|
|
5
|
+
exports.SUPPORT_FEEDBACK_CONTROLLER_PUBLIC = 'public/support-feedback';
|
|
6
|
+
exports.SUPPORT_FEEDBACK_ROUTES = {
|
|
7
|
+
CREATE: '',
|
|
8
|
+
CHECK: 'check',
|
|
9
|
+
};
|
package/build/api/routes.js
CHANGED
|
@@ -394,6 +394,14 @@ exports.REST_API = {
|
|
|
394
394
|
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.FEEDBACK_CONTROLLER_PUBLIC}/${uuid}`,
|
|
395
395
|
CHECK_IF_USER_READY_FOR_FEEDBACK: `${exports.ROOT}/${CONTROLLERS.FEEDBACK_CONTROLLER_PUBLIC}/${CONTROLLERS.FEEDBACK_ROUTES.CHECK_IF_USER_READY_FOR_FEEDBACK}`,
|
|
396
396
|
},
|
|
397
|
+
SUPPORT_FEEDBACK_PRIVATE: {
|
|
398
|
+
CREATE: `${exports.ROOT}/${CONTROLLERS.SUPPORT_FEEDBACK_CONTROLLER_PRIVATE}/${CONTROLLERS.SUPPORT_FEEDBACK_ROUTES.CREATE}`,
|
|
399
|
+
CHECK: `${exports.ROOT}/${CONTROLLERS.SUPPORT_FEEDBACK_CONTROLLER_PRIVATE}/${CONTROLLERS.SUPPORT_FEEDBACK_ROUTES.CHECK}`,
|
|
400
|
+
},
|
|
401
|
+
SUPPORT_FEEDBACK_PUBLIC: {
|
|
402
|
+
CREATE: `${exports.ROOT}/${CONTROLLERS.SUPPORT_FEEDBACK_CONTROLLER_PUBLIC}/${CONTROLLERS.SUPPORT_FEEDBACK_ROUTES.CREATE}`,
|
|
403
|
+
CHECK: `${exports.ROOT}/${CONTROLLERS.SUPPORT_FEEDBACK_CONTROLLER_PUBLIC}/${CONTROLLERS.SUPPORT_FEEDBACK_ROUTES.CHECK}`,
|
|
404
|
+
},
|
|
397
405
|
DAILY_STREAK_PRIVATE: {
|
|
398
406
|
GET: `${exports.ROOT}/${CONTROLLERS.DAILY_STREAK_PRIVATE_CONTROLLER}/${CONTROLLERS.DAILY_STREAK_ROUTES.GET}`,
|
|
399
407
|
COLLECT: `${exports.ROOT}/${CONTROLLERS.DAILY_STREAK_PRIVATE_CONTROLLER}/${CONTROLLERS.DAILY_STREAK_ROUTES.COLLECT}`,
|
package/build/commands/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __exportStar(require("./product"), exports);
|
|
|
40
40
|
__exportStar(require("./question"), exports);
|
|
41
41
|
__exportStar(require("./referral"), exports);
|
|
42
42
|
__exportStar(require("./subscription"), exports);
|
|
43
|
+
__exportStar(require("./support-feedback"), exports);
|
|
43
44
|
__exportStar(require("./task"), exports);
|
|
44
45
|
__exportStar(require("./telegram"), exports);
|
|
45
46
|
__exportStar(require("./telegram-auth"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckSupportFeedbackCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var CheckSupportFeedbackCommand;
|
|
7
|
+
(function (CheckSupportFeedbackCommand) {
|
|
8
|
+
CheckSupportFeedbackCommand.RequestQuerySchema = zod_1.z.object({
|
|
9
|
+
supportDialogId: zod_1.z.string().min(1),
|
|
10
|
+
});
|
|
11
|
+
CheckSupportFeedbackCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.object({
|
|
13
|
+
hasFeedback: zod_1.z.boolean(),
|
|
14
|
+
feedback: models_1.SupportFeedbackSchema.pick({
|
|
15
|
+
uuid: true,
|
|
16
|
+
supportDialogId: true,
|
|
17
|
+
rating: true,
|
|
18
|
+
comment: true,
|
|
19
|
+
createdAt: true,
|
|
20
|
+
updatedAt: true,
|
|
21
|
+
}).nullable(),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
})(CheckSupportFeedbackCommand || (exports.CheckSupportFeedbackCommand = CheckSupportFeedbackCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./check-support-feedback.command"), exports);
|
|
18
|
+
__exportStar(require("./upsert-support-feedback.command"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpsertSupportFeedbackCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var UpsertSupportFeedbackCommand;
|
|
7
|
+
(function (UpsertSupportFeedbackCommand) {
|
|
8
|
+
UpsertSupportFeedbackCommand.RequestSchema = models_1.SupportFeedbackSchema.pick({
|
|
9
|
+
supportDialogId: true,
|
|
10
|
+
rating: true,
|
|
11
|
+
comment: true,
|
|
12
|
+
}).partial({
|
|
13
|
+
comment: true,
|
|
14
|
+
});
|
|
15
|
+
UpsertSupportFeedbackCommand.ResponseSchema = zod_1.z.object({
|
|
16
|
+
data: models_1.SupportFeedbackSchema,
|
|
17
|
+
});
|
|
18
|
+
})(UpsertSupportFeedbackCommand || (exports.UpsertSupportFeedbackCommand = UpsertSupportFeedbackCommand = {}));
|
package/build/models/index.js
CHANGED
|
@@ -60,6 +60,7 @@ __exportStar(require("./subscription-feature.schema"), exports);
|
|
|
60
60
|
__exportStar(require("./team-subscription-feature.schema"), exports);
|
|
61
61
|
__exportStar(require("./subscription-upgrade-schema"), exports);
|
|
62
62
|
__exportStar(require("./subscription.schema"), exports);
|
|
63
|
+
__exportStar(require("./support-feedback.schema"), exports);
|
|
63
64
|
__exportStar(require("./telegram-user-data.schema"), exports);
|
|
64
65
|
__exportStar(require("./tool-job.schema"), exports);
|
|
65
66
|
__exportStar(require("./tool-group.schema"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SupportFeedbackSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.SupportFeedbackSchema = zod_1.z.object({
|
|
6
|
+
uuid: zod_1.z.string().uuid(),
|
|
7
|
+
supportDialogId: zod_1.z.string().min(1),
|
|
8
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
9
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
10
|
+
rating: zod_1.z.number().int().min(1).max(5),
|
|
11
|
+
comment: zod_1.z.string().nullable().optional(),
|
|
12
|
+
createdAt: zod_1.z.date(),
|
|
13
|
+
updatedAt: zod_1.z.date(),
|
|
14
|
+
});
|
package/commands/index.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SupportFeedbackSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace CheckSupportFeedbackCommand {
|
|
5
|
+
export const RequestQuerySchema = z.object({
|
|
6
|
+
supportDialogId: z.string().min(1),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: z.object({
|
|
13
|
+
hasFeedback: z.boolean(),
|
|
14
|
+
feedback: SupportFeedbackSchema.pick({
|
|
15
|
+
uuid: true,
|
|
16
|
+
supportDialogId: true,
|
|
17
|
+
rating: true,
|
|
18
|
+
comment: true,
|
|
19
|
+
createdAt: true,
|
|
20
|
+
updatedAt: true,
|
|
21
|
+
}).nullable(),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SupportFeedbackSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpsertSupportFeedbackCommand {
|
|
5
|
+
export const RequestSchema = SupportFeedbackSchema.pick({
|
|
6
|
+
supportDialogId: true,
|
|
7
|
+
rating: true,
|
|
8
|
+
comment: true,
|
|
9
|
+
}).partial({
|
|
10
|
+
comment: true,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: SupportFeedbackSchema,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
package/models/index.ts
CHANGED
|
@@ -44,6 +44,7 @@ export * from './subscription-feature.schema';
|
|
|
44
44
|
export * from './team-subscription-feature.schema';
|
|
45
45
|
export * from './subscription-upgrade-schema';
|
|
46
46
|
export * from './subscription.schema';
|
|
47
|
+
export * from './support-feedback.schema';
|
|
47
48
|
export * from './telegram-user-data.schema';
|
|
48
49
|
export * from './tool-job.schema';
|
|
49
50
|
export * from './tool-group.schema';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const SupportFeedbackSchema = z.object({
|
|
4
|
+
uuid: z.string().uuid(),
|
|
5
|
+
supportDialogId: z.string().min(1),
|
|
6
|
+
userId: z.string().uuid().nullable().optional(),
|
|
7
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
8
|
+
rating: z.number().int().min(1).max(5),
|
|
9
|
+
comment: z.string().nullable().optional(),
|
|
10
|
+
createdAt: z.date(),
|
|
11
|
+
updatedAt: z.date(),
|
|
12
|
+
});
|