@remixhq/core 0.1.2
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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/api.d.ts +494 -0
- package/dist/api.js +7 -0
- package/dist/auth.d.ts +27 -0
- package/dist/auth.js +15 -0
- package/dist/binding.d.ts +16 -0
- package/dist/binding.js +11 -0
- package/dist/chunk-2WGZS7CD.js +0 -0
- package/dist/chunk-34WDQCPF.js +242 -0
- package/dist/chunk-4OCNZHHR.js +0 -0
- package/dist/chunk-54CBEP2W.js +570 -0
- package/dist/chunk-55K5GHAZ.js +252 -0
- package/dist/chunk-5H5CZKGN.js +691 -0
- package/dist/chunk-5NTOJXEZ.js +223 -0
- package/dist/chunk-7WUKH3ZD.js +221 -0
- package/dist/chunk-AE2HPMUZ.js +80 -0
- package/dist/chunk-AEAOYVIL.js +200 -0
- package/dist/chunk-BJFCN2C3.js +46 -0
- package/dist/chunk-DCU3646I.js +12 -0
- package/dist/chunk-DEWAIK5X.js +11 -0
- package/dist/chunk-DRD6EVTT.js +447 -0
- package/dist/chunk-E4KAGBU7.js +134 -0
- package/dist/chunk-EF3677RE.js +93 -0
- package/dist/chunk-EVWDYCBL.js +223 -0
- package/dist/chunk-FAZUMWBS.js +93 -0
- package/dist/chunk-GC2MOT3U.js +12 -0
- package/dist/chunk-GFOBGYW4.js +252 -0
- package/dist/chunk-INDDXWAH.js +92 -0
- package/dist/chunk-K57ZFDGC.js +15 -0
- package/dist/chunk-NDA7EJJA.js +286 -0
- package/dist/chunk-NK2DA4X6.js +357 -0
- package/dist/chunk-OJMTW22J.js +286 -0
- package/dist/chunk-OMUDRPUI.js +195 -0
- package/dist/chunk-ONKKRS2C.js +239 -0
- package/dist/chunk-OWFBBWU7.js +196 -0
- package/dist/chunk-P7EM3N73.js +46 -0
- package/dist/chunk-PR5QKMHM.js +46 -0
- package/dist/chunk-RIP2MIZL.js +710 -0
- package/dist/chunk-TQHLFQY4.js +448 -0
- package/dist/chunk-TY3SSQQK.js +688 -0
- package/dist/chunk-UGKPOCN5.js +710 -0
- package/dist/chunk-VM3CGCNX.js +46 -0
- package/dist/chunk-XOQIADCH.js +223 -0
- package/dist/chunk-YZ34ICNN.js +17 -0
- package/dist/chunk-ZBMOGUSJ.js +17 -0
- package/dist/collab.d.ts +680 -0
- package/dist/collab.js +1917 -0
- package/dist/config.d.ts +22 -0
- package/dist/config.js +9 -0
- package/dist/errors.d.ts +21 -0
- package/dist/errors.js +12 -0
- package/dist/index.cjs +1269 -0
- package/dist/index.d.cts +482 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +34 -0
- package/dist/repo.d.ts +66 -0
- package/dist/repo.js +62 -0
- package/dist/tokenProvider-BWTusyj4.d.ts +63 -0
- package/package.json +72 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { CoreConfig } from './config.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
declare const storedSessionSchema: z.ZodObject<{
|
|
5
|
+
access_token: z.ZodString;
|
|
6
|
+
refresh_token: z.ZodString;
|
|
7
|
+
expires_at: z.ZodNumber;
|
|
8
|
+
token_type: z.ZodOptional<z.ZodString>;
|
|
9
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
id: string;
|
|
14
|
+
email?: string | null | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
id: string;
|
|
17
|
+
email?: string | null | undefined;
|
|
18
|
+
}>>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
access_token: string;
|
|
21
|
+
refresh_token: string;
|
|
22
|
+
expires_at: number;
|
|
23
|
+
token_type?: string | undefined;
|
|
24
|
+
user?: {
|
|
25
|
+
id: string;
|
|
26
|
+
email?: string | null | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
access_token: string;
|
|
30
|
+
refresh_token: string;
|
|
31
|
+
expires_at: number;
|
|
32
|
+
token_type?: string | undefined;
|
|
33
|
+
user?: {
|
|
34
|
+
id: string;
|
|
35
|
+
email?: string | null | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
type StoredSession = z.infer<typeof storedSessionSchema>;
|
|
39
|
+
type SessionStore = {
|
|
40
|
+
getSession(): Promise<StoredSession | null>;
|
|
41
|
+
setSession(session: StoredSession): Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
type RefreshStoredSession = (params: {
|
|
45
|
+
config: CoreConfig;
|
|
46
|
+
session: StoredSession;
|
|
47
|
+
}) => Promise<StoredSession>;
|
|
48
|
+
type ResolvedAuthToken = {
|
|
49
|
+
token: string;
|
|
50
|
+
session: StoredSession | null;
|
|
51
|
+
fromEnv: boolean;
|
|
52
|
+
};
|
|
53
|
+
type TokenProvider = (opts?: {
|
|
54
|
+
forceRefresh?: boolean;
|
|
55
|
+
}) => Promise<ResolvedAuthToken>;
|
|
56
|
+
declare function shouldRefreshSoon(session: StoredSession, skewSeconds?: number): boolean;
|
|
57
|
+
declare function createStoredSessionTokenProvider(params: {
|
|
58
|
+
config: CoreConfig;
|
|
59
|
+
sessionStore: SessionStore;
|
|
60
|
+
refreshStoredSession: RefreshStoredSession;
|
|
61
|
+
}): TokenProvider;
|
|
62
|
+
|
|
63
|
+
export { type RefreshStoredSession as R, type SessionStore as S, type TokenProvider as T, type StoredSession as a, storedSessionSchema as b, createStoredSessionTokenProvider as c, type ResolvedAuthToken as d, shouldRefreshSoon as s };
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@remixhq/core",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Remix core library",
|
|
5
|
+
"homepage": "https://github.com/RemixDotOne/remix-core",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/RemixDotOne/remix-core.git"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=20"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./api": {
|
|
26
|
+
"types": "./dist/api.d.ts",
|
|
27
|
+
"import": "./dist/api.js"
|
|
28
|
+
},
|
|
29
|
+
"./auth": {
|
|
30
|
+
"types": "./dist/auth.d.ts",
|
|
31
|
+
"import": "./dist/auth.js"
|
|
32
|
+
},
|
|
33
|
+
"./binding": {
|
|
34
|
+
"types": "./dist/binding.d.ts",
|
|
35
|
+
"import": "./dist/binding.js"
|
|
36
|
+
},
|
|
37
|
+
"./collab": {
|
|
38
|
+
"types": "./dist/collab.d.ts",
|
|
39
|
+
"import": "./dist/collab.js"
|
|
40
|
+
},
|
|
41
|
+
"./config": {
|
|
42
|
+
"types": "./dist/config.d.ts",
|
|
43
|
+
"import": "./dist/config.js"
|
|
44
|
+
},
|
|
45
|
+
"./errors": {
|
|
46
|
+
"types": "./dist/errors.d.ts",
|
|
47
|
+
"import": "./dist/errors.js"
|
|
48
|
+
},
|
|
49
|
+
"./repo": {
|
|
50
|
+
"types": "./dist/repo.d.ts",
|
|
51
|
+
"import": "./dist/repo.js"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"dist"
|
|
56
|
+
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsup src/index.ts src/api.ts src/auth.ts src/binding.ts src/collab.ts src/config.ts src/errors.ts src/repo.ts --dts --format esm",
|
|
59
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
60
|
+
"prepack": "npm run build"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@supabase/supabase-js": "^2.57.4",
|
|
64
|
+
"execa": "^9.6.0",
|
|
65
|
+
"zod": "^3.25.76"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "^24.3.0",
|
|
69
|
+
"tsup": "^8.5.0",
|
|
70
|
+
"typescript": "^5.9.2"
|
|
71
|
+
}
|
|
72
|
+
}
|