@deliverart/sdk-js-email-notification-configuration 2.8.9 → 2.8.10

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 CHANGED
@@ -11,8 +11,11 @@ npm install @deliverart/sdk-js-email-notification-configuration @deliverart/sdk-
11
11
  ## Exported Types
12
12
 
13
13
  ### Core Types
14
- - `EmailNotificationConfiguration` - Email notification configuration
15
- - `EmailNotificationConfigConfig` - Configuration object containing notification settings
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
16
19
 
17
20
  ### Template Keys
18
21
  Available email template keys:
@@ -23,19 +26,30 @@ Available email template keys:
23
26
  - `order_in_preparation` - Notification when order enters preparation
24
27
  - `order_preparation_done` - Notification when order preparation is complete
25
28
 
29
+ ### Order Sources
30
+ Configuration supports the following order sources:
31
+ - `application` - Orders from mobile/web application
32
+ - `ecommerce` - Orders from ecommerce platform
33
+ - `partner` - Orders from partner integrations
34
+
26
35
  ### IRI Types
27
36
  - `EmailNotificationConfigurationIri` - Email notification configuration IRI (`/email_notification_configurations/:id`)
28
37
 
29
- ## Configuration
38
+ ## Configuration Structure
39
+
40
+ Each email notification configuration contains a `config` object with template-specific settings. The configuration structure is designed to be extensible for future template-specific fields.
30
41
 
31
- Each email notification configuration contains a `config` object with template-specific settings:
42
+ ### Config Object
32
43
 
33
44
  ```typescript
34
45
  {
35
- sourcesEnabled: string[] // Array of enabled order sources: 'application', 'ecommerce', 'partner'
46
+ sourcesEnabled: string[] // Array of enabled order sources
36
47
  }
37
48
  ```
38
49
 
50
+ **Fields:**
51
+ - `sourcesEnabled?: string[]` - Array of order sources for which the notification should be sent
52
+
39
53
  ## Available Requests
40
54
 
41
55
  ### CreateEmailNotificationConfiguration
@@ -44,10 +58,10 @@ import { CreateEmailNotificationConfiguration } from '@deliverart/sdk-js-email-n
44
58
 
45
59
  const config = await sdk.call(new CreateEmailNotificationConfiguration({
46
60
  pointOfSale: '/point_of_sales/123',
47
- templateKey: 'order_created',
61
+ templateKey: 'order_preparation_done',
48
62
  isActive: true,
49
63
  config: {
50
- sourcesEnabled: ['application', 'ecommerce']
64
+ sourcesEnabled: ['application']
51
65
  }
52
66
  }));
53
67
  ```
@@ -55,9 +69,8 @@ const config = await sdk.call(new CreateEmailNotificationConfiguration({
55
69
  **Input Parameters:**
56
70
  - `pointOfSale: string` (required) - Point of sale IRI
57
71
  - `templateKey: string` (required) - Email template key
58
- - `isActive: boolean` (required) - Enable/disable this notification
59
- - `config: object` (required) - Configuration settings
60
- - `sourcesEnabled: string[]` (required) - Array of enabled order sources
72
+ - `isActive: boolean` (required) - Enable/disable notification
73
+ - `config: object` (required) - Configuration object with sourcesEnabled
61
74
 
62
75
  ---
63
76
 
@@ -67,16 +80,22 @@ import { GetEmailNotificationConfigurations } from '@deliverart/sdk-js-email-not
67
80
 
68
81
  const configs = await sdk.call(new GetEmailNotificationConfigurations({
69
82
  query: {
70
- pointOfSale: '/point_of_sales/123',
83
+ templateKey: 'order_created',
71
84
  page: 1
72
85
  }
73
86
  }));
74
87
  ```
75
88
 
76
89
  **Query Parameters:**
77
- - `pointOfSale?: string` - Filter by point of sale
78
- - `templateKey?: string` - Filter by template key
90
+ - `id?: string | string[]` - Filter by configuration ID
91
+ - `templateKey?: string | string[]` - Filter by template key
92
+ - `order[createdAt]?: string` - Sort by creation date
93
+ - `order[updatedAt]?: string` - Sort by update date
79
94
  - `page?: number` - Page number
