@e22m4u/ts-rest-router 0.2.6 → 0.2.8
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/cjs/index.cjs +7 -7
- package/dist/esm/decorators/request-data/request-data-decorator.js +7 -7
- package/dist/esm/decorators/request-data/request-data-decorator.spec.js +4 -4
- package/package.json +1 -1
- package/src/decorators/request-data/request-data-decorator.spec.ts +4 -4
- package/src/decorators/request-data/request-data-decorator.ts +1 -7
package/dist/cjs/index.cjs
CHANGED
@@ -306,7 +306,7 @@ function createRequestDataDecoratorWithSource(source) {
|
|
306
306
|
};
|
307
307
|
}
|
308
308
|
__name(createRequestDataDecoratorWithSource, "createRequestDataDecoratorWithSource");
|
309
|
-
function createRequestDataPropertyDecoratorWithSource(source
|
309
|
+
function createRequestDataPropertyDecoratorWithSource(source) {
|
310
310
|
return function(propertyKey, schemaOrType) {
|
311
311
|
const properties = {};
|
312
312
|
const rootSchema = { type: import_ts_data_schema.DataType.OBJECT };
|
@@ -317,7 +317,7 @@ function createRequestDataPropertyDecoratorWithSource(source, defaultType) {
|
|
317
317
|
properties[propertyKey] = { type: schemaOrType };
|
318
318
|
rootSchema.properties = properties;
|
319
319
|
} else {
|
320
|
-
properties[propertyKey] = { type:
|
320
|
+
properties[propertyKey] = { type: import_ts_data_schema.DataType.ANY };
|
321
321
|
rootSchema.properties = properties;
|
322
322
|
}
|
323
323
|
return requestData({
|
@@ -329,15 +329,15 @@ function createRequestDataPropertyDecoratorWithSource(source, defaultType) {
|
|
329
329
|
}
|
330
330
|
__name(createRequestDataPropertyDecoratorWithSource, "createRequestDataPropertyDecoratorWithSource");
|
331
331
|
var requestParams = createRequestDataDecoratorWithSource(RequestDataSource.PARAMS);
|
332
|
-
var requestParam = createRequestDataPropertyDecoratorWithSource(RequestDataSource.PARAMS
|
332
|
+
var requestParam = createRequestDataPropertyDecoratorWithSource(RequestDataSource.PARAMS);
|
333
333
|
var requestQueries = createRequestDataDecoratorWithSource(RequestDataSource.QUERY);
|
334
|
-
var requestQuery = createRequestDataPropertyDecoratorWithSource(RequestDataSource.QUERY
|
334
|
+
var requestQuery = createRequestDataPropertyDecoratorWithSource(RequestDataSource.QUERY);
|
335
335
|
var requestHeaders = createRequestDataDecoratorWithSource(RequestDataSource.HEADERS);
|
336
|
-
var requestHeader = createRequestDataPropertyDecoratorWithSource(RequestDataSource.HEADERS
|
336
|
+
var requestHeader = createRequestDataPropertyDecoratorWithSource(RequestDataSource.HEADERS);
|
337
337
|
var requestCookies = createRequestDataDecoratorWithSource(RequestDataSource.COOKIE);
|
338
|
-
var requestCookie = createRequestDataPropertyDecoratorWithSource(RequestDataSource.COOKIE
|
338
|
+
var requestCookie = createRequestDataPropertyDecoratorWithSource(RequestDataSource.COOKIE);
|
339
339
|
var requestBody = createRequestDataDecoratorWithSource(RequestDataSource.BODY);
|
340
|
-
var requestField = createRequestDataPropertyDecoratorWithSource(RequestDataSource.BODY
|
340
|
+
var requestField = createRequestDataPropertyDecoratorWithSource(RequestDataSource.BODY);
|
341
341
|
|
342
342
|
// dist/esm/decorators/after-action/after-action-metadata.js
|
343
343
|
var import_ts_reflector9 = require("@e22m4u/ts-reflector");
|
@@ -42,7 +42,7 @@ function createRequestDataDecoratorWithSource(source) {
|
|
42
42
|
*
|
43
43
|
* @param source
|
44
44
|
*/
|
45
|
-
function createRequestDataPropertyDecoratorWithSource(source
|
45
|
+
function createRequestDataPropertyDecoratorWithSource(source) {
|
46
46
|
return function (propertyKey, schemaOrType) {
|
47
47
|
const properties = {};
|
48
48
|
const rootSchema = { type: DataType.OBJECT };
|
@@ -55,7 +55,7 @@ function createRequestDataPropertyDecoratorWithSource(source, defaultType) {
|
|
55
55
|
rootSchema.properties = properties;
|
56
56
|
}
|
57
57
|
else {
|
58
|
-
properties[propertyKey] = { type:
|
58
|
+
properties[propertyKey] = { type: DataType.ANY };
|
59
59
|
rootSchema.properties = properties;
|
60
60
|
}
|
61
61
|
return requestData({
|
@@ -69,12 +69,12 @@ function createRequestDataPropertyDecoratorWithSource(source, defaultType) {
|
|
69
69
|
* Decorator aliases.
|
70
70
|
*/
|
71
71
|
export const requestParams = createRequestDataDecoratorWithSource(RequestDataSource.PARAMS);
|
72
|
-
export const requestParam = createRequestDataPropertyDecoratorWithSource(RequestDataSource.PARAMS
|
72
|
+
export const requestParam = createRequestDataPropertyDecoratorWithSource(RequestDataSource.PARAMS);
|
73
73
|
export const requestQueries = createRequestDataDecoratorWithSource(RequestDataSource.QUERY);
|
74
|
-
export const requestQuery = createRequestDataPropertyDecoratorWithSource(RequestDataSource.QUERY
|
74
|
+
export const requestQuery = createRequestDataPropertyDecoratorWithSource(RequestDataSource.QUERY);
|
75
75
|
export const requestHeaders = createRequestDataDecoratorWithSource(RequestDataSource.HEADERS);
|
76
|
-
export const requestHeader = createRequestDataPropertyDecoratorWithSource(RequestDataSource.HEADERS
|
76
|
+
export const requestHeader = createRequestDataPropertyDecoratorWithSource(RequestDataSource.HEADERS);
|
77
77
|
export const requestCookies = createRequestDataDecoratorWithSource(RequestDataSource.COOKIE);
|
78
|
-
export const requestCookie = createRequestDataPropertyDecoratorWithSource(RequestDataSource.COOKIE
|
78
|
+
export const requestCookie = createRequestDataPropertyDecoratorWithSource(RequestDataSource.COOKIE);
|
79
79
|
export const requestBody = createRequestDataDecoratorWithSource(RequestDataSource.BODY);
|
80
|
-
export const requestField = createRequestDataPropertyDecoratorWithSource(RequestDataSource.BODY
|
80
|
+
export const requestField = createRequestDataPropertyDecoratorWithSource(RequestDataSource.BODY);
|
@@ -203,7 +203,7 @@ describe('requestData', function () {
|
|
203
203
|
type: DataType.OBJECT,
|
204
204
|
properties: {
|
205
205
|
[propertyKey]: {
|
206
|
-
type: DataType.
|
206
|
+
type: DataType.ANY,
|
207
207
|
},
|
208
208
|
},
|
209
209
|
},
|
@@ -283,7 +283,7 @@ describe('requestData', function () {
|
|
283
283
|
type: DataType.OBJECT,
|
284
284
|
properties: {
|
285
285
|
[propertyKey]: {
|
286
|
-
type: DataType.
|
286
|
+
type: DataType.ANY,
|
287
287
|
},
|
288
288
|
},
|
289
289
|
},
|
@@ -363,7 +363,7 @@ describe('requestData', function () {
|
|
363
363
|
type: DataType.OBJECT,
|
364
364
|
properties: {
|
365
365
|
[propertyKey]: {
|
366
|
-
type: DataType.
|
366
|
+
type: DataType.ANY,
|
367
367
|
},
|
368
368
|
},
|
369
369
|
},
|
@@ -443,7 +443,7 @@ describe('requestData', function () {
|
|
443
443
|
type: DataType.OBJECT,
|
444
444
|
properties: {
|
445
445
|
[propertyKey]: {
|
446
|
-
type: DataType.
|
446
|
+
type: DataType.ANY,
|
447
447
|
},
|
448
448
|
},
|
449
449
|
},
|
package/package.json
CHANGED
@@ -174,7 +174,7 @@ describe('requestData', function () {
|
|
174
174
|
type: DataType.OBJECT,
|
175
175
|
properties: {
|
176
176
|
[propertyKey]: {
|
177
|
-
type: DataType.
|
177
|
+
type: DataType.ANY,
|
178
178
|
},
|
179
179
|
},
|
180
180
|
},
|
@@ -248,7 +248,7 @@ describe('requestData', function () {
|
|
248
248
|
type: DataType.OBJECT,
|
249
249
|
properties: {
|
250
250
|
[propertyKey]: {
|
251
|
-
type: DataType.
|
251
|
+
type: DataType.ANY,
|
252
252
|
},
|
253
253
|
},
|
254
254
|
},
|
@@ -322,7 +322,7 @@ describe('requestData', function () {
|
|
322
322
|
type: DataType.OBJECT,
|
323
323
|
properties: {
|
324
324
|
[propertyKey]: {
|
325
|
-
type: DataType.
|
325
|
+
type: DataType.ANY,
|
326
326
|
},
|
327
327
|
},
|
328
328
|
},
|
@@ -396,7 +396,7 @@ describe('requestData', function () {
|
|
396
396
|
type: DataType.OBJECT,
|
397
397
|
properties: {
|
398
398
|
[propertyKey]: {
|
399
|
-
type: DataType.
|
399
|
+
type: DataType.ANY,
|
400
400
|
},
|
401
401
|
},
|
402
402
|
},
|
@@ -62,7 +62,6 @@ function createRequestDataDecoratorWithSource(source: RequestDataSource) {
|
|
62
62
|
*/
|
63
63
|
function createRequestDataPropertyDecoratorWithSource(
|
64
64
|
source: RequestDataSource,
|
65
|
-
defaultType: DataType,
|
66
65
|
) {
|
67
66
|
return function (propertyKey: string, schemaOrType?: DataSchema | DataType) {
|
68
67
|
const properties = {} as NoUndef<DataSchema['properties']>;
|
@@ -74,7 +73,7 @@ function createRequestDataPropertyDecoratorWithSource(
|
|
74
73
|
properties[propertyKey] = {type: schemaOrType};
|
75
74
|
rootSchema.properties = properties;
|
76
75
|
} else {
|
77
|
-
properties[propertyKey] = {type:
|
76
|
+
properties[propertyKey] = {type: DataType.ANY};
|
78
77
|
rootSchema.properties = properties;
|
79
78
|
}
|
80
79
|
return requestData({
|
@@ -93,33 +92,28 @@ export const requestParams = createRequestDataDecoratorWithSource(
|
|
93
92
|
);
|
94
93
|
export const requestParam = createRequestDataPropertyDecoratorWithSource(
|
95
94
|
RequestDataSource.PARAMS,
|
96
|
-
DataType.STRING,
|
97
95
|
);
|
98
96
|
export const requestQueries = createRequestDataDecoratorWithSource(
|
99
97
|
RequestDataSource.QUERY,
|
100
98
|
);
|
101
99
|
export const requestQuery = createRequestDataPropertyDecoratorWithSource(
|
102
100
|
RequestDataSource.QUERY,
|
103
|
-
DataType.STRING,
|
104
101
|
);
|
105
102
|
export const requestHeaders = createRequestDataDecoratorWithSource(
|
106
103
|
RequestDataSource.HEADERS,
|
107
104
|
);
|
108
105
|
export const requestHeader = createRequestDataPropertyDecoratorWithSource(
|
109
106
|
RequestDataSource.HEADERS,
|
110
|
-
DataType.STRING,
|
111
107
|
);
|
112
108
|
export const requestCookies = createRequestDataDecoratorWithSource(
|
113
109
|
RequestDataSource.COOKIE,
|
114
110
|
);
|
115
111
|
export const requestCookie = createRequestDataPropertyDecoratorWithSource(
|
116
112
|
RequestDataSource.COOKIE,
|
117
|
-
DataType.STRING,
|
118
113
|
);
|
119
114
|
export const requestBody = createRequestDataDecoratorWithSource(
|
120
115
|
RequestDataSource.BODY,
|
121
116
|
);
|
122
117
|
export const requestField = createRequestDataPropertyDecoratorWithSource(
|
123
118
|
RequestDataSource.BODY,
|
124
|
-
DataType.ANY,
|
125
119
|
);
|