@zyphr-dev/node-sdk 0.1.23 → 0.1.25

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.23",
3
+ "version": "0.1.25",
4
4
  "description": "Official Zyphr SDK for Node.js, React, and React Native",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -66,6 +66,7 @@ src/models/AuthUser.ts
66
66
  src/models/AuthUserResponse.ts
67
67
  src/models/AuthUserResponseData.ts
68
68
  src/models/BatchPublishWaaSEvents201Response.ts
69
+ src/models/BatchRecipient.ts
69
70
  src/models/BulkRetryWebhookDeliveriesRequest.ts
70
71
  src/models/BulkUpsertAuthEmailTemplatesRequest.ts
71
72
  src/models/BulkUpsertAuthEmailTemplatesResponse.ts
@@ -82,6 +83,11 @@ src/models/ConsentRecordResponseData.ts
82
83
  src/models/ConsentStatus.ts
83
84
  src/models/ConsentStatusResponse.ts
84
85
  src/models/ConsentWithdrawResponse.ts
86
+ src/models/ConvertAnonymousUserRequest.ts
87
+ src/models/ConvertAnonymousUserRequestOneOf.ts
88
+ src/models/ConvertAnonymousUserRequestOneOf1.ts
89
+ src/models/ConvertAnonymousUserRequestOneOf1AppleUser.ts
90
+ src/models/ConvertAnonymousUserRequestOneOf1AppleUserName.ts
85
91
  src/models/CreateCategoryRequest.ts
86
92
  src/models/CreateSubscriberRequest.ts
87
93
  src/models/CreateTemplateRequest.ts
@@ -269,6 +275,7 @@ src/models/SessionListResponseData.ts
269
275
  src/models/SessionListResponseDataSessionInfo.ts
270
276
  src/models/SetPreferencesRequest.ts
271
277
  src/models/SetPreferencesRequestPreferencesInner.ts
278
+ src/models/SignInAnonymouslyRequest.ts
272
279
  src/models/SlackMessage.ts
273
280
  src/models/SlackMessageListResponse.ts
274
281
  src/models/SlackMessageListResponseMeta.ts
@@ -17,21 +17,35 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  ApiError,
19
19
  AuthResultResponse,
20
+ ConvertAnonymousUserRequest,
20
21
  RegisterRequest,
22
+ SignInAnonymouslyRequest,
21
23
  } from '../models/index';
22
24
  import {
23
25
  ApiErrorFromJSON,
24
26
  ApiErrorToJSON,
25
27
  AuthResultResponseFromJSON,
26
28
  AuthResultResponseToJSON,
29
+ ConvertAnonymousUserRequestFromJSON,
30
+ ConvertAnonymousUserRequestToJSON,
27
31
  RegisterRequestFromJSON,
28
32
  RegisterRequestToJSON,
33
+ SignInAnonymouslyRequestFromJSON,
34
+ SignInAnonymouslyRequestToJSON,
29
35
  } from '../models/index';
30
36
 
37
+ export interface AuthRegistrationApiConvertAnonymousUserOperationRequest {
38
+ convertAnonymousUserRequest: ConvertAnonymousUserRequest;
39
+ }
40
+
31
41
  export interface AuthRegistrationApiRegisterEndUserRequest {
32
42
  registerRequest: RegisterRequest;
33
43
  }
34
44
 
45
+ export interface AuthRegistrationApiSignInAnonymouslyOperationRequest {
46
+ signInAnonymouslyRequest: SignInAnonymouslyRequest;
47
+ }
48
+
35
49
  /**
36
50
  * AuthRegistrationApi - interface
37
51
  *
@@ -39,6 +53,22 @@ export interface AuthRegistrationApiRegisterEndUserRequest {
39
53
  * @interface AuthRegistrationApiInterface
40
54
  */
