@faasjs/func 0.0.2-beta.400 → 0.0.2-beta.403

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/index.d.ts CHANGED
@@ -80,6 +80,7 @@ declare type FuncConfig<TEvent = any, TContext = any, TResult = any> = {
80
80
  handler?: Handler<TEvent, TContext, TResult>;
81
81
  };
82
82
  declare class Func<TEvent = any, TContext = any, TResult = any> {
83
+ [key: string]: any;
83
84
  plugins: Plugin[];
84
85
  handler?: Handler<TEvent, TContext, TResult>;
85
86
  config: Config;
package/dist/index.js CHANGED
@@ -166,7 +166,7 @@ var Func = class {
166
166
  if (typeof context === "undefined")
167
167
  context = {};
168
168
  if (!context.request_id)
169
- context.request_id = (0, import_crypto.randomUUID)();
169
+ context.request_id = (0, import_crypto.randomBytes)(16).toString("hex");
170
170
  if (!context.request_at)
171
171
  context.request_at = Math.round(new Date().getTime() / 1e3);
172
172
  context.callbackWaitsForEmptyEventLoop = false;
@@ -201,7 +201,8 @@ function usePlugin(plugin) {
201
201
  await plugin.onMount({
202
202
  config,
203
203
  event: {},
204
- context: {}
204
+ context: {},
205
+ logger: new import_logger.Logger(plugin.name)
205
206
  }, async () => Promise.resolve());
206
207
  };
207
208
  return plugin;
package/dist/index.mjs CHANGED
@@ -32,7 +32,7 @@ var RunHandler = class {
32
32
  };
33
33
 
34
34
  // src/index.ts
35
- import { randomUUID } from "crypto";
35
+ import { randomBytes } from "crypto";
36
36
  var Func = class {
37
37
  constructor(config) {
38
38
  this.handler = config.handler;
@@ -140,7 +140,7 @@ var Func = class {
140
140
  if (typeof context === "undefined")
141
141
  context = {};
142
142
  if (!context.request_id)
143
- context.request_id = randomUUID();
143
+ context.request_id = randomBytes(16).toString("hex");
144
144
  if (!context.request_at)
145
145
  context.request_at = Math.round(new Date().getTime() / 1e3);
146
146
  context.callbackWaitsForEmptyEventLoop = false;
@@ -175,7 +175,8 @@ function usePlugin(plugin) {
175
175
  await plugin.onMount({
176
176
  config,
177
177
  event: {},
178
- context: {}
178
+ context: {},
179
+ logger: new Logger(plugin.name)
179
180
  }, async () => Promise.resolve());
180
181
  };
181
182
  return plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/func",
3
- "version": "0.0.2-beta.400",
3
+ "version": "0.0.2-beta.403",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,8 +22,8 @@
22
22
  "dist"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@faasjs/deep_merge": "^0.0.2-beta.400",
26
- "@faasjs/logger": "^0.0.2-beta.400"
25
+ "@faasjs/deep_merge": "^0.0.2-beta.403",
26
+ "@faasjs/logger": "^0.0.2-beta.403"
27
27
  },
28
28
  "devDependencies": {
29
29
  "tsup": "*",