sendblue 3.6.0 → 3.7.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 (88) hide show
  1. package/CHANGELOG.md +36 -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 +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/index.d.mts +1 -0
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +1 -0
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +3 -1
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +1 -0
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/v2/index.d.mts +3 -0
  20. package/resources/v2/index.d.mts.map +1 -0
  21. package/resources/v2/index.d.ts +3 -0
  22. package/resources/v2/index.d.ts.map +1 -0
  23. package/resources/v2/index.js +9 -0
  24. package/resources/v2/index.js.map +1 -0
  25. package/resources/v2/index.mjs +4 -0
  26. package/resources/v2/index.mjs.map +1 -0
  27. package/resources/v2/totp/index.d.mts +3 -0
  28. package/resources/v2/totp/index.d.mts.map +1 -0
  29. package/resources/v2/totp/index.d.ts +3 -0
  30. package/resources/v2/totp/index.d.ts.map +1 -0
  31. package/resources/v2/totp/index.js +9 -0
  32. package/resources/v2/totp/index.js.map +1 -0
  33. package/resources/v2/totp/index.mjs +4 -0
  34. package/resources/v2/totp/index.mjs.map +1 -0
  35. package/resources/v2/totp/secrets.d.mts +159 -0
  36. package/resources/v2/totp/secrets.d.mts.map +1 -0
  37. package/resources/v2/totp/secrets.d.ts +159 -0
  38. package/resources/v2/totp/secrets.d.ts.map +1 -0
  39. package/resources/v2/totp/secrets.js +57 -0
  40. package/resources/v2/totp/secrets.js.map +1 -0
  41. package/resources/v2/totp/secrets.mjs +53 -0
  42. package/resources/v2/totp/secrets.mjs.map +1 -0
  43. package/resources/v2/totp/totp.d.mts +39 -0
  44. package/resources/v2/totp/totp.d.mts.map +1 -0
  45. package/resources/v2/totp/totp.d.ts +39 -0
  46. package/resources/v2/totp/totp.d.ts.map +1 -0
  47. package/resources/v2/totp/totp.js +35 -0
  48. package/resources/v2/totp/totp.js.map +1 -0
  49. package/resources/v2/totp/totp.mjs +30 -0
  50. package/resources/v2/totp/totp.mjs.map +1 -0
  51. package/resources/v2/totp.d.mts +2 -0
  52. package/resources/v2/totp.d.mts.map +1 -0
  53. package/resources/v2/totp.d.ts +2 -0
  54. package/resources/v2/totp.d.ts.map +1 -0
  55. package/resources/v2/totp.js +6 -0
  56. package/resources/v2/totp.js.map +1 -0
  57. package/resources/v2/totp.mjs +3 -0
  58. package/resources/v2/totp.mjs.map +1 -0
  59. package/resources/v2/v2.d.mts +10 -0
  60. package/resources/v2/v2.d.mts.map +1 -0
  61. package/resources/v2/v2.d.ts +10 -0
  62. package/resources/v2/v2.d.ts.map +1 -0
  63. package/resources/v2/v2.js +17 -0
  64. package/resources/v2/v2.js.map +1 -0
  65. package/resources/v2/v2.mjs +12 -0
  66. package/resources/v2/v2.mjs.map +1 -0
  67. package/resources/v2.d.mts +2 -0
  68. package/resources/v2.d.mts.map +1 -0
  69. package/resources/v2.d.ts +2 -0
  70. package/resources/v2.d.ts.map +1 -0
  71. package/resources/v2.js +6 -0
  72. package/resources/v2.js.map +1 -0
  73. package/resources/v2.mjs +3 -0
  74. package/resources/v2.mjs.map +1 -0
  75. package/src/client.ts +5 -0
  76. package/src/resources/index.ts +1 -0
  77. package/src/resources/v2/index.ts +4 -0
  78. package/src/resources/v2/totp/index.ts +10 -0
  79. package/src/resources/v2/totp/secrets.ts +204 -0
  80. package/src/resources/v2/totp/totp.ts +64 -0
  81. package/src/resources/v2/totp.ts +3 -0
  82. package/src/resources/v2/v2.ts +15 -0
  83. package/src/resources/v2.ts +3 -0
  84. package/src/version.ts +1 -1
  85. package/version.d.mts +1 -1
  86. package/version.d.ts +1 -1
  87. package/version.js +1 -1
  88. package/version.mjs +1 -1
