@opens/gateways 1.16.18 → 1.16.20

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/index.mjs CHANGED
@@ -471,6 +471,19 @@ var ChatConfigGateway = class {
471
471
  const { data } = await this.httpClient.put(`${this.baseUrl}/rules/queue/find-or-create`, payload);
472
472
  return data;
473
473
  }
474
+ /**
475
+ * Retrieves a rule by its ID (`GET /rules/:id`).
476
+ * Pass `rootOnly: false` to expand the nested `flow` tree recursively.
477
+ * @param ruleId - The unique identifier of the rule.
478
+ * @param params - Optional query parameters (`rootOnly`, `includeFlow`, etc.).
479
+ * @returns The rule, optionally with nested `flow`.
480
+ */
481
+ async getRuleById(ruleId, params) {
482
+ const { data } = await this.httpClient.get(`${this.baseUrl}/rules/${ruleId}`, {
483
+ params
484
+ });
485
+ return data;
486
+ }
474
487
  /**
475
488
  * @param params - The company and pagination parameters.
476
489
  * @returns The paginated initial service rules.
@@ -499,6 +512,17 @@ var ChatConfigGateway = class {
499
512
  });
500
513
  return data;
501
514
  }
515
+ /**
516
+ * Counts rules matching the given filters.
517
+ * @param params - Query parameters for filtering rules (same filters as `getRules`, without pagination/associations).
518
+ * @returns The total number of rules matching the filters.
519
+ */
520
+ async getRulesCount(params) {
521
+ const { data } = await this.httpClient.get(`${this.baseUrl}/rules/count`, {
522
+ params
523
+ });
524
+ return data;
525
+ }
502
526
  };
503
527
 
504
528
  // src/campaigns/index.ts