@revenexx/sdk 0.0.10 → 0.0.12
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 +825 -21
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +825 -21
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +825 -21
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/services/carts.ts +64 -1
- package/src/services/customers.ts +128 -2
- package/src/services/orderlists.ts +64 -1
- package/src/services/products.ts +688 -16
- package/types/services/carts.d.ts +27 -1
- package/types/services/customers.d.ts +54 -2
- package/types/services/orderlists.d.ts +27 -1
- package/types/services/products.d.ts +288 -16
package/package.json
CHANGED
package/src/client.ts
CHANGED
package/src/services/carts.ts
CHANGED
|
@@ -18,13 +18,76 @@ export class Carts {
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
*
|
|
21
|
+
* @param {string} params.contactId - Filter to one owning contact.
|
|
22
|
+
* @param {string} params.sessionKey - Filter to one guest session.
|
|
23
|
+
* @param {string} params.status - Filter by cart status (e.g. active).
|
|
24
|
+
* @param {number} params.limit - Page size (default 50, max 200).
|
|
25
|
+
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
26
|
+
* @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
21
27
|
* @throws {RevenexxException}
|
|
22
28
|
* @returns {Promise<{}>}
|
|
23
29
|
*/
|
|
24
|
-
cartsList(): Promise<{}
|
|
30
|
+
cartsList(params?: { contactId?: string, sessionKey?: string, status?: string, limit?: number, offset?: number, order?: string }): Promise<{}>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param {string} contactId - Filter to one owning contact.
|
|
34
|
+
* @param {string} sessionKey - Filter to one guest session.
|
|
35
|
+
* @param {string} status - Filter by cart status (e.g. active).
|
|
36
|
+
* @param {number} limit - Page size (default 50, max 200).
|
|
37
|
+
* @param {number} offset - Row offset for pagination (default 0).
|
|
38
|
+
* @param {string} order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
39
|
+
* @throws {RevenexxException}
|
|
40
|
+
* @returns {Promise<{}>}
|
|
41
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
42
|
+
*/
|
|
43
|
+
cartsList(contactId?: string, sessionKey?: string, status?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
|
|
44
|
+
cartsList(
|
|
45
|
+
paramsOrFirst?: { contactId?: string, sessionKey?: string, status?: string, limit?: number, offset?: number, order?: string } | string,
|
|
46
|
+
...rest: [(string)?, (string)?, (number)?, (number)?, (string)?]
|
|
47
|
+
): Promise<{}> {
|
|
48
|
+
let params: { contactId?: string, sessionKey?: string, status?: string, limit?: number, offset?: number, order?: string };
|
|
49
|
+
|
|
50
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
51
|
+
params = (paramsOrFirst || {}) as { contactId?: string, sessionKey?: string, status?: string, limit?: number, offset?: number, order?: string };
|
|
52
|
+
} else {
|
|
53
|
+
params = {
|
|
54
|
+
contactId: paramsOrFirst as string,
|
|
55
|
+
sessionKey: rest[0] as string,
|
|
56
|
+
status: rest[1] as string,
|
|
57
|
+
limit: rest[2] as number,
|
|
58
|
+
offset: rest[3] as number,
|
|
59
|
+
order: rest[4] as string
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const contactId = params.contactId;
|
|
64
|
+
const sessionKey = params.sessionKey;
|
|
65
|
+
const status = params.status;
|
|
66
|
+
const limit = params.limit;
|
|
67
|
+
const offset = params.offset;
|
|
68
|
+
const order = params.order;
|
|
69
|
+
|
|
25
70
|
|
|
26
71
|
const apiPath = '/v1/carts';
|
|
27
72
|
const apiPayload: Payload = {};
|
|
73
|
+
if (typeof contactId !== 'undefined') {
|
|
74
|
+
apiPayload['contact_id'] = contactId;
|
|
75
|
+
}
|
|
76
|
+
if (typeof sessionKey !== 'undefined') {
|
|
77
|
+
apiPayload['session_key'] = sessionKey;
|
|
78
|
+
}
|
|
79
|
+
if (typeof status !== 'undefined') {
|
|
80
|
+
apiPayload['status'] = status;
|
|
81
|
+
}
|
|
82
|
+
if (typeof limit !== 'undefined') {
|
|
83
|
+
apiPayload['limit'] = limit;
|
|
84
|
+
}
|
|
85
|
+
if (typeof offset !== 'undefined') {
|
|
86
|
+
apiPayload['offset'] = offset;
|
|
87
|
+
}
|
|
88
|
+
if (typeof order !== 'undefined') {
|
|
89
|
+
apiPayload['order'] = order;
|
|
90
|
+
}
|
|
28
91
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
29
92
|
|
|
30
93
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -16,13 +16,69 @@ export class Customers {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
|
+
* @param {string} params.contactId - Filter to one owning contact.
|
|
20
|
+
* @param {string} params.organizationId - Filter to one organization.
|
|
21
|
+
* @param {number} params.limit - Page size (default 50, max 200).
|
|
22
|
+
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
23
|
+
* @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
19
24
|
* @throws {RevenexxException}
|
|
20
25
|
* @returns {Promise<{}>}
|
|
21
26
|
*/
|
|
22
|
-
customersAddressesList(): Promise<{}
|
|
27
|
+
customersAddressesList(params?: { contactId?: string, organizationId?: string, limit?: number, offset?: number, order?: string }): Promise<{}>;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {string} contactId - Filter to one owning contact.
|
|
31
|
+
* @param {string} organizationId - Filter to one organization.
|
|
32
|
+
* @param {number} limit - Page size (default 50, max 200).
|
|
33
|
+
* @param {number} offset - Row offset for pagination (default 0).
|
|
34
|
+
* @param {string} order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
35
|
+
* @throws {RevenexxException}
|
|
36
|
+
* @returns {Promise<{}>}
|
|
37
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
38
|
+
*/
|
|
39
|
+
customersAddressesList(contactId?: string, organizationId?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
|
|
40
|
+
customersAddressesList(
|
|
41
|
+
paramsOrFirst?: { contactId?: string, organizationId?: string, limit?: number, offset?: number, order?: string } | string,
|
|
42
|
+
...rest: [(string)?, (number)?, (number)?, (string)?]
|
|
43
|
+
): Promise<{}> {
|
|
44
|
+
let params: { contactId?: string, organizationId?: string, limit?: number, offset?: number, order?: string };
|
|
45
|
+
|
|
46
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
47
|
+
params = (paramsOrFirst || {}) as { contactId?: string, organizationId?: string, limit?: number, offset?: number, order?: string };
|
|
48
|
+
} else {
|
|
49
|
+
params = {
|
|
50
|
+
contactId: paramsOrFirst as string,
|
|
51
|
+
organizationId: rest[0] as string,
|
|
52
|
+
limit: rest[1] as number,
|
|
53
|
+
offset: rest[2] as number,
|
|
54
|
+
order: rest[3] as string
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const contactId = params.contactId;
|
|
59
|
+
const organizationId = params.organizationId;
|
|
60
|
+
const limit = params.limit;
|
|
61
|
+
const offset = params.offset;
|
|
62
|
+
const order = params.order;
|
|
63
|
+
|
|
23
64
|
|
|
24
65
|
const apiPath = '/v1/customers/addresses';
|
|
25
66
|
const apiPayload: Payload = {};
|
|
67
|
+
if (typeof contactId !== 'undefined') {
|
|
68
|
+
apiPayload['contact_id'] = contactId;
|
|
69
|
+
}
|
|
70
|
+
if (typeof organizationId !== 'undefined') {
|
|
71
|
+
apiPayload['organization_id'] = organizationId;
|
|
72
|
+
}
|
|
73
|
+
if (typeof limit !== 'undefined') {
|
|
74
|
+
apiPayload['limit'] = limit;
|
|
75
|
+
}
|
|
76
|
+
if (typeof offset !== 'undefined') {
|
|
77
|
+
apiPayload['offset'] = offset;
|
|
78
|
+
}
|
|
79
|
+
if (typeof order !== 'undefined') {
|
|
80
|
+
apiPayload['order'] = order;
|
|
81
|
+
}
|
|
26
82
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
27
83
|
|
|
28
84
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -851,13 +907,83 @@ export class Customers {
|
|
|
851
907
|
|
|
852
908
|
/**
|
|
853
909
|
*
|
|
910
|
+
* @param {string} params.organizationId - Filter to one organization.
|
|
911
|
+
* @param {string} params.role - Filter by role (buyer | approver | admin | requester).
|
|
912
|
+
* @param {string} params.status - Filter by status (invited | active | blocked).
|
|
913
|
+
* @param {string} params.email - Filter by exact email.
|
|
914
|
+
* @param {number} params.limit - Page size (default 50, max 200).
|
|
915
|
+
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
916
|
+
* @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
917
|
+
* @throws {RevenexxException}
|
|
918
|
+
* @returns {Promise<{}>}
|
|
919
|
+
*/
|
|
920
|
+
customersContactsList(params?: { organizationId?: string, role?: string, status?: string, email?: string, limit?: number, offset?: number, order?: string }): Promise<{}>;
|
|
921
|
+
/**
|
|
922
|
+
*
|
|
923
|
+
* @param {string} organizationId - Filter to one organization.
|
|
924
|
+
* @param {string} role - Filter by role (buyer | approver | admin | requester).
|
|
925
|
+
* @param {string} status - Filter by status (invited | active | blocked).
|
|
926
|
+
* @param {string} email - Filter by exact email.
|
|
927
|
+
* @param {number} limit - Page size (default 50, max 200).
|
|
928
|
+
* @param {number} offset - Row offset for pagination (default 0).
|
|
929
|
+
* @param {string} order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
854
930
|
* @throws {RevenexxException}
|
|
855
931
|
* @returns {Promise<{}>}
|
|
932
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
856
933
|
*/
|
|
857
|
-
customersContactsList(): Promise<{}
|
|
934
|
+
customersContactsList(organizationId?: string, role?: string, status?: string, email?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
|
|
935
|
+
customersContactsList(
|
|
936
|
+
paramsOrFirst?: { organizationId?: string, role?: string, status?: string, email?: string, limit?: number, offset?: number, order?: string } | string,
|
|
937
|
+
...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?]
|
|
938
|
+
): Promise<{}> {
|
|
939
|
+
let params: { organizationId?: string, role?: string, status?: string, email?: string, limit?: number, offset?: number, order?: string };
|
|
940
|
+
|
|
941
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
942
|
+
params = (paramsOrFirst || {}) as { organizationId?: string, role?: string, status?: string, email?: string, limit?: number, offset?: number, order?: string };
|
|
943
|
+
} else {
|
|
944
|
+
params = {
|
|
945
|
+
organizationId: paramsOrFirst as string,
|
|
946
|
+
role: rest[0] as string,
|
|
947
|
+
status: rest[1] as string,
|
|
948
|
+
email: rest[2] as string,
|
|
949
|
+
limit: rest[3] as number,
|
|
950
|
+
offset: rest[4] as number,
|
|
951
|
+
order: rest[5] as string
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
const organizationId = params.organizationId;
|
|
956
|
+
const role = params.role;
|
|
957
|
+
const status = params.status;
|
|
958
|
+
const email = params.email;
|
|
959
|
+
const limit = params.limit;
|
|
960
|
+
const offset = params.offset;
|
|
961
|
+
const order = params.order;
|
|
962
|
+
|
|
858
963
|
|
|
859
964
|
const apiPath = '/v1/customers/contacts';
|
|
860
965
|
const apiPayload: Payload = {};
|
|
966
|
+
if (typeof organizationId !== 'undefined') {
|
|
967
|
+
apiPayload['organization_id'] = organizationId;
|
|
968
|
+
}
|
|
969
|
+
if (typeof role !== 'undefined') {
|
|
970
|
+
apiPayload['role'] = role;
|
|
971
|
+
}
|
|
972
|
+
if (typeof status !== 'undefined') {
|
|
973
|
+
apiPayload['status'] = status;
|
|
974
|
+
}
|
|
975
|
+
if (typeof email !== 'undefined') {
|
|
976
|
+
apiPayload['email'] = email;
|
|
977
|
+
}
|
|
978
|
+
if (typeof limit !== 'undefined') {
|
|
979
|
+
apiPayload['limit'] = limit;
|
|
980
|
+
}
|
|
981
|
+
if (typeof offset !== 'undefined') {
|
|
982
|
+
apiPayload['offset'] = offset;
|
|
983
|
+
}
|
|
984
|
+
if (typeof order !== 'undefined') {
|
|
985
|
+
apiPayload['order'] = order;
|
|
986
|
+
}
|
|
861
987
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
862
988
|
|
|
863
989
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -13,13 +13,76 @@ export class Orderlists {
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
|
+
* @param {string} params.ownerId - Filter to one owning contact.
|
|
17
|
+
* @param {string} params.organizationId - Filter to one organization.
|
|
18
|
+
* @param {string} params.kind - Filter by list kind (shopping | label).
|
|
19
|
+
* @param {number} params.limit - Page size (default 50, max 200).
|
|
20
|
+
* @param {number} params.offset - Row offset for pagination (default 0).
|
|
21
|
+
* @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
16
22
|
* @throws {RevenexxException}
|
|
17
23
|
* @returns {Promise<{}>}
|
|
18
24
|
*/
|
|
19
|
-
orderlistsList(): Promise<{}
|
|
25
|
+
orderlistsList(params?: { ownerId?: string, organizationId?: string, kind?: string, limit?: number, offset?: number, order?: string }): Promise<{}>;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param {string} ownerId - Filter to one owning contact.
|
|
29
|
+
* @param {string} organizationId - Filter to one organization.
|
|
30
|
+
* @param {string} kind - Filter by list kind (shopping | label).
|
|
31
|
+
* @param {number} limit - Page size (default 50, max 200).
|
|
32
|
+
* @param {number} offset - Row offset for pagination (default 0).
|
|
33
|
+
* @param {string} order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
|
|
34
|
+
* @throws {RevenexxException}
|
|
35
|
+
* @returns {Promise<{}>}
|
|
36
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
37
|
+
*/
|
|
38
|
+
orderlistsList(ownerId?: string, organizationId?: string, kind?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
|
|
39
|
+
orderlistsList(
|
|
40
|
+
paramsOrFirst?: { ownerId?: string, organizationId?: string, kind?: string, limit?: number, offset?: number, order?: string } | string,
|
|
41
|
+
...rest: [(string)?, (string)?, (number)?, (number)?, (string)?]
|
|
42
|
+
): Promise<{}> {
|
|
43
|
+
let params: { ownerId?: string, organizationId?: string, kind?: string, limit?: number, offset?: number, order?: string };
|
|
44
|
+
|
|
45
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
46
|
+
params = (paramsOrFirst || {}) as { ownerId?: string, organizationId?: string, kind?: string, limit?: number, offset?: number, order?: string };
|
|
47
|
+
} else {
|
|
48
|
+
params = {
|
|
49
|
+
ownerId: paramsOrFirst as string,
|
|
50
|
+
organizationId: rest[0] as string,
|
|
51
|
+
kind: rest[1] as string,
|
|
52
|
+
limit: rest[2] as number,
|
|
53
|
+
offset: rest[3] as number,
|
|
54
|
+
order: rest[4] as string
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const ownerId = params.ownerId;
|
|
59
|
+
const organizationId = params.organizationId;
|
|
60
|
+
const kind = params.kind;
|
|
61
|
+
const limit = params.limit;
|
|
62
|
+
const offset = params.offset;
|
|
63
|
+
const order = params.order;
|
|
64
|
+
|
|
20
65
|
|
|
21
66
|
const apiPath = '/v1/orderlists';
|
|
22
67
|
const apiPayload: Payload = {};
|
|
68
|
+
if (typeof ownerId !== 'undefined') {
|
|
69
|
+
apiPayload['owner_id'] = ownerId;
|
|
70
|
+
}
|
|
71
|
+
if (typeof organizationId !== 'undefined') {
|
|
72
|
+
apiPayload['organization_id'] = organizationId;
|
|
73
|
+
}
|
|
74
|
+
if (typeof kind !== 'undefined') {
|
|
75
|
+
apiPayload['kind'] = kind;
|
|
76
|
+
}
|
|
77
|
+
if (typeof limit !== 'undefined') {
|
|
78
|
+
apiPayload['limit'] = limit;
|
|
79
|
+
}
|
|
80
|
+
if (typeof offset !== 'undefined') {
|
|
81
|
+
apiPayload['offset'] = offset;
|
|
82
|
+
}
|
|
83
|
+
if (typeof order !== 'undefined') {
|
|
84
|
+
apiPayload['order'] = order;
|
|
85
|
+
}
|
|
23
86
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
24
87
|
|
|
25
88
|
const apiHeaders: { [header: string]: string } = {
|