@sendery/sdk 0.1.5 → 0.1.7

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 CHANGED
@@ -1,8 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.7
4
+
5
+ - See the GitHub release notes for this version.
6
+
7
+ ## 0.1.6
8
+
9
+ - See the GitHub release notes for this version.
10
+
3
11
  ## 0.1.5
4
12
 
5
- - Register and list event definitions with readable data fields and recipient roles for the visual trigger builder.
13
+ - Register and list event definitions with readable data fields and recipient roles for the visual workflow builder.
6
14
 
7
15
  - Add application events, stable-key retries, event status lookup, and object-data deletion. Framework integrations use the project client.
8
16
 
package/README.md CHANGED
@@ -36,9 +36,9 @@ if (!apiKey) throw new Error('Set SENDERY_API_KEY on your server.');
36
36
 
37
37
  const sendery = new Sendery(apiKey);
38
38
  const receipt = await sendery.send({
39
- to: 'alex@example.com',
39
+ to: 'steven@example.com',
40
40
  template: 'your-template',
41
- data: { name: 'Alex', action_url: 'https://example.com/start' },
41
+ data: { name: 'Steven', action_url: 'https://example.com/start' },
42
42
  });
43
43
 
44
44
  console.log(receipt.id);
@@ -50,9 +50,9 @@ Choose a [published template version](https://sendery.co/en/docs/send-email#sect
50
50
 
51
51
  ```javascript
52
52
  const receipt = await sendery.prepare({
53
- to: 'alex@example.com',
53
+ to: 'steven@example.com',
54
54
  template: 'your-template',
55
- data: { name: 'Alex', action_url: 'https://example.com/start' },
55
+ data: { name: 'Steven', action_url: 'https://example.com/start' },
56
56
  }).version(3).send();
57
57
  ```
58
58
 
@@ -70,9 +70,9 @@ const sendery = new Sendery(process.env.SENDERY_API_KEY);
70
70
  const file = await readFile('/path/document.pdf');
71
71
 
72
72
  await sendery.prepare({
73
- to: 'alex@example.com',
73
+ to: 'steven@example.com',
74
74
  template: 'your-template',
75
- data: { name: 'Alex', action_url: 'https://example.com/start' },
75
+ data: { name: 'Steven', action_url: 'https://example.com/start' },
76
76
  attachments: [attachment('document.pdf', file, 'application/pdf')],
77
77
  }, 'your-idempotency-key').retry().send();
78
78
  ```
@@ -94,9 +94,9 @@ Use `retry(3)` for up to three extra attempts after temporary failures. Keep the
94
94
 
95
95
  ```javascript
96
96
  const email = sendery.prepare({
97
- to: 'alex@example.com',
97
+ to: 'steven@example.com',
98
98
  template: 'your-template',
99
- data: { name: 'Alex', action_url: 'https://example.com/start' },
99
+ data: { name: 'Steven', action_url: 'https://example.com/start' },
100
100
  }, 'your-idempotency-key');
101
101
 
102
102
  const receipt = await email.retry(3).send();
@@ -133,7 +133,7 @@ Learn how to [retry emails without duplicate sends](https://sendery.co/en/docs/i
133
133
 
134
134
  [MIT](LICENSE).
135
135
 
136
- ## Events and triggers
136
+ ## Events and workflows
137
137
 
138
138
  Send events such as account signups or orders from your app. Your team can use them to automate emails in Sendery, choosing the content, recipients, and timing. Available on all plans.
139
139
 
@@ -143,8 +143,8 @@ Start with [Connecting your application](https://sendery.co/en/docs/connect-even
143
143
  const receipt = await sendery.event({
144
144
  name: "account.created",
145
145
  object: { type: "account", id: "842" },
146
- data: { email: "alex@example.com", name: "Alex" },
146
+ data: { email: "steven@example.com", name: "Steven" },
147
147
  }).retry().send();
148
148
  ```
149
149
 
150
- Retries reuse the same event data and idempotency key. To retry across jobs or process restarts, supply and persist your own key. A successful response confirms that Sendery accepted the event. [Learn what you can automate with triggers](https://sendery.co/en/docs/build-trigger).
150
+ Retries reuse the same event data and idempotency key. To retry across jobs or process restarts, supply and persist your own key. A successful response confirms that Sendery accepted the event. [Learn what you can automate with workflows](https://sendery.co/en/docs/build-workflow).
package/dist/index.d.ts CHANGED
@@ -72,11 +72,11 @@ export interface EventInput {
72
72
  export interface EventReceipt extends SendReceipt {
73
73
  name?: string;
74
74
  received_at?: string;
75
- matched_triggers?: number;
75
+ matched_workflows?: number;
76
76
  environment?: "sandbox" | "live";
77
77
  runs?: {
78
78
  id: string;
79
- trigger_id: number;
79
+ workflow_id: number;
80
80
  status: string;
81
81
  due_at: string | null;
82
82
  error_code: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendery/sdk",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "description": "Server-side Sendery template email SDK for JavaScript and TypeScript",
6
6
  "license": "MIT",