sendblue 3.7.0 → 3.9.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 (66) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +14 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +14 -0
  9. package/client.mjs.map +1 -1
  10. package/internal/utils/env.js +2 -2
  11. package/internal/utils/env.js.map +1 -1
  12. package/internal/utils/env.mjs +2 -2
  13. package/internal/utils/env.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/index.d.mts +1 -0
  16. package/resources/index.d.mts.map +1 -1
  17. package/resources/index.d.ts +1 -0
  18. package/resources/index.d.ts.map +1 -1
  19. package/resources/index.js +3 -1
  20. package/resources/index.js.map +1 -1
  21. package/resources/index.mjs +1 -0
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/lines/call-forwarding.d.mts +94 -0
  24. package/resources/lines/call-forwarding.d.mts.map +1 -0
  25. package/resources/lines/call-forwarding.d.ts +94 -0
  26. package/resources/lines/call-forwarding.d.ts.map +1 -0
  27. package/resources/lines/call-forwarding.js +65 -0
  28. package/resources/lines/call-forwarding.js.map +1 -0
  29. package/resources/lines/call-forwarding.mjs +61 -0
  30. package/resources/lines/call-forwarding.mjs.map +1 -0
  31. package/resources/lines/index.d.mts +3 -0
  32. package/resources/lines/index.d.mts.map +1 -0
  33. package/resources/lines/index.d.ts +3 -0
  34. package/resources/lines/index.d.ts.map +1 -0
  35. package/resources/lines/index.js +9 -0
  36. package/resources/lines/index.js.map +1 -0
  37. package/resources/lines/index.mjs +4 -0
  38. package/resources/lines/index.mjs.map +1 -0
  39. package/resources/lines/lines.d.mts +10 -0
  40. package/resources/lines/lines.d.mts.map +1 -0
  41. package/resources/lines/lines.d.ts +10 -0
  42. package/resources/lines/lines.d.ts.map +1 -0
  43. package/resources/lines/lines.js +17 -0
  44. package/resources/lines/lines.js.map +1 -0
  45. package/resources/lines/lines.mjs +12 -0
  46. package/resources/lines/lines.mjs.map +1 -0
  47. package/resources/lines.d.mts +2 -0
  48. package/resources/lines.d.mts.map +1 -0
  49. package/resources/lines.d.ts +2 -0
  50. package/resources/lines.d.ts.map +1 -0
  51. package/resources/lines.js +6 -0
  52. package/resources/lines.js.map +1 -0
  53. package/resources/lines.mjs +3 -0
  54. package/resources/lines.mjs.map +1 -0
  55. package/src/client.ts +17 -0
  56. package/src/internal/utils/env.ts +2 -2
  57. package/src/resources/index.ts +1 -0
  58. package/src/resources/lines/call-forwarding.ts +122 -0
  59. package/src/resources/lines/index.ts +10 -0
  60. package/src/resources/lines/lines.ts +27 -0
  61. package/src/resources/lines.ts +3 -0
  62. package/src/version.ts +1 -1
  63. package/version.d.mts +1 -1
  64. package/version.d.ts +1 -1
  65. package/version.js +1 -1
  66. package/version.mjs +1 -1