@@ -0,0 +1,10 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as TotpAPI from "./totp/totp.js";
3
+ import { Totp, TotpGetCodeResponse } from "./totp/totp.js";
4
+ export declare class V2 extends APIResource {
5
+ totp: TotpAPI.Totp;
6
+ }
7
+ export declare namespace V2 {
8
+ export { Totp as Totp, type TotpGetCodeResponse as TotpGetCodeResponse };
9
+ }
10
+ //# sourceMappingURL=v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../src/resources/v2/v2.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,IAAI,EAAE,mBAAmB,EAAE;AAEpC,qBAAa,EAAG,SAAQ,WAAW;IACjC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;CACrD;AAID,MAAM,CAAC,OAAO,WAAW,EAAE,CAAC;IAC1B,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC1E"}
@@ -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.V2 = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const TotpAPI = tslib_1.__importStar(require("./totp/totp.js"));
8
+ const totp_1 = require("./totp/totp.js");
9
+ class V2 extends resource_1.APIResource {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.totp = new TotpAPI.Totp(this._client);
13
+ }
14
+ }
15
+ exports.V2 = V2;
16
+ V2.Totp = totp_1.Totp;
17
+ //# sourceMappingURL=v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.js","sourceRoot":"","sources":["../../src/resources/v2/v2.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,gEAAuC;AACvC,yCAAwD;AAExD,MAAa,EAAG,SAAQ,sBAAW;IAAnC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;CAAA;AAFD,gBAEC;AAED,EAAE,CAAC,IAAI,GAAG,WAAI,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 TotpAPI from "./totp/totp.mjs";
4
+ import { Totp } from "./totp/totp.mjs";
5
+ export class V2 extends APIResource {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.totp = new TotpAPI.Totp(this._client);
9
+ }
10
+ }
11
+ V2.Totp = Totp;
12
+ //# sourceMappingURL=v2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.mjs","sourceRoot":"","sources":["../../src/resources/v2/v2.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,EAAE,IAAI,EAAuB;AAEpC,MAAM,OAAO,EAAG,SAAQ,WAAW;IAAnC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;CAAA;AAED,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./v2/index.mjs";
2
+ //# sourceMappingURL=v2.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.d.mts","sourceRoot":"","sources":["../src/resources/v2.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./v2/index.js";
2
+ //# sourceMappingURL=v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../src/resources/v2.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("./v2/index.js"), exports);
6
+ //# sourceMappingURL=v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.js","sourceRoot":"","sources":["../src/resources/v2.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAA2B"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./v2/index.mjs";
3
+ //# sourceMappingURL=v2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.mjs","sourceRoot":"","sources":["../src/resources/v2.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 { V2 } from './resources/v2/v2';
67
68
  import { type Fetch } from './internal/builtin-types';
68
69
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
69
70
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -820,6 +821,7 @@ export class SendblueAPI {
820
821
  * Operations for sending and managing messages
821
822
  */
822
823
  sendCarousel: API.SendCarousel = new API.SendCarousel(this);
824
+ v2: API.V2 = new API.V2(this);
823
825
  }
824
826
 
825
827
  SendblueAPI.Messages = Messages;
@@ -830,6 +832,7 @@ SendblueAPI.TypingIndicators = TypingIndicators;
830
832
  SendblueAPI.Contacts = Contacts;
831
833
  SendblueAPI.Webhooks = Webhooks;
832
834
  SendblueAPI.SendCarousel = SendCarousel;
835
+ SendblueAPI.V2 = V2;
833
836
 
834
837
  export declare namespace SendblueAPI {
835
838
  export type RequestOptions = Opts.RequestOptions;
@@ -905,4 +908,6 @@ export declare namespace SendblueAPI {
905
908
  type SendCarouselSendResponse as SendCarouselSendResponse,
906
909
  type SendCarouselSendParams as SendCarouselSendParams,
907
910
  };
911
+
912
+ export { V2 as V2 };
908
913
  }
@@ -41,6 +41,7 @@ export {
41
41
  type TypingIndicatorSendResponse,
42
42
  type TypingIndicatorSendParams,
43
43
  } from './typing-indicators';
