diff --git a/examples/ent-rsvp/backend/src/ent/event/actions/create_event_action.ts b/examples/ent-rsvp/backend/src/ent/event/actions/create_event_action.ts index 67fc1f84a..4b47e9a54 100644 --- a/examples/ent-rsvp/backend/src/ent/event/actions/create_event_action.ts +++ b/examples/ent-rsvp/backend/src/ent/event/actions/create_event_action.ts @@ -25,7 +25,7 @@ export default class CreateEventAction extends CreateEventActionBase { return; } - return await Promise.all( + return Promise.all( input.activities.map(async (activity) => { return CreateEventActivityAction.create(builder.viewer, { eventID: builder, diff --git a/examples/ent-rsvp/backend/src/ent/event_activity/actions/create_event_activity_action.ts b/examples/ent-rsvp/backend/src/ent/event_activity/actions/create_event_activity_action.ts index 5790ee1c0..6f5899d6e 100644 --- a/examples/ent-rsvp/backend/src/ent/event_activity/actions/create_event_activity_action.ts +++ b/examples/ent-rsvp/backend/src/ent/event_activity/actions/create_event_activity_action.ts @@ -25,7 +25,7 @@ export default class CreateEventActivityAction extends CreateEventActivityAction if (!this.input.address) { return; } - return await CreateAddressAction.create(builder.viewer, { + return CreateAddressAction.create(builder.viewer, { ...this.input.address, ownerID: builder, ownerType: NodeType.EventActivity, diff --git a/examples/ent-rsvp/backend/src/ent/event_activity/actions/edit_event_activity_rsvp_status_action.ts b/examples/ent-rsvp/backend/src/ent/event_activity/actions/edit_event_activity_rsvp_status_action.ts index 637bf32cb..b8ceca894 100644 --- a/examples/ent-rsvp/backend/src/ent/event_activity/actions/edit_event_activity_rsvp_status_action.ts +++ b/examples/ent-rsvp/backend/src/ent/event_activity/actions/edit_event_activity_rsvp_status_action.ts @@ -67,7 +67,7 @@ export default class EditEventActivityRsvpStatusAction extends EditEventActivity EdgeType.EventActivityToAttending, WriteOperation.Insert, ); - return await Promise.all( + return Promise.all( edges.map(async (edge) => { if (edge.isBuilder(edge.id)) { throw new Error("edge should not be a builder"); diff --git a/examples/ent-rsvp/backend/src/ent/guest_group/actions/create_guest_group_action.ts b/examples/ent-rsvp/backend/src/ent/guest_group/actions/create_guest_group_action.ts index 971e701c4..1d506b6b2 100644 --- a/examples/ent-rsvp/backend/src/ent/guest_group/actions/create_guest_group_action.ts +++ b/examples/ent-rsvp/backend/src/ent/guest_group/actions/create_guest_group_action.ts @@ -42,7 +42,7 @@ export default class CreateGuestGroupAction extends CreateGuestGroupActionBase { (activity) => activity.inviteAllGuests, ); - return await Promise.all( + return Promise.all( activities.map((activity) => EventActivityAddInviteAction.create(builder.viewer, activity) .addInviteID(builder) @@ -57,7 +57,7 @@ export default class CreateGuestGroupAction extends CreateGuestGroupActionBase { return; } - return await Promise.all( + return Promise.all( input.guests.map(async (guest) => { return CreateGuestAction.create(builder.viewer, { eventID: input.eventID, diff --git a/examples/ent-rsvp/backend/src/graphql/resolvers/event.ts b/examples/ent-rsvp/backend/src/graphql/resolvers/event.ts index 785924521..2b33abf65 100644 --- a/examples/ent-rsvp/backend/src/graphql/resolvers/event.ts +++ b/examples/ent-rsvp/backend/src/graphql/resolvers/event.ts @@ -37,6 +37,6 @@ export class EventResolver { ], }) async event(context: RequestContext, slug: string) { - return await Event.loadFromSlug(context.getViewer(), slug); + return Event.loadFromSlug(context.getViewer(), slug); } } diff --git a/examples/ent-rsvp/backend/src/testutils/index.ts b/examples/ent-rsvp/backend/src/testutils/index.ts index c108a29e5..0b282305e 100644 --- a/examples/ent-rsvp/backend/src/testutils/index.ts +++ b/examples/ent-rsvp/backend/src/testutils/index.ts @@ -56,7 +56,7 @@ export async function createActivity( eventID = event.id; } - return await CreateEventActivityAction.create(event.viewer, { + return CreateEventActivityAction.create(event.viewer, { startTime: new Date(), location: "fun location", name: "welcome dinner", @@ -142,7 +142,7 @@ export async function createGuests( group: GuestGroup, idx: number, ): Promise { - return await Promise.all( + return Promise.all( inputs[idx].map(async (input) => { return CreateGuestAction.create(group.viewer, { ...input, diff --git a/examples/ent-rsvp/ent-rsvp-web/src/initRelayEnvironment.ts b/examples/ent-rsvp/ent-rsvp-web/src/initRelayEnvironment.ts index 5c483e643..7570db9ed 100644 --- a/examples/ent-rsvp/ent-rsvp-web/src/initRelayEnvironment.ts +++ b/examples/ent-rsvp/ent-rsvp-web/src/initRelayEnvironment.ts @@ -61,7 +61,7 @@ async function fetchQuery(operation, variables) { process.env.NEXT_PUBLIC_RELAY_ENDPOINT, fetchOptions, ); - return await response.json(); + return response.json(); } catch (err) { console.log("errrrrorrrrr"); console.error(err); diff --git a/examples/simple/src/ent/tests/contact.test.ts b/examples/simple/src/ent/tests/contact.test.ts index 370c43f9e..324a2820f 100644 --- a/examples/simple/src/ent/tests/contact.test.ts +++ b/examples/simple/src/ent/tests/contact.test.ts @@ -15,7 +15,7 @@ import { Transaction } from "@snowtop/ent/action"; const loggedOutViewer = new LoggedOutExampleViewer(); async function createUser(): Promise { - return await CreateUserAction.create(loggedOutViewer, { + return CreateUserAction.create(loggedOutViewer, { firstName: "Jon", lastName: "Snow", emailAddress: randomEmail(), @@ -29,7 +29,7 @@ async function create( firstName: string, lastName: string, ): Promise { - return await CreateContactAction.create(new ExampleViewer(user.id), { + return CreateContactAction.create(new ExampleViewer(user.id), { emails: [ { emailAddress: randomEmail(), diff --git a/examples/simple/src/ent/tests/event.test.ts b/examples/simple/src/ent/tests/event.test.ts index f3c647320..7bae7fd4a 100644 --- a/examples/simple/src/ent/tests/event.test.ts +++ b/examples/simple/src/ent/tests/event.test.ts @@ -13,7 +13,7 @@ import { ID, query } from "@snowtop/ent"; const loggedOutViewer = new LoggedOutExampleViewer(); async function createUser() { - return await CreateUserAction.create(loggedOutViewer, { + return CreateUserAction.create(loggedOutViewer, { firstName: "Jon", lastName: "Snow", emailAddress: randomEmail(), @@ -28,7 +28,7 @@ async function create( ): Promise { let user = await createUser(); - return await CreateEventAction.create(loggedOutViewer, { + return CreateEventAction.create(loggedOutViewer, { name: "fun event", creatorID: user.id, startTime: startTime, diff --git a/examples/simple/src/ent/tests/user.test.ts b/examples/simple/src/ent/tests/user.test.ts index c3efd382c..bd6764f12 100644 --- a/examples/simple/src/ent/tests/user.test.ts +++ b/examples/simple/src/ent/tests/user.test.ts @@ -59,7 +59,7 @@ async function create(opts: Partial): Promise { phoneNumber: randomPhoneNumber(), ...opts, }; - return await CreateUserAction.create(loggedOutViewer, input).saveX(); + return CreateUserAction.create(loggedOutViewer, input).saveX(); } class OmniViewer extends ExampleViewer { diff --git a/examples/simple/src/ent/tests/user_full_text.test.ts b/examples/simple/src/ent/tests/user_full_text.test.ts index c400e0570..5b1b62cab 100644 --- a/examples/simple/src/ent/tests/user_full_text.test.ts +++ b/examples/simple/src/ent/tests/user_full_text.test.ts @@ -128,7 +128,7 @@ async function create(opts: Partial): Promise { phoneNumber: randomPhoneNumber(), ...opts, }; - return await CreateUserAction.create(loggedOutViewer, input).saveX(); + return CreateUserAction.create(loggedOutViewer, input).saveX(); } test("baratheon", async () => { diff --git a/examples/simple/src/ent/tests/user_query.test.ts b/examples/simple/src/ent/tests/user_query.test.ts index b25a32f02..fab623e0b 100644 --- a/examples/simple/src/ent/tests/user_query.test.ts +++ b/examples/simple/src/ent/tests/user_query.test.ts @@ -18,7 +18,7 @@ async function create(opts: Partial): Promise { password: "pa$$w0rd", ...opts, }; - return await CreateUserAction.create(loggedOutViewer, input).saveX(); + return CreateUserAction.create(loggedOutViewer, input).saveX(); } test("self contact query", async () => { diff --git a/examples/simple/src/ent/user/actions/confirm_edit_email_address_action.ts b/examples/simple/src/ent/user/actions/confirm_edit_email_address_action.ts index dad7cfeac..9610e083f 100644 --- a/examples/simple/src/ent/user/actions/confirm_edit_email_address_action.ts +++ b/examples/simple/src/ent/user/actions/confirm_edit_email_address_action.ts @@ -70,7 +70,7 @@ export default class ConfirmEditEmailAddressAction extends ConfirmEditEmailAddre ); } // delete the authCode - return await DeleteAuthCodeAction.create( + return DeleteAuthCodeAction.create( builder.viewer, authCode, ).changeset(); diff --git a/examples/simple/src/ent/user/actions/confirm_edit_phone_number_action.ts b/examples/simple/src/ent/user/actions/confirm_edit_phone_number_action.ts index 75216282c..302a3aed5 100644 --- a/examples/simple/src/ent/user/actions/confirm_edit_phone_number_action.ts +++ b/examples/simple/src/ent/user/actions/confirm_edit_phone_number_action.ts @@ -69,7 +69,7 @@ export default class ConfirmEditPhoneNumberAction extends ConfirmEditPhoneNumber ); } // delete the authCode - return await DeleteAuthCodeAction.create( + return DeleteAuthCodeAction.create( builder.viewer, authCode, ).changeset(); diff --git a/examples/simple/src/graphql/mutations/tests/user_mutations.test.ts b/examples/simple/src/graphql/mutations/tests/user_mutations.test.ts index f6f069b4e..a0485d666 100644 --- a/examples/simple/src/graphql/mutations/tests/user_mutations.test.ts +++ b/examples/simple/src/graphql/mutations/tests/user_mutations.test.ts @@ -24,7 +24,7 @@ async function create(opts: Partial): Promise { phoneNumber: randomPhoneNumber(), ...opts, }; - return await CreateUserAction.create(loggedOutViewer, input).saveX(); + return CreateUserAction.create(loggedOutViewer, input).saveX(); } function getConfig( diff --git a/examples/simple/src/graphql/tests/contact_type.test.ts b/examples/simple/src/graphql/tests/contact_type.test.ts index 14525af01..1dc1b2c06 100644 --- a/examples/simple/src/graphql/tests/contact_type.test.ts +++ b/examples/simple/src/graphql/tests/contact_type.test.ts @@ -60,7 +60,7 @@ function getUserConfig( } async function createUser(): Promise { - return await CreateUserAction.create(loggedOutViewer, { + return CreateUserAction.create(loggedOutViewer, { firstName: "Jon", lastName: "Snow", emailAddress: randomEmail(), @@ -84,7 +84,7 @@ async function createContact(user?: User): Promise { userID: user.id, }).saveX(); // reload - return await Contact.loadX(contact.viewer, contact.id); + return Contact.loadX(contact.viewer, contact.id); } test("query contact", async () => { diff --git a/examples/simple/src/graphql/tests/event_type.test.ts b/examples/simple/src/graphql/tests/event_type.test.ts index 691eda429..d9e17d9bd 100644 --- a/examples/simple/src/graphql/tests/event_type.test.ts +++ b/examples/simple/src/graphql/tests/event_type.test.ts @@ -61,7 +61,7 @@ async function createEvent(options: Partial): Promise { const user = await createUser(); let vc = new ExampleViewer(user.id); - return await CreateEventAction.create(vc, { + return CreateEventAction.create(vc, { name: "event", creatorID: user.id, startTime: new Date(), diff --git a/examples/simple/src/graphql/tests/user_auth.test.ts b/examples/simple/src/graphql/tests/user_auth.test.ts index b7d30f94c..04315a28e 100644 --- a/examples/simple/src/graphql/tests/user_auth.test.ts +++ b/examples/simple/src/graphql/tests/user_auth.test.ts @@ -37,7 +37,7 @@ function getUserRootConfig( const loggedOutViewer = new LoggedOutExampleViewer(); async function createUser(input?: Partial): Promise { - return await CreateUserAction.create(loggedOutViewer, { + return CreateUserAction.create(loggedOutViewer, { firstName: "first", lastName: "last", emailAddress: randomEmail(), diff --git a/examples/simple/src/graphql/tests/user_auth_jwt.test.ts b/examples/simple/src/graphql/tests/user_auth_jwt.test.ts index 49dde380b..80eabfb43 100644 --- a/examples/simple/src/graphql/tests/user_auth_jwt.test.ts +++ b/examples/simple/src/graphql/tests/user_auth_jwt.test.ts @@ -39,7 +39,7 @@ function getUserRootConfig( const loggedOutViewer = new LoggedOutExampleViewer(); async function createUser(input?: Partial): Promise { - return await CreateUserAction.create(loggedOutViewer, { + return CreateUserAction.create(loggedOutViewer, { firstName: "first", lastName: "last", emailAddress: randomEmail(), diff --git a/examples/simple/src/graphql/tests/user_type.test.ts b/examples/simple/src/graphql/tests/user_type.test.ts index 23c2d2a04..7665334a0 100644 --- a/examples/simple/src/graphql/tests/user_type.test.ts +++ b/examples/simple/src/graphql/tests/user_type.test.ts @@ -53,7 +53,7 @@ async function create(opts: Partial): Promise { password: "pa$$w0rd", ...opts, }; - return await CreateUserAction.create(loggedOutViewer, input).saveX(); + return CreateUserAction.create(loggedOutViewer, input).saveX(); } function getNodeConfig( diff --git a/examples/todo-sqlite/src/graphql/mutations/todo/todo_resolver.ts b/examples/todo-sqlite/src/graphql/mutations/todo/todo_resolver.ts index 026c144c0..b24c81fa5 100644 --- a/examples/todo-sqlite/src/graphql/mutations/todo/todo_resolver.ts +++ b/examples/todo-sqlite/src/graphql/mutations/todo/todo_resolver.ts @@ -41,7 +41,7 @@ export class TodosResolver { ChangeTodoStatusAction.create(vc, todo, { completed: completed }), ), ); - return await bulk.saveX(); + return bulk.saveX(); } @gqlMutation({ @@ -72,6 +72,6 @@ export class TodosResolver { AccountBuilder, ...completedTodos.map((todo) => DeleteTodoAction.create(vc, todo)), ); - return await bulk.saveX(); + return bulk.saveX(); } } diff --git a/examples/todo-sqlite/src/graphql/resolvers/todos_resolver.ts b/examples/todo-sqlite/src/graphql/resolvers/todos_resolver.ts index 0ab348971..7b86b4e9a 100644 --- a/examples/todo-sqlite/src/graphql/resolvers/todos_resolver.ts +++ b/examples/todo-sqlite/src/graphql/resolvers/todos_resolver.ts @@ -54,7 +54,7 @@ export class TodoResolver { }) async openTodosPlural(id: ID): Promise { const viewer = new IDViewer(id); - return await Todo.loadCustom( + return Todo.loadCustom( viewer, query.And(query.Eq("assignee_id", id), query.Eq("completed", false)), ); diff --git a/ts/packages/ent-graphql-tests/src/index.ts b/ts/packages/ent-graphql-tests/src/index.ts index 2a86bb4e5..b612c938e 100644 --- a/ts/packages/ent-graphql-tests/src/index.ts +++ b/ts/packages/ent-graphql-tests/src/index.ts @@ -344,7 +344,7 @@ export async function expectQueryFromRoot( config: queryRootConfig, ...options: Option[] // TODO queries? expected values ): Promise> { - return await expectFromRoot( + return expectFromRoot( { ...config, queryPrefix: "query", @@ -375,7 +375,7 @@ export async function expectMutation( }; } - return await expectFromRoot( + return expectFromRoot( { ...config, args: args, diff --git a/ts/packages/ent-passport/src/passport.test.ts b/ts/packages/ent-passport/src/passport.test.ts index 8ff501290..f074c61b8 100644 --- a/ts/packages/ent-passport/src/passport.test.ts +++ b/ts/packages/ent-passport/src/passport.test.ts @@ -124,7 +124,7 @@ let viewerType = new GraphQLObjectType({ async resolve(_source, args, context) { const v = context.getViewer() as IDViewer; - return await v.viewer(); + return v.viewer(); }, }, }, @@ -196,7 +196,7 @@ const authUserSessionType: GraphQLFieldConfig< }, type: new GraphQLNonNull(viewerType), async resolve(_source, args, context) { - return await useAndVerifyAuth( + return useAndVerifyAuth( context, async () => { const row = await loadRow({ @@ -263,7 +263,7 @@ interface User { } async function createUser(opts?: Partial) { - return await createRowForTest( + return createRowForTest( { tableName: "users", fields: { diff --git a/ts/packages/ent-passport/src/passport.ts b/ts/packages/ent-passport/src/passport.ts index f4b93e604..7255954ad 100644 --- a/ts/packages/ent-passport/src/passport.ts +++ b/ts/packages/ent-passport/src/passport.ts @@ -82,7 +82,7 @@ export class PassportAuthHandler implements AuthHandler { return null; } let userr = await user; - return await toViewer(context, userr, this.options?.userToViewer); + return toViewer(context, userr, this.options?.userToViewer); } static testInitSessionBasedFunction( @@ -111,7 +111,7 @@ async function toViewer( return obj; } if (userToViewer) { - return await userToViewer(context, obj); + return userToViewer(context, obj); } throw new Error("cannot convert to Viewer"); @@ -322,15 +322,11 @@ export async function useAndVerifyAuth( if (!viewerMaybe) { return null; } - return await toViewer( - context, - viewerMaybe, - defaultReqToViewer(loadOptions), - ); + return toViewer(context, viewerMaybe, defaultReqToViewer(loadOptions)); }, }); - return await useAndAuth(context, strategy, options); + return useAndAuth(context, strategy, options); } interface JWTOptions { diff --git a/ts/packages/ent-password/src/password.ts b/ts/packages/ent-password/src/password.ts index 1b886d1b9..b4c6c6026 100644 --- a/ts/packages/ent-password/src/password.ts +++ b/ts/packages/ent-password/src/password.ts @@ -66,7 +66,7 @@ export class Password extends BaseField implements Field { val = this.stringType.format(val); let salt = await bcrypt.genSalt(this._cost); - return await bcrypt.hash(val, salt); + return bcrypt.hash(val, salt); } valid(val: any): boolean {