@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.
Files changed (120) hide show
  1. package/build/api/controllers/http/payment.d.ts +1 -0
  2. package/build/api/controllers/http/payment.js +1 -0
  3. package/build/api/controllers/http/subscription.d.ts +1 -0
  4. package/build/api/controllers/http/subscription.js +1 -0
  5. package/build/api/partner-code-routes.d.ts +31 -0
  6. package/build/api/partner-code-routes.js +33 -1
  7. package/build/api/routes.d.ts +6 -0
  8. package/build/api/routes.js +7 -0
  9. package/build/commands/agents/agent-dialog/find-agent-dialogs.command.d.ts +1 -0
  10. package/build/commands/agents/agent-dialog/get-agent-dialog-by-id.command.d.ts +1 -0
  11. package/build/commands/agents/agent-dialog/rename-agent-dialog.command.d.ts +1 -0
  12. package/build/commands/agents/agent-dialog/update-agent-dialog-status.command.d.ts +1 -0
  13. package/build/commands/agents/agent-lead/create-agent-lead.command.d.ts +1 -0
  14. package/build/commands/agents/agent-lead/find-agent-leads.command.d.ts +1 -0
  15. package/build/commands/agents/agent-lead/get-agent-lead-by-id.command.d.ts +1 -0
  16. package/build/commands/agents/agent-lead/update-agent-lead.command.d.ts +1 -0
  17. package/build/commands/agents/agent-lead-form/upsert-agent-lead-form.command.js +4 -1
  18. package/build/commands/agents/agents/activate-agent.command.d.ts +1 -0
  19. package/build/commands/agents/agents/create-agent.command.d.ts +2 -0
  20. package/build/commands/agents/agents/create-agent.command.js +1 -0
  21. package/build/commands/agents/agents/find-agents.command.d.ts +1 -0
  22. package/build/commands/agents/agents/get-agent-aggregate.command.d.ts +1 -0
  23. package/build/commands/agents/agents/get-agent-by-id.command.d.ts +1 -0
  24. package/build/commands/agents/agents/stop-agent.command.d.ts +1 -0
  25. package/build/commands/agents/agents/update-agent.command.d.ts +2 -0
  26. package/build/commands/agents/agents/update-agent.command.js +1 -0
  27. package/build/commands/ai-studio/canvas/save-canvas.command.d.ts +1 -1
  28. package/build/commands/auth/register-user.command.d.ts +1 -0
  29. package/build/commands/auth/register-user.command.js +2 -0
  30. package/build/commands/auth/vk-login.command.d.ts +1 -0
  31. package/build/commands/auth/vk-login.command.js +2 -0
  32. package/build/commands/auth/yandex-login.command.d.ts +1 -0
  33. package/build/commands/auth/yandex-login.command.js +2 -0
  34. package/build/commands/chat/find-chats.command.d.ts +3 -3
  35. package/build/commands/community/get-all-community-posts-by-criteria.command.d.ts +1 -1
  36. package/build/commands/community/get-my-community-posts-by-criteria.command.d.ts +1 -1
  37. package/build/commands/community/get-my-favorite-community-posts.command.d.ts +1 -1
  38. package/build/commands/folder/find-folder-by-uuid-with-chats.command.d.ts +1 -1
  39. package/build/commands/folder/find-folders-by-user.command.d.ts +1 -1
  40. package/build/commands/model-page/base/find-model-pages-admin.command.d.ts +2 -2
  41. package/build/commands/model-page/common.schemas.d.ts +1 -1
  42. package/build/commands/model-page/public/find-model-page-hub.command.d.ts +3 -3
  43. package/build/commands/partner-codes/administration.d.ts +650 -0
  44. package/build/commands/partner-codes/administration.js +138 -0
  45. package/build/commands/partner-codes/index.d.ts +50 -3
  46. package/build/commands/partner-codes/index.js +28 -3
  47. package/build/commands/payment/find-payments-by-criteria.command.d.ts +1 -1
  48. package/build/commands/payment/get-purchase-history.command.d.ts +90 -0
  49. package/build/commands/payment/get-purchase-history.command.js +22 -0
  50. package/build/commands/payment/index.d.ts +1 -0
  51. package/build/commands/payment/index.js +1 -0
  52. package/build/commands/product/buy-product.command.d.ts +1 -1
  53. package/build/commands/subscription/buy-subscription.command.d.ts +1 -1
  54. package/build/commands/subscription/downgrade-subscription.command.d.ts +28 -5
  55. package/build/commands/subscription/downgrade-subscription.command.js +32 -9
  56. package/build/commands/subscription/get-subscriptions-summary.command.d.ts +32 -0
  57. package/build/commands/subscription/get-subscriptions-summary.command.js +2 -0
  58. package/build/commands/subscription/index.d.ts +1 -0
  59. package/build/commands/subscription/index.js +1 -0
  60. package/build/commands/subscription/payment-incident-diagnostics.d.ts +445 -0
  61. package/build/commands/subscription/payment-incident-diagnostics.js +173 -0
  62. package/build/commands/telegram-profile/auth-with-telegram-web-app.command.d.ts +1 -1
  63. package/build/commands/tools/diagrams/find-diagrams-jobs.command.d.ts +1 -1
  64. package/build/commands/tools/html-page-builder/find-html-page-builder-sessions.command.d.ts +1 -1
  65. package/build/commands/tools/image-editor/find-image-editor-jobs.command.d.ts +1 -1
  66. package/build/commands/tools/image-generation/find-image-generation-jobs.command.d.ts +1 -1
  67. package/build/commands/tools/image-recognition/find-image-recognition-jobs.command.d.ts +1 -1
  68. package/build/commands/tools/interior-design/find-interior-design-generation-groups.command.d.ts +1 -1
  69. package/build/commands/tools/interior-design/find-interior-design-jobs.command.d.ts +1 -1
  70. package/build/commands/tools/marketplace-card/find-marketplace-card-jobs.command.d.ts +1 -1
  71. package/build/commands/tools/motion-control/index.d.ts +1 -1
  72. package/build/commands/tools/music/find-music-jobs.command.d.ts +1 -1
  73. package/build/commands/tools/paraphrase/find-paraphrase-jobs.command.d.ts +1 -1
  74. package/build/commands/tools/photo-session/find-photo-session-jobs.command.d.ts +1 -1
  75. package/build/commands/tools/presentation/find-presentations.command.d.ts +1 -1
  76. package/build/commands/tools/solving-edu-task/find-solving-edu-task-jobs.command.d.ts +1 -1
  77. package/build/commands/tools/sound-generation/find-sound-generation-jobs.command.d.ts +1 -1
  78. package/build/commands/tools/spell-corrector/find-spell-corrector-jobs.command.d.ts +1 -1
  79. package/build/commands/tools/stt/find-stt-jobs.command.d.ts +1 -1
  80. package/build/commands/tools/tool-workspace/find-tool-workspaces.command.d.ts +1 -1
  81. package/build/commands/tools/tts/find-tts-jobs.command.d.ts +1 -1
  82. package/build/commands/tools/video/find-video-jobs.command.d.ts +1 -1
  83. package/build/commands/tools/video-editor/find-video-editor-jobs.command.d.ts +1 -1
  84. package/build/commands/tools/writer/find-writer-documents.command.d.ts +1 -1
  85. package/build/commands/user/find-users-by-criteria.command.d.ts +1 -1
  86. package/build/commands/user/get-me.command.d.ts +3 -0
  87. package/build/commands/user/get-me.command.js +1 -0
  88. package/build/helpers/query-boolean.schema.d.ts +1 -1
  89. package/build/models/agents/agent-aggregate.schema.d.ts +1 -0
  90. package/build/models/agents/agent-dialog-lead.schema.d.ts +1 -0
  91. package/build/models/agents/agent-dialog-lead.schema.js +1 -0
  92. package/build/models/agents/agent-lead-find-result.schema.d.ts +1 -0
  93. package/build/models/agents/agent-lead-form-field.schema.js +8 -3
  94. package/build/models/agents/agent-lead.schema.d.ts +1 -0
  95. package/build/models/agents/agent-lead.schema.js +1 -0
  96. package/build/models/agents/agent.schema.d.ts +1 -0
  97. package/build/models/agents/agent.schema.js +1 -0
  98. package/build/models/agents/dialog-find-result.schema.d.ts +1 -0
  99. package/build/models/agents/dialog-with-messages.schema.d.ts +1 -0
  100. package/build/models/agents/dialog.schema.d.ts +1 -0
  101. package/build/models/index.d.ts +1 -0
  102. package/build/models/index.js +1 -0
  103. package/build/models/partner-codes/index.d.ts +4 -0
  104. package/build/models/partner-codes/index.js +4 -0
  105. package/build/models/partner-codes/partner-administration.schema.d.ts +183 -0
  106. package/build/models/partner-codes/partner-administration.schema.js +72 -0
  107. package/build/models/partner-codes/partner-cabinet-context.schema.d.ts +24 -0
  108. package/build/models/partner-codes/partner-cabinet-context.schema.js +8 -0
  109. package/build/models/partner-codes/partner-cabinet.schema.d.ts +362 -0
  110. package/build/models/partner-codes/partner-cabinet.schema.js +84 -0
  111. package/build/models/partner-codes/partner-codes.schema.d.ts +78 -2
  112. package/build/models/partner-codes/partner-codes.schema.js +73 -5
  113. package/build/models/partner-codes/partner-leak-create.schema.d.ts +6 -0
  114. package/build/models/partner-codes/partner-leak-create.schema.js +8 -0
  115. package/build/models/partner-registration-context.schema.d.ts +3 -0
  116. package/build/models/partner-registration-context.schema.js +6 -0
  117. package/build/models/purchase-history.schema.d.ts +112 -0
  118. package/build/models/purchase-history.schema.js +38 -0
  119. package/build/models/tools/diagrams/diagrams-job.schema.d.ts +2 -2
  120. package/package.json +3 -3
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RevokeAdminPartnerCodeCommand = exports.RevokeAdminPartnerBatchCommand = exports.SearchAdminPartnerCodeCommand = exports.UpdatePartnerOfferCommand = exports.CreatePartnerOfferCommand = exports.RemovePartnerMembershipCommand = exports.UpdatePartnerMembershipRoleCommand = exports.SetPartnerMembershipCommand = exports.EnablePartnerCompanyCommand = exports.DisablePartnerCompanyCommand = exports.UpdatePartnerCompanyCommand = exports.CreatePartnerCompanyCommand = exports.ListAdminPartnerLeaksCommand = exports.ListAdminPartnerExportsCommand = exports.ListAdminPartnerCodesCommand = exports.GetAdminPartnerBatchCommand = exports.ListAdminPartnerBatchesCommand = exports.ListAdminPartnerOffersCommand = exports.ListAdminPartnerMembershipsCommand = exports.ListAdminPartnerCatalogCommand = exports.ListAdminPartnerCompaniesCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const partner_codes_1 = require("../../models/partner-codes");
6
+ var ListAdminPartnerCompaniesCommand;
7
+ (function (ListAdminPartnerCompaniesCommand) {
8
+ ListAdminPartnerCompaniesCommand.RequestSchema = zod_1.z.object({}).strict();
9
+ ListAdminPartnerCompaniesCommand.ResponseSchema = zod_1.z.object({ data: zod_1.z.array(partner_codes_1.PartnerCompanySchema) }).strict();
10
+ })(ListAdminPartnerCompaniesCommand || (exports.ListAdminPartnerCompaniesCommand = ListAdminPartnerCompaniesCommand = {}));
11
+ var ListAdminPartnerCatalogCommand;
12
+ (function (ListAdminPartnerCatalogCommand) {
13
+ ListAdminPartnerCatalogCommand.RequestSchema = zod_1.z.object({}).strict();
14
+ ListAdminPartnerCatalogCommand.ResponseSchema = zod_1.z.object({ data: zod_1.z.array(partner_codes_1.PartnerCatalogProductSchema) }).strict();
15
+ })(ListAdminPartnerCatalogCommand || (exports.ListAdminPartnerCatalogCommand = ListAdminPartnerCatalogCommand = {}));
16
+ var ListAdminPartnerMembershipsCommand;
17
+ (function (ListAdminPartnerMembershipsCommand) {
18
+ ListAdminPartnerMembershipsCommand.RequestSchema = zod_1.z.object({}).strict();
19
+ ListAdminPartnerMembershipsCommand.ResponseSchema = zod_1.z
20
+ .object({ data: zod_1.z.array(partner_codes_1.PartnerAdminMembershipSchema) })
21
+ .strict();
22
+ })(ListAdminPartnerMembershipsCommand || (exports.ListAdminPartnerMembershipsCommand = ListAdminPartnerMembershipsCommand = {}));
23
+ var ListAdminPartnerOffersCommand;
24
+ (function (ListAdminPartnerOffersCommand) {
25
+ ListAdminPartnerOffersCommand.RequestSchema = zod_1.z.object({}).strict();
26
+ ListAdminPartnerOffersCommand.ResponseSchema = zod_1.z.object({ data: zod_1.z.array(partner_codes_1.PartnerOfferSchema) }).strict();
27
+ })(ListAdminPartnerOffersCommand || (exports.ListAdminPartnerOffersCommand = ListAdminPartnerOffersCommand = {}));
28
+ var ListAdminPartnerBatchesCommand;
29
+ (function (ListAdminPartnerBatchesCommand) {
30
+ ListAdminPartnerBatchesCommand.RequestSchema = partner_codes_1.PartnerBatchListQuerySchema;
31
+ ListAdminPartnerBatchesCommand.ResponseSchema = zod_1.z
32
+ .object({
33
+ data: partner_codes_1.PartnerPageQuerySchema.extend({
34
+ count: zod_1.z.number().int().nonnegative(),
35
+ items: zod_1.z.array(partner_codes_1.PartnerBatchSchema),
36
+ }),
37
+ })
38
+ .strict();
39
+ })(ListAdminPartnerBatchesCommand || (exports.ListAdminPartnerBatchesCommand = ListAdminPartnerBatchesCommand = {}));
40
+ var GetAdminPartnerBatchCommand;
41
+ (function (GetAdminPartnerBatchCommand) {
42
+ GetAdminPartnerBatchCommand.RequestSchema = zod_1.z.object({}).strict();
43
+ GetAdminPartnerBatchCommand.ResponseSchema = zod_1.z.object({ data: partner_codes_1.PartnerBatchSchema }).strict();
44
+ })(GetAdminPartnerBatchCommand || (exports.GetAdminPartnerBatchCommand = GetAdminPartnerBatchCommand = {}));
45
+ var ListAdminPartnerCodesCommand;
46
+ (function (ListAdminPartnerCodesCommand) {
47
+ ListAdminPartnerCodesCommand.RequestSchema = partner_codes_1.PartnerCodeListQuerySchema;
48
+ ListAdminPartnerCodesCommand.ResponseSchema = zod_1.z
49
+ .object({
50
+ data: partner_codes_1.PartnerPageQuerySchema.extend({
51
+ count: zod_1.z.number().int().nonnegative(),
52
+ items: zod_1.z.array(partner_codes_1.PartnerCodeSchema),
53
+ }),
54
+ })
55
+ .strict();
56
+ })(ListAdminPartnerCodesCommand || (exports.ListAdminPartnerCodesCommand = ListAdminPartnerCodesCommand = {}));
57
+ var ListAdminPartnerExportsCommand;
58
+ (function (ListAdminPartnerExportsCommand) {
59
+ ListAdminPartnerExportsCommand.RequestSchema = zod_1.z.object({}).strict();
60
+ ListAdminPartnerExportsCommand.ResponseSchema = zod_1.z.object({ data: zod_1.z.array(partner_codes_1.PartnerExportAuditSchema) }).strict();
61
+ })(ListAdminPartnerExportsCommand || (exports.ListAdminPartnerExportsCommand = ListAdminPartnerExportsCommand = {}));
62
+ // Read boundary only: persistence/creation/delivery belong to the partner audience owner.
63
+ var ListAdminPartnerLeaksCommand;
64
+ (function (ListAdminPartnerLeaksCommand) {
65
+ ListAdminPartnerLeaksCommand.RequestSchema = partner_codes_1.PartnerPageQuerySchema.extend({ partnerId: zod_1.z.uuid() }).strict();
66
+ ListAdminPartnerLeaksCommand.ResponseSchema = zod_1.z
67
+ .object({
68
+ data: partner_codes_1.PartnerPageQuerySchema.extend({
69
+ count: zod_1.z.number().int().nonnegative(),
70
+ items: zod_1.z.array(partner_codes_1.PartnerLeakRequestSchema),
71
+ }).strict(),
72
+ })
73
+ .strict();
74
+ })(ListAdminPartnerLeaksCommand || (exports.ListAdminPartnerLeaksCommand = ListAdminPartnerLeaksCommand = {}));
75
+ var CreatePartnerCompanyCommand;
76
+ (function (CreatePartnerCompanyCommand) {
77
+ CreatePartnerCompanyCommand.RequestSchema = partner_codes_1.PartnerCompanyCreateSchema;
78
+ CreatePartnerCompanyCommand.ResponseSchema = zod_1.z.object({ data: partner_codes_1.PartnerCompanySchema }).strict();
79
+ })(CreatePartnerCompanyCommand || (exports.CreatePartnerCompanyCommand = CreatePartnerCompanyCommand = {}));
80
+ var UpdatePartnerCompanyCommand;
81
+ (function (UpdatePartnerCompanyCommand) {
82
+ UpdatePartnerCompanyCommand.RequestSchema = partner_codes_1.PartnerCompanyUpdateSchema;
83
+ UpdatePartnerCompanyCommand.ResponseSchema = CreatePartnerCompanyCommand.ResponseSchema;
84
+ })(UpdatePartnerCompanyCommand || (exports.UpdatePartnerCompanyCommand = UpdatePartnerCompanyCommand = {}));
85
+ var DisablePartnerCompanyCommand;
86
+ (function (DisablePartnerCompanyCommand) {
87
+ DisablePartnerCompanyCommand.RequestSchema = zod_1.z.object({}).strict();
88
+ DisablePartnerCompanyCommand.ResponseSchema = CreatePartnerCompanyCommand.ResponseSchema;
89
+ })(DisablePartnerCompanyCommand || (exports.DisablePartnerCompanyCommand = DisablePartnerCompanyCommand = {}));
90
+ var EnablePartnerCompanyCommand;
91
+ (function (EnablePartnerCompanyCommand) {
92
+ EnablePartnerCompanyCommand.RequestSchema = zod_1.z.object({}).strict();
93
+ EnablePartnerCompanyCommand.ResponseSchema = CreatePartnerCompanyCommand.ResponseSchema;
94
+ })(EnablePartnerCompanyCommand || (exports.EnablePartnerCompanyCommand = EnablePartnerCompanyCommand = {}));
95
+ var SetPartnerMembershipCommand;
96
+ (function (SetPartnerMembershipCommand) {
97
+ SetPartnerMembershipCommand.RequestSchema = partner_codes_1.PartnerMembershipWriteSchema;
98
+ SetPartnerMembershipCommand.ResponseSchema = zod_1.z.object({ data: partner_codes_1.PartnerAdminMembershipSchema }).strict();
99
+ })(SetPartnerMembershipCommand || (exports.SetPartnerMembershipCommand = SetPartnerMembershipCommand = {}));
100
+ var UpdatePartnerMembershipRoleCommand;
101
+ (function (UpdatePartnerMembershipRoleCommand) {
102
+ UpdatePartnerMembershipRoleCommand.RequestSchema = partner_codes_1.PartnerMembershipRoleUpdateSchema;
103
+ UpdatePartnerMembershipRoleCommand.ResponseSchema = SetPartnerMembershipCommand.ResponseSchema;
104
+ })(UpdatePartnerMembershipRoleCommand || (exports.UpdatePartnerMembershipRoleCommand = UpdatePartnerMembershipRoleCommand = {}));
105
+ var RemovePartnerMembershipCommand;
106
+ (function (RemovePartnerMembershipCommand) {
107
+ RemovePartnerMembershipCommand.RequestSchema = zod_1.z.object({}).strict();
108
+ RemovePartnerMembershipCommand.ResponseSchema = zod_1.z
109
+ .object({ data: zod_1.z.object({ removed: zod_1.z.boolean() }).strict() })
110
+ .strict();
111
+ })(RemovePartnerMembershipCommand || (exports.RemovePartnerMembershipCommand = RemovePartnerMembershipCommand = {}));
112
+ var CreatePartnerOfferCommand;
113
+ (function (CreatePartnerOfferCommand) {
114
+ CreatePartnerOfferCommand.RequestSchema = partner_codes_1.PartnerOfferCreateSchema;
115
+ CreatePartnerOfferCommand.ResponseSchema = zod_1.z.object({ data: partner_codes_1.PartnerOfferSchema }).strict();
116
+ })(CreatePartnerOfferCommand || (exports.CreatePartnerOfferCommand = CreatePartnerOfferCommand = {}));
117
+ var UpdatePartnerOfferCommand;
118
+ (function (UpdatePartnerOfferCommand) {
119
+ UpdatePartnerOfferCommand.RequestSchema = partner_codes_1.PartnerOfferSettingsSchema;
120
+ UpdatePartnerOfferCommand.ResponseSchema = CreatePartnerOfferCommand.ResponseSchema;
121
+ })(UpdatePartnerOfferCommand || (exports.UpdatePartnerOfferCommand = UpdatePartnerOfferCommand = {}));
122
+ var SearchAdminPartnerCodeCommand;
123
+ (function (SearchAdminPartnerCodeCommand) {
124
+ SearchAdminPartnerCodeCommand.RequestSchema = partner_codes_1.PartnerAdminCodeSearchSchema;
125
+ SearchAdminPartnerCodeCommand.ResponseSchema = zod_1.z
126
+ .object({ data: partner_codes_1.PartnerAdminCodeSearchResultSchema.nullable() })
127
+ .strict();
128
+ })(SearchAdminPartnerCodeCommand || (exports.SearchAdminPartnerCodeCommand = SearchAdminPartnerCodeCommand = {}));
129
+ var RevokeAdminPartnerBatchCommand;
130
+ (function (RevokeAdminPartnerBatchCommand) {
131
+ RevokeAdminPartnerBatchCommand.RequestSchema = zod_1.z.object({}).strict();
132
+ RevokeAdminPartnerBatchCommand.ResponseSchema = zod_1.z.object({ data: partner_codes_1.PartnerBatchSchema }).strict();
133
+ })(RevokeAdminPartnerBatchCommand || (exports.RevokeAdminPartnerBatchCommand = RevokeAdminPartnerBatchCommand = {}));
134
+ var RevokeAdminPartnerCodeCommand;
135
+ (function (RevokeAdminPartnerCodeCommand) {
136
+ RevokeAdminPartnerCodeCommand.RequestSchema = zod_1.z.object({}).strict();
137
+ RevokeAdminPartnerCodeCommand.ResponseSchema = zod_1.z.object({ data: partner_codes_1.PartnerCodeSchema }).strict();
138
+ })(RevokeAdminPartnerCodeCommand || (exports.RevokeAdminPartnerCodeCommand = RevokeAdminPartnerCodeCommand = {}));
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export * from './administration';
2
3
  export declare namespace IssuePartnerBatchCommand {
3
4
  const RequestSchema: z.ZodObject<{
4
5
  offerId: z.ZodUUID;
@@ -17,6 +18,7 @@ export declare namespace IssuePartnerBatchCommand {
17
18
  }, z.core.$strict>, z.ZodObject<{
18
19
  kind: z.ZodLiteral<"stars">;
19
20
  title: z.ZodString;
21
+ productId: z.ZodUUID;
20
22
  starsAmount: z.ZodString;
21
23
  }, z.core.$strict>], "kind">;
22
24
  quantity: z.ZodNumber;
@@ -28,6 +30,9 @@ export declare namespace IssuePartnerBatchCommand {
28
30
  expiresAt: z.ZodISODateTime;
29
31
  createdAt: z.ZodISODateTime;
30
32
  createdByUserId: z.ZodNullable<z.ZodUUID>;
33
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
34
+ name: z.ZodNullable<z.ZodString>;
35
+ }, z.core.$strict>>>;
31
36
  exportCount: z.ZodNumber;
32
37
  lastExportedAt: z.ZodNullable<z.ZodISODateTime>;
33
38
  activatedCount: z.ZodNumber;
@@ -53,8 +58,10 @@ export declare namespace CheckPartnerCodeCommand {
53
58
  }, z.core.$strict>, z.ZodObject<{
54
59
  kind: z.ZodLiteral<"stars">;
55
60
  title: z.ZodString;
61
+ productId: z.ZodUUID;
56
62
  starsAmount: z.ZodString;
57
63
  }, z.core.$strict>], "kind">;
