teleleo 0.0.0-stage → 0.2.0

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 (140) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +21 -0
  3. package/README.md +236 -2
  4. package/api.md +187 -0
  5. package/dist/client.d.ts +28 -0
  6. package/dist/client.d.ts.map +1 -0
  7. package/dist/client.js +27 -0
  8. package/dist/client.js.map +1 -0
  9. package/dist/core.d.ts +66 -0
  10. package/dist/core.d.ts.map +1 -0
  11. package/dist/core.js +195 -0
  12. package/dist/core.js.map +1 -0
  13. package/dist/errors.d.ts +92 -0
  14. package/dist/errors.d.ts.map +1 -0
  15. package/dist/errors.js +163 -0
  16. package/dist/errors.js.map +1 -0
  17. package/dist/index.d.ts +23 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +23 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/pagination.d.ts +41 -0
  22. package/dist/pagination.d.ts.map +1 -0
  23. package/dist/pagination.js +98 -0
  24. package/dist/pagination.js.map +1 -0
  25. package/dist/resource.d.ts +7 -0
  26. package/dist/resource.d.ts.map +1 -0
  27. package/dist/resource.js +8 -0
  28. package/dist/resource.js.map +1 -0
  29. package/dist/resources/call-scenarios.d.ts +77 -0
  30. package/dist/resources/call-scenarios.d.ts.map +1 -0
  31. package/dist/resources/call-scenarios.js +137 -0
  32. package/dist/resources/call-scenarios.js.map +1 -0
  33. package/dist/resources/calls.d.ts +69 -0
  34. package/dist/resources/calls.d.ts.map +1 -0
  35. package/dist/resources/calls.js +109 -0
  36. package/dist/resources/calls.js.map +1 -0
  37. package/dist/resources/contact-groups.d.ts +65 -0
  38. package/dist/resources/contact-groups.d.ts.map +1 -0
  39. package/dist/resources/contact-groups.js +99 -0
  40. package/dist/resources/contact-groups.js.map +1 -0
  41. package/dist/resources/contacts.d.ts +75 -0
  42. package/dist/resources/contacts.d.ts.map +1 -0
  43. package/dist/resources/contacts.js +132 -0
  44. package/dist/resources/contacts.js.map +1 -0
  45. package/dist/resources/dongles.d.ts +201 -0
  46. package/dist/resources/dongles.d.ts.map +1 -0
  47. package/dist/resources/dongles.js +296 -0
  48. package/dist/resources/dongles.js.map +1 -0
  49. package/dist/resources/files.d.ts +52 -0
  50. package/dist/resources/files.d.ts.map +1 -0
  51. package/dist/resources/files.js +73 -0
  52. package/dist/resources/files.js.map +1 -0
  53. package/dist/resources/follow-up-sms-settings.d.ts +65 -0
  54. package/dist/resources/follow-up-sms-settings.d.ts.map +1 -0
  55. package/dist/resources/follow-up-sms-settings.js +111 -0
  56. package/dist/resources/follow-up-sms-settings.js.map +1 -0
  57. package/dist/resources/index.d.ts +50 -0
  58. package/dist/resources/index.d.ts.map +1 -0
  59. package/dist/resources/index.js +36 -0
  60. package/dist/resources/index.js.map +1 -0
  61. package/dist/resources/mailings.d.ts +85 -0
  62. package/dist/resources/mailings.d.ts.map +1 -0
  63. package/dist/resources/mailings.js +191 -0
  64. package/dist/resources/mailings.js.map +1 -0
  65. package/dist/resources/public-vpn.d.ts +51 -0
  66. package/dist/resources/public-vpn.d.ts.map +1 -0
  67. package/dist/resources/public-vpn.js +67 -0
  68. package/dist/resources/public-vpn.js.map +1 -0
  69. package/dist/resources/redirections.d.ts +65 -0
  70. package/dist/resources/redirections.d.ts.map +1 -0
  71. package/dist/resources/redirections.js +113 -0
  72. package/dist/resources/redirections.js.map +1 -0
  73. package/dist/resources/sip-users.d.ts +30 -0
  74. package/dist/resources/sip-users.d.ts.map +1 -0
  75. package/dist/resources/sip-users.js +40 -0
  76. package/dist/resources/sip-users.js.map +1 -0
  77. package/dist/resources/sms.d.ts +116 -0
  78. package/dist/resources/sms.d.ts.map +1 -0
  79. package/dist/resources/sms.js +203 -0
  80. package/dist/resources/sms.js.map +1 -0
  81. package/dist/resources/socks-proxies.d.ts +65 -0
  82. package/dist/resources/socks-proxies.d.ts.map +1 -0
  83. package/dist/resources/socks-proxies.js +91 -0
  84. package/dist/resources/socks-proxies.js.map +1 -0
  85. package/dist/resources/ussd.d.ts +71 -0
  86. package/dist/resources/ussd.d.ts.map +1 -0
  87. package/dist/resources/ussd.js +89 -0
  88. package/dist/resources/ussd.js.map +1 -0
  89. package/dist/types/enums.d.ts +280 -0
  90. package/dist/types/enums.d.ts.map +1 -0
  91. package/dist/types/enums.js +233 -0
  92. package/dist/types/enums.js.map +1 -0
  93. package/dist/types/index.d.ts +4 -0
  94. package/dist/types/index.d.ts.map +1 -0
  95. package/dist/types/index.js +5 -0
  96. package/dist/types/index.js.map +1 -0
  97. package/dist/types/models.d.ts +686 -0
  98. package/dist/types/models.d.ts.map +1 -0
  99. package/dist/types/models.js +3 -0
  100. package/dist/types/models.js.map +1 -0
  101. package/dist/types/params.d.ts +711 -0
  102. package/dist/types/params.d.ts.map +1 -0
  103. package/dist/types/params.js +3 -0
  104. package/dist/types/params.js.map +1 -0
  105. package/dist/utils.d.ts +32 -0
  106. package/dist/utils.d.ts.map +1 -0
  107. package/dist/utils.js +118 -0
  108. package/dist/utils.js.map +1 -0
  109. package/dist/version.d.ts +2 -0
  110. package/dist/version.d.ts.map +1 -0
  111. package/dist/version.js +2 -0
  112. package/dist/version.js.map +1 -0
  113. package/package.json +63 -4
  114. package/src/client.ts +42 -0
  115. package/src/core.ts +278 -0
  116. package/src/errors.ts +170 -0
  117. package/src/index.ts +46 -0
  118. package/src/pagination.ts +110 -0
  119. package/src/resource.ts +10 -0
  120. package/src/resources/call-scenarios.ts +154 -0
  121. package/src/resources/calls.ts +117 -0
  122. package/src/resources/contact-groups.ts +115 -0
  123. package/src/resources/contacts.ts +149 -0
  124. package/src/resources/dongles.ts +346 -0
  125. package/src/resources/files.ts +79 -0
  126. package/src/resources/follow-up-sms-settings.ts +130 -0
  127. package/src/resources/index.ts +86 -0
  128. package/src/resources/mailings.ts +207 -0
  129. package/src/resources/public-vpn.ts +72 -0
  130. package/src/resources/redirections.ts +129 -0
  131. package/src/resources/sip-users.ts +44 -0
  132. package/src/resources/sms.ts +232 -0
  133. package/src/resources/socks-proxies.ts +107 -0
  134. package/src/resources/ussd.ts +97 -0
  135. package/src/types/enums.ts +300 -0
  136. package/src/types/index.ts +5 -0
  137. package/src/types/models.ts +747 -0
  138. package/src/types/params.ts +767 -0
  139. package/src/utils.ts +123 -0
  140. package/src/version.ts +1 -0
