@zyphr-dev/node-sdk 0.1.35 → 0.1.36

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.35",
3
+ "version": "0.1.36",
4
4
  "description": "Official Zyphr SDK for Node.js, React, and React Native",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -27,7 +27,7 @@
27
27
  "scripts": {
28
28
  "build": "tsup",
29
29
  "lint": "tsc --noEmit",
30
- "test": "echo 'No tests yet for generated SDK'",
30
+ "test": "vitest run",
31
31
  "examples:typecheck": "tsc --noEmit -p examples/tsconfig.json",
32
32
  "readme:check": "node ../scripts/verify-readme-methods.mjs",
33
33
  "verify": "yarn lint && yarn examples:typecheck && yarn readme:check",
@@ -35,7 +35,8 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "tsup": "^8.5.1",
38
- "typescript": "^5.3.0"
38
+ "typescript": "^5.3.0",
39
+ "vitest": "^4.0.18"
39
40
  },
40
41
  "keywords": [
41
42
  "zyphr",
@@ -82,8 +82,6 @@ src/models/BulkUpsertAuthEmailTemplatesResponse.ts
82
82
  src/models/Category.ts
83
83
  src/models/CategoryListResponse.ts
84
84
  src/models/CategoryResponse.ts
85
- src/models/CheckEmailOtpAvailability200Response.ts
86
- src/models/CheckEmailOtpAvailability200ResponseData.ts
87
85
  src/models/ConfirmEmailVerificationRequest.ts
88
86
  src/models/ConfirmEmailVerificationResponse.ts
89
87
  src/models/ConfirmEmailVerificationResponseData.ts
@@ -234,6 +232,7 @@ src/models/PayloadTooLargeError.ts
234
232
  src/models/PayloadTooLargeErrorError.ts
235
233
  src/models/PayloadTooLargeErrorErrorDetails.ts
236
234
  src/models/PhoneAuthAvailabilityResponse.ts
235
+ src/models/PhoneAuthAvailabilityResponseData.ts
237
236
  src/models/PhoneLoginVerifyRequest.ts
238
237
  src/models/PhoneOtpSendRequest.ts
239
238
  src/models/PhoneOtpSentResponse.ts
package/src/client.ts CHANGED
@@ -16,6 +16,7 @@
16
16
  import { Configuration } from './src/runtime.js';
17
17
  import type { Middleware, ResponseContext } from './src/runtime.js';
18
18
  import {
19
+ AuthEmailOTPApi,
19
20
  AuthEmailVerificationApi,
20
21
  AuthLoginApi,
21
22
  AuthMFAApi,
@@ -108,6 +109,7 @@ export class Zyphr {
108
109
  readonly oauth: AuthOAuthApi;
109
110
  readonly organizations: AuthOrganizationsApi;
110
111
  readonly phone: AuthPhoneApi;
112
+ readonly emailOtp: AuthEmailOTPApi;
111
113
  readonly profile: AuthUserProfileApi;
112
114
  readonly webauthn: AuthWebAuthnApi;
113
115
  };
@@ -162,6 +164,7 @@ export class Zyphr {
162
164
  // Sub-tenant CRUD + membership + the active-org switch flow.
163
165
  organizations: new AuthOrganizationsApi(config),
164
166
  phone: new AuthPhoneApi(config),
167
+ emailOtp: new AuthEmailOTPApi(config),
165
168
  profile: new AuthUserProfileApi(config),
166
169
  webauthn: new AuthWebAuthnApi(config),
167
170
  };
@@ -18,7 +18,7 @@ import type {
18
18
  ApiError,
19
19
  AuthLoginResponse,
20
20
  AuthResultResponse,
21
- CheckEmailOtpAvailability200Response,
21
+ PhoneAuthAvailabilityResponse,
22
22
  PhoneOtpSentResponse,
23
23
  SendEmailOtpRegistrationRequest,
24
24
  VerifyEmailOtpLoginRequest,
@@ -31,8 +31,8 @@ import {
31
31
  AuthLoginResponseToJSON,
32
32
  AuthResultResponseFromJSON,
33
33
  AuthResultResponseToJSON,
34
- CheckEmailOtpAvailability200ResponseFromJSON,
35
- CheckEmailOtpAvailability200ResponseToJSON,
34
+ PhoneAuthAvailabilityResponseFromJSON,
35
+ PhoneAuthAvailabilityResponseToJSON,
36
36
  PhoneOtpSentResponseFromJSON,
37
37
  PhoneOtpSentResponseToJSON,
38
38
  SendEmailOtpRegistrationRequestFromJSON,
@@ -73,13 +73,13 @@ export interface AuthEmailOTPApiInterface {
73
73
  * @throws {RequiredError}
74
74
  * @memberof AuthEmailOTPApiInterface
75
75
  */
76
- checkEmailOtpAvailabilityRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CheckEmailOtpAvailability200Response>>;
76
+ checkEmailOtpAvailabilityRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhoneAuthAvailabilityResponse>>;
77
77
 
78
78
  /**
79
79
  * Check if numeric email OTP authentication is available for this application. Requires a verified sending domain on the project.
80
80
  * Check email OTP availability
81
81
  */
82
- checkEmailOtpAvailability(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CheckEmailOtpAvailability200Response>;
82
+ checkEmailOtpAvailability(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneAuthAvailabilityResponse>;
83
83
 
84
84
  /**
85
85
  * Send a numeric verification code to an existing user\'s email address for login.
@@ -156,7 +156,7 @@ export class AuthEmailOTPApi extends runtime.BaseAPI implements AuthEmailOTPApiI
156
156
  * Check if numeric email OTP authentication is available for this application. Requires a verified sending domain on the project.
157
157
  * Check email OTP availability
158
158
  */
159
- async checkEmailOtpAvailabilityRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CheckEmailOtpAvailability200Response>> {
159
+ async checkEmailOtpAvailabilityRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhoneAuthAvailabilityResponse>> {
160
160
  const queryParameters: any = {};
161
161
 
162
162
  const headerParameters: runtime.HTTPHeaders = {};
@@ -172,14 +172,14 @@ export class AuthEmailOTPApi extends runtime.BaseAPI implements AuthEmailOTPApiI
172
172
  query: queryParameters,
173
173
  }, initOverrides);
174
174
 
175
- return new runtime.JSONApiResponse(response, (jsonValue) => CheckEmailOtpAvailability200ResponseFromJSON(jsonValue));
175
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhoneAuthAvailabilityResponseFromJSON(jsonValue));
176
176
  }
177
177
 
178
178
  /**
179
179
  * Check if numeric email OTP authentication is available for this application. Requires a verified sending domain on the project.
180
180
  * Check email OTP availability
181
181
  */
182
- async checkEmailOtpAvailability(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CheckEmailOtpAvailability200Response> {
182
+ async checkEmailOtpAvailability(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneAuthAvailabilityResponse> {
183
183
  const response = await this.checkEmailOtpAvailabilityRaw(initOverrides);
184
184
  return await response.value();
185
185
  }
@@ -13,13 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
- import type { CheckEmailOtpAvailability200ResponseData } from './CheckEmailOtpAvailability200ResponseData';
16
+ import type { PhoneAuthAvailabilityResponseData } from './PhoneAuthAvailabilityResponseData';
17
17
  import {
18
- CheckEmailOtpAvailability200ResponseDataFromJSON,
19
- CheckEmailOtpAvailability200ResponseDataFromJSONTyped,
20
- CheckEmailOtpAvailability200ResponseDataToJSON,
21
- CheckEmailOtpAvailability200ResponseDataToJSONTyped,
22
- } from './CheckEmailOtpAvailability200ResponseData';
18
+ PhoneAuthAvailabilityResponseDataFromJSON,
19
+ PhoneAuthAvailabilityResponseDataFromJSONTyped,
20
+ PhoneAuthAvailabilityResponseDataToJSON,
21
+ PhoneAuthAvailabilityResponseDataToJSONTyped,
22
+ } from './PhoneAuthAvailabilityResponseData';
23
23
  import type { RequestMeta } from './RequestMeta';
24
24
  import {
25
25
  RequestMetaFromJSON,
@@ -36,10 +36,10 @@ import {
36
36
  export interface PhoneAuthAvailabilityResponse {
37
37
  /**
38
38
  *
39
- * @type {CheckEmailOtpAvailability200ResponseData}
39
+ * @type {PhoneAuthAvailabilityResponseData}
40
40
  * @memberof PhoneAuthAvailabilityResponse
41
41
  */
42
- data?: CheckEmailOtpAvailability200ResponseData;
42
+ data?: PhoneAuthAvailabilityResponseData;
43
43
  /**
44
44
  *
45
45
  * @type {RequestMeta}
@@ -65,7 +65,7 @@ export function PhoneAuthAvailabilityResponseFromJSONTyped(json: any, ignoreDisc
65
65
  }
66
66
  return {
67
67
 
68
- 'data': json['data'] == null ? undefined : CheckEmailOtpAvailability200ResponseDataFromJSON(json['data']),
68
+ 'data': json['data'] == null ? undefined : PhoneAuthAvailabilityResponseDataFromJSON(json['data']),
69
69
  'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
70
70
  };
71
71
  }
@@ -81,7 +81,7 @@ export function PhoneAuthAvailabilityResponseToJSONTyped(value?: PhoneAuthAvaila
81
81
 
82
82
  return {
83
83
 
84
- 'data': CheckEmailOtpAvailability200ResponseDataToJSON(value['data']),
84
+ 'data': PhoneAuthAvailabilityResponseDataToJSON(value['data']),
85
85
  'meta': RequestMetaToJSON(value['meta']),
86
86
  };
87
87
  }
@@ -16,35 +16,35 @@ import { mapValues } from '../runtime';
16
16
  /**
17
17
  *
18
18
  * @export
19
- * @interface CheckEmailOtpAvailability200ResponseData
19
+ * @interface PhoneAuthAvailabilityResponseData
20
20
  */
21
- export interface CheckEmailOtpAvailability200ResponseData {
21
+ export interface PhoneAuthAvailabilityResponseData {
22
22
  /**
23
23
  *
24
24
  * @type {boolean}
25
- * @memberof CheckEmailOtpAvailability200ResponseData
25
+ * @memberof PhoneAuthAvailabilityResponseData
26
26
  */
27
27
  available?: boolean;
28
28
  /**
29
29
  *
30
30
  * @type {string}
31
- * @memberof CheckEmailOtpAvailability200ResponseData
31
+ * @memberof PhoneAuthAvailabilityResponseData
32
32
  */
33
33
  message?: string;
34
34
  }
35
35
 
36
36
  /**
37
- * Check if a given object implements the CheckEmailOtpAvailability200ResponseData interface.
37
+ * Check if a given object implements the PhoneAuthAvailabilityResponseData interface.
38
38
  */
39
- export function instanceOfCheckEmailOtpAvailability200ResponseData(value: object): value is CheckEmailOtpAvailability200ResponseData {
39
+ export function instanceOfPhoneAuthAvailabilityResponseData(value: object): value is PhoneAuthAvailabilityResponseData {
40
40
  return true;
41
41
  }
42
42
 
43
- export function CheckEmailOtpAvailability200ResponseDataFromJSON(json: any): CheckEmailOtpAvailability200ResponseData {
44
- return CheckEmailOtpAvailability200ResponseDataFromJSONTyped(json, false);
43
+ export function PhoneAuthAvailabilityResponseDataFromJSON(json: any): PhoneAuthAvailabilityResponseData {
44
+ return PhoneAuthAvailabilityResponseDataFromJSONTyped(json, false);
45
45
  }
46
46
 
47
- export function CheckEmailOtpAvailability200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CheckEmailOtpAvailability200ResponseData {
47
+ export function PhoneAuthAvailabilityResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): PhoneAuthAvailabilityResponseData {
48
48
  if (json == null) {
49
49
  return json;
50
50
  }
@@ -55,11 +55,11 @@ export function CheckEmailOtpAvailability200ResponseDataFromJSONTyped(json: any,
55
55
  };
56
56
  }
57
57
 
58
- export function CheckEmailOtpAvailability200ResponseDataToJSON(json: any): CheckEmailOtpAvailability200ResponseData {
59
- return CheckEmailOtpAvailability200ResponseDataToJSONTyped(json, false);
58
+ export function PhoneAuthAvailabilityResponseDataToJSON(json: any): PhoneAuthAvailabilityResponseData {
59
+ return PhoneAuthAvailabilityResponseDataToJSONTyped(json, false);
60
60
  }
61
61
 
62
- export function CheckEmailOtpAvailability200ResponseDataToJSONTyped(value?: CheckEmailOtpAvailability200ResponseData | null, ignoreDiscriminator: boolean = false): any {
62
+ export function PhoneAuthAvailabilityResponseDataToJSONTyped(value?: PhoneAuthAvailabilityResponseData | null, ignoreDiscriminator: boolean = false): any {
63
63
  if (value == null) {
64
64
  return value;
65
65
  }
@@ -43,8 +43,6 @@ export * from './BulkUpsertAuthEmailTemplatesResponse';
43
43
  export * from './Category';
44
44
  export * from './CategoryListResponse';
45
45
  export * from './CategoryResponse';
46
- export * from './CheckEmailOtpAvailability200Response';
47
- export * from './CheckEmailOtpAvailability200ResponseData';
48
46
  export * from './ConfirmEmailVerificationRequest';
49
47
  export * from './ConfirmEmailVerificationResponse';
50
48
  export * from './ConfirmEmailVerificationResponseData';
@@ -195,6 +193,7 @@ export * from './PayloadTooLargeError';
195
193
  export * from './PayloadTooLargeErrorError';
196
194
  export * from './PayloadTooLargeErrorErrorDetails';
197
195
  export * from './PhoneAuthAvailabilityResponse';
196
+ export * from './PhoneAuthAvailabilityResponseData';
198
197
  export * from './PhoneLoginVerifyRequest';
199
198
  export * from './PhoneOtpSendRequest';
200
199
  export * from './PhoneOtpSentResponse';
@@ -1,73 +0,0 @@
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 { CheckEmailOtpAvailability200ResponseData } from './CheckEmailOtpAvailability200ResponseData';
17
- import {
18
- CheckEmailOtpAvailability200ResponseDataFromJSON,
19
- CheckEmailOtpAvailability200ResponseDataFromJSONTyped,
20
- CheckEmailOtpAvailability200ResponseDataToJSON,
21
- CheckEmailOtpAvailability200ResponseDataToJSONTyped,
22
- } from './CheckEmailOtpAvailability200ResponseData';
23
-
24
- /**
25
- *
26
- * @export
27
- * @interface CheckEmailOtpAvailability200Response
28
- */
29
- export interface CheckEmailOtpAvailability200Response {
30
- /**
31
- *
32
- * @type {CheckEmailOtpAvailability200ResponseData}
33
- * @memberof CheckEmailOtpAvailability200Response
34
- */
35
- data?: CheckEmailOtpAvailability200ResponseData;
36
- }
37
-
38
- /**
39
- * Check if a given object implements the CheckEmailOtpAvailability200Response interface.
40
- */
41
- export function instanceOfCheckEmailOtpAvailability200Response(value: object): value is CheckEmailOtpAvailability200Response {
42
- return true;
43
- }
44
-
45
- export function CheckEmailOtpAvailability200ResponseFromJSON(json: any): CheckEmailOtpAvailability200Response {
46
- return CheckEmailOtpAvailability200ResponseFromJSONTyped(json, false);
47
- }
48
-
49
- export function CheckEmailOtpAvailability200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CheckEmailOtpAvailability200Response {
50
- if (json == null) {
51
- return json;
52
- }
53
- return {
54
-
55
- 'data': json['data'] == null ? undefined : CheckEmailOtpAvailability200ResponseDataFromJSON(json['data']),
56
- };
57
- }
58
-
59
- export function CheckEmailOtpAvailability200ResponseToJSON(json: any): CheckEmailOtpAvailability200Response {
60
- return CheckEmailOtpAvailability200ResponseToJSONTyped(json, false);
61
- }
62
-
63
- export function CheckEmailOtpAvailability200ResponseToJSONTyped(value?: CheckEmailOtpAvailability200Response | null, ignoreDiscriminator: boolean = false): any {
64
- if (value == null) {
65
- return value;
66
- }
67
-
68
- return {
69
-
70
- 'data': CheckEmailOtpAvailability200ResponseDataToJSON(value['data']),
71
- };
72
- }
73
-