@fleetless/contracts 6.3.0-next.5 → 6.4.0-next.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/CONTRIBUTING.md +4 -4
  3. package/artifacts/openapi.json +4386 -1883
  4. package/artifacts/routes.json +461 -2
  5. package/artifacts/schema/admin-org-detail.schema.json +641 -0
  6. package/artifacts/schema/admin-search-query.schema.json +14 -0
  7. package/artifacts/schema/admin-search-response.schema.json +219 -0
  8. package/artifacts/schema/billing-address.schema.json +49 -0
  9. package/artifacts/schema/billing-cancel-request.schema.json +12 -0
  10. package/artifacts/schema/billing-change-request.schema.json +60 -0
  11. package/artifacts/schema/billing-change-response.schema.json +799 -0
  12. package/artifacts/schema/billing-details-update.schema.json +25 -0
  13. package/artifacts/schema/billing-details.schema.json +176 -0
  14. package/artifacts/schema/billing-invoice.schema.json +76 -0
  15. package/artifacts/schema/billing-view.schema.json +705 -0
  16. package/artifacts/schema/checkout-request.schema.json +252 -0
  17. package/artifacts/schema/checkout-response.schema.json +22 -0
  18. package/artifacts/schema/checkout-status.schema.json +49 -0
  19. package/artifacts/schema/noop-command-request.schema.json +75 -0
  20. package/artifacts/schema/noop-command-response.schema.json +134 -0
  21. package/artifacts/schema/operator-audit-ref.schema.json +28 -0
  22. package/artifacts/schema/operator-preview.schema.json +66 -0
  23. package/artifacts/schema/payment-method-change-request.schema.json +19 -0
  24. package/artifacts/schema/payment-method.schema.json +86 -0
  25. package/artifacts/schema/payment-provider-unavailable-details.schema.json +29 -0
  26. package/artifacts/schema/preview-stale-details.schema.json +80 -0
  27. package/artifacts/schema/vat-id-check-request.schema.json +22 -0
  28. package/artifacts/schema/vat-id-check-response.schema.json +36 -0
  29. package/dist/admin.d.ts +217 -0
  30. package/dist/admin.js +39 -0
  31. package/dist/app-users.d.ts +3 -3
  32. package/dist/billing.d.ts +812 -0
  33. package/dist/billing.js +471 -0
  34. package/dist/errors.d.ts +23 -11
  35. package/dist/errors.js +47 -0
  36. package/dist/index.d.ts +12 -4
  37. package/dist/index.js +10 -2
  38. package/dist/operator-commands.d.ts +137 -0
  39. package/dist/operator-commands.js +51 -0
  40. package/dist/operator.d.ts +63 -0
  41. package/dist/operator.js +48 -0
  42. package/dist/plans.d.ts +25 -25
  43. package/dist/realtime.d.ts +2 -2
  44. package/dist/rest.d.ts +3 -3
  45. package/dist/routes.d.ts +21 -2
  46. package/dist/routes.js +270 -4
  47. package/package.json +1 -1
