@lobb-js/lobb-ext-auth 0.2.2 → 0.2.3
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/auth.d.ts +13 -0
- package/dist/auth.js +44 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +52 -0
- package/dist/lib/components/pages/loginPage/index.svelte +64 -0
- package/dist/lib/components/pages/loginPage/index.svelte.d.ts +14 -0
- package/dist/lib/components/pages/settings/index.svelte +53 -0
- package/dist/lib/components/pages/settings/index.svelte.d.ts +14 -0
- package/dist/lib/components/pages/settings/pages/activityFeed.svelte +21 -0
- package/dist/lib/components/pages/settings/pages/activityFeed.svelte.d.ts +14 -0
- package/dist/lib/components/pages/settings/pages/rolesAndPermissions.svelte +21 -0
- package/dist/lib/components/pages/settings/pages/rolesAndPermissions.svelte.d.ts +14 -0
- package/dist/lib/components/pages/settings/pages/users.svelte +21 -0
- package/dist/lib/components/pages/settings/pages/users.svelte.d.ts +14 -0
- package/dist/lib/components/pages/userSettings/components/account.svelte +106 -0
- package/dist/lib/components/pages/userSettings/components/account.svelte.d.ts +14 -0
- package/dist/lib/components/pages/userSettings/components/profile.svelte +87 -0
- package/dist/lib/components/pages/userSettings/components/profile.svelte.d.ts +14 -0
- package/dist/lib/components/pages/userSettings/index.svelte +48 -0
- package/dist/lib/components/pages/userSettings/index.svelte.d.ts +14 -0
- package/dist/lib/index.d.ts +0 -0
- package/dist/lib/index.js +2 -0
- package/dist/lib/utils.d.ts +12 -0
- package/dist/lib/utils.js +5 -0
- package/dist/onStartup.d.ts +2 -0
- package/dist/onStartup.js +21 -0
- package/dist/tests/login.spec.d.ts +1 -0
- package/dist/tests/login.spec.js +27 -0
- package/dist/tests/package.json +1 -0
- package/dist/tests/playwright.config.cjs +27 -0
- package/dist/tests/playwright.config.d.cts +2 -0
- package/package.json +6 -2
- package/.vscode/settings.json +0 -5
- package/CHANGELOG.md +0 -149
- package/lobb.ts +0 -108
- package/public/public/vite.svg +0 -1
- package/public/vite.svg +0 -1
- package/scripts/postpublish.sh +0 -12
- package/scripts/prepublish.sh +0 -17
- package/studio/app.html +0 -12
- package/studio/routes/+layout.svelte +0 -7
- package/studio/routes/+layout.ts +0 -1
- package/studio/routes/[...path]/+page.svelte +0 -6
- package/svelte.config.js +0 -24
- package/todo.md +0 -37
- package/tsconfig.app.json +0 -27
- package/tsconfig.json +0 -13
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -8
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ClassValue } from "clsx";
|
|
2
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
+
export type WithoutChild<T> = T extends {
|
|
4
|
+
child?: any;
|
|
5
|
+
} ? Omit<T, "child"> : T;
|
|
6
|
+
export type WithoutChildren<T> = T extends {
|
|
7
|
+
children?: any;
|
|
8
|
+
} ? Omit<T, "children"> : T;
|
|
9
|
+
export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
|
|
10
|
+
export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
|
|
11
|
+
ref?: U | null;
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Auth } from "./auth";
|
|
2
|
+
export async function onStartup(utils) {
|
|
3
|
+
// logout if we got an Unauthorized response
|
|
4
|
+
const auth = new Auth(utils);
|
|
5
|
+
utils.lobb.onResponse(async (response) => {
|
|
6
|
+
if (response.status === 401) {
|
|
7
|
+
const body = await response.json();
|
|
8
|
+
if (body.message === "JWT token has expired" ||
|
|
9
|
+
body.message === "Invalid JWT token") {
|
|
10
|
+
auth.logout();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const session = auth.getSession();
|
|
15
|
+
// if user is logged in
|
|
16
|
+
if (session) {
|
|
17
|
+
utils.ctx.extensions.auth.session = session;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
await auth.logout();
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
const ADMIN_EMAIL = "admin@example.com";
|
|
3
|
+
const ADMIN_PASSWORD = "admin";
|
|
4
|
+
const LOGIN_URL = "/studio/extensions/auth/login_page";
|
|
5
|
+
const STUDIO_URL = "/studio";
|
|
6
|
+
test.describe("Login page", () => {
|
|
7
|
+
test.beforeEach(async ({ page }) => {
|
|
8
|
+
await page.goto(LOGIN_URL);
|
|
9
|
+
});
|
|
10
|
+
test("shows the login form", async ({ page }) => {
|
|
11
|
+
await expect(page.getByText("Welcome back")).toBeVisible();
|
|
12
|
+
await expect(page.getByPlaceholder("email@example.com")).toBeVisible();
|
|
13
|
+
await expect(page.getByPlaceholder("••••••••")).toBeVisible();
|
|
14
|
+
await expect(page.getByRole("button", { name: "Sign In" })).toBeVisible();
|
|
15
|
+
});
|
|
16
|
+
test("logs in with valid credentials and redirects to studio", async ({ page }) => {
|
|
17
|
+
await page.getByPlaceholder("email@example.com").fill(ADMIN_EMAIL);
|
|
18
|
+
await page.getByPlaceholder("••••••••").fill(ADMIN_PASSWORD);
|
|
19
|
+
await page.getByRole("button", { name: "Sign In" }).click();
|
|
20
|
+
await page.waitForURL(STUDIO_URL);
|
|
21
|
+
expect(page.url()).toContain(STUDIO_URL);
|
|
22
|
+
});
|
|
23
|
+
test("shows error toast on empty form submission", async ({ page }) => {
|
|
24
|
+
await page.getByRole("button", { name: "Sign In" }).click();
|
|
25
|
+
await expect(page.getByText("Please complete all fields")).toBeVisible();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "commonjs"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const { defineConfig, devices } = require("@playwright/test");
|
|
2
|
+
|
|
3
|
+
module.exports = defineConfig({
|
|
4
|
+
testDir: __dirname,
|
|
5
|
+
testMatch: "**/*.spec.ts",
|
|
6
|
+
fullyParallel: true,
|
|
7
|
+
retries: 0,
|
|
8
|
+
expect: { timeout: 15000 },
|
|
9
|
+
use: {
|
|
10
|
+
baseURL: "http://localhost:3000",
|
|
11
|
+
trace: "on-first-retry",
|
|
12
|
+
headless: true,
|
|
13
|
+
},
|
|
14
|
+
projects: [
|
|
15
|
+
{
|
|
16
|
+
name: "chromium",
|
|
17
|
+
use: { ...devices["Desktop Chrome"] },
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
// Automatically start the dev server before running tests
|
|
21
|
+
webServer: {
|
|
22
|
+
command: "bun run dev",
|
|
23
|
+
url: "http://localhost:3000/studio",
|
|
24
|
+
reuseExistingServer: true,
|
|
25
|
+
cwd: "../../../../", // packages/auth-ext root
|
|
26
|
+
},
|
|
27
|
+
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobb-js/lobb-ext-auth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"extensions",
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
9
13
|
"exports": {
|
|
10
14
|
".": "./extensions/auth/index.ts",
|
|
11
15
|
"./studio": {
|
|
@@ -34,7 +38,7 @@
|
|
|
34
38
|
"hono": "^4.7.0"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
|
-
"@lobb-js/studio": "^0.7.
|
|
41
|
+
"@lobb-js/studio": "^0.7.3",
|
|
38
42
|
"@lucide/svelte": "^0.563.1",
|
|
39
43
|
"@playwright/test": "^1.58.2",
|
|
40
44
|
"@sveltejs/adapter-node": "^5.5.4",
|
package/.vscode/settings.json
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
|
|
3
|
-
|
|
4
|
-
- - -
|
|
5
|
-
## auth-ext@0.2.2 - 2026-03-28
|
|
6
|
-
#### Bug Fixes
|
|
7
|
-
- update readme to trigger publish - (cf1e896) - malik ben
|
|
8
|
-
- update READMEs to trigger republish of all packages - (2bd145d) - malik ben
|
|
9
|
-
#### Miscellaneous Chores
|
|
10
|
-
- (**version**) 0.26.2 - (1907933) - Cocogitto Bot
|
|
11
|
-
|
|
12
|
-
- - -
|
|
13
|
-
|
|
14
|
-
## auth-ext@0.2.1 - 2026-03-28
|
|
15
|
-
#### Bug Fixes
|
|
16
|
-
- adding readme to all packages - (3a9264a) - malik ben
|
|
17
|
-
#### Miscellaneous Chores
|
|
18
|
-
- add publishConfig and fix ext packages for npm publishing - (49747e9) - malik ben
|
|
19
|
-
|
|
20
|
-
- - -
|
|
21
|
-
|
|
22
|
-
## auth-ext@0.2.0 - 2026-03-28
|
|
23
|
-
#### Features
|
|
24
|
-
- (**auth-ext**) convert studio from Svelte SPA to SvelteKit - (6f24661) - malik ben
|
|
25
|
-
- (**auth-ext**) add Playwright e2e tests for studio login page - (5679c3e) - malik ben
|
|
26
|
-
- (**auth-ext**) auto-discover studio extensions via import.meta.glob - (478c4be) - malik ben
|
|
27
|
-
- (**auth-ext**) enable parallel bun test execution with port/db isolation - (721ee14) - malik ben
|
|
28
|
-
- (**auth-ext**) migrate packages/auth-ext from Deno to Bun - (2ce1866) - malik ben
|
|
29
|
-
- replace hasDashboardExtension with virtual:lobb-studio-extensions module - (437cb2e) - malik ben
|
|
30
|
-
#### Bug Fixes
|
|
31
|
-
- (**auth-ext**) move onStartup.ts to extensions/auth/studio - (af08d43) - malik ben
|
|
32
|
-
- (**studio**) prevent @lobb-js/studio version shadowing in extensions - (cd674b9) - malik ben
|
|
33
|
-
- add /studio subpath exports to ext packages, update studio pages to use them - (c0b9a82) - malik ben
|
|
34
|
-
- untrack .svelte-kit from mindhar, fix process leak and $lib imports, update ai sdk versions - (017f784) - malik ben
|
|
35
|
-
- chaning $lib to relative path - (c6d9e8f) - malik ben
|
|
36
|
-
#### Miscellaneous Chores
|
|
37
|
-
- (**auth-ext**) remove dashboard extension.json reference from auth extension - (27df519) - malik ben
|
|
38
|
-
- (**auth-ext**) move backend tests to extensions/auth/tests and rename scripts - (6ba4a4e) - malik ben
|
|
39
|
-
- (**auth-ext**) split studio into host and extension-specific directories - (6f68493) - malik ben
|
|
40
|
-
- (**auth-ext**) move extension logic from projectExtension to extensions/auth - (e172b74) - malik ben
|
|
41
|
-
- (**auth-ext**) flatten studio into project root and simplify workspace globs - (7a9a873) - malik ben
|
|
42
|
-
- (**auth-ext**) rename studio directory to __studio - (abdaa72) - malik ben
|
|
43
|
-
- (**auth-ext**) clear create_users_collections migration - (cbe5d2a) - malik ben
|
|
44
|
-
- (**version**) 0.25.2 - (a62acb9) - Cocogitto Bot
|
|
45
|
-
- (**version**) 0.25.1 - (afe7e69) - Cocogitto Bot
|
|
46
|
-
- (**version**) 0.25.0 - (77a383c) - Cocogitto Bot
|
|
47
|
-
- (**version**) 0.24.0 - (a8cb605) - Cocogitto Bot
|
|
48
|
-
- (**version**) 0.23.0 - (60f357e) - Cocogitto Bot
|
|
49
|
-
- (**version**) 0.22.0 - (6510e32) - Cocogitto Bot
|
|
50
|
-
- (**version**) 0.21.0 - (c973aa9) - Cocogitto Bot
|
|
51
|
-
- (**version**) 0.20.0 - (06cc303) - Cocogitto Bot
|
|
52
|
-
- (**version**) 0.19.0 - (6bbc900) - Cocogitto Bot
|
|
53
|
-
- (**version**) 0.18.0 - (efc553f) - Cocogitto Bot
|
|
54
|
-
- (**version**) 0.17.0 - (4174f0c) - Cocogitto Bot
|
|
55
|
-
- (**version**) 0.16.0 - (9508655) - Cocogitto Bot
|
|
56
|
-
- (**version**) 0.15.0 - (0c2c345) - Cocogitto Bot
|
|
57
|
-
- (**version**) 0.14.11 - (ad92b61) - Cocogitto Bot
|
|
58
|
-
- add dev:studio/build:studio scripts, fix Dockerfiles, remove --build flag - (1595975) - malik ben
|
|
59
|
-
- add prepublish/postpublish scripts to extension packages for standalone compatibility - (4d6108f) - malik ben
|
|
60
|
-
- centralize studio app.css in @lobb-js/studio package, remove local copies - (05192dc) - malik ben
|
|
61
|
-
- rename @lobb/ scope to @lobb-js/ across all packages and apps - (cce4ce0) - malik ben
|
|
62
|
-
- add start/build scripts and gitignore build dir across all projects - (58f539d) - malik ben
|
|
63
|
-
- update CLAUDE.md to enforce no-commit-without-explicit-instruction rule - (6d63a42) - malik ben
|
|
64
|
-
- replace workspace:* with exact versions in all package.json files - (74fbdb7) - malik ben
|
|
65
|
-
- rename __studio to studio and remove unused studio dirs - (77fb932) - malik ben
|
|
66
|
-
|
|
67
|
-
- - -
|
|
68
|
-
|
|
69
|
-
## auth-ext@0.1.67 - 2026-02-25
|
|
70
|
-
#### Bug Fixes
|
|
71
|
-
- publishing extension again - (e07ac36) - Malik Najjar
|
|
72
|
-
#### Miscellaneous Chores
|
|
73
|
-
- (**version**) 0.14.8 - (0e6c1cb) - Cocogitto Bot
|
|
74
|
-
|
|
75
|
-
- - -
|
|
76
|
-
|
|
77
|
-
## auth-ext@0.1.66 - 2026-02-22
|
|
78
|
-
#### Bug Fixes
|
|
79
|
-
- coggito publishing packages order fix - (573c75e) - malik ben
|
|
80
|
-
|
|
81
|
-
- - -
|
|
82
|
-
|
|
83
|
-
## auth-ext@0.1.65 - 2026-02-22
|
|
84
|
-
#### Bug Fixes
|
|
85
|
-
- adjusted the names of the events - (6543d8c) - malik ben
|
|
86
|
-
|
|
87
|
-
- - -
|
|
88
|
-
|
|
89
|
-
## auth-ext@0.1.64 - 2026-02-22
|
|
90
|
-
#### Bug Fixes
|
|
91
|
-
- made the collectionService become an property in the main lobb object - (146e4cb) - malik ben
|
|
92
|
-
|
|
93
|
-
- - -
|
|
94
|
-
|
|
95
|
-
## auth-ext@0.1.63 - 2026-02-21
|
|
96
|
-
#### Bug Fixes
|
|
97
|
-
- using default export instead of named export for extensions - (37dd485) - malik ben
|
|
98
|
-
#### Miscellaneous Chores
|
|
99
|
-
- (**version**) 0.13.2 - (39b0145) - Cocogitto Bot
|
|
100
|
-
- (**version**) 0.12.3 - (cd06fc0) - Cocogitto Bot
|
|
101
|
-
- (**version**) 0.12.2 - (35b2ff3) - Cocogitto Bot
|
|
102
|
-
- (**version**) 0.12.1 - (c548105) - Cocogitto Bot
|
|
103
|
-
- (**version**) 0.11.1 - (659ebd3) - Cocogitto Bot
|
|
104
|
-
- (**version**) 0.11.0 - (3f4f47e) - Cocogitto Bot
|
|
105
|
-
|
|
106
|
-
- - -
|
|
107
|
-
|
|
108
|
-
## auth-ext@0.1.62 - 2026-02-17
|
|
109
|
-
#### Bug Fixes
|
|
110
|
-
- removing a comment - (15c57c0) - Malik Najjar
|
|
111
|
-
#### Miscellaneous Chores
|
|
112
|
-
- adding a comment - (fde6900) - Malik Najjar
|
|
113
|
-
|
|
114
|
-
- - -
|
|
115
|
-
|
|
116
|
-
## auth-ext@0.1.61 - 2026-02-17
|
|
117
|
-
#### Bug Fixes
|
|
118
|
-
- removeing stupid comment - (ca41782) - Malik Najjar
|
|
119
|
-
#### Miscellaneous Chores
|
|
120
|
-
- (**version**) 0.10.2 - (2c92a7d) - Cocogitto Bot
|
|
121
|
-
- adding comment - (c6cc16d) - Malik Najjar
|
|
122
|
-
|
|
123
|
-
- - -
|
|
124
|
-
|
|
125
|
-
## auth-ext@0.1.60 - 2026-02-17
|
|
126
|
-
#### Bug Fixes
|
|
127
|
-
- update the auth extension - (5318dda) - Malik Najjar
|
|
128
|
-
#### Miscellaneous Chores
|
|
129
|
-
- (**version**) 0.8.0 - (fdee7ca) - Cocogitto Bot
|
|
130
|
-
|
|
131
|
-
- - -
|
|
132
|
-
|
|
133
|
-
## auth-ext@0.1.59 - 2026-02-15
|
|
134
|
-
#### Bug Fixes
|
|
135
|
-
- fix deno publish issue - (e8dcc4f) - malik ben
|
|
136
|
-
- issue fix - (63d66d3) - malik ben
|
|
137
|
-
#### Miscellaneous Chores
|
|
138
|
-
- (**version**) 0.5.5 - (d4dedeb) - Cocogitto Bot
|
|
139
|
-
- (**version**) 0.5.4 - (1ca3970) - Cocogitto Bot
|
|
140
|
-
- (**version**) 0.5.3 - (dcdb9cb) - Cocogitto Bot
|
|
141
|
-
- (**version**) 0.5.2 - (aa66e29) - Cocogitto Bot
|
|
142
|
-
- (**version**) 0.5.1 - (41b7c35) - Cocogitto Bot
|
|
143
|
-
- (**version**) 0.5.0 - (af63147) - Cocogitto Bot
|
|
144
|
-
- (**version**) 0.4.4 - (eaed3b4) - Cocogitto Bot
|
|
145
|
-
- (**version**) 0.4.3 - (ea9ec49) - Cocogitto Bot
|
|
146
|
-
|
|
147
|
-
- - -
|
|
148
|
-
|
|
149
|
-
Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto).
|
package/lobb.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { Lobb } from "@lobb-js/core";
|
|
2
|
-
import { auth } from "./extensions/auth/index.ts";
|
|
3
|
-
|
|
4
|
-
Lobb.init({
|
|
5
|
-
project: {
|
|
6
|
-
name: "Social To Courier",
|
|
7
|
-
force_sync: true,
|
|
8
|
-
},
|
|
9
|
-
database: {
|
|
10
|
-
host: "localhost",
|
|
11
|
-
port: 5432,
|
|
12
|
-
username: "test",
|
|
13
|
-
password: "test",
|
|
14
|
-
database: "social_to_courier",
|
|
15
|
-
},
|
|
16
|
-
web_server: {
|
|
17
|
-
host: "0.0.0.0",
|
|
18
|
-
port: 3000,
|
|
19
|
-
cors: {
|
|
20
|
-
origin: "*",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
extensions: [
|
|
24
|
-
auth({
|
|
25
|
-
admin: {
|
|
26
|
-
email: "admin@example.com",
|
|
27
|
-
password: "admin",
|
|
28
|
-
},
|
|
29
|
-
extend_users: {
|
|
30
|
-
fields: {
|
|
31
|
-
instagram_user_id: {
|
|
32
|
-
type: "string",
|
|
33
|
-
length: 255,
|
|
34
|
-
},
|
|
35
|
-
instagram_token: {
|
|
36
|
-
type: "string",
|
|
37
|
-
length: 255,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
roles: {
|
|
42
|
-
public: {
|
|
43
|
-
permissions: true,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
}),
|
|
47
|
-
],
|
|
48
|
-
collections: {
|
|
49
|
-
articles: {
|
|
50
|
-
indexes: {},
|
|
51
|
-
fields: {
|
|
52
|
-
id: {
|
|
53
|
-
type: "integer",
|
|
54
|
-
},
|
|
55
|
-
image: {
|
|
56
|
-
type: "string",
|
|
57
|
-
length: 255,
|
|
58
|
-
},
|
|
59
|
-
title: {
|
|
60
|
-
type: "string",
|
|
61
|
-
length: 255,
|
|
62
|
-
validators: {
|
|
63
|
-
required: true,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
description: {
|
|
67
|
-
type: "string",
|
|
68
|
-
length: 255,
|
|
69
|
-
},
|
|
70
|
-
body: {
|
|
71
|
-
type: "string",
|
|
72
|
-
length: 255,
|
|
73
|
-
validators: {
|
|
74
|
-
required: true,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
status: {
|
|
78
|
-
type: "string",
|
|
79
|
-
length: 255,
|
|
80
|
-
validators: {
|
|
81
|
-
enum: ["public", "private"],
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
comments: {
|
|
87
|
-
indexes: {},
|
|
88
|
-
fields: {
|
|
89
|
-
id: {
|
|
90
|
-
type: "integer",
|
|
91
|
-
},
|
|
92
|
-
body: {
|
|
93
|
-
type: "string",
|
|
94
|
-
length: 255,
|
|
95
|
-
validators: {
|
|
96
|
-
required: true,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
article_id: {
|
|
100
|
-
type: "integer",
|
|
101
|
-
validators: {
|
|
102
|
-
required: true,
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
});
|
package/public/public/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/public/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/scripts/postpublish.sh
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Postpublish script for @lobb-js/lobb-ext-auth
|
|
4
|
-
# Reverts package.json exports and cleans dist to avoid uncommitted changes
|
|
5
|
-
|
|
6
|
-
echo "📝 Reverting package.json exports to development mode..."
|
|
7
|
-
jq '."exports"["./studio"] = "./extensions/auth/studio/index.ts"' package.json > package.json.tmp && mv package.json.tmp package.json
|
|
8
|
-
|
|
9
|
-
echo "🧹 Cleaning dist directory..."
|
|
10
|
-
rm -rf dist
|
|
11
|
-
|
|
12
|
-
echo "✅ Postpublish complete"
|
package/scripts/prepublish.sh
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Prepublish script for @lobb-js/lobb-ext-auth
|
|
4
|
-
# Builds the studio package and updates exports for publishing
|
|
5
|
-
|
|
6
|
-
echo "📦 Building studio package..."
|
|
7
|
-
bun run package
|
|
8
|
-
|
|
9
|
-
if [ $? -ne 0 ]; then
|
|
10
|
-
echo "❌ Build failed"
|
|
11
|
-
exit 1
|
|
12
|
-
fi
|
|
13
|
-
|
|
14
|
-
echo "📝 Updating package.json exports for publishing..."
|
|
15
|
-
jq '."exports"["./studio"] = {"svelte": "./dist/index.js", "types": "./dist/index.d.ts"}' package.json > package.json.tmp && mv package.json.tmp package.json
|
|
16
|
-
|
|
17
|
-
echo "✅ Prepublish complete"
|
package/studio/app.html
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<link rel="icon" href="%sveltekit.assets%/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
%sveltekit.head%
|
|
8
|
-
</head>
|
|
9
|
-
<body data-sveltekit-preload-data="hover">
|
|
10
|
-
<div style="display: contents">%sveltekit.body%</div>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|
package/studio/routes/+layout.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const ssr = false;
|
package/svelte.config.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import adapter from '@sveltejs/adapter-node';
|
|
2
|
-
|
|
3
|
-
/** @type {import('@sveltejs/kit').Config} */
|
|
4
|
-
const config = {
|
|
5
|
-
kit: {
|
|
6
|
-
adapter: adapter(),
|
|
7
|
-
paths: {
|
|
8
|
-
base: '/studio'
|
|
9
|
-
},
|
|
10
|
-
files: {
|
|
11
|
-
lib: 'studio/lib',
|
|
12
|
-
routes: 'studio/routes',
|
|
13
|
-
appTemplate: 'studio/app.html',
|
|
14
|
-
assets: 'public',
|
|
15
|
-
hooks: {
|
|
16
|
-
server: 'studio/hooks.server',
|
|
17
|
-
client: 'studio/hooks.client',
|
|
18
|
-
},
|
|
19
|
-
params: 'studio/params',
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default config;
|
package/todo.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# high priority
|
|
2
|
-
|
|
3
|
-
- remove the `dashboard_access_roles` and just put it in the specific role in the `roles` property
|
|
4
|
-
- currently we have the payloadGuard. you can later implement the `recordGuard`
|
|
5
|
-
for `update` and `delete`
|
|
6
|
-
- implement rotating refresh token mechanism
|
|
7
|
-
- you can implement the firebase adapter and get all other adapters
|
|
8
|
-
- check `https://passkeys.dev/`. the new standart to abandon passwords
|
|
9
|
-
- prevent any one from creating a user with the admin role
|
|
10
|
-
|
|
11
|
-
# low priority
|
|
12
|
-
|
|
13
|
-
- add basic authentication in lobb. or at least make something like it. where
|
|
14
|
-
you have a users.json file and those will be the users without creating a
|
|
15
|
-
users or anything like that. its much simpler for simpler usage
|
|
16
|
-
- the collection_name property in the refresh_token property default value in
|
|
17
|
-
the schema doent work. its similar to the issue of the auth collection name.
|
|
18
|
-
although Im adding a default value to that property. but its value is
|
|
19
|
-
undefined for some reason. investigate it
|
|
20
|
-
- remove keep only the user id in the payload of the access and refresh tokens
|
|
21
|
-
- rotational refresh tokens where the refresh token is changes every time its
|
|
22
|
-
used to refresh an access token
|
|
23
|
-
- prepare the views directory for extensions in a better way. now there is a way
|
|
24
|
-
to view all component you have in an isolated manner. and when you run
|
|
25
|
-
`npm run build` it will generate a js compiled version of the svelte
|
|
26
|
-
component.
|
|
27
|
-
- for now you need to import the main css file in all of the components in order
|
|
28
|
-
for tailwind stuff to be indluded in the main style.css. but in the future you
|
|
29
|
-
should import all component in an index file and include the main css there
|
|
30
|
-
and force vite to create seperate chunks for each imported svelte compoenent
|
|
31
|
-
there. so that you dont get one bundle because you need them seperated
|
|
32
|
-
- change the views from svelte files into directories that holds index.svelte
|
|
33
|
-
files. (this is better because maybe in the future you want to modularize or
|
|
34
|
-
split your code or have other files. so they will all be organized inside that
|
|
35
|
-
directory and you dont need to have a svelte file and then have a directory
|
|
36
|
-
with the same name of that file to hold all the imports of that svelte file.
|
|
37
|
-
its better to have them all stored in one directory)
|
package/tsconfig.app.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@tsconfig/svelte/tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
5
|
-
"target": "ES2022",
|
|
6
|
-
"useDefineForClassFields": true,
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"types": ["svelte", "vite/client"],
|
|
9
|
-
"noEmit": true,
|
|
10
|
-
"allowArbitraryExtensions": true,
|
|
11
|
-
/**
|
|
12
|
-
* Typecheck JS in `.svelte` and `.js` files by default.
|
|
13
|
-
* Disable checkJs if you'd like to use dynamic types in JS.
|
|
14
|
-
* Note that setting allowJs false does not prevent the use
|
|
15
|
-
* of JS in `.svelte` files.
|
|
16
|
-
*/
|
|
17
|
-
"allowJs": true,
|
|
18
|
-
"checkJs": true,
|
|
19
|
-
"moduleDetection": "force",
|
|
20
|
-
"baseUrl": ".",
|
|
21
|
-
"paths": {
|
|
22
|
-
"$lib": ["./studio/lib"],
|
|
23
|
-
"$lib/*": ["./studio/lib/*"]
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"include": ["studio/**/*.ts", "studio/**/*.js", "studio/**/*.svelte"]
|
|
27
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./.svelte-kit/tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"allowJs": true,
|
|
5
|
-
"checkJs": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"forceConsistentCasingInFileNames": true,
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"strict": true
|
|
12
|
-
}
|
|
13
|
-
}
|
package/tsconfig.node.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
-
"target": "ES2023",
|
|
5
|
-
"lib": ["ES2023"],
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"types": ["node"],
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"verbatimModuleSyntax": true,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
/* Linting */
|
|
18
|
-
"strict": true,
|
|
19
|
-
"noUnusedLocals": true,
|
|
20
|
-
"noUnusedParameters": true,
|
|
21
|
-
"erasableSyntaxOnly": true,
|
|
22
|
-
"noFallthroughCasesInSwitch": true,
|
|
23
|
-
"noUncheckedSideEffectImports": true
|
|
24
|
-
},
|
|
25
|
-
"include": ["vite.config.ts"]
|
|
26
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { sveltekit } from '@sveltejs/kit/vite';
|
|
2
|
-
import { defineConfig } from 'vite';
|
|
3
|
-
import tailwindcss from "@tailwindcss/vite";
|
|
4
|
-
import { lobbStudioPlugins } from '@lobb-js/studio/vite-plugins';
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
plugins: [tailwindcss(), sveltekit(), ...lobbStudioPlugins()],
|
|
8
|
-
});
|