@hammadj/better-auth-scim 1.5.0-beta.9

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,84 @@
1
+
2
+ > @hammadj/better-auth-scim@1.5.0-beta.9 build /Users/hammadjutt/Dev/better-auth-fork/packages/scim
3
+ > tsdown
4
+
5
+ β„Ή tsdown v0.20.1 powered by rolldown v1.0.0-rc.1
6
+ β„Ή config file: /Users/hammadjutt/Dev/better-auth-fork/packages/scim/tsdown.config.ts
7
+ β„Ή entry: src/index.ts, src/client.ts
8
+ β„Ή tsconfig: tsconfig.json
9
+ β„Ή Build start
10
+ β„Ή Cleaning 5 files
11
+ β„Ή dist/index.mjs 39.36 kB β”‚ gzip: 8.03 kB
12
+ β„Ή dist/client.mjs  0.19 kB β”‚ gzip: 0.17 kB
13
+ β„Ή dist/index.mjs.map 78.19 kB β”‚ gzip: 15.15 kB
14
+ β„Ή dist/client.mjs.map  0.46 kB β”‚ gzip: 0.30 kB
15
+ β„Ή dist/index.d.mts  1.81 kB β”‚ gzip: 0.71 kB
16
+ β„Ή dist/client.d.mts  0.15 kB β”‚ gzip: 0.14 kB
17
+ β„Ή 6 files, total: 120.15 kB
18
+ src/middlewares.ts (2:37) [UNRESOLVED_IMPORT] Warning: Could not resolve 'better-auth/plugins' in src/middlewares.ts
19
+ β•­─[ src/middlewares.ts:2:38 ]
20
+ β”‚
21
+ 2 β”‚ import { createAuthMiddleware } from "better-auth/plugins";
22
+  β”‚ ──────────┬──────────
23
+  β”‚ ╰──────────── Module not found, treating it as an external dependency
24
+ ───╯
25
+
26
+ src/routes.ts (3:30) [UNRESOLVED_IMPORT] Warning: Could not resolve 'better-auth' in src/routes.ts
27
+ β•­─[ src/routes.ts:3:31 ]
28
+ β”‚
29
+ 3 β”‚ import { HIDE_METADATA } from "better-auth";
30
+  β”‚ ──────┬──────
31
+  β”‚ ╰──────── Module not found, treating it as an external dependency
32
+ ───╯
33
+
34
+ src/routes.ts (4:44) [UNRESOLVED_IMPORT] Warning: Could not resolve 'better-auth/api' in src/routes.ts
35
+ β•­─[ src/routes.ts:4:45 ]
36
+ β”‚
37
+ 4 β”‚ import { APIError, sessionMiddleware } from "better-auth/api";
38
+  β”‚ ────────┬────────
39
+  β”‚ ╰────────── Module not found, treating it as an external dependency
40
+ ───╯
41
+
42
+ src/routes.ts (5:37) [UNRESOLVED_IMPORT] Warning: Could not resolve 'better-auth/crypto' in src/routes.ts
43
+ β•­─[ src/routes.ts:5:38 ]
44
+ β”‚
45
+ 5 β”‚ import { generateRandomString } from "better-auth/crypto";
46
+  β”‚ ──────────┬─────────
47
+  β”‚ ╰─────────── Module not found, treating it as an external dependency
48
+ ───╯
49
+
50
+ src/routes.ts (7:35) [UNRESOLVED_IMPORT] Warning: Could not resolve 'better-auth/plugins' in src/routes.ts
51
+ β•­─[ src/routes.ts:7:36 ]
52
+ β”‚
53
+ 7 β”‚ import { createAuthEndpoint } from "better-auth/plugins";
54
+  β”‚ ──────────┬──────────
55
+  β”‚ ╰──────────── Module not found, treating it as an external dependency
56
+ ───╯
57
+
58
+ src/scim-tokens.ts (2:51) [UNRESOLVED_IMPORT] Warning: Could not resolve 'better-auth/crypto' in src/scim-tokens.ts
59
+ β•­─[ src/scim-tokens.ts:2:52 ]
60
+ β”‚
61
+ 2 β”‚ import { symmetricDecrypt, symmetricEncrypt } from "better-auth/crypto";
62
+  β”‚ ──────────┬─────────
63
+  β”‚ ╰─────────── Module not found, treating it as an external dependency
64
+ ───╯
65
+
66
+ src/scim-tokens.ts (3:33) [UNRESOLVED_IMPORT] Warning: Could not resolve 'better-auth/plugins' in src/scim-tokens.ts
67
+ β•­─[ src/scim-tokens.ts:3:34 ]
68
+ β”‚
69
+ 3 β”‚ import { defaultKeyHasher } from "better-auth/plugins";
70
+  β”‚ ──────────┬──────────
71
+  β”‚ ╰──────────── Module not found, treating it as an external dependency
72
+ ───╯
73
+
74
+ src/scim-error.ts (2:25) [UNRESOLVED_IMPORT] Warning: Could not resolve 'better-auth' in src/scim-error.ts
75
+ β•­─[ src/scim-error.ts:2:26 ]
76
+ β”‚
77
+ 2 β”‚ import { APIError } from "better-auth";
78
+  β”‚ ──────┬──────
79
+  β”‚ ╰──────── Module not found, treating it as an external dependency
80
+ ───╯
81
+
82
+ [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
83
+
84
+ βœ” Build complete in 3932ms
package/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) 2024 - present, Bereket Engida
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the β€œSoftware”), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ the Software, and to permit persons to whom the Software is furnished to do so,
9
+ subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED β€œAS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
+ DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,5 @@
1
+ //#region src/client.d.ts
2
+ declare const scimClient: () => BetterAuthClientPlugin;
3
+ //#endregion
4
+ export { scimClient };
5
+ //# sourceMappingURL=client.d.mts.map
@@ -0,0 +1,11 @@
1
+ //#region src/client.ts
2
+ const scimClient = () => {
3
+ return {
4
+ id: "scim-client",
5
+ $InferServerPlugin: {}
6
+ };
7
+ };
8
+
9
+ //#endregion
10
+ export { scimClient };
11
+ //# sourceMappingURL=client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterAuthClientPlugin } from \"better-auth/client\";\nimport type { scim } from \"./index\";\n\nexport const scimClient = () => {\n\treturn {\n\t\tid: \"scim-client\",\n\t\t$InferServerPlugin: {} as ReturnType<typeof scim>,\n\t} satisfies BetterAuthClientPlugin;\n};\n"],"mappings":";AAGA,MAAa,mBAAmB;AAC/B,QAAO;EACN,IAAI;EACJ,oBAAoB,EAAE;EACtB"}
@@ -0,0 +1,77 @@
1
+ import { Member } from "better-auth/plugins";
2
+ import { User } from "better-auth";
3
+
4
+ //#region src/types.d.ts
5
+ interface SCIMProvider {
6
+ id: string;
7
+ providerId: string;
8
+ scimToken: string;
9
+ organizationId?: string;
10
+ }
11
+ type SCIMName = {
12
+ formatted?: string;
13
+ givenName?: string;
14
+ familyName?: string;
15
+ };
16
+ type SCIMEmail = {
17
+ value?: string;
18
+ primary?: boolean;
19
+ };
20
+ type SCIMOptions = {
21
+ /**
22
+ * Default list of SCIM providers for testing
23
+ * These will take precedence over the database when present
24
+ */
25
+ defaultSCIM?: Omit<SCIMProvider, "id">[];
26
+ /**
27
+ * A callback that runs before a new SCIM token is generated.
28
+ * @returns
29
+ */
30
+ beforeSCIMTokenGenerated?: ({
31
+ user,
32
+ member,
33
+ scimToken
34
+ }: {
35
+ user: User;
36
+ member?: Member | null;
37
+ scimToken: string;
38
+ }) => Promise<void>;
39
+ /**
40
+ * A callback that runs before a new SCIM token is generated
41
+ * @returns
42
+ */
43
+ afterSCIMTokenGenerated?: ({
44
+ user,
45
+ member,
46
+ scimProvider
47
+ }: {
48
+ user: User;
49
+ member?: Member | null;
50
+ scimToken: string;
51
+ scimProvider: SCIMProvider;
52
+ }) => Promise<void>;
53
+ /**
54
+ * Store the SCIM token in your database in a secure way
55
+ *
56
+ * @default "plain"
57
+ */
58
+ storeSCIMToken?: ("hashed" | "plain" | "encrypted" | {
59
+ hash: (scimToken: string) => Promise<string>;
60
+ } | {
61
+ encrypt: (scimToken: string) => Promise<string>;
62
+ decrypt: (scimToken: string) => Promise<string>;
63
+ }) | undefined;
64
+ };
65
+ //#endregion
66
+ //#region src/index.d.ts
67
+ declare module "@better-auth/core" {
68
+ interface BetterAuthPluginRegistry<AuthOptions, Options> {
69
+ scim: {
70
+ creator: typeof scim;
71
+ };
72
+ }
73
+ }
74
+ declare const scim: (options?: SCIMOptions) => BetterAuthPlugin;
75
+ //#endregion
76
+ export { SCIMEmail, SCIMName, SCIMOptions, SCIMProvider, scim };
77
+ //# sourceMappingURL=index.d.mts.map