@remit/electrodb-entities 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +4007 -0
- package/index.d.cts +3153 -0
- package/index.d.mts +3153 -0
- package/index.d.ts +3153 -0
- package/index.mjs +4004 -0
- package/package.json +32 -0
package/index.mjs
ADDED
|
@@ -0,0 +1,4004 @@
|
|
|
1
|
+
import { CustomAttributeType } from "electrodb";
|
|
2
|
+
export const AccountExportRequest = {
|
|
3
|
+
attributes: {
|
|
4
|
+
accountExportRequestId: {
|
|
5
|
+
type: "string",
|
|
6
|
+
required: true,
|
|
7
|
+
validate: value => {
|
|
8
|
+
if (typeof value === "string" && value.length < 25)
|
|
9
|
+
throw new Error("'accountExportRequestId' must be at least 25 characters");
|
|
10
|
+
if (typeof value === "string" && value.length > 25)
|
|
11
|
+
throw new Error("'accountExportRequestId' must be at most 25 characters");
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
accountConfigId: {
|
|
16
|
+
type: "string",
|
|
17
|
+
required: true,
|
|
18
|
+
validate: value => {
|
|
19
|
+
if (typeof value === "string" && value.length < 25)
|
|
20
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
21
|
+
if (typeof value === "string" && value.length > 25)
|
|
22
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
userId: {
|
|
27
|
+
type: "string",
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
state: {
|
|
31
|
+
type: ["Pending", "Processing", "Ready", "Failed"],
|
|
32
|
+
required: true,
|
|
33
|
+
default: "Pending"
|
|
34
|
+
},
|
|
35
|
+
createdAt: {
|
|
36
|
+
type: "number",
|
|
37
|
+
readOnly: true,
|
|
38
|
+
required: true,
|
|
39
|
+
default: () => Date.now(),
|
|
40
|
+
set: () => Date.now()
|
|
41
|
+
},
|
|
42
|
+
updatedAt: {
|
|
43
|
+
type: "number",
|
|
44
|
+
watch: "*",
|
|
45
|
+
required: true,
|
|
46
|
+
default: () => Date.now(),
|
|
47
|
+
set: () => Date.now()
|
|
48
|
+
},
|
|
49
|
+
expiresAt: {
|
|
50
|
+
type: "number",
|
|
51
|
+
required: false,
|
|
52
|
+
validate: value => {
|
|
53
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
54
|
+
throw new Error("'expiresAt' must be an integer");
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
objectKey: {
|
|
59
|
+
type: "string",
|
|
60
|
+
required: false
|
|
61
|
+
},
|
|
62
|
+
downloadUrl: {
|
|
63
|
+
type: "string",
|
|
64
|
+
required: false
|
|
65
|
+
},
|
|
66
|
+
errorMessage: {
|
|
67
|
+
type: "string",
|
|
68
|
+
required: false
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
indexes: {
|
|
72
|
+
byAccountConfigId: {
|
|
73
|
+
pk: {
|
|
74
|
+
field: "gsi0pk",
|
|
75
|
+
composite: ["accountConfigId"]
|
|
76
|
+
},
|
|
77
|
+
sk: {
|
|
78
|
+
field: "gsi0sk",
|
|
79
|
+
composite: ["createdAt"]
|
|
80
|
+
},
|
|
81
|
+
index: "gsi0"
|
|
82
|
+
},
|
|
83
|
+
AccountExportRequest: {
|
|
84
|
+
pk: {
|
|
85
|
+
field: "pk",
|
|
86
|
+
composite: ["accountExportRequestId"]
|
|
87
|
+
},
|
|
88
|
+
sk: {
|
|
89
|
+
field: "sk",
|
|
90
|
+
composite: []
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
model: {
|
|
95
|
+
entity: "accountExportRequest",
|
|
96
|
+
service: "remit",
|
|
97
|
+
version: "1"
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
export const AccountConfig = {
|
|
101
|
+
attributes: {
|
|
102
|
+
accountConfigId: {
|
|
103
|
+
type: "string",
|
|
104
|
+
required: true,
|
|
105
|
+
validate: value => {
|
|
106
|
+
if (typeof value === "string" && value.length < 25)
|
|
107
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
108
|
+
if (typeof value === "string" && value.length > 25)
|
|
109
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
userId: {
|
|
114
|
+
type: "string",
|
|
115
|
+
required: true,
|
|
116
|
+
validate: value => {
|
|
117
|
+
if (typeof value === "string" && value.length < 25)
|
|
118
|
+
throw new Error("'userId' must be at least 25 characters");
|
|
119
|
+
if (typeof value === "string" && value.length > 25)
|
|
120
|
+
throw new Error("'userId' must be at most 25 characters");
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
name: {
|
|
125
|
+
type: "string",
|
|
126
|
+
required: false
|
|
127
|
+
},
|
|
128
|
+
state: {
|
|
129
|
+
type: ["active", "deleting"],
|
|
130
|
+
required: true,
|
|
131
|
+
default: "active"
|
|
132
|
+
},
|
|
133
|
+
deletedAt: {
|
|
134
|
+
type: "number",
|
|
135
|
+
required: false,
|
|
136
|
+
validate: value => {
|
|
137
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
138
|
+
throw new Error("'deletedAt' must be an integer");
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
cascadeStartedAt: {
|
|
143
|
+
type: "number",
|
|
144
|
+
required: false,
|
|
145
|
+
validate: value => {
|
|
146
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
147
|
+
throw new Error("'cascadeStartedAt' must be an integer");
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
createdAt: {
|
|
152
|
+
type: "number",
|
|
153
|
+
readOnly: true,
|
|
154
|
+
required: true,
|
|
155
|
+
default: () => Date.now(),
|
|
156
|
+
set: () => Date.now()
|
|
157
|
+
},
|
|
158
|
+
updatedAt: {
|
|
159
|
+
type: "number",
|
|
160
|
+
watch: "*",
|
|
161
|
+
required: true,
|
|
162
|
+
default: () => Date.now(),
|
|
163
|
+
set: () => Date.now()
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
indexes: {
|
|
167
|
+
allAccountConfigs: {
|
|
168
|
+
pk: {
|
|
169
|
+
field: "gsi2pk",
|
|
170
|
+
composite: []
|
|
171
|
+
},
|
|
172
|
+
sk: {
|
|
173
|
+
field: "gsi2sk",
|
|
174
|
+
composite: ["accountConfigId"]
|
|
175
|
+
},
|
|
176
|
+
index: "gsi2"
|
|
177
|
+
},
|
|
178
|
+
byAccountConfigId: {
|
|
179
|
+
pk: {
|
|
180
|
+
field: "gsi1pk",
|
|
181
|
+
composite: ["accountConfigId"]
|
|
182
|
+
},
|
|
183
|
+
sk: {
|
|
184
|
+
field: "gsi1sk",
|
|
185
|
+
composite: []
|
|
186
|
+
},
|
|
187
|
+
index: "gsi1",
|
|
188
|
+
collection: "accountConfig"
|
|
189
|
+
},
|
|
190
|
+
byUserId: {
|
|
191
|
+
pk: {
|
|
192
|
+
field: "gsi0pk",
|
|
193
|
+
composite: ["userId"]
|
|
194
|
+
},
|
|
195
|
+
sk: {
|
|
196
|
+
field: "gsi0sk",
|
|
197
|
+
composite: ["accountConfigId"]
|
|
198
|
+
},
|
|
199
|
+
index: "gsi0"
|
|
200
|
+
},
|
|
201
|
+
AccountConfig: {
|
|
202
|
+
pk: {
|
|
203
|
+
field: "pk",
|
|
204
|
+
composite: ["accountConfigId"]
|
|
205
|
+
},
|
|
206
|
+
sk: {
|
|
207
|
+
field: "sk",
|
|
208
|
+
composite: []
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
model: {
|
|
213
|
+
entity: "accountConfig",
|
|
214
|
+
service: "remit",
|
|
215
|
+
version: "1"
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
export const Account = {
|
|
219
|
+
attributes: {
|
|
220
|
+
accountId: {
|
|
221
|
+
type: "string",
|
|
222
|
+
required: true,
|
|
223
|
+
validate: value => {
|
|
224
|
+
if (typeof value === "string" && value.length < 25)
|
|
225
|
+
throw new Error("'accountId' must be at least 25 characters");
|
|
226
|
+
if (typeof value === "string" && value.length > 25)
|
|
227
|
+
throw new Error("'accountId' must be at most 25 characters");
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
accountConfigId: {
|
|
232
|
+
type: "string",
|
|
233
|
+
required: true,
|
|
234
|
+
validate: value => {
|
|
235
|
+
if (typeof value === "string" && value.length < 25)
|
|
236
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
237
|
+
if (typeof value === "string" && value.length > 25)
|
|
238
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
username: {
|
|
243
|
+
type: "string",
|
|
244
|
+
required: true,
|
|
245
|
+
validate: value => {
|
|
246
|
+
if (typeof value === "string" && value.length < 1)
|
|
247
|
+
throw new Error("'username' must be at least 1 characters");
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
email: {
|
|
252
|
+
type: "string",
|
|
253
|
+
required: true
|
|
254
|
+
},
|
|
255
|
+
authType: {
|
|
256
|
+
type: ["password", "oauthMicrosoft"],
|
|
257
|
+
required: true,
|
|
258
|
+
default: "password"
|
|
259
|
+
},
|
|
260
|
+
passwordHash: {
|
|
261
|
+
type: "string",
|
|
262
|
+
required: false
|
|
263
|
+
},
|
|
264
|
+
oauthRefreshTokenHash: {
|
|
265
|
+
type: "string",
|
|
266
|
+
required: false
|
|
267
|
+
},
|
|
268
|
+
oauthTokenUpdatedAt: {
|
|
269
|
+
type: "number",
|
|
270
|
+
required: false,
|
|
271
|
+
validate: value => {
|
|
272
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
273
|
+
throw new Error("'oauthTokenUpdatedAt' must be an integer");
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
imapHost: {
|
|
278
|
+
type: "string",
|
|
279
|
+
required: true,
|
|
280
|
+
validate: value => {
|
|
281
|
+
if (typeof value === "string" && value.length < 1)
|
|
282
|
+
throw new Error("'imapHost' must be at least 1 characters");
|
|
283
|
+
return true;
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
imapPort: {
|
|
287
|
+
type: "number",
|
|
288
|
+
required: true,
|
|
289
|
+
validate: value => {
|
|
290
|
+
if (typeof value === "number" && value < 1)
|
|
291
|
+
throw new Error("'imapPort' must be at least 1");
|
|
292
|
+
if (typeof value === "number" && value > 65535)
|
|
293
|
+
throw new Error("'imapPort' must be at most 65535");
|
|
294
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
295
|
+
throw new Error("'imapPort' must be an integer");
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
imapTls: {
|
|
300
|
+
type: "boolean",
|
|
301
|
+
required: true
|
|
302
|
+
},
|
|
303
|
+
imapStartTls: {
|
|
304
|
+
type: "boolean",
|
|
305
|
+
required: true
|
|
306
|
+
},
|
|
307
|
+
smtpEnabled: {
|
|
308
|
+
type: "boolean",
|
|
309
|
+
required: true,
|
|
310
|
+
default: false
|
|
311
|
+
},
|
|
312
|
+
smtpHost: {
|
|
313
|
+
type: "string",
|
|
314
|
+
required: true,
|
|
315
|
+
default: ""
|
|
316
|
+
},
|
|
317
|
+
smtpPort: {
|
|
318
|
+
type: "number",
|
|
319
|
+
required: true,
|
|
320
|
+
default: 587,
|
|
321
|
+
validate: value => {
|
|
322
|
+
if (typeof value === "number" && value < 1)
|
|
323
|
+
throw new Error("'smtpPort' must be at least 1");
|
|
324
|
+
if (typeof value === "number" && value > 65535)
|
|
325
|
+
throw new Error("'smtpPort' must be at most 65535");
|
|
326
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
327
|
+
throw new Error("'smtpPort' must be an integer");
|
|
328
|
+
return true;
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
smtpTls: {
|
|
332
|
+
type: "boolean",
|
|
333
|
+
required: true,
|
|
334
|
+
default: false
|
|
335
|
+
},
|
|
336
|
+
smtpStartTls: {
|
|
337
|
+
type: "boolean",
|
|
338
|
+
required: true,
|
|
339
|
+
default: true
|
|
340
|
+
},
|
|
341
|
+
smtpUsername: {
|
|
342
|
+
type: "string",
|
|
343
|
+
required: true,
|
|
344
|
+
default: ""
|
|
345
|
+
},
|
|
346
|
+
smtpPasswordHash: {
|
|
347
|
+
type: "string",
|
|
348
|
+
required: false
|
|
349
|
+
},
|
|
350
|
+
isActive: {
|
|
351
|
+
type: "boolean",
|
|
352
|
+
required: true
|
|
353
|
+
},
|
|
354
|
+
connectionState: {
|
|
355
|
+
type: ["not_authenticated", "authenticated", "selected", "logout", "reauth_required"],
|
|
356
|
+
required: true
|
|
357
|
+
},
|
|
358
|
+
lastConnectedAt: {
|
|
359
|
+
type: "number",
|
|
360
|
+
required: false,
|
|
361
|
+
validate: value => {
|
|
362
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
363
|
+
throw new Error("'lastConnectedAt' must be an integer");
|
|
364
|
+
return true;
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
lastSyncAt: {
|
|
368
|
+
type: "number",
|
|
369
|
+
required: false,
|
|
370
|
+
validate: value => {
|
|
371
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
372
|
+
throw new Error("'lastSyncAt' must be an integer");
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
lastError: {
|
|
377
|
+
type: "string",
|
|
378
|
+
required: false
|
|
379
|
+
},
|
|
380
|
+
syncPhase: {
|
|
381
|
+
type: ["idle", "discovering_mailboxes", "syncing_inbox", "syncing_others", "complete", "error"],
|
|
382
|
+
required: false
|
|
383
|
+
},
|
|
384
|
+
mailboxCountTotal: {
|
|
385
|
+
type: "number",
|
|
386
|
+
required: false,
|
|
387
|
+
validate: value => {
|
|
388
|
+
if (typeof value === "number" && value < 0)
|
|
389
|
+
throw new Error("'mailboxCountTotal' must be at least 0");
|
|
390
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
391
|
+
throw new Error("'mailboxCountTotal' must be an integer");
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
mailboxCountSynced: {
|
|
396
|
+
type: "number",
|
|
397
|
+
required: false,
|
|
398
|
+
validate: value => {
|
|
399
|
+
if (typeof value === "number" && value < 0)
|
|
400
|
+
throw new Error("'mailboxCountSynced' must be at least 0");
|
|
401
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
402
|
+
throw new Error("'mailboxCountSynced' must be an integer");
|
|
403
|
+
return true;
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
createdAt: {
|
|
407
|
+
type: "number",
|
|
408
|
+
readOnly: true,
|
|
409
|
+
required: true,
|
|
410
|
+
default: () => Date.now(),
|
|
411
|
+
set: () => Date.now()
|
|
412
|
+
},
|
|
413
|
+
updatedAt: {
|
|
414
|
+
type: "number",
|
|
415
|
+
watch: "*",
|
|
416
|
+
required: true,
|
|
417
|
+
default: () => Date.now(),
|
|
418
|
+
set: () => Date.now()
|
|
419
|
+
},
|
|
420
|
+
deletedAt: {
|
|
421
|
+
type: "number",
|
|
422
|
+
required: false,
|
|
423
|
+
validate: value => {
|
|
424
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
425
|
+
throw new Error("'deletedAt' must be an integer");
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
indexes: {
|
|
431
|
+
allAccounts: {
|
|
432
|
+
pk: {
|
|
433
|
+
field: "gsi2pk",
|
|
434
|
+
composite: []
|
|
435
|
+
},
|
|
436
|
+
sk: {
|
|
437
|
+
field: "gsi2sk",
|
|
438
|
+
composite: ["accountId"]
|
|
439
|
+
},
|
|
440
|
+
index: "gsi2"
|
|
441
|
+
},
|
|
442
|
+
byAccountId: {
|
|
443
|
+
pk: {
|
|
444
|
+
field: "gsi0pk",
|
|
445
|
+
composite: ["accountId"]
|
|
446
|
+
},
|
|
447
|
+
sk: {
|
|
448
|
+
field: "gsi0sk",
|
|
449
|
+
composite: []
|
|
450
|
+
},
|
|
451
|
+
index: "gsi0",
|
|
452
|
+
collection: "account"
|
|
453
|
+
},
|
|
454
|
+
byAccountConfigId: {
|
|
455
|
+
pk: {
|
|
456
|
+
field: "gsi1pk",
|
|
457
|
+
composite: ["accountConfigId"]
|
|
458
|
+
},
|
|
459
|
+
sk: {
|
|
460
|
+
field: "gsi1sk",
|
|
461
|
+
composite: ["accountId"]
|
|
462
|
+
},
|
|
463
|
+
index: "gsi1",
|
|
464
|
+
collection: "accountConfig"
|
|
465
|
+
},
|
|
466
|
+
Account: {
|
|
467
|
+
pk: {
|
|
468
|
+
field: "pk",
|
|
469
|
+
composite: ["accountId"]
|
|
470
|
+
},
|
|
471
|
+
sk: {
|
|
472
|
+
field: "sk",
|
|
473
|
+
composite: []
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
model: {
|
|
478
|
+
entity: "account",
|
|
479
|
+
service: "remit",
|
|
480
|
+
version: "1"
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
export const Mailbox = {
|
|
484
|
+
attributes: {
|
|
485
|
+
mailboxId: {
|
|
486
|
+
type: "string",
|
|
487
|
+
required: true,
|
|
488
|
+
validate: value => {
|
|
489
|
+
if (typeof value === "string" && value.length < 25)
|
|
490
|
+
throw new Error("'mailboxId' must be at least 25 characters");
|
|
491
|
+
if (typeof value === "string" && value.length > 25)
|
|
492
|
+
throw new Error("'mailboxId' must be at most 25 characters");
|
|
493
|
+
return true;
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
accountId: {
|
|
497
|
+
type: "string",
|
|
498
|
+
required: true,
|
|
499
|
+
validate: value => {
|
|
500
|
+
if (typeof value === "string" && value.length < 25)
|
|
501
|
+
throw new Error("'accountId' must be at least 25 characters");
|
|
502
|
+
if (typeof value === "string" && value.length > 25)
|
|
503
|
+
throw new Error("'accountId' must be at most 25 characters");
|
|
504
|
+
return true;
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
namespaceType: {
|
|
508
|
+
type: ["personal", "other_users", "shared"],
|
|
509
|
+
required: true,
|
|
510
|
+
default: "personal"
|
|
511
|
+
},
|
|
512
|
+
namespacePrefix: {
|
|
513
|
+
type: "string",
|
|
514
|
+
required: true
|
|
515
|
+
},
|
|
516
|
+
hierarchyDelimiter: {
|
|
517
|
+
type: "string",
|
|
518
|
+
required: true,
|
|
519
|
+
validate: value => {
|
|
520
|
+
if (typeof value === "string" && value.length < 1)
|
|
521
|
+
throw new Error("'hierarchyDelimiter' must be at least 1 characters");
|
|
522
|
+
if (typeof value === "string" && value.length > 1)
|
|
523
|
+
throw new Error("'hierarchyDelimiter' must be at most 1 characters");
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
fullPath: {
|
|
528
|
+
type: "string",
|
|
529
|
+
required: true,
|
|
530
|
+
validate: value => {
|
|
531
|
+
if (typeof value === "string" && value.length < 1)
|
|
532
|
+
throw new Error("'fullPath' must be at least 1 characters");
|
|
533
|
+
if (typeof value === "string" && value.length > 512)
|
|
534
|
+
throw new Error("'fullPath' must be at most 512 characters");
|
|
535
|
+
return true;
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
uidValidity: {
|
|
539
|
+
type: "number",
|
|
540
|
+
required: true,
|
|
541
|
+
validate: value => {
|
|
542
|
+
if (typeof value === "number" && value < 1)
|
|
543
|
+
throw new Error("'uidValidity' must be at least 1");
|
|
544
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
545
|
+
throw new Error("'uidValidity' must be an integer");
|
|
546
|
+
return true;
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
uidNext: {
|
|
550
|
+
type: "number",
|
|
551
|
+
required: true,
|
|
552
|
+
validate: value => {
|
|
553
|
+
if (typeof value === "number" && value < 1)
|
|
554
|
+
throw new Error("'uidNext' must be at least 1");
|
|
555
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
556
|
+
throw new Error("'uidNext' must be an integer");
|
|
557
|
+
return true;
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
highestModseq: {
|
|
561
|
+
type: "number",
|
|
562
|
+
required: true,
|
|
563
|
+
validate: value => {
|
|
564
|
+
if (typeof value === "number" && value < 0)
|
|
565
|
+
throw new Error("'highestModseq' must be at least 0");
|
|
566
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
567
|
+
throw new Error("'highestModseq' must be an integer");
|
|
568
|
+
return true;
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
messageCount: {
|
|
572
|
+
type: "number",
|
|
573
|
+
required: true,
|
|
574
|
+
validate: value => {
|
|
575
|
+
if (typeof value === "number" && value < 0)
|
|
576
|
+
throw new Error("'messageCount' must be at least 0");
|
|
577
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
578
|
+
throw new Error("'messageCount' must be an integer");
|
|
579
|
+
return true;
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
unseenCount: {
|
|
583
|
+
type: "number",
|
|
584
|
+
required: true,
|
|
585
|
+
validate: value => {
|
|
586
|
+
if (typeof value === "number" && value < 0)
|
|
587
|
+
throw new Error("'unseenCount' must be at least 0");
|
|
588
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
589
|
+
throw new Error("'unseenCount' must be an integer");
|
|
590
|
+
return true;
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
deletedCount: {
|
|
594
|
+
type: "number",
|
|
595
|
+
required: true,
|
|
596
|
+
validate: value => {
|
|
597
|
+
if (typeof value === "number" && value < 0)
|
|
598
|
+
throw new Error("'deletedCount' must be at least 0");
|
|
599
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
600
|
+
throw new Error("'deletedCount' must be an integer");
|
|
601
|
+
return true;
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
totalSize: {
|
|
605
|
+
type: "number",
|
|
606
|
+
required: true,
|
|
607
|
+
validate: value => {
|
|
608
|
+
if (typeof value === "number" && value < 0)
|
|
609
|
+
throw new Error("'totalSize' must be at least 0");
|
|
610
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
611
|
+
throw new Error("'totalSize' must be an integer");
|
|
612
|
+
return true;
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
lastSyncUid: {
|
|
616
|
+
type: "number",
|
|
617
|
+
required: true,
|
|
618
|
+
validate: value => {
|
|
619
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
620
|
+
throw new Error("'lastSyncUid' must be an integer");
|
|
621
|
+
return true;
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
highWaterMarkUid: {
|
|
625
|
+
type: "number",
|
|
626
|
+
required: true,
|
|
627
|
+
validate: value => {
|
|
628
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
629
|
+
throw new Error("'highWaterMarkUid' must be an integer");
|
|
630
|
+
return true;
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
lastMessageSyncAt: {
|
|
634
|
+
type: "number",
|
|
635
|
+
required: true,
|
|
636
|
+
validate: value => {
|
|
637
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
638
|
+
throw new Error("'lastMessageSyncAt' must be an integer");
|
|
639
|
+
return true;
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
initialSyncCompletedAt: {
|
|
643
|
+
type: "number",
|
|
644
|
+
required: false,
|
|
645
|
+
validate: value => {
|
|
646
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
647
|
+
throw new Error("'initialSyncCompletedAt' must be an integer");
|
|
648
|
+
return true;
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
parentMailboxId: {
|
|
652
|
+
type: "string",
|
|
653
|
+
required: true,
|
|
654
|
+
default: "None"
|
|
655
|
+
},
|
|
656
|
+
syncStatus: {
|
|
657
|
+
type: ["synced", "pending", "failed", "deleting"],
|
|
658
|
+
required: false
|
|
659
|
+
},
|
|
660
|
+
cursorState: {
|
|
661
|
+
type: ["normal", "cursor_invalid", "rebuilding"],
|
|
662
|
+
required: true,
|
|
663
|
+
default: "normal"
|
|
664
|
+
},
|
|
665
|
+
oldPath: {
|
|
666
|
+
type: "string",
|
|
667
|
+
required: false,
|
|
668
|
+
validate: value => {
|
|
669
|
+
if (typeof value === "string" && value.length > 512)
|
|
670
|
+
throw new Error("'oldPath' must be at most 512 characters");
|
|
671
|
+
return true;
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
specialUse: {
|
|
675
|
+
type: "set",
|
|
676
|
+
items: ["All", "Archive", "Drafts", "Flagged", "Junk", "Sent", "Trash", "Important"],
|
|
677
|
+
set: value => Array.isArray(value) && value.length === 0 ? undefined : value,
|
|
678
|
+
required: false
|
|
679
|
+
},
|
|
680
|
+
createdAt: {
|
|
681
|
+
type: "number",
|
|
682
|
+
readOnly: true,
|
|
683
|
+
required: true,
|
|
684
|
+
default: () => Date.now(),
|
|
685
|
+
set: () => Date.now()
|
|
686
|
+
},
|
|
687
|
+
updatedAt: {
|
|
688
|
+
type: "number",
|
|
689
|
+
watch: "*",
|
|
690
|
+
required: true,
|
|
691
|
+
default: () => Date.now(),
|
|
692
|
+
set: () => Date.now()
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
indexes: {
|
|
696
|
+
byMailboxId: {
|
|
697
|
+
pk: {
|
|
698
|
+
field: "gsi1pk",
|
|
699
|
+
composite: ["mailboxId"]
|
|
700
|
+
},
|
|
701
|
+
sk: {
|
|
702
|
+
field: "gsi1sk",
|
|
703
|
+
composite: []
|
|
704
|
+
},
|
|
705
|
+
index: "gsi1",
|
|
706
|
+
collection: "mailbox"
|
|
707
|
+
},
|
|
708
|
+
byAccountId: {
|
|
709
|
+
pk: {
|
|
710
|
+
field: "gsi0pk",
|
|
711
|
+
composite: ["accountId"]
|
|
712
|
+
},
|
|
713
|
+
sk: {
|
|
714
|
+
field: "gsi0sk",
|
|
715
|
+
composite: []
|
|
716
|
+
},
|
|
717
|
+
index: "gsi0",
|
|
718
|
+
collection: "account"
|
|
719
|
+
},
|
|
720
|
+
Mailbox: {
|
|
721
|
+
pk: {
|
|
722
|
+
field: "pk",
|
|
723
|
+
composite: ["mailboxId"]
|
|
724
|
+
},
|
|
725
|
+
sk: {
|
|
726
|
+
field: "sk",
|
|
727
|
+
composite: []
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
model: {
|
|
732
|
+
entity: "mailbox",
|
|
733
|
+
service: "remit",
|
|
734
|
+
version: "1"
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
export const Filter = {
|
|
738
|
+
attributes: {
|
|
739
|
+
filterId: {
|
|
740
|
+
type: "string",
|
|
741
|
+
required: true,
|
|
742
|
+
validate: value => {
|
|
743
|
+
if (typeof value === "string" && value.length < 25)
|
|
744
|
+
throw new Error("'filterId' must be at least 25 characters");
|
|
745
|
+
if (typeof value === "string" && value.length > 25)
|
|
746
|
+
throw new Error("'filterId' must be at most 25 characters");
|
|
747
|
+
return true;
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
accountConfigId: {
|
|
751
|
+
type: "string",
|
|
752
|
+
required: true,
|
|
753
|
+
validate: value => {
|
|
754
|
+
if (typeof value === "string" && value.length < 25)
|
|
755
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
756
|
+
if (typeof value === "string" && value.length > 25)
|
|
757
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
758
|
+
return true;
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
name: {
|
|
762
|
+
type: "string",
|
|
763
|
+
required: true,
|
|
764
|
+
validate: value => {
|
|
765
|
+
if (typeof value === "string" && value.length > 256)
|
|
766
|
+
throw new Error("'name' must be at most 256 characters");
|
|
767
|
+
return true;
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
scope: {
|
|
771
|
+
type: ["Standing", "Temporary"],
|
|
772
|
+
required: true
|
|
773
|
+
},
|
|
774
|
+
expiresAt: {
|
|
775
|
+
type: "string",
|
|
776
|
+
required: false
|
|
777
|
+
},
|
|
778
|
+
ttl: {
|
|
779
|
+
type: "number",
|
|
780
|
+
required: false,
|
|
781
|
+
validate: value => {
|
|
782
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
783
|
+
throw new Error("'ttl' must be an integer");
|
|
784
|
+
return true;
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
state: {
|
|
788
|
+
type: ["Active", "Expired"],
|
|
789
|
+
required: true,
|
|
790
|
+
default: "Active"
|
|
791
|
+
},
|
|
792
|
+
hasAnchor: {
|
|
793
|
+
type: "boolean",
|
|
794
|
+
required: true,
|
|
795
|
+
default: false
|
|
796
|
+
},
|
|
797
|
+
ruleChangedAt: {
|
|
798
|
+
type: "number",
|
|
799
|
+
required: true,
|
|
800
|
+
validate: value => {
|
|
801
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
802
|
+
throw new Error("'ruleChangedAt' must be an integer");
|
|
803
|
+
return true;
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
matchOperator: {
|
|
807
|
+
type: ["And", "Or"],
|
|
808
|
+
required: true,
|
|
809
|
+
default: "And"
|
|
810
|
+
},
|
|
811
|
+
literalClauses: {
|
|
812
|
+
type: "list",
|
|
813
|
+
items: {
|
|
814
|
+
type: "map",
|
|
815
|
+
properties: {
|
|
816
|
+
field: {
|
|
817
|
+
type: ["From", "Subject", "HasWords"],
|
|
818
|
+
required: true
|
|
819
|
+
},
|
|
820
|
+
value: {
|
|
821
|
+
type: "string",
|
|
822
|
+
required: true
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
required: true
|
|
827
|
+
},
|
|
828
|
+
actionLabelId: {
|
|
829
|
+
type: "string",
|
|
830
|
+
required: true,
|
|
831
|
+
default: "None"
|
|
832
|
+
},
|
|
833
|
+
actionMailboxId: {
|
|
834
|
+
type: "string",
|
|
835
|
+
required: true,
|
|
836
|
+
default: "None"
|
|
837
|
+
},
|
|
838
|
+
createdAt: {
|
|
839
|
+
type: "number",
|
|
840
|
+
readOnly: true,
|
|
841
|
+
required: true,
|
|
842
|
+
default: () => Date.now(),
|
|
843
|
+
set: () => Date.now()
|
|
844
|
+
},
|
|
845
|
+
updatedAt: {
|
|
846
|
+
type: "number",
|
|
847
|
+
watch: "*",
|
|
848
|
+
required: true,
|
|
849
|
+
default: () => Date.now(),
|
|
850
|
+
set: () => Date.now()
|
|
851
|
+
}
|
|
852
|
+
},
|
|
853
|
+
indexes: {
|
|
854
|
+
byAccountAndState: {
|
|
855
|
+
pk: {
|
|
856
|
+
field: "gsi1pk",
|
|
857
|
+
composite: ["accountConfigId"]
|
|
858
|
+
},
|
|
859
|
+
sk: {
|
|
860
|
+
field: "gsi1sk",
|
|
861
|
+
composite: ["state", "filterId"]
|
|
862
|
+
},
|
|
863
|
+
index: "gsi1"
|
|
864
|
+
},
|
|
865
|
+
Filter: {
|
|
866
|
+
pk: {
|
|
867
|
+
field: "pk",
|
|
868
|
+
composite: ["accountConfigId"]
|
|
869
|
+
},
|
|
870
|
+
sk: {
|
|
871
|
+
field: "sk",
|
|
872
|
+
composite: ["filterId"]
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
model: {
|
|
877
|
+
entity: "filter",
|
|
878
|
+
service: "remit",
|
|
879
|
+
version: "1"
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
export const OrganizeJobRequest = {
|
|
883
|
+
attributes: {
|
|
884
|
+
organizeJobId: {
|
|
885
|
+
type: "string",
|
|
886
|
+
required: true,
|
|
887
|
+
validate: value => {
|
|
888
|
+
if (typeof value === "string" && value.length < 25)
|
|
889
|
+
throw new Error("'organizeJobId' must be at least 25 characters");
|
|
890
|
+
if (typeof value === "string" && value.length > 25)
|
|
891
|
+
throw new Error("'organizeJobId' must be at most 25 characters");
|
|
892
|
+
return true;
|
|
893
|
+
}
|
|
894
|
+
},
|
|
895
|
+
accountConfigId: {
|
|
896
|
+
type: "string",
|
|
897
|
+
required: true,
|
|
898
|
+
validate: value => {
|
|
899
|
+
if (typeof value === "string" && value.length < 25)
|
|
900
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
901
|
+
if (typeof value === "string" && value.length > 25)
|
|
902
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
903
|
+
return true;
|
|
904
|
+
}
|
|
905
|
+
},
|
|
906
|
+
userId: {
|
|
907
|
+
type: "string",
|
|
908
|
+
required: true
|
|
909
|
+
},
|
|
910
|
+
state: {
|
|
911
|
+
type: ["Pending", "Running", "Complete", "Failed"],
|
|
912
|
+
required: true,
|
|
913
|
+
default: "Pending"
|
|
914
|
+
},
|
|
915
|
+
anchorMessageId: {
|
|
916
|
+
type: "string",
|
|
917
|
+
required: true,
|
|
918
|
+
default: "None"
|
|
919
|
+
},
|
|
920
|
+
matchOperator: {
|
|
921
|
+
type: ["And", "Or"],
|
|
922
|
+
required: true,
|
|
923
|
+
default: "And"
|
|
924
|
+
},
|
|
925
|
+
literalClauses: {
|
|
926
|
+
type: "list",
|
|
927
|
+
items: {
|
|
928
|
+
type: "map",
|
|
929
|
+
properties: {
|
|
930
|
+
field: {
|
|
931
|
+
type: ["From", "Subject", "HasWords"],
|
|
932
|
+
required: true
|
|
933
|
+
},
|
|
934
|
+
value: {
|
|
935
|
+
type: "string",
|
|
936
|
+
required: true
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
required: true
|
|
941
|
+
},
|
|
942
|
+
similarityThreshold: {
|
|
943
|
+
type: "number",
|
|
944
|
+
required: true,
|
|
945
|
+
default: 0.75,
|
|
946
|
+
validate: value => {
|
|
947
|
+
if (typeof value === "number" && !Number.isFinite(value))
|
|
948
|
+
throw new Error("'similarityThreshold' must be a finite number");
|
|
949
|
+
return true;
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
actionLabelId: {
|
|
953
|
+
type: "string",
|
|
954
|
+
required: true,
|
|
955
|
+
default: "None"
|
|
956
|
+
},
|
|
957
|
+
actionMailboxId: {
|
|
958
|
+
type: "string",
|
|
959
|
+
required: true,
|
|
960
|
+
default: "None"
|
|
961
|
+
},
|
|
962
|
+
matchedCount: {
|
|
963
|
+
type: "number",
|
|
964
|
+
required: true,
|
|
965
|
+
default: 0,
|
|
966
|
+
validate: value => {
|
|
967
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
968
|
+
throw new Error("'matchedCount' must be an integer");
|
|
969
|
+
return true;
|
|
970
|
+
}
|
|
971
|
+
},
|
|
972
|
+
appliedCount: {
|
|
973
|
+
type: "number",
|
|
974
|
+
required: true,
|
|
975
|
+
default: 0,
|
|
976
|
+
validate: value => {
|
|
977
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
978
|
+
throw new Error("'appliedCount' must be an integer");
|
|
979
|
+
return true;
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
failedCount: {
|
|
983
|
+
type: "number",
|
|
984
|
+
required: true,
|
|
985
|
+
default: 0,
|
|
986
|
+
validate: value => {
|
|
987
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
988
|
+
throw new Error("'failedCount' must be an integer");
|
|
989
|
+
return true;
|
|
990
|
+
}
|
|
991
|
+
},
|
|
992
|
+
errorMessage: {
|
|
993
|
+
type: "string",
|
|
994
|
+
required: true,
|
|
995
|
+
default: ""
|
|
996
|
+
},
|
|
997
|
+
ttl: {
|
|
998
|
+
type: "number",
|
|
999
|
+
required: true,
|
|
1000
|
+
validate: value => {
|
|
1001
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1002
|
+
throw new Error("'ttl' must be an integer");
|
|
1003
|
+
return true;
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
createdAt: {
|
|
1007
|
+
type: "number",
|
|
1008
|
+
readOnly: true,
|
|
1009
|
+
required: true,
|
|
1010
|
+
default: () => Date.now(),
|
|
1011
|
+
set: () => Date.now()
|
|
1012
|
+
},
|
|
1013
|
+
updatedAt: {
|
|
1014
|
+
type: "number",
|
|
1015
|
+
watch: "*",
|
|
1016
|
+
required: true,
|
|
1017
|
+
default: () => Date.now(),
|
|
1018
|
+
set: () => Date.now()
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
1021
|
+
indexes: {
|
|
1022
|
+
byAccountConfigId: {
|
|
1023
|
+
pk: {
|
|
1024
|
+
field: "gsi0pk",
|
|
1025
|
+
composite: ["accountConfigId"]
|
|
1026
|
+
},
|
|
1027
|
+
sk: {
|
|
1028
|
+
field: "gsi0sk",
|
|
1029
|
+
composite: ["createdAt"]
|
|
1030
|
+
},
|
|
1031
|
+
index: "gsi0"
|
|
1032
|
+
},
|
|
1033
|
+
OrganizeJobRequest: {
|
|
1034
|
+
pk: {
|
|
1035
|
+
field: "pk",
|
|
1036
|
+
composite: ["organizeJobId"]
|
|
1037
|
+
},
|
|
1038
|
+
sk: {
|
|
1039
|
+
field: "sk",
|
|
1040
|
+
composite: []
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
},
|
|
1044
|
+
model: {
|
|
1045
|
+
entity: "organizeJobRequest",
|
|
1046
|
+
service: "remit",
|
|
1047
|
+
version: "1"
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
export const ThreadMessage = {
|
|
1051
|
+
attributes: {
|
|
1052
|
+
threadMessageId: {
|
|
1053
|
+
type: "string",
|
|
1054
|
+
required: true,
|
|
1055
|
+
validate: value => {
|
|
1056
|
+
if (typeof value === "string" && value.length < 25)
|
|
1057
|
+
throw new Error("'threadMessageId' must be at least 25 characters");
|
|
1058
|
+
if (typeof value === "string" && value.length > 25)
|
|
1059
|
+
throw new Error("'threadMessageId' must be at most 25 characters");
|
|
1060
|
+
return true;
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
threadId: {
|
|
1064
|
+
type: "string",
|
|
1065
|
+
required: true,
|
|
1066
|
+
validate: value => {
|
|
1067
|
+
if (typeof value === "string" && value.length < 25)
|
|
1068
|
+
throw new Error("'threadId' must be at least 25 characters");
|
|
1069
|
+
if (typeof value === "string" && value.length > 25)
|
|
1070
|
+
throw new Error("'threadId' must be at most 25 characters");
|
|
1071
|
+
return true;
|
|
1072
|
+
}
|
|
1073
|
+
},
|
|
1074
|
+
messageId: {
|
|
1075
|
+
type: "string",
|
|
1076
|
+
required: true,
|
|
1077
|
+
validate: value => {
|
|
1078
|
+
if (typeof value === "string" && value.length < 25)
|
|
1079
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
1080
|
+
if (typeof value === "string" && value.length > 25)
|
|
1081
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
1082
|
+
return true;
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
accountConfigId: {
|
|
1086
|
+
type: "string",
|
|
1087
|
+
required: true,
|
|
1088
|
+
validate: value => {
|
|
1089
|
+
if (typeof value === "string" && value.length < 25)
|
|
1090
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
1091
|
+
if (typeof value === "string" && value.length > 25)
|
|
1092
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
1093
|
+
return true;
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
mailboxId: {
|
|
1097
|
+
type: "string",
|
|
1098
|
+
required: true,
|
|
1099
|
+
validate: value => {
|
|
1100
|
+
if (typeof value === "string" && value.length < 25)
|
|
1101
|
+
throw new Error("'mailboxId' must be at least 25 characters");
|
|
1102
|
+
if (typeof value === "string" && value.length > 25)
|
|
1103
|
+
throw new Error("'mailboxId' must be at most 25 characters");
|
|
1104
|
+
return true;
|
|
1105
|
+
}
|
|
1106
|
+
},
|
|
1107
|
+
uid: {
|
|
1108
|
+
type: "number",
|
|
1109
|
+
required: true,
|
|
1110
|
+
validate: value => {
|
|
1111
|
+
if (typeof value === "number" && value < 1)
|
|
1112
|
+
throw new Error("'uid' must be at least 1");
|
|
1113
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1114
|
+
throw new Error("'uid' must be an integer");
|
|
1115
|
+
return true;
|
|
1116
|
+
}
|
|
1117
|
+
},
|
|
1118
|
+
messageIdHeader: {
|
|
1119
|
+
type: "string",
|
|
1120
|
+
required: false
|
|
1121
|
+
},
|
|
1122
|
+
inReplyTo: {
|
|
1123
|
+
type: "string",
|
|
1124
|
+
required: false
|
|
1125
|
+
},
|
|
1126
|
+
referenceOrder: {
|
|
1127
|
+
type: "number",
|
|
1128
|
+
required: true,
|
|
1129
|
+
validate: value => {
|
|
1130
|
+
if (typeof value === "number" && value < 0)
|
|
1131
|
+
throw new Error("'referenceOrder' must be at least 0");
|
|
1132
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1133
|
+
throw new Error("'referenceOrder' must be an integer");
|
|
1134
|
+
return true;
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
fromEmail: {
|
|
1138
|
+
type: "string",
|
|
1139
|
+
required: false
|
|
1140
|
+
},
|
|
1141
|
+
fromName: {
|
|
1142
|
+
type: "string",
|
|
1143
|
+
required: false
|
|
1144
|
+
},
|
|
1145
|
+
subject: {
|
|
1146
|
+
type: "string",
|
|
1147
|
+
required: false
|
|
1148
|
+
},
|
|
1149
|
+
internalDate: {
|
|
1150
|
+
type: "number",
|
|
1151
|
+
required: true,
|
|
1152
|
+
validate: value => {
|
|
1153
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1154
|
+
throw new Error("'internalDate' must be an integer");
|
|
1155
|
+
return true;
|
|
1156
|
+
}
|
|
1157
|
+
},
|
|
1158
|
+
sentDate: {
|
|
1159
|
+
type: "number",
|
|
1160
|
+
required: true,
|
|
1161
|
+
validate: value => {
|
|
1162
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1163
|
+
throw new Error("'sentDate' must be an integer");
|
|
1164
|
+
return true;
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1167
|
+
isRead: {
|
|
1168
|
+
type: "boolean",
|
|
1169
|
+
required: true
|
|
1170
|
+
},
|
|
1171
|
+
hasAttachment: {
|
|
1172
|
+
type: "boolean",
|
|
1173
|
+
required: true
|
|
1174
|
+
},
|
|
1175
|
+
star: {
|
|
1176
|
+
type: ["none", "yellow", "orange", "red", "purple", "blue", "teal", "green", "yellow_bang", "red_bang", "purple_question", "blue_info", "orange_guillemet", "green_check", "yellow_check", "blue_star"],
|
|
1177
|
+
required: true,
|
|
1178
|
+
default: "none"
|
|
1179
|
+
},
|
|
1180
|
+
hasStars: {
|
|
1181
|
+
type: "boolean",
|
|
1182
|
+
required: true
|
|
1183
|
+
},
|
|
1184
|
+
isDeleted: {
|
|
1185
|
+
type: "boolean",
|
|
1186
|
+
required: true
|
|
1187
|
+
},
|
|
1188
|
+
snippet: {
|
|
1189
|
+
type: "string",
|
|
1190
|
+
required: false,
|
|
1191
|
+
validate: value => {
|
|
1192
|
+
if (typeof value === "string" && value.length > 256)
|
|
1193
|
+
throw new Error("'snippet' must be at most 256 characters");
|
|
1194
|
+
return true;
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
category: {
|
|
1198
|
+
type: ["uncategorized", "personal", "newsletter", "marketing", "automated", "transactional", "social"],
|
|
1199
|
+
required: true,
|
|
1200
|
+
default: "uncategorized"
|
|
1201
|
+
},
|
|
1202
|
+
createdAt: {
|
|
1203
|
+
type: "number",
|
|
1204
|
+
readOnly: true,
|
|
1205
|
+
required: true,
|
|
1206
|
+
default: () => Date.now(),
|
|
1207
|
+
set: () => Date.now()
|
|
1208
|
+
},
|
|
1209
|
+
updatedAt: {
|
|
1210
|
+
type: "number",
|
|
1211
|
+
watch: "*",
|
|
1212
|
+
required: true,
|
|
1213
|
+
default: () => Date.now(),
|
|
1214
|
+
set: () => Date.now()
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
indexes: {
|
|
1218
|
+
byMailboxAndReadStatus: {
|
|
1219
|
+
pk: {
|
|
1220
|
+
field: "pk",
|
|
1221
|
+
composite: ["accountConfigId"]
|
|
1222
|
+
},
|
|
1223
|
+
sk: {
|
|
1224
|
+
field: "lsi5sk",
|
|
1225
|
+
composite: ["mailboxId", "isRead", "sentDate"]
|
|
1226
|
+
},
|
|
1227
|
+
index: "lsi5"
|
|
1228
|
+
},
|
|
1229
|
+
byStarred: {
|
|
1230
|
+
pk: {
|
|
1231
|
+
field: "pk",
|
|
1232
|
+
composite: ["accountConfigId"]
|
|
1233
|
+
},
|
|
1234
|
+
sk: {
|
|
1235
|
+
field: "lsi4sk",
|
|
1236
|
+
composite: ["hasStars", "sentDate"]
|
|
1237
|
+
},
|
|
1238
|
+
index: "lsi4"
|
|
1239
|
+
},
|
|
1240
|
+
byAttachment: {
|
|
1241
|
+
pk: {
|
|
1242
|
+
field: "pk",
|
|
1243
|
+
composite: ["accountConfigId"]
|
|
1244
|
+
},
|
|
1245
|
+
sk: {
|
|
1246
|
+
field: "lsi3sk",
|
|
1247
|
+
composite: ["hasAttachment", "sentDate"]
|
|
1248
|
+
},
|
|
1249
|
+
index: "lsi3"
|
|
1250
|
+
},
|
|
1251
|
+
byMailboxId: {
|
|
1252
|
+
pk: {
|
|
1253
|
+
field: "pk",
|
|
1254
|
+
composite: ["accountConfigId"]
|
|
1255
|
+
},
|
|
1256
|
+
sk: {
|
|
1257
|
+
field: "lsi2sk",
|
|
1258
|
+
composite: ["mailboxId", "sentDate"]
|
|
1259
|
+
},
|
|
1260
|
+
index: "lsi2"
|
|
1261
|
+
},
|
|
1262
|
+
byDate: {
|
|
1263
|
+
pk: {
|
|
1264
|
+
field: "pk",
|
|
1265
|
+
composite: ["accountConfigId"]
|
|
1266
|
+
},
|
|
1267
|
+
sk: {
|
|
1268
|
+
field: "lsi1sk",
|
|
1269
|
+
composite: ["sentDate"]
|
|
1270
|
+
},
|
|
1271
|
+
index: "lsi1"
|
|
1272
|
+
},
|
|
1273
|
+
byUnread: {
|
|
1274
|
+
pk: {
|
|
1275
|
+
field: "gsi2pk",
|
|
1276
|
+
composite: ["accountConfigId"]
|
|
1277
|
+
},
|
|
1278
|
+
sk: {
|
|
1279
|
+
field: "gsi2sk",
|
|
1280
|
+
composite: ["isRead", "sentDate"]
|
|
1281
|
+
},
|
|
1282
|
+
index: "gsi2"
|
|
1283
|
+
},
|
|
1284
|
+
byMessageId: {
|
|
1285
|
+
pk: {
|
|
1286
|
+
field: "gsi1pk",
|
|
1287
|
+
composite: ["messageId"]
|
|
1288
|
+
},
|
|
1289
|
+
sk: {
|
|
1290
|
+
field: "gsi1sk",
|
|
1291
|
+
composite: []
|
|
1292
|
+
},
|
|
1293
|
+
index: "gsi1"
|
|
1294
|
+
},
|
|
1295
|
+
byThreadId: {
|
|
1296
|
+
pk: {
|
|
1297
|
+
field: "gsi0pk",
|
|
1298
|
+
composite: ["threadId"]
|
|
1299
|
+
},
|
|
1300
|
+
sk: {
|
|
1301
|
+
field: "gsi0sk",
|
|
1302
|
+
composite: ["sentDate"]
|
|
1303
|
+
},
|
|
1304
|
+
index: "gsi0",
|
|
1305
|
+
collection: "threadDetails"
|
|
1306
|
+
},
|
|
1307
|
+
ThreadMessage: {
|
|
1308
|
+
pk: {
|
|
1309
|
+
field: "pk",
|
|
1310
|
+
composite: ["accountConfigId"]
|
|
1311
|
+
},
|
|
1312
|
+
sk: {
|
|
1313
|
+
field: "sk",
|
|
1314
|
+
composite: ["threadMessageId"]
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
model: {
|
|
1319
|
+
entity: "threadMessage",
|
|
1320
|
+
service: "remit",
|
|
1321
|
+
version: "1"
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
export const OutboxMessage = {
|
|
1325
|
+
attributes: {
|
|
1326
|
+
outboxMessageId: {
|
|
1327
|
+
type: "string",
|
|
1328
|
+
required: true,
|
|
1329
|
+
validate: value => {
|
|
1330
|
+
if (typeof value === "string" && value.length < 25)
|
|
1331
|
+
throw new Error("'outboxMessageId' must be at least 25 characters");
|
|
1332
|
+
if (typeof value === "string" && value.length > 25)
|
|
1333
|
+
throw new Error("'outboxMessageId' must be at most 25 characters");
|
|
1334
|
+
return true;
|
|
1335
|
+
}
|
|
1336
|
+
},
|
|
1337
|
+
accountId: {
|
|
1338
|
+
type: "string",
|
|
1339
|
+
required: true,
|
|
1340
|
+
validate: value => {
|
|
1341
|
+
if (typeof value === "string" && value.length < 25)
|
|
1342
|
+
throw new Error("'accountId' must be at least 25 characters");
|
|
1343
|
+
if (typeof value === "string" && value.length > 25)
|
|
1344
|
+
throw new Error("'accountId' must be at most 25 characters");
|
|
1345
|
+
return true;
|
|
1346
|
+
}
|
|
1347
|
+
},
|
|
1348
|
+
accountConfigId: {
|
|
1349
|
+
type: "string",
|
|
1350
|
+
required: true,
|
|
1351
|
+
validate: value => {
|
|
1352
|
+
if (typeof value === "string" && value.length < 25)
|
|
1353
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
1354
|
+
if (typeof value === "string" && value.length > 25)
|
|
1355
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
1356
|
+
return true;
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
fromAddress: {
|
|
1360
|
+
type: "string",
|
|
1361
|
+
required: true
|
|
1362
|
+
},
|
|
1363
|
+
fromName: {
|
|
1364
|
+
type: "string",
|
|
1365
|
+
required: false
|
|
1366
|
+
},
|
|
1367
|
+
toAddresses: {
|
|
1368
|
+
type: "list",
|
|
1369
|
+
items: {
|
|
1370
|
+
type: "string"
|
|
1371
|
+
},
|
|
1372
|
+
required: true
|
|
1373
|
+
},
|
|
1374
|
+
ccAddresses: {
|
|
1375
|
+
type: "list",
|
|
1376
|
+
items: {
|
|
1377
|
+
type: "string"
|
|
1378
|
+
},
|
|
1379
|
+
required: true
|
|
1380
|
+
},
|
|
1381
|
+
bccAddresses: {
|
|
1382
|
+
type: "list",
|
|
1383
|
+
items: {
|
|
1384
|
+
type: "string"
|
|
1385
|
+
},
|
|
1386
|
+
required: true
|
|
1387
|
+
},
|
|
1388
|
+
replyToAddress: {
|
|
1389
|
+
type: "string",
|
|
1390
|
+
required: false
|
|
1391
|
+
},
|
|
1392
|
+
subject: {
|
|
1393
|
+
type: "string",
|
|
1394
|
+
required: false
|
|
1395
|
+
},
|
|
1396
|
+
messageIdValue: {
|
|
1397
|
+
type: "string",
|
|
1398
|
+
required: true
|
|
1399
|
+
},
|
|
1400
|
+
inReplyTo: {
|
|
1401
|
+
type: "string",
|
|
1402
|
+
required: false
|
|
1403
|
+
},
|
|
1404
|
+
references: {
|
|
1405
|
+
type: "list",
|
|
1406
|
+
items: {
|
|
1407
|
+
type: "string"
|
|
1408
|
+
},
|
|
1409
|
+
required: true
|
|
1410
|
+
},
|
|
1411
|
+
textBody: {
|
|
1412
|
+
type: "string",
|
|
1413
|
+
required: false
|
|
1414
|
+
},
|
|
1415
|
+
htmlBody: {
|
|
1416
|
+
type: "string",
|
|
1417
|
+
required: false
|
|
1418
|
+
},
|
|
1419
|
+
status: {
|
|
1420
|
+
type: ["draft", "queued", "sending", "sent", "failed", "blocked"],
|
|
1421
|
+
required: true
|
|
1422
|
+
},
|
|
1423
|
+
lastError: {
|
|
1424
|
+
type: "string",
|
|
1425
|
+
required: false
|
|
1426
|
+
},
|
|
1427
|
+
lastSmtpCode: {
|
|
1428
|
+
type: "number",
|
|
1429
|
+
required: false,
|
|
1430
|
+
validate: value => {
|
|
1431
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1432
|
+
throw new Error("'lastSmtpCode' must be an integer");
|
|
1433
|
+
return true;
|
|
1434
|
+
}
|
|
1435
|
+
},
|
|
1436
|
+
sentAt: {
|
|
1437
|
+
type: "number",
|
|
1438
|
+
required: false,
|
|
1439
|
+
validate: value => {
|
|
1440
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1441
|
+
throw new Error("'sentAt' must be an integer");
|
|
1442
|
+
return true;
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
smtpMessageId: {
|
|
1446
|
+
type: "string",
|
|
1447
|
+
required: false
|
|
1448
|
+
},
|
|
1449
|
+
createdAt: {
|
|
1450
|
+
type: "number",
|
|
1451
|
+
readOnly: true,
|
|
1452
|
+
required: true,
|
|
1453
|
+
default: () => Date.now(),
|
|
1454
|
+
set: () => Date.now()
|
|
1455
|
+
},
|
|
1456
|
+
updatedAt: {
|
|
1457
|
+
type: "number",
|
|
1458
|
+
watch: "*",
|
|
1459
|
+
required: true,
|
|
1460
|
+
default: () => Date.now(),
|
|
1461
|
+
set: () => Date.now()
|
|
1462
|
+
}
|
|
1463
|
+
},
|
|
1464
|
+
indexes: {
|
|
1465
|
+
byAccountId: {
|
|
1466
|
+
pk: {
|
|
1467
|
+
field: "gsi0pk",
|
|
1468
|
+
composite: ["accountId"]
|
|
1469
|
+
},
|
|
1470
|
+
sk: {
|
|
1471
|
+
field: "gsi0sk",
|
|
1472
|
+
composite: ["createdAt"]
|
|
1473
|
+
},
|
|
1474
|
+
index: "gsi0"
|
|
1475
|
+
},
|
|
1476
|
+
OutboxMessage: {
|
|
1477
|
+
pk: {
|
|
1478
|
+
field: "pk",
|
|
1479
|
+
composite: ["outboxMessageId"]
|
|
1480
|
+
},
|
|
1481
|
+
sk: {
|
|
1482
|
+
field: "sk",
|
|
1483
|
+
composite: []
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
},
|
|
1487
|
+
model: {
|
|
1488
|
+
entity: "outboxMessage",
|
|
1489
|
+
service: "remit",
|
|
1490
|
+
version: "1"
|
|
1491
|
+
}
|
|
1492
|
+
};
|
|
1493
|
+
export const Address = {
|
|
1494
|
+
attributes: {
|
|
1495
|
+
addressId: {
|
|
1496
|
+
type: "string",
|
|
1497
|
+
required: true,
|
|
1498
|
+
validate: value => {
|
|
1499
|
+
if (typeof value === "string" && value.length < 25)
|
|
1500
|
+
throw new Error("'addressId' must be at least 25 characters");
|
|
1501
|
+
if (typeof value === "string" && value.length > 25)
|
|
1502
|
+
throw new Error("'addressId' must be at most 25 characters");
|
|
1503
|
+
return true;
|
|
1504
|
+
}
|
|
1505
|
+
},
|
|
1506
|
+
accountConfigId: {
|
|
1507
|
+
type: "string",
|
|
1508
|
+
required: true,
|
|
1509
|
+
validate: value => {
|
|
1510
|
+
if (typeof value === "string" && value.length < 25)
|
|
1511
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
1512
|
+
if (typeof value === "string" && value.length > 25)
|
|
1513
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
1514
|
+
return true;
|
|
1515
|
+
}
|
|
1516
|
+
},
|
|
1517
|
+
displayName: {
|
|
1518
|
+
type: "string",
|
|
1519
|
+
required: false
|
|
1520
|
+
},
|
|
1521
|
+
localPart: {
|
|
1522
|
+
type: "string",
|
|
1523
|
+
required: true,
|
|
1524
|
+
validate: value => {
|
|
1525
|
+
if (typeof value === "string" && value.length < 1)
|
|
1526
|
+
throw new Error("'localPart' must be at least 1 characters");
|
|
1527
|
+
return true;
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
domain: {
|
|
1531
|
+
type: "string",
|
|
1532
|
+
required: true,
|
|
1533
|
+
validate: value => {
|
|
1534
|
+
if (typeof value === "string" && value.length < 1)
|
|
1535
|
+
throw new Error("'domain' must be at least 1 characters");
|
|
1536
|
+
return true;
|
|
1537
|
+
}
|
|
1538
|
+
},
|
|
1539
|
+
normalizedEmail: {
|
|
1540
|
+
type: "string",
|
|
1541
|
+
required: true
|
|
1542
|
+
},
|
|
1543
|
+
normalizedCompound: {
|
|
1544
|
+
type: "string",
|
|
1545
|
+
required: true
|
|
1546
|
+
},
|
|
1547
|
+
flags: {
|
|
1548
|
+
type: "map",
|
|
1549
|
+
properties: {
|
|
1550
|
+
trusted: {
|
|
1551
|
+
type: "map",
|
|
1552
|
+
properties: {
|
|
1553
|
+
value: {
|
|
1554
|
+
type: "boolean",
|
|
1555
|
+
required: true
|
|
1556
|
+
},
|
|
1557
|
+
setAt: {
|
|
1558
|
+
type: "number",
|
|
1559
|
+
required: true
|
|
1560
|
+
},
|
|
1561
|
+
setBy: {
|
|
1562
|
+
type: "string",
|
|
1563
|
+
required: false
|
|
1564
|
+
},
|
|
1565
|
+
expiresAt: {
|
|
1566
|
+
type: "number",
|
|
1567
|
+
required: false
|
|
1568
|
+
},
|
|
1569
|
+
reason: {
|
|
1570
|
+
type: "string",
|
|
1571
|
+
required: false
|
|
1572
|
+
}
|
|
1573
|
+
},
|
|
1574
|
+
required: false
|
|
1575
|
+
},
|
|
1576
|
+
blocked: {
|
|
1577
|
+
type: "map",
|
|
1578
|
+
properties: {
|
|
1579
|
+
value: {
|
|
1580
|
+
type: "boolean",
|
|
1581
|
+
required: true
|
|
1582
|
+
},
|
|
1583
|
+
setAt: {
|
|
1584
|
+
type: "number",
|
|
1585
|
+
required: true
|
|
1586
|
+
},
|
|
1587
|
+
setBy: {
|
|
1588
|
+
type: "string",
|
|
1589
|
+
required: false
|
|
1590
|
+
},
|
|
1591
|
+
expiresAt: {
|
|
1592
|
+
type: "number",
|
|
1593
|
+
required: false
|
|
1594
|
+
},
|
|
1595
|
+
reason: {
|
|
1596
|
+
type: "string",
|
|
1597
|
+
required: false
|
|
1598
|
+
}
|
|
1599
|
+
},
|
|
1600
|
+
required: false
|
|
1601
|
+
},
|
|
1602
|
+
muted: {
|
|
1603
|
+
type: "map",
|
|
1604
|
+
properties: {
|
|
1605
|
+
value: {
|
|
1606
|
+
type: "boolean",
|
|
1607
|
+
required: true
|
|
1608
|
+
},
|
|
1609
|
+
setAt: {
|
|
1610
|
+
type: "number",
|
|
1611
|
+
required: true
|
|
1612
|
+
},
|
|
1613
|
+
setBy: {
|
|
1614
|
+
type: "string",
|
|
1615
|
+
required: false
|
|
1616
|
+
},
|
|
1617
|
+
expiresAt: {
|
|
1618
|
+
type: "number",
|
|
1619
|
+
required: false
|
|
1620
|
+
},
|
|
1621
|
+
reason: {
|
|
1622
|
+
type: "string",
|
|
1623
|
+
required: false
|
|
1624
|
+
}
|
|
1625
|
+
},
|
|
1626
|
+
required: false
|
|
1627
|
+
},
|
|
1628
|
+
vip: {
|
|
1629
|
+
type: "map",
|
|
1630
|
+
properties: {
|
|
1631
|
+
value: {
|
|
1632
|
+
type: "boolean",
|
|
1633
|
+
required: true
|
|
1634
|
+
},
|
|
1635
|
+
setAt: {
|
|
1636
|
+
type: "number",
|
|
1637
|
+
required: true
|
|
1638
|
+
},
|
|
1639
|
+
setBy: {
|
|
1640
|
+
type: "string",
|
|
1641
|
+
required: false
|
|
1642
|
+
},
|
|
1643
|
+
expiresAt: {
|
|
1644
|
+
type: "number",
|
|
1645
|
+
required: false
|
|
1646
|
+
},
|
|
1647
|
+
reason: {
|
|
1648
|
+
type: "string",
|
|
1649
|
+
required: false
|
|
1650
|
+
}
|
|
1651
|
+
},
|
|
1652
|
+
required: false
|
|
1653
|
+
},
|
|
1654
|
+
wellknown: {
|
|
1655
|
+
type: "map",
|
|
1656
|
+
properties: {
|
|
1657
|
+
value: {
|
|
1658
|
+
type: "boolean",
|
|
1659
|
+
required: true
|
|
1660
|
+
},
|
|
1661
|
+
setAt: {
|
|
1662
|
+
type: "number",
|
|
1663
|
+
required: true
|
|
1664
|
+
},
|
|
1665
|
+
setBy: {
|
|
1666
|
+
type: "string",
|
|
1667
|
+
required: false
|
|
1668
|
+
},
|
|
1669
|
+
expiresAt: {
|
|
1670
|
+
type: "number",
|
|
1671
|
+
required: false
|
|
1672
|
+
},
|
|
1673
|
+
reason: {
|
|
1674
|
+
type: "string",
|
|
1675
|
+
required: false
|
|
1676
|
+
}
|
|
1677
|
+
},
|
|
1678
|
+
required: false
|
|
1679
|
+
},
|
|
1680
|
+
category: {
|
|
1681
|
+
type: "map",
|
|
1682
|
+
properties: {
|
|
1683
|
+
value: {
|
|
1684
|
+
type: ["uncategorized", "personal", "newsletter", "marketing", "automated", "transactional", "social"],
|
|
1685
|
+
required: true
|
|
1686
|
+
},
|
|
1687
|
+
setAt: {
|
|
1688
|
+
type: "number",
|
|
1689
|
+
required: true
|
|
1690
|
+
},
|
|
1691
|
+
setBy: {
|
|
1692
|
+
type: "string",
|
|
1693
|
+
required: false
|
|
1694
|
+
},
|
|
1695
|
+
expiresAt: {
|
|
1696
|
+
type: "number",
|
|
1697
|
+
required: false
|
|
1698
|
+
},
|
|
1699
|
+
reason: {
|
|
1700
|
+
type: "string",
|
|
1701
|
+
required: false
|
|
1702
|
+
}
|
|
1703
|
+
},
|
|
1704
|
+
required: false
|
|
1705
|
+
},
|
|
1706
|
+
autoArchive: {
|
|
1707
|
+
type: "map",
|
|
1708
|
+
properties: {
|
|
1709
|
+
value: {
|
|
1710
|
+
type: "boolean",
|
|
1711
|
+
required: true
|
|
1712
|
+
},
|
|
1713
|
+
setAt: {
|
|
1714
|
+
type: "number",
|
|
1715
|
+
required: true
|
|
1716
|
+
},
|
|
1717
|
+
setBy: {
|
|
1718
|
+
type: "string",
|
|
1719
|
+
required: false
|
|
1720
|
+
},
|
|
1721
|
+
expiresAt: {
|
|
1722
|
+
type: "number",
|
|
1723
|
+
required: false
|
|
1724
|
+
},
|
|
1725
|
+
reason: {
|
|
1726
|
+
type: "string",
|
|
1727
|
+
required: false
|
|
1728
|
+
}
|
|
1729
|
+
},
|
|
1730
|
+
required: false
|
|
1731
|
+
},
|
|
1732
|
+
unsubscribed: {
|
|
1733
|
+
type: "map",
|
|
1734
|
+
properties: {
|
|
1735
|
+
value: {
|
|
1736
|
+
type: "boolean",
|
|
1737
|
+
required: true
|
|
1738
|
+
},
|
|
1739
|
+
setAt: {
|
|
1740
|
+
type: "number",
|
|
1741
|
+
required: true
|
|
1742
|
+
},
|
|
1743
|
+
setBy: {
|
|
1744
|
+
type: "string",
|
|
1745
|
+
required: false
|
|
1746
|
+
},
|
|
1747
|
+
expiresAt: {
|
|
1748
|
+
type: "number",
|
|
1749
|
+
required: false
|
|
1750
|
+
},
|
|
1751
|
+
reason: {
|
|
1752
|
+
type: "string",
|
|
1753
|
+
required: false
|
|
1754
|
+
}
|
|
1755
|
+
},
|
|
1756
|
+
required: false
|
|
1757
|
+
}
|
|
1758
|
+
},
|
|
1759
|
+
required: true
|
|
1760
|
+
},
|
|
1761
|
+
inboundCount: {
|
|
1762
|
+
type: "number",
|
|
1763
|
+
required: true,
|
|
1764
|
+
default: 0,
|
|
1765
|
+
validate: value => {
|
|
1766
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1767
|
+
throw new Error("'inboundCount' must be an integer");
|
|
1768
|
+
return true;
|
|
1769
|
+
}
|
|
1770
|
+
},
|
|
1771
|
+
outboundCount: {
|
|
1772
|
+
type: "number",
|
|
1773
|
+
required: true,
|
|
1774
|
+
default: 0,
|
|
1775
|
+
validate: value => {
|
|
1776
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1777
|
+
throw new Error("'outboundCount' must be an integer");
|
|
1778
|
+
return true;
|
|
1779
|
+
}
|
|
1780
|
+
},
|
|
1781
|
+
replyCount: {
|
|
1782
|
+
type: "number",
|
|
1783
|
+
required: true,
|
|
1784
|
+
default: 0,
|
|
1785
|
+
validate: value => {
|
|
1786
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1787
|
+
throw new Error("'replyCount' must be an integer");
|
|
1788
|
+
return true;
|
|
1789
|
+
}
|
|
1790
|
+
},
|
|
1791
|
+
lastInboundAt: {
|
|
1792
|
+
type: "number",
|
|
1793
|
+
required: true,
|
|
1794
|
+
default: 0,
|
|
1795
|
+
validate: value => {
|
|
1796
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1797
|
+
throw new Error("'lastInboundAt' must be an integer");
|
|
1798
|
+
return true;
|
|
1799
|
+
}
|
|
1800
|
+
},
|
|
1801
|
+
lastOutboundAt: {
|
|
1802
|
+
type: "number",
|
|
1803
|
+
required: false,
|
|
1804
|
+
validate: value => {
|
|
1805
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1806
|
+
throw new Error("'lastOutboundAt' must be an integer");
|
|
1807
|
+
return true;
|
|
1808
|
+
}
|
|
1809
|
+
},
|
|
1810
|
+
lastReplyAt: {
|
|
1811
|
+
type: "number",
|
|
1812
|
+
required: true,
|
|
1813
|
+
default: 0,
|
|
1814
|
+
validate: value => {
|
|
1815
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1816
|
+
throw new Error("'lastReplyAt' must be an integer");
|
|
1817
|
+
return true;
|
|
1818
|
+
}
|
|
1819
|
+
},
|
|
1820
|
+
createdAt: {
|
|
1821
|
+
type: "number",
|
|
1822
|
+
readOnly: true,
|
|
1823
|
+
required: true,
|
|
1824
|
+
default: () => Date.now(),
|
|
1825
|
+
set: () => Date.now()
|
|
1826
|
+
},
|
|
1827
|
+
updatedAt: {
|
|
1828
|
+
type: "number",
|
|
1829
|
+
watch: "*",
|
|
1830
|
+
required: true,
|
|
1831
|
+
default: () => Date.now(),
|
|
1832
|
+
set: () => Date.now()
|
|
1833
|
+
}
|
|
1834
|
+
},
|
|
1835
|
+
indexes: {
|
|
1836
|
+
byAccountConfigId: {
|
|
1837
|
+
pk: {
|
|
1838
|
+
field: "gsi1pk",
|
|
1839
|
+
composite: ["accountConfigId"]
|
|
1840
|
+
},
|
|
1841
|
+
sk: {
|
|
1842
|
+
field: "gsi1sk",
|
|
1843
|
+
composite: ["normalizedCompound"]
|
|
1844
|
+
},
|
|
1845
|
+
index: "gsi1",
|
|
1846
|
+
collection: "accountConfig"
|
|
1847
|
+
},
|
|
1848
|
+
Address: {
|
|
1849
|
+
pk: {
|
|
1850
|
+
field: "pk",
|
|
1851
|
+
composite: ["addressId"]
|
|
1852
|
+
},
|
|
1853
|
+
sk: {
|
|
1854
|
+
field: "sk",
|
|
1855
|
+
composite: []
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
},
|
|
1859
|
+
model: {
|
|
1860
|
+
entity: "address",
|
|
1861
|
+
service: "remit",
|
|
1862
|
+
version: "1"
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
export const Message = {
|
|
1866
|
+
attributes: {
|
|
1867
|
+
messageId: {
|
|
1868
|
+
type: "string",
|
|
1869
|
+
required: true,
|
|
1870
|
+
validate: value => {
|
|
1871
|
+
if (typeof value === "string" && value.length < 25)
|
|
1872
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
1873
|
+
if (typeof value === "string" && value.length > 25)
|
|
1874
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
1875
|
+
return true;
|
|
1876
|
+
}
|
|
1877
|
+
},
|
|
1878
|
+
mailboxId: {
|
|
1879
|
+
type: "string",
|
|
1880
|
+
required: true,
|
|
1881
|
+
validate: value => {
|
|
1882
|
+
if (typeof value === "string" && value.length < 25)
|
|
1883
|
+
throw new Error("'mailboxId' must be at least 25 characters");
|
|
1884
|
+
if (typeof value === "string" && value.length > 25)
|
|
1885
|
+
throw new Error("'mailboxId' must be at most 25 characters");
|
|
1886
|
+
return true;
|
|
1887
|
+
}
|
|
1888
|
+
},
|
|
1889
|
+
uid: {
|
|
1890
|
+
type: "number",
|
|
1891
|
+
required: true,
|
|
1892
|
+
validate: value => {
|
|
1893
|
+
if (typeof value === "number" && value < 1)
|
|
1894
|
+
throw new Error("'uid' must be at least 1");
|
|
1895
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1896
|
+
throw new Error("'uid' must be an integer");
|
|
1897
|
+
return true;
|
|
1898
|
+
}
|
|
1899
|
+
},
|
|
1900
|
+
sequenceNumber: {
|
|
1901
|
+
type: "number",
|
|
1902
|
+
required: true,
|
|
1903
|
+
validate: value => {
|
|
1904
|
+
if (typeof value === "number" && value < 1)
|
|
1905
|
+
throw new Error("'sequenceNumber' must be at least 1");
|
|
1906
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1907
|
+
throw new Error("'sequenceNumber' must be an integer");
|
|
1908
|
+
return true;
|
|
1909
|
+
}
|
|
1910
|
+
},
|
|
1911
|
+
rfc822Size: {
|
|
1912
|
+
type: "number",
|
|
1913
|
+
required: true,
|
|
1914
|
+
validate: value => {
|
|
1915
|
+
if (typeof value === "number" && value < 0)
|
|
1916
|
+
throw new Error("'rfc822Size' must be at least 0");
|
|
1917
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1918
|
+
throw new Error("'rfc822Size' must be an integer");
|
|
1919
|
+
return true;
|
|
1920
|
+
}
|
|
1921
|
+
},
|
|
1922
|
+
internalDate: {
|
|
1923
|
+
type: "number",
|
|
1924
|
+
required: true,
|
|
1925
|
+
validate: value => {
|
|
1926
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1927
|
+
throw new Error("'internalDate' must be an integer");
|
|
1928
|
+
return true;
|
|
1929
|
+
}
|
|
1930
|
+
},
|
|
1931
|
+
messageIdHeader: {
|
|
1932
|
+
type: "string",
|
|
1933
|
+
required: false
|
|
1934
|
+
},
|
|
1935
|
+
envelopeId: {
|
|
1936
|
+
type: "string",
|
|
1937
|
+
required: true,
|
|
1938
|
+
validate: value => {
|
|
1939
|
+
if (typeof value === "string" && value.length < 25)
|
|
1940
|
+
throw new Error("'envelopeId' must be at least 25 characters");
|
|
1941
|
+
if (typeof value === "string" && value.length > 25)
|
|
1942
|
+
throw new Error("'envelopeId' must be at most 25 characters");
|
|
1943
|
+
return true;
|
|
1944
|
+
}
|
|
1945
|
+
},
|
|
1946
|
+
rootBodyPartId: {
|
|
1947
|
+
type: "string",
|
|
1948
|
+
required: true,
|
|
1949
|
+
validate: value => {
|
|
1950
|
+
if (typeof value === "string" && value.length < 25)
|
|
1951
|
+
throw new Error("'rootBodyPartId' must be at least 25 characters");
|
|
1952
|
+
if (typeof value === "string" && value.length > 25)
|
|
1953
|
+
throw new Error("'rootBodyPartId' must be at most 25 characters");
|
|
1954
|
+
return true;
|
|
1955
|
+
}
|
|
1956
|
+
},
|
|
1957
|
+
bodyStorageKey: {
|
|
1958
|
+
type: "string",
|
|
1959
|
+
required: false
|
|
1960
|
+
},
|
|
1961
|
+
status: {
|
|
1962
|
+
type: ["active", "deleting", "deleted", "moving"],
|
|
1963
|
+
required: true,
|
|
1964
|
+
default: "active"
|
|
1965
|
+
},
|
|
1966
|
+
syncStatus: {
|
|
1967
|
+
type: ["synced", "pending", "failed"],
|
|
1968
|
+
required: true,
|
|
1969
|
+
default: "synced"
|
|
1970
|
+
},
|
|
1971
|
+
originalMailboxId: {
|
|
1972
|
+
type: "string",
|
|
1973
|
+
required: false,
|
|
1974
|
+
validate: value => {
|
|
1975
|
+
if (typeof value === "string" && value.length < 25)
|
|
1976
|
+
throw new Error("'originalMailboxId' must be at least 25 characters");
|
|
1977
|
+
if (typeof value === "string" && value.length > 25)
|
|
1978
|
+
throw new Error("'originalMailboxId' must be at most 25 characters");
|
|
1979
|
+
return true;
|
|
1980
|
+
}
|
|
1981
|
+
},
|
|
1982
|
+
originalUid: {
|
|
1983
|
+
type: "number",
|
|
1984
|
+
required: false,
|
|
1985
|
+
validate: value => {
|
|
1986
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
1987
|
+
throw new Error("'originalUid' must be an integer");
|
|
1988
|
+
return true;
|
|
1989
|
+
}
|
|
1990
|
+
},
|
|
1991
|
+
category: {
|
|
1992
|
+
type: ["uncategorized", "personal", "newsletter", "marketing", "automated", "transactional", "social"],
|
|
1993
|
+
required: true,
|
|
1994
|
+
default: "uncategorized"
|
|
1995
|
+
},
|
|
1996
|
+
authenticity: {
|
|
1997
|
+
type: "map",
|
|
1998
|
+
properties: {
|
|
1999
|
+
fromDomain: {
|
|
2000
|
+
type: "string",
|
|
2001
|
+
required: true
|
|
2002
|
+
},
|
|
2003
|
+
dkimDomain: {
|
|
2004
|
+
type: "string",
|
|
2005
|
+
required: false
|
|
2006
|
+
},
|
|
2007
|
+
dkimMismatch: {
|
|
2008
|
+
type: "boolean",
|
|
2009
|
+
required: true
|
|
2010
|
+
}
|
|
2011
|
+
},
|
|
2012
|
+
required: false
|
|
2013
|
+
},
|
|
2014
|
+
authResult: {
|
|
2015
|
+
type: "map",
|
|
2016
|
+
properties: {
|
|
2017
|
+
dmarc: {
|
|
2018
|
+
type: ["Pass", "Fail", "None", "Neutral", "Softfail"],
|
|
2019
|
+
required: false
|
|
2020
|
+
},
|
|
2021
|
+
spf: {
|
|
2022
|
+
type: ["Pass", "Fail", "None", "Neutral", "Softfail"],
|
|
2023
|
+
required: false
|
|
2024
|
+
},
|
|
2025
|
+
dkim: {
|
|
2026
|
+
type: ["Pass", "Fail", "None", "Neutral", "Softfail"],
|
|
2027
|
+
required: false
|
|
2028
|
+
}
|
|
2029
|
+
},
|
|
2030
|
+
required: false
|
|
2031
|
+
},
|
|
2032
|
+
providerSpam: {
|
|
2033
|
+
type: "map",
|
|
2034
|
+
properties: {
|
|
2035
|
+
classified: {
|
|
2036
|
+
type: "boolean",
|
|
2037
|
+
required: true
|
|
2038
|
+
},
|
|
2039
|
+
score: {
|
|
2040
|
+
type: "string",
|
|
2041
|
+
required: false
|
|
2042
|
+
},
|
|
2043
|
+
source: {
|
|
2044
|
+
type: "string",
|
|
2045
|
+
required: false
|
|
2046
|
+
}
|
|
2047
|
+
},
|
|
2048
|
+
required: false
|
|
2049
|
+
},
|
|
2050
|
+
hasListUnsubscribe: {
|
|
2051
|
+
type: "boolean",
|
|
2052
|
+
required: true,
|
|
2053
|
+
default: false
|
|
2054
|
+
},
|
|
2055
|
+
movedByRemit: {
|
|
2056
|
+
type: "boolean",
|
|
2057
|
+
required: true,
|
|
2058
|
+
default: false
|
|
2059
|
+
},
|
|
2060
|
+
placementVerdict: {
|
|
2061
|
+
type: "map",
|
|
2062
|
+
properties: {
|
|
2063
|
+
action: {
|
|
2064
|
+
type: ["MoveToInbox", "MoveToJunk"],
|
|
2065
|
+
required: true
|
|
2066
|
+
},
|
|
2067
|
+
confidence: {
|
|
2068
|
+
type: ["Confident", "Unsure"],
|
|
2069
|
+
required: true
|
|
2070
|
+
},
|
|
2071
|
+
fromPlacement: {
|
|
2072
|
+
type: "string",
|
|
2073
|
+
required: true
|
|
2074
|
+
},
|
|
2075
|
+
reasons: {
|
|
2076
|
+
type: "list",
|
|
2077
|
+
items: {
|
|
2078
|
+
type: "string"
|
|
2079
|
+
},
|
|
2080
|
+
required: true
|
|
2081
|
+
},
|
|
2082
|
+
dryRun: {
|
|
2083
|
+
type: "boolean",
|
|
2084
|
+
required: true
|
|
2085
|
+
},
|
|
2086
|
+
decidedAt: {
|
|
2087
|
+
type: "number",
|
|
2088
|
+
required: true
|
|
2089
|
+
}
|
|
2090
|
+
},
|
|
2091
|
+
required: false
|
|
2092
|
+
},
|
|
2093
|
+
createdAt: {
|
|
2094
|
+
type: "number",
|
|
2095
|
+
readOnly: true,
|
|
2096
|
+
required: true,
|
|
2097
|
+
default: () => Date.now(),
|
|
2098
|
+
set: () => Date.now()
|
|
2099
|
+
},
|
|
2100
|
+
updatedAt: {
|
|
2101
|
+
type: "number",
|
|
2102
|
+
watch: "*",
|
|
2103
|
+
required: true,
|
|
2104
|
+
default: () => Date.now(),
|
|
2105
|
+
set: () => Date.now()
|
|
2106
|
+
}
|
|
2107
|
+
},
|
|
2108
|
+
indexes: {
|
|
2109
|
+
byMessageId: {
|
|
2110
|
+
pk: {
|
|
2111
|
+
field: "gsi2pk",
|
|
2112
|
+
composite: ["messageId"]
|
|
2113
|
+
},
|
|
2114
|
+
sk: {
|
|
2115
|
+
field: "gsi2sk",
|
|
2116
|
+
composite: []
|
|
2117
|
+
},
|
|
2118
|
+
index: "gsi2",
|
|
2119
|
+
collection: "messageData"
|
|
2120
|
+
},
|
|
2121
|
+
byMailboxId: {
|
|
2122
|
+
pk: {
|
|
2123
|
+
field: "gsi0pk",
|
|
2124
|
+
composite: ["mailboxId"]
|
|
2125
|
+
},
|
|
2126
|
+
sk: {
|
|
2127
|
+
field: "gsi0sk",
|
|
2128
|
+
composite: ["uid"]
|
|
2129
|
+
},
|
|
2130
|
+
index: "gsi0",
|
|
2131
|
+
collection: "message"
|
|
2132
|
+
},
|
|
2133
|
+
Message: {
|
|
2134
|
+
pk: {
|
|
2135
|
+
field: "pk",
|
|
2136
|
+
composite: ["messageId"]
|
|
2137
|
+
},
|
|
2138
|
+
sk: {
|
|
2139
|
+
field: "sk",
|
|
2140
|
+
composite: []
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
},
|
|
2144
|
+
model: {
|
|
2145
|
+
entity: "message",
|
|
2146
|
+
service: "remit",
|
|
2147
|
+
version: "1"
|
|
2148
|
+
}
|
|
2149
|
+
};
|
|
2150
|
+
export const BodyPart = {
|
|
2151
|
+
attributes: {
|
|
2152
|
+
bodyPartId: {
|
|
2153
|
+
type: "string",
|
|
2154
|
+
required: true,
|
|
2155
|
+
validate: value => {
|
|
2156
|
+
if (typeof value === "string" && value.length < 25)
|
|
2157
|
+
throw new Error("'bodyPartId' must be at least 25 characters");
|
|
2158
|
+
if (typeof value === "string" && value.length > 25)
|
|
2159
|
+
throw new Error("'bodyPartId' must be at most 25 characters");
|
|
2160
|
+
return true;
|
|
2161
|
+
}
|
|
2162
|
+
},
|
|
2163
|
+
messageId: {
|
|
2164
|
+
type: "string",
|
|
2165
|
+
required: true,
|
|
2166
|
+
validate: value => {
|
|
2167
|
+
if (typeof value === "string" && value.length < 25)
|
|
2168
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
2169
|
+
if (typeof value === "string" && value.length > 25)
|
|
2170
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
2171
|
+
return true;
|
|
2172
|
+
}
|
|
2173
|
+
},
|
|
2174
|
+
parentBodyPartId: {
|
|
2175
|
+
type: "string",
|
|
2176
|
+
required: false,
|
|
2177
|
+
validate: value => {
|
|
2178
|
+
if (typeof value === "string" && value.length < 25)
|
|
2179
|
+
throw new Error("'parentBodyPartId' must be at least 25 characters");
|
|
2180
|
+
if (typeof value === "string" && value.length > 25)
|
|
2181
|
+
throw new Error("'parentBodyPartId' must be at most 25 characters");
|
|
2182
|
+
return true;
|
|
2183
|
+
}
|
|
2184
|
+
},
|
|
2185
|
+
partPath: {
|
|
2186
|
+
type: "string",
|
|
2187
|
+
required: true,
|
|
2188
|
+
validate: value => {
|
|
2189
|
+
if (typeof value === "string" && value.length < 1)
|
|
2190
|
+
throw new Error("'partPath' must be at least 1 characters");
|
|
2191
|
+
return true;
|
|
2192
|
+
}
|
|
2193
|
+
},
|
|
2194
|
+
mediaType: {
|
|
2195
|
+
type: ["TEXT", "IMAGE", "AUDIO", "VIDEO", "APPLICATION", "MULTIPART", "MESSAGE"],
|
|
2196
|
+
required: true
|
|
2197
|
+
},
|
|
2198
|
+
mediaSubtype: {
|
|
2199
|
+
type: "string",
|
|
2200
|
+
required: true,
|
|
2201
|
+
validate: value => {
|
|
2202
|
+
if (typeof value === "string" && value.length < 1)
|
|
2203
|
+
throw new Error("'mediaSubtype' must be at least 1 characters");
|
|
2204
|
+
return true;
|
|
2205
|
+
}
|
|
2206
|
+
},
|
|
2207
|
+
contentId: {
|
|
2208
|
+
type: "string",
|
|
2209
|
+
required: false
|
|
2210
|
+
},
|
|
2211
|
+
contentDescription: {
|
|
2212
|
+
type: "string",
|
|
2213
|
+
required: false
|
|
2214
|
+
},
|
|
2215
|
+
transferEncoding: {
|
|
2216
|
+
type: ["7BIT", "8BIT", "BINARY", "BASE64", "QUOTED-PRINTABLE"],
|
|
2217
|
+
required: true
|
|
2218
|
+
},
|
|
2219
|
+
sizeOctets: {
|
|
2220
|
+
type: "number",
|
|
2221
|
+
required: true,
|
|
2222
|
+
validate: value => {
|
|
2223
|
+
if (typeof value === "number" && value < 0)
|
|
2224
|
+
throw new Error("'sizeOctets' must be at least 0");
|
|
2225
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
2226
|
+
throw new Error("'sizeOctets' must be an integer");
|
|
2227
|
+
return true;
|
|
2228
|
+
}
|
|
2229
|
+
},
|
|
2230
|
+
lineCount: {
|
|
2231
|
+
type: "number",
|
|
2232
|
+
required: false,
|
|
2233
|
+
validate: value => {
|
|
2234
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
2235
|
+
throw new Error("'lineCount' must be an integer");
|
|
2236
|
+
return true;
|
|
2237
|
+
}
|
|
2238
|
+
},
|
|
2239
|
+
md5Hash: {
|
|
2240
|
+
type: "string",
|
|
2241
|
+
required: false
|
|
2242
|
+
},
|
|
2243
|
+
disposition: {
|
|
2244
|
+
type: ["inline", "attachment"],
|
|
2245
|
+
required: false
|
|
2246
|
+
},
|
|
2247
|
+
dispositionFilename: {
|
|
2248
|
+
type: "string",
|
|
2249
|
+
required: false
|
|
2250
|
+
},
|
|
2251
|
+
language: {
|
|
2252
|
+
type: "string",
|
|
2253
|
+
required: false
|
|
2254
|
+
},
|
|
2255
|
+
location: {
|
|
2256
|
+
type: "string",
|
|
2257
|
+
required: false
|
|
2258
|
+
},
|
|
2259
|
+
isMultipart: {
|
|
2260
|
+
type: "boolean",
|
|
2261
|
+
required: true
|
|
2262
|
+
},
|
|
2263
|
+
multipartSubtype: {
|
|
2264
|
+
type: ["mixed", "alternative", "digest", "parallel", "related", "signed", "encrypted", "form-data", "report"],
|
|
2265
|
+
required: false
|
|
2266
|
+
},
|
|
2267
|
+
createdAt: {
|
|
2268
|
+
type: "number",
|
|
2269
|
+
readOnly: true,
|
|
2270
|
+
required: true,
|
|
2271
|
+
default: () => Date.now(),
|
|
2272
|
+
set: () => Date.now()
|
|
2273
|
+
},
|
|
2274
|
+
updatedAt: {
|
|
2275
|
+
type: "number",
|
|
2276
|
+
watch: "*",
|
|
2277
|
+
required: true,
|
|
2278
|
+
default: () => Date.now(),
|
|
2279
|
+
set: () => Date.now()
|
|
2280
|
+
}
|
|
2281
|
+
},
|
|
2282
|
+
indexes: {
|
|
2283
|
+
byMessageId: {
|
|
2284
|
+
pk: {
|
|
2285
|
+
field: "gsi2pk",
|
|
2286
|
+
composite: ["messageId"]
|
|
2287
|
+
},
|
|
2288
|
+
sk: {
|
|
2289
|
+
field: "gsi2sk",
|
|
2290
|
+
composite: ["bodyPartId"]
|
|
2291
|
+
},
|
|
2292
|
+
index: "gsi2",
|
|
2293
|
+
collection: "messageData"
|
|
2294
|
+
},
|
|
2295
|
+
BodyPart: {
|
|
2296
|
+
pk: {
|
|
2297
|
+
field: "pk",
|
|
2298
|
+
composite: ["bodyPartId"]
|
|
2299
|
+
},
|
|
2300
|
+
sk: {
|
|
2301
|
+
field: "sk",
|
|
2302
|
+
composite: []
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
},
|
|
2306
|
+
model: {
|
|
2307
|
+
entity: "bodyPart",
|
|
2308
|
+
service: "remit",
|
|
2309
|
+
version: "1"
|
|
2310
|
+
}
|
|
2311
|
+
};
|
|
2312
|
+
export const MessageReference = {
|
|
2313
|
+
attributes: {
|
|
2314
|
+
messageReferenceId: {
|
|
2315
|
+
type: "string",
|
|
2316
|
+
required: true,
|
|
2317
|
+
validate: value => {
|
|
2318
|
+
if (typeof value === "string" && value.length < 25)
|
|
2319
|
+
throw new Error("'messageReferenceId' must be at least 25 characters");
|
|
2320
|
+
if (typeof value === "string" && value.length > 25)
|
|
2321
|
+
throw new Error("'messageReferenceId' must be at most 25 characters");
|
|
2322
|
+
return true;
|
|
2323
|
+
}
|
|
2324
|
+
},
|
|
2325
|
+
messageId: {
|
|
2326
|
+
type: "string",
|
|
2327
|
+
required: true,
|
|
2328
|
+
validate: value => {
|
|
2329
|
+
if (typeof value === "string" && value.length < 25)
|
|
2330
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
2331
|
+
if (typeof value === "string" && value.length > 25)
|
|
2332
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
2333
|
+
return true;
|
|
2334
|
+
}
|
|
2335
|
+
},
|
|
2336
|
+
envelopeId: {
|
|
2337
|
+
type: "string",
|
|
2338
|
+
required: true,
|
|
2339
|
+
validate: value => {
|
|
2340
|
+
if (typeof value === "string" && value.length < 25)
|
|
2341
|
+
throw new Error("'envelopeId' must be at least 25 characters");
|
|
2342
|
+
if (typeof value === "string" && value.length > 25)
|
|
2343
|
+
throw new Error("'envelopeId' must be at most 25 characters");
|
|
2344
|
+
return true;
|
|
2345
|
+
}
|
|
2346
|
+
},
|
|
2347
|
+
messageIdValue: {
|
|
2348
|
+
type: "string",
|
|
2349
|
+
required: true
|
|
2350
|
+
},
|
|
2351
|
+
referenceType: {
|
|
2352
|
+
type: ["in_reply_to", "references"],
|
|
2353
|
+
required: true
|
|
2354
|
+
},
|
|
2355
|
+
referenceOrder: {
|
|
2356
|
+
type: "number",
|
|
2357
|
+
required: true,
|
|
2358
|
+
validate: value => {
|
|
2359
|
+
if (typeof value === "number" && value < 0)
|
|
2360
|
+
throw new Error("'referenceOrder' must be at least 0");
|
|
2361
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
2362
|
+
throw new Error("'referenceOrder' must be an integer");
|
|
2363
|
+
return true;
|
|
2364
|
+
}
|
|
2365
|
+
},
|
|
2366
|
+
createdAt: {
|
|
2367
|
+
type: "number",
|
|
2368
|
+
readOnly: true,
|
|
2369
|
+
required: true,
|
|
2370
|
+
default: () => Date.now(),
|
|
2371
|
+
set: () => Date.now()
|
|
2372
|
+
},
|
|
2373
|
+
updatedAt: {
|
|
2374
|
+
type: "number",
|
|
2375
|
+
watch: "*",
|
|
2376
|
+
required: true,
|
|
2377
|
+
default: () => Date.now(),
|
|
2378
|
+
set: () => Date.now()
|
|
2379
|
+
}
|
|
2380
|
+
},
|
|
2381
|
+
indexes: {
|
|
2382
|
+
byMessageId: {
|
|
2383
|
+
pk: {
|
|
2384
|
+
field: "gsi2pk",
|
|
2385
|
+
composite: ["messageId"]
|
|
2386
|
+
},
|
|
2387
|
+
sk: {
|
|
2388
|
+
field: "gsi2sk",
|
|
2389
|
+
composite: ["messageReferenceId"]
|
|
2390
|
+
},
|
|
2391
|
+
index: "gsi2",
|
|
2392
|
+
collection: "messageData"
|
|
2393
|
+
},
|
|
2394
|
+
MessageReference: {
|
|
2395
|
+
pk: {
|
|
2396
|
+
field: "pk",
|
|
2397
|
+
composite: ["messageReferenceId"]
|
|
2398
|
+
},
|
|
2399
|
+
sk: {
|
|
2400
|
+
field: "sk",
|
|
2401
|
+
composite: []
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
},
|
|
2405
|
+
model: {
|
|
2406
|
+
entity: "messageReference",
|
|
2407
|
+
service: "remit",
|
|
2408
|
+
version: "1"
|
|
2409
|
+
}
|
|
2410
|
+
};
|
|
2411
|
+
export const EnvelopeAddress = {
|
|
2412
|
+
attributes: {
|
|
2413
|
+
envelopeAddressId: {
|
|
2414
|
+
type: "string",
|
|
2415
|
+
required: true,
|
|
2416
|
+
validate: value => {
|
|
2417
|
+
if (typeof value === "string" && value.length < 25)
|
|
2418
|
+
throw new Error("'envelopeAddressId' must be at least 25 characters");
|
|
2419
|
+
if (typeof value === "string" && value.length > 25)
|
|
2420
|
+
throw new Error("'envelopeAddressId' must be at most 25 characters");
|
|
2421
|
+
return true;
|
|
2422
|
+
}
|
|
2423
|
+
},
|
|
2424
|
+
messageId: {
|
|
2425
|
+
type: "string",
|
|
2426
|
+
required: true,
|
|
2427
|
+
validate: value => {
|
|
2428
|
+
if (typeof value === "string" && value.length < 25)
|
|
2429
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
2430
|
+
if (typeof value === "string" && value.length > 25)
|
|
2431
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
2432
|
+
return true;
|
|
2433
|
+
}
|
|
2434
|
+
},
|
|
2435
|
+
addressId: {
|
|
2436
|
+
type: "string",
|
|
2437
|
+
required: true,
|
|
2438
|
+
validate: value => {
|
|
2439
|
+
if (typeof value === "string" && value.length < 25)
|
|
2440
|
+
throw new Error("'addressId' must be at least 25 characters");
|
|
2441
|
+
if (typeof value === "string" && value.length > 25)
|
|
2442
|
+
throw new Error("'addressId' must be at most 25 characters");
|
|
2443
|
+
return true;
|
|
2444
|
+
}
|
|
2445
|
+
},
|
|
2446
|
+
displayName: {
|
|
2447
|
+
type: "string",
|
|
2448
|
+
required: false
|
|
2449
|
+
},
|
|
2450
|
+
normalizedEmail: {
|
|
2451
|
+
type: "string",
|
|
2452
|
+
required: true
|
|
2453
|
+
},
|
|
2454
|
+
addressRole: {
|
|
2455
|
+
type: ["from", "sender", "reply_to", "to", "cc", "bcc"],
|
|
2456
|
+
required: true
|
|
2457
|
+
},
|
|
2458
|
+
addressOrder: {
|
|
2459
|
+
type: "number",
|
|
2460
|
+
required: true,
|
|
2461
|
+
validate: value => {
|
|
2462
|
+
if (typeof value === "number" && value < 0)
|
|
2463
|
+
throw new Error("'addressOrder' must be at least 0");
|
|
2464
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
2465
|
+
throw new Error("'addressOrder' must be an integer");
|
|
2466
|
+
return true;
|
|
2467
|
+
}
|
|
2468
|
+
},
|
|
2469
|
+
createdAt: {
|
|
2470
|
+
type: "number",
|
|
2471
|
+
readOnly: true,
|
|
2472
|
+
required: true,
|
|
2473
|
+
default: () => Date.now(),
|
|
2474
|
+
set: () => Date.now()
|
|
2475
|
+
},
|
|
2476
|
+
updatedAt: {
|
|
2477
|
+
type: "number",
|
|
2478
|
+
watch: "*",
|
|
2479
|
+
required: true,
|
|
2480
|
+
default: () => Date.now(),
|
|
2481
|
+
set: () => Date.now()
|
|
2482
|
+
}
|
|
2483
|
+
},
|
|
2484
|
+
indexes: {
|
|
2485
|
+
byMessageId: {
|
|
2486
|
+
pk: {
|
|
2487
|
+
field: "gsi2pk",
|
|
2488
|
+
composite: ["messageId"]
|
|
2489
|
+
},
|
|
2490
|
+
sk: {
|
|
2491
|
+
field: "gsi2sk",
|
|
2492
|
+
composite: ["envelopeAddressId"]
|
|
2493
|
+
},
|
|
2494
|
+
index: "gsi2",
|
|
2495
|
+
collection: "messageData"
|
|
2496
|
+
},
|
|
2497
|
+
EnvelopeAddress: {
|
|
2498
|
+
pk: {
|
|
2499
|
+
field: "pk",
|
|
2500
|
+
composite: ["envelopeAddressId"]
|
|
2501
|
+
},
|
|
2502
|
+
sk: {
|
|
2503
|
+
field: "sk",
|
|
2504
|
+
composite: []
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
},
|
|
2508
|
+
model: {
|
|
2509
|
+
entity: "envelopeAddress",
|
|
2510
|
+
service: "remit",
|
|
2511
|
+
version: "1"
|
|
2512
|
+
}
|
|
2513
|
+
};
|
|
2514
|
+
export const AccountSetting = {
|
|
2515
|
+
attributes: {
|
|
2516
|
+
accountSettingId: {
|
|
2517
|
+
type: "string",
|
|
2518
|
+
required: true,
|
|
2519
|
+
validate: value => {
|
|
2520
|
+
if (typeof value === "string" && value.length < 25)
|
|
2521
|
+
throw new Error("'accountSettingId' must be at least 25 characters");
|
|
2522
|
+
if (typeof value === "string" && value.length > 25)
|
|
2523
|
+
throw new Error("'accountSettingId' must be at most 25 characters");
|
|
2524
|
+
return true;
|
|
2525
|
+
}
|
|
2526
|
+
},
|
|
2527
|
+
accountConfigId: {
|
|
2528
|
+
type: "string",
|
|
2529
|
+
required: true,
|
|
2530
|
+
validate: value => {
|
|
2531
|
+
if (typeof value === "string" && value.length < 25)
|
|
2532
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
2533
|
+
if (typeof value === "string" && value.length > 25)
|
|
2534
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
2535
|
+
return true;
|
|
2536
|
+
}
|
|
2537
|
+
},
|
|
2538
|
+
name: {
|
|
2539
|
+
type: "string",
|
|
2540
|
+
required: true
|
|
2541
|
+
},
|
|
2542
|
+
value: {
|
|
2543
|
+
type: CustomAttributeType("any"),
|
|
2544
|
+
required: true
|
|
2545
|
+
},
|
|
2546
|
+
createdAt: {
|
|
2547
|
+
type: "number",
|
|
2548
|
+
readOnly: true,
|
|
2549
|
+
required: true,
|
|
2550
|
+
default: () => Date.now(),
|
|
2551
|
+
set: () => Date.now()
|
|
2552
|
+
},
|
|
2553
|
+
updatedAt: {
|
|
2554
|
+
type: "number",
|
|
2555
|
+
watch: "*",
|
|
2556
|
+
required: true,
|
|
2557
|
+
default: () => Date.now(),
|
|
2558
|
+
set: () => Date.now()
|
|
2559
|
+
}
|
|
2560
|
+
},
|
|
2561
|
+
indexes: {
|
|
2562
|
+
byAccountConfigId: {
|
|
2563
|
+
pk: {
|
|
2564
|
+
field: "gsi0pk",
|
|
2565
|
+
composite: ["accountConfigId"]
|
|
2566
|
+
},
|
|
2567
|
+
sk: {
|
|
2568
|
+
field: "gsi0sk",
|
|
2569
|
+
composite: ["name"]
|
|
2570
|
+
},
|
|
2571
|
+
index: "gsi0"
|
|
2572
|
+
},
|
|
2573
|
+
AccountSetting: {
|
|
2574
|
+
pk: {
|
|
2575
|
+
field: "pk",
|
|
2576
|
+
composite: ["accountSettingId"]
|
|
2577
|
+
},
|
|
2578
|
+
sk: {
|
|
2579
|
+
field: "sk",
|
|
2580
|
+
composite: []
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
},
|
|
2584
|
+
model: {
|
|
2585
|
+
entity: "accountSetting",
|
|
2586
|
+
service: "remit",
|
|
2587
|
+
version: "1"
|
|
2588
|
+
}
|
|
2589
|
+
};
|
|
2590
|
+
export const MailboxAttributeEntry = {
|
|
2591
|
+
attributes: {
|
|
2592
|
+
mailboxAttributeId: {
|
|
2593
|
+
type: "string",
|
|
2594
|
+
required: true,
|
|
2595
|
+
validate: value => {
|
|
2596
|
+
if (typeof value === "string" && value.length < 25)
|
|
2597
|
+
throw new Error("'mailboxAttributeId' must be at least 25 characters");
|
|
2598
|
+
if (typeof value === "string" && value.length > 25)
|
|
2599
|
+
throw new Error("'mailboxAttributeId' must be at most 25 characters");
|
|
2600
|
+
return true;
|
|
2601
|
+
}
|
|
2602
|
+
},
|
|
2603
|
+
mailboxId: {
|
|
2604
|
+
type: "string",
|
|
2605
|
+
required: true,
|
|
2606
|
+
validate: value => {
|
|
2607
|
+
if (typeof value === "string" && value.length < 25)
|
|
2608
|
+
throw new Error("'mailboxId' must be at least 25 characters");
|
|
2609
|
+
if (typeof value === "string" && value.length > 25)
|
|
2610
|
+
throw new Error("'mailboxId' must be at most 25 characters");
|
|
2611
|
+
return true;
|
|
2612
|
+
}
|
|
2613
|
+
},
|
|
2614
|
+
attributeName: {
|
|
2615
|
+
type: ["\NonExistent", "\Noinferiors", "\Noselect", "\HasChildren", "\HasNoChildren", "\Marked", "\Unmarked", "\Subscribed", "\Remote"],
|
|
2616
|
+
required: true
|
|
2617
|
+
}
|
|
2618
|
+
},
|
|
2619
|
+
indexes: {
|
|
2620
|
+
byMailboxId: {
|
|
2621
|
+
pk: {
|
|
2622
|
+
field: "gsi1pk",
|
|
2623
|
+
composite: ["mailboxId"]
|
|
2624
|
+
},
|
|
2625
|
+
sk: {
|
|
2626
|
+
field: "gsi1sk",
|
|
2627
|
+
composite: ["mailboxAttributeId"]
|
|
2628
|
+
},
|
|
2629
|
+
index: "gsi1",
|
|
2630
|
+
collection: "mailbox"
|
|
2631
|
+
},
|
|
2632
|
+
MailboxAttributeEntry: {
|
|
2633
|
+
pk: {
|
|
2634
|
+
field: "pk",
|
|
2635
|
+
composite: ["mailboxAttributeId"]
|
|
2636
|
+
},
|
|
2637
|
+
sk: {
|
|
2638
|
+
field: "sk",
|
|
2639
|
+
composite: []
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
},
|
|
2643
|
+
model: {
|
|
2644
|
+
entity: "mailboxAttributeEntry",
|
|
2645
|
+
service: "remit",
|
|
2646
|
+
version: "1"
|
|
2647
|
+
}
|
|
2648
|
+
};
|
|
2649
|
+
export const MailboxSpecialUseEntry = {
|
|
2650
|
+
attributes: {
|
|
2651
|
+
mailboxSpecialUseId: {
|
|
2652
|
+
type: "string",
|
|
2653
|
+
required: true,
|
|
2654
|
+
validate: value => {
|
|
2655
|
+
if (typeof value === "string" && value.length < 25)
|
|
2656
|
+
throw new Error("'mailboxSpecialUseId' must be at least 25 characters");
|
|
2657
|
+
if (typeof value === "string" && value.length > 25)
|
|
2658
|
+
throw new Error("'mailboxSpecialUseId' must be at most 25 characters");
|
|
2659
|
+
return true;
|
|
2660
|
+
}
|
|
2661
|
+
},
|
|
2662
|
+
mailboxId: {
|
|
2663
|
+
type: "string",
|
|
2664
|
+
required: true,
|
|
2665
|
+
validate: value => {
|
|
2666
|
+
if (typeof value === "string" && value.length < 25)
|
|
2667
|
+
throw new Error("'mailboxId' must be at least 25 characters");
|
|
2668
|
+
if (typeof value === "string" && value.length > 25)
|
|
2669
|
+
throw new Error("'mailboxId' must be at most 25 characters");
|
|
2670
|
+
return true;
|
|
2671
|
+
}
|
|
2672
|
+
},
|
|
2673
|
+
specialUse: {
|
|
2674
|
+
type: ["All", "Archive", "Drafts", "Flagged", "Junk", "Sent", "Trash", "Important"],
|
|
2675
|
+
required: true
|
|
2676
|
+
}
|
|
2677
|
+
},
|
|
2678
|
+
indexes: {
|
|
2679
|
+
byMailboxId: {
|
|
2680
|
+
pk: {
|
|
2681
|
+
field: "gsi1pk",
|
|
2682
|
+
composite: ["mailboxId"]
|
|
2683
|
+
},
|
|
2684
|
+
sk: {
|
|
2685
|
+
field: "gsi1sk",
|
|
2686
|
+
composite: ["mailboxSpecialUseId"]
|
|
2687
|
+
},
|
|
2688
|
+
index: "gsi1",
|
|
2689
|
+
collection: "mailbox"
|
|
2690
|
+
},
|
|
2691
|
+
MailboxSpecialUseEntry: {
|
|
2692
|
+
pk: {
|
|
2693
|
+
field: "pk",
|
|
2694
|
+
composite: ["mailboxSpecialUseId"]
|
|
2695
|
+
},
|
|
2696
|
+
sk: {
|
|
2697
|
+
field: "sk",
|
|
2698
|
+
composite: []
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
},
|
|
2702
|
+
model: {
|
|
2703
|
+
entity: "mailboxSpecialUseEntry",
|
|
2704
|
+
service: "remit",
|
|
2705
|
+
version: "1"
|
|
2706
|
+
}
|
|
2707
|
+
};
|
|
2708
|
+
export const MailboxFlag = {
|
|
2709
|
+
attributes: {
|
|
2710
|
+
mailboxFlagId: {
|
|
2711
|
+
type: "string",
|
|
2712
|
+
required: true,
|
|
2713
|
+
validate: value => {
|
|
2714
|
+
if (typeof value === "string" && value.length < 25)
|
|
2715
|
+
throw new Error("'mailboxFlagId' must be at least 25 characters");
|
|
2716
|
+
if (typeof value === "string" && value.length > 25)
|
|
2717
|
+
throw new Error("'mailboxFlagId' must be at most 25 characters");
|
|
2718
|
+
return true;
|
|
2719
|
+
}
|
|
2720
|
+
},
|
|
2721
|
+
mailboxId: {
|
|
2722
|
+
type: "string",
|
|
2723
|
+
required: true,
|
|
2724
|
+
validate: value => {
|
|
2725
|
+
if (typeof value === "string" && value.length < 25)
|
|
2726
|
+
throw new Error("'mailboxId' must be at least 25 characters");
|
|
2727
|
+
if (typeof value === "string" && value.length > 25)
|
|
2728
|
+
throw new Error("'mailboxId' must be at most 25 characters");
|
|
2729
|
+
return true;
|
|
2730
|
+
}
|
|
2731
|
+
},
|
|
2732
|
+
flagName: {
|
|
2733
|
+
type: CustomAttributeType("any"),
|
|
2734
|
+
required: true
|
|
2735
|
+
},
|
|
2736
|
+
isPermanent: {
|
|
2737
|
+
type: "boolean",
|
|
2738
|
+
required: true
|
|
2739
|
+
}
|
|
2740
|
+
},
|
|
2741
|
+
indexes: {
|
|
2742
|
+
byMailboxId: {
|
|
2743
|
+
pk: {
|
|
2744
|
+
field: "gsi1pk",
|
|
2745
|
+
composite: ["mailboxId"]
|
|
2746
|
+
},
|
|
2747
|
+
sk: {
|
|
2748
|
+
field: "gsi1sk",
|
|
2749
|
+
composite: ["mailboxFlagId"]
|
|
2750
|
+
},
|
|
2751
|
+
index: "gsi1",
|
|
2752
|
+
collection: "mailbox"
|
|
2753
|
+
},
|
|
2754
|
+
MailboxFlag: {
|
|
2755
|
+
pk: {
|
|
2756
|
+
field: "pk",
|
|
2757
|
+
composite: ["mailboxFlagId"]
|
|
2758
|
+
},
|
|
2759
|
+
sk: {
|
|
2760
|
+
field: "sk",
|
|
2761
|
+
composite: []
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
},
|
|
2765
|
+
model: {
|
|
2766
|
+
entity: "mailboxFlag",
|
|
2767
|
+
service: "remit",
|
|
2768
|
+
version: "1"
|
|
2769
|
+
}
|
|
2770
|
+
};
|
|
2771
|
+
export const MailboxLock = {
|
|
2772
|
+
attributes: {
|
|
2773
|
+
mailboxId: {
|
|
2774
|
+
type: "string",
|
|
2775
|
+
required: true,
|
|
2776
|
+
validate: value => {
|
|
2777
|
+
if (typeof value === "string" && value.length < 25)
|
|
2778
|
+
throw new Error("'mailboxId' must be at least 25 characters");
|
|
2779
|
+
if (typeof value === "string" && value.length > 25)
|
|
2780
|
+
throw new Error("'mailboxId' must be at most 25 characters");
|
|
2781
|
+
return true;
|
|
2782
|
+
}
|
|
2783
|
+
},
|
|
2784
|
+
eventName: {
|
|
2785
|
+
type: "string",
|
|
2786
|
+
required: true
|
|
2787
|
+
},
|
|
2788
|
+
accountId: {
|
|
2789
|
+
type: "string",
|
|
2790
|
+
required: true,
|
|
2791
|
+
validate: value => {
|
|
2792
|
+
if (typeof value === "string" && value.length < 25)
|
|
2793
|
+
throw new Error("'accountId' must be at least 25 characters");
|
|
2794
|
+
if (typeof value === "string" && value.length > 25)
|
|
2795
|
+
throw new Error("'accountId' must be at most 25 characters");
|
|
2796
|
+
return true;
|
|
2797
|
+
}
|
|
2798
|
+
},
|
|
2799
|
+
lockId: {
|
|
2800
|
+
type: "string",
|
|
2801
|
+
required: true,
|
|
2802
|
+
validate: value => {
|
|
2803
|
+
if (typeof value === "string" && value.length < 25)
|
|
2804
|
+
throw new Error("'lockId' must be at least 25 characters");
|
|
2805
|
+
if (typeof value === "string" && value.length > 25)
|
|
2806
|
+
throw new Error("'lockId' must be at most 25 characters");
|
|
2807
|
+
return true;
|
|
2808
|
+
}
|
|
2809
|
+
},
|
|
2810
|
+
acquiredAt: {
|
|
2811
|
+
type: "number",
|
|
2812
|
+
required: true,
|
|
2813
|
+
validate: value => {
|
|
2814
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
2815
|
+
throw new Error("'acquiredAt' must be an integer");
|
|
2816
|
+
return true;
|
|
2817
|
+
}
|
|
2818
|
+
},
|
|
2819
|
+
lockedBy: {
|
|
2820
|
+
type: "string",
|
|
2821
|
+
required: true
|
|
2822
|
+
},
|
|
2823
|
+
ttl: {
|
|
2824
|
+
type: "number",
|
|
2825
|
+
required: true,
|
|
2826
|
+
validate: value => {
|
|
2827
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
2828
|
+
throw new Error("'ttl' must be an integer");
|
|
2829
|
+
return true;
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
},
|
|
2833
|
+
indexes: {
|
|
2834
|
+
allLocks: {
|
|
2835
|
+
pk: {
|
|
2836
|
+
field: "gsi2pk",
|
|
2837
|
+
composite: []
|
|
2838
|
+
},
|
|
2839
|
+
sk: {
|
|
2840
|
+
field: "gsi2sk",
|
|
2841
|
+
composite: ["acquiredAt"]
|
|
2842
|
+
},
|
|
2843
|
+
index: "gsi2",
|
|
2844
|
+
collection: "locks"
|
|
2845
|
+
},
|
|
2846
|
+
byAccountId: {
|
|
2847
|
+
pk: {
|
|
2848
|
+
field: "gsi1pk",
|
|
2849
|
+
composite: ["accountId"]
|
|
2850
|
+
},
|
|
2851
|
+
sk: {
|
|
2852
|
+
field: "gsi1sk",
|
|
2853
|
+
composite: ["mailboxId", "eventName"]
|
|
2854
|
+
},
|
|
2855
|
+
index: "gsi1"
|
|
2856
|
+
},
|
|
2857
|
+
MailboxLock: {
|
|
2858
|
+
pk: {
|
|
2859
|
+
field: "pk",
|
|
2860
|
+
composite: ["mailboxId"]
|
|
2861
|
+
},
|
|
2862
|
+
sk: {
|
|
2863
|
+
field: "sk",
|
|
2864
|
+
composite: ["eventName"]
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
},
|
|
2868
|
+
model: {
|
|
2869
|
+
entity: "mailboxLock",
|
|
2870
|
+
service: "remit",
|
|
2871
|
+
version: "1"
|
|
2872
|
+
}
|
|
2873
|
+
};
|
|
2874
|
+
export const MessageFlag = {
|
|
2875
|
+
attributes: {
|
|
2876
|
+
messageFlagId: {
|
|
2877
|
+
type: "string",
|
|
2878
|
+
required: true,
|
|
2879
|
+
validate: value => {
|
|
2880
|
+
if (typeof value === "string" && value.length < 25)
|
|
2881
|
+
throw new Error("'messageFlagId' must be at least 25 characters");
|
|
2882
|
+
if (typeof value === "string" && value.length > 25)
|
|
2883
|
+
throw new Error("'messageFlagId' must be at most 25 characters");
|
|
2884
|
+
return true;
|
|
2885
|
+
}
|
|
2886
|
+
},
|
|
2887
|
+
messageId: {
|
|
2888
|
+
type: "string",
|
|
2889
|
+
required: true,
|
|
2890
|
+
validate: value => {
|
|
2891
|
+
if (typeof value === "string" && value.length < 25)
|
|
2892
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
2893
|
+
if (typeof value === "string" && value.length > 25)
|
|
2894
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
2895
|
+
return true;
|
|
2896
|
+
}
|
|
2897
|
+
},
|
|
2898
|
+
flagName: {
|
|
2899
|
+
type: CustomAttributeType("any"),
|
|
2900
|
+
required: true
|
|
2901
|
+
},
|
|
2902
|
+
setAt: {
|
|
2903
|
+
type: "number",
|
|
2904
|
+
required: true,
|
|
2905
|
+
validate: value => {
|
|
2906
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
2907
|
+
throw new Error("'setAt' must be an integer");
|
|
2908
|
+
return true;
|
|
2909
|
+
}
|
|
2910
|
+
},
|
|
2911
|
+
createdAt: {
|
|
2912
|
+
type: "number",
|
|
2913
|
+
readOnly: true,
|
|
2914
|
+
required: true,
|
|
2915
|
+
default: () => Date.now(),
|
|
2916
|
+
set: () => Date.now()
|
|
2917
|
+
},
|
|
2918
|
+
updatedAt: {
|
|
2919
|
+
type: "number",
|
|
2920
|
+
watch: "*",
|
|
2921
|
+
required: true,
|
|
2922
|
+
default: () => Date.now(),
|
|
2923
|
+
set: () => Date.now()
|
|
2924
|
+
}
|
|
2925
|
+
},
|
|
2926
|
+
indexes: {
|
|
2927
|
+
byMessageId: {
|
|
2928
|
+
pk: {
|
|
2929
|
+
field: "gsi2pk",
|
|
2930
|
+
composite: ["messageId"]
|
|
2931
|
+
},
|
|
2932
|
+
sk: {
|
|
2933
|
+
field: "gsi2sk",
|
|
2934
|
+
composite: ["messageFlagId"]
|
|
2935
|
+
},
|
|
2936
|
+
index: "gsi2",
|
|
2937
|
+
collection: "messageData"
|
|
2938
|
+
},
|
|
2939
|
+
MessageFlag: {
|
|
2940
|
+
pk: {
|
|
2941
|
+
field: "pk",
|
|
2942
|
+
composite: ["messageFlagId"]
|
|
2943
|
+
},
|
|
2944
|
+
sk: {
|
|
2945
|
+
field: "sk",
|
|
2946
|
+
composite: []
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
},
|
|
2950
|
+
model: {
|
|
2951
|
+
entity: "messageFlag",
|
|
2952
|
+
service: "remit",
|
|
2953
|
+
version: "1"
|
|
2954
|
+
}
|
|
2955
|
+
};
|
|
2956
|
+
export const MessagePlacementMove = {
|
|
2957
|
+
attributes: {
|
|
2958
|
+
messageId: {
|
|
2959
|
+
type: "string",
|
|
2960
|
+
required: true,
|
|
2961
|
+
validate: value => {
|
|
2962
|
+
if (typeof value === "string" && value.length < 25)
|
|
2963
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
2964
|
+
if (typeof value === "string" && value.length > 25)
|
|
2965
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
2966
|
+
return true;
|
|
2967
|
+
}
|
|
2968
|
+
},
|
|
2969
|
+
accountId: {
|
|
2970
|
+
type: "string",
|
|
2971
|
+
required: true,
|
|
2972
|
+
validate: value => {
|
|
2973
|
+
if (typeof value === "string" && value.length < 25)
|
|
2974
|
+
throw new Error("'accountId' must be at least 25 characters");
|
|
2975
|
+
if (typeof value === "string" && value.length > 25)
|
|
2976
|
+
throw new Error("'accountId' must be at most 25 characters");
|
|
2977
|
+
return true;
|
|
2978
|
+
}
|
|
2979
|
+
},
|
|
2980
|
+
accountConfigId: {
|
|
2981
|
+
type: "string",
|
|
2982
|
+
required: true,
|
|
2983
|
+
validate: value => {
|
|
2984
|
+
if (typeof value === "string" && value.length < 25)
|
|
2985
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
2986
|
+
if (typeof value === "string" && value.length > 25)
|
|
2987
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
2988
|
+
return true;
|
|
2989
|
+
}
|
|
2990
|
+
},
|
|
2991
|
+
sourceMailboxId: {
|
|
2992
|
+
type: "string",
|
|
2993
|
+
required: true,
|
|
2994
|
+
validate: value => {
|
|
2995
|
+
if (typeof value === "string" && value.length < 25)
|
|
2996
|
+
throw new Error("'sourceMailboxId' must be at least 25 characters");
|
|
2997
|
+
if (typeof value === "string" && value.length > 25)
|
|
2998
|
+
throw new Error("'sourceMailboxId' must be at most 25 characters");
|
|
2999
|
+
return true;
|
|
3000
|
+
}
|
|
3001
|
+
},
|
|
3002
|
+
destinationMailboxId: {
|
|
3003
|
+
type: "string",
|
|
3004
|
+
required: true,
|
|
3005
|
+
validate: value => {
|
|
3006
|
+
if (typeof value === "string" && value.length < 25)
|
|
3007
|
+
throw new Error("'destinationMailboxId' must be at least 25 characters");
|
|
3008
|
+
if (typeof value === "string" && value.length > 25)
|
|
3009
|
+
throw new Error("'destinationMailboxId' must be at most 25 characters");
|
|
3010
|
+
return true;
|
|
3011
|
+
}
|
|
3012
|
+
},
|
|
3013
|
+
state: {
|
|
3014
|
+
type: ["pending", "queued", "processing", "processed"],
|
|
3015
|
+
required: true,
|
|
3016
|
+
default: "pending"
|
|
3017
|
+
},
|
|
3018
|
+
createdAt: {
|
|
3019
|
+
type: "number",
|
|
3020
|
+
readOnly: true,
|
|
3021
|
+
required: true,
|
|
3022
|
+
default: () => Date.now(),
|
|
3023
|
+
set: () => Date.now()
|
|
3024
|
+
},
|
|
3025
|
+
updatedAt: {
|
|
3026
|
+
type: "number",
|
|
3027
|
+
watch: "*",
|
|
3028
|
+
required: true,
|
|
3029
|
+
default: () => Date.now(),
|
|
3030
|
+
set: () => Date.now()
|
|
3031
|
+
}
|
|
3032
|
+
},
|
|
3033
|
+
indexes: {
|
|
3034
|
+
byAccountId: {
|
|
3035
|
+
pk: {
|
|
3036
|
+
field: "gsi0pk",
|
|
3037
|
+
composite: ["accountId"]
|
|
3038
|
+
},
|
|
3039
|
+
sk: {
|
|
3040
|
+
field: "gsi0sk",
|
|
3041
|
+
composite: ["messageId"]
|
|
3042
|
+
},
|
|
3043
|
+
index: "gsi0"
|
|
3044
|
+
},
|
|
3045
|
+
MessagePlacementMove: {
|
|
3046
|
+
pk: {
|
|
3047
|
+
field: "pk",
|
|
3048
|
+
composite: ["messageId"]
|
|
3049
|
+
},
|
|
3050
|
+
sk: {
|
|
3051
|
+
field: "sk",
|
|
3052
|
+
composite: []
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
},
|
|
3056
|
+
model: {
|
|
3057
|
+
entity: "messagePlacementMove",
|
|
3058
|
+
service: "remit",
|
|
3059
|
+
version: "1"
|
|
3060
|
+
}
|
|
3061
|
+
};
|
|
3062
|
+
export const MessageFlagPush = {
|
|
3063
|
+
attributes: {
|
|
3064
|
+
messageId: {
|
|
3065
|
+
type: "string",
|
|
3066
|
+
required: true,
|
|
3067
|
+
validate: value => {
|
|
3068
|
+
if (typeof value === "string" && value.length < 25)
|
|
3069
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
3070
|
+
if (typeof value === "string" && value.length > 25)
|
|
3071
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
3072
|
+
return true;
|
|
3073
|
+
}
|
|
3074
|
+
},
|
|
3075
|
+
flagName: {
|
|
3076
|
+
type: "string",
|
|
3077
|
+
required: true
|
|
3078
|
+
},
|
|
3079
|
+
accountId: {
|
|
3080
|
+
type: "string",
|
|
3081
|
+
required: true,
|
|
3082
|
+
validate: value => {
|
|
3083
|
+
if (typeof value === "string" && value.length < 25)
|
|
3084
|
+
throw new Error("'accountId' must be at least 25 characters");
|
|
3085
|
+
if (typeof value === "string" && value.length > 25)
|
|
3086
|
+
throw new Error("'accountId' must be at most 25 characters");
|
|
3087
|
+
return true;
|
|
3088
|
+
}
|
|
3089
|
+
},
|
|
3090
|
+
accountConfigId: {
|
|
3091
|
+
type: "string",
|
|
3092
|
+
required: true,
|
|
3093
|
+
validate: value => {
|
|
3094
|
+
if (typeof value === "string" && value.length < 25)
|
|
3095
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
3096
|
+
if (typeof value === "string" && value.length > 25)
|
|
3097
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
3098
|
+
return true;
|
|
3099
|
+
}
|
|
3100
|
+
},
|
|
3101
|
+
mailboxId: {
|
|
3102
|
+
type: "string",
|
|
3103
|
+
required: true,
|
|
3104
|
+
validate: value => {
|
|
3105
|
+
if (typeof value === "string" && value.length < 25)
|
|
3106
|
+
throw new Error("'mailboxId' must be at least 25 characters");
|
|
3107
|
+
if (typeof value === "string" && value.length > 25)
|
|
3108
|
+
throw new Error("'mailboxId' must be at most 25 characters");
|
|
3109
|
+
return true;
|
|
3110
|
+
}
|
|
3111
|
+
},
|
|
3112
|
+
operation: {
|
|
3113
|
+
type: ["add", "remove"],
|
|
3114
|
+
required: true
|
|
3115
|
+
},
|
|
3116
|
+
state: {
|
|
3117
|
+
type: ["pending", "queued", "processing", "processed"],
|
|
3118
|
+
required: true,
|
|
3119
|
+
default: "pending"
|
|
3120
|
+
},
|
|
3121
|
+
createdAt: {
|
|
3122
|
+
type: "number",
|
|
3123
|
+
readOnly: true,
|
|
3124
|
+
required: true,
|
|
3125
|
+
default: () => Date.now(),
|
|
3126
|
+
set: () => Date.now()
|
|
3127
|
+
},
|
|
3128
|
+
updatedAt: {
|
|
3129
|
+
type: "number",
|
|
3130
|
+
watch: "*",
|
|
3131
|
+
required: true,
|
|
3132
|
+
default: () => Date.now(),
|
|
3133
|
+
set: () => Date.now()
|
|
3134
|
+
}
|
|
3135
|
+
},
|
|
3136
|
+
indexes: {
|
|
3137
|
+
byMailboxId: {
|
|
3138
|
+
pk: {
|
|
3139
|
+
field: "gsi1pk",
|
|
3140
|
+
composite: ["mailboxId"]
|
|
3141
|
+
},
|
|
3142
|
+
sk: {
|
|
3143
|
+
field: "gsi1sk",
|
|
3144
|
+
composite: ["messageId", "flagName"]
|
|
3145
|
+
},
|
|
3146
|
+
index: "gsi1"
|
|
3147
|
+
},
|
|
3148
|
+
byAccountId: {
|
|
3149
|
+
pk: {
|
|
3150
|
+
field: "gsi0pk",
|
|
3151
|
+
composite: ["accountId"]
|
|
3152
|
+
},
|
|
3153
|
+
sk: {
|
|
3154
|
+
field: "gsi0sk",
|
|
3155
|
+
composite: ["messageId", "flagName"]
|
|
3156
|
+
},
|
|
3157
|
+
index: "gsi0"
|
|
3158
|
+
},
|
|
3159
|
+
MessageFlagPush: {
|
|
3160
|
+
pk: {
|
|
3161
|
+
field: "pk",
|
|
3162
|
+
composite: ["messageId"]
|
|
3163
|
+
},
|
|
3164
|
+
sk: {
|
|
3165
|
+
field: "sk",
|
|
3166
|
+
composite: ["flagName"]
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
},
|
|
3170
|
+
model: {
|
|
3171
|
+
entity: "messageFlagPush",
|
|
3172
|
+
service: "remit",
|
|
3173
|
+
version: "1"
|
|
3174
|
+
}
|
|
3175
|
+
};
|
|
3176
|
+
export const Envelope = {
|
|
3177
|
+
attributes: {
|
|
3178
|
+
envelopeId: {
|
|
3179
|
+
type: "string",
|
|
3180
|
+
required: true,
|
|
3181
|
+
validate: value => {
|
|
3182
|
+
if (typeof value === "string" && value.length < 25)
|
|
3183
|
+
throw new Error("'envelopeId' must be at least 25 characters");
|
|
3184
|
+
if (typeof value === "string" && value.length > 25)
|
|
3185
|
+
throw new Error("'envelopeId' must be at most 25 characters");
|
|
3186
|
+
return true;
|
|
3187
|
+
}
|
|
3188
|
+
},
|
|
3189
|
+
messageId: {
|
|
3190
|
+
type: "string",
|
|
3191
|
+
required: true,
|
|
3192
|
+
validate: value => {
|
|
3193
|
+
if (typeof value === "string" && value.length < 25)
|
|
3194
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
3195
|
+
if (typeof value === "string" && value.length > 25)
|
|
3196
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
3197
|
+
return true;
|
|
3198
|
+
}
|
|
3199
|
+
},
|
|
3200
|
+
dateValue: {
|
|
3201
|
+
type: "number",
|
|
3202
|
+
required: true,
|
|
3203
|
+
validate: value => {
|
|
3204
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
3205
|
+
throw new Error("'dateValue' must be an integer");
|
|
3206
|
+
return true;
|
|
3207
|
+
}
|
|
3208
|
+
},
|
|
3209
|
+
dateRaw: {
|
|
3210
|
+
type: "string",
|
|
3211
|
+
required: true
|
|
3212
|
+
},
|
|
3213
|
+
subject: {
|
|
3214
|
+
type: "string",
|
|
3215
|
+
required: false
|
|
3216
|
+
},
|
|
3217
|
+
messageIdValue: {
|
|
3218
|
+
type: "string",
|
|
3219
|
+
required: false
|
|
3220
|
+
},
|
|
3221
|
+
createdAt: {
|
|
3222
|
+
type: "number",
|
|
3223
|
+
readOnly: true,
|
|
3224
|
+
required: true,
|
|
3225
|
+
default: () => Date.now(),
|
|
3226
|
+
set: () => Date.now()
|
|
3227
|
+
},
|
|
3228
|
+
updatedAt: {
|
|
3229
|
+
type: "number",
|
|
3230
|
+
watch: "*",
|
|
3231
|
+
required: true,
|
|
3232
|
+
default: () => Date.now(),
|
|
3233
|
+
set: () => Date.now()
|
|
3234
|
+
}
|
|
3235
|
+
},
|
|
3236
|
+
indexes: {
|
|
3237
|
+
byMessageId: {
|
|
3238
|
+
pk: {
|
|
3239
|
+
field: "gsi2pk",
|
|
3240
|
+
composite: ["messageId"]
|
|
3241
|
+
},
|
|
3242
|
+
sk: {
|
|
3243
|
+
field: "gsi2sk",
|
|
3244
|
+
composite: ["envelopeId"]
|
|
3245
|
+
},
|
|
3246
|
+
index: "gsi2",
|
|
3247
|
+
collection: "messageData"
|
|
3248
|
+
},
|
|
3249
|
+
Envelope: {
|
|
3250
|
+
pk: {
|
|
3251
|
+
field: "pk",
|
|
3252
|
+
composite: ["envelopeId"]
|
|
3253
|
+
},
|
|
3254
|
+
sk: {
|
|
3255
|
+
field: "sk",
|
|
3256
|
+
composite: []
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
},
|
|
3260
|
+
model: {
|
|
3261
|
+
entity: "envelope",
|
|
3262
|
+
service: "remit",
|
|
3263
|
+
version: "1"
|
|
3264
|
+
}
|
|
3265
|
+
};
|
|
3266
|
+
export const BodyPartParameter = {
|
|
3267
|
+
attributes: {
|
|
3268
|
+
bodyPartParameterId: {
|
|
3269
|
+
type: "string",
|
|
3270
|
+
required: true,
|
|
3271
|
+
validate: value => {
|
|
3272
|
+
if (typeof value === "string" && value.length < 25)
|
|
3273
|
+
throw new Error("'bodyPartParameterId' must be at least 25 characters");
|
|
3274
|
+
if (typeof value === "string" && value.length > 25)
|
|
3275
|
+
throw new Error("'bodyPartParameterId' must be at most 25 characters");
|
|
3276
|
+
return true;
|
|
3277
|
+
}
|
|
3278
|
+
},
|
|
3279
|
+
messageId: {
|
|
3280
|
+
type: "string",
|
|
3281
|
+
required: true,
|
|
3282
|
+
validate: value => {
|
|
3283
|
+
if (typeof value === "string" && value.length < 25)
|
|
3284
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
3285
|
+
if (typeof value === "string" && value.length > 25)
|
|
3286
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
3287
|
+
return true;
|
|
3288
|
+
}
|
|
3289
|
+
},
|
|
3290
|
+
bodyPartId: {
|
|
3291
|
+
type: "string",
|
|
3292
|
+
required: true,
|
|
3293
|
+
validate: value => {
|
|
3294
|
+
if (typeof value === "string" && value.length < 25)
|
|
3295
|
+
throw new Error("'bodyPartId' must be at least 25 characters");
|
|
3296
|
+
if (typeof value === "string" && value.length > 25)
|
|
3297
|
+
throw new Error("'bodyPartId' must be at most 25 characters");
|
|
3298
|
+
return true;
|
|
3299
|
+
}
|
|
3300
|
+
},
|
|
3301
|
+
parameterName: {
|
|
3302
|
+
type: "string",
|
|
3303
|
+
required: true,
|
|
3304
|
+
validate: value => {
|
|
3305
|
+
if (typeof value === "string" && value.length < 1)
|
|
3306
|
+
throw new Error("'parameterName' must be at least 1 characters");
|
|
3307
|
+
return true;
|
|
3308
|
+
}
|
|
3309
|
+
},
|
|
3310
|
+
parameterValue: {
|
|
3311
|
+
type: "string",
|
|
3312
|
+
required: true
|
|
3313
|
+
},
|
|
3314
|
+
createdAt: {
|
|
3315
|
+
type: "number",
|
|
3316
|
+
readOnly: true,
|
|
3317
|
+
required: true,
|
|
3318
|
+
default: () => Date.now(),
|
|
3319
|
+
set: () => Date.now()
|
|
3320
|
+
},
|
|
3321
|
+
updatedAt: {
|
|
3322
|
+
type: "number",
|
|
3323
|
+
watch: "*",
|
|
3324
|
+
required: true,
|
|
3325
|
+
default: () => Date.now(),
|
|
3326
|
+
set: () => Date.now()
|
|
3327
|
+
}
|
|
3328
|
+
},
|
|
3329
|
+
indexes: {
|
|
3330
|
+
byMessageId: {
|
|
3331
|
+
pk: {
|
|
3332
|
+
field: "gsi2pk",
|
|
3333
|
+
composite: ["messageId"]
|
|
3334
|
+
},
|
|
3335
|
+
sk: {
|
|
3336
|
+
field: "gsi2sk",
|
|
3337
|
+
composite: ["bodyPartParameterId"]
|
|
3338
|
+
},
|
|
3339
|
+
index: "gsi2",
|
|
3340
|
+
collection: "messageData"
|
|
3341
|
+
},
|
|
3342
|
+
BodyPartParameter: {
|
|
3343
|
+
pk: {
|
|
3344
|
+
field: "pk",
|
|
3345
|
+
composite: ["bodyPartParameterId"]
|
|
3346
|
+
},
|
|
3347
|
+
sk: {
|
|
3348
|
+
field: "sk",
|
|
3349
|
+
composite: []
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
},
|
|
3353
|
+
model: {
|
|
3354
|
+
entity: "bodyPartParameter",
|
|
3355
|
+
service: "remit",
|
|
3356
|
+
version: "1"
|
|
3357
|
+
}
|
|
3358
|
+
};
|
|
3359
|
+
export const RawMessageStorage = {
|
|
3360
|
+
attributes: {
|
|
3361
|
+
rawStorageId: {
|
|
3362
|
+
type: "string",
|
|
3363
|
+
required: true,
|
|
3364
|
+
validate: value => {
|
|
3365
|
+
if (typeof value === "string" && value.length < 25)
|
|
3366
|
+
throw new Error("'rawStorageId' must be at least 25 characters");
|
|
3367
|
+
if (typeof value === "string" && value.length > 25)
|
|
3368
|
+
throw new Error("'rawStorageId' must be at most 25 characters");
|
|
3369
|
+
return true;
|
|
3370
|
+
}
|
|
3371
|
+
},
|
|
3372
|
+
messageId: {
|
|
3373
|
+
type: "string",
|
|
3374
|
+
required: true,
|
|
3375
|
+
validate: value => {
|
|
3376
|
+
if (typeof value === "string" && value.length < 25)
|
|
3377
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
3378
|
+
if (typeof value === "string" && value.length > 25)
|
|
3379
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
3380
|
+
return true;
|
|
3381
|
+
}
|
|
3382
|
+
},
|
|
3383
|
+
storageType: {
|
|
3384
|
+
type: ["s3", "filesystem", "inline", "database"],
|
|
3385
|
+
required: true
|
|
3386
|
+
},
|
|
3387
|
+
storageLocation: {
|
|
3388
|
+
type: "string",
|
|
3389
|
+
required: true
|
|
3390
|
+
},
|
|
3391
|
+
storageKey: {
|
|
3392
|
+
type: "string",
|
|
3393
|
+
required: true
|
|
3394
|
+
},
|
|
3395
|
+
sizeBytes: {
|
|
3396
|
+
type: "number",
|
|
3397
|
+
required: true,
|
|
3398
|
+
validate: value => {
|
|
3399
|
+
if (typeof value === "number" && value < 0)
|
|
3400
|
+
throw new Error("'sizeBytes' must be at least 0");
|
|
3401
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
3402
|
+
throw new Error("'sizeBytes' must be an integer");
|
|
3403
|
+
return true;
|
|
3404
|
+
}
|
|
3405
|
+
},
|
|
3406
|
+
checksumSha256: {
|
|
3407
|
+
type: "string",
|
|
3408
|
+
required: true,
|
|
3409
|
+
validate: value => {
|
|
3410
|
+
if (typeof value === "string" && value.length < 64)
|
|
3411
|
+
throw new Error("'checksumSha256' must be at least 64 characters");
|
|
3412
|
+
if (typeof value === "string" && value.length > 64)
|
|
3413
|
+
throw new Error("'checksumSha256' must be at most 64 characters");
|
|
3414
|
+
return true;
|
|
3415
|
+
}
|
|
3416
|
+
},
|
|
3417
|
+
contentEncoding: {
|
|
3418
|
+
type: ["none", "gzip", "zstd"],
|
|
3419
|
+
required: true
|
|
3420
|
+
},
|
|
3421
|
+
storedAt: {
|
|
3422
|
+
type: "number",
|
|
3423
|
+
required: true,
|
|
3424
|
+
validate: value => {
|
|
3425
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
3426
|
+
throw new Error("'storedAt' must be an integer");
|
|
3427
|
+
return true;
|
|
3428
|
+
}
|
|
3429
|
+
},
|
|
3430
|
+
expiresAt: {
|
|
3431
|
+
type: "number",
|
|
3432
|
+
required: false,
|
|
3433
|
+
validate: value => {
|
|
3434
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
3435
|
+
throw new Error("'expiresAt' must be an integer");
|
|
3436
|
+
return true;
|
|
3437
|
+
}
|
|
3438
|
+
},
|
|
3439
|
+
createdAt: {
|
|
3440
|
+
type: "number",
|
|
3441
|
+
readOnly: true,
|
|
3442
|
+
required: true,
|
|
3443
|
+
default: () => Date.now(),
|
|
3444
|
+
set: () => Date.now()
|
|
3445
|
+
},
|
|
3446
|
+
updatedAt: {
|
|
3447
|
+
type: "number",
|
|
3448
|
+
watch: "*",
|
|
3449
|
+
required: true,
|
|
3450
|
+
default: () => Date.now(),
|
|
3451
|
+
set: () => Date.now()
|
|
3452
|
+
}
|
|
3453
|
+
},
|
|
3454
|
+
indexes: {
|
|
3455
|
+
byMessageId: {
|
|
3456
|
+
pk: {
|
|
3457
|
+
field: "gsi2pk",
|
|
3458
|
+
composite: ["messageId"]
|
|
3459
|
+
},
|
|
3460
|
+
sk: {
|
|
3461
|
+
field: "gsi2sk",
|
|
3462
|
+
composite: ["rawStorageId"]
|
|
3463
|
+
},
|
|
3464
|
+
index: "gsi2",
|
|
3465
|
+
collection: "messageData"
|
|
3466
|
+
},
|
|
3467
|
+
RawMessageStorage: {
|
|
3468
|
+
pk: {
|
|
3469
|
+
field: "pk",
|
|
3470
|
+
composite: ["rawStorageId"]
|
|
3471
|
+
},
|
|
3472
|
+
sk: {
|
|
3473
|
+
field: "sk",
|
|
3474
|
+
composite: []
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
},
|
|
3478
|
+
model: {
|
|
3479
|
+
entity: "rawMessageStorage",
|
|
3480
|
+
service: "remit",
|
|
3481
|
+
version: "1"
|
|
3482
|
+
}
|
|
3483
|
+
};
|
|
3484
|
+
export const BodyPartStorage = {
|
|
3485
|
+
attributes: {
|
|
3486
|
+
bodyPartStorageId: {
|
|
3487
|
+
type: "string",
|
|
3488
|
+
required: true,
|
|
3489
|
+
validate: value => {
|
|
3490
|
+
if (typeof value === "string" && value.length < 25)
|
|
3491
|
+
throw new Error("'bodyPartStorageId' must be at least 25 characters");
|
|
3492
|
+
if (typeof value === "string" && value.length > 25)
|
|
3493
|
+
throw new Error("'bodyPartStorageId' must be at most 25 characters");
|
|
3494
|
+
return true;
|
|
3495
|
+
}
|
|
3496
|
+
},
|
|
3497
|
+
messageId: {
|
|
3498
|
+
type: "string",
|
|
3499
|
+
required: true,
|
|
3500
|
+
validate: value => {
|
|
3501
|
+
if (typeof value === "string" && value.length < 25)
|
|
3502
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
3503
|
+
if (typeof value === "string" && value.length > 25)
|
|
3504
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
3505
|
+
return true;
|
|
3506
|
+
}
|
|
3507
|
+
},
|
|
3508
|
+
bodyPartId: {
|
|
3509
|
+
type: "string",
|
|
3510
|
+
required: true,
|
|
3511
|
+
validate: value => {
|
|
3512
|
+
if (typeof value === "string" && value.length < 25)
|
|
3513
|
+
throw new Error("'bodyPartId' must be at least 25 characters");
|
|
3514
|
+
if (typeof value === "string" && value.length > 25)
|
|
3515
|
+
throw new Error("'bodyPartId' must be at most 25 characters");
|
|
3516
|
+
return true;
|
|
3517
|
+
}
|
|
3518
|
+
},
|
|
3519
|
+
storageType: {
|
|
3520
|
+
type: ["s3", "filesystem", "inline", "database"],
|
|
3521
|
+
required: true
|
|
3522
|
+
},
|
|
3523
|
+
storageLocation: {
|
|
3524
|
+
type: "string",
|
|
3525
|
+
required: true
|
|
3526
|
+
},
|
|
3527
|
+
storageKey: {
|
|
3528
|
+
type: "string",
|
|
3529
|
+
required: true
|
|
3530
|
+
},
|
|
3531
|
+
decodedSizeBytes: {
|
|
3532
|
+
type: "number",
|
|
3533
|
+
required: true,
|
|
3534
|
+
validate: value => {
|
|
3535
|
+
if (typeof value === "number" && value < 0)
|
|
3536
|
+
throw new Error("'decodedSizeBytes' must be at least 0");
|
|
3537
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
3538
|
+
throw new Error("'decodedSizeBytes' must be an integer");
|
|
3539
|
+
return true;
|
|
3540
|
+
}
|
|
3541
|
+
},
|
|
3542
|
+
checksumSha256: {
|
|
3543
|
+
type: "string",
|
|
3544
|
+
required: true,
|
|
3545
|
+
validate: value => {
|
|
3546
|
+
if (typeof value === "string" && value.length < 64)
|
|
3547
|
+
throw new Error("'checksumSha256' must be at least 64 characters");
|
|
3548
|
+
if (typeof value === "string" && value.length > 64)
|
|
3549
|
+
throw new Error("'checksumSha256' must be at most 64 characters");
|
|
3550
|
+
return true;
|
|
3551
|
+
}
|
|
3552
|
+
},
|
|
3553
|
+
contentEncoding: {
|
|
3554
|
+
type: ["none", "gzip", "zstd"],
|
|
3555
|
+
required: true
|
|
3556
|
+
},
|
|
3557
|
+
isDeduped: {
|
|
3558
|
+
type: "boolean",
|
|
3559
|
+
required: true
|
|
3560
|
+
},
|
|
3561
|
+
dedupHash: {
|
|
3562
|
+
type: "string",
|
|
3563
|
+
required: false
|
|
3564
|
+
},
|
|
3565
|
+
storedAt: {
|
|
3566
|
+
type: "number",
|
|
3567
|
+
required: true,
|
|
3568
|
+
validate: value => {
|
|
3569
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
3570
|
+
throw new Error("'storedAt' must be an integer");
|
|
3571
|
+
return true;
|
|
3572
|
+
}
|
|
3573
|
+
},
|
|
3574
|
+
createdAt: {
|
|
3575
|
+
type: "number",
|
|
3576
|
+
readOnly: true,
|
|
3577
|
+
required: true,
|
|
3578
|
+
default: () => Date.now(),
|
|
3579
|
+
set: () => Date.now()
|
|
3580
|
+
},
|
|
3581
|
+
updatedAt: {
|
|
3582
|
+
type: "number",
|
|
3583
|
+
watch: "*",
|
|
3584
|
+
required: true,
|
|
3585
|
+
default: () => Date.now(),
|
|
3586
|
+
set: () => Date.now()
|
|
3587
|
+
}
|
|
3588
|
+
},
|
|
3589
|
+
indexes: {
|
|
3590
|
+
byMessageId: {
|
|
3591
|
+
pk: {
|
|
3592
|
+
field: "gsi2pk",
|
|
3593
|
+
composite: ["messageId"]
|
|
3594
|
+
},
|
|
3595
|
+
sk: {
|
|
3596
|
+
field: "gsi2sk",
|
|
3597
|
+
composite: ["bodyPartStorageId"]
|
|
3598
|
+
},
|
|
3599
|
+
index: "gsi2",
|
|
3600
|
+
collection: "messageData"
|
|
3601
|
+
},
|
|
3602
|
+
BodyPartStorage: {
|
|
3603
|
+
pk: {
|
|
3604
|
+
field: "pk",
|
|
3605
|
+
composite: ["bodyPartStorageId"]
|
|
3606
|
+
},
|
|
3607
|
+
sk: {
|
|
3608
|
+
field: "sk",
|
|
3609
|
+
composite: []
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
},
|
|
3613
|
+
model: {
|
|
3614
|
+
entity: "bodyPartStorage",
|
|
3615
|
+
service: "remit",
|
|
3616
|
+
version: "1"
|
|
3617
|
+
}
|
|
3618
|
+
};
|
|
3619
|
+
export const BodyPartContent = {
|
|
3620
|
+
attributes: {
|
|
3621
|
+
bodyPartContentId: {
|
|
3622
|
+
type: "string",
|
|
3623
|
+
required: true,
|
|
3624
|
+
validate: value => {
|
|
3625
|
+
if (typeof value === "string" && value.length < 25)
|
|
3626
|
+
throw new Error("'bodyPartContentId' must be at least 25 characters");
|
|
3627
|
+
if (typeof value === "string" && value.length > 25)
|
|
3628
|
+
throw new Error("'bodyPartContentId' must be at most 25 characters");
|
|
3629
|
+
return true;
|
|
3630
|
+
}
|
|
3631
|
+
},
|
|
3632
|
+
messageId: {
|
|
3633
|
+
type: "string",
|
|
3634
|
+
required: true,
|
|
3635
|
+
validate: value => {
|
|
3636
|
+
if (typeof value === "string" && value.length < 25)
|
|
3637
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
3638
|
+
if (typeof value === "string" && value.length > 25)
|
|
3639
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
3640
|
+
return true;
|
|
3641
|
+
}
|
|
3642
|
+
},
|
|
3643
|
+
bodyPartId: {
|
|
3644
|
+
type: "string",
|
|
3645
|
+
required: true,
|
|
3646
|
+
validate: value => {
|
|
3647
|
+
if (typeof value === "string" && value.length < 25)
|
|
3648
|
+
throw new Error("'bodyPartId' must be at least 25 characters");
|
|
3649
|
+
if (typeof value === "string" && value.length > 25)
|
|
3650
|
+
throw new Error("'bodyPartId' must be at most 25 characters");
|
|
3651
|
+
return true;
|
|
3652
|
+
}
|
|
3653
|
+
},
|
|
3654
|
+
content: {
|
|
3655
|
+
type: "string",
|
|
3656
|
+
required: true
|
|
3657
|
+
},
|
|
3658
|
+
contentLength: {
|
|
3659
|
+
type: "number",
|
|
3660
|
+
required: true,
|
|
3661
|
+
validate: value => {
|
|
3662
|
+
if (typeof value === "number" && value < 0)
|
|
3663
|
+
throw new Error("'contentLength' must be at least 0");
|
|
3664
|
+
if (typeof value === "number" && !Number.isInteger(value))
|
|
3665
|
+
throw new Error("'contentLength' must be an integer");
|
|
3666
|
+
return true;
|
|
3667
|
+
}
|
|
3668
|
+
},
|
|
3669
|
+
createdAt: {
|
|
3670
|
+
type: "number",
|
|
3671
|
+
readOnly: true,
|
|
3672
|
+
required: true,
|
|
3673
|
+
default: () => Date.now(),
|
|
3674
|
+
set: () => Date.now()
|
|
3675
|
+
},
|
|
3676
|
+
updatedAt: {
|
|
3677
|
+
type: "number",
|
|
3678
|
+
watch: "*",
|
|
3679
|
+
required: true,
|
|
3680
|
+
default: () => Date.now(),
|
|
3681
|
+
set: () => Date.now()
|
|
3682
|
+
}
|
|
3683
|
+
},
|
|
3684
|
+
indexes: {
|
|
3685
|
+
byMessageId: {
|
|
3686
|
+
pk: {
|
|
3687
|
+
field: "gsi2pk",
|
|
3688
|
+
composite: ["messageId"]
|
|
3689
|
+
},
|
|
3690
|
+
sk: {
|
|
3691
|
+
field: "gsi2sk",
|
|
3692
|
+
composite: ["bodyPartContentId"]
|
|
3693
|
+
},
|
|
3694
|
+
index: "gsi2",
|
|
3695
|
+
collection: "messageData"
|
|
3696
|
+
},
|
|
3697
|
+
BodyPartContent: {
|
|
3698
|
+
pk: {
|
|
3699
|
+
field: "pk",
|
|
3700
|
+
composite: ["bodyPartContentId"]
|
|
3701
|
+
},
|
|
3702
|
+
sk: {
|
|
3703
|
+
field: "sk",
|
|
3704
|
+
composite: []
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
},
|
|
3708
|
+
model: {
|
|
3709
|
+
entity: "bodyPartContent",
|
|
3710
|
+
service: "remit",
|
|
3711
|
+
version: "1"
|
|
3712
|
+
}
|
|
3713
|
+
};
|
|
3714
|
+
export const Label = {
|
|
3715
|
+
attributes: {
|
|
3716
|
+
labelId: {
|
|
3717
|
+
type: "string",
|
|
3718
|
+
required: true,
|
|
3719
|
+
validate: value => {
|
|
3720
|
+
if (typeof value === "string" && value.length < 25)
|
|
3721
|
+
throw new Error("'labelId' must be at least 25 characters");
|
|
3722
|
+
if (typeof value === "string" && value.length > 25)
|
|
3723
|
+
throw new Error("'labelId' must be at most 25 characters");
|
|
3724
|
+
return true;
|
|
3725
|
+
}
|
|
3726
|
+
},
|
|
3727
|
+
accountConfigId: {
|
|
3728
|
+
type: "string",
|
|
3729
|
+
required: true,
|
|
3730
|
+
validate: value => {
|
|
3731
|
+
if (typeof value === "string" && value.length < 25)
|
|
3732
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
3733
|
+
if (typeof value === "string" && value.length > 25)
|
|
3734
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
3735
|
+
return true;
|
|
3736
|
+
}
|
|
3737
|
+
},
|
|
3738
|
+
name: {
|
|
3739
|
+
type: "string",
|
|
3740
|
+
required: true,
|
|
3741
|
+
validate: value => {
|
|
3742
|
+
if (typeof value === "string" && value.length > 140)
|
|
3743
|
+
throw new Error("'name' must be at most 140 characters");
|
|
3744
|
+
return true;
|
|
3745
|
+
}
|
|
3746
|
+
},
|
|
3747
|
+
normalizedName: {
|
|
3748
|
+
type: "string",
|
|
3749
|
+
required: true,
|
|
3750
|
+
validate: value => {
|
|
3751
|
+
if (typeof value === "string" && value.length > 140)
|
|
3752
|
+
throw new Error("'normalizedName' must be at most 140 characters");
|
|
3753
|
+
return true;
|
|
3754
|
+
}
|
|
3755
|
+
},
|
|
3756
|
+
color: {
|
|
3757
|
+
type: ["Default", "Red", "Orange", "Yellow", "Green", "Teal", "Blue", "Purple", "Gray"],
|
|
3758
|
+
required: true,
|
|
3759
|
+
default: "Default"
|
|
3760
|
+
},
|
|
3761
|
+
createdAt: {
|
|
3762
|
+
type: "number",
|
|
3763
|
+
readOnly: true,
|
|
3764
|
+
required: true,
|
|
3765
|
+
default: () => Date.now(),
|
|
3766
|
+
set: () => Date.now()
|
|
3767
|
+
},
|
|
3768
|
+
updatedAt: {
|
|
3769
|
+
type: "number",
|
|
3770
|
+
watch: "*",
|
|
3771
|
+
required: true,
|
|
3772
|
+
default: () => Date.now(),
|
|
3773
|
+
set: () => Date.now()
|
|
3774
|
+
}
|
|
3775
|
+
},
|
|
3776
|
+
indexes: {
|
|
3777
|
+
byNormalizedName: {
|
|
3778
|
+
pk: {
|
|
3779
|
+
field: "gsi0pk",
|
|
3780
|
+
composite: ["accountConfigId"]
|
|
3781
|
+
},
|
|
3782
|
+
sk: {
|
|
3783
|
+
field: "gsi0sk",
|
|
3784
|
+
composite: ["normalizedName"]
|
|
3785
|
+
},
|
|
3786
|
+
index: "gsi0"
|
|
3787
|
+
},
|
|
3788
|
+
Label: {
|
|
3789
|
+
pk: {
|
|
3790
|
+
field: "pk",
|
|
3791
|
+
composite: ["accountConfigId"]
|
|
3792
|
+
},
|
|
3793
|
+
sk: {
|
|
3794
|
+
field: "sk",
|
|
3795
|
+
composite: ["labelId"]
|
|
3796
|
+
}
|
|
3797
|
+
}
|
|
3798
|
+
},
|
|
3799
|
+
model: {
|
|
3800
|
+
entity: "label",
|
|
3801
|
+
service: "remit",
|
|
3802
|
+
version: "1"
|
|
3803
|
+
}
|
|
3804
|
+
};
|
|
3805
|
+
export const MessageLabel = {
|
|
3806
|
+
attributes: {
|
|
3807
|
+
messageLabelId: {
|
|
3808
|
+
type: "string",
|
|
3809
|
+
required: true,
|
|
3810
|
+
validate: value => {
|
|
3811
|
+
if (typeof value === "string" && value.length < 25)
|
|
3812
|
+
throw new Error("'messageLabelId' must be at least 25 characters");
|
|
3813
|
+
if (typeof value === "string" && value.length > 25)
|
|
3814
|
+
throw new Error("'messageLabelId' must be at most 25 characters");
|
|
3815
|
+
return true;
|
|
3816
|
+
}
|
|
3817
|
+
},
|
|
3818
|
+
messageId: {
|
|
3819
|
+
type: "string",
|
|
3820
|
+
required: true,
|
|
3821
|
+
validate: value => {
|
|
3822
|
+
if (typeof value === "string" && value.length < 25)
|
|
3823
|
+
throw new Error("'messageId' must be at least 25 characters");
|
|
3824
|
+
if (typeof value === "string" && value.length > 25)
|
|
3825
|
+
throw new Error("'messageId' must be at most 25 characters");
|
|
3826
|
+
return true;
|
|
3827
|
+
}
|
|
3828
|
+
},
|
|
3829
|
+
labelId: {
|
|
3830
|
+
type: "string",
|
|
3831
|
+
required: true,
|
|
3832
|
+
validate: value => {
|
|
3833
|
+
if (typeof value === "string" && value.length < 25)
|
|
3834
|
+
throw new Error("'labelId' must be at least 25 characters");
|
|
3835
|
+
if (typeof value === "string" && value.length > 25)
|
|
3836
|
+
throw new Error("'labelId' must be at most 25 characters");
|
|
3837
|
+
return true;
|
|
3838
|
+
}
|
|
3839
|
+
},
|
|
3840
|
+
accountConfigId: {
|
|
3841
|
+
type: "string",
|
|
3842
|
+
required: true,
|
|
3843
|
+
validate: value => {
|
|
3844
|
+
if (typeof value === "string" && value.length < 25)
|
|
3845
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
3846
|
+
if (typeof value === "string" && value.length > 25)
|
|
3847
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
3848
|
+
return true;
|
|
3849
|
+
}
|
|
3850
|
+
},
|
|
3851
|
+
appliedByFilterId: {
|
|
3852
|
+
type: "string",
|
|
3853
|
+
required: false,
|
|
3854
|
+
validate: value => {
|
|
3855
|
+
if (typeof value === "string" && value.length < 25)
|
|
3856
|
+
throw new Error("'appliedByFilterId' must be at least 25 characters");
|
|
3857
|
+
if (typeof value === "string" && value.length > 25)
|
|
3858
|
+
throw new Error("'appliedByFilterId' must be at most 25 characters");
|
|
3859
|
+
return true;
|
|
3860
|
+
}
|
|
3861
|
+
},
|
|
3862
|
+
createdAt: {
|
|
3863
|
+
type: "number",
|
|
3864
|
+
readOnly: true,
|
|
3865
|
+
required: true,
|
|
3866
|
+
default: () => Date.now(),
|
|
3867
|
+
set: () => Date.now()
|
|
3868
|
+
},
|
|
3869
|
+
updatedAt: {
|
|
3870
|
+
type: "number",
|
|
3871
|
+
watch: "*",
|
|
3872
|
+
required: true,
|
|
3873
|
+
default: () => Date.now(),
|
|
3874
|
+
set: () => Date.now()
|
|
3875
|
+
}
|
|
3876
|
+
},
|
|
3877
|
+
indexes: {
|
|
3878
|
+
byLabelId: {
|
|
3879
|
+
pk: {
|
|
3880
|
+
field: "gsi2pk",
|
|
3881
|
+
composite: ["accountConfigId"]
|
|
3882
|
+
},
|
|
3883
|
+
sk: {
|
|
3884
|
+
field: "gsi2sk",
|
|
3885
|
+
composite: ["labelId", "createdAt"]
|
|
3886
|
+
},
|
|
3887
|
+
index: "gsi2"
|
|
3888
|
+
},
|
|
3889
|
+
byMessageId: {
|
|
3890
|
+
pk: {
|
|
3891
|
+
field: "gsi1pk",
|
|
3892
|
+
composite: ["messageId"]
|
|
3893
|
+
},
|
|
3894
|
+
sk: {
|
|
3895
|
+
field: "gsi1sk",
|
|
3896
|
+
composite: ["labelId"]
|
|
3897
|
+
},
|
|
3898
|
+
index: "gsi1"
|
|
3899
|
+
},
|
|
3900
|
+
MessageLabel: {
|
|
3901
|
+
pk: {
|
|
3902
|
+
field: "pk",
|
|
3903
|
+
composite: ["messageLabelId"]
|
|
3904
|
+
},
|
|
3905
|
+
sk: {
|
|
3906
|
+
field: "sk",
|
|
3907
|
+
composite: []
|
|
3908
|
+
}
|
|
3909
|
+
}
|
|
3910
|
+
},
|
|
3911
|
+
model: {
|
|
3912
|
+
entity: "messageLabel",
|
|
3913
|
+
service: "remit",
|
|
3914
|
+
version: "1"
|
|
3915
|
+
}
|
|
3916
|
+
};
|
|
3917
|
+
export const FilterAnchor = {
|
|
3918
|
+
attributes: {
|
|
3919
|
+
accountConfigId: {
|
|
3920
|
+
type: "string",
|
|
3921
|
+
required: true,
|
|
3922
|
+
validate: value => {
|
|
3923
|
+
if (typeof value === "string" && value.length < 25)
|
|
3924
|
+
throw new Error("'accountConfigId' must be at least 25 characters");
|
|
3925
|
+
if (typeof value === "string" && value.length > 25)
|
|
3926
|
+
throw new Error("'accountConfigId' must be at most 25 characters");
|
|
3927
|
+
return true;
|
|
3928
|
+
}
|
|
3929
|
+
},
|
|
3930
|
+
filterId: {
|
|
3931
|
+
type: "string",
|
|
3932
|
+
required: true,
|
|
3933
|
+
validate: value => {
|
|
3934
|
+
if (typeof value === "string" && value.length < 25)
|
|
3935
|
+
throw new Error("'filterId' must be at least 25 characters");
|
|
3936
|
+
if (typeof value === "string" && value.length > 25)
|
|
3937
|
+
throw new Error("'filterId' must be at most 25 characters");
|
|
3938
|
+
return true;
|
|
3939
|
+
}
|
|
3940
|
+
},
|
|
3941
|
+
anchorEmbedding: {
|
|
3942
|
+
type: "list",
|
|
3943
|
+
items: {
|
|
3944
|
+
type: "number"
|
|
3945
|
+
},
|
|
3946
|
+
required: true
|
|
3947
|
+
},
|
|
3948
|
+
anchorEmbeddingId: {
|
|
3949
|
+
type: "string",
|
|
3950
|
+
required: true
|
|
3951
|
+
},
|
|
3952
|
+
anchorSourceText: {
|
|
3953
|
+
type: "string",
|
|
3954
|
+
required: true,
|
|
3955
|
+
validate: value => {
|
|
3956
|
+
if (typeof value === "string" && value.length > 512)
|
|
3957
|
+
throw new Error("'anchorSourceText' must be at most 512 characters");
|
|
3958
|
+
return true;
|
|
3959
|
+
}
|
|
3960
|
+
},
|
|
3961
|
+
anchorMessageId: {
|
|
3962
|
+
type: "string",
|
|
3963
|
+
required: true,
|
|
3964
|
+
validate: value => {
|
|
3965
|
+
if (typeof value === "string" && value.length < 25)
|
|
3966
|
+
throw new Error("'anchorMessageId' must be at least 25 characters");
|
|
3967
|
+
if (typeof value === "string" && value.length > 25)
|
|
3968
|
+
throw new Error("'anchorMessageId' must be at most 25 characters");
|
|
3969
|
+
return true;
|
|
3970
|
+
}
|
|
3971
|
+
},
|
|
3972
|
+
createdAt: {
|
|
3973
|
+
type: "number",
|
|
3974
|
+
readOnly: true,
|
|
3975
|
+
required: true,
|
|
3976
|
+
default: () => Date.now(),
|
|
3977
|
+
set: () => Date.now()
|
|
3978
|
+
},
|
|
3979
|
+
updatedAt: {
|
|
3980
|
+
type: "number",
|
|
3981
|
+
watch: "*",
|
|
3982
|
+
required: true,
|
|
3983
|
+
default: () => Date.now(),
|
|
3984
|
+
set: () => Date.now()
|
|
3985
|
+
}
|
|
3986
|
+
},
|
|
3987
|
+
indexes: {
|
|
3988
|
+
FilterAnchor: {
|
|
3989
|
+
pk: {
|
|
3990
|
+
field: "pk",
|
|
3991
|
+
composite: ["accountConfigId"]
|
|
3992
|
+
},
|
|
3993
|
+
sk: {
|
|
3994
|
+
field: "sk",
|
|
3995
|
+
composite: ["filterId"]
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
},
|
|
3999
|
+
model: {
|
|
4000
|
+
entity: "filterAnchor",
|
|
4001
|
+
service: "remit",
|
|
4002
|
+
version: "1"
|
|
4003
|
+
}
|
|
4004
|
+
};
|