@nymphjs/server 1.0.0-beta.7 → 1.0.0-beta.71

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,55 +1,63 @@
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);
16
- this.$clientEnabledMethods = [
17
- '$testMethodStateless',
18
- '$testMethod',
19
- '$throwError',
20
- ];
21
- this.$protectedTags = ['employee'];
22
- this.$allowlistTags = ['boss', 'bigcheese'];
23
- this.$allowlistData = [
24
- 'name',
25
- 'id',
26
- 'title',
27
- 'department',
28
- 'subordinates',
29
- 'salary',
30
- 'current',
31
- 'startDate',
32
- 'endDate',
33
- 'phone',
34
- 'manager',
35
- 'building',
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
- }
12
+ static ETYPE = 'employee';
13
+ static class = 'Employee';
14
+ $clientEnabledMethods = [
15
+ '$testMethodStateless',
16
+ '$testMethod',
17
+ '$throwError',
18
+ '$throwHttpError',
19
+ '$throwHttpErrorWithDescription',
20
+ ];
21
+ static clientEnabledStaticMethods = [
22
+ 'testStatic',
23
+ 'testStaticIterable',
24
+ 'testStaticIterableAbort',
25
+ 'throwErrorStatic',
26
+ 'throwErrorStaticIterable',
27
+ ];
28
+ $protectedTags = ['employee'];
29
+ $allowlistTags = ['boss', 'bigcheese'];
30
+ $allowlistData = [
31
+ 'name',
32
+ 'id',
33
+ 'title',
34
+ 'department',
35
+ 'subordinates',
36
+ 'salary',
37
+ 'current',
38
+ 'startDate',
39
+ 'endDate',
40
+ 'phone',
41
+ 'manager',
42
+ 'building',
43
+ ];
44
+ constructor() {
45
+ super();
46
+ this.$addTag('employee');
47
+ this.$data.current = true;
48
+ this.$data.startDate = Date.now();
49
+ this.$data.subordinates = [];
50
+ if (!IS_MANAGER) {
51
+ this.$privateData.push('salary');
45
52
  }
46
53
  }
