sendblue 3.7.0 → 3.8.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.
- package/CHANGELOG.md +16 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/lines/call-forwarding.d.mts +94 -0
- package/resources/lines/call-forwarding.d.mts.map +1 -0
- package/resources/lines/call-forwarding.d.ts +94 -0
- package/resources/lines/call-forwarding.d.ts.map +1 -0
- package/resources/lines/call-forwarding.js +65 -0
- package/resources/lines/call-forwarding.js.map +1 -0
- package/resources/lines/call-forwarding.mjs +61 -0
- package/resources/lines/call-forwarding.mjs.map +1 -0
- package/resources/lines/index.d.mts +3 -0
- package/resources/lines/index.d.mts.map +1 -0
- package/resources/lines/index.d.ts +3 -0
- package/resources/lines/index.d.ts.map +1 -0
- package/resources/lines/index.js +9 -0
- package/resources/lines/index.js.map +1 -0
- package/resources/lines/index.mjs +4 -0
- package/resources/lines/index.mjs.map +1 -0
- package/resources/lines/lines.d.mts +10 -0
- package/resources/lines/lines.d.mts.map +1 -0
- package/resources/lines/lines.d.ts +10 -0
- package/resources/lines/lines.d.ts.map +1 -0
- package/resources/lines/lines.js +17 -0
- package/resources/lines/lines.js.map +1 -0
- package/resources/lines/lines.mjs +12 -0
- package/resources/lines/lines.mjs.map +1 -0
- package/resources/lines.d.mts +2 -0
- package/resources/lines.d.mts.map +1 -0
- package/resources/lines.d.ts +2 -0
- package/resources/lines.d.ts.map +1 -0
- package/resources/lines.js +6 -0
- package/resources/lines.js.map +1 -0
- package/resources/lines.mjs +3 -0
- package/resources/lines.mjs.map +1 -0
- package/src/client.ts +5 -0
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/index.ts +1 -0
- package/src/resources/lines/call-forwarding.ts +122 -0
- package/src/resources/lines/index.ts +10 -0
- package/src/resources/lines/lines.ts +27 -0
- package/src/resources/lines.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
+
export declare class CallForwarding extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the current call forwarding number for a dedicated phone line.
|
|
7
|
+
*
|
|
8
|
+
* Per-line forwarding takes priority over the company default forwarding number
|
|
9
|
+
* but is overridden by seat-level forwarding when a seat has a forwarding number
|
|
10
|
+
* set.
|
|
11
|
+
*
|
|
12
|
+
* **Priority order:** seat forwarding → per-line forwarding → company default
|
|
13
|
+
* forwarding
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const callForwarding =
|
|
18
|
+
* await client.lines.callForwarding.retrieve(
|
|
19
|
+
* '+12125550101',
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
retrieve(sendblueNumber: string, options?: RequestOptions): APIPromise<CallForwardingRetrieveResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Sets a call forwarding number for a specific dedicated phone line. Inbound calls
|
|
26
|
+
* to this line will be forwarded to the specified number.
|
|
27
|
+
*
|
|
28
|
+
* The `forwarding_number` is normalized to E.164 format before storage. US numbers
|
|
29
|
+
* can be supplied in local format (e.g. `2125550199`).
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const callForwarding =
|
|
34
|
+
* await client.lines.callForwarding.update('+12125550101', {
|
|
35
|
+
* forwarding_number: '+16692138010',
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
update(sendblueNumber: string, body: CallForwardingUpdateParams, options?: RequestOptions): APIPromise<CallForwardingUpdateResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Removes the per-line call forwarding number. After clearing, inbound calls will
|
|
42
|
+
* fall back to the company default forwarding number (if configured).
|
|
43
|
+
*
|
|
44
|
+
* This operation is idempotent — calling it on a line with no forwarding set
|
|
45
|
+
* returns 200 with `forwarding_number: null`.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const callForwarding =
|
|
50
|
+
* await client.lines.callForwarding.delete('+12125550101');
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
delete(sendblueNumber: string, options?: RequestOptions): APIPromise<CallForwardingDeleteResponse>;
|
|
54
|
+
}
|
|
55
|
+
export interface CallForwardingRetrieveResponse {
|
|
56
|
+
/**
|
|
57
|
+
* The number calls are forwarded to, or null if not set
|
|
58
|
+
*/
|
|
59
|
+
forwarding_number: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* The Sendblue phone number (E.164)
|
|
62
|
+
*/
|
|
63
|
+
sendblue_number: string;
|
|
64
|
+
}
|
|
65
|
+
export interface CallForwardingUpdateResponse {
|
|
66
|
+
/**
|
|
67
|
+
* The number calls are forwarded to, or null if not set
|
|
68
|
+
*/
|
|
69
|
+
forwarding_number: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* The Sendblue phone number (E.164)
|
|
72
|
+
*/
|
|
73
|
+
sendblue_number: string;
|
|
74
|
+
}
|
|
75
|
+
export interface CallForwardingDeleteResponse {
|
|
76
|
+
/**
|
|
77
|
+
* The number calls are forwarded to, or null if not set
|
|
78
|
+
*/
|
|
79
|
+
forwarding_number: string | null;
|
|
80
|
+
/**
|
|
81
|
+
* The Sendblue phone number (E.164)
|
|
82
|
+
*/
|
|
83
|
+
sendblue_number: string;
|
|
84
|
+
}
|
|
85
|
+
export interface CallForwardingUpdateParams {
|
|
86
|
+
/**
|
|
87
|
+
* Phone number to forward calls to (E.164 or US local format)
|
|
88
|
+
*/
|
|
89
|
+
forwarding_number: string;
|
|
90
|
+
}
|
|
91
|
+
export declare namespace CallForwarding {
|
|
92
|
+
export { type CallForwardingRetrieveResponse as CallForwardingRetrieveResponse, type CallForwardingUpdateResponse as CallForwardingUpdateResponse, type CallForwardingDeleteResponse as CallForwardingDeleteResponse, type CallForwardingUpdateParams as CallForwardingUpdateParams, };
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=call-forwarding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-forwarding.d.ts","sourceRoot":"","sources":["../../src/resources/lines/call-forwarding.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,8BAA8B,CAAC;IAItG;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,4BAA4B,CAAC;IAI3C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;CAGnG;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CallForwarding = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
+
class CallForwarding extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the current call forwarding number for a dedicated phone line.
|
|
10
|
+
*
|
|
11
|
+
* Per-line forwarding takes priority over the company default forwarding number
|
|
12
|
+
* but is overridden by seat-level forwarding when a seat has a forwarding number
|
|
13
|
+
* set.
|
|
14
|
+
*
|
|
15
|
+
* **Priority order:** seat forwarding → per-line forwarding → company default
|
|
16
|
+
* forwarding
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const callForwarding =
|
|
21
|
+
* await client.lines.callForwarding.retrieve(
|
|
22
|
+
* '+12125550101',
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
retrieve(sendblueNumber, options) {
|
|
27
|
+
return this._client.get((0, path_1.path) `/api/lines/${sendblueNumber}/call-forwarding`, options);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Sets a call forwarding number for a specific dedicated phone line. Inbound calls
|
|
31
|
+
* to this line will be forwarded to the specified number.
|
|
32
|
+
*
|
|
33
|
+
* The `forwarding_number` is normalized to E.164 format before storage. US numbers
|
|
34
|
+
* can be supplied in local format (e.g. `2125550199`).
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const callForwarding =
|
|
39
|
+
* await client.lines.callForwarding.update('+12125550101', {
|
|
40
|
+
* forwarding_number: '+16692138010',
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
update(sendblueNumber, body, options) {
|
|
45
|
+
return this._client.put((0, path_1.path) `/api/lines/${sendblueNumber}/call-forwarding`, { body, ...options });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Removes the per-line call forwarding number. After clearing, inbound calls will
|
|
49
|
+
* fall back to the company default forwarding number (if configured).
|
|
50
|
+
*
|
|
51
|
+
* This operation is idempotent — calling it on a line with no forwarding set
|
|
52
|
+
* returns 200 with `forwarding_number: null`.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const callForwarding =
|
|
57
|
+
* await client.lines.callForwarding.delete('+12125550101');
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
delete(sendblueNumber, options) {
|
|
61
|
+
return this._client.delete((0, path_1.path) `/api/lines/${sendblueNumber}/call-forwarding`, options);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.CallForwarding = CallForwarding;
|
|
65
|
+
//# sourceMappingURL=call-forwarding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-forwarding.js","sourceRoot":"","sources":["../../src/resources/lines/call-forwarding.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,cAAc,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,cAAsB,EACtB,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,cAAc,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,cAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,cAAc,cAAc,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AA9DD,wCA8DC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
export class CallForwarding extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the current call forwarding number for a dedicated phone line.
|
|
7
|
+
*
|
|
8
|
+
* Per-line forwarding takes priority over the company default forwarding number
|
|
9
|
+
* but is overridden by seat-level forwarding when a seat has a forwarding number
|
|
10
|
+
* set.
|
|
11
|
+
*
|
|
12
|
+
* **Priority order:** seat forwarding → per-line forwarding → company default
|
|
13
|
+
* forwarding
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const callForwarding =
|
|
18
|
+
* await client.lines.callForwarding.retrieve(
|
|
19
|
+
* '+12125550101',
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
retrieve(sendblueNumber, options) {
|
|
24
|
+
return this._client.get(path `/api/lines/${sendblueNumber}/call-forwarding`, options);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sets a call forwarding number for a specific dedicated phone line. Inbound calls
|
|
28
|
+
* to this line will be forwarded to the specified number.
|
|
29
|
+
*
|
|
30
|
+
* The `forwarding_number` is normalized to E.164 format before storage. US numbers
|
|
31
|
+
* can be supplied in local format (e.g. `2125550199`).
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const callForwarding =
|
|
36
|
+
* await client.lines.callForwarding.update('+12125550101', {
|
|
37
|
+
* forwarding_number: '+16692138010',
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
update(sendblueNumber, body, options) {
|
|
42
|
+
return this._client.put(path `/api/lines/${sendblueNumber}/call-forwarding`, { body, ...options });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Removes the per-line call forwarding number. After clearing, inbound calls will
|
|
46
|
+
* fall back to the company default forwarding number (if configured).
|
|
47
|
+
*
|
|
48
|
+
* This operation is idempotent — calling it on a line with no forwarding set
|
|
49
|
+
* returns 200 with `forwarding_number: null`.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const callForwarding =
|
|
54
|
+
* await client.lines.callForwarding.delete('+12125550101');
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
delete(sendblueNumber, options) {
|
|
58
|
+
return this._client.delete(path `/api/lines/${sendblueNumber}/call-forwarding`, options);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=call-forwarding.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-forwarding.mjs","sourceRoot":"","sources":["../../src/resources/lines/call-forwarding.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,cAAc,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,cAAsB,EACtB,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,cAAc,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,cAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,cAAc,cAAc,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/lines/index.ts"],"names":[],"mappings":"OAEO,EACL,cAAc,EACd,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,GAChC;OACM,EAAE,KAAK,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/lines/index.ts"],"names":[],"mappings":"OAEO,EACL,cAAc,EACd,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,GAChC;OACM,EAAE,KAAK,EAAE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Lines = exports.CallForwarding = void 0;
|
|
5
|
+
var call_forwarding_1 = require("./call-forwarding.js");
|
|
6
|
+
Object.defineProperty(exports, "CallForwarding", { enumerable: true, get: function () { return call_forwarding_1.CallForwarding; } });
|
|
7
|
+
var lines_1 = require("./lines.js");
|
|
8
|
+
Object.defineProperty(exports, "Lines", { enumerable: true, get: function () { return lines_1.Lines; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/lines/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAM2B;AALzB,iHAAA,cAAc,OAAA;AAMhB,oCAAgC;AAAvB,8FAAA,KAAK,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/lines/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,cAAc,GAKf;OACM,EAAE,KAAK,EAAE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as CallForwardingAPI from "./call-forwarding.mjs";
|
|
3
|
+
import { CallForwarding, CallForwardingDeleteResponse, CallForwardingRetrieveResponse, CallForwardingUpdateParams, CallForwardingUpdateResponse } from "./call-forwarding.mjs";
|
|
4
|
+
export declare class Lines extends APIResource {
|
|
5
|
+
callForwarding: CallForwardingAPI.CallForwarding;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Lines {
|
|
8
|
+
export { CallForwarding as CallForwarding, type CallForwardingRetrieveResponse as CallForwardingRetrieveResponse, type CallForwardingUpdateResponse as CallForwardingUpdateResponse, type CallForwardingDeleteResponse as CallForwardingDeleteResponse, type CallForwardingUpdateParams as CallForwardingUpdateParams, };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=lines.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.mts","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,iBAAiB;OACtB,EACL,cAAc,EACd,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC7B;AAED,qBAAa,KAAM,SAAQ,WAAW;IACpC,cAAc,EAAE,iBAAiB,CAAC,cAAc,CAAsD;CACvG;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,cAAc,IAAI,cAAc,EAChC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as CallForwardingAPI from "./call-forwarding.js";
|
|
3
|
+
import { CallForwarding, CallForwardingDeleteResponse, CallForwardingRetrieveResponse, CallForwardingUpdateParams, CallForwardingUpdateResponse } from "./call-forwarding.js";
|
|
4
|
+
export declare class Lines extends APIResource {
|
|
5
|
+
callForwarding: CallForwardingAPI.CallForwarding;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Lines {
|
|
8
|
+
export { CallForwarding as CallForwarding, type CallForwardingRetrieveResponse as CallForwardingRetrieveResponse, type CallForwardingUpdateResponse as CallForwardingUpdateResponse, type CallForwardingDeleteResponse as CallForwardingDeleteResponse, type CallForwardingUpdateParams as CallForwardingUpdateParams, };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,iBAAiB;OACtB,EACL,cAAc,EACd,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC7B;AAED,qBAAa,KAAM,SAAQ,WAAW;IACpC,cAAc,EAAE,iBAAiB,CAAC,cAAc,CAAsD;CACvG;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,cAAc,IAAI,cAAc,EAChC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Lines = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const CallForwardingAPI = tslib_1.__importStar(require("./call-forwarding.js"));
|
|
8
|
+
const call_forwarding_1 = require("./call-forwarding.js");
|
|
9
|
+
class Lines extends resource_1.APIResource {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.callForwarding = new CallForwardingAPI.CallForwarding(this._client);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Lines = Lines;
|
|
16
|
+
Lines.CallForwarding = call_forwarding_1.CallForwarding;
|
|
17
|
+
//# sourceMappingURL=lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,gFAAuD;AACvD,0DAM2B;AAE3B,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxG,CAAC;CAAA;AAFD,sBAEC;AAED,KAAK,CAAC,cAAc,GAAG,gCAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as CallForwardingAPI from "./call-forwarding.mjs";
|
|
4
|
+
import { CallForwarding, } from "./call-forwarding.mjs";
|
|
5
|
+
export class Lines extends APIResource {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.callForwarding = new CallForwardingAPI.CallForwarding(this._client);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
Lines.CallForwarding = CallForwarding;
|
|
12
|
+
//# sourceMappingURL=lines.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.mjs","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,iBAAiB;OACtB,EACL,cAAc,GAKf;AAED,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxG,CAAC;CAAA;AAED,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.mts","sourceRoot":"","sources":["../src/resources/lines.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../src/resources/lines.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./lines/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../src/resources/lines.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.mjs","sourceRoot":"","sources":["../src/resources/lines.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
package/src/client.ts
CHANGED
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
ContactVerifyResponse,
|
|
65
65
|
Contacts,
|
|
66
66
|
} from './resources/contacts/contacts';
|
|
67
|
+
import { Lines } from './resources/lines/lines';
|
|
67
68
|
import { V2 } from './resources/v2/v2';
|
|
68
69
|
import { type Fetch } from './internal/builtin-types';
|
|
69
70
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
@@ -822,6 +823,7 @@ export class SendblueAPI {
|
|
|
822
823
|
*/
|
|
823
824
|
sendCarousel: API.SendCarousel = new API.SendCarousel(this);
|
|
824
825
|
v2: API.V2 = new API.V2(this);
|
|
826
|
+
lines: API.Lines = new API.Lines(this);
|
|
825
827
|
}
|
|
826
828
|
|
|
827
829
|
SendblueAPI.Messages = Messages;
|
|
@@ -833,6 +835,7 @@ SendblueAPI.Contacts = Contacts;
|
|
|
833
835
|
SendblueAPI.Webhooks = Webhooks;
|
|
834
836
|
SendblueAPI.SendCarousel = SendCarousel;
|
|
835
837
|
SendblueAPI.V2 = V2;
|
|
838
|
+
SendblueAPI.Lines = Lines;
|
|
836
839
|
|
|
837
840
|
export declare namespace SendblueAPI {
|
|
838
841
|
export type RequestOptions = Opts.RequestOptions;
|
|
@@ -910,4 +913,6 @@ export declare namespace SendblueAPI {
|
|
|
910
913
|
};
|
|
911
914
|
|
|
912
915
|
export { V2 as V2 };
|
|
916
|
+
|
|
917
|
+
export { Lines as Lines };
|
|
913
918
|
}
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const readEnv = (env: string): string | undefined => {
|
|
11
11
|
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim()
|
|
12
|
+
return (globalThis as any).process.env?.[env]?.trim() || undefined;
|
|
13
13
|
}
|
|
14
14
|
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
15
|
+
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
package/src/resources/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export {
|
|
|
23
23
|
type GroupModifyParams,
|
|
24
24
|
type GroupSendMessageParams,
|
|
25
25
|
} from './groups';
|
|
26
|
+
export { Lines } from './lines/lines';
|
|
26
27
|
export { Lookups, type LookupLookupNumberResponse, type LookupLookupNumberParams } from './lookups';
|
|
27
28
|
export { MediaObjects, type MediaObjectUploadResponse, type MediaObjectUploadParams } from './media-objects';
|
|
28
29
|
export {
|
|
@@ -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
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '3.
|
|
1
|
+
export const VERSION = '3.8.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.
|
|
1
|
+
export declare const VERSION = "3.8.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.
|
|
1
|
+
export declare const VERSION = "3.8.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '3.
|
|
1
|
+
export const VERSION = '3.8.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|