resting-squirrel-controller 2.4.0 → 2.6.0
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/controller.d.ts +14 -9
- package/dist/controller.js +31 -4
- package/dist/controller.js.map +1 -1
- package/dist/decorators/controller-options.d.ts +2 -2
- package/dist/decorators/methods.js +29 -5
- package/dist/decorators/methods.js.map +1 -1
- package/dist/decorators/options.d.ts +2 -2
- package/dist/decorators/resource.d.ts +3 -0
- package/dist/decorators/resource.js +8 -0
- package/dist/decorators/resource.js.map +1 -0
- package/dist/utils.d.ts +35 -7
- package/package.json +14 -14
package/dist/controller.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Application,
|
|
1
|
+
import { Application, Field, IRequest, IResponse, IRouteOptions, Response, RouteAuth } from 'resting-squirrel';
|
|
2
2
|
import { ArgsDto, BaseDto, RequestDto, ResponseDto } from 'resting-squirrel-dto';
|
|
3
|
-
import { IOptions as IControllerOptions } from './decorators/controller-options';
|
|
4
3
|
import { IOptions, RSDtoType } from './decorators/options';
|
|
5
4
|
export interface IStore {
|
|
6
5
|
__endpoints__: Array<IEndpoint>;
|
|
@@ -69,7 +68,7 @@ declare class E {
|
|
|
69
68
|
/**
|
|
70
69
|
* Sets the `errors` option to the endpoint.
|
|
71
70
|
*/
|
|
72
|
-
static errors: (errors:
|
|
71
|
+
static errors: (errors: IOptions['errors']) => (target: Controller, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
73
72
|
/**
|
|
74
73
|
* Sets the `description` option to the endpoint.
|
|
75
74
|
*/
|
|
@@ -119,9 +118,10 @@ export default class Controller {
|
|
|
119
118
|
* @alias version
|
|
120
119
|
*/
|
|
121
120
|
static v: (version: number) => (target: typeof Controller) => void;
|
|
122
|
-
static controllerOptions: (options: Partial<
|
|
121
|
+
static controllerOptions: (options: Partial<import("./decorators/controller-options").IOptions<{
|
|
123
122
|
[key: string]: any;
|
|
124
123
|
}>>) => (target: typeof Controller) => void;
|
|
124
|
+
static resource: (resource: string) => (target: typeof Controller) => void;
|
|
125
125
|
static Endpoint: typeof E;
|
|
126
126
|
/**
|
|
127
127
|
* Marks the endpoint on the method as deprecated.
|
|
@@ -188,7 +188,7 @@ export default class Controller {
|
|
|
188
188
|
* Sets the `errors` option to the endpoint.
|
|
189
189
|
* @deprecated
|
|
190
190
|
*/
|
|
191
|
-
static errors: (errors:
|
|
191
|
+
static errors: (errors: IOptions['errors']) => (target: Controller, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
192
192
|
/**
|
|
193
193
|
* Sets the `description` option to the endpoint.
|
|
194
194
|
* @deprecated
|
|
@@ -231,6 +231,7 @@ export default class Controller {
|
|
|
231
231
|
* @deprecated
|
|
232
232
|
*/
|
|
233
233
|
static emptyResponse: (target: Controller, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
234
|
+
private static _controllers;
|
|
234
235
|
/**
|
|
235
236
|
* Registers all found controllers in the directory to the application.
|
|
236
237
|
*
|
|
@@ -239,13 +240,17 @@ export default class Controller {
|
|
|
239
240
|
*/
|
|
240
241
|
static registerDirectory(app: Application, directory: string): Promise<void>;
|
|
241
242
|
static register(app: Application): void;
|
|
243
|
+
static getControllers(): Controller[];
|
|
242
244
|
private _app;
|
|
243
245
|
constructor(app: Application);
|
|
244
246
|
register(): void;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
beforeExecution(req: IRequest, res: IResponse): Promise<void>;
|
|
248
|
+
getEndpoints(): Array<IEndpoint>;
|
|
249
|
+
getVersion(): number;
|
|
250
|
+
getResource(): string;
|
|
251
|
+
getOptions(propertyKey: string): IRouteOptions;
|
|
252
|
+
isDeprecated(propertyKey: string): boolean;
|
|
253
|
+
getRoute(route: string): string;
|
|
249
254
|
private _getParamsArray;
|
|
250
255
|
private _getResponseArray;
|
|
251
256
|
}
|
package/dist/controller.js
CHANGED
|
@@ -27,6 +27,7 @@ const controller_options_1 = require("./decorators/controller-options");
|
|
|
27
27
|
const deprecated_1 = require("./decorators/deprecated");
|
|
28
28
|
const methods_1 = require("./decorators/methods");
|
|
29
29
|
const options_1 = require("./decorators/options");
|
|
30
|
+
const resource_1 = require("./decorators/resource");
|
|
30
31
|
const version_1 = require("./decorators/version");
|
|
31
32
|
const utils_1 = require("./utils");
|
|
32
33
|
class E {
|
|
@@ -124,9 +125,8 @@ E.redirect = E.options({ redirect: true });
|
|
|
124
125
|
class Controller {
|
|
125
126
|
constructor(app) {
|
|
126
127
|
this._app = app;
|
|
128
|
+
Controller._controllers.push(this);
|
|
127
129
|
}
|
|
128
|
-
// #endregion
|
|
129
|
-
// #endregion
|
|
130
130
|
/**
|
|
131
131
|
* Registers all found controllers in the directory to the application.
|
|
132
132
|
*
|
|
@@ -160,27 +160,36 @@ class Controller {
|
|
|
160
160
|
static register(app) {
|
|
161
161
|
new this(app).register();
|
|
162
162
|
}
|
|
163
|
+
static getControllers() {
|
|
164
|
+
return this._controllers;
|
|
165
|
+
}
|
|
163
166
|
register() {
|
|
164
167
|
const version = this.getVersion();
|
|
165
168
|
for (const endpoint of this.getEndpoints()) {
|
|
166
169
|
let e;
|
|
167
170
|
if (version !== undefined) {
|
|
168
|
-
e = this._app.registerRoute(endpoint.method, version, endpoint.route, this.getOptions(endpoint.propertyKey), endpoint.callback);
|
|
171
|
+
e = this._app.registerRoute(endpoint.method, version, this.getRoute(endpoint.route), this.getOptions(endpoint.propertyKey), endpoint.callback);
|
|
169
172
|
}
|
|
170
173
|
else {
|
|
171
|
-
e = this._app.registerRoute(endpoint.method, endpoint.route, this.getOptions(endpoint.propertyKey), endpoint.callback);
|
|
174
|
+
e = this._app.registerRoute(endpoint.method, this.getRoute(endpoint.route), this.getOptions(endpoint.propertyKey), endpoint.callback);
|
|
172
175
|
}
|
|
173
176
|
if (this.isDeprecated(endpoint.propertyKey)) {
|
|
174
177
|
e.deprecate();
|
|
175
178
|
}
|
|
176
179
|
}
|
|
177
180
|
}
|
|
181
|
+
beforeExecution(req, res) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
183
|
+
}
|
|
178
184
|
getEndpoints() {
|
|
179
185
|
return this.__endpoints__ || [];
|
|
180
186
|
}
|
|
181
187
|
getVersion() {
|
|
182
188
|
return this.constructor.__version__;
|
|
183
189
|
}
|
|
190
|
+
getResource() {
|
|
191
|
+
return this.constructor.__resource__;
|
|
192
|
+
}
|
|
184
193
|
getOptions(propertyKey) {
|
|
185
194
|
const t = this;
|
|
186
195
|
const controllerOptions = this.constructor.__options__;
|
|
@@ -211,6 +220,19 @@ class Controller {
|
|
|
211
220
|
}
|
|
212
221
|
return t.__deprecated__.includes(propertyKey);
|
|
213
222
|
}
|
|
223
|
+
getRoute(route) {
|
|
224
|
+
let resource = this.getResource();
|
|
225
|
+
if (!resource) {
|
|
226
|
+
return route;
|
|
227
|
+
}
|
|
228
|
+
if (resource.indexOf('/') !== 0) {
|
|
229
|
+
resource = `/${resource}`;
|
|
230
|
+
}
|
|
231
|
+
if (route.indexOf('/') !== 0) {
|
|
232
|
+
route = `/${route}`;
|
|
233
|
+
}
|
|
234
|
+
return `${resource}${route}`;
|
|
235
|
+
}
|
|
214
236
|
_getParamsArray(params, optional = [], omit = []) {
|
|
215
237
|
if (!params) {
|
|
216
238
|
return undefined;
|
|
@@ -244,6 +266,7 @@ Controller.version = version_1.default;
|
|
|
244
266
|
*/
|
|
245
267
|
Controller.v = Controller.version;
|
|
246
268
|
Controller.controllerOptions = controller_options_1.default;
|
|
269
|
+
Controller.resource = resource_1.default;
|
|
247
270
|
Controller.Endpoint = E;
|
|
248
271
|
/**
|
|
249
272
|
* Marks the endpoint on the method as deprecated.
|
|
@@ -350,4 +373,8 @@ Controller.props = (props) => Controller.options({ props });
|
|
|
350
373
|
*/
|
|
351
374
|
// tslint:disable-next-line: member-ordering
|
|
352
375
|
Controller.emptyResponse = Controller.response(null);
|
|
376
|
+
// #endregion
|
|
377
|
+
// #endregion
|
|
378
|
+
// tslint:disable-next-line: member-ordering
|
|
379
|
+
Controller._controllers = [];
|
|
353
380
|
//# sourceMappingURL=controller.js.map
|
package/dist/controller.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../src/controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA6B;AAC7B,uDAc0B;AAC1B,+
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../src/controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA6B;AAC7B,uDAc0B;AAC1B,+DAAwF;AAExF,wEAAgE;AAChE,wDAAiD;AACjD,kDAAiE;AACjE,kDAA6E;AAC7E,oDAAsD;AACtD,kDAAoD;AAEpD,mCAA4C;AAe5C,MAAM,CAAC;;AACN;;GAEG;AACW,KAAG,GAAG,aAAG,CAAC;AAExB;;GAEG;AACW,KAAG,GAAG,aAAG,CAAC;AAExB;;GAEG;AACW,MAAI,GAAG,cAAI,CAAC;AAE1B;;GAEG;AACW,QAAM,GAAG,aAAG,CAAC;AAE3B;;GAEG;AACW,MAAI,GAAG,cAAI,CAAC;AAE1B;;GAEG;AACW,SAAO,GAAG,iBAAgB,CAAC;AAEzC;;GAEG;AACW,QAAM,GAAG,CACtB,MAAS,EAAE,KAAkB,EAC5B,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AAEnC;;GAEG;AACW,MAAI,GAAG,CAAC,IAAe,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AAE9D;;GAEG;AACW,QAAM,GAAG,CACtB,MAAsD,EACtD,iBAAgC,EAAE,EAClC,OAAsB,EAAE,EACvB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE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AC,EAAE,aAAa,EAAE,CAAC,CAAC;AAEhG;;;GAGG;AACW,0BAAe,GAAG,CAAC,eACa,EAC5C,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC,CAAA;AAE5C;;;GAGG;AACW,kBAAO,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAE7E;;;GAGG;AACW,gBAAK,GAAG,CAAkC,KAAa,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAExG;;;GAGG;AACH,4CAA4C;AAC9B,wBAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAExD,aAAa;AAEb,aAAa;AAEb,4CAA4C;AAC7B,uBAAY,GAAiB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IRouteOptions, RouteAuth } from 'resting-squirrel';
|
|
2
2
|
import { IRSDto } from 'resting-squirrel-dto';
|
|
3
3
|
import Controller from '../controller';
|
|
4
4
|
export declare type RSDtoType = new (...args: Array<any>) => IRSDto;
|
|
@@ -6,7 +6,7 @@ export interface IOptions<IProps = {
|
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
}> {
|
|
8
8
|
auth: RouteAuth;
|
|
9
|
-
errors:
|
|
9
|
+
errors: IRouteOptions['errors'];
|
|
10
10
|
hideDocs: boolean;
|
|
11
11
|
requireApiKey: boolean;
|
|
12
12
|
excludedApiKeys: (() => Promise<Array<string>>) | Array<string>;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.head = exports.del = exports.post = exports.get = exports.put = void 0;
|
|
4
13
|
const put = (endpoint) => {
|
|
@@ -8,7 +17,10 @@ const put = (endpoint) => {
|
|
|
8
17
|
t.__endpoints__ = [];
|
|
9
18
|
}
|
|
10
19
|
t.__endpoints__.push({
|
|
11
|
-
callback: (req, res) =>
|
|
20
|
+
callback: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
yield target.beforeExecution(req, res);
|
|
22
|
+
return descriptor.value.apply(target, [req, res]);
|
|
23
|
+
}),
|
|
12
24
|
method: 'put',
|
|
13
25
|
propertyKey,
|
|
14
26
|
route: endpoint,
|
|
@@ -24,7 +36,10 @@ const get = (endpoint) => {
|
|
|
24
36
|
t.__endpoints__ = [];
|
|
25
37
|
}
|
|
26
38
|
t.__endpoints__.push({
|
|
27
|
-
callback: (req, res) =>
|
|
39
|
+
callback: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
yield target.beforeExecution(req, res);
|
|
41
|
+
return descriptor.value.apply(target, [req, res]);
|
|
42
|
+
}),
|
|
28
43
|
method: 'get',
|
|
29
44
|
propertyKey,
|
|
30
45
|
route: endpoint,
|
|
@@ -40,7 +55,10 @@ const post = (endpoint) => {
|
|
|
40
55
|
t.__endpoints__ = [];
|
|
41
56
|
}
|
|
42
57
|
t.__endpoints__.push({
|
|
43
|
-
callback: (req, res) =>
|
|
58
|
+
callback: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
+
yield target.beforeExecution(req, res);
|
|
60
|
+
return descriptor.value.apply(target, [req, res]);
|
|
61
|
+
}),
|
|
44
62
|
method: 'post',
|
|
45
63
|
propertyKey,
|
|
46
64
|
route: endpoint,
|
|
@@ -56,7 +74,10 @@ const del = (endpoint) => {
|
|
|
56
74
|
t.__endpoints__ = [];
|
|
57
75
|
}
|
|
58
76
|
t.__endpoints__.push({
|
|
59
|
-
callback: (req, res) =>
|
|
77
|
+
callback: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
+
yield target.beforeExecution(req, res);
|
|
79
|
+
return descriptor.value.apply(target, [req, res]);
|
|
80
|
+
}),
|
|
60
81
|
method: 'delete',
|
|
61
82
|
propertyKey,
|
|
62
83
|
route: endpoint,
|
|
@@ -72,7 +93,10 @@ const head = (endpoint) => {
|
|
|
72
93
|
t.__endpoints__ = [];
|
|
73
94
|
}
|
|
74
95
|
t.__endpoints__.push({
|
|
75
|
-
callback: (req, res) =>
|
|
96
|
+
callback: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
|
+
yield target.beforeExecution(req, res);
|
|
98
|
+
return descriptor.value.apply(target, [req, res]);
|
|
99
|
+
}),
|
|
76
100
|
method: 'head',
|
|
77
101
|
propertyKey,
|
|
78
102
|
route: endpoint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/decorators/methods.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/decorators/methods.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGO,MAAM,GAAG,GAAG,CAAC,QAAgB,EAAE,EAAE;IACvC,OAAO,CAAC,MAAkB,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE;QAClF,MAAM,CAAC,GAAW,MAAa,CAAC;QAChC,IAAI,CAAC,CAAC,CAAC,aAAa,EAAE;YACrB,CAAC,CAAC,aAAa,GAAG,EAAE,CAAC;SACrB;QACD,CAAC,CAAC,aAAa,CAAC,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GAAG,OAiBd;AAEK,MAAM,IAAI,GAAG,CAAC,QAAgB,EAAE,EAAE;IACxC,OAAO,CAAC,MAAkB,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE;QAClF,MAAM,CAAC,GAAW,MAAa,CAAC;QAChC,IAAI,CAAC,CAAC,CAAC,aAAa,EAAE;YACrB,CAAC,CAAC,aAAa,GAAG,EAAE,CAAC;SACrB;QACD,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC;YACpB,QAAQ,EAAE,CAAO,GAAa,EAAE,GAAQ,EAAE,EAAE;gBAC3C,MAAM,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBACvC,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;YAClD,CAAC,CAAA;YACD,MAAM,EAAE,MAAM;YACd,WAAW;YACX,KAAK,EAAE,QAAQ;SACf,CAAC,CAAC;QACH,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC,CAAC;AAjBW,QAAA,IAAI,QAiBf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Field, Response, RouteAuth, IRouteOptions } from 'resting-squirrel';
|
|
2
2
|
import { ArgsDto, BaseDto, IRSDto, RequestDto, ResponseDto } from 'resting-squirrel-dto';
|
|
3
3
|
import Controller from '../controller';
|
|
4
4
|
export declare type RSDtoType = new (...args: Array<any>) => IRSDto;
|
|
@@ -8,7 +8,7 @@ export interface IOptions<IProps = {
|
|
|
8
8
|
auth: RouteAuth;
|
|
9
9
|
params: RSDtoType | typeof BaseDto | typeof RequestDto;
|
|
10
10
|
response: RSDtoType | typeof BaseDto | typeof ResponseDto | Response.Base;
|
|
11
|
-
errors
|
|
11
|
+
errors?: IRouteOptions['errors'];
|
|
12
12
|
description: string;
|
|
13
13
|
hideDocs: boolean;
|
|
14
14
|
args: (typeof ArgsDto) | Array<Field>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../src/decorators/resource.ts"],"names":[],"mappings":";;AAEA,kBAAe,CAAC,QAAgB,EAAE,EAAE;IACnC,OAAO,CAAC,MAAyB,EAAE,EAAE;QACnC,MAAc,CAAC,YAAY,GAAG,QAAQ,CAAC;IACzC,CAAC,CAAC;AACH,CAAC,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -15,17 +15,36 @@ export declare const fs: {
|
|
|
15
15
|
fchownSync(fd: number, uid: number, gid: number): void;
|
|
16
16
|
lchown: typeof nfs.lchown;
|
|
17
17
|
lchownSync(path: nfs.PathLike, uid: number, gid: number): void;
|
|
18
|
+
lutimes: typeof nfs.lutimes;
|
|
19
|
+
lutimesSync(path: nfs.PathLike, atime: string | number | Date, mtime: string | number | Date): void;
|
|
18
20
|
chmod: typeof nfs.chmod;
|
|
19
21
|
chmodSync(path: nfs.PathLike, mode: string | number): void;
|
|
20
22
|
fchmod: typeof nfs.fchmod;
|
|
21
23
|
fchmodSync(fd: number, mode: string | number): void;
|
|
22
24
|
lchmod: typeof nfs.lchmod;
|
|
23
25
|
lchmodSync(path: nfs.PathLike, mode: string | number): void;
|
|
24
|
-
statSync(path: nfs.PathLike
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
statSync(path: nfs.PathLike, options?: nfs.StatOptions & {
|
|
27
|
+
bigint?: false;
|
|
28
|
+
}): nfs.Stats;
|
|
29
|
+
statSync(path: nfs.PathLike, options: nfs.StatOptions & {
|
|
30
|
+
bigint: true;
|
|
31
|
+
}): nfs.BigIntStats;
|
|
32
|
+
statSync(path: nfs.PathLike, options?: nfs.StatOptions): nfs.Stats | nfs.BigIntStats;
|
|
33
|
+
fstatSync(fd: number, options?: nfs.StatOptions & {
|
|
34
|
+
bigint?: false;
|
|
35
|
+
}): nfs.Stats;
|
|
36
|
+
fstatSync(fd: number, options: nfs.StatOptions & {
|
|
37
|
+
bigint: true;
|
|
38
|
+
}): nfs.BigIntStats;
|
|
39
|
+
fstatSync(fd: number, options?: nfs.StatOptions): nfs.Stats | nfs.BigIntStats;
|
|
27
40
|
lstat: typeof nfs.lstat;
|
|
28
|
-
lstatSync(path: nfs.PathLike
|
|
41
|
+
lstatSync(path: nfs.PathLike, options?: nfs.StatOptions & {
|
|
42
|
+
bigint?: false;
|
|
43
|
+
}): nfs.Stats;
|
|
44
|
+
lstatSync(path: nfs.PathLike, options: nfs.StatOptions & {
|
|
45
|
+
bigint: true;
|
|
46
|
+
}): nfs.BigIntStats;
|
|
47
|
+
lstatSync(path: nfs.PathLike, options?: nfs.StatOptions): nfs.Stats | nfs.BigIntStats;
|
|
29
48
|
link: typeof nfs.link;
|
|
30
49
|
linkSync(existingPath: nfs.PathLike, newPath: nfs.PathLike): void;
|
|
31
50
|
symlink: typeof nfs.symlink;
|
|
@@ -45,7 +64,7 @@ export declare const fs: {
|
|
|
45
64
|
unlink: typeof nfs.unlink;
|
|
46
65
|
unlinkSync(path: nfs.PathLike): void;
|
|
47
66
|
rmdir: typeof nfs.rmdir;
|
|
48
|
-
rmdirSync(path: nfs.PathLike): void;
|
|
67
|
+
rmdirSync(path: nfs.PathLike, options?: nfs.RmDirOptions): void;
|
|
49
68
|
mkdir: typeof nfs.mkdir;
|
|
50
69
|
mkdirSync(path: nfs.PathLike, options?: string | number | nfs.MakeDirectoryOptions): void;
|
|
51
70
|
mkdtemp: typeof nfs.mkdtemp;
|
|
@@ -85,10 +104,10 @@ export declare const fs: {
|
|
|
85
104
|
fsync: typeof nfs.fsync;
|
|
86
105
|
fsyncSync(fd: number): void;
|
|
87
106
|
write: typeof nfs.write;
|
|
88
|
-
writeSync(fd: number, buffer:
|
|
107
|
+
writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number, length?: number, position?: number): number;
|
|
89
108
|
writeSync(fd: number, string: any, position?: number, encoding?: string): number;
|
|
90
109
|
read: typeof nfs.read;
|
|
91
|
-
readSync(fd: number, buffer:
|
|
110
|
+
readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: number): number;
|
|
92
111
|
readFile: typeof nfs.readFile;
|
|
93
112
|
readFileSync(path: number | nfs.PathLike, options?: {
|
|
94
113
|
encoding?: null;
|
|
@@ -138,6 +157,7 @@ export declare const fs: {
|
|
|
138
157
|
fd?: number;
|
|
139
158
|
mode?: number;
|
|
140
159
|
autoClose?: boolean;
|
|
160
|
+
emitClose?: boolean;
|
|
141
161
|
start?: number;
|
|
142
162
|
end?: number;
|
|
143
163
|
highWaterMark?: number;
|
|
@@ -148,6 +168,7 @@ export declare const fs: {
|
|
|
148
168
|
fd?: number;
|
|
149
169
|
mode?: number;
|
|
150
170
|
autoClose?: boolean;
|
|
171
|
+
emitClose?: boolean;
|
|
151
172
|
start?: number;
|
|
152
173
|
highWaterMark?: number;
|
|
153
174
|
}): nfs.WriteStream;
|
|
@@ -155,11 +176,18 @@ export declare const fs: {
|
|
|
155
176
|
fdatasyncSync(fd: number): void;
|
|
156
177
|
copyFile: typeof nfs.copyFile;
|
|
157
178
|
copyFileSync(src: nfs.PathLike, dest: nfs.PathLike, flags?: number): void;
|
|
179
|
+
writev: typeof nfs.writev;
|
|
180
|
+
writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): number;
|
|
181
|
+
opendirSync(path: nfs.PathLike, options?: nfs.OpenDirOptions): nfs.Dir;
|
|
182
|
+
opendir: typeof nfs.opendir;
|
|
158
183
|
Stats: typeof nfs.Stats;
|
|
159
184
|
Dirent: typeof nfs.Dirent;
|
|
185
|
+
Dir: typeof nfs.Dir;
|
|
160
186
|
ReadStream: typeof nfs.ReadStream;
|
|
161
187
|
WriteStream: typeof nfs.WriteStream;
|
|
188
|
+
fstat: typeof nfs.fstat;
|
|
162
189
|
constants: typeof nfs.constants;
|
|
163
190
|
promises: typeof nfs.promises;
|
|
191
|
+
BigIntStats: typeof nfs.BigIntStats;
|
|
164
192
|
};
|
|
165
193
|
export declare const requireModule: <T>(path: string) => T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resting-squirrel-controller",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Controller for defining endpoints in resting-squirrel.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -33,23 +33,23 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/chai": "^4.
|
|
36
|
+
"@types/chai": "^4.3.1",
|
|
37
37
|
"@types/core-js": "^2.5.5",
|
|
38
|
-
"@types/mocha": "^
|
|
39
|
-
"@types/node": "^
|
|
40
|
-
"@types/node-fetch": "^2.
|
|
41
|
-
"chai": "^4.
|
|
42
|
-
"mocha": "^
|
|
43
|
-
"node-fetch": "^2.6.
|
|
44
|
-
"resting-squirrel": "^2.27.
|
|
45
|
-
"resting-squirrel-connector": "^2.3.
|
|
38
|
+
"@types/mocha": "^9.1.0",
|
|
39
|
+
"@types/node": "^12.20.48",
|
|
40
|
+
"@types/node-fetch": "^2.6.1",
|
|
41
|
+
"chai": "^4.3.6",
|
|
42
|
+
"mocha": "^9.2.2",
|
|
43
|
+
"node-fetch": "^2.6.7",
|
|
44
|
+
"resting-squirrel": "^2.27.1",
|
|
45
|
+
"resting-squirrel-connector": "^2.3.4",
|
|
46
46
|
"resting-squirrel-dto": "^2.0.2",
|
|
47
47
|
"run-script-os-fix": "^1.0.4",
|
|
48
|
-
"source-map-support": "^0.5.
|
|
49
|
-
"ts-node": "^10.
|
|
48
|
+
"source-map-support": "^0.5.21",
|
|
49
|
+
"ts-node": "^10.5.0",
|
|
50
50
|
"tslint": "^6.1.3",
|
|
51
|
-
"typedoc": "^0.22.
|
|
52
|
-
"typescript": "^4.
|
|
51
|
+
"typedoc": "^0.22.15",
|
|
52
|
+
"typescript": "^4.5.5"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"resting-squirrel": "^2.27.0",
|