@deliverart/sdk-js-email-notification-configuration 0.0.0-dev-20260721002647
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/README.md +180 -0
- package/dist/index.cjs +544 -0
- package/dist/index.d.cts +2439 -0
- package/dist/index.d.ts +2439 -0
- package/dist/index.js +494 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# @deliverart/sdk-js-email-notification-configuration
|
|
2
|
+
|
|
3
|
+
Email notification configuration management package for the DeliverArt JavaScript SDK.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @deliverart/sdk-js-email-notification-configuration @deliverart/sdk-js-core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Exported Types
|
|
12
|
+
|
|
13
|
+
### Core Types
|
|
14
|
+
- `EmailNotificationConfiguration` - Email notification configuration with all details
|
|
15
|
+
- `EmailNotificationConfigurationListItem` - Email notification configuration list item
|
|
16
|
+
- `EmailNotificationConfigurationConfig` - Configuration object containing notification settings
|
|
17
|
+
- `WritableEmailNotificationConfiguration` - Writable email notification configuration
|
|
18
|
+
- `WritableCreateEmailNotificationConfiguration` - Writable create email notification configuration
|
|
19
|
+
|
|
20
|
+
### Template Keys
|
|
21
|
+
Available email template keys:
|
|
22
|
+
- `delivery_started` - Notification when delivery starts
|
|
23
|
+
- `delivery_taken_over` - Notification when delivery is taken over
|
|
24
|
+
- `order_created` - Notification when order is created
|
|
25
|
+
- `order_delivered` - Notification when order is delivered
|
|
26
|
+
- `order_in_preparation` - Notification when order enters preparation
|
|
27
|
+
- `order_preparation_done` - Notification when order preparation is complete
|
|
28
|
+
- `subscription_expiring` - Reminder when a time-based subscription is close to expiration
|
|
29
|
+
- `subscription_low_credits` - Reminder when a consumption subscription is low on credits
|
|
30
|
+
- `subscription_pending_renewal` - Reminder when a subscription has a pending renewal
|
|
31
|
+
- `subscription_payment_pending_verification` - Notification for subscription payments that require central admin verification
|
|
32
|
+
|
|
33
|
+
### Order Sources
|
|
34
|
+
Configuration supports the following order sources:
|
|
35
|
+
- `application` - Orders from mobile/web application
|
|
36
|
+
- `ecommerce` - Orders from ecommerce platform
|
|
37
|
+
- `partner` - Orders from partner integrations
|
|
38
|
+
|
|
39
|
+
### IRI Types
|
|
40
|
+
- `EmailNotificationConfigurationIri` - Email notification configuration IRI (`/email_notification_configurations/:id`)
|
|
41
|
+
|
|
42
|
+
## Configuration Structure
|
|
43
|
+
|
|
44
|
+
Each email notification configuration contains a `config` object with template-specific settings. The structure depends on the template key.
|
|
45
|
+
|
|
46
|
+
### Config Object
|
|
47
|
+
|
|
48
|
+
Order and delivery templates use:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
{
|
|
52
|
+
sourcesEnabled: string[]
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Subscription reminder templates use:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
{}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The same empty config is also used by subscription billing verification notifications.
|
|
63
|
+
|
|
64
|
+
**Fields:**
|
|
65
|
+
- `sourcesEnabled?: string[]` - Array of order sources for which the notification should be sent on order and delivery templates
|
|
66
|
+
|
|
67
|
+
## Available Requests
|
|
68
|
+
|
|
69
|
+
### CreateEmailNotificationConfiguration
|
|
70
|
+
```typescript
|
|
71
|
+
import { CreateEmailNotificationConfiguration } from '@deliverart/sdk-js-email-notification-configuration';
|
|
72
|
+
|
|
73
|
+
const config = await sdk.call(new CreateEmailNotificationConfiguration({
|
|
74
|
+
pointOfSale: '/point_of_sales/123',
|
|
75
|
+
templateKey: 'order_preparation_done',
|
|
76
|
+
isActive: true,
|
|
77
|
+
config: {
|
|
78
|
+
sourcesEnabled: ['application']
|
|
79
|
+
}
|
|
80
|
+
}));
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Subscription reminder example:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
const config = await sdk.call(new CreateEmailNotificationConfiguration({
|
|
87
|
+
pointOfSale: '/point_of_sales/123',
|
|
88
|
+
templateKey: 'subscription_low_credits',
|
|
89
|
+
isActive: true,
|
|
90
|
+
config: {}
|
|
91
|
+
}));
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Subscription billing verification example:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
const config = await sdk.call(new CreateEmailNotificationConfiguration({
|
|
98
|
+
pointOfSale: '/point_of_sales/123',
|
|
99
|
+
templateKey: 'subscription_payment_pending_verification',
|
|
100
|
+
isActive: true,
|
|
101
|
+
config: {}
|
|
102
|
+
}));
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Input Parameters:**
|
|
106
|
+
- `pointOfSale: string` (required) - Point of sale IRI
|
|
107
|
+
- `templateKey: string` (required) - Email template key
|
|
108
|
+
- `isActive: boolean` (required) - Enable/disable notification
|
|
109
|
+
- `config: object` (required) - Configuration object with sourcesEnabled
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### GetEmailNotificationConfigurations
|
|
114
|
+
```typescript
|
|
115
|
+
import { GetEmailNotificationConfigurations } from '@deliverart/sdk-js-email-notification-configuration';
|
|
116
|
+
|
|
117
|
+
const configs = await sdk.call(new GetEmailNotificationConfigurations({
|
|
118
|
+
query: {
|
|
119
|
+
templateKey: 'order_created',
|
|
120
|
+
page: 1
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Query Parameters:**
|
|
126
|
+
- `id?: string | string[]` - Filter by configuration ID
|
|
127
|
+
- `templateKey?: string | string[]` - Filter by template key
|
|
128
|
+
- `order[createdAt]?: string` - Sort by creation date
|
|
129
|
+
- `order[updatedAt]?: string` - Sort by update date
|
|
130
|
+
- `page?: number` - Page number
|
|
131
|
+
- `createdAtFrom?: string` - Filter by creation date (from)
|
|
132
|
+
- `createdAtTo?: string` - Filter by creation date (to)
|
|
133
|
+
- `updatedAtFrom?: string` - Filter by update date (from)
|
|
134
|
+
- `updatedAtTo?: string` - Filter by update date (to)
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### GetEmailNotificationConfigurationDetails
|
|
139
|
+
```typescript
|
|
140
|
+
import { GetEmailNotificationConfigurationDetails } from '@deliverart/sdk-js-email-notification-configuration';
|
|
141
|
+
|
|
142
|
+
const config = await sdk.call(new GetEmailNotificationConfigurationDetails('config-123'));
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### UpdateEmailNotificationConfiguration
|
|
148
|
+
```typescript
|
|
149
|
+
import { UpdateEmailNotificationConfiguration } from '@deliverart/sdk-js-email-notification-configuration';
|
|
150
|
+
|
|
151
|
+
const updated = await sdk.call(new UpdateEmailNotificationConfiguration('config-123', {
|
|
152
|
+
templateKey: 'order_preparation_done',
|
|
153
|
+
isActive: false,
|
|
154
|
+
config: {
|
|
155
|
+
sourcesEnabled: ['application', 'ecommerce']
|
|
156
|
+
}
|
|
157
|
+
}));
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Input Parameters:**
|
|
161
|
+
- `templateKey: string` (required) - Email template key
|
|
162
|
+
- `isActive: boolean` (required) - Enable/disable notification
|
|
163
|
+
- `config: object` (required) - Configuration object
|
|
164
|
+
- order/delivery templates: `sourcesEnabled: string[]`
|
|
165
|
+
- subscription reminder templates: empty object `{}`
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
### DeleteEmailNotificationConfiguration
|
|
170
|
+
```typescript
|
|
171
|
+
import { DeleteEmailNotificationConfiguration } from '@deliverart/sdk-js-email-notification-configuration';
|
|
172
|
+
|
|
173
|
+
await sdk.call(new DeleteEmailNotificationConfiguration('config-123'));
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
This package is part of the DeliverArt JavaScript SDK.
|