@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
@@ -2017,6 +2017,38 @@ export declare namespace GetSubscriptionsSummaryCommand {
2017
2017
  renewalBonusPercent: z.ZodNumber;
2018
2018
  }, z.core.$strip>>;
2019
2019
  }, z.core.$strip>;
2020
+ activationCodeGrants: z.ZodArray<z.ZodObject<{
2021
+ uuid: z.ZodUUID;
2022
+ origin: z.ZodObject<{
2023
+ type: z.ZodLiteral<"activation_code">;
2024
+ codeId: z.ZodUUID;
2025
+ serial: z.ZodString;
2026
+ partnerId: z.ZodUUID;
2027
+ }, z.core.$strict>;
2028
+ product: z.ZodDiscriminatedUnion<[z.ZodObject<{
2029
+ kind: z.ZodLiteral<"subscription">;
2030
+ title: z.ZodString;
2031
+ subscriptionId: z.ZodUUID;
2032
+ durationMonths: z.ZodNumber;
2033
+ }, z.core.$strict>, z.ZodObject<{
2034
+ kind: z.ZodLiteral<"stars">;
2035
+ title: z.ZodString;
2036
+ productId: z.ZodUUID;
2037
+ starsAmount: z.ZodString;
2038
+ }, z.core.$strict>], "kind">;
2039
+ startsAt: z.ZodISODateTime;
2040
+ endsAt: z.ZodISODateTime;
2041
+ currentEntitlementId: z.ZodUUID;
2042
+ state: z.ZodEnum<{
2043
+ active: "active";
2044
+ canceled: "canceled";
2045
+ depleted: "depleted";
2046
+ expired: "expired";
2047
+ queued: "queued";
2048
+ }>;
2049
+ autoRenewal: z.ZodBoolean;
2050
+ status: z.ZodUnion<readonly [z.ZodEnum<typeof SUBSCRIPTION_STATUS>, z.ZodLiteral<"depleted">]>;
2051
+ }, z.core.$strict>>;
2020
2052
  }, z.core.$strip>;
2021
2053
  type Response = z.infer<typeof ResponseSchema>;
2022
2054
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetSubscriptionsSummaryCommand = exports.UserToProductSummarySchema = exports.SubscriptionSummarySchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const purchase_history_schema_1 = require("../../models/purchase-history.schema");
5
6
  const models_1 = require("../../models");
6
7
  const constants_1 = require("../../constants");
7
8
  const SubscriptionSummaryFieldsSchema = zod_1.z.object({
@@ -43,5 +44,6 @@ var GetSubscriptionsSummaryCommand;
43
44
  products: zod_1.z.array(exports.UserToProductSummarySchema),
44
45
  teamSubscription: models_1.TeamToSubscriptionWithSubscriptionSchema.nullable(),
45
46
  loyaltyStatus: models_1.UserLoyaltyStatusResponseSchema,
47
+ activationCodeGrants: zod_1.z.array(purchase_history_schema_1.CodeGrantedEntitlementSchema),
46
48
  });
47
49
  })(GetSubscriptionsSummaryCommand || (exports.GetSubscriptionsSummaryCommand = GetSubscriptionsSummaryCommand = {}));
@@ -12,3 +12,4 @@ export * from './update-subscription.command';
12
12
  export * from './upgrade-subscription.command';
13
13
  export * from './downgrade-subscription.command';
14
14
  export * from './refund-subscription.command';
15
+ export * from './payment-incident-diagnostics';
@@ -28,3 +28,4 @@ __exportStar(require("./update-subscription.command"), exports);
28
28
  __exportStar(require("./upgrade-subscription.command"), exports);
29
29
  __exportStar(require("./downgrade-subscription.command"), exports);
30
30
  __exportStar(require("./refund-subscription.command"), exports);
