orator-serviceserver-restify 2.0.9 → 2.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orator-serviceserver-restify",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "Restify Service Server for Orator",
5
5
  "main": "source/Orator-ServiceServer-Restify.js",
6
6
  "scripts": {
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/stevenvelozo/orator-serviceserver-restify#readme",
48
48
  "dependencies": {
49
- "orator-serviceserver-base": "^1.0.6",
49
+ "orator-serviceserver-base": "^1.0.7",
50
50
  "restify": "^11.1.0"
51
51
  },
52
52
  "devDependencies": {
@@ -54,12 +54,13 @@
54
54
  "@types/jquery": "^3.5.33",
55
55
  "@types/mocha": "^10.0.10",
56
56
  "@types/node": "^16.18.126",
57
+ "@types/restify": "^8.5.12",
57
58
  "@types/sinon": "^17.0.4",
58
59
  "eslint": "^9.39.1",
59
- "fable": "^3.1.61",
60
+ "fable": "^3.1.67",
60
61
  "globals": "^16.5.0",
61
- "orator": "^6.0.2",
62
- "quackage": "^1.0.58",
62
+ "orator": "^6.0.4",
63
+ "quackage": "^1.0.65",
63
64
  "typescript": "^5.9.3"
64
65
  }
65
66
  }
@@ -5,6 +5,9 @@ const _DefaultRestifyConfiguration =
5
5
  {
6
6
  maxParamLength: Number.MAX_SAFE_INTEGER,
7
7
  };
8
+ /**
9
+ * @extends {libOratorServiceServerBase<import('restify').Request, import('restify').Response, import('restify').Server>}
10
+ */
8
11
  class OratorServiceServerRestify extends libOratorServiceServerBase
9
12
  {
10
13
  /**
@@ -22,7 +25,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
22
25
  (this.fable.settings.hasOwnProperty('RestifyConfiguration')) ? this.fable.settings.RestifyConfiguration :
23
26
  {};
24
27
 
25
- /** @type {libRestify} */
28
+ /** @type {import('restify').Server} */
26
29
  this.server = libRestify.createServer(Object.assign({}, _DefaultRestifyConfiguration, tmpRestifyConfiguration));
27
30
  }
28
31
 
@@ -68,7 +71,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
68
71
  /**
69
72
  * Registers a global handler function to be used by the Orator service server.
70
73
  *
71
- * @param {import('orator-serviceserver-base').RequestHandler} fHandlerFunction - The handler function to be registered. It should have the prototype function(Request, Response, Next).
74
+ * @param {import('orator-serviceserver-base').RequestHandler<import('restify').Request, import('restify').Response>} fHandlerFunction - The handler function to be registered. It should have the prototype function(Request, Response, Next).
72
75
  * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
73
76
  */
74
77
  use(fHandlerFunction)
@@ -85,7 +88,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
85
88
  /**
86
89
  * Registers a global handler function to be used by the Orator service server that runs before routing.
87
90
  *
88
- * @param {function} fHandlerFunction - The handler function to be registered. It should have the prototype function(Request, Response, Next).
91
+ * @param {import('orator-serviceserver-base').RequestHandler<import('restify').Request, import('restify').Response>} fHandlerFunction - The handler function to be registered. It should have the prototype function(Request, Response, Next).
89
92
  * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
90
93
  */
91
94
  pre(fHandlerFunction)
@@ -103,7 +106,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
103
106
  * Middleware function for parsing the request body.
104
107
  *
105
108
  * @param {Record<string, any>} [pOptions] - The options for the body parser.
106
- * @return {import('orator-serviceserver-base').RequestHandler} - The middleware function.
109
+ * @return {import('restify').RequestHandler[]} - The middleware function.
107
110
  */
108
111
  bodyParser(pOptions)
