[
  {
    "path": ".editorconfig",
    "content": "# editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\ndist\n*.log\ncoverage\n.env\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"singleQuote\": true\n}\n"
  },
  {
    "path": ".travis.yml",
    "content": "sudo: false\n\nlanguage:\n  node_js\n\nnode_js:\n  - '8'\n\ncache:\n  yarn: true\n  directories:\n    - node_modules\n\nscript:\n  cd packages/graphql-authentication && npm run ci\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "Pull requests and issues are very welcome!\n\n# Prerequisites\n\n- Node v8+\n\n# Getting started\n\nTo get started, clone this repository and run `yarn` in the repository root. Note you have to use Yarn, npm will not work correctly.\n\nIn the `packages/` folder, pick one of the packages you want to work on. You can run the tests inside a package with `yarn test`.\nIf you want to use a GraphQL Playground to test something by hand, you can go to `packages/graphql-authentication-prisma/example` and run `docker-compose up -d` in it (this requires you have Docker installed). Then, run `yarn start`.\n\n# Adding a feature or changing behavior\n\nFor features or changes, please create a new issue first. Since this is a very opinionated package, it is possible I don’t like the change. By discussing it first you can prevent wasted time. But please do! I am very open to improvements.\n\n# Publishing packages\n\nIn the root repository, run `yarn run publish` (note: the `run` part is very important). This will make Lerna publish all the packages. After that, be sure to write a changelog on GitHubs Releases page.\n"
  },
  {
    "path": "LICENSE",
    "content": "ISC License\n\nCopyright (c) 2018, Volst\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# GraphQL Authentication\n\n**Disclaimer: This repository is not actively maintained!**\n\n_Previously called Prisma Auth_\n\nA very opinionated user authentication package for [GraphQL](https://graphql.org/). It uses old-school email/password authentication.\n\nThis package provides **a GraphQL schema and GraphQL resolvers** for everything you need related to authentication. It does not access your data layer (e.g. an ORM); for that you need to write an _adapter_ (which is not hard to do).\nIf you use Prisma, there is already an adapter for you, **[graphql-authentication-prisma](https://github.com/Volst/graphql-authentication/tree/master/packages/graphql-authentication-prisma)**. You can also checkout the [`examples/`](https://github.com/Volst/graphql-authentication/tree/master/examples) folder with examples on how to write an adapter for Sequelize and TypeORM!\n\n[**👉 Try out the live demo**](https://graphql-authentication-demo.now.sh/)\n\n**Features:**\n\n- Signup with good ol' email/password and confirmation email\n- Login\n- Invite another user (sends email)\n- Password reset\n- Change password of current user\n- Update current user info\n- Support for [graphql-shield](https://github.com/maticzav/graphql-shield) to deal with permissions\n\n# Motivation\n\nAdding user authentication seems simple; there are lots of examples on how to write a \"login\" and a \"signup\" resolver. You implement it in your own project and continue working. After a while you'll have users forgetting their password so you need to build something for that. Then you want to be able to invite users, ... you get the idea. In the end you have a lot of boilerplate code related to user authentication.\n\nThe intention with this package is **to let you write as less user-related code as possible**, while being flexible enough to support different use cases like open sign up, invitation-only signup, extra fields on the User model etc.\n\n> If this package is too opinionated for you, you could still copy/paste parts of it in your application!\n\n# Install\n\nNode v8+ should be used. Install with Yarn or npm:\n\n```\nyarn add graphql-authentication email-templates\nnpm i graphql-authentication email-templates\n```\n\n# Usage\n\n## Using the schema\n\nIn your own GraphQL schema you can import all the types this package provides:\n\n```graphql\n# import Query.*, Mutation.* from \"node_modules/graphql-authentication/schema.graphql\"\n```\n\n> This only works if you use [graphql-import](https://github.com/prismagraphql/graphql-import). If you are using graphql-yoga this will work out of the box!\n\nAlternatively you can only import the types you want to expose, for example:\n\n```graphql\n# import Query.currentUser, Mutation.signupByInvite, Mutation.inviteUser, Mutation.login from \"node_modules/graphql-authentication/schema.graphql\"\n```\n\n## Configuration\n\nWe need to add some configuration to get this package to work. The following example uses [graphql-yoga](https://github.com/graphcool/graphql-yoga/), but it should also work with Apollo Server.\n\n```js\nimport { graphqlAuthenticationConfig } from 'graphql-authentication';\nimport * as Email from 'email-templates';\n\nconst server = new GraphQLServer({\n  typeDefs: './schema.graphql',\n  resolvers,\n  context: req => ({\n    ...req,\n    graphqlAuthentication: graphqlAuthenticationConfig({\n      // Required, see for more info the \"Writing an adapter\" section on this page\n      adapter: new GraphqlAuthenticationSequelizeAdapter(),\n      // Required, used for signing JWT tokens\n      secret: 'wheredidthesodago',\n      // Optional, for sending emails with email-templates (https://www.npmjs.com/package/email-templates)\n      mailer: new Email(),\n      // Optional, the URL to your frontend which is used in emails\n      mailAppUrl: 'http://example.com'\n    })\n  })\n});\n```\n\n## Adding the resolvers\n\nYou need to expose the resolvers this package provides for you to your own GraphQL server. For example:\n\n```js\nimport { authQueries, authMutations } from 'graphql-authentication';\n\nconst resolvers = {\n  Query: {\n    ...authQueries\n  },\n  Mutation: {\n    ...authMutations\n  }\n};\n```\n\n## Emails\n\nLastly, this project can optionally send emails for you (e.g. the password reset link). [`email-templates`](https://www.npmjs.com/package/email-templates) is used for this. Be sure to configure it in the options:\n\n```js\nimport * as Email from 'email-templates';\n\ngraphqlAuthentication: graphqlAuthenticationConfig({\n  mailer: new Email()\n});\n```\n\nHowever, this package does not provide the email templates itself for you, since these differ too much. You can [**copy the email templates**](https://github.com/Volst/graphql-authentication/tree/master/examples/with-prisma/emails) from our example to get started.\n\n# Documentation\n\n## GraphQL endpoints\n\nMutations:\n\n- `signUpByInvite`\n- `signup`\n- `confirmEmail`\n- `inviteUser`\n- `login`\n- `changePassword`\n- `updateCurrentUser`\n- `trigerPasswordReset`\n- `passwordReset`\n\nQueries:\n\n- `currentUser`\n\nFor more details take a look at [schema.graphql](./packages/graphql-authentication/schema.graphql).\n\n## Authentication on endpoints\n\nOn some of your endpoints you might want to require that the user is logged in, or only allow the user to see the data if they have a specific role. A very powerful package exists for this, [graphql-shield](https://github.com/maticzav/graphql-shield):\n\n```js\nimport { shield, rule } from 'graphql-shield';\nimport { isAuthResolver } from 'graphql-authentication';\n\nconst isAuth = rule()(isAuthResolver);\n\nconst permissions = shield({\n  Mutation: {\n    publish: isAuth\n  }\n});\n\nconst server = new GraphQLServer({\n  typeDefs: './schema.graphql',\n  resolvers,\n  middlewares: [permissions]\n});\n```\n\nTake a look at the [graphql-shield README](https://github.com/maticzav/graphql-shield/blob/master/README.md) to find out more.\n\n## Helper utilities\n\nGet the current user in a resolver (performs a request to your data layer):\n\n```js\nimport { getUser } from 'graphql-authentication';\n\nconst Mutation = {\n  async publish(parent, data, ctx) {\n    const user = await getUser(ctx);\n    console.log('User', user.email);\n  }\n};\n```\n\nGet only the current user ID in a resolver (without request to your data layer):\n\n```js\nimport { getUserId } from 'graphql-authentication';\n\nconst Mutation = {\n  async publish(parent, data, ctx) {\n    const userId = await getUserId(ctx);\n    console.log('User', userId);\n  }\n};\n```\n\n## Login and session handling\n\n[JWT tokens](https://jwt.io/) are used to handle sessions. In the frontend you can perform a login like this:\n\n```graphql\nmutation login($email: String!, $password: String!) {\n  login(email: $email, password: $password) {\n    token\n    user {\n      # optional\n      name\n    }\n  }\n}\n```\n\nAnd then save the token to `localStorage`. Now you need to send the token with every request. If you are using Apollo, [the documentation](https://www.apollographql.com/docs/react/recipes/authentication.html#Header) has a great example on how to do this.\n\n## Adding custom fields to the User type\n\nIf you wish to expose some fields on the User type that are not exposed in our [schema.graphql](./packages/graphql-authentication/schema.graphql), you can provide your own User. In your own `schema.graphql`, do something like the following:\n\n```graphql\n# import Mutation.* from \"node_modules/graphql-authentication/schema.graphql\"\n\ntype Query {\n  currentUser: User\n}\n\ntype User {\n  id: ID!\n  email: String!\n  name: String!\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n  # And finally, our custom field:\n  isWillingToDance: Boolean!\n}\n```\n\nIf for example you do not want the `joinedAt` field to be exposed, you can simply remove it from your schema.\n\n> `extend type User` would save some copy/pasta here, but unfortunately that doesn't work yet in `graphql-js`. [More info](https://github.com/graphcool/graphql-import/issues/42#issuecomment-357693183).\n\n## Signup only by invite\n\nBy default everyone can signup for your project. But what if you want to only allow invite by signup? In this case you need to leave out the `Mutation.signup` import. Example:\n\n```graphql\n# import Mutation.signupByInvite, Mutation.inviteUser, Mutation.login, Mutation.changePassword, Mutation.updateCurrentUser, Mutation.triggerPasswordReset, Mutation.passwordReset, from \"node_modules/graphql-authentication/schema.graphql\"\n```\n\n## Making email confirmation required before login\n\nAfter a user signups via the `signup` endpoint, they will get an email with a link in it to confirm their email. Meanwhile they can still login in the app. This is done to not disturb the users flow too much (e.g. services like Twitter do this too). It is left open to the project to block the user after a while. With the fields `emailConfirmed` and `joinedAt` on the User you can perhaps display a warning in your frontend or disallow certain features.\n\nHowever, you might want to block the user from logging in at all when their email is not yet confirmed. In this case you need to pass this option:\n\n```js\ngraphqlAuthentication: graphqlAuthenticationConfig({\n  requiredConfirmedEmailForLogin: true\n});\n```\n\n## Custom password validation\n\nThe users password is validated with `password.length >= 8` by default. Maybe you want stricter or less stricter validation on this. You will need to pass this option to change it:\n\n```js\ngraphqlAuthentication: graphqlAuthenticationConfig({\n  validatePassword: value => value.length >= 10\n});\n```\n\n## Writing an adapter\n\nAn adapter sits between GraphQL Authentication and your own ORM/database thingy. If you are using Prisma, there is already [graphql-authentication-prisma](https://github.com/Volst/graphql-authentication/tree/master/packages/graphql-authentication-prisma) for you.\n\nHowever, if you don't use Prisma, that's totally fine! Writing an adapter shouldn't take very long.\n\nIn [the tests](https://github.com/Volst/graphql-authentication/blob/refactor/packages/graphql-authentication/src/__tests__/setup.ts) there is a good example of an adapter. Also, the [`examples/`](https://github.com/Volst/graphql-authentication/tree/master/examples) folder contains more some custom adapters, like one for Sequelize.\n\nYou can keep the adapter class directly in your own project, make a separate npm package for it or write a PR to add it here (please do)!\n\n> TODO: this section needs to be improved\n"
  },
  {
    "path": "examples/with-prisma/.graphqlconfig.yml",
    "content": "projects:\n  prisma:\n    schemaPath: \"./generated/prisma.graphql\"\n    extensions:\n      prisma: prisma.yml\n      codegen:\n        generator: prisma-binding\n        output:\n          binding: \"generated/prisma.ts\"\n        language: typescript\n"
  },
  {
    "path": "examples/with-prisma/README.md",
    "content": "# Prisma example\n\nThis is an example of how to use GraphQL Authentication with [Prisma](https://www.prisma.io/). It uses the adapter package for Prisma, [graphql-authentication-prisma](https://github.com/Volst/graphql-authentication/tree/master/packages/graphql-authentication-prisma).\n\n## Usage\n\nYou need to have Docker installed. If you're new to Prisma, you might want to read the [Quickstart](https://www.prismagraphql.com/docs/quickstart/) first.\n\n```\ndocker-compose up -d # now wait for it to start\nyarn prisma deploy\nnpm i\nnpm start\n```\n\nGo to http://localhost:4000 in your browser and start running some queries and mutations!\n"
  },
  {
    "path": "examples/with-prisma/datamodel.graphql",
    "content": "type User {\n  id: ID! @unique\n  email: String! @unique\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean! @default(value: \"true\")\n  emailConfirmed: Boolean! @default(value: \"true\")\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean! @default(value: \"false\")\n}\n"
  },
  {
    "path": "examples/with-prisma/docker-compose.yml",
    "content": "version: '3'\nservices:\n  prisma:\n    image: prismagraphql/prisma:1.9\n    restart: \"no\"\n    ports:\n    - \"4466:4466\"\n    environment:\n      PRISMA_CONFIG: |\n        port: 4466\n        managementApiSecret: \"mymanagementsecret123\"\n        databases:\n          default:\n            connector: mysql\n            active: true\n            host: db\n            port: 3306\n            user: root\n            password: prisma\n  db:\n    image: mysql:5.7\n    restart: \"no\"\n    environment:\n      MYSQL_ROOT_PASSWORD: prisma\n"
  },
  {
    "path": "examples/with-prisma/emails/inviteUser/html.pug",
    "content": "p Hi,\np You are invited to join *your project*!\np\n  a(href=mailAppUrl + '/register/' + email + '/' + inviteToken) Accept invite.\n"
  },
  {
    "path": "examples/with-prisma/emails/inviteUser/subject.pug",
    "content": "= `Invited for *your project*!`\n"
  },
  {
    "path": "examples/with-prisma/emails/passwordReset/html.pug",
    "content": "p Hi,\np You requested a password reset on *your project*.\np\n  a(href=mailAppUrl + '/login/reset-password/' + email + '/' + resetToken) Reset my password.\n"
  },
  {
    "path": "examples/with-prisma/emails/passwordReset/subject.pug",
    "content": "= `Confirm your email on *your project*`\n"
  },
  {
    "path": "examples/with-prisma/emails/signupUser/html.pug",
    "content": "p Hi,\np You have just created an account on *your project*! As a last step, please confirm your email:\np\n  a(href=mailAppUrl + '/confirm-email/' + email + '/' + emailConfirmToken) Confirm email.\n"
  },
  {
    "path": "examples/with-prisma/emails/signupUser/subject.pug",
    "content": "= `Confirm your email on *your project*`\n"
  },
  {
    "path": "examples/with-prisma/generated/prisma.graphql",
    "content": "# source: http://localhost:4466\n# timestamp: Mon Jul 16 2018 12:37:56 GMT+0200 (CEST)\n\ntype AggregateUser {\n  count: Int!\n}\n\ntype BatchPayload {\n  \"\"\"\n  The number of nodes that have been affected by the Batch operation.\n  \"\"\"\n  count: Long!\n}\n\nscalar DateTime\n\n\"\"\"\nThe `Long` scalar type represents non-fractional signed whole numeric values.\nLong can represent values between -(2^63) and 2^63 - 1.\n\"\"\"\nscalar Long\n\ntype Mutation {\n  createUser(data: UserCreateInput!): User!\n  updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User\n  deleteUser(where: UserWhereUniqueInput!): User\n  upsertUser(\n    where: UserWhereUniqueInput!\n    create: UserCreateInput!\n    update: UserUpdateInput!\n  ): User!\n  updateManyUsers(data: UserUpdateInput!, where: UserWhereInput): BatchPayload!\n  deleteManyUsers(where: UserWhereInput): BatchPayload!\n}\n\nenum MutationType {\n  CREATED\n  UPDATED\n  DELETED\n}\n\n\"\"\"\nAn object with an ID\n\"\"\"\ninterface Node {\n  \"\"\"\n  The id of the object.\n  \"\"\"\n  id: ID!\n}\n\n\"\"\"\nInformation about pagination in a connection.\n\"\"\"\ntype PageInfo {\n  \"\"\"\n  When paginating forwards, are there more items?\n  \"\"\"\n  hasNextPage: Boolean!\n\n  \"\"\"\n  When paginating backwards, are there more items?\n  \"\"\"\n  hasPreviousPage: Boolean!\n\n  \"\"\"\n  When paginating backwards, the cursor to continue.\n  \"\"\"\n  startCursor: String\n\n  \"\"\"\n  When paginating forwards, the cursor to continue.\n  \"\"\"\n  endCursor: String\n}\n\ntype Query {\n  users(\n    where: UserWhereInput\n    orderBy: UserOrderByInput\n    skip: Int\n    after: String\n    before: String\n    first: Int\n    last: Int\n  ): [User]!\n  user(where: UserWhereUniqueInput!): User\n  usersConnection(\n    where: UserWhereInput\n    orderBy: UserOrderByInput\n    skip: Int\n    after: String\n    before: String\n    first: Int\n    last: Int\n  ): UserConnection!\n\n  \"\"\"\n  Fetches an object given its ID\n  \"\"\"\n  node(\n    \"\"\"\n    The ID of an object\n    \"\"\"\n    id: ID!\n  ): Node\n}\n\ntype Subscription {\n  user(where: UserSubscriptionWhereInput): UserSubscriptionPayload\n}\n\ntype User implements Node {\n  id: ID!\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n}\n\n\"\"\"\nA connection to a list of items.\n\"\"\"\ntype UserConnection {\n  \"\"\"\n  Information to aid in pagination.\n  \"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"\n  A list of edges.\n  \"\"\"\n  edges: [UserEdge]!\n  aggregate: AggregateUser!\n}\n\ninput UserCreateInput {\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean\n  emailConfirmed: Boolean\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean\n}\n\n\"\"\"\nAn edge in a connection.\n\"\"\"\ntype UserEdge {\n  \"\"\"\n  The item at the end of the edge.\n  \"\"\"\n  node: User!\n\n  \"\"\"\n  A cursor for use in pagination.\n  \"\"\"\n  cursor: String!\n}\n\nenum UserOrderByInput {\n  id_ASC\n  id_DESC\n  email_ASC\n  email_DESC\n  password_ASC\n  password_DESC\n  name_ASC\n  name_DESC\n  inviteToken_ASC\n  inviteToken_DESC\n  inviteAccepted_ASC\n  inviteAccepted_DESC\n  emailConfirmed_ASC\n  emailConfirmed_DESC\n  emailConfirmToken_ASC\n  emailConfirmToken_DESC\n  resetToken_ASC\n  resetToken_DESC\n  resetExpires_ASC\n  resetExpires_DESC\n  deletedAt_ASC\n  deletedAt_DESC\n  lastLogin_ASC\n  lastLogin_DESC\n  joinedAt_ASC\n  joinedAt_DESC\n  isSuper_ASC\n  isSuper_DESC\n  updatedAt_ASC\n  updatedAt_DESC\n  createdAt_ASC\n  createdAt_DESC\n}\n\ntype UserPreviousValues {\n  id: ID!\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n}\n\ntype UserSubscriptionPayload {\n  mutation: MutationType!\n  node: User\n  updatedFields: [String!]\n  previousValues: UserPreviousValues\n}\n\ninput UserSubscriptionWhereInput {\n  \"\"\"\n  Logical AND on all given filters.\n  \"\"\"\n  AND: [UserSubscriptionWhereInput!]\n\n  \"\"\"\n  Logical OR on all given filters.\n  \"\"\"\n  OR: [UserSubscriptionWhereInput!]\n\n  \"\"\"\n  Logical NOT on all given filters combined by AND.\n  \"\"\"\n  NOT: [UserSubscriptionWhereInput!]\n\n  \"\"\"\n  The subscription event gets dispatched when it's listed in mutation_in\n  \"\"\"\n  mutation_in: [MutationType!]\n\n  \"\"\"\n  The subscription event gets only dispatched when one of the updated fields names is included in this list\n  \"\"\"\n  updatedFields_contains: String\n\n  \"\"\"\n  The subscription event gets only dispatched when all of the field names included in this list have been updated\n  \"\"\"\n  updatedFields_contains_every: [String!]\n\n  \"\"\"\n  The subscription event gets only dispatched when some of the field names included in this list have been updated\n  \"\"\"\n  updatedFields_contains_some: [String!]\n  node: UserWhereInput\n}\n\ninput UserUpdateInput {\n  email: String\n  password: String\n  name: String\n  inviteToken: String\n  inviteAccepted: Boolean\n  emailConfirmed: Boolean\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime\n  isSuper: Boolean\n}\n\ninput UserWhereInput {\n  \"\"\"\n  Logical AND on all given filters.\n  \"\"\"\n  AND: [UserWhereInput!]\n\n  \"\"\"\n  Logical OR on all given filters.\n  \"\"\"\n  OR: [UserWhereInput!]\n\n  \"\"\"\n  Logical NOT on all given filters combined by AND.\n  \"\"\"\n  NOT: [UserWhereInput!]\n  id: ID\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  id_not: ID\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  id_in: [ID!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  id_not_in: [ID!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  id_lt: ID\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  id_lte: ID\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  id_gt: ID\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  id_gte: ID\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  id_contains: ID\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  id_not_contains: ID\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  id_starts_with: ID\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  id_not_starts_with: ID\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  id_ends_with: ID\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  id_not_ends_with: ID\n  email: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  email_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  email_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  email_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  email_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  email_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  email_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  email_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  email_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  email_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  email_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  email_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  email_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  email_not_ends_with: String\n  password: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  password_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  password_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  password_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  password_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  password_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  password_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  password_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  password_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  password_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  password_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  password_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  password_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  password_not_ends_with: String\n  name: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  name_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  name_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  name_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  name_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  name_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  name_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  name_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  name_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  name_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  name_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  name_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  name_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  name_not_ends_with: String\n  inviteToken: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  inviteToken_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  inviteToken_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  inviteToken_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  inviteToken_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  inviteToken_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  inviteToken_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  inviteToken_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  inviteToken_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  inviteToken_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  inviteToken_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  inviteToken_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  inviteToken_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  inviteToken_not_ends_with: String\n  inviteAccepted: Boolean\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  inviteAccepted_not: Boolean\n  emailConfirmed: Boolean\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  emailConfirmed_not: Boolean\n  emailConfirmToken: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  emailConfirmToken_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  emailConfirmToken_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  emailConfirmToken_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  emailConfirmToken_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  emailConfirmToken_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  emailConfirmToken_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  emailConfirmToken_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  emailConfirmToken_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  emailConfirmToken_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  emailConfirmToken_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  emailConfirmToken_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  emailConfirmToken_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  emailConfirmToken_not_ends_with: String\n  resetToken: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  resetToken_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  resetToken_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  resetToken_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  resetToken_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  resetToken_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  resetToken_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  resetToken_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  resetToken_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  resetToken_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  resetToken_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  resetToken_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  resetToken_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  resetToken_not_ends_with: String\n  resetExpires: DateTime\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  resetExpires_not: DateTime\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  resetExpires_in: [DateTime!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  resetExpires_not_in: [DateTime!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  resetExpires_lt: DateTime\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  resetExpires_lte: DateTime\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  resetExpires_gt: DateTime\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  resetExpires_gte: DateTime\n  deletedAt: DateTime\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  deletedAt_not: DateTime\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  deletedAt_in: [DateTime!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  deletedAt_not_in: [DateTime!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  deletedAt_lt: DateTime\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  deletedAt_lte: DateTime\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  deletedAt_gt: DateTime\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  deletedAt_gte: DateTime\n  lastLogin: DateTime\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  lastLogin_not: DateTime\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  lastLogin_in: [DateTime!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  lastLogin_not_in: [DateTime!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  lastLogin_lt: DateTime\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  lastLogin_lte: DateTime\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  lastLogin_gt: DateTime\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  lastLogin_gte: DateTime\n  joinedAt: DateTime\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  joinedAt_not: DateTime\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  joinedAt_in: [DateTime!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  joinedAt_not_in: [DateTime!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  joinedAt_lt: DateTime\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  joinedAt_lte: DateTime\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  joinedAt_gt: DateTime\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  joinedAt_gte: DateTime\n  isSuper: Boolean\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  isSuper_not: Boolean\n}\n\ninput UserWhereUniqueInput {\n  id: ID\n  email: String\n}\n"
  },
  {
    "path": "examples/with-prisma/generated/prisma.ts",
    "content": "import { GraphQLResolveInfo, GraphQLSchema } from 'graphql';\nimport { IResolvers } from 'graphql-tools/dist/Interfaces';\nimport { Options } from 'graphql-binding';\nimport { makePrismaBindingClass, BasePrismaOptions } from 'prisma-binding';\n\nexport interface Query {\n  users: <T = User[]>(\n    args: {\n      where?: UserWhereInput;\n      orderBy?: UserOrderByInput;\n      skip?: Int;\n      after?: String;\n      before?: String;\n      first?: Int;\n      last?: Int;\n    },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  user: <T = User | null>(\n    args: { where: UserWhereUniqueInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  usersConnection: <T = UserConnection>(\n    args: {\n      where?: UserWhereInput;\n      orderBy?: UserOrderByInput;\n      skip?: Int;\n      after?: String;\n      before?: String;\n      first?: Int;\n      last?: Int;\n    },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  node: <T = Node | null>(\n    args: { id: ID_Output },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n}\n\nexport interface Mutation {\n  createUser: <T = User>(\n    args: { data: UserCreateInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  updateUser: <T = User | null>(\n    args: { data: UserUpdateInput; where: UserWhereUniqueInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  deleteUser: <T = User | null>(\n    args: { where: UserWhereUniqueInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  upsertUser: <T = User>(\n    args: {\n      where: UserWhereUniqueInput;\n      create: UserCreateInput;\n      update: UserUpdateInput;\n    },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  updateManyUsers: <T = BatchPayload>(\n    args: { data: UserUpdateInput; where?: UserWhereInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  deleteManyUsers: <T = BatchPayload>(\n    args: { where?: UserWhereInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n}\n\nexport interface Subscription {\n  user: <T = UserSubscriptionPayload | null>(\n    args: { where?: UserSubscriptionWhereInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<AsyncIterator<T>>;\n}\n\nexport interface Exists {\n  User: (where?: UserWhereInput) => Promise<boolean>;\n}\n\nexport interface Prisma {\n  query: Query;\n  mutation: Mutation;\n  subscription: Subscription;\n  exists: Exists;\n  request: <T = any>(\n    query: string,\n    variables?: { [key: string]: any }\n  ) => Promise<T>;\n  delegate(\n    operation: 'query' | 'mutation',\n    fieldName: string,\n    args: {\n      [key: string]: any;\n    },\n    infoOrQuery?: GraphQLResolveInfo | string,\n    options?: Options\n  ): Promise<any>;\n  delegateSubscription(\n    fieldName: string,\n    args?: {\n      [key: string]: any;\n    },\n    infoOrQuery?: GraphQLResolveInfo | string,\n    options?: Options\n  ): Promise<AsyncIterator<any>>;\n  getAbstractResolvers(filterSchema?: GraphQLSchema | string): IResolvers;\n}\n\nexport interface BindingConstructor<T> {\n  new (options: BasePrismaOptions): T;\n}\n/**\n * Type Defs\n */\n\nconst typeDefs = `type AggregateUser {\n  count: Int!\n}\n\ntype BatchPayload {\n  \"\"\"The number of nodes that have been affected by the Batch operation.\"\"\"\n  count: Long!\n}\n\nscalar DateTime\n\n\"\"\"\nThe \\`Long\\` scalar type represents non-fractional signed whole numeric values.\nLong can represent values between -(2^63) and 2^63 - 1.\n\"\"\"\nscalar Long\n\ntype Mutation {\n  createUser(data: UserCreateInput!): User!\n  updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User\n  deleteUser(where: UserWhereUniqueInput!): User\n  upsertUser(where: UserWhereUniqueInput!, create: UserCreateInput!, update: UserUpdateInput!): User!\n  updateManyUsers(data: UserUpdateInput!, where: UserWhereInput): BatchPayload!\n  deleteManyUsers(where: UserWhereInput): BatchPayload!\n}\n\nenum MutationType {\n  CREATED\n  UPDATED\n  DELETED\n}\n\n\"\"\"An object with an ID\"\"\"\ninterface Node {\n  \"\"\"The id of the object.\"\"\"\n  id: ID!\n}\n\n\"\"\"Information about pagination in a connection.\"\"\"\ntype PageInfo {\n  \"\"\"When paginating forwards, are there more items?\"\"\"\n  hasNextPage: Boolean!\n\n  \"\"\"When paginating backwards, are there more items?\"\"\"\n  hasPreviousPage: Boolean!\n\n  \"\"\"When paginating backwards, the cursor to continue.\"\"\"\n  startCursor: String\n\n  \"\"\"When paginating forwards, the cursor to continue.\"\"\"\n  endCursor: String\n}\n\ntype Query {\n  users(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User]!\n  user(where: UserWhereUniqueInput!): User\n  usersConnection(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection!\n\n  \"\"\"Fetches an object given its ID\"\"\"\n  node(\n    \"\"\"The ID of an object\"\"\"\n    id: ID!\n  ): Node\n}\n\ntype Subscription {\n  user(where: UserSubscriptionWhereInput): UserSubscriptionPayload\n}\n\ntype User implements Node {\n  id: ID!\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype UserConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [UserEdge]!\n  aggregate: AggregateUser!\n}\n\ninput UserCreateInput {\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean\n  emailConfirmed: Boolean\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype UserEdge {\n  \"\"\"The item at the end of the edge.\"\"\"\n  node: User!\n\n  \"\"\"A cursor for use in pagination.\"\"\"\n  cursor: String!\n}\n\nenum UserOrderByInput {\n  id_ASC\n  id_DESC\n  email_ASC\n  email_DESC\n  password_ASC\n  password_DESC\n  name_ASC\n  name_DESC\n  inviteToken_ASC\n  inviteToken_DESC\n  inviteAccepted_ASC\n  inviteAccepted_DESC\n  emailConfirmed_ASC\n  emailConfirmed_DESC\n  emailConfirmToken_ASC\n  emailConfirmToken_DESC\n  resetToken_ASC\n  resetToken_DESC\n  resetExpires_ASC\n  resetExpires_DESC\n  deletedAt_ASC\n  deletedAt_DESC\n  lastLogin_ASC\n  lastLogin_DESC\n  joinedAt_ASC\n  joinedAt_DESC\n  isSuper_ASC\n  isSuper_DESC\n  updatedAt_ASC\n  updatedAt_DESC\n  createdAt_ASC\n  createdAt_DESC\n}\n\ntype UserPreviousValues {\n  id: ID!\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n}\n\ntype UserSubscriptionPayload {\n  mutation: MutationType!\n  node: User\n  updatedFields: [String!]\n  previousValues: UserPreviousValues\n}\n\ninput UserSubscriptionWhereInput {\n  \"\"\"Logical AND on all given filters.\"\"\"\n  AND: [UserSubscriptionWhereInput!]\n\n  \"\"\"Logical OR on all given filters.\"\"\"\n  OR: [UserSubscriptionWhereInput!]\n\n  \"\"\"Logical NOT on all given filters combined by AND.\"\"\"\n  NOT: [UserSubscriptionWhereInput!]\n\n  \"\"\"\n  The subscription event gets dispatched when it's listed in mutation_in\n  \"\"\"\n  mutation_in: [MutationType!]\n\n  \"\"\"\n  The subscription event gets only dispatched when one of the updated fields names is included in this list\n  \"\"\"\n  updatedFields_contains: String\n\n  \"\"\"\n  The subscription event gets only dispatched when all of the field names included in this list have been updated\n  \"\"\"\n  updatedFields_contains_every: [String!]\n\n  \"\"\"\n  The subscription event gets only dispatched when some of the field names included in this list have been updated\n  \"\"\"\n  updatedFields_contains_some: [String!]\n  node: UserWhereInput\n}\n\ninput UserUpdateInput {\n  email: String\n  password: String\n  name: String\n  inviteToken: String\n  inviteAccepted: Boolean\n  emailConfirmed: Boolean\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime\n  isSuper: Boolean\n}\n\ninput UserWhereInput {\n  \"\"\"Logical AND on all given filters.\"\"\"\n  AND: [UserWhereInput!]\n\n  \"\"\"Logical OR on all given filters.\"\"\"\n  OR: [UserWhereInput!]\n\n  \"\"\"Logical NOT on all given filters combined by AND.\"\"\"\n  NOT: [UserWhereInput!]\n  id: ID\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  id_not: ID\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  id_in: [ID!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  id_not_in: [ID!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  id_lt: ID\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  id_lte: ID\n\n  \"\"\"All values greater than the given value.\"\"\"\n  id_gt: ID\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  id_gte: ID\n\n  \"\"\"All values containing the given string.\"\"\"\n  id_contains: ID\n\n  \"\"\"All values not containing the given string.\"\"\"\n  id_not_contains: ID\n\n  \"\"\"All values starting with the given string.\"\"\"\n  id_starts_with: ID\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  id_not_starts_with: ID\n\n  \"\"\"All values ending with the given string.\"\"\"\n  id_ends_with: ID\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  id_not_ends_with: ID\n  email: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  email_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  email_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  email_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  email_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  email_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  email_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  email_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  email_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  email_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  email_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  email_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  email_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  email_not_ends_with: String\n  password: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  password_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  password_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  password_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  password_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  password_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  password_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  password_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  password_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  password_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  password_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  password_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  password_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  password_not_ends_with: String\n  name: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  name_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  name_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  name_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  name_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  name_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  name_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  name_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  name_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  name_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  name_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  name_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  name_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  name_not_ends_with: String\n  inviteToken: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  inviteToken_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  inviteToken_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  inviteToken_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  inviteToken_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  inviteToken_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  inviteToken_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  inviteToken_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  inviteToken_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  inviteToken_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  inviteToken_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  inviteToken_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  inviteToken_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  inviteToken_not_ends_with: String\n  inviteAccepted: Boolean\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  inviteAccepted_not: Boolean\n  emailConfirmed: Boolean\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  emailConfirmed_not: Boolean\n  emailConfirmToken: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  emailConfirmToken_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  emailConfirmToken_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  emailConfirmToken_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  emailConfirmToken_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  emailConfirmToken_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  emailConfirmToken_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  emailConfirmToken_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  emailConfirmToken_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  emailConfirmToken_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  emailConfirmToken_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  emailConfirmToken_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  emailConfirmToken_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  emailConfirmToken_not_ends_with: String\n  resetToken: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  resetToken_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  resetToken_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  resetToken_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  resetToken_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  resetToken_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  resetToken_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  resetToken_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  resetToken_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  resetToken_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  resetToken_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  resetToken_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  resetToken_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  resetToken_not_ends_with: String\n  resetExpires: DateTime\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  resetExpires_not: DateTime\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  resetExpires_in: [DateTime!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  resetExpires_not_in: [DateTime!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  resetExpires_lt: DateTime\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  resetExpires_lte: DateTime\n\n  \"\"\"All values greater than the given value.\"\"\"\n  resetExpires_gt: DateTime\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  resetExpires_gte: DateTime\n  deletedAt: DateTime\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  deletedAt_not: DateTime\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  deletedAt_in: [DateTime!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  deletedAt_not_in: [DateTime!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  deletedAt_lt: DateTime\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  deletedAt_lte: DateTime\n\n  \"\"\"All values greater than the given value.\"\"\"\n  deletedAt_gt: DateTime\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  deletedAt_gte: DateTime\n  lastLogin: DateTime\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  lastLogin_not: DateTime\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  lastLogin_in: [DateTime!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  lastLogin_not_in: [DateTime!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  lastLogin_lt: DateTime\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  lastLogin_lte: DateTime\n\n  \"\"\"All values greater than the given value.\"\"\"\n  lastLogin_gt: DateTime\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  lastLogin_gte: DateTime\n  joinedAt: DateTime\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  joinedAt_not: DateTime\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  joinedAt_in: [DateTime!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  joinedAt_not_in: [DateTime!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  joinedAt_lt: DateTime\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  joinedAt_lte: DateTime\n\n  \"\"\"All values greater than the given value.\"\"\"\n  joinedAt_gt: DateTime\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  joinedAt_gte: DateTime\n  isSuper: Boolean\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  isSuper_not: Boolean\n}\n\ninput UserWhereUniqueInput {\n  id: ID\n  email: String\n}\n`;\n\nexport const Prisma = makePrismaBindingClass<BindingConstructor<Prisma>>({\n  typeDefs\n});\n\n/**\n * Types\n */\n\nexport type UserOrderByInput =\n  | 'id_ASC'\n  | 'id_DESC'\n  | 'email_ASC'\n  | 'email_DESC'\n  | 'password_ASC'\n  | 'password_DESC'\n  | 'name_ASC'\n  | 'name_DESC'\n  | 'inviteToken_ASC'\n  | 'inviteToken_DESC'\n  | 'inviteAccepted_ASC'\n  | 'inviteAccepted_DESC'\n  | 'emailConfirmed_ASC'\n  | 'emailConfirmed_DESC'\n  | 'emailConfirmToken_ASC'\n  | 'emailConfirmToken_DESC'\n  | 'resetToken_ASC'\n  | 'resetToken_DESC'\n  | 'resetExpires_ASC'\n  | 'resetExpires_DESC'\n  | 'deletedAt_ASC'\n  | 'deletedAt_DESC'\n  | 'lastLogin_ASC'\n  | 'lastLogin_DESC'\n  | 'joinedAt_ASC'\n  | 'joinedAt_DESC'\n  | 'isSuper_ASC'\n  | 'isSuper_DESC'\n  | 'updatedAt_ASC'\n  | 'updatedAt_DESC'\n  | 'createdAt_ASC'\n  | 'createdAt_DESC';\n\nexport type MutationType = 'CREATED' | 'UPDATED' | 'DELETED';\n\nexport interface UserWhereUniqueInput {\n  id?: ID_Input;\n  email?: String;\n}\n\nexport interface UserCreateInput {\n  email: String;\n  password: String;\n  name: String;\n  inviteToken?: String;\n  inviteAccepted?: Boolean;\n  emailConfirmed?: Boolean;\n  emailConfirmToken?: String;\n  resetToken?: String;\n  resetExpires?: DateTime;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt: DateTime;\n  isSuper?: Boolean;\n}\n\nexport interface UserUpdateInput {\n  email?: String;\n  password?: String;\n  name?: String;\n  inviteToken?: String;\n  inviteAccepted?: Boolean;\n  emailConfirmed?: Boolean;\n  emailConfirmToken?: String;\n  resetToken?: String;\n  resetExpires?: DateTime;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt?: DateTime;\n  isSuper?: Boolean;\n}\n\nexport interface UserSubscriptionWhereInput {\n  AND?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput;\n  OR?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput;\n  NOT?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput;\n  mutation_in?: MutationType[] | MutationType;\n  updatedFields_contains?: String;\n  updatedFields_contains_every?: String[] | String;\n  updatedFields_contains_some?: String[] | String;\n  node?: UserWhereInput;\n}\n\nexport interface UserWhereInput {\n  AND?: UserWhereInput[] | UserWhereInput;\n  OR?: UserWhereInput[] | UserWhereInput;\n  NOT?: UserWhereInput[] | UserWhereInput;\n  id?: ID_Input;\n  id_not?: ID_Input;\n  id_in?: ID_Input[] | ID_Input;\n  id_not_in?: ID_Input[] | ID_Input;\n  id_lt?: ID_Input;\n  id_lte?: ID_Input;\n  id_gt?: ID_Input;\n  id_gte?: ID_Input;\n  id_contains?: ID_Input;\n  id_not_contains?: ID_Input;\n  id_starts_with?: ID_Input;\n  id_not_starts_with?: ID_Input;\n  id_ends_with?: ID_Input;\n  id_not_ends_with?: ID_Input;\n  email?: String;\n  email_not?: String;\n  email_in?: String[] | String;\n  email_not_in?: String[] | String;\n  email_lt?: String;\n  email_lte?: String;\n  email_gt?: String;\n  email_gte?: String;\n  email_contains?: String;\n  email_not_contains?: String;\n  email_starts_with?: String;\n  email_not_starts_with?: String;\n  email_ends_with?: String;\n  email_not_ends_with?: String;\n  password?: String;\n  password_not?: String;\n  password_in?: String[] | String;\n  password_not_in?: String[] | String;\n  password_lt?: String;\n  password_lte?: String;\n  password_gt?: String;\n  password_gte?: String;\n  password_contains?: String;\n  password_not_contains?: String;\n  password_starts_with?: String;\n  password_not_starts_with?: String;\n  password_ends_with?: String;\n  password_not_ends_with?: String;\n  name?: String;\n  name_not?: String;\n  name_in?: String[] | String;\n  name_not_in?: String[] | String;\n  name_lt?: String;\n  name_lte?: String;\n  name_gt?: String;\n  name_gte?: String;\n  name_contains?: String;\n  name_not_contains?: String;\n  name_starts_with?: String;\n  name_not_starts_with?: String;\n  name_ends_with?: String;\n  name_not_ends_with?: String;\n  inviteToken?: String;\n  inviteToken_not?: String;\n  inviteToken_in?: String[] | String;\n  inviteToken_not_in?: String[] | String;\n  inviteToken_lt?: String;\n  inviteToken_lte?: String;\n  inviteToken_gt?: String;\n  inviteToken_gte?: String;\n  inviteToken_contains?: String;\n  inviteToken_not_contains?: String;\n  inviteToken_starts_with?: String;\n  inviteToken_not_starts_with?: String;\n  inviteToken_ends_with?: String;\n  inviteToken_not_ends_with?: String;\n  inviteAccepted?: Boolean;\n  inviteAccepted_not?: Boolean;\n  emailConfirmed?: Boolean;\n  emailConfirmed_not?: Boolean;\n  emailConfirmToken?: String;\n  emailConfirmToken_not?: String;\n  emailConfirmToken_in?: String[] | String;\n  emailConfirmToken_not_in?: String[] | String;\n  emailConfirmToken_lt?: String;\n  emailConfirmToken_lte?: String;\n  emailConfirmToken_gt?: String;\n  emailConfirmToken_gte?: String;\n  emailConfirmToken_contains?: String;\n  emailConfirmToken_not_contains?: String;\n  emailConfirmToken_starts_with?: String;\n  emailConfirmToken_not_starts_with?: String;\n  emailConfirmToken_ends_with?: String;\n  emailConfirmToken_not_ends_with?: String;\n  resetToken?: String;\n  resetToken_not?: String;\n  resetToken_in?: String[] | String;\n  resetToken_not_in?: String[] | String;\n  resetToken_lt?: String;\n  resetToken_lte?: String;\n  resetToken_gt?: String;\n  resetToken_gte?: String;\n  resetToken_contains?: String;\n  resetToken_not_contains?: String;\n  resetToken_starts_with?: String;\n  resetToken_not_starts_with?: String;\n  resetToken_ends_with?: String;\n  resetToken_not_ends_with?: String;\n  resetExpires?: DateTime;\n  resetExpires_not?: DateTime;\n  resetExpires_in?: DateTime[] | DateTime;\n  resetExpires_not_in?: DateTime[] | DateTime;\n  resetExpires_lt?: DateTime;\n  resetExpires_lte?: DateTime;\n  resetExpires_gt?: DateTime;\n  resetExpires_gte?: DateTime;\n  deletedAt?: DateTime;\n  deletedAt_not?: DateTime;\n  deletedAt_in?: DateTime[] | DateTime;\n  deletedAt_not_in?: DateTime[] | DateTime;\n  deletedAt_lt?: DateTime;\n  deletedAt_lte?: DateTime;\n  deletedAt_gt?: DateTime;\n  deletedAt_gte?: DateTime;\n  lastLogin?: DateTime;\n  lastLogin_not?: DateTime;\n  lastLogin_in?: DateTime[] | DateTime;\n  lastLogin_not_in?: DateTime[] | DateTime;\n  lastLogin_lt?: DateTime;\n  lastLogin_lte?: DateTime;\n  lastLogin_gt?: DateTime;\n  lastLogin_gte?: DateTime;\n  joinedAt?: DateTime;\n  joinedAt_not?: DateTime;\n  joinedAt_in?: DateTime[] | DateTime;\n  joinedAt_not_in?: DateTime[] | DateTime;\n  joinedAt_lt?: DateTime;\n  joinedAt_lte?: DateTime;\n  joinedAt_gt?: DateTime;\n  joinedAt_gte?: DateTime;\n  isSuper?: Boolean;\n  isSuper_not?: Boolean;\n}\n\n/*\n * An object with an ID\n\n */\nexport interface Node {\n  id: ID_Output;\n}\n\n/*\n * Information about pagination in a connection.\n\n */\nexport interface PageInfo {\n  hasNextPage: Boolean;\n  hasPreviousPage: Boolean;\n  startCursor?: String;\n  endCursor?: String;\n}\n\nexport interface UserPreviousValues {\n  id: ID_Output;\n  email: String;\n  password: String;\n  name: String;\n  inviteToken?: String;\n  inviteAccepted: Boolean;\n  emailConfirmed: Boolean;\n  emailConfirmToken?: String;\n  resetToken?: String;\n  resetExpires?: DateTime;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt: DateTime;\n  isSuper: Boolean;\n}\n\nexport interface User extends Node {\n  id: ID_Output;\n  email: String;\n  password: String;\n  name: String;\n  inviteToken?: String;\n  inviteAccepted: Boolean;\n  emailConfirmed: Boolean;\n  emailConfirmToken?: String;\n  resetToken?: String;\n  resetExpires?: DateTime;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt: DateTime;\n  isSuper: Boolean;\n}\n\n/*\n * An edge in a connection.\n\n */\nexport interface UserEdge {\n  node: User;\n  cursor: String;\n}\n\n/*\n * A connection to a list of items.\n\n */\nexport interface UserConnection {\n  pageInfo: PageInfo;\n  edges: UserEdge[];\n  aggregate: AggregateUser;\n}\n\nexport interface UserSubscriptionPayload {\n  mutation: MutationType;\n  node?: User;\n  updatedFields?: String[];\n  previousValues?: UserPreviousValues;\n}\n\nexport interface AggregateUser {\n  count: Int;\n}\n\nexport interface BatchPayload {\n  count: Long;\n}\n\nexport type DateTime = Date | string;\n\n/*\nThe `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.\n*/\nexport type ID_Input = string | number;\nexport type ID_Output = string;\n\n/*\nThe `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. \n*/\nexport type Int = number;\n\n/*\nThe `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.\n*/\nexport type String = string;\n\n/*\nThe `Boolean` scalar type represents `true` or `false`.\n*/\nexport type Boolean = boolean;\n\n/*\nThe `Long` scalar type represents non-fractional signed whole numeric values.\nLong can represent values between -(2^63) and 2^63 - 1.\n*/\nexport type Long = string;\n"
  },
  {
    "path": "examples/with-prisma/package.json",
    "content": "{\n  \"name\": \"graphql-authentication-with-prisma-example\",\n  \"private\": true,\n  \"version\": \"1.0.0\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"email-templates\": \"^4.0.1\",\n    \"graphql-authentication\": \"^0.5.3\",\n    \"graphql-authentication-prisma\": \"^0.1.3\",\n    \"graphql-cli\": \"^2.16.4\",\n    \"graphql-yoga\": \"^1.14.12\",\n    \"prisma\": \"^1.11.1\",\n    \"prisma-binding\": \"^2.1.0\",\n    \"ts-node\": \"^7.0.0\"\n  },\n  \"scripts\": {\n    \"start\": \"ts-node server.ts\",\n    \"prisma\": \"PRISMA_MANAGEMENT_API_SECRET=mymanagementsecret123 prisma\"\n  }\n}\n"
  },
  {
    "path": "examples/with-prisma/prisma.yml",
    "content": "endpoint: http://localhost:4466\ndatamodel: datamodel.graphql\n\nhooks:\n  post-deploy:\n    - graphql codegen\n"
  },
  {
    "path": "examples/with-prisma/schema.graphql",
    "content": "# import Query.*, Mutation.* from \"node_modules/graphql-authentication/schema.graphql\"\n\ntype Query {\n  timeline: [Post!]!\n}\n\ntype Post {\n  name: String!\n}\n"
  },
  {
    "path": "examples/with-prisma/server.ts",
    "content": "import { GraphQLServer } from 'graphql-yoga';\nimport * as path from 'path';\nimport * as Email from 'email-templates';\nimport { Prisma } from './generated/prisma';\nimport {\n  authQueries,\n  authMutations,\n  graphqlAuthenticationConfig\n} from 'graphql-authentication';\nimport { GraphqlAuthenticationPrismaAdapter } from 'graphql-authentication-prisma';\n\nconst resolvers = {\n  Query: {\n    ...authQueries,\n    timeline() {\n      return [{ name: 'Testje' }];\n    }\n  },\n  Mutation: {\n    ...authMutations\n  }\n};\n\nconst mailer = new Email({\n  message: {\n    from: 'info@example.com'\n  },\n  views: {\n    root: path.join(__dirname, 'emails')\n  }\n});\n\nconst server = new GraphQLServer({\n  typeDefs: './schema.graphql',\n  resolvers,\n  context: req => ({\n    ...req,\n    db: new Prisma({\n      endpoint: 'http://localhost:4466',\n      debug: true\n    }),\n    graphqlAuthentication: graphqlAuthenticationConfig({\n      adapter: new GraphqlAuthenticationPrismaAdapter(),\n      secret: 'wherearemyshoes',\n      mailer,\n      mailAppUrl: 'http://example.com'\n    })\n  })\n});\nserver.start(() => console.log('Server is running on http://localhost:4000'));\n"
  },
  {
    "path": "examples/with-prisma/utils.ts",
    "content": "import { Prisma } from './generated/prisma';\n\nexport interface Context {\n  db: Prisma;\n  request: any;\n}\n"
  },
  {
    "path": "examples/with-sequelize/README.md",
    "content": "# Sequelize example\n\nThis is an example of how to use GraphQL Authentication with [Sequelize](http://docs.sequelizejs.com/). There is no adapter package for Sequelize yet, so in this example we write our own adapter (see `SequelizeAdapter.js`).\n\nSequelize is configured with SQLite, but only because it doesn't require you to manually start a database so this example stays simple. It also works with MySQL, Postgres etc.\n\n## Usage\n\n```\nnpm i\nnpm start\n```\n\nGo to http://localhost:4000 in your browser and start running some queries and mutations!\n"
  },
  {
    "path": "examples/with-sequelize/SequelizeAdapter.js",
    "content": "const { User } = require('./database');\n\n// There currently is no package for a sequelize adapter, so we create one ourselves!\n\nclass GraphqlAuthenticationSequelizeAdapter {\n  findUserById(ctx, id, info) {\n    return User.findById(id);\n  }\n  findUserByEmail(ctx, email, info) {\n    return User.findOne({ where: { email } });\n  }\n  async userExistsByEmail(ctx, email) {\n    const user = await User.count({ where: { email } });\n    return user > 0;\n  }\n\n  // the _createUser and _updateUser methods are just helper methods, they are not used by graphql-authentication.\n  _createUser(ctx, data) {\n    return User.create(data);\n  }\n  _updateUser(ctx, userId, data) {\n    return User.update(data, { where: { id: userId } });\n  }\n\n  createUserBySignup(ctx, data) {\n    return this._createUser(ctx, data);\n  }\n  createUserByInvite(ctx, data) {\n    return this._createUser(ctx, data);\n  }\n  updateUserConfirmToken(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserLastLogin(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserPassword(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserResetToken(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserInfo(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserCompleteInvite(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n}\n\nmodule.exports = { GraphqlAuthenticationSequelizeAdapter };\n"
  },
  {
    "path": "examples/with-sequelize/database.js",
    "content": "const Sequelize = require('sequelize');\nconst sequelize = new Sequelize({ dialect: 'sqlite' });\n\nconst User = sequelize.define('user', {\n  email: Sequelize.STRING,\n  password: Sequelize.STRING,\n  name: Sequelize.STRING,\n  inviteToken: Sequelize.STRING,\n  inviteAccepted: Sequelize.BOOLEAN,\n  emailConfirmed: Sequelize.BOOLEAN,\n  emailConfirmToken: Sequelize.STRING,\n  resetToken: Sequelize.STRING,\n  resetExpires: Sequelize.DATE,\n  deletedAt: Sequelize.DATE,\n  lastLogin: Sequelize.DATE,\n  joinedAt: Sequelize.DATE,\n  isSuper: Sequelize.BOOLEAN\n});\n\nsequelize.sync();\n\nmodule.exports = { User };\n"
  },
  {
    "path": "examples/with-sequelize/emails/inviteUser/html.pug",
    "content": "p Hi,\np You are invited to join *your project*!\np\n  a(href=mailAppUrl + '/register/' + email + '/' + inviteToken) Accept invite.\n"
  },
  {
    "path": "examples/with-sequelize/emails/inviteUser/subject.pug",
    "content": "= `Invited for *your project*!`\n"
  },
  {
    "path": "examples/with-sequelize/emails/passwordReset/html.pug",
    "content": "p Hi,\np You requested a password reset on *your project*.\np\n  a(href=mailAppUrl + '/login/reset-password/' + email + '/' + resetToken) Reset my password.\n"
  },
  {
    "path": "examples/with-sequelize/emails/passwordReset/subject.pug",
    "content": "= `Confirm your email on *your project*`\n"
  },
  {
    "path": "examples/with-sequelize/emails/signupUser/html.pug",
    "content": "p Hi,\np You have just created an account on *your project*! As a last step, please confirm your email:\np\n  a(href=mailAppUrl + '/confirm-email/' + email + '/' + emailConfirmToken) Confirm email.\n"
  },
  {
    "path": "examples/with-sequelize/emails/signupUser/subject.pug",
    "content": "= `Confirm your email on *your project*`\n"
  },
  {
    "path": "examples/with-sequelize/package.json",
    "content": "{\n  \"name\": \"graphql-authentication-with-sequelize-example\",\n  \"private\": true,\n  \"version\": \"1.0.0\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"email-templates\": \"^4.0.1\",\n    \"graphql-authentication\": \"^0.5.3\",\n    \"graphql-yoga\": \"^1.14.12\",\n    \"sequelize\": \"^4.38.0\",\n    \"sqlite3\": \"^4.0.2\"\n  },\n  \"scripts\": {\n    \"start\": \"node server.js\"\n  }\n}\n"
  },
  {
    "path": "examples/with-sequelize/schema.graphql",
    "content": "# import Query.*, Mutation.* from \"node_modules/graphql-authentication/schema.graphql\"\n\ntype Query {\n  timeline: [Post!]!\n}\n\ntype Post {\n  name: String!\n}\n"
  },
  {
    "path": "examples/with-sequelize/server.js",
    "content": "const { GraphQLServer } = require('graphql-yoga');\nconst path = require('path');\nconst Email = require('email-templates');\nconst {\n  authQueries,\n  authMutations,\n  graphqlAuthenticationConfig\n} = require('graphql-authentication');\nconst { GraphqlAuthenticationSequelizeAdapter } = require('./SequelizeAdapter');\n\nconst resolvers = {\n  Query: {\n    ...authQueries,\n    timeline() {\n      return [{ name: 'Testje' }];\n    }\n  },\n  Mutation: {\n    ...authMutations\n  }\n};\n\nconst mailer = new Email({\n  message: {\n    from: 'info@example.com'\n  },\n  views: {\n    root: path.join(__dirname, 'emails')\n  }\n});\n\nconst server = new GraphQLServer({\n  typeDefs: './schema.graphql',\n  resolvers,\n  context: req => ({\n    ...req,\n    graphqlAuthentication: graphqlAuthenticationConfig({\n      adapter: new GraphqlAuthenticationSequelizeAdapter(),\n      secret: 'wherearemyshoes',\n      mailer,\n      mailAppUrl: 'http://example.com'\n    })\n  })\n});\nserver.start(() => console.log('Server is running on http://localhost:4000'));\n"
  },
  {
    "path": "examples/with-typeorm/README.md",
    "content": "# TypeORM example\n\nThis is an example of how to use GraphQL Authentication with [TypeORM](http://typeorm.io/). There is no adapter package for TypeORM yet, so in this example we write our own adapter (see `TypeOrmAdapter.js`).\n\nTypeORM is configured with SQLite, but only because it doesn't require you to manually start a database so this example stays simple. It also works with MySQL, Postgres etc.\n\n## Usage\n\n```\nnpm i\nnpm start\n```\n\nGo to http://localhost:4000 in your browser and start running some queries and mutations!\n"
  },
  {
    "path": "examples/with-typeorm/TypeOrmAdapter.ts",
    "content": "import { getRepository } from 'typeorm';\nimport { User } from './database';\nimport { GraphqlAuthenticationAdapter } from './node_modules/graphql-authentication';\n\n// There currently is no package for a TypeORM adapter, so we create one ourselves!\n\nexport class GraphqlAuthenticationTypeOrmAdapter\n  implements GraphqlAuthenticationAdapter {\n  private db() {\n    return getRepository(User);\n  }\n  async findUserById(ctx: object, id, info) {\n    return (await this.db().findOne(id)) || null;\n  }\n  async findUserByEmail(ctx: object, email, info) {\n    return (await this.db().findOne({ where: { email } })) || null;\n  }\n  async userExistsByEmail(ctx: object, email) {\n    const user = await this.db().count({ email });\n    return user > 0;\n  }\n\n  // the _createUser and _updateUser methods are just helper methods, they are not used by graphql-authentication.\n  async _createUser(ctx: object, data) {\n    const user = ((await this.db().create(data)) as any) as User;\n    await this.db().save(user);\n    return user;\n  }\n  async _updateUser(ctx: object, userId, data) {\n    return await this.db().update(userId, { name: 'kees' })[0];\n  }\n\n  createUserBySignup(ctx: object, data) {\n    return this._createUser(ctx, data);\n  }\n  createUserByInvite(ctx: object, data) {\n    return this._createUser(ctx, data);\n  }\n  updateUserConfirmToken(ctx: object, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserLastLogin(ctx: object, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserPassword(ctx: object, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserResetToken(ctx: object, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserInfo(ctx: object, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserCompleteInvite(ctx: object, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n}\n"
  },
  {
    "path": "examples/with-typeorm/database.ts",
    "content": "import 'reflect-metadata';\nimport { createConnection } from 'typeorm';\n\nexport { User } from './entities/User';\n\ncreateConnection();\n"
  },
  {
    "path": "examples/with-typeorm/emails/inviteUser/html.pug",
    "content": "p Hi,\np You are invited to join *your project*!\np\n  a(href=mailAppUrl + '/register/' + email + '/' + inviteToken) Accept invite.\n"
  },
  {
    "path": "examples/with-typeorm/emails/inviteUser/subject.pug",
    "content": "= `Invited for *your project*!`\n"
  },
  {
    "path": "examples/with-typeorm/emails/passwordReset/html.pug",
    "content": "p Hi,\np You requested a password reset on *your project*.\np\n  a(href=mailAppUrl + '/login/reset-password/' + email + '/' + resetToken) Reset my password.\n"
  },
  {
    "path": "examples/with-typeorm/emails/passwordReset/subject.pug",
    "content": "= `Confirm your email on *your project*`\n"
  },
  {
    "path": "examples/with-typeorm/emails/signupUser/html.pug",
    "content": "p Hi,\np You have just created an account on *your project*! As a last step, please confirm your email:\np\n  a(href=mailAppUrl + '/confirm-email/' + email + '/' + emailConfirmToken) Confirm email.\n"
  },
  {
    "path": "examples/with-typeorm/emails/signupUser/subject.pug",
    "content": "= `Confirm your email on *your project*`\n"
  },
  {
    "path": "examples/with-typeorm/entities/User.ts",
    "content": "import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';\n\n@Entity()\nexport class User {\n  @PrimaryGeneratedColumn() id!: string;\n\n  @Column() email!: string;\n\n  @Column() password!: string;\n\n  @Column() name!: string;\n\n  @Column({ nullable: true })\n  inviteToken!: string;\n\n  @Column({ default: true })\n  inviteAccepted!: boolean;\n\n  @Column({ default: true })\n  emailConfirmed!: boolean;\n\n  @Column({ nullable: true })\n  emailConfirmToken!: string;\n\n  @Column({ nullable: true })\n  resetToken!: string;\n\n  @Column({ nullable: true })\n  resetExpires!: Date;\n\n  @Column({ nullable: true })\n  deletedAt!: Date;\n\n  @Column({ nullable: true })\n  lastLogin!: Date;\n\n  @Column() joinedAt!: Date;\n\n  @Column({ default: false })\n  isSuper!: boolean;\n}\n"
  },
  {
    "path": "examples/with-typeorm/ormconfig.json",
    "content": "{\n  \"type\": \"sqlite\",\n  \"database\": \":memory:\",\n  \"synchronize\": true,\n  \"logging\": true,\n  \"entities\": [\"entities/**/*.ts\"]\n}\n"
  },
  {
    "path": "examples/with-typeorm/package.json",
    "content": "{\n  \"name\": \"graphql-authentication-with-typeorm-example\",\n  \"private\": true,\n  \"version\": \"1.0.0\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"email-templates\": \"^4.0.1\",\n    \"graphql-authentication\": \"^0.5.4\",\n    \"graphql-yoga\": \"^1.14.12\",\n    \"reflect-metadata\": \"^0.1.12\",\n    \"sqlite3\": \"^4.0.2\",\n    \"typeorm\": \"^0.2.7\"\n  },\n  \"scripts\": {\n    \"start\": \"ts-node server.ts\"\n  },\n  \"devDependencies\": {\n    \"ts-node\": \"^7.0.0\",\n    \"typescript\": \"^2.9.2\"\n  }\n}\n"
  },
  {
    "path": "examples/with-typeorm/schema.graphql",
    "content": "# import Query.*, Mutation.* from \"node_modules/graphql-authentication/schema.graphql\"\n\ntype Query {\n  timeline: [Post!]!\n}\n\ntype Post {\n  name: String!\n}\n"
  },
  {
    "path": "examples/with-typeorm/server.ts",
    "content": "import { GraphQLServer } from 'graphql-yoga';\nimport * as Email from 'email-templates';\nimport {\n  authQueries,\n  authMutations,\n  graphqlAuthenticationConfig\n} from 'graphql-authentication';\nimport { GraphqlAuthenticationTypeOrmAdapter } from './TypeOrmAdapter';\n\nconst resolvers = {\n  Query: {\n    ...authQueries,\n    timeline() {\n      return [{ name: 'Testje' }];\n    }\n  },\n  Mutation: {\n    ...authMutations\n  }\n};\n\nconst mailer = new Email({\n  message: {\n    from: 'info@example.com'\n  }\n});\n\nconst server = new GraphQLServer({\n  typeDefs: './schema.graphql',\n  resolvers,\n  context: req => ({\n    ...req,\n    graphqlAuthentication: graphqlAuthenticationConfig({\n      adapter: new GraphqlAuthenticationTypeOrmAdapter(),\n      secret: 'wherearemyshoes',\n      mailer,\n      mailAppUrl: 'http://example.com'\n    })\n  })\n});\nserver.start(() => console.log('Server is running on http://localhost:4000'));\n"
  },
  {
    "path": "examples/with-typeorm/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2017\",\n    \"module\": \"commonjs\",\n    \"experimentalDecorators\": true,\n    \"emitDecoratorMetadata\": true,\n    \"lib\": [\"esnext\"],\n    \"strict\": true,\n    \"strictFunctionTypes\": false,\n    \"noImplicitAny\": false,\n    \"forceConsistentCasingInFileNames\": true\n  }\n}\n"
  },
  {
    "path": "lerna.json",
    "content": "{\n  \"lerna\": \"2.11.0\",\n  \"packages\": [\n    \"packages/*\"\n  ],\n  \"version\": \"independent\",\n  \"npmClient\": \"yarn\",\n  \"useWorkspaces\": true\n}\n"
  },
  {
    "path": "live-demo/InMemoryAdapter.js",
    "content": "class GraphqlAuthenticationInMemoryAdapter {\n  constructor() {\n    this.users = [];\n  }\n  // If you'd use a database you wouldn't need this\n  _generateId() {\n    const lastUser = this.users[this.users.length - 1];\n    if (lastUser) {\n      return String(parseInt(lastUser.id) + 1);\n    }\n    return '1';\n  }\n\n  findUserById(ctx, id, info) {\n    return Promise.resolve(this.users.find(user => user.id === id) || null);\n  }\n  findUserByEmail(ctx, email, info) {\n    return Promise.resolve(\n      this.users.find(user => user.email === email) || null\n    );\n  }\n  async userExistsByEmail(ctx, email) {\n    return Promise.resolve(this.users.some(user => user.email === email));\n  }\n\n  _createUser(ctx, data) {\n    const user = { id: this._generateId(), ...data };\n    this.users.push(user);\n    return Promise.resolve(user);\n  }\n  async _updateUser(ctx, userId, data) {\n    const user = await this.findUserById(ctx, userId);\n    Object.assign(user, data);\n    return Promise.resolve(user);\n  }\n\n  createUserBySignup(ctx, data) {\n    return this._createUser(ctx, data);\n  }\n  createUserByInvite(ctx, data) {\n    return this._createUser(ctx, data);\n  }\n  updateUserConfirmToken(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserLastLogin(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserPassword(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserResetToken(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserInfo(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n  updateUserCompleteInvite(ctx, userId, data) {\n    return this._updateUser(ctx, userId, data);\n  }\n}\n\nmodule.exports = { GraphqlAuthenticationInMemoryAdapter };\n"
  },
  {
    "path": "live-demo/README.md",
    "content": "# Live Demo\n\nThe code in this repository is used to host a live demo on x.now.sh (TODO).\n\nThe live demo uses an in-memory adapter, so everytime the server restarts the data is gone. For a demo this is perfect :).\n\n## Test locally\n\nRun `yarn && yarn start`.\n\n## Deploy on Now\n\nCopy `.env.example` to `.env` and fill the variables in.\n\n```\nnpm i -g now\nnow --dotenv\nnow alias graphql-authentication-demo.now.sh\n```\n"
  },
  {
    "path": "live-demo/email.js",
    "content": "const { createTransport } = require('nodemailer');\nconst mailgun = require('nodemailer-mailgun-transport');\nconst Email = require('email-templates');\n\nconst apiKey = process.env.MAILGUN_API_KEY;\n\nconst mailgunConfig = {\n  auth: {\n    api_key: apiKey,\n    domain: process.env.MAILGUN_DOMAIN\n  }\n};\n\n// Just send the email locally if apikey is not filled in\nconst transporter = apiKey\n  ? createTransport(mailgun(mailgunConfig))\n  : undefined;\n\nemail = new Email({\n  message: {\n    from: process.env.MAIL_FROM\n  },\n  send: true,\n  transport: transporter\n});\n\nmodule.exports = { email };\n"
  },
  {
    "path": "live-demo/emails/inviteUser/html.pug",
    "content": "p Hi,\np You are invited to join GraphQL Authentication Demo! Accept the invite by writing this mutation:\npre\n  | mutation {\n  |   signupByInvite(\n  |     data: {\n  |       name: \"Enter your name here\",\n  |       password: \"myverystrongpassword\",\n  |       email: \"#{email}\",\n  |       inviteToken: \"#{inviteToken}\"\n  |     }\n  |  ) {\n  |     token\n  |   }\n  | }\n\np\n  em In a real-world application the user wouldn't have to run the mutation itself of course, it would something like this:<br />\n  a(href=mailAppUrl + '/register/' + email + '/' + inviteToken) Accept invite.\n"
  },
  {
    "path": "live-demo/emails/inviteUser/subject.pug",
    "content": "= `Invited for GraphQL Authentication Demo!`\n"
  },
  {
    "path": "live-demo/emails/passwordReset/html.pug",
    "content": "p Hi,\np You requested a password reset on GraphQL Authentication Demo. Reset your password by writing this mutation:\npre\n  | mutation {\n  |   passwordReset(password: \"mynewpassword\", email: \"#{email}\", resetToken: \"#{resetToken}\") {\n  |     id\n  |   }\n  |}\n\np\n  em In a real-world application the user wouldn't have to run the mutation itself of course, it would something like this:<br />\n  a(href=mailAppUrl + '/login/reset-password/' + email + '/' + resetToken) Reset my password.\n"
  },
  {
    "path": "live-demo/emails/passwordReset/subject.pug",
    "content": "= `Confirm your email on GraphQL Authentication Demo`\n"
  },
  {
    "path": "live-demo/emails/signupUser/html.pug",
    "content": "p Hi,\np You have just created an account on GraphQL Authentication Demo! As a last step, please confirm your email by writing this mutation:\npre\n  | mutation {\n  |   confirmEmail(email: \"#{email}\", emailConfirmToken: \"#{emailConfirmToken}\") {\n  |     token\n  |   }\n  | }\n\np\n  em In a real-world application the user wouldn't have to run the mutation itself of course, it would something like this:<br />\n  a(href=mailAppUrl + '/confirm-email/' + email + '/' + emailConfirmToken) Confirm your email.\n"
  },
  {
    "path": "live-demo/emails/signupUser/subject.pug",
    "content": "= `Confirm your email on GraphQL Authentication Demo`\n"
  },
  {
    "path": "live-demo/index.js",
    "content": "const { GraphQLServer } = require('graphql-yoga');\nconst {\n  authQueries,\n  authMutations,\n  graphqlAuthenticationConfig\n} = require('graphql-authentication');\nconst { GraphqlAuthenticationInMemoryAdapter } = require('./InMemoryAdapter');\nconst { email } = require('./email');\n\nconst adapter = new GraphqlAuthenticationInMemoryAdapter();\n\nconst resolvers = {\n  Query: {\n    ...authQueries\n  },\n  Mutation: {\n    ...authMutations\n  }\n};\n\nconst server = new GraphQLServer({\n  typeDefs: './schema.graphql',\n  resolvers,\n  context: req => ({\n    ...req,\n    graphqlAuthentication: graphqlAuthenticationConfig({\n      adapter,\n      secret: 'wherearemyshoes',\n      mailer: email,\n      mailAppUrl: 'http://example.com'\n    })\n  })\n});\n\nserver.start(() => console.log('Server is running on http://localhost:4000'));\n"
  },
  {
    "path": "live-demo/package.json",
    "content": "{\n  \"name\": \"graphql-authentication-live-demo\",\n  \"private\": true,\n  \"version\": \"1.0.0\",\n  \"license\": \"ISC\",\n  \"dependencies\": {\n    \"email-templates\": \"^4.0.1\",\n    \"graphql\": \"^0.13.2\",\n    \"graphql-authentication\": \"^0.5.4\",\n    \"graphql-yoga\": \"^1.14.12\",\n    \"nodemailer-mailgun-transport\": \"^1.4.0\",\n    \"now\": \"^11.2.10\"\n  },\n  \"scripts\": {\n    \"start\": \"node index.js\"\n  },\n  \"now\": {\n    \"alias\": [\n      \"graphql-authentication-demo.now.sh\"\n    ]\n  }\n}\n"
  },
  {
    "path": "live-demo/schema.graphql",
    "content": "# import Query.*, Mutation.* from \"node_modules/graphql-authentication/schema.graphql\"\n\ntype Query\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"private\": true,\n  \"workspaces\": [\n    \"packages/*\"\n  ],\n  \"devDependencies\": {\n    \"husky\": \"^0.14.3\",\n    \"lerna\": \"^2.11.0\",\n    \"prettier\": \"^1.13.6\",\n    \"pretty-quick\": \"^1.6.0\"\n  },\n  \"scripts\": {\n    \"publish\": \"lerna publish\",\n    \"precommit\": \"pretty-quick --staged\"\n  }\n}\n"
  },
  {
    "path": "packages/graphql-authentication/README.md",
    "content": "# GraphQL Authentication\n\nA very opinionated user authentication package for [GraphQL](https://graphql.org/). It uses old-school email/password authentication.\n\nThis package does not access your data layer (e.g. an ORM); for that you need to write a _adapter_ (which is not hard to do).\nIf you use Prisma, there is already an adapter for you, **[graphql-authentication-prisma](https://github.com/Volst/graphql-authentication/tree/master/packages/graphql-authentication-prisma)**.\n\n### [Full Documentation](https://github.com/Volst/graphql-authentication/blob/master/README.md)\n"
  },
  {
    "path": "packages/graphql-authentication/package.json",
    "content": "{\n  \"name\": \"graphql-authentication\",\n  \"version\": \"0.5.5\",\n  \"description\": \"Makes it super easy to do do boring authentication stuff with GraphQL (login, password reset, ...)\",\n  \"author\": \"kees@volst.nl\",\n  \"repository\": \"Volst/graphql-authentication\",\n  \"keywords\": [\n    \"graphql\",\n    \"user\",\n    \"authentication\",\n    \"login\"\n  ],\n  \"license\": \"ISC\",\n  \"private\": false,\n  \"main\": \"dist/index.js\",\n  \"typings\": \"dist/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=8.0\"\n  },\n  \"files\": [\n    \"dist\",\n    \"schema.graphql\"\n  ],\n  \"scripts\": {\n    \"build\": \"rm -rf dist && tsc -p tsconfig.build.json\",\n    \"lint\": \"tslint -p .\",\n    \"prepublishOnly\": \"npm run -s build\",\n    \"test\": \"jest --watch\",\n    \"test-coverage\": \"jest --coverage\",\n    \"ci\": \"npm run -s lint && npm run -s build && npm run -s test-coverage && codecov\",\n    \"graphql-types\": \"graphql-binding --input src/schema.ts --language typescript --outputBinding src/binding.ts\"\n  },\n  \"devDependencies\": {\n    \"@types/email-templates\": \"^3.5.0\",\n    \"@types/jest\": \"^23.1.0\",\n    \"@volst/tslint-config\": \"^0.2.1\",\n    \"codecov\": \"^3.0.2\",\n    \"email-templates\": \"^4.0.1\",\n    \"graphql-binding\": \"^2.1.1\",\n    \"graphql-cli\": \"^2.16.3\",\n    \"graphql-request\": \"^1.6.0\",\n    \"graphql-yoga\": \"1.14.10\",\n    \"jest\": \"^23.1.0\",\n    \"nodemon\": \"^1.17.3\",\n    \"pug\": \"^2.0.3\",\n    \"ts-jest\": \"^22.4.6\",\n    \"ts-node\": \"^7.0.0\",\n    \"tslint\": \"^5.9.1\",\n    \"typescript\": \"^2.8.3\"\n  },\n  \"dependencies\": {\n    \"@types/bcryptjs\": \"^2.4.1\",\n    \"@types/jsonwebtoken\": \"^7.2.6\",\n    \"@types/uuid\": \"^3.4.3\",\n    \"@types/validator\": \"^9.4.1\",\n    \"apollo-errors\": \"^1.9.0\",\n    \"bcryptjs\": \"^2.4.3\",\n    \"jsonwebtoken\": \"^8.2.1\",\n    \"uuid\": \"^3.2.1\",\n    \"validator\": \"^10.2.0\"\n  },\n  \"peerDependencies\": {\n    \"email-templates\": \"^3.6 || ^4\"\n  },\n  \"jest\": {\n    \"roots\": [\n      \"./src\"\n    ],\n    \"transform\": {\n      \"^.+\\\\.ts$\": \"ts-jest\"\n    },\n    \"testRegex\": \"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(js|ts)$\",\n    \"setupTestFrameworkScriptFile\": \"<rootDir>/src/__tests__/setup.ts\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\",\n      \"json\",\n      \"node\"\n    ]\n  }\n}\n"
  },
  {
    "path": "packages/graphql-authentication/schema.graphql",
    "content": "scalar DateTime\n\ntype Query {\n  currentUser: User\n}\n\ntype Mutation {\n  signupByInvite(data: SignupByInviteInput!): AuthPayload!\n  signup(data: SignupInput!): AuthPayload!\n  confirmEmail(email: String!, emailConfirmToken: String!): AuthPayload!\n  inviteUser(data: InviteUserInput!): UserIdPayload!\n  login(email: String!, password: String!): AuthPayload!\n  changePassword(oldPassword: String!, newPassword: String!): UserIdPayload!\n  updateCurrentUser(data: UserUpdateInput!): User\n  triggerPasswordReset(email: String!): TriggerPasswordResetPayload!\n  passwordReset(\n    email: String!\n    resetToken: String!\n    password: String!\n  ): UserIdPayload!\n}\n\ntype AuthPayload {\n  token: String!\n  user: User!\n}\n\ntype UserIdPayload {\n  id: ID!\n}\n\ntype TriggerPasswordResetPayload {\n  ok: Boolean!\n}\n\ntype User {\n  id: ID!\n  email: String!\n  name: String!\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n}\n\ninput InviteUserInput {\n  email: String!\n}\n\ninput UserUpdateInput {\n  email: String\n  name: String\n}\n\ninput SignupByInviteInput {\n  email: String!\n  inviteToken: String!\n  password: String!\n  name: String!\n}\n\ninput SignupInput {\n  email: String!\n  password: String!\n  name: String!\n}\n"
  },
  {
    "path": "packages/graphql-authentication/src/Adapter.ts",
    "content": "import { Context } from './utils';\n\nexport type DateTime = Date | string;\nexport type ID = string;\n\nexport interface User {\n  id: ID;\n  email: string;\n  password: string;\n  name: string;\n  inviteToken?: string;\n  inviteAccepted: Boolean;\n  emailConfirmed: Boolean;\n  emailConfirmToken?: string;\n  resetToken?: string;\n  resetExpires?: DateTime;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt: DateTime;\n  isSuper: Boolean;\n}\n\nexport interface GraphqlAuthenticationAdapter {\n  findUserById(ctx: Context, id: ID, info?: any): Promise<User | null>;\n  findUserByEmail(\n    ctx: Context,\n    email: string,\n    info?: any\n  ): Promise<User | null>;\n  userExistsByEmail(ctx: Context, email: string): Promise<boolean>;\n  createUserBySignup(ctx: Context, data: any): Promise<User>;\n  createUserByInvite(ctx: Context, data: any): Promise<User>;\n  updateUserConfirmToken(\n    ctx: Context,\n    userId: ID,\n    data: any\n  ): Promise<User | null>;\n  updateUserLastLogin(\n    ctx: Context,\n    userId: ID,\n    data: any\n  ): Promise<User | null>;\n  updateUserPassword(ctx: Context, userId: ID, data: any): Promise<User | null>;\n  updateUserResetToken(\n    ctx: Context,\n    userId: ID,\n    data: any\n  ): Promise<User | null>;\n  updateUserInfo(ctx: Context, userId: ID, data: any): Promise<User | null>;\n  updateUserCompleteInvite(\n    ctx: Context,\n    userId: ID,\n    data: any\n  ): Promise<User | null>;\n}\n"
  },
  {
    "path": "packages/graphql-authentication/src/Config.ts",
    "content": "import * as Email from 'email-templates';\nimport { User } from './Adapter';\nimport { Context } from './utils';\nimport { GraphqlAuthenticationAdapter } from './Adapter';\n\nexport interface IGraphqlAuthenticationConfig {\n  mailer?: Email;\n  mailAppUrl?: string;\n  secret: string;\n  requiredConfirmedEmailForLogin?: boolean;\n  hookInviteUserPostCreate?: (\n    data: any,\n    ctx: Context,\n    user: User\n  ) => Promise<any>;\n  adapter: GraphqlAuthenticationAdapter;\n  validatePassword?: (value: string) => boolean;\n}\n\nexport function graphqlAuthenticationConfig(\n  options: IGraphqlAuthenticationConfig\n) {\n  const defaults = {\n    requiredConfirmedEmailForLogin: false,\n    validatePassword: value => value.length >= 8\n  };\n  if (!options.adapter) {\n    throw new Error(\n      'You forgot to add the `adapter` option to graphql-authentication!'\n    );\n  }\n  return Object.assign(defaults, options);\n}\n"
  },
  {
    "path": "packages/graphql-authentication/src/__tests__/mutations.ts",
    "content": "import { client, clientWithAuth, startServer, FakeAdapter } from './setup';\n\ntest('signup - a new user', async () => {\n  const req = client(await startServer());\n\n  const result = await req.request(`mutation {\n    signup(data: {name: \"Roger\", email: \"roger@volst.nl\", password: \"testtest2\"}) {\n      token\n      user {\n        id\n        name\n      }\n    }\n  }`);\n\n  expect((result as any).signup).toEqual({\n    // Poorly check for a JWT token\n    token: expect.stringContaining('.'),\n    user: {\n      id: '3',\n      name: 'Roger'\n    }\n  });\n});\n\ntest('signup - with existent user', async () => {\n  expect.assertions(1);\n  const req = client(await startServer());\n\n  try {\n    await req.request(`mutation {\n      signup(data: {name: \"Kees\", email: \"kees@volst.nl\", password: \"testtest2\"}) {\n        token\n      }\n    }`);\n  } catch (e) {\n    expect(String(e)).toMatch(/User already exists with this email/);\n  }\n});\n\ntest('signup - with weak password', async () => {\n  expect.assertions(1);\n  const req = client(await startServer());\n\n  try {\n    await req.request(`mutation {\n      signup(data: {name: \"Roger\", email: \"roger@volst.nl\", password: \"test\"}) {\n        token\n      }\n    }`);\n  } catch (e) {\n    expect(String(e)).toMatch(/Password is too short/);\n  }\n});\n\ntest('signup - with custom password validation', async () => {\n  expect.assertions(1);\n  const req = client(\n    await startServer({\n      graphqlAuthentication: {\n        validatePassword: value => {\n          return value.length > 400;\n        }\n      }\n    })\n  );\n\n  try {\n    await req.request(`mutation {\n      signup(data: {name: \"Roger\", email: \"roger@volst.nl\", password: \"testtest2\"}) {\n        token\n      }\n    }`);\n  } catch (e) {\n    expect(String(e)).toMatch(/Password is too short/);\n  }\n});\n\ntest('login - correct', async () => {\n  const req = client(await startServer());\n\n  const result = await req.request(`mutation {\n    login(email: \"kees@volst.nl\", password: \"testtest2\") {\n      token\n      user {\n        id\n        name\n      }\n    }\n  }`);\n\n  expect((result as any).login).toEqual({\n    // Poorly check for a JWT token\n    token: expect.stringContaining('.'),\n    user: {\n      id: '2',\n      name: 'Kees'\n    }\n  });\n});\n\ntest('login - non-existent user', async () => {\n  const req = client(await startServer());\n  expect.assertions(1);\n\n  try {\n    await req.request(`mutation {\n      login(email: \"roger@volst.nl\", password: \"testtest2\") {\n        token\n      }\n  }`);\n  } catch (e) {\n    expect(String(e)).toMatch(/No user found/);\n  }\n});\n\ntest('login - wrong password', async () => {\n  expect.assertions(1);\n  const req = client(await startServer());\n\n  try {\n    await req.request(`mutation {\n      login(email: \"kees@volst.nl\", password: \"testtest1\") {\n        token\n      }\n  }`);\n  } catch (e) {\n    expect(String(e)).toMatch(/No user found/);\n  }\n});\n\ntest('update current user data - correct', async () => {\n  const req = clientWithAuth(await startServer());\n\n  const result = await req.request(`mutation {\n    updateCurrentUser(data: {name: \"Voldemort\"}) {\n      id\n      name\n    }\n  }`);\n\n  expect((result as any).updateCurrentUser).toEqual({\n    id: '2',\n    name: 'Voldemort'\n  });\n});\n\ntest('update current user data - wrong old passwd', async () => {\n  expect.assertions(1);\n  const req = clientWithAuth(await startServer());\n\n  try {\n    await req.request(`mutation {\n      changePassword(oldPassword: \"testtest3\", newPassword: \"testtest4\") {\n        id\n      }\n    }`);\n  } catch (e) {\n    expect(String(e)).toMatch(/Invalid old password/);\n  }\n});\n\ntest('update user password', async () => {\n  const req = clientWithAuth(await startServer());\n\n  const result = await req.request(`mutation {\n    changePassword(oldPassword: \"testtest2\", newPassword: \"testtest3\") {\n      id\n    }\n  }`);\n\n  expect((result as any).changePassword).toEqual({\n    id: '2'\n  });\n\n  // Now verify the password has actually been changed correctly.\n  const result2 = await req.request(`mutation {\n    login(email: \"kees@volst.nl\", password: \"testtest3\") {\n      user {\n        id\n      }\n    }\n  }`);\n\n  expect((result2 as any).login.user).toEqual({\n    id: '2'\n  });\n});\n\ntest('trigger password reset - correct', async () => {\n  expect.assertions(6);\n  const req = clientWithAuth(await startServer());\n  const spy = jest.spyOn(FakeAdapter.prototype, 'updateUserResetToken');\n\n  const result = await req.request(`mutation {\n    triggerPasswordReset(email: \"kees@volst.nl\") {\n      ok\n    }\n  }`);\n\n  expect(spy).toHaveBeenCalled();\n\n  expect((result as any).triggerPasswordReset).toEqual({\n    ok: true\n  });\n\n  const { resetToken } = await spy.mock.results[0].value;\n  // Verify the resetToken is a UUID\n  expect(resetToken.length).toBe(36);\n\n  const result2 = await req.request(`mutation {\n    passwordReset(email: \"kees@volst.nl\", password: \"testtest4\", resetToken: \"${resetToken}\") {\n      id\n    }\n  }`);\n\n  expect((result2 as any).passwordReset).toEqual({\n    id: '2'\n  });\n\n  const result3 = await req.request(`mutation {\n    login(email: \"kees@volst.nl\", password: \"testtest4\") {\n      user {\n        id\n      }\n    }\n  }`);\n\n  expect((result3 as any).login.user).toEqual({\n    id: '2'\n  });\n\n  // Now verify that the resetToken is now invalid\n  try {\n    await req.request(`mutation {\n      passwordReset(email: \"kees@volst.nl\", password: \"badbadbad\", resetToken: \"${resetToken}\") {\n        id\n      }\n    }`);\n  } catch (e) {\n    expect(String(e)).toMatch(/No user found/);\n  }\n\n  spy.mockRestore();\n});\n\ntest('invite user - correct', async () => {\n  expect.assertions(6);\n  const req = clientWithAuth(await startServer());\n  const spy = jest.spyOn(FakeAdapter.prototype, 'createUserByInvite');\n\n  const result = await req.request(`mutation {\n    inviteUser(data: {email: \"roger@volst.nl\"}) {\n      id\n    }\n  }`);\n\n  expect(spy).toHaveBeenCalled();\n\n  expect((result as any).inviteUser).toEqual({\n    id: '3'\n  });\n\n  const { inviteToken } = await spy.mock.results[0].value;\n  // Verify the resetToken is a UUID\n  expect(inviteToken.length).toBe(36);\n\n  const SIGNUP_INVITE = `mutation {\n    signupByInvite(data:{name: \"Roger\", email: \"roger@volst.nl\", password: \"testtest4\", inviteToken: \"${inviteToken}\"}) {\n      user {\n        id\n      }\n    }\n  }`;\n\n  const result2 = await req.request(SIGNUP_INVITE);\n\n  expect((result2 as any).signupByInvite.user).toEqual({\n    id: '3'\n  });\n\n  const result3 = await req.request(`mutation {\n    login(email: \"roger@volst.nl\", password: \"testtest4\") {\n      user {\n        id\n      }\n    }\n  }`);\n\n  expect((result3 as any).login.user).toEqual({\n    id: '3'\n  });\n\n  // Now verify that the inviteToken is now invalid\n  try {\n    await req.request(SIGNUP_INVITE);\n  } catch (e) {\n    expect(String(e)).toMatch(/inviteToken is invalid/);\n  }\n\n  spy.mockRestore();\n});\n\ntest('confirm email - correct', async () => {\n  expect.assertions(6);\n  const req = clientWithAuth(await startServer());\n  const spy = jest.spyOn(FakeAdapter.prototype, 'createUserBySignup');\n\n  const result = await req.request(`mutation {\n    signup(data:{name: \"Roger\", email: \"roger@volst.nl\", password: \"testtest4\"}) {\n      user {\n        id\n      }\n    }\n  }`);\n\n  expect(spy).toHaveBeenCalled();\n\n  expect((result as any).signup.user).toEqual({\n    id: '3'\n  });\n\n  const { emailConfirmToken } = await spy.mock.results[0].value;\n  // Verify the emailConfirmToken is a UUID\n  expect(emailConfirmToken.length).toBe(36);\n\n  const CONFIRM_EMAIL = `mutation {\n    confirmEmail(email: \"roger@volst.nl\", emailConfirmToken: \"${emailConfirmToken}\") {\n      user {\n        id\n      }\n    }\n  }`;\n  const result2 = await req.request(CONFIRM_EMAIL);\n\n  expect((result2 as any).confirmEmail.user).toEqual({\n    id: '3'\n  });\n\n  const result3 = await req.request(`mutation {\n    login(email: \"roger@volst.nl\", password: \"testtest4\") {\n      user {\n        id\n      }\n    }\n  }`);\n\n  expect((result3 as any).login.user).toEqual({\n    id: '3'\n  });\n\n  // Now verify that the emailConfirmToken is now invalid\n  try {\n    await req.request(CONFIRM_EMAIL);\n  } catch (e) {\n    expect(String(e)).toMatch(/emailConfirmToken is invalid/);\n  }\n\n  spy.mockRestore();\n});\n"
  },
  {
    "path": "packages/graphql-authentication/src/__tests__/queries.ts",
    "content": "import { client, startServer, clientWithAuth } from './setup';\n\ntest('currentUser - throw error when login fails', async () => {\n  const req = client(await startServer());\n  expect.assertions(1);\n\n  try {\n    await req.request(`query {\n      currentUser {\n        name\n      }\n    }`);\n  } catch (e) {\n    expect(String(e)).toMatch(/Not authorized/);\n  }\n});\n\ntest('currentUser - fetch user data', async () => {\n  const req = clientWithAuth(await startServer());\n\n  const result = await req.request(`query {\n    currentUser {\n      name\n    }\n  }`);\n\n  expect((result as any).currentUser.name).toBe('Kees');\n});\n"
  },
  {
    "path": "packages/graphql-authentication/src/__tests__/setup.ts",
    "content": "import { GraphQLServer } from 'graphql-yoga';\nimport { GraphQLClient } from 'graphql-request';\nimport {\n  graphqlAuthenticationConfig,\n  authQueries,\n  authMutations,\n  GraphqlAuthenticationAdapter,\n  User,\n  ID\n} from '..';\n\nexport class FakeAdapter implements GraphqlAuthenticationAdapter {\n  users: User[] = [\n    {\n      id: '2',\n      name: 'Kees',\n      password: '$2a$10$3dcRen7qMwJmzUzgj7cjUukHYlPTTCAjFhfF00.5WAFhhClTp6H4y', // testtest2\n      email: 'kees@volst.nl',\n      inviteAccepted: true,\n      emailConfirmed: true,\n      joinedAt: '2018-06-29T14:26:57+00:00',\n      isSuper: false,\n      lastLogin: ''\n    }\n  ];\n\n  // If you'd use a database you wouldn't need this\n  _generateId() {\n    const lastUser = this.users[this.users.length - 1];\n    return String(parseInt(lastUser.id) + 1);\n  }\n  findUserById(ctx: object, id: ID, info?: any) {\n    return Promise.resolve(this.users.find(user => user.id === id) || null);\n  }\n  findUserByEmail(ctx: any, email: string) {\n    return Promise.resolve(\n      this.users.find(user => user.email === email) || null\n    );\n  }\n  userExistsByEmail(ctx: any, email: string) {\n    return Promise.resolve(this.users.some(user => user.email === email));\n  }\n  createUserBySignup(ctx: any, data: any) {\n    const user = { id: this._generateId(), ...data };\n    this.users.push(user);\n    return Promise.resolve(user);\n  }\n  createUserByInvite(ctx: any, data: any) {\n    const user = { id: this._generateId(), ...data };\n    this.users.push(user);\n    return Promise.resolve(user);\n  }\n  async updateUserLastLogin(ctx: any, userId: string, data: any) {\n    const user = await this.findUserById(ctx, userId);\n    Object.assign(user, data); // iel\n    return Promise.resolve(user);\n  }\n  async updateUserInfo(ctx: any, userId: string, data: any) {\n    const user = await this.findUserById(ctx, userId);\n    Object.assign(user, data); // iel\n    return Promise.resolve(user);\n  }\n  async updateUserPassword(ctx: any, userId: string, data: any) {\n    const user = await this.findUserById(ctx, userId);\n    user!.password = data.password;\n    return Promise.resolve(user);\n  }\n  async updateUserResetToken(ctx: any, userId: string, data: any) {\n    const user = await this.findUserById(ctx, userId);\n    Object.assign(user, data); // iel\n    return Promise.resolve(user);\n  }\n  async updateUserCompleteInvite(ctx: any, userId: string, data: any) {\n    const user = await this.findUserById(ctx, userId);\n    Object.assign(user, data); // iel\n    return Promise.resolve(user);\n  }\n  async updateUserConfirmToken(ctx: any, userId: string, data: any) {\n    const user = await this.findUserById(ctx, userId);\n    Object.assign(user, data); // iel\n    return Promise.resolve(user);\n  }\n}\n\n// In nodejs run `require('jsonwebtoken').sign({ userId: '2' }, 'wherearemyshoes')`\nconst AUTH_KEY =\n  'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIyIiwiaWF0IjoxNTI5MjUxNjQ4fQ.Tw4a0CI3r_8GmyuO1v2aMonrQtKV9QFYnXoxQz0cyRQ';\n\nlet http: any;\nexport async function startServer(options: any = {}) {\n  if (http) {\n    await http.close();\n  }\n  const adapter = new FakeAdapter() as any;\n  const server = new GraphQLServer({\n    typeDefs: './schema.graphql',\n    resolvers: {\n      Query: {\n        ...authQueries\n      },\n      Mutation: {\n        ...authMutations\n      }\n    },\n    context: req => ({\n      ...req,\n      graphqlAuthentication: graphqlAuthenticationConfig({\n        secret: 'wherearemyshoes',\n        adapter,\n        ...options.graphqlAuthentication\n      })\n    })\n  });\n\n  http = await server.start({\n    port: 0\n  });\n  const { port } = http.address();\n  return `http://localhost:${port}/`;\n}\n\nafterAll(async () => {\n  if (http) {\n    await http.close();\n  }\n});\n\nexport const clientWithAuth = uri =>\n  new GraphQLClient(uri, {\n    headers: {\n      Authorization: `Bearer ${AUTH_KEY}`\n    }\n  });\n\nexport const client = uri => new GraphQLClient(uri);\n\n// TODO: this workaround sucks\ntest('asdf', () => undefined);\n"
  },
  {
    "path": "packages/graphql-authentication/src/binding.ts",
    "content": "import { makeBindingClass, Options } from 'graphql-binding';\nimport { GraphQLResolveInfo, GraphQLSchema } from 'graphql';\nimport { IResolvers } from 'graphql-tools/dist/Interfaces';\nimport schema from './schema';\n\nexport interface Query {\n  currentUser: <T = User | null>(\n    args?: {},\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n}\n\nexport interface Mutation {\n  signupByInvite: <T = AuthPayload>(\n    args: { data: SignupByInviteInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  signup: <T = AuthPayload>(\n    args: { data: SignupInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  confirmEmail: <T = AuthPayload>(\n    args: { email: String; emailConfirmToken: String },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  inviteUser: <T = UserIdPayload>(\n    args: { data: InviteUserInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  login: <T = AuthPayload>(\n    args: { email: String; password: String },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  changePassword: <T = UserIdPayload>(\n    args: { oldPassword: String; newPassword: String },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  updateCurrentUser: <T = User | null>(\n    args: { data: UserUpdateInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  triggerPasswordReset: <T = TriggerPasswordResetPayload>(\n    args: { email: String },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  passwordReset: <T = UserIdPayload>(\n    args: { email: String; resetToken: String; password: String },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n}\n\nexport interface Subscription {}\n\nexport interface Binding {\n  query: Query;\n  mutation: Mutation;\n  subscription: Subscription;\n  request: <T = any>(\n    query: string,\n    variables?: { [key: string]: any }\n  ) => Promise<T>;\n  delegate(\n    operation: 'query' | 'mutation',\n    fieldName: string,\n    args: {\n      [key: string]: any;\n    },\n    infoOrQuery?: GraphQLResolveInfo | string,\n    options?: Options\n  ): Promise<any>;\n  delegateSubscription(\n    fieldName: string,\n    args?: {\n      [key: string]: any;\n    },\n    infoOrQuery?: GraphQLResolveInfo | string,\n    options?: Options\n  ): Promise<AsyncIterator<any>>;\n  getAbstractResolvers(filterSchema?: GraphQLSchema | string): IResolvers;\n}\n\nexport interface BindingConstructor<T> {\n  new (...args): T;\n}\n\nexport const Binding = makeBindingClass<BindingConstructor<Binding>>({\n  schema\n});\n\n/**\n * Types\n */\n\nexport interface SignupByInviteInput {\n  email: String;\n  inviteToken: String;\n  password: String;\n  name: String;\n}\n\nexport interface SignupInput {\n  email: String;\n  password: String;\n  name: String;\n}\n\nexport interface InviteUserInput {\n  email: String;\n}\n\nexport interface UserUpdateInput {\n  email?: String;\n  name?: String;\n}\n\nexport interface AuthPayload {\n  token: String;\n  user: User;\n}\n\nexport interface TriggerPasswordResetPayload {\n  ok: Boolean;\n}\n\nexport interface User {\n  id: ID_Output;\n  email: String;\n  name: String;\n  inviteAccepted: Boolean;\n  emailConfirmed: Boolean;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt: DateTime;\n  isSuper: Boolean;\n}\n\nexport interface UserIdPayload {\n  id: ID_Output;\n}\n\n/*\nThe `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.\n*/\nexport type String = string;\n\n/*\nThe `Boolean` scalar type represents `true` or `false`.\n*/\nexport type Boolean = boolean;\n\nexport type DateTime = Date | string;\n\n/*\nThe `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.\n*/\nexport type ID_Input = string | number;\nexport type ID_Output = string;\n"
  },
  {
    "path": "packages/graphql-authentication/src/errors.ts",
    "content": "import { createError } from 'apollo-errors';\n\nexport const MissingDataError = createError('MissingDataError', {\n  message: 'Not all required fields are filled in.'\n});\n\nexport const InvalidEmailError = createError('InvalidEmailError', {\n  message: 'Given email is invalid.'\n});\n\nexport const ResetTokenExpiredError = createError('ResetTokenExpiredError', {\n  message: 'resetToken expired.'\n});\n\nexport const PasswordTooShortError = createError('PasswordTooShortError', {\n  message: 'Password is too short.'\n});\n\nexport const UserNotFoundError = createError('UserNotFoundError', {\n  message: 'No user found.'\n});\n\nexport const InvalidInviteTokenError = createError('InvalidInviteTokenError', {\n  message: 'inviteToken is invalid.'\n});\n\nexport const InvalidEmailConfirmToken = createError(\n  'InvalidEmailConfirmToken',\n  {\n    message: 'emailConfirmToken is invalid.'\n  }\n);\n\nexport const UserEmailExistsError = createError('UserEmailExistsError', {\n  message: 'User already exists with this email.'\n});\n\nexport const UserInviteNotAcceptedError = createError(\n  'UserInviteNotAcceptedError',\n  {\n    message: 'User has not accepted invite yet.'\n  }\n);\n\nexport const UserDeletedError = createError('UserDeletedError', {\n  message: 'User has been deleted.'\n});\n\nexport const UserEmailUnconfirmedError = createError(\n  'UserEmailUnconfirmedError',\n  {\n    message: 'Users email has not been confirmed yet.'\n  }\n);\n\nexport const InvalidOldPasswordError = createError('InvalidOldPasswordError', {\n  message: 'Invalid old password.'\n});\n"
  },
  {
    "path": "packages/graphql-authentication/src/index.ts",
    "content": "export { mutations as authMutations } from './mutations';\nexport { queries as authQueries } from './queries';\nexport { getUser, getUserId, isAuthResolver, Context } from './utils';\nexport { graphqlAuthenticationConfig } from './Config';\nexport { GraphqlAuthenticationAdapter, ID, DateTime, User } from './Adapter';\n"
  },
  {
    "path": "packages/graphql-authentication/src/mutations.ts",
    "content": "import * as bcrypt from 'bcryptjs';\nimport * as jwt from 'jsonwebtoken';\nimport * as validator from 'validator';\nimport { v4 as uuid } from 'uuid';\nimport { getUser, Context } from './utils';\nimport { User } from './Adapter';\nimport {\n  MissingDataError,\n  ResetTokenExpiredError,\n  InvalidEmailError,\n  PasswordTooShortError,\n  UserNotFoundError,\n  InvalidInviteTokenError,\n  UserEmailExistsError,\n  UserInviteNotAcceptedError,\n  UserDeletedError,\n  InvalidOldPasswordError,\n  InvalidEmailConfirmToken,\n  UserEmailUnconfirmedError\n} from './errors';\nimport {\n  SignupByInviteInput,\n  SignupInput,\n  InviteUserInput,\n  UserUpdateInput\n} from './binding';\n\nfunction generateToken(user: User, ctx: Context) {\n  return jwt.sign({ userId: user.id }, ctx.graphqlAuthentication.secret);\n}\n\nfunction validatePassword(ctx: Context, value: string) {\n  if (!ctx.graphqlAuthentication.validatePassword!(value)) {\n    throw new PasswordTooShortError();\n  }\n}\n\nfunction getHashedPassword(value: string) {\n  return bcrypt.hash(value, 10);\n}\n\nexport const mutations = {\n  async signupByInvite(\n    parent: any,\n    { data }: { data: SignupByInviteInput },\n    ctx: Context\n  ) {\n    // Important first check, because i.e. the `inviteToken` could be an empty string\n    // and in that case the find query beneath would find any user with any given email,\n    // allowing you to change the password of everybody.\n    if (!data.inviteToken || !data.email) {\n      throw new MissingDataError();\n    }\n    const user = await ctx.graphqlAuthentication.adapter.findUserByEmail(\n      ctx,\n      data.email\n    );\n    if (!user) {\n      throw new UserNotFoundError();\n    }\n    if (user.inviteToken !== data.inviteToken || user.inviteAccepted) {\n      throw new InvalidInviteTokenError();\n    }\n\n    validatePassword(ctx, data.password);\n    const hashedPassword = await getHashedPassword(data.password);\n\n    const updatedUser = await ctx.graphqlAuthentication.adapter.updateUserCompleteInvite(\n      ctx,\n      user.id,\n      {\n        name: data.name,\n        inviteToken: '',\n        inviteAccepted: true,\n        password: hashedPassword\n      }\n    );\n\n    return {\n      token: generateToken(user, ctx),\n      user: updatedUser\n    };\n  },\n\n  async signup(parent: any, { data }: { data: SignupInput }, ctx: Context) {\n    if (!data.email) {\n      throw new MissingDataError();\n    }\n    const userExists = await ctx.graphqlAuthentication.adapter.userExistsByEmail(\n      ctx,\n      data.email\n    );\n    if (userExists) {\n      throw new UserEmailExistsError();\n    }\n\n    validatePassword(ctx, data.password);\n    const hashedPassword = await getHashedPassword(data.password);\n    const emailConfirmToken = uuid();\n\n    const newUser = await ctx.graphqlAuthentication.adapter.createUserBySignup(\n      ctx,\n      {\n        name: data.name,\n        email: data.email,\n        password: hashedPassword,\n        emailConfirmToken,\n        emailConfirmed: false,\n        inviteAccepted: true,\n        joinedAt: new Date().toISOString()\n      }\n    );\n\n    if (ctx.graphqlAuthentication.mailer) {\n      ctx.graphqlAuthentication.mailer.send({\n        template: 'signupUser',\n        message: {\n          to: newUser.email\n        },\n        locals: {\n          mailAppUrl: ctx.graphqlAuthentication.mailAppUrl,\n          emailConfirmToken,\n          email: newUser.email\n        }\n      });\n    }\n\n    return {\n      token: generateToken(newUser, ctx),\n      user: newUser\n    };\n  },\n\n  async confirmEmail(\n    parent: any,\n    { emailConfirmToken, email }: { emailConfirmToken: string; email: string },\n    ctx: Context\n  ) {\n    if (!emailConfirmToken || !email) {\n      throw new MissingDataError();\n    }\n    const user = await ctx.graphqlAuthentication.adapter.findUserByEmail(\n      ctx,\n      email\n    );\n    if (!user) {\n      throw new UserNotFoundError();\n    }\n    if (user.emailConfirmToken !== emailConfirmToken || user.emailConfirmed) {\n      throw new InvalidEmailConfirmToken();\n    }\n\n    const updatedUser = await ctx.graphqlAuthentication.adapter.updateUserConfirmToken(\n      ctx,\n      user.id,\n      {\n        emailConfirmToken: '',\n        emailConfirmed: true\n      }\n    );\n\n    return {\n      token: generateToken(user, ctx),\n      user: updatedUser\n    };\n  },\n\n  async login(\n    parent: any,\n    { email, password }: { email: string; password: string },\n    ctx: Context\n  ) {\n    const user = await ctx.graphqlAuthentication.adapter.findUserByEmail(\n      ctx,\n      email\n    );\n    if (!user) {\n      throw new UserNotFoundError();\n    }\n\n    if (!user.inviteAccepted) {\n      throw new UserInviteNotAcceptedError();\n    }\n\n    if (user.deletedAt) {\n      throw new UserDeletedError();\n    }\n\n    if (\n      ctx.graphqlAuthentication.requiredConfirmedEmailForLogin &&\n      !user.emailConfirmed\n    ) {\n      throw new UserEmailUnconfirmedError();\n    }\n\n    const valid = await bcrypt.compare(password, user.password);\n    if (!valid) {\n      throw new UserNotFoundError();\n    }\n\n    // Purposefully async, this update doesn't matter that much.\n    ctx.graphqlAuthentication.adapter.updateUserLastLogin(ctx, user.id, {\n      lastLogin: new Date().toISOString()\n    });\n\n    return {\n      token: generateToken(user, ctx),\n      user\n    };\n  },\n\n  async changePassword(\n    parent: any,\n    { oldPassword, newPassword }: { oldPassword: string; newPassword: string },\n    ctx: Context\n  ) {\n    const user = await getUser(ctx);\n\n    const valid = await bcrypt.compare(oldPassword, user.password);\n    if (!valid) {\n      throw new InvalidOldPasswordError();\n    }\n\n    validatePassword(ctx, newPassword);\n    const password = await getHashedPassword(newPassword);\n\n    const newUser = await ctx.graphqlAuthentication.adapter.updateUserPassword(\n      ctx,\n      user.id,\n      { password }\n    );\n\n    return {\n      id: newUser!.id\n    };\n  },\n\n  async inviteUser(\n    parent: any,\n    { data }: { data: InviteUserInput },\n    ctx: Context\n  ) {\n    await getUser(ctx);\n\n    if (!validator.isEmail(data.email)) {\n      throw new InvalidEmailError();\n    }\n\n    const existingUser = await ctx.graphqlAuthentication.adapter.findUserByEmail(\n      ctx,\n      data.email\n    );\n    if (existingUser) {\n      if (ctx.graphqlAuthentication.hookInviteUserPostCreate) {\n        await ctx.graphqlAuthentication.hookInviteUserPostCreate(\n          data,\n          ctx,\n          existingUser\n        );\n      }\n      return {\n        id: existingUser.id\n      };\n    }\n\n    // This token will be used in the email to the user.\n    // According to https://gist.github.com/joepie91/7105003c3b26e65efcea63f3db82dfba\n    // uuid v4 is safe to be used as random token generator.\n    const inviteToken = uuid();\n\n    const newUser = await ctx.graphqlAuthentication.adapter.createUserByInvite(\n      ctx,\n      {\n        email: data.email,\n        inviteToken,\n        inviteAccepted: false,\n        password: '',\n        name: '',\n        joinedAt: new Date().toISOString()\n      }\n    );\n\n    if (ctx.graphqlAuthentication.hookInviteUserPostCreate) {\n      await ctx.graphqlAuthentication.hookInviteUserPostCreate(\n        data,\n        ctx,\n        newUser\n      );\n    }\n\n    if (ctx.graphqlAuthentication.mailer) {\n      ctx.graphqlAuthentication.mailer.send({\n        template: 'inviteUser',\n        message: {\n          to: newUser.email\n        },\n        locals: {\n          mailAppUrl: ctx.graphqlAuthentication.mailAppUrl,\n          inviteToken,\n          email: newUser.email\n        }\n      });\n    }\n\n    return {\n      id: newUser.id\n    };\n  },\n\n  async triggerPasswordReset(\n    parent: any,\n    { email }: { email: string },\n    ctx: Context\n  ) {\n    if (!validator.isEmail(email)) {\n      throw new InvalidEmailError();\n    }\n\n    const user = await ctx.graphqlAuthentication.adapter.findUserByEmail(\n      ctx,\n      email\n    );\n    if (!user) {\n      return { ok: true };\n    }\n\n    // This token will be used in the email to the user.\n    // According to https://gist.github.com/joepie91/7105003c3b26e65efcea63f3db82dfba\n    // uuid v4 is safe to be used as random token generator.\n    const resetToken = uuid();\n    const now = new Date();\n    // Expires in two hours\n    const resetExpires = new Date(now.getTime() + 7200000).toISOString();\n\n    await ctx.graphqlAuthentication.adapter.updateUserResetToken(ctx, user.id, {\n      resetToken,\n      resetExpires\n    });\n\n    if (ctx.graphqlAuthentication.mailer) {\n      ctx.graphqlAuthentication.mailer.send({\n        template: 'passwordReset',\n        message: {\n          to: user.email\n        },\n        locals: {\n          mailAppUrl: ctx.graphqlAuthentication.mailAppUrl,\n          resetToken,\n          email\n        }\n      });\n    }\n\n    return {\n      ok: true\n    };\n  },\n\n  async passwordReset(\n    parent: any,\n    {\n      email,\n      resetToken,\n      password\n    }: { email: string; resetToken: string; password: string },\n    ctx: Context\n  ) {\n    if (!resetToken || !password) {\n      throw new MissingDataError();\n    }\n    const user = await ctx.graphqlAuthentication.adapter.findUserByEmail(\n      ctx,\n      email\n    );\n    if (!user || !user.resetExpires || user.resetToken !== resetToken) {\n      throw new UserNotFoundError();\n    }\n    if (new Date() > new Date(user.resetExpires)) {\n      throw new ResetTokenExpiredError();\n    }\n\n    validatePassword(ctx, password);\n    const hashedPassword = await getHashedPassword(password);\n\n    await ctx.graphqlAuthentication.adapter.updateUserResetToken(ctx, user.id, {\n      resetToken: '',\n      resetExpires: undefined\n    });\n    await ctx.graphqlAuthentication.adapter.updateUserPassword(ctx, user.id, {\n      password: hashedPassword\n    });\n\n    return {\n      id: user.id\n    };\n  },\n\n  async updateCurrentUser(\n    parent: any,\n    { data }: { data: UserUpdateInput },\n    ctx: Context\n  ) {\n    const user = await getUser(ctx);\n\n    await ctx.graphqlAuthentication.adapter.updateUserInfo(ctx, user.id, data);\n\n    return user;\n  }\n};\n"
  },
  {
    "path": "packages/graphql-authentication/src/queries.ts",
    "content": "import { getUserId, Context } from './utils';\n// Without this manual User interface import, TypeScript will create an incorrect queries.d.ts declaration file, WTF?\nimport { User } from './Adapter';\n\nexport const queries = {\n  currentUser(parent: any, args: any, ctx: Context, info: any) {\n    const id = getUserId(ctx);\n    return ctx.graphqlAuthentication.adapter.findUserById(ctx, id, info);\n  }\n};\n"
  },
  {
    "path": "packages/graphql-authentication/src/schema.ts",
    "content": "import * as path from 'path';\nimport { makeExecutableSchema } from 'graphql-tools';\nimport { importSchema } from 'graphql-import';\n\n// This is only used for generating `src/binding.ts`\nexport default makeExecutableSchema({\n  typeDefs: importSchema(path.resolve('schema.graphql'))\n});\n"
  },
  {
    "path": "packages/graphql-authentication/src/utils.ts",
    "content": "import * as jwt from 'jsonwebtoken';\nimport { IGraphqlAuthenticationConfig } from './Config';\nimport { ID } from './Adapter';\n\nexport interface Context {\n  graphqlAuthentication: IGraphqlAuthenticationConfig;\n  request?: any;\n  req?: any;\n}\n\nfunction _getUserId(ctx: Context): string {\n  // For Apollo Server 2.0+ it is ctx.req and for GraphQL Yoga ctx.request. Maybe there is a better way...\n  const Authorization = (ctx.req || ctx.request).get('Authorization');\n  if (Authorization) {\n    const token = Authorization.replace('Bearer ', '');\n    const { userId } = jwt.verify(token, ctx.graphqlAuthentication.secret) as {\n      userId: ID;\n    };\n    return userId;\n  }\n  return '';\n}\n\nexport function getUserId(ctx: Context): string {\n  const userId = _getUserId(ctx);\n  if (userId) {\n    return userId;\n  }\n  throw new AuthError();\n}\n\nexport function getUser(ctx: Context): Promise<any> {\n  return ctx.graphqlAuthentication.adapter.findUserById(ctx, getUserId(ctx));\n}\n\nexport class AuthError extends Error {\n  constructor() {\n    super('Not authorized');\n  }\n}\n\nexport function isAuthResolver(parent: any, args: any, ctx: Context) {\n  return !!_getUserId(ctx);\n}\n"
  },
  {
    "path": "packages/graphql-authentication/tsconfig.build.json",
    "content": "{\n  \"extends\": \"../../tsconfig.base.json\",\n  \"compilerOptions\": {\n    \"rootDir\": \"src\",\n    \"outDir\": \"dist\"\n  },\n  \"include\": [\"src/index.ts\"]\n}\n"
  },
  {
    "path": "packages/graphql-authentication/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\"\n}\n"
  },
  {
    "path": "packages/graphql-authentication-prisma/README.md",
    "content": "# GraphQL Authentication Prisma\n\nA Prisma adapter for [Graphql Authentication](https://github.com/Volst/graphql-authentication/blob/master/README.md).\n\n# Install\n\nNode v8+ should be used. Install with Yarn or npm:\n\n```\nyarn add graphql-authentication graphql-authentication-prisma email-templates\nnpm i graphql-authentication graphql-authentication-prisma email-templates\n```\n\n# Usage with Prisma\n\nYou can read the guide below or checkout [the example](https://github.com/Volst/graphql-authentication/tree/master/examples/with-prisma) to see the full code.\n\n## Step 1\n\nRead the [Usage](https://github.com/Volst/graphql-authentication/blob/master/README.md#usage) section in the full documentation first.\n\n## Step 2\n\nAfter configuring the basics, you can now add this package as an adapter. Pseudo-code example:\n\n```js\nimport { GraphqlAuthenticationPrismaAdapter } from 'graphql-authentication-prisma';\n\ngraphqlAuthentication: graphqlAuthenticationConfig({\n  adapter: new GraphqlAuthenticationPrismaAdapter({\n    // Optional, defaults to 'db'\n    prismaContextName: 'db'\n  })\n});\n```\n\n## Step 3\n\nIn your Prisma `datamodel.graphql` file, add this [User model](https://github.com/Volst/graphql-authentication/blob/master/examples/with-prisma/datamodel.graphql). Run `prisma deploy` to run the migrations.\n\n### [Full Documentation](https://github.com/Volst/graphql-authentication/blob/master/README.md#documentation)\n"
  },
  {
    "path": "packages/graphql-authentication-prisma/package.json",
    "content": "{\n  \"name\": \"graphql-authentication-prisma\",\n  \"version\": \"0.1.5\",\n  \"description\": \"Prisma adapter for graphql-authentication\",\n  \"author\": \"kees@volst.nl\",\n  \"repository\": \"Volst/graphql-authentication\",\n  \"keywords\": [\n    \"graphql\",\n    \"user\",\n    \"authentication\",\n    \"login\",\n    \"prisma\"\n  ],\n  \"license\": \"ISC\",\n  \"private\": false,\n  \"main\": \"dist/index.js\",\n  \"typings\": \"dist/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=8.0\"\n  },\n  \"files\": [\n    \"dist\"\n  ],\n  \"scripts\": {\n    \"build\": \"rm -rf dist && tsc -p tsconfig.build.json\",\n    \"lint\": \"tslint -p .\",\n    \"prepublishOnly\": \"npm run -s build\",\n    \"test\": \"jest --watch\",\n    \"test-coverage\": \"jest --coverage\",\n    \"ci\": \"npm run -s lint && npm run -s build && npm run -s test-coverage && codecov\"\n  },\n  \"devDependencies\": {\n    \"@types/email-templates\": \"^3.5.0\",\n    \"@types/jest\": \"^23.1.0\",\n    \"@volst/tslint-config\": \"^0.2.1\",\n    \"codecov\": \"^3.0.2\",\n    \"email-templates\": \"^4.0.1\",\n    \"graphql-authentication\": \"^0.5.5\",\n    \"graphql-cli\": \"^2.15.13\",\n    \"graphql-request\": \"^1.6.0\",\n    \"graphql-yoga\": \"1.14.10\",\n    \"jest\": \"^23.1.0\",\n    \"nodemon\": \"^1.17.3\",\n    \"prisma-binding\": \"^2.0.0\",\n    \"pug\": \"^2.0.3\",\n    \"ts-jest\": \"^22.4.6\",\n    \"ts-node\": \"^7.0.0\",\n    \"tslint\": \"^5.9.1\",\n    \"typescript\": \"^2.8.3\"\n  },\n  \"dependencies\": {\n    \"@types/bcryptjs\": \"^2.4.1\",\n    \"@types/jsonwebtoken\": \"^7.2.6\",\n    \"@types/uuid\": \"^3.4.3\",\n    \"@types/validator\": \"^9.4.1\",\n    \"apollo-errors\": \"^1.9.0\",\n    \"bcryptjs\": \"^2.4.3\",\n    \"jsonwebtoken\": \"^8.2.1\",\n    \"uuid\": \"^3.2.1\",\n    \"validator\": \"^10.2.0\"\n  },\n  \"peerDependencies\": {\n    \"graphql-authentication\": \"^0.5.0\",\n    \"prisma-binding\": \"^2.0.0\"\n  },\n  \"jest\": {\n    \"roots\": [\n      \"./src\"\n    ],\n    \"transform\": {\n      \"^.+\\\\.tsx?$\": \"ts-jest\"\n    },\n    \"testRegex\": \"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$\",\n    \"moduleFileExtensions\": [\n      \"ts\",\n      \"js\",\n      \"json\",\n      \"node\"\n    ]\n  }\n}\n"
  },
  {
    "path": "packages/graphql-authentication-prisma/src/Prisma.ts",
    "content": "import { Prisma, User } from './generated/prisma';\nimport { GraphqlAuthenticationAdapter, ID } from 'graphql-authentication';\n\nexport class GraphqlAuthenticationPrismaAdapter\n  implements GraphqlAuthenticationAdapter {\n  prismaContextName = 'db';\n\n  constructor(options: { prismaContextName?: string } = {}) {\n    if (options && options.prismaContextName) {\n      this.prismaContextName = options.prismaContextName;\n    }\n  }\n\n  private db(ctx: object) {\n    const db: Prisma = ctx[this.prismaContextName];\n    if (!db) {\n      throw new Error(\n        `The Prisma binding is not attached to the \\`${\n          this.prismaContextName\n        }\\` property on your context.`\n      );\n    }\n    return db;\n  }\n\n  findUserById(ctx: object, id: ID, info?: any) {\n    return this.db(ctx).query.user({ where: { id } }, info);\n  }\n  findUserByEmail(ctx: object, email: string, info?: any) {\n    return this.db(ctx).query.user(\n      {\n        where: { email: email }\n      },\n      info\n    );\n  }\n  userExistsByEmail(ctx: object, email: string) {\n    return this.db(ctx).exists.User({ email });\n  }\n  private createUser(ctx: object, data: any) {\n    return this.db(ctx).mutation.createUser({\n      data\n    });\n  }\n  createUserBySignup(ctx: object, data: any) {\n    return this.createUser(ctx, data);\n  }\n  createUserByInvite(ctx: object, data: any) {\n    return this.createUser(ctx, data);\n  }\n  private updateUser(ctx: object, userId: ID, data: any) {\n    return this.db(ctx).mutation.updateUser({\n      where: { id: userId },\n      data\n    });\n  }\n  updateUserConfirmToken(ctx: object, userId: ID, data: any) {\n    return this.updateUser(ctx, userId, data);\n  }\n  updateUserLastLogin(ctx: object, userId: ID, data: any) {\n    return this.updateUser(ctx, userId, data);\n  }\n  updateUserPassword(ctx: object, userId: ID, data: any) {\n    return this.updateUser(ctx, userId, data);\n  }\n  updateUserResetToken(ctx: object, userId: ID, data: any) {\n    return this.updateUser(ctx, userId, data);\n  }\n  updateUserInfo(ctx: object, userId: ID, data: any) {\n    return this.updateUser(ctx, userId, data);\n  }\n  updateUserCompleteInvite(ctx: object, userId: ID, data: any) {\n    return this.updateUser(ctx, userId, data);\n  }\n}\n"
  },
  {
    "path": "packages/graphql-authentication-prisma/src/generated/prisma.graphql",
    "content": "# source: http://localhost:4466\n# timestamp: Sun Jun 17 2018 19:34:23 GMT+0200 (CEST)\n\ntype AggregateUser {\n  count: Int!\n}\n\ntype BatchPayload {\n  \"\"\"\n  The number of nodes that have been affected by the Batch operation.\n  \"\"\"\n  count: Long!\n}\n\nscalar DateTime\n\n\"\"\"\nThe `Long` scalar type represents non-fractional signed whole numeric values.\nLong can represent values between -(2^63) and 2^63 - 1.\n\"\"\"\nscalar Long\n\ntype Mutation {\n  createUser(data: UserCreateInput!): User!\n  updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User\n  deleteUser(where: UserWhereUniqueInput!): User\n  upsertUser(\n    where: UserWhereUniqueInput!\n    create: UserCreateInput!\n    update: UserUpdateInput!\n  ): User!\n  updateManyUsers(data: UserUpdateInput!, where: UserWhereInput): BatchPayload!\n  deleteManyUsers(where: UserWhereInput): BatchPayload!\n}\n\nenum MutationType {\n  CREATED\n  UPDATED\n  DELETED\n}\n\n\"\"\"\nAn object with an ID\n\"\"\"\ninterface Node {\n  \"\"\"\n  The id of the object.\n  \"\"\"\n  id: ID!\n}\n\n\"\"\"\nInformation about pagination in a connection.\n\"\"\"\ntype PageInfo {\n  \"\"\"\n  When paginating forwards, are there more items?\n  \"\"\"\n  hasNextPage: Boolean!\n\n  \"\"\"\n  When paginating backwards, are there more items?\n  \"\"\"\n  hasPreviousPage: Boolean!\n\n  \"\"\"\n  When paginating backwards, the cursor to continue.\n  \"\"\"\n  startCursor: String\n\n  \"\"\"\n  When paginating forwards, the cursor to continue.\n  \"\"\"\n  endCursor: String\n}\n\ntype Query {\n  users(\n    where: UserWhereInput\n    orderBy: UserOrderByInput\n    skip: Int\n    after: String\n    before: String\n    first: Int\n    last: Int\n  ): [User]!\n  user(where: UserWhereUniqueInput!): User\n  usersConnection(\n    where: UserWhereInput\n    orderBy: UserOrderByInput\n    skip: Int\n    after: String\n    before: String\n    first: Int\n    last: Int\n  ): UserConnection!\n\n  \"\"\"\n  Fetches an object given its ID\n  \"\"\"\n  node(\n    \"\"\"\n    The ID of an object\n    \"\"\"\n    id: ID!\n  ): Node\n}\n\ntype Subscription {\n  user(where: UserSubscriptionWhereInput): UserSubscriptionPayload\n}\n\ntype User implements Node {\n  id: ID!\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n}\n\n\"\"\"\nA connection to a list of items.\n\"\"\"\ntype UserConnection {\n  \"\"\"\n  Information to aid in pagination.\n  \"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"\n  A list of edges.\n  \"\"\"\n  edges: [UserEdge]!\n  aggregate: AggregateUser!\n}\n\ninput UserCreateInput {\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean\n  emailConfirmed: Boolean\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean\n}\n\n\"\"\"\nAn edge in a connection.\n\"\"\"\ntype UserEdge {\n  \"\"\"\n  The item at the end of the edge.\n  \"\"\"\n  node: User!\n\n  \"\"\"\n  A cursor for use in pagination.\n  \"\"\"\n  cursor: String!\n}\n\nenum UserOrderByInput {\n  id_ASC\n  id_DESC\n  email_ASC\n  email_DESC\n  password_ASC\n  password_DESC\n  name_ASC\n  name_DESC\n  inviteToken_ASC\n  inviteToken_DESC\n  inviteAccepted_ASC\n  inviteAccepted_DESC\n  emailConfirmed_ASC\n  emailConfirmed_DESC\n  emailConfirmToken_ASC\n  emailConfirmToken_DESC\n  resetToken_ASC\n  resetToken_DESC\n  resetExpires_ASC\n  resetExpires_DESC\n  deletedAt_ASC\n  deletedAt_DESC\n  lastLogin_ASC\n  lastLogin_DESC\n  joinedAt_ASC\n  joinedAt_DESC\n  isSuper_ASC\n  isSuper_DESC\n  updatedAt_ASC\n  updatedAt_DESC\n  createdAt_ASC\n  createdAt_DESC\n}\n\ntype UserPreviousValues {\n  id: ID!\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n}\n\ntype UserSubscriptionPayload {\n  mutation: MutationType!\n  node: User\n  updatedFields: [String!]\n  previousValues: UserPreviousValues\n}\n\ninput UserSubscriptionWhereInput {\n  \"\"\"\n  Logical AND on all given filters.\n  \"\"\"\n  AND: [UserSubscriptionWhereInput!]\n\n  \"\"\"\n  Logical OR on all given filters.\n  \"\"\"\n  OR: [UserSubscriptionWhereInput!]\n\n  \"\"\"\n  Logical NOT on all given filters combined by AND.\n  \"\"\"\n  NOT: [UserSubscriptionWhereInput!]\n\n  \"\"\"\n  The subscription event gets dispatched when it's listed in mutation_in\n  \"\"\"\n  mutation_in: [MutationType!]\n\n  \"\"\"\n  The subscription event gets only dispatched when one of the updated fields names is included in this list\n  \"\"\"\n  updatedFields_contains: String\n\n  \"\"\"\n  The subscription event gets only dispatched when all of the field names included in this list have been updated\n  \"\"\"\n  updatedFields_contains_every: [String!]\n\n  \"\"\"\n  The subscription event gets only dispatched when some of the field names included in this list have been updated\n  \"\"\"\n  updatedFields_contains_some: [String!]\n  node: UserWhereInput\n}\n\ninput UserUpdateInput {\n  email: String\n  password: String\n  name: String\n  inviteToken: String\n  inviteAccepted: Boolean\n  emailConfirmed: Boolean\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime\n  isSuper: Boolean\n}\n\ninput UserWhereInput {\n  \"\"\"\n  Logical AND on all given filters.\n  \"\"\"\n  AND: [UserWhereInput!]\n\n  \"\"\"\n  Logical OR on all given filters.\n  \"\"\"\n  OR: [UserWhereInput!]\n\n  \"\"\"\n  Logical NOT on all given filters combined by AND.\n  \"\"\"\n  NOT: [UserWhereInput!]\n  id: ID\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  id_not: ID\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  id_in: [ID!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  id_not_in: [ID!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  id_lt: ID\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  id_lte: ID\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  id_gt: ID\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  id_gte: ID\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  id_contains: ID\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  id_not_contains: ID\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  id_starts_with: ID\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  id_not_starts_with: ID\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  id_ends_with: ID\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  id_not_ends_with: ID\n  email: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  email_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  email_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  email_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  email_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  email_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  email_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  email_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  email_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  email_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  email_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  email_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  email_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  email_not_ends_with: String\n  password: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  password_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  password_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  password_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  password_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  password_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  password_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  password_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  password_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  password_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  password_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  password_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  password_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  password_not_ends_with: String\n  name: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  name_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  name_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  name_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  name_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  name_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  name_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  name_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  name_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  name_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  name_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  name_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  name_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  name_not_ends_with: String\n  inviteToken: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  inviteToken_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  inviteToken_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  inviteToken_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  inviteToken_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  inviteToken_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  inviteToken_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  inviteToken_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  inviteToken_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  inviteToken_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  inviteToken_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  inviteToken_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  inviteToken_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  inviteToken_not_ends_with: String\n  inviteAccepted: Boolean\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  inviteAccepted_not: Boolean\n  emailConfirmed: Boolean\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  emailConfirmed_not: Boolean\n  emailConfirmToken: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  emailConfirmToken_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  emailConfirmToken_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  emailConfirmToken_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  emailConfirmToken_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  emailConfirmToken_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  emailConfirmToken_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  emailConfirmToken_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  emailConfirmToken_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  emailConfirmToken_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  emailConfirmToken_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  emailConfirmToken_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  emailConfirmToken_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  emailConfirmToken_not_ends_with: String\n  resetToken: String\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  resetToken_not: String\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  resetToken_in: [String!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  resetToken_not_in: [String!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  resetToken_lt: String\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  resetToken_lte: String\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  resetToken_gt: String\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  resetToken_gte: String\n\n  \"\"\"\n  All values containing the given string.\n  \"\"\"\n  resetToken_contains: String\n\n  \"\"\"\n  All values not containing the given string.\n  \"\"\"\n  resetToken_not_contains: String\n\n  \"\"\"\n  All values starting with the given string.\n  \"\"\"\n  resetToken_starts_with: String\n\n  \"\"\"\n  All values not starting with the given string.\n  \"\"\"\n  resetToken_not_starts_with: String\n\n  \"\"\"\n  All values ending with the given string.\n  \"\"\"\n  resetToken_ends_with: String\n\n  \"\"\"\n  All values not ending with the given string.\n  \"\"\"\n  resetToken_not_ends_with: String\n  resetExpires: DateTime\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  resetExpires_not: DateTime\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  resetExpires_in: [DateTime!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  resetExpires_not_in: [DateTime!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  resetExpires_lt: DateTime\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  resetExpires_lte: DateTime\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  resetExpires_gt: DateTime\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  resetExpires_gte: DateTime\n  deletedAt: DateTime\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  deletedAt_not: DateTime\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  deletedAt_in: [DateTime!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  deletedAt_not_in: [DateTime!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  deletedAt_lt: DateTime\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  deletedAt_lte: DateTime\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  deletedAt_gt: DateTime\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  deletedAt_gte: DateTime\n  lastLogin: DateTime\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  lastLogin_not: DateTime\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  lastLogin_in: [DateTime!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  lastLogin_not_in: [DateTime!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  lastLogin_lt: DateTime\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  lastLogin_lte: DateTime\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  lastLogin_gt: DateTime\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  lastLogin_gte: DateTime\n  joinedAt: DateTime\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  joinedAt_not: DateTime\n\n  \"\"\"\n  All values that are contained in given list.\n  \"\"\"\n  joinedAt_in: [DateTime!]\n\n  \"\"\"\n  All values that are not contained in given list.\n  \"\"\"\n  joinedAt_not_in: [DateTime!]\n\n  \"\"\"\n  All values less than the given value.\n  \"\"\"\n  joinedAt_lt: DateTime\n\n  \"\"\"\n  All values less than or equal the given value.\n  \"\"\"\n  joinedAt_lte: DateTime\n\n  \"\"\"\n  All values greater than the given value.\n  \"\"\"\n  joinedAt_gt: DateTime\n\n  \"\"\"\n  All values greater than or equal the given value.\n  \"\"\"\n  joinedAt_gte: DateTime\n  isSuper: Boolean\n\n  \"\"\"\n  All values that are not equal to given value.\n  \"\"\"\n  isSuper_not: Boolean\n}\n\ninput UserWhereUniqueInput {\n  id: ID\n  email: String\n}\n"
  },
  {
    "path": "packages/graphql-authentication-prisma/src/generated/prisma.ts",
    "content": "import { GraphQLResolveInfo, GraphQLSchema } from 'graphql';\nimport { IResolvers } from 'graphql-tools/dist/Interfaces';\nimport { Options } from 'graphql-binding';\nimport { makePrismaBindingClass, BasePrismaOptions } from 'prisma-binding';\n\nexport interface Query {\n  users: <T = User[]>(\n    args: {\n      where?: UserWhereInput;\n      orderBy?: UserOrderByInput;\n      skip?: Int;\n      after?: String;\n      before?: String;\n      first?: Int;\n      last?: Int;\n    },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  user: <T = User | null>(\n    args: { where: UserWhereUniqueInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  usersConnection: <T = UserConnection>(\n    args: {\n      where?: UserWhereInput;\n      orderBy?: UserOrderByInput;\n      skip?: Int;\n      after?: String;\n      before?: String;\n      first?: Int;\n      last?: Int;\n    },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  node: <T = Node | null>(\n    args: { id: ID_Output },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n}\n\nexport interface Mutation {\n  createUser: <T = User>(\n    args: { data: UserCreateInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  updateUser: <T = User | null>(\n    args: { data: UserUpdateInput; where: UserWhereUniqueInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  deleteUser: <T = User | null>(\n    args: { where: UserWhereUniqueInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  upsertUser: <T = User>(\n    args: {\n      where: UserWhereUniqueInput;\n      create: UserCreateInput;\n      update: UserUpdateInput;\n    },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  updateManyUsers: <T = BatchPayload>(\n    args: { data: UserUpdateInput; where?: UserWhereInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n  deleteManyUsers: <T = BatchPayload>(\n    args: { where?: UserWhereInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<T>;\n}\n\nexport interface Subscription {\n  user: <T = UserSubscriptionPayload | null>(\n    args: { where?: UserSubscriptionWhereInput },\n    info?: GraphQLResolveInfo | string,\n    options?: Options\n  ) => Promise<AsyncIterator<T>>;\n}\n\nexport interface Exists {\n  User: (where?: UserWhereInput) => Promise<boolean>;\n}\n\nexport interface Prisma {\n  query: Query;\n  mutation: Mutation;\n  subscription: Subscription;\n  exists: Exists;\n  request: <T = any>(\n    query: string,\n    variables?: { [key: string]: any }\n  ) => Promise<T>;\n  delegate(\n    operation: 'query' | 'mutation',\n    fieldName: string,\n    args: {\n      [key: string]: any;\n    },\n    infoOrQuery?: GraphQLResolveInfo | string,\n    options?: Options\n  ): Promise<any>;\n  delegateSubscription(\n    fieldName: string,\n    args?: {\n      [key: string]: any;\n    },\n    infoOrQuery?: GraphQLResolveInfo | string,\n    options?: Options\n  ): Promise<AsyncIterator<any>>;\n  getAbstractResolvers(filterSchema?: GraphQLSchema | string): IResolvers;\n}\n\nexport interface BindingConstructor<T> {\n  new (options: BasePrismaOptions): T;\n}\n/**\n * Type Defs\n */\n\nconst typeDefs = `type AggregateUser {\n  count: Int!\n}\n\ntype BatchPayload {\n  \"\"\"The number of nodes that have been affected by the Batch operation.\"\"\"\n  count: Long!\n}\n\nscalar DateTime\n\n\"\"\"\nThe \\`Long\\` scalar type represents non-fractional signed whole numeric values.\nLong can represent values between -(2^63) and 2^63 - 1.\n\"\"\"\nscalar Long\n\ntype Mutation {\n  createUser(data: UserCreateInput!): User!\n  updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User\n  deleteUser(where: UserWhereUniqueInput!): User\n  upsertUser(where: UserWhereUniqueInput!, create: UserCreateInput!, update: UserUpdateInput!): User!\n  updateManyUsers(data: UserUpdateInput!, where: UserWhereInput): BatchPayload!\n  deleteManyUsers(where: UserWhereInput): BatchPayload!\n}\n\nenum MutationType {\n  CREATED\n  UPDATED\n  DELETED\n}\n\n\"\"\"An object with an ID\"\"\"\ninterface Node {\n  \"\"\"The id of the object.\"\"\"\n  id: ID!\n}\n\n\"\"\"Information about pagination in a connection.\"\"\"\ntype PageInfo {\n  \"\"\"When paginating forwards, are there more items?\"\"\"\n  hasNextPage: Boolean!\n\n  \"\"\"When paginating backwards, are there more items?\"\"\"\n  hasPreviousPage: Boolean!\n\n  \"\"\"When paginating backwards, the cursor to continue.\"\"\"\n  startCursor: String\n\n  \"\"\"When paginating forwards, the cursor to continue.\"\"\"\n  endCursor: String\n}\n\ntype Query {\n  users(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User]!\n  user(where: UserWhereUniqueInput!): User\n  usersConnection(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection!\n\n  \"\"\"Fetches an object given its ID\"\"\"\n  node(\n    \"\"\"The ID of an object\"\"\"\n    id: ID!\n  ): Node\n}\n\ntype Subscription {\n  user(where: UserSubscriptionWhereInput): UserSubscriptionPayload\n}\n\ntype User implements Node {\n  id: ID!\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype UserConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [UserEdge]!\n  aggregate: AggregateUser!\n}\n\ninput UserCreateInput {\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean\n  emailConfirmed: Boolean\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype UserEdge {\n  \"\"\"The item at the end of the edge.\"\"\"\n  node: User!\n\n  \"\"\"A cursor for use in pagination.\"\"\"\n  cursor: String!\n}\n\nenum UserOrderByInput {\n  id_ASC\n  id_DESC\n  email_ASC\n  email_DESC\n  password_ASC\n  password_DESC\n  name_ASC\n  name_DESC\n  inviteToken_ASC\n  inviteToken_DESC\n  inviteAccepted_ASC\n  inviteAccepted_DESC\n  emailConfirmed_ASC\n  emailConfirmed_DESC\n  emailConfirmToken_ASC\n  emailConfirmToken_DESC\n  resetToken_ASC\n  resetToken_DESC\n  resetExpires_ASC\n  resetExpires_DESC\n  deletedAt_ASC\n  deletedAt_DESC\n  lastLogin_ASC\n  lastLogin_DESC\n  joinedAt_ASC\n  joinedAt_DESC\n  isSuper_ASC\n  isSuper_DESC\n  updatedAt_ASC\n  updatedAt_DESC\n  createdAt_ASC\n  createdAt_DESC\n}\n\ntype UserPreviousValues {\n  id: ID!\n  email: String!\n  password: String!\n  name: String!\n  inviteToken: String\n  inviteAccepted: Boolean!\n  emailConfirmed: Boolean!\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime!\n  isSuper: Boolean!\n}\n\ntype UserSubscriptionPayload {\n  mutation: MutationType!\n  node: User\n  updatedFields: [String!]\n  previousValues: UserPreviousValues\n}\n\ninput UserSubscriptionWhereInput {\n  \"\"\"Logical AND on all given filters.\"\"\"\n  AND: [UserSubscriptionWhereInput!]\n\n  \"\"\"Logical OR on all given filters.\"\"\"\n  OR: [UserSubscriptionWhereInput!]\n\n  \"\"\"Logical NOT on all given filters combined by AND.\"\"\"\n  NOT: [UserSubscriptionWhereInput!]\n\n  \"\"\"\n  The subscription event gets dispatched when it's listed in mutation_in\n  \"\"\"\n  mutation_in: [MutationType!]\n\n  \"\"\"\n  The subscription event gets only dispatched when one of the updated fields names is included in this list\n  \"\"\"\n  updatedFields_contains: String\n\n  \"\"\"\n  The subscription event gets only dispatched when all of the field names included in this list have been updated\n  \"\"\"\n  updatedFields_contains_every: [String!]\n\n  \"\"\"\n  The subscription event gets only dispatched when some of the field names included in this list have been updated\n  \"\"\"\n  updatedFields_contains_some: [String!]\n  node: UserWhereInput\n}\n\ninput UserUpdateInput {\n  email: String\n  password: String\n  name: String\n  inviteToken: String\n  inviteAccepted: Boolean\n  emailConfirmed: Boolean\n  emailConfirmToken: String\n  resetToken: String\n  resetExpires: DateTime\n  deletedAt: DateTime\n  lastLogin: DateTime\n  joinedAt: DateTime\n  isSuper: Boolean\n}\n\ninput UserWhereInput {\n  \"\"\"Logical AND on all given filters.\"\"\"\n  AND: [UserWhereInput!]\n\n  \"\"\"Logical OR on all given filters.\"\"\"\n  OR: [UserWhereInput!]\n\n  \"\"\"Logical NOT on all given filters combined by AND.\"\"\"\n  NOT: [UserWhereInput!]\n  id: ID\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  id_not: ID\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  id_in: [ID!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  id_not_in: [ID!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  id_lt: ID\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  id_lte: ID\n\n  \"\"\"All values greater than the given value.\"\"\"\n  id_gt: ID\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  id_gte: ID\n\n  \"\"\"All values containing the given string.\"\"\"\n  id_contains: ID\n\n  \"\"\"All values not containing the given string.\"\"\"\n  id_not_contains: ID\n\n  \"\"\"All values starting with the given string.\"\"\"\n  id_starts_with: ID\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  id_not_starts_with: ID\n\n  \"\"\"All values ending with the given string.\"\"\"\n  id_ends_with: ID\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  id_not_ends_with: ID\n  email: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  email_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  email_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  email_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  email_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  email_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  email_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  email_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  email_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  email_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  email_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  email_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  email_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  email_not_ends_with: String\n  password: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  password_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  password_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  password_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  password_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  password_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  password_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  password_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  password_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  password_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  password_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  password_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  password_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  password_not_ends_with: String\n  name: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  name_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  name_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  name_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  name_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  name_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  name_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  name_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  name_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  name_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  name_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  name_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  name_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  name_not_ends_with: String\n  inviteToken: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  inviteToken_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  inviteToken_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  inviteToken_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  inviteToken_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  inviteToken_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  inviteToken_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  inviteToken_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  inviteToken_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  inviteToken_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  inviteToken_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  inviteToken_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  inviteToken_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  inviteToken_not_ends_with: String\n  inviteAccepted: Boolean\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  inviteAccepted_not: Boolean\n  emailConfirmed: Boolean\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  emailConfirmed_not: Boolean\n  emailConfirmToken: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  emailConfirmToken_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  emailConfirmToken_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  emailConfirmToken_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  emailConfirmToken_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  emailConfirmToken_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  emailConfirmToken_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  emailConfirmToken_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  emailConfirmToken_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  emailConfirmToken_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  emailConfirmToken_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  emailConfirmToken_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  emailConfirmToken_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  emailConfirmToken_not_ends_with: String\n  resetToken: String\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  resetToken_not: String\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  resetToken_in: [String!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  resetToken_not_in: [String!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  resetToken_lt: String\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  resetToken_lte: String\n\n  \"\"\"All values greater than the given value.\"\"\"\n  resetToken_gt: String\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  resetToken_gte: String\n\n  \"\"\"All values containing the given string.\"\"\"\n  resetToken_contains: String\n\n  \"\"\"All values not containing the given string.\"\"\"\n  resetToken_not_contains: String\n\n  \"\"\"All values starting with the given string.\"\"\"\n  resetToken_starts_with: String\n\n  \"\"\"All values not starting with the given string.\"\"\"\n  resetToken_not_starts_with: String\n\n  \"\"\"All values ending with the given string.\"\"\"\n  resetToken_ends_with: String\n\n  \"\"\"All values not ending with the given string.\"\"\"\n  resetToken_not_ends_with: String\n  resetExpires: DateTime\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  resetExpires_not: DateTime\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  resetExpires_in: [DateTime!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  resetExpires_not_in: [DateTime!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  resetExpires_lt: DateTime\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  resetExpires_lte: DateTime\n\n  \"\"\"All values greater than the given value.\"\"\"\n  resetExpires_gt: DateTime\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  resetExpires_gte: DateTime\n  deletedAt: DateTime\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  deletedAt_not: DateTime\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  deletedAt_in: [DateTime!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  deletedAt_not_in: [DateTime!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  deletedAt_lt: DateTime\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  deletedAt_lte: DateTime\n\n  \"\"\"All values greater than the given value.\"\"\"\n  deletedAt_gt: DateTime\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  deletedAt_gte: DateTime\n  lastLogin: DateTime\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  lastLogin_not: DateTime\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  lastLogin_in: [DateTime!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  lastLogin_not_in: [DateTime!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  lastLogin_lt: DateTime\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  lastLogin_lte: DateTime\n\n  \"\"\"All values greater than the given value.\"\"\"\n  lastLogin_gt: DateTime\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  lastLogin_gte: DateTime\n  joinedAt: DateTime\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  joinedAt_not: DateTime\n\n  \"\"\"All values that are contained in given list.\"\"\"\n  joinedAt_in: [DateTime!]\n\n  \"\"\"All values that are not contained in given list.\"\"\"\n  joinedAt_not_in: [DateTime!]\n\n  \"\"\"All values less than the given value.\"\"\"\n  joinedAt_lt: DateTime\n\n  \"\"\"All values less than or equal the given value.\"\"\"\n  joinedAt_lte: DateTime\n\n  \"\"\"All values greater than the given value.\"\"\"\n  joinedAt_gt: DateTime\n\n  \"\"\"All values greater than or equal the given value.\"\"\"\n  joinedAt_gte: DateTime\n  isSuper: Boolean\n\n  \"\"\"All values that are not equal to given value.\"\"\"\n  isSuper_not: Boolean\n}\n\ninput UserWhereUniqueInput {\n  id: ID\n  email: String\n}\n`;\n\nexport const Prisma = makePrismaBindingClass<BindingConstructor<Prisma>>({\n  typeDefs\n});\n\n/**\n * Types\n */\n\nexport type UserOrderByInput =\n  | 'id_ASC'\n  | 'id_DESC'\n  | 'email_ASC'\n  | 'email_DESC'\n  | 'password_ASC'\n  | 'password_DESC'\n  | 'name_ASC'\n  | 'name_DESC'\n  | 'inviteToken_ASC'\n  | 'inviteToken_DESC'\n  | 'inviteAccepted_ASC'\n  | 'inviteAccepted_DESC'\n  | 'emailConfirmed_ASC'\n  | 'emailConfirmed_DESC'\n  | 'emailConfirmToken_ASC'\n  | 'emailConfirmToken_DESC'\n  | 'resetToken_ASC'\n  | 'resetToken_DESC'\n  | 'resetExpires_ASC'\n  | 'resetExpires_DESC'\n  | 'deletedAt_ASC'\n  | 'deletedAt_DESC'\n  | 'lastLogin_ASC'\n  | 'lastLogin_DESC'\n  | 'joinedAt_ASC'\n  | 'joinedAt_DESC'\n  | 'isSuper_ASC'\n  | 'isSuper_DESC'\n  | 'updatedAt_ASC'\n  | 'updatedAt_DESC'\n  | 'createdAt_ASC'\n  | 'createdAt_DESC';\n\nexport type MutationType = 'CREATED' | 'UPDATED' | 'DELETED';\n\nexport interface UserWhereUniqueInput {\n  id?: ID_Input;\n  email?: String;\n}\n\nexport interface UserCreateInput {\n  email: String;\n  password: String;\n  name: String;\n  inviteToken?: String;\n  inviteAccepted?: Boolean;\n  emailConfirmed?: Boolean;\n  emailConfirmToken?: String;\n  resetToken?: String;\n  resetExpires?: DateTime;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt: DateTime;\n  isSuper?: Boolean;\n}\n\nexport interface UserUpdateInput {\n  email?: String;\n  password?: String;\n  name?: String;\n  inviteToken?: String;\n  inviteAccepted?: Boolean;\n  emailConfirmed?: Boolean;\n  emailConfirmToken?: String;\n  resetToken?: String;\n  resetExpires?: DateTime;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt?: DateTime;\n  isSuper?: Boolean;\n}\n\nexport interface UserSubscriptionWhereInput {\n  AND?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput;\n  OR?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput;\n  NOT?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput;\n  mutation_in?: MutationType[] | MutationType;\n  updatedFields_contains?: String;\n  updatedFields_contains_every?: String[] | String;\n  updatedFields_contains_some?: String[] | String;\n  node?: UserWhereInput;\n}\n\nexport interface UserWhereInput {\n  AND?: UserWhereInput[] | UserWhereInput;\n  OR?: UserWhereInput[] | UserWhereInput;\n  NOT?: UserWhereInput[] | UserWhereInput;\n  id?: ID_Input;\n  id_not?: ID_Input;\n  id_in?: ID_Input[] | ID_Input;\n  id_not_in?: ID_Input[] | ID_Input;\n  id_lt?: ID_Input;\n  id_lte?: ID_Input;\n  id_gt?: ID_Input;\n  id_gte?: ID_Input;\n  id_contains?: ID_Input;\n  id_not_contains?: ID_Input;\n  id_starts_with?: ID_Input;\n  id_not_starts_with?: ID_Input;\n  id_ends_with?: ID_Input;\n  id_not_ends_with?: ID_Input;\n  email?: String;\n  email_not?: String;\n  email_in?: String[] | String;\n  email_not_in?: String[] | String;\n  email_lt?: String;\n  email_lte?: String;\n  email_gt?: String;\n  email_gte?: String;\n  email_contains?: String;\n  email_not_contains?: String;\n  email_starts_with?: String;\n  email_not_starts_with?: String;\n  email_ends_with?: String;\n  email_not_ends_with?: String;\n  password?: String;\n  password_not?: String;\n  password_in?: String[] | String;\n  password_not_in?: String[] | String;\n  password_lt?: String;\n  password_lte?: String;\n  password_gt?: String;\n  password_gte?: String;\n  password_contains?: String;\n  password_not_contains?: String;\n  password_starts_with?: String;\n  password_not_starts_with?: String;\n  password_ends_with?: String;\n  password_not_ends_with?: String;\n  name?: String;\n  name_not?: String;\n  name_in?: String[] | String;\n  name_not_in?: String[] | String;\n  name_lt?: String;\n  name_lte?: String;\n  name_gt?: String;\n  name_gte?: String;\n  name_contains?: String;\n  name_not_contains?: String;\n  name_starts_with?: String;\n  name_not_starts_with?: String;\n  name_ends_with?: String;\n  name_not_ends_with?: String;\n  inviteToken?: String;\n  inviteToken_not?: String;\n  inviteToken_in?: String[] | String;\n  inviteToken_not_in?: String[] | String;\n  inviteToken_lt?: String;\n  inviteToken_lte?: String;\n  inviteToken_gt?: String;\n  inviteToken_gte?: String;\n  inviteToken_contains?: String;\n  inviteToken_not_contains?: String;\n  inviteToken_starts_with?: String;\n  inviteToken_not_starts_with?: String;\n  inviteToken_ends_with?: String;\n  inviteToken_not_ends_with?: String;\n  inviteAccepted?: Boolean;\n  inviteAccepted_not?: Boolean;\n  emailConfirmed?: Boolean;\n  emailConfirmed_not?: Boolean;\n  emailConfirmToken?: String;\n  emailConfirmToken_not?: String;\n  emailConfirmToken_in?: String[] | String;\n  emailConfirmToken_not_in?: String[] | String;\n  emailConfirmToken_lt?: String;\n  emailConfirmToken_lte?: String;\n  emailConfirmToken_gt?: String;\n  emailConfirmToken_gte?: String;\n  emailConfirmToken_contains?: String;\n  emailConfirmToken_not_contains?: String;\n  emailConfirmToken_starts_with?: String;\n  emailConfirmToken_not_starts_with?: String;\n  emailConfirmToken_ends_with?: String;\n  emailConfirmToken_not_ends_with?: String;\n  resetToken?: String;\n  resetToken_not?: String;\n  resetToken_in?: String[] | String;\n  resetToken_not_in?: String[] | String;\n  resetToken_lt?: String;\n  resetToken_lte?: String;\n  resetToken_gt?: String;\n  resetToken_gte?: String;\n  resetToken_contains?: String;\n  resetToken_not_contains?: String;\n  resetToken_starts_with?: String;\n  resetToken_not_starts_with?: String;\n  resetToken_ends_with?: String;\n  resetToken_not_ends_with?: String;\n  resetExpires?: DateTime;\n  resetExpires_not?: DateTime;\n  resetExpires_in?: DateTime[] | DateTime;\n  resetExpires_not_in?: DateTime[] | DateTime;\n  resetExpires_lt?: DateTime;\n  resetExpires_lte?: DateTime;\n  resetExpires_gt?: DateTime;\n  resetExpires_gte?: DateTime;\n  deletedAt?: DateTime;\n  deletedAt_not?: DateTime;\n  deletedAt_in?: DateTime[] | DateTime;\n  deletedAt_not_in?: DateTime[] | DateTime;\n  deletedAt_lt?: DateTime;\n  deletedAt_lte?: DateTime;\n  deletedAt_gt?: DateTime;\n  deletedAt_gte?: DateTime;\n  lastLogin?: DateTime;\n  lastLogin_not?: DateTime;\n  lastLogin_in?: DateTime[] | DateTime;\n  lastLogin_not_in?: DateTime[] | DateTime;\n  lastLogin_lt?: DateTime;\n  lastLogin_lte?: DateTime;\n  lastLogin_gt?: DateTime;\n  lastLogin_gte?: DateTime;\n  joinedAt?: DateTime;\n  joinedAt_not?: DateTime;\n  joinedAt_in?: DateTime[] | DateTime;\n  joinedAt_not_in?: DateTime[] | DateTime;\n  joinedAt_lt?: DateTime;\n  joinedAt_lte?: DateTime;\n  joinedAt_gt?: DateTime;\n  joinedAt_gte?: DateTime;\n  isSuper?: Boolean;\n  isSuper_not?: Boolean;\n}\n\n/*\n * An object with an ID\n\n */\nexport interface Node {\n  id: ID_Output;\n}\n\n/*\n * Information about pagination in a connection.\n\n */\nexport interface PageInfo {\n  hasNextPage: Boolean;\n  hasPreviousPage: Boolean;\n  startCursor?: String;\n  endCursor?: String;\n}\n\nexport interface UserPreviousValues {\n  id: ID_Output;\n  email: String;\n  password: String;\n  name: String;\n  inviteToken?: String;\n  inviteAccepted: Boolean;\n  emailConfirmed: Boolean;\n  emailConfirmToken?: String;\n  resetToken?: String;\n  resetExpires?: DateTime;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt: DateTime;\n  isSuper: Boolean;\n}\n\nexport interface User extends Node {\n  id: ID_Output;\n  email: String;\n  password: String;\n  name: String;\n  inviteToken?: String;\n  inviteAccepted: Boolean;\n  emailConfirmed: Boolean;\n  emailConfirmToken?: String;\n  resetToken?: String;\n  resetExpires?: DateTime;\n  deletedAt?: DateTime;\n  lastLogin?: DateTime;\n  joinedAt: DateTime;\n  isSuper: Boolean;\n}\n\n/*\n * An edge in a connection.\n\n */\nexport interface UserEdge {\n  node: User;\n  cursor: String;\n}\n\n/*\n * A connection to a list of items.\n\n */\nexport interface UserConnection {\n  pageInfo: PageInfo;\n  edges: UserEdge[];\n  aggregate: AggregateUser;\n}\n\nexport interface UserSubscriptionPayload {\n  mutation: MutationType;\n  node?: User;\n  updatedFields?: String[];\n  previousValues?: UserPreviousValues;\n}\n\nexport interface AggregateUser {\n  count: Int;\n}\n\nexport interface BatchPayload {\n  count: Long;\n}\n\nexport type DateTime = Date | string;\n\n/*\nThe `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.\n*/\nexport type ID_Input = string | number;\nexport type ID_Output = string;\n\n/*\nThe `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.\n*/\nexport type Int = number;\n\n/*\nThe `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.\n*/\nexport type String = string;\n\n/*\nThe `Boolean` scalar type represents `true` or `false`.\n*/\nexport type Boolean = boolean;\n\n/*\nThe `Long` scalar type represents non-fractional signed whole numeric values.\nLong can represent values between -(2^63) and 2^63 - 1.\n*/\nexport type Long = string;\n"
  },
  {
    "path": "packages/graphql-authentication-prisma/src/index.ts",
    "content": "export { forwardTo } from './utils';\nexport { GraphqlAuthenticationPrismaAdapter } from './Prisma';\n"
  },
  {
    "path": "packages/graphql-authentication-prisma/src/utils.ts",
    "content": "import { forwardTo as pForwardTo } from 'prisma-binding';\nimport { getUserId, Context } from 'graphql-authentication';\n\n/**\n * @deprecated Use prisma-binding's forwardTo('db') method instead in combination with graphql-shield to handle permissions.\n */\nexport function forwardTo({\n  unauthorized,\n  bindingName\n}: {\n  unauthorized?: boolean;\n  bindingName?: string;\n}) {\n  return (parent: any, args: any, ctx: Context, info: any) => {\n    if (!unauthorized) {\n      getUserId(ctx);\n    }\n    return pForwardTo(bindingName || 'db')(parent, args, ctx, info);\n  };\n}\n"
  },
  {
    "path": "packages/graphql-authentication-prisma/tsconfig.build.json",
    "content": "{\n  \"extends\": \"../../tsconfig.base.json\",\n  \"compilerOptions\": {\n    \"rootDir\": \"src\",\n    \"outDir\": \"dist\"\n  },\n  \"include\": [\"src/index.ts\"]\n}\n"
  },
  {
    "path": "packages/graphql-authentication-prisma/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\"\n}\n"
  },
  {
    "path": "tsconfig.base.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2017\",\n    \"module\": \"commonjs\",\n    \"declaration\": true,\n    \"lib\": [\"esnext\"],\n    \"strict\": true,\n    // Disabled because this doesn't work correctly with \"declaration\": true\n    \"noUnusedLocals\": false,\n    \"strictFunctionTypes\": false,\n    \"noImplicitAny\": false,\n    \"forceConsistentCasingInFileNames\": true\n  }\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"extends\": \"./tsconfig.base.json\",\n  \"compilerOptions\": {\n    \"baseUrl\": \"./packages\",\n    \"paths\": {\n      \"graphql-authentication\": [\"./graphql-authentication/src\"]\n    }\n  }\n}\n"
  },
  {
    "path": "tslint.json",
    "content": "{\n  \"extends\": \"@volst/tslint-config\"\n}\n"
  }
]