@nymphjs/server 1.0.0-beta.6 → 1.0.0-beta.61

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.
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.statusDescriptions = void 0;
4
+ /**
5
+ * HTTP status code to status text map.
6
+ */
7
+ exports.statusDescriptions = {
8
+ 100: 'Continue',
9
+ 101: 'Switching Protocols',
10
+ 102: 'Processing',
11
+ 103: 'Early Hints',
12
+ 200: 'OK',
13
+ 201: 'Created',
14
+ 202: 'Accepted',
15
+ 203: 'Non-Authoritative Information',
16
+ 204: 'No Content',
17
+ 205: 'Reset Content',
18
+ 206: 'Partial Content',
19
+ 207: 'Multi-Status',
20
+ 208: 'Already Reported',
21
+ 226: 'IM Used',
22
+ 300: 'Multiple Choices',
23
+ 301: 'Moved Permanently',
24
+ 302: 'Found',
25
+ 303: 'See Other',
26
+ 304: 'Not Modified',
27
+ 305: 'Use Proxy',
28
+ 306: 'Switch Proxy',
29
+ 307: 'Temporary Redirect',
30
+ 308: 'Permanent Redirect',
31
+ 400: 'Bad Request',
32
+ 401: 'Unauthorized',
33
+ 402: 'Payment Required',
34
+ 403: 'Forbidden',
35
+ 404: 'Not Found',
36
+ 405: 'Method Not Allowed',
37
+ 406: 'Not Acceptable',
38
+ 407: 'Proxy Authentication Required',
39
+ 408: 'Request Timeout',
40
+ 409: 'Conflict',
41
+ 410: 'Gone',
42
+ 411: 'Length Required',
43
+ 412: 'Precondition Failed',
44
+ 413: 'Payload Too Large',
45
+ 414: 'URI Too Long',
46
+ 415: 'Unsupported Media Type',
47
+ 416: 'Range Not Satisfiable',
48
+ 417: 'Expectation Failed',
49
+ 418: "I'm a teapot",
50
+ 421: 'Misdirected Request',
51
+ 422: 'Unprocessable Entity',
52
+ 423: 'Locked',
53
+ 424: 'Failed Dependency',
54
+ 425: 'Too Early',
55
+ 426: 'Upgrade Required',
56
+ 428: 'Precondition Required',
57
+ 429: 'Too Many Requests',
58
+ 431: 'Request Header Fields Too Large',
59
+ 451: 'Unavailable For Legal Reasons',
60
+ 500: 'Internal Server Error',
61
+ 501: 'Not Implemented',
62
+ 502: 'Bad Gateway',
63
+ 503: 'Service Unavailable',
64
+ 504: 'Gateway Timeout',
65
+ 505: 'HTTP Version Not Supported',
66
+ 506: 'Variant Also Negotiates',
67
+ 507: 'Insufficient Storage',
68
+ 508: 'Loop Detected',
69
+ 510: 'Not Extended',
70
+ 511: 'Network Authentication Required',
71
+ };
72
+ //# sourceMappingURL=statusDescriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusDescriptions.js","sourceRoot":"","sources":["../src/statusDescriptions.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,kBAAkB,GAA4B;IACzD,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,wBAAwB;IAC7B,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,iCAAiC;IACtC,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,4BAA4B;IACjC,GAAG,EAAE,yBAAyB;IAC9B,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,iCAAiC;CACvC,CAAC"}
@@ -16,6 +16,9 @@ export type EmployeeBaseData<T> = {
16
16
  other?: string;
17
17
  };
18
18
  export type EmployeeModelData = EmployeeBaseData<EmployeeModel>;
