@lwrjs/server 0.17.2-alpha.3 → 0.17.2-alpha.31

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.
@@ -113,7 +113,7 @@ var AbstractMiddlewareRequest = class {
113
113
  uiBasePath,
114
114
  environment,
115
115
  host,
116
- requestDepth
116
+ requestDepth: String(requestDepth)
117
117
  };
118
118
  return {
119
119
  runtimeEnvironment,
@@ -3,6 +3,7 @@ import crypto from 'crypto';
3
3
  * Common code for internal server implementations
4
4
  */
5
5
  export default class AbstractInternalAppServer {
6
+ internalRequestKey;
6
7
  constructor() {
7
8
  this.internalRequestKey = crypto.randomBytes(16).toString('base64');
8
9
  }
@@ -16,6 +16,7 @@ function parseForwardedHeader(forwarded) {
16
16
  return map.host ? `${proto}${map.host}` : undefined;
17
17
  }
18
18
  export class AbstractMiddlewareRequest {
19
+ isSiteGenerationRequest;
19
20
  constructor(isSiteGenerationRequest) {
20
21
  this.isSiteGenerationRequest = isSiteGenerationRequest || false;
21
22
  }
@@ -94,7 +95,7 @@ export class AbstractMiddlewareRequest {
94
95
  uiBasePath,
95
96
  environment,
96
97
  host,
97
- requestDepth,
98
+ requestDepth: String(requestDepth), // stringify to use as a header
98
99
  };
99
100
  return {
100
101
  runtimeEnvironment,
@@ -1,5 +1,6 @@
1
1
  import { AbstractMiddlewareRequest } from '../common/abstract-request.js';
2
2
  export default class ExpressRequest extends AbstractMiddlewareRequest {
3
+ req;
3
4
  constructor(expressRequest, isSiteGenerationRequest) {
4
5
  super(isSiteGenerationRequest);
5
6
  this.req = expressRequest;
@@ -1,4 +1,7 @@
1
1
  export default class ExpressResponse {
2
+ res;
3
+ metadata;
4
+ isSiteGenerationRequest;
2
5
  constructor(expressResponse, isSiteGenerationRequest) {
3
6
  this.res = expressResponse;
4
7
  this.isSiteGenerationRequest = isSiteGenerationRequest || false;
@@ -7,6 +7,9 @@ import ExpressResponse from './express-response.js';
7
7
  * Express Server Implementation (https://expressjs.com/)
8
8
  */
9
9
  export default class ExpressInternalServer extends AbstractInternalAppServer {
10
+ expressApp;
11
+ httpServer;
12
+ basePath;
10
13
  constructor(options) {
11
14
  super();
12
15
  this.expressApp = options?.app || express();
@@ -1,4 +1,5 @@
1
1
  export default class FsResponse {
2
+ context;
2
3
  constructor(context) {
3
4
  if (!context.fs) {
4
5
  context.fs = { headers: {} };
@@ -7,6 +7,7 @@ import FsResponse from './fs-response.js';
7
7
  import createFsContext from './fs-context.js';
8
8
  import AbstractInternalAppServer from '../common/abstract-internal-app-server.js';
9
9
  export class LwrFsKoa extends Koa {
10
+ composedMiddleware;
10
11
  constructor() {
11
12
  super();
12
13
  }
@@ -30,9 +31,11 @@ export class LwrFsKoa extends Koa {
30
31
  * FS Server (FS == FileSystem) implementation used for static generation. Should not be configured directly by consumers.
31
32
  */
32
33
  export class FsInternalServer extends AbstractInternalAppServer {
34
+ lwrFsKoaApp;
35
+ koaRouter;
36
+ middlewares = [];
33
37
  constructor(options) {
34
38
  super();
35
- this.middlewares = [];
36
39
  this.lwrFsKoaApp = new LwrFsKoa();
37
40
  this.koaRouter = new KoaRouter({
38
41
  prefix: options.basePath ?? undefined,
@@ -1,5 +1,6 @@
1
1
  import { AbstractMiddlewareRequest } from '../common/abstract-request.js';
2
2
  export default class KoaRequest extends AbstractMiddlewareRequest {
3
+ ctx;
3
4
  constructor(ctx, isSiteGenerationRequest) {
4
5
  super(isSiteGenerationRequest);
5
6
  this.ctx = ctx;
@@ -1,5 +1,8 @@
1
1
  import { PassThrough } from 'stream';
2
2
  export default class KoaResponse {
3
+ ctx;
4
+ metadata;
5
+ isSiteGenerationRequest;
3
6
  constructor(ctx, isSiteGenerationRequest) {
4
7
  this.ctx = ctx;
5
8
  this.isSiteGenerationRequest = isSiteGenerationRequest || false;
@@ -8,6 +8,9 @@ import KoaResponse from './koa-response.js';
8
8
  * Koa Server Implementation (https://koajs.com/)
9
9
  */
10
10
  export default class KoaInternalServer extends AbstractInternalAppServer {
11
+ koaApp;
12
+ koaRouter;
13
+ httpServer;
11
14
  constructor(options) {
12
15
  super();
13
16
  this.koaApp = new Koa();
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.17.2-alpha.3",
7
+ "version": "0.17.2-alpha.31",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -37,24 +37,24 @@
37
37
  "build": "tsc -b"
38
38
  },
39
39
  "devDependencies": {
40
- "@lwrjs/types": "0.17.2-alpha.3",
40
+ "@lwrjs/types": "0.17.2-alpha.31",
41
41
  "@types/koa-compress": "^4.0.6",
42
42
  "@types/koa__router": "^8.0.4",
43
43
  "jest-express": "^1.12.0"
44
44
  },
45
45
  "dependencies": {
46
46
  "@koa/router": "^10.0.0",
47
- "@lwrjs/diagnostics": "0.17.2-alpha.3",
48
- "@lwrjs/instrumentation": "0.17.2-alpha.3",
49
- "@lwrjs/shared-utils": "0.17.2-alpha.3",
47
+ "@lwrjs/diagnostics": "0.17.2-alpha.31",
48
+ "@lwrjs/instrumentation": "0.17.2-alpha.31",
49
+ "@lwrjs/shared-utils": "0.17.2-alpha.31",
50
50
  "@types/express": "^4.17.21",
51
51
  "@types/koa": "^2.15.0",
52
52
  "express": "^4.20.0",
53
- "koa": "^2.15.3",
53
+ "koa": "^2.15.4",
54
54
  "koa-compose": "^4.1.0"
55
55
  },
56
56
  "engines": {
57
- "node": ">=18.0.0"
57
+ "node": ">=20.0.0"
58
58
  },
59
- "gitHead": "43757693dfca356cff105d4896a7a3cbf11ac017"
59
+ "gitHead": "bbb087ab080321047b10bbcda40e88e69b6a69a5"
60
60
  }