109
112
  {
@@ -143,7 +146,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
143
146
  * Handles HTTP GET requests -- this is a base function that does nothing; override by the serviceserver is expected.
144
147
  *
145
148
  * @param {string} pRoute - The route of the request.
146
- * @param {...Function} fRouteProcessingFunctions - The processing functions for the route.
149
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions for the route.
147
150
  * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
148
151
  */
149
152
  doGet(pRoute, ...fRouteProcessingFunctions)
@@ -155,7 +158,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
155
158
  * Handles HTTP PUT requests -- this is a base function that does nothing; override by the serviceserver is expected.
156
159
  *
157
160
  * @param {string} pRoute - The route to handle.
158
- * @param {...Function} fRouteProcessingFunctions - The processing functions to execute for the route.
161
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to execute for the route.
159
162
  * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
160
163
  */
161
164
  doPut(pRoute, ...fRouteProcessingFunctions)
@@ -167,7 +170,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
167
170
  * Handles the HTTP POST request for a specific route.
168
171
  *
169
172
  * @param {string} pRoute - The route to handle the POST request for.
170
- * @param {...Function} fRouteProcessingFunctions - The processing functions to execute for the route.
173
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to execute for the route.
171
174
  * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
172
175
  */
173
176
  doPost(pRoute, ...fRouteProcessingFunctions)
@@ -179,7 +182,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
179
182
  * Handles HTTP DELETE requests -- this is a base function that does nothing; override by the serviceserver is expected.
180
183
  *
181
184
  * @param {string} pRoute - The route of the resource to delete.
182
- * @param {...Function} fRouteProcessingFunctions - The processing functions to be executed to delete the resource.
185
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to be executed to delete the resource.
183
186
  * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
184
187
  */
185
188
  doDel(pRoute, ...fRouteProcessingFunctions)
@@ -191,7 +194,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
191
194
  * Handles HTTP PATCH requests -- this is a base function that does nothing; override by the serviceserver is expected.
192
195
  *
193
196
  * @param {string} pRoute - The route to send the PATCH request to.
194
- * @param {...Function} fRouteProcessingFunctions - The processing functions to apply to the route.
197
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to apply to the route.
195
198
  * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
196
199
  */
197
200
  doPatch(pRoute, ...fRouteProcessingFunctions)
@@ -203,7 +206,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
203
206
  * Handles HTTP OPT requests -- this is a base function that does nothing; override by the serviceserver is expected.
204
207
  *
205
208
  * @param {string} pRoute - The route.
206
- * @param {...Function} fRouteProcessingFunctions - The processing functions to apply to the route.
209
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to apply to the route.
207
210
  * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
208
211
  */
209
212
  doOpts(pRoute, ...fRouteProcessingFunctions)
@@ -215,7 +218,7 @@ class OratorServiceServerRestify extends libOratorServiceServerBase
215
218
  * Handles HTTP HEAD requests -- this is a base function that does nothing; override by the serviceserver is expected.
216
219
  *
217
220
  * @param {string} pRoute - The route to handle the HEAD request for.
218
- * @param {...Function} fRouteProcessingFunctions - The processing functions to execute for the route.
221
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to execute for the route.
219
222
  * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
220
223
  */
221
224
  doHead(pRoute, ...fRouteProcessingFunctions)
@@ -1,7 +1,80 @@
1
1
  export = OratorServiceServerRestify;
2
- declare class OratorServiceServerRestify extends libOratorServiceServerBase {
3
- /** @type {libRestify} */
4
- server: libRestify;
2
+ /**
3
+ * @extends {libOratorServiceServerBase<import('restify').Request, import('restify').Response, import('restify').Server>}
4
+ */
5
+ declare class OratorServiceServerRestify extends libOratorServiceServerBase<libRestify.Request, libRestify.Response, libRestify.Server> {
6
+ /**
7
+ * @param {import('fable')|Record<string, any>} [pFable] - (optional) The fable instance, or the options object if there is no fable
8
+ * @param {Record<string, any>|string} [pOptions] - (optional) The options object, or the service hash if there is no fable
9
+ * @param {string} [pServiceHash] - (optional) The service hash to identify this service instance
10
+ */
11
+ constructor(pFable?: any | Record<string, any>, pOptions?: Record<string, any> | string, pServiceHash?: string);
12
+ /** @type {import('restify').Server} */
13
+ server: import("restify").Server;
14
+ /**
15
+ * Middleware function for parsing the request body.
16
+ *
17
+ * @param {Record<string, any>} [pOptions] - The options for the body parser.
18
+ * @return {import('restify').RequestHandler[]} - The middleware function.
19
+ */
20
+ bodyParser(pOptions?: Record<string, any>): import("restify").RequestHandler[];
21
+ /**
22
+ * Handles HTTP GET requests -- this is a base function that does nothing; override by the serviceserver is expected.
23
+ *
24
+ * @param {string} pRoute - The route of the request.
25
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions for the route.
26
+ * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
27
+ */
28
+ doGet(pRoute: string, ...fRouteProcessingFunctions: import("restify").RequestHandlerType[]): any;
29
+ /**
30
+ * Handles HTTP PUT requests -- this is a base function that does nothing; override by the serviceserver is expected.
31
+ *
32
+ * @param {string} pRoute - The route to handle.
33
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to execute for the route.
34
+ * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
35
+ */
36
+ doPut(pRoute: string, ...fRouteProcessingFunctions: import("restify").RequestHandlerType[]): any;
37
+ /**
38
+ * Handles the HTTP POST request for a specific route.
39
+ *
40
+ * @param {string} pRoute - The route to handle the POST request for.
41
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to execute for the route.
42
+ * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
43
+ */
44
+ doPost(pRoute: string, ...fRouteProcessingFunctions: import("restify").RequestHandlerType[]): any;
45
+ /**
46
+ * Handles HTTP DELETE requests -- this is a base function that does nothing; override by the serviceserver is expected.
47
+ *
48
+ * @param {string} pRoute - The route of the resource to delete.
49
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to be executed to delete the resource.
50
+ * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
51
+ */
52
+ doDel(pRoute: string, ...fRouteProcessingFunctions: import("restify").RequestHandlerType[]): any;
53
+ /**
54
+ * Handles HTTP PATCH requests -- this is a base function that does nothing; override by the serviceserver is expected.
55
+ *
56
+ * @param {string} pRoute - The route to send the PATCH request to.
57
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to apply to the route.
58
+ * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
59
+ */
60
+ doPatch(pRoute: string, ...fRouteProcessingFunctions: import("restify").RequestHandlerType[]): any;
61
+ /**
62
+ * Handles HTTP OPT requests -- this is a base function that does nothing; override by the serviceserver is expected.
63
+ *
64
+ * @param {string} pRoute - The route.
65
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to apply to the route.
66
+ * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
67
+ */
68
+ doOpts(pRoute: string, ...fRouteProcessingFunctions: import("restify").RequestHandlerType[]): any;
69
+ /**
70
+ * Handles HTTP HEAD requests -- this is a base function that does nothing; override by the serviceserver is expected.
71
+ *
72
+ * @param {string} pRoute - The route to handle the HEAD request for.
73
+ * @param {...import('restify').RequestHandlerType} fRouteProcessingFunctions - The processing functions to execute for the route.
74
+ * @returns {any} - The result of adding the route to the concrete service provider (ex. a route object, a boolean).
75
+ */
76
+ doHead(pRoute: string, ...fRouteProcessingFunctions: import("restify").RequestHandlerType[]): any;
5
77
  }
78
+ import libRestify = require("restify");
6
79
  import libOratorServiceServerBase = require("orator-serviceserver-base");
7
80
  //# sourceMappingURL=Orator-ServiceServer-Restify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Orator-ServiceServer-Restify.d.ts","sourceRoot":"","sources":["../source/Orator-ServiceServer-Restify.js"],"names":[],"mappings":";AAOA;IAiBE,yBAAyB;IACzB,QADW,UAAU,CAC0F;CA0MhH"}
1
+ {"version":3,"file":"Orator-ServiceServer-Restify.d.ts","sourceRoot":"","sources":["../source/Orator-ServiceServer-Restify.js"],"names":[],"mappings":";AAOA;;GAEG;AACH;IAEC;;;;OAIG;IACH,qBAJW,GAAe,GAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,aACnC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAC,MAAM,iBAC1B,MAAM,EAchB;IAFA,uCAAuC;IACvC,QADW,OAAO,SAAS,EAAE,MAAM,CAC4E;IA4EhH;;;;;OAKG;IACH,sBAHW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAClB,OAAO,SAAS,EAAE,cAAc,EAAE,CA+B7C;IAKD;;;;;;OAMG;IACH,cAJW,MAAM,gCACH,OAAO,SAAS,EAAE,kBAAkB,EAAA,GACrC,GAAG,CAKf;IAED;;;;;;OAMG;IACH,cAJW,MAAM,gCACH,OAAO,SAAS,EAAE,kBAAkB,EAAA,GACrC,GAAG,CAKf;IAED;;;;;;OAMG;IACH,eAJW,MAAM,gCACH,OAAO,SAAS,EAAE,kBAAkB,EAAA,GACrC,GAAG,CAKf;IAED;;;;;;OAMG;IACH,cAJW,MAAM,gCACH,OAAO,SAAS,EAAE,kBAAkB,EAAA,GACrC,GAAG,CAKf;IAED;;;;;;OAMG;IACH,gBAJW,MAAM,gCACH,OAAO,SAAS,EAAE,kBAAkB,EAAA,GACrC,GAAG,CAKf;IAED;;;;;;OAMG;IACH,eAJW,MAAM,gCACH,OAAO,SAAS,EAAE,kBAAkB,EAAA,GACrC,GAAG,CAKf;IAED;;;;;;OAMG;IACH,eAJW,MAAM,gCACH,OAAO,SAAS,EAAE,kBAAkB,EAAA,GACrC,GAAG,CAKf;CAID"}