95
+ - `createdAtFrom?: string` - Filter by creation date (from)
96
+ - `createdAtTo?: string` - Filter by creation date (to)
97
+ - `updatedAtFrom?: string` - Filter by update date (from)
98
+ - `updatedAtTo?: string` - Filter by update date (to)
80
99
 
81
100
  ---
82
101
 
@@ -94,13 +113,20 @@ const config = await sdk.call(new GetEmailNotificationConfigurationDetails('conf
94
113
  import { UpdateEmailNotificationConfiguration } from '@deliverart/sdk-js-email-notification-configuration';
95
114
 
96
115
  const updated = await sdk.call(new UpdateEmailNotificationConfiguration('config-123', {
116
+ templateKey: 'order_preparation_done',
97
117
  isActive: false,
98
118
  config: {
99
- sourcesEnabled: ['partner']
119
+ sourcesEnabled: ['application', 'ecommerce']
100
120
  }
101
121
  }));
102
122
  ```
103
123
 
124
+ **Input Parameters:**
125
+ - `templateKey: string` (required) - Email template key
126
+ - `isActive: boolean` (required) - Enable/disable notification
127
+ - `config: object` (required) - Configuration object
128
+ - `sourcesEnabled: string[]` - Array of enabled order sources
129
+
104
130
  ---
105
131
 
106
132
  ### DeleteEmailNotificationConfiguration
package/dist/index.cjs CHANGED
@@ -11199,63 +11199,185 @@ function date4(params) {
11199
11199
  config(en_default());
11200
11200
 
11201
11201
  // src/models.ts
11202
- var baseConfigSchema = external_exports.object({
11202
+ var emailNotificationConfigurationConfigSchema = external_exports.object({
11203
11203
  sourcesEnabled: external_exports.array(import_sdk_js_global_types.orderSourceSchema)
11204
11204
  });
11205
- var emailNotificationConfigurationConfigSchema = external_exports.discriminatedUnion("templateKey", [
11205
+ var emailNotificationConfigurationSchema = external_exports.discriminatedUnion("templateKey", [
11206
11206
  external_exports.object({
11207
+ id: external_exports.string(),
11208
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11207
11209
  templateKey: external_exports.literal("delivery_started"),
11208
- ...baseConfigSchema.shape
11210
+ config: emailNotificationConfigurationConfigSchema,
11211
+ isActive: external_exports.boolean(),
11212
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11213
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11209
11214
  }),
11210
11215
  external_exports.object({
11216
+ id: external_exports.string(),
11217
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11211
11218
  templateKey: external_exports.literal("delivery_taken_over"),
11212
- ...baseConfigSchema.shape
11219
+ config: emailNotificationConfigurationConfigSchema,
11220
+ isActive: external_exports.boolean(),
11221
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11222
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11213
11223
  }),
11214
11224
  external_exports.object({
11225
+ id: external_exports.string(),
11226
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11215
11227
  templateKey: external_exports.literal("order_created"),
11216
- ...baseConfigSchema.shape
11228
+ config: emailNotificationConfigurationConfigSchema,
11229
+ isActive: external_exports.boolean(),
11230
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11231
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11217
11232
  }),
11218
11233
  external_exports.object({
11234
+ id: external_exports.string(),
11235
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11219
11236
  templateKey: external_exports.literal("order_delivered"),
11220
- ...baseConfigSchema.shape
11237
+ config: emailNotificationConfigurationConfigSchema,
11238
+ isActive: external_exports.boolean(),
11239
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11240
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11221
11241
  }),
11222
11242
  external_exports.object({
11243
+ id: external_exports.string(),
11244
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11223
11245
  templateKey: external_exports.literal("order_in_preparation"),
11224
- ...baseConfigSchema.shape
11246
+ config: emailNotificationConfigurationConfigSchema,
11247
+ isActive: external_exports.boolean(),
11248
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11249
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11225
11250
  }),
11226
11251
  external_exports.object({
11252
+ id: external_exports.string(),
11253
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11227
11254
  templateKey: external_exports.literal("order_preparation_done"),
11228
- ...baseConfigSchema.shape
11255
+ config: emailNotificationConfigurationConfigSchema,
11256
+ isActive: external_exports.boolean(),
11257
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11258
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11259
+ })
11260
+ ]);
11261
+ var emailNotificationConfigurationSchemaListItem = external_exports.discriminatedUnion("templateKey", [
11262
+ external_exports.object({
11263
+ id: external_exports.string(),
11264
+ templateKey: external_exports.literal("delivery_started"),
11265
+ config: emailNotificationConfigurationConfigSchema,
11266
+ isActive: external_exports.boolean(),
11267
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11268
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11269
+ }),
11270
+ external_exports.object({
11271
+ id: external_exports.string(),
11272
+ templateKey: external_exports.literal("delivery_taken_over"),
11273
+ config: emailNotificationConfigurationConfigSchema,
11274
+ isActive: external_exports.boolean(),
11275
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11276
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11277
+ }),
11278
+ external_exports.object({
11279
+ id: external_exports.string(),
11280
+ templateKey: external_exports.literal("order_created"),
11281
+ config: emailNotificationConfigurationConfigSchema,
11282
+ isActive: external_exports.boolean(),
11283
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11284
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11285
+ }),
11286
+ external_exports.object({
11287
+ id: external_exports.string(),
11288
+ templateKey: external_exports.literal("order_delivered"),
11289
+ config: emailNotificationConfigurationConfigSchema,
11290
+ isActive: external_exports.boolean(),
11291
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11292
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11293
+ }),
11294
+ external_exports.object({
11295
+ id: external_exports.string(),
11296
+ templateKey: external_exports.literal("order_in_preparation"),
11297
+ config: emailNotificationConfigurationConfigSchema,
11298
+ isActive: external_exports.boolean(),
11299
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11300
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11301
+ }),
11302
+ external_exports.object({
11303
+ id: external_exports.string(),
11304
+ templateKey: external_exports.literal("order_preparation_done"),
11305
+ config: emailNotificationConfigurationConfigSchema,
11306
+ isActive: external_exports.boolean(),
11307
+ createdAt: import_sdk_js_global_types.datetimeSchema,
11308
+ updatedAt: import_sdk_js_global_types.datetimeSchema
11309
+ })
11310
+ ]);
11311
+ var writableEmailNotificationConfigurationSchema = external_exports.union([
11312
+ external_exports.object({
11313
+ templateKey: external_exports.literal("delivery_started"),
11314
+ config: emailNotificationConfigurationConfigSchema.optional(),
11315
+ isActive: external_exports.boolean().optional()
11316
+ }),
11317
+ external_exports.object({
11318
+ templateKey: external_exports.literal("delivery_taken_over"),
11319
+ config: emailNotificationConfigurationConfigSchema.optional(),
11320
+ isActive: external_exports.boolean().optional()
11321
+ }),
11322
+ external_exports.object({
11323
+ templateKey: external_exports.literal("order_created"),
11324
+ config: emailNotificationConfigurationConfigSchema.optional(),
11325
+ isActive: external_exports.boolean().optional()
11326
+ }),
11327
+ external_exports.object({
11328
+ templateKey: external_exports.literal("order_delivered"),
11329
+ config: emailNotificationConfigurationConfigSchema.optional(),
11330
+ isActive: external_exports.boolean().optional()
11331
+ }),
11332
+ external_exports.object({
11333
+ templateKey: external_exports.literal("order_in_preparation"),
11334
+ config: emailNotificationConfigurationConfigSchema.optional(),
11335
+ isActive: external_exports.boolean().optional()
11336
+ }),
11337
+ external_exports.object({
11338
+ templateKey: external_exports.literal("order_preparation_done"),
11339
+ config: emailNotificationConfigurationConfigSchema.optional(),
11340
+ isActive: external_exports.boolean().optional()
11341
+ })
11342
+ ]);
11343
+ var writableCreateEmailNotificationConfigurationSchema = external_exports.union([
11344
+ external_exports.object({
11345
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11346
+ templateKey: external_exports.literal("delivery_started"),
11347
+ config: emailNotificationConfigurationConfigSchema,
11348
+ isActive: external_exports.boolean()
11349
+ }),
11350
+ external_exports.object({
11351
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11352
+ templateKey: external_exports.literal("delivery_taken_over"),
11353
+ config: emailNotificationConfigurationConfigSchema,
11354
+ isActive: external_exports.boolean()
11355
+ }),
11356
+ external_exports.object({
11357
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11358
+ templateKey: external_exports.literal("order_created"),
11359
+ config: emailNotificationConfigurationConfigSchema,
11360
+ isActive: external_exports.boolean()
11361
+ }),
11362
+ external_exports.object({
11363
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11364
+ templateKey: external_exports.literal("order_delivered"),
11365
+ config: emailNotificationConfigurationConfigSchema,
11366
+ isActive: external_exports.boolean()
11367
+ }),
11368
+ external_exports.object({
11369
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11370
+ templateKey: external_exports.literal("order_in_preparation"),
11371
+ config: emailNotificationConfigurationConfigSchema,
11372
+ isActive: external_exports.boolean()
11373
+ }),
11374
+ external_exports.object({
11375
+ pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11376
+ templateKey: external_exports.literal("order_preparation_done"),
11377
+ config: emailNotificationConfigurationConfigSchema,
11378
+ isActive: external_exports.boolean()
11229
11379
  })
11230
11380
  ]);
11231
- var emailNotificationConfigurationSchema = external_exports.object({
11232
- id: external_exports.string(),
11233
- pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11234
- templateKey: import_sdk_js_global_types.emailTemplateKeySchema,
11235
- config: emailNotificationConfigurationConfigSchema,
11236
- isActive: external_exports.boolean(),
11237
- createdAt: import_sdk_js_global_types.datetimeSchema,
11238
- updatedAt: import_sdk_js_global_types.datetimeSchema
11239
- });
11240
- var emailNotificationConfigurationSchemaListItem = external_exports.object({
11241
- id: external_exports.string(),
11242
- templateKey: import_sdk_js_global_types.emailTemplateKeySchema,
11243
- config: emailNotificationConfigurationConfigSchema,
11244
- isActive: external_exports.boolean(),
11245
- createdAt: import_sdk_js_global_types.datetimeSchema,
11246
- updatedAt: import_sdk_js_global_types.datetimeSchema
11247
- });
11248
- var writableEmailNotificationConfigBaseSchema = external_exports.object({
11249
- config: baseConfigSchema,
11250
- isActive: external_exports.boolean()
11251
- });
11252
- var writableEmailNotificationConfigurationSchema = writableEmailNotificationConfigBaseSchema;
11253
- var writableCreateEmailNotificationConfigurationSchema = external_exports.object({
11254
- pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
11255
- templateKey: import_sdk_js_global_types.emailTemplateKeySchema,
11256
- config: baseConfigSchema,
11257
- isActive: external_exports.boolean()
11258
- });
11259
11381
  var emailNotificationConfigurationsQuerySchema = external_exports.object({
11260
11382
  id: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
11261
11383
  templateKey: external_exports.union([import_sdk_js_global_types.emailTemplateKeySchema, external_exports.array(import_sdk_js_global_types.emailTemplateKeySchema)]).optional(),
@@ -11266,7 +11388,7 @@ var emailNotificationConfigurationsQuerySchema = external_exports.object({
11266
11388
 
11267
11389
  // src/requests/CreateEmailNotificationConfiguration.ts
11268
11390
  var import_sdk_js_core = require("@deliverart/sdk-js-core");
11269
- var createEmailNotificationConfigurationInputSchema = writableCreateEmailNotificationConfigurationSchema.required();
11391
+ var createEmailNotificationConfigurationInputSchema = writableCreateEmailNotificationConfigurationSchema;
11270
11392
  var createEmailNotificationConfigurationResponseSchema = emailNotificationConfigurationSchema;
11271
11393
  var CreateEmailNotificationConfiguration = class extends import_sdk_js_core.AbstractApiRequest {
11272
11394
  constructor(input) {
@@ -11381,7 +11503,7 @@ var GetEmailNotificationConfigurationsFromPointOfSale = class extends import_sdk
11381
11503
 
11382
11504
  // src/requests/UpdateEmailNotificationConfiguration.ts
11383
11505
  var import_sdk_js_core6 = require("@deliverart/sdk-js-core");
11384
- var updateEmailNotificationConfigurationInputSchema = writableEmailNotificationConfigurationSchema.partial();
11506
+ var updateEmailNotificationConfigurationInputSchema = writableEmailNotificationConfigurationSchema;
11385
11507
  var updateEmailNotificationConfigurationResponseSchema = emailNotificationConfigurationSchema;
11386
11508
  var UpdateEmailNotificationConfiguration = class extends import_sdk_js_core6.AbstractApiRequest {
11387
11509
  constructor(emailNotificationConfigurationId, input) {