sequenzy 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +34 -19
- package/package.json +2 -2
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0 (2025-12-08)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0...v0.2.0](https://github.com/Sequenzy/sequenzy-typescript/compare/v0.1.0...v0.2.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([21e684c](https://github.com/Sequenzy/sequenzy-typescript/commit/21e684cb059e3387f595aba165e17ea66cae53b4))
|
|
10
|
+
|
|
3
11
|
## 0.1.0 (2025-12-08)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.0.1...v0.1.0](https://github.com/Sequenzy/sequenzy-typescript/compare/v0.0.1...v0.1.0)
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Sequenzy TypeScript API Library
|
|
1
|
+
# Sequenzy TypeScript API - Best Email Marketing platform API Library
|
|
2
2
|
|
|
3
3
|
[>)](https://npmjs.org/package/sequenzy) 
|
|
4
4
|
|
|
@@ -26,9 +26,13 @@ const client = new Sequenzy({
|
|
|
26
26
|
apiKey: process.env['SEQUENZY_API_KEY'], // This is the default and can be omitted
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const subscriber = await client.subscribers.create({
|
|
30
|
+
email: 'user@example.com',
|
|
31
|
+
firstName: 'User',
|
|
32
|
+
lastName: 'TheBest',
|
|
33
|
+
});
|
|
30
34
|
|
|
31
|
-
console.log(
|
|
35
|
+
console.log(subscriber.subscriber);
|
|
32
36
|
```
|
|
33
37
|
|
|
34
38
|
### Request & Response types
|
|
@@ -43,7 +47,12 @@ const client = new Sequenzy({
|
|
|
43
47
|
apiKey: process.env['SEQUENZY_API_KEY'], // This is the default and can be omitted
|
|
44
48
|
});
|
|
45
49
|
|
|
46
|
-
const
|
|
50
|
+
const params: Sequenzy.SubscriberCreateParams = {
|
|
51
|
+
email: 'user@example.com',
|
|
52
|
+
firstName: 'User',
|
|
53
|
+
lastName: 'TheBest',
|
|
54
|
+
};
|
|
55
|
+
const subscriber: Sequenzy.SubscriberCreateResponse = await client.subscribers.create(params);
|
|
47
56
|
```
|
|
48
57
|
|
|
49
58
|
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
@@ -56,15 +65,17 @@ a subclass of `APIError` will be thrown:
|
|
|
56
65
|
|
|
57
66
|
<!-- prettier-ignore -->
|
|
58
67
|
```ts
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
const subscriber = await client.subscribers
|
|
69
|
+
.create({ email: 'user@example.com', firstName: 'User', lastName: 'TheBest' })
|
|
70
|
+
.catch(async (err) => {
|
|
71
|
+
if (err instanceof Sequenzy.APIError) {
|
|
72
|
+
console.log(err.status); // 400
|
|
73
|
+
console.log(err.name); // BadRequestError
|
|
74
|
+
console.log(err.headers); // {server: 'nginx', ...}
|
|
75
|
+
} else {
|
|
76
|
+
throw err;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
68
79
|
```
|
|
69
80
|
|
|
70
81
|
Error codes are as follows:
|
|
@@ -96,7 +107,7 @@ const client = new Sequenzy({
|
|
|
96
107
|
});
|
|
97
108
|
|
|
98
109
|
// Or, configure per-request:
|
|
99
|
-
await client.subscribers.
|
|
110
|
+
await client.subscribers.create({ email: 'user@example.com', firstName: 'User', lastName: 'TheBest' }, {
|
|
100
111
|
maxRetries: 5,
|
|
101
112
|
});
|
|
102
113
|
```
|
|
@@ -113,7 +124,7 @@ const client = new Sequenzy({
|
|
|
113
124
|
});
|
|
114
125
|
|
|
115
126
|
// Override per-request:
|
|
116
|
-
await client.subscribers.
|
|
127
|
+
await client.subscribers.create({ email: 'user@example.com', firstName: 'User', lastName: 'TheBest' }, {
|
|
117
128
|
timeout: 5 * 1000,
|
|
118
129
|
});
|
|
119
130
|
```
|
|
@@ -136,13 +147,17 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
|
|
|
136
147
|
```ts
|
|
137
148
|
const client = new Sequenzy();
|
|
138
149
|
|
|
139
|
-
const response = await client.subscribers
|
|
150
|
+
const response = await client.subscribers
|
|
151
|
+
.create({ email: 'user@example.com', firstName: 'User', lastName: 'TheBest' })
|
|
152
|
+
.asResponse();
|
|
140
153
|
console.log(response.headers.get('X-My-Header'));
|
|
141
154
|
console.log(response.statusText); // access the underlying Response object
|
|
142
155
|
|
|
143
|
-
const { data:
|
|
156
|
+
const { data: subscriber, response: raw } = await client.subscribers
|
|
157
|
+
.create({ email: 'user@example.com', firstName: 'User', lastName: 'TheBest' })
|
|
158
|
+
.withResponse();
|
|
144
159
|
console.log(raw.headers.get('X-My-Header'));
|
|
145
|
-
console.log(
|
|
160
|
+
console.log(subscriber.subscriber);
|
|
146
161
|
```
|
|
147
162
|
|
|
148
163
|
### Logging
|
|
@@ -222,7 +237,7 @@ parameter. This library doesn't validate at runtime that the request matches the
|
|
|
222
237
|
send will be sent as-is.
|
|
223
238
|
|
|
224
239
|
```ts
|
|
225
|
-
client.subscribers.
|
|
240
|
+
client.subscribers.create({
|
|
226
241
|
// ...
|
|
227
242
|
// @ts-expect-error baz is not yet public
|
|
228
243
|
baz: 'undocumented option',
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sequenzy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "The official TypeScript library for the Sequenzy API",
|
|
5
|
-
"author": "Sequenzy
|
|
5
|
+
"author": "Sequenzy <nic@sequenzy.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"type": "commonjs",
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.2.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.2.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.2.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.2.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|