47
54
  async $save() {
55
+ // Validate employee data.
48
56
  const error = new nymph_1.EntityInvalidDataError('Invalid entity data.');
49
- if (this.$data.name == null || this.$data.name == '') {
57
+ if (this.$data.name == null || this.$data.name === '') {
50
58
  error.addField('name');
51
59
  }
52
- if (this.$data.title == null || this.$data.title == '') {
60
+ if (this.$data.title == null || this.$data.title === '') {
53
61
  error.addField('title');
54
62
  }
55
63
  if (this.$data.startDate == null) {
@@ -58,6 +66,7 @@ class EmployeeModel extends nymph_1.Entity {
58
66
  if (error.getFields().length) {
59
67
  throw error;
60
68
  }
69
+ // Generate employee ID.
61
70
  if (this.$data.id == null) {
62
71
  this.$data.id = (await this.$nymph.newUID('employee')) ?? undefined;
63
72
  }
@@ -74,20 +83,38 @@ class EmployeeModel extends nymph_1.Entity {
74
83
  static testStatic(value) {
75
84
  return value * 2;
76
85
  }
86
+ static *testStaticIterable(value) {
87
+ yield value + 1;
88
+ yield value + 2;
89
+ yield value + 3;
90
+ }
91
+ static *testStaticIterableAbort() {
92
+ let aborted = yield 1;
93
+ if (!aborted) {
94
+ throw new Error("testStaticIterableAbort wasn't aborted after the first iteration.");
95
+ }
96
+ }
77
97
  static throwErrorStatic() {
78
98
  throw new BadFunctionCallError('This function only throws errors.');
79
99
  }
100
+ static *throwErrorStaticIterable() {
101
+ yield 1;
102
+ throw new BadFunctionCallError('This function throws errors after the first iteration.');
103
+ }
80
104
  $throwError() {
81
105
  throw new BadFunctionCallError('This function only throws errors.');
82
106
  }
107
+ $throwHttpError() {
108
+ throw new HttpError_1.HttpError('A 501 HTTP error.', 501);
109
+ }
110
+ $throwHttpErrorWithDescription() {
111
+ throw new HttpError_1.HttpError('A 512 HTTP error.', 512, 'Some Error');
112
+ }
83
113
  static inaccessibleMethod() {
84
114
  return true;
85
115
  }
86
116
  }
87
117
  exports.EmployeeModel = EmployeeModel;
88
- EmployeeModel.ETYPE = 'employee';
89
- EmployeeModel.class = 'Employee';
90
- EmployeeModel.clientEnabledStaticMethods = ['testStatic', 'throwErrorStatic'];
91
118
  class BadFunctionCallError extends Error {
92
119
  constructor(message) {
93
120
  super(message);
@@ -96,19 +123,13 @@ 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
+ // The name of the server class
127
+ static class = 'Employee';
128
+ constructor() {
129
+ super();
130
+ this.$addTag('employee');
131
+ this.$data.current = true;
132
+ this.$data.subordinates = [];
112
133
  }
113
134
  $testMethod(value) {
114
135
  return this.$serverCall('$testMethod', [value]);
@@ -119,17 +140,108 @@ class Employee extends client_1.Entity {
119
140
  $throwError() {
120
141
  return this.$serverCall('$throwError', []);
121
142
  }
143
+ $throwHttpError() {
144
+ return this.$serverCall('$throwHttpError', []);
145
+ }
146
+ $throwHttpErrorWithDescription() {
147
+ return this.$serverCall('$throwHttpErrorWithDescription', []);
148
+ }
122
149
  static testStatic(value) {
123
- return Employee.serverCallStatic('testStatic', [value]);
150
+ return this.serverCallStatic('testStatic', [value]);
151
+ }
152
+ static testStaticIterable(value) {
153
+ return this.serverCallStaticIterator('testStaticIterable', [value]);
154
+ }
155
+ static testStaticIterableAbort() {
156
+ return this.serverCallStaticIterator('testStaticIterableAbort', []);
124
157
  }
125
158
  static throwErrorStatic() {
126
- return Employee.serverCallStatic('throwErrorStatic', []);
159
+ return this.serverCallStatic('throwErrorStatic', []);
160
+ }
161
+ static throwErrorStaticIterable() {
162
+ return this.serverCallStaticIterator('throwErrorStaticIterable', []);
127
163
  }
128
164
  static inaccessibleMethod() {
129
- return Employee.serverCallStatic('inaccessibleMethod', []);
165
+ return this.serverCallStatic('inaccessibleMethod', []);
130
166
  }
131
167
  }
132
168
  exports.Employee = Employee;
133
- 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
+ static ETYPE = 'restricted';
174
+ static class = 'Restricted';
175
+ static restEnabled = false;
176
+ constructor() {
177
+ super();
178
+ this.$data.name = '';
179
+ }
180
+ async $save() {
181
+ // Validate entity data.
182
+ const error = new nymph_1.EntityInvalidDataError('Invalid entity data.');
183
+ if (this.$data.name == null || this.$data.name === '') {
184
+ error.addField('name');
185
+ }
186
+ if (error.getFields().length) {
187
+ throw error;
188
+ }
189
+ return await super.$save();
190
+ }
191
+ $testMethod(value) {
192
+ return value;
193
+ }
194
+ static testStatic(value) {
195
+ return value;
196
+ }
197
+ }
198
+ exports.RestrictedModel = RestrictedModel;
199
+ class Restricted extends client_1.Entity {
200
+ // The name of the server class
201
+ static class = 'Restricted';
202
+ constructor() {
203
+ super();
204
+ this.$data.name = '';
205
+ }
206
+ $testMethod(value) {
207
+ return this.$serverCall('$testMethod', [value]);
208
+ }
209
+ static testStatic(value) {
210
+ return this.serverCallStatic('testStatic', [value]);
211
+ }
212
+ }
213
+ exports.Restricted = Restricted;
214
+ /**
215
+ * This class is a test class that extends the Entity class.
216
+ */
217
+ class PubSubDisabledModel extends nymph_1.Entity {
218
+ static ETYPE = 'pubsub_disabled';
219
+ static class = 'PubSubDisabled';
220
+ static pubSubEnabled = false;
221
+ constructor() {
222
+ super();
223
+ this.$data.name = '';
224
+ }
225
+ async $save() {
226
+ // Validate entity data.
227
+ const error = new nymph_1.EntityInvalidDataError('Invalid entity data.');
228
+ if (this.$data.name == null || this.$data.name === '') {
229
+ error.addField('name');
230
+ }
231
+ if (error.getFields().length) {
232
+ throw error;
233
+ }
234
+ return await super.$save();
235
+ }
236
+ }
237
+ exports.PubSubDisabledModel = PubSubDisabledModel;
238
+ class PubSubDisabled extends client_1.Entity {
239
+ // The name of the server class
240
+ static class = 'PubSubDisabled';
241
+ constructor() {
242
+ super();
243
+ this.$data.name = '';
244
+ }
245
+ }
246
+ exports.PubSubDisabled = 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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AC;QACD,OAAO,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;;AAtBH,kDAuBC;AAMD,MAAa,cAAe,SAAQ,eAA0B;IAC5D,+BAA+B;IACxB,MAAM,CAAC,KAAK,GAAG,gBAAgB,CAAC;IAEvC;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;IACvB,CAAC;;AARH,wCASC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nymphjs/server",
3
- "version": "1.0.0-beta.7",
4
- "description": "NymphJS - REST Server",
3
+ "version": "1.0.0-beta.71",
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.7",
34
+ "@nymphjs/nymph": "^1.0.0-beta.71",
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.7",
40
- "@nymphjs/client-node": "^1.0.0-beta.7",
41
- "@nymphjs/driver-sqlite3": "^1.0.0-beta.7",
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.71",
40
+ "@nymphjs/client-node": "^1.0.0-beta.71",
41
+ "@nymphjs/driver-sqlite3": "^1.0.0-beta.71",
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": "0f2e7433e16e40c704f505a3c8db5383d9e6b240"
50
+ "gitHead": "c6e7c987c990dfcdb9f2a176954b69bf5bbbefc7"
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) {