@cedarjs/auth-supabase-api 9.0.0-canary.1784 → 9.0.0-canary.3124

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.
package/dist/decoder.js CHANGED
@@ -1,41 +1,8 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var decoder_exports = {};
30
- __export(decoder_exports, {
31
- authDecoder: () => authDecoder,
32
- messageForSupabaseSettingsError: () => messageForSupabaseSettingsError,
33
- throwSupabaseSettingsError: () => throwSupabaseSettingsError
34
- });
35
- module.exports = __toCommonJS(decoder_exports);
36
- var import_ssr = require("@supabase/ssr");
37
- var import_jsonwebtoken = __toESM(require("jsonwebtoken"));
38
- var import_api = require("@cedarjs/api");
1
+ import { createServerClient } from "@supabase/ssr";
2
+ import jwt from "jsonwebtoken";
3
+ import {
4
+ parseAuthorizationCookie
5
+ } from "@cedarjs/api";
39
6
  const ERROR_MESSAGE = `Your project's URL, Key and Secret are required to create a Supabase client!
40
7
 
41
8
  Check your Supabase project's API settings to find these values
@@ -54,7 +21,7 @@ const createSupabaseServerClient = (authCookies) => {
54
21
  if (!process.env.SUPABASE_KEY) {
55
22
  throwSupabaseSettingsError("SUPABASE_KEY");
56
23
  }
57
- return (0, import_ssr.createServerClient)(
24
+ return createServerClient(
58
25
  process.env.SUPABASE_URL || "",
59
26
  process.env.SUPABASE_KEY || "",
60
27
  {
@@ -88,20 +55,19 @@ const authDecoder = async (token, type, { event }) => {
88
55
  if (type !== "supabase") {
89
56
  return null;
90
57
  }
91
- const authCookies = (0, import_api.parseAuthorizationCookie)(event);
58
+ const authCookies = parseAuthorizationCookie(event);
92
59
  if (authCookies?.type === "supabase") {
93
60
  token = await getSupabaseAccessTokenFromCookie(authCookies);
94
61
  }
95
62
  try {
96
- return import_jsonwebtoken.default.verify(token, secret);
63
+ return jwt.verify(token, secret);
97
64
  } catch (error) {
98
65
  console.error(error);
99
66
  throw error;
100
67
  }
101
68
  };
102
- // Annotate the CommonJS export names for ESM import in node:
103
- 0 && (module.exports = {
69
+ export {
104
70
  authDecoder,
105
71
  messageForSupabaseSettingsError,
106
72
  throwSupabaseSettingsError
107
- });
73
+ };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { authDecoder, throwSupabaseSettingsError } from './decoder';
1
+ export { authDecoder, throwSupabaseSettingsError } from './decoder.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
package/dist/index.js CHANGED
@@ -1,30 +1,5 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var src_exports = {};
20
- __export(src_exports, {
21
- authDecoder: () => import_decoder.authDecoder,
22
- throwSupabaseSettingsError: () => import_decoder.throwSupabaseSettingsError
23
- });
24
- module.exports = __toCommonJS(src_exports);
25
- var import_decoder = require("./decoder");
26
- // Annotate the CommonJS export names for ESM import in node:
27
- 0 && (module.exports = {
1
+ import { authDecoder, throwSupabaseSettingsError } from "./decoder.js";
2
+ export {
28
3
  authDecoder,
29
4
  throwSupabaseSettingsError
30
- });
5
+ };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@cedarjs/auth-supabase-api",
3
- "version": "9.0.0-canary.1784+baa47810a",
3
+ "version": "9.0.0-canary.3124",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
7
7
  "directory": "packages/auth-providers/supabase/api"
8
8
  },
9
9
  "license": "MIT",
10
- "type": "commonjs",
10
+ "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
13
  "default": {
@@ -28,34 +28,35 @@
28
28
  "dist"
29
29
  ],
30
30
  "scripts": {
31
- "build": "tsx ./build.mts && yarn build:types",
31
+ "build": "node ./build.mts",
32
32
  "build:pack": "yarn pack -o cedarjs-auth-supabase-api.tgz",
33
- "build:types": "tsc --build --verbose ./tsconfig.json",
33
+ "build:types": "tsc --build --verbose ./tsconfig.build.json",
34
34
  "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"",
35
- "check:attw": "yarn attw -P",
35
+ "check:attw": "yarn cedar-fwtools-attw",
36
36
  "check:package": "concurrently npm:check:attw yarn:publint",
37
37
  "prepublishOnly": "NODE_ENV=production yarn build",
38
38
  "test": "vitest run",
39
39
  "test:watch": "vitest watch"
40
40
  },
41
41
  "dependencies": {
42
- "@cedarjs/api": "9.0.0-canary.1784",
43
- "@supabase/ssr": "0.8.0",
42
+ "@cedarjs/api": "9.0.0-canary.3124",
43
+ "@supabase/ssr": "0.12.5",
44
44
  "jsonwebtoken": "9.0.3"
45
45
  },
46
46
  "devDependencies": {
47
- "@arethetypeswrong/cli": "0.18.2",
48
- "@cedarjs/framework-tools": "9.0.0-canary.1784",
49
- "@types/aws-lambda": "8.10.160",
47
+ "@cedarjs/framework-tools": "9.0.0-canary.3124",
48
+ "@types/aws-lambda": "8.10.163",
50
49
  "@types/jsonwebtoken": "9.0.10",
51
- "concurrently": "9.2.1",
52
- "publint": "0.3.17",
53
- "tsx": "4.21.0",
50
+ "concurrently": "9.2.4",
51
+ "publint": "0.3.24",
54
52
  "typescript": "5.9.3",
55
- "vitest": "3.2.4"
53
+ "vitest": "4.1.11"
54
+ },
55
+ "engines": {
56
+ "node": ">=24"
56
57
  },
57
58
  "publishConfig": {
58
59
  "access": "public"
59
60
  },
60
- "gitHead": "baa47810a7defb73de27fdf513b815d679509b5e"
61
+ "gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
61
62
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Cedar
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.