@ebay-dt/bonfire-next 0.2.0-alpha.0 → 0.2.0-alpha.11
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 +9 -3
- package/dist/client/lifecycle-provider.d.ts.map +1 -1
- package/dist/client/lifecycle-provider.js +1 -1
- package/dist/client/lifecycle-provider.js.map +1 -1
- package/dist/server/create-bonfire-next.d.ts +7 -0
- package/dist/server/create-bonfire-next.d.ts.map +1 -1
- package/dist/server/create-bonfire-next.js +14 -28
- package/dist/server/create-bonfire-next.js.map +1 -1
- package/dist/server/entry-coordinator.d.ts +15 -4
- package/dist/server/entry-coordinator.d.ts.map +1 -1
- package/dist/server/entry-coordinator.js +13 -7
- package/dist/server/entry-coordinator.js.map +1 -1
- package/dist/server/prototype-actions.d.ts +4 -1
- package/dist/server/prototype-actions.d.ts.map +1 -1
- package/dist/server/prototype-actions.js +83 -2
- package/dist/server/prototype-actions.js.map +1 -1
- package/dist/server/prototype-source-link.d.ts +11 -0
- package/dist/server/prototype-source-link.d.ts.map +1 -0
- package/dist/server/prototype-source-link.js +59 -0
- package/dist/server/prototype-source-link.js.map +1 -0
- package/dist/server/repository-actions.d.ts +6 -4
- package/dist/server/repository-actions.d.ts.map +1 -1
- package/dist/server/repository-actions.js +71 -3
- package/dist/server/repository-actions.js.map +1 -1
- package/dist/server/repository-routes.d.ts +1 -0
- package/dist/server/repository-routes.d.ts.map +1 -1
- package/dist/server/repository-routes.js +7 -0
- package/dist/server/repository-routes.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-routes.d.ts","sourceRoot":"","sources":["../../src/server/repository-routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repository-routes.d.ts","sourceRoot":"","sources":["../../src/server/repository-routes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7B,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,gBAAgB,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvC,CAAC;AAqBF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;CAC5B,GAAG,gBAAgB,CAgCnB","sourcesContent":["import { NextResponse } from \"next/server.js\";\nimport { lifecycleFailure, type LifecycleResult } from \"@ebay-dt/bonfire-core\";\nimport type { RepositoryActions } from \"./repository-actions.js\";\n\nexport type RepositoryRoutes = {\n summary(): Promise<Response>;\n check(): Promise<Response>;\n update(): Promise<Response>;\n retry(): Promise<Response>;\n retryPreparation(): Promise<Response>;\n};\n\nfunction responseFor<Value>(result: LifecycleResult<Value>) {\n if (result.ok) {\n return NextResponse.json(result.value, {\n headers: { \"Cache-Control\": \"no-store\" },\n });\n }\n\n const status =\n result.error.code === \"unauthenticated\"\n ? 401\n : result.error.code === \"forbidden\"\n ? 403\n : 500;\n return new NextResponse(null, {\n status,\n headers: { \"Cache-Control\": \"no-store\" },\n });\n}\n\nexport function createRepositoryRoutes(options: {\n production: boolean;\n actions: RepositoryActions;\n}): RepositoryRoutes {\n const unavailable = () => new Response(null, { status: 404 });\n return {\n async summary() {\n return options.production\n ? unavailable()\n : responseFor(await options.actions.getSummary());\n },\n async check() {\n return options.production\n ? unavailable()\n : responseFor(await options.actions.check());\n },\n async update() {\n return options.production\n ? unavailable()\n : responseFor(await options.actions.applyUpdates());\n },\n async retry() {\n return options.production\n ? unavailable()\n : responseFor(await options.actions.retry());\n },\n async retryPreparation() {\n return options.production\n ? unavailable()\n : responseFor(\n await (options.actions.retryPreparation?.() ??\n Promise.resolve(lifecycleFailure(\"forbidden\"))),\n );\n },\n };\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NextResponse } from "next/server.js";
|
|
2
|
+
import { lifecycleFailure } from "@ebay-dt/bonfire-core";
|
|
2
3
|
function responseFor(result) {
|
|
3
4
|
if (result.ok) {
|
|
4
5
|
return NextResponse.json(result.value, {
|
|
@@ -38,6 +39,12 @@ export function createRepositoryRoutes(options) {
|
|
|
38
39
|
? unavailable()
|
|
39
40
|
: responseFor(await options.actions.retry());
|
|
40
41
|
},
|
|
42
|
+
async retryPreparation() {
|
|
43
|
+
return options.production
|
|
44
|
+
? unavailable()
|
|
45
|
+
: responseFor(await (options.actions.retryPreparation?.() ??
|
|
46
|
+
Promise.resolve(lifecycleFailure("forbidden"))));
|
|
47
|
+
},
|
|
41
48
|
};
|
|
42
49
|
}
|
|
43
50
|
//# sourceMappingURL=repository-routes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-routes.js","sourceRoot":"","sources":["../../src/server/repository-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"repository-routes.js","sourceRoot":"","sources":["../../src/server/repository-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAwB,MAAM,uBAAuB,CAAC;AAW/E,SAAS,WAAW,CAAQ,MAA8B;IACxD,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;QACd,OAAO,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;YACrC,OAAO,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;SACzC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,MAAM,GACV,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,iBAAiB;QACrC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gBACf,CAAC,CAAC,WAAW,CACT,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE;oBACzC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAClD,CAAC;QACR,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { NextResponse } from \"next/server.js\";\nimport { lifecycleFailure, type LifecycleResult } from \"@ebay-dt/bonfire-core\";\nimport type { RepositoryActions } from \"./repository-actions.js\";\n\nexport type RepositoryRoutes = {\n summary(): Promise<Response>;\n check(): Promise<Response>;\n update(): Promise<Response>;\n retry(): Promise<Response>;\n retryPreparation(): Promise<Response>;\n};\n\nfunction responseFor<Value>(result: LifecycleResult<Value>) {\n if (result.ok) {\n return NextResponse.json(result.value, {\n headers: { \"Cache-Control\": \"no-store\" },\n });\n }\n\n const status =\n result.error.code === \"unauthenticated\"\n ? 401\n : result.error.code === \"forbidden\"\n ? 403\n : 500;\n return new NextResponse(null, {\n status,\n headers: { \"Cache-Control\": \"no-store\" },\n });\n}\n\nexport function createRepositoryRoutes(options: {\n production: boolean;\n actions: RepositoryActions;\n}): RepositoryRoutes {\n const unavailable = () => new Response(null, { status: 404 });\n return {\n async summary() {\n return options.production\n ? unavailable()\n : responseFor(await options.actions.getSummary());\n },\n async check() {\n return options.production\n ? unavailable()\n : responseFor(await options.actions.check());\n },\n async update() {\n return options.production\n ? unavailable()\n : responseFor(await options.actions.applyUpdates());\n },\n async retry() {\n return options.production\n ? unavailable()\n : responseFor(await options.actions.retry());\n },\n async retryPreparation() {\n return options.production\n ? unavailable()\n : responseFor(\n await (options.actions.retryPreparation?.() ??\n Promise.resolve(lifecycleFailure(\"forbidden\"))),\n );\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebay-dt/bonfire-next",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.11",
|
|
4
4
|
"description": "Next.js server integration for Bonfire.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ebay-dt/bonfire-core": "0.2.0-alpha.
|
|
35
|
-
"@ebay-dt/bonfire-node": "0.2.0-alpha.
|
|
34
|
+
"@ebay-dt/bonfire-core": "0.2.0-alpha.11",
|
|
35
|
+
"@ebay-dt/bonfire-node": "0.2.0-alpha.11",
|
|
36
36
|
"jose": "^6.1.3"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@ebay-dt/bonfire-react": "0.2.0-alpha.
|
|
39
|
+
"@ebay-dt/bonfire-react": "0.2.0-alpha.11",
|
|
40
40
|
"next": ">=16.2 <17",
|
|
41
41
|
"react": ">=19.2 <20",
|
|
42
42
|
"react-dom": ">=19.2 <20"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@ebay-dt/bonfire-react": "0.2.0-alpha.
|
|
45
|
+
"@ebay-dt/bonfire-react": "0.2.0-alpha.11",
|
|
46
46
|
"@repo/eslint-config": "0.0.0",
|
|
47
47
|
"@repo/typescript-config": "0.0.0",
|
|
48
48
|
"@types/node": "20.19.43",
|