@scaletrail/connector 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/schema.js ADDED
@@ -0,0 +1,1109 @@
1
+ // Generated from the ScaleTrail Connector API v1 JSON Schema. Do not edit by hand.
2
+ export const SCHEMA = Object.freeze({
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "$id": "https://api.scaletrail.io/connect/v1/schema.json",
5
+ "title": "ScaleTrail Connector API v1 (Eigenbau-Shops)",
6
+ "version": "1.0.0-draft.7",
7
+ "oneOf": [
8
+ {
9
+ "$ref": "#/definitions/order_message"
10
+ },
11
+ {
12
+ "$ref": "#/definitions/event_message"
13
+ },
14
+ {
15
+ "$ref": "#/definitions/redact_message"
16
+ }
17
+ ],
18
+ "definitions": {
19
+ "cents": {
20
+ "type": "integer",
21
+ "minimum": 0
22
+ },
23
+ "cents_or_null": {
24
+ "type": [
25
+ "integer",
26
+ "null"
27
+ ],
28
+ "minimum": 0
29
+ },
30
+ "datetime": {
31
+ "type": "string",
32
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,6})?(Z|[+-]\\d{2}:\\d{2})$"
33
+ },
34
+ "datetime_ms": {
35
+ "type": "string",
36
+ "description": "Wie datetime, aber mit 3 bis 6 Nachkommastellen. Fuer updated_at: zwei Staende in derselben Sekunde muessen unterscheidbar sein, ein gleicher Zeitstempel gilt als derselbe Stand.",
37
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3,6}(Z|[+-]\\d{2}:\\d{2})$"
38
+ },
39
+ "datetime_or_null": {
40
+ "type": [
41
+ "string",
42
+ "null"
43
+ ],
44
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,6})?(Z|[+-]\\d{2}:\\d{2})$"
45
+ },
46
+ "id": {
47
+ "type": "string",
48
+ "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
49
+ },
50
+ "id_or_null": {
51
+ "type": [
52
+ "string",
53
+ "null"
54
+ ],
55
+ "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
56
+ },
57
+ "order_id": {
58
+ "type": "string",
59
+ "pattern": "^[A-Za-z0-9_-]{1,64}$"
60
+ },
61
+ "refund_id": {
62
+ "type": "string",
63
+ "pattern": "^[A-Za-z0-9_-]{1,40}$"
64
+ },
65
+ "trailiq": {
66
+ "type": [
67
+ "string",
68
+ "null"
69
+ ],
70
+ "pattern": "^[A-Za-z0-9_|:.~-]{1,256}$"
71
+ },
72
+ "text": {
73
+ "type": [
74
+ "string",
75
+ "null"
76
+ ],
77
+ "maxLength": 256
78
+ },
79
+ "uuid": {
80
+ "type": [
81
+ "string",
82
+ "null"
83
+ ],
84
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[47][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
85
+ },
86
+ "click_id": {
87
+ "type": [
88
+ "string",
89
+ "null"
90
+ ],
91
+ "pattern": "^[A-Za-z0-9_-]{20,200}$"
92
+ },
93
+ "currency": {
94
+ "type": "string",
95
+ "pattern": "^[A-Z]{3}$"
96
+ },
97
+ "country": {
98
+ "type": [
99
+ "string",
100
+ "null"
101
+ ],
102
+ "pattern": "^[A-Z]{2}$"
103
+ },
104
+ "percent": {
105
+ "type": [
106
+ "number",
107
+ "null"
108
+ ],
109
+ "minimum": 0,
110
+ "maximum": 100
111
+ },
112
+ "order_message": {
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "required": [
116
+ "order"
117
+ ],
118
+ "properties": {
119
+ "order": {
120
+ "$ref": "#/definitions/order"
121
+ }
122
+ }
123
+ },
124
+ "event_message": {
125
+ "type": "object",
126
+ "additionalProperties": false,
127
+ "required": [
128
+ "event"
129
+ ],
130
+ "properties": {
131
+ "event": {
132
+ "oneOf": [
133
+ {
134
+ "$ref": "#/definitions/event_add_to_cart"
135
+ },
136
+ {
137
+ "$ref": "#/definitions/event_login_identity"
138
+ }
139
+ ]
140
+ }
141
+ }
142
+ },
143
+ "redact_message": {
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": [
147
+ "redact"
148
+ ],
149
+ "properties": {
150
+ "redact": {
151
+ "$ref": "#/definitions/redact"
152
+ }
153
+ }
154
+ },
155
+ "order": {
156
+ "type": "object",
157
+ "additionalProperties": false,
158
+ "required": [
159
+ "schema_version",
160
+ "order_id",
161
+ "created_at",
162
+ "updated_at",
163
+ "status",
164
+ "sales_channel",
165
+ "is_test",
166
+ "currency",
167
+ "totals",
168
+ "items",
169
+ "customer"
170
+ ],
171
+ "properties": {
172
+ "schema_version": {
173
+ "type": "string",
174
+ "enum": [
175
+ "1"
176
+ ]
177
+ },
178
+ "order_id": {
179
+ "$ref": "#/definitions/order_id"
180
+ },
181
+ "order_number": {
182
+ "$ref": "#/definitions/id_or_null"
183
+ },
184
+ "origin": {
185
+ "type": "string",
186
+ "enum": [
187
+ "native",
188
+ "migrated"
189
+ ]
190
+ },
191
+ "created_at": {
192
+ "$ref": "#/definitions/datetime"
193
+ },
194
+ "updated_at": {
195
+ "$ref": "#/definitions/datetime_ms"
196
+ },
197
+ "paid_at": {
198
+ "$ref": "#/definitions/datetime_or_null"
199
+ },
200
+ "status": {
201
+ "type": "string",
202
+ "enum": [
203
+ "pending",
204
+ "processing",
205
+ "on-hold",
206
+ "completed",
207
+ "cancelled",
208
+ "refunded",
209
+ "failed"
210
+ ]
211
+ },
212
+ "sales_channel": {
213
+ "type": "string",
214
+ "pattern": "^[a-z0-9_-]{1,40}$"
215
+ },
216
+ "is_test": {
217
+ "type": "boolean"
218
+ },
219
+ "currency": {
220
+ "$ref": "#/definitions/currency"
221
+ },
222
+ "language": {
223
+ "type": [
224
+ "string",
225
+ "null"
226
+ ],
227
+ "pattern": "^[a-z]{2}(-[a-z]{2})?$"
228
+ },
229
+ "totals": {
230
+ "$ref": "#/definitions/totals"
231
+ },
232
+ "items": {
233
+ "type": "array",
234
+ "minItems": 1,
235
+ "maxItems": 250,
236
+ "items": {
237
+ "$ref": "#/definitions/item"
238
+ }
239
+ },
240
+ "discounts": {
241
+ "type": "array",
242
+ "maxItems": 50,
243
+ "items": {
244
+ "$ref": "#/definitions/discount"
245
+ }
246
+ },
247
+ "payments": {
248
+ "type": "array",
249
+ "maxItems": 20,
250
+ "items": {
251
+ "$ref": "#/definitions/payment"
252
+ }
253
+ },
254
+ "shipments": {
255
+ "type": "array",
256
+ "maxItems": 20,
257
+ "items": {
258
+ "$ref": "#/definitions/shipment"
259
+ }
260
+ },
261
+ "refunds": {
262
+ "type": "array",
263
+ "maxItems": 50,
264
+ "items": {
265
+ "$ref": "#/definitions/refund"
266
+ }
267
+ },
268
+ "subscription": {
269
+ "oneOf": [
270
+ {
271
+ "type": "null"
272
+ },
273
+ {
274
+ "$ref": "#/definitions/subscription"
275
+ }
276
+ ]
277
+ },
278
+ "customer": {
279
+ "$ref": "#/definitions/customer"
280
+ },
281
+ "billing_address": {
282
+ "oneOf": [
283
+ {
284
+ "type": "null"
285
+ },
286
+ {
287
+ "$ref": "#/definitions/address"
288
+ }
289
+ ]
290
+ },
291
+ "shipping_address": {
292
+ "oneOf": [
293
+ {
294
+ "type": "null"
295
+ },
296
+ {
297
+ "$ref": "#/definitions/address"
298
+ }
299
+ ]
300
+ },
301
+ "attribution": {
302
+ "oneOf": [
303
+ {
304
+ "type": "null"
305
+ },
306
+ {
307
+ "$ref": "#/definitions/attribution"
308
+ }
309
+ ]
310
+ },
311
+ "client": {
312
+ "oneOf": [
313
+ {
314
+ "type": "null"
315
+ },
316
+ {
317
+ "$ref": "#/definitions/client"
318
+ }
319
+ ]
320
+ },
321
+ "consent": {
322
+ "oneOf": [
323
+ {
324
+ "type": "null"
325
+ },
326
+ {
327
+ "$ref": "#/definitions/consent"
328
+ }
329
+ ]
330
+ }
331
+ }
332
+ },
333
+ "totals": {
334
+ "type": "object",
335
+ "additionalProperties": false,
336
+ "required": [
337
+ "total_cents"
338
+ ],
339
+ "properties": {
340
+ "total_cents": {
341
+ "$ref": "#/definitions/cents"
342
+ },
343
+ "subtotal_cents": {
344
+ "$ref": "#/definitions/cents_or_null"
345
+ },
346
+ "shipping_cents": {
347
+ "$ref": "#/definitions/cents_or_null"
348
+ },
349
+ "discount_cents": {
350
+ "$ref": "#/definitions/cents_or_null"
351
+ },
352
+ "tax_cents": {
353
+ "$ref": "#/definitions/cents_or_null"
354
+ },
355
+ "taxes_included": {
356
+ "type": [
357
+ "boolean",
358
+ "null"
359
+ ]
360
+ },
361
+ "tax_lines": {
362
+ "type": "array",
363
+ "maxItems": 10,
364
+ "items": {
365
+ "type": "object",
366
+ "additionalProperties": false,
367
+ "required": [
368
+ "rate",
369
+ "tax_cents"
370
+ ],
371
+ "properties": {
372
+ "rate": {
373
+ "type": "number",
374
+ "minimum": 0,
375
+ "maximum": 100
376
+ },
377
+ "base_cents": {
378
+ "$ref": "#/definitions/cents_or_null"
379
+ },
380
+ "tax_cents": {
381
+ "$ref": "#/definitions/cents"
382
+ }
383
+ }
384
+ }
385
+ }
386
+ }
387
+ },
388
+ "item": {
389
+ "type": "object",
390
+ "additionalProperties": false,
391
+ "required": [
392
+ "line_id",
393
+ "product_id",
394
+ "name",
395
+ "quantity",
396
+ "unit_price_cents",
397
+ "line_total_cents"
398
+ ],
399
+ "properties": {
400
+ "line_id": {
401
+ "$ref": "#/definitions/id"
402
+ },
403
+ "product_id": {
404
+ "$ref": "#/definitions/id"
405
+ },
406
+ "variant_id": {
407
+ "$ref": "#/definitions/id_or_null"
408
+ },
409
+ "sku": {
410
+ "type": [
411
+ "string",
412
+ "null"
413
+ ],
414
+ "pattern": "^[A-Za-z0-9_.\\-/]{1,64}$"
415
+ },
416
+ "name": {
417
+ "type": "string",
418
+ "minLength": 1,
419
+ "maxLength": 256
420
+ },
421
+ "quantity": {
422
+ "type": "integer",
423
+ "minimum": 1
424
+ },
425
+ "unit_price_cents": {
426
+ "$ref": "#/definitions/cents"
427
+ },
428
+ "line_total_cents": {
429
+ "$ref": "#/definitions/cents"
430
+ },
431
+ "line_discount_cents": {
432
+ "$ref": "#/definitions/cents_or_null"
433
+ },
434
+ "tax_rate": {
435
+ "$ref": "#/definitions/percent"
436
+ },
437
+ "unit_cost_cents": {
438
+ "$ref": "#/definitions/cents_or_null"
439
+ },
440
+ "category": {
441
+ "$ref": "#/definitions/text"
442
+ },
443
+ "is_subscription": {
444
+ "type": [
445
+ "boolean",
446
+ "null"
447
+ ]
448
+ }
449
+ }
450
+ },
451
+ "discount": {
452
+ "type": "object",
453
+ "additionalProperties": false,
454
+ "required": [
455
+ "source",
456
+ "amount_cents"
457
+ ],
458
+ "properties": {
459
+ "source": {
460
+ "type": "string",
461
+ "enum": [
462
+ "coupon",
463
+ "rule",
464
+ "loyalty_points",
465
+ "tier",
466
+ "gift_card",
467
+ "manual"
468
+ ]
469
+ },
470
+ "amount_cents": {
471
+ "$ref": "#/definitions/cents"
472
+ },
473
+ "code": {
474
+ "type": [
475
+ "string",
476
+ "null"
477
+ ],
478
+ "pattern": "^[A-Za-z0-9_\\-.]{1,100}$"
479
+ },
480
+ "rule_id": {
481
+ "$ref": "#/definitions/id_or_null"
482
+ },
483
+ "label": {
484
+ "$ref": "#/definitions/text"
485
+ },
486
+ "line_ids": {
487
+ "type": "array",
488
+ "maxItems": 250,
489
+ "items": {
490
+ "$ref": "#/definitions/id"
491
+ }
492
+ }
493
+ }
494
+ },
495
+ "payment": {
496
+ "type": "object",
497
+ "additionalProperties": false,
498
+ "required": [
499
+ "gateway_id",
500
+ "amount_cents"
501
+ ],
502
+ "properties": {
503
+ "gateway_id": {
504
+ "type": "string",
505
+ "pattern": "^[a-z0-9_-]{1,64}$"
506
+ },
507
+ "method": {
508
+ "$ref": "#/definitions/text"
509
+ },
510
+ "amount_cents": {
511
+ "$ref": "#/definitions/cents"
512
+ },
513
+ "fee_cents": {
514
+ "$ref": "#/definitions/cents_or_null"
515
+ },
516
+ "fee_source": {
517
+ "type": [
518
+ "string",
519
+ "null"
520
+ ],
521
+ "enum": [
522
+ "provider",
523
+ "estimated",
524
+ null
525
+ ]
526
+ },
527
+ "status": {
528
+ "type": [
529
+ "string",
530
+ "null"
531
+ ],
532
+ "enum": [
533
+ "authorized",
534
+ "captured",
535
+ "failed",
536
+ "refunded",
537
+ null
538
+ ]
539
+ },
540
+ "captured_at": {
541
+ "$ref": "#/definitions/datetime_or_null"
542
+ }
543
+ }
544
+ },
545
+ "shipment": {
546
+ "type": "object",
547
+ "additionalProperties": false,
548
+ "required": [
549
+ "shipment_id"
550
+ ],
551
+ "properties": {
552
+ "shipment_id": {
553
+ "$ref": "#/definitions/id"
554
+ },
555
+ "method": {
556
+ "type": [
557
+ "string",
558
+ "null"
559
+ ],
560
+ "pattern": "^[a-z0-9_-]{1,64}$"
561
+ },
562
+ "postage_cents": {
563
+ "$ref": "#/definitions/cents_or_null"
564
+ },
565
+ "weight_grams": {
566
+ "type": [
567
+ "integer",
568
+ "null"
569
+ ],
570
+ "minimum": 0
571
+ },
572
+ "created_at": {
573
+ "$ref": "#/definitions/datetime_or_null"
574
+ }
575
+ }
576
+ },
577
+ "refund": {
578
+ "type": "object",
579
+ "additionalProperties": false,
580
+ "required": [
581
+ "refund_id",
582
+ "created_at",
583
+ "amount_cents"
584
+ ],
585
+ "properties": {
586
+ "refund_id": {
587
+ "$ref": "#/definitions/refund_id"
588
+ },
589
+ "created_at": {
590
+ "$ref": "#/definitions/datetime"
591
+ },
592
+ "amount_cents": {
593
+ "$ref": "#/definitions/cents"
594
+ },
595
+ "tax_cents": {
596
+ "$ref": "#/definitions/cents_or_null"
597
+ },
598
+ "shipping_cents": {
599
+ "$ref": "#/definitions/cents_or_null"
600
+ },
601
+ "reason": {
602
+ "$ref": "#/definitions/text"
603
+ },
604
+ "items": {
605
+ "type": "array",
606
+ "maxItems": 250,
607
+ "items": {
608
+ "type": "object",
609
+ "additionalProperties": false,
610
+ "required": [
611
+ "line_id",
612
+ "quantity"
613
+ ],
614
+ "properties": {
615
+ "line_id": {
616
+ "$ref": "#/definitions/id"
617
+ },
618
+ "quantity": {
619
+ "type": "integer",
620
+ "minimum": 1
621
+ },
622
+ "amount_cents": {
623
+ "$ref": "#/definitions/cents_or_null"
624
+ }
625
+ }
626
+ }
627
+ }
628
+ }
629
+ },
630
+ "subscription": {
631
+ "type": "object",
632
+ "additionalProperties": false,
633
+ "required": [
634
+ "subscription_id",
635
+ "is_renewal"
636
+ ],
637
+ "properties": {
638
+ "subscription_id": {
639
+ "$ref": "#/definitions/id"
640
+ },
641
+ "is_renewal": {
642
+ "type": "boolean"
643
+ },
644
+ "renewal_number": {
645
+ "type": [
646
+ "integer",
647
+ "null"
648
+ ],
649
+ "minimum": 0
650
+ },
651
+ "status": {
652
+ "type": [
653
+ "string",
654
+ "null"
655
+ ],
656
+ "enum": [
657
+ "active",
658
+ "paused",
659
+ "cancelled",
660
+ "payment_failed",
661
+ null
662
+ ]
663
+ },
664
+ "interval": {
665
+ "type": [
666
+ "string",
667
+ "null"
668
+ ],
669
+ "pattern": "^P(\\d+[YMWD])+$"
670
+ },
671
+ "started_at": {
672
+ "$ref": "#/definitions/datetime_or_null"
673
+ }
674
+ }
675
+ },
676
+ "customer": {
677
+ "type": "object",
678
+ "additionalProperties": false,
679
+ "required": [
680
+ "customer_id"
681
+ ],
682
+ "properties": {
683
+ "customer_id": {
684
+ "$ref": "#/definitions/id"
685
+ },
686
+ "is_guest": {
687
+ "type": [
688
+ "boolean",
689
+ "null"
690
+ ]
691
+ },
692
+ "email": {
693
+ "type": [
694
+ "string",
695
+ "null"
696
+ ],
697
+ "maxLength": 254
698
+ },
699
+ "phone": {
700
+ "type": [
701
+ "string",
702
+ "null"
703
+ ],
704
+ "maxLength": 32
705
+ },
706
+ "first_name": {
707
+ "$ref": "#/definitions/text"
708
+ },
709
+ "last_name": {
710
+ "$ref": "#/definitions/text"
711
+ },
712
+ "order_count": {
713
+ "type": [
714
+ "integer",
715
+ "null"
716
+ ],
717
+ "minimum": 1
718
+ },
719
+ "first_order_at": {
720
+ "$ref": "#/definitions/datetime_or_null"
721
+ }
722
+ }
723
+ },
724
+ "address": {
725
+ "type": "object",
726
+ "additionalProperties": false,
727
+ "properties": {
728
+ "street": {
729
+ "$ref": "#/definitions/text"
730
+ },
731
+ "postcode": {
732
+ "type": [
733
+ "string",
734
+ "null"
735
+ ],
736
+ "maxLength": 16
737
+ },
738
+ "city": {
739
+ "$ref": "#/definitions/text"
740
+ },
741
+ "region": {
742
+ "$ref": "#/definitions/text"
743
+ },
744
+ "country": {
745
+ "$ref": "#/definitions/country"
746
+ }
747
+ }
748
+ },
749
+ "attribution": {
750
+ "type": "object",
751
+ "additionalProperties": false,
752
+ "properties": {
753
+ "sa_uid": {
754
+ "$ref": "#/definitions/uuid"
755
+ },
756
+ "click_ids": {
757
+ "type": "object",
758
+ "additionalProperties": false,
759
+ "properties": {
760
+ "gclid": {
761
+ "$ref": "#/definitions/click_id"
762
+ },
763
+ "gbraid": {
764
+ "$ref": "#/definitions/click_id"
765
+ },
766
+ "wbraid": {
767
+ "$ref": "#/definitions/click_id"
768
+ },
769
+ "fbclid": {
770
+ "$ref": "#/definitions/click_id"
771
+ },
772
+ "ttclid": {
773
+ "$ref": "#/definitions/click_id"
774
+ },
775
+ "msclkid": {
776
+ "$ref": "#/definitions/click_id"
777
+ },
778
+ "oppref": {
779
+ "$ref": "#/definitions/click_id"
780
+ },
781
+ "trailiq": {
782
+ "$ref": "#/definitions/trailiq"
783
+ },
784
+ "epik": {
785
+ "$ref": "#/definitions/click_id"
786
+ },
787
+ "srsltid": {
788
+ "$ref": "#/definitions/click_id"
789
+ }
790
+ }
791
+ },
792
+ "utm": {
793
+ "type": "object",
794
+ "additionalProperties": false,
795
+ "properties": {
796
+ "source": {
797
+ "type": [
798
+ "string",
799
+ "null"
800
+ ],
801
+ "maxLength": 200
802
+ },
803
+ "medium": {
804
+ "type": [
805
+ "string",
806
+ "null"
807
+ ],
808
+ "maxLength": 200
809
+ },
810
+ "campaign": {
811
+ "type": [
812
+ "string",
813
+ "null"
814
+ ],
815
+ "maxLength": 200
816
+ },
817
+ "content": {
818
+ "type": [
819
+ "string",
820
+ "null"
821
+ ],
822
+ "maxLength": 200
823
+ },
824
+ "term": {
825
+ "type": [
826
+ "string",
827
+ "null"
828
+ ],
829
+ "maxLength": 200
830
+ },
831
+ "id": {
832
+ "type": [
833
+ "string",
834
+ "null"
835
+ ],
836
+ "maxLength": 200
837
+ }
838
+ }
839
+ },
840
+ "landing_url": {
841
+ "type": [
842
+ "string",
843
+ "null"
844
+ ],
845
+ "maxLength": 2048,
846
+ "pattern": "^https://"
847
+ },
848
+ "referrer": {
849
+ "type": [
850
+ "string",
851
+ "null"
852
+ ],
853
+ "maxLength": 2048
854
+ },
855
+ "browser_ids": {
856
+ "type": "object",
857
+ "additionalProperties": false,
858
+ "properties": {
859
+ "ga": {
860
+ "type": [
861
+ "string",
862
+ "null"
863
+ ],
864
+ "maxLength": 64
865
+ },
866
+ "fbp": {
867
+ "type": [
868
+ "string",
869
+ "null"
870
+ ],
871
+ "maxLength": 128
872
+ },
873
+ "fbc": {
874
+ "type": [
875
+ "string",
876
+ "null"
877
+ ],
878
+ "maxLength": 512
879
+ },
880
+ "ttp": {
881
+ "type": [
882
+ "string",
883
+ "null"
884
+ ],
885
+ "maxLength": 128
886
+ }
887
+ }
888
+ },
889
+ "captured_at": {
890
+ "$ref": "#/definitions/datetime_or_null"
891
+ }
892
+ }
893
+ },
894
+ "client": {
895
+ "type": "object",
896
+ "additionalProperties": false,
897
+ "properties": {
898
+ "ip": {
899
+ "type": [
900
+ "string",
901
+ "null"
902
+ ],
903
+ "maxLength": 45
904
+ },
905
+ "user_agent": {
906
+ "type": [
907
+ "string",
908
+ "null"
909
+ ],
910
+ "maxLength": 512
911
+ }
912
+ }
913
+ },
914
+ "consent": {
915
+ "type": "object",
916
+ "additionalProperties": false,
917
+ "required": [
918
+ "source"
919
+ ],
920
+ "properties": {
921
+ "source": {
922
+ "type": "string",
923
+ "enum": [
924
+ "cookiebot",
925
+ "tcf",
926
+ "custom",
927
+ "none"
928
+ ]
929
+ },
930
+ "statistics": {
931
+ "type": [
932
+ "boolean",
933
+ "null"
934
+ ]
935
+ },
936
+ "marketing": {
937
+ "type": [
938
+ "boolean",
939
+ "null"
940
+ ]
941
+ },
942
+ "captured_at": {
943
+ "$ref": "#/definitions/datetime_or_null"
944
+ }
945
+ }
946
+ },
947
+ "event_add_to_cart": {
948
+ "type": "object",
949
+ "additionalProperties": false,
950
+ "required": [
951
+ "type",
952
+ "event_id",
953
+ "occurred_at",
954
+ "product_id",
955
+ "quantity",
956
+ "unit_price_cents",
957
+ "currency"
958
+ ],
959
+ "properties": {
960
+ "type": {
961
+ "type": "string",
962
+ "enum": [
963
+ "add_to_cart"
964
+ ]
965
+ },
966
+ "event_id": {
967
+ "type": "string",
968
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[47][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
969
+ },
970
+ "occurred_at": {
971
+ "$ref": "#/definitions/datetime"
972
+ },
973
+ "sa_uid": {
974
+ "$ref": "#/definitions/uuid"
975
+ },
976
+ "product_id": {
977
+ "$ref": "#/definitions/id"
978
+ },
979
+ "variant_id": {
980
+ "$ref": "#/definitions/id_or_null"
981
+ },
982
+ "sku": {
983
+ "type": [
984
+ "string",
985
+ "null"
986
+ ],
987
+ "pattern": "^[A-Za-z0-9_.\\-/]{1,64}$"
988
+ },
989
+ "name": {
990
+ "$ref": "#/definitions/text"
991
+ },
992
+ "quantity": {
993
+ "type": "integer",
994
+ "minimum": 1
995
+ },
996
+ "unit_price_cents": {
997
+ "$ref": "#/definitions/cents"
998
+ },
999
+ "currency": {
1000
+ "$ref": "#/definitions/currency"
1001
+ },
1002
+ "page_url": {
1003
+ "type": [
1004
+ "string",
1005
+ "null"
1006
+ ],
1007
+ "maxLength": 2048,
1008
+ "pattern": "^https://"
1009
+ },
1010
+ "client": {
1011
+ "oneOf": [
1012
+ {
1013
+ "type": "null"
1014
+ },
1015
+ {
1016
+ "$ref": "#/definitions/client"
1017
+ }
1018
+ ]
1019
+ }
1020
+ }
1021
+ },
1022
+ "event_login_identity": {
1023
+ "type": "object",
1024
+ "additionalProperties": false,
1025
+ "required": [
1026
+ "type",
1027
+ "event_id",
1028
+ "occurred_at",
1029
+ "customer_id"
1030
+ ],
1031
+ "properties": {
1032
+ "type": {
1033
+ "type": "string",
1034
+ "enum": [
1035
+ "login_identity"
1036
+ ]
1037
+ },
1038
+ "event_id": {
1039
+ "$ref": "#/definitions/id"
1040
+ },
1041
+ "occurred_at": {
1042
+ "$ref": "#/definitions/datetime"
1043
+ },
1044
+ "sa_uid": {
1045
+ "$ref": "#/definitions/uuid"
1046
+ },
1047
+ "customer_id": {
1048
+ "$ref": "#/definitions/id"
1049
+ },
1050
+ "email": {
1051
+ "type": [
1052
+ "string",
1053
+ "null"
1054
+ ],
1055
+ "maxLength": 254
1056
+ },
1057
+ "phone": {
1058
+ "type": [
1059
+ "string",
1060
+ "null"
1061
+ ],
1062
+ "maxLength": 32
1063
+ },
1064
+ "first_name": {
1065
+ "$ref": "#/definitions/text"
1066
+ },
1067
+ "last_name": {
1068
+ "$ref": "#/definitions/text"
1069
+ }
1070
+ }
1071
+ },
1072
+ "redact": {
1073
+ "type": "object",
1074
+ "additionalProperties": false,
1075
+ "required": [
1076
+ "requested_at"
1077
+ ],
1078
+ "properties": {
1079
+ "customer_id": {
1080
+ "$ref": "#/definitions/id_or_null"
1081
+ },
1082
+ "email": {
1083
+ "type": [
1084
+ "string",
1085
+ "null"
1086
+ ],
1087
+ "maxLength": 254
1088
+ },
1089
+ "phone": {
1090
+ "type": [
1091
+ "string",
1092
+ "null"
1093
+ ],
1094
+ "maxLength": 32
1095
+ },
1096
+ "order_ids": {
1097
+ "type": "array",
1098
+ "maxItems": 1000,
1099
+ "items": {
1100
+ "$ref": "#/definitions/order_id"
1101
+ }
1102
+ },
1103
+ "requested_at": {
1104
+ "$ref": "#/definitions/datetime"
1105
+ }
1106
+ }
1107
+ }
1108
+ }
1109
+ });