@fleetless/contracts 6.2.0 → 6.3.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 (31) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/artifacts/openapi.json +4322 -1887
  3. package/artifacts/routes.json +326 -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 +778 -0
  21. package/dist/billing.js +441 -0
  22. package/dist/errors.d.ts +17 -5
  23. package/dist/errors.js +31 -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 +181 -4
  31. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "invoice_email": {
6
+ "description": "Replaces the invoice email. Omitted leaves it as it is.",
7
+ "type": "string",
8
+ "format": "email",
9
+ "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
10
+ },
11
+ "vat_id": {
12
+ "description": "Replaces the VAT ID; `null` clears it. Omitted leaves it as it is. A new ID is re-checked through VIES.",
13
+ "anyOf": [
14
+ {
15
+ "type": "string",
16
+ "maxLength": 20
17
+ },
18
+ {
19
+ "type": "null"
20
+ }
21
+ ]
22
+ }
23
+ },
24
+ "additionalProperties": false
25
+ }
@@ -0,0 +1,176 @@
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": "company",
10
+ "description": "Billed as a company."
11
+ },
12
+ "company_name": {
13
+ "type": "string",
14
+ "minLength": 1,
15
+ "maxLength": 200,
16
+ "description": "The company's legal name, printed on the invoice."
17
+ },
18
+ "vat_id": {
19
+ "anyOf": [
20
+ {
21
+ "type": "string",
22
+ "maxLength": 20
23
+ },
24
+ {
25
+ "type": "null"
26
+ }
27
+ ],
28
+ "description": "The company's VAT ID, or `null` for none. Required, and must check out through VIES, for a company outside Germany."
29
+ },
30
+ "address": {
31
+ "type": "object",
32
+ "properties": {
33
+ "line1": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "maxLength": 200,
37
+ "description": "Street and number, or the first address line."
38
+ },
39
+ "line2": {
40
+ "anyOf": [
41
+ {
42
+ "type": "string",
43
+ "maxLength": 200
44
+ },
45
+ {
46
+ "type": "null"
47
+ }
48
+ ],
49
+ "description": "A second address line, or `null` when there is none."
50
+ },
51
+ "postal_code": {
52
+ "type": "string",
53
+ "minLength": 1,
54
+ "maxLength": 20,
55
+ "description": "Postal or ZIP code."
56
+ },
57
+ "city": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "maxLength": 100,
61
+ "description": "City or town."
62
+ },
63
+ "country": {
64
+ "type": "string",
65
+ "pattern": "^[A-Z]{2}$",
66
+ "description": "The billing country. Decides VAT (`vatFor`) and currency (`currencyForCountry`)."
67
+ }
68
+ },
69
+ "required": [
70
+ "line1",
71
+ "line2",
72
+ "postal_code",
73
+ "city",
74
+ "country"
75
+ ],
76
+ "additionalProperties": false,
77
+ "description": "The billing address."
78
+ },
79
+ "invoice_email": {
80
+ "type": "string",
81
+ "format": "email",
82
+ "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
83
+ "description": "Where invoices and billing mail are sent."
84
+ }
85
+ },
86
+ "required": [
87
+ "kind",
88
+ "company_name",
89
+ "vat_id",
90
+ "address",
91
+ "invoice_email"
92
+ ],
93
+ "additionalProperties": false,
94
+ "description": "A company: name and an optional VAT ID, never 'full name'."
95
+ },
96
+ {
97
+ "type": "object",
98
+ "properties": {
99
+ "kind": {
100
+ "type": "string",
101
+ "const": "person",
102
+ "description": "Billed as a person."
103
+ },
104
+ "full_name": {
105
+ "type": "string",
106
+ "minLength": 1,
107
+ "maxLength": 200,
108
+ "description": "The person's full name, printed on the invoice."
109
+ },
110
+ "address": {
111
+ "type": "object",
112
+ "properties": {
113
+ "line1": {
114
+ "type": "string",
115
+ "minLength": 1,
116
+ "maxLength": 200,
117
+ "description": "Street and number, or the first address line."
118
+ },
119
+ "line2": {
120
+ "anyOf": [
121
+ {
122
+ "type": "string",
123
+ "maxLength": 200
124
+ },
125
+ {
126
+ "type": "null"
127
+ }
128
+ ],
129
+ "description": "A second address line, or `null` when there is none."
130
+ },
131
+ "postal_code": {
132
+ "type": "string",
133
+ "minLength": 1,
134
+ "maxLength": 20,
135
+ "description": "Postal or ZIP code."
136
+ },
137
+ "city": {
138
+ "type": "string",
139
+ "minLength": 1,
140
+ "maxLength": 100,
141
+ "description": "City or town."
142
+ },
143
+ "country": {
144
+ "type": "string",
145
+ "pattern": "^[A-Z]{2}$",
146
+ "description": "The billing country. Decides VAT (`vatFor`) and currency (`currencyForCountry`)."
147
+ }
148
+ },
149
+ "required": [
150
+ "line1",
151
+ "line2",
152
+ "postal_code",
153
+ "city",
154
+ "country"
155
+ ],
156
+ "additionalProperties": false,
157
+ "description": "The billing address."
158
+ },
159
+ "invoice_email": {
160
+ "type": "string",
161
+ "format": "email",
162
+ "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
163
+ "description": "Where invoices and billing mail are sent."
164
+ }
165
+ },
166
+ "required": [
167
+ "kind",
168
+ "full_name",
169
+ "address",
170
+ "invoice_email"
171
+ ],
172
+ "additionalProperties": false,
173
+ "description": "A person: a full name, never a VAT ID — only a company can be VAT-registered."
174
+ }
175
+ ]
176
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "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 invoice's id."
10
+ },
11
+ "number": {
12
+ "type": "string",
13
+ "pattern": "^FL-\\d{4}-\\d{4,}$",
14
+ "description": "The invoice number: `FL-<year>-<seq>`, `seq` zero-padded to four digits, gapless per calendar year in `Europe/Berlin`."
15
+ },
16
+ "issued_at": {
17
+ "type": "string",
18
+ "format": "date-time",
19
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
20
+ "description": "When the invoice was issued."
21
+ },
22
+ "status": {
23
+ "type": "string",
24
+ "enum": [
25
+ "open",
26
+ "paid",
27
+ "uncollectible"
28
+ ],
29
+ "description": "This invoice's own status."
30
+ },
31
+ "currency": {
32
+ "type": "string",
33
+ "enum": [
34
+ "eur",
35
+ "usd"
36
+ ],
37
+ "description": "The org's billing currency."
38
+ },
39
+ "net_cents": {
40
+ "type": "integer",
41
+ "minimum": 0,
42
+ "maximum": 9007199254740991,
43
+ "description": "The charge, excluding VAT, in integer cents."
44
+ },
45
+ "vat_rate_percent": {
46
+ "type": "integer",
47
+ "minimum": 0,
48
+ "maximum": 100,
49
+ "description": "The VAT rate applied, in whole percent."
50
+ },
51
+ "vat_cents": {
52
+ "type": "integer",
53
+ "minimum": 0,
54
+ "maximum": 9007199254740991,
55
+ "description": "VAT, in integer cents (`vatCents`)."
56
+ },
57
+ "gross_cents": {
58
+ "type": "integer",
59
+ "minimum": 0,
60
+ "maximum": 9007199254740991,
61
+ "description": "Net plus VAT, in integer cents."
62
+ }
63
+ },
64
+ "required": [
65
+ "id",
66
+ "number",
67
+ "issued_at",
68
+ "status",
69
+ "currency",
70
+ "net_cents",
71
+ "vat_rate_percent",
72
+ "vat_cents",
73
+ "gross_cents"
74
+ ],
75
+ "additionalProperties": false
76
+ }