Skip to content

Commit

Permalink
added basic build
Browse files Browse the repository at this point in the history
  • Loading branch information
niftyvictor committed Nov 8, 2024
1 parent b8cffc1 commit bf9e00f
Show file tree
Hide file tree
Showing 44 changed files with 3,766 additions and 57 deletions.
5 changes: 4 additions & 1 deletion lib/build/recipe/accountlinking/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,12 @@ export declare type AccountInfo = {
id: string;
userId: string;
};
webauthn?: {
credentialIds: string[];
};
};
export declare type AccountInfoWithRecipeId = {
recipeId: "emailpassword" | "thirdparty" | "passwordless";
recipeId: "emailpassword" | "thirdparty" | "passwordless" | "webauthn";
} & AccountInfo;
export declare type RecipeLevelUser = {
tenantIds: string[];
Expand Down
1 change: 1 addition & 0 deletions lib/build/recipe/multifactorauth/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default class Wrapper {
static MultiFactorAuthClaim: import("./multiFactorAuthClaim").MultiFactorAuthClaimClass;
static FactorIds: {
EMAILPASSWORD: string;
WEBAUTHN: string;
OTP_EMAIL: string;
OTP_PHONE: string;
LINK_EMAIL: string;
Expand Down
1 change: 1 addition & 0 deletions lib/build/recipe/multifactorauth/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export declare type GetPhoneNumbersForFactorsFromOtherRecipesFunc = (
};
export declare const FactorIds: {
EMAILPASSWORD: string;
WEBAUTHN: string;
OTP_EMAIL: string;
OTP_PHONE: string;
LINK_EMAIL: string;
Expand Down
1 change: 1 addition & 0 deletions lib/build/recipe/multifactorauth/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.FactorIds = void 0;
exports.FactorIds = {
EMAILPASSWORD: "emailpassword",
WEBAUTHN: "webauthn",
OTP_EMAIL: "otp-email",
OTP_PHONE: "otp-phone",
LINK_EMAIL: "link-email",
Expand Down
9 changes: 9 additions & 0 deletions lib/build/recipe/webauthn/api/emailExists.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @ts-nocheck
import { APIInterface, APIOptions } from "../";
import { UserContext } from "../../../types";
export default function emailExists(
apiImplementation: APIInterface,
tenantId: string,
options: APIOptions,
userContext: UserContext
): Promise<boolean>;
45 changes: 45 additions & 0 deletions lib/build/recipe/webauthn/api/emailExists.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"use strict";
/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
*
* This software is licensed under the Apache License, Version 2.0 (the
* "License") as published by the Apache Software Foundation.
*
* You may not use this file except in compliance with the License. You may
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
var __importDefault =
(this && this.__importDefault) ||
function (mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("../../../utils");
const error_1 = __importDefault(require("../error"));
async function emailExists(apiImplementation, tenantId, options, userContext) {
// Logic as per https://github.com/supertokens/supertokens-node/issues/47#issue-751571692
if (apiImplementation.emailExistsGET === undefined) {
return false;
}
let email = options.req.getKeyValueFromQuery("email");
if (email === undefined || typeof email !== "string") {
throw new error_1.default({
type: error_1.default.BAD_INPUT_ERROR,
message: "Please provide the email as a GET param",
});
}
let result = await apiImplementation.emailExistsGET({
email,
tenantId,
options,
userContext,
});
utils_1.send200Response(options.res, result);
return true;
}
exports.default = emailExists;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @ts-nocheck
import { APIInterface, APIOptions } from "../";
import { UserContext } from "../../../types";
export default function generateRecoverAccountToken(
apiImplementation: APIInterface,
tenantId: string,
options: APIOptions,
userContext: UserContext
): Promise<boolean>;
45 changes: 45 additions & 0 deletions lib/build/recipe/webauthn/api/generateRecoverAccountToken.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"use strict";
/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
*
* This software is licensed under the Apache License, Version 2.0 (the
* "License") as published by the Apache Software Foundation.
*
* You may not use this file except in compliance with the License. You may
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
var __importDefault =
(this && this.__importDefault) ||
function (mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("../../../utils");
const error_1 = __importDefault(require("../error"));
async function generateRecoverAccountToken(apiImplementation, tenantId, options, userContext) {
if (apiImplementation.generateRecoverAccountTokenPOST === undefined) {
return false;
}
const requestBody = await options.req.getJSONBody();
const email = requestBody.email;
if (email === undefined || typeof email !== "string") {
throw new error_1.default({
type: error_1.default.BAD_INPUT_ERROR,
message: "Please provide the email",
});
}
let result = await apiImplementation.generateRecoverAccountTokenPOST({
email,
tenantId,
options,
userContext,
});
utils_1.send200Response(options.res, result);
return true;
}
exports.default = generateRecoverAccountToken;
3 changes: 3 additions & 0 deletions lib/build/recipe/webauthn/api/implementation.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// @ts-nocheck
import { APIInterface } from "..";
export default function getAPIImplementation(): APIInterface;
Loading

0 comments on commit bf9e00f

Please sign in to comment.