@@ -0,0 +1,252 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "plan": {
6
+ "type": "string",
7
+ "enum": [
8
+ "plus",
9
+ "pro"
10
+ ],
11
+ "description": "The plan to buy."
12
+ },
13
+ "cycle": {
14
+ "type": "string",
15
+ "enum": [
16
+ "monthly",
17
+ "yearly"
18
+ ],
19
+ "description": "Monthly, or yearly at 15 % off."
20
+ },
21
+ "addons": {
22
+ "description": "Add-on counts to buy alongside the plan. Pro only; named on `plus`, or without the feature, `400 validation_error`.",
23
+ "type": "object",
24
+ "properties": {
25
+ "seats": {
26
+ "type": "integer",
27
+ "minimum": 0,
28
+ "maximum": 9007199254740991,
29
+ "description": "Extra developer seats, one each."
30
+ },
31
+ "robots": {
32
+ "type": "integer",
33
+ "minimum": 0,
34
+ "maximum": 9007199254740991,
35
+ "description": "Extra robots, one each."
36
+ },
37
+ "apps": {
38
+ "type": "integer",
39
+ "minimum": 0,
40
+ "maximum": 9007199254740991,
41
+ "description": "Extra apps, one each."
42
+ },
43
+ "app_user_packs": {
44
+ "type": "integer",
45
+ "minimum": 0,
46
+ "maximum": 9007199254740991,
47
+ "description": "Packs of five extra app users."
48
+ },
49
+ "live_video_packs": {
50
+ "type": "integer",
51
+ "minimum": 0,
52
+ "maximum": 9007199254740991,
53
+ "description": "Packs of 250 extra hours of app-user live video per month."
54
+ }
55
+ },
56
+ "additionalProperties": false
57
+ },
58
+ "billing": {
59
+ "oneOf": [
60
+ {
61
+ "type": "object",
62
+ "properties": {
63
+ "kind": {
64
+ "type": "string",
65
+ "const": "company",
66
+ "description": "Billed as a company."
67
+ },
68
+ "company_name": {
69
+ "type": "string",
70
+ "minLength": 1,
71
+ "maxLength": 200,
72
+ "description": "The company's legal name, printed on the invoice."
73
+ },
74
+ "vat_id": {
75
+ "anyOf": [
76
+ {
77
+ "type": "string",
78
+ "maxLength": 20
79
+ },
80
+ {
81
+ "type": "null"
82
+ }
83
+ ],
84
+ "description": "The company's VAT ID, or `null` for none. Required, and must check out through VIES, for a company outside Germany."
85
+ },
86
+ "address": {
87
+ "type": "object",
88
+ "properties": {
89
+ "line1": {
90
+ "type": "string",
91
+ "minLength": 1,
92
+ "maxLength": 200,
93
+ "description": "Street and number, or the first address line."
94
+ },
95
+ "line2": {
96
+ "anyOf": [
97
+ {
98
+ "type": "string",
99
+ "maxLength": 200
100
+ },
101
+ {
102
+ "type": "null"
103
+ }
104
+ ],
105
+ "description": "A second address line, or `null` when there is none."
106
+ },
107
+ "postal_code": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "maxLength": 20,
111
+ "description": "Postal or ZIP code."
112
+ },
113
+ "city": {
114
+ "type": "string",
115
+ "minLength": 1,
116
+ "maxLength": 100,
117
+ "description": "City or town."
118
+ },
119
+ "country": {
120
+ "type": "string",
121
+ "pattern": "^[A-Z]{2}$",
122
+ "description": "The billing country. Decides VAT (`vatFor`) and currency (`currencyForCountry`)."
123
+ }
124
+ },
125
+ "required": [
126
+ "line1",
127
+ "line2",
128
+ "postal_code",
129
+ "city",
130
+ "country"
131
+ ],
132
+ "additionalProperties": false,
133
+ "description": "The billing address."
134
+ },
135
+ "invoice_email": {
136
+ "type": "string",
137
+ "format": "email",
138
+ "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
139
+ "description": "Where invoices and billing mail are sent."
140
+ }
141
+ },
142
+ "required": [
143
+ "kind",
144
+ "company_name",
145
+ "vat_id",
146
+ "address",
147
+ "invoice_email"
148
+ ],
149
+ "additionalProperties": false,
150
+ "description": "A company: name and an optional VAT ID, never 'full name'."
151
+ },
152
+ {
153
+ "type": "object",
154
+ "properties": {
155
+ "kind": {
156
+ "type": "string",
157
+ "const": "person",
158
+ "description": "Billed as a person."
159
+ },
160
+ "full_name": {
161
+ "type": "string",
162
+ "minLength": 1,
163
+ "maxLength": 200,
164
+ "description": "The person's full name, printed on the invoice."
165
+ },
166
+ "address": {
167
+ "type": "object",
168
+ "properties": {
169
+ "line1": {
170
+ "type": "string",
171
+ "minLength": 1,
172
+ "maxLength": 200,
173
+ "description": "Street and number, or the first address line."
174
+ },
175
+ "line2": {
176
+ "anyOf": [
177
+ {
178
+ "type": "string",
179
+ "maxLength": 200
180
+ },
181
+ {
182
+ "type": "null"
183
+ }
184
+ ],
185
+ "description": "A second address line, or `null` when there is none."
186
+ },
187
+ "postal_code": {
188
+ "type": "string",
189
+ "minLength": 1,
190
+ "maxLength": 20,
191
+ "description": "Postal or ZIP code."
192
+ },
193
+ "city": {
194
+ "type": "string",
195
+ "minLength": 1,
196
+ "maxLength": 100,
197
+ "description": "City or town."
198
+ },
199
+ "country": {
200
+ "type": "string",
201
+ "pattern": "^[A-Z]{2}$",
202
+ "description": "The billing country. Decides VAT (`vatFor`) and currency (`currencyForCountry`)."
203
+ }
204
+ },
205
+ "required": [
206
+ "line1",
207
+ "line2",
208
+ "postal_code",
209
+ "city",
210
+ "country"
211
+ ],
212
+ "additionalProperties": false,
213
+ "description": "The billing address."
214
+ },
215
+ "invoice_email": {
216
+ "type": "string",
217
+ "format": "email",
218
+ "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
219
+ "description": "Where invoices and billing mail are sent."
220
+ }
221
+ },
222
+ "required": [
223
+ "kind",
224
+ "full_name",
225
+ "address",
226
+ "invoice_email"
227
+ ],
228
+ "additionalProperties": false,
229
+ "description": "A person: a full name, never a VAT ID — only a company can be VAT-registered."
230
+ }
231
+ ],
232
+ "description": "Who is paying, and where the invoice goes."
233
+ },
234
+ "accept_terms": {
235
+ "type": "boolean",
236
+ "const": true,
237
+ "description": "Confirms Fleetless's terms of service. Always required."
238
+ },
239
+ "accept_withdrawal": {
240
+ "description": "Confirms the plan starts at once and the 14-day right of withdrawal ends with it. Required for a person; a company sending it is `400 validation_error` — it has no withdrawal right to confirm.",
241
+ "type": "boolean",
242
+ "const": true
243
+ }
244
+ },
245
+ "required": [
246
+ "plan",
247
+ "cycle",
248
+ "billing",
249
+ "accept_terms"
250
+ ],
251
+ "additionalProperties": false
252
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "checkout_id": {
6
+ "type": "string",
7
+ "format": "uuid",
8
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
9
+ "description": "Identifies this checkout: polled by `GET /api/billing/checkout/:id` and carried on the return URL."
10
+ },
11
+ "checkout_url": {
12
+ "type": "string",
13
+ "format": "uri",
14
+ "description": "Mollie's hosted checkout page. The caller's browser is sent here."
15
+ }
16
+ },
17
+ "required": [
18
+ "checkout_id",
19
+ "checkout_url"
20
+ ],
21
+ "additionalProperties": false
22
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "checkout_id": {
6
+ "type": "string",
7
+ "format": "uuid",
8
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
9
+ "description": "The checkout this status is for."
10
+ },
11
+ "status": {
12
+ "type": "string",
13
+ "enum": [
14
+ "pending",
15
+ "paid",
16
+ "failed",
17
+ "canceled",
18
+ "expired"
19
+ ],
20
+ "description": "Mollie's payment status, as `reconcilePayment` last read it."
21
+ },
22
+ "purpose": {
23
+ "type": "string",
24
+ "enum": [
25
+ "upgrade",
26
+ "payment_method",
27
+ "invoice"
28
+ ],
29
+ "description": "What this checkout paid for: a plan upgrade, a payment-method change, or an open invoice."
30
+ },
31
+ "plan": {
32
+ "type": "string",
33
+ "enum": [
34
+ "basic",
35
+ "plus",
36
+ "pro",
37
+ "enterprise"
38
+ ],
39
+ "description": "The org's plan after applying — unchanged unless `purpose` is `upgrade` and `status` is `paid`."
40
+ }
41
+ },
42
+ "required": [
43
+ "checkout_id",
44
+ "status",
45
+ "purpose",
46
+ "plan"
47
+ ],
48
+ "additionalProperties": false
49
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "oneOf": [
4
+ {
5
+ "type": "object",
6
+ "properties": {
7
+ "mode": {
8
+ "type": "string",
9
+ "const": "preview"
10
+ },
11
+ "input": {
12
+ "type": "object",
13
+ "properties": {
14
+ "org_id": {
15
+ "type": "string",
16
+ "format": "uuid",
17
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
18
+ }
19
+ },
20
+ "required": [
21
+ "org_id"
22
+ ]
23
+ }
24
+ },
25
+ "required": [
26
+ "mode",
27
+ "input"
28
+ ]
29
+ },
30
+ {
31
+ "type": "object",
32
+ "properties": {
33
+ "mode": {
34
+ "type": "string",
35
+ "const": "execute"
36
+ },
37
+ "input": {
38
+ "type": "object",
39
+ "properties": {
40
+ "org_id": {
41
+ "type": "string",
42
+ "format": "uuid",
43
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
44
+ }
45
+ },
46
+ "required": [
47
+ "org_id"
48
+ ]
49
+ },
50
+ "reason": {
51
+ "type": "string",
52
+ "minLength": 10,
53
+ "maxLength": 2000
54
+ },
55
+ "preview_token": {
56
+ "type": "string",
57
+ "minLength": 1,
58
+ "maxLength": 512
59
+ },
60
+ "idempotency_key": {
61
+ "type": "string",
62
+ "format": "uuid",
63
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
64
+ }
65
+ },
66
+ "required": [
67
+ "mode",
68
+ "input",
69
+ "reason",
70
+ "preview_token",
71
+ "idempotency_key"
72
+ ]
73
+ }
74
+ ]
75
+ }
@@ -0,0 +1,134 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "anyOf": [
4
+ {
5
+ "type": "object",
6
+ "properties": {
7
+ "preview": {
8
+ "type": "object",
9
+ "properties": {
10
+ "effects": {
11
+ "minItems": 1,
12
+ "maxItems": 50,
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "properties": {
17
+ "kind": {
18
+ "type": "string",
19
+ "enum": [
20
+ "changes",
21
+ "triggers",
22
+ "keeps"
23
+ ],
24
+ "description": "`changes`: a value moves from `from` to `to`. `triggers`: something is set off (a mail, a refund, a document). `keeps`: something explicitly stays as it is."
25
+ },
26
+ "label": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "maxLength": 300
30
+ },
31
+ "from": {
32
+ "anyOf": [
33
+ {
34
+ "type": "string",
35
+ "maxLength": 300
36
+ },
37
+ {
38
+ "type": "null"
39
+ }
40
+ ]
41
+ },
42
+ "to": {
43
+ "anyOf": [
44
+ {
45
+ "type": "string",
46
+ "maxLength": 300
47
+ },
48
+ {
49
+ "type": "null"
50
+ }
51
+ ]
52
+ },
53
+ "amount_cents": {
54
+ "type": "integer",
55
+ "minimum": -9007199254740991,
56
+ "maximum": 9007199254740991
57
+ }
58
+ },
59
+ "required": [
60
+ "kind",
61
+ "label"
62
+ ],
63
+ "additionalProperties": false
64
+ }
65
+ }
66
+ },
67
+ "required": [
68
+ "effects"
69
+ ],
70
+ "additionalProperties": false
71
+ },
72
+ "preview_token": {
73
+ "type": "string",
74
+ "minLength": 1
75
+ }
76
+ },
77
+ "required": [
78
+ "preview",
79
+ "preview_token"
80
+ ],
81
+ "additionalProperties": false
82
+ },
83
+ {
84
+ "type": "object",
85
+ "properties": {
86
+ "result": {
87
+ "type": "object",
88
+ "properties": {
89
+ "changed": {
90
+ "type": "boolean",
91
+ "const": false
92
+ }
93
+ },
94
+ "required": [
95
+ "changed"
96
+ ],
97
+ "additionalProperties": false
98
+ },
99
+ "audit_ref": {
100
+ "type": "object",
101
+ "properties": {
102
+ "operator_audit": {
103
+ "type": "string",
104
+ "format": "uuid",
105
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
106
+ },
107
+ "org_audit": {
108
+ "anyOf": [
109
+ {
110
+ "type": "string",
111
+ "format": "uuid",
112
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
113
+ },
114
+ {
115
+ "type": "null"
116
+ }
117
+ ]
118
+ }
119
+ },
120
+ "required": [
121
+ "operator_audit",
122
+ "org_audit"
123
+ ],
124
+ "additionalProperties": false
125
+ }
126
+ },
127
+ "required": [
128
+ "result",
129
+ "audit_ref"
130
+ ],
131
+ "additionalProperties": false
132
+ }
133
+ ]
134
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "operator_audit": {
6
+ "type": "string",
7
+ "format": "uuid",
8
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
9
+ },
10
+ "org_audit": {
11
+ "anyOf": [
12
+ {
13
+ "type": "string",
14
+ "format": "uuid",
15
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
16
+ },
17
+ {
18
+ "type": "null"
19
+ }
20
+ ]
21
+ }
22
+ },
23
+ "required": [
24
+ "operator_audit",
25
+ "org_audit"
26
+ ],
27
+ "additionalProperties": false
28
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "effects": {
6
+ "minItems": 1,
7
+ "maxItems": 50,
8
+ "type": "array",
9
+ "items": {
10
+ "type": "object",
11
+ "properties": {
12
+ "kind": {
13
+ "type": "string",
14
+ "enum": [
15
+ "changes",
16
+ "triggers",
17
+ "keeps"
18
+ ],
19
+ "description": "`changes`: a value moves from `from` to `to`. `triggers`: something is set off (a mail, a refund, a document). `keeps`: something explicitly stays as it is."
20
+ },
21
+ "label": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "maxLength": 300
25
+ },
26
+ "from": {
27
+ "anyOf": [
28
+ {
29
+ "type": "string",
30
+ "maxLength": 300
31
+ },
32
+ {
33
+ "type": "null"
34
+ }
35
+ ]
36
+ },
37
+ "to": {
38
+ "anyOf": [
39
+ {
40
+ "type": "string",
41
+ "maxLength": 300
42
+ },
43
+ {
44
+ "type": "null"
45
+ }
46
+ ]
47
+ },
48
+ "amount_cents": {
49
+ "type": "integer",
50
+ "minimum": -9007199254740991,
51
+ "maximum": 9007199254740991
52
+ }
53
+ },
54
+ "required": [
55
+ "kind",
56
+ "label"
57
+ ],
58
+ "additionalProperties": false
59
+ }
60
+ }
61
+ },
62
+ "required": [
63
+ "effects"
64
+ ],
65
+ "additionalProperties": false
66
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "method": {
6
+ "type": "string",
7
+ "enum": [
8
+ "card",
9
+ "paypal",
10
+ "applepay"
11
+ ],
12
+ "description": "The new mandate's method. Offer what `billingView.payment_method_options` lists: `applepay` may be refused with `400 validation_error` `{ field: 'method', rule: 'applepay_needs_open_invoice' }` unless an invoice is open."
13
+ }
14
+ },
15
+ "required": [
16
+ "method"
17
+ ],
18
+ "additionalProperties": false
19
+ }