@zyphr-dev/node-sdk 0.1.43 → 0.1.45
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 +6 -4
- package/dist/index.cjs +511 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +522 -21
- package/dist/index.d.ts +522 -21
- package/dist/index.js +472 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +8 -0
- package/src/client.ts +18 -3
- package/src/clientAuth.ts +45 -12
- package/src/src/apis/AuthApplicationApi.ts +162 -0
- package/src/src/apis/AuthEmailTemplatesApi.ts +4 -4
- package/src/src/apis/AuthUserDirectoryApi.ts +66 -0
- package/src/src/apis/AuthUserProfileApi.ts +76 -0
- package/src/src/apis/index.ts +1 -0
- package/src/src/models/ApplicationSelf.ts +127 -0
- package/src/src/models/ApplicationSelfResponse.ts +88 -0
- package/src/src/models/AuthEmailTemplateTestRequest.ts +1 -1
- package/src/src/models/AuthMethods.ts +111 -0
- package/src/src/models/ChangePasswordRequest.ts +75 -0
- package/src/src/models/GetEndUserAuthMethods200Response.ts +88 -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 +79 -0
- package/src/src/models/WebhookEventTypesResponseData.ts +12 -4
- package/src/src/models/WebhookTestEventResponseData.ts +14 -4
- package/src/src/models/index.ts +7 -0
|
@@ -0,0 +1,79 @@
|
|
|
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_RECEIVED: 'email.received',
|
|
31
|
+
PUSH_SENT: 'push.sent',
|
|
32
|
+
PUSH_DELIVERED: 'push.delivered',
|
|
33
|
+
PUSH_FAILED: 'push.failed',
|
|
34
|
+
PUSH_EXPIRED: 'push.expired',
|
|
35
|
+
USER_CREATED: 'user.created',
|
|
36
|
+
USER_LOGIN: 'user.login',
|
|
37
|
+
USER_LOGOUT: 'user.logout',
|
|
38
|
+
USER_PASSWORD_CHANGED: 'user.password_changed',
|
|
39
|
+
USER_PASSWORD_RESET_REQUESTED: 'user.password_reset_requested',
|
|
40
|
+
USER_EMAIL_VERIFIED: 'user.email_verified',
|
|
41
|
+
USER_PHONE_VERIFIED: 'user.phone_verified',
|
|
42
|
+
USER_DELETED: 'user.deleted',
|
|
43
|
+
USER_SESSION_REVOKED: 'user.session_revoked',
|
|
44
|
+
USER_MFA_ENABLED: 'user.mfa_enabled',
|
|
45
|
+
USER_MFA_DISABLED: 'user.mfa_disabled',
|
|
46
|
+
USER_IMPERSONATED: 'user.impersonated',
|
|
47
|
+
DOMAIN_VERIFIED: 'domain.verified',
|
|
48
|
+
DOMAIN_VERIFICATION_FAILED: 'domain.verification_failed'
|
|
49
|
+
} as const;
|
|
50
|
+
export type WebhookEventType = typeof WebhookEventType[keyof typeof WebhookEventType];
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export function instanceOfWebhookEventType(value: any): boolean {
|
|
54
|
+
for (const key in WebhookEventType) {
|
|
55
|
+
if (Object.prototype.hasOwnProperty.call(WebhookEventType, key)) {
|
|
56
|
+
if (WebhookEventType[key as keyof typeof WebhookEventType] === value) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function WebhookEventTypeFromJSON(json: any): WebhookEventType {
|
|
65
|
+
return WebhookEventTypeFromJSONTyped(json, false);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function WebhookEventTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookEventType {
|
|
69
|
+
return json as WebhookEventType;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function WebhookEventTypeToJSON(value?: WebhookEventType | null): any {
|
|
73
|
+
return value as any;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function WebhookEventTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): WebhookEventType {
|
|
77
|
+
return value as WebhookEventType;
|
|
78
|
+
}
|
|
79
|
+
|
|
@@ -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
|
@@ -10,6 +10,8 @@ export * from './AddWorkflowStepRequest';
|
|
|
10
10
|
export * from './ApiError';
|
|
11
11
|
export * from './ApiErrorError';
|
|
12
12
|
export * from './ApiErrorMeta';
|
|
13
|
+
export * from './ApplicationSelf';
|
|
14
|
+
export * from './ApplicationSelfResponse';
|
|
13
15
|
export * from './AuthEmailTemplate';
|
|
14
16
|
export * from './AuthEmailTemplateDefault';
|
|
15
17
|
export * from './AuthEmailTemplateDefaultResponse';
|
|
@@ -30,6 +32,7 @@ export * from './AuthEmailType';
|
|
|
30
32
|
export * from './AuthLoginResponse';
|
|
31
33
|
export * from './AuthLoginResult';
|
|
32
34
|
export * from './AuthLoginResultMfaChallenge';
|
|
35
|
+
export * from './AuthMethods';
|
|
33
36
|
export * from './AuthResult';
|
|
34
37
|
export * from './AuthResultResponse';
|
|
35
38
|
export * from './AuthSession';
|
|
@@ -45,6 +48,7 @@ export * from './BulkUpsertAuthEmailTemplatesResponse';
|
|
|
45
48
|
export * from './Category';
|
|
46
49
|
export * from './CategoryListResponse';
|
|
47
50
|
export * from './CategoryResponse';
|
|
51
|
+
export * from './ChangePasswordRequest';
|
|
48
52
|
export * from './CloseWaaSEndpointCircuit200Response';
|
|
49
53
|
export * from './CloseWaaSEndpointCircuit200ResponseData';
|
|
50
54
|
export * from './ConfirmEmailVerificationRequest';
|
|
@@ -123,6 +127,7 @@ export * from './GenerateSubscriberTokenRequest';
|
|
|
123
127
|
export * from './GenerateWaaSPortalToken201Response';
|
|
124
128
|
export * from './GetDomain200Response';
|
|
125
129
|
export * from './GetDomain200ResponseMeta';
|
|
130
|
+
export * from './GetEndUserAuthMethods200Response';
|
|
126
131
|
export * from './GetEndUserById200Response';
|
|
127
132
|
export * from './GetEndUserClaims200Response';
|
|
128
133
|
export * from './GetEndUserClaims200ResponseData';
|
|
@@ -323,6 +328,7 @@ export * from './SetEndUserClaims200ResponseData';
|
|
|
323
328
|
export * from './SetEndUserClaimsRequest';
|
|
324
329
|
export * from './SetPreferencesRequest';
|
|
325
330
|
export * from './SetPreferencesRequestPreferencesInner';
|
|
331
|
+
export * from './SetSelfApplicationTestRecipientsRequest';
|
|
326
332
|
export * from './SignInAnonymouslyRequest';
|
|
327
333
|
export * from './SignInWithGameCenterRequest';
|
|
328
334
|
export * from './SignInWithGooglePlayGamesRequest';
|
|
@@ -460,6 +466,7 @@ export * from './WebhookDeliveryListResponse';
|
|
|
460
466
|
export * from './WebhookDeliveryResponse';
|
|
461
467
|
export * from './WebhookDeliveryRetryResponse';
|
|
462
468
|
export * from './WebhookDeliveryRetryResponseData';
|
|
469
|
+
export * from './WebhookEventType';
|
|
463
470
|
export * from './WebhookEventTypesResponse';
|
|
464
471
|
export * from './WebhookEventTypesResponseData';
|
|
465
472
|
export * from './WebhookIpsResponse';
|