@cloudcommerce/types 0.0.35
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/.turbo/turbo-build.log +6 -0
- package/CHANGELOG.md +1 -0
- package/LICENSE.md +230 -0
- package/README.md +1 -0
- package/index.ts +66 -0
- package/modules/@checkout:params.d.ts +920 -0
- package/modules/apply_discount:params.d.ts +154 -0
- package/modules/apply_discount:response.d.ts +71 -0
- package/modules/calculate_shipping:params.d.ts +275 -0
- package/modules/calculate_shipping:response.d.ts +402 -0
- package/modules/create_transaction:params.d.ts +515 -0
- package/modules/create_transaction:response.d.ts +261 -0
- package/modules/list_payments:params.d.ts +323 -0
- package/modules/list_payments:response.d.ts +266 -0
- package/package.json +21 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Triggered to validate and apply discount value, must return discount and conditions
|
|
10
|
+
*/
|
|
11
|
+
export interface ApplyDiscountParams {
|
|
12
|
+
/**
|
|
13
|
+
* Text of discount coupon applied by customer
|
|
14
|
+
*/
|
|
15
|
+
discount_coupon?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Products composing the cart
|
|
18
|
+
*
|
|
19
|
+
* @maxItems 3000
|
|
20
|
+
*/
|
|
21
|
+
items?: {
|
|
22
|
+
/**
|
|
23
|
+
* Product ID
|
|
24
|
+
*/
|
|
25
|
+
product_id: string;
|
|
26
|
+
/**
|
|
27
|
+
* ID to specify the variation added to cart, if product has variations
|
|
28
|
+
*/
|
|
29
|
+
variation_id?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Product or variation unique reference code
|
|
32
|
+
*/
|
|
33
|
+
sku?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Product or variation full name, or other label for this cart item
|
|
36
|
+
*/
|
|
37
|
+
name?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Item quantity in cart
|
|
40
|
+
*/
|
|
41
|
+
quantity: number;
|
|
42
|
+
/**
|
|
43
|
+
* Designator of currency according to ISO 4217 (3 uppercase letters)
|
|
44
|
+
*/
|
|
45
|
+
currency_id?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Graphic symbol used as a shorthand for currency's name
|
|
48
|
+
*/
|
|
49
|
+
currency_symbol?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Product sale price specifically for this cart
|
|
52
|
+
*/
|
|
53
|
+
price: number;
|
|
54
|
+
/**
|
|
55
|
+
* Final item price including additions due to customizations and gift wrap
|
|
56
|
+
*/
|
|
57
|
+
final_price?: number;
|
|
58
|
+
}[];
|
|
59
|
+
/**
|
|
60
|
+
* Designator of currency according to ISO 4217 (3 uppercase letters)
|
|
61
|
+
*/
|
|
62
|
+
currency_id?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Graphic symbol used as a shorthand for currency's name
|
|
65
|
+
*/
|
|
66
|
+
currency_symbol?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Object with sums of values
|
|
69
|
+
*/
|
|
70
|
+
amount?: {
|
|
71
|
+
/**
|
|
72
|
+
* Order total amount
|
|
73
|
+
*/
|
|
74
|
+
total: number;
|
|
75
|
+
/**
|
|
76
|
+
* The sum of all items prices
|
|
77
|
+
*/
|
|
78
|
+
subtotal?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Order freight cost
|
|
81
|
+
*/
|
|
82
|
+
freight?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Applied discount value
|
|
85
|
+
*/
|
|
86
|
+
discount?: number;
|
|
87
|
+
/**
|
|
88
|
+
* The sum of all the taxes applied to the order
|
|
89
|
+
*/
|
|
90
|
+
tax?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Sum of optional extra costs applied
|
|
93
|
+
*/
|
|
94
|
+
extra?: number;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* UTM campaign HTTP parameters
|
|
98
|
+
*/
|
|
99
|
+
utm?: {
|
|
100
|
+
/**
|
|
101
|
+
* Parameter "utm_source", the referrer: (e.g. google, newsletter)
|
|
102
|
+
*/
|
|
103
|
+
source?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Parameter "utm_medium", the marketing medium: (e.g. cpc, banner, email)
|
|
106
|
+
*/
|
|
107
|
+
medium?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Parameter "utm_campaign", the product, promo code, or slogan (e.g. spring_sale)
|
|
110
|
+
*/
|
|
111
|
+
campaign?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Parameter "utm_term", identifies the paid keywords
|
|
114
|
+
*/
|
|
115
|
+
term?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Parameter "utm_content", used to differentiate ads
|
|
118
|
+
*/
|
|
119
|
+
content?: string;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Code to identify the affiliate that referred the customer
|
|
123
|
+
*/
|
|
124
|
+
affiliate_code?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Channel unique identificator
|
|
127
|
+
*/
|
|
128
|
+
channel_id?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Channel type or source
|
|
131
|
+
*/
|
|
132
|
+
channel_type?: 'ecommerce' | 'mobile' | 'pdv' | 'button' | 'facebook' | 'chatbot';
|
|
133
|
+
/**
|
|
134
|
+
* Store domain name (numbers and lowercase letters, eg.: www.myshop.sample)
|
|
135
|
+
*/
|
|
136
|
+
domain?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Language two letters code, sometimes with region, eg.: pt_br, fr, en_us
|
|
139
|
+
*/
|
|
140
|
+
lang?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Customer object summary
|
|
143
|
+
*/
|
|
144
|
+
customer?: {
|
|
145
|
+
/**
|
|
146
|
+
* Customer ID
|
|
147
|
+
*/
|
|
148
|
+
_id?: null | string;
|
|
149
|
+
/**
|
|
150
|
+
* The name of this Customer, suitable for display
|
|
151
|
+
*/
|
|
152
|
+
display_name?: string;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Response - Triggered to validate and apply discount value, must return discount and conditions
|
|
10
|
+
*/
|
|
11
|
+
export interface ApplyDiscountResponse {
|
|
12
|
+
/**
|
|
13
|
+
* Available but not yet applied discount campaign
|
|
14
|
+
*/
|
|
15
|
+
available_extra_discount?: {
|
|
16
|
+
/**
|
|
17
|
+
* Minimum amount to apply the discount
|
|
18
|
+
*/
|
|
19
|
+
min_amount?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Name of discount campaign
|
|
22
|
+
*/
|
|
23
|
+
label?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Discount type
|
|
26
|
+
*/
|
|
27
|
+
type?: 'percentage' | 'fixed';
|
|
28
|
+
/**
|
|
29
|
+
* Discount value, percentage or fixed
|
|
30
|
+
*/
|
|
31
|
+
value: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Matched discount rule for current UTM campaign or coupon
|
|
35
|
+
*/
|
|
36
|
+
discount_rule?: {
|
|
37
|
+
/**
|
|
38
|
+
* Name of the discount rule, can be the coupon or campaign name
|
|
39
|
+
*/
|
|
40
|
+
label?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Additional text description for the discount rule
|
|
43
|
+
*/
|
|
44
|
+
description?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Extra discount to apply on checkout
|
|
47
|
+
*/
|
|
48
|
+
extra_discount: {
|
|
49
|
+
/**
|
|
50
|
+
* Extra discount value
|
|
51
|
+
*/
|
|
52
|
+
value: number;
|
|
53
|
+
/**
|
|
54
|
+
* Flags to associate additional info
|
|
55
|
+
*
|
|
56
|
+
* @maxItems 10
|
|
57
|
+
*/
|
|
58
|
+
flags?: string[];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Short message for curtomer if coupon/campaign tried is invalid
|
|
63
|
+
*/
|
|
64
|
+
invalid_coupon_message?: string;
|
|
65
|
+
/**
|
|
66
|
+
* List of available freebie (gift) products
|
|
67
|
+
*
|
|
68
|
+
* @maxItems 3000
|
|
69
|
+
*/
|
|
70
|
+
freebie_product_ids?: string[];
|
|
71
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Triggered to calculate shipping options, must return calculated values and times
|
|
10
|
+
*/
|
|
11
|
+
export interface CalculateShippingParams {
|
|
12
|
+
/**
|
|
13
|
+
* Products composing the cart
|
|
14
|
+
*
|
|
15
|
+
* @maxItems 3000
|
|
16
|
+
*/
|
|
17
|
+
items?: {
|
|
18
|
+
/**
|
|
19
|
+
* Product ID
|
|
20
|
+
*/
|
|
21
|
+
product_id: string;
|
|
22
|
+
/**
|
|
23
|
+
* ID to specify the variation added to cart, if product has variations
|
|
24
|
+
*/
|
|
25
|
+
variation_id?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Product or variation unique reference code
|
|
28
|
+
*/
|
|
29
|
+
sku?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Product or variation full name, or other label for this cart item
|
|
32
|
+
*/
|
|
33
|
+
name?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Item quantity in cart
|
|
36
|
+
*/
|
|
37
|
+
quantity: number;
|
|
38
|
+
/**
|
|
39
|
+
* Warehouses by code and respective product stock
|
|
40
|
+
*/
|
|
41
|
+
inventory?: {
|
|
42
|
+
/**
|
|
43
|
+
* Product quantity available for sale from current warehouse
|
|
44
|
+
*
|
|
45
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
46
|
+
* via the `patternProperty` "^[A-Za-z0-9-_]{2,30}$".
|
|
47
|
+
*/
|
|
48
|
+
[k: string]: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Designator of currency according to ISO 4217 (3 uppercase letters)
|
|
52
|
+
*/
|
|
53
|
+
currency_id?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Graphic symbol used as a shorthand for currency's name
|
|
56
|
+
*/
|
|
57
|
+
currency_symbol?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Product sale price specifically for this cart
|
|
60
|
+
*/
|
|
61
|
+
price: number;
|
|
62
|
+
/**
|
|
63
|
+
* Final item price including additions due to customizations and gift wrap
|
|
64
|
+
*/
|
|
65
|
+
final_price?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Product dimensions with packaging for freight calculation
|
|
68
|
+
*/
|
|
69
|
+
dimensions?: {
|
|
70
|
+
/**
|
|
71
|
+
* Package width, height and length
|
|
72
|
+
*
|
|
73
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
74
|
+
* via the `patternProperty` "^width|height|length$".
|
|
75
|
+
*/
|
|
76
|
+
[k: string]: {
|
|
77
|
+
/**
|
|
78
|
+
* Size in specified unit
|
|
79
|
+
*/
|
|
80
|
+
value: number;
|
|
81
|
+
/**
|
|
82
|
+
* Unit of measurement
|
|
83
|
+
*/
|
|
84
|
+
unit?: 'mm' | 'cm' | 'm' | 'ft' | 'in' | 'yd' | 'mi';
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Package weight for freight calculation
|
|
89
|
+
*/
|
|
90
|
+
weight?: {
|
|
91
|
+
/**
|
|
92
|
+
* Size in specified unit
|
|
93
|
+
*/
|
|
94
|
+
value: number;
|
|
95
|
+
/**
|
|
96
|
+
* Unit of measurement
|
|
97
|
+
*/
|
|
98
|
+
unit?: 'mg' | 'g' | 'kg' | 'lb' | 'oz';
|
|
99
|
+
};
|
|
100
|
+
}[];
|
|
101
|
+
/**
|
|
102
|
+
* The sum of all items prices
|
|
103
|
+
*/
|
|
104
|
+
subtotal?: number;
|
|
105
|
+
from?: Address;
|
|
106
|
+
to?: Address1;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the package must be delivered with additional service "own hand"
|
|
109
|
+
*/
|
|
110
|
+
own_hand?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* If the package will be delivered with acknowledgment of receipt
|
|
113
|
+
*/
|
|
114
|
+
receipt?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Code of service defined by carrier, if shipping method is already defined
|
|
117
|
+
*/
|
|
118
|
+
service_code?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Language two letters code, sometimes with region, eg.: pt_br, fr, en_us
|
|
121
|
+
*/
|
|
122
|
+
lang?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Whether shipping were already chosen and is just being confirmed to complete checkout
|
|
125
|
+
*/
|
|
126
|
+
is_checkout_confirmation?: boolean;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Sender's address
|
|
130
|
+
*/
|
|
131
|
+
export interface Address {
|
|
132
|
+
/**
|
|
133
|
+
* ZIP (CEP, postal...) code
|
|
134
|
+
*/
|
|
135
|
+
zip: string;
|
|
136
|
+
/**
|
|
137
|
+
* Street or public place name
|
|
138
|
+
*/
|
|
139
|
+
street?: string;
|
|
140
|
+
/**
|
|
141
|
+
* House or building street number
|
|
142
|
+
*/
|
|
143
|
+
number?: number;
|
|
144
|
+
/**
|
|
145
|
+
* Address complement or second line, such as apartment number
|
|
146
|
+
*/
|
|
147
|
+
complement?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Borough name
|
|
150
|
+
*/
|
|
151
|
+
borough?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Some optional other reference for this address
|
|
154
|
+
*/
|
|
155
|
+
near_to?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Full in line mailing address, should include street, number and borough
|
|
158
|
+
*/
|
|
159
|
+
line_address?: string;
|
|
160
|
+
/**
|
|
161
|
+
* City name
|
|
162
|
+
*/
|
|
163
|
+
city?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Country name
|
|
166
|
+
*/
|
|
167
|
+
country?: string;
|
|
168
|
+
/**
|
|
169
|
+
* An ISO 3166-2 country code
|
|
170
|
+
*/
|
|
171
|
+
country_code?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Province or state name
|
|
174
|
+
*/
|
|
175
|
+
province?: string;
|
|
176
|
+
/**
|
|
177
|
+
* The two-letter code for the province or state
|
|
178
|
+
*/
|
|
179
|
+
province_code?: string;
|
|
180
|
+
/**
|
|
181
|
+
* The name of recipient, generally is the customer's name
|
|
182
|
+
*/
|
|
183
|
+
name?: string;
|
|
184
|
+
/**
|
|
185
|
+
* The recipient's last name
|
|
186
|
+
*/
|
|
187
|
+
last_name?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Customer phone number for this mailing address
|
|
190
|
+
*/
|
|
191
|
+
phone?: {
|
|
192
|
+
/**
|
|
193
|
+
* Country calling code (without +), defined by standards E.123 and E.164
|
|
194
|
+
*/
|
|
195
|
+
country_code?: number;
|
|
196
|
+
/**
|
|
197
|
+
* The actual phone number, digits only
|
|
198
|
+
*/
|
|
199
|
+
number: string;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Shipping address (recipient)
|
|
204
|
+
*/
|
|
205
|
+
export interface Address1 {
|
|
206
|
+
/**
|
|
207
|
+
* ZIP (CEP, postal...) code
|
|
208
|
+
*/
|
|
209
|
+
zip: string;
|
|
210
|
+
/**
|
|
211
|
+
* Street or public place name
|
|
212
|
+
*/
|
|
213
|
+
street?: string;
|
|
214
|
+
/**
|
|
215
|
+
* House or building street number
|
|
216
|
+
*/
|
|
217
|
+
number?: number;
|
|
218
|
+
/**
|
|
219
|
+
* Address complement or second line, such as apartment number
|
|
220
|
+
*/
|
|
221
|
+
complement?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Borough name
|
|
224
|
+
*/
|
|
225
|
+
borough?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Some optional other reference for this address
|
|
228
|
+
*/
|
|
229
|
+
near_to?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Full in line mailing address, should include street, number and borough
|
|
232
|
+
*/
|
|
233
|
+
line_address?: string;
|
|
234
|
+
/**
|
|
235
|
+
* City name
|
|
236
|
+
*/
|
|
237
|
+
city?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Country name
|
|
240
|
+
*/
|
|
241
|
+
country?: string;
|
|
242
|
+
/**
|
|
243
|
+
* An ISO 3166-2 country code
|
|
244
|
+
*/
|
|
245
|
+
country_code?: string;
|
|
246
|
+
/**
|
|
247
|
+
* Province or state name
|
|
248
|
+
*/
|
|
249
|
+
province?: string;
|
|
250
|
+
/**
|
|
251
|
+
* The two-letter code for the province or state
|
|
252
|
+
*/
|
|
253
|
+
province_code?: string;
|
|
254
|
+
/**
|
|
255
|
+
* The name of recipient, generally is the customer's name
|
|
256
|
+
*/
|
|
257
|
+
name?: string;
|
|
258
|
+
/**
|
|
259
|
+
* The recipient's last name
|
|
260
|
+
*/
|
|
261
|
+
last_name?: string;
|
|
262
|
+
/**
|
|
263
|
+
* Customer phone number for this mailing address
|
|
264
|
+
*/
|
|
265
|
+
phone?: {
|
|
266
|
+
/**
|
|
267
|
+
* Country calling code (without +), defined by standards E.123 and E.164
|
|
268
|
+
*/
|
|
269
|
+
country_code?: number;
|
|
270
|
+
/**
|
|
271
|
+
* The actual phone number, digits only
|
|
272
|
+
*/
|
|
273
|
+
number: string;
|
|
274
|
+
};
|
|
275
|
+
}
|