64
+ starsPerMonth: z.ZodOptional<z.ZodNumber>;
58
65
  eligibility: z.ZodDiscriminatedUnion<[z.ZodObject<{
59
66
  state: z.ZodLiteral<"guest">;
60
67
  }, z.core.$strict>, z.ZodObject<{
@@ -68,6 +75,7 @@ export declare namespace CheckPartnerCodeCommand {
68
75
  }, z.core.$strict>, z.ZodObject<{
69
76
  kind: z.ZodLiteral<"stars">;
70
77
  title: z.ZodString;
78
+ productId: z.ZodUUID;
71
79
  starsAmount: z.ZodString;
72
80
  }, z.core.$strict>], "kind">;
73
81
  state: z.ZodEnum<{
@@ -89,6 +97,7 @@ export declare namespace CheckPartnerCodeCommand {
89
97
  }, z.core.$strict>, z.ZodObject<{
90
98
  kind: z.ZodLiteral<"stars">;
91
99
  title: z.ZodString;
100
+ productId: z.ZodUUID;
92
101
  starsAmount: z.ZodString;
93
102
  }, z.core.$strict>], "kind">;
94
103
  state: z.ZodEnum<{
@@ -99,6 +108,7 @@ export declare namespace CheckPartnerCodeCommand {
99
108
  endsAt: z.ZodISODateTime;
100
109
  }, z.core.$strict>;
101
110
  }, z.core.$strict>], "state">;
