@velastack/patterns 0.0.19 → 0.0.20
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/README.md +12 -0
- package/dist/chunks/collections-C7dgGs-E.js +67 -0
- package/dist/chunks/collections-C7dgGs-E.js.map +1 -0
- package/dist/chunks/{env.runtime-C3E02sUH.js → env.runtime-DwDRkEXV.js} +2 -2
- package/dist/chunks/{env.runtime-C3E02sUH.js.map → env.runtime-DwDRkEXV.js.map} +1 -1
- package/dist/chunks/generate.runtime-C7g-zL0o.js.map +1 -1
- package/dist/chunks/generate.runtime-D21wXYWT.js +172 -0
- package/dist/chunks/generate.runtime-D21wXYWT.js.map +1 -0
- package/dist/chunks/generate.runtime-DcDyK2xK.js +334 -0
- package/dist/chunks/generate.runtime-DcDyK2xK.js.map +1 -0
- package/dist/chunks/{generate.runtime-DgtB6hP4.js → generate.runtime-cNqC7P0N.js} +33 -10
- package/dist/chunks/generate.runtime-cNqC7P0N.js.map +1 -0
- package/dist/chunks/generate.runtime-toUqgDQY.js +610 -0
- package/dist/chunks/generate.runtime-toUqgDQY.js.map +1 -0
- package/dist/chunks/{index-E6LAzq1d.js → index-GTS4D08Z.js} +2533 -2246
- package/dist/chunks/index-GTS4D08Z.js.map +1 -0
- package/dist/chunks/{pocketbase-BCvqw1Cr.js → pocketbase-QZ34CciJ.js} +50 -45
- package/dist/chunks/pocketbase-QZ34CciJ.js.map +1 -0
- package/dist/chunks/ts-morph-helpers-BNCluWTs.js +166 -0
- package/dist/chunks/ts-morph-helpers-BNCluWTs.js.map +1 -0
- package/dist/chunks/{write-result-CbUTMeAc.js → write-result-DmD7kWlV.js} +81 -70
- package/dist/chunks/write-result-DmD7kWlV.js.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +1 -1
- package/package.json +16 -1
- package/dist/chunks/collections-CAafgIoZ.js +0 -62
- package/dist/chunks/collections-CAafgIoZ.js.map +0 -1
- package/dist/chunks/generate.runtime-C7YhHvlr.js +0 -353
- package/dist/chunks/generate.runtime-C7YhHvlr.js.map +0 -1
- package/dist/chunks/generate.runtime-DBTOrhnc.js +0 -633
- package/dist/chunks/generate.runtime-DBTOrhnc.js.map +0 -1
- package/dist/chunks/generate.runtime-DgtB6hP4.js.map +0 -1
- package/dist/chunks/generate.runtime-DoQkjIdl.js +0 -227
- package/dist/chunks/generate.runtime-DoQkjIdl.js.map +0 -1
- package/dist/chunks/index-E6LAzq1d.js.map +0 -1
- package/dist/chunks/pocketbase-BCvqw1Cr.js.map +0 -1
- package/dist/chunks/write-result-CbUTMeAc.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate.runtime-C7YhHvlr.js","sources":["../../src/patterns/enable/auth/modifies/+layout.server.ts","../../src/patterns/enable/auth/modifies/root-layout.svelte.ts","../../src/patterns/enable/auth/modifies/hooks.server.ts","../../src/patterns/enable/auth/generate.runtime.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport { Project, SyntaxKind } from \"ts-morph\";\n\nexport function modifyLayoutServer(layoutPath: string) {\n if (!fs.existsSync(layoutPath)) {\n // write file directly\n\n const snippet = dedent`\n\t\t\texport const load = async ({ locals }) => {\n\t\t\t\treturn { user: locals.pb.authStore.record };\n\t\t\t};\n\t\t`;\n\n fs.writeFileSync(layoutPath, snippet);\n return;\n }\n\n const project = new Project();\n const sourceFile = project.addSourceFileAtPath(layoutPath);\n\n // helper to add user property to an object literal if missing\n const addUserProp = (obj: import(\"ts-morph\").ObjectLiteralExpression) => {\n const hasUser = !!obj.getProperty(\"user\");\n if (!hasUser) {\n obj.addPropertyAssignment({\n name: \"user\",\n initializer: \"locals.pb.authStore.record\",\n });\n }\n };\n\n // find existing exported load (function or const with arrow)\n let loadArrow: import(\"ts-morph\").ArrowFunction | undefined;\n let loadFn:\n | import(\"ts-morph\").FunctionDeclaration\n | import(\"ts-morph\").FunctionExpression\n | undefined;\n\n const varDecl = sourceFile.getVariableDeclaration(\"load\");\n if (varDecl) {\n const vs = varDecl.getFirstAncestorByKind(SyntaxKind.VariableStatement);\n const isExported = !!vs?.hasExportKeyword();\n if (isExported) {\n const directArrow = varDecl.getInitializerIfKind(\n SyntaxKind.ArrowFunction,\n );\n if (directArrow) {\n loadArrow = directArrow;\n } else {\n const init = varDecl.getInitializer();\n if (init) {\n const innerArrow = init.getFirstDescendantByKind(\n SyntaxKind.ArrowFunction,\n );\n if (innerArrow) {\n loadArrow = innerArrow;\n } else {\n const innerFnExpr = init.getFirstDescendantByKind(\n SyntaxKind.FunctionExpression,\n );\n if (innerFnExpr) {\n loadFn = innerFnExpr;\n }\n }\n }\n }\n }\n }\n\n if (!loadArrow) {\n const maybeFn = sourceFile.getFunction(\"load\");\n if (maybeFn && maybeFn.isExported()) {\n loadFn = maybeFn;\n }\n }\n\n // if no load found, create one\n if (!loadArrow && !loadFn) {\n sourceFile.addFunction({\n isExported: true,\n isAsync: true,\n name: \"load\",\n parameters: [{ name: \"{ locals }\" }],\n statements: `return { user: locals.pb.authStore.record };`,\n });\n sourceFile.formatText();\n sourceFile.saveSync();\n return;\n }\n\n // normalize function-like to a single handle\n const fnLike:\n | import(\"ts-morph\").ArrowFunction\n | import(\"ts-morph\").FunctionDeclaration\n | import(\"ts-morph\").FunctionExpression = (loadArrow ?? loadFn!) as any;\n\n // ensure first parameter destructures locals, preserving existing information\n const params = fnLike.getParameters();\n if (params.length === 0) {\n fnLike.insertParameter(0, { name: \"{ locals }\" });\n } else {\n const first = params[0];\n const original = first.getStructure();\n const nameNode = first.getNameNode();\n if (nameNode.getKind() === SyntaxKind.ObjectBindingPattern) {\n const obp = nameNode as import(\"ts-morph\").ObjectBindingPattern;\n const hasLocals = obp\n .getElements()\n .some((el) => el.getName() === \"locals\");\n if (!hasLocals) {\n const parts = obp\n .getElements()\n .map((el) => el.getText())\n .filter(Boolean);\n const tail = parts.length > 0 ? \", \" + parts.join(\", \") : \"\";\n first.set({\n name: `{ locals${tail} }`,\n type: original.type,\n initializer: (original as any).initializer,\n });\n }\n } else {\n const currentName = first.getName();\n if (currentName !== \"locals\") {\n first.set({\n name: `{ locals, ...${currentName} }`,\n type: original.type,\n initializer: (original as any).initializer,\n });\n }\n }\n }\n\n // add user to returned object literals without altering other properties\n if (loadArrow) {\n const body = loadArrow.getBody();\n if (body.getKind() === SyntaxKind.Block) {\n const returns = body.getDescendantsOfKind(SyntaxKind.ReturnStatement);\n returns.forEach((ret) => {\n const expr = ret.getExpression();\n if (!expr) return;\n if (expr.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(expr as import(\"ts-morph\").ObjectLiteralExpression);\n } else if (expr.getKind() === SyntaxKind.ParenthesizedExpression) {\n const inner = (\n expr as import(\"ts-morph\").ParenthesizedExpression\n ).getExpression();\n if (inner.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(inner as import(\"ts-morph\").ObjectLiteralExpression);\n }\n }\n });\n } else {\n // concise body\n const bodyExpr = body as import(\"ts-morph\").Expression;\n if (bodyExpr.getKind() === SyntaxKind.ParenthesizedExpression) {\n const inner = (\n bodyExpr as import(\"ts-morph\").ParenthesizedExpression\n ).getExpression();\n if (inner.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(inner as import(\"ts-morph\").ObjectLiteralExpression);\n }\n } else if (bodyExpr.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(bodyExpr as import(\"ts-morph\").ObjectLiteralExpression);\n }\n }\n } else if (loadFn) {\n const body = loadFn.getBody();\n if (body) {\n const returns = body.getDescendantsOfKind(SyntaxKind.ReturnStatement);\n returns.forEach((ret) => {\n const expr = ret.getExpression();\n if (!expr) return;\n if (expr.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(expr as import(\"ts-morph\").ObjectLiteralExpression);\n } else if (expr.getKind() === SyntaxKind.ParenthesizedExpression) {\n const inner = (\n expr as import(\"ts-morph\").ParenthesizedExpression\n ).getExpression();\n if (inner.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(inner as import(\"ts-morph\").ObjectLiteralExpression);\n }\n }\n });\n }\n }\n\n sourceFile.formatText();\n sourceFile.saveSync();\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\n\nexport function modifyRootLayoutSvelte(layoutPath: string) {\n let layout = fs.readFileSync(layoutPath, \"utf8\");\n // TODO: use magic-string to modify the layout\n\n // find the navbar.root > navbar.list\n const navbarRoot = layout.match(/<Navbar\\.Root>([\\s\\S]*?)<\\/Navbar\\.Root>/);\n if (!navbarRoot) {\n return;\n }\n\n const navbarList = navbarRoot[1].match(\n /<Navbar\\.List>([\\s\\S]*?)<\\/Navbar\\.List>/,\n );\n if (!navbarList) {\n return;\n }\n\n // add imports\n const imports = dedent`\n\t\timport * as AuthMenu from '$lib/components/ui/auth-menu';\n\t\timport * as Avatar from '$lib/components/ui/avatar';\n\t`;\n\n // Insert imports after the last existing import inside the first <script> block (if any)\n const scriptOpenIdx = layout.indexOf(\"<script\");\n if (scriptOpenIdx !== -1) {\n const scriptOpenEnd = layout.indexOf(\">\", scriptOpenIdx);\n const scriptCloseIdx =\n scriptOpenEnd !== -1\n ? layout.indexOf(\"</script>\", scriptOpenEnd + 1)\n : -1;\n if (scriptOpenEnd !== -1 && scriptCloseIdx !== -1) {\n const scriptContent = layout.slice(scriptOpenEnd + 1, scriptCloseIdx);\n let lastImportEnd = -1;\n const importRegex = /^\\s*import[\\s\\S]*?;[ \\t]*$/gm;\n let match: RegExpExecArray | null;\n while ((match = importRegex.exec(scriptContent)) !== null) {\n lastImportEnd = match.index + match[0].length;\n }\n\n if (lastImportEnd !== -1) {\n const before = scriptContent.slice(0, lastImportEnd);\n const after = scriptContent.slice(lastImportEnd);\n const newScriptContent = `${before}\\n${imports}\\n${after}`;\n layout =\n layout.slice(0, scriptOpenEnd + 1) +\n newScriptContent +\n layout.slice(scriptCloseIdx);\n } else {\n layout = layout.replace(\"</script>\", `${imports}\\n</script>`);\n }\n } else {\n layout = layout.replace(\"</script>\", `${imports}\\n</script>`);\n }\n } else {\n layout = layout.replace(\"</script>\", `${imports}\\n</script>`);\n }\n\n // add the auth menu to the navbar.list\n const newNavbarList =\n navbarList[1] +\n `\n\t\t\t<Navbar.Item\n\t\t\t\t\tclass=\"flex flex-col md:flex-row items-center space-y-2 md:space-y-0 md:space-x-4\"\n\t\t\t>\n\t\t\t\t\t<AuthMenu.Root>\n\t\t\t\t\t\t\t{#snippet user()}\n\t\t\t\t\t\t\t\t\t<AuthMenu.Trigger>\n\t\t\t\t\t\t\t\t\t\t\t<Avatar.Root>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{#if data.user?.avatar}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Avatar.Image\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"/api/files/users/{data.user?.id}/{data.user?.avatar}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talt={data.user?.email}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Avatar.Fallback>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{data.user?.email?.charAt(0).toUpperCase()}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Avatar.Fallback>\n\t\t\t\t\t\t\t\t\t\t\t</Avatar.Root>\n\t\t\t\t\t\t\t\t\t</AuthMenu.Trigger>\n\n\t\t\t\t\t\t\t\t\t<AuthMenu.Content align=\"end\">\n\t\t\t\t\t\t\t\t\t\t\t<AuthMenu.Item href=\"/dashboard\">Dashboard</AuthMenu.Item>\n\t\t\t\t\t\t\t\t\t\t\t<AuthMenu.Group>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<AuthMenu.Item href=\"/settings\">Settings</AuthMenu.Item>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<AuthMenu.Item>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<form action=\"/logout\" method=\"post\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button type=\"submit\" class=\"contents\">Logout</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</AuthMenu.Item>\n\t\t\t\t\t\t\t\t\t\t\t</AuthMenu.Group>\n\t\t\t\t\t\t\t\t\t</AuthMenu.Content>\n\t\t\t\t\t\t\t{/snippet}\n\n\t\t\t\t\t\t\t{#snippet guest()}\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclass=\"w-full justify-start md:justify-center md:w-auto\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\thref=\"/login\">Login</Button\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclass=\"w-full justify-start md:justify-center md:w-auto\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\t\t\thref=\"/signup\">Sign up</Button\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{/snippet}\n\t\t\t\t\t</AuthMenu.Root>\n\t\t\t</Navbar.Item>\n\t\t`;\n\n // replace the navbar.list with the new one\n layout = layout.replace(navbarList[1], newNavbarList);\n\n fs.writeFileSync(layoutPath, layout);\n}\n","import { Project, SyntaxKind } from \"ts-morph\";\n\nexport function modifyHooksServer(hooksServerPath: string) {\n const project = new Project();\n const sourceFile = project.addSourceFileAtPath(hooksServerPath);\n\n // Find the handlePocketbase(...) call\n const callExpr = sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .find((ce) => ce.getExpression().getText() === \"handlePocketbase\");\n\n if (!callExpr) {\n sourceFile.saveSync();\n return;\n }\n\n const args = callExpr.getArguments();\n if (args.length === 0) {\n // Create an options object if missing\n callExpr.addArgument(`{ auth: { protectedRoutes: ['/(app)'] } }`);\n sourceFile.formatText();\n sourceFile.saveSync();\n return;\n }\n\n const firstArg = args[0];\n if (firstArg.getKind() !== SyntaxKind.ObjectLiteralExpression) {\n // Replace non-object first arg with an object including auth\n callExpr.insertArgument(0, `{ auth: { protectedRoutes: ['/(app)'] } }`);\n sourceFile.formatText();\n sourceFile.saveSync();\n return;\n }\n\n const optionsObj = firstArg.asKindOrThrow(SyntaxKind.ObjectLiteralExpression);\n\n // Ensure auth property exists\n const authProp = optionsObj.getProperty(\"auth\");\n if (!authProp) {\n optionsObj.addPropertyAssignment({\n name: \"auth\",\n initializer: `{ protectedRoutes: ['/(app)'] }`,\n });\n sourceFile.formatText();\n sourceFile.saveSync();\n return;\n }\n\n // If auth exists, ensure protectedRoutes includes '/(app)'\n if (authProp.getKind() === SyntaxKind.PropertyAssignment) {\n const authInit = (\n authProp as import(\"ts-morph\").PropertyAssignment\n ).getInitializer();\n if (authInit && authInit.getKind() === SyntaxKind.ObjectLiteralExpression) {\n const authObj = authInit as import(\"ts-morph\").ObjectLiteralExpression;\n const prProp = authObj.getProperty(\"protectedRoutes\");\n if (!prProp) {\n authObj.addPropertyAssignment({\n name: \"protectedRoutes\",\n initializer: `['/(app)']`,\n });\n } else if (prProp.getKind() === SyntaxKind.PropertyAssignment) {\n const prInit = (\n prProp as import(\"ts-morph\").PropertyAssignment\n ).getInitializer();\n if (prInit && prInit.getKind() === SyntaxKind.ArrayLiteralExpression) {\n const arr = prInit as import(\"ts-morph\").ArrayLiteralExpression;\n const hasApp = arr\n .getElements()\n .some((el) => el.getText().replace(/['\"`]/g, \"\") === \"/(app)\");\n if (!hasApp) {\n arr.addElement(`'/(app)'`);\n }\n } else {\n // Replace non-array with desired value\n (prProp as import(\"ts-morph\").PropertyAssignment).setInitializer(\n `['/(app)']`,\n );\n }\n }\n }\n }\n\n sourceFile.formatText();\n sourceFile.saveSync();\n}\n","import path from \"node:path\";\nimport fs from \"node:fs\";\nimport { Options, Result, File } from \"../../../core/types\";\nimport { getMigrationFile, withPocketbase } from \"../../../runtime/pocketbase\";\n\nimport { modifyLayoutServer } from \"./modifies/+layout.server\";\nimport { modifyRootLayoutSvelte } from \"./modifies/root-layout.svelte\";\nimport { modifyHooksServer } from \"./modifies/hooks.server\";\n\nexport async function generate(options: Options) {\n const { input } = options;\n\n let creates: File[] = [];\n\n // Update PocketBase\n await withPocketbase(options.root, async (pb) => {\n await pb.settings.update({\n meta: {\n senderName: input.senderName,\n senderAddress: input.senderAddress,\n },\n });\n\n const userCollection = await pb.collections.getOne(\"users\");\n\n if (!userCollection) {\n throw new Error(\"Users collection not found\");\n }\n\n const verificationTemplate =\n userCollection.verificationTemplate.body.replace(\n \"{APP_URL}/_/#/auth/confirm-verification/{TOKEN}\",\n \"{APP_URL}/confirm-verification/{TOKEN}\",\n );\n const resetPasswordTemplate =\n userCollection.resetPasswordTemplate.body.replace(\n \"{APP_URL}/_/#/auth/confirm-password-reset/{TOKEN}\",\n \"{APP_URL}/confirm-password-reset/{TOKEN}\",\n );\n const confirmEmailChangeTemplate =\n userCollection.confirmEmailChangeTemplate.body.replace(\n \"{APP_URL}/_/#/auth/confirm-email-change/{TOKEN}\",\n \"{APP_URL}/confirm-email-change/{TOKEN}\",\n );\n\n // Update user auth rules to lock down access to the user's own account\n await pb.collections.update(\"users\", {\n listRule: \"@request.auth.id = id\",\n viewRule: \"@request.auth.id = id\",\n createRule: \"@request.auth.id = id\",\n updateRule: \"@request.auth.id = id\",\n deleteRule: \"@request.auth.id = id\",\n\n // Update email templates to VelaStack auth urls\n verificationTemplate: {\n body: verificationTemplate,\n },\n resetPasswordTemplate: {\n body: resetPasswordTemplate,\n },\n confirmEmailChangeTemplate: {\n body: confirmEmailChangeTemplate,\n },\n });\n\n const migrationFile = getMigrationFile(\"users\", \"updated\", options);\n if (migrationFile) {\n creates.push({\n path: migrationFile,\n language: \"ts\",\n content: fs.readFileSync(migrationFile, \"utf8\"),\n });\n }\n });\n\n // Modify files\n let modifies: File[] = [];\n\n const layoutServerFile = path.join(\n options.root,\n \"src\",\n \"routes\",\n \"+layout.server.ts\",\n );\n\n await modifyLayoutServer(layoutServerFile);\n modifies.push({\n path: layoutServerFile,\n language: \"ts\",\n content: fs.readFileSync(layoutServerFile, \"utf8\"),\n });\n\n // TODO: make this more robust by searching for Navbar.Root > Navbar.List\n // src/routes/(public)/root-layout.svelte is what vela creates by default\n let layoutFile = path.join(\n options.root,\n \"src\",\n \"routes\",\n \"(public)\",\n \"root-layout.svelte\",\n );\n\n if (!fs.existsSync(layoutFile)) {\n layoutFile = path.join(options.root, \"src\", \"routes\", \"root-layout.svelte\");\n }\n\n if (!fs.existsSync(layoutFile)) {\n layoutFile = path.join(\n options.root,\n \"src\",\n \"routes\",\n \"(public)\",\n \"+layout.svelte\",\n );\n }\n\n if (!fs.existsSync(layoutFile)) {\n layoutFile = path.join(options.root, \"src\", \"routes\", \"+layout.svelte\");\n }\n\n if (fs.existsSync(layoutFile)) {\n modifyRootLayoutSvelte(layoutFile);\n modifies.push({\n path: layoutFile,\n language: \"svelte\",\n content: fs.readFileSync(layoutFile, \"utf8\"),\n });\n }\n\n const hooksServerFile = path.join(options.root, \"src\", \"hooks.server.ts\");\n\n if (fs.existsSync(hooksServerFile)) {\n modifyHooksServer(hooksServerFile);\n modifies.push({\n path: hooksServerFile,\n language: \"ts\",\n content: fs.readFileSync(hooksServerFile, \"utf8\"),\n });\n }\n\n return {\n creates: [],\n modifies,\n deletes: [],\n components: [],\n packages: [],\n collections: [],\n } satisfies Result;\n}\n"],"names":["modifyLayoutServer","layoutPath","fs","snippet","dedent","sourceFile","Project","addUserProp","obj","loadArrow","loadFn","varDecl","vs","SyntaxKind","directArrow","init","innerArrow","innerFnExpr","maybeFn","fnLike","params","first","original","nameNode","obp","el","parts","tail","currentName","body","ret","expr","inner","bodyExpr","modifyRootLayoutSvelte","layout","navbarRoot","navbarList","imports","scriptOpenIdx","scriptOpenEnd","scriptCloseIdx","scriptContent","lastImportEnd","importRegex","match","before","after","newScriptContent","newNavbarList","modifyHooksServer","hooksServerPath","callExpr","ce","args","firstArg","optionsObj","authProp","authInit","authObj","prProp","prInit","arr","generate","options","input","creates","withPocketbase","pb","userCollection","verificationTemplate","resetPasswordTemplate","confirmEmailChangeTemplate","migrationFile","getMigrationFile","modifies","layoutServerFile","path","layoutFile","hooksServerFile"],"mappings":";;;;;AAIO,SAASA,EAAmBC,GAAoB;AACrD,MAAI,CAACC,EAAG,WAAWD,CAAU,GAAG;AAG9B,UAAME,IAAUC;AAAA;AAAA;AAAA;AAAA;AAMhB,IAAAF,EAAG,cAAcD,GAAYE,CAAO;AACpC;AAAA,EACF;AAGA,QAAME,IADU,IAAIC,EAAA,EACO,oBAAoBL,CAAU,GAGnDM,IAAc,CAACC,MAAoD;AAEvE,IADgB,CAAC,CAACA,EAAI,YAAY,MAAM,KAEtCA,EAAI,sBAAsB;AAAA,MACxB,MAAM;AAAA,MACN,aAAa;AAAA,IAAA,CACd;AAAA,EAEL;AAGA,MAAIC,GACAC;AAKJ,QAAMC,IAAUN,EAAW,uBAAuB,MAAM;AACxD,MAAIM,GAAS;AACX,UAAMC,IAAKD,EAAQ,uBAAuBE,EAAW,iBAAiB;AAEtE,QADmB,CAAC,EAACD,KAAA,QAAAA,EAAI,qBACT;AACd,YAAME,IAAcH,EAAQ;AAAA,QAC1BE,EAAW;AAAA,MAAA;AAEb,UAAIC;AACF,QAAAL,IAAYK;AAAA,WACP;AACL,cAAMC,IAAOJ,EAAQ,eAAA;AACrB,YAAII,GAAM;AACR,gBAAMC,IAAaD,EAAK;AAAA,YACtBF,EAAW;AAAA,UAAA;AAEb,cAAIG;AACF,YAAAP,IAAYO;AAAA,eACP;AACL,kBAAMC,IAAcF,EAAK;AAAA,cACvBF,EAAW;AAAA,YAAA;AAEb,YAAII,MACFP,IAASO;AAAA,UAEb;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,MAAI,CAACR,GAAW;AACd,UAAMS,IAAUb,EAAW,Y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,IACV,SAAS5E,EAAG,aAAa4E,GAAY,MAAM;AAAA,EAAA,CAC5C;AAGH,QAAMC,IAAkBF,EAAK,KAAKb,EAAQ,MAAM,OAAO,iBAAiB;AAExE,SAAI9D,EAAG,WAAW6E,CAAe,MAC/B7B,EAAkB6B,CAAe,GACjCJ,EAAS,KAAK;AAAA,IACZ,MAAMI;AAAA,IACN,UAAU;AAAA,IACV,SAAS7E,EAAG,aAAa6E,GAAiB,MAAM;AAAA,EAAA,CACjD,IAGI;AAAA,IACL,SAAS,CAAA;AAAA,IACT,UAAAJ;AAAA,IACA,SAAS,CAAA;AAAA,IACT,YAAY,CAAA;AAAA,IACZ,UAAU,CAAA;AAAA,IACV,aAAa,CAAA;AAAA,EAAC;AAElB;"}
|
|
@@ -1,633 +0,0 @@
|
|
|
1
|
-
import f from "node:fs";
|
|
2
|
-
import A from "node:path";
|
|
3
|
-
import { d as z, T as j, l as P } from "./index-E6LAzq1d.js";
|
|
4
|
-
import { applyCollectionRulePatches as _ } from "./collections-CAafgIoZ.js";
|
|
5
|
-
import { w as O, g as D } from "./pocketbase-BCvqw1Cr.js";
|
|
6
|
-
import { Project as F, SyntaxKind as s, QuoteKind as N } from "ts-morph";
|
|
7
|
-
function L(t) {
|
|
8
|
-
if (!f.existsSync(t))
|
|
9
|
-
return !1;
|
|
10
|
-
let n = f.readFileSync(t, "utf8");
|
|
11
|
-
if (n.includes("teams={data.teams"))
|
|
12
|
-
return !1;
|
|
13
|
-
const o = "<AppSidebar user={data.user} meta={data.meta} />", r = "<AppSidebar user={data.user} meta={data.meta} team={data.team} teams={data.teams ?? []} />";
|
|
14
|
-
return n.includes(o) ? (n = n.replace(o, r), f.writeFileSync(t, n, "utf8"), !0) : !1;
|
|
15
|
-
}
|
|
16
|
-
const I = /import NavUser from ['"]\.\/nav-user\.svelte['"];/, C = `import NavUser from './nav-user.svelte';
|
|
17
|
-
import TeamSwitcher from '$lib/components/team-switcher.svelte';
|
|
18
|
-
import ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';
|
|
19
|
-
import * as Avatar from '$lib/components/ui/avatar';`, U = `<Sidebar.Header>
|
|
20
|
-
<Sidebar.Menu>
|
|
21
|
-
<TeamSwitcher {teams}>
|
|
22
|
-
{#snippet children()}
|
|
23
|
-
{@const activeTeam = teams.find((t) => t.id === team)}
|
|
24
|
-
{#if activeTeam}
|
|
25
|
-
<Avatar.Root class="size-8 rounded-lg">
|
|
26
|
-
<Avatar.Fallback class="rounded-lg bg-primary text-primary-foreground font-medium">
|
|
27
|
-
{activeTeam.name?.charAt(0).toUpperCase()}
|
|
28
|
-
</Avatar.Fallback>
|
|
29
|
-
</Avatar.Root>
|
|
30
|
-
<div class="grid flex-1 text-left text-sm leading-tight">
|
|
31
|
-
<span class="truncate font-medium">
|
|
32
|
-
{activeTeam.name}
|
|
33
|
-
</span>
|
|
34
|
-
</div>
|
|
35
|
-
{:else}
|
|
36
|
-
<div
|
|
37
|
-
class="bg-sidebar-accent text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg"
|
|
38
|
-
>
|
|
39
|
-
<img src="/favicon.svg" alt="logo" class="size-6" />
|
|
40
|
-
</div>
|
|
41
|
-
<div class="grid flex-1 text-left text-sm leading-tight">
|
|
42
|
-
<span class="truncate font-medium">{meta.appName}</span>
|
|
43
|
-
</div>
|
|
44
|
-
{/if}
|
|
45
|
-
<ChevronsUpDownIcon class="ml-auto" />
|
|
46
|
-
{/snippet}
|
|
47
|
-
</TeamSwitcher>
|
|
48
|
-
</Sidebar.Menu>
|
|
49
|
-
</Sidebar.Header>`;
|
|
50
|
-
function q(t) {
|
|
51
|
-
if (!f.existsSync(t))
|
|
52
|
-
return !1;
|
|
53
|
-
let n = f.readFileSync(t, "utf8");
|
|
54
|
-
if (n.includes("TeamSwitcher") || !I.test(n))
|
|
55
|
-
return !1;
|
|
56
|
-
n = n.replace(I, C), n = n.replace(
|
|
57
|
-
/let \{[\s\S]*?\}: ComponentProps<typeof Sidebar\.Root> & \{ user: any; meta: any \} = \$props\(\);/,
|
|
58
|
-
`let {
|
|
59
|
-
user,
|
|
60
|
-
meta,
|
|
61
|
-
team,
|
|
62
|
-
teams = [],
|
|
63
|
-
ref = $bindable(null),
|
|
64
|
-
...restProps
|
|
65
|
-
}: ComponentProps<typeof Sidebar.Root> & {
|
|
66
|
-
user: any;
|
|
67
|
-
meta: any;
|
|
68
|
-
team?: string | undefined;
|
|
69
|
-
teams?: { id: string; name: string }[];
|
|
70
|
-
} = $props();`
|
|
71
|
-
);
|
|
72
|
-
const o = n.match(/<Sidebar\.Header>[\s\S]*?<\/Sidebar\.Header>/);
|
|
73
|
-
return o ? (n = n.replace(o[0], U), f.writeFileSync(t, n, "utf8"), !0) : !1;
|
|
74
|
-
}
|
|
75
|
-
function R(t) {
|
|
76
|
-
if (!f.existsSync(t)) {
|
|
77
|
-
const e = z`
|
|
78
|
-
export const load = async ({ locals, depends }) => {
|
|
79
|
-
const user = locals.pb.authStore.record!;
|
|
80
|
-
const team = locals.team;
|
|
81
|
-
const teams = await locals.pb.collection("teams").getFullList();
|
|
82
|
-
depends("app:team");
|
|
83
|
-
|
|
84
|
-
const breadcrumbs = [{ title: "Home", url: "/dashboard" }];
|
|
85
|
-
return { user, team, teams, breadcrumbs };
|
|
86
|
-
};
|
|
87
|
-
`;
|
|
88
|
-
f.writeFileSync(t, e);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const o = new F().addSourceFileAtPath(t), r = (e, a, c) => {
|
|
92
|
-
!!e.getProperty(a) || (a === c ? e.addShorthandPropertyAssignment({ name: a }) : e.addPropertyAssignment({ name: a, initializer: c }));
|
|
93
|
-
};
|
|
94
|
-
let p, m;
|
|
95
|
-
const g = o.getVariableDeclaration("load");
|
|
96
|
-
if (g) {
|
|
97
|
-
const e = g.getFirstAncestorByKind(s.VariableStatement);
|
|
98
|
-
if (!!(e != null && e.hasExportKeyword())) {
|
|
99
|
-
const c = g.getInitializerIfKind(s.ArrowFunction);
|
|
100
|
-
if (c)
|
|
101
|
-
p = c;
|
|
102
|
-
else {
|
|
103
|
-
const i = g.getInitializer();
|
|
104
|
-
if (i) {
|
|
105
|
-
const l = i.getFirstDescendantByKind(s.ArrowFunction);
|
|
106
|
-
if (l)
|
|
107
|
-
p = l;
|
|
108
|
-
else {
|
|
109
|
-
const u = i.getFirstDescendantByKind(s.FunctionExpression);
|
|
110
|
-
u && (m = u);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (!p) {
|
|
117
|
-
const e = o.getFunction("load");
|
|
118
|
-
e && e.isExported() && (m = e);
|
|
119
|
-
}
|
|
120
|
-
if (!p && !m) {
|
|
121
|
-
o.addFunction({
|
|
122
|
-
isExported: !0,
|
|
123
|
-
isAsync: !0,
|
|
124
|
-
name: "load",
|
|
125
|
-
parameters: [{ name: "{ locals, depends }" }],
|
|
126
|
-
statements: [
|
|
127
|
-
"const user = locals.pb.authStore.record!;",
|
|
128
|
-
"const team = locals.team;",
|
|
129
|
-
'const teams = await locals.pb.collection("teams").getFullList();',
|
|
130
|
-
'depends("app:team");',
|
|
131
|
-
"",
|
|
132
|
-
'const breadcrumbs = [{ title: "Home", url: "/dashboard" }];',
|
|
133
|
-
"return { user, team, teams, breadcrumbs };"
|
|
134
|
-
]
|
|
135
|
-
}), o.formatText(), o.saveSync();
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
const d = p ?? m, S = d.getParameters();
|
|
139
|
-
if (S.length === 0)
|
|
140
|
-
d.insertParameter(0, { name: "{ locals, depends }" });
|
|
141
|
-
else {
|
|
142
|
-
const e = S[0], a = e.getStructure(), c = e.getNameNode();
|
|
143
|
-
if (c.getKind() === s.ObjectBindingPattern) {
|
|
144
|
-
const i = c, l = i.getElements().some((x) => x.getName() === "depends"), u = i.getElements().some((x) => x.getName() === "locals");
|
|
145
|
-
if (!l) {
|
|
146
|
-
const x = i.getElements().map((w) => w.getText()).filter(Boolean), b = x.length > 0 ? ", " + x.join(", ") : "";
|
|
147
|
-
u ? e.set({
|
|
148
|
-
name: `{ depends${b} }`,
|
|
149
|
-
type: a.type,
|
|
150
|
-
initializer: a.initializer
|
|
151
|
-
}) : e.set({
|
|
152
|
-
name: `{ locals, depends${b} }`,
|
|
153
|
-
type: a.type,
|
|
154
|
-
initializer: a.initializer
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
} else {
|
|
158
|
-
const i = e.getName();
|
|
159
|
-
i !== "locals" ? e.set({
|
|
160
|
-
name: `{ locals, depends, ...${i} }`,
|
|
161
|
-
type: a.type,
|
|
162
|
-
initializer: a.initializer
|
|
163
|
-
}) : e.set({
|
|
164
|
-
name: "{ locals, depends }",
|
|
165
|
-
type: a.type,
|
|
166
|
-
initializer: a.initializer
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
p && !p.isAsync() ? p.setIsAsync(!0) : m && !m.isAsync() && m.setIsAsync(!0);
|
|
171
|
-
const y = d.getBody();
|
|
172
|
-
if (y && y.getKind() === s.Block) {
|
|
173
|
-
const e = y, a = e.getStatements(), c = a.some(
|
|
174
|
-
(u) => u.getKind() === s.VariableStatement && u.getDescendantsOfKind(s.Identifier).some((x) => x.getText() === "team")
|
|
175
|
-
), i = a.some(
|
|
176
|
-
(u) => u.getKind() === s.VariableStatement && u.getDescendantsOfKind(s.Identifier).some((x) => x.getText() === "teams")
|
|
177
|
-
), l = a.some(
|
|
178
|
-
(u) => u.getKind() === s.ExpressionStatement && u.getDescendantsOfKind(s.CallExpression).some((x) => {
|
|
179
|
-
var K;
|
|
180
|
-
if (x.getExpression().getText() !== "depends") return !1;
|
|
181
|
-
const w = x.getArguments(), h = ((K = w[0]) == null ? void 0 : K.getText()) ?? "";
|
|
182
|
-
return w.length === 1 && (h === "'app:team'" || h === '"app:team"');
|
|
183
|
-
})
|
|
184
|
-
);
|
|
185
|
-
c || e.insertStatements(1, "const team = locals.team;"), i || e.insertStatements(
|
|
186
|
-
2,
|
|
187
|
-
'const teams = await locals.pb.collection("teams").getFullList();'
|
|
188
|
-
), l || e.insertStatements(3, 'depends("app:team");');
|
|
189
|
-
}
|
|
190
|
-
if (p) {
|
|
191
|
-
const e = p.getBody();
|
|
192
|
-
if (e.getKind() === s.Block)
|
|
193
|
-
e.getDescendantsOfKind(s.ReturnStatement).forEach((c) => {
|
|
194
|
-
const i = c.getExpression();
|
|
195
|
-
if (i) {
|
|
196
|
-
if (i.getKind() === s.ObjectLiteralExpression) {
|
|
197
|
-
const l = i;
|
|
198
|
-
r(l, "team", "team"), r(l, "teams", "teams");
|
|
199
|
-
} else if (i.getKind() === s.ParenthesizedExpression) {
|
|
200
|
-
const l = i.getExpression();
|
|
201
|
-
if (l.getKind() === s.ObjectLiteralExpression) {
|
|
202
|
-
const u = l;
|
|
203
|
-
r(u, "team", "team"), r(u, "teams", "teams");
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
else {
|
|
209
|
-
const a = e;
|
|
210
|
-
if (a.getKind() === s.ParenthesizedExpression) {
|
|
211
|
-
const c = a.getExpression();
|
|
212
|
-
if (c.getKind() === s.ObjectLiteralExpression) {
|
|
213
|
-
const i = c;
|
|
214
|
-
r(i, "team", "team"), r(i, "teams", "teams");
|
|
215
|
-
}
|
|
216
|
-
} else if (a.getKind() === s.ObjectLiteralExpression) {
|
|
217
|
-
const c = a;
|
|
218
|
-
r(c, "team", "team"), r(c, "teams", "teams");
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
} else if (m) {
|
|
222
|
-
const e = m.getBody();
|
|
223
|
-
e && e.getDescendantsOfKind(s.ReturnStatement).forEach((c) => {
|
|
224
|
-
const i = c.getExpression();
|
|
225
|
-
if (i) {
|
|
226
|
-
if (i.getKind() === s.ObjectLiteralExpression) {
|
|
227
|
-
const l = i;
|
|
228
|
-
r(l, "team", "team"), r(l, "teams", "teams");
|
|
229
|
-
} else if (i.getKind() === s.ParenthesizedExpression) {
|
|
230
|
-
const l = i.getExpression();
|
|
231
|
-
if (l.getKind() === s.ObjectLiteralExpression) {
|
|
232
|
-
const u = l;
|
|
233
|
-
r(u, "team", "team"), r(u, "teams", "teams");
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
o.formatText(), o.saveSync();
|
|
240
|
-
}
|
|
241
|
-
function T(t, n, o, r, p) {
|
|
242
|
-
const m = `
|
|
243
|
-
{
|
|
244
|
-
title: '${n}',
|
|
245
|
-
url: '${o}',
|
|
246
|
-
icon: ${r}
|
|
247
|
-
}
|
|
248
|
-
`, d = new F({
|
|
249
|
-
useInMemoryFileSystem: !0,
|
|
250
|
-
skipFileDependencyResolution: !0,
|
|
251
|
-
manipulationSettings: { quoteKind: N.Single }
|
|
252
|
-
}).createSourceFile("module.ts", t, { overwrite: !0 });
|
|
253
|
-
d.getImportDeclarations().some((a) => a.getModuleSpecifierValue() === p) || d.addImportDeclaration({ defaultImport: r, moduleSpecifier: p });
|
|
254
|
-
const y = d.getVariableDeclarations().find((a) => a.getName() === "data"), e = y == null ? void 0 : y.getInitializer();
|
|
255
|
-
if (e && e.getKind() === s.ObjectLiteralExpression) {
|
|
256
|
-
const c = e.asKindOrThrow(s.ObjectLiteralExpression).getProperty("navUser");
|
|
257
|
-
if (c && c.getKind() === s.PropertyAssignment) {
|
|
258
|
-
const l = c.asKindOrThrow(s.PropertyAssignment).getInitializer();
|
|
259
|
-
if (l && l.getKind() === s.ArrayLiteralExpression) {
|
|
260
|
-
const u = l.asKindOrThrow(s.ArrayLiteralExpression);
|
|
261
|
-
if (!u.getElements().some((b) => {
|
|
262
|
-
if (b.getKind() !== s.ObjectLiteralExpression) return !1;
|
|
263
|
-
const h = b.asKindOrThrow(s.ObjectLiteralExpression).getProperty("title");
|
|
264
|
-
if (!h || h.getKind() !== s.PropertyAssignment) return !1;
|
|
265
|
-
const E = h.asKindOrThrow(s.PropertyAssignment).getInitializer();
|
|
266
|
-
return (E == null ? void 0 : E.getKind()) === s.StringLiteral && E.getLiteralText() === n;
|
|
267
|
-
}))
|
|
268
|
-
return u.addElement(m.trim()), d.formatText(), { newInner: d.getFullText(), wasAdded: !0 };
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return { newInner: t, wasAdded: !1 };
|
|
273
|
-
}
|
|
274
|
-
function $(t, n, o, r, p) {
|
|
275
|
-
const m = /<script\b([^>]*)>([\s\S]*?)<\/script>/gi;
|
|
276
|
-
let g;
|
|
277
|
-
for (; (g = m.exec(t)) !== null; ) {
|
|
278
|
-
const d = g[1] ?? "";
|
|
279
|
-
if (!(/\bmodule\b/.test(d) || /context\s*=\s*"module"/.test(d)))
|
|
280
|
-
continue;
|
|
281
|
-
const y = `<script${d}>`, e = g[2] ?? "", a = g.index, c = m.lastIndex, { newInner: i, wasAdded: l } = T(
|
|
282
|
-
e,
|
|
283
|
-
n,
|
|
284
|
-
o,
|
|
285
|
-
r,
|
|
286
|
-
p
|
|
287
|
-
);
|
|
288
|
-
if (l)
|
|
289
|
-
return {
|
|
290
|
-
newNavUserSnippet: t.slice(0, a) + y + i + "<\/script>" + t.slice(c),
|
|
291
|
-
wasAdded: !0
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
for (m.lastIndex = 0; (g = m.exec(t)) !== null; ) {
|
|
295
|
-
const d = g[1] ?? "";
|
|
296
|
-
if (/\bmodule\b/.test(d) || /context\s*=\s*"module"/.test(d))
|
|
297
|
-
continue;
|
|
298
|
-
const y = g[2] ?? "";
|
|
299
|
-
if (!y.includes("navUser"))
|
|
300
|
-
continue;
|
|
301
|
-
const e = `<script${d}>`, a = g.index, c = m.lastIndex, { newInner: i, wasAdded: l } = T(
|
|
302
|
-
y,
|
|
303
|
-
n,
|
|
304
|
-
o,
|
|
305
|
-
r,
|
|
306
|
-
p
|
|
307
|
-
);
|
|
308
|
-
if (l)
|
|
309
|
-
return {
|
|
310
|
-
newNavUserSnippet: t.slice(0, a) + e + i + "<\/script>" + t.slice(c),
|
|
311
|
-
wasAdded: !0
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
return { newNavUserSnippet: t, wasAdded: !1 };
|
|
315
|
-
}
|
|
316
|
-
function M(t) {
|
|
317
|
-
if (!f.existsSync(t))
|
|
318
|
-
return !1;
|
|
319
|
-
const n = f.readFileSync(t, "utf8"), { newNavUserSnippet: o, wasAdded: r } = $(
|
|
320
|
-
n,
|
|
321
|
-
"Teams",
|
|
322
|
-
"/teams",
|
|
323
|
-
"UsersIcon",
|
|
324
|
-
"@lucide/svelte/icons/users"
|
|
325
|
-
);
|
|
326
|
-
return r && f.writeFileSync(t, o, "utf8"), r;
|
|
327
|
-
}
|
|
328
|
-
function v(t, n, o) {
|
|
329
|
-
const r = D(n, "created", o);
|
|
330
|
-
r && t.push({
|
|
331
|
-
path: r,
|
|
332
|
-
language: P(r),
|
|
333
|
-
content: f.readFileSync(r, "utf8")
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
async function X(t) {
|
|
337
|
-
const n = [];
|
|
338
|
-
await O(t.root, async (d) => {
|
|
339
|
-
const S = await d.collections.getOne("users"), y = await d.collections.create({
|
|
340
|
-
name: "teams",
|
|
341
|
-
type: "base",
|
|
342
|
-
fields: [
|
|
343
|
-
{
|
|
344
|
-
name: "id",
|
|
345
|
-
type: "text",
|
|
346
|
-
primaryKey: !0,
|
|
347
|
-
autogeneratePattern: "[a-z0-9]{15}",
|
|
348
|
-
max: 15,
|
|
349
|
-
min: 15,
|
|
350
|
-
pattern: "^[a-z0-9]+$",
|
|
351
|
-
required: !0
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
name: "name",
|
|
355
|
-
type: "text",
|
|
356
|
-
required: !0
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
name: "owner",
|
|
360
|
-
type: "relation",
|
|
361
|
-
cascadeDelete: !1,
|
|
362
|
-
collectionId: S.id,
|
|
363
|
-
maxSelect: 1,
|
|
364
|
-
minSelect: 0,
|
|
365
|
-
required: !0
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
name: "created",
|
|
369
|
-
type: "autodate",
|
|
370
|
-
onCreate: !0,
|
|
371
|
-
onUpdate: !1
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
name: "updated",
|
|
375
|
-
type: "autodate",
|
|
376
|
-
onCreate: !0,
|
|
377
|
-
onUpdate: !0
|
|
378
|
-
}
|
|
379
|
-
]
|
|
380
|
-
});
|
|
381
|
-
v(n, "teams", t);
|
|
382
|
-
const e = await d.collections.create({
|
|
383
|
-
name: "team_memberships",
|
|
384
|
-
type: "base",
|
|
385
|
-
fields: [
|
|
386
|
-
{
|
|
387
|
-
name: "id",
|
|
388
|
-
autogeneratePattern: "[a-z0-9]{15}",
|
|
389
|
-
max: 15,
|
|
390
|
-
min: 15,
|
|
391
|
-
pattern: "^[a-z0-9]+$",
|
|
392
|
-
primaryKey: !0,
|
|
393
|
-
required: !0,
|
|
394
|
-
type: "text"
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
name: "team",
|
|
398
|
-
cascadeDelete: !0,
|
|
399
|
-
collectionId: y.id,
|
|
400
|
-
maxSelect: 1,
|
|
401
|
-
minSelect: 0,
|
|
402
|
-
required: !0,
|
|
403
|
-
type: "relation"
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
name: "user",
|
|
407
|
-
cascadeDelete: !0,
|
|
408
|
-
collectionId: S.id,
|
|
409
|
-
maxSelect: 1,
|
|
410
|
-
minSelect: 0,
|
|
411
|
-
required: !0,
|
|
412
|
-
type: "relation"
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
name: "role",
|
|
416
|
-
maxSelect: 1,
|
|
417
|
-
required: !0,
|
|
418
|
-
type: "select",
|
|
419
|
-
values: ["owner", "admin", "member"]
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
name: "created",
|
|
423
|
-
onCreate: !0,
|
|
424
|
-
onUpdate: !1,
|
|
425
|
-
type: "autodate"
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
name: "updated",
|
|
429
|
-
onCreate: !0,
|
|
430
|
-
onUpdate: !0,
|
|
431
|
-
type: "autodate"
|
|
432
|
-
}
|
|
433
|
-
]
|
|
434
|
-
});
|
|
435
|
-
v(n, "team_memberships", t), await d.collections.create({
|
|
436
|
-
name: "team_users",
|
|
437
|
-
type: "view",
|
|
438
|
-
fields: [
|
|
439
|
-
{
|
|
440
|
-
name: "id",
|
|
441
|
-
pattern: "^[a-z0-9]+$",
|
|
442
|
-
primaryKey: !0,
|
|
443
|
-
required: !0,
|
|
444
|
-
type: "text"
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
name: "email",
|
|
448
|
-
exceptDomains: null,
|
|
449
|
-
onlyDomains: null,
|
|
450
|
-
required: !0,
|
|
451
|
-
type: "email"
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
name: "name",
|
|
455
|
-
max: 255,
|
|
456
|
-
required: !1,
|
|
457
|
-
type: "text"
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
name: "membership_id",
|
|
461
|
-
cascadeDelete: !1,
|
|
462
|
-
collectionId: e.id,
|
|
463
|
-
maxSelect: 1,
|
|
464
|
-
minSelect: 0,
|
|
465
|
-
required: !1,
|
|
466
|
-
type: "relation"
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
name: "team",
|
|
470
|
-
cascadeDelete: !0,
|
|
471
|
-
collectionId: y.id,
|
|
472
|
-
maxSelect: 1,
|
|
473
|
-
minSelect: 0,
|
|
474
|
-
required: !0,
|
|
475
|
-
type: "relation"
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
name: "role",
|
|
479
|
-
maxSelect: 1,
|
|
480
|
-
required: !0,
|
|
481
|
-
type: "select",
|
|
482
|
-
values: ["owner", "admin", "member"]
|
|
483
|
-
}
|
|
484
|
-
],
|
|
485
|
-
viewQuery: "select users.id, users.email, users.name, team_memberships.id as membership_id, team_memberships.team, team_memberships.role from users join team_memberships on team_memberships.user = users.id;"
|
|
486
|
-
}), v(n, "team_users", t), await d.collections.create({
|
|
487
|
-
name: "team_invites",
|
|
488
|
-
type: "base",
|
|
489
|
-
fields: [
|
|
490
|
-
{
|
|
491
|
-
name: "id",
|
|
492
|
-
type: "text",
|
|
493
|
-
primaryKey: !0,
|
|
494
|
-
autogeneratePattern: "[a-z0-9]{15}",
|
|
495
|
-
max: 15,
|
|
496
|
-
min: 15,
|
|
497
|
-
pattern: "^[a-z0-9]+$",
|
|
498
|
-
required: !0
|
|
499
|
-
},
|
|
500
|
-
{
|
|
501
|
-
name: "team",
|
|
502
|
-
type: "relation",
|
|
503
|
-
cascadeDelete: !0,
|
|
504
|
-
collectionId: y.id,
|
|
505
|
-
maxSelect: 1,
|
|
506
|
-
minSelect: 0,
|
|
507
|
-
required: !0
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
name: "email",
|
|
511
|
-
type: "email",
|
|
512
|
-
required: !0
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
name: "created",
|
|
516
|
-
onCreate: !0,
|
|
517
|
-
onUpdate: !1,
|
|
518
|
-
type: "autodate"
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
name: "updated",
|
|
522
|
-
onCreate: !0,
|
|
523
|
-
onUpdate: !0,
|
|
524
|
-
type: "autodate"
|
|
525
|
-
}
|
|
526
|
-
]
|
|
527
|
-
}), v(n, "team_invites", t), await d.collections.create({
|
|
528
|
-
name: "team_invite_links",
|
|
529
|
-
type: "base",
|
|
530
|
-
fields: [
|
|
531
|
-
{
|
|
532
|
-
name: "id",
|
|
533
|
-
autogeneratePattern: "[a-z0-9]{15}",
|
|
534
|
-
max: 15,
|
|
535
|
-
min: 15,
|
|
536
|
-
pattern: "^[a-z0-9]+$",
|
|
537
|
-
primaryKey: !0,
|
|
538
|
-
required: !0,
|
|
539
|
-
type: "text"
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
name: "team",
|
|
543
|
-
cascadeDelete: !0,
|
|
544
|
-
collectionId: y.id,
|
|
545
|
-
maxSelect: 1,
|
|
546
|
-
minSelect: 0,
|
|
547
|
-
required: !0,
|
|
548
|
-
type: "relation"
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
name: "created",
|
|
552
|
-
onCreate: !0,
|
|
553
|
-
onUpdate: !1,
|
|
554
|
-
type: "autodate"
|
|
555
|
-
},
|
|
556
|
-
{
|
|
557
|
-
name: "updated",
|
|
558
|
-
onCreate: !0,
|
|
559
|
-
onUpdate: !0,
|
|
560
|
-
type: "autodate"
|
|
561
|
-
}
|
|
562
|
-
],
|
|
563
|
-
indexes: [
|
|
564
|
-
"CREATE UNIQUE INDEX `idx_9y3Oz1KVzz` ON `team_invite_links` (`team`)"
|
|
565
|
-
]
|
|
566
|
-
}), v(n, "team_invite_links", t);
|
|
567
|
-
const a = await _(
|
|
568
|
-
d,
|
|
569
|
-
j,
|
|
570
|
-
t
|
|
571
|
-
);
|
|
572
|
-
n.push(...a);
|
|
573
|
-
});
|
|
574
|
-
const o = [], r = A.join(
|
|
575
|
-
t.root,
|
|
576
|
-
"src",
|
|
577
|
-
"routes",
|
|
578
|
-
"(app)",
|
|
579
|
-
"+layout.server.ts"
|
|
580
|
-
);
|
|
581
|
-
f.existsSync(r) && (R(r), o.push({
|
|
582
|
-
path: r,
|
|
583
|
-
language: "ts",
|
|
584
|
-
content: f.readFileSync(r, "utf8")
|
|
585
|
-
}));
|
|
586
|
-
const p = A.join(
|
|
587
|
-
t.root,
|
|
588
|
-
"src",
|
|
589
|
-
"routes",
|
|
590
|
-
"(app)",
|
|
591
|
-
"+layout.svelte"
|
|
592
|
-
);
|
|
593
|
-
f.existsSync(p) && L(p) && o.push({
|
|
594
|
-
path: p,
|
|
595
|
-
language: "svelte",
|
|
596
|
-
content: f.readFileSync(p, "utf8")
|
|
597
|
-
});
|
|
598
|
-
const m = A.join(
|
|
599
|
-
t.root,
|
|
600
|
-
"src",
|
|
601
|
-
"lib",
|
|
602
|
-
"components",
|
|
603
|
-
"app-sidebar.svelte"
|
|
604
|
-
);
|
|
605
|
-
f.existsSync(m) && q(m) && o.push({
|
|
606
|
-
path: m,
|
|
607
|
-
language: "svelte",
|
|
608
|
-
content: f.readFileSync(m, "utf8")
|
|
609
|
-
});
|
|
610
|
-
const g = A.join(
|
|
611
|
-
t.root,
|
|
612
|
-
"src",
|
|
613
|
-
"lib",
|
|
614
|
-
"components",
|
|
615
|
-
"nav-user.svelte"
|
|
616
|
-
);
|
|
617
|
-
return M(g) && o.push({
|
|
618
|
-
path: g,
|
|
619
|
-
language: "svelte",
|
|
620
|
-
content: f.readFileSync(g, "utf8")
|
|
621
|
-
}), {
|
|
622
|
-
creates: n,
|
|
623
|
-
modifies: o,
|
|
624
|
-
deletes: [],
|
|
625
|
-
components: [],
|
|
626
|
-
packages: [],
|
|
627
|
-
collections: []
|
|
628
|
-
};
|
|
629
|
-
}
|
|
630
|
-
export {
|
|
631
|
-
X as generate
|
|
632
|
-
};
|
|
633
|
-
//# sourceMappingURL=generate.runtime-DBTOrhnc.js.map
|