@crmcom/self-service-sdk 3.0.0-build.30 → 3.0.0-build.32

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/subscriptions.js +10 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crmcom/self-service-sdk",
3
- "version": "3.0.0-build.30",
3
+ "version": "3.0.0-build.32",
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
@@ -16,6 +16,7 @@ export const subscriptions = {
16
16
  getListContactDevices,
17
17
  getListContactSharedDevices,
18
18
  updateDevice,
19
+ listSubscriptionActions
19
20
  }
20
21
 
21
22
  async function getListSubscriptions({
@@ -435,23 +436,16 @@ async function listSubscriptionActions({
435
436
  include_total,
436
437
  behaviour_code,
437
438
  business_classification_code,
438
- cancelled_on,
439
- cancelled_on_gt,
440
- cancelled_on_gte,
441
- cancelled_on_lt,
442
- cancelled_on_lte,
443
- scheduled_on,
444
- scheduled_on_gt,
445
- scheduled_on_gte,
446
- scheduled_on_lt,
447
- scheduled_on_lte,
448
- state,
439
+ contact_id,
440
+ is_scheduled,
441
+ service_id,
442
+ subscription_id,
449
443
  subscription_id,
450
444
  } = {}) {
451
445
  try {
452
- let id = httpUtil.getSession().sub;
446
+ if (!contact_id) contact_id = await httpUtil.getSession().sub;
453
447
  let response = await httpUtil.get({
454
- resourcePath: "/v2/contacts/" + id + "/subscriptions/actions",
448
+ resourcePath: "/v2/subscriptions/actions",
455
449
  queryParams: {
456
450
  sort,
457
451
  order,
@@ -459,17 +453,9 @@ async function listSubscriptionActions({
459
453
  size,
460
454
  behaviour_code,
461
455
  business_classification_code,
462
- cancelled_on,
463
- "cancelled_on[gt]":cancelled_on_gt,
464
- "cancelled_on[gte]": cancelled_on_gte,
465
- "cancelled_on[lt]":cancelled_on_lt,
466
- "cancelled_on[lte]":cancelled_on_lte,
467
- scheduled_on,
468
- "scheduled_on[gt]":scheduled_on_gt,
469
- "scheduled_on[gte]":scheduled_on_gte,
470
- "scheduled_on[lt]":scheduled_on_lt,
471
- "scheduled_on[lte]":scheduled_on_lte,
472
- state,
456
+ contact_id,
457
+ is_scheduled,
458
+ service_id,
473
459
  subscription_id,
474
460
  include_total,
475
461
  },