44
+ export { V2 } from './v2/v2';
44
45
  export {
45
46
  Webhooks,
46
47
  type WebhookConfiguration,
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Totp, type TotpGetCodeResponse } from './totp/index';
4
+ export { V2 } from './v2';
@@ -0,0 +1,10 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Secrets,
5
+ type SecretCreateResponse,
6
+ type SecretListResponse,
7
+ type SecretDeleteResponse,
8
+ type SecretCreateParams,
9
+ } from './secrets';
10
+ export { Totp, type TotpGetCodeResponse } from './totp';
@@ -0,0 +1,204 @@
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
+ /**
9
+ * Store and retrieve TOTP codes for agent 2FA (authenticator app replacement)
10
+ */
11
+ export class Secrets extends APIResource {
12
+ /**
13
+ * Store an encrypted TOTP secret for your account. Agents can use this instead of
14
+ * a phone-based authenticator app.
15
+ *
16
+ * Provide either:
17
+ *
18
+ * - A `uri` (the `otpauth://` URI from a QR code scan), which auto-populates all
19
+ * fields
20
+ * - A base32 `secret` with optional `label`, `issuer`, `algorithm`, `digits`, and
21
+ * `period`
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const secret = await client.v2.totp.secrets.create();
26
+ * ```
27
+ */
28
+ create(body: SecretCreateParams, options?: RequestOptions): APIPromise<SecretCreateResponse> {
29
+ return this._client.post('/api/v2/totp/secrets', { body, ...options });
30
+ }
31
+
32
+ /**
33
+ * List all stored TOTP secrets for the account. The encrypted secret values are
34
+ * never returned.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const secrets = await client.v2.totp.secrets.list();
39
+ * ```
40
+ */
41
+ list(options?: RequestOptions): APIPromise<SecretListResponse> {
42
+ return this._client.get('/api/v2/totp/secrets', options);
43
+ }
44
+
45
+ /**
46
+ * Permanently delete a stored TOTP secret.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const secret = await client.v2.totp.secrets.delete(
51
+ * '550e8400-e29b-41d4-a716-446655440000',
52
+ * );
53
+ * ```
54
+ */
55
+ delete(secretID: string, options?: RequestOptions): APIPromise<SecretDeleteResponse> {
56
+ return this._client.delete(path`/api/v2/totp/secrets/${secretID}`, options);
57
+ }
58
+ }
59
+
60
+ export interface SecretCreateResponse {
61
+ status?: string;
62
+
63
+ totp_secret?: SecretCreateResponse.TotpSecret;
64
+ }
65
+
66
+ export namespace SecretCreateResponse {
67
+ export interface TotpSecret {
68
+ /**
69
+ * Unique identifier for this TOTP secret
70
+ */
71
+ id?: string;
72
+
73
+ /**
74
+ * Hash algorithm used
75
+ */
76
+ algorithm?: 'SHA1' | 'SHA256' | 'SHA512';
77
+
78
+ created_at?: string;
79
+
80
+ /**
81
+ * Code length (6 or 8)
82
+ */
83
+ digits?: number;
84
+
85
+ /**
86
+ * Service name
87
+ */
88
+ issuer?: string | null;
89
+
90
+ /**
91
+ * Human-readable label
92
+ */
93
+ label?: string;
94
+
95
+ /**
96
+ * Rotation period in seconds
97
+ */
98
+ period?: number;
99
+
100
+ /**
101
+ * Base32 secret — only returned on creation, never on list/get
102
+ */
103
+ secret?: string;
104
+ }
105
+ }
106
+
107
+ export interface SecretListResponse {
108
+ status?: string;
109
+
110
+ totp_secrets?: Array<SecretListResponse.TotpSecret>;
111
+ }
112
+
113
+ export namespace SecretListResponse {
114
+ export interface TotpSecret {
115
+ /**
116
+ * Unique identifier for this TOTP secret
117
+ */
118
+ id?: string;
119
+
120
+ /**
121
+ * Hash algorithm used
122
+ */
123
+ algorithm?: 'SHA1' | 'SHA256' | 'SHA512';
124
+
125
+ created_at?: string;
126
+
127
+ /**
128
+ * Code length (6 or 8)
129
+ */
130
+ digits?: number;
131
+
132
+ /**
133
+ * Service name
134
+ */
135
+ issuer?: string | null;
136
+
137
+ /**
138
+ * Human-readable label
139
+ */
140
+ label?: string;
141
+
142
+ /**
143
+ * Rotation period in seconds
144
+ */
145
+ period?: number;
146
+
147
+ /**
148
+ * Base32 secret — only returned on creation, never on list/get
149
+ */
150
+ secret?: string;
151
+ }
152
+ }
153
+
154
+ export interface SecretDeleteResponse {
155
+ status?: string;
156
+ }
157
+
158
+ export interface SecretCreateParams {
159
+ /**
160
+ * Hash algorithm
161
+ */
162
+ algorithm?: 'SHA1' | 'SHA256' | 'SHA512';
163
+
164
+ /**
165
+ * Code length
166
+ */
167
+ digits?: 6 | 8;
168
+
169
+ /**
170
+ * Service name (e.g. "GitHub", "Google")
171
+ */
172
+ issuer?: string;
173
+
174
+ /**
175
+ * Human-readable label for this secret (e.g. "GitHub - agent@example.com").
176
+ * Required unless `uri` is provided.
177
+ */
178
+ label?: string;
179
+
180
+ /**
181
+ * Rotation period in seconds
182
+ */
183
+ period?: number;
184
+
185
+ /**
186
+ * Base32-encoded TOTP secret. Omit to auto-generate one.
187
+ */
188
+ secret?: string;
189
+
190
+ /**
191
+ * Full `otpauth://totp/...` URI from a QR code. Overrides all other fields if
192
+ * provided.
193
+ */
194
+ uri?: string;
195
+ }
196
+
197
+ export declare namespace Secrets {
198
+ export {
199
+ type SecretCreateResponse as SecretCreateResponse,
200
+ type SecretListResponse as SecretListResponse,
201
+ type SecretDeleteResponse as SecretDeleteResponse,
202
+ type SecretCreateParams as SecretCreateParams,
203
+ };
204
+ }
@@ -0,0 +1,64 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as SecretsAPI from './secrets';
5
+ import {
6
+ SecretCreateParams,
7
+ SecretCreateResponse,
8
+ SecretDeleteResponse,
9
+ SecretListResponse,
10
+ Secrets,
11
+ } from './secrets';
12
+ import { APIPromise } from '../../../core/api-promise';
13
+ import { RequestOptions } from '../../../internal/request-options';
14
+ import { path } from '../../../internal/utils/path';
15
+
16
+ /**
17
+ * Store and retrieve TOTP codes for agent 2FA (authenticator app replacement)
18
+ */
19
+ export class Totp extends APIResource {
20
+ secrets: SecretsAPI.Secrets = new SecretsAPI.Secrets(this._client);
21
+
22
+ /**
23
+ * Generate the current 6- or 8-digit TOTP code for a stored secret, along with how
24
+ * many seconds remain until it rotates.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const response = await client.v2.totp.getCode(
29
+ * '550e8400-e29b-41d4-a716-446655440000',
30
+ * );
31
+ * ```
32
+ */
33
+ getCode(secretID: string, options?: RequestOptions): APIPromise<TotpGetCodeResponse> {
34
+ return this._client.get(path`/api/v2/totp/code/${secretID}`, options);
35
+ }
36
+ }
37
+
38
+ export interface TotpGetCodeResponse {
39
+ /**
40
+ * The current TOTP code
41
+ */
42
+ code?: string;
43
+
44
+ /**
45
+ * Seconds until this code rotates
46
+ */
47
+ expires_in?: number;
48
+
49
+ status?: string;
50
+ }
51
+
52
+ Totp.Secrets = Secrets;
53
+
54
+ export declare namespace Totp {
55
+ export { type TotpGetCodeResponse as TotpGetCodeResponse };
56
+
57
+ export {
58
+ Secrets as Secrets,
59
+ type SecretCreateResponse as SecretCreateResponse,
60
+ type SecretListResponse as SecretListResponse,
61
+ type SecretDeleteResponse as SecretDeleteResponse,
62
+ type SecretCreateParams as SecretCreateParams,
63
+ };
64
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './totp/index';
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as TotpAPI from './totp/totp';
5
+ import { Totp, TotpGetCodeResponse } from './totp/totp';
6
+
7
+ export class V2 extends APIResource {
8
+ totp: TotpAPI.Totp = new TotpAPI.Totp(this._client);
9
+ }
10
+
11
+ V2.Totp = Totp;
12
+
13
+ export declare namespace V2 {
14
+ export { Totp as Totp, type TotpGetCodeResponse as TotpGetCodeResponse };
15
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './v2/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '3.6.0'; // x-release-please-version
1
+ export const VERSION = '3.7.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.6.0";
1
+ export declare const VERSION = "3.7.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.6.0";
1
+ export declare const VERSION = "3.7.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.6.0'; // x-release-please-version
4
+ exports.VERSION = '3.7.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.6.0'; // x-release-please-version
1
+ export const VERSION = '3.7.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map