@zyphr-dev/node-sdk 0.1.60 → 0.1.61

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyphr-dev/node-sdk",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "description": "Official Zyphr SDK for Node.js, React, and React Native",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -476,6 +476,7 @@ src/models/VerifySmsConfigResponse.ts
476
476
  src/models/WaaSApplication.ts
477
477
  src/models/WaaSBatchPublishRequest.ts
478
478
  src/models/WaaSBatchPublishResponse.ts
479
+ src/models/WaaSBatchPublishResult.ts
479
480
  src/models/WaaSDelivery.ts
480
481
  src/models/WaaSEndpoint.ts
481
482
  src/models/WaaSEventType.ts
@@ -13,18 +13,32 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { WaaSBatchPublishResult } from './WaaSBatchPublishResult';
17
+ import {
18
+ WaaSBatchPublishResultFromJSON,
19
+ WaaSBatchPublishResultFromJSONTyped,
20
+ WaaSBatchPublishResultToJSON,
21
+ WaaSBatchPublishResultToJSONTyped,
22
+ } from './WaaSBatchPublishResult';
23
+
16
24
  /**
17
25
  *
18
26
  * @export
19
27
  * @interface WaaSBatchPublishResponse
20
28
  */
21
29
  export interface WaaSBatchPublishResponse {
30
+ /**
31
+ * Events in the request
32
+ * @type {number}
33
+ * @memberof WaaSBatchPublishResponse
34
+ */
35
+ total?: number;
22
36
  /**
23
37
  *
24
38
  * @type {number}
25
39
  * @memberof WaaSBatchPublishResponse
26
40
  */
27
- published?: number;
41
+ succeeded?: number;
28
42
  /**
29
43
  *
30
44
  * @type {number}
@@ -32,11 +46,11 @@ export interface WaaSBatchPublishResponse {
32
46
  */
33
47
  failed?: number;
34
48
  /**
35
- *
36
- * @type {Array<object>}
49
+ * One entry per event, in request order. A published event has the same fields as a single publish (`event_id`, `endpoints_matched`, `deliveries_created`, `created_at`, ...). An event that was not published has `error` and `code` instead, e.g. `code: usage_limit_exceeded` when the monthly event limit is reached. Tell them apart by the presence of `error`.
50
+ * @type {Array<WaaSBatchPublishResult>}
37
51
  * @memberof WaaSBatchPublishResponse
38
52
  */
39
- results?: Array<object>;
53
+ results?: Array<WaaSBatchPublishResult>;
40
54
  }
41
55
 
