alepha 0.19.4 → 0.19.5
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/api/audits/index.d.ts +8 -8
- package/dist/api/issues/index.d.ts +810 -0
- package/dist/api/issues/index.d.ts.map +1 -0
- package/dist/api/issues/index.js +447 -0
- package/dist/api/issues/index.js.map +1 -0
- package/dist/api/keys/index.d.ts +5 -5
- package/dist/api/users/index.d.ts +6 -0
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +10 -3
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/workflows/index.d.ts +3 -3
- package/dist/captcha/index.d.ts +142 -0
- package/dist/captcha/index.d.ts.map +1 -0
- package/dist/captcha/index.js +177 -0
- package/dist/captcha/index.js.map +1 -0
- package/dist/cli/core/index.d.ts +82 -2
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +90 -6
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +84 -10
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +92 -4
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/vendor/index.d.ts +30 -3
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/cli/vendor/index.js +98 -21
- package/dist/cli/vendor/index.js.map +1 -1
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +2 -3
- package/dist/command/index.js.map +1 -1
- package/dist/orm/core/index.bun.js +6 -6
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +6 -6
- package/dist/orm/core/index.js.map +1 -1
- package/dist/react/i18n/index.d.ts +1 -0
- package/dist/react/i18n/index.d.ts.map +1 -1
- package/dist/react/i18n/index.js +8 -4
- package/dist/react/i18n/index.js.map +1 -1
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +145 -2
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +364 -63
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js.map +1 -1
- package/package.json +11 -1
- package/src/api/issues/__tests__/IssueService.spec.ts +263 -0
- package/src/api/issues/controllers/AdminIssueController.ts +149 -0
- package/src/api/issues/controllers/IssueController.ts +44 -0
- package/src/api/issues/entities/issues.ts +49 -0
- package/src/api/issues/index.ts +53 -0
- package/src/api/issues/schemas/createIssueSchema.ts +13 -0
- package/src/api/issues/schemas/issueConfigAtom.ts +13 -0
- package/src/api/issues/schemas/issueQuerySchema.ts +18 -0
- package/src/api/issues/schemas/issueResourceSchema.ts +6 -0
- package/src/api/issues/schemas/myIssueQuerySchema.ts +10 -0
- package/src/api/issues/schemas/updateIssueSchema.ts +13 -0
- package/src/api/issues/services/IssueService.ts +264 -0
- package/src/api/users/primitives/$realm.ts +24 -0
- package/src/api/users/services/CredentialService.ts +6 -3
- package/src/api/users/services/RegistrationService.ts +15 -5
- package/src/api/users/services/SessionService.ts +2 -0
- package/src/captcha/__tests__/MemoryCaptchaProvider.spec.ts +74 -0
- package/src/captcha/index.ts +33 -0
- package/src/captcha/providers/CaptchaProvider.ts +17 -0
- package/src/captcha/providers/MemoryCaptchaProvider.ts +65 -0
- package/src/captcha/providers/TurnstileCaptchaProvider.ts +125 -0
- package/src/cli/core/atoms/buildOptions.ts +57 -0
- package/src/cli/core/commands/build.ts +2 -0
- package/src/cli/core/providers/ViteDevServerProvider.ts +1 -1
- package/src/cli/core/services/ViteUtils.ts +5 -2
- package/src/cli/core/tasks/BuildClientTask.ts +3 -1
- package/src/cli/core/tasks/BuildCloudflareTask.ts +4 -0
- package/src/cli/core/tasks/BuildPwaTask.ts +81 -0
- package/src/cli/platform/adapters/CloudflareAdapter.ts +24 -0
- package/src/cli/platform/atoms/platformOptions.ts +19 -3
- package/src/cli/platform/hooks/PlatformHook.ts +51 -0
- package/src/cli/platform/index.ts +1 -0
- package/src/cli/platform/services/CloudflareApi.ts +22 -1
- package/src/cli/platform/services/PlatformOrchestrator.ts +67 -2
- package/src/cli/vendor/__tests__/VendorService.spec.ts +40 -1
- package/src/cli/vendor/commands/VendorCommand.ts +41 -38
- package/src/cli/vendor/services/VendorService.ts +108 -4
- package/src/command/__tests__/CliProvider.spec.ts +45 -0
- package/src/command/providers/CliProvider.ts +3 -4
- package/src/orm/core/services/Repository.ts +20 -6
- package/src/react/i18n/__tests__/I18nProvider.spec.ts +83 -0
- package/src/react/i18n/providers/I18nProvider.ts +12 -10
- package/src/security/primitives/$issuer.ts +3 -1
- package/src/server/auth/index.ts +7 -0
- package/src/server/auth/primitives/$auth.ts +37 -3
- package/src/server/auth/primitives/$authApple.ts +114 -4
- package/src/server/auth/primitives/$authFacebook.ts +98 -0
- package/src/server/auth/primitives/$authFranceConnect.ts +105 -0
- package/src/server/auth/primitives/$authGithub.ts +22 -16
- package/src/server/auth/primitives/$authMicrosoft.ts +88 -0
- package/src/server/auth/providers/ServerAuthProvider.ts +197 -72
- package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -0
- package/src/server/core/__tests__/ServerRouterProvider-errorHandler.spec.ts +1 -1
- package/src/websocket/providers/NodeWebSocketServerProvider.ts +3 -1
package/dist/cli/core/index.js
CHANGED
|
@@ -74,6 +74,19 @@ const buildOptions = $atom({
|
|
|
74
74
|
}))
|
|
75
75
|
})),
|
|
76
76
|
static: t.optional(t.object({ domain: t.optional(t.string()) })),
|
|
77
|
+
pwa: t.optional(t.object({
|
|
78
|
+
name: t.string(),
|
|
79
|
+
shortName: t.optional(t.string()),
|
|
80
|
+
themeColor: t.optional(t.string()),
|
|
81
|
+
backgroundColor: t.optional(t.string()),
|
|
82
|
+
display: t.optional(t.enum([
|
|
83
|
+
"standalone",
|
|
84
|
+
"fullscreen",
|
|
85
|
+
"minimal-ui",
|
|
86
|
+
"browser"
|
|
87
|
+
])),
|
|
88
|
+
offline: t.optional(t.boolean())
|
|
89
|
+
})),
|
|
77
90
|
sitemap: t.optional(t.object({ hostname: t.string() }))
|
|
78
91
|
}),
|
|
79
92
|
default: {}
|
|
@@ -408,7 +421,7 @@ var ViteUtils = class {
|
|
|
408
421
|
}
|
|
409
422
|
};
|
|
410
423
|
}
|
|
411
|
-
generateIndexHtml(entry) {
|
|
424
|
+
generateIndexHtml(entry, opts) {
|
|
412
425
|
const style = entry.style;
|
|
413
426
|
const browser = entry.browser ?? entry.server;
|
|
414
427
|
return `
|
|
@@ -417,7 +430,7 @@ var ViteUtils = class {
|
|
|
417
430
|
<head>
|
|
418
431
|
<meta charset="UTF-8" />
|
|
419
432
|
<title>App</title>
|
|
420
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
433
|
+
<meta name="viewport" content="width=device-width, initial-scale=1"/>${opts?.pwa ? "\n<link rel=\"manifest\" href=\"/manifest.webmanifest\" />" : ""}
|
|
421
434
|
${style ? `<link rel="stylesheet" href="/${style}" />` : ""}
|
|
422
435
|
</head>
|
|
423
436
|
<body>
|
|
@@ -1737,7 +1750,7 @@ var BuildClientTask = class extends BuildTask {
|
|
|
1737
1750
|
const publicDir = ctx.options.output?.public ?? "public";
|
|
1738
1751
|
const stats = ctx.options.stats ?? false;
|
|
1739
1752
|
const isCI = this.alepha.isCI();
|
|
1740
|
-
const template = this.viteUtils.generateIndexHtml(ctx.entry);
|
|
1753
|
+
const template = this.viteUtils.generateIndexHtml(ctx.entry, { pwa: !!ctx.options.pwa });
|
|
1741
1754
|
await this.fs.mkdir(this.fs.join(ctx.root, "node_modules/.alepha"));
|
|
1742
1755
|
const indexHtmlPath = this.fs.join(ctx.root, "node_modules/.alepha/index.html");
|
|
1743
1756
|
await this.fs.writeFile(indexHtmlPath, template);
|
|
@@ -1897,11 +1910,13 @@ var BuildCloudflareTask = class BuildCloudflareTask extends BuildTask {
|
|
|
1897
1910
|
if (!url?.startsWith("d1:")) return;
|
|
1898
1911
|
const [dbName, id] = url.replace("d1://", "").replace("d1:", "").split(":");
|
|
1899
1912
|
const binding = BuildCloudflareTask.D1_BINDING;
|
|
1913
|
+
const jurisdiction = process.env.CLOUDFLARE_JURISDICTION;
|
|
1900
1914
|
wrangler.d1_databases = wrangler.d1_databases || [];
|
|
1901
1915
|
wrangler.d1_databases.push({
|
|
1902
1916
|
binding,
|
|
1903
1917
|
database_name: dbName,
|
|
1904
|
-
database_id: id
|
|
1918
|
+
database_id: id,
|
|
1919
|
+
...jurisdiction ? { jurisdiction } : {}
|
|
1905
1920
|
});
|
|
1906
1921
|
wrangler.vars ??= {};
|
|
1907
1922
|
wrangler.vars.DATABASE_URL = `d1://${binding}`;
|
|
@@ -1922,10 +1937,12 @@ var BuildCloudflareTask = class BuildCloudflareTask extends BuildTask {
|
|
|
1922
1937
|
enhanceR2(wrangler) {
|
|
1923
1938
|
const bucketName = process.env.R2_BUCKET_NAME;
|
|
1924
1939
|
if (!bucketName) return;
|
|
1940
|
+
const jurisdiction = process.env.CLOUDFLARE_JURISDICTION;
|
|
1925
1941
|
wrangler.r2_buckets = wrangler.r2_buckets || [];
|
|
1926
1942
|
wrangler.r2_buckets.push({
|
|
1927
1943
|
binding: bucketName,
|
|
1928
|
-
bucket_name: bucketName
|
|
1944
|
+
bucket_name: bucketName,
|
|
1945
|
+
...jurisdiction ? { jurisdiction } : {}
|
|
1929
1946
|
});
|
|
1930
1947
|
wrangler.vars ??= {};
|
|
1931
1948
|
wrangler.vars.R2_BUCKET_NAME = bucketName;
|
|
@@ -2220,6 +2237,72 @@ var BuildPrerenderTask = class extends BuildTask {
|
|
|
2220
2237
|
}
|
|
2221
2238
|
};
|
|
2222
2239
|
//#endregion
|
|
2240
|
+
//#region ../../src/cli/core/tasks/BuildPwaTask.ts
|
|
2241
|
+
/**
|
|
2242
|
+
* Generate PWA web app manifest.
|
|
2243
|
+
*
|
|
2244
|
+
* Produces a `manifest.webmanifest` in the public output directory
|
|
2245
|
+
* from the `pwa` section of build options. Detects icons from `public/`.
|
|
2246
|
+
*/
|
|
2247
|
+
var BuildPwaTask = class extends BuildTask {
|
|
2248
|
+
fs = $inject(FileSystemProvider);
|
|
2249
|
+
async run(ctx) {
|
|
2250
|
+
const pwa = ctx.options.pwa;
|
|
2251
|
+
if (!pwa || !ctx.hasClient) return;
|
|
2252
|
+
const distDir = ctx.options.output?.dist ?? "dist";
|
|
2253
|
+
const publicDir = ctx.options.output?.public ?? "public";
|
|
2254
|
+
const outputDir = this.fs.join(ctx.root, distDir, publicDir);
|
|
2255
|
+
await ctx.run({
|
|
2256
|
+
name: "generate pwa manifest",
|
|
2257
|
+
handler: async () => {
|
|
2258
|
+
const icons = await this.detectIcons(outputDir);
|
|
2259
|
+
const manifest = {
|
|
2260
|
+
name: pwa.name,
|
|
2261
|
+
short_name: pwa.shortName ?? pwa.name,
|
|
2262
|
+
start_url: "/",
|
|
2263
|
+
display: pwa.display ?? "standalone",
|
|
2264
|
+
theme_color: pwa.themeColor ?? "#ffffff",
|
|
2265
|
+
background_color: pwa.backgroundColor ?? "#ffffff"
|
|
2266
|
+
};
|
|
2267
|
+
if (icons.length > 0) manifest.icons = icons;
|
|
2268
|
+
const output = this.fs.join(outputDir, "manifest.webmanifest");
|
|
2269
|
+
await this.fs.writeFile(output, JSON.stringify(manifest, null, 2));
|
|
2270
|
+
}
|
|
2271
|
+
});
|
|
2272
|
+
}
|
|
2273
|
+
/**
|
|
2274
|
+
* Detect icon files in the public output directory.
|
|
2275
|
+
*
|
|
2276
|
+
* Looks for common icon filenames and generates
|
|
2277
|
+
* manifest icon entries with appropriate sizes and types.
|
|
2278
|
+
*/
|
|
2279
|
+
async detectIcons(publicDir) {
|
|
2280
|
+
const icons = [];
|
|
2281
|
+
for (const candidate of [
|
|
2282
|
+
{
|
|
2283
|
+
file: "icon-192.png",
|
|
2284
|
+
sizes: "192x192",
|
|
2285
|
+
type: "image/png"
|
|
2286
|
+
},
|
|
2287
|
+
{
|
|
2288
|
+
file: "icon-512.png",
|
|
2289
|
+
sizes: "512x512",
|
|
2290
|
+
type: "image/png"
|
|
2291
|
+
},
|
|
2292
|
+
{
|
|
2293
|
+
file: "icon.svg",
|
|
2294
|
+
sizes: "any",
|
|
2295
|
+
type: "image/svg+xml"
|
|
2296
|
+
}
|
|
2297
|
+
]) if (await this.fs.exists(this.fs.join(publicDir, candidate.file))) icons.push({
|
|
2298
|
+
src: `/${candidate.file}`,
|
|
2299
|
+
sizes: candidate.sizes,
|
|
2300
|
+
type: candidate.type
|
|
2301
|
+
});
|
|
2302
|
+
return icons;
|
|
2303
|
+
}
|
|
2304
|
+
};
|
|
2305
|
+
//#endregion
|
|
2223
2306
|
//#region ../../src/cli/core/tasks/BuildServerTask.ts
|
|
2224
2307
|
/**
|
|
2225
2308
|
* Build server-side SSR bundle with Vite.
|
|
@@ -2679,6 +2762,7 @@ var BuildCommand = class {
|
|
|
2679
2762
|
$inject(BuildServerTask),
|
|
2680
2763
|
$inject(BuildAssetsTask),
|
|
2681
2764
|
$inject(BuildSitemapTask),
|
|
2765
|
+
$inject(BuildPwaTask),
|
|
2682
2766
|
$inject(BuildPrerenderTask),
|
|
2683
2767
|
$inject(BuildVercelTask),
|
|
2684
2768
|
$inject(BuildCloudflareTask),
|
|
@@ -3550,7 +3634,7 @@ if (import.meta.hot) {
|
|
|
3550
3634
|
});
|
|
3551
3635
|
}
|
|
3552
3636
|
<\/script>`);
|
|
3553
|
-
if (style) tags.push(`<
|
|
3637
|
+
if (style) tags.push(`<script type="module">import "/${style}";<\/script>`);
|
|
3554
3638
|
if (browser) tags.push(`<script type="module" src="/${browser}"><\/script>`);
|
|
3555
3639
|
return tags.join("\n");
|
|
3556
3640
|
}
|