@revenexx/sdk 0.0.7 → 0.0.9
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/dist/cjs/sdk.js +94 -2
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +94 -2
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +94 -2
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/fulfillment-status.ts +5 -0
- package/src/enums/payment-status.ts +9 -0
- package/src/enums/status.ts +7 -0
- package/src/services/orders.ts +99 -1
- package/types/enums/fulfillment-status.d.ts +5 -0
- package/types/enums/payment-status.d.ts +9 -0
- package/types/enums/status.d.ts +7 -0
- package/types/services/orders.d.ts +42 -1
package/dist/iife/sdk.js
CHANGED
|
@@ -4415,7 +4415,7 @@
|
|
|
4415
4415
|
'x-sdk-name': 'Revenexx Web',
|
|
4416
4416
|
'x-sdk-platform': '',
|
|
4417
4417
|
'x-sdk-language': 'web',
|
|
4418
|
-
'x-sdk-version': '0.0.
|
|
4418
|
+
'x-sdk-version': '0.0.9'
|
|
4419
4419
|
};
|
|
4420
4420
|
|
|
4421
4421
|
/**
|
|
@@ -16346,12 +16346,104 @@
|
|
|
16346
16346
|
|
|
16347
16347
|
/**
|
|
16348
16348
|
*
|
|
16349
|
+
* @param {string} params.status - Filter by order status (exact match): pending | placed | in_fulfillment | completed | cancelled.
|
|
16350
|
+
* @param {string} params.paymentStatus - Filter by payment status (exact match): open | pending | authorized | paid | partially_paid | refunded | failed.
|
|
16351
|
+
* @param {string} params.fulfillmentStatus - Filter by fulfillment status (exact match): unfulfilled | partial | fulfilled.
|
|
16352
|
+
* @param {string} params.contactId - Filter to one ordering contact.
|
|
16353
|
+
* @param {string} params.organizationId - Filter to one B2B organization.
|
|
16354
|
+
* @param {string} params.channelId - Filter to one sales channel.
|
|
16355
|
+
* @param {string} params.marketId - Filter to one market.
|
|
16356
|
+
* @param {string} params.number - Filter by exact order number.
|
|
16357
|
+
* @param {number} params.limit - Page size (default 50, max 200).
|
|
16358
|
+
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
16359
|
+
* @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
16349
16360
|
* @throws {RevenexxException}
|
|
16350
16361
|
* @returns {Promise<{}>}
|
|
16351
16362
|
*/
|
|
16352
|
-
|
|
16363
|
+
|
|
16364
|
+
/**
|
|
16365
|
+
*
|
|
16366
|
+
* @param {string} status - Filter by order status (exact match): pending | placed | in_fulfillment | completed | cancelled.
|
|
16367
|
+
* @param {string} paymentStatus - Filter by payment status (exact match): open | pending | authorized | paid | partially_paid | refunded | failed.
|
|
16368
|
+
* @param {string} fulfillmentStatus - Filter by fulfillment status (exact match): unfulfilled | partial | fulfilled.
|
|
16369
|
+
* @param {string} contactId - Filter to one ordering contact.
|
|
16370
|
+
* @param {string} organizationId - Filter to one B2B organization.
|
|
16371
|
+
* @param {string} channelId - Filter to one sales channel.
|
|
16372
|
+
* @param {string} marketId - Filter to one market.
|
|
16373
|
+
* @param {string} number - Filter by exact order number.
|
|
16374
|
+
* @param {number} limit - Page size (default 50, max 200).
|
|
16375
|
+
* @param {number} offset - Row offset for pagination (default 0).
|
|
16376
|
+
* @param {string} order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
16377
|
+
* @throws {RevenexxException}
|
|
16378
|
+
* @returns {Promise<{}>}
|
|
16379
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
16380
|
+
*/
|
|
16381
|
+
|
|
16382
|
+
ordersList(paramsOrFirst, ...rest) {
|
|
16383
|
+
let params;
|
|
16384
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) {
|
|
16385
|
+
params = paramsOrFirst || {};
|
|
16386
|
+
} else {
|
|
16387
|
+
params = {
|
|
16388
|
+
status: paramsOrFirst,
|
|
16389
|
+
paymentStatus: rest[0],
|
|
16390
|
+
fulfillmentStatus: rest[1],
|
|
16391
|
+
contactId: rest[2],
|
|
16392
|
+
organizationId: rest[3],
|
|
16393
|
+
channelId: rest[4],
|
|
16394
|
+
marketId: rest[5],
|
|
16395
|
+
number: rest[6],
|
|
16396
|
+
limit: rest[7],
|
|
16397
|
+
offset: rest[8],
|
|
16398
|
+
order: rest[9]
|
|
16399
|
+
};
|
|
16400
|
+
}
|
|
16401
|
+
const status = params.status;
|
|
16402
|
+
const paymentStatus = params.paymentStatus;
|
|
16403
|
+
const fulfillmentStatus = params.fulfillmentStatus;
|
|
16404
|
+
const contactId = params.contactId;
|
|
16405
|
+
const organizationId = params.organizationId;
|
|
16406
|
+
const channelId = params.channelId;
|
|
16407
|
+
const marketId = params.marketId;
|
|
16408
|
+
const number = params.number;
|
|
16409
|
+
const limit = params.limit;
|
|
16410
|
+
const offset = params.offset;
|
|
16411
|
+
const order = params.order;
|
|
16353
16412
|
const apiPath = '/v1/orders';
|
|
16354
16413
|
const apiPayload = {};
|
|
16414
|
+
if (typeof status !== 'undefined') {
|
|
16415
|
+
apiPayload['status'] = status;
|
|
16416
|
+
}
|
|
16417
|
+
if (typeof paymentStatus !== 'undefined') {
|
|
16418
|
+
apiPayload['payment_status'] = paymentStatus;
|
|
16419
|
+
}
|
|
16420
|
+
if (typeof fulfillmentStatus !== 'undefined') {
|
|
16421
|
+
apiPayload['fulfillment_status'] = fulfillmentStatus;
|
|
16422
|
+
}
|
|
16423
|
+
if (typeof contactId !== 'undefined') {
|
|
16424
|
+
apiPayload['contact_id'] = contactId;
|
|
16425
|
+
}
|
|
16426
|
+
if (typeof organizationId !== 'undefined') {
|
|
16427
|
+
apiPayload['organization_id'] = organizationId;
|
|
16428
|
+
}
|
|
16429
|
+
if (typeof channelId !== 'undefined') {
|
|
16430
|
+
apiPayload['channel_id'] = channelId;
|
|
16431
|
+
}
|
|
16432
|
+
if (typeof marketId !== 'undefined') {
|
|
16433
|
+
apiPayload['market_id'] = marketId;
|
|
16434
|
+
}
|
|
16435
|
+
if (typeof number !== 'undefined') {
|
|
16436
|
+
apiPayload['number'] = number;
|
|
16437
|
+
}
|
|
16438
|
+
if (typeof limit !== 'undefined') {
|
|
16439
|
+
apiPayload['limit'] = limit;
|
|
16440
|
+
}
|
|
16441
|
+
if (typeof offset !== 'undefined') {
|
|
16442
|
+
apiPayload['offset'] = offset;
|
|
16443
|
+
}
|
|
16444
|
+
if (typeof order !== 'undefined') {
|
|
16445
|
+
apiPayload['order'] = order;
|
|
16446
|
+
}
|
|
16355
16447
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
16356
16448
|
const apiHeaders = {};
|
|
16357
16449
|
return this.client.call('get', uri, apiHeaders, apiPayload);
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
package/src/services/orders.ts
CHANGED
|
@@ -14,13 +14,111 @@ export class Orders {
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
|
+
* @param {string} params.status - Filter by order status (exact match): pending | placed | in_fulfillment | completed | cancelled.
|
|
18
|
+
* @param {string} params.paymentStatus - Filter by payment status (exact match): open | pending | authorized | paid | partially_paid | refunded | failed.
|
|
19
|
+
* @param {string} params.fulfillmentStatus - Filter by fulfillment status (exact match): unfulfilled | partial | fulfilled.
|
|
20
|
+
* @param {string} params.contactId - Filter to one ordering contact.
|
|
21
|
+
* @param {string} params.organizationId - Filter to one B2B organization.
|
|
22
|
+
* @param {string} params.channelId - Filter to one sales channel.
|
|
23
|
+
* @param {string} params.marketId - Filter to one market.
|
|
24
|
+
* @param {string} params.number - Filter by exact order number.
|
|
25
|
+
* @param {number} params.limit - Page size (default 50, max 200).
|
|
26
|
+
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
27
|
+
* @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
17
28
|
* @throws {RevenexxException}
|
|
18
29
|
* @returns {Promise<{}>}
|
|
19
30
|
*/
|
|
20
|
-
ordersList(): Promise<{}
|
|
31
|
+
ordersList(params?: { status?: string, paymentStatus?: string, fulfillmentStatus?: string, contactId?: string, organizationId?: string, channelId?: string, marketId?: string, number?: string, limit?: number, offset?: number, order?: string }): Promise<{}>;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param {string} status - Filter by order status (exact match): pending | placed | in_fulfillment | completed | cancelled.
|
|
35
|
+
* @param {string} paymentStatus - Filter by payment status (exact match): open | pending | authorized | paid | partially_paid | refunded | failed.
|
|
36
|
+
* @param {string} fulfillmentStatus - Filter by fulfillment status (exact match): unfulfilled | partial | fulfilled.
|
|
37
|
+
* @param {string} contactId - Filter to one ordering contact.
|
|
38
|
+
* @param {string} organizationId - Filter to one B2B organization.
|
|
39
|
+
* @param {string} channelId - Filter to one sales channel.
|
|
40
|
+
* @param {string} marketId - Filter to one market.
|
|
41
|
+
* @param {string} number - Filter by exact order number.
|
|
42
|
+
* @param {number} limit - Page size (default 50, max 200).
|
|
43
|
+
* @param {number} offset - Row offset for pagination (default 0).
|
|
44
|
+
* @param {string} order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
45
|
+
* @throws {RevenexxException}
|
|
46
|
+
* @returns {Promise<{}>}
|
|
47
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
48
|
+
*/
|
|
49
|
+
ordersList(status?: string, paymentStatus?: string, fulfillmentStatus?: string, contactId?: string, organizationId?: string, channelId?: string, marketId?: string, number?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
|
|
50
|
+
ordersList(
|
|
51
|
+
paramsOrFirst?: { status?: string, paymentStatus?: string, fulfillmentStatus?: string, contactId?: string, organizationId?: string, channelId?: string, marketId?: string, number?: string, limit?: number, offset?: number, order?: string } | string,
|
|
52
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (number)?, (string)?]
|
|
53
|
+
): Promise<{}> {
|
|
54
|
+
let params: { status?: string, paymentStatus?: string, fulfillmentStatus?: string, contactId?: string, organizationId?: string, channelId?: string, marketId?: string, number?: string, limit?: number, offset?: number, order?: string };
|
|
55
|
+
|
|
56
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
57
|
+
params = (paramsOrFirst || {}) as { status?: string, paymentStatus?: string, fulfillmentStatus?: string, contactId?: string, organizationId?: string, channelId?: string, marketId?: string, number?: string, limit?: number, offset?: number, order?: string };
|
|
58
|
+
} else {
|
|
59
|
+
params = {
|
|
60
|
+
status: paramsOrFirst as string,
|
|
61
|
+
paymentStatus: rest[0] as string,
|
|
62
|
+
fulfillmentStatus: rest[1] as string,
|
|
63
|
+
contactId: rest[2] as string,
|
|
64
|
+
organizationId: rest[3] as string,
|
|
65
|
+
channelId: rest[4] as string,
|
|
66
|
+
marketId: rest[5] as string,
|
|
67
|
+
number: rest[6] as string,
|
|
68
|
+
limit: rest[7] as number,
|
|
69
|
+
offset: rest[8] as number,
|
|
70
|
+
order: rest[9] as string
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const status = params.status;
|
|
75
|
+
const paymentStatus = params.paymentStatus;
|
|
76
|
+
const fulfillmentStatus = params.fulfillmentStatus;
|
|
77
|
+
const contactId = params.contactId;
|
|
78
|
+
const organizationId = params.organizationId;
|
|
79
|
+
const channelId = params.channelId;
|
|
80
|
+
const marketId = params.marketId;
|
|
81
|
+
const number = params.number;
|
|
82
|
+
const limit = params.limit;
|
|
83
|
+
const offset = params.offset;
|
|
84
|
+
const order = params.order;
|
|
85
|
+
|
|
21
86
|
|
|
22
87
|
const apiPath = '/v1/orders';
|
|
23
88
|
const apiPayload: Payload = {};
|
|
89
|
+
if (typeof status !== 'undefined') {
|
|
90
|
+
apiPayload['status'] = status;
|
|
91
|
+
}
|
|
92
|
+
if (typeof paymentStatus !== 'undefined') {
|
|
93
|
+
apiPayload['payment_status'] = paymentStatus;
|
|
94
|
+
}
|
|
95
|
+
if (typeof fulfillmentStatus !== 'undefined') {
|
|
96
|
+
apiPayload['fulfillment_status'] = fulfillmentStatus;
|
|
97
|
+
}
|
|
98
|
+
if (typeof contactId !== 'undefined') {
|
|
99
|
+
apiPayload['contact_id'] = contactId;
|
|
100
|
+
}
|
|
101
|
+
if (typeof organizationId !== 'undefined') {
|
|
102
|
+
apiPayload['organization_id'] = organizationId;
|
|
103
|
+
}
|
|
104
|
+
if (typeof channelId !== 'undefined') {
|
|
105
|
+
apiPayload['channel_id'] = channelId;
|
|
106
|
+
}
|
|
107
|
+
if (typeof marketId !== 'undefined') {
|
|
108
|
+
apiPayload['market_id'] = marketId;
|
|
109
|
+
}
|
|
110
|
+
if (typeof number !== 'undefined') {
|
|
111
|
+
apiPayload['number'] = number;
|
|
112
|
+
}
|
|
113
|
+
if (typeof limit !== 'undefined') {
|
|
114
|
+
apiPayload['limit'] = limit;
|
|
115
|
+
}
|
|
116
|
+
if (typeof offset !== 'undefined') {
|
|
117
|
+
apiPayload['offset'] = offset;
|
|
118
|
+
}
|
|
119
|
+
if (typeof order !== 'undefined') {
|
|
120
|
+
apiPayload['order'] = order;
|
|
121
|
+
}
|
|
24
122
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
25
123
|
|
|
26
124
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -7,10 +7,51 @@ export declare class Orders {
|
|
|
7
7
|
constructor(client: Client);
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
|
+
* @param {string} params.status - Filter by order status (exact match): pending | placed | in_fulfillment | completed | cancelled.
|
|
11
|
+
* @param {string} params.paymentStatus - Filter by payment status (exact match): open | pending | authorized | paid | partially_paid | refunded | failed.
|
|
12
|
+
* @param {string} params.fulfillmentStatus - Filter by fulfillment status (exact match): unfulfilled | partial | fulfilled.
|
|
13
|
+
* @param {string} params.contactId - Filter to one ordering contact.
|
|
14
|
+
* @param {string} params.organizationId - Filter to one B2B organization.
|
|
15
|
+
* @param {string} params.channelId - Filter to one sales channel.
|
|
16
|
+
* @param {string} params.marketId - Filter to one market.
|
|
17
|
+
* @param {string} params.number - Filter by exact order number.
|
|
18
|
+
* @param {number} params.limit - Page size (default 50, max 200).
|
|
19
|
+
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
20
|
+
* @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
10
21
|
* @throws {RevenexxException}
|
|
11
22
|
* @returns {Promise<{}>}
|
|
12
23
|
*/
|
|
13
|
-
ordersList(
|
|
24
|
+
ordersList(params?: {
|
|
25
|
+
status?: string;
|
|
26
|
+
paymentStatus?: string;
|
|
27
|
+
fulfillmentStatus?: string;
|
|
28
|
+
contactId?: string;
|
|
29
|
+
organizationId?: string;
|
|
30
|
+
channelId?: string;
|
|
31
|
+
marketId?: string;
|
|
32
|
+
number?: string;
|
|
33
|
+
limit?: number;
|
|
34
|
+
offset?: number;
|
|
35
|
+
order?: string;
|
|
36
|
+
}): Promise<{}>;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @param {string} status - Filter by order status (exact match): pending | placed | in_fulfillment | completed | cancelled.
|
|
40
|
+
* @param {string} paymentStatus - Filter by payment status (exact match): open | pending | authorized | paid | partially_paid | refunded | failed.
|
|
41
|
+
* @param {string} fulfillmentStatus - Filter by fulfillment status (exact match): unfulfilled | partial | fulfilled.
|
|
42
|
+
* @param {string} contactId - Filter to one ordering contact.
|
|
43
|
+
* @param {string} organizationId - Filter to one B2B organization.
|
|
44
|
+
* @param {string} channelId - Filter to one sales channel.
|
|
45
|
+
* @param {string} marketId - Filter to one market.
|
|
46
|
+
* @param {string} number - Filter by exact order number.
|
|
47
|
+
* @param {number} limit - Page size (default 50, max 200).
|
|
48
|
+
* @param {number} offset - Row offset for pagination (default 0).
|
|
49
|
+
* @param {string} order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
50
|
+
* @throws {RevenexxException}
|
|
51
|
+
* @returns {Promise<{}>}
|
|
52
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
53
|
+
*/
|
|
54
|
+
ordersList(status?: string, paymentStatus?: string, fulfillmentStatus?: string, contactId?: string, organizationId?: string, channelId?: string, marketId?: string, number?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
|
|
14
55
|
/**
|
|
15
56
|
*
|
|
16
57
|
* @throws {RevenexxException}
|