controlresell 2.0.10 → 2.1.0

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 (108) hide show
  1. package/package.json +2 -2
  2. package/src/com/controlresell/models/customers/VerifyCustomerRequest.d.ts +9 -0
  3. package/src/com/controlresell/models/customers/VerifyCustomerRequest.js +7 -0
  4. package/src/com/controlresell/models/customers/VerifyCustomerRequest.ts +6 -0
  5. package/src/com/controlresell/models/customers/contracts/Contract.d.ts +4 -4
  6. package/src/com/controlresell/models/customers/contracts/PrepareContractResponse.d.ts +4 -4
  7. package/src/com/controlresell/models/fees/Fee.d.ts +6 -6
  8. package/src/com/controlresell/models/items/CreatedItems.d.ts +74 -74
  9. package/src/com/controlresell/models/items/Item.d.ts +48 -48
  10. package/src/com/controlresell/models/items/ItemFiltersContext.d.ts +6 -6
  11. package/src/com/controlresell/models/items/ItemFiltersContext.js +2 -2
  12. package/src/com/controlresell/models/items/ItemFiltersContext.ts +2 -2
  13. package/src/com/controlresell/models/items/ItemPayload.d.ts +2 -2
  14. package/src/com/controlresell/models/items/ItemsWithFilters.d.ts +70 -70
  15. package/src/com/controlresell/models/items/UpdatedItem.d.ts +74 -74
  16. package/src/com/controlresell/models/items/files/ItemFile.d.ts +6 -6
  17. package/src/com/controlresell/models/items/labels/ItemLabel.d.ts +4 -4
  18. package/src/com/controlresell/models/items/platforms/ItemOnPlatform.d.ts +10 -10
  19. package/src/com/controlresell/models/items/platforms/ItemOnPlatformsRequestWithItem.d.ts +70 -70
  20. package/src/com/controlresell/models/metadata/brands/Brand.d.ts +2 -2
  21. package/src/com/controlresell/models/metadata/labels/Label.d.ts +2 -2
  22. package/src/com/controlresell/models/metadata/places/Place.d.ts +2 -2
  23. package/src/com/controlresell/models/platforms/conversations/Conversation.d.ts +149 -55
  24. package/src/com/controlresell/models/platforms/conversations/UserConversations.d.ts +193 -75
  25. package/src/com/controlresell/models/platforms/conversations/messages/ConversationMessage.d.ts +97 -27
  26. package/src/com/controlresell/models/platforms/conversations/messages/ConversationMessage.js +6 -4
  27. package/src/com/controlresell/models/platforms/conversations/messages/ConversationMessage.ts +6 -4
  28. package/src/com/controlresell/models/platforms/conversations/messages/ConversationMessageRequest.d.ts +12 -0
  29. package/src/com/controlresell/models/platforms/conversations/messages/ConversationMessageRequest.js +8 -0
  30. package/src/com/controlresell/models/platforms/conversations/messages/ConversationMessageRequest.ts +7 -0
  31. package/src/com/controlresell/models/platforms/conversations/messages/CreateConversationMessagePayload.d.ts +5 -5
  32. package/src/com/controlresell/models/platforms/conversations/messages/CreateConversationMessagePayload.js +1 -1
  33. package/src/com/controlresell/models/platforms/conversations/messages/CreateConversationMessagePayload.ts +1 -1
  34. package/src/com/controlresell/models/platforms/conversations/messages/PaginatedConversationMessages.d.ts +133 -39
  35. package/src/com/controlresell/models/platforms/conversations/messages/UpdateConversationMessagePayload.d.ts +45 -0
  36. package/src/com/controlresell/models/platforms/conversations/messages/UpdateConversationMessagePayload.js +10 -0
  37. package/src/com/controlresell/models/platforms/conversations/messages/UpdateConversationMessagePayload.ts +9 -0
  38. package/src/com/controlresell/models/platforms/conversations/messages/files/ConversationMessageFile.d.ts +48 -0
  39. package/src/com/controlresell/models/platforms/conversations/messages/files/ConversationMessageFile.js +11 -0
  40. package/src/com/controlresell/models/platforms/conversations/messages/files/ConversationMessageFile.ts +10 -0
  41. package/src/com/controlresell/models/platforms/conversations/messages/files/CreateConversationMessageFilePayload.d.ts +12 -0
  42. package/src/com/controlresell/models/platforms/conversations/messages/files/CreateConversationMessageFilePayload.js +8 -0
  43. package/src/com/controlresell/models/platforms/conversations/messages/files/CreateConversationMessageFilePayload.ts +7 -0
  44. package/src/com/controlresell/models/platforms/conversations/messages/files/UpdateConversationMessageFilePayload.d.ts +9 -0
  45. package/src/com/controlresell/models/platforms/conversations/messages/files/UpdateConversationMessageFilePayload.js +7 -0
  46. package/src/com/controlresell/models/platforms/conversations/messages/files/UpdateConversationMessageFilePayload.ts +6 -0
  47. package/src/com/controlresell/models/platforms/conversations/messages/offers/ConversationMessageOffer.d.ts +21 -0
  48. package/src/com/controlresell/models/platforms/conversations/messages/offers/ConversationMessageOffer.js +12 -0
  49. package/src/com/controlresell/models/platforms/conversations/messages/offers/ConversationMessageOffer.ts +11 -0
  50. package/src/com/controlresell/models/platforms/conversations/messages/offers/ConversationOfferRequest.d.ts +9 -0
  51. package/src/com/controlresell/models/platforms/conversations/messages/offers/ConversationOfferRequest.js +7 -0
  52. package/src/com/controlresell/models/platforms/conversations/messages/offers/ConversationOfferRequest.ts +6 -0
  53. package/src/com/controlresell/models/platforms/conversations/messages/offers/CreateConversationMessageOfferPayload.d.ts +15 -0
  54. package/src/com/controlresell/models/platforms/conversations/messages/offers/CreateConversationMessageOfferPayload.js +10 -0
  55. package/src/com/controlresell/models/platforms/conversations/messages/offers/CreateConversationMessageOfferPayload.ts +9 -0
  56. package/src/com/controlresell/models/platforms/conversations/messages/offers/UpdateConversationMessageOfferPayload.d.ts +9 -0
  57. package/src/com/controlresell/models/platforms/conversations/messages/offers/UpdateConversationMessageOfferPayload.js +8 -0
  58. package/src/com/controlresell/models/platforms/conversations/messages/offers/UpdateConversationMessageOfferPayload.ts +7 -0
  59. package/src/com/controlresell/models/platforms/conversations/users/ConversationUser.d.ts +4 -4
  60. package/src/com/controlresell/models/platforms/labels/OrderLabel.d.ts +10 -10
  61. package/src/com/controlresell/models/platforms/orders/CreateOrderPayload.d.ts +3 -0
  62. package/src/com/controlresell/models/platforms/orders/CreateOrderPayload.js +1 -0
  63. package/src/com/controlresell/models/platforms/orders/CreateOrderPayload.ts +1 -0
  64. package/src/com/controlresell/models/platforms/orders/Order.d.ts +45 -42
  65. package/src/com/controlresell/models/platforms/orders/Order.js +1 -0
  66. package/src/com/controlresell/models/platforms/orders/Order.ts +1 -0
  67. package/src/com/controlresell/models/platforms/orders/UpdateOrderPayload.d.ts +5 -2
  68. package/src/com/controlresell/models/platforms/orders/UpdateOrderPayload.js +1 -0
  69. package/src/com/controlresell/models/platforms/orders/UpdateOrderPayload.ts +1 -0
  70. package/src/com/controlresell/models/platforms/orders/items/ItemInOrder.d.ts +16 -16
  71. package/src/com/controlresell/models/platforms/orders/items/OrderWithItems.d.ts +1126 -0
  72. package/src/com/controlresell/models/platforms/orders/items/OrderWithItems.js +10 -0
  73. package/src/com/controlresell/models/platforms/orders/items/OrderWithItems.ts +9 -0
  74. package/src/com/controlresell/models/platforms/transactions/CreateTransactionPayload.d.ts +21 -0
  75. package/src/com/controlresell/models/platforms/transactions/CreateTransactionPayload.js +11 -0
  76. package/src/com/controlresell/models/platforms/transactions/CreateTransactionPayload.ts +10 -0
  77. package/src/com/controlresell/models/platforms/transactions/Transaction.d.ts +167 -0
  78. package/src/com/controlresell/models/platforms/transactions/Transaction.js +15 -0
  79. package/src/com/controlresell/models/platforms/transactions/Transaction.ts +14 -0
  80. package/src/com/controlresell/models/platforms/transactions/UpdateTransactionPayload.d.ts +18 -0
  81. package/src/com/controlresell/models/platforms/transactions/UpdateTransactionPayload.js +10 -0
  82. package/src/com/controlresell/models/platforms/transactions/UpdateTransactionPayload.ts +9 -0
  83. package/src/com/controlresell/models/platforms/transactions/items/CreateItemInTransactionPayload.d.ts +9 -0
  84. package/src/com/controlresell/models/platforms/transactions/items/CreateItemInTransactionPayload.js +7 -0
  85. package/src/com/controlresell/models/platforms/transactions/items/CreateItemInTransactionPayload.ts +6 -0
  86. package/src/com/controlresell/models/platforms/transactions/items/ItemInTransaction.d.ts +102 -0
  87. package/src/com/controlresell/models/platforms/transactions/items/ItemInTransaction.js +10 -0
  88. package/src/com/controlresell/models/platforms/transactions/items/ItemInTransaction.ts +9 -0
  89. package/src/com/controlresell/models/platforms/transactions/items/TransactionWithItems.d.ts +959 -0
  90. package/src/com/controlresell/models/platforms/transactions/items/TransactionWithItems.js +10 -0
  91. package/src/com/controlresell/models/platforms/transactions/items/TransactionWithItems.ts +9 -0
  92. package/src/com/controlresell/models/users/UpdateUserPayload.d.ts +2 -2
  93. package/src/com/controlresell/models/users/User.d.ts +2 -2
  94. package/src/com/controlresell/models/users/fields/Field.d.ts +2 -2
  95. package/src/com/controlresell/models/users/fields/FieldsWithData.d.ts +4 -4
  96. package/src/com/controlresell/models/users/files/File.d.ts +2 -2
  97. package/src/com/controlresell/models/users/platforms/CreateUserOnPlatformPayload.d.ts +2 -2
  98. package/src/com/controlresell/models/users/platforms/PlatformAuthRequest.d.ts +8 -8
  99. package/src/com/controlresell/models/users/platforms/PlatformJobUpdate.d.ts +11 -11
  100. package/src/com/controlresell/models/users/platforms/UpdateUserOnPlatformPayload.d.ts +2 -2
  101. package/src/com/controlresell/models/users/platforms/UserOnPlatform.d.ts +4 -4
  102. package/src/com/controlresell/models/users/platforms/UserOnPlatformSessionMessage.d.ts +6 -6
  103. package/src/index.d.ts +18 -1
  104. package/src/index.js +18 -1
  105. package/src/index.ts +18 -1
  106. package/src/com/controlresell/models/{connector → users/platforms}/UserOnPlatformRequest.d.ts +2 -2
  107. /package/src/com/controlresell/models/{connector → users/platforms}/UserOnPlatformRequest.js +0 -0
  108. /package/src/com/controlresell/models/{connector → users/platforms}/UserOnPlatformRequest.ts +0 -0
