sendblue 3.10.0 → 3.11.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 +41 -0
- package/README.md +7 -7
- package/client.d.mts +37 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +37 -4
- package/client.d.ts.map +1 -1
- package/client.js +42 -1
- package/client.js.map +1 -1
- package/client.mjs +42 -1
- package/client.mjs.map +1 -1
- package/core/streaming.d.mts +33 -0
- package/core/streaming.d.mts.map +1 -0
- package/core/streaming.d.ts +33 -0
- package/core/streaming.d.ts.map +1 -0
- package/core/streaming.js +263 -0
- package/core/streaming.js.map +1 -0
- package/core/streaming.mjs +258 -0
- package/core/streaming.mjs.map +1 -0
- package/internal/decoders/line.d.mts +17 -0
- package/internal/decoders/line.d.mts.map +1 -0
- package/internal/decoders/line.d.ts +17 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +113 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +108 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +10 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +10 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +2 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +2 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +11 -1
- package/resources/auth/auth.d.mts +10 -0
- package/resources/auth/auth.d.mts.map +1 -0
- package/resources/auth/auth.d.ts +10 -0
- package/resources/auth/auth.d.ts.map +1 -0
- package/resources/auth/auth.js +17 -0
- package/resources/auth/auth.js.map +1 -0
- package/resources/auth/auth.mjs +12 -0
- package/resources/auth/auth.mjs.map +1 -0
- package/resources/auth/index.d.mts +3 -0
- package/resources/auth/index.d.mts.map +1 -0
- package/resources/auth/index.d.ts +3 -0
- package/resources/auth/index.d.ts.map +1 -0
- package/resources/auth/index.js +9 -0
- package/resources/auth/index.js.map +1 -0
- package/resources/auth/index.mjs +4 -0
- package/resources/auth/index.mjs.map +1 -0
- package/resources/auth/tokens.d.mts +77 -0
- package/resources/auth/tokens.d.mts.map +1 -0
- package/resources/auth/tokens.d.ts +77 -0
- package/resources/auth/tokens.d.ts.map +1 -0
- package/resources/auth/tokens.js +51 -0
- package/resources/auth/tokens.js.map +1 -0
- package/resources/auth/tokens.mjs +47 -0
- package/resources/auth/tokens.mjs.map +1 -0
- package/resources/auth.d.mts +2 -0
- package/resources/auth.d.mts.map +1 -0
- package/resources/auth.d.ts +2 -0
- package/resources/auth.d.ts.map +1 -0
- package/resources/auth.js +6 -0
- package/resources/auth.js.map +1 -0
- package/resources/auth.mjs +3 -0
- package/resources/auth.mjs.map +1 -0
- package/resources/contacts/contacts.d.mts +8 -0
- package/resources/contacts/contacts.d.mts.map +1 -1
- package/resources/contacts/contacts.d.ts +8 -0
- package/resources/contacts/contacts.d.ts.map +1 -1
- package/resources/contacts/contacts.js.map +1 -1
- package/resources/contacts/contacts.mjs.map +1 -1
- package/resources/events.d.mts +45 -0
- package/resources/events.d.mts.map +1 -0
- package/resources/events.d.ts +45 -0
- package/resources/events.d.ts.map +1 -0
- package/resources/events.js +37 -0
- package/resources/events.js.map +1 -0
- package/resources/events.mjs +33 -0
- package/resources/events.mjs.map +1 -0
- package/resources/groups.d.mts +25 -0
- package/resources/groups.d.mts.map +1 -1
- package/resources/groups.d.ts +25 -0
- package/resources/groups.d.ts.map +1 -1
- package/resources/index.d.mts +8 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +6 -0
- package/resources/index.mjs.map +1 -1
- package/resources/lines/call-forwarding.d.mts +3 -0
- package/resources/lines/call-forwarding.d.mts.map +1 -1
- package/resources/lines/call-forwarding.d.ts +3 -0
- package/resources/lines/call-forwarding.d.ts.map +1 -1
- package/resources/lines/call-forwarding.js +3 -0
- package/resources/lines/call-forwarding.js.map +1 -1
- package/resources/lines/call-forwarding.mjs +3 -0
- package/resources/lines/call-forwarding.mjs.map +1 -1
- package/resources/lines/index.d.mts +1 -1
- package/resources/lines/index.d.mts.map +1 -1
- package/resources/lines/index.d.ts +1 -1
- package/resources/lines/index.d.ts.map +1 -1
- package/resources/lines/index.js.map +1 -1
- package/resources/lines/index.mjs.map +1 -1
- package/resources/lines/lines.d.mts +30 -0
- package/resources/lines/lines.d.mts.map +1 -1
- package/resources/lines/lines.d.ts +30 -0
- package/resources/lines/lines.d.ts.map +1 -1
- package/resources/lines/lines.js +15 -0
- package/resources/lines/lines.js.map +1 -1
- package/resources/lines/lines.mjs +15 -0
- package/resources/lines/lines.mjs.map +1 -1
- package/resources/location.d.mts +156 -0
- package/resources/location.d.mts.map +1 -0
- package/resources/location.d.ts +156 -0
- package/resources/location.d.ts.map +1 -0
- package/resources/location.js +57 -0
- package/resources/location.js.map +1 -0
- package/resources/location.mjs +53 -0
- package/resources/location.mjs.map +1 -0
- package/resources/messages.d.mts +507 -9
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +507 -9
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +16 -2
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +16 -2
- package/resources/messages.mjs.map +1 -1
- package/resources/request-location.d.mts +54 -0
- package/resources/request-location.d.mts.map +1 -0
- package/resources/request-location.d.ts +54 -0
- package/resources/request-location.d.ts.map +1 -0
- package/resources/request-location.js +30 -0
- package/resources/request-location.js.map +1 -0
- package/resources/request-location.mjs +26 -0
- package/resources/request-location.mjs.map +1 -0
- package/resources/send-carousel.d.mts +67 -0
- package/resources/send-carousel.d.mts.map +1 -1
- package/resources/send-carousel.d.ts +67 -0
- package/resources/send-carousel.d.ts.map +1 -1
- package/resources/v2/groups.d.mts +82 -0
- package/resources/v2/groups.d.mts.map +1 -0
- package/resources/v2/groups.d.ts +82 -0
- package/resources/v2/groups.d.ts.map +1 -0
- package/resources/v2/groups.js +27 -0
- package/resources/v2/groups.js.map +1 -0
- package/resources/v2/groups.mjs +23 -0
- package/resources/v2/groups.mjs.map +1 -0
- package/resources/v2/index.d.mts +1 -0
- package/resources/v2/index.d.mts.map +1 -1
- package/resources/v2/index.d.ts +1 -0
- package/resources/v2/index.d.ts.map +1 -1
- package/resources/v2/index.js +3 -1
- package/resources/v2/index.js.map +1 -1
- package/resources/v2/index.mjs +1 -0
- package/resources/v2/index.mjs.map +1 -1
- package/resources/v2/v2.d.mts +4 -0
- package/resources/v2/v2.d.mts.map +1 -1
- package/resources/v2/v2.d.ts +4 -0
- package/resources/v2/v2.d.ts.map +1 -1
- package/resources/v2/v2.js +4 -0
- package/resources/v2/v2.js.map +1 -1
- package/resources/v2/v2.mjs +4 -0
- package/resources/v2/v2.mjs.map +1 -1
- package/resources/verified-contacts.d.mts +152 -0
- package/resources/verified-contacts.d.mts.map +1 -0
- package/resources/verified-contacts.d.ts +152 -0
- package/resources/verified-contacts.d.ts.map +1 -0
- package/resources/verified-contacts.js +56 -0
- package/resources/verified-contacts.js.map +1 -0
- package/resources/verified-contacts.mjs +52 -0
- package/resources/verified-contacts.mjs.map +1 -0
- package/resources/verify/index.d.mts +3 -0
- package/resources/verify/index.d.mts.map +1 -0
- package/resources/verify/index.d.ts +3 -0
- package/resources/verify/index.d.ts.map +1 -0
- package/resources/verify/index.js +9 -0
- package/resources/verify/index.js.map +1 -0
- package/resources/verify/index.mjs +4 -0
- package/resources/verify/index.mjs.map +1 -0
- package/resources/verify/verifications.d.mts +45 -0
- package/resources/verify/verifications.d.mts.map +1 -0
- package/resources/verify/verifications.d.ts +45 -0
- package/resources/verify/verifications.d.ts.map +1 -0
- package/resources/verify/verifications.js +19 -0
- package/resources/verify/verifications.js.map +1 -0
- package/resources/verify/verifications.mjs +15 -0
- package/resources/verify/verifications.mjs.map +1 -0
- package/resources/verify/verify.d.mts +10 -0
- package/resources/verify/verify.d.mts.map +1 -0
- package/resources/verify/verify.d.ts +10 -0
- package/resources/verify/verify.d.ts.map +1 -0
- package/resources/verify/verify.js +17 -0
- package/resources/verify/verify.js.map +1 -0
- package/resources/verify/verify.mjs +12 -0
- package/resources/verify/verify.mjs.map +1 -0
- package/resources/verify.d.mts +2 -0
- package/resources/verify.d.mts.map +1 -0
- package/resources/verify.d.ts +2 -0
- package/resources/verify.d.ts.map +1 -0
- package/resources/verify.js +6 -0
- package/resources/verify.js.map +1 -0
- package/resources/verify.mjs +3 -0
- package/resources/verify.mjs.map +1 -0
- package/resources/webhooks.d.mts +26 -10
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +26 -10
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +13 -2
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +13 -2
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +94 -3
- package/src/core/streaming.ts +319 -0
- package/src/internal/decoders/line.ts +135 -0
- package/src/internal/parse.ts +14 -0
- package/src/internal/request-options.ts +2 -0
- package/src/resources/auth/auth.ts +19 -0
- package/src/resources/auth/index.ts +4 -0
- package/src/resources/auth/tokens.ts +101 -0
- package/src/resources/auth.ts +3 -0
- package/src/resources/contacts/contacts.ts +10 -0
- package/src/resources/events.ts +75 -0
- package/src/resources/groups.ts +28 -0
- package/src/resources/index.ts +26 -1
- package/src/resources/lines/call-forwarding.ts +3 -0
- package/src/resources/lines/index.ts +1 -1
- package/src/resources/lines/lines.ts +44 -0
- package/src/resources/location.ts +237 -0
- package/src/resources/messages.ts +634 -9
- package/src/resources/request-location.ts +72 -0
- package/src/resources/send-carousel.ts +76 -0
- package/src/resources/v2/groups.ts +106 -0
- package/src/resources/v2/index.ts +1 -0
- package/src/resources/v2/v2.ts +6 -0
- package/src/resources/verified-contacts.ts +204 -0
- package/src/resources/verify/index.ts +9 -0
- package/src/resources/verify/verifications.ts +75 -0
- package/src/resources/verify/verify.ts +25 -0
- package/src/resources/verify.ts +3 -0
- package/src/resources/webhooks.ts +27 -10
- package/src/streaming.ts +2 -0
- package/src/version.ts +1 -1
- package/streaming.d.mts +3 -0
- package/streaming.d.mts.map +1 -0
- package/streaming.d.ts +3 -0
- package/streaming.d.ts.map +1 -0
- package/streaming.js +6 -0
- package/streaming.js.map +1 -0
- package/streaming.mjs +3 -0
- package/streaming.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
2
|
import * as CallForwardingAPI from "./call-forwarding.mjs";
|
|
3
3
|
import { CallForwarding, CallForwardingDeleteResponse, CallForwardingRetrieveResponse, CallForwardingUpdateParams, CallForwardingUpdateResponse } from "./call-forwarding.mjs";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Sendblue line configuration and health state
|
|
8
|
+
*/
|
|
4
9
|
export declare class Lines extends APIResource {
|
|
5
10
|
callForwarding: CallForwardingAPI.CallForwarding;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the authenticated account's current line membership and latest persisted
|
|
13
|
+
* health transition.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response = await client.lines.getState();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
getState(options?: RequestOptions): APIPromise<LineGetStateResponse>;
|
|
21
|
+
}
|
|
22
|
+
export interface LineState {
|
|
23
|
+
assignment: 'assigned' | 'shared' | 'grace_period';
|
|
24
|
+
sendblue_number: string | null;
|
|
25
|
+
status: 'ONLINE' | 'OFFLINE' | 'DEGRADED' | 'UNKNOWN';
|
|
26
|
+
worker_id: string;
|
|
27
|
+
degraded_since?: string | null;
|
|
28
|
+
effective_until?: string | null;
|
|
29
|
+
status_changed_at?: string | null;
|
|
30
|
+
}
|
|
31
|
+
export interface LineGetStateResponse {
|
|
32
|
+
data: Array<LineState>;
|
|
33
|
+
snapshot_at: string;
|
|
34
|
+
status: 'OK';
|
|
6
35
|
}
|
|
7
36
|
export declare namespace Lines {
|
|
37
|
+
export { type LineState as LineState, type LineGetStateResponse as LineGetStateResponse };
|
|
8
38
|
export { CallForwarding as CallForwarding, type CallForwardingRetrieveResponse as CallForwardingRetrieveResponse, type CallForwardingUpdateResponse as CallForwardingUpdateResponse, type CallForwardingDeleteResponse as CallForwardingDeleteResponse, type CallForwardingUpdateParams as CallForwardingUpdateParams, };
|
|
9
39
|
}
|
|
10
40
|
//# sourceMappingURL=lines.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lines.d.mts","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC7B,8BAA0B;
|
|
1
|
+
{"version":3,"file":"lines.d.mts","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC7B,8BAA0B;AAC3B,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC,cAAc,EAAE,iBAAiB,CAAC,cAAc,CAAsD;IAEtG;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAGrE;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,UAAU,GAAG,QAAQ,GAAG,cAAc,CAAC;IAEnD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAEtD,SAAS,EAAE,MAAM,CAAC;IAElB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAEvB,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,IAAI,CAAC;CACd;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,SAAS,IAAI,SAAS,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;IAE1F,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"}
|
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import * as CallForwardingAPI from "./call-forwarding.js";
|
|
3
3
|
import { CallForwarding, CallForwardingDeleteResponse, CallForwardingRetrieveResponse, CallForwardingUpdateParams, CallForwardingUpdateResponse } from "./call-forwarding.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
6
|
+
/**
|
|
7
|
+
* Sendblue line configuration and health state
|
|
8
|
+
*/
|
|
4
9
|
export declare class Lines extends APIResource {
|
|
5
10
|
callForwarding: CallForwardingAPI.CallForwarding;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the authenticated account's current line membership and latest persisted
|
|
13
|
+
* health transition.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response = await client.lines.getState();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
getState(options?: RequestOptions): APIPromise<LineGetStateResponse>;
|
|
21
|
+
}
|
|
22
|
+
export interface LineState {
|
|
23
|
+
assignment: 'assigned' | 'shared' | 'grace_period';
|
|
24
|
+
sendblue_number: string | null;
|
|
25
|
+
status: 'ONLINE' | 'OFFLINE' | 'DEGRADED' | 'UNKNOWN';
|
|
26
|
+
worker_id: string;
|
|
27
|
+
degraded_since?: string | null;
|
|
28
|
+
effective_until?: string | null;
|
|
29
|
+
status_changed_at?: string | null;
|
|
30
|
+
}
|
|
31
|
+
export interface LineGetStateResponse {
|
|
32
|
+
data: Array<LineState>;
|
|
33
|
+
snapshot_at: string;
|
|
34
|
+
status: 'OK';
|
|
6
35
|
}
|
|
7
36
|
export declare namespace Lines {
|
|
37
|
+
export { type LineState as LineState, type LineGetStateResponse as LineGetStateResponse };
|
|
8
38
|
export { CallForwarding as CallForwarding, type CallForwardingRetrieveResponse as CallForwardingRetrieveResponse, type CallForwardingUpdateResponse as CallForwardingUpdateResponse, type CallForwardingDeleteResponse as CallForwardingDeleteResponse, type CallForwardingUpdateParams as CallForwardingUpdateParams, };
|
|
9
39
|
}
|
|
10
40
|
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;A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,EAAE,KAAK,SAAS,IAAI,SAAS,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;IAE1F,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"}
|
package/resources/lines/lines.js
CHANGED
|
@@ -6,11 +6,26 @@ const tslib_1 = require("../../internal/tslib.js");
|
|
|
6
6
|
const resource_1 = require("../../core/resource.js");
|
|
7
7
|
const CallForwardingAPI = tslib_1.__importStar(require("./call-forwarding.js"));
|
|
8
8
|
const call_forwarding_1 = require("./call-forwarding.js");
|
|
9
|
+
/**
|
|
10
|
+
* Sendblue line configuration and health state
|
|
11
|
+
*/
|
|
9
12
|
class Lines extends resource_1.APIResource {
|
|
10
13
|
constructor() {
|
|
11
14
|
super(...arguments);
|
|
12
15
|
this.callForwarding = new CallForwardingAPI.CallForwarding(this._client);
|
|
13
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns the authenticated account's current line membership and latest persisted
|
|
19
|
+
* health transition.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const response = await client.lines.getState();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
getState(options) {
|
|
27
|
+
return this._client.get('/api/v2/lines/state', options);
|
|
28
|
+
}
|
|
14
29
|
}
|
|
15
30
|
exports.Lines = Lines;
|
|
16
31
|
Lines.CallForwarding = call_forwarding_1.CallForwarding;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,gFAAuD;AACvD,0DAM2B;
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,gFAAuD;AACvD,0DAM2B;AAI3B;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAcxG,CAAC;IAZC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AAfD,sBAeC;AA0BD,KAAK,CAAC,cAAc,GAAG,gCAAc,CAAC"}
|
|
@@ -2,11 +2,26 @@
|
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
3
|
import * as CallForwardingAPI from "./call-forwarding.mjs";
|
|
4
4
|
import { CallForwarding, } from "./call-forwarding.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Sendblue line configuration and health state
|
|
7
|
+
*/
|
|
5
8
|
export class Lines extends APIResource {
|
|
6
9
|
constructor() {
|
|
7
10
|
super(...arguments);
|
|
8
11
|
this.callForwarding = new CallForwardingAPI.CallForwarding(this._client);
|
|
9
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns the authenticated account's current line membership and latest persisted
|
|
15
|
+
* health transition.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const response = await client.lines.getState();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
getState(options) {
|
|
23
|
+
return this._client.get('/api/v2/lines/state', options);
|
|
24
|
+
}
|
|
10
25
|
}
|
|
11
26
|
Lines.CallForwarding = CallForwarding;
|
|
12
27
|
//# sourceMappingURL=lines.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lines.mjs","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EACL,cAAc,GAKf,8BAA0B;
|
|
1
|
+
{"version":3,"file":"lines.mjs","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EACL,cAAc,GAKf,8BAA0B;AAI3B;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAcxG,CAAC;IAZC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AA0BD,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { Stream } from "../core/streaming.mjs";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Operations for sending and managing messages
|
|
7
|
+
*/
|
|
8
|
+
export declare class Location extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Read the current Find My location for one contact if that contact already shares
|
|
11
|
+
* with a dedicated Mac-backed Sendblue number. Shared lines cannot use this
|
|
12
|
+
* endpoint.
|
|
13
|
+
*/
|
|
14
|
+
retrieve(number: string, query: LocationRetrieveParams, options?: RequestOptions): APIPromise<LocationRetrieveResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Read the current Find My locations already shared with a dedicated Mac-backed
|
|
17
|
+
* Sendblue number. Shared lines cannot use this endpoint.
|
|
18
|
+
*/
|
|
19
|
+
list(query: LocationListParams, options?: RequestOptions): APIPromise<LocationListResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Open a Server-Sent Events (SSE) stream for live Find My updates from one contact
|
|
22
|
+
* sharing with a dedicated Mac-backed Sendblue number. Shared lines cannot use
|
|
23
|
+
* this endpoint.
|
|
24
|
+
*
|
|
25
|
+
* The stream has no client-visible duration. It remains open while the client is
|
|
26
|
+
* connected, authorized, and the worker is available. Comment heartbeats are sent
|
|
27
|
+
* every 15 seconds. Clients should reconnect with their normal credentials after a
|
|
28
|
+
* network interruption or a `worker_disconnected` completion. Location events are
|
|
29
|
+
* live-only and may repeat across internal native-watch renewals.
|
|
30
|
+
*
|
|
31
|
+
* Named events and their JSON `data` payloads:
|
|
32
|
+
*
|
|
33
|
+
* - `ready`: the native watch is active.
|
|
34
|
+
* - `location`: a location state or fix.
|
|
35
|
+
* - `complete`: the watch ended normally. Known reasons are `sharing_ended`,
|
|
36
|
+
* `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
|
|
37
|
+
* should tolerate additional completion reasons.
|
|
38
|
+
* - `error`: the watch failed after the SSE response started.
|
|
39
|
+
*/
|
|
40
|
+
watch(number: string, query: LocationWatchParams, options?: RequestOptions): APIPromise<Stream<LocationWatchResponse>>;
|
|
41
|
+
}
|
|
42
|
+
export interface LocationRetrieveResponse {
|
|
43
|
+
from_number?: string;
|
|
44
|
+
location?: LocationRetrieveResponse.Location;
|
|
45
|
+
number?: string;
|
|
46
|
+
state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
|
|
47
|
+
status?: 'OK';
|
|
48
|
+
}
|
|
49
|
+
export declare namespace LocationRetrieveResponse {
|
|
50
|
+
interface Location {
|
|
51
|
+
accuracy?: number;
|
|
52
|
+
address?: string | null;
|
|
53
|
+
altitude?: number;
|
|
54
|
+
expiresAt?: string;
|
|
55
|
+
latitude?: number;
|
|
56
|
+
locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
|
|
57
|
+
longitude?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Present when cached data is returned after a refresh error
|
|
60
|
+
*/
|
|
61
|
+
refreshError?: string;
|
|
62
|
+
timestamp?: string;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export interface LocationListResponse {
|
|
66
|
+
from_number?: string;
|
|
67
|
+
locations?: Array<LocationListResponse.Location>;
|
|
68
|
+
status?: 'OK';
|
|
69
|
+
}
|
|
70
|
+
export declare namespace LocationListResponse {
|
|
71
|
+
interface Location {
|
|
72
|
+
location?: Location.Location;
|
|
73
|
+
number?: string;
|
|
74
|
+
state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
|
|
75
|
+
}
|
|
76
|
+
namespace Location {
|
|
77
|
+
interface Location {
|
|
78
|
+
accuracy?: number;
|
|
79
|
+
address?: string | null;
|
|
80
|
+
altitude?: number;
|
|
81
|
+
expiresAt?: string;
|
|
82
|
+
latitude?: number;
|
|
83
|
+
locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
|
|
84
|
+
longitude?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Present when cached data is returned after a refresh error
|
|
87
|
+
*/
|
|
88
|
+
refreshError?: string;
|
|
89
|
+
timestamp?: string;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* JSON data payload from one named event in a live-location SSE stream
|
|
95
|
+
*/
|
|
96
|
+
export interface LocationWatchResponse {
|
|
97
|
+
/**
|
|
98
|
+
* Sendblue line receiving the shared location
|
|
99
|
+
*/
|
|
100
|
+
from_number?: string;
|
|
101
|
+
location?: LocationWatchResponse.Location;
|
|
102
|
+
/**
|
|
103
|
+
* Human-readable watch failure
|
|
104
|
+
*/
|
|
105
|
+
message?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Contact whose location is being watched or changed
|
|
108
|
+
*/
|
|
109
|
+
number?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Why the stream ended normally. Known values are `sharing_ended`,
|
|
112
|
+
* `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
|
|
113
|
+
* should tolerate additional values.
|
|
114
|
+
*/
|
|
115
|
+
reason?: string;
|
|
116
|
+
state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
|
|
117
|
+
status?: 'OK' | 'ERROR';
|
|
118
|
+
}
|
|
119
|
+
export declare namespace LocationWatchResponse {
|
|
120
|
+
interface Location {
|
|
121
|
+
accuracy?: number;
|
|
122
|
+
address?: string | null;
|
|
123
|
+
altitude?: number;
|
|
124
|
+
expiresAt?: string;
|
|
125
|
+
latitude?: number;
|
|
126
|
+
locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
|
|
127
|
+
longitude?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Present when cached data is returned after a refresh error
|
|
130
|
+
*/
|
|
131
|
+
refreshError?: string;
|
|
132
|
+
timestamp?: string;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export interface LocationRetrieveParams {
|
|
136
|
+
/**
|
|
137
|
+
* Your Sendblue number in E.164 format
|
|
138
|
+
*/
|
|
139
|
+
from_number: string;
|
|
140
|
+
}
|
|
141
|
+
export interface LocationListParams {
|
|
142
|
+
/**
|
|
143
|
+
* Your Sendblue number in E.164 format
|
|
144
|
+
*/
|
|
145
|
+
from_number: string;
|
|
146
|
+
}
|
|
147
|
+
export interface LocationWatchParams {
|
|
148
|
+
/**
|
|
149
|
+
* Your supported Sendblue number in E.164 format
|
|
150
|
+
*/
|
|
151
|
+
from_number: string;
|
|
152
|
+
}
|
|
153
|
+
export declare namespace Location {
|
|
154
|
+
export { type LocationRetrieveResponse as LocationRetrieveResponse, type LocationListResponse as LocationListResponse, type LocationWatchResponse as LocationWatchResponse, type LocationRetrieveParams as LocationRetrieveParams, type LocationListParams as LocationListParams, type LocationWatchParams as LocationWatchParams, };
|
|
155
|
+
}
|
|
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
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { Stream } from "../core/streaming.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Operations for sending and managing messages
|
|
7
|
+
*/
|
|
8
|
+
export declare class Location extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Read the current Find My location for one contact if that contact already shares
|
|
11
|
+
* with a dedicated Mac-backed Sendblue number. Shared lines cannot use this
|
|
12
|
+
* endpoint.
|
|
13
|
+
*/
|
|
14
|
+
retrieve(number: string, query: LocationRetrieveParams, options?: RequestOptions): APIPromise<LocationRetrieveResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Read the current Find My locations already shared with a dedicated Mac-backed
|
|
17
|
+
* Sendblue number. Shared lines cannot use this endpoint.
|
|
18
|
+
*/
|
|
19
|
+
list(query: LocationListParams, options?: RequestOptions): APIPromise<LocationListResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Open a Server-Sent Events (SSE) stream for live Find My updates from one contact
|
|
22
|
+
* sharing with a dedicated Mac-backed Sendblue number. Shared lines cannot use
|
|
23
|
+
* this endpoint.
|
|
24
|
+
*
|
|
25
|
+
* The stream has no client-visible duration. It remains open while the client is
|
|
26
|
+
* connected, authorized, and the worker is available. Comment heartbeats are sent
|
|
27
|
+
* every 15 seconds. Clients should reconnect with their normal credentials after a
|
|
28
|
+
* network interruption or a `worker_disconnected` completion. Location events are
|
|
29
|
+
* live-only and may repeat across internal native-watch renewals.
|
|
30
|
+
*
|
|
31
|
+
* Named events and their JSON `data` payloads:
|
|
32
|
+
*
|
|
33
|
+
* - `ready`: the native watch is active.
|
|
34
|
+
* - `location`: a location state or fix.
|
|
35
|
+
* - `complete`: the watch ended normally. Known reasons are `sharing_ended`,
|
|
36
|
+
* `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
|
|
37
|
+
* should tolerate additional completion reasons.
|
|
38
|
+
* - `error`: the watch failed after the SSE response started.
|
|
39
|
+
*/
|
|
40
|
+
watch(number: string, query: LocationWatchParams, options?: RequestOptions): APIPromise<Stream<LocationWatchResponse>>;
|
|
41
|
+
}
|
|
42
|
+
export interface LocationRetrieveResponse {
|
|
43
|
+
from_number?: string;
|
|
44
|
+
location?: LocationRetrieveResponse.Location;
|
|
45
|
+
number?: string;
|
|
46
|
+
state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
|
|
47
|
+
status?: 'OK';
|
|
48
|
+
}
|
|
49
|
+
export declare namespace LocationRetrieveResponse {
|
|
50
|
+
interface Location {
|
|
51
|
+
accuracy?: number;
|
|
52
|
+
address?: string | null;
|
|
53
|
+
altitude?: number;
|
|
54
|
+
expiresAt?: string;
|
|
55
|
+
latitude?: number;
|
|
56
|
+
locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
|
|
57
|
+
longitude?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Present when cached data is returned after a refresh error
|
|
60
|
+
*/
|
|
61
|
+
refreshError?: string;
|
|
62
|
+
timestamp?: string;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export interface LocationListResponse {
|
|
66
|
+
from_number?: string;
|
|
67
|
+
locations?: Array<LocationListResponse.Location>;
|
|
68
|
+
status?: 'OK';
|
|
69
|
+
}
|
|
70
|
+
export declare namespace LocationListResponse {
|
|
71
|
+
interface Location {
|
|
72
|
+
location?: Location.Location;
|
|
73
|
+
number?: string;
|
|
74
|
+
state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
|
|
75
|
+
}
|
|
76
|
+
namespace Location {
|
|
77
|
+
interface Location {
|
|
78
|
+
accuracy?: number;
|
|
79
|
+
address?: string | null;
|
|
80
|
+
altitude?: number;
|
|
81
|
+
expiresAt?: string;
|
|
82
|
+
latitude?: number;
|
|
83
|
+
locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
|
|
84
|
+
longitude?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Present when cached data is returned after a refresh error
|
|
87
|
+
*/
|
|
88
|
+
refreshError?: string;
|
|
89
|
+
timestamp?: string;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* JSON data payload from one named event in a live-location SSE stream
|
|
95
|
+
*/
|
|
96
|
+
export interface LocationWatchResponse {
|
|
97
|
+
/**
|
|
98
|
+
* Sendblue line receiving the shared location
|
|
99
|
+
*/
|
|
100
|
+
from_number?: string;
|
|
101
|
+
location?: LocationWatchResponse.Location;
|
|
102
|
+
/**
|
|
103
|
+
* Human-readable watch failure
|
|
104
|
+
*/
|
|
105
|
+
message?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Contact whose location is being watched or changed
|
|
108
|
+
*/
|
|
109
|
+
number?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Why the stream ended normally. Known values are `sharing_ended`,
|
|
112
|
+
* `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
|
|
113
|
+
* should tolerate additional values.
|
|
114
|
+
*/
|
|
115
|
+
reason?: string;
|
|
116
|
+
state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
|
|
117
|
+
status?: 'OK' | 'ERROR';
|
|
118
|
+
}
|
|
119
|
+
export declare namespace LocationWatchResponse {
|
|
120
|
+
interface Location {
|
|
121
|
+
accuracy?: number;
|
|
122
|
+
address?: string | null;
|
|
123
|
+
altitude?: number;
|
|
124
|
+
expiresAt?: string;
|
|
125
|
+
latitude?: number;
|
|
126
|
+
locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
|
|
127
|
+
longitude?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Present when cached data is returned after a refresh error
|
|
130
|
+
*/
|
|
131
|
+
refreshError?: string;
|
|
132
|
+
timestamp?: string;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export interface LocationRetrieveParams {
|
|
136
|
+
/**
|
|
137
|
+
* Your Sendblue number in E.164 format
|
|
138
|
+
*/
|
|
139
|
+
from_number: string;
|
|
140
|
+
}
|
|
141
|
+
export interface LocationListParams {
|
|
142
|
+
/**
|
|
143
|
+
* Your Sendblue number in E.164 format
|
|
144
|
+
*/
|
|
145
|
+
from_number: string;
|
|
146
|
+
}
|
|
147
|
+
export interface LocationWatchParams {
|
|
148
|
+
/**
|
|
149
|
+
* Your supported Sendblue number in E.164 format
|
|
150
|
+
*/
|
|
151
|
+
from_number: string;
|
|
152
|
+
}
|
|
153
|
+
export declare namespace Location {
|
|
154
|
+
export { type LocationRetrieveResponse as LocationRetrieveResponse, type LocationListResponse as LocationListResponse, type LocationWatchResponse as LocationWatchResponse, type LocationRetrieveParams as LocationRetrieveParams, type LocationListParams as LocationListParams, type LocationWatchParams as LocationWatchParams, };
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../src/resources/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,MAAM,EAAE,6BAA0B;AAE3C,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;OAIG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,sBAAsB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI3F;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CACH,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,mBAAmB,EAC1B,OAAO,CAAC,E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AAM,CAAC;KACpB;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.Location = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const headers_1 = require("../internal/headers.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* Operations for sending and managing messages
|
|
10
|
+
*/
|
|
11
|
+
class Location extends resource_1.APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Read the current Find My location for one contact if that contact already shares
|
|
14
|
+
* with a dedicated Mac-backed Sendblue number. Shared lines cannot use this
|
|
15
|
+
* endpoint.
|
|
16
|
+
*/
|
|
17
|
+
retrieve(number, query, options) {
|
|
18
|
+
return this._client.get((0, path_1.path) `/api/location/${number}`, { query, ...options });
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Read the current Find My locations already shared with a dedicated Mac-backed
|
|
22
|
+
* Sendblue number. Shared lines cannot use this endpoint.
|
|
23
|
+
*/
|
|
24
|
+
list(query, options) {
|
|
25
|
+
return this._client.get('/api/location', { query, ...options });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Open a Server-Sent Events (SSE) stream for live Find My updates from one contact
|
|
29
|
+
* sharing with a dedicated Mac-backed Sendblue number. Shared lines cannot use
|
|
30
|
+
* this endpoint.
|
|
31
|
+
*
|
|
32
|
+
* The stream has no client-visible duration. It remains open while the client is
|
|
33
|
+
* connected, authorized, and the worker is available. Comment heartbeats are sent
|
|
34
|
+
* every 15 seconds. Clients should reconnect with their normal credentials after a
|
|
35
|
+
* network interruption or a `worker_disconnected` completion. Location events are
|
|
36
|
+
* live-only and may repeat across internal native-watch renewals.
|
|
37
|
+
*
|
|
38
|
+
* Named events and their JSON `data` payloads:
|
|
39
|
+
*
|
|
40
|
+
* - `ready`: the native watch is active.
|
|
41
|
+
* - `location`: a location state or fix.
|
|
42
|
+
* - `complete`: the watch ended normally. Known reasons are `sharing_ended`,
|
|
43
|
+
* `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
|
|
44
|
+
* should tolerate additional completion reasons.
|
|
45
|
+
* - `error`: the watch failed after the SSE response started.
|
|
46
|
+
*/
|
|
47
|
+
watch(number, query, options) {
|
|
48
|
+
return this._client.get((0, path_1.path) `/api/location/${number}/watch`, {
|
|
49
|
+
query,
|
|
50
|
+
...options,
|
|
51
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
52
|
+
stream: true,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.Location = Location;
|
|
57
|
+
//# sourceMappingURL=location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../src/resources/location.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;GAEG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;OAIG;IACH,QAAQ,CACN,MAAc,EACd,KAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,KAAyB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CACH,MAAc,EACd,KAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,MAAM,QAAQ,EAAE;YAC3D,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAA8C,CAAC;IAClD,CAAC;CACF;AAtDD,4BAsDC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Operations for sending and managing messages
|
|
7
|
+
*/
|
|
8
|
+
export class Location extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Read the current Find My location for one contact if that contact already shares
|
|
11
|
+
* with a dedicated Mac-backed Sendblue number. Shared lines cannot use this
|
|
12
|
+
* endpoint.
|
|
13
|
+
*/
|
|
14
|
+
retrieve(number, query, options) {
|
|
15
|
+
return this._client.get(path `/api/location/${number}`, { query, ...options });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Read the current Find My locations already shared with a dedicated Mac-backed
|
|
19
|
+
* Sendblue number. Shared lines cannot use this endpoint.
|
|
20
|
+
*/
|
|
21
|
+
list(query, options) {
|
|
22
|
+
return this._client.get('/api/location', { query, ...options });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Open a Server-Sent Events (SSE) stream for live Find My updates from one contact
|
|
26
|
+
* sharing with a dedicated Mac-backed Sendblue number. Shared lines cannot use
|
|
27
|
+
* this endpoint.
|
|
28
|
+
*
|
|
29
|
+
* The stream has no client-visible duration. It remains open while the client is
|
|
30
|
+
* connected, authorized, and the worker is available. Comment heartbeats are sent
|
|
31
|
+
* every 15 seconds. Clients should reconnect with their normal credentials after a
|
|
32
|
+
* network interruption or a `worker_disconnected` completion. Location events are
|
|
33
|
+
* live-only and may repeat across internal native-watch renewals.
|
|
34
|
+
*
|
|
35
|
+
* Named events and their JSON `data` payloads:
|
|
36
|
+
*
|
|
37
|
+
* - `ready`: the native watch is active.
|
|
38
|
+
* - `location`: a location state or fix.
|
|
39
|
+
* - `complete`: the watch ended normally. Known reasons are `sharing_ended`,
|
|
40
|
+
* `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
|
|
41
|
+
* should tolerate additional completion reasons.
|
|
42
|
+
* - `error`: the watch failed after the SSE response started.
|
|
43
|
+
*/
|
|
44
|
+
watch(number, query, options) {
|
|
45
|
+
return this._client.get(path `/api/location/${number}/watch`, {
|
|
46
|
+
query,
|
|
47
|
+
...options,
|
|
48
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
49
|
+
stream: true,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=location.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.mjs","sourceRoot":"","sources":["../src/resources/location.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;OAIG;IACH,QAAQ,CACN,MAAc,EACd,KAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,KAAyB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CACH,MAAc,EACd,KAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,MAAM,QAAQ,EAAE;YAC3D,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAA8C,CAAC;IAClD,CAAC;CACF"}
|