@@ -0,0 +1,98 @@
1
+ /** Page size the API uses when only `page` is sent. */
2
+ const DEFAULT_PAGE_SIZE = 50;
3
+ /**
4
+ * One page of a list.
5
+ *
6
+ * `page.items` holds this page. `for await` over the page goes through every item of every page and requests the
7
+ * next pages as needed.
8
+ */
9
+ export class Page {
10
+ /** The items of this page. */
11
+ items;
12
+ /** How many items match the request across all pages, when the API reports it. */
13
+ totalCount;
14
+ #query;
15
+ #fetch;
16
+ /** @internal */
17
+ constructor(items, totalCount, query, fetch) {
18
+ this.items = items;
19
+ this.totalCount = totalCount;
20
+ this.#query = query;
21
+ this.#fetch = fetch;
22
+ }
23
+ #position() {
24
+ const page = this.#query['page'];
25
+ const limit = this.#query['limit'];
26
+ const pageIndex = typeof page === 'number' ? page : 0;
27
+ if (typeof limit === 'number')
28
+ return [pageIndex, limit];
29
+ if (page !== undefined)
30
+ return [pageIndex, DEFAULT_PAGE_SIZE];
31
+ return [pageIndex, this.items.length || null];
32
+ }
33
+ hasNextPage() {
34
+ if (!this.items.length)
35
+ return false;
36
+ const [page, limit] = this.#position();
37
+ if (limit === null)
38
+ return false;
39
+ if (this.totalCount === null)
40
+ return this.items.length >= limit;
41
+ return page * limit + this.items.length < this.totalCount;
42
+ }
43
+ async getNextPage() {
44
+ if (!this.hasNextPage())
45
+ throw new Error('No next page; check hasNextPage() first');
46
+ const [page, limit] = this.#position();
47
+ return this.#fetch({ ...this.#query, page: page + 1, limit });
48
+ }
49
+ /** Every page, starting with this one. */
50
+ async *iterPages() {
51
+ let page = this;
52
+ while (true) {
53
+ yield page;
54
+ if (!page.hasNextPage())
55
+ return;
56
+ page = await page.getNextPage();
57
+ }
58
+ }
59
+ async *[Symbol.asyncIterator]() {
60
+ for await (const page of this.iterPages())
61
+ yield* page.items;
62
+ }
63
+ }
64
+ /**
65
+ * The result of a list method: await it for the first page, or iterate it with `for await` to go through every
66
+ * item of every page.
67
+ *
68
+ * ```ts
69
+ * const page = await client.sms.list({ limit: 100 });
70
+ * for await (const sms of client.sms.list({ limit: 100 })) console.log(sms.message_decoded);
71
+ * ```
72
+ */
73
+ export class PagePromise {
74
+ #promise;
75
+ #load;
76
+ /** @internal */
77
+ constructor(load) {
78
+ this.#load = load;
79
+ }
80
+ #page() {
81
+ this.#promise ??= this.#load();
82
+ return this.#promise;
83
+ }
84
+ then(onfulfilled, onrejected) {
85
+ return this.#page().then(onfulfilled, onrejected);
86
+ }
87
+ catch(onrejected) {
88
+ return this.#page().catch(onrejected);
89
+ }
90
+ finally(onfinally) {
91
+ return this.#page().finally(onfinally);
92
+ }
93
+ async *[Symbol.asyncIterator]() {
94
+ const page = await this.#page();
95
+ yield* page;
96
+ }
97
+ }
98
+ //# sourceMappingURL=pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAK7B;;;;;GAKG;AACH,MAAM,OAAO,IAAI;IACf,8BAA8B;IACrB,KAAK,CAAM;IACpB,kFAAkF;IACzE,UAAU,CAAgB;IAE1B,MAAM,CAA0B;IAChC,MAAM,CAAe;IAE9B,gBAAgB;IAChB,YAAY,KAAU,EAAE,UAAyB,EAAE,KAA8B,EAAE,KAAmB;QACpG,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,SAAS;QACP,MAAM,IAAI,GAAG,I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C,CAAC,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import type { BaseClient } from './core.js';
2
+ /** Base class of the resource groups of the client (`client.dongles`, `client.sms`, ...). */
3
+ export declare class APIResource {
4
+ protected readonly _client: BaseClient;
5
+ constructor(client: BaseClient);
6
+ }
7
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,6FAA6F;AAC7F,qBAAa,WAAW;IACtB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;gBAE3B,MAAM,EAAE,UAAU;CAG/B"}
@@ -0,0 +1,8 @@
1
+ /** Base class of the resource groups of the client (`client.dongles`, `client.sms`, ...). */
2
+ export class APIResource {
3
+ _client;
4
+ constructor(client) {
5
+ this._client = client;
6
+ }
7
+ }
8
+ //# sourceMappingURL=resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.js","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAEA,6FAA6F;AAC7F,MAAM,OAAO,WAAW;IACH,OAAO,CAAa;IAEvC,YAAY,MAAkB;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,77 @@
1
+ import type { RequestOptions } from '../core.js';
2
+ import type { PagePromise } from '../pagination.js';
3
+ import { APIResource } from '../resource.js';
4
+ import type { CallScenario } from '../types/models.js';
5
+ import type { CallScenariosCreateParams, CallScenariosListParams, CallScenariosUpdateParams } from '../types/params.js';
6
+ /** What a modem plays to incoming callers. */
7
+ export declare class CallScenariosResource extends APIResource {
8
+ /**
9
+ * List call scenarios.
10
+ *
11
+ * Call scenarios of the account: what a modem plays to incoming callers. Newest first by default (created_at descending, then the id descending).
12
+ *
13
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION.
14
+ *
15
+ * Capability the role of an organization API key needs: `automation.view`.
16
+ */
17
+ list(params?: CallScenariosListParams, options?: RequestOptions): PagePromise<CallScenario>;
18
+ /**
19
+ * Create call scenario.
20
+ *
21
+ * Creates the call scenario of a modem (one per modem) and pushes it to the modem; follow the delivery in call_scenario_apply_status_id.
22
+ *
23
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_HAS_SIP_TYPE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, CALL_SCENARIO_MANAGEMENT_DONGLE_NOT_SUPPORTED_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_ALREADY_HAS_ACTIVE_SCENARIO_EXCEPTION, TMP_FILE_NOT_FOUND, CALL_SCENARIO_MANAGEMENT_CONTACT_NOT_FOUND_EXCEPTION.
24
+ *
25
+ * Capability the role of an organization API key needs: `automation.manage`.
26
+ */
27
+ create(params: CallScenariosCreateParams, options?: RequestOptions): Promise<CallScenario>;
28
+ /**
29
+ * Get call scenario.
30
+ *
31
+ * One call scenario of the account with its delivery state.
32
+ *
33
+ * @param callScenarioId - Call scenario id
34
+ *
35
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_SCENARIO_NOT_FOUND_EXCEPTION.
36
+ *
37
+ * Capability the role of an organization API key needs: `automation.view`.
38
+ */
39
+ get(callScenarioId: number, options?: RequestOptions): Promise<CallScenario>;
40
+ /**
41
+ * Update call scenario.
42
+ *
43
+ * Changes the call scenario and pushes the new version to the modem. Send version_uuid of the version you read to avoid overwriting a newer one (409).
44
+ *
45
+ * @param callScenarioId - Call scenario id
46
+ *
47
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_SCENARIO_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_HAS_SIP_TYPE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, CALL_SCENARIO_MANAGEMENT_DONGLE_NOT_SUPPORTED_EXCEPTION, CALL_SCENARIO_MANAGEMENT_VERSION_CONFLICT_EXCEPTION, TMP_FILE_NOT_FOUND, CALL_SCENARIO_MANAGEMENT_CONTACT_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_ALREADY_HAS_ACTIVE_SCENARIO_EXCEPTION.
48
+ *
49
+ * Capability the role of an organization API key needs: `automation.manage`.
50
+ */
51
+ update(callScenarioId: number, params?: CallScenariosUpdateParams, options?: RequestOptions): Promise<CallScenario>;
52
+ /**
53
+ * Delete call scenario.
54
+ *
55
+ * Deletes the call scenario and removes it from the modem.
56
+ *
57
+ * @param callScenarioId - Identifier in the path
58
+ *
59
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_SCENARIO_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_UNAVAILABLE_EXCEPTION, CALL_SCENARIO_MANAGEMENT_VERSION_CONFLICT_EXCEPTION.
60
+ *
61
+ * Capability the role of an organization API key needs: `automation.manage`.
62
+ */
63
+ delete(callScenarioId: number, options?: RequestOptions): Promise<boolean>;
64
+ /**
65
+ * Retry call scenario delivery.
66
+ *
67
+ * Re-sends the scenario to the modem after a delivery error (call_scenario_apply_status_id / call_scenario_delivery_error_id).
68
+ *
69
+ * @param callScenarioId - Call scenario id
70
+ *
71
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_SCENARIO_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_HAS_SIP_TYPE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, CALL_SCENARIO_MANAGEMENT_DONGLE_NOT_SUPPORTED_EXCEPTION.
72
+ *
73
+ * Capability the role of an organization API key needs: `automation.manage`.
74
+ */
75
+ retry(callScenarioId: number, options?: RequestOptions): Promise<CallScenario>;
76
+ }
77
+ //# sourceMappingURL=call-scenarios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call-scenarios.d.ts","sourceRoot":"","sources":["../../src/resources/call-scenarios.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,8CAA8C;AAC9C,qBAAa,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,GAAE,uBAA4B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,YAAY,CAAC;IAoB/F;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAkB1F;;;;;;;;;;OAUG;IACH,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAM5E;;;;;;;;;;OAUG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,MAAM,GAAE,yBAA8B,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,YAAY,CAAC;IAkBxB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAM1E;;;;;;;;;;OAUG;IACH,KAAK,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;CAK/E"}
@@ -0,0 +1,137 @@
1
+ // File generated from spec/openapi.yaml by scripts/generate.mjs. Do not edit by hand.
2
+ import { APIResource } from '../resource.js';
3
+ import { asStatus, pathParam } from '../utils.js';
4
+ /** What a modem plays to incoming callers. */
5
+ export class CallScenariosResource extends APIResource {
6
+ /**
7
+ * List call scenarios.
8
+ *
9
+ * Call scenarios of the account: what a modem plays to incoming callers. Newest first by default (created_at descending, then the id descending).
10
+ *
11
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION.
12
+ *
13
+ * Capability the role of an organization API key needs: `automation.view`.
14
+ */
15
+ list(params = {}, options) {
16
+ return this._client.getPage('/call-scenario', {
17
+ query: {
18
+ 'dongle_ids[]': params.dongle_ids,
19
+ name: params.name,
20
+ dongle_name: params.dongle_name,
21
+ dongle_phone: params.dongle_phone,
22
+ from: params.from,
23
+ to: params.to,
24
+ is_empty_file_id: params.is_empty_file_id,
25
+ page: params.page,
26
+ limit: params.limit,
27
+ order_by: params.order_by,
28
+ order: params.order,
29
+ },
30
+ itemKey: 'call_scenarios',
31
+ options,
32
+ });
33
+ }
34
+ /**
35
+ * Create call scenario.
36
+ *
37
+ * Creates the call scenario of a modem (one per modem) and pushes it to the modem; follow the delivery in call_scenario_apply_status_id.
38
+ *
39
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_HAS_SIP_TYPE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, CALL_SCENARIO_MANAGEMENT_DONGLE_NOT_SUPPORTED_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_ALREADY_HAS_ACTIVE_SCENARIO_EXCEPTION, TMP_FILE_NOT_FOUND, CALL_SCENARIO_MANAGEMENT_CONTACT_NOT_FOUND_EXCEPTION.
40
+ *
41
+ * Capability the role of an organization API key needs: `automation.manage`.
42
+ */
43
+ create(params, options) {
44
+ return this._client
45
+ .request('POST', '/call-scenario', {
46
+ body: {
47
+ name: params.name,
48
+ is_call_record: params.is_call_record,
49
+ dongle_id: params.dongle_id,
50
+ call_scenario_type_id: params.call_scenario_type_id,
51
+ tmp_file_id: params.tmp_file_id,
52
+ call_scenario_contact_ids: params.call_scenario_contact_ids,
53
+ call_scenario_phones: params.call_scenario_phones,
54
+ call_scenario_contact_group_ids: params.call_scenario_contact_group_ids,
55
+ },
56
+ options,
57
+ })
58
+ .then((data) => data);
59
+ }
60
+ /**
61
+ * Get call scenario.
62
+ *
63
+ * One call scenario of the account with its delivery state.
64
+ *
65
+ * @param callScenarioId - Call scenario id
66
+ *
67
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_SCENARIO_NOT_FOUND_EXCEPTION.
68
+ *
69
+ * Capability the role of an organization API key needs: `automation.view`.
70
+ */
71
+ get(callScenarioId, options) {
72
+ return this._client
73
+ .request('GET', `/call-scenario/${pathParam(callScenarioId)}`, { options })
74
+ .then((data) => data);
75
+ }
76
+ /**
77
+ * Update call scenario.
78
+ *
79
+ * Changes the call scenario and pushes the new version to the modem. Send version_uuid of the version you read to avoid overwriting a newer one (409).
80
+ *
81
+ * @param callScenarioId - Call scenario id
82
+ *
83
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_SCENARIO_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_HAS_SIP_TYPE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, CALL_SCENARIO_MANAGEMENT_DONGLE_NOT_SUPPORTED_EXCEPTION, CALL_SCENARIO_MANAGEMENT_VERSION_CONFLICT_EXCEPTION, TMP_FILE_NOT_FOUND, CALL_SCENARIO_MANAGEMENT_CONTACT_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_ALREADY_HAS_ACTIVE_SCENARIO_EXCEPTION.
84
+ *
85
+ * Capability the role of an organization API key needs: `automation.manage`.
86
+ */
87
+ update(callScenarioId, params = {}, options) {
88
+ return this._client
89
+ .request('PUT', `/call-scenario/${pathParam(callScenarioId)}`, {
90
+ body: {
91
+ name: params.name,
92
+ is_call_record: params.is_call_record,
93
+ call_scenario_type_id: params.call_scenario_type_id,
94
+ tmp_file_id: params.tmp_file_id,
95
+ call_scenario_contact_ids: params.call_scenario_contact_ids,
96
+ call_scenario_phones: params.call_scenario_phones,
97
+ call_scenario_contact_group_ids: params.call_scenario_contact_group_ids,
98
+ version_uuid: params.version_uuid,
99
+ },
100
+ options,
101
+ })
102
+ .then((data) => data);
103
+ }
104
+ /**
105
+ * Delete call scenario.
106
+ *
107
+ * Deletes the call scenario and removes it from the modem.
108
+ *
109
+ * @param callScenarioId - Identifier in the path
110
+ *
111
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_SCENARIO_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_UNAVAILABLE_EXCEPTION, CALL_SCENARIO_MANAGEMENT_VERSION_CONFLICT_EXCEPTION.
112
+ *
113
+ * Capability the role of an organization API key needs: `automation.manage`.
114
+ */
115
+ delete(callScenarioId, options) {
116
+ return this._client
117
+ .request('DELETE', `/call-scenario/${pathParam(callScenarioId)}`, { options })
118
+ .then(asStatus);
119
+ }
120
+ /**
121
+ * Retry call scenario delivery.
122
+ *
123
+ * Re-sends the scenario to the modem after a delivery error (call_scenario_apply_status_id / call_scenario_delivery_error_id).
124
+ *
125
+ * @param callScenarioId - Call scenario id
126
+ *
127
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_SCENARIO_NOT_FOUND_EXCEPTION, CALL_SCENARIO_MANAGEMENT_DONGLE_HAS_SIP_TYPE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, CALL_SCENARIO_MANAGEMENT_DONGLE_NOT_SUPPORTED_EXCEPTION.
128
+ *
129
+ * Capability the role of an organization API key needs: `automation.manage`.
130
+ */
131
+ retry(callScenarioId, options) {
132
+ return this._client
133
+ .request('POST', `/call-scenario/${pathParam(callScenarioId)}/retry`, { options })
134
+ .then((data) => data);
135
+ }
136
+ }
137
+ //# sourceMappingURL=call-scenarios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call-scenarios.js","sourceRoot":"","sources":["../../src/resources/call-scenarios.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO7C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,8CAA8C;AAC9C,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;OAQG;IACH,IAAI,CAAC,SAAkC,EAAE,EAAE,OAAwB;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAe,gBAAgB,EAAE;YAC1D,KAAK,EAAE;gBACL,cAAc,EAAE,MAAM,CAAC,UAAU;gBACjC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;gBACzC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB;YACD,OAAO,EAAE,gBAAgB;YACzB,OAAO;SACR,CAAC,CAAC;IACL,CAA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M,CAAC,yBAAyB;gBAC3D,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;gBACjD,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;gBACvE,YAAY,EAAE,MAAM,CAAC,YAAY;aAClC;YACD,OAAO;SACR,CAAC;aACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAoB,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,cAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,QAAQ,EAAE,kBAAkB,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;aAC7E,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,cAAsB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,MAAM,EAAE,kBAAkB,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC;aACjF,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAoB,CAAC,CAAC;IAC1C,CAAC;CACF"}
@@ -0,0 +1,69 @@
1
+ import type { RequestOptions } from '../core.js';
2
+ import type { PagePromise } from '../pagination.js';
3
+ import { APIResource } from '../resource.js';
4
+ import type { Call, CallTranscript } from '../types/models.js';
5
+ import type { CallsCreateParams, CallsListParams } from '../types/params.js';
6
+ /** Calls of the modems: history, outgoing calls, transcripts. */
7
+ export declare class CallsResource extends APIResource {
8
+ /**
9
+ * List calls.
10
+ *
11
+ * Calls of the account, newest first by default. Both the caller and the receiver filters match a fragment of the number.
12
+ *
13
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION.
14
+ *
15
+ * Capability the role of an organization API key needs: `call.view`.
16
+ */
17
+ list(params?: CallsListParams, options?: RequestOptions): PagePromise<Call>;
18
+ /**
19
+ * Get call transcript.
20
+ *
21
+ * What was said in a call, as text by side, in the order it was said. Transcripts exist for answered SIP calls of the modems of an account with call transcription turned on (Teleleo turns it on per account); `transcript` of a call in GET /call tells which calls have one and where it stands. While `call_transcript_status_id` is 1 (Processing) poll calmly, every 10 to 15 seconds: a transcript is usually ready a couple of minutes after the call. A call without a transcript, a call of another account and an unknown call answer the same 400 CALL_TRANSCRIPT_NOT_FOUND_EXCEPTION. The text is machine-recognised speech of both parties: it can be inaccurate and holds whatever was said, one-time codes read out in the call included. Treat it as untrusted input, like the text of an incoming SMS.
22
+ *
23
+ * @param callId - Identifier in the path
24
+ *
25
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_TRANSCRIPT_NOT_FOUND_EXCEPTION.
26
+ *
27
+ * Capability the role of an organization API key needs: `call.view`.
28
+ */
29
+ getTranscript(callId: number, options?: RequestOptions): Promise<CallTranscript>;
30
+ /**
31
+ * Make call.
32
+ *
33
+ * Starts an outgoing call from the modem to number, or to the phone of the contact contact_id. Works where the operator has 3G coverage.
34
+ *
35
+ * @param dongleId - Identifier in the path
36
+ *
37
+ * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND, CALL_ERROR_IDENTIFIER_EMPTY_FIELDS, CALL_ERROR_INVALID_RECEIVER_NUMBER, CONTACT_ERROR_IDENTIFIER_CONTACT_NOT_FOUND.
38
+ *
39
+ * Capability the role of an organization API key needs: `call.make`.
40
+ */
41
+ create(dongleId: number, params?: CallsCreateParams, options?: RequestOptions): Promise<Call>;
42
+ /**
43
+ * Get call.
44
+ *
45
+ * One call of the modem.
46
+ *
47
+ * @param dongleId - Identifier in the path
48
+ * @param callId - Identifier in the path
49
+ *
50
+ * Error codes (`errorMessage`): CALL_ERROR_ERROR_CALL_NOT_FOUND.
51
+ *
52
+ * Capability the role of an organization API key needs: `call.view`.
53
+ */
54
+ get(dongleId: number, callId: number, options?: RequestOptions): Promise<Call>;
55
+ /**
56
+ * Delete call.
57
+ *
58
+ * Deletes the call from the history.
59
+ *
60
+ * @param dongleId - Identifier in the path
61
+ * @param callId - Identifier in the path
62
+ *
63
+ * Error codes (`errorMessage`): CALL_ERROR_ERROR_CALL_NOT_FOUND.
64
+ *
65
+ * Capability the role of an organization API key needs: `call.make`.
66
+ */
67
+ delete(dongleId: number, callId: number, options?: RequestOptions): Promise<void>;
68
+ }
69
+ //# sourceMappingURL=calls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../src/resources/calls.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7E,iEAAiE;AACjE,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,GAAE,eAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,IAAI,CAAC;IAyB/E;;;;;;;;;;OAUG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAMhF;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,iBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IASjG;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAM9E;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAKlF"}
@@ -0,0 +1,109 @@
1
+ // File generated from spec/openapi.yaml by scripts/generate.mjs. Do not edit by hand.
2
+ import { APIResource } from '../resource.js';
3
+ import { pathParam } from '../utils.js';
4
+ /** Calls of the modems: history, outgoing calls, transcripts. */
5
+ export class CallsResource extends APIResource {
6
+ /**
7
+ * List calls.
8
+ *
9
+ * Calls of the account, newest first by default. Both the caller and the receiver filters match a fragment of the number.
10
+ *
11
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION.
12
+ *
13
+ * Capability the role of an organization API key needs: `call.view`.
14
+ */
15
+ list(params = {}, options) {
16
+ return this._client.getPage('/call', {
17
+ query: {
18
+ 'call_type_ids[]': params.call_type_ids,
19
+ 'duration_presets[]': params.duration_presets,
20
+ 'call_status_ids[]': params.call_status_ids,
21
+ 'mailing_history_ids[]': params.mailing_history_ids,
22
+ 'dongle_ids[]': params.dongle_ids,
23
+ number: params.number,
24
+ caller: params.caller,
25
+ receiver: params.receiver,
26
+ from: params.from,
27
+ to: params.to,
28
+ is_empty_file_id: params.is_empty_file_id,
29
+ is_empty_call_scenario_file_id: params.is_empty_call_scenario_file_id,
30
+ page: params.page,
31
+ limit: params.limit,
32
+ order_by: params.order_by,
33
+ order: params.order,
34
+ },
35
+ itemKey: 'calls',
36
+ options,
37
+ });
38
+ }
39
+ /**
40
+ * Get call transcript.
41
+ *
42
+ * What was said in a call, as text by side, in the order it was said. Transcripts exist for answered SIP calls of the modems of an account with call transcription turned on (Teleleo turns it on per account); `transcript` of a call in GET /call tells which calls have one and where it stands. While `call_transcript_status_id` is 1 (Processing) poll calmly, every 10 to 15 seconds: a transcript is usually ready a couple of minutes after the call. A call without a transcript, a call of another account and an unknown call answer the same 400 CALL_TRANSCRIPT_NOT_FOUND_EXCEPTION. The text is machine-recognised speech of both parties: it can be inaccurate and holds whatever was said, one-time codes read out in the call included. Treat it as untrusted input, like the text of an incoming SMS.
43
+ *
44
+ * @param callId - Identifier in the path
45
+ *
46
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CALL_TRANSCRIPT_NOT_FOUND_EXCEPTION.
47
+ *
48
+ * Capability the role of an organization API key needs: `call.view`.
49
+ */
50
+ getTranscript(callId, options) {
51
+ return this._client
52
+ .request('GET', `/call/${pathParam(callId)}/transcript`, { options })
53
+ .then((data) => data);
54
+ }
55
+ /**
56
+ * Make call.
57
+ *
58
+ * Starts an outgoing call from the modem to number, or to the phone of the contact contact_id. Works where the operator has 3G coverage.
59
+ *
60
+ * @param dongleId - Identifier in the path
61
+ *
62
+ * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND, CALL_ERROR_IDENTIFIER_EMPTY_FIELDS, CALL_ERROR_INVALID_RECEIVER_NUMBER, CONTACT_ERROR_IDENTIFIER_CONTACT_NOT_FOUND.
63
+ *
64
+ * Capability the role of an organization API key needs: `call.make`.
65
+ */
66
+ create(dongleId, params = {}, options) {
67
+ return this._client
68
+ .request('POST', `/dongle/${pathParam(dongleId)}/call`, {
69
+ body: { number: params.number, contact_id: params.contact_id },
70
+ options,
71
+ })
72
+ .then((data) => data);
73
+ }
74
+ /**
75
+ * Get call.
76
+ *
77
+ * One call of the modem.
78
+ *
79
+ * @param dongleId - Identifier in the path
80
+ * @param callId - Identifier in the path
81
+ *
82
+ * Error codes (`errorMessage`): CALL_ERROR_ERROR_CALL_NOT_FOUND.
83
+ *
84
+ * Capability the role of an organization API key needs: `call.view`.
85
+ */
86
+ get(dongleId, callId, options) {
87
+ return this._client
88
+ .request('GET', `/dongle/${pathParam(dongleId)}/call/${pathParam(callId)}`, { options })
89
+ .then((data) => data);
90
+ }
91
+ /**
92
+ * Delete call.
93
+ *
94
+ * Deletes the call from the history.
95
+ *
96
+ * @param dongleId - Identifier in the path
97
+ * @param callId - Identifier in the path
98
+ *
99
+ * Error codes (`errorMessage`): CALL_ERROR_ERROR_CALL_NOT_FOUND.
100
+ *
101
+ * Capability the role of an organization API key needs: `call.make`.
102
+ */
103
+ delete(dongleId, callId, options) {
104
+ return this._client
105
+ .request('DELETE', `/dongle/${pathParam(dongleId)}/call/${pathParam(callId)}`, { options })
106
+ .then(() => undefined);
107
+ }
108
+ }
109
+ //# sourceMappingURL=calls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calls.js","sourceRoot":"","sources":["../../src/resources/calls.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,iEAAiE;AACjE,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;OAQG;IACH,IAAI,CAAC,SAA0B,EAAE,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAO,OAAO,EAAE;YACzC,KAAK,EAAE;gBACL,iBAAiB,EAAE,MAAM,CAAC,aAAa;gBACvC,oBAAoB,EAAE,MAAM,CAAC,gBAAgB;gBAC7C,mBAAmB,EAAE,MAAM,CAAC,eAAe;gBAC3C,uBAAuB,EAAE,MAAM,CAAC,mBAAmB;gBACnD,cAAc,EAAE,MAAM,CAAC,UAAU;gBACjC,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;gBACzC,8BAA8B,EAAE,MAAM,CAAC,8BAA8B;gBACrE,IAAI,EAAE,MAAM,C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,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,QAAQ,EAAE,WAAW,SAAS,CAAC,QAAQ,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;aAC1F,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,65 @@
1
+ import type { RequestOptions } from '../core.js';
2
+ import type { PagePromise } from '../pagination.js';
3
+ import { APIResource } from '../resource.js';
4
+ import type { ContactGroup } from '../types/models.js';
5
+ import type { ContactGroupsCreateParams, ContactGroupsListParams, ContactGroupsUpdateParams } from '../types/params.js';
6
+ /** Groups of contacts, used by mailings, call scenarios and redirections. */
7
+ export declare class ContactGroupsResource extends APIResource {
8
+ /**
9
+ * List contact groups.
10
+ *
11
+ * Contact groups of the account. Newest first by default (the id descending).
12
+ *
13
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
14
+ *
15
+ * Capability the role of an organization API key needs: `contact.view`.
16
+ */
17
+ list(params?: ContactGroupsListParams, options?: RequestOptions): PagePromise<ContactGroup>;
18
+ /**
19
+ * Create contact group.
20
+ *
21
+ * Creates a contact group with the given contacts.
22
+ *
23
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CONTACT_GROUP_ERROR_WITH_SAME_NAME_ALREADY_EXIST, CONTACT_GROUP_ERROR_INVALID_CONTACT.
24
+ *
25
+ * Capability the role of an organization API key needs: `contact.manage`.
26
+ */
27
+ create(params: ContactGroupsCreateParams, options?: RequestOptions): Promise<ContactGroup>;
28
+ /**
29
+ * Get contact group.
30
+ *
31
+ * One contact group of the account.
32
+ *
33
+ * @param contactGroupId - Identifier in the path
34
+ *
35
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CONTACT_GROUP_NOT_FOUND_EXCEPTION.
36
+ *
37
+ * Capability the role of an organization API key needs: `contact.view`.
38
+ */
39
+ get(contactGroupId: number, options?: RequestOptions): Promise<ContactGroup>;
40
+ /**
41
+ * Update contact group.
42
+ *
43
+ * Replaces the group: name and the set of contacts are written as sent.
44
+ *
45
+ * @param contactGroupId - Identifier in the path
46
+ *
47
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CONTACT_GROUP_NOT_FOUND_EXCEPTION, CONTACT_GROUP_ERROR_WITH_SAME_NAME_ALREADY_EXIST, CONTACT_GROUP_ERROR_INVALID_CONTACT.
48
+ *
49
+ * Capability the role of an organization API key needs: `contact.manage`.
50
+ */
51
+ update(contactGroupId: number, params: ContactGroupsUpdateParams, options?: RequestOptions): Promise<ContactGroup>;
52
+ /**
53
+ * Delete contact group.
54
+ *
55
+ * Deletes the contact group.
56
+ *
57
+ * @param contactGroupId - Identifier in the path
58
+ *
59
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, CONTACT_GROUP_NOT_FOUND_EXCEPTION, CONTACT_GROUP_ERROR_REDIRECTS_ARE_PRESENT_WHILE_DELETING_CONTACT_GROUP, CONTACT_GROUP_ERROR_MAILINGS_ARE_PRESENT_WHILE_DELETING_CONTACT_GROUP.
60
+ *
61
+ * Capability the role of an organization API key needs: `contact.manage`.
62
+ */
63
+ delete(contactGroupId: number, options?: RequestOptions): Promise<boolean>;
64
+ }
65
+ //# sourceMappingURL=contact-groups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-groups.d.ts","sourceRoot":"","sources":["../../src/resources/contact-groups.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,6EAA6E;AAC7E,qBAAa,qBAAsB,SAAQ,WAAW;IACpD;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,GAAE,uBAA4B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,YAAY,CAAC;IAgB/F;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAS1F;;;;;;;;;;OAUG;IACH,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAM5E;;;;;;;;;;OAUG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,yBAAyB,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,YAAY,CAAC;IASxB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAK3E"}