@@ -15,74 +15,144 @@ export declare const UserConversationsSchema: z.ZodObject<{
15
15
  status: z.ZodEnum<["CONNECTED", "DISCONNECTED", "ERROR"]>;
16
16
  }, "strip", z.ZodTypeAny, {
17
17
  status: "ERROR" | "CONNECTED" | "DISCONNECTED";
18
+ userId: string | number;
19
+ name: string;
18
20
  platform: "VINTED" | "SHOPIFY";
19
21
  accountId: string;
20
- name: string;
21
- userId: string | number;
22
22
  }, {
23
23
  status: "ERROR" | "CONNECTED" | "DISCONNECTED";
24
+ userId: string | number;
25
+ name: string;
24
26
  platform: "VINTED" | "SHOPIFY";
25
27
  accountId: string;
26
- name: string;
27
- userId: string | number;
28
28
  }>>>;
29
29
  lastMessage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
30
30
  id: z.ZodString;
31
31
  conversationId: z.ZodString;
32
32
  conversationUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
- platformMessageId: z.ZodString;
33
+ platformMessageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
34
  type: z.ZodEnum<["MESSAGE", "STATUS_MESSAGE", "ACTION_MESSAGE", "OFFER_REQUEST_MESSAGE", "OFFER_MESSAGE"]>;
