@slashid/remix 0.1.1

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.
@@ -0,0 +1,11 @@
1
+ import { LoaderFunctionArgs } from "@remix-run/server-runtime";
2
+ import { RootAuthLoaderCallback } from "./callback";
3
+ type RootLoaderSlashIDContext = {
4
+ baseApiUrl: string;
5
+ sdkUrl: string;
6
+ analyticsEnabled?: boolean;
7
+ oid: string;
8
+ };
9
+ export declare const rootLoader: (context: RootLoaderSlashIDContext) => <T extends RootAuthLoaderCallback>(callback?: T) => (args: LoaderFunctionArgs) => Promise<ReturnType<T>>;
10
+ export {};
11
+ //# sourceMappingURL=root-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-loader.d.ts","sourceRoot":"","sources":["../src/root-loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAU/D,OAAO,EAAE,sBAAsB,EAAqB,MAAM,YAAY,CAAC;AAIvE,KAAK,wBAAwB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAIF,eAAO,MAAM,UAAU,YACX,wBAAwB,gEAErB,kBAAkB,2BA4D9B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { RemixSlashIDProviderOptions } from "./slashid-provider";
2
+ import { LoaderFunctionArgs, type LoaderFunction } from "@remix-run/server-runtime";
3
+ type SlashIDAppOptions = Omit<RemixSlashIDProviderOptions, "children" | "initialToken">;
4
+ export declare const createSlashIDApp: (options: SlashIDAppOptions) => {
5
+ SlashIDApp: ({ children }: any) => import("react/jsx-runtime").JSX.Element;
6
+ slashIDRootLoader: <T extends import("./callback").RootAuthLoaderCallback>(callback?: T) => (args: LoaderFunctionArgs) => Promise<ReturnType<T>>;
7
+ slashIDLoader: (loader: LoaderFunction) => (args: LoaderFunctionArgs) => ({} | Response | null) | Promise<{} | Response | null>;
8
+ };
9
+ export {};
10
+ //# sourceMappingURL=slashid-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slashid-app.d.ts","sourceRoot":"","sources":["../src/slashid-app.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAE5B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,kBAAkB,EAClB,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAInC,KAAK,iBAAiB,GAAG,IAAI,CAC3B,2BAA2B,EAC3B,UAAU,GAAG,cAAc,CAC5B,CAAC;AAyBF,eAAO,MAAM,gBAAgB,YAAa,iBAAiB;+BAOvB,GAAG;;4BAe1B,cAAc,YAAY,kBAAkB;CAyBxD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { SlashIDProviderProps } from "@slashid/react";
2
+ export type RemixSlashIDProviderOptions = Omit<SlashIDProviderProps, "tokenStorage">;
3
+ export declare const SlashIDProvider: ({ children, ...props }: RemixSlashIDProviderOptions) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=slashid-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slashid-provider.d.ts","sourceRoot":"","sources":["../src/slashid-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,oBAAoB,EAGrB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,oBAAoB,EACpB,cAAc,CACf,CAAC;AAkEF,eAAO,MAAM,eAAe,2BAGzB,2BAA2B,4CAmB7B,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare global {
2
+ const __REACT_FORM_STYLES__: string;
3
+ }
4
+ export declare const Styles: () => import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,qBAAqB,EAAE,MAAM,CAAC;CACrC;AAED,eAAO,MAAM,MAAM,+CAElB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type UseSlashID } from "@slashid/react";
2
+ export declare const useSlashID: () => UseSlashID;
3
+ //# sourceMappingURL=use-slash-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-slash-id.d.ts","sourceRoot":"","sources":["../src/use-slash-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAiC,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEhF,eAAO,MAAM,UAAU,QAAO,UAY7B,CAAC"}
package/dist/util.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { LoaderFunctionArgs, type defer } from "@remix-run/server-runtime";
2
+ import { RootAuthLoaderCallbackReturn } from "./callback";
3
+ import { SSR } from "@slashid/slashid";
4
+ export declare const addSlashIdToResponse: <T extends (...args: any) => any>(response: Response, slashid: {
5
+ slashid?: string | undefined;
6
+ }) => Promise<ReturnType<T & {
7
+ slashid?: string | undefined;
8
+ }>>;
9
+ export declare const addSlashIdToDeferredResponse: <T extends (...args: any) => any>(response: ReturnType<typeof defer>, slashid: {
10
+ slashid?: string | undefined;
11
+ }) => Promise<ReturnType<T & {
12
+ slashid?: string | undefined;
13
+ }>>;
14
+ export declare function assertCallbackResult(callbackReturn: any): asserts callbackReturn is Record<string, unknown> | null;
15
+ export declare const getUserTokenFromCookies: (cookies: string | null) => string | undefined;
16
+ type BaseUser = typeof SSR.User;
17
+ /**
18
+ * Use this function in a loader to check if the user is authenticated.
19
+ * @param request
20
+ * @returns
21
+ */
22
+ export declare const getUser: (args: LoaderFunctionArgs) => BaseUser | undefined;
23
+ export declare const isResponse: (callback: Awaited<RootAuthLoaderCallbackReturn>) => callback is Response;
24
+ export declare const isRedirect: ({ status }: Response) => boolean;
25
+ export {};
26
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,KAAK,KAAK,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,eAAO,MAAM,oBAAoB,uBAA8B,GAAG,KAAK,GAAG,YAC9D,QAAQ;;;;GAWnB,CAAC;AAEF,eAAO,MAAM,4BAA4B,uBACnB,GAAG,KAAK,GAAG,YAErB,WAAW,YAAY,CAAC;;;;GAMnC,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,GAAG,GAClB,OAAO,CAAC,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAO1D;AAED,eAAO,MAAM,uBAAuB,YACzB,MAAM,GAAG,IAAI,KACrB,MAAM,GAAG,SAsBX,CAAC;AAEF,KAAK,QAAQ,GAAG,OAAO,GAAG,CAAC,IAAI,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,OAAO,SAAU,kBAAkB,KAAG,QAAQ,GAAG,SAI7D,CAAC;AAEF,eAAO,MAAM,UAAU,aACX,QAAQ,4BAA4B,CAAC,yBAShD,CAAC;AAEF,eAAO,MAAM,UAAU,eAAgB,QAAQ,KAAG,OAEjD,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const verifyToken: ({ token, baseApiUrl, oid, }: {
2
+ token?: string | undefined;
3
+ baseApiUrl: string;
4
+ oid: string;
5
+ }) => Promise<undefined>;
6
+ //# sourceMappingURL=verify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW;;gBAMV,MAAM;SACb,MAAM;wBAkBZ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@slashid/remix",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "main": "dist/main.js",
6
+ "module": "dist/main.js",
7
+ "dependencies": {
8
+ "@slashid/react": "^1.17.0",
9
+ "@slashid/slashid": "^3.17.1",
10
+ "jose": "^5.2.0",
11
+ "url-join": "^5.0.0"
12
+ },
13
+ "devDependencies": {
14
+ "@remix-run/react": "^2.3.1",
15
+ "@remix-run/server-runtime": "^2.3.1",
16
+ "@types/react": "^18.2.42",
17
+ "@types/react-dom": "^18.2.17",
18
+ "@vitejs/plugin-react": "^4.2.1",
19
+ "react": "^18.2.0",
20
+ "react-dom": "^18.2.0",
21
+ "tsconfig": "workspace:*",
22
+ "vite": "^5.0.7"
23
+ },
24
+ "peerDependencies": {
25
+ "@remix-run/react": "^2.0.0",
26
+ "@remix-run/server-runtime": "^2.0.0",
27
+ "react": ">=18",
28
+ "react-dom": ">=18"
29
+ },
30
+ "scripts": {
31
+ "build": "vite build && tsc"
32
+ },
33
+ "exports": {
34
+ ".": {
35
+ "import": "./dist/main.js"
36
+ },
37
+ "./style.css": "./dist/style.css"
38
+ },
39
+ "files": [
40
+ "dist/*"
41
+ ]
42
+ }