@zuplo/cli 6.10.0 → 6.11.0
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/__tests__/engine.test.js.map +1 -1
- package/dist/cmds/compile.d.ts.map +1 -1
- package/dist/cmds/compile.js +5 -0
- package/dist/cmds/compile.js.map +1 -1
- package/dist/compile/handler.d.ts +1 -0
- package/dist/compile/handler.d.ts.map +1 -1
- package/dist/compile/handler.js +1 -0
- package/dist/compile/handler.js.map +1 -1
- package/dist/convert/engine.d.ts +3 -3
- package/dist/convert/engine.d.ts.map +1 -1
- package/dist/convert/engine.js.map +1 -1
- package/dist/convert/handler.js.map +1 -1
- package/dist/convert/{routes.generated.d.ts → routes.legacy.d.ts} +1 -1
- package/dist/convert/routes.legacy.d.ts.map +1 -0
- package/dist/convert/routes.legacy.js +2 -0
- package/dist/convert/routes.legacy.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/convert/routes.generated.d.ts.map +0 -1
- package/dist/convert/routes.generated.js +0 -2
- package/dist/convert/routes.generated.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.test.js","sourceRoot":"","sources":["../../src/__tests__/engine.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,YAAY,GAAoB;YACpC,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,IAAI;oBACV,UAAU,EAAE,KAAK;iBAClB;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,UAAU,EAAE,EAAE;iBACf;aACF;Y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G,EAAE;wBACH,OAAO,EAAE,YAAY;wBACrB,WAAW,EAAE,sBAAsB;wBACnC,WAAW,EAAE,SAAS;wBACtB,eAAe,EAAE;4BACf,UAAU,EAAE,eAAe;4BAC3B,OAAO,EAAE;gCACP,MAAM,EAAE,mBAAmB;gCAC3B,MAAM,EAAE,yBAAyB;gCACjC,OAAO,EAAE;oCACP,cAAc,EAAE,2BAA2B;oCAC3C,aAAa,EAAE,IAAI;iCACpB;6BACF;yBACF;qBACF;oBACD,IAAI,EAAE;wBACJ,OAAO,EAAE,YAAY;wBACrB,WAAW,EAAE,sBAAsB;wBACnC,WAAW,EAAE,SAAS;wBACtB,eAAe,EAAE;4BACf,UAAU,EAAE,eAAe;4BAC3B,OAAO,EAAE;gCACP,MAAM,EAAE,mBAAmB;gCAC3B,MAAM,EAAE,yBAAyB;gCACjC,OAAO,EAAE;oCACP,cAAc,EAAE,2BAA2B;oCAC3C,aAAa,EAAE,IAAI;iCACpB;6BACF;yBACF;qBACF;oBACD,cAAc,EAAE;wBACd,QAAQ,EAAE,aAAa;qBACxB;iBACF;aACF;SACF,CAAC;QACF,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-floating-promises */\nimport { expect } from \"chai\";\nimport { describe, it } from \"node:test\";\nimport { convertRoutes } from \"../convert/engine.js\";\nimport { RouteConfigFile } from \"../convert/routes.generated.js\";\n\ndescribe(\"Routes.json Conversion Engine\", () => {\n it(\"should handle simple route conversion (no version)\", () => {\n const routesConfig: RouteConfigFile = {\n versions: [\n {\n name: \"v1\",\n pathPrefix: \"/v1\",\n },\n {\n name: \"none\",\n pathPrefix: \"\",\n },\n ],\n routes: [\n {\n methods: [\"GET\"],\n path: \"/test\",\n summary: \"Test route\",\n version: \"none\",\n corsPolicy: \"anything-goes\",\n description: \"This is a test route\",\n operationId: \"random\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n ],\n };\n const expected = {\n openapi: \"3.1.0\",\n info: {\n title: \"Converted from config/routes.json\",\n version: \"1.0.0\",\n },\n paths: {\n \"/test\": {\n get: {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n },\n \"x-zuplo-path\": {\n pathMode: \"url-pattern\",\n },\n },\n },\n };\n const actual = convertRoutes(routesConfig);\n expect(actual).to.deep.equal(expected);\n });\n\n it(\"should handle simple route conversion (with version)\", () => {\n const routesConfig: RouteConfigFile = {\n versions: [\n {\n name: \"v1\",\n pathPrefix: \"/v1\",\n },\n {\n name: \"none\",\n pathPrefix: \"\",\n },\n ],\n routes: [\n {\n methods: [\"GET\"],\n path: \"/test\",\n summary: \"Test route\",\n version: \"v1\",\n corsPolicy: \"anything-goes\",\n description: \"This is a test route\",\n operationId: \"random\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n ],\n };\n const expected = {\n openapi: \"3.1.0\",\n info: {\n title: \"Converted from config/routes.json\",\n version: \"1.0.0\",\n },\n paths: {\n \"/v1/test\": {\n get: {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n },\n \"x-zuplo-path\": {\n pathMode: \"url-pattern\",\n },\n },\n },\n };\n const actual = convertRoutes(routesConfig);\n expect(actual).to.deep.equal(expected);\n });\n\n it(\"should handle single route with multiple methods\", () => {\n const routesConfig: RouteConfigFile = {\n versions: [\n {\n name: \"v1\",\n pathPrefix: \"/v1\",\n },\n {\n name: \"none\",\n pathPrefix: \"\",\n },\n ],\n routes: [\n {\n methods: [\"GET\", \"POST\", \"HEAD\"],\n path: \"/test\",\n summary: \"Test route\",\n version: \"v1\",\n corsPolicy: \"anything-goes\",\n description: \"This is a test route\",\n operationId: \"random\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n ],\n };\n const expected = {\n openapi: \"3.1.0\",\n info: {\n title: \"Converted from config/routes.json\",\n version: \"1.0.0\",\n },\n paths: {\n \"/v1/test\": {\n \"get,post,head\": {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n },\n \"x-zuplo-path\": {\n pathMode: \"url-pattern\",\n },\n },\n },\n };\n const actual = convertRoutes(routesConfig);\n expect(actual).to.deep.equal(expected);\n });\n\n it(\"should handle single route with different methods\", () => {\n const routesConfig: RouteConfigFile = {\n versions: [\n {\n name: \"v1\",\n pathPrefix: \"/v1\",\n },\n {\n name: \"none\",\n pathPrefix: \"\",\n },\n ],\n routes: [\n {\n methods: [\"GET\"],\n path: \"/test\",\n summary: \"Test route\",\n description: \"This is a test route\",\n version: \"v1\",\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://welcome.zuplo.io/\",\n forwardSearch: true,\n },\n },\n operationId: \"random1\",\n },\n {\n methods: [\"POST\"],\n path: \"/test\",\n summary: \"Test route\",\n description: \"This is a test route\",\n version: \"v1\",\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://welcome.zuplo.io/\",\n forwardSearch: true,\n },\n },\n operationId: \"random2\",\n },\n ],\n };\n const expected = {\n openapi: \"3.1.0\",\n info: {\n title: \"Converted from config/routes.json\",\n version: \"1.0.0\",\n },\n paths: {\n \"/v1/test\": {\n get: {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random1\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://welcome.zuplo.io/\",\n forwardSearch: true,\n },\n },\n },\n },\n post: {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random2\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://welcome.zuplo.io/\",\n forwardSearch: true,\n },\n },\n },\n },\n \"x-zuplo-path\": {\n pathMode: \"url-pattern\",\n },\n },\n },\n };\n const actual = convertRoutes(routesConfig);\n expect(actual).to.deep.equal(expected);\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"engine.test.js","sourceRoot":"","sources":["../../src/__tests__/engine.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,Q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B;4BAC3C,aAAa,EAAE,IAAI;yBACpB;qBACF;oBACD,WAAW,EAAE,SAAS;iBACvB;aACF;SACF,CAAC;QACF,MAAM,QAAQ,GAAG;YACf,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE;gBACJ,KAAK,EAAE,mCAAmC;gBAC1C,OAAO,EAAE,OAAO;aACjB;YACD,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV,GAAG,EAAE;wBACH,OAAO,EAAE,YAAY;wBACrB,WAAW,EAAE,sBAAsB;wBACnC,WAAW,EAAE,SAAS;wBACtB,eAAe,EAAE;4BACf,UAAU,EAAE,eAAe;4BAC3B,OAAO,EAAE;gCACP,MAAM,EAAE,mBAAmB;gCAC3B,MAAM,EAAE,yBAAyB;gCACjC,OAAO,EAAE;oCACP,cAAc,EAAE,2BAA2B;oCAC3C,aAAa,EAAE,IAAI;iCACpB;6BACF;yBACF;qBACF;oBACD,IAAI,EAAE;wBACJ,OAAO,EAAE,YAAY;wBACrB,WAAW,EAAE,sBAAsB;wBACnC,WAAW,EAAE,SAAS;wBACtB,eAAe,EAAE;4BACf,UAAU,EAAE,eAAe;4BAC3B,OAAO,EAAE;gCACP,MAAM,EAAE,mBAAmB;gCAC3B,MAAM,EAAE,yBAAyB;gCACjC,OAAO,EAAE;oCACP,cAAc,EAAE,2BAA2B;oCAC3C,aAAa,EAAE,IAAI;iCACpB;6BACF;yBACF;qBACF;oBACD,cAAc,EAAE;wBACd,QAAQ,EAAE,aAAa;qBACxB;iBACF;aACF;SACF,CAAC;QACF,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-floating-promises */\nimport { expect } from \"chai\";\nimport { describe, it } from \"node:test\";\nimport { convertRoutes } from \"../convert/engine.js\";\nimport { RouteConfigFile } from \"../convert/routes.legacy.js\";\n\ndescribe(\"Routes.json Conversion Engine\", () => {\n it(\"should handle simple route conversion (no version)\", () => {\n const routesConfig: RouteConfigFile = {\n versions: [\n {\n name: \"v1\",\n pathPrefix: \"/v1\",\n },\n {\n name: \"none\",\n pathPrefix: \"\",\n },\n ],\n routes: [\n {\n methods: [\"GET\"],\n path: \"/test\",\n summary: \"Test route\",\n version: \"none\",\n corsPolicy: \"anything-goes\",\n description: \"This is a test route\",\n operationId: \"random\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n ],\n };\n const expected = {\n openapi: \"3.1.0\",\n info: {\n title: \"Converted from config/routes.json\",\n version: \"1.0.0\",\n },\n paths: {\n \"/test\": {\n get: {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n },\n \"x-zuplo-path\": {\n pathMode: \"url-pattern\",\n },\n },\n },\n };\n const actual = convertRoutes(routesConfig);\n expect(actual).to.deep.equal(expected);\n });\n\n it(\"should handle simple route conversion (with version)\", () => {\n const routesConfig: RouteConfigFile = {\n versions: [\n {\n name: \"v1\",\n pathPrefix: \"/v1\",\n },\n {\n name: \"none\",\n pathPrefix: \"\",\n },\n ],\n routes: [\n {\n methods: [\"GET\"],\n path: \"/test\",\n summary: \"Test route\",\n version: \"v1\",\n corsPolicy: \"anything-goes\",\n description: \"This is a test route\",\n operationId: \"random\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n ],\n };\n const expected = {\n openapi: \"3.1.0\",\n info: {\n title: \"Converted from config/routes.json\",\n version: \"1.0.0\",\n },\n paths: {\n \"/v1/test\": {\n get: {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n },\n \"x-zuplo-path\": {\n pathMode: \"url-pattern\",\n },\n },\n },\n };\n const actual = convertRoutes(routesConfig);\n expect(actual).to.deep.equal(expected);\n });\n\n it(\"should handle single route with multiple methods\", () => {\n const routesConfig: RouteConfigFile = {\n versions: [\n {\n name: \"v1\",\n pathPrefix: \"/v1\",\n },\n {\n name: \"none\",\n pathPrefix: \"\",\n },\n ],\n routes: [\n {\n methods: [\"GET\", \"POST\", \"HEAD\"],\n path: \"/test\",\n summary: \"Test route\",\n version: \"v1\",\n corsPolicy: \"anything-goes\",\n description: \"This is a test route\",\n operationId: \"random\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n ],\n };\n const expected = {\n openapi: \"3.1.0\",\n info: {\n title: \"Converted from config/routes.json\",\n version: \"1.0.0\",\n },\n paths: {\n \"/v1/test\": {\n \"get,post,head\": {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://jsonplaceholder.typicode.com/todos\",\n forwardSearch: true,\n },\n },\n },\n },\n \"x-zuplo-path\": {\n pathMode: \"url-pattern\",\n },\n },\n },\n };\n const actual = convertRoutes(routesConfig);\n expect(actual).to.deep.equal(expected);\n });\n\n it(\"should handle single route with different methods\", () => {\n const routesConfig: RouteConfigFile = {\n versions: [\n {\n name: \"v1\",\n pathPrefix: \"/v1\",\n },\n {\n name: \"none\",\n pathPrefix: \"\",\n },\n ],\n routes: [\n {\n methods: [\"GET\"],\n path: \"/test\",\n summary: \"Test route\",\n description: \"This is a test route\",\n version: \"v1\",\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://welcome.zuplo.io/\",\n forwardSearch: true,\n },\n },\n operationId: \"random1\",\n },\n {\n methods: [\"POST\"],\n path: \"/test\",\n summary: \"Test route\",\n description: \"This is a test route\",\n version: \"v1\",\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://welcome.zuplo.io/\",\n forwardSearch: true,\n },\n },\n operationId: \"random2\",\n },\n ],\n };\n const expected = {\n openapi: \"3.1.0\",\n info: {\n title: \"Converted from config/routes.json\",\n version: \"1.0.0\",\n },\n paths: {\n \"/v1/test\": {\n get: {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random1\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://welcome.zuplo.io/\",\n forwardSearch: true,\n },\n },\n },\n },\n post: {\n summary: \"Test route\",\n description: \"This is a test route\",\n operationId: \"random2\",\n \"x-zuplo-route\": {\n corsPolicy: \"anything-goes\",\n handler: {\n export: \"urlRewriteHandler\",\n module: \"$import(@zuplo/runtime)\",\n options: {\n rewritePattern: \"https://welcome.zuplo.io/\",\n forwardSearch: true,\n },\n },\n },\n },\n \"x-zuplo-path\": {\n pathMode: \"url-pattern\",\n },\n },\n },\n };\n const actual = convertRoutes(routesConfig);\n expect(actual).to.deep.equal(expected);\n });\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/cmds/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAaV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/cmds/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;;;;qBAaV,IAAI,KAAG,IAAI,CAAC,OAAO,CAAC;oBAgCf,OAAO;;AArC/B,wBAyCE"}
|
package/dist/cmds/compile.js
CHANGED
|
@@ -15,6 +15,11 @@ export default {
|
|
|
15
15
|
default: ".",
|
|
16
16
|
normalize: true,
|
|
17
17
|
hidden: true,
|
|
18
|
+
})
|
|
19
|
+
.option("bundled-script", {
|
|
20
|
+
type: "string",
|
|
21
|
+
describe: "The .js file representing a built zup. Use to skip build and bundling.",
|
|
22
|
+
hidden: true,
|
|
18
23
|
})
|
|
19
24
|
.option("port", {
|
|
20
25
|
type: "number",
|
package/dist/cmds/compile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/cmds/compile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AACvE,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAa,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE3D,eAAe;IAEb,IAAI,EAAE,KAAK;IAEX,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,MAAM,CAAC,KAAK,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,mCAAmC;YAC7C,OAAO,EAAE,GAAG;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,IAAI;SACb,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,mCAAmC;YAC7C,OAAO,EAAE,IAAI;SACd,CAAC;aACD,MAAM,CAAC,aAAa,EAAE;YACrB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,OAAO,EAAE,cAAc;SACxB,CAAC;aACD,UAAU,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;aACnC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACpB,OAAO,MAAM,IAAI,YAAY,CAC3B,IAAI,qBAAqB,EAAE,CAC5B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;QACnD,MAAM,OAAO,CAAC,IAAiB,CAAC,CAAC;IACnC,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { captureEvent } from \"../common/analytics/lib.js\";\nimport { identify } from \"../common/middleware/user-identification.js\";\nimport setBlocking from \"../common/output.js\";\nimport { ZuploProjectValidator } from \"../common/validators/file-system-validator.js\";\nimport { YargsChecker } from \"../common/validators/lib.js\";\nimport { Arguments, compile } from \"../compile/handler.js\";\n\nexport default {\n // For now, hide this command\n desc: false,\n // desc: \"Compiles a self-contained zup binary\",\n command: \"compile\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .option(\"dir\", {\n type: \"string\",\n describe: \"The directory containing your zup\",\n default: \".\",\n normalize: true,\n hidden: true,\n })\n .option(\"port\", {\n type: \"number\",\n describe: \"The port to run the zup server on\",\n default: 9000,\n })\n .option(\"binary-name\", {\n type: \"string\",\n describe: \"The name of the binary\",\n default: \"compiled-zup\",\n })\n .middleware([setBlocking, identify])\n .check(async (argv) => {\n return await new YargsChecker<typeof argv>(\n new ZuploProjectValidator()\n ).check(argv);\n });\n },\n handler: async (argv: unknown) => {\n await captureEvent({ argv, event: \"zup compile\" });\n await compile(argv as Arguments);\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/cmds/compile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AACvE,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAa,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE3D,eAAe;IAEb,IAAI,EAAE,KAAK;IAEX,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,CAAC,KAAW,EAAiB,EAAE;QACtC,OAAO,KAAK;aACT,MAAM,CAAC,KAAK,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,mCAAmC;YAC7C,OAAO,EAAE,GAAG;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,IAAI;SACb,CAAC;aACD,MAAM,CAAC,gBAAgB,EAAE;YACxB,IAAI,EAAE,QAAQ;YACd,QAAQ,EACN,wEAAwE;YAC1E,MAAM,EAAE,IAAI;SACb,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,mCAAmC;YAC7C,OAAO,EAAE,IAAI;SACd,CAAC;aACD,MAAM,CAAC,aAAa,EAAE;YACrB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,wBAAwB;YAClC,OAAO,EAAE,cAAc;SACxB,CAAC;aACD,UAAU,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;aACnC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACpB,OAAO,MAAM,IAAI,YAAY,CAC3B,IAAI,qBAAqB,EAAE,CAC5B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;QACnD,MAAM,OAAO,CAAC,IAAiB,CAAC,CAAC;IACnC,CAAC;CACF,CAAC","sourcesContent":["import { Argv } from \"yargs\";\nimport { captureEvent } from \"../common/analytics/lib.js\";\nimport { identify } from \"../common/middleware/user-identification.js\";\nimport setBlocking from \"../common/output.js\";\nimport { ZuploProjectValidator } from \"../common/validators/file-system-validator.js\";\nimport { YargsChecker } from \"../common/validators/lib.js\";\nimport { Arguments, compile } from \"../compile/handler.js\";\n\nexport default {\n // For now, hide this command\n desc: false,\n // desc: \"Compiles a self-contained zup binary\",\n command: \"compile\",\n builder: (yargs: Argv): Argv<unknown> => {\n return yargs\n .option(\"dir\", {\n type: \"string\",\n describe: \"The directory containing your zup\",\n default: \".\",\n normalize: true,\n hidden: true,\n })\n .option(\"bundled-script\", {\n type: \"string\",\n describe:\n \"The .js file representing a built zup. Use to skip build and bundling.\",\n hidden: true,\n })\n .option(\"port\", {\n type: \"number\",\n describe: \"The port to run the zup server on\",\n default: 9000,\n })\n .option(\"binary-name\", {\n type: \"string\",\n describe: \"The name of the binary\",\n default: \"compiled-zup\",\n })\n .middleware([setBlocking, identify])\n .check(async (argv) => {\n return await new YargsChecker<typeof argv>(\n new ZuploProjectValidator()\n ).check(argv);\n });\n },\n handler: async (argv: unknown) => {\n await captureEvent({ argv, event: \"zup compile\" });\n await compile(argv as Arguments);\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/compile/handler.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/compile/handler.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,iBAkE5C"}
|
package/dist/compile/handler.js
CHANGED
|
@@ -28,6 +28,7 @@ export async function compile(argv) {
|
|
|
28
28
|
const zupPort = argv.port;
|
|
29
29
|
await core.compileWorkerdServer({
|
|
30
30
|
sourceDirectory,
|
|
31
|
+
bundledScript: argv["bundled-script"],
|
|
31
32
|
port: zupPort,
|
|
32
33
|
binaryName: argv["binary-name"],
|
|
33
34
|
publicZuploEnvironmentVariables: envZuplo
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/compile/handler.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;A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Ae,EAAE,YAAY,CAAC,CAAC;IACzD,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAGD,MAAM,MAAM,GAAG;QACb,gBAAgB,EAAE,aAAa,CAAC,eAAe,CAAC;KACjD,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAG1D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAE7C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;IAE1B,MAAM,IAAI,CAAC,oBAAoB,CAAC;QAC9B,eAAe;QACf,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC;QACrC,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC;QAC/B,+BAA+B,EAAE,QAAQ;YACvC,CAAC,CAAC;gBACE,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;gBAC/C,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;gBAC/C,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;aACxD;YACH,CAAC;gBACC,SAAS;QACb,MAAM;KACP,CAAC,CAAC;IAEH,yBAAyB,CAAC,yCAAyC,CAAC,CAAC;IACrE,yBAAyB,CACvB,8BAA8B,eAAe,SAAS,IAAI,CAAC,aAAa,CAAC,EAAE,CAC5E,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable node/no-process-env */\nimport dotenv from \"dotenv\";\nimport { cpSync, existsSync, readFileSync } from \"node:fs\";\nimport { join, relative, resolve } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { printDiagnosticsToConsole } from \"../common/output.js\";\nimport { logger } from \"../common/logger.js\";\n\nexport interface Arguments {\n dir: string;\n \"bundled-script\": string;\n port: number;\n \"binary-name\": string;\n}\n\nexport async function compile(argv: Arguments) {\n const sourceDirectory = resolve(join(relative(process.cwd(), argv.dir)));\n\n // When we build, we MIGHT need to use the @zuplo/runtime from the node_modules if the user\n // has installed our packages using https://www.npmjs.com/package/zuplo in a global directory\n\n // Try to copy the @zuplo/runtime locally\n const zuploRuntimePath = new URL(\n \"../../node_modules/@zuplo/runtime\",\n import.meta.url\n );\n if (existsSync(zuploRuntimePath)) {\n cpSync(\n zuploRuntimePath,\n join(sourceDirectory, \"node_modules/@zuplo/runtime\"),\n {\n recursive: true,\n dereference: true,\n }\n );\n }\n\n // Set GLOBAL_MODULE_LOCATION to the location of the CLIs node_modules\n process.env.GLOBAL_MODULE_LOCATION = fileURLToPath(\n new URL(\"../../node_modules\", import.meta.url)\n );\n\n // Check if the user has a .env.zuplo file\n let envZuplo: dotenv.DotenvParseOutput = {};\n const envZuploFile = join(sourceDirectory, \".env.zuplo\");\n if (existsSync(envZuploFile)) {\n const contents = readFileSync(envZuploFile);\n envZuplo = dotenv.parse(contents);\n }\n\n // Set other variables using __ZUPLO_CONFIG\n const config = {\n build_assets_url: pathToFileURL(sourceDirectory),\n };\n process.env.__ZUPLO_CONFIG = btoa(JSON.stringify(config));\n\n // Use a dynamic import so that setting process.env has effect\n const core = await import(\"@zuplo/core/cli\");\n\n const zupPort = argv.port;\n\n await core.compileWorkerdServer({\n sourceDirectory,\n bundledScript: argv[\"bundled-script\"],\n port: zupPort,\n binaryName: argv[\"binary-name\"],\n publicZuploEnvironmentVariables: envZuplo\n ? {\n ZUPLO_ACCOUNT_NAME: envZuplo.ZUPLO_ACCOUNT_NAME,\n ZUPLO_PROJECT_NAME: envZuplo.ZUPLO_PROJECT_NAME,\n ZUPLO_ENVIRONMENT_TYPE: envZuplo.ZUPLO_ENVIRONMENT_TYPE,\n }\n : // Leave this as undefined to simulate the old behavior\n undefined,\n logger,\n });\n\n printDiagnosticsToConsole(\"📦 Compiled a self-contained zup binary\");\n printDiagnosticsToConsole(\n `The binary is available at ${sourceDirectory}/dist/${argv[\"binary-name\"]}`\n );\n}\n"]}
|
package/dist/convert/engine.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RouteConfigFile } from "./routes.
|
|
1
|
+
import { RouteConfigFile } from "./routes.legacy.js";
|
|
2
2
|
export declare function convertRoutes(routesConfig: RouteConfigFile): {
|
|
3
3
|
openapi: string;
|
|
4
4
|
info: {
|
|
@@ -8,7 +8,7 @@ export declare function convertRoutes(routesConfig: RouteConfigFile): {
|
|
|
8
8
|
paths: {};
|
|
9
9
|
};
|
|
10
10
|
export declare function convertPolicies(routes: RouteConfigFile): {
|
|
11
|
-
policies: import("./routes.
|
|
12
|
-
corsPolicies: import("./routes.
|
|
11
|
+
policies: import("./routes.legacy.js").PolicyConfigurationFragment[];
|
|
12
|
+
corsPolicies: import("./routes.legacy.js").CorsPolicyConfiguration[];
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/convert/engine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/convert/engine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,wBAAgB,aAAa,CAAC,YAAY,EAAE,eAAe;;;;;;;EA8D1D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe;;;EAQtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/convert/engine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,UAAU,aAAa,CAAC,YAA6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AAC;AAKD,SAAS,yBAAyB;IAChC,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE;YACJ,KAAK,EAAE,mCAAmC;YAC1C,OAAO,EAAE,OAAO;SACjB;QACD,KAAK,EAAE,EAAE;KACV,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CACf,IAAuC,EACvC,OAAwB;IAExB,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAC3C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,CAC/B,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAChB,OAAO,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { join } from \"node:path\";\nimport { RouteConfigFile } from \"./routes.
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/convert/engine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,UAAU,aAAa,CAAC,YAA6B;IACzD,MAAM,IAAI,GAAG,yBAAyB,EAAE,CAAC;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAY,CAAC;IAEhC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACpC,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAEpD,IAAI,UAAe,CAAC;QACpB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;YAC1B,UAAU,GAAG,EAAS,CAAC;YAEvB,UAAU,CAAC,cAAc,CAAC,GAAG;gBAC3B,QAAQ,EAAE,aAAa;aACxB,CAAC;YACF,KAAK,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC;QACpC,CAAC;QAED,UAAU,GAAG,KAAK,CAAC,aA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slint/no-explicit-any */\nimport { join } from \"node:path\";\nimport { RouteConfigFile } from \"./routes.legacy.js\";\n\nexport function convertRoutes(routesConfig: RouteConfigFile) {\n const base = generateBaseOpenAPIConfig();\n const paths = base.paths as any;\n\n routesConfig.routes.forEach((route) => {\n const pathObjectKey = fullPath(route, routesConfig);\n\n let pathObject: any;\n if (!paths[pathObjectKey]) {\n pathObject = {} as any;\n // Default the path to url-pattern\n pathObject[\"x-zuplo-path\"] = {\n pathMode: \"url-pattern\",\n };\n paths[pathObjectKey] = pathObject;\n }\n\n pathObject = paths[pathObjectKey];\n\n const operationKey = route.methods.map((m) => m.toLowerCase()).join(\",\");\n const operation = {} as any;\n\n if (route.excludeFromOpenApi) {\n operation[\"x-internal\"] = true;\n }\n\n operation[\"summary\"] = route.summary;\n operation[\"description\"] = route.description;\n operation[\"operationId\"] = route.operationId;\n\n // Support for openapi types we supported for a short time\n // for a while that some customers are actually using\n const routeWithOpenApi = route as {\n responses?: any;\n parameters?: any;\n tags?: any;\n };\n if (routeWithOpenApi.parameters) {\n operation[\"parameters\"] = routeWithOpenApi.parameters;\n }\n if (routeWithOpenApi.responses) {\n operation[\"responses\"] = routeWithOpenApi.responses;\n }\n if (routeWithOpenApi.tags) {\n operation[\"tags\"] = routeWithOpenApi.tags;\n }\n\n const xZuploRoute = {} as any;\n if (route.corsPolicy) xZuploRoute[\"corsPolicy\"] = route.corsPolicy;\n if (route.custom) xZuploRoute[\"custom\"] = route.custom;\n if (route.policies) xZuploRoute[\"policies\"] = route.policies;\n if (route.key) xZuploRoute[\"key\"] = route.key;\n if (route.label) xZuploRoute[\"label\"] = route.label;\n\n xZuploRoute[\"handler\"] = route.handler;\n\n operation[\"x-zuplo-route\"] = xZuploRoute;\n\n pathObject[operationKey] = operation;\n });\n\n return base;\n}\n\nexport function convertPolicies(routes: RouteConfigFile) {\n const policies = routes.policies;\n const corsPolicies = routes.corsPolicies;\n\n return {\n policies: policies ? [...policies] : [],\n corsPolicies: corsPolicies ? [...corsPolicies] : [],\n };\n}\n\n// Utilities\n////////////\n\nfunction generateBaseOpenAPIConfig() {\n return {\n openapi: \"3.1.0\",\n info: {\n title: \"Converted from config/routes.json\",\n version: \"1.0.0\",\n },\n paths: {},\n };\n}\n\nfunction fullPath(\n path: { path: string; version: string },\n context: RouteConfigFile\n) {\n const versionPrefix = context.versions.filter(\n (v) => v.name === path.version\n )[0].pathPrefix;\n return join(versionPrefix, path.path);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/convert/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,oCAAoC,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAO7D,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAe;IAC3C,IAAI,CAAC;QAEH,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACrB,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACzD,MAAM,SAAS,GAAG,MAAM,QAAQ,CAC9B,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,aAAa,CAAC,CAC7C,CAAC;QACF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAoB,CAAC;QAGnE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QAGtC,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QACzE,MAAM,gBAAgB,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;YACtE,MAAM,EAAE,gBAAgB;SACzB,CAAC,CAAC;QACH,aAAa,CAAC,eAAe,EAAE,gBAAgB,EAAE;YAC/C,IAAI,EAAE,GAAG;SACV,CAAC,CAAC;QAGH,MAAM,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QAGzC,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;QACxE,MAAM,iBAAiB,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;YACxE,MAAM,EAAE,gBAAgB;SACzB,CAAC,CAAC;QACH,aAAa,CAAC,gBAAgB,EAAE,iBAAiB,EAAE;YACjD,IAAI,EAAE,GAAG;SACV,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,MAAM,oCAAoC,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["import { writeFileSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { join, relative } from \"node:path\";\nimport prettier from \"prettier\";\nimport { logger } from \"../common/logger.js\";\nimport { printCriticalFailureToConsoleAndExit } from \"../common/output.js\";\nimport { convertPolicies, convertRoutes } from \"./engine.js\";\nimport { RouteConfigFile } from \"./routes.
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/convert/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,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AAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;YACxE,MAAM,EAAE,gBAAgB;SACzB,CAAC,CAAC;QACH,aAAa,CAAC,gBAAgB,EAAE,iBAAiB,EAAE;YACjD,IAAI,EAAE,GAAG;SACV,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,MAAM,oCAAoC,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["import { writeFileSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { join, relative } from \"node:path\";\nimport prettier from \"prettier\";\nimport { logger } from \"../common/logger.js\";\nimport { printCriticalFailureToConsoleAndExit } from \"../common/output.js\";\nimport { convertPolicies, convertRoutes } from \"./engine.js\";\nimport { RouteConfigFile } from \"./routes.legacy.js\";\n\nexport interface Arguments {\n dir: string;\n}\n\nexport async function convert(argv: Arguments) {\n try {\n // 1. Read the routes.json\n const dir = argv.dir;\n const normalizedDir = join(relative(process.cwd(), dir));\n const rawRoutes = await readFile(\n join(normalizedDir, \"config\", \"routes.json\")\n );\n const routes = JSON.parse(rawRoutes.toString()) as RouteConfigFile;\n\n // 2. Convert to OpenAPI\n const openApi = convertRoutes(routes);\n\n // 3. Write to routes.oas.json\n const openAPIFilePath = join(normalizedDir, \"config\", \"routes.oas.json\");\n const formattedOpenAPI = await prettier.format(JSON.stringify(openApi), {\n parser: \"json-stringify\",\n });\n writeFileSync(openAPIFilePath, formattedOpenAPI, {\n flag: \"w\",\n });\n\n // 4. Extract policies\n const policies = convertPolicies(routes);\n\n // 5. Write policies\n const policiesFilePath = join(normalizedDir, \"config\", \"policies.json\");\n const formattedPolicies = await prettier.format(JSON.stringify(policies), {\n parser: \"json-stringify\",\n });\n writeFileSync(policiesFilePath, formattedPolicies, {\n flag: \"w\",\n });\n } catch (err) {\n logger.error(err);\n await printCriticalFailureToConsoleAndExit(err);\n }\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1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.legacy.js","sourceRoot":"","sources":["../../src/convert/routes.legacy.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @deprecated This is the legacy route.json format, it should only be\n * used for conversion purposes.\n */\nexport interface RouteConfigFile {\n $schema?: string;\n /**\n * @minItems 1\n */\n versions: [VersionData, ...VersionData[]];\n /**\n * @minItems 0\n */\n routes: RouteConfigurationFragment[];\n policies?: PolicyConfigurationFragment[];\n corsPolicies?: CorsPolicyConfiguration[];\n requestErrorHandler?: HandlerDefinition;\n}\n\n/**\n * @deprecated This is the legacy route.json format, it should only be\n * used for conversion purposes.\n */\nexport interface VersionData {\n name: string;\n pathPrefix: string;\n info?: Info;\n /**\n * The project relative path to the OpenAPI spec.\n */\n openApiFile?: string;\n /**\n * If false, OpenAPI documentation will not be generated for this version. If openApiFile is set this setting is ignored.\n */\n excludeFromOpenApi?: boolean;\n /**\n * If true, schema validation found in the OpenAPI spec will be enforced on requests/responses.\n */\n enforceOpenApi?: boolean;\n}\n\n/**\n * @deprecated This is the legacy route.json format, it should only be\n * used for conversion purposes.\n */\nexport interface Info {\n title: string;\n summary?: string;\n description?: string;\n termsOfService?: string;\n version: string;\n [k: string]: unknown;\n}\n\n/**\n * @deprecated This is the legacy route.json format, it should only be\n * used for conversion purposes.\n */\nexport interface RouteConfigurationFragment {\n operationId?: string;\n path: string;\n methods: (\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"CONNECT\"\n | \"OPTIONS\"\n | \"TRACE\"\n | \"PATCH\"\n )[];\n /**\n * An internal user-friendly identifier of the route.\n */\n label?: string;\n /**\n * If true, schema validation found in the OpenAPI spec will be enforced on requests/responses.\n */\n enforceOpenApi?: boolean;\n key?: string;\n handler: HandlerDefinition;\n corsPolicy?: string;\n custom?: unknown;\n version: string;\n policies?: {\n inbound?: string[];\n outbound?: string[];\n };\n summary?: string;\n description?: string;\n excludeFromOpenApi?: boolean;\n tags?: string[];\n}\n\n/**\n * @deprecated This is the legacy route.json format, it should only be\n * used for conversion purposes.\n */\nexport interface HandlerDefinition {\n module: string;\n export: string;\n options?: {\n [k: string]: unknown;\n };\n}\n\n/**\n * @deprecated This is the legacy route.json format, it should only be\n * used for conversion purposes.\n */\nexport interface PolicyConfigurationFragment {\n name: string;\n policyType: string;\n handler: HandlerDefinition;\n options?: {\n [k: string]: unknown;\n };\n}\n\n/**\n * @deprecated This is the legacy route.json format, it should only be\n * used for conversion purposes.\n */\nexport interface CorsPolicyConfiguration {\n name: string;\n allowCredentials?: boolean;\n maxAge?: number;\n allowedOrigins: string[];\n allowedMethods?: (\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"CONNECT\"\n | \"OPTIONS\"\n | \"TRACE\"\n | \"PATCH\"\n )[];\n allowedHeaders?: string[];\n exposeHeaders?: string[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/cli.ts","../src/__tests__/archive-utils.test.ts","../src/__tests__/engine.test.ts","../src/__tests__/import-openapi-utils.test.ts","../src/__tests__/import-openapi.test.ts","../src/__tests__/oas-test-data.ts","../src/__tests__/outdated.test.ts","../src/__tests__/tsconfig-upgrader.test.ts","../src/build/handler.ts","../src/cmds/build.ts","../src/cmds/compile.ts","../src/cmds/convert.ts","../src/cmds/delete.ts","../src/cmds/deploy.ts","../src/cmds/dev.ts","../src/cmds/editor.ts","../src/cmds/link.ts","../src/cmds/list.ts","../src/cmds/login.ts","../src/cmds/test.ts","../src/cmds/project/import-openapi.ts","../src/cmds/project/index.ts","../src/cmds/project/update.ts","../src/cmds/tunnel/create.ts","../src/cmds/tunnel/delete.ts","../src/cmds/tunnel/describe.ts","../src/cmds/tunnel/index.ts","../src/cmds/tunnel/list.ts","../src/cmds/tunnel/rotate-token.ts","../src/cmds/tunnel/services/describe.ts","../src/cmds/tunnel/services/index.ts","../src/cmds/tunnel/services/update.ts","../src/cmds/variable/create.ts","../src/cmds/variable/index.ts","../src/cmds/variable/update.ts","../src/common/alias.ts","../src/common/args.ts","../src/common/constants.ts","../src/common/handler.ts","../src/common/logger.ts","../src/common/models.ts","../src/common/outdated.ts","../src/common/output.ts","../src/common/settings.ts","../src/common/analytics/lib.ts","../src/common/api/lib.ts","../src/common/machine-id/lib.ts","../src/common/middleware/user-configuration.ts","../src/common/middleware/user-identification.ts","../src/common/upgraders/lib.ts","../src/common/upgraders/package-json-upgrader.ts","../src/common/upgraders/tsconfig-upgrader.ts","../src/common/upgraders/vscode-settings-json-upgrader.ts","../src/common/utils/box.ts","../src/common/utils/ports.ts","../src/common/utils/types.ts","../src/common/utils/urls.ts","../src/common/validators/file-system-validator.ts","../src/common/validators/lib.ts","../src/common/validators/login-state-validator.ts","../src/common/validators/project-name-validator.ts","../src/common/xdg/lib.ts","../src/compile/handler.ts","../src/convert/engine.ts","../src/convert/handler.ts","../src/convert/routes.
|
|
1
|
+
{"root":["../src/cli.ts","../src/__tests__/archive-utils.test.ts","../src/__tests__/engine.test.ts","../src/__tests__/import-openapi-utils.test.ts","../src/__tests__/import-openapi.test.ts","../src/__tests__/oas-test-data.ts","../src/__tests__/outdated.test.ts","../src/__tests__/tsconfig-upgrader.test.ts","../src/build/handler.ts","../src/cmds/build.ts","../src/cmds/compile.ts","../src/cmds/convert.ts","../src/cmds/delete.ts","../src/cmds/deploy.ts","../src/cmds/dev.ts","../src/cmds/editor.ts","../src/cmds/link.ts","../src/cmds/list.ts","../src/cmds/login.ts","../src/cmds/test.ts","../src/cmds/project/import-openapi.ts","../src/cmds/project/index.ts","../src/cmds/project/update.ts","../src/cmds/tunnel/create.ts","../src/cmds/tunnel/delete.ts","../src/cmds/tunnel/describe.ts","../src/cmds/tunnel/index.ts","../src/cmds/tunnel/list.ts","../src/cmds/tunnel/rotate-token.ts","../src/cmds/tunnel/services/describe.ts","../src/cmds/tunnel/services/index.ts","../src/cmds/tunnel/services/update.ts","../src/cmds/variable/create.ts","../src/cmds/variable/index.ts","../src/cmds/variable/update.ts","../src/common/alias.ts","../src/common/args.ts","../src/common/constants.ts","../src/common/handler.ts","../src/common/logger.ts","../src/common/models.ts","../src/common/outdated.ts","../src/common/output.ts","../src/common/settings.ts","../src/common/analytics/lib.ts","../src/common/api/lib.ts","../src/common/machine-id/lib.ts","../src/common/middleware/user-configuration.ts","../src/common/middleware/user-identification.ts","../src/common/upgraders/lib.ts","../src/common/upgraders/package-json-upgrader.ts","../src/common/upgraders/tsconfig-upgrader.ts","../src/common/upgraders/vscode-settings-json-upgrader.ts","../src/common/utils/box.ts","../src/common/utils/ports.ts","../src/common/utils/types.ts","../src/common/utils/urls.ts","../src/common/validators/file-system-validator.ts","../src/common/validators/lib.ts","../src/common/validators/login-state-validator.ts","../src/common/validators/project-name-validator.ts","../src/common/xdg/lib.ts","../src/compile/handler.ts","../src/convert/engine.ts","../src/convert/handler.ts","../src/convert/routes.legacy.ts","../src/delete/handler.ts","../src/delete/poll-deployment.ts","../src/deploy/archive.ts","../src/deploy/environments.ts","../src/deploy/file-upload.ts","../src/deploy/handler.ts","../src/deploy/poll-deployment.ts","../src/dev/handler.ts","../src/editor/handler.ts","../src/editor/assets/index-03352ce7.js","../src/editor/server/cors-plugin.ts","../src/editor/server/server.ts","../src/editor/server/xfs.ts","../src/link/handler.ts","../src/link/populate.ts","../src/list/handler.ts","../src/login/handler.ts","../src/login/server.ts","../src/project/import-openapi/handler.ts","../src/project/import-openapi/interfaces.ts","../src/project/import-openapi/utils.ts","../src/project/update/handler.ts","../src/test/esbuild-config.ts","../src/test/handler.ts","../src/test/invoke-test.ts","../src/test/esbuild-plugins/node-test-prep-plugin.ts","../src/tunnel/models.ts","../src/tunnel/create/handler.ts","../src/tunnel/delete/handler.ts","../src/tunnel/delete/poll-teardown-operation.ts","../src/tunnel/describe/handler.ts","../src/tunnel/list/handler.ts","../src/tunnel/rotate-token/handler.ts","../src/tunnel/services/describe/handler.ts","../src/tunnel/services/update/handler.ts","../src/tunnel/services/update/poll-provisioning-operations.ts","../src/variable/models.ts","../src/variable/create/handler.ts","../src/variable/update/handler.ts"],"version":"5.6.2"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/cli",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.11.0",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@opentelemetry/api": "^1.8.0",
|
|
30
30
|
"@sentry/node": "^7.119.2",
|
|
31
31
|
"@swc/core": "1.7.6",
|
|
32
|
-
"@zuplo/core": "^6.
|
|
32
|
+
"@zuplo/core": "^6.11.0",
|
|
33
33
|
"@zuplo/pino-pretty-configurations": "^1.5.0",
|
|
34
|
-
"@zuplo/runtime": "^6.
|
|
34
|
+
"@zuplo/runtime": "^6.11.0",
|
|
35
35
|
"chalk": "^5.3.0",
|
|
36
36
|
"chokidar": "^3.5.3",
|
|
37
37
|
"dotenv": "^16.4.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes.generated.d.ts","sourceRoot":"","sources":["../../src/convert/routes.generated.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,QAAQ,EAAE,CAAC,WAAW,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC;IAI1C,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,QAAQ,CAAC,EAAE,2BAA2B,EAAE,CAAC;IACzC,YAAY,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACzC,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;CACzC;AACD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,CAAC;IAI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C,EAAE,MAAM,GAAG,OAAO,CAAC;KACtB,CAAC;CACH;AACD,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,CAAC,EAAE;QACR,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;KACtB,CAAC;CACH;AACD,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,CACb,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,QAAQ,GACR,SAAS,GACT,SAAS,GACT,OAAO,GACP,OAAO,CACV,EAAE,CAAC;IACJ,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes.generated.js","sourceRoot":"","sources":["../../src/convert/routes.generated.ts"],"names":[],"mappings":"","sourcesContent":["/* tslint:disable */\n/**\n * This file was automatically generated by json-schema-to-typescript.\n * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n * and run json-schema-to-typescript to regenerate this file.\n */\n\nexport interface RouteConfigFile {\n $schema?: string;\n /**\n * @minItems 1\n */\n versions: [VersionData, ...VersionData[]];\n /**\n * @minItems 0\n */\n routes: RouteConfigurationFragment[];\n policies?: PolicyConfigurationFragment[];\n corsPolicies?: CorsPolicyConfiguration[];\n requestErrorHandler?: HandlerDefinition;\n}\nexport interface VersionData {\n name: string;\n pathPrefix: string;\n info?: Info;\n /**\n * The project relative path to the OpenAPI spec.\n */\n openApiFile?: string;\n /**\n * If false, OpenAPI documentation will not be generated for this version. If openApiFile is set this setting is ignored.\n */\n excludeFromOpenApi?: boolean;\n /**\n * If true, schema validation found in the OpenAPI spec will be enforced on requests/responses.\n */\n enforceOpenApi?: boolean;\n}\nexport interface Info {\n title: string;\n summary?: string;\n description?: string;\n termsOfService?: string;\n version: string;\n [k: string]: unknown;\n}\nexport interface RouteConfigurationFragment {\n operationId?: string;\n path: string;\n methods: (\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"CONNECT\"\n | \"OPTIONS\"\n | \"TRACE\"\n | \"PATCH\"\n )[];\n /**\n * An internal user-friendly identifier of the route.\n */\n label?: string;\n /**\n * If true, schema validation found in the OpenAPI spec will be enforced on requests/responses.\n */\n enforceOpenApi?: boolean;\n key?: string;\n handler: HandlerDefinition;\n corsPolicy?: string;\n custom?: unknown;\n version: string;\n policies?: {\n inbound?: string[];\n outbound?: string[];\n };\n summary?: string;\n description?: string;\n excludeFromOpenApi?: boolean;\n tags?: string[];\n}\nexport interface HandlerDefinition {\n module: string;\n export: string;\n options?: {\n [k: string]: unknown;\n };\n}\nexport interface PolicyConfigurationFragment {\n name: string;\n policyType: string;\n handler: HandlerDefinition;\n options?: {\n [k: string]: unknown;\n };\n}\nexport interface CorsPolicyConfiguration {\n name: string;\n allowCredentials?: boolean;\n maxAge?: number;\n allowedOrigins: string[];\n allowedMethods?: (\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"CONNECT\"\n | \"OPTIONS\"\n | \"TRACE\"\n | \"PATCH\"\n )[];\n allowedHeaders?: string[];\n exposeHeaders?: string[];\n}\n"]}
|