@@ -0,0 +1,122 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ export class CallForwarding extends APIResource {
9
+ /**
10
+ * Returns the current call forwarding number for a dedicated phone line.
11
+ *
12
+ * Per-line forwarding takes priority over the company default forwarding number
13
+ * but is overridden by seat-level forwarding when a seat has a forwarding number
14
+ * set.
15
+ *
16
+ * **Priority order:** seat forwarding → per-line forwarding → company default
17
+ * forwarding
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const callForwarding =
22
+ * await client.lines.callForwarding.retrieve(
23
+ * '+12125550101',
24
+ * );
25
+ * ```
26
+ */
27
+ retrieve(sendblueNumber: string, options?: RequestOptions): APIPromise<CallForwardingRetrieveResponse> {
28
+ return this._client.get(path`/api/lines/${sendblueNumber}/call-forwarding`, options);
29
+ }
30
+
31
+ /**
32
+ * Sets a call forwarding number for a specific dedicated phone line. Inbound calls
33
+ * to this line will be forwarded to the specified number.
34
+ *
35
+ * The `forwarding_number` is normalized to E.164 format before storage. US numbers
36
+ * can be supplied in local format (e.g. `2125550199`).
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const callForwarding =
41
+ * await client.lines.callForwarding.update('+12125550101', {
42
+ * forwarding_number: '+16692138010',
43
+ * });
44
+ * ```
45
+ */
46
+ update(
47
+ sendblueNumber: string,
48
+ body: CallForwardingUpdateParams,
49
+ options?: RequestOptions,
50
+ ): APIPromise<CallForwardingUpdateResponse> {
51
+ return this._client.put(path`/api/lines/${sendblueNumber}/call-forwarding`, { body, ...options });
52
+ }
53
+
54
+ /**
55
+ * Removes the per-line call forwarding number. After clearing, inbound calls will
56
+ * fall back to the company default forwarding number (if configured).
57
+ *
58
+ * This operation is idempotent — calling it on a line with no forwarding set
59
+ * returns 200 with `forwarding_number: null`.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const callForwarding =
64
+ * await client.lines.callForwarding.delete('+12125550101');
65
+ * ```
66
+ */
67
+ delete(sendblueNumber: string, options?: RequestOptions): APIPromise<CallForwardingDeleteResponse> {
68
+ return this._client.delete(path`/api/lines/${sendblueNumber}/call-forwarding`, options);
69
+ }
70
+ }
71
+
72
+ export interface CallForwardingRetrieveResponse {
73
+ /**
74
+ * The number calls are forwarded to, or null if not set
75
+ */
76
+ forwarding_number: string | null;
77
+
78
+ /**
79
+ * The Sendblue phone number (E.164)
80
+ */
81
+ sendblue_number: string;
82
+ }
83
+
84
+ export interface CallForwardingUpdateResponse {
85
+ /**
86
+ * The number calls are forwarded to, or null if not set
87
+ */
88
+ forwarding_number: string | null;
89
+
90
+ /**
91
+ * The Sendblue phone number (E.164)
92
+ */
93
+ sendblue_number: string;
94
+ }
95
+
96
+ export interface CallForwardingDeleteResponse {
97
+ /**
98
+ * The number calls are forwarded to, or null if not set
99
+ */
100
+ forwarding_number: string | null;
101
+
102
+ /**
103
+ * The Sendblue phone number (E.164)
104
+ */
105
+ sendblue_number: string;
106
+ }
107
+
108
+ export interface CallForwardingUpdateParams {
109
+ /**
110
+ * Phone number to forward calls to (E.164 or US local format)
111
+ */
112
+ forwarding_number: string;
113
+ }
114
+
115
+ export declare namespace CallForwarding {
116
+ export {
117
+ type CallForwardingRetrieveResponse as CallForwardingRetrieveResponse,
118
+ type CallForwardingUpdateResponse as CallForwardingUpdateResponse,
119
+ type CallForwardingDeleteResponse as CallForwardingDeleteResponse,
120
+ type CallForwardingUpdateParams as CallForwardingUpdateParams,
121
+ };
122
+ }
@@ -0,0 +1,10 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ CallForwarding,
5
+ type CallForwardingRetrieveResponse,
6
+ type CallForwardingUpdateResponse,
7
+ type CallForwardingDeleteResponse,
8
+ type CallForwardingUpdateParams,
9
+ } from './call-forwarding';
10
+ export { Lines } from './lines';
@@ -0,0 +1,27 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as CallForwardingAPI from './call-forwarding';
5
+ import {
6
+ CallForwarding,
7
+ CallForwardingDeleteResponse,
8
+ CallForwardingRetrieveResponse,
9
+ CallForwardingUpdateParams,
10
+ CallForwardingUpdateResponse,
11
+ } from './call-forwarding';
12
+
13
+ export class Lines extends APIResource {
14
+ callForwarding: CallForwardingAPI.CallForwarding = new CallForwardingAPI.CallForwarding(this._client);
15
+ }
16
+
17
+ Lines.CallForwarding = CallForwarding;
18
+
19
+ export declare namespace Lines {
20
+ export {
21
+ CallForwarding as CallForwarding,
22
+ type CallForwardingRetrieveResponse as CallForwardingRetrieveResponse,
23
+ type CallForwardingUpdateResponse as CallForwardingUpdateResponse,
24
+ type CallForwardingDeleteResponse as CallForwardingDeleteResponse,
25
+ type CallForwardingUpdateParams as CallForwardingUpdateParams,
26
+ };
27
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './lines/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '3.7.0'; // x-release-please-version
1
+ export const VERSION = '3.9.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.7.0";
1
+ export declare const VERSION = "3.9.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.7.0";
1
+ export declare const VERSION = "3.9.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '3.7.0'; // x-release-please-version
4
+ exports.VERSION = '3.9.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.7.0'; // x-release-please-version
1
+ export const VERSION = '3.9.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map