@zyphr-dev/node-sdk 0.1.65 → 0.1.67
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 +30 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -14
- package/dist/index.d.ts +59 -14
- package/dist/index.js +30 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +18 -0
- package/src/src/apis/AuthEmailTemplatesApi.ts +4 -4
- package/src/src/apis/AuthMagicLinksApi.ts +4 -4
- package/src/src/apis/AuthUserDirectoryApi.ts +4 -4
- package/src/src/models/AuthEmailType.ts +3 -1
- package/src/src/models/BulkUpsertAuthEmailTemplatesRequest.ts +17 -1
- package/src/src/models/InviteEndUser200ResponseData.ts +5 -1
- package/src/src/models/InviteEndUserRequest.ts +1 -0
- package/src/src/models/MagicLinkVerifyResponseData.ts +23 -0
package/dist/index.cjs
CHANGED
|
@@ -3640,7 +3640,9 @@ function ApplicationSelfResponseToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
3640
3640
|
var AuthEmailType = {
|
|
3641
3641
|
MAGIC_LINK: "magic_link",
|
|
3642
3642
|
PASSWORD_RESET: "password_reset",
|
|
3643
|
-
EMAIL_VERIFICATION: "email_verification"
|
|
3643
|
+
EMAIL_VERIFICATION: "email_verification",
|
|
3644
|
+
EMAIL_OTP: "email_otp",
|
|
3645
|
+
INVITATION: "invitation"
|
|
3644
3646
|
};
|
|
3645
3647
|
function instanceOfAuthEmailType(value) {
|
|
3646
3648
|
for (const key in AuthEmailType) {
|
|
@@ -4812,7 +4814,9 @@ function BulkUpsertAuthEmailTemplatesRequestFromJSONTyped(json, ignoreDiscrimina
|
|
|
4812
4814
|
return {
|
|
4813
4815
|
"magicLink": json["magic_link"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["magic_link"]),
|
|
4814
4816
|
"passwordReset": json["password_reset"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["password_reset"]),
|
|
4815
|
-
"emailVerification": json["email_verification"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["email_verification"])
|
|
4817
|
+
"emailVerification": json["email_verification"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["email_verification"]),
|
|
4818
|
+
"emailOtp": json["email_otp"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["email_otp"]),
|
|
4819
|
+
"invitation": json["invitation"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["invitation"])
|
|
4816
4820
|
};
|
|
4817
4821
|
}
|
|
4818
4822
|
function BulkUpsertAuthEmailTemplatesRequestToJSON(json) {
|
|
@@ -4825,7 +4829,9 @@ function BulkUpsertAuthEmailTemplatesRequestToJSONTyped(value, ignoreDiscriminat
|
|
|
4825
4829
|
return {
|
|
4826
4830
|
"magic_link": UpsertAuthEmailTemplateRequestToJSON(value["magicLink"]),
|
|
4827
4831
|
"password_reset": UpsertAuthEmailTemplateRequestToJSON(value["passwordReset"]),
|
|
4828
|
-
"email_verification": UpsertAuthEmailTemplateRequestToJSON(value["emailVerification"])
|
|
4832
|
+
"email_verification": UpsertAuthEmailTemplateRequestToJSON(value["emailVerification"]),
|
|
4833
|
+
"email_otp": UpsertAuthEmailTemplateRequestToJSON(value["emailOtp"]),
|
|
4834
|
+
"invitation": UpsertAuthEmailTemplateRequestToJSON(value["invitation"])
|
|
4829
4835
|
};
|
|
4830
4836
|
}
|
|
4831
4837
|
|
|
@@ -9254,6 +9260,7 @@ function InviteEndUser200ResponseToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
9254
9260
|
|
|
9255
9261
|
// src/src/models/InviteEndUserRequest.ts
|
|
9256
9262
|
var InviteEndUserRequestSendLinkEnum = {
|
|
9263
|
+
INVITATION: "invitation",
|
|
9257
9264
|
MAGIC: "magic",
|
|
9258
9265
|
PASSWORD_RESET: "password_reset",
|
|
9259
9266
|
NONE: "none"
|
|
@@ -9669,8 +9676,10 @@ function MagicLinkVerifyResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9669
9676
|
return json;
|
|
9670
9677
|
}
|
|
9671
9678
|
return {
|
|
9679
|
+
"mfaRequired": json["mfa_required"] == null ? void 0 : json["mfa_required"],
|
|
9672
9680
|
"user": json["user"] == null ? void 0 : AuthUserFromJSON(json["user"]),
|
|
9673
9681
|
"tokens": json["tokens"] == null ? void 0 : AuthTokensFromJSON(json["tokens"]),
|
|
9682
|
+
"mfaChallenge": json["mfa_challenge"] == null ? void 0 : AuthLoginResultMfaChallengeFromJSON(json["mfa_challenge"]),
|
|
9674
9683
|
"isNewUser": json["is_new_user"] == null ? void 0 : json["is_new_user"]
|
|
9675
9684
|
};
|
|
9676
9685
|
}
|
|
@@ -9682,8 +9691,10 @@ function MagicLinkVerifyResponseDataToJSONTyped(value, ignoreDiscriminator = fal
|
|
|
9682
9691
|
return value;
|
|
9683
9692
|
}
|
|
9684
9693
|
return {
|
|
9694
|
+
"mfa_required": value["mfaRequired"],
|
|
9685
9695
|
"user": AuthUserToJSON(value["user"]),
|
|
9686
9696
|
"tokens": AuthTokensToJSON(value["tokens"]),
|
|
9697
|
+
"mfa_challenge": AuthLoginResultMfaChallengeToJSON(value["mfaChallenge"]),
|
|
9687
9698
|
"is_new_user": value["isNewUser"]
|
|
9688
9699
|
};
|
|
9689
9700
|
}
|
|
@@ -20117,7 +20128,7 @@ var AuthEmailOTPApi = class extends BaseAPI {
|
|
|
20117
20128
|
// src/src/apis/AuthEmailTemplatesApi.ts
|
|
20118
20129
|
var AuthEmailTemplatesApi = class extends BaseAPI {
|
|
20119
20130
|
/**
|
|
20120
|
-
* Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
20131
|
+
* Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
20121
20132
|
* Bulk-upsert auth email templates
|
|
20122
20133
|
*/
|
|
20123
20134
|
async bulkUpsertAuthEmailTemplatesRaw(requestParameters, initOverrides) {
|
|
@@ -20156,7 +20167,7 @@ var AuthEmailTemplatesApi = class extends BaseAPI {
|
|
|
20156
20167
|
return new JSONApiResponse(response, (jsonValue) => BulkUpsertAuthEmailTemplatesResponseFromJSON(jsonValue));
|
|
20157
20168
|
}
|
|
20158
20169
|
/**
|
|
20159
|
-
* Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
20170
|
+
* Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
|
|
20160
20171
|
* Bulk-upsert auth email templates
|
|
20161
20172
|
*/
|
|
20162
20173
|
async bulkUpsertAuthEmailTemplates(bulkUpsertAuthEmailTemplatesRequest, initOverrides) {
|
|
@@ -21165,7 +21176,7 @@ var AuthMagicLinksApi = class extends BaseAPI {
|
|
|
21165
21176
|
return await response.value();
|
|
21166
21177
|
}
|
|
21167
21178
|
/**
|
|
21168
|
-
* Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
|
|
21179
|
+
* Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets `mfa_required: true` and an `mfa_challenge` instead of tokens; complete the login with the challenge token at `POST /auth/mfa/verify`, exactly as after password login.
|
|
21169
21180
|
* Verify a magic link
|
|
21170
21181
|
*/
|
|
21171
21182
|
async verifyMagicLinkRaw(requestParameters, initOverrides) {
|
|
@@ -21204,7 +21215,7 @@ var AuthMagicLinksApi = class extends BaseAPI {
|
|
|
21204
21215
|
return new JSONApiResponse(response, (jsonValue) => MagicLinkVerifyResponseFromJSON(jsonValue));
|
|
21205
21216
|
}
|
|
21206
21217
|
/**
|
|
21207
|
-
* Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
|
|
21218
|
+
* Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets `mfa_required: true` and an `mfa_challenge` instead of tokens; complete the login with the challenge token at `POST /auth/mfa/verify`, exactly as after password login.
|
|
21208
21219
|
* Verify a magic link
|
|
21209
21220
|
*/
|
|
21210
21221
|
async verifyMagicLink(magicLinkVerifyRequest, initOverrides) {
|
|
@@ -23184,7 +23195,7 @@ var AuthUserDirectoryApi = class extends BaseAPI {
|
|
|
23184
23195
|
return await response.value();
|
|
23185
23196
|
}
|
|
23186
23197
|
/**
|
|
23187
|
-
* Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"
|
|
23198
|
+
* Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
|
|
23188
23199
|
* Pre-provision (invite) an end user (server-side admin)
|
|
23189
23200
|
*/
|
|
23190
23201
|
async inviteEndUserRaw(requestParameters, initOverrides) {
|
|
@@ -23223,7 +23234,7 @@ var AuthUserDirectoryApi = class extends BaseAPI {
|
|
|
23223
23234
|
return new JSONApiResponse(response, (jsonValue) => InviteEndUser200ResponseFromJSON(jsonValue));
|
|
23224
23235
|
}
|
|
23225
23236
|
/**
|
|
23226
|
-
* Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"
|
|
23237
|
+
* Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
|
|
23227
23238
|
* Pre-provision (invite) an end user (server-side admin)
|
|
23228
23239
|
*/
|
|
23229
23240
|
async inviteEndUser(inviteEndUserRequest, initOverrides) {
|
|
@@ -30888,6 +30899,13 @@ var Zyphr = class {
|
|
|
30888
30899
|
* facade, which made the documented `zyphr.workflows.*` calls throw.
|
|
30889
30900
|
*/
|
|
30890
30901
|
workflows;
|
|
30902
|
+
/**
|
|
30903
|
+
* A single workflow execution by id: get its status and step results, cancel
|
|
30904
|
+
* it while running, or retry it after a failure (#1866). List a workflow's
|
|
30905
|
+
* executions with `workflows.listWorkflowExecutions`. Requires the
|
|
30906
|
+
* `workflows:read` scope for reads and `workflows:execute` for cancel/retry.
|
|
30907
|
+
*/
|
|
30908
|
+
executions;
|
|
30891
30909
|
/** Inbound (received) email — read access. Requires the `email:read` scope. */
|
|
30892
30910
|
inbound;
|
|
30893
30911
|
waas;
|
|
@@ -30917,6 +30935,7 @@ var Zyphr = class {
|
|
|
30917
30935
|
this.utility = new UtilityApi(config);
|
|
30918
30936
|
this.domains = new DomainsApi(config);
|
|
30919
30937
|
this.workflows = new WorkflowsApi(config);
|
|
30938
|
+
this.executions = new ExecutionsApi(config);
|
|
30920
30939
|
this.inbound = new InboundEmailApi(config);
|
|
30921
30940
|
this.waas = {
|
|
30922
30941
|
applications: new WaaSApplicationsApi(config),
|
|
@@ -30943,7 +30962,8 @@ var Zyphr = class {
|
|
|
30943
30962
|
profile: new AuthUserProfileApi(config),
|
|
30944
30963
|
userDirectory: new AuthUserDirectoryApi(config),
|
|
30945
30964
|
webauthn: new AuthWebAuthnApi(config),
|
|
30946
|
-
application: new AuthApplicationApi(config)
|
|
30965
|
+
application: new AuthApplicationApi(config),
|
|
30966
|
+
emailTemplates: new AuthEmailTemplatesApi(config)
|
|
30947
30967
|
};
|
|
30948
30968
|
}
|
|
30949
30969
|
/**
|