@modern-js/bff-core 1.22.1 → 1.22.2-beta.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/CHANGELOG.md +135 -17
- package/dist/js/modern/api.js +49 -34
- package/dist/js/modern/client/generate-client.js +52 -34
- package/dist/js/modern/client/index.js +1 -1
- package/dist/js/modern/client/result.js +10 -8
- package/dist/js/modern/errors/http.js +8 -14
- package/dist/js/modern/index.js +19 -3
- package/dist/js/modern/operators/http.js +139 -116
- package/dist/js/modern/router/constants.js +31 -13
- package/dist/js/modern/router/index.js +68 -131
- package/dist/js/modern/router/types.js +0 -1
- package/dist/js/modern/router/utils.js +36 -54
- package/dist/js/modern/types.js +45 -47
- package/dist/js/modern/utils/alias.js +35 -50
- package/dist/js/modern/utils/debug.js +5 -2
- package/dist/js/modern/utils/index.js +5 -2
- package/dist/js/modern/utils/meta.js +8 -4
- package/dist/js/modern/utils/storage.js +8 -14
- package/dist/js/modern/utils/validate.js +23 -29
- package/dist/js/node/api.js +78 -46
- package/dist/js/node/client/generate-client.js +85 -55
- package/dist/js/node/client/index.js +17 -18
- package/dist/js/node/client/result.js +32 -18
- package/dist/js/node/errors/http.js +28 -22
- package/dist/js/node/index.js +45 -122
- package/dist/js/node/operators/http.js +184 -169
- package/dist/js/node/router/constants.js +60 -28
- package/dist/js/node/router/index.js +112 -201
- package/dist/js/node/router/types.js +15 -5
- package/dist/js/node/router/utils.js +71 -78
- package/dist/js/node/types.js +71 -57
- package/dist/js/node/utils/alias.js +65 -73
- package/dist/js/node/utils/debug.js +27 -10
- package/dist/js/node/utils/index.js +28 -68
- package/dist/js/node/utils/meta.js +30 -12
- package/dist/js/node/utils/storage.js +36 -24
- package/dist/js/node/utils/validate.js +50 -44
- package/package.json +12 -40
|
@@ -1,226 +1,241 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
+
var __export = (target, all) => {
|
|
23
|
+
for (var name in all)
|
|
24
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
+
};
|
|
26
|
+
var __copyProps = (to, from, except, desc) => {
|
|
27
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(from))
|
|
29
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
|
+
}
|
|
32
|
+
return to;
|
|
33
|
+
};
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
var __async = (__this, __arguments, generator) => {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
var fulfilled = (value) => {
|
|
38
|
+
try {
|
|
39
|
+
step(generator.next(value));
|
|
40
|
+
} catch (e) {
|
|
41
|
+
reject(e);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var rejected = (value) => {
|
|
45
|
+
try {
|
|
46
|
+
step(generator.throw(value));
|
|
47
|
+
} catch (e) {
|
|
48
|
+
reject(e);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
52
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
var http_exports = {};
|
|
56
|
+
__export(http_exports, {
|
|
57
|
+
Connect: () => Connect,
|
|
58
|
+
Data: () => Data,
|
|
59
|
+
Delete: () => Delete,
|
|
60
|
+
Get: () => Get,
|
|
61
|
+
Head: () => Head,
|
|
62
|
+
Headers: () => Headers,
|
|
63
|
+
HttpCode: () => HttpCode,
|
|
64
|
+
Option: () => Option,
|
|
65
|
+
Params: () => Params,
|
|
66
|
+
Patch: () => Patch,
|
|
67
|
+
Post: () => Post,
|
|
68
|
+
Put: () => Put,
|
|
69
|
+
Query: () => Query,
|
|
70
|
+
Redirect: () => Redirect,
|
|
71
|
+
SetHeaders: () => SetHeaders,
|
|
72
|
+
Trace: () => Trace,
|
|
73
|
+
createHttpOperator: () => createHttpOperator
|
|
5
74
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _http = require("../errors/http");
|
|
11
|
-
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
|
|
16
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
|
|
18
|
-
const validateInput = async (schema, input) => {
|
|
75
|
+
module.exports = __toCommonJS(http_exports);
|
|
76
|
+
var import_types = require("../types");
|
|
77
|
+
var import_http = require("../errors/http");
|
|
78
|
+
const validateInput = (schema, input) => __async(void 0, null, function* () {
|
|
19
79
|
try {
|
|
20
|
-
return
|
|
80
|
+
return yield schema.parseAsync(input);
|
|
21
81
|
} catch (error) {
|
|
22
|
-
const {
|
|
23
|
-
z: zod
|
|
24
|
-
} = require('zod');
|
|
25
|
-
|
|
82
|
+
const { z: zod } = require("zod");
|
|
26
83
|
if (error instanceof zod.ZodError) {
|
|
27
|
-
throw new
|
|
84
|
+
throw new import_http.ValidationError(400, error.message);
|
|
28
85
|
}
|
|
29
|
-
|
|
30
86
|
throw error;
|
|
31
87
|
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return urlPath => {
|
|
88
|
+
});
|
|
89
|
+
const createHttpOperator = (method) => {
|
|
90
|
+
return (urlPath) => {
|
|
36
91
|
return {
|
|
37
92
|
name: method,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}) {
|
|
42
|
-
setMetadata(_types.OperatorType.Trigger, {
|
|
43
|
-
type: _types.TriggerType.Http,
|
|
93
|
+
metadata({ setMetadata }) {
|
|
94
|
+
setMetadata(import_types.OperatorType.Trigger, {
|
|
95
|
+
type: import_types.TriggerType.Http,
|
|
44
96
|
path: urlPath,
|
|
45
97
|
method
|
|
46
98
|
});
|
|
47
99
|
}
|
|
48
|
-
|
|
49
100
|
};
|
|
50
101
|
};
|
|
51
102
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const Connect = createHttpOperator(_types.HttpMethod.Connect);
|
|
63
|
-
exports.Connect = Connect;
|
|
64
|
-
const Trace = createHttpOperator(_types.HttpMethod.Trace);
|
|
65
|
-
exports.Trace = Trace;
|
|
66
|
-
const Patch = createHttpOperator(_types.HttpMethod.Patch);
|
|
67
|
-
exports.Patch = Patch;
|
|
68
|
-
const Option = createHttpOperator(_types.HttpMethod.Option);
|
|
69
|
-
exports.Option = Option;
|
|
70
|
-
const Head = createHttpOperator(_types.HttpMethod.Head);
|
|
71
|
-
exports.Head = Head;
|
|
72
|
-
|
|
73
|
-
const Data = schema => {
|
|
103
|
+
const Get = createHttpOperator(import_types.HttpMethod.Get);
|
|
104
|
+
const Post = createHttpOperator(import_types.HttpMethod.Post);
|
|
105
|
+
const Put = createHttpOperator(import_types.HttpMethod.Put);
|
|
106
|
+
const Delete = createHttpOperator(import_types.HttpMethod.Delete);
|
|
107
|
+
const Connect = createHttpOperator(import_types.HttpMethod.Connect);
|
|
108
|
+
const Trace = createHttpOperator(import_types.HttpMethod.Trace);
|
|
109
|
+
const Patch = createHttpOperator(import_types.HttpMethod.Patch);
|
|
110
|
+
const Option = createHttpOperator(import_types.HttpMethod.Option);
|
|
111
|
+
const Head = createHttpOperator(import_types.HttpMethod.Head);
|
|
112
|
+
const Data = (schema) => {
|
|
74
113
|
return {
|
|
75
|
-
name:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
setMetadata
|
|
79
|
-
}) {
|
|
80
|
-
setMetadata(_types.HttpMetadata.Data, schema);
|
|
114
|
+
name: import_types.HttpMetadata.Data,
|
|
115
|
+
metadata({ setMetadata }) {
|
|
116
|
+
setMetadata(import_types.HttpMetadata.Data, schema);
|
|
81
117
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
118
|
+
validate(helper, next) {
|
|
119
|
+
return __async(this, null, function* () {
|
|
120
|
+
const {
|
|
121
|
+
inputs: { data }
|
|
122
|
+
} = helper;
|
|
123
|
+
helper.inputs = __spreadProps(__spreadValues({}, helper.inputs), {
|
|
124
|
+
data: yield validateInput(schema, data)
|
|
125
|
+
});
|
|
126
|
+
return next();
|
|
91
127
|
});
|
|
92
|
-
return next();
|
|
93
128
|
}
|
|
94
|
-
|
|
95
129
|
};
|
|
96
130
|
};
|
|
97
|
-
|
|
98
|
-
exports.Data = Data;
|
|
99
|
-
|
|
100
|
-
const Query = schema => {
|
|
131
|
+
const Query = (schema) => {
|
|
101
132
|
return {
|
|
102
|
-
name:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
setMetadata
|
|
106
|
-
}) {
|
|
107
|
-
setMetadata(_types.HttpMetadata.Query, schema);
|
|
133
|
+
name: import_types.HttpMetadata.Query,
|
|
134
|
+
metadata({ setMetadata }) {
|
|
135
|
+
setMetadata(import_types.HttpMetadata.Query, schema);
|
|
108
136
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
137
|
+
validate(helper, next) {
|
|
138
|
+
return __async(this, null, function* () {
|
|
139
|
+
const {
|
|
140
|
+
inputs: { query }
|
|
141
|
+
} = helper;
|
|
142
|
+
helper.inputs = __spreadProps(__spreadValues({}, helper.inputs), {
|
|
143
|
+
query: yield validateInput(schema, query)
|
|
144
|
+
});
|
|
145
|
+
return next();
|
|
118
146
|
});
|
|
119
|
-
return next();
|
|
120
147
|
}
|
|
121
|
-
|
|
122
148
|
};
|
|
123
149
|
};
|
|
124
|
-
|
|
125
|
-
exports.Query = Query;
|
|
126
|
-
|
|
127
|
-
const Params = schema => {
|
|
150
|
+
const Params = (schema) => {
|
|
128
151
|
return {
|
|
129
|
-
name:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
setMetadata
|
|
133
|
-
}) {
|
|
134
|
-
setMetadata(_types.HttpMetadata.Params, schema);
|
|
152
|
+
name: import_types.HttpMetadata.Params,
|
|
153
|
+
metadata({ setMetadata }) {
|
|
154
|
+
setMetadata(import_types.HttpMetadata.Params, schema);
|
|
135
155
|
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
156
|
+
validate(helper, next) {
|
|
157
|
+
return __async(this, null, function* () {
|
|
158
|
+
const {
|
|
159
|
+
inputs: { params }
|
|
160
|
+
} = helper;
|
|
161
|
+
helper.inputs = __spreadProps(__spreadValues({}, helper.inputs), {
|
|
162
|
+
params: yield validateInput(schema, params)
|
|
163
|
+
});
|
|
164
|
+
return next();
|
|
145
165
|
});
|
|
146
|
-
return next();
|
|
147
166
|
}
|
|
148
|
-
|
|
149
167
|
};
|
|
150
168
|
};
|
|
151
|
-
|
|
152
|
-
exports.Params = Params;
|
|
153
|
-
|
|
154
|
-
const Headers = schema => {
|
|
169
|
+
const Headers = (schema) => {
|
|
155
170
|
return {
|
|
156
|
-
name:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
setMetadata
|
|
160
|
-
}) {
|
|
161
|
-
setMetadata(_types.HttpMetadata.Headers, schema);
|
|
171
|
+
name: import_types.HttpMetadata.Headers,
|
|
172
|
+
metadata({ setMetadata }) {
|
|
173
|
+
setMetadata(import_types.HttpMetadata.Headers, schema);
|
|
162
174
|
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
validate(helper, next) {
|
|
176
|
+
return __async(this, null, function* () {
|
|
177
|
+
const {
|
|
178
|
+
inputs: { headers }
|
|
179
|
+
} = helper;
|
|
180
|
+
helper.inputs = __spreadProps(__spreadValues({}, helper.inputs), {
|
|
181
|
+
headers: yield validateInput(schema, headers)
|
|
182
|
+
});
|
|
183
|
+
return next();
|
|
172
184
|
});
|
|
173
|
-
return next();
|
|
174
185
|
}
|
|
175
|
-
|
|
176
186
|
};
|
|
177
187
|
};
|
|
178
|
-
|
|
179
|
-
exports.Headers = Headers;
|
|
180
|
-
|
|
181
188
|
const setResponseMeta = (helper, type, value) => {
|
|
182
|
-
const responseMetaData = helper.getMetadata(
|
|
183
|
-
helper.setMetadata(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
189
|
+
const responseMetaData = helper.getMetadata(import_types.HttpMetadata.Response) || [];
|
|
190
|
+
helper.setMetadata(import_types.HttpMetadata.Response, [
|
|
191
|
+
...responseMetaData,
|
|
192
|
+
{
|
|
193
|
+
type,
|
|
194
|
+
value
|
|
195
|
+
}
|
|
196
|
+
]);
|
|
187
197
|
};
|
|
188
|
-
|
|
189
|
-
const HttpCode = statusCode => {
|
|
198
|
+
const HttpCode = (statusCode) => {
|
|
190
199
|
return {
|
|
191
|
-
name:
|
|
192
|
-
|
|
200
|
+
name: "HttpCode",
|
|
193
201
|
metadata(helper) {
|
|
194
|
-
setResponseMeta(helper,
|
|
202
|
+
setResponseMeta(helper, import_types.ResponseMetaType.StatusCode, statusCode);
|
|
195
203
|
}
|
|
196
|
-
|
|
197
204
|
};
|
|
198
205
|
};
|
|
199
|
-
|
|
200
|
-
exports.HttpCode = HttpCode;
|
|
201
|
-
|
|
202
|
-
const SetHeaders = headers => {
|
|
206
|
+
const SetHeaders = (headers) => {
|
|
203
207
|
return {
|
|
204
|
-
name:
|
|
205
|
-
|
|
208
|
+
name: "SetHeaders",
|
|
206
209
|
metadata(helper) {
|
|
207
|
-
setResponseMeta(helper,
|
|
210
|
+
setResponseMeta(helper, import_types.ResponseMetaType.Headers, headers);
|
|
208
211
|
}
|
|
209
|
-
|
|
210
212
|
};
|
|
211
213
|
};
|
|
212
|
-
|
|
213
|
-
exports.SetHeaders = SetHeaders;
|
|
214
|
-
|
|
215
|
-
const Redirect = url => {
|
|
214
|
+
const Redirect = (url) => {
|
|
216
215
|
return {
|
|
217
|
-
name:
|
|
218
|
-
|
|
216
|
+
name: "Redirect",
|
|
219
217
|
metadata(helper) {
|
|
220
|
-
setResponseMeta(helper,
|
|
218
|
+
setResponseMeta(helper, import_types.ResponseMetaType.Redirect, url);
|
|
221
219
|
}
|
|
222
|
-
|
|
223
220
|
};
|
|
224
221
|
};
|
|
225
|
-
|
|
226
|
-
exports
|
|
222
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
223
|
+
0 && (module.exports = {
|
|
224
|
+
Connect,
|
|
225
|
+
Data,
|
|
226
|
+
Delete,
|
|
227
|
+
Get,
|
|
228
|
+
Head,
|
|
229
|
+
Headers,
|
|
230
|
+
HttpCode,
|
|
231
|
+
Option,
|
|
232
|
+
Params,
|
|
233
|
+
Patch,
|
|
234
|
+
Post,
|
|
235
|
+
Put,
|
|
236
|
+
Query,
|
|
237
|
+
Redirect,
|
|
238
|
+
SetHeaders,
|
|
239
|
+
Trace,
|
|
240
|
+
createHttpOperator
|
|
241
|
+
});
|
|
@@ -1,29 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var constants_exports = {};
|
|
19
|
+
__export(constants_exports, {
|
|
20
|
+
APIMode: () => APIMode,
|
|
21
|
+
API_DIR: () => API_DIR,
|
|
22
|
+
API_FILE_RULES: () => API_FILE_RULES,
|
|
23
|
+
AllHttpMethods: () => AllHttpMethods,
|
|
24
|
+
FRAMEWORK_MODE_APP_DIR: () => FRAMEWORK_MODE_APP_DIR,
|
|
25
|
+
FRAMEWORK_MODE_LAMBDA_DIR: () => FRAMEWORK_MODE_LAMBDA_DIR,
|
|
26
|
+
INDEX_SUFFIX: () => INDEX_SUFFIX
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(constants_exports);
|
|
29
|
+
var import_types = require("../types");
|
|
30
|
+
const AllHttpMethods = Object.values(import_types.HttpMethod);
|
|
31
|
+
var APIMode = /* @__PURE__ */ ((APIMode2) => {
|
|
32
|
+
APIMode2["FARMEWORK"] = "framework";
|
|
33
|
+
APIMode2["FUNCTION"] = "function";
|
|
34
|
+
return APIMode2;
|
|
35
|
+
})(APIMode || {});
|
|
36
|
+
const FRAMEWORK_MODE_LAMBDA_DIR = "lambda";
|
|
37
|
+
const FRAMEWORK_MODE_APP_DIR = "app";
|
|
38
|
+
const INDEX_SUFFIX = "index";
|
|
39
|
+
const API_DIR = "api";
|
|
40
|
+
const API_FILE_RULES = [
|
|
41
|
+
"**/*.[tj]s",
|
|
42
|
+
"!**/_*",
|
|
43
|
+
"!**/_*/**/*.[tj]s",
|
|
44
|
+
"!**/*.test.js",
|
|
45
|
+
"!**/*.test.ts",
|
|
46
|
+
"!**/*.d.ts",
|
|
47
|
+
"!__test__/*.ts",
|
|
48
|
+
"!__tests__/*.ts",
|
|
49
|
+
"!node_modules/**",
|
|
50
|
+
"!bootstrap.js"
|
|
51
|
+
];
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
APIMode,
|
|
55
|
+
API_DIR,
|
|
56
|
+
API_FILE_RULES,
|
|
57
|
+
AllHttpMethods,
|
|
58
|
+
FRAMEWORK_MODE_APP_DIR,
|
|
59
|
+
FRAMEWORK_MODE_LAMBDA_DIR,
|
|
60
|
+
INDEX_SUFFIX
|
|
5
61
|
});
|
|
6
|
-
exports.INDEX_SUFFIX = exports.FRAMEWORK_MODE_LAMBDA_DIR = exports.FRAMEWORK_MODE_APP_DIR = exports.AllHttpMethods = exports.API_FILE_RULES = exports.API_DIR = exports.APIMode = void 0;
|
|
7
|
-
|
|
8
|
-
var _types = require("../types");
|
|
9
|
-
|
|
10
|
-
const AllHttpMethods = Object.values(_types.HttpMethod);
|
|
11
|
-
exports.AllHttpMethods = AllHttpMethods;
|
|
12
|
-
let APIMode;
|
|
13
|
-
exports.APIMode = APIMode;
|
|
14
|
-
|
|
15
|
-
(function (APIMode) {
|
|
16
|
-
APIMode["FARMEWORK"] = "framework";
|
|
17
|
-
APIMode["FUNCTION"] = "function";
|
|
18
|
-
})(APIMode || (exports.APIMode = APIMode = {}));
|
|
19
|
-
|
|
20
|
-
const FRAMEWORK_MODE_LAMBDA_DIR = 'lambda';
|
|
21
|
-
exports.FRAMEWORK_MODE_LAMBDA_DIR = FRAMEWORK_MODE_LAMBDA_DIR;
|
|
22
|
-
const FRAMEWORK_MODE_APP_DIR = 'app';
|
|
23
|
-
exports.FRAMEWORK_MODE_APP_DIR = FRAMEWORK_MODE_APP_DIR;
|
|
24
|
-
const INDEX_SUFFIX = 'index';
|
|
25
|
-
exports.INDEX_SUFFIX = INDEX_SUFFIX;
|
|
26
|
-
const API_DIR = 'api';
|
|
27
|
-
exports.API_DIR = API_DIR;
|
|
28
|
-
const API_FILE_RULES = ['**/*.[tj]s', '!**/_*', '!**/_*/**/*.[tj]s', '!**/*.test.js', '!**/*.test.ts', '!**/*.d.ts', '!__test__/*.ts', '!__tests__/*.ts', '!node_modules/**', '!bootstrap.js'];
|
|
29
|
-
exports.API_FILE_RULES = API_FILE_RULES;
|