@purpleschool/gptbot 0.19.16 → 0.19.18-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.
- package/build/api/controllers/http/payment.d.ts +1 -0
- package/build/api/controllers/http/payment.js +1 -0
- package/build/api/controllers/http/subscription.d.ts +1 -0
- package/build/api/controllers/http/subscription.js +1 -0
- package/build/api/partner-code-routes.d.ts +31 -0
- package/build/api/partner-code-routes.js +33 -1
- package/build/api/routes.d.ts +6 -0
- package/build/api/routes.js +7 -0
- package/build/commands/agents/agent-dialog/find-agent-dialogs.command.d.ts +1 -0
- package/build/commands/agents/agent-dialog/get-agent-dialog-by-id.command.d.ts +1 -0
- package/build/commands/agents/agent-dialog/rename-agent-dialog.command.d.ts +1 -0
- package/build/commands/agents/agent-dialog/update-agent-dialog-status.command.d.ts +1 -0
- package/build/commands/agents/agent-lead/create-agent-lead.command.d.ts +1 -0
- package/build/commands/agents/agent-lead/find-agent-leads.command.d.ts +1 -0
- package/build/commands/agents/agent-lead/get-agent-lead-by-id.command.d.ts +1 -0
- package/build/commands/agents/agent-lead/update-agent-lead.command.d.ts +1 -0
- package/build/commands/agents/agent-lead-form/upsert-agent-lead-form.command.js +4 -1
- package/build/commands/agents/agents/activate-agent.command.d.ts +1 -0
- package/build/commands/agents/agents/create-agent.command.d.ts +2 -0
- package/build/commands/agents/agents/create-agent.command.js +1 -0
- package/build/commands/agents/agents/find-agents.command.d.ts +1 -0
- package/build/commands/agents/agents/get-agent-aggregate.command.d.ts +1 -0
- package/build/commands/agents/agents/get-agent-by-id.command.d.ts +1 -0
- package/build/commands/agents/agents/stop-agent.command.d.ts +1 -0
- package/build/commands/agents/agents/update-agent.command.d.ts +2 -0
- package/build/commands/agents/agents/update-agent.command.js +1 -0
- package/build/commands/ai-studio/canvas/save-canvas.command.d.ts +1 -1
- package/build/commands/auth/register-user.command.d.ts +1 -0
- package/build/commands/auth/register-user.command.js +2 -0
- package/build/commands/auth/vk-login.command.d.ts +1 -0
- package/build/commands/auth/vk-login.command.js +2 -0
- package/build/commands/auth/yandex-login.command.d.ts +1 -0
- package/build/commands/auth/yandex-login.command.js +2 -0
- package/build/commands/chat/find-chats.command.d.ts +3 -3
- package/build/commands/community/get-all-community-posts-by-criteria.command.d.ts +1 -1
- package/build/commands/community/get-my-community-posts-by-criteria.command.d.ts +1 -1
- package/build/commands/community/get-my-favorite-community-posts.command.d.ts +1 -1
- package/build/commands/folder/find-folder-by-uuid-with-chats.command.d.ts +1 -1
- package/build/commands/folder/find-folders-by-user.command.d.ts +1 -1
- package/build/commands/model-page/base/find-model-pages-admin.command.d.ts +2 -2
- package/build/commands/model-page/common.schemas.d.ts +1 -1
- package/build/commands/model-page/public/find-model-page-hub.command.d.ts +3 -3
- package/build/commands/partner-codes/administration.d.ts +650 -0
- package/build/commands/partner-codes/administration.js +138 -0
- package/build/commands/partner-codes/index.d.ts +50 -3
- package/build/commands/partner-codes/index.js +28 -3
- package/build/commands/payment/find-payments-by-criteria.command.d.ts +1 -1
- package/build/commands/payment/get-purchase-history.command.d.ts +90 -0
- package/build/commands/payment/get-purchase-history.command.js +22 -0
- package/build/commands/payment/index.d.ts +1 -0
- package/build/commands/payment/index.js +1 -0
- package/build/commands/product/buy-product.command.d.ts +1 -1
- package/build/commands/subscription/buy-subscription.command.d.ts +1 -1
- package/build/commands/subscription/downgrade-subscription.command.d.ts +28 -5
- package/build/commands/subscription/downgrade-subscription.command.js +32 -9
- package/build/commands/subscription/get-subscriptions-summary.command.d.ts +32 -0
- package/build/commands/subscription/get-subscriptions-summary.command.js +2 -0
- package/build/commands/subscription/index.d.ts +1 -0
- package/build/commands/subscription/index.js +1 -0
- package/build/commands/subscription/payment-incident-diagnostics.d.ts +445 -0
- package/build/commands/subscription/payment-incident-diagnostics.js +173 -0
- package/build/commands/telegram-profile/auth-with-telegram-web-app.command.d.ts +1 -1
- package/build/commands/tools/diagrams/find-diagrams-jobs.command.d.ts +1 -1
- package/build/commands/tools/html-page-builder/find-html-page-builder-sessions.command.d.ts +1 -1
- package/build/commands/tools/image-editor/find-image-editor-jobs.command.d.ts +1 -1
- package/build/commands/tools/image-generation/find-image-generation-jobs.command.d.ts +1 -1
- package/build/commands/tools/image-recognition/find-image-recognition-jobs.command.d.ts +1 -1
- package/build/commands/tools/interior-design/find-interior-design-generation-groups.command.d.ts +1 -1
- package/build/commands/tools/interior-design/find-interior-design-jobs.command.d.ts +1 -1
- package/build/commands/tools/marketplace-card/find-marketplace-card-jobs.command.d.ts +1 -1
- package/build/commands/tools/motion-control/index.d.ts +1 -1
- package/build/commands/tools/music/find-music-jobs.command.d.ts +1 -1
- package/build/commands/tools/paraphrase/find-paraphrase-jobs.command.d.ts +1 -1
- package/build/commands/tools/photo-session/find-photo-session-jobs.command.d.ts +1 -1
- package/build/commands/tools/presentation/find-presentations.command.d.ts +1 -1
- package/build/commands/tools/solving-edu-task/find-solving-edu-task-jobs.command.d.ts +1 -1
- package/build/commands/tools/sound-generation/find-sound-generation-jobs.command.d.ts +1 -1
- package/build/commands/tools/spell-corrector/find-spell-corrector-jobs.command.d.ts +1 -1
- package/build/commands/tools/stt/find-stt-jobs.command.d.ts +1 -1
- package/build/commands/tools/tool-workspace/find-tool-workspaces.command.d.ts +1 -1
- package/build/commands/tools/tts/find-tts-jobs.command.d.ts +1 -1
- package/build/commands/tools/video/find-video-jobs.command.d.ts +1 -1
- package/build/commands/tools/video-editor/find-video-editor-jobs.command.d.ts +1 -1
- package/build/commands/tools/writer/find-writer-documents.command.d.ts +1 -1
- package/build/commands/user/find-users-by-criteria.command.d.ts +1 -1
- package/build/commands/user/get-me.command.d.ts +3 -0
- package/build/commands/user/get-me.command.js +1 -0
- package/build/helpers/query-boolean.schema.d.ts +1 -1
- package/build/models/agents/agent-aggregate.schema.d.ts +1 -0
- package/build/models/agents/agent-dialog-lead.schema.d.ts +1 -0
- package/build/models/agents/agent-dialog-lead.schema.js +1 -0
- package/build/models/agents/agent-lead-find-result.schema.d.ts +1 -0
- package/build/models/agents/agent-lead-form-field.schema.js +8 -3
- package/build/models/agents/agent-lead.schema.d.ts +1 -0
- package/build/models/agents/agent-lead.schema.js +1 -0
- package/build/models/agents/agent.schema.d.ts +1 -0
- package/build/models/agents/agent.schema.js +1 -0
- package/build/models/agents/dialog-find-result.schema.d.ts +1 -0
- package/build/models/agents/dialog-with-messages.schema.d.ts +1 -0
- package/build/models/agents/dialog.schema.d.ts +1 -0
- package/build/models/index.d.ts +1 -0
- package/build/models/index.js +1 -0
- package/build/models/partner-codes/index.d.ts +4 -0
- package/build/models/partner-codes/index.js +4 -0
- package/build/models/partner-codes/partner-administration.schema.d.ts +183 -0
- package/build/models/partner-codes/partner-administration.schema.js +72 -0
- package/build/models/partner-codes/partner-cabinet-context.schema.d.ts +24 -0
- package/build/models/partner-codes/partner-cabinet-context.schema.js +8 -0
- package/build/models/partner-codes/partner-cabinet.schema.d.ts +362 -0
- package/build/models/partner-codes/partner-cabinet.schema.js +84 -0
- package/build/models/partner-codes/partner-codes.schema.d.ts +78 -2
- package/build/models/partner-codes/partner-codes.schema.js +73 -5
- package/build/models/partner-codes/partner-leak-create.schema.d.ts +6 -0
- package/build/models/partner-codes/partner-leak-create.schema.js +8 -0
- package/build/models/partner-registration-context.schema.d.ts +3 -0
- package/build/models/partner-registration-context.schema.js +6 -0
- package/build/models/purchase-history.schema.d.ts +112 -0
- package/build/models/purchase-history.schema.js +38 -0
- package/build/models/tools/diagrams/diagrams-job.schema.d.ts +2 -2
- package/package.json +3 -3
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PartnerAdminCodeSearchResultSchema = exports.PartnerAdminCodeSearchSchema = exports.PartnerOfferCreateSchema = exports.PartnerOfferSettingsSchema = exports.PartnerCatalogProductSchema = exports.PartnerAdminMembershipSchema = exports.PartnerMembershipRoleUpdateSchema = exports.PartnerMembershipWriteSchema = exports.PartnerCompanyUpdateSchema = exports.PartnerCompanyCreateSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const partner_codes_schema_1 = require("./partner-codes.schema");
|
|
6
|
+
// Write limits match PostgreSQL Int and Decimal(18,2), not widened report totals.
|
|
7
|
+
const databaseInteger = zod_1.z.number().int().min(0).max(2147483647);
|
|
8
|
+
const databaseMoney = partner_codes_schema_1.PartnerMoneySchema.regex(/^(0|[1-9]\d{0,15})\.\d{2}$/);
|
|
9
|
+
const nonemptyText = zod_1.z.string().trim().min(1);
|
|
10
|
+
const accountEmail = zod_1.z.string().trim().toLowerCase().email();
|
|
11
|
+
exports.PartnerCompanyCreateSchema = zod_1.z
|
|
12
|
+
.object({ name: nonemptyText, email: accountEmail })
|
|
13
|
+
.strict();
|
|
14
|
+
exports.PartnerCompanyUpdateSchema = zod_1.z.object({ name: nonemptyText }).strict();
|
|
15
|
+
exports.PartnerMembershipWriteSchema = zod_1.z
|
|
16
|
+
.object({ email: accountEmail, role: partner_codes_schema_1.PartnerRoleSchema })
|
|
17
|
+
.strict();
|
|
18
|
+
exports.PartnerMembershipRoleUpdateSchema = zod_1.z.object({ role: partner_codes_schema_1.PartnerRoleSchema }).strict();
|
|
19
|
+
exports.PartnerAdminMembershipSchema = partner_codes_schema_1.PartnerMembershipSchema.extend({
|
|
20
|
+
email: accountEmail.nullable(),
|
|
21
|
+
}).strict();
|
|
22
|
+
exports.PartnerCatalogProductSchema = zod_1.z.discriminatedUnion('kind', [
|
|
23
|
+
partner_codes_schema_1.PartnerProductSchema.options[0].extend({ mainSubscriptionId: zod_1.z.uuid().nullable() }),
|
|
24
|
+
partner_codes_schema_1.PartnerProductSchema.options[1],
|
|
25
|
+
]);
|
|
26
|
+
const offerSettings = {
|
|
27
|
+
title: nonemptyText,
|
|
28
|
+
retailPrice: databaseMoney,
|
|
29
|
+
commissionType: partner_codes_schema_1.PartnerCommissionTypeSchema,
|
|
30
|
+
commissionValue: partner_codes_schema_1.PartnerCommissionValueSchema,
|
|
31
|
+
maxOutstanding: databaseInteger,
|
|
32
|
+
codeTtlDays: databaseInteger.min(1),
|
|
33
|
+
active: zod_1.z.boolean(),
|
|
34
|
+
};
|
|
35
|
+
const subscriptionSettings = zod_1.z
|
|
36
|
+
.object(Object.assign(Object.assign({}, offerSettings), { kind: zod_1.z.literal('subscription'), subscriptionId: zod_1.z.uuid(), productId: zod_1.z.null().default(null), durationMonths: databaseInteger.min(1), starsAmount: zod_1.z.null().default(null) }))
|
|
37
|
+
.strict();
|
|
38
|
+
const starsSettings = zod_1.z
|
|
39
|
+
.object(Object.assign(Object.assign({}, offerSettings), { kind: zod_1.z.literal('stars'), productId: zod_1.z.uuid(), subscriptionId: zod_1.z.null().default(null), durationMonths: zod_1.z.null().default(null), starsAmount: databaseMoney.refine((value) => value !== '0.00') }))
|
|
40
|
+
.strict();
|
|
41
|
+
// Company comes from the route. A settings update cannot move an offer to another company.
|
|
42
|
+
exports.PartnerOfferSettingsSchema = zod_1.z
|
|
43
|
+
.discriminatedUnion('kind', [subscriptionSettings, starsSettings])
|
|
44
|
+
.refine(partner_codes_schema_1.validPartnerCommission, { message: 'Invalid partner commission conditions' });
|
|
45
|
+
const offerDefaults = {
|
|
46
|
+
codeTtlDays: offerSettings.codeTtlDays.default(365),
|
|
47
|
+
active: offerSettings.active.default(true),
|
|
48
|
+
};
|
|
49
|
+
exports.PartnerOfferCreateSchema = zod_1.z
|
|
50
|
+
.discriminatedUnion('kind', [
|
|
51
|
+
subscriptionSettings.extend(offerDefaults),
|
|
52
|
+
starsSettings.extend(offerDefaults),
|
|
53
|
+
])
|
|
54
|
+
.refine(partner_codes_schema_1.validPartnerCommission, { message: 'Invalid partner commission conditions' });
|
|
55
|
+
// POST body only. Never persist/log these inputs or reuse them as read models.
|
|
56
|
+
exports.PartnerAdminCodeSearchSchema = zod_1.z.union([
|
|
57
|
+
zod_1.z.object({ serial: zod_1.z.string().min(1).max(128) }).strict(),
|
|
58
|
+
zod_1.z.object({ code: zod_1.z.string().min(1).max(128) }).strict(),
|
|
59
|
+
]);
|
|
60
|
+
exports.PartnerAdminCodeSearchResultSchema = zod_1.z
|
|
61
|
+
.object({
|
|
62
|
+
company: partner_codes_schema_1.PartnerCompanySchema,
|
|
63
|
+
batch: partner_codes_schema_1.PartnerBatchSchema,
|
|
64
|
+
code: partner_codes_schema_1.PartnerCodeSchema,
|
|
65
|
+
activatedByUserId: zod_1.z.uuid().nullable(),
|
|
66
|
+
activatedByUser: zod_1.z
|
|
67
|
+
.object({ uuid: zod_1.z.uuid(), email: zod_1.z.email(), name: zod_1.z.string().nullable() })
|
|
68
|
+
.strict()
|
|
69
|
+
.nullable()
|
|
70
|
+
.optional(),
|
|
71
|
+
})
|
|
72
|
+
.strict();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PartnerCabinetContextSchema: z.ZodObject<{
|
|
3
|
+
company: z.ZodObject<{
|
|
4
|
+
uuid: z.ZodUUID;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
code: z.ZodString;
|
|
7
|
+
status: z.ZodEnum<{
|
|
8
|
+
active: "active";
|
|
9
|
+
disabled: "disabled";
|
|
10
|
+
}>;
|
|
11
|
+
createdAt: z.ZodISODateTime;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
membership: z.ZodObject<{
|
|
14
|
+
uuid: z.ZodUUID;
|
|
15
|
+
partnerId: z.ZodUUID;
|
|
16
|
+
userId: z.ZodUUID;
|
|
17
|
+
role: z.ZodEnum<{
|
|
18
|
+
manager: "manager";
|
|
19
|
+
owner: "owner";
|
|
20
|
+
}>;
|
|
21
|
+
createdAt: z.ZodISODateTime;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export type PartnerCabinetContext = z.infer<typeof PartnerCabinetContextSchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PartnerCabinetContextSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const partner_codes_schema_1 = require("./partner-codes.schema");
|
|
6
|
+
exports.PartnerCabinetContextSchema = zod_1.z
|
|
7
|
+
.object({ company: partner_codes_schema_1.PartnerCompanySchema, membership: partner_codes_schema_1.PartnerMembershipSchema })
|
|
8
|
+
.strict();
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { PartnerCabinetContextSchema, PartnerCabinetContext, } from './partner-cabinet-context.schema';
|
|
3
|
+
export { PartnerCabinetLeakCreateSchema } from './partner-leak-create.schema';
|
|
4
|
+
export declare const PartnerCabinetContextResponseSchema: z.ZodObject<{
|
|
5
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
6
|
+
company: z.ZodObject<{
|
|
7
|
+
uuid: z.ZodUUID;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
code: z.ZodString;
|
|
10
|
+
status: z.ZodEnum<{
|
|
11
|
+
active: "active";
|
|
12
|
+
disabled: "disabled";
|
|
13
|
+
}>;
|
|
14
|
+
createdAt: z.ZodISODateTime;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
membership: z.ZodObject<{
|
|
17
|
+
uuid: z.ZodUUID;
|
|
18
|
+
partnerId: z.ZodUUID;
|
|
19
|
+
userId: z.ZodUUID;
|
|
20
|
+
role: z.ZodEnum<{
|
|
21
|
+
manager: "manager";
|
|
22
|
+
owner: "owner";
|
|
23
|
+
}>;
|
|
24
|
+
createdAt: z.ZodISODateTime;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
}, z.core.$strict>>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export declare const PartnerCabinetOffersResponseSchema: z.ZodObject<{
|
|
29
|
+
data: z.ZodArray<z.ZodObject<{
|
|
30
|
+
uuid: z.ZodUUID;
|
|
31
|
+
partnerId: z.ZodUUID;
|
|
32
|
+
product: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
|
+
kind: z.ZodLiteral<"subscription">;
|
|
34
|
+
title: z.ZodString;
|
|
35
|
+
subscriptionId: z.ZodUUID;
|
|
36
|
+
durationMonths: z.ZodNumber;
|
|
37
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
38
|
+
kind: z.ZodLiteral<"stars">;
|
|
39
|
+
title: z.ZodString;
|
|
40
|
+
productId: z.ZodUUID;
|
|
41
|
+
starsAmount: z.ZodString;
|
|
42
|
+
}, z.core.$strict>], "kind">;
|
|
43
|
+
retailPrice: z.ZodString;
|
|
44
|
+
commissionType: z.ZodEnum<{
|
|
45
|
+
fixed: "fixed";
|
|
46
|
+
percent: "percent";
|
|
47
|
+
}>;
|
|
48
|
+
commissionValue: z.ZodString;
|
|
49
|
+
maxOutstanding: z.ZodNumber;
|
|
50
|
+
codeTtlDays: z.ZodNumber;
|
|
51
|
+
active: z.ZodBoolean;
|
|
52
|
+
activatedCount: z.ZodNumber;
|
|
53
|
+
outstanding: z.ZodNumber;
|
|
54
|
+
availableQuantity: z.ZodNumber;
|
|
55
|
+
}, z.core.$strict>>;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
export declare const PartnerCabinetBatchesResponseSchema: z.ZodObject<{
|
|
58
|
+
count: z.ZodNumber;
|
|
59
|
+
page: z.ZodNumber;
|
|
60
|
+
pageSize: z.ZodNumber;
|
|
61
|
+
items: z.ZodArray<z.ZodObject<{
|
|
62
|
+
uuid: z.ZodUUID;
|
|
63
|
+
partnerId: z.ZodUUID;
|
|
64
|
+
offerId: z.ZodUUID;
|
|
65
|
+
product: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
66
|
+
kind: z.ZodLiteral<"subscription">;
|
|
67
|
+
title: z.ZodString;
|
|
68
|
+
subscriptionId: z.ZodUUID;
|
|
69
|
+
durationMonths: z.ZodNumber;
|
|
70
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
71
|
+
kind: z.ZodLiteral<"stars">;
|
|
72
|
+
title: z.ZodString;
|
|
73
|
+
productId: z.ZodUUID;
|
|
74
|
+
starsAmount: z.ZodString;
|
|
75
|
+
}, z.core.$strict>], "kind">;
|
|
76
|
+
quantity: z.ZodNumber;
|
|
77
|
+
status: z.ZodEnum<{
|
|
78
|
+
active: "active";
|
|
79
|
+
expired: "expired";
|
|
80
|
+
revoked: "revoked";
|
|
81
|
+
}>;
|
|
82
|
+
expiresAt: z.ZodISODateTime;
|
|
83
|
+
createdAt: z.ZodISODateTime;
|
|
84
|
+
createdByUserId: z.ZodNullable<z.ZodUUID>;
|
|
85
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
86
|
+
name: z.ZodNullable<z.ZodString>;
|
|
87
|
+
}, z.core.$strict>>>;
|
|
88
|
+
exportCount: z.ZodNumber;
|
|
89
|
+
lastExportedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
90
|
+
activatedCount: z.ZodNumber;
|
|
91
|
+
remainingCount: z.ZodNumber;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
export declare const PartnerCabinetCodesResponseSchema: z.ZodObject<{
|
|
95
|
+
count: z.ZodNumber;
|
|
96
|
+
page: z.ZodNumber;
|
|
97
|
+
pageSize: z.ZodNumber;
|
|
98
|
+
items: z.ZodArray<z.ZodObject<{
|
|
99
|
+
uuid: z.ZodUUID;
|
|
100
|
+
batchId: z.ZodUUID;
|
|
101
|
+
serial: z.ZodString;
|
|
102
|
+
status: z.ZodEnum<{
|
|
103
|
+
activated: "activated";
|
|
104
|
+
expired: "expired";
|
|
105
|
+
issued: "issued";
|
|
106
|
+
revoked: "revoked";
|
|
107
|
+
}>;
|
|
108
|
+
activatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
109
|
+
}, z.core.$strict>>;
|
|
110
|
+
}, z.core.$strict>;
|
|
111
|
+
export declare const PartnerCabinetBatchResponseSchema: z.ZodObject<{
|
|
112
|
+
data: z.ZodObject<{
|
|
113
|
+
uuid: z.ZodUUID;
|
|
114
|
+
partnerId: z.ZodUUID;
|
|
115
|
+
offerId: z.ZodUUID;
|
|
116
|
+
product: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
117
|
+
kind: z.ZodLiteral<"subscription">;
|
|
118
|
+
title: z.ZodString;
|
|
119
|
+
subscriptionId: z.ZodUUID;
|
|
120
|
+
durationMonths: z.ZodNumber;
|
|
121
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
122
|
+
kind: z.ZodLiteral<"stars">;
|
|
123
|
+
title: z.ZodString;
|
|
124
|
+
productId: z.ZodUUID;
|
|
125
|
+
starsAmount: z.ZodString;
|
|
126
|
+
}, z.core.$strict>], "kind">;
|
|
127
|
+
quantity: z.ZodNumber;
|
|
128
|
+
status: z.ZodEnum<{
|
|
129
|
+
active: "active";
|
|
130
|
+
expired: "expired";
|
|
131
|
+
revoked: "revoked";
|
|
132
|
+
}>;
|
|
133
|
+
expiresAt: z.ZodISODateTime;
|
|
134
|
+
createdAt: z.ZodISODateTime;
|
|
135
|
+
createdByUserId: z.ZodNullable<z.ZodUUID>;
|
|
136
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
137
|
+
name: z.ZodNullable<z.ZodString>;
|
|
138
|
+
}, z.core.$strict>>>;
|
|
139
|
+
exportCount: z.ZodNumber;
|
|
140
|
+
lastExportedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
141
|
+
activatedCount: z.ZodNumber;
|
|
142
|
+
remainingCount: z.ZodNumber;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
export declare const PartnerCabinetIssueRequestSchema: z.ZodObject<{
|
|
146
|
+
offerId: z.ZodUUID;
|
|
147
|
+
quantity: z.ZodNumber;
|
|
148
|
+
requestId: z.ZodUUID;
|
|
149
|
+
}, z.core.$strict>;
|
|
150
|
+
export declare const PartnerCabinetReportQuerySchema: z.ZodObject<{
|
|
151
|
+
month: z.ZodString;
|
|
152
|
+
sequence: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
}, z.core.$strict>;
|
|
154
|
+
export declare const PartnerCabinetReportResponseSchema: z.ZodObject<{
|
|
155
|
+
data: z.ZodObject<{
|
|
156
|
+
version: z.ZodLiteral<1>;
|
|
157
|
+
partnerId: z.ZodUUID;
|
|
158
|
+
month: z.ZodString;
|
|
159
|
+
summary: z.ZodObject<{
|
|
160
|
+
activationsCount: z.ZodNumber;
|
|
161
|
+
retailTotal: z.ZodString;
|
|
162
|
+
commissionTotal: z.ZodString;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
165
|
+
activationsCount: z.ZodNumber;
|
|
166
|
+
retailTotal: z.ZodString;
|
|
167
|
+
commissionTotal: z.ZodString;
|
|
168
|
+
product: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
169
|
+
kind: z.ZodLiteral<"subscription">;
|
|
170
|
+
title: z.ZodString;
|
|
171
|
+
subscriptionId: z.ZodUUID;
|
|
172
|
+
durationMonths: z.ZodNumber;
|
|
173
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
174
|
+
kind: z.ZodLiteral<"stars">;
|
|
175
|
+
title: z.ZodString;
|
|
176
|
+
productId: z.ZodUUID;
|
|
177
|
+
starsAmount: z.ZodString;
|
|
178
|
+
}, z.core.$strict>], "kind">;
|
|
179
|
+
retailPrice: z.ZodString;
|
|
180
|
+
commission: z.ZodString;
|
|
181
|
+
commissionType: z.ZodEnum<{
|
|
182
|
+
fixed: "fixed";
|
|
183
|
+
percent: "percent";
|
|
184
|
+
}>;
|
|
185
|
+
commissionValue: z.ZodString;
|
|
186
|
+
}, z.core.$strict>>;
|
|
187
|
+
days: z.ZodArray<z.ZodObject<{
|
|
188
|
+
activationsCount: z.ZodNumber;
|
|
189
|
+
retailTotal: z.ZodString;
|
|
190
|
+
commissionTotal: z.ZodString;
|
|
191
|
+
day: z.ZodString;
|
|
192
|
+
}, z.core.$strict>>;
|
|
193
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
194
|
+
codeId: z.ZodUUID;
|
|
195
|
+
serial: z.ZodString;
|
|
196
|
+
product: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
197
|
+
kind: z.ZodLiteral<"subscription">;
|
|
198
|
+
title: z.ZodString;
|
|
199
|
+
subscriptionId: z.ZodUUID;
|
|
200
|
+
durationMonths: z.ZodNumber;
|
|
201
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
202
|
+
kind: z.ZodLiteral<"stars">;
|
|
203
|
+
title: z.ZodString;
|
|
204
|
+
productId: z.ZodUUID;
|
|
205
|
+
starsAmount: z.ZodString;
|
|
206
|
+
}, z.core.$strict>], "kind">;
|
|
207
|
+
activatedAt: z.ZodISODateTime;
|
|
208
|
+
retailPrice: z.ZodString;
|
|
209
|
+
commission: z.ZodString;
|
|
210
|
+
commissionType: z.ZodEnum<{
|
|
211
|
+
fixed: "fixed";
|
|
212
|
+
percent: "percent";
|
|
213
|
+
}>;
|
|
214
|
+
commissionValue: z.ZodString;
|
|
215
|
+
}, z.core.$strict>>;
|
|
216
|
+
status: z.ZodEnum<{
|
|
217
|
+
closed: "closed";
|
|
218
|
+
open: "open";
|
|
219
|
+
}>;
|
|
220
|
+
closedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
221
|
+
dataVersion: z.ZodString;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
}, z.core.$strict>;
|
|
224
|
+
export declare const PartnerCabinetMemberSchema: z.ZodObject<{
|
|
225
|
+
uuid: z.ZodUUID;
|
|
226
|
+
partnerId: z.ZodUUID;
|
|
227
|
+
userId: z.ZodUUID;
|
|
228
|
+
role: z.ZodEnum<{
|
|
229
|
+
manager: "manager";
|
|
230
|
+
owner: "owner";
|
|
231
|
+
}>;
|
|
232
|
+
createdAt: z.ZodISODateTime;
|
|
233
|
+
name: z.ZodNullable<z.ZodString>;
|
|
234
|
+
email: z.ZodEmail;
|
|
235
|
+
}, z.core.$strict>;
|
|
236
|
+
export declare const PartnerCabinetMembersResponseSchema: z.ZodObject<{
|
|
237
|
+
items: z.ZodArray<z.ZodObject<{
|
|
238
|
+
uuid: z.ZodUUID;
|
|
239
|
+
partnerId: z.ZodUUID;
|
|
240
|
+
userId: z.ZodUUID;
|
|
241
|
+
role: z.ZodEnum<{
|
|
242
|
+
manager: "manager";
|
|
243
|
+
owner: "owner";
|
|
244
|
+
}>;
|
|
245
|
+
createdAt: z.ZodISODateTime;
|
|
246
|
+
name: z.ZodNullable<z.ZodString>;
|
|
247
|
+
email: z.ZodEmail;
|
|
248
|
+
}, z.core.$strict>>;
|
|
249
|
+
}, z.core.$strict>;
|
|
250
|
+
export declare const PartnerCabinetInviteResponseSchema: z.ZodObject<{
|
|
251
|
+
data: z.ZodObject<{
|
|
252
|
+
uuid: z.ZodUUID;
|
|
253
|
+
partnerId: z.ZodUUID;
|
|
254
|
+
recipientUserId: z.ZodUUID;
|
|
255
|
+
recipientEmail: z.ZodEmail;
|
|
256
|
+
sentByUserId: z.ZodNullable<z.ZodUUID>;
|
|
257
|
+
role: z.ZodEnum<{
|
|
258
|
+
manager: "manager";
|
|
259
|
+
owner: "owner";
|
|
260
|
+
}>;
|
|
261
|
+
status: z.ZodEnum<{
|
|
262
|
+
accepted: "accepted";
|
|
263
|
+
expired: "expired";
|
|
264
|
+
pending: "pending";
|
|
265
|
+
revoked: "revoked";
|
|
266
|
+
}>;
|
|
267
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
268
|
+
acceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
269
|
+
revokedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
270
|
+
createdAt: z.ZodISODateTime;
|
|
271
|
+
}, z.core.$strict>;
|
|
272
|
+
}, z.core.$strict>;
|
|
273
|
+
export declare const PartnerCabinetInviteResendSchema: z.ZodObject<{
|
|
274
|
+
inviteId: z.ZodUUID;
|
|
275
|
+
}, z.core.$strict>;
|
|
276
|
+
export declare const PartnerCabinetInviteErrorSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
277
|
+
already_member: "already_member";
|
|
278
|
+
forbidden: "forbidden";
|
|
279
|
+
invalid_invite: "invalid_invite";
|
|
280
|
+
user_not_found: "user_not_found";
|
|
281
|
+
}>, z.ZodLiteral<"invite_rate_limited">]>;
|
|
282
|
+
export declare const PartnerCabinetInviteReadResponseSchema: z.ZodObject<{
|
|
283
|
+
data: z.ZodObject<{
|
|
284
|
+
invite: z.ZodObject<{
|
|
285
|
+
uuid: z.ZodUUID;
|
|
286
|
+
partnerId: z.ZodUUID;
|
|
287
|
+
recipientUserId: z.ZodUUID;
|
|
288
|
+
recipientEmail: z.ZodEmail;
|
|
289
|
+
sentByUserId: z.ZodNullable<z.ZodUUID>;
|
|
290
|
+
role: z.ZodEnum<{
|
|
291
|
+
manager: "manager";
|
|
292
|
+
owner: "owner";
|
|
293
|
+
}>;
|
|
294
|
+
status: z.ZodEnum<{
|
|
295
|
+
accepted: "accepted";
|
|
296
|
+
expired: "expired";
|
|
297
|
+
pending: "pending";
|
|
298
|
+
revoked: "revoked";
|
|
299
|
+
}>;
|
|
300
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
301
|
+
acceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
302
|
+
revokedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
303
|
+
createdAt: z.ZodISODateTime;
|
|
304
|
+
}, z.core.$strict>;
|
|
305
|
+
company: z.ZodObject<{
|
|
306
|
+
uuid: z.ZodUUID;
|
|
307
|
+
name: z.ZodString;
|
|
308
|
+
code: z.ZodString;
|
|
309
|
+
status: z.ZodEnum<{
|
|
310
|
+
active: "active";
|
|
311
|
+
disabled: "disabled";
|
|
312
|
+
}>;
|
|
313
|
+
createdAt: z.ZodISODateTime;
|
|
314
|
+
}, z.core.$strict>;
|
|
315
|
+
}, z.core.$strict>;
|
|
316
|
+
}, z.core.$strict>;
|
|
317
|
+
export declare const PartnerCabinetInviteAcceptResponseSchema: z.ZodObject<{
|
|
318
|
+
data: z.ZodObject<{
|
|
319
|
+
uuid: z.ZodUUID;
|
|
320
|
+
partnerId: z.ZodUUID;
|
|
321
|
+
userId: z.ZodUUID;
|
|
322
|
+
role: z.ZodEnum<{
|
|
323
|
+
manager: "manager";
|
|
324
|
+
owner: "owner";
|
|
325
|
+
}>;
|
|
326
|
+
createdAt: z.ZodISODateTime;
|
|
327
|
+
}, z.core.$strict>;
|
|
328
|
+
}, z.core.$strict>;
|
|
329
|
+
export declare const PartnerCabinetMutationResponseSchema: z.ZodObject<{
|
|
330
|
+
success: z.ZodLiteral<true>;
|
|
331
|
+
}, z.core.$strict>;
|
|
332
|
+
export declare const PartnerCabinetExportChallengeResponseSchema: z.ZodObject<{
|
|
333
|
+
data: z.ZodObject<{
|
|
334
|
+
purpose: z.ZodLiteral<"partner_code_export">;
|
|
335
|
+
challengeId: z.ZodUUID;
|
|
336
|
+
batchId: z.ZodUUID;
|
|
337
|
+
expiresAt: z.ZodISODateTime;
|
|
338
|
+
resendAt: z.ZodISODateTime;
|
|
339
|
+
}, z.core.$strict>;
|
|
340
|
+
}, z.core.$strict>;
|
|
341
|
+
export declare const PartnerCabinetExportVerifiedResponseSchema: z.ZodObject<{
|
|
342
|
+
data: z.ZodObject<{
|
|
343
|
+
purpose: z.ZodLiteral<"partner_code_export">;
|
|
344
|
+
challengeId: z.ZodUUID;
|
|
345
|
+
verified: z.ZodLiteral<true>;
|
|
346
|
+
}, z.core.$strict>;
|
|
347
|
+
}, z.core.$strict>;
|
|
348
|
+
export declare const PartnerCabinetExportRequestSchema: z.ZodObject<{
|
|
349
|
+
purpose: z.ZodLiteral<"partner_code_export">;
|
|
350
|
+
challengeId: z.ZodUUID;
|
|
351
|
+
}, z.core.$strict>;
|
|
352
|
+
export declare const PartnerCabinetExportsResponseSchema: z.ZodObject<{
|
|
353
|
+
items: z.ZodArray<z.ZodObject<{
|
|
354
|
+
createdAt: z.ZodISODateTime;
|
|
355
|
+
}, z.core.$strict>>;
|
|
356
|
+
}, z.core.$strict>;
|
|
357
|
+
export declare const PartnerCabinetExportErrorSchema: z.ZodEnum<{
|
|
358
|
+
email_not_verified: "email_not_verified";
|
|
359
|
+
otp_expired: "otp_expired";
|
|
360
|
+
otp_invalid: "otp_invalid";
|
|
361
|
+
otp_rate_limited: "otp_rate_limited";
|
|
362
|
+
}>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PartnerCabinetExportErrorSchema = exports.PartnerCabinetExportsResponseSchema = exports.PartnerCabinetExportRequestSchema = exports.PartnerCabinetExportVerifiedResponseSchema = exports.PartnerCabinetExportChallengeResponseSchema = exports.PartnerCabinetMutationResponseSchema = exports.PartnerCabinetInviteAcceptResponseSchema = exports.PartnerCabinetInviteReadResponseSchema = exports.PartnerCabinetInviteErrorSchema = exports.PartnerCabinetInviteResendSchema = exports.PartnerCabinetInviteResponseSchema = exports.PartnerCabinetMembersResponseSchema = exports.PartnerCabinetMemberSchema = exports.PartnerCabinetReportResponseSchema = exports.PartnerCabinetReportQuerySchema = exports.PartnerCabinetIssueRequestSchema = exports.PartnerCabinetBatchResponseSchema = exports.PartnerCabinetCodesResponseSchema = exports.PartnerCabinetBatchesResponseSchema = exports.PartnerCabinetOffersResponseSchema = exports.PartnerCabinetContextResponseSchema = exports.PartnerCabinetLeakCreateSchema = exports.PartnerCabinetContextSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const partner_codes_schema_1 = require("./partner-codes.schema");
|
|
6
|
+
const partner_cabinet_context_schema_1 = require("./partner-cabinet-context.schema");
|
|
7
|
+
var partner_cabinet_context_schema_2 = require("./partner-cabinet-context.schema");
|
|
8
|
+
Object.defineProperty(exports, "PartnerCabinetContextSchema", { enumerable: true, get: function () { return partner_cabinet_context_schema_2.PartnerCabinetContextSchema; } });
|
|
9
|
+
var partner_leak_create_schema_1 = require("./partner-leak-create.schema");
|
|
10
|
+
Object.defineProperty(exports, "PartnerCabinetLeakCreateSchema", { enumerable: true, get: function () { return partner_leak_create_schema_1.PartnerCabinetLeakCreateSchema; } });
|
|
11
|
+
exports.PartnerCabinetContextResponseSchema = zod_1.z
|
|
12
|
+
.object({ data: partner_cabinet_context_schema_1.PartnerCabinetContextSchema.nullable() })
|
|
13
|
+
.strict();
|
|
14
|
+
exports.PartnerCabinetOffersResponseSchema = zod_1.z
|
|
15
|
+
.object({ data: zod_1.z.array(partner_codes_schema_1.PartnerOfferSchema) })
|
|
16
|
+
.strict();
|
|
17
|
+
const pagination = {
|
|
18
|
+
count: zod_1.z.number().int().nonnegative(),
|
|
19
|
+
page: zod_1.z.number().int().positive(),
|
|
20
|
+
pageSize: zod_1.z.number().int().min(1).max(100),
|
|
21
|
+
};
|
|
22
|
+
exports.PartnerCabinetBatchesResponseSchema = zod_1.z
|
|
23
|
+
.object(Object.assign(Object.assign({}, pagination), { items: zod_1.z.array(partner_codes_schema_1.PartnerBatchSchema) }))
|
|
24
|
+
.strict();
|
|
25
|
+
exports.PartnerCabinetCodesResponseSchema = zod_1.z
|
|
26
|
+
.object(Object.assign(Object.assign({}, pagination), { items: zod_1.z.array(partner_codes_schema_1.PartnerCodeSchema) }))
|
|
27
|
+
.strict();
|
|
28
|
+
exports.PartnerCabinetBatchResponseSchema = zod_1.z.object({ data: partner_codes_schema_1.PartnerBatchSchema }).strict();
|
|
29
|
+
exports.PartnerCabinetIssueRequestSchema = partner_codes_schema_1.PartnerIssueRequestSchema.extend({
|
|
30
|
+
requestId: zod_1.z.uuid(),
|
|
31
|
+
});
|
|
32
|
+
exports.PartnerCabinetReportQuerySchema = partner_codes_schema_1.PartnerReportQuerySchema;
|
|
33
|
+
exports.PartnerCabinetReportResponseSchema = zod_1.z.object({ data: partner_codes_schema_1.PartnerReportSchema }).strict();
|
|
34
|
+
exports.PartnerCabinetMemberSchema = partner_codes_schema_1.PartnerMembershipSchema.extend({
|
|
35
|
+
name: zod_1.z.string().nullable(),
|
|
36
|
+
email: zod_1.z.email(),
|
|
37
|
+
});
|
|
38
|
+
exports.PartnerCabinetMembersResponseSchema = zod_1.z
|
|
39
|
+
.object({ items: zod_1.z.array(exports.PartnerCabinetMemberSchema) })
|
|
40
|
+
.strict();
|
|
41
|
+
exports.PartnerCabinetInviteResponseSchema = zod_1.z.object({ data: partner_codes_schema_1.PartnerInviteSchema }).strict();
|
|
42
|
+
exports.PartnerCabinetInviteResendSchema = zod_1.z.object({ inviteId: zod_1.z.uuid() }).strict();
|
|
43
|
+
exports.PartnerCabinetInviteErrorSchema = zod_1.z.union([
|
|
44
|
+
partner_codes_schema_1.PartnerInviteErrorSchema,
|
|
45
|
+
zod_1.z.literal('invite_rate_limited'),
|
|
46
|
+
]);
|
|
47
|
+
exports.PartnerCabinetInviteReadResponseSchema = zod_1.z
|
|
48
|
+
.object({
|
|
49
|
+
data: zod_1.z.object({ invite: partner_codes_schema_1.PartnerInviteSchema, company: partner_codes_schema_1.PartnerCompanySchema }).strict(),
|
|
50
|
+
})
|
|
51
|
+
.strict();
|
|
52
|
+
exports.PartnerCabinetInviteAcceptResponseSchema = zod_1.z
|
|
53
|
+
.object({ data: partner_codes_schema_1.PartnerMembershipSchema })
|
|
54
|
+
.strict();
|
|
55
|
+
exports.PartnerCabinetMutationResponseSchema = zod_1.z.object({ success: zod_1.z.literal(true) }).strict();
|
|
56
|
+
exports.PartnerCabinetExportChallengeResponseSchema = zod_1.z
|
|
57
|
+
.object({ data: partner_codes_schema_1.PartnerExportChallengeSchema })
|
|
58
|
+
.strict();
|
|
59
|
+
exports.PartnerCabinetExportVerifiedResponseSchema = zod_1.z
|
|
60
|
+
.object({
|
|
61
|
+
data: zod_1.z
|
|
62
|
+
.object({
|
|
63
|
+
purpose: zod_1.z.literal('partner_code_export'),
|
|
64
|
+
challengeId: zod_1.z.uuid(),
|
|
65
|
+
verified: zod_1.z.literal(true),
|
|
66
|
+
})
|
|
67
|
+
.strict(),
|
|
68
|
+
})
|
|
69
|
+
.strict();
|
|
70
|
+
exports.PartnerCabinetExportRequestSchema = zod_1.z
|
|
71
|
+
.object({
|
|
72
|
+
purpose: zod_1.z.literal('partner_code_export'),
|
|
73
|
+
challengeId: zod_1.z.uuid(),
|
|
74
|
+
})
|
|
75
|
+
.strict();
|
|
76
|
+
exports.PartnerCabinetExportsResponseSchema = zod_1.z
|
|
77
|
+
.object({ items: zod_1.z.array(partner_codes_schema_1.PartnerExportHistorySchema) })
|
|
78
|
+
.strict();
|
|
79
|
+
exports.PartnerCabinetExportErrorSchema = zod_1.z.enum([
|
|
80
|
+
'otp_invalid',
|
|
81
|
+
'otp_expired',
|
|
82
|
+
'otp_rate_limited',
|
|
83
|
+
'email_not_verified',
|
|
84
|
+
]);
|