111
+ partnerRegistrationContext: z.ZodOptional<z.ZodString>;
102
112
  }, z.core.$strict>, z.ZodObject<{
103
113
  validity: z.ZodEnum<{
104
114
  disabled: "disabled";
@@ -111,8 +121,18 @@ export declare namespace CheckPartnerCodeCommand {
111
121
  retryAfter: z.ZodOptional<z.ZodNumber>;
112
122
  }, z.core.$strict>], "validity">;
113
123
  }, z.core.$strict>;
124
+ const ProtectionErrorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
125
+ statusCode: z.ZodLiteral<429>;
126
+ reason: z.ZodLiteral<"rate_limited">;
127
+ retryAfter: z.ZodNumber;
128
+ }, z.core.$strict>, z.ZodObject<{
129
+ statusCode: z.ZodLiteral<403>;
130
+ reason: z.ZodLiteral<"captcha_required">;
131
+ captchaRequired: z.ZodLiteral<true>;
132
+ }, z.core.$strict>], "reason">;
114
133
  type Request = z.infer<typeof RequestSchema>;
115
134
  type Response = z.infer<typeof ResponseSchema>;
135
+ type ProtectionError = z.infer<typeof ProtectionErrorSchema>;
116
136
  }
117
137
  export declare namespace ActivatePartnerCodeCommand {
118
138
  const RequestSchema: z.ZodObject<{
@@ -138,6 +158,7 @@ export declare namespace ActivatePartnerCodeCommand {
138
158
  }, z.core.$strict>, z.ZodObject<{
139
159
  kind: z.ZodLiteral<"stars">;
140
160
  title: z.ZodString;
161
+ productId: z.ZodUUID;
141
162
  starsAmount: z.ZodString;
142
163
  }, z.core.$strict>], "kind">;
143
164
  state: z.ZodEnum<{
@@ -148,6 +169,7 @@ export declare namespace ActivatePartnerCodeCommand {
148
169
  endsAt: z.ZodISODateTime;
149
170
  }, z.core.$strict>;
150
171
  idempotent: z.ZodBoolean;
172
+ starsPerMonth: z.ZodOptional<z.ZodNumber>;
151
173
  }, z.core.$strict>, z.ZodObject<{
152
174
  result: z.ZodLiteral<"error">;
153
175
  reason: z.ZodEnum<{
@@ -216,7 +238,7 @@ export declare namespace ListPartnerInvitesCommand {
216
238
  pending: "pending";
217
239
  revoked: "revoked";
218
240
  }>;
219
- expiresAt: z.ZodISODateTime;
241
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
220
242
  acceptedAt: z.ZodNullable<z.ZodISODateTime>;
221
243
  revokedAt: z.ZodNullable<z.ZodISODateTime>;
222
244
  createdAt: z.ZodISODateTime;
@@ -251,7 +273,7 @@ export declare namespace SendPartnerInviteCommand {
251
273
  pending: "pending";
252
274
  revoked: "revoked";
253
275
  }>;
254
- expiresAt: z.ZodISODateTime;
276
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
255
277
  acceptedAt: z.ZodNullable<z.ZodISODateTime>;
256
278
  revokedAt: z.ZodNullable<z.ZodISODateTime>;
257
279
  createdAt: z.ZodISODateTime;
@@ -301,7 +323,7 @@ export declare namespace RevokePartnerInviteCommand {
301
323
  pending: "pending";
302
324
  revoked: "revoked";
303
325
  }>;
304
- expiresAt: z.ZodISODateTime;
326
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
305
327
  acceptedAt: z.ZodNullable<z.ZodISODateTime>;
306
328
  revokedAt: z.ZodNullable<z.ZodISODateTime>;
307
329
  createdAt: z.ZodISODateTime;
@@ -313,6 +335,7 @@ export declare namespace RevokePartnerInviteCommand {
313
335
  export declare namespace GetPartnerReportCommand {
314
336
  const RequestSchema: z.ZodObject<{
315
337
  month: z.ZodString;
338
+ sequence: z.ZodOptional<z.ZodNumber>;
316
339
  }, z.core.$strict>;
317
340
  const ResponseSchema: z.ZodObject<{
318
341
  data: z.ZodObject<{
@@ -336,6 +359,7 @@ export declare namespace GetPartnerReportCommand {
336
359
  }, z.core.$strict>, z.ZodObject<{
337
360
  kind: z.ZodLiteral<"stars">;
338
361
  title: z.ZodString;
362
+ productId: z.ZodUUID;
339
363
  starsAmount: z.ZodString;
340
364
  }, z.core.$strict>], "kind">;
341
365
  retailPrice: z.ZodString;
@@ -363,6 +387,7 @@ export declare namespace GetPartnerReportCommand {
363
387
  }, z.core.$strict>, z.ZodObject<{
364
388
  kind: z.ZodLiteral<"stars">;
365
389
  title: z.ZodString;
390
+ productId: z.ZodUUID;
366
391
  starsAmount: z.ZodString;
367
392
  }, z.core.$strict>], "kind">;
368
393
  activatedAt: z.ZodISODateTime;
@@ -385,10 +410,29 @@ export declare namespace GetPartnerReportCommand {
385
410
  type Request = z.infer<typeof RequestSchema>;
386
411
  type Response = z.infer<typeof ResponseSchema>;
387
412
  }
413
+ export declare namespace ListPartnerReportPeriodsCommand {
414
+ const RequestSchema: z.ZodObject<{
415
+ month: z.ZodString;
416
+ }, z.core.$strict>;
417
+ const ResponseSchema: z.ZodObject<{
418
+ data: z.ZodArray<z.ZodObject<{
419
+ sequence: z.ZodNumber;
420
+ status: z.ZodEnum<{
421
+ closed: "closed";
422
+ open: "open";
423
+ }>;
424
+ openedAt: z.ZodNullable<z.ZodISODateTime>;
425
+ closedAt: z.ZodNullable<z.ZodISODateTime>;
426
+ }, z.core.$strict>>;
427
+ }, z.core.$strict>;
428
+ type Request = z.infer<typeof RequestSchema>;
429
+ type Response = z.infer<typeof ResponseSchema>;
430
+ }
388
431
  export declare namespace ClosePartnerPeriodCommand {
389
432
  const RequestSchema: z.ZodObject<{
390
433
  partnerId: z.ZodUUID;
391
434
  month: z.ZodString;
435
+ sequence: z.ZodOptional<z.ZodNumber>;
392
436
  }, z.core.$strict>;
393
437
  const ResponseSchema: z.ZodObject<{
394
438
  data: z.ZodObject<{
@@ -415,6 +459,7 @@ export declare namespace ClosePartnerPeriodCommand {
415
459
  }, z.core.$strict>, z.ZodObject<{
416
460
  kind: z.ZodLiteral<"stars">;
417
461
  title: z.ZodString;
462
+ productId: z.ZodUUID;
418
463
  starsAmount: z.ZodString;
419
464
  }, z.core.$strict>], "kind">;
420
465
  retailPrice: z.ZodString;
@@ -442,6 +487,7 @@ export declare namespace ClosePartnerPeriodCommand {
442
487
  }, z.core.$strict>, z.ZodObject<{
443
488
  kind: z.ZodLiteral<"stars">;
444
489
  title: z.ZodString;
490
+ productId: z.ZodUUID;
445
491
  starsAmount: z.ZodString;
446
492
  }, z.core.$strict>], "kind">;
447
493
  activatedAt: z.ZodISODateTime;
@@ -469,6 +515,7 @@ export declare namespace CreatePartnerLeakRequestCommand {
469
515
  const RequestSchema: z.ZodObject<{
470
516
  batchId: z.ZodUUID;
471
517
  comment: z.ZodString;
518
+ requestId: z.ZodOptional<z.ZodUUID>;
472
519
  }, z.core.$strict>;
473
520
  const ResponseSchema: z.ZodObject<{
474
521
  data: z.ZodObject<{
@@ -1,7 +1,22 @@
1
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
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreatePartnerLeakRequestCommand = exports.ClosePartnerPeriodCommand = exports.GetPartnerReportCommand = exports.RevokePartnerInviteCommand = exports.AcceptPartnerInviteCommand = exports.SendPartnerInviteCommand = exports.ListPartnerInvitesCommand = exports.VerifyPartnerCodeExportCommand = exports.RequestPartnerCodeExportCommand = exports.ActivatePartnerCodeCommand = exports.CheckPartnerCodeCommand = exports.IssuePartnerBatchCommand = void 0;
17
+ exports.CreatePartnerLeakRequestCommand = exports.ClosePartnerPeriodCommand = exports.ListPartnerReportPeriodsCommand = exports.GetPartnerReportCommand = exports.RevokePartnerInviteCommand = exports.AcceptPartnerInviteCommand = exports.SendPartnerInviteCommand = exports.ListPartnerInvitesCommand = exports.VerifyPartnerCodeExportCommand = exports.RequestPartnerCodeExportCommand = exports.ActivatePartnerCodeCommand = exports.CheckPartnerCodeCommand = exports.IssuePartnerBatchCommand = void 0;
4
18
  const zod_1 = require("zod");
19
+ __exportStar(require("./administration"), exports);
5
20
  const partner_codes_1 = require("../../models/partner-codes");
6
21
  var IssuePartnerBatchCommand;
7
22
  (function (IssuePartnerBatchCommand) {
@@ -12,6 +27,7 @@ var CheckPartnerCodeCommand;
12
27
  (function (CheckPartnerCodeCommand) {
13
28
  CheckPartnerCodeCommand.RequestSchema = partner_codes_1.PartnerCodeInputSchema;
14
29
  CheckPartnerCodeCommand.ResponseSchema = zod_1.z.object({ data: partner_codes_1.PartnerCodeCheckSchema }).strict();
30
+ CheckPartnerCodeCommand.ProtectionErrorSchema = partner_codes_1.PartnerCodeCheckProtectionErrorSchema;
15
31
  })(CheckPartnerCodeCommand || (exports.CheckPartnerCodeCommand = CheckPartnerCodeCommand = {}));
16
32
  var ActivatePartnerCodeCommand;
17
33
  (function (ActivatePartnerCodeCommand) {
@@ -56,13 +72,22 @@ var RevokePartnerInviteCommand;
56
72
  })(RevokePartnerInviteCommand || (exports.RevokePartnerInviteCommand = RevokePartnerInviteCommand = {}));
57
73
  var GetPartnerReportCommand;
58
74
  (function (GetPartnerReportCommand) {
59
- GetPartnerReportCommand.RequestSchema = zod_1.z.object({ month: partner_codes_1.PartnerMonthSchema }).strict();
75
+ GetPartnerReportCommand.RequestSchema = partner_codes_1.PartnerReportQuerySchema;
60
76
  GetPartnerReportCommand.ResponseSchema = zod_1.z.object({ data: partner_codes_1.PartnerReportSchema }).strict();
61
77
  })(GetPartnerReportCommand || (exports.GetPartnerReportCommand = GetPartnerReportCommand = {}));
78
+ var ListPartnerReportPeriodsCommand;
79
+ (function (ListPartnerReportPeriodsCommand) {
80
+ ListPartnerReportPeriodsCommand.RequestSchema = zod_1.z.object({ month: partner_codes_1.PartnerMonthSchema }).strict();
81
+ ListPartnerReportPeriodsCommand.ResponseSchema = partner_codes_1.PartnerReportPeriodsResponseSchema;
82
+ })(ListPartnerReportPeriodsCommand || (exports.ListPartnerReportPeriodsCommand = ListPartnerReportPeriodsCommand = {}));
62
83
  var ClosePartnerPeriodCommand;
63
84
  (function (ClosePartnerPeriodCommand) {
64
85
  ClosePartnerPeriodCommand.RequestSchema = zod_1.z
65
- .object({ partnerId: zod_1.z.uuid(), month: partner_codes_1.PartnerMonthSchema })
86
+ .object({
87
+ partnerId: zod_1.z.uuid(),
88
+ month: partner_codes_1.PartnerMonthSchema,
89
+ sequence: partner_codes_1.PartnerPeriodSequenceSchema.optional(),
90
+ })
66
91
  .strict();
67
92
  ClosePartnerPeriodCommand.ResponseSchema = zod_1.z.object({ data: partner_codes_1.PartnerCloseResultSchema }).strict();
68
93
  })(ClosePartnerPeriodCommand || (exports.ClosePartnerPeriodCommand = ClosePartnerPeriodCommand = {}));
@@ -25,7 +25,7 @@ export declare namespace FindPaymentsByCriteriaCommand {
25
25
  sortOrder: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof SORT_ORDER>>>;
26
26
  limit: z.ZodCoercedNumber<unknown>;
27
27
  offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
28
- }, z.core.$strip>>;
28
+ }, z.core.$strip>, unknown>;
29
29
  type Request = z.infer<typeof RequestSchema>;
30
30
  const ResponseSchema: z.ZodObject<{
31
31
  data: z.ZodArray<z.ZodObject<{
@@ -0,0 +1,90 @@
1
+ import { z } from 'zod';
2
+ export declare namespace GetPurchaseHistoryCommand {
3
+ const RequestQuerySchema: z.ZodObject<{
4
+ limit: z.ZodDefault<z.ZodNumber>;
5
+ offset: z.ZodDefault<z.ZodNumber>;
6
+ }, z.core.$strict>;
7
+ type RequestQuery = z.infer<typeof RequestQuerySchema>;
8
+ const ResponseSchema: z.ZodObject<{
9
+ data: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ kind: z.ZodLiteral<"payment">;
11
+ uuid: z.ZodUUID;
12
+ occurredAt: z.ZodISODateTime;
13
+ payment: z.ZodObject<{
14
+ uuid: z.ZodUUID;
15
+ status: z.ZodEnum<typeof import("../..").PAYMENT_STATUS>;
16
+ sum: z.ZodNumber;
17
+ description: z.ZodString;
18
+ type: z.ZodEnum<typeof import("../..").PAYMENT_HISTORY_ITEM_TYPE>;
19
+ createdAt: z.ZodISODateTime;
20
+ updatedAt: z.ZodISODateTime;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strict>, z.ZodObject<{
23
+ kind: z.ZodLiteral<"activation">;
24
+ uuid: z.ZodUUID;
25
+ occurredAt: z.ZodISODateTime;
26
+ grant: z.ZodObject<{
27
+ uuid: z.ZodUUID;
28
+ origin: z.ZodObject<{
29
+ type: z.ZodLiteral<"activation_code">;
30
+ codeId: z.ZodUUID;
31
+ serial: z.ZodString;
32
+ partnerId: z.ZodUUID;
33
+ }, z.core.$strict>;
34
+ product: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
+ kind: z.ZodLiteral<"subscription">;
36
+ title: z.ZodString;
37
+ subscriptionId: z.ZodUUID;
38
+ durationMonths: z.ZodNumber;
39
+ }, z.core.$strict>, z.ZodObject<{
40
+ kind: z.ZodLiteral<"stars">;
41
+ title: z.ZodString;
42
+ productId: z.ZodUUID;
43
+ starsAmount: z.ZodString;
44
+ }, z.core.$strict>], "kind">;
45
+ state: z.ZodEnum<{
46
+ active: "active";
47
+ queued: "queued";
48
+ }>;
49
+ startsAt: z.ZodISODateTime;
50
+ endsAt: z.ZodISODateTime;
51
+ }, z.core.$strict>;
52
+ entitlement: z.ZodNullable<z.ZodObject<{
53
+ uuid: z.ZodUUID;
54
+ origin: z.ZodObject<{
55
+ type: z.ZodLiteral<"activation_code">;
56
+ codeId: z.ZodUUID;
57
+ serial: z.ZodString;
58
+ partnerId: z.ZodUUID;
59
+ }, z.core.$strict>;
60
+ product: z.ZodDiscriminatedUnion<[z.ZodObject<{
61
+ kind: z.ZodLiteral<"subscription">;
62
+ title: z.ZodString;
63
+ subscriptionId: z.ZodUUID;
64
+ durationMonths: z.ZodNumber;
65
+ }, z.core.$strict>, z.ZodObject<{
66
+ kind: z.ZodLiteral<"stars">;
67
+ title: z.ZodString;
68
+ productId: z.ZodUUID;
69
+ starsAmount: z.ZodString;
70
+ }, z.core.$strict>], "kind">;
71
+ startsAt: z.ZodISODateTime;
72
+ endsAt: z.ZodISODateTime;
73
+ currentEntitlementId: z.ZodUUID;
74
+ state: z.ZodEnum<{
75
+ active: "active";
76
+ canceled: "canceled";
77
+ depleted: "depleted";
78
+ expired: "expired";
79
+ queued: "queued";
80
+ }>;
81
+ autoRenewal: z.ZodBoolean;
82
+ status: z.ZodUnion<readonly [z.ZodEnum<typeof import("../..").SUBSCRIPTION_STATUS>, z.ZodLiteral<"depleted">]>;
83
+ }, z.core.$strict>>;
84
+ }, z.core.$strict>], "kind">>;
85
+ total: z.ZodNumber;
86
+ limit: z.ZodNumber;
87
+ offset: z.ZodNumber;
88
+ }, z.core.$strict>;
89
+ type Response = z.infer<typeof ResponseSchema>;
90
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetPurchaseHistoryCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const purchase_history_schema_1 = require("../../models/purchase-history.schema");
6
+ var GetPurchaseHistoryCommand;
7
+ (function (GetPurchaseHistoryCommand) {
8
+ GetPurchaseHistoryCommand.RequestQuerySchema = zod_1.z
9
+ .object({
10
+ limit: zod_1.z.number().int().min(1).max(100).default(20),
11
+ offset: zod_1.z.number().int().min(0).max(1000000).default(0),
12
+ })
13
+ .strict();
14
+ GetPurchaseHistoryCommand.ResponseSchema = zod_1.z
15
+ .object({
16
+ data: zod_1.z.array(purchase_history_schema_1.PurchaseHistoryItemSchema),
17
+ total: zod_1.z.number().int().nonnegative(),
18
+ limit: zod_1.z.number().int().positive(),
19
+ offset: zod_1.z.number().int().nonnegative(),
20
+ })
21
+ .strict();
22
+ })(GetPurchaseHistoryCommand || (exports.GetPurchaseHistoryCommand = GetPurchaseHistoryCommand = {}));
@@ -1,5 +1,6 @@
1
1
  export * from './check.command';
2
2
  export * from './get-payment-history.command';
3
+ export * from './get-purchase-history.command';
3
4
  export * from './pay.command';
4
5
  export * from './receipt.command';
5
6
  export * from './recurrent.command';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./check.command"), exports);
18
18
  __exportStar(require("./get-payment-history.command"), exports);
19
+ __exportStar(require("./get-purchase-history.command"), exports);
19
20
  __exportStar(require("./pay.command"), exports);
20
21
  __exportStar(require("./receipt.command"), exports);
21
22
  __exportStar(require("./recurrent.command"), exports);
@@ -17,7 +17,7 @@ export declare namespace BuyProductCommand {
17
17
  partnerId: z.ZodOptional<z.ZodUUID>;
18
18
  promocode: z.ZodOptional<z.ZodString>;
19
19
  webmasterAlias: z.ZodOptional<z.ZodString>;
20
- webmasterReferralProvidedAt: z.ZodOptional<z.ZodPreprocess<z.ZodDate>>;
20
+ webmasterReferralProvidedAt: z.ZodOptional<z.ZodPreprocess<z.ZodDate, unknown>>;
21
21
  admitadUid: z.ZodOptional<z.ZodString>;
22
22
  admitadClickDate: z.ZodOptional<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
23
23
  marketingConsent: z.ZodDefault<z.ZodBoolean>;
@@ -18,7 +18,7 @@ export declare namespace BuySubscriptionCommand {
18
18
  webmasterAlias: z.ZodOptional<z.ZodString>;
19
19
  teamAccountPurchase: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
20
20
  teamAccountName: z.ZodOptional<z.ZodString>;
21
- webmasterReferralProvidedAt: z.ZodOptional<z.ZodPreprocess<z.ZodDate>>;
21
+ webmasterReferralProvidedAt: z.ZodOptional<z.ZodPreprocess<z.ZodDate, unknown>>;
22
22
  admitadUid: z.ZodOptional<z.ZodString>;
23
23
  admitadClickDate: z.ZodOptional<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>>;
24
24
  marketingConsent: z.ZodDefault<z.ZodBoolean>;
@@ -2,13 +2,36 @@ import { z } from 'zod';
2
2
  export declare namespace DowngradeSubscriptionCommand {
3
3
  const RequestSchema: z.ZodObject<{
4
4
  downgradeSubscriptionId: z.ZodUUID;
5
- }, z.core.$strip>;
5
+ requestId: z.ZodUUID;
6
+ }, z.core.$strict>;
6
7
  const RequestParamSchema: z.ZodObject<{
7
8
  uuid: z.ZodUUID;
8
- }, z.core.$strip>;
9
+ }, z.core.$strict>;
10
+ const StatusRequestParamSchema: z.ZodObject<{
11
+ operationId: z.ZodUUID;
12
+ }, z.core.$strict>;
13
+ const ProcessingConflictDetailsSchema: z.ZodObject<{
14
+ operationId: z.ZodUUID;
15
+ }, z.core.$strict>;
9
16
  type Request = z.infer<typeof RequestSchema>;
10
- const ResponseSchema: z.ZodObject<{
11
- isSuccess: z.ZodBoolean;
12
- }, z.core.$strip>;
17
+ const ResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
18
+ status: z.ZodLiteral<"processing">;
19
+ operationId: z.ZodUUID;
20
+ }, z.core.$strict>, z.ZodObject<{
21
+ status: z.ZodLiteral<"succeeded">;
22
+ operationId: z.ZodUUID;
23
+ subscriptionId: z.ZodUUID;
24
+ startsAt: z.ZodISODateTime;
25
+ }, z.core.$strict>, z.ZodObject<{
26
+ status: z.ZodLiteral<"failed">;
27
+ operationId: z.ZodUUID;
28
+ reason: z.ZodEnum<{
29
+ deadline_elapsed: "deadline_elapsed";
30
+ finalization_failed: "finalization_failed";
31
+ provider_rejected: "provider_rejected";
32
+ source_changed: "source_changed";
33
+ }>;
34
+ autoRenewalDisabled: z.ZodBoolean;
35
+ }, z.core.$strict>], "status">;
13
36
  type Response = z.infer<typeof ResponseSchema>;
14
37
  }
@@ -2,16 +2,39 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DowngradeSubscriptionCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const models_1 = require("../../models");
6
5
  var DowngradeSubscriptionCommand;
7
6
  (function (DowngradeSubscriptionCommand) {
8
- DowngradeSubscriptionCommand.RequestSchema = zod_1.z.object({
7
+ DowngradeSubscriptionCommand.RequestSchema = zod_1.z
8
+ .object({
9
9
  downgradeSubscriptionId: zod_1.z.uuid(),
10
- });
11
- DowngradeSubscriptionCommand.RequestParamSchema = models_1.UserToSubscriptionSchema.pick({
12
- uuid: true,
13
- });
14
- DowngradeSubscriptionCommand.ResponseSchema = zod_1.z.object({
15
- isSuccess: zod_1.z.boolean(),
16
- });
10
+ requestId: zod_1.z.uuid(),
11
+ })
12
+ .strict();
13
+ DowngradeSubscriptionCommand.RequestParamSchema = zod_1.z.object({ uuid: zod_1.z.uuid() }).strict();
14
+ DowngradeSubscriptionCommand.StatusRequestParamSchema = zod_1.z.object({ operationId: zod_1.z.uuid() }).strict();
15
+ DowngradeSubscriptionCommand.ProcessingConflictDetailsSchema = zod_1.z.object({ operationId: zod_1.z.uuid() }).strict();
16
+ DowngradeSubscriptionCommand.ResponseSchema = zod_1.z.discriminatedUnion('status', [
17
+ zod_1.z.object({ status: zod_1.z.literal('processing'), operationId: zod_1.z.uuid() }).strict(),
18
+ zod_1.z
19
+ .object({
20
+ status: zod_1.z.literal('succeeded'),
21
+ operationId: zod_1.z.uuid(),
22
+ subscriptionId: zod_1.z.uuid(),
23
+ startsAt: zod_1.z.iso.datetime(),
24
+ })
25
+ .strict(),
26
+ zod_1.z
27
+ .object({
28
+ status: zod_1.z.literal('failed'),
29
+ operationId: zod_1.z.uuid(),
30
+ reason: zod_1.z.enum([
31
+ 'source_changed',
32
+ 'provider_rejected',
33
+ 'deadline_elapsed',
34
+ 'finalization_failed',
35
+ ]),
36
+ autoRenewalDisabled: zod_1.z.boolean(),
37
+ })
38
+ .strict(),
39
+ ]);
17
40
  })(DowngradeSubscriptionCommand || (exports.DowngradeSubscriptionCommand = DowngradeSubscriptionCommand = {}));