41
55
  export interface AuthRegistrationApiInterface {
56
+ /**
57
+ * Upgrade the calling anonymous user to a full email+password account in place. The end_user.id is preserved, so customer-domain tables with foreign keys to end_users.id need no migration on conversion. All prior sessions for the user (including the anonymous token used to make this call) are revoked. A fresh token pair is returned in the response body. The conversion is the moment the user becomes billable -- MAU is tracked from this point forward.
58
+ * @summary Convert anonymous account to a full account
59
+ * @param {ConvertAnonymousUserRequest} convertAnonymousUserRequest
60
+ * @param {*} [options] Override http request option.
61
+ * @throws {RequiredError}
62
+ * @memberof AuthRegistrationApiInterface
63
+ */
64
+ convertAnonymousUserRaw(requestParameters: AuthRegistrationApiConvertAnonymousUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthResultResponse>>;
65
+
66
+ /**
67
+ * Upgrade the calling anonymous user to a full email+password account in place. The end_user.id is preserved, so customer-domain tables with foreign keys to end_users.id need no migration on conversion. All prior sessions for the user (including the anonymous token used to make this call) are revoked. A fresh token pair is returned in the response body. The conversion is the moment the user becomes billable -- MAU is tracked from this point forward.
68
+ * Convert anonymous account to a full account
69
+ */
70
+ convertAnonymousUser(convertAnonymousUserRequest: ConvertAnonymousUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthResultResponse>;
71
+
42
72
  /**
43
73
  * Register a new end user with email and password.
44
74
  * @summary Register a new end user
@@ -55,6 +85,22 @@ export interface AuthRegistrationApiInterface {
55
85
  */
56
86
  registerEndUser(registerRequest: RegisterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthResultResponse>;
57
87
 
88
+ /**
89
+ * Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
90
+ * @summary Sign in anonymously
91
+ * @param {SignInAnonymouslyRequest} signInAnonymouslyRequest
92
+ * @param {*} [options] Override http request option.
93
+ * @throws {RequiredError}
94
+ * @memberof AuthRegistrationApiInterface
95
+ */
96
+ signInAnonymouslyRaw(requestParameters: AuthRegistrationApiSignInAnonymouslyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthResultResponse>>;
97
+
98
+ /**
99
+ * Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
100
+ * Sign in anonymously
101
+ */
102
+ signInAnonymously(signInAnonymouslyRequest: SignInAnonymouslyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthResultResponse>;
103
+
58
104
  }
59
105
 
60
106
  /**
@@ -62,6 +108,44 @@ export interface AuthRegistrationApiInterface {
62
108
  */
63
109
  export class AuthRegistrationApi extends runtime.BaseAPI implements AuthRegistrationApiInterface {
64
110
 
111
+ /**
112
+ * Upgrade the calling anonymous user to a full email+password account in place. The end_user.id is preserved, so customer-domain tables with foreign keys to end_users.id need no migration on conversion. All prior sessions for the user (including the anonymous token used to make this call) are revoked. A fresh token pair is returned in the response body. The conversion is the moment the user becomes billable -- MAU is tracked from this point forward.
113
+ * Convert anonymous account to a full account
114
+ */
115
+ async convertAnonymousUserRaw(requestParameters: AuthRegistrationApiConvertAnonymousUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthResultResponse>> {
116
+ if (requestParameters['convertAnonymousUserRequest'] == null) {
117
+ throw new runtime.RequiredError(
118
+ 'convertAnonymousUserRequest',
119
+ 'Required parameter "convertAnonymousUserRequest" was null or undefined when calling convertAnonymousUser().'
120
+ );
121
+ }
122
+
123
+ const queryParameters: any = {};
124
+
125
+ const headerParameters: runtime.HTTPHeaders = {};
126
+
127
+ headerParameters['Content-Type'] = 'application/json';
128
+
129
+ const response = await this.request({
130
+ path: `/auth/users/convert`,
131
+ method: 'POST',
132
+ headers: headerParameters,
133
+ query: queryParameters,
134
+ body: ConvertAnonymousUserRequestToJSON(requestParameters['convertAnonymousUserRequest']),
135
+ }, initOverrides);
136
+
137
+ return new runtime.JSONApiResponse(response, (jsonValue) => AuthResultResponseFromJSON(jsonValue));
138
+ }
139
+
140
+ /**
141
+ * Upgrade the calling anonymous user to a full email+password account in place. The end_user.id is preserved, so customer-domain tables with foreign keys to end_users.id need no migration on conversion. All prior sessions for the user (including the anonymous token used to make this call) are revoked. A fresh token pair is returned in the response body. The conversion is the moment the user becomes billable -- MAU is tracked from this point forward.
142
+ * Convert anonymous account to a full account
143
+ */
144
+ async convertAnonymousUser(convertAnonymousUserRequest: ConvertAnonymousUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthResultResponse> {
145
+ const response = await this.convertAnonymousUserRaw({ convertAnonymousUserRequest: convertAnonymousUserRequest }, initOverrides);
146
+ return await response.value();
147
+ }
148
+
65
149
  /**
66
150
  * Register a new end user with email and password.
67
151
  * Register a new end user
@@ -108,4 +192,46 @@ export class AuthRegistrationApi extends runtime.BaseAPI implements AuthRegistra
108
192
  return await response.value();
109
193
  }
110
194
 
195
+ /**
196
+ * Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
197
+ * Sign in anonymously
198
+ */
199
+ async signInAnonymouslyRaw(requestParameters: AuthRegistrationApiSignInAnonymouslyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthResultResponse>> {
200
+ if (requestParameters['signInAnonymouslyRequest'] == null) {
201
+ throw new runtime.RequiredError(
202
+ 'signInAnonymouslyRequest',
203
+ 'Required parameter "signInAnonymouslyRequest" was null or undefined when calling signInAnonymously().'
204
+ );
205
+ }
206
+
207
+ const queryParameters: any = {};
208
+
209
+ const headerParameters: runtime.HTTPHeaders = {};
210
+
211
+ headerParameters['Content-Type'] = 'application/json';
212
+
213
+ if (this.configuration && this.configuration.apiKey) {
214
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key"); // ApplicationPublicKey authentication
215
+ }
216
+
217
+ const response = await this.request({
218
+ path: `/auth/users/anonymous`,
219
+ method: 'POST',
220
+ headers: headerParameters,
221
+ query: queryParameters,
222
+ body: SignInAnonymouslyRequestToJSON(requestParameters['signInAnonymouslyRequest']),
223
+ }, initOverrides);
224
+
225
+ return new runtime.JSONApiResponse(response, (jsonValue) => AuthResultResponseFromJSON(jsonValue));
226
+ }
227
+
228
+ /**
229
+ * Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
230
+ * Sign in anonymously
231
+ */
232
+ async signInAnonymously(signInAnonymouslyRequest: SignInAnonymouslyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthResultResponse> {
233
+ const response = await this.signInAnonymouslyRaw({ signInAnonymouslyRequest: signInAnonymouslyRequest }, initOverrides);
234
+ return await response.value();
235
+ }
236
+
111
237
  }
@@ -148,7 +148,7 @@ export interface EmailsApiInterface {
148
148
  listEmails(status?: ListEmailsStatusEnum, tag?: string, limit?: number, offset?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EmailListResponse>;
149
149
 
150
150
  /**
151
- * Send up to 100 emails in a single request. Each recipient gets their own message record.
151
+ * Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
152
152
  * @summary Send batch emails
153
153
  * @param {SendBatchEmailRequest} sendBatchEmailRequest
154
154
  * @param {*} [options] Override http request option.
@@ -158,7 +158,7 @@ export interface EmailsApiInterface {
158
158
  sendBatchEmailRaw(requestParameters: EmailsApiSendBatchEmailOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SendBatchEmailResponse>>;
159
159
 
160
160
  /**
161
- * Send up to 100 emails in a single request. Each recipient gets their own message record.
161
+ * Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
162
162
  * Send batch emails
163
163
  */
164
164
  sendBatchEmail(sendBatchEmailRequest: SendBatchEmailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SendBatchEmailResponse>;
@@ -352,7 +352,7 @@ export class EmailsApi extends runtime.BaseAPI implements EmailsApiInterface {
352
352
  }
353
353
 
354
354
  /**
355
- * Send up to 100 emails in a single request. Each recipient gets their own message record.
355
+ * Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
356
356
  * Send batch emails
357
357
  */
358
358
  async sendBatchEmailRaw(requestParameters: EmailsApiSendBatchEmailOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SendBatchEmailResponse>> {
@@ -385,7 +385,7 @@ export class EmailsApi extends runtime.BaseAPI implements EmailsApiInterface {
385
385
  }
386
386
 
387
387
  /**
388
- * Send up to 100 emails in a single request. Each recipient gets their own message record.
388
+ * Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
389
389
  * Send batch emails
390
390
  */
391
391
  async sendBatchEmail(sendBatchEmailRequest: SendBatchEmailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SendBatchEmailResponse> {
@@ -79,6 +79,24 @@ export interface AuthUser {
79
79
  * @memberof AuthUser
80
80
  */
81
81
  mfaEnabled?: boolean;
82
+ /**
83
+ * True if the user signed in anonymously and has not yet been converted to a full account.
84
+ * @type {boolean}
85
+ * @memberof AuthUser
86
+ */
87
+ isAnonymous?: boolean;
88
+ /**
89
+ * Per-device identifier supplied at anonymous sign-in. Preserved across conversion so client-side "this device has scores from me" detection survives the upgrade. NULL for users who never signed in anonymously.
90
+ * @type {string}
91
+ * @memberof AuthUser
92
+ */
93
+ anonymousDeviceId?: string | null;
94
+ /**
95
+ * Set on the user's first authenticated request after anonymous sign-in (excluding /auth/refresh). MAU billing for anonymous-origin users keys off this timestamp instead of created_at.
96
+ * @type {Date}
97
+ * @memberof AuthUser
98
+ */
99
+ firstActivityAt?: Date | null;
82
100
  /**
83
101
  *
84
102
  * @type {Date}
@@ -138,6 +156,9 @@ export function AuthUserFromJSONTyped(json: any, ignoreDiscriminator: boolean):
138
156
  'phoneVerified': json['phone_verified'] == null ? undefined : json['phone_verified'],
139
157
  'status': json['status'] == null ? undefined : json['status'],
140
158
  'mfaEnabled': json['mfa_enabled'] == null ? undefined : json['mfa_enabled'],
159
+ 'isAnonymous': json['is_anonymous'] == null ? undefined : json['is_anonymous'],
160
+ 'anonymousDeviceId': json['anonymous_device_id'] == null ? undefined : json['anonymous_device_id'],
161
+ 'firstActivityAt': json['first_activity_at'] == null ? undefined : (new Date(json['first_activity_at'])),
141
162
  'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
142
163
  'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
143
164
  'lastLoginAt': json['last_login_at'] == null ? undefined : (new Date(json['last_login_at'])),
@@ -165,6 +186,9 @@ export function AuthUserToJSONTyped(value?: AuthUser | null, ignoreDiscriminator
165
186
  'phone_verified': value['phoneVerified'],
166
187
  'status': value['status'],
167
188
  'mfa_enabled': value['mfaEnabled'],
189
+ 'is_anonymous': value['isAnonymous'],
190
+ 'anonymous_device_id': value['anonymousDeviceId'],
191
+ 'first_activity_at': value['firstActivityAt'] == null ? undefined : ((value['firstActivityAt'] as any).toISOString()),
168
192
  'created_at': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
169
193
  'updated_at': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()),
170
194
  'last_login_at': value['lastLoginAt'] == null ? undefined : ((value['lastLoginAt'] as any).toISOString()),
@@ -0,0 +1,83 @@
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 ## 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 BatchRecipient
20
+ */
21
+ export interface BatchRecipient {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof BatchRecipient
26
+ */
27
+ email: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof BatchRecipient
32
+ */
33
+ name?: string;
34
+ /**
35
+ * Per-recipient template variables. Merged on top of the batch-level `template_data`, so per-recipient values win on key collisions.
36
+ *
37
+ * @type {{ [key: string]: any; }}
38
+ * @memberof BatchRecipient
39
+ */
40
+ variables?: { [key: string]: any; };
41
+ }
42
+
43
+ /**
44
+ * Check if a given object implements the BatchRecipient interface.
45
+ */
46
+ export function instanceOfBatchRecipient(value: object): value is BatchRecipient {
47
+ if (!('email' in value) || value['email'] === undefined) return false;
48
+ return true;
49
+ }
50
+
51
+ export function BatchRecipientFromJSON(json: any): BatchRecipient {
52
+ return BatchRecipientFromJSONTyped(json, false);
53
+ }
54
+
55
+ export function BatchRecipientFromJSONTyped(json: any, ignoreDiscriminator: boolean): BatchRecipient {
56
+ if (json == null) {
57
+ return json;
58
+ }
59
+ return {
60
+
61
+ 'email': json['email'],
62
+ 'name': json['name'] == null ? undefined : json['name'],
63
+ 'variables': json['variables'] == null ? undefined : json['variables'],
64
+ };
65
+ }
66
+
67
+ export function BatchRecipientToJSON(json: any): BatchRecipient {
68
+ return BatchRecipientToJSONTyped(json, false);
69
+ }
70
+
71
+ export function BatchRecipientToJSONTyped(value?: BatchRecipient | null, ignoreDiscriminator: boolean = false): any {
72
+ if (value == null) {
73
+ return value;
74
+ }
75
+
76
+ return {
77
+
78
+ 'email': value['email'],
79
+ 'name': value['name'],
80
+ 'variables': value['variables'],
81
+ };
82
+ }
83
+
@@ -0,0 +1,73 @@
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 ## 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 type { ConvertAnonymousUserRequestOneOf } from './ConvertAnonymousUserRequestOneOf';
16
+ import {
17
+ instanceOfConvertAnonymousUserRequestOneOf,
18
+ ConvertAnonymousUserRequestOneOfFromJSON,
19
+ ConvertAnonymousUserRequestOneOfFromJSONTyped,
20
+ ConvertAnonymousUserRequestOneOfToJSON,
21
+ } from './ConvertAnonymousUserRequestOneOf';
22
+ import type { ConvertAnonymousUserRequestOneOf1 } from './ConvertAnonymousUserRequestOneOf1';
23
+ import {
24
+ instanceOfConvertAnonymousUserRequestOneOf1,
25
+ ConvertAnonymousUserRequestOneOf1FromJSON,
26
+ ConvertAnonymousUserRequestOneOf1FromJSONTyped,
27
+ ConvertAnonymousUserRequestOneOf1ToJSON,
28
+ } from './ConvertAnonymousUserRequestOneOf1';
29
+
30
+ /**
31
+ * @type ConvertAnonymousUserRequest
32
+ *
33
+ * @export
34
+ */
35
+ export type ConvertAnonymousUserRequest = ConvertAnonymousUserRequestOneOf | ConvertAnonymousUserRequestOneOf1;
36
+
37
+ export function ConvertAnonymousUserRequestFromJSON(json: any): ConvertAnonymousUserRequest {
38
+ return ConvertAnonymousUserRequestFromJSONTyped(json, false);
39
+ }
40
+
41
+ export function ConvertAnonymousUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConvertAnonymousUserRequest {
42
+ if (json == null) {
43
+ return json;
44
+ }
45
+ if (instanceOfConvertAnonymousUserRequestOneOf(json)) {
46
+ return ConvertAnonymousUserRequestOneOfFromJSONTyped(json, true);
47
+ }
48
+ if (instanceOfConvertAnonymousUserRequestOneOf1(json)) {
49
+ return ConvertAnonymousUserRequestOneOf1FromJSONTyped(json, true);
50
+ }
51
+
52
+ return {} as any;
53
+ }
54
+
55
+ export function ConvertAnonymousUserRequestToJSON(json: any): any {
56
+ return ConvertAnonymousUserRequestToJSONTyped(json, false);
57
+ }
58
+
59
+ export function ConvertAnonymousUserRequestToJSONTyped(value?: ConvertAnonymousUserRequest | null, ignoreDiscriminator: boolean = false): any {
60
+ if (value == null) {
61
+ return value;
62
+ }
63
+
64
+ if (instanceOfConvertAnonymousUserRequestOneOf(value)) {
65
+ return ConvertAnonymousUserRequestOneOfToJSON(value as ConvertAnonymousUserRequestOneOf);
66
+ }
67
+ if (instanceOfConvertAnonymousUserRequestOneOf1(value)) {
68
+ return ConvertAnonymousUserRequestOneOf1ToJSON(value as ConvertAnonymousUserRequestOneOf1);
69
+ }
70
+
71
+ return {};
72
+ }
73
+
@@ -0,0 +1,102 @@
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 ## 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 ConvertAnonymousUserRequestOneOf
20
+ */
21
+ export interface ConvertAnonymousUserRequestOneOf {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ConvertAnonymousUserRequestOneOf
26
+ */
27
+ method: ConvertAnonymousUserRequestOneOfMethodEnum;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ConvertAnonymousUserRequestOneOf
32
+ */
33
+ email: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof ConvertAnonymousUserRequestOneOf
38
+ */
39
+ password: string;
40
+ /**
41
+ * Optional. Overwrites the user's existing name if provided.
42
+ * @type {string}
43
+ * @memberof ConvertAnonymousUserRequestOneOf
44
+ */
45
+ name?: string;
46
+ }
47
+
48
+
49
+ /**
50
+ * @export
51
+ */
52
+ export const ConvertAnonymousUserRequestOneOfMethodEnum = {
53
+ PASSWORD: 'password'
54
+ } as const;
55
+ export type ConvertAnonymousUserRequestOneOfMethodEnum = typeof ConvertAnonymousUserRequestOneOfMethodEnum[keyof typeof ConvertAnonymousUserRequestOneOfMethodEnum];
56
+
57
+
58
+ /**
59
+ * Check if a given object implements the ConvertAnonymousUserRequestOneOf interface.
60
+ */
61
+ export function instanceOfConvertAnonymousUserRequestOneOf(value: object): value is ConvertAnonymousUserRequestOneOf {
62
+ if (!('method' in value) || value['method'] === undefined) return false;
63
+ if (!('email' in value) || value['email'] === undefined) return false;
64
+ if (!('password' in value) || value['password'] === undefined) return false;
65
+ return true;
66
+ }
67
+
68
+ export function ConvertAnonymousUserRequestOneOfFromJSON(json: any): ConvertAnonymousUserRequestOneOf {
69
+ return ConvertAnonymousUserRequestOneOfFromJSONTyped(json, false);
70
+ }
71
+
72
+ export function ConvertAnonymousUserRequestOneOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConvertAnonymousUserRequestOneOf {
73
+ if (json == null) {
74
+ return json;
75
+ }
76
+ return {
77
+
78
+ 'method': json['method'],
79
+ 'email': json['email'],
80
+ 'password': json['password'],
81
+ 'name': json['name'] == null ? undefined : json['name'],
82
+ };
83
+ }
84
+
85
+ export function ConvertAnonymousUserRequestOneOfToJSON(json: any): ConvertAnonymousUserRequestOneOf {
86
+ return ConvertAnonymousUserRequestOneOfToJSONTyped(json, false);
87
+ }
88
+
89
+ export function ConvertAnonymousUserRequestOneOfToJSONTyped(value?: ConvertAnonymousUserRequestOneOf | null, ignoreDiscriminator: boolean = false): any {
90
+ if (value == null) {
91
+ return value;
92
+ }
93
+
94
+ return {
95
+
96
+ 'method': value['method'],
97
+ 'email': value['email'],
98
+ 'password': value['password'],
99
+ 'name': value['name'],
100
+ };
101
+ }
102
+
@@ -0,0 +1,110 @@
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 ## 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
+ import type { ConvertAnonymousUserRequestOneOf1AppleUser } from './ConvertAnonymousUserRequestOneOf1AppleUser';
17
+ import {
18
+ ConvertAnonymousUserRequestOneOf1AppleUserFromJSON,
19
+ ConvertAnonymousUserRequestOneOf1AppleUserFromJSONTyped,
20
+ ConvertAnonymousUserRequestOneOf1AppleUserToJSON,
21
+ ConvertAnonymousUserRequestOneOf1AppleUserToJSONTyped,
22
+ } from './ConvertAnonymousUserRequestOneOf1AppleUser';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ConvertAnonymousUserRequestOneOf1
28
+ */
29
+ export interface ConvertAnonymousUserRequestOneOf1 {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof ConvertAnonymousUserRequestOneOf1
34
+ */
35
+ method: ConvertAnonymousUserRequestOneOf1MethodEnum;
36
+ /**
37
+ * Authorization code returned by the OAuth provider after the user authorizes.
38
+ * @type {string}
39
+ * @memberof ConvertAnonymousUserRequestOneOf1
40
+ */
41
+ code: string;
42
+ /**
43
+ * Opaque state token previously issued by GET /v1/auth/oauth/authorize.
44
+ * @type {string}
45
+ * @memberof ConvertAnonymousUserRequestOneOf1
46
+ */
47
+ state: string;
48
+ /**
49
+ *
50
+ * @type {ConvertAnonymousUserRequestOneOf1AppleUser}
51
+ * @memberof ConvertAnonymousUserRequestOneOf1
52
+ */
53
+ appleUser?: ConvertAnonymousUserRequestOneOf1AppleUser;
54
+ }
55
+
56
+
57
+ /**
58
+ * @export
59
+ */
60
+ export const ConvertAnonymousUserRequestOneOf1MethodEnum = {
61
+ OAUTH: 'oauth'
62
+ } as const;
63
+ export type ConvertAnonymousUserRequestOneOf1MethodEnum = typeof ConvertAnonymousUserRequestOneOf1MethodEnum[keyof typeof ConvertAnonymousUserRequestOneOf1MethodEnum];
64
+
65
+
66
+ /**
67
+ * Check if a given object implements the ConvertAnonymousUserRequestOneOf1 interface.
68
+ */
69
+ export function instanceOfConvertAnonymousUserRequestOneOf1(value: object): value is ConvertAnonymousUserRequestOneOf1 {
70
+ if (!('method' in value) || value['method'] === undefined) return false;
71
+ if (!('code' in value) || value['code'] === undefined) return false;
72
+ if (!('state' in value) || value['state'] === undefined) return false;
73
+ return true;
74
+ }
75
+
76
+ export function ConvertAnonymousUserRequestOneOf1FromJSON(json: any): ConvertAnonymousUserRequestOneOf1 {
77
+ return ConvertAnonymousUserRequestOneOf1FromJSONTyped(json, false);
78
+ }
79
+
80
+ export function ConvertAnonymousUserRequestOneOf1FromJSONTyped(json: any, ignoreDiscriminator: boolean): ConvertAnonymousUserRequestOneOf1 {
81
+ if (json == null) {
82
+ return json;
83
+ }
84
+ return {
85
+
86
+ 'method': json['method'],
87
+ 'code': json['code'],
88
+ 'state': json['state'],
89
+ 'appleUser': json['apple_user'] == null ? undefined : ConvertAnonymousUserRequestOneOf1AppleUserFromJSON(json['apple_user']),
90
+ };
91
+ }
92
+
93
+ export function ConvertAnonymousUserRequestOneOf1ToJSON(json: any): ConvertAnonymousUserRequestOneOf1 {
94
+ return ConvertAnonymousUserRequestOneOf1ToJSONTyped(json, false);
95
+ }
96
+
97
+ export function ConvertAnonymousUserRequestOneOf1ToJSONTyped(value?: ConvertAnonymousUserRequestOneOf1 | null, ignoreDiscriminator: boolean = false): any {
98
+ if (value == null) {
99
+ return value;
100
+ }
101
+
102
+ return {
103
+
104
+ 'method': value['method'],
105
+ 'code': value['code'],
106
+ 'state': value['state'],
107
+ 'apple_user': ConvertAnonymousUserRequestOneOf1AppleUserToJSON(value['appleUser']),
108
+ };
109
+ }
110
+