19
+ /**
20
+ * This class is a test class that extends the Entity class.
21
+ */
19
22
  export declare class EmployeeModel extends EntityServer<EmployeeModelData> {
20
23
  static ETYPE: string;
21
24
  static class: string;
@@ -24,15 +27,18 @@ export declare class EmployeeModel extends EntityServer<EmployeeModelData> {
24
27
  protected $protectedTags: string[];
25
28
  protected $allowlistTags?: string[] | undefined;
26
29
  protected $allowlistData?: string[] | undefined;
27
- static factory(guid?: string): Promise<EmployeeModel & EmployeeModelData>;
28
- static factorySync(guid?: string): EmployeeModel & EmployeeModelData;
29
- constructor(guid?: string);
30
+ constructor();
30
31
  $save(): Promise<boolean>;
31
32
  $testMethodStateless(value: number): number;
32
33
  $testMethod(value: number): number;
33
34
  static testStatic(value: number): number;
35
+ static testStaticIterable(value: number): Generator<number, void, unknown>;
36
+ static testStaticIterableAbort(): Iterator<number, void, boolean>;
34
37
  static throwErrorStatic(): void;
38
+ static throwErrorStaticIterable(): Generator<number, void, unknown>;
35
39
  $throwError(): void;
40
+ $throwHttpError(): void;
41
+ $throwHttpErrorWithDescription(): void;
36
42
  static inaccessibleMethod(): boolean;
37
43
  }
38
44
  export declare class BadFunctionCallError extends Error {
@@ -41,14 +47,60 @@ export declare class BadFunctionCallError extends Error {
41
47
  export type EmployeeData = EmployeeBaseData<Employee>;
42
48
  export declare class Employee extends Entity<EmployeeData> {
43
49
  static class: string;
44
- constructor(guid?: string);
45
- static factory(guid?: string): Promise<Employee & EmployeeData>;
46
- static factorySync(guid?: string): Employee & EmployeeData;
50
+ constructor();
47
51
  $testMethod(value: number): Promise<any>;
48
52
  $testMethodStateless(value: number): Promise<any>;
49
53
  $throwError(): Promise<any>;
54
+ $throwHttpError(): Promise<any>;
55
+ $throwHttpErrorWithDescription(): Promise<any>;
50
56
  static testStatic(value: number): Promise<any>;
57
+ static testStaticIterable(value: number): Promise<import("@nymphjs/client").AbortableAsyncIterator<any>>;
58
+ static testStaticIterableAbort(): Promise<import("@nymphjs/client").AbortableAsyncIterator<any>>;
51
59
  static throwErrorStatic(): Promise<any>;
60
+ static throwErrorStaticIterable(): Promise<import("@nymphjs/client").AbortableAsyncIterator<any>>;
52
61
  static inaccessibleMethod(): Promise<any>;
53
62
  }
54
- export default Employee;
63
+ export type RestrictedModelData = {
64
+ name: string;
65
+ };
66
+ /**
67
+ * This class is a test class that extends the Entity class.
68
+ */
69
+ export declare class RestrictedModel extends EntityServer<RestrictedModelData> {
70
+ static ETYPE: string;
71
+ static class: string;
72
+ static restEnabled: boolean;
73
+ constructor();
74
+ $save(): Promise<boolean>;
75
+ $testMethod(value: string): string;
76
+ static testStatic(value: number): number;
77
+ }
78
+ export type RestrictedData = {
79
+ name: string;
80
+ };
81
+ export declare class Restricted extends Entity<RestrictedData> {
82
+ static class: string;
83
+ constructor();
84
+ $testMethod(value: number): Promise<any>;
85
+ static testStatic(value: number): Promise<any>;
86
+ }
87
+ export type PubSubDisabledModelData = {
88
+ name: string;
89
+ };
90
+ /**
91
+ * This class is a test class that extends the Entity class.
92
+ */
93
+ export declare class PubSubDisabledModel extends EntityServer<PubSubDisabledModelData> {
94
+ static ETYPE: string;
95
+ static class: string;
96
+ static pubSubEnabled: boolean;
97
+ constructor();
98
+ $save(): Promise<boolean>;
99
+ }
100
+ export type PubSubDisabledData = {
101
+ name: string;
102
+ };
103
+ export declare class PubSubDisabled extends Entity<PubSubDisabledData> {
104
+ static class: string;
105
+ constructor();
106
+ }
@@ -1,22 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Employee = exports.BadFunctionCallError = exports.EmployeeModel = void 0;
3
+ exports.PubSubDisabled = exports.PubSubDisabledModel = exports.Restricted = exports.RestrictedModel = exports.Employee = exports.BadFunctionCallError = exports.EmployeeModel = void 0;
4
4
  const nymph_1 = require("@nymphjs/nymph");
5
5
  const client_1 = require("@nymphjs/client");
6
+ const HttpError_1 = require("./HttpError");
6
7
  const IS_MANAGER = true;
8
+ /**
9
+ * This class is a test class that extends the Entity class.
10
+ */
7
11
  class EmployeeModel extends nymph_1.Entity {
8
- static async factory(guid) {
9
- return (await super.factory(guid));
10
- }
11
- static factorySync(guid) {
12
- return super.factorySync(guid);
13
- }
14
- constructor(guid) {
15
- super(guid);
12
+ constructor() {
13
+ super();
16
14
  this.$clientEnabledMethods = [
17
15
  '$testMethodStateless',
18
16
  '$testMethod',
19
17
  '$throwError',
18
+ '$throwHttpError',
19
+ '$throwHttpErrorWithDescription',
20
20
  ];
21
21
  this.$protectedTags = ['employee'];
22
22
  this.$allowlistTags = ['boss', 'bigcheese'];
@@ -34,22 +34,21 @@ class EmployeeModel extends nymph_1.Entity {
34
34
  'manager',
35
35
  'building',
36
36
  ];
37
- if (this.guid == null) {
38
- this.$addTag('employee');
39
- this.$data.current = true;
40
- this.$data.startDate = Date.now();
41
- this.$data.subordinates = [];
42
- if (!IS_MANAGER) {
43
- this.$privateData.push('salary');
44
- }
37
+ this.$addTag('employee');
38
+ this.$data.current = true;
39
+ this.$data.startDate = Date.now();
40
+ this.$data.subordinates = [];
41
+ if (!IS_MANAGER) {
42
+ this.$privateData.push('salary');
45
43
  }
46
44
  }
47
45
  async $save() {
46
+ // Validate employee data.
48
47
  const error = new nymph_1.EntityInvalidDataError('Invalid entity data.');
49
- if (this.$data.name == null || this.$data.name == '') {
48
+ if (this.$data.name == null || this.$data.name === '') {
50
49
  error.addField('name');
51
50
  }
52
- if (this.$data.title == null || this.$data.title == '') {
51
+ if (this.$data.title == null || this.$data.title === '') {
53
52
  error.addField('title');
54
53
  }
55
54
  if (this.$data.startDate == null) {
@@ -58,6 +57,7 @@ class EmployeeModel extends nymph_1.Entity {
58
57
  if (error.getFields().length) {
59
58
  throw error;
60
59
  }
60
+ // Generate employee ID.
61
61
  if (this.$data.id == null) {
62
62
  this.$data.id = (await this.$nymph.newUID('employee')) ?? undefined;
63
63
  }
@@ -74,12 +74,33 @@ class EmployeeModel extends nymph_1.Entity {
74
74
  static testStatic(value) {
75
75
  return value * 2;
76
76
  }
77
+ static *testStaticIterable(value) {
78
+ yield value + 1;
79
+ yield value + 2;
80
+ yield value + 3;
81
+ }
82
+ static *testStaticIterableAbort() {
83
+ let aborted = yield 1;
84
+ if (!aborted) {
85
+ throw new Error("testStaticIterableAbort wasn't aborted after the first iteration.");
86
+ }
87
+ }
77
88
  static throwErrorStatic() {
78
89
  throw new BadFunctionCallError('This function only throws errors.');
79
90
  }
91
+ static *throwErrorStaticIterable() {
92
+ yield 1;
93
+ throw new BadFunctionCallError('This function throws errors after the first iteration.');
94
+ }
80
95
  $throwError() {
81
96
  throw new BadFunctionCallError('This function only throws errors.');
82
97
  }
98
+ $throwHttpError() {
99
+ throw new HttpError_1.HttpError('A 501 HTTP error.', 501);
100
+ }
101
+ $throwHttpErrorWithDescription() {
102
+ throw new HttpError_1.HttpError('A 512 HTTP error.', 512, 'Some Error');
103
+ }
83
104
  static inaccessibleMethod() {
84
105
  return true;
85
106
  }
@@ -87,7 +108,13 @@ class EmployeeModel extends nymph_1.Entity {
87
108
  exports.EmployeeModel = EmployeeModel;
88
109
  EmployeeModel.ETYPE = 'employee';
89
110
  EmployeeModel.class = 'Employee';
90
- EmployeeModel.clientEnabledStaticMethods = ['testStatic', 'throwErrorStatic'];
111
+ EmployeeModel.clientEnabledStaticMethods = [
112
+ 'testStatic',
113
+ 'testStaticIterable',
114
+ 'testStaticIterableAbort',
115
+ 'throwErrorStatic',
116
+ 'throwErrorStaticIterable',
117
+ ];
91
118
  class BadFunctionCallError extends Error {
92
119
  constructor(message) {
93
120
  super(message);
@@ -96,19 +123,11 @@ class BadFunctionCallError extends Error {
96
123
  }
97
124
  exports.BadFunctionCallError = BadFunctionCallError;
98
125
  class Employee extends client_1.Entity {
99
- constructor(guid) {
100
- super(guid);
101
- if (guid == null) {
102
- this.$addTag('employee');
103
- this.$data.current = true;
104
- this.$data.subordinates = [];
105
- }
106
- }
107
- static async factory(guid) {
108
- return (await super.factory(guid));
109
- }
110
- static factorySync(guid) {
111
- return super.factorySync(guid);
126
+ constructor() {
127
+ super();
128
+ this.$addTag('employee');
129
+ this.$data.current = true;
130
+ this.$data.subordinates = [];
112
131
  }
113
132
  $testMethod(value) {
114
133
  return this.$serverCall('$testMethod', [value]);
@@ -119,17 +138,110 @@ class Employee extends client_1.Entity {
119
138
  $throwError() {
120
139
  return this.$serverCall('$throwError', []);
121
140
  }
141
+ $throwHttpError() {
142
+ return this.$serverCall('$throwHttpError', []);
143
+ }
144
+ $throwHttpErrorWithDescription() {
145
+ return this.$serverCall('$throwHttpErrorWithDescription', []);
146
+ }
122
147
  static testStatic(value) {
123
- return Employee.serverCallStatic('testStatic', [value]);
148
+ return this.serverCallStatic('testStatic', [value]);
149
+ }
150
+ static testStaticIterable(value) {
151
+ return this.serverCallStaticIterator('testStaticIterable', [value]);
152
+ }
153
+ static testStaticIterableAbort() {
154
+ return this.serverCallStaticIterator('testStaticIterableAbort', []);
124
155
  }
125
156
  static throwErrorStatic() {
126
- return Employee.serverCallStatic('throwErrorStatic', []);
157
+ return this.serverCallStatic('throwErrorStatic', []);
158
+ }
159
+ static throwErrorStaticIterable() {
160
+ return this.serverCallStaticIterator('throwErrorStaticIterable', []);
127
161
  }
128
162
  static inaccessibleMethod() {
129
- return Employee.serverCallStatic('inaccessibleMethod', []);
163
+ return this.serverCallStatic('inaccessibleMethod', []);
130
164
  }
131
165
  }
132
166
  exports.Employee = Employee;
167
+ // The name of the server class
133
168
  Employee.class = 'Employee';
134
- exports.default = Employee;
169
+ /**
170
+ * This class is a test class that extends the Entity class.
171
+ */
172
+ class RestrictedModel extends nymph_1.Entity {
173
+ constructor() {
174
+ super();
175
+ this.$data.name = '';
176
+ }
177
+ async $save() {
178
+ // Validate entity data.
179
+ const error = new nymph_1.EntityInvalidDataError('Invalid entity data.');
180
+ if (this.$data.name == null || this.$data.name === '') {
181
+ error.addField('name');
182
+ }
183
+ if (error.getFields().length) {
184
+ throw error;
185
+ }
186
+ return await super.$save();
187
+ }
188
+ $testMethod(value) {
189
+ return value;
190
+ }
191
+ static testStatic(value) {
192
+ return value;
193
+ }
194
+ }
195
+ exports.RestrictedModel = RestrictedModel;
196
+ RestrictedModel.ETYPE = 'restricted';
197
+ RestrictedModel.class = 'Restricted';
198
+ RestrictedModel.restEnabled = false;
199
+ class Restricted extends client_1.Entity {
200
+ constructor() {
201
+ super();
202
+ this.$data.name = '';
203
+ }
204
+ $testMethod(value) {
205
+ return this.$serverCall('$testMethod', [value]);
206
+ }
207
+ static testStatic(value) {
208
+ return this.serverCallStatic('testStatic', [value]);
209
+ }
210
+ }
211
+ exports.Restricted = Restricted;
212
+ // The name of the server class
213
+ Restricted.class = 'Restricted';
214
+ /**
215
+ * This class is a test class that extends the Entity class.
216
+ */
217
+ class PubSubDisabledModel extends nymph_1.Entity {
218
+ constructor() {
219
+ super();
220
+ this.$data.name = '';
221
+ }
222
+ async $save() {
223
+ // Validate entity data.
224
+ const error = new nymph_1.EntityInvalidDataError('Invalid entity data.');
225
+ if (this.$data.name == null || this.$data.name === '') {
226
+ error.addField('name');
227
+ }
228
+ if (error.getFields().length) {
229
+ throw error;
230
+ }
231
+ return await super.$save();
232
+ }
233
+ }
234
+ exports.PubSubDisabledModel = PubSubDisabledModel;
235
+ PubSubDisabledModel.ETYPE = 'pubsub_disabled';
236
+ PubSubDisabledModel.class = 'PubSubDisabled';
237
+ PubSubDisabledModel.pubSubEnabled = false;
238
+ class PubSubDisabled extends client_1.Entity {
239
+ constructor() {
240
+ super();
241
+ this.$data.name = '';
242
+ }
243
+ }
244
+ exports.PubSubDisabled = PubSubDisabled;
245
+ // The name of the server class
246
+ PubSubDisabled.class = 'PubSubDisabled';
135
247
  //# sourceMappingURL=testArtifacts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"testArtifacts.js","sourceRoot":"","sources":["../src/testArtifacts.ts"],"names":[],"mappings":";;;AAAA,0CAAgF;AAChF,4CAAyC;AAsBzC,MAAM,UAAU,GAAG,IAAI,CAAC;AAKxB,MAAa,aAAc,SAAQ,cAA+B;IA2BhE,MAAM,CAAC,KAAK,CAAC,OAAO,CAClB,IAAa;QAEb,OAAO,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAsC,CAAC;IAC1E,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,IAAa;QAC9B,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,CAAsC,CAAC;IACt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6",
4
- "description": "NymphJS - REST Server",
3
+ "version": "1.0.0-beta.61",
4
+ "description": "Nymph.js - REST Server",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "clean": "test -d dist && rm -r dist || true",
15
15
  "build": "tsc",
16
16
  "watch": "tsc --watch",
17
- "prepare": "npm run clean && npm run build",
17
+ "prepublish": "npm run clean && npm run build",
18
18
  "test": "jest",
19
19
  "test:watch": "jest --watch"
20
20
  },
@@ -31,21 +31,21 @@
31
31
  },
32
32
  "license": "Apache-2.0",
33
33
  "dependencies": {
34
- "@nymphjs/nymph": "^1.0.0-beta.6",
34
+ "@nymphjs/nymph": "^1.0.0-beta.61",
35
35
  "cookie-parser": "^1.4.6",
36
- "express": "^4.18.2"
36
+ "express": "^4.18.3"
37
37
  },
38
38
  "devDependencies": {
39
- "@nymphjs/client": "^1.0.0-beta.6",
40
- "@nymphjs/client-node": "^1.0.0-beta.6",
41
- "@nymphjs/driver-sqlite3": "^1.0.0-beta.6",
42
- "@tsconfig/recommended": "^1.0.1",
43
- "@types/cookie-parser": "^1.4.3",
44
- "@types/express": "^4.17.15",
45
- "@types/jest": "^29.2.5",
46
- "jest": "^29.3.1",
47
- "ts-jest": "^29.0.3",
48
- "typescript": "^4.9.4"
39
+ "@nymphjs/client": "^1.0.0-beta.61",
40
+ "@nymphjs/client-node": "^1.0.0-beta.61",
41
+ "@nymphjs/driver-sqlite3": "^1.0.0-beta.61",
42
+ "@tsconfig/recommended": "^1.0.3",
43
+ "@types/cookie-parser": "^1.4.7",
44
+ "@types/express": "^4.17.21",
45
+ "@types/jest": "^29.5.12",
46
+ "jest": "^29.7.0",
47
+ "ts-jest": "^29.1.2",
48
+ "typescript": "^5.3.3"
49
49
  },
50
- "gitHead": "9aaf5dbd46a7ac82d22c5e8d526c12ee9d9706dc"
50
+ "gitHead": "109543e980a0c3401cdc543b4e595ac53d886d7c"
51
51
  }
@@ -0,0 +1,12 @@
1
+ export class HttpError extends Error {
2
+ status?: number;
3
+ statusText?: string;
4
+
5
+ constructor(message: string, status?: number, statusText?: string) {
6
+ super(message);
7
+
8
+ this.name = 'HttpError';
9
+ this.status = status;
10
+ this.statusText = statusText;
11
+ }
12
+ }
package/src/cache.test.ts CHANGED
@@ -4,14 +4,17 @@ import { Nymph as NymphServer } from '@nymphjs/nymph';
4
4
  import { Nymph } from '@nymphjs/client-node';
5
5
 
6
6
  import createServer from './index';
7
- import { EmployeeModel, Employee } from './testArtifacts';
7
+ import {
8
+ EmployeeModel as EmployeeModelClass,
9
+ Employee as EmployeeClass,
10
+ } from './testArtifacts';
8
11
 
9
12
  const sqliteConfig = {
10
13
  filename: ':memory:',
11
14
  };
12
15
 
13
16
  const nymphServer = new NymphServer({}, new SQLite3Driver(sqliteConfig));
14
- nymphServer.addEntityClass(EmployeeModel);
17
+ const EmployeeModel = nymphServer.addEntityClass(EmployeeModelClass);
15
18
 
16
19
  const app = express();
17
20
  app.use('/test', createServer(nymphServer));
@@ -21,7 +24,7 @@ const nymph = new Nymph({
21
24
  restUrl: 'http://localhost:5081/test/',
22
25
  weakCache: true,
23
26
  });
24
- nymph.addEntityClass(Employee);
27
+ const Employee = nymph.addEntityClass(EmployeeClass);
25
28
 
26
29
  describe('Nymph REST Server and Client with Client Weak Ref Cache', () => {
27
30
  async function createJane() {
@@ -45,7 +48,7 @@ describe('Nymph REST Server and Client with Client Weak Ref Cache', () => {
45
48
  // @ts-ignore TS doesn't know about WeakRef.
46
49
  if (typeof WeakRef === 'undefined') {
47
50
  throw new Error(
48
- 'You must run this test in an environment that includes WeakRef.'
51
+ 'You must run this test in an environment that includes WeakRef.',
49
52
  );
50
53
  }
51
54
 
@@ -58,7 +61,7 @@ describe('Nymph REST Server and Client with Client Weak Ref Cache', () => {
58
61
  const checkA = await Employee.factory(employee.guid);
59
62
  const checkB = await nymph.getEntity(
60
63
  { class: Employee },
61
- { type: '&', guid: employee.guid }
64
+ { type: '&', guid: employee.guid },
62
65
  );
63
66
 
64
67
  if (!checkB) {