Skip to content

Commit

Permalink
Remove all changes in user metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
deepjyoti30-st committed Oct 14, 2024
1 parent 81cb0c3 commit 848c8a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 354 deletions.
174 changes: 2 additions & 172 deletions lib/build/recipe/usermetadata/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// @ts-nocheck
import { BaseRequest, BaseResponse } from "../../framework";
import OverrideableBuilder from "supertokens-js-override";
import { GeneralErrorResponse, JSONObject, UserContext } from "../../types";
import { SessionContainerInterface } from "../session/types";
import { JSONObject, UserContext } from "../../types";
export declare type TypeInput = {
override?: {
functions?: (
Expand All @@ -21,175 +19,7 @@ export declare type TypeNormalisedInput = {
apis: (originalImplementation: APIInterface, builder?: OverrideableBuilder<APIInterface>) => APIInterface;
};
};
export declare type APIOptions = {
recipeImplementation: RecipeInterface;
config: TypeNormalisedInput;
recipeId: string;
isInServerlessEnv: boolean;
req: BaseRequest;
res: BaseResponse;
};
export declare type APIInterface = {
userDetailsGET?: (input: {
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
details: {
name?: string;
};
}
| GeneralErrorResponse
>;
updateUserDetailsPOST?: (input: {
session: SessionContainerInterface;
details: {
name?: string;
};
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
details: {
name: string | undefined;
};
}
| {
status: "USER_DETAILS_UPDATE_NOT_ALLOWED";
reason: string;
}
| GeneralErrorResponse
>;
userEmailsGET?: (input: {
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
emails: Array<{
id: string;
isVerified: boolean;
isPrimary: boolean;
}>;
}
| GeneralErrorResponse
>;
addEmailForUserPOST?: (input: {
email: {
id: string;
isVerified?: boolean;
isPrimary?: boolean;
};
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
}
| {
status: "UNVERIFIED_EMAIL_CANNOT_BE_PRIMARY";
reason: string;
}
| GeneralErrorResponse
>;
updateEmailForUserPATCH?: (input: {
emailId: string;
details: {
isVerified?: boolean;
isPrimary?: boolean;
};
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
}
| {
status: "UNVERIFIED_EMAIL_CANNOT_BE_PRIMARY";
reason: string;
}
| GeneralErrorResponse
>;
removeEmailForUserDELETE?: (
emailId: string,
session: SessionContainerInterface,
options: APIOptions,
userContext: UserContext
) => Promise<
| {
status: "OK";
email: {
id: string;
isVerified: boolean;
isPrimary: boolean;
};
}
| {
status: "AT_LEAST_ONE_VERIFIED_EMAIL_IS_REQUIRED";
reason: string;
}
| GeneralErrorResponse
>;
userPhoneNumbersGET?: (input: {
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
phones: Array<{
number: string;
isVerified: boolean;
}>;
}
| GeneralErrorResponse
>;
addPhoneNumberForUserPOST?: (input: {
phone: {
number: string;
isVerified?: boolean;
};
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
}
| GeneralErrorResponse
>;
updatePhoneNumberForUserPATCH?: (input: {
phoneNumber: string;
details: {
isVerified?: boolean;
};
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
}
| GeneralErrorResponse
>;
removePhoneNumberForUserDELETE?: (
phoneNumber: string,
session: SessionContainerInterface,
options: APIOptions,
userContext: UserContext
) => Promise<
| {
status: "OK";
}
| GeneralErrorResponse
>;
};
export declare type APIInterface = {};
export declare type RecipeInterface = {
getUserMetadata: (input: {
userId: string;
Expand Down
184 changes: 2 additions & 182 deletions lib/ts/recipe/usermetadata/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
* under the License.
*/

import { BaseRequest, BaseResponse } from "../../framework";
import OverrideableBuilder from "supertokens-js-override";
import { GeneralErrorResponse, JSONObject, UserContext } from "../../types";
import { SessionContainerInterface } from "../session/types";
import { JSONObject, UserContext } from "../../types";

export type TypeInput = {
override?: {
Expand All @@ -38,185 +36,7 @@ export type TypeNormalisedInput = {
};
};

export type APIOptions = {
recipeImplementation: RecipeInterface;
config: TypeNormalisedInput;
recipeId: string;
isInServerlessEnv: boolean;
req: BaseRequest;
res: BaseResponse;
};

export type APIInterface = {
userDetailsGET?: (input: {
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
details: {
name?: string;
};
}
| GeneralErrorResponse
>;

updateUserDetailsPOST?: (input: {
session: SessionContainerInterface;
details: {
name?: string;
};
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
details: {
name: string | undefined;
};
}
| {
status: "USER_DETAILS_UPDATE_NOT_ALLOWED";
reason: string;
}
| GeneralErrorResponse
>;

userEmailsGET?: (input: {
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
emails: Array<{
id: string;
isVerified: boolean;
isPrimary: boolean;
}>;
}
| GeneralErrorResponse
>;

addEmailForUserPOST?: (input: {
email: {
id: string;
isVerified?: boolean;
isPrimary?: boolean;
};
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
}
| {
status: "UNVERIFIED_EMAIL_CANNOT_BE_PRIMARY";
reason: string;
}
| GeneralErrorResponse
>;

updateEmailForUserPATCH?: (input: {
emailId: string;
details: {
isVerified?: boolean;
isPrimary?: boolean;
};
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
}
| {
status: "UNVERIFIED_EMAIL_CANNOT_BE_PRIMARY";
reason: string;
}
| GeneralErrorResponse
>;

removeEmailForUserDELETE?: (
emailId: string,
session: SessionContainerInterface,
options: APIOptions,
userContext: UserContext
) => Promise<
| {
status: "OK";
email: {
id: string;
isVerified: boolean;
isPrimary: boolean;
};
}
| {
status: "AT_LEAST_ONE_VERIFIED_EMAIL_IS_REQUIRED";
reason: string;
}
| GeneralErrorResponse
>;

userPhoneNumbersGET?: (input: {
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
phones: Array<{
number: string;
isVerified: boolean;
}>;
}
| GeneralErrorResponse
>;

addPhoneNumberForUserPOST?: (input: {
phone: {
number: string;
isVerified?: boolean;
};
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
}
| GeneralErrorResponse
>;

updatePhoneNumberForUserPATCH?: (input: {
phoneNumber: string;
details: {
isVerified?: boolean;
};
session: SessionContainerInterface;
options: APIOptions;
userContext: UserContext;
}) => Promise<
| {
status: "OK";
}
| GeneralErrorResponse
>;

removePhoneNumberForUserDELETE?: (
phoneNumber: string,
session: SessionContainerInterface,
options: APIOptions,
userContext: UserContext
) => Promise<
| {
status: "OK";
}
| GeneralErrorResponse
>;
};
export type APIInterface = {};

export type RecipeInterface = {
getUserMetadata: (input: {
Expand Down

0 comments on commit 848c8a8

Please sign in to comment.