31
+ __exportStar(require("./payment-incident-diagnostics"), exports);
@@ -0,0 +1,445 @@
1
+ import { z } from 'zod';
2
+ export declare const PAYMENT_INCIDENT_ADMIN_CONTROLLER = "subscription/admin/payment-incidents";
3
+ export declare const PAYMENT_INCIDENT_ADMIN_ROUTES: {
4
+ readonly detail: (id: string) => string;
5
+ readonly providerCheck: (id: string) => string;
6
+ };
7
+ export declare const PaymentIncidentStageSchema: z.ZodEnum<{
8
+ cancelling_new: "cancelling_new";
9
+ cancelling_old: "cancelling_old";
10
+ creating_new: "creating_new";
11
+ failed: "failed";
12
+ finalizing: "finalizing";
13
+ manual_review: "manual_review";
14
+ prepared: "prepared";
15
+ reconciling: "reconciling";
16
+ succeeded: "succeeded";
17
+ }>;
18
+ export declare const PaymentIncidentReasonSchema: z.ZodEnum<{
19
+ compensation_after_start: "compensation_after_start";
20
+ multiple_exact_matches: "multiple_exact_matches";
21
+ no_exact_match: "no_exact_match";
22
+ }>;
23
+ export declare const PaymentIncidentPageSchema: z.ZodObject<{
24
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
25
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
26
+ }, z.core.$strict>;
27
+ export declare const PaymentIncidentListQuerySchema: z.ZodObject<{
28
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
29
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
30
+ operationId: z.ZodOptional<z.ZodUUID>;
31
+ userId: z.ZodOptional<z.ZodUUID>;
32
+ stage: z.ZodOptional<z.ZodEnum<{
33
+ cancelling_new: "cancelling_new";
34
+ cancelling_old: "cancelling_old";
35
+ creating_new: "creating_new";
36
+ failed: "failed";
37
+ finalizing: "finalizing";
38
+ manual_review: "manual_review";
39
+ prepared: "prepared";
40
+ reconciling: "reconciling";
41
+ succeeded: "succeeded";
42
+ }>>;
43
+ status: z.ZodOptional<z.ZodEnum<{
44
+ failed: "failed";
45
+ processing: "processing";
46
+ succeeded: "succeeded";
47
+ }>>;
48
+ minAttempts: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
49
+ createdFrom: z.ZodOptional<z.ZodISODateTime>;
50
+ createdTo: z.ZodOptional<z.ZodISODateTime>;
51
+ }, z.core.$strict>;
52
+ export declare const PaymentIncidentIdSchema: z.ZodObject<{
53
+ operationId: z.ZodUUID;
54
+ }, z.core.$strict>;
55
+ export declare const PaymentIncidentSummarySchema: z.ZodObject<{
56
+ uuid: z.ZodUUID;
57
+ userId: z.ZodUUID;
58
+ sourceId: z.ZodUUID;
59
+ targetId: z.ZodUUID;
60
+ orderId: z.ZodUUID;
61
+ status: z.ZodEnum<{
62
+ failed: "failed";
63
+ processing: "processing";
64
+ succeeded: "succeeded";
65
+ }>;
66
+ stage: z.ZodEnum<{
67
+ cancelling_new: "cancelling_new";
68
+ cancelling_old: "cancelling_old";
69
+ creating_new: "creating_new";
70
+ failed: "failed";
71
+ finalizing: "finalizing";
72
+ manual_review: "manual_review";
73
+ prepared: "prepared";
74
+ reconciling: "reconciling";
75
+ succeeded: "succeeded";
76
+ }>;
77
+ amount: z.ZodNullable<z.ZodNumber>;
78
+ currency: z.ZodNullable<z.ZodString>;
79
+ attempts: z.ZodNumber;
80
+ createdAt: z.ZodISODateTime;
81
+ updatedAt: z.ZodISODateTime;
82
+ nextAttemptAt: z.ZodISODateTime;
83
+ sourceEnd: z.ZodISODateTime;
84
+ blocked: z.ZodBoolean;
85
+ manualReviewReason: z.ZodNullable<z.ZodEnum<{
86
+ compensation_after_start: "compensation_after_start";
87
+ multiple_exact_matches: "multiple_exact_matches";
88
+ no_exact_match: "no_exact_match";
89
+ }>>;
90
+ manualReviewAt: z.ZodNullable<z.ZodISODateTime>;
91
+ manualReviewAlertedAt: z.ZodNullable<z.ZodISODateTime>;
92
+ retryAlertedAt: z.ZodNullable<z.ZodISODateTime>;
93
+ }, z.core.$strict>;
94
+ export declare const PaymentIncidentListResponseSchema: z.ZodObject<{
95
+ data: z.ZodObject<{
96
+ items: z.ZodArray<z.ZodObject<{
97
+ uuid: z.ZodUUID;
98
+ userId: z.ZodUUID;
99
+ sourceId: z.ZodUUID;
100
+ targetId: z.ZodUUID;
101
+ orderId: z.ZodUUID;
102
+ status: z.ZodEnum<{
103
+ failed: "failed";
104
+ processing: "processing";
105
+ succeeded: "succeeded";
106
+ }>;
107
+ stage: z.ZodEnum<{
108
+ cancelling_new: "cancelling_new";
109
+ cancelling_old: "cancelling_old";
110
+ creating_new: "creating_new";
111
+ failed: "failed";
112
+ finalizing: "finalizing";
113
+ manual_review: "manual_review";
114
+ prepared: "prepared";
115
+ reconciling: "reconciling";
116
+ succeeded: "succeeded";
117
+ }>;
118
+ amount: z.ZodNullable<z.ZodNumber>;
119
+ currency: z.ZodNullable<z.ZodString>;
120
+ attempts: z.ZodNumber;
121
+ createdAt: z.ZodISODateTime;
122
+ updatedAt: z.ZodISODateTime;
123
+ nextAttemptAt: z.ZodISODateTime;
124
+ sourceEnd: z.ZodISODateTime;
125
+ blocked: z.ZodBoolean;
126
+ manualReviewReason: z.ZodNullable<z.ZodEnum<{
127
+ compensation_after_start: "compensation_after_start";
128
+ multiple_exact_matches: "multiple_exact_matches";
129
+ no_exact_match: "no_exact_match";
130
+ }>>;
131
+ manualReviewAt: z.ZodNullable<z.ZodISODateTime>;
132
+ manualReviewAlertedAt: z.ZodNullable<z.ZodISODateTime>;
133
+ retryAlertedAt: z.ZodNullable<z.ZodISODateTime>;
134
+ }, z.core.$strict>>;
135
+ total: z.ZodNumber;
136
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
137
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
138
+ }, z.core.$strict>;
139
+ }, z.core.$strict>;
140
+ export declare const PaymentIncidentDetailsSchema: z.ZodObject<{
141
+ uuid: z.ZodUUID;
142
+ userId: z.ZodUUID;
143
+ sourceId: z.ZodUUID;
144
+ targetId: z.ZodUUID;
145
+ orderId: z.ZodUUID;
146
+ status: z.ZodEnum<{
147
+ failed: "failed";
148
+ processing: "processing";
149
+ succeeded: "succeeded";
150
+ }>;
151
+ stage: z.ZodEnum<{
152
+ cancelling_new: "cancelling_new";
153
+ cancelling_old: "cancelling_old";
154
+ creating_new: "creating_new";
155
+ failed: "failed";
156
+ finalizing: "finalizing";
157
+ manual_review: "manual_review";
158
+ prepared: "prepared";
159
+ reconciling: "reconciling";
160
+ succeeded: "succeeded";
161
+ }>;
162
+ amount: z.ZodNullable<z.ZodNumber>;
163
+ currency: z.ZodNullable<z.ZodString>;
164
+ attempts: z.ZodNumber;
165
+ createdAt: z.ZodISODateTime;
166
+ updatedAt: z.ZodISODateTime;
167
+ nextAttemptAt: z.ZodISODateTime;
168
+ sourceEnd: z.ZodISODateTime;
169
+ blocked: z.ZodBoolean;
170
+ manualReviewReason: z.ZodNullable<z.ZodEnum<{
171
+ compensation_after_start: "compensation_after_start";
172
+ multiple_exact_matches: "multiple_exact_matches";
173
+ no_exact_match: "no_exact_match";
174
+ }>>;
175
+ manualReviewAt: z.ZodNullable<z.ZodISODateTime>;
176
+ manualReviewAlertedAt: z.ZodNullable<z.ZodISODateTime>;
177
+ retryAlertedAt: z.ZodNullable<z.ZodISODateTime>;
178
+ userExists: z.ZodBoolean;
179
+ source: z.ZodNullable<z.ZodObject<{
180
+ uuid: z.ZodUUID;
181
+ subscriptionId: z.ZodUUID;
182
+ status: z.ZodString;
183
+ active: z.ZodBoolean;
184
+ startDate: z.ZodNullable<z.ZodISODateTime>;
185
+ endDate: z.ZodNullable<z.ZodISODateTime>;
186
+ intervalEndDate: z.ZodNullable<z.ZodISODateTime>;
187
+ }, z.core.$strict>>;
188
+ targetExists: z.ZodBoolean;
189
+ order: z.ZodNullable<z.ZodObject<{
190
+ uuid: z.ZodUUID;
191
+ status: z.ZodString;
192
+ sum: z.ZodNumber;
193
+ currency: z.ZodString;
194
+ }, z.core.$strict>>;
195
+ oldRecurringRef: z.ZodNullable<z.ZodString>;
196
+ newRecurringRef: z.ZodNullable<z.ZodString>;
197
+ successorId: z.ZodNullable<z.ZodUUID>;
198
+ autoRenewalDisabled: z.ZodBoolean;
199
+ events: z.ZodArray<z.ZodObject<{
200
+ kind: z.ZodEnum<{
201
+ cancel_new_sent: "cancel_new_sent";
202
+ cancel_old_sent: "cancel_old_sent";
203
+ completed: "completed";
204
+ create_new_sent: "create_new_sent";
205
+ created: "created";
206
+ manual_review: "manual_review";
207
+ manual_review_notified: "manual_review_notified";
208
+ new_cancelled: "new_cancelled";
209
+ old_cancelled: "old_cancelled";
210
+ }>;
211
+ at: z.ZodISODateTime;
212
+ }, z.core.$strict>>;
213
+ notificationConfigured: z.ZodBoolean;
214
+ payments: z.ZodObject<{
215
+ items: z.ZodArray<z.ZodObject<{
216
+ uuid: z.ZodUUID;
217
+ status: z.ZodString;
218
+ sum: z.ZodNumber;
219
+ createdAt: z.ZodISODateTime;
220
+ cloudPaymentsTransactionId: z.ZodNullable<z.ZodString>;
221
+ }, z.core.$strict>>;
222
+ total: z.ZodNumber;
223
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
224
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
225
+ }, z.core.$strict>;
226
+ }, z.core.$strict>;
227
+ export declare const PaymentIncidentDetailsResponseSchema: z.ZodObject<{
228
+ data: z.ZodObject<{
229
+ uuid: z.ZodUUID;
230
+ userId: z.ZodUUID;
231
+ sourceId: z.ZodUUID;
232
+ targetId: z.ZodUUID;
233
+ orderId: z.ZodUUID;
234
+ status: z.ZodEnum<{
235
+ failed: "failed";
236
+ processing: "processing";
237
+ succeeded: "succeeded";
238
+ }>;
239
+ stage: z.ZodEnum<{
240
+ cancelling_new: "cancelling_new";
241
+ cancelling_old: "cancelling_old";
242
+ creating_new: "creating_new";
243
+ failed: "failed";
244
+ finalizing: "finalizing";
245
+ manual_review: "manual_review";
246
+ prepared: "prepared";
247
+ reconciling: "reconciling";
248
+ succeeded: "succeeded";
249
+ }>;
250
+ amount: z.ZodNullable<z.ZodNumber>;
251
+ currency: z.ZodNullable<z.ZodString>;
252
+ attempts: z.ZodNumber;
253
+ createdAt: z.ZodISODateTime;
254
+ updatedAt: z.ZodISODateTime;
255
+ nextAttemptAt: z.ZodISODateTime;
256
+ sourceEnd: z.ZodISODateTime;
257
+ blocked: z.ZodBoolean;
258
+ manualReviewReason: z.ZodNullable<z.ZodEnum<{
259
+ compensation_after_start: "compensation_after_start";
260
+ multiple_exact_matches: "multiple_exact_matches";
261
+ no_exact_match: "no_exact_match";
262
+ }>>;
263
+ manualReviewAt: z.ZodNullable<z.ZodISODateTime>;
264
+ manualReviewAlertedAt: z.ZodNullable<z.ZodISODateTime>;
265
+ retryAlertedAt: z.ZodNullable<z.ZodISODateTime>;
266
+ userExists: z.ZodBoolean;
267
+ source: z.ZodNullable<z.ZodObject<{
268
+ uuid: z.ZodUUID;
269
+ subscriptionId: z.ZodUUID;
270
+ status: z.ZodString;
271
+ active: z.ZodBoolean;
272
+ startDate: z.ZodNullable<z.ZodISODateTime>;
273
+ endDate: z.ZodNullable<z.ZodISODateTime>;
274
+ intervalEndDate: z.ZodNullable<z.ZodISODateTime>;
275
+ }, z.core.$strict>>;
276
+ targetExists: z.ZodBoolean;
277
+ order: z.ZodNullable<z.ZodObject<{
278
+ uuid: z.ZodUUID;
279
+ status: z.ZodString;
280
+ sum: z.ZodNumber;
281
+ currency: z.ZodString;
282
+ }, z.core.$strict>>;
283
+ oldRecurringRef: z.ZodNullable<z.ZodString>;
284
+ newRecurringRef: z.ZodNullable<z.ZodString>;
285
+ successorId: z.ZodNullable<z.ZodUUID>;
286
+ autoRenewalDisabled: z.ZodBoolean;
287
+ events: z.ZodArray<z.ZodObject<{
288
+ kind: z.ZodEnum<{
289
+ cancel_new_sent: "cancel_new_sent";
290
+ cancel_old_sent: "cancel_old_sent";
291
+ completed: "completed";
292
+ create_new_sent: "create_new_sent";
293
+ created: "created";
294
+ manual_review: "manual_review";
295
+ manual_review_notified: "manual_review_notified";
296
+ new_cancelled: "new_cancelled";
297
+ old_cancelled: "old_cancelled";
298
+ }>;
299
+ at: z.ZodISODateTime;
300
+ }, z.core.$strict>>;
301
+ notificationConfigured: z.ZodBoolean;
302
+ payments: z.ZodObject<{
303
+ items: z.ZodArray<z.ZodObject<{
304
+ uuid: z.ZodUUID;
305
+ status: z.ZodString;
306
+ sum: z.ZodNumber;
307
+ createdAt: z.ZodISODateTime;
308
+ cloudPaymentsTransactionId: z.ZodNullable<z.ZodString>;
309
+ }, z.core.$strict>>;
310
+ total: z.ZodNumber;
311
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
312
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
313
+ }, z.core.$strict>;
314
+ }, z.core.$strict>;
315
+ }, z.core.$strict>;
316
+ export declare const PaymentIncidentRecurringSchema: z.ZodObject<{
317
+ id: z.ZodString;
318
+ status: z.ZodString;
319
+ amount: z.ZodNumber;
320
+ currency: z.ZodString;
321
+ startsAt: z.ZodISODateTime;
322
+ matches: z.ZodBoolean;
323
+ }, z.core.$strict>;
324
+ export declare const PaymentIncidentProviderCheckSchema: z.ZodObject<{
325
+ operationId: z.ZodUUID;
326
+ startedAt: z.ZodISODateTime;
327
+ finishedAt: z.ZodISODateTime;
328
+ local: z.ZodObject<{
329
+ status: z.ZodString;
330
+ stage: z.ZodString;
331
+ updatedAt: z.ZodISODateTime;
332
+ }, z.core.$strict>;
333
+ stale: z.ZodBoolean;
334
+ outcome: z.ZodEnum<{
335
+ ambiguous: "ambiguous";
336
+ mismatch: "mismatch";
337
+ none: "none";
338
+ partial: "partial";
339
+ unique: "unique";
340
+ unknown: "unknown";
341
+ }>;
342
+ exactMatchCount: z.ZodNullable<z.ZodNumber>;
343
+ truncated: z.ZodBoolean;
344
+ candidates: z.ZodArray<z.ZodObject<{
345
+ id: z.ZodString;
346
+ status: z.ZodString;
347
+ amount: z.ZodNumber;
348
+ currency: z.ZodString;
349
+ startsAt: z.ZodISODateTime;
350
+ matches: z.ZodBoolean;
351
+ }, z.core.$strict>>;
352
+ oldRecurring: z.ZodNullable<z.ZodObject<{
353
+ outcome: z.ZodEnum<{
354
+ confirmed: "confirmed";
355
+ unknown: "unknown";
356
+ }>;
357
+ recurring: z.ZodNullable<z.ZodObject<{
358
+ id: z.ZodString;
359
+ status: z.ZodString;
360
+ amount: z.ZodNumber;
361
+ currency: z.ZodString;
362
+ startsAt: z.ZodISODateTime;
363
+ matches: z.ZodBoolean;
364
+ }, z.core.$strict>>;
365
+ }, z.core.$strict>>;
366
+ newRecurring: z.ZodNullable<z.ZodObject<{
367
+ outcome: z.ZodEnum<{
368
+ confirmed: "confirmed";
369
+ unknown: "unknown";
370
+ }>;
371
+ recurring: z.ZodNullable<z.ZodObject<{
372
+ id: z.ZodString;
373
+ status: z.ZodString;
374
+ amount: z.ZodNumber;
375
+ currency: z.ZodString;
376
+ startsAt: z.ZodISODateTime;
377
+ matches: z.ZodBoolean;
378
+ }, z.core.$strict>>;
379
+ }, z.core.$strict>>;
380
+ }, z.core.$strict>;
381
+ export declare const PaymentIncidentProviderCheckResponseSchema: z.ZodObject<{
382
+ data: z.ZodObject<{
383
+ operationId: z.ZodUUID;
384
+ startedAt: z.ZodISODateTime;
385
+ finishedAt: z.ZodISODateTime;
386
+ local: z.ZodObject<{
387
+ status: z.ZodString;
388
+ stage: z.ZodString;
389
+ updatedAt: z.ZodISODateTime;
390
+ }, z.core.$strict>;
391
+ stale: z.ZodBoolean;
392
+ outcome: z.ZodEnum<{
393
+ ambiguous: "ambiguous";
394
+ mismatch: "mismatch";
395
+ none: "none";
396
+ partial: "partial";
397
+ unique: "unique";
398
+ unknown: "unknown";
399
+ }>;
400
+ exactMatchCount: z.ZodNullable<z.ZodNumber>;
401
+ truncated: z.ZodBoolean;
402
+ candidates: z.ZodArray<z.ZodObject<{
403
+ id: z.ZodString;
404
+ status: z.ZodString;
405
+ amount: z.ZodNumber;
406
+ currency: z.ZodString;
407
+ startsAt: z.ZodISODateTime;
408
+ matches: z.ZodBoolean;
409
+ }, z.core.$strict>>;
410
+ oldRecurring: z.ZodNullable<z.ZodObject<{
411
+ outcome: z.ZodEnum<{
412
+ confirmed: "confirmed";
413
+ unknown: "unknown";
414
+ }>;
415
+ recurring: z.ZodNullable<z.ZodObject<{
416
+ id: z.ZodString;
417
+ status: z.ZodString;
418
+ amount: z.ZodNumber;
419
+ currency: z.ZodString;
420
+ startsAt: z.ZodISODateTime;
421
+ matches: z.ZodBoolean;
422
+ }, z.core.$strict>>;
423
+ }, z.core.$strict>>;
424
+ newRecurring: z.ZodNullable<z.ZodObject<{
425
+ outcome: z.ZodEnum<{
426
+ confirmed: "confirmed";
427
+ unknown: "unknown";
428
+ }>;
429
+ recurring: z.ZodNullable<z.ZodObject<{
430
+ id: z.ZodString;
431
+ status: z.ZodString;
432
+ amount: z.ZodNumber;
433
+ currency: z.ZodString;
434
+ startsAt: z.ZodISODateTime;
435
+ matches: z.ZodBoolean;
436
+ }, z.core.$strict>>;
437
+ }, z.core.$strict>>;
438
+ }, z.core.$strict>;
439
+ }, z.core.$strict>;
440
+ export type PaymentIncidentListQuery = z.infer<typeof PaymentIncidentListQuerySchema>;
441
+ export type PaymentIncidentPage = z.infer<typeof PaymentIncidentPageSchema>;
442
+ export type PaymentIncidentSummary = z.infer<typeof PaymentIncidentSummarySchema>;
443
+ export type PaymentIncidentDetails = z.infer<typeof PaymentIncidentDetailsSchema>;
444
+ export type PaymentIncidentProviderCheck = z.infer<typeof PaymentIncidentProviderCheckSchema>;
445
+ export type PaymentIncidentRecurring = z.infer<typeof PaymentIncidentRecurringSchema>;
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentIncidentProviderCheckResponseSchema = exports.PaymentIncidentProviderCheckSchema = exports.PaymentIncidentRecurringSchema = exports.PaymentIncidentDetailsResponseSchema = exports.PaymentIncidentDetailsSchema = exports.PaymentIncidentListResponseSchema = exports.PaymentIncidentSummarySchema = exports.PaymentIncidentIdSchema = exports.PaymentIncidentListQuerySchema = exports.PaymentIncidentPageSchema = exports.PaymentIncidentReasonSchema = exports.PaymentIncidentStageSchema = exports.PAYMENT_INCIDENT_ADMIN_ROUTES = exports.PAYMENT_INCIDENT_ADMIN_CONTROLLER = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.PAYMENT_INCIDENT_ADMIN_CONTROLLER = 'subscription/admin/payment-incidents';
6
+ exports.PAYMENT_INCIDENT_ADMIN_ROUTES = {
7
+ detail: (id) => `${id}`,
8
+ providerCheck: (id) => `${id}/provider-check`,
9
+ };
10
+ exports.PaymentIncidentStageSchema = zod_1.z.enum([
11
+ 'prepared',
12
+ 'cancelling_old',
13
+ 'creating_new',
14
+ 'finalizing',
15
+ 'cancelling_new',
16
+ 'reconciling',
17
+ 'manual_review',
18
+ 'succeeded',
19
+ 'failed',
20
+ ]);
21
+ exports.PaymentIncidentReasonSchema = zod_1.z.enum([
22
+ 'no_exact_match',
23
+ 'multiple_exact_matches',
24
+ 'compensation_after_start',
25
+ ]);
26
+ const date = zod_1.z.iso.datetime();
27
+ const page = zod_1.z.coerce.number().int().min(1).max(1000000).default(1);
28
+ const pageSize = zod_1.z.coerce.number().int().min(1).max(100).default(20);
29
+ exports.PaymentIncidentPageSchema = zod_1.z.object({ page, pageSize }).strict();
30
+ exports.PaymentIncidentListQuerySchema = zod_1.z
31
+ .object({
32
+ page,
33
+ pageSize,
34
+ operationId: zod_1.z.uuid().optional(),
35
+ userId: zod_1.z.uuid().optional(),
36
+ stage: exports.PaymentIncidentStageSchema.optional(),
37
+ status: zod_1.z.enum(['processing', 'failed', 'succeeded']).optional(),
38
+ minAttempts: zod_1.z.coerce.number().int().min(0).max(1000000).optional(),
39
+ createdFrom: date.optional(),
40
+ createdTo: date.optional(),
41
+ })
42
+ .strict()
43
+ .refine((input) => !input.createdFrom || !input.createdTo || input.createdFrom < input.createdTo, { message: 'Invalid date range' });
44
+ exports.PaymentIncidentIdSchema = zod_1.z.object({ operationId: zod_1.z.uuid() }).strict();
45
+ exports.PaymentIncidentSummarySchema = zod_1.z
46
+ .object({
47
+ uuid: zod_1.z.uuid(),
48
+ userId: zod_1.z.uuid(),
49
+ sourceId: zod_1.z.uuid(),
50
+ targetId: zod_1.z.uuid(),
51
+ orderId: zod_1.z.uuid(),
52
+ status: zod_1.z.enum(['processing', 'failed', 'succeeded']),
53
+ stage: exports.PaymentIncidentStageSchema,
54
+ amount: zod_1.z.number().finite().nonnegative().nullable(),
55
+ currency: zod_1.z.string().max(10).nullable(),
56
+ attempts: zod_1.z.number().int().nonnegative(),
57
+ createdAt: date,
58
+ updatedAt: date,
59
+ nextAttemptAt: date,
60
+ sourceEnd: date,
61
+ blocked: zod_1.z.boolean(),
62
+ manualReviewReason: exports.PaymentIncidentReasonSchema.nullable(),
63
+ manualReviewAt: date.nullable(),
64
+ manualReviewAlertedAt: date.nullable(),
65
+ retryAlertedAt: date.nullable(),
66
+ })
67
+ .strict();
68
+ exports.PaymentIncidentListResponseSchema = zod_1.z
69
+ .object({
70
+ data: zod_1.z
71
+ .object({
72
+ items: zod_1.z.array(exports.PaymentIncidentSummarySchema),
73
+ total: zod_1.z.number().int().nonnegative(),
74
+ page,
75
+ pageSize,
76
+ })
77
+ .strict(),
78
+ })
79
+ .strict();
80
+ const subscription = zod_1.z
81
+ .object({
82
+ uuid: zod_1.z.uuid(),
83
+ subscriptionId: zod_1.z.uuid(),
84
+ status: zod_1.z.string(),
85
+ active: zod_1.z.boolean(),
86
+ startDate: date.nullable(),
87
+ endDate: date.nullable(),
88
+ intervalEndDate: date.nullable(),
89
+ })
90
+ .strict();
91
+ exports.PaymentIncidentDetailsSchema = exports.PaymentIncidentSummarySchema.extend({
92
+ userExists: zod_1.z.boolean(),
93
+ source: subscription.nullable(),
94
+ targetExists: zod_1.z.boolean(),
95
+ order: zod_1.z
96
+ .object({ uuid: zod_1.z.uuid(), status: zod_1.z.string(), sum: zod_1.z.number(), currency: zod_1.z.string() })
97
+ .strict()
98
+ .nullable(),
99
+ oldRecurringRef: zod_1.z.string().nullable(),
100
+ newRecurringRef: zod_1.z.string().nullable(),
101
+ successorId: zod_1.z.uuid().nullable(),
102
+ autoRenewalDisabled: zod_1.z.boolean(),
103
+ events: zod_1.z.array(zod_1.z
104
+ .object({
105
+ kind: zod_1.z.enum([
106
+ 'created',
107
+ 'cancel_old_sent',
108
+ 'old_cancelled',
109
+ 'create_new_sent',
110
+ 'cancel_new_sent',
111
+ 'new_cancelled',
112
+ 'manual_review',
113
+ 'manual_review_notified',
114
+ 'completed',
115
+ ]),
116
+ at: date,
117
+ })
118
+ .strict()),
119
+ notificationConfigured: zod_1.z.boolean(),
120
+ payments: zod_1.z
121
+ .object({
122
+ items: zod_1.z.array(zod_1.z
123
+ .object({
124
+ uuid: zod_1.z.uuid(),
125
+ status: zod_1.z.string(),
126
+ sum: zod_1.z.number(),
127
+ createdAt: date,
128
+ cloudPaymentsTransactionId: zod_1.z.string().nullable(),
129
+ })
130
+ .strict()),
131
+ total: zod_1.z.number().int().nonnegative(),
132
+ page,
133
+ pageSize,
134
+ })
135
+ .strict(),
136
+ }).strict();
137
+ exports.PaymentIncidentDetailsResponseSchema = zod_1.z
138
+ .object({ data: exports.PaymentIncidentDetailsSchema })
139
+ .strict();
140
+ exports.PaymentIncidentRecurringSchema = zod_1.z
141
+ .object({
142
+ id: zod_1.z.string(),
143
+ status: zod_1.z.string(),
144
+ amount: zod_1.z.number(),
145
+ currency: zod_1.z.string(),
146
+ startsAt: date,
147
+ matches: zod_1.z.boolean(),
148
+ })
149
+ .strict();
150
+ const readResult = zod_1.z
151
+ .object({
152
+ outcome: zod_1.z.enum(['confirmed', 'unknown']),
153
+ recurring: exports.PaymentIncidentRecurringSchema.nullable(),
154
+ })
155
+ .strict();
156
+ exports.PaymentIncidentProviderCheckSchema = zod_1.z
157
+ .object({
158
+ operationId: zod_1.z.uuid(),
159
+ startedAt: date,
160
+ finishedAt: date,
161
+ local: zod_1.z.object({ status: zod_1.z.string(), stage: zod_1.z.string(), updatedAt: date }).strict(),
162
+ stale: zod_1.z.boolean(),
163
+ outcome: zod_1.z.enum(['unique', 'none', 'ambiguous', 'mismatch', 'partial', 'unknown']),
164
+ exactMatchCount: zod_1.z.number().int().nonnegative().nullable(),
165
+ truncated: zod_1.z.boolean(),
166
+ candidates: zod_1.z.array(exports.PaymentIncidentRecurringSchema).max(20),
167
+ oldRecurring: readResult.nullable(),
168
+ newRecurring: readResult.nullable(),
169
+ })
170
+ .strict();
171
+ exports.PaymentIncidentProviderCheckResponseSchema = zod_1.z
172
+ .object({ data: exports.PaymentIncidentProviderCheckSchema })
173
+ .strict();