35
35
  body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
- files: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
36
+ createdAt: z.ZodDate;
37
+ offer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
37
38
  id: z.ZodString;
38
- userId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
39
- path: z.ZodString;
40
- signedUrl: z.ZodString;
41
- createdAt: z.ZodDate;
39
+ messageId: z.ZodString;
40
+ price: z.ZodNumber;
41
+ originalPrice: z.ZodNumber;
42
+ status: z.ZodEnum<["PENDING", "ACCEPTED", "REJECTED", "CANCELLED"]>;
42
43
  }, "strip", z.ZodTypeAny, {
43
- path: string;
44
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
44
45
  id: string;
45
- userId: string | number;
46
- createdAt: Date;
47
- signedUrl: string;
46
+ price: number;
47
+ originalPrice: number;
48
+ messageId: string;
48
49
  }, {
49
- path: string;
50
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
50
51
  id: string;
51
- userId: string | number;
52
- createdAt: Date;
53
- signedUrl: string;
52
+ price: number;
53
+ originalPrice: number;
54
+ messageId: string;
55
+ }>>>;
56
+ files: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
57
+ fileId: z.ZodString;
58
+ messageId: z.ZodString;
59
+ index: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
60
+ file: z.ZodOptional<z.ZodNullable<z.ZodObject<{
61
+ id: z.ZodString;
62
+ userId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
63
+ path: z.ZodString;
64
+ signedUrl: z.ZodString;
65
+ createdAt: z.ZodDate;
66
+ }, "strip", z.ZodTypeAny, {
67
+ path: string;
68
+ id: string;
69
+ userId: string | number;
70
+ signedUrl: string;
71
+ createdAt: Date;
72
+ }, {
73
+ path: string;
74
+ id: string;
75
+ userId: string | number;
76
+ signedUrl: string;
77
+ createdAt: Date;
78
+ }>>>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ fileId: string;
81
+ messageId: string;
82
+ file?: {
83
+ path: string;
84
+ id: string;
85
+ userId: string | number;
86
+ signedUrl: string;
87
+ createdAt: Date;
88
+ } | null | undefined;
89
+ index?: number | null | undefined;
90
+ }, {
91
+ fileId: string;
92
+ messageId: string;
93
+ file?: {
94
+ path: string;
95
+ id: string;
96
+ userId: string | number;
97
+ signedUrl: string;
98
+ createdAt: Date;
99
+ } | null | undefined;
100
+ index?: number | null | undefined;
54
101
  }>, "many">>>;
