@cedarjs/api-server 6.0.0-canary.2843 → 6.0.0-canary.2845

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.
@@ -1 +1 @@
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
+ {"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,QAwBpD;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,gBAAgB,iBAGtD"}
@@ -7,7 +7,7 @@ function builder(yargs) {
7
7
  alias: "p"
8
8
  },
9
9
  host: {
10
- description: "The host to listen at. Note that you most likely want this to be '0.0.0.0' in production",
10
+ description: "The host to listen at",
11
11
  type: "string"
12
12
  },
13
13
  apiRootPath: {
package/dist/bin.js CHANGED
@@ -24,7 +24,7 @@ function getAPIHost({ isPublicSide = false } = {}) {
24
24
  host ??= process.env.HOST;
25
25
  }
26
26
  host ??= getConfig().api.host;
27
- host ??= process.env.NODE_ENV === "production" ? "0.0.0.0" : "::";
27
+ host ??= "::";
28
28
  return host;
29
29
  }
30
30
  function getAPIPort({ isPublicSide = false } = {}) {
@@ -50,7 +50,7 @@ function getWebHost({ isPublicSide = false } = {}) {
50
50
  host ??= process.env.HOST;
51
51
  }
52
52
  host ??= getConfig().web.host;
53
- host ??= process.env.NODE_ENV === "production" ? "0.0.0.0" : "::";
53
+ host ??= "::";
54
54
  return host;
55
55
  }
56
56
  function getWebPort({ isPublicSide = false } = {}) {
@@ -156,8 +156,12 @@ var init_createServerHelpers = __esm({
156
156
  configureApiServer: () => {
157
157
  },
158
158
  parseArgs: true,
159
- apiHost: getAPIHost(),
160
- apiPort: getAPIPort()
159
+ // `createServer()`'s only callers are `cedarjs-server api` and custom
160
+ // `api/src/server.ts` files — both only ever run with the api side
161
+ // serving public traffic on its own, so they get to use the host's
162
+ // `HOST`/`PORT` env vars.
163
+ apiHost: getAPIHost({ isPublicSide: true }),
164
+ apiPort: getAPIPort({ isPublicSide: true })
161
165
  });
162
166
  }
163
167
  });
@@ -976,7 +980,7 @@ function builder(yargs2) {
976
980
  alias: "p"
977
981
  },
978
982
  host: {
979
- description: "The host to listen at. Note that you most likely want this to be '0.0.0.0' in production",
983
+ description: "The host to listen at",
980
984
  type: "string"
981
985
  },
