@crmcom/self-service-sdk 3.0.0-build.26 → 3.0.0-build.27

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/index.d.ts CHANGED
@@ -356,6 +356,7 @@ export declare const payment: {
356
356
 
357
357
  export declare const subscriptions: {
358
358
  getListSubscriptions(params?: { page?: number; size?: number; include_terms?: boolean; include_billing_info?: boolean }): Promise<SDKResult>;
359
+ getServiceDevices(params?: PaginationParams & { state?: string; }): Promise<SDKResult>;
359
360
  getListContactServices(params?: PaginationParams & { classification?: string; include_future_info?: boolean; include_order_info?: boolean; include_subscription?: boolean; subscription_id?: string }): Promise<SDKResult>;
360
361
  getListContactDevices(params?: PaginationParams & { owned_by_contact?: boolean; search_value?: string; serial_number?: string; include_custom_fields?: boolean; include_subscription?: boolean; include_characteristics?: boolean }): Promise<SDKResult>;
361
362
  getListContactSharedDevices(params?: PaginationParams & { search_value?: string; serial_number?: string; include_custom_fields?: boolean; include_subscription?: boolean; include_characteristics?: boolean }): Promise<SDKResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crmcom/self-service-sdk",
3
- "version": "3.0.0-build.26",
3
+ "version": "3.0.0-build.27",
4
4
  "description": "Official CRM.COM Self-Service JavaScript SDK for consumer-facing API integration",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/subscriptions.js CHANGED
@@ -12,6 +12,7 @@ export const subscriptions = {
12
12
  getServiceRescommendation,
13
13
  getSubscriptionAction,
14
14
  getListSubscriptions,
15
+ getServiceDevices,
15
16
  getListContactDevices,
16
17
  getListContactSharedDevices,
17
18
  updateDevice,
@@ -43,6 +44,36 @@ async function getListSubscriptions({
43
44
  }
44
45
  }
45
46
 
47
+ async function getServiceDevices({
48
+ include_total,
49
+ order,
50
+ page=1,
51
+ size=20,
52
+ sort,
53
+ state
54
+ }={}) {
55
+ try {
56
+ let id = httpUtil.getSession().sub;
57
+ let response = await httpUtil.get({
58
+ resourcePath: "/v2/services/" + id + "/devices",
59
+ queryParams: {
60
+ include_total,
61
+ order,
62
+ page,
63
+ size,
64
+ sort,
65
+ state
66
+ },
67
+ withAccessToken: true,
68
+ logOutIfSessionInvalid: false
69
+ });
70
+ return createCommonResult(response);
71
+ } catch (e) {
72
+ logger.error("Exception addDevice:", e);
73
+ return createResult(ErrorCodes.UNKNOWN, e);
74
+ }
75
+ }
76
+
46
77
  async function getListContactDevices({
47
78
  order,
48
79
  owned_by_contact,