42
56
  /**
@@ -56,9 +70,10 @@ export function WaaSBatchPublishResponseFromJSONTyped(json: any, ignoreDiscrimin
56
70
  }
57
71
  return {
58
72
 
59
- 'published': json['published'] == null ? undefined : json['published'],
73
+ 'total': json['total'] == null ? undefined : json['total'],
74
+ 'succeeded': json['succeeded'] == null ? undefined : json['succeeded'],
60
75
  'failed': json['failed'] == null ? undefined : json['failed'],
61
- 'results': json['results'] == null ? undefined : json['results'],
76
+ 'results': json['results'] == null ? undefined : ((json['results'] as Array<any>).map(WaaSBatchPublishResultFromJSON)),
62
77
  };
63
78
  }
64
79
 
@@ -73,9 +88,10 @@ export function WaaSBatchPublishResponseToJSONTyped(value?: WaaSBatchPublishResp
73
88
 
74
89
  return {
75
90
 
76
- 'published': value['published'],
91
+ 'total': value['total'],
92
+ 'succeeded': value['succeeded'],
77
93
  'failed': value['failed'],
78
- 'results': value['results'],
94
+ 'results': value['results'] == null ? undefined : ((value['results'] as Array<any>).map(WaaSBatchPublishResultToJSON)),
79
95
  };
80
96
  }
81
97
 
@@ -0,0 +1,129 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Zyphr API
5
+ * Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. > **Test keys are being retired.** `zy_test_*` keys are no longer issued, and existing ones stop working on **21 October 2026**. They never delivered mail — sends were mocked and marked sent without reaching a provider, so they could not verify domain authentication, rendering, or deliverability. To test your integration, use a `zy_live_*` key against a verified domain and send to an address you control. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Account Sending Status Every authenticated response carries the account\'s current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@zyphr.dev
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface WaaSBatchPublishResult
20
+ */
21
+ export interface WaaSBatchPublishResult {
22
+ /**
23
+ * Set when the event was published
24
+ * @type {string}
25
+ * @memberof WaaSBatchPublishResult
26
+ */
27
+ eventId?: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof WaaSBatchPublishResult
32
+ */
33
+ eventType?: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof WaaSBatchPublishResult
38
+ */
39
+ tenantId?: string;
40
+ /**
41
+ * Set when the event was published
42
+ * @type {number}
43
+ * @memberof WaaSBatchPublishResult
44
+ */
45
+ endpointsMatched?: number;
46
+ /**
47
+ * Set when the event was published
48
+ * @type {number}
49
+ * @memberof WaaSBatchPublishResult
50
+ */
51
+ deliveriesCreated?: number;
52
+ /**
53
+ * Set when the event was published
54
+ * @type {Date}
55
+ * @memberof WaaSBatchPublishResult
56
+ */
57
+ createdAt?: Date;
58
+ /**
59
+ * True when the idempotency key matched an earlier publish
60
+ * @type {boolean}
61
+ * @memberof WaaSBatchPublishResult
62
+ */
63
+ deduplicated?: boolean;
64
+ /**
65
+ * Set when the event was not published
66
+ * @type {string}
67
+ * @memberof WaaSBatchPublishResult
68
+ */
69
+ error?: string;
70
+ /**
71
+ * Set when the event was not published, e.g. `usage_limit_exceeded` (monthly event limit reached), `event_type_not_found`, `event_type_deprecated`, `internal_error`
72
+ * @type {string}
73
+ * @memberof WaaSBatchPublishResult
74
+ */
75
+ code?: string;
76
+ }
77
+
78
+ /**
79
+ * Check if a given object implements the WaaSBatchPublishResult interface.
80
+ */
81
+ export function instanceOfWaaSBatchPublishResult(value: object): value is WaaSBatchPublishResult {
82
+ return true;
83
+ }
84
+
85
+ export function WaaSBatchPublishResultFromJSON(json: any): WaaSBatchPublishResult {
86
+ return WaaSBatchPublishResultFromJSONTyped(json, false);
87
+ }
88
+
89
+ export function WaaSBatchPublishResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): WaaSBatchPublishResult {
90
+ if (json == null) {
91
+ return json;
92
+ }
93
+ return {
94
+
95
+ 'eventId': json['event_id'] == null ? undefined : json['event_id'],
96
+ 'eventType': json['event_type'] == null ? undefined : json['event_type'],
97
+ 'tenantId': json['tenant_id'] == null ? undefined : json['tenant_id'],
98
+ 'endpointsMatched': json['endpoints_matched'] == null ? undefined : json['endpoints_matched'],
99
+ 'deliveriesCreated': json['deliveries_created'] == null ? undefined : json['deliveries_created'],
100
+ 'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
101
+ 'deduplicated': json['deduplicated'] == null ? undefined : json['deduplicated'],
102
+ 'error': json['error'] == null ? undefined : json['error'],
103
+ 'code': json['code'] == null ? undefined : json['code'],
104
+ };
105
+ }
106
+
107
+ export function WaaSBatchPublishResultToJSON(json: any): WaaSBatchPublishResult {
108
+ return WaaSBatchPublishResultToJSONTyped(json, false);
109
+ }
110
+
111
+ export function WaaSBatchPublishResultToJSONTyped(value?: WaaSBatchPublishResult | null, ignoreDiscriminator: boolean = false): any {
112
+ if (value == null) {
113
+ return value;
114
+ }
115
+
116
+ return {
117
+
118
+ 'event_id': value['eventId'],
119
+ 'event_type': value['eventType'],
120
+ 'tenant_id': value['tenantId'],
121
+ 'endpoints_matched': value['endpointsMatched'],
122
+ 'deliveries_created': value['deliveriesCreated'],
123
+ 'created_at': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
124
+ 'deduplicated': value['deduplicated'],
125
+ 'error': value['error'],
126
+ 'code': value['code'],
127
+ };
128
+ }
129
+
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface WaaSPublishEventResponse {
22
22
  /**
23
- *
23
+ * Prefixed id, not a bare UUID
24
24
  * @type {string}
25
25
  * @memberof WaaSPublishEventResponse
26
26
  */
@@ -49,6 +49,18 @@ export interface WaaSPublishEventResponse {
49
49
  * @memberof WaaSPublishEventResponse
50
50
  */
51
51
  deliveriesCreated?: number;
52
+ /**
53
+ *
54
+ * @type {Date}
55
+ * @memberof WaaSPublishEventResponse
56
+ */
57
+ createdAt?: Date;
58
+ /**
59
+ * Present and true when the idempotency key matched an earlier publish, which is returned instead of publishing again
60
+ * @type {boolean}
61
+ * @memberof WaaSPublishEventResponse
62
+ */
63
+ deduplicated?: boolean;
52
64
  }
53
65
 
54
66
  /**
@@ -73,6 +85,8 @@ export function WaaSPublishEventResponseFromJSONTyped(json: any, ignoreDiscrimin
73
85
  'tenantId': json['tenant_id'] == null ? undefined : json['tenant_id'],
74
86
  'endpointsMatched': json['endpoints_matched'] == null ? undefined : json['endpoints_matched'],
75
87
  'deliveriesCreated': json['deliveries_created'] == null ? undefined : json['deliveries_created'],
88
+ 'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
89
+ 'deduplicated': json['deduplicated'] == null ? undefined : json['deduplicated'],
76
90
  };
77
91
  }
78
92
 
@@ -92,6 +106,8 @@ export function WaaSPublishEventResponseToJSONTyped(value?: WaaSPublishEventResp
92
106
  'tenant_id': value['tenantId'],
93
107
  'endpoints_matched': value['endpointsMatched'],
94
108
  'deliveries_created': value['deliveriesCreated'],
109
+ 'created_at': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
110
+ 'deduplicated': value['deduplicated'],
95
111
  };
96
112
  }
97
113
 
@@ -435,6 +435,7 @@ export * from './VerifySmsConfigResponse';
435
435
  export * from './WaaSApplication';
436
436
  export * from './WaaSBatchPublishRequest';
437
437
  export * from './WaaSBatchPublishResponse';
438
+ export * from './WaaSBatchPublishResult';
438
439
  export * from './WaaSDelivery';
439
440
  export * from './WaaSEndpoint';
440
441
  export * from './WaaSEventType';