982
986
  apiRootPath: {
@@ -1007,7 +1011,7 @@ function builder2(yargs2) {
1007
1011
  alias: ["web-port"]
1008
1012
  },
1009
1013
  webHost: {
1010
- description: "The host for the web server to listen on. Note that you most likely want this to be '0.0.0.0' in production",
1014
+ description: "The host for the web server to listen on",
1011
1015
  type: "string",
1012
1016
  alias: ["web-host"]
1013
1017
  },
@@ -1017,7 +1021,7 @@ function builder2(yargs2) {
1017
1021
  alias: ["api-port"]
1018
1022
  },
1019
1023
  apiHost: {
1020
- description: "The host for the api server to listen on. Note that you most likely want this to be '0.0.0.0' in production",
1024
+ description: "The host for the api server to listen on",
1021
1025
  type: "string",
1022
1026
  alias: ["api-host"]
1023
1027
  },
@@ -1 +1 @@
1
- {"version":3,"file":"bothCLIConfig.d.ts","sourceRoot":"","sources":["../src/bothCLIConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,eAAO,MAAM,WAAW,qDAAqD,CAAA;AAE7E,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC,QA+BrD;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,iBAAiB,iBAGvD"}
1
+ {"version":3,"file":"bothCLIConfig.d.ts","sourceRoot":"","sources":["../src/bothCLIConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,eAAO,MAAM,WAAW,qDAAqD,CAAA;AAE7E,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC,QA6BrD;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,iBAAiB,iBAGvD"}
@@ -7,7 +7,7 @@ function builder(yargs) {
7
7
  alias: ["web-port"]
8
8
  },
9
9
  webHost: {
10
- description: "The host for the web server to listen on. Note that you most likely want this to be '0.0.0.0' in production",
10
+ description: "The host for the web server to listen on",
11
11
  type: "string",
12
12
  alias: ["web-host"]
13
13
  },
@@ -17,7 +17,7 @@ function builder(yargs) {
17
17
  alias: ["api-port"]
18
18
  },
19
19
  apiHost: {
20
- description: "The host for the api server to listen on. Note that you most likely want this to be '0.0.0.0' in production",
20
+ description: "The host for the api server to listen on",
21
21
  type: "string",
22
22
  alias: ["api-host"]
23
23
  },
@@ -1 +1 @@
1
- {"version":3,"file":"cliHelpers.d.ts","sourceRoot":"","sources":["../src/cliHelpers.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW;IACnB;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,UAAU,CAAC,EAAE,YAAoB,EAAE,GAAE,WAAgB,UAYpE;AAED,wBAAgB,UAAU,CAAC,EAAE,YAAoB,EAAE,GAAE,WAAgB,UAcpE;AAED,wBAAgB,cAAc,WAE7B;AAED,wBAAgB,UAAU,CAAC,EAAE,YAAoB,EAAE,GAAE,WAAgB,UAYpE;AAED,wBAAgB,UAAU,CAAC,EAAE,YAAoB,EAAE,GAAE,WAAgB,UAcpE"}
1
+ {"version":3,"file":"cliHelpers.d.ts","sourceRoot":"","sources":["../src/cliHelpers.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW;IACnB;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,UAAU,CAAC,EAAE,YAAoB,EAAE,GAAE,WAAgB,UAepE;AAED,wBAAgB,UAAU,CAAC,EAAE,YAAoB,EAAE,GAAE,WAAgB,UAcpE;AAED,wBAAgB,cAAc,WAE7B;AAED,wBAAgB,UAAU,CAAC,EAAE,YAAoB,EAAE,GAAE,WAAgB,UAepE;AAED,wBAAgB,UAAU,CAAC,EAAE,YAAoB,EAAE,GAAE,WAAgB,UAcpE"}
@@ -7,7 +7,7 @@ function getAPIHost({ isPublicSide = false } = {}) {
7
7
  host ??= process.env.HOST;
8
8
  }
9
9
  host ??= getConfig().api.host;
10
- host ??= process.env.NODE_ENV === "production" ? "0.0.0.0" : "::";
10
+ host ??= "::";
11
11
  return host;
12
12
  }
13
13
  function getAPIPort({ isPublicSide = false } = {}) {
@@ -33,7 +33,7 @@ function getWebHost({ isPublicSide = false } = {}) {
33
33
  host ??= process.env.HOST;
34
34
  }
35
35
  host ??= getConfig().web.host;
36
- host ??= process.env.NODE_ENV === "production" ? "0.0.0.0" : "::";
36
+ host ??= "::";
37
37
  return host;
38
38
  }
39
39
  function getWebPort({ isPublicSide = false } = {}) {
@@ -1 +1 @@
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
+ {"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,mBAqHnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"createServerHelpers.d.ts","sourceRoot":"","sources":["../src/createServerHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EAChB,MAAM,SAAS,CAAA;AAMhB,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;AAEtE,MAAM,WAAW,MAAO,SAAQ,eAAe;IAC7C,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACnD;AAED,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IAGpB,iCAAiC;IACjC,MAAM,CAAC,EACH,oBAAoB,CAAC,QAAQ,CAAC,GAC9B,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IAE1C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAA;IAE3D;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAEzC,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,I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C,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7D,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,KAAK,0BAA0B,GAAG,QAAQ,CACxC,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG;IAClD,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C,CACF,CAAA;AAID,eAAO,MAAM,6BAA6B,EAAE,MAAM,0BAqB9C,CAAA;AAgBJ,wBAAgB,cAAc,CAC5B,OAAO,GAAE,mBAAwB,EACjC,IAAI,CAAC,EAAE,MAAM,EAAE;0BAdS,oBAAoB;GA4F7C"}
@@ -15,8 +15,12 @@ const getDefaultCreateServerOptions = () => ({
15
15
  configureApiServer: () => {
16
16
  },
17
17
  parseArgs: true,
18
- apiHost: getAPIHost(),
19
- apiPort: getAPIPort()
18
+ // `createServer()`'s only callers are `cedarjs-server api` and custom
19
+ // `api/src/server.ts` files — both only ever run with the api side
20
+ // serving public traffic on its own, so they get to use the host's
21
+ // `HOST`/`PORT` env vars.
22
+ apiHost: getAPIHost({ isPublicSide: true }),
23
+ apiPort: getAPIPort({ isPublicSide: true })
20
24
  });
21
25
  function isCustomLoggerInstance(logger) {
22
26
  return !!logger && typeof logger === "object" && "info" in logger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "6.0.0-canary.2843",
3
+ "version": "6.0.0-canary.2845",
4
4
  "description": "CedarJS's HTTP server for Serverless Functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -92,11 +92,11 @@
92
92
  "test:watch": "vitest watch"
93
93
  },
94
94
  "dependencies": {
95
- "@cedarjs/api": "6.0.0-canary.2843",
96
- "@cedarjs/context": "6.0.0-canary.2843",
97
- "@cedarjs/fastify-web": "6.0.0-canary.2843",
98
- "@cedarjs/project-config": "6.0.0-canary.2843",
99
- "@cedarjs/web-server": "6.0.0-canary.2843",
95
+ "@cedarjs/api": "6.0.0-canary.2845",
96
+ "@cedarjs/context": "6.0.0-canary.2845",
97
+ "@cedarjs/fastify-web": "6.0.0-canary.2845",
98
+ "@cedarjs/project-config": "6.0.0-canary.2845",
99
+ "@cedarjs/web-server": "6.0.0-canary.2845",
100
100
  "@fastify/multipart": "9.4.0",
101
101
  "@fastify/url-data": "6.0.3",
102
102
  "ansis": "4.3.1",
@@ -113,7 +113,7 @@
113
113
  "yargs": "17.7.3"
114
114
  },
115
115
  "devDependencies": {
116
- "@cedarjs/framework-tools": "6.0.0-canary.2843",
116
+ "@cedarjs/framework-tools": "6.0.0-canary.2845",
117
117
  "@types/aws-lambda": "8.10.162",
118
118
  "@types/dotenv-defaults": "^5.0.0",
119
119
  "@types/split2": "4.2.3",
@@ -128,7 +128,7 @@
128
128
  "vitest": "4.1.10"
129
129
  },
130
130
  "peerDependencies": {
131
- "@cedarjs/graphql-server": "6.0.0-canary.2843"
131
+ "@cedarjs/graphql-server": "6.0.0-canary.2845"
132
132
  },
133
133
  "peerDependenciesMeta": {
134
134
  "@cedarjs/graphql-server": {