@fleetless/contracts 6.2.0 → 6.3.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/artifacts/openapi.json +4322 -1887
  3. package/artifacts/routes.json +328 -2
  4. package/artifacts/schema/billing-address.schema.json +49 -0
  5. package/artifacts/schema/billing-cancel-request.schema.json +12 -0
  6. package/artifacts/schema/billing-change-request.schema.json +60 -0
  7. package/artifacts/schema/billing-change-response.schema.json +765 -0
  8. package/artifacts/schema/billing-details-update.schema.json +25 -0
  9. package/artifacts/schema/billing-details.schema.json +176 -0
  10. package/artifacts/schema/billing-invoice.schema.json +76 -0
  11. package/artifacts/schema/billing-view.schema.json +671 -0
  12. package/artifacts/schema/checkout-request.schema.json +252 -0
  13. package/artifacts/schema/checkout-response.schema.json +22 -0
  14. package/artifacts/schema/checkout-status.schema.json +49 -0
  15. package/artifacts/schema/payment-method-change-request.schema.json +19 -0
  16. package/artifacts/schema/payment-method.schema.json +80 -0
  17. package/artifacts/schema/payment-provider-unavailable-details.schema.json +29 -0
  18. package/artifacts/schema/vat-id-check-request.schema.json +22 -0
  19. package/artifacts/schema/vat-id-check-response.schema.json +36 -0
  20. package/dist/billing.d.ts +783 -0
  21. package/dist/billing.js +448 -0
  22. package/dist/errors.d.ts +17 -5
  23. package/dist/errors.js +33 -0
  24. package/dist/index.d.ts +4 -2
  25. package/dist/index.js +5 -1
  26. package/dist/plans.d.ts +9 -9
  27. package/dist/realtime.d.ts +2 -2
  28. package/dist/rest.d.ts +3 -3
  29. package/dist/routes.d.ts +1 -1
  30. package/dist/routes.js +183 -4
  31. 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,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
+ "sepa"
11
+ ],
12
+ "description": "The new mandate's method. `sepa` needs an open invoice to charge a real amount against; without one it is `400 validation_error`."
13
+ }
14
+ },
15
+ "required": [
16
+ "method"
17
+ ],
18
+ "additionalProperties": false
19
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "oneOf": [
4
+ {
5
+ "type": "object",
6
+ "properties": {
7
+ "kind": {
8
+ "type": "string",
9
+ "const": "card",
10
+ "description": "A card mandate."
11
+ },
12
+ "brand": {
13
+ "type": "string",
14
+ "description": "The card network, as Mollie's mandate reports it, e.g. 'Visa'."
15
+ },
16
+ "last4": {
17
+ "type": "string",
18
+ "pattern": "^\\d{4}$",
19
+ "description": "The last four digits of the card."
20
+ },
21
+ "expires": {
22
+ "type": "string",
23
+ "pattern": "^\\d{2}\\/\\d{2}$",
24
+ "description": "Expiry as Mollie's mandate shows it, 'MM/YY'."
25
+ }
26
+ },
27
+ "required": [
28
+ "kind",
29
+ "brand",
30
+ "last4",
31
+ "expires"
32
+ ],
33
+ "additionalProperties": false
34
+ },
35
+ {
36
+ "type": "object",
37
+ "properties": {
38
+ "kind": {
39
+ "type": "string",
40
+ "const": "sepa",
41
+ "description": "A SEPA direct-debit mandate."
42
+ },
43
+ "holder": {
44
+ "type": "string",
45
+ "description": "The account holder's name on the mandate."
46
+ },
47
+ "iban_last4": {
48
+ "type": "string",
49
+ "pattern": "^[0-9A-Z]{4}$",
50
+ "description": "The last four characters of the IBAN."
51
+ }
52
+ },
53
+ "required": [
54
+ "kind",
55
+ "holder",
56
+ "iban_last4"
57
+ ],
58
+ "additionalProperties": false
59
+ },
60
+ {
61
+ "type": "object",
62
+ "properties": {
63
+ "kind": {
64
+ "type": "string",
65
+ "const": "paypal",
66
+ "description": "A PayPal mandate."
67
+ },
68
+ "account": {
69
+ "type": "string",
70
+ "description": "The PayPal account Mollie's mandate names."
71
+ }
72
+ },
73
+ "required": [
74
+ "kind",
75
+ "account"
76
+ ],
77
+ "additionalProperties": false
78
+ }
79
+ ]
80
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "provider": {
6
+ "type": "string",
7
+ "const": "mollie",
8
+ "description": "The payment provider. Always `mollie` today."
9
+ },
10
+ "status": {
11
+ "anyOf": [
12
+ {
13
+ "type": "integer",
14
+ "minimum": -9007199254740991,
15
+ "maximum": 9007199254740991
16
+ },
17
+ {
18
+ "type": "null"
19
+ }
20
+ ],
21
+ "description": "Mollie's own HTTP status, or `null` when the request timed out instead of answering."
22
+ }
23
+ },
24
+ "required": [
25
+ "provider",
26
+ "status"
27
+ ],
28
+ "additionalProperties": false
29
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "country": {
6
+ "type": "string",
7
+ "pattern": "^[A-Z]{2}$",
8
+ "description": "The VAT ID's country."
9
+ },
10
+ "vat_id": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "maxLength": 20,
14
+ "description": "The VAT ID as typed; normalized before the VIES lookup (`normalizeVatId`)."
15
+ }
16
+ },
17
+ "required": [
18
+ "country",
19
+ "vat_id"
20
+ ],
21
+ "additionalProperties": false
22
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "status": {
6
+ "type": "string",
7
+ "enum": [
8
+ "valid",
9
+ "unverified",
10
+ "invalid"
11
+ ],
12
+ "description": "VIES's answer."
13
+ },
14
+ "vat_id": {
15
+ "type": "string",
16
+ "description": "The normalized VAT ID that was checked."
17
+ },
18
+ "name": {
19
+ "anyOf": [
20
+ {
21
+ "type": "string"
22
+ },
23
+ {
24
+ "type": "null"
25
+ }
26
+ ],
27
+ "description": "The registered holder, when VIES named one; `null` otherwise."
28
+ }
29
+ },
30
+ "required": [
31
+ "status",
32
+ "vat_id",
33
+ "name"
34
+ ],
35
+ "additionalProperties": false
36
+ }