@revenexx/sdk 0.0.9 → 0.0.11

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.
@@ -328,7 +328,7 @@ export class Search {
328
328
  const apiPath = '/v1/search/multi_search';
329
329
  const apiPayload: Payload = {};
330
330
  if (typeof searches !== 'undefined') {
331
- apiPayload['searches'] = searches;
331
+ apiPayload['searches'] = Client.toWireKeys(searches, {"facetBy":{"wire":"facet_by","children":null},"filterBy":{"wire":"filter_by","children":null},"perPage":{"wire":"per_page","children":null},"queryBy":{"wire":"query_by","children":null},"sortBy":{"wire":"sort_by","children":null}});
332
332
  }
333
333
  const uri = new URL(this.client.config.endpoint + apiPath);
334
334
 
@@ -659,7 +659,7 @@ export class Shipping {
659
659
  const apiPath = '/v1/shipping/methods/{method_id}/tiers'.replace('{method_id}', methodId);
660
660
  const apiPayload: Payload = {};
661
661
  if (typeof tiers !== 'undefined') {
662
- apiPayload['tiers'] = tiers;
662
+ apiPayload['tiers'] = Client.toWireKeys(tiers, {"fromValue":{"wire":"from_value","children":null}});
663
663
  }
664
664
  const uri = new URL(this.client.config.endpoint + apiPath);
665
665
 
package/types/client.d.ts CHANGED
@@ -202,6 +202,17 @@ declare class Client {
202
202
  chunkedUpload(method: string, url: URL, headers: Headers | undefined, originalPayload: Payload | undefined, onProgress: (progress: UploadProgress) => void): Promise<any>;
203
203
  ping(): Promise<string>;
204
204
  call(method: string, url: URL, headers?: Headers, params?: Payload, responseType?: string): Promise<any>;
205
+ /**
206
+ * Recursively renames an argument's DECLARED keys to their snake_case wire
207
+ * names, using a map generated from the API contract. Free-form subtrees
208
+ * (metadata / user_data — keys absent from the map, with no `children`) are
209
+ * passed through untouched, so user data is never mangled. For arrays the
210
+ * same element map is applied to every item.
211
+ */
212
+ static toWireKeys(value: any, map: Record<string, {
213
+ wire: string;
214
+ children: any;
215
+ }>): any;
205
216
  static flatten(data: Payload, prefix?: string): Payload;
206
217
  }
207
218
  export { Client, RevenexxException };
@@ -0,0 +1,5 @@
1
+ export declare enum OrderFulfillmentStatus {
2
+ Unfulfilled = "unfulfilled",
3
+ Partial = "partial",
4
+ Fulfilled = "fulfilled"
5
+ }
@@ -0,0 +1,7 @@
1
+ export declare enum OrderStatus {
2
+ Pending = "pending",
3
+ Placed = "placed",
4
+ InFulfillment = "in_fulfillment",
5
+ Completed = "completed",
6
+ Cancelled = "cancelled"
7
+ }
package/types/index.d.ts CHANGED
@@ -64,8 +64,10 @@ export { LocationType } from './enums/location-type';
64
64
  export { MarketStatus } from './enums/market-status';
65
65
  export { Priority } from './enums/priority';
66
66
  export { OrderListKind } from './enums/order-list-kind';
67
- export { OrderCommentVisibility } from './enums/order-comment-visibility';
67
+ export { OrderStatus } from './enums/order-status';
68
68
  export { OrderPaymentStatus } from './enums/order-payment-status';
69
+ export { OrderFulfillmentStatus } from './enums/order-fulfillment-status';
70
+ export { OrderCommentVisibility } from './enums/order-comment-visibility';
69
71
  export { PageStatus } from './enums/page-status';
70
72
  export { PaymentFeeType } from './enums/payment-fee-type';
71
73
  export { PaymentMethodKind } from './enums/payment-method-kind';
@@ -11,10 +11,36 @@ export declare class Carts {
11
11
  constructor(client: Client);
12
12
  /**
13
13
  *
14
+ * @param {string} params.contactId - Filter to one owning contact.
15
+ * @param {string} params.sessionKey - Filter to one guest session.
16
+ * @param {string} params.status - Filter by cart status (e.g. active).
17
+ * @param {number} params.limit - Page size (default 50, max 200).
18
+ * @param {number} params.offset - Row offset for pagination (default 0).
19
+ * @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
14
20
  * @throws {RevenexxException}
15
21
  * @returns {Promise<{}>}
16
22
  */
17
- cartsList(): Promise<{}>;
23
+ cartsList(params?: {
24
+ contactId?: string;
25
+ sessionKey?: string;
26
+ status?: string;
27
+ limit?: number;
28
+ offset?: number;
29
+ order?: string;
30
+ }): 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<{}>;
18
44
  /**
19
45
  *
20
46
  * @param {string} params.channelId -
@@ -9,10 +9,33 @@ export declare class Customers {
9
9
  constructor(client: Client);
10
10
  /**
11
11
  *
12
+ * @param {string} params.contactId - Filter to one owning contact.
13
+ * @param {string} params.organizationId - Filter to one organization.
14
+ * @param {number} params.limit - Page size (default 50, max 200).
15
+ * @param {number} params.offset - Row offset for pagination (default 0).
16
+ * @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
12
17
  * @throws {RevenexxException}
13
18
  * @returns {Promise<{}>}
14
19
  */
15
- customersAddressesList(): Promise<{}>;
20
+ customersAddressesList(params?: {
21
+ contactId?: string;
22
+ organizationId?: string;
23
+ limit?: number;
24
+ offset?: number;
25
+ order?: string;
26
+ }): Promise<{}>;
27
+ /**
28
+ *
29
+ * @param {string} contactId - Filter to one owning contact.
30
+ * @param {string} organizationId - Filter to one organization.
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
+ customersAddressesList(contactId?: string, organizationId?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
16
39
  /**
17
40
  *
18
41
  * @param {string} params.city -
@@ -6,10 +6,36 @@ export declare class Orderlists {
6
6
  constructor(client: Client);
7
7
  /**
8
8
  *
9
+ * @param {string} params.ownerId - Filter to one owning contact.
10
+ * @param {string} params.organizationId - Filter to one organization.
11
+ * @param {string} params.kind - Filter by list kind (shopping | label).
12
+ * @param {number} params.limit - Page size (default 50, max 200).
13
+ * @param {number} params.offset - Row offset for pagination (default 0).
14
+ * @param {string} params.order - Sort as 'column.asc' | 'column.desc', e.g. 'created_at.desc'.
9
15
  * @throws {RevenexxException}
10
16
  * @returns {Promise<{}>}
11
17
  */
12
- orderlistsList(): Promise<{}>;
18
+ orderlistsList(params?: {
19
+ ownerId?: string;
20
+ organizationId?: string;
21
+ kind?: string;
22
+ limit?: number;
23
+ offset?: number;
24
+ order?: string;
25
+ }): 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<{}>;
13
39
  /**
14
40
  *
15
41
  * @param {string} params.name -
@@ -1,15 +1,17 @@
1
1
  import { Client } from '../client';
2
2
  import type { Models } from '../models';
3
- import { OrderCommentVisibility } from '../enums/order-comment-visibility';
3
+ import { OrderStatus } from '../enums/order-status';
4
4
  import { OrderPaymentStatus } from '../enums/order-payment-status';
5
+ import { OrderFulfillmentStatus } from '../enums/order-fulfillment-status';
6
+ import { OrderCommentVisibility } from '../enums/order-comment-visibility';
5
7
  export declare class Orders {
6
8
  client: Client;
7
9
  constructor(client: Client);
8
10
  /**
9
11
  *
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.
12
+ * @param {OrderStatus} params.status - Filter by order status (exact match).
13
+ * @param {OrderPaymentStatus} params.paymentStatus - Filter by payment status (exact match).
14
+ * @param {OrderFulfillmentStatus} params.fulfillmentStatus - Filter by fulfillment status (exact match).
13
15
  * @param {string} params.contactId - Filter to one ordering contact.
14
16
  * @param {string} params.organizationId - Filter to one B2B organization.
15
17
  * @param {string} params.channelId - Filter to one sales channel.
@@ -22,9 +24,9 @@ export declare class Orders {
22
24
  * @returns {Promise<{}>}
23
25
  */
24
26
  ordersList(params?: {
25
- status?: string;
26
- paymentStatus?: string;
27
- fulfillmentStatus?: string;
27
+ status?: OrderStatus;
28
+ paymentStatus?: OrderPaymentStatus;
29
+ fulfillmentStatus?: OrderFulfillmentStatus;
28
30
  contactId?: string;
29
31
  organizationId?: string;
30
32
  channelId?: string;
@@ -36,9 +38,9 @@ export declare class Orders {
36
38
  }): Promise<{}>;
37
39
  /**
38
40
  *
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.
41
+ * @param {OrderStatus} status - Filter by order status (exact match).
42
+ * @param {OrderPaymentStatus} paymentStatus - Filter by payment status (exact match).
43
+ * @param {OrderFulfillmentStatus} fulfillmentStatus - Filter by fulfillment status (exact match).
42
44
  * @param {string} contactId - Filter to one ordering contact.
43
45
  * @param {string} organizationId - Filter to one B2B organization.
44
46
  * @param {string} channelId - Filter to one sales channel.
@@ -51,7 +53,7 @@ export declare class Orders {
51
53
  * @returns {Promise<{}>}
52
54
  * @deprecated Use the object parameter style method for a better developer experience.
53
55
  */
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<{}>;
56
+ ordersList(status?: OrderStatus, paymentStatus?: OrderPaymentStatus, fulfillmentStatus?: OrderFulfillmentStatus, contactId?: string, organizationId?: string, channelId?: string, marketId?: string, number?: string, limit?: number, offset?: number, order?: string): Promise<{}>;
55
57
  /**
56
58
  *
57
59
  * @throws {RevenexxException}