@cedarjs/auth-supertokens-setup 7.1.0 → 7.1.1-next.469

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAIjC,eAAO,MAAM,OAAO,gBAAgB,CAAA;AACpC,eAAO,MAAM,WAAW,oCAAoC,CAAA;AAE5D,wBAAsB,OAAO,CAAC,KAAK,EAAE,IAAI;;;;IAExC;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,OAAO,CAAA;CACf;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,IAAI,iBAG1C"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAGjC,eAAO,MAAM,OAAO,gBAAgB,CAAA;AACpC,eAAO,MAAM,WAAW,oCAAoC,CAAA;AAE5D,wBAAsB,OAAO,CAAC,KAAK,EAAE,IAAI;;;;IAExC;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,OAAO,CAAA;CACf;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,IAAI,iBAG1C"}
package/dist/setup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { standardAuthBuilder } from "@cedarjs/cli-helpers";
1
+ import { standardAuthBuilder } from "@cedarjs/cli-helpers/auth/setupHelpers";
2
2
  const command = "supertokens";
3
3
  const description = "Set up auth for for SuperTokens";
4
4
  async function builder(yargs) {
@@ -1 +1 @@
1
- {"version":3,"file":"setupHandler.d.ts","sourceRoot":"","sources":["../src/setupHandler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC,wBAAsB,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,IAAI,iBAgCtD;AAGD,eAAO,MAAM,eAAe;;;CAqD3B,CAAA"}
1
+ {"version":3,"file":"setupHandler.d.ts","sourceRoot":"","sources":["../src/setupHandler.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC,wBAAsB,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,IAAI,iBAgCtD;AAGD,eAAO,MAAM,eAAe;;;CAqD3B,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import fs from "node:fs";
2
2
  import path from "path";
3
- import { getPaths, standardAuthHandler } from "@cedarjs/cli-helpers";
3
+ import { standardAuthHandler } from "@cedarjs/cli-helpers/auth/setupHelpers";
4
+ import { getPaths } from "@cedarjs/cli-helpers/paths";
4
5
  async function handler({ force: forceArg }) {
5
6
  const { version } = JSON.parse(
6
7
  fs.readFileSync(
@@ -1,3 +1,4 @@
1
+ import type { AuthContextPayload, Decoded } from '@cedarjs/api'
1
2
  import { parseJWT } from '@cedarjs/api'
2
3
  import { AuthenticationError, ForbiddenError } from '@cedarjs/graphql-server'
3
4
 
@@ -28,12 +29,12 @@ type RedwoodUser = Record<string, unknown> & { roles?: string[] }
28
29
  * @returns RedwoodUser
29
30
  */
30
31
  export const getCurrentUser = async (
31
- decoded,
32
+ decoded: Decoded,
32
33
  /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */
33
- { token, type },
34
+ { token, type }: AuthContextPayload[1],
34
35
  /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */
35
- { event, context }
36
- ): Promise<RedwoodUser> => {
36
+ { event, context }: Partial<AuthContextPayload[2]> = {}
37
+ ): Promise<RedwoodUser | null> => {
37
38
  if (!decoded) {
38
39
  return null
39
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/auth-supertokens-setup",
3
- "version": "7.1.0",
3
+ "version": "7.1.1-next.469",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
@@ -39,14 +39,14 @@
39
39
  "test:watch": "vitest watch"
40
40
  },
41
41
  "dependencies": {
42
- "@cedarjs/cli-helpers": "7.1.0"
42
+ "@cedarjs/cli-helpers": "7.1.1-next.469"
43
43
  },
44
44
  "devDependencies": {
45
- "@cedarjs/framework-tools": "7.1.0",
45
+ "@cedarjs/framework-tools": "7.1.1-next.469",
46
46
  "@types/yargs": "17.0.35",
47
- "concurrently": "9.2.4",
48
- "memfs": "4.78.1",
49
- "publint": "0.3.24",
47
+ "concurrently": "9.2.5",
48
+ "memfs": "4.80.0",
49
+ "publint": "0.3.25",
50
50
  "typescript": "5.9.3",
51
51
  "vitest": "4.1.11"
52
52
  },