@cedarjs/api-server 5.0.6 → 5.0.7-next.186

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.
Files changed (80) hide show
  1. package/dist/apiCLIConfigHandler.d.ts.map +1 -1
  2. package/dist/bin.js +9 -4
  3. package/dist/bothCLIConfigHandler.d.ts.map +1 -1
  4. package/dist/createServer.d.ts.map +1 -1
  5. package/dist/logFormatter/formatters.d.ts.map +1 -1
  6. package/dist/plugins/graphql.js +2 -2
  7. package/dist/plugins/lambdaLoader.d.ts.map +1 -1
  8. package/dist/serverManager.d.ts.map +1 -1
  9. package/dist/watch.d.ts.map +1 -1
  10. package/package.json +40 -71
  11. package/dist/cjs/apiCLIConfig.d.ts +0 -6
  12. package/dist/cjs/apiCLIConfig.d.ts.map +0 -1
  13. package/dist/cjs/apiCLIConfig.js +0 -71
  14. package/dist/cjs/apiCLIConfigHandler.d.ts +0 -3
  15. package/dist/cjs/apiCLIConfigHandler.d.ts.map +0 -1
  16. package/dist/cjs/apiCLIConfigHandler.js +0 -67
  17. package/dist/cjs/bin.d.ts +0 -2
  18. package/dist/cjs/bin.d.ts.map +0 -1
  19. package/dist/cjs/bin.js +0 -1002
  20. package/dist/cjs/bothCLIConfig.d.ts +0 -6
  21. package/dist/cjs/bothCLIConfig.d.ts.map +0 -1
  22. package/dist/cjs/bothCLIConfig.js +0 -76
  23. package/dist/cjs/bothCLIConfigHandler.d.ts +0 -3
  24. package/dist/cjs/bothCLIConfigHandler.d.ts.map +0 -1
  25. package/dist/cjs/bothCLIConfigHandler.js +0 -107
  26. package/dist/cjs/buildManager.d.ts +0 -15
  27. package/dist/cjs/buildManager.d.ts.map +0 -1
  28. package/dist/cjs/buildManager.js +0 -79
  29. package/dist/cjs/cliHelpers.d.ts +0 -6
  30. package/dist/cjs/cliHelpers.d.ts.map +0 -1
  31. package/dist/cjs/cliHelpers.js +0 -57
  32. package/dist/cjs/createServer.d.ts +0 -30
  33. package/dist/cjs/createServer.d.ts.map +0 -1
  34. package/dist/cjs/createServer.js +0 -145
  35. package/dist/cjs/createServerHelpers.d.ts +0 -38
  36. package/dist/cjs/createServerHelpers.d.ts.map +0 -1
  37. package/dist/cjs/createServerHelpers.js +0 -112
  38. package/dist/cjs/fastify.d.ts +0 -13
  39. package/dist/cjs/fastify.d.ts.map +0 -1
  40. package/dist/cjs/fastify.js +0 -96
  41. package/dist/cjs/logFormatter/ambient.d.js +0 -1
  42. package/dist/cjs/logFormatter/bin.d.ts +0 -2
  43. package/dist/cjs/logFormatter/bin.d.ts.map +0 -1
  44. package/dist/cjs/logFormatter/bin.js +0 -369
  45. package/dist/cjs/logFormatter/formatters.d.ts +0 -30
  46. package/dist/cjs/logFormatter/formatters.d.ts.map +0 -1
  47. package/dist/cjs/logFormatter/formatters.js +0 -275
  48. package/dist/cjs/logFormatter/index.d.ts +0 -2
  49. package/dist/cjs/logFormatter/index.d.ts.map +0 -1
  50. package/dist/cjs/logFormatter/index.js +0 -184
  51. package/dist/cjs/package.json +0 -1
  52. package/dist/cjs/plugins/api.d.ts +0 -14
  53. package/dist/cjs/plugins/api.d.ts.map +0 -1
  54. package/dist/cjs/plugins/api.js +0 -78
  55. package/dist/cjs/plugins/graphql.d.ts +0 -10
  56. package/dist/cjs/plugins/graphql.d.ts.map +0 -1
  57. package/dist/cjs/plugins/graphql.js +0 -135
  58. package/dist/cjs/plugins/lambdaLoader.d.ts +0 -34
  59. package/dist/cjs/plugins/lambdaLoader.d.ts.map +0 -1
  60. package/dist/cjs/plugins/lambdaLoader.js +0 -199
  61. package/dist/cjs/requestHandlers/awsLambdaFastify.d.ts +0 -5
  62. package/dist/cjs/requestHandlers/awsLambdaFastify.d.ts.map +0 -1
  63. package/dist/cjs/requestHandlers/awsLambdaFastify.js +0 -105
  64. package/dist/cjs/requestHandlers/utils.d.ts +0 -26
  65. package/dist/cjs/requestHandlers/utils.d.ts.map +0 -1
  66. package/dist/cjs/requestHandlers/utils.js +0 -55
  67. package/dist/cjs/serverManager.d.ts +0 -8
  68. package/dist/cjs/serverManager.d.ts.map +0 -1
  69. package/dist/cjs/serverManager.js +0 -137
  70. package/dist/cjs/types.d.ts +0 -19
  71. package/dist/cjs/types.d.ts.map +0 -1
  72. package/dist/cjs/utils.d.ts +0 -6
  73. package/dist/cjs/utils.d.ts.map +0 -1
  74. package/dist/cjs/utils.js +0 -58
  75. package/dist/cjs/watch.d.ts +0 -10
  76. package/dist/cjs/watch.d.ts.map +0 -1
  77. package/dist/cjs/watch.js +0 -399
  78. package/dist/cjs/watchPaths.d.ts +0 -3
  79. package/dist/cjs/watchPaths.d.ts.map +0 -1
  80. package/dist/cjs/watchPaths.js +0 -140
