@faasjs/func 8.0.0-beta.6 → 8.0.0-beta.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/README.md +0 -1
- package/dist/index.cjs +251 -308
- package/dist/index.d.ts +74 -110
- package/dist/index.mjs +250 -305
- package/package.json +4 -6
package/dist/index.mjs
CHANGED
|
@@ -1,321 +1,266 @@
|
|
|
1
|
-
import { randomBytes } from
|
|
2
|
-
import { fileURLToPath } from
|
|
3
|
-
import { Logger } from
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { Logger } from "@faasjs/logger";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// src/plugins/run_handler/index.ts
|
|
8
|
-
var Name = "handler";
|
|
5
|
+
//#region src/plugins/run_handler/index.ts
|
|
6
|
+
const Name = "handler";
|
|
9
7
|
var RunHandler = class {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
8
|
+
type = Name;
|
|
9
|
+
name = Name;
|
|
10
|
+
async onInvoke(data, next) {
|
|
11
|
+
if (data.handler) if (!data.runHandler) {
|
|
12
|
+
try {
|
|
13
|
+
data.response = await new Promise((resolve, reject) => {
|
|
14
|
+
data.callback = (error, result) => {
|
|
15
|
+
if (error) reject(error);
|
|
16
|
+
else resolve(result);
|
|
17
|
+
};
|
|
18
|
+
Promise.resolve(data.handler?.(data)).then(resolve).catch(reject);
|
|
19
|
+
});
|
|
20
|
+
} catch (error) {
|
|
21
|
+
data.logger.error(error);
|
|
22
|
+
data.response = error;
|
|
23
|
+
}
|
|
24
|
+
data.runHandler = true;
|
|
25
|
+
} else data.logger.warn("handler has been run");
|
|
26
|
+
await next();
|
|
27
|
+
}
|
|
31
28
|
};
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/utils.ts
|
|
32
|
+
/**
|
|
33
|
+
* Assigns a name to a given function handler, which will be displayed in logs and error messages.
|
|
34
|
+
*
|
|
35
|
+
* @template T - The type of the function handler.
|
|
36
|
+
* @param {string} name - The name to assign to the function handler.
|
|
37
|
+
* @param {T} handler - The function handler to which the name will be assigned.
|
|
38
|
+
* @returns {T} - The original function handler with the assigned name.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { nameFunc } from '@faasjs/func'
|
|
43
|
+
*
|
|
44
|
+
* const handler = nameFunc('myHandler', () => {
|
|
45
|
+
* return 'Hello World'
|
|
46
|
+
* })
|
|
47
|
+
*
|
|
48
|
+
* console.log(handler.name) // => 'myHandler'
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
34
51
|
function nameFunc(name, handler) {
|
|
35
|
-
|
|
36
|
-
|
|
52
|
+
Object.defineProperty(handler, "name", { value: name });
|
|
53
|
+
return handler;
|
|
37
54
|
}
|
|
38
55
|
|
|
39
|
-
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/index.ts
|
|
58
|
+
/**
|
|
59
|
+
* FaasJS's function module.
|
|
60
|
+
*
|
|
61
|
+
* [](https://github.com/faasjs/faasjs/blob/main/packages/func/LICENSE)
|
|
62
|
+
* [](https://www.npmjs.com/package/@faasjs/func)
|
|
63
|
+
*
|
|
64
|
+
* ## Install
|
|
65
|
+
*
|
|
66
|
+
* ```sh
|
|
67
|
+
* npm install @faasjs/func
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* ## Usage
|
|
71
|
+
*
|
|
72
|
+
* @see {@link useFunc}
|
|
73
|
+
*
|
|
74
|
+
* @packageDocumentation
|
|
75
|
+
*/
|
|
40
76
|
function parseFuncFilenameFromStack(stack) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return filename;
|
|
57
|
-
}
|
|
58
|
-
function formatPluginModuleName(type) {
|
|
59
|
-
if (type.startsWith("npm:")) return type.slice(4);
|
|
60
|
-
if (type.startsWith("@") || type.startsWith(".") || type.startsWith("/") || type.includes(":"))
|
|
61
|
-
return type;
|
|
62
|
-
return `@faasjs/${type}`;
|
|
63
|
-
}
|
|
64
|
-
function formatPluginClassName(type) {
|
|
65
|
-
return type.replace(/^@[^/]+\//, "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((item) => item.slice(0, 1).toUpperCase() + item.slice(1)).join("");
|
|
77
|
+
if (!stack) return;
|
|
78
|
+
const frame = stack.split("\n").map((line) => line.trim()).find((line) => line.includes(".func.ts"));
|
|
79
|
+
if (!frame) return;
|
|
80
|
+
const content = frame.replace(/^at\s+/, "");
|
|
81
|
+
const match = (content.endsWith(")") && content.includes("(") ? content.slice(content.lastIndexOf("(") + 1, -1) : content).match(/^(.+\.func\.ts):\d+:\d+$/);
|
|
82
|
+
if (!match) return;
|
|
83
|
+
const filename = match[1];
|
|
84
|
+
if (filename.startsWith("file://")) try {
|
|
85
|
+
return fileURLToPath(filename);
|
|
86
|
+
} catch (_) {
|
|
87
|
+
return filename;
|
|
88
|
+
}
|
|
89
|
+
return filename;
|
|
66
90
|
}
|
|
67
91
|
var Func = class {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return Promise.reject(Error("next() called multiple times"));
|
|
190
|
-
index = i;
|
|
191
|
-
let fn = list[i];
|
|
192
|
-
if (i === list.length) fn = next;
|
|
193
|
-
if (!fn) return Promise.resolve();
|
|
194
|
-
if (typeof fn.key === "undefined") fn.key = `uname#${i}`;
|
|
195
|
-
if (!data.context) data.context = /* @__PURE__ */ Object.create(null);
|
|
196
|
-
if (!data.context.request_at)
|
|
197
|
-
data.context.request_at = randomBytes(16).toString("hex");
|
|
198
|
-
const label = `${data.context.request_id}] [${fn.key}] [${key}`;
|
|
199
|
-
data.logger.label = label;
|
|
200
|
-
data.logger.debug("begin");
|
|
201
|
-
data.logger.time(label);
|
|
202
|
-
try {
|
|
203
|
-
const res = await Promise.resolve(
|
|
204
|
-
fn.handler(data, dispatch.bind(null, i + 1))
|
|
205
|
-
);
|
|
206
|
-
data.logger.label = label;
|
|
207
|
-
data.logger.timeEnd(label, "end");
|
|
208
|
-
return res;
|
|
209
|
-
} catch (err) {
|
|
210
|
-
data.logger.label = label;
|
|
211
|
-
data.logger.timeEnd(label, "failed");
|
|
212
|
-
data.logger.error(err);
|
|
213
|
-
return Promise.reject(err);
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
return await dispatch(0);
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* First time mount the function
|
|
221
|
-
*/
|
|
222
|
-
async mount(data = {
|
|
223
|
-
event: /* @__PURE__ */ Object.create(null),
|
|
224
|
-
context: /* @__PURE__ */ Object.create(null)
|
|
225
|
-
}) {
|
|
226
|
-
if (!data.logger) data.logger = new Logger("Func");
|
|
227
|
-
if (this.mounted) {
|
|
228
|
-
data.logger.warn("mount() has been called, skipped.");
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
if (!data.config) data.config = this.config;
|
|
232
|
-
if (this.autoLoadPluginsFromConfig && !this.loadedConfigPlugins)
|
|
233
|
-
await this.loadPluginsFromConfig(data.config);
|
|
234
|
-
data.logger.debug(
|
|
235
|
-
`plugins: ${this.plugins.map((p) => `${p.type}#${p.name}`).join(",")}`
|
|
236
|
-
);
|
|
237
|
-
await this.compose("onMount")(data);
|
|
238
|
-
this.mounted = true;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Invoke the function
|
|
242
|
-
* @param data {object} data
|
|
243
|
-
*/
|
|
244
|
-
async invoke(data) {
|
|
245
|
-
if (!this.mounted) await this.mount(data);
|
|
246
|
-
try {
|
|
247
|
-
await this.compose("onInvoke")(data);
|
|
248
|
-
} catch (error) {
|
|
249
|
-
data.logger.error(error);
|
|
250
|
-
data.response = error;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Export the function
|
|
255
|
-
*/
|
|
256
|
-
export() {
|
|
257
|
-
const handler = async (event, context, callback) => {
|
|
258
|
-
if (typeof context === "undefined") context = {};
|
|
259
|
-
if (!context.request_id)
|
|
260
|
-
context.request_id = event?.headers?.["x-faasjs-request-id"] || randomBytes(16).toString("hex");
|
|
261
|
-
if (!context.request_at)
|
|
262
|
-
context.request_at = randomBytes(16).toString("hex");
|
|
263
|
-
context.callbackWaitsForEmptyEventLoop = false;
|
|
264
|
-
const logger = new Logger(context.request_id);
|
|
265
|
-
const data = {
|
|
266
|
-
event: event ?? /* @__PURE__ */ Object.create(null),
|
|
267
|
-
context,
|
|
268
|
-
callback,
|
|
269
|
-
response: void 0,
|
|
270
|
-
handler: this.handler,
|
|
271
|
-
logger,
|
|
272
|
-
config: this.config
|
|
273
|
-
};
|
|
274
|
-
await this.invoke(data);
|
|
275
|
-
if (Object.prototype.toString.call(data.response) === "[object Error]")
|
|
276
|
-
throw data.response;
|
|
277
|
-
return data.response;
|
|
278
|
-
};
|
|
279
|
-
return {
|
|
280
|
-
handler: handler.bind(this)
|
|
281
|
-
};
|
|
282
|
-
}
|
|
92
|
+
plugins;
|
|
93
|
+
handler;
|
|
94
|
+
config;
|
|
95
|
+
mounted = false;
|
|
96
|
+
filename;
|
|
97
|
+
cachedFunctions = Object.create(null);
|
|
98
|
+
/**
|
|
99
|
+
* Create a cloud function
|
|
100
|
+
* @param config {object} config
|
|
101
|
+
* @param config.plugins {Plugin[]} plugins list
|
|
102
|
+
* @param config.handler {Handler} business logic
|
|
103
|
+
*/
|
|
104
|
+
constructor(config) {
|
|
105
|
+
if (config.handler) this.handler = config.handler;
|
|
106
|
+
this.plugins = config.plugins || [];
|
|
107
|
+
this.plugins.push(new RunHandler());
|
|
108
|
+
this.config = { plugins: Object.create(null) };
|
|
109
|
+
try {
|
|
110
|
+
const filename = parseFuncFilenameFromStack((/* @__PURE__ */ new Error()).stack);
|
|
111
|
+
if (filename) this.filename = filename;
|
|
112
|
+
} catch (_) {}
|
|
113
|
+
}
|
|
114
|
+
compose(key) {
|
|
115
|
+
let list = [];
|
|
116
|
+
if (this.cachedFunctions[key]) list = this.cachedFunctions[key];
|
|
117
|
+
else {
|
|
118
|
+
for (const plugin of this.plugins) {
|
|
119
|
+
const handler = plugin[key];
|
|
120
|
+
if (typeof handler === "function") list.push({
|
|
121
|
+
key: plugin.name,
|
|
122
|
+
handler: handler.bind(plugin)
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
this.cachedFunctions[key] = list;
|
|
126
|
+
}
|
|
127
|
+
return async (data, next) => {
|
|
128
|
+
let index = -1;
|
|
129
|
+
if (!data.logger) data.logger = new Logger();
|
|
130
|
+
const dispatch = async (i) => {
|
|
131
|
+
if (i <= index) return Promise.reject(Error("next() called multiple times"));
|
|
132
|
+
index = i;
|
|
133
|
+
let fn = list[i];
|
|
134
|
+
if (i === list.length) fn = next;
|
|
135
|
+
if (!fn) return Promise.resolve();
|
|
136
|
+
if (typeof fn.key === "undefined") fn.key = `uname#${i}`;
|
|
137
|
+
if (!data.context) data.context = Object.create(null);
|
|
138
|
+
if (!data.context.request_at) data.context.request_at = randomBytes(16).toString("hex");
|
|
139
|
+
const label = `${data.context.request_id}] [${fn.key}] [${key}`;
|
|
140
|
+
data.logger.label = label;
|
|
141
|
+
data.logger.debug("begin");
|
|
142
|
+
data.logger.time(label);
|
|
143
|
+
try {
|
|
144
|
+
const res = await Promise.resolve(fn.handler(data, dispatch.bind(null, i + 1)));
|
|
145
|
+
data.logger.label = label;
|
|
146
|
+
data.logger.timeEnd(label, "end");
|
|
147
|
+
return res;
|
|
148
|
+
} catch (err) {
|
|
149
|
+
data.logger.label = label;
|
|
150
|
+
data.logger.timeEnd(label, "failed");
|
|
151
|
+
data.logger.error(err);
|
|
152
|
+
return Promise.reject(err);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
return await dispatch(0);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* First time mount the function
|
|
160
|
+
*/
|
|
161
|
+
async mount(data = {
|
|
162
|
+
event: Object.create(null),
|
|
163
|
+
context: Object.create(null)
|
|
164
|
+
}) {
|
|
165
|
+
if (!data.logger) data.logger = new Logger("Func");
|
|
166
|
+
if (this.mounted) {
|
|
167
|
+
data.logger.warn("mount() has been called, skipped.");
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (!data.config) data.config = this.config;
|
|
171
|
+
data.logger.debug(`plugins: ${this.plugins.map((p) => `${p.type}#${p.name}`).join(",")}`);
|
|
172
|
+
await this.compose("onMount")(data);
|
|
173
|
+
this.mounted = true;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Invoke the function
|
|
177
|
+
* @param data {object} data
|
|
178
|
+
*/
|
|
179
|
+
async invoke(data) {
|
|
180
|
+
if (!this.mounted) await this.mount(data);
|
|
181
|
+
try {
|
|
182
|
+
await this.compose("onInvoke")(data);
|
|
183
|
+
} catch (error) {
|
|
184
|
+
data.logger.error(error);
|
|
185
|
+
data.response = error;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Export the function
|
|
190
|
+
*/
|
|
191
|
+
export() {
|
|
192
|
+
const handler = async (event, context, callback) => {
|
|
193
|
+
if (typeof context === "undefined") context = {};
|
|
194
|
+
if (!context.request_id) context.request_id = event?.headers?.["x-faasjs-request-id"] || randomBytes(16).toString("hex");
|
|
195
|
+
if (!context.request_at) context.request_at = randomBytes(16).toString("hex");
|
|
196
|
+
context.callbackWaitsForEmptyEventLoop = false;
|
|
197
|
+
const logger = new Logger(context.request_id);
|
|
198
|
+
const data = {
|
|
199
|
+
event: event ?? Object.create(null),
|
|
200
|
+
context,
|
|
201
|
+
callback,
|
|
202
|
+
response: void 0,
|
|
203
|
+
logger,
|
|
204
|
+
config: this.config,
|
|
205
|
+
...this.handler ? { handler: this.handler } : {}
|
|
206
|
+
};
|
|
207
|
+
await this.invoke(data);
|
|
208
|
+
if (Object.prototype.toString.call(data.response) === "[object Error]") throw data.response;
|
|
209
|
+
return data.response;
|
|
210
|
+
};
|
|
211
|
+
return { handler: handler.bind(this) };
|
|
212
|
+
}
|
|
283
213
|
};
|
|
284
|
-
|
|
214
|
+
let plugins = [];
|
|
285
215
|
function usePlugin(plugin) {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
};
|
|
298
|
-
return plugin;
|
|
216
|
+
if (!plugins.find((p) => p.name === plugin.name)) plugins.push(plugin);
|
|
217
|
+
if (!plugin.mount) plugin.mount = async (data) => {
|
|
218
|
+
const parsedData = data || Object.create(null);
|
|
219
|
+
if (!parsedData.config) parsedData.config = Object.create(null);
|
|
220
|
+
if (!parsedData.context) parsedData.context = Object.create(null);
|
|
221
|
+
if (!parsedData.event) parsedData.event = Object.create(null);
|
|
222
|
+
if (!parsedData.logger) parsedData.logger = new Logger(plugin.name);
|
|
223
|
+
if (plugin.onMount) await plugin.onMount(parsedData, async () => Promise.resolve());
|
|
224
|
+
return plugin;
|
|
225
|
+
};
|
|
226
|
+
return plugin;
|
|
299
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* Create a cloud function.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```ts
|
|
233
|
+
* // pure function
|
|
234
|
+
* export const func = useFunc(() => {
|
|
235
|
+
* return () => {
|
|
236
|
+
* return 'Hello World'
|
|
237
|
+
* }
|
|
238
|
+
* })
|
|
239
|
+
*
|
|
240
|
+
* // with http
|
|
241
|
+
* import { useHttp } from '@faasjs/http'
|
|
242
|
+
*
|
|
243
|
+
* export const func = useFunc<{
|
|
244
|
+
* params: { name: string }
|
|
245
|
+
* }>(() => {
|
|
246
|
+
* useHttp()
|
|
247
|
+
*
|
|
248
|
+
* return ({ event }) => {
|
|
249
|
+
* return `Hello ${event.params.name}`
|
|
250
|
+
* }
|
|
251
|
+
* })
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
300
254
|
function useFunc(handler) {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
function defineFunc(handler) {
|
|
311
|
-
plugins = [];
|
|
312
|
-
const func = new Func({
|
|
313
|
-
plugins,
|
|
314
|
-
handler,
|
|
315
|
-
autoLoadPluginsFromConfig: true
|
|
316
|
-
});
|
|
317
|
-
plugins = [];
|
|
318
|
-
return func;
|
|
255
|
+
plugins = [];
|
|
256
|
+
const invokeHandler = handler();
|
|
257
|
+
const func = new Func({
|
|
258
|
+
plugins,
|
|
259
|
+
handler: invokeHandler
|
|
260
|
+
});
|
|
261
|
+
plugins = [];
|
|
262
|
+
return func;
|
|
319
263
|
}
|
|
320
264
|
|
|
321
|
-
|
|
265
|
+
//#endregion
|
|
266
|
+
export { Func, nameFunc, parseFuncFilenameFromStack, useFunc, usePlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/func",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -24,18 +24,16 @@
|
|
|
24
24
|
},
|
|
25
25
|
"funding": "https://github.com/sponsors/faasjs",
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "
|
|
27
|
+
"build": "tsdown src/index.ts --config ../../tsdown.config.ts"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@faasjs/
|
|
34
|
-
"@faasjs/logger": ">=8.0.0-beta.6"
|
|
33
|
+
"@faasjs/logger": ">=8.0.0-beta.8"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@faasjs/
|
|
38
|
-
"@faasjs/logger": ">=8.0.0-beta.6"
|
|
36
|
+
"@faasjs/logger": ">=8.0.0-beta.8"
|
|
39
37
|
},
|
|
40
38
|
"engines": {
|
|
41
39
|
"node": ">=24.0.0",
|