55
- createdAt: z.ZodDate;
56
102
  }, "strip", z.ZodTypeAny, {
57
103
  type: "MESSAGE" | "STATUS_MESSAGE" | "ACTION_MESSAGE" | "OFFER_REQUEST_MESSAGE" | "OFFER_MESSAGE";
58
104
  id: string;
59
105
  createdAt: Date;
60
106
  conversationId: string;
61
- platformMessageId: string;
62
107
  body?: string | null | undefined;
63
- files?: {
64
- path: string;
108
+ offer?: {
109
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
65
110
  id: string;
66
- userId: string | number;
67
- createdAt: Date;
68
- signedUrl: string;
111
+ price: number;
112
+ originalPrice: number;
113
+ messageId: string;
114
+ } | null | undefined;
115
+ files?: {
116
+ fileId: string;
117
+ messageId: string;
118
+ file?: {
119
+ path: string;
120
+ id: string;
121
+ userId: string | number;
122
+ signedUrl: string;
123
+ createdAt: Date;
124
+ } | null | undefined;
125
+ index?: number | null | undefined;
69
126
  }[] | null | undefined;
70
127
  conversationUserId?: string | null | undefined;
128
+ platformMessageId?: string | null | undefined;
71
129
  }, {
72
130
  type: "MESSAGE" | "STATUS_MESSAGE" | "ACTION_MESSAGE" | "OFFER_REQUEST_MESSAGE" | "OFFER_MESSAGE";
73
131
  id: string;
74
132
  createdAt: Date;
75
133
  conversationId: string;
76
- platformMessageId: string;
77
134
  body?: string | null | undefined;
78
- files?: {
79
- path: string;
135
+ offer?: {
136
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
80
137
  id: string;
81
- userId: string | number;
82
- createdAt: Date;
83
- signedUrl: string;
138
+ price: number;
139
+ originalPrice: number;
140
+ messageId: string;
141
+ } | null | undefined;
142
+ files?: {
143
+ fileId: string;
144
+ messageId: string;
145
+ file?: {
146
+ path: string;
147
+ id: string;
148
+ userId: string | number;
149
+ signedUrl: string;
150
+ createdAt: Date;
151
+ } | null | undefined;
152
+ index?: number | null | undefined;
84
153
  }[] | null | undefined;
85
154
  conversationUserId?: string | null | undefined;
155
+ platformMessageId?: string | null | undefined;
86
156
  }>>>;
87
157
  users: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
88
158
  id: z.ZodString;
@@ -103,14 +173,14 @@ export declare const UserConversationsSchema: z.ZodObject<{
103
173
  path: string;
104
174
  id: string;
105
175
  userId: string | number;
106
- createdAt: Date;
107
176
  signedUrl: string;
177
+ createdAt: Date;
108
178
  }, {
109
179
  path: string;
110
180
  id: string;
111
181
  userId: string | number;
112
- createdAt: Date;
113
182
  signedUrl: string;
183
+ createdAt: Date;
114
184
  }>>>;
115
185
  }, "strip", z.ZodTypeAny, {
116
186
  id: string;
@@ -125,8 +195,8 @@ export declare const UserConversationsSchema: z.ZodObject<{
125
195
  path: string;
126
196
  id: string;
127
197
  userId: string | number;
128
- createdAt: Date;
129
198
  signedUrl: string;
199
+ createdAt: Date;
130
200
  } | null | undefined;
131
201
  }, {
132
202
  id: string;
@@ -141,37 +211,49 @@ export declare const UserConversationsSchema: z.ZodObject<{
141
211
  path: string;
142
212
  id: string;
143
213
  userId: string | number;
144
- createdAt: Date;
145
214
  signedUrl: string;
215
+ createdAt: Date;
146
216
  } | null | undefined;
147
217
  }>, "many">>>;
148
218
  }, "strip", z.ZodTypeAny, {
149
219
  id: string;
150
- accountId: string;
151
220
  updatedAt: Date;
221
+ accountId: string;
152
222
  platformConversationId: string;
153
223
  account?: {
154
224
  status: "ERROR" | "CONNECTED" | "DISCONNECTED";
225
+ userId: string | number;
226
+ name: string;
155
227
  platform: "VINTED" | "SHOPIFY";
156
228
  accountId: string;
157
- name: string;
158
- userId: string | number;
159
229
  } | null | undefined;
160
230
  lastMessage?: {
161
231
  type: "MESSAGE" | "STATUS_MESSAGE" | "ACTION_MESSAGE" | "OFFER_REQUEST_MESSAGE" | "OFFER_MESSAGE";
162
232
  id: string;
163
233
  createdAt: Date;
164
234
  conversationId: string;
165
- platformMessageId: string;
166
235
  body?: string | null | undefined;
167
- files?: {
168
- path: string;
236
+ offer?: {
237
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
169
238
  id: string;
170
- userId: string | number;
171
- createdAt: Date;
172
- signedUrl: string;
239
+ price: number;
240
+ originalPrice: number;
241
+ messageId: string;
242
+ } | null | undefined;
243
+ files?: {
244
+ fileId: string;
245
+ messageId: string;
246
+ file?: {
247
+ path: string;
248
+ id: string;
249
+ userId: string | number;
250
+ signedUrl: string;
251
+ createdAt: Date;
252
+ } | null | undefined;
253
+ index?: number | null | undefined;
173
254
  }[] | null | undefined;
174
255
  conversationUserId?: string | null | undefined;
256
+ platformMessageId?: string | null | undefined;
175
257
  } | null | undefined;
176
258
  users?: {
177
259
  id: string;
@@ -186,37 +268,49 @@ export declare const UserConversationsSchema: z.ZodObject<{
186
268
  path: string;
187
269
  id: string;
188
270
  userId: string | number;
189
- createdAt: Date;
190
271
  signedUrl: string;
272
+ createdAt: Date;
191
273
  } | null | undefined;
192
274
  }[] | null | undefined;
193
275
  }, {
194
276
  id: string;
195
- accountId: string;
196
277
  updatedAt: Date;
278
+ accountId: string;
197
279
  platformConversationId: string;
198
280
  account?: {
199
281
  status: "ERROR" | "CONNECTED" | "DISCONNECTED";
282
+ userId: string | number;
283
+ name: string;
200
284
  platform: "VINTED" | "SHOPIFY";
201
285
  accountId: string;
202
- name: string;
203
- userId: string | number;
204
286
  } | null | undefined;
205
287
  lastMessage?: {
206
288
  type: "MESSAGE" | "STATUS_MESSAGE" | "ACTION_MESSAGE" | "OFFER_REQUEST_MESSAGE" | "OFFER_MESSAGE";
207
289
  id: string;
208
290
  createdAt: Date;
209
291
  conversationId: string;
210
- platformMessageId: string;
211
292
  body?: string | null | undefined;
212
- files?: {
213
- path: string;
293
+ offer?: {
294
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
214
295
  id: string;
215
- userId: string | number;
216
- createdAt: Date;
217
- signedUrl: string;
296
+ price: number;
297
+ originalPrice: number;
298
+ messageId: string;
299
+ } | null | undefined;
300
+ files?: {
301
+ fileId: string;
302
+ messageId: string;
303
+ file?: {
304
+ path: string;
305
+ id: string;
306
+ userId: string | number;
307
+ signedUrl: string;
308
+ createdAt: Date;
309
+ } | null | undefined;
310
+ index?: number | null | undefined;
218
311
  }[] | null | undefined;
219
312
  conversationUserId?: string | null | undefined;
313
+ platformMessageId?: string | null | undefined;
220
314
  } | null | undefined;
221
315
  users?: {
222
316
  id: string;
@@ -231,8 +325,8 @@ export declare const UserConversationsSchema: z.ZodObject<{
231
325
  path: string;
232
326
  id: string;
233
327
  userId: string | number;
234
- createdAt: Date;
235
328
  signedUrl: string;
329
+ createdAt: Date;
236
330
  } | null | undefined;
237
331
  }[] | null | undefined;
238
332
  }>, "many">;
@@ -242,31 +336,43 @@ export declare const UserConversationsSchema: z.ZodObject<{
242
336
  count: number;
243
337
  rows: {
244
338
  id: string;
245
- accountId: string;
246
339
  updatedAt: Date;
340
+ accountId: string;
247
341
  platformConversationId: string;
248
342
  account?: {
249
343
  status: "ERROR" | "CONNECTED" | "DISCONNECTED";
344
+ userId: string | number;
345
+ name: string;
250
346
  platform: "VINTED" | "SHOPIFY";
251
347
  accountId: string;
252
- name: string;
253
- userId: string | number;
254
348
  } | null | undefined;
255
349
  lastMessage?: {
256
350
  type: "MESSAGE" | "STATUS_MESSAGE" | "ACTION_MESSAGE" | "OFFER_REQUEST_MESSAGE" | "OFFER_MESSAGE";
257
351
  id: string;
258
352
  createdAt: Date;
259
353
  conversationId: string;
260
- platformMessageId: string;
261
354
  body?: string | null | undefined;
262
- files?: {
263
- path: string;
355
+ offer?: {
356
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
264
357
  id: string;
265
- userId: string | number;
266
- createdAt: Date;
267
- signedUrl: string;
358
+ price: number;
359
+ originalPrice: number;
360
+ messageId: string;
361
+ } | null | undefined;
362
+ files?: {
363
+ fileId: string;
364
+ messageId: string;
365
+ file?: {
366
+ path: string;
367
+ id: string;
368
+ userId: string | number;
369
+ signedUrl: string;
370
+ createdAt: Date;
371
+ } | null | undefined;
372
+ index?: number | null | undefined;
268
373
  }[] | null | undefined;
269
374
  conversationUserId?: string | null | undefined;
375
+ platformMessageId?: string | null | undefined;
270
376
  } | null | undefined;
271
377
  users?: {
272
378
  id: string;
@@ -281,8 +387,8 @@ export declare const UserConversationsSchema: z.ZodObject<{
281
387
  path: string;
282
388
  id: string;
283
389
  userId: string | number;
284
- createdAt: Date;
285
390
  signedUrl: string;
391
+ createdAt: Date;
286
392
  } | null | undefined;
287
393
  }[] | null | undefined;
288
394
  }[];
@@ -293,31 +399,43 @@ export declare const UserConversationsSchema: z.ZodObject<{
293
399
  count: number;
294
400
  rows: {
295
401
  id: string;
296
- accountId: string;
297
402
  updatedAt: Date;
403
+ accountId: string;
298
404
  platformConversationId: string;
299
405
  account?: {
300
406
  status: "ERROR" | "CONNECTED" | "DISCONNECTED";
407
+ userId: string | number;
408
+ name: string;
301
409
  platform: "VINTED" | "SHOPIFY";
302
410
  accountId: string;
303
- name: string;
304
- userId: string | number;
305
411
  } | null | undefined;
306
412
  lastMessage?: {
307
413
  type: "MESSAGE" | "STATUS_MESSAGE" | "ACTION_MESSAGE" | "OFFER_REQUEST_MESSAGE" | "OFFER_MESSAGE";
308
414
  id: string;
309
415
  createdAt: Date;
310
416
  conversationId: string;
311
- platformMessageId: string;
312
417
  body?: string | null | undefined;
313
- files?: {
314
- path: string;
418
+ offer?: {
419
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
315
420
  id: string;
316
- userId: string | number;
317
- createdAt: Date;
318
- signedUrl: string;
421
+ price: number;
422
+ originalPrice: number;
423
+ messageId: string;
424
+ } | null | undefined;
425
+ files?: {
426
+ fileId: string;
427
+ messageId: string;
428
+ file?: {
429
+ path: string;
430
+ id: string;
431
+ userId: string | number;
432
+ signedUrl: string;
433
+ createdAt: Date;
434
+ } | null | undefined;
435
+ index?: number | null | undefined;
319
436
  }[] | null | undefined;
320
437
  conversationUserId?: string | null | undefined;
438
+ platformMessageId?: string | null | undefined;
321
439
  } | null | undefined;
322
440
  users?: {
323
441
  id: string;
@@ -332,8 +450,8 @@ export declare const UserConversationsSchema: z.ZodObject<{
332
450
  path: string;
333
451
  id: string;
334
452
  userId: string | number;
335
- createdAt: Date;
336
453
  signedUrl: string;
454
+ createdAt: Date;
337
455
  } | null | undefined;
338
456
  }[] | null | undefined;
339
457
  }[];
@@ -3,58 +3,128 @@ export declare const ConversationMessageSchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  conversationId: z.ZodString;
5
5
  conversationUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
- platformMessageId: z.ZodString;
6
+ platformMessageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
7
  type: z.ZodEnum<["MESSAGE", "STATUS_MESSAGE", "ACTION_MESSAGE", "OFFER_REQUEST_MESSAGE", "OFFER_MESSAGE"]>;
8
8
  body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
- files: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
9
+ createdAt: z.ZodDate;
10
+ offer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
10
11
  id: z.ZodString;
11
- userId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
12
- path: z.ZodString;
13
- signedUrl: z.ZodString;
14
- createdAt: z.ZodDate;
12
+ messageId: z.ZodString;
13
+ price: z.ZodNumber;
14
+ originalPrice: z.ZodNumber;
15
+ status: z.ZodEnum<["PENDING", "ACCEPTED", "REJECTED", "CANCELLED"]>;
15
16
  }, "strip", z.ZodTypeAny, {
16
- path: string;
17
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
17
18
  id: string;
18
- userId: string | number;
19
- createdAt: Date;
20
- signedUrl: string;
19
+ price: number;
20
+ originalPrice: number;
21
+ messageId: string;
21
22
  }, {
22
- path: string;
23
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
23
24
  id: string;
24
- userId: string | number;
25
- createdAt: Date;
26
- signedUrl: string;
25
+ price: number;
26
+ originalPrice: number;
27
+ messageId: string;
28
+ }>>>;
29
+ files: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
30
+ fileId: z.ZodString;
31
+ messageId: z.ZodString;
32
+ index: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
33
+ file: z.ZodOptional<z.ZodNullable<z.ZodObject<{
34
+ id: z.ZodString;
35
+ userId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
36
+ path: z.ZodString;
37
+ signedUrl: z.ZodString;
38
+ createdAt: z.ZodDate;
39
+ }, "strip", z.ZodTypeAny, {
40
+ path: string;
41
+ id: string;
42
+ userId: string | number;
43
+ signedUrl: string;
44
+ createdAt: Date;
45
+ }, {
46
+ path: string;
47
+ id: string;
48
+ userId: string | number;
49
+ signedUrl: string;
50
+ createdAt: Date;
51
+ }>>>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ fileId: string;
54
+ messageId: string;
55
+ file?: {
56
+ path: string;
57
+ id: string;
58
+ userId: string | number;
59
+ signedUrl: string;
60
+ createdAt: Date;
61
+ } | null | undefined;
62
+ index?: number | null | undefined;
63
+ }, {
64
+ fileId: string;
65
+ messageId: string;
66
+ file?: {
67
+ path: string;
68
+ id: string;
69
+ userId: string | number;
70
+ signedUrl: string;
71
+ createdAt: Date;
72
+ } | null | undefined;
73
+ index?: number | null | undefined;
27
74
  }>, "many">>>;
28
- createdAt: z.ZodDate;
29
75
  }, "strip", z.ZodTypeAny, {
30
76
  type: "MESSAGE" | "STATUS_MESSAGE" | "ACTION_MESSAGE" | "OFFER_REQUEST_MESSAGE" | "OFFER_MESSAGE";
31
77
  id: string;
32
78
  createdAt: Date;
33
79
  conversationId: string;
34
- platformMessageId: string;
35
80
  body?: string | null | undefined;
36
- files?: {
37
- path: string;
81
+ offer?: {
82
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
38
83
  id: string;
39
- userId: string | number;
40
- createdAt: Date;
41
- signedUrl: string;
84
+ price: number;
85
+ originalPrice: number;
86
+ messageId: string;
87
+ } | null | undefined;
88
+ files?: {
89
+ fileId: string;
90
+ messageId: string;
91
+ file?: {
92
+ path: string;
93
+ id: string;
94
+ userId: string | number;
95
+ signedUrl: string;
96
+ createdAt: Date;
97
+ } | null | undefined;
98
+ index?: number | null | undefined;
42
99
  }[] | null | undefined;
43
100
  conversationUserId?: string | null | undefined;
101
+ platformMessageId?: string | null | undefined;
44
102
  }, {
45
103
  type: "MESSAGE" | "STATUS_MESSAGE" | "ACTION_MESSAGE" | "OFFER_REQUEST_MESSAGE" | "OFFER_MESSAGE";
46
104
  id: string;
47
105
  createdAt: Date;
48
106
  conversationId: string;
49
- platformMessageId: string;
50
107
  body?: string | null | undefined;
51
- files?: {
52
- path: string;
108
+ offer?: {
109
+ status: "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELLED";
53
110
  id: string;
54
- userId: string | number;
55
- createdAt: Date;
56
- signedUrl: string;
111
+ price: number;
112
+ originalPrice: number;
113
+ messageId: string;
114
+ } | null | undefined;
115
+ files?: {
116
+ fileId: string;
117
+ messageId: string;
118
+ file?: {
119
+ path: string;
120
+ id: string;
121
+ userId: string | number;
122
+ signedUrl: string;
123
+ createdAt: Date;
124
+ } | null | undefined;
125
+ index?: number | null | undefined;
57
126
  }[] | null | undefined;
58
127
  conversationUserId?: string | null | undefined;
128
+ platformMessageId?: string | null | undefined;
59
129
  }>;
60
130
  export type ConversationMessage = z.infer<typeof ConversationMessageSchema>;
@@ -3,14 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConversationMessageSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const controlresell_connector_1 = require("controlresell-connector");
6
- const File_1 = require("../../../users/files/File");
6
+ const ConversationMessageOffer_1 = require("./offers/ConversationMessageOffer");
7
+ const ConversationMessageFile_1 = require("./files/ConversationMessageFile");
7
8
  exports.ConversationMessageSchema = zod_1.z.object({
8
9
  id: zod_1.z.string().uuid(),
9
10
  conversationId: zod_1.z.string().uuid(),
10
11
  conversationUserId: zod_1.z.string().uuid().nullish(),
11
- platformMessageId: zod_1.z.string(),
12
+ platformMessageId: zod_1.z.string().nullish(),
12
13
  type: controlresell_connector_1.JobConversationMessageTypeSchema,
13
14
  body: zod_1.z.string().nullish(),
14
- files: zod_1.z.array(File_1.FileSchema).nullish(),
15
- createdAt: zod_1.z.coerce.date()
15
+ createdAt: zod_1.z.coerce.date(),
16
+ offer: ConversationMessageOffer_1.ConversationMessageOfferSchema.nullish(),
17
+ files: zod_1.z.array(ConversationMessageFile_1.ConversationMessageFileSchema).nullish()
16
18
  });
@@ -1,15 +1,17 @@
1
1
  import {z} from "zod"
2
2
  import {JobConversationMessageTypeSchema} from "controlresell-connector"
3
- import {FileSchema} from "../../../users/files/File"
3
+ import {ConversationMessageOfferSchema} from "./offers/ConversationMessageOffer"
4
+ import {ConversationMessageFileSchema} from "./files/ConversationMessageFile"
4
5
 
5
6
  export const ConversationMessageSchema = z.object({
6
7
  id: z.string().uuid(),
7
8
  conversationId: z.string().uuid(),
8
9
  conversationUserId: z.string().uuid().nullish(),
9
- platformMessageId: z.string(),
10
+ platformMessageId: z.string().nullish(),
10
11
  type: JobConversationMessageTypeSchema,
11
12
  body: z.string().nullish(),
12
- files: z.array(FileSchema).nullish(),
13
- createdAt: z.coerce.date()
13
+ createdAt: z.coerce.date(),
14
+ offer: ConversationMessageOfferSchema.nullish(),
15
+ files: z.array(ConversationMessageFileSchema).nullish()
14
16
  })
15
17
  export type ConversationMessage = z.infer<typeof ConversationMessageSchema>
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ export declare const ConversationMessageRequestSchema: z.ZodObject<{
3
+ message: z.ZodString;
4
+ filesId: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ message: string;
7
+ filesId?: string[] | null | undefined;
8
+ }, {
9
+ message: string;
10
+ filesId?: string[] | null | undefined;
11
+ }>;
12
+ export type ConversationMessageRequest = z.infer<typeof ConversationMessageRequestSchema>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConversationMessageRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ConversationMessageRequestSchema = zod_1.z.object({
6
+ message: zod_1.z.string(),
7
+ filesId: zod_1.z.array(zod_1.z.string().uuid()).nullish()
8
+ });