@@ -1 +1 @@
1
- {"version":3,"file":"apiCLIConfigHandler.d.ts","sourceRoot":"","sources":["../src/apiCLIConfigHandler.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,wBAAsB,OAAO,CAAC,OAAO,GAAE,gBAAqB,iBAoC3D"}
1
+ {"version":3,"file":"apiCLIConfigHandler.d.ts","sourceRoot":"","sources":["../src/apiCLIConfigHandler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,wBAAsB,OAAO,CAAC,OAAO,GAAE,gBAAqB,iBAoC3D"}
package/dist/bin.js CHANGED
@@ -1,8 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __esm = (fn, res) => function __init() {
5
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
4
+ var __esm = (fn, res, err) => function __init() {
5
+ if (err) throw err[0];
6
+ try {
7
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ } catch (e) {
9
+ throw err = [e], e;
10
+ }
6
11
  };
7
12
  var __export = (target, all) => {
8
13
  for (var name in all)
@@ -542,7 +547,7 @@ import { pathToFileURL as pathToFileURL3 } from "node:url";
542
547
  import fastifyMultiPart from "@fastify/multipart";
543
548
  import fastifyUrlData2 from "@fastify/url-data";
544
549
  import fg2 from "fast-glob";
545
- import { buildCedarContext as buildCedarContext2, noopAuthDecoder } from "@cedarjs/api/runtime";
550
+ import { buildCedarContext as buildCedarContext2 } from "@cedarjs/api/runtime";
546
551
  import { getAsyncStoreInstance as getAsyncStoreInstance3 } from "@cedarjs/context/dist/store";
547
552
  import { coerceRootPath as coerceRootPath3 } from "@cedarjs/fastify-web/dist/helpers.js";
548
553
  import { createGraphQLYoga } from "@cedarjs/graphql-server";
@@ -584,7 +589,7 @@ async function redwoodFastifyGraphQLServer(fastify2, options) {
584
589
  handler: async (req, reply) => {
585
590
  const request = createFetchRequest(req, reply);
586
591
  const cedarContext = await buildCedarContext2(request, {
587
- authDecoder: graphqlOptions.authDecoder ?? noopAuthDecoder
592
+ authDecoder: graphqlOptions.authDecoder
588
593
  });
589
594
  try {
590
595
  return await yoga.handle(request, {
@@ -1 +1 @@
1
- {"version":3,"file":"bothCLIConfigHandler.d.ts","sourceRoot":"","sources":["../src/bothCLIConfigHandler.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,wBAAsB,OAAO,CAAC,OAAO,EAAE,iBAAiB,iBAmEvD"}
1
+ {"version":3,"file":"bothCLIConfigHandler.d.ts","sourceRoot":"","sources":["../src/bothCLIConfigHandler.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,wBAAsB,OAAO,CAAC,OAAO,EAAE,iBAAiB,iBAmEvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../src/createServer.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,mBAAmB,EACnB,MAAM,EAEP,MAAM,0BAA0B,CAAA;AAsBjC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,mBAoHnE"}
1
+ {"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../src/createServer.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,mBAAmB,EACnB,MAAM,EAEP,MAAM,0BAA0B,CAAA;AAsBjC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,mBAoHnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/logFormatter/formatters.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO,OAAO,CAAA;AAE3B,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAO3C,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,EASrC,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,wBAExD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,wBAE7D,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,wBAEtD,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,WAAW,MAAM,YAE5C,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,WAI9C,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,uBAgB3D,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,uBAQxD,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,SAAS,IAAI,WAOvC,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,gB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B,GAAI,SAAS,MAAM,WAYhD,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,eAAe,MAAM,WAExD,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,uBAQ1D,CAAA;AAED,eAAO,MAAM,mBAAmB,GAC9B,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,uBAYxC,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,WAGlD,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WAMnE,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,uBAQ3D,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,WAEpC,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,WAEhD,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,OAAO,GAAG,YAEjC,CAAA"}
@@ -2,7 +2,7 @@ import { pathToFileURL } from "node:url";
2
2
  import fastifyMultiPart from "@fastify/multipart";
3
3
  import fastifyUrlData from "@fastify/url-data";
4
4
  import fg from "fast-glob";
5
- import { buildCedarContext, noopAuthDecoder } from "@cedarjs/api/runtime";
5
+ import { buildCedarContext } from "@cedarjs/api/runtime";
6
6
  import { getAsyncStoreInstance } from "@cedarjs/context/dist/store";
7
7
  import { coerceRootPath } from "@cedarjs/fastify-web/dist/helpers.js";
8
8
  import { createGraphQLYoga } from "@cedarjs/graphql-server";
@@ -45,7 +45,7 @@ async function redwoodFastifyGraphQLServer(fastify, options) {
45
45
  handler: async (req, reply) => {
46
46
  const request = createFetchRequest(req, reply);
47
47
  const cedarContext = await buildCedarContext(request, {
48
- authDecoder: graphqlOptions.authDecoder ?? noopAuthDecoder
48
+ authDecoder: graphqlOptions.authDecoder
49
49
  });
50
50
  try {
51
51
  return await yoga.handle(request, {
@@ -1 +1 @@
1
- {"version":3,"file":"lambdaLoader.d.ts","sourceRoot":"","sources":["../../src/plugins/lambdaLoader.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAGhB,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAEjB,MAAM,sBAAsB,CAAA;AAO7B,eAAO,MAAM,gBAAgB,sBAA6B,CAAA;AAC1D,eAAO,MAAM,cAAc,2BAAkC,CAAA;AAG7D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,0BAAgC,CAAA;AAIlE,eAAO,MAAM,kBAAkB,GAAU,gBAAgB,MAAM,EAAE,kBAuGhE,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1C,CAAA;AAGD,eAAO,MAAM,qBAAqB,GAChC,UAAS,4BAAiC,kBAe3C,CAAA;AA0BD,UAAU,oBAAqB,SAAQ,uBAAuB;IAC5D,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,cAAc,CAAC,oBAAoB,CAAC,EACzC,OAAO,YAAY,kBAqEpB,CAAA"}
1
+ {"version":3,"file":"lambdaLoader.d.ts","sourceRoot":"","sources":["../../src/plugins/lambdaLoader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAGhB,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAEjB,MAAM,sBAAsB,CAAA;AAO7B,eAAO,MAAM,gBAAgB,sBAA6B,CAAA;AAC1D,eAAO,MAAM,cAAc,2BAAkC,CAAA;AAG7D;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,0BAAgC,CAAA;AAIlE,eAAO,MAAM,kBAAkB,GAAU,gBAAgB,MAAM,EAAE,kBAuGhE,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1C,CAAA;AAGD,eAAO,MAAM,qBAAqB,GAChC,UAAS,4BAAiC,kBAe3C,CAAA;AA0BD,UAAU,oBAAqB,SAAQ,uBAAuB;IAC5D,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,cAAc,CAAC,oBAAoB,CAAC,EACzC,OAAO,YAAY,kBAqEpB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"serverManager.d.ts","sourceRoot":"","sources":["../src/serverManager.ts"],"names":[],"mappings":"AA6BA,qBAAa,aAAa;IACxB,OAAO,CAAC,iBAAiB,CAA4B;YAEvC,cAAc;IAyDtB,gBAAgB;IAKhB,aAAa;CAmCpB;AAED,eAAO,MAAM,aAAa,eAAsB,CAAA"}
1
+ {"version":3,"file":"serverManager.d.ts","sourceRoot":"","sources":["../src/serverManager.ts"],"names":[],"mappings":"AA0BA,qBAAa,aAAa;IACxB,OAAO,CAAC,iBAAiB,CAA4B;YAEvC,cAAc;IAsDtB,gBAAgB;IAKhB,aAAa;CAmCpB;AAED,eAAO,MAAM,aAAa,eAAsB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AAwEA;;;;;;;GAOG;AACH,wBAAsB,UAAU,kBAsD/B"}
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AAqEA;;;;;;;GAOG;AACH,wBAAsB,UAAU,kBAsD/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "5.0.6",
3
+ "version": "5.0.7-next.186",
4
4
  "description": "CedarJS's HTTP server for Serverless Functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,110 +11,78 @@
11
11
  "type": "module",
12
12
  "exports": {
13
13
  ".": {
14
- "import": {
14
+ "default": {
15
15
  "types": "./dist/createServer.d.ts",
16
16
  "default": "./dist/createServer.js"
17
- },
18
- "require": {
19
- "types": "./dist/cjs/createServer.d.ts",
20
- "default": "./dist/cjs/createServer.js"
21
17
  }
22
18
  },
23
19
  "./package.json": "./package.json",
24
20
  "./apiCliConfig": {
25
- "import": {
21
+ "default": {
26
22
  "types": "./dist/apiCLIConfig.d.ts",
27
23
  "default": "./dist/apiCLIConfig.js"
28
- },
29
- "require": {
30
- "types": "./dist/cjs/apiCLIConfig.d.ts",
31
- "default": "./dist/cjs/apiCLIConfig.js"
32
24
  }
33
25
  },
34
26
  "./bothCliConfig": {
35
- "import": {
27
+ "default": {
36
28
  "types": "./dist/bothCLIConfig.d.ts",
37
29
  "default": "./dist/bothCLIConfig.js"
38
- },
39
- "require": {
40
- "types": "./dist/cjs/bothCLIConfig.d.ts",
41
- "default": "./dist/cjs/bothCLIConfig.js"
42
30
  }
43
31
  },
44
32
  "./apiCliConfigHandler": {
45
- "import": {
33
+ "default": {
46
34
  "types": "./dist/apiCLIConfigHandler.d.ts",
47
35
  "default": "./dist/apiCLIConfigHandler.js"
48
- },
49
- "require": {
50
- "types": "./dist/cjs/apiCLIConfigHandler.d.ts",
51
- "default": "./dist/cjs/apiCLIConfigHandler.js"
36
+ }
37
+ },
38
+ "./bothCliConfigHandler": {
39
+ "default": {
40
+ "types": "./dist/bothCLIConfigHandler.d.ts",
41
+ "default": "./dist/bothCLIConfigHandler.js"
52
42
  }
53
43
  },
54
44
  "./cliHelpers": {
55
- "import": {
45
+ "default": {
56
46
  "types": "./dist/cliHelpers.d.ts",
57
47
  "default": "./dist/cliHelpers.js"
58
- },
59
- "require": {
60
- "types": "./dist/cjs/cliHelpers.d.ts",
61
- "default": "./dist/cjs/cliHelpers.js"
62
48
  }
63
49
  },
64
- "./cjs/apiCliConfigHandler": {
65
- "types": "./dist/cjs/apiCLIConfigHandler.d.ts",
66
- "default": "./dist/cjs/apiCLIConfigHandler.js"
67
- },
68
- "./cjs/cliHelpers": {
69
- "types": "./dist/cjs/cliHelpers.d.ts",
70
- "default": "./dist/cjs/cliHelpers.js"
71
- },
72
- "./cjs/bothCliConfigHandler": {
73
- "types": "./dist/cjs/bothCLIConfigHandler.d.ts",
74
- "default": "./dist/cjs/bothCLIConfigHandler.js"
75
- },
76
50
  "./fastify": {
77
- "import": {
51
+ "default": {
78
52
  "types": "./dist/fastify.d.ts",
79
53
  "default": "./dist/fastify.js"
80
- },
81
- "require": {
82
- "types": "./dist/cjs/fastify.d.ts",
83
- "default": "./dist/cjs/fastify.js"
84
54
  }
85
55
  },
86
56
  "./watch": {
87
- "import": {
57
+ "default": {
88
58
  "types": "./dist/watch.d.ts",
89
59
  "default": "./dist/watch.js"
90
- },
91
- "require": {
92
- "types": "./dist/cjs/watch.d.ts",
93
- "default": "./dist/cjs/watch.js"
60
+ }
61
+ },
62
+ "./logFormatter": {
63
+ "default": {
64
+ "types": "./dist/logFormatter/index.d.ts",
65
+ "default": "./dist/logFormatter/index.js"
94
66
  }
95
67
  },
96
68
  "./requestHandlers": {
97
- "import": {
69
+ "default": {
98
70
  "types": "./dist/requestHandlers/awsLambdaFastify.d.ts",
99
71
  "default": "./dist/requestHandlers/awsLambdaFastify.js"
100
- },
101
- "require": {
102
- "types": "./dist/cjs/requestHandlers/awsLambdaFastify.d.ts",
103
- "default": "./dist/cjs/requestHandlers/awsLambdaFastify.js"
104
72
  }
105
73
  }
106
74
  },
107
75
  "main": "./dist/createServer.js",
108
76
  "types": "./dist/createServer.d.ts",
109
77
  "bin": {
110
- "cedar-api-server-watch": "./dist/cjs/watch.js",
111
- "cedar-log-formatter": "./dist/cjs/logFormatter/bin.js",
112
- "cedar-server": "./dist/cjs/bin.js",
78
+ "cedar-api-server-watch": "./dist/watch.js",
79
+ "cedar-log-formatter": "./dist/logFormatter/bin.js",
80
+ "cedar-server": "./dist/bin.js",
113
81
  "cedarjs-api-server-watch": "./dist/watch.js",
114
82
  "cedarjs-log-formatter": "./dist/logFormatter/bin.js",
115
83
  "cedarjs-server": "./dist/bin.js",
116
- "rw-log-formatter": "./dist/cjs/logFormatter/bin.js",
117
- "rw-server": "./dist/cjs/bin.js"
84
+ "rw-log-formatter": "./dist/logFormatter/bin.js",
85
+ "rw-server": "./dist/bin.js"
118
86
  },
119
87
  "files": [
120
88
  "dist"
@@ -123,7 +91,6 @@
123
91
  "build": "node ./build.mts",
124
92
  "build:pack": "yarn pack -o cedarjs-api-server.tgz",
125
93
  "build:types": "tsc --build --verbose tsconfig.build.json",
126
- "build:types-cjs": "tsc --build --verbose tsconfig.cjs.json",
127
94
  "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build && yarn fix:permissions\"",
128
95
  "check:attw": "yarn cedar-fwtools-attw",
129
96
  "check:package": "concurrently npm:check:attw yarn:publint",
@@ -133,19 +100,20 @@
133
100
  "test:watch": "vitest watch"
134
101
  },
135
102
  "dependencies": {
136
- "@cedarjs/context": "5.0.6",
137
- "@cedarjs/fastify-web": "5.0.6",
138
- "@cedarjs/internal": "5.0.6",
139
- "@cedarjs/project-config": "5.0.6",
140
- "@cedarjs/web-server": "5.0.6",
103
+ "@cedarjs/api": "5.0.7-next.186",
104
+ "@cedarjs/context": "5.0.7-next.186",
105
+ "@cedarjs/fastify-web": "5.0.7-next.186",
106
+ "@cedarjs/internal": "5.0.7-next.186",
107
+ "@cedarjs/project-config": "5.0.7-next.186",
108
+ "@cedarjs/web-server": "5.0.7-next.186",
141
109
  "@fastify/multipart": "9.4.0",
142
110
  "@fastify/url-data": "6.0.3",
143
- "ansis": "4.2.0",
111
+ "ansis": "4.3.1",
144
112
  "chokidar": "3.6.0",
145
113
  "dotenv-defaults": "5.0.2",
146
114
  "fast-glob": "3.3.3",
147
115
  "fast-json-parse": "1.0.3",
148
- "fastify": "5.8.5",
116
+ "fastify": "5.10.0",
149
117
  "fastify-raw-body": "5.0.0",
150
118
  "picoquery": "2.5.0",
151
119
  "pretty-bytes": "5.6.0",
@@ -155,21 +123,22 @@
155
123
  "yargs": "17.7.3"
156
124
  },
157
125
  "devDependencies": {
158
- "@cedarjs/framework-tools": "5.0.6",
126
+ "@cedarjs/framework-tools": "5.0.7-next.186",
159
127
  "@types/aws-lambda": "8.10.162",
160
128
  "@types/dotenv-defaults": "^5.0.0",
161
129
  "@types/split2": "4.2.3",
162
130
  "@types/yargs": "17.0.35",
163
131
  "concurrently": "9.2.4",
164
- "graphql-yoga": "5.21.2",
132
+ "esbuild": "0.28.1",
165
133
  "memfs": "4.64.0",
134
+ "pino": "9.7.0",
166
135
  "pino-abstract-transport": "1.2.0",
167
- "publint": "0.3.21",
136
+ "publint": "0.3.22",
168
137
  "typescript": "5.9.3",
169
- "vitest": "3.2.6"
138
+ "vitest": "4.1.10"
170
139
  },
171
140
  "peerDependencies": {
172
- "@cedarjs/graphql-server": "5.0.6"
141
+ "@cedarjs/graphql-server": "5.0.7-next.186"
173
142
  },
174
143
  "peerDependenciesMeta": {
175
144
  "@cedarjs/graphql-server": {
@@ -1,6 +0,0 @@
1
- import type { Argv } from 'yargs';
2
- import type { APIParsedOptions } from './types.js';
3
- export declare const description = "Start a server for serving the api side";
4
- export declare function builder(yargs: Argv<APIParsedOptions>): void;
5
- export declare function handler(options: APIParsedOptions): Promise<void>;
6
- //# sourceMappingURL=apiCLIConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiCLIConfig.d.ts","sourceRoot":"","sources":["../../src/apiCLIConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,eAAO,MAAM,WAAW,4CAA4C,CAAA;AAEpE,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,QA0BpD;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,gBAAgB,iBAGtD"}
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var apiCLIConfig_exports = {};
30
- __export(apiCLIConfig_exports, {
31
- builder: () => builder,
32
- description: () => description,
33
- handler: () => handler
34
- });
35
- module.exports = __toCommonJS(apiCLIConfig_exports);
36
- const description = "Start a server for serving the api side";
37
- function builder(yargs) {
38
- yargs.options({
39
- port: {
40
- description: "The port to listen at",
41
- type: "number",
42
- alias: "p"
43
- },
44
- host: {
45
- description: "The host to listen at. Note that you most likely want this to be '0.0.0.0' in production",
46
- type: "string"
47
- },
48
- apiRootPath: {
49
- description: "Root path where your api functions are served",
50
- type: "string",
51
- alias: ["api-root-path", "rootPath", "root-path"],
52
- default: "/"
53
- },
54
- // This became a no-op in v7 because env files weren't loaded by default
55
- // but removing it would break yargs parsing for older projects,
56
- // so leaving it here so that yargs doesn't throw an error
57
- loadEnvFiles: {
58
- hidden: true
59
- }
60
- });
61
- }
62
- async function handler(options) {
63
- const { handler: handler2 } = await import("./apiCLIConfigHandler.js");
64
- await handler2(options);
65
- }
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- builder,
69
- description,
70
- handler
71
- });
@@ -1,3 +0,0 @@
1
- import type { APIParsedOptions } from './types.js';
2
- export declare function handler(options?: APIParsedOptions): Promise<void>;
3
- //# sourceMappingURL=apiCLIConfigHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiCLIConfigHandler.d.ts","sourceRoot":"","sources":["../../src/apiCLIConfigHandler.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,wBAAsB,OAAO,CAAC,OAAO,GAAE,gBAAqB,iBAoC3D"}
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var apiCLIConfigHandler_exports = {};
30
- __export(apiCLIConfigHandler_exports, {
31
- handler: () => handler
32
- });
33
- module.exports = __toCommonJS(apiCLIConfigHandler_exports);
34
- var import_ansis = __toESM(require("ansis"), 1);
35
- var import_fastify_web = require("@cedarjs/fastify-web");
36
- var import_createServer = require("./createServer.js");
37
- async function handler(options = {}) {
38
- const timeStart = Date.now();
39
- console.log(import_ansis.default.dim.italic("Starting API Server..."));
40
- options.apiRootPath = (0, import_fastify_web.coerceRootPath)(options.apiRootPath ?? "/");
41
- const fastify = await (0, import_createServer.createServer)({
42
- apiRootPath: options.apiRootPath,
43
- apiHost: options.host,
44
- apiPort: options.port
45
- });
46
- await fastify.start();
47
- fastify.log.trace(
48
- { custom: { ...fastify.initialConfig } },
49
- "Fastify server configuration"
50
- );
51
- fastify.log.trace(`Registered plugins
52
- ${fastify.printPlugins()}`);
53
- console.log(import_ansis.default.dim.italic("Took " + (Date.now() - timeStart) + " ms"));
54
- let address = fastify.listeningOrigin;
55
- if (process.env.NODE_ENV !== "production") {
56
- address = address.replace(/http:\/\/\[::\]/, "http://localhost");
57
- }
58
- const apiServer = import_ansis.default.magenta(`${address}${options.apiRootPath}`);
59
- const graphqlEndpoint = import_ansis.default.magenta(`${apiServer}graphql`);
60
- console.log(`API server listening at ${apiServer}`);
61
- console.log(`GraphQL endpoint at ${graphqlEndpoint}`);
62
- process?.send?.("ready");
63
- }
64
- // Annotate the CommonJS export names for ESM import in node:
65
- 0 && (module.exports = {
66
- handler
67
- });
package/dist/cjs/bin.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=bin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":""}