@cedarjs/api-server 1.0.0-canary.12749 → 1.0.0-rc.26

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/bin.js CHANGED
@@ -38,17 +38,15 @@ var init_cliHelpers = __esm({
38
38
  // src/createServerHelpers.ts
39
39
  import { parseArgs } from "util";
40
40
  import { coerceRootPath } from "@cedarjs/fastify-web/dist/helpers.js";
41
- function isCustomLoggerInstance(logger) {
42
- return !!logger && typeof logger === "object" && "info" in logger;
43
- }
44
41
  function resolveOptions(options = {}, args) {
45
42
  options.parseArgs ??= true;
46
43
  const defaults = getDefaultCreateServerOptions();
47
- const logger = options.logger ?? defaults.logger;
44
+ options.logger ??= defaults.logger;
48
45
  const resolvedOptions = {
49
46
  apiRootPath: options.apiRootPath ?? defaults.apiRootPath,
50
47
  fastifyServerOptions: options.fastifyServerOptions ?? {
51
48
  requestTimeout: defaults.fastifyServerOptions.requestTimeout,
49
+ logger: options.logger ?? defaults.logger,
52
50
  bodyLimit: defaults.fastifyServerOptions.bodyLimit
53
51
  },
54
52
  discoverFunctionsGlob: options.discoverFunctionsGlob ?? defaults.discoverFunctionsGlob,
@@ -57,11 +55,7 @@ function resolveOptions(options = {}, args) {
57
55
  apiPort: options.apiPort ?? defaults.apiPort
58
56
  };
59
57
  resolvedOptions.fastifyServerOptions.requestTimeout ??= defaults.fastifyServerOptions.requestTimeout;
60
- if (isCustomLoggerInstance(logger)) {
61
- resolvedOptions.fastifyServerOptions.loggerInstance = logger;
62
- } else {
63
- resolvedOptions.fastifyServerOptions.logger = logger;
64
- }
58
+ resolvedOptions.fastifyServerOptions.logger = options.logger;
65
59
  if (options.parseArgs) {
66
60
  const { values } = parseArgs({
67
61
  options: {
package/dist/cjs/bin.js CHANGED
@@ -58,17 +58,15 @@ var init_cliHelpers = __esm({
58
58
  });
59
59
 
60
60
  // src/createServerHelpers.ts
61
- function isCustomLoggerInstance(logger) {
62
- return !!logger && typeof logger === "object" && "info" in logger;
63
- }
64
61
  function resolveOptions(options = {}, args) {
65
62
  options.parseArgs ??= true;
66
63
  const defaults = getDefaultCreateServerOptions();
67
- const logger = options.logger ?? defaults.logger;
64
+ options.logger ??= defaults.logger;
68
65
  const resolvedOptions = {
69
66
  apiRootPath: options.apiRootPath ?? defaults.apiRootPath,
70
67
  fastifyServerOptions: options.fastifyServerOptions ?? {
71
68
  requestTimeout: defaults.fastifyServerOptions.requestTimeout,
69
+ logger: options.logger ?? defaults.logger,
72
70
  bodyLimit: defaults.fastifyServerOptions.bodyLimit
73
71
  },
74
72
  discoverFunctionsGlob: options.discoverFunctionsGlob ?? defaults.discoverFunctionsGlob,
@@ -77,11 +75,7 @@ function resolveOptions(options = {}, args) {
77
75
  apiPort: options.apiPort ?? defaults.apiPort
78
76
  };
79
77
  resolvedOptions.fastifyServerOptions.requestTimeout ??= defaults.fastifyServerOptions.requestTimeout;
80
- if (isCustomLoggerInstance(logger)) {
81
- resolvedOptions.fastifyServerOptions.loggerInstance = logger;
82
- } else {
83
- resolvedOptions.fastifyServerOptions.logger = logger;
84
- }
78
+ resolvedOptions.fastifyServerOptions.logger = options.logger;
85
79
  if (options.parseArgs) {
86
80
  const { values } = (0, import_util.parseArgs)({
87
81
  options: {
@@ -7,7 +7,7 @@ export interface CreateServerOptions {
7
7
  /** The prefix for all routes. Defaults to `/` */
8
8
  apiRootPath?: string;
9
9
  /** Logger instance or options */
10
- logger?: FastifyServerOptions['logger'] | FastifyServerOptions['loggerInstance'];
10
+ logger?: FastifyServerOptions['logger'];
11
11
  /**
12
12
  * Options for the fastify server instance.
13
13
  * Omitting logger here because we move it up.
@@ -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,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0, import_cliHelpers.getAPIPort)()
44
44
  });
45
- function isCustomLoggerInstance(logger) {
46
- return !!logger && typeof logger === "object" && "info" in logger;
47
- }
48
45
  function resolveOptions(options = {}, args) {
49
46
  options.parseArgs ??= true;
50
47
  const defaults = getDefaultCreateServerOptions();
51
- const logger = options.logger ?? defaults.logger;
48
+ options.logger ??= defaults.logger;
52
49
  const resolvedOptions = {
53
50
  apiRootPath: options.apiRootPath ?? defaults.apiRootPath,
54
51
  fastifyServerOptions: options.fastifyServerOptions ?? {
55
52
  requestTimeout: defaults.fastifyServerOptions.requestTimeout,
53
+ logger: options.logger ?? defaults.logger,
56
54
  bodyLimit: defaults.fastifyServerOptions.bodyLimit
57
55
  },
58
56
  discoverFunctionsGlob: options.discoverFunctionsGlob ?? defaults.discoverFunctionsGlob,
@@ -61,11 +59,7 @@ function resolveOptions(options = {}, args) {
61
59
  apiPort: options.apiPort ?? defaults.apiPort
62
60
  };
63
61
  resolvedOptions.fastifyServerOptions.requestTimeout ??= defaults.fastifyServerOptions.requestTimeout;
64
- if (isCustomLoggerInstance(logger)) {
65
- resolvedOptions.fastifyServerOptions.loggerInstance = logger;
66
- } else {
67
- resolvedOptions.fastifyServerOptions.logger = logger;
68
- }
62
+ resolvedOptions.fastifyServerOptions.logger = options.logger;
69
63
  if (options.parseArgs) {
70
64
  const { values } = (0, import_util.parseArgs)({
71
65
  options: {
@@ -7,7 +7,7 @@ export interface CreateServerOptions {
7
7
  /** The prefix for all routes. Defaults to `/` */
8
8
  apiRootPath?: string;
9
9
  /** Logger instance or options */
10
- logger?: FastifyServerOptions['logger'] | FastifyServerOptions['loggerInstance'];
10
+ logger?: FastifyServerOptions['logger'];
11
11
  /**
12
12
  * Options for the fastify server instance.
13
13
  * Omitting logger here because we move it up.
@@ -1 +1 @@
1
- {"version":3,"file":"createServerHelpers.d.ts","sourceRoot":"","sources":["../src/createServerHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB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DefaultCreateServerOptions = () => ({
18
18
  apiHost: getAPIHost(),
19
19
  apiPort: getAPIPort()
20
20
  });
21
- function isCustomLoggerInstance(logger) {
22
- return !!logger && typeof logger === "object" && "info" in logger;
23
- }
24
21
  function resolveOptions(options = {}, args) {
25
22
  options.parseArgs ??= true;
26
23
  const defaults = getDefaultCreateServerOptions();
27
- const logger = options.logger ?? defaults.logger;
24
+ options.logger ??= defaults.logger;
28
25
  const resolvedOptions = {
29
26
  apiRootPath: options.apiRootPath ?? defaults.apiRootPath,
30
27
  fastifyServerOptions: options.fastifyServerOptions ?? {
31
28
  requestTimeout: defaults.fastifyServerOptions.requestTimeout,
29
+ logger: options.logger ?? defaults.logger,
32
30
  bodyLimit: defaults.fastifyServerOptions.bodyLimit
33
31
  },
34
32
  discoverFunctionsGlob: options.discoverFunctionsGlob ?? defaults.discoverFunctionsGlob,
@@ -37,11 +35,7 @@ function resolveOptions(options = {}, args) {
37
35
  apiPort: options.apiPort ?? defaults.apiPort
38
36
  };
39
37
  resolvedOptions.fastifyServerOptions.requestTimeout ??= defaults.fastifyServerOptions.requestTimeout;
40
- if (isCustomLoggerInstance(logger)) {
41
- resolvedOptions.fastifyServerOptions.loggerInstance = logger;
42
- } else {
43
- resolvedOptions.fastifyServerOptions.logger = logger;
44
- }
38
+ resolvedOptions.fastifyServerOptions.logger = options.logger;
45
39
  if (options.parseArgs) {
46
40
  const { values } = parseArgs({
47
41
  options: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/api-server",
3
- "version": "1.0.0-canary.12749+b56167a72",
3
+ "version": "1.0.0-rc.26",
4
4
  "description": "CedarJS's HTTP server for Serverless Functions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -97,20 +97,20 @@
97
97
  "test:watch": "vitest watch"
98
98
  },
99
99
  "dependencies": {
100
- "@cedarjs/context": "1.0.0-canary.12749",
101
- "@cedarjs/fastify-web": "1.0.0-canary.12749",
102
- "@cedarjs/internal": "1.0.0-canary.12749",
103
- "@cedarjs/project-config": "1.0.0-canary.12749",
104
- "@cedarjs/web-server": "1.0.0-canary.12749",
105
- "@fastify/multipart": "9.0.3",
106
- "@fastify/url-data": "6.0.3",
100
+ "@cedarjs/context": "1.0.0-rc.26",
101
+ "@cedarjs/fastify-web": "1.0.0-rc.26",
102
+ "@cedarjs/internal": "1.0.0-rc.26",
103
+ "@cedarjs/project-config": "1.0.0-rc.26",
104
+ "@cedarjs/web-server": "1.0.0-rc.26",
105
+ "@fastify/multipart": "8.3.1",
106
+ "@fastify/url-data": "5.4.0",
107
107
  "ansis": "4.1.0",
108
108
  "chokidar": "3.6.0",
109
109
  "dotenv-defaults": "5.0.2",
110
110
  "fast-glob": "3.3.3",
111
111
  "fast-json-parse": "1.0.3",
112
- "fastify": "5.4.0",
113
- "fastify-raw-body": "5.0.0",
112
+ "fastify": "4.28.1",
113
+ "fastify-raw-body": "4.3.0",
114
114
  "pretty-bytes": "5.6.0",
115
115
  "pretty-ms": "7.0.1",
116
116
  "qs": "6.13.0",
@@ -118,20 +118,19 @@
118
118
  "yargs": "17.7.2"
119
119
  },
120
120
  "devDependencies": {
121
- "@cedarjs/framework-tools": "1.0.0-canary.12749",
121
+ "@cedarjs/framework-tools": "1.0.0-rc.26",
122
122
  "@types/aws-lambda": "8.10.152",
123
123
  "@types/dotenv-defaults": "^2.0.4",
124
124
  "@types/qs": "6.9.16",
125
125
  "@types/split2": "4.2.3",
126
126
  "@types/yargs": "17.0.33",
127
- "memfs": "4.17.2",
128
127
  "pino-abstract-transport": "1.2.0",
129
128
  "tsx": "4.20.5",
130
129
  "typescript": "5.9.2",
131
130
  "vitest": "3.2.4"
132
131
  },
133
132
  "peerDependencies": {
134
- "@cedarjs/graphql-server": "1.0.0-canary.12749"
133
+ "@cedarjs/graphql-server": "1.0.0-rc.26"
135
134
  },
136
135
  "peerDependenciesMeta": {
137
136
  "@cedarjs/graphql-server": {
@@ -141,5 +140,5 @@
141
140
  "publishConfig": {
142
141
  "access": "public"
143
142
  },
144
- "gitHead": "b56167a72490d585fd4ce0ecb34235c9a39fa4f5"
143
+ "gitHead": "2ea84a564123f5d986dd88efcb6dddc55cbef367"
145
144
  }