@zyphr-dev/node-sdk 0.1.44 → 0.1.46
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/dist/index.cjs +257 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +217 -14
- package/dist/index.d.ts +217 -14
- package/dist/index.js +241 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +3 -0
- package/src/clientAuth.ts +34 -8
- package/src/src/apis/AuthApplicationApi.ts +69 -0
- package/src/src/apis/AuthUserProfileApi.ts +76 -0
- package/src/src/models/ApplicationSelf.ts +9 -0
- package/src/src/models/ChangePasswordRequest.ts +75 -0
- package/src/src/models/SetSelfApplicationTestRecipientsRequest.ts +66 -0
- package/src/src/models/WebhookDelivery.ts +12 -4
- package/src/src/models/WebhookDeliveryDetail.ts +12 -4
- package/src/src/models/WebhookEventType.ts +80 -0
- package/src/src/models/WebhookEventTypesResponseData.ts +12 -4
- package/src/src/models/WebhookTestEventResponseData.ts +14 -4
- package/src/src/models/index.ts +3 -0
|
@@ -0,0 +1,80 @@
|
|
|
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. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## 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
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Canonical webhook event type. Matches the event `type` field on the webhook delivery envelope and the values returned by `GET /v1/webhooks/event-types`. Source of truth: packages/shared/src/constants/webhookEventRegistry.ts.
|
|
18
|
+
* @export
|
|
19
|
+
*/
|
|
20
|
+
export const WebhookEventType = {
|
|
21
|
+
EMAIL_QUEUED: 'email.queued',
|
|
22
|
+
EMAIL_SENT: 'email.sent',
|
|
23
|
+
EMAIL_DELIVERED: 'email.delivered',
|
|
24
|
+
EMAIL_BOUNCED: 'email.bounced',
|
|
25
|
+
EMAIL_SOFT_BOUNCED: 'email.soft_bounced',
|
|
26
|
+
EMAIL_COMPLAINED: 'email.complained',
|
|
27
|
+
EMAIL_OPENED: 'email.opened',
|
|
28
|
+
EMAIL_CLICKED: 'email.clicked',
|
|
29
|
+
EMAIL_FAILED: 'email.failed',
|
|
30
|
+
EMAIL_SUPPRESSED: 'email.suppressed',
|
|
31
|
+
EMAIL_RECEIVED: 'email.received',
|
|
32
|
+
PUSH_SENT: 'push.sent',
|
|
33
|
+
PUSH_DELIVERED: 'push.delivered',
|
|
34
|
+
PUSH_FAILED: 'push.failed',
|
|
35
|
+
PUSH_EXPIRED: 'push.expired',
|
|
36
|
+
USER_CREATED: 'user.created',
|
|
37
|
+
USER_LOGIN: 'user.login',
|
|
38
|
+
USER_LOGOUT: 'user.logout',
|
|
39
|
+
USER_PASSWORD_CHANGED: 'user.password_changed',
|
|
40
|
+
USER_PASSWORD_RESET_REQUESTED: 'user.password_reset_requested',
|
|
41
|
+
USER_EMAIL_VERIFIED: 'user.email_verified',
|
|
42
|
+
USER_PHONE_VERIFIED: 'user.phone_verified',
|
|
43
|
+
USER_DELETED: 'user.deleted',
|
|
44
|
+
USER_SESSION_REVOKED: 'user.session_revoked',
|
|
45
|
+
USER_MFA_ENABLED: 'user.mfa_enabled',
|
|
46
|
+
USER_MFA_DISABLED: 'user.mfa_disabled',
|
|
47
|
+
USER_IMPERSONATED: 'user.impersonated',
|
|
48
|
+
DOMAIN_VERIFIED: 'domain.verified',
|
|
49
|
+
DOMAIN_VERIFICATION_FAILED: 'domain.verification_failed'
|
|
50
|
+
} as const;
|
|
51
|
+
export type WebhookEventType = typeof WebhookEventType[keyof typeof WebhookEventType];
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export function instanceOfWebhookEventType(value: any): boolean {
|
|
55
|
+
for (const key in WebhookEventType) {
|
|
56
|
+
if (Object.prototype.hasOwnProperty.call(WebhookEventType, key)) {
|
|
57
|
+
if (WebhookEventType[key as keyof typeof WebhookEventType] === value) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function WebhookEventTypeFromJSON(json: any): WebhookEventType {
|
|
66
|
+
return WebhookEventTypeFromJSONTyped(json, false);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function WebhookEventTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookEventType {
|
|
70
|
+
return json as WebhookEventType;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function WebhookEventTypeToJSON(value?: WebhookEventType | null): any {
|
|
74
|
+
return value as any;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function WebhookEventTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): WebhookEventType {
|
|
78
|
+
return value as WebhookEventType;
|
|
79
|
+
}
|
|
80
|
+
|
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
+
import type { WebhookEventType } from './WebhookEventType';
|
|
17
|
+
import {
|
|
18
|
+
WebhookEventTypeFromJSON,
|
|
19
|
+
WebhookEventTypeFromJSONTyped,
|
|
20
|
+
WebhookEventTypeToJSON,
|
|
21
|
+
WebhookEventTypeToJSONTyped,
|
|
22
|
+
} from './WebhookEventType';
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
*
|
|
18
26
|
* @export
|
|
@@ -21,10 +29,10 @@ import { mapValues } from '../runtime';
|
|
|
21
29
|
export interface WebhookEventTypesResponseData {
|
|
22
30
|
/**
|
|
23
31
|
*
|
|
24
|
-
* @type {Array<
|
|
32
|
+
* @type {Array<WebhookEventType>}
|
|
25
33
|
* @memberof WebhookEventTypesResponseData
|
|
26
34
|
*/
|
|
27
|
-
eventTypes?: Array<
|
|
35
|
+
eventTypes?: Array<WebhookEventType>;
|
|
28
36
|
/**
|
|
29
37
|
*
|
|
30
38
|
* @type {Array<object>}
|
|
@@ -62,7 +70,7 @@ export function WebhookEventTypesResponseDataFromJSONTyped(json: any, ignoreDisc
|
|
|
62
70
|
}
|
|
63
71
|
return {
|
|
64
72
|
|
|
65
|
-
'eventTypes': json['event_types'] == null ? undefined : json['event_types'],
|
|
73
|
+
'eventTypes': json['event_types'] == null ? undefined : ((json['event_types'] as Array<any>).map(WebhookEventTypeFromJSON)),
|
|
66
74
|
'registry': json['registry'] == null ? undefined : json['registry'],
|
|
67
75
|
'categories': json['categories'] == null ? undefined : json['categories'],
|
|
68
76
|
'apiVersion': json['api_version'] == null ? undefined : json['api_version'],
|
|
@@ -80,7 +88,7 @@ export function WebhookEventTypesResponseDataToJSONTyped(value?: WebhookEventTyp
|
|
|
80
88
|
|
|
81
89
|
return {
|
|
82
90
|
|
|
83
|
-
'event_types': value['eventTypes'],
|
|
91
|
+
'event_types': value['eventTypes'] == null ? undefined : ((value['eventTypes'] as Array<any>).map(WebhookEventTypeToJSON)),
|
|
84
92
|
'registry': value['registry'],
|
|
85
93
|
'categories': value['categories'],
|
|
86
94
|
'api_version': value['apiVersion'],
|
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
+
import type { WebhookEventType } from './WebhookEventType';
|
|
17
|
+
import {
|
|
18
|
+
WebhookEventTypeFromJSON,
|
|
19
|
+
WebhookEventTypeFromJSONTyped,
|
|
20
|
+
WebhookEventTypeToJSON,
|
|
21
|
+
WebhookEventTypeToJSONTyped,
|
|
22
|
+
} from './WebhookEventType';
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
*
|
|
18
26
|
* @export
|
|
@@ -27,10 +35,10 @@ export interface WebhookTestEventResponseData {
|
|
|
27
35
|
deliveryId?: string;
|
|
28
36
|
/**
|
|
29
37
|
*
|
|
30
|
-
* @type {
|
|
38
|
+
* @type {WebhookEventType}
|
|
31
39
|
* @memberof WebhookTestEventResponseData
|
|
32
40
|
*/
|
|
33
|
-
eventType?:
|
|
41
|
+
eventType?: WebhookEventType;
|
|
34
42
|
/**
|
|
35
43
|
*
|
|
36
44
|
* @type {object}
|
|
@@ -45,6 +53,8 @@ export interface WebhookTestEventResponseData {
|
|
|
45
53
|
status?: string;
|
|
46
54
|
}
|
|
47
55
|
|
|
56
|
+
|
|
57
|
+
|
|
48
58
|
/**
|
|
49
59
|
* Check if a given object implements the WebhookTestEventResponseData interface.
|
|
50
60
|
*/
|
|
@@ -63,7 +73,7 @@ export function WebhookTestEventResponseDataFromJSONTyped(json: any, ignoreDiscr
|
|
|
63
73
|
return {
|
|
64
74
|
|
|
65
75
|
'deliveryId': json['delivery_id'] == null ? undefined : json['delivery_id'],
|
|
66
|
-
'eventType': json['event_type'] == null ? undefined : json['event_type'],
|
|
76
|
+
'eventType': json['event_type'] == null ? undefined : WebhookEventTypeFromJSON(json['event_type']),
|
|
67
77
|
'payload': json['payload'] == null ? undefined : json['payload'],
|
|
68
78
|
'status': json['status'] == null ? undefined : json['status'],
|
|
69
79
|
};
|
|
@@ -81,7 +91,7 @@ export function WebhookTestEventResponseDataToJSONTyped(value?: WebhookTestEvent
|
|
|
81
91
|
return {
|
|
82
92
|
|
|
83
93
|
'delivery_id': value['deliveryId'],
|
|
84
|
-
'event_type': value['eventType'],
|
|
94
|
+
'event_type': WebhookEventTypeToJSON(value['eventType']),
|
|
85
95
|
'payload': value['payload'],
|
|
86
96
|
'status': value['status'],
|
|
87
97
|
};
|
package/src/src/models/index.ts
CHANGED
|
@@ -48,6 +48,7 @@ export * from './BulkUpsertAuthEmailTemplatesResponse';
|
|
|
48
48
|
export * from './Category';
|
|
49
49
|
export * from './CategoryListResponse';
|
|
50
50
|
export * from './CategoryResponse';
|
|
51
|
+
export * from './ChangePasswordRequest';
|
|
51
52
|
export * from './CloseWaaSEndpointCircuit200Response';
|
|
52
53
|
export * from './CloseWaaSEndpointCircuit200ResponseData';
|
|
53
54
|
export * from './ConfirmEmailVerificationRequest';
|
|
@@ -327,6 +328,7 @@ export * from './SetEndUserClaims200ResponseData';
|
|
|
327
328
|
export * from './SetEndUserClaimsRequest';
|
|
328
329
|
export * from './SetPreferencesRequest';
|
|
329
330
|
export * from './SetPreferencesRequestPreferencesInner';
|
|
331
|
+
export * from './SetSelfApplicationTestRecipientsRequest';
|
|
330
332
|
export * from './SignInAnonymouslyRequest';
|
|
331
333
|
export * from './SignInWithGameCenterRequest';
|
|
332
334
|
export * from './SignInWithGooglePlayGamesRequest';
|
|
@@ -464,6 +466,7 @@ export * from './WebhookDeliveryListResponse';
|
|
|
464
466
|
export * from './WebhookDeliveryResponse';
|
|
465
467
|
export * from './WebhookDeliveryRetryResponse';
|
|
466
468
|
export * from './WebhookDeliveryRetryResponseData';
|
|
469
|
+
export * from './WebhookEventType';
|
|
467
470
|
export * from './WebhookEventTypesResponse';
|
|
468
471
|
export * from './WebhookEventTypesResponseData';
|
|
469
472
|
export * from './WebhookIpsResponse';
|