@queuebase/node 1.5.0 → 1.6.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/dist/index.cjs +10 -11
- package/dist/index.js +1 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -21,26 +21,25 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
createClient: () => createClient,
|
|
24
|
-
createJobRouter: () =>
|
|
24
|
+
createJobRouter: () => import_core3.createJobRouter,
|
|
25
25
|
createNodeHandler: () => createNodeHandler,
|
|
26
26
|
defineConfig: () => defineConfig,
|
|
27
|
-
job: () =>
|
|
28
|
-
processJobCallback: () =>
|
|
27
|
+
job: () => import_core3.job,
|
|
28
|
+
processJobCallback: () => import_core4.processJobCallback,
|
|
29
29
|
resolveConfig: () => resolveConfig
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(src_exports);
|
|
32
|
-
var import_core2 = require("@queuebase/core");
|
|
33
32
|
var import_core3 = require("@queuebase/core");
|
|
33
|
+
var import_core4 = require("@queuebase/core");
|
|
34
34
|
|
|
35
35
|
// src/config.ts
|
|
36
|
-
var
|
|
37
|
-
var DEFAULT_PROD_API_URL = "https://api.queuebase.io";
|
|
36
|
+
var import_core = require("@queuebase/core");
|
|
38
37
|
function defineConfig(config) {
|
|
39
38
|
return {
|
|
40
39
|
jobsDir: config.jobsDir ?? "./src/jobs",
|
|
41
40
|
callbackUrl: config.callbackUrl ?? process.env.QUEUEBASE_CALLBACK_URL,
|
|
42
41
|
apiKey: config.apiKey ?? process.env.QUEUEBASE_API_KEY,
|
|
43
|
-
apiUrl: config.apiUrl ?? process.env.QUEUEBASE_API_URL ?? (process.env.NODE_ENV === "production" ? DEFAULT_PROD_API_URL : DEFAULT_DEV_API_URL)
|
|
42
|
+
apiUrl: config.apiUrl ?? process.env.QUEUEBASE_API_URL ?? (process.env.NODE_ENV === "production" ? import_core.DEFAULT_PROD_API_URL : import_core.DEFAULT_DEV_API_URL)
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
45
|
function resolveConfig(config) {
|
|
@@ -49,7 +48,7 @@ function resolveConfig(config) {
|
|
|
49
48
|
jobsDir: config.jobsDir,
|
|
50
49
|
callbackUrl: process.env.QUEUEBASE_CALLBACK_URL ?? config.callbackUrl,
|
|
51
50
|
apiKey: process.env.QUEUEBASE_API_KEY ?? config.apiKey,
|
|
52
|
-
apiUrl: process.env.QUEUEBASE_API_URL ?? config.apiUrl ?? (isDev ? DEFAULT_DEV_API_URL : DEFAULT_PROD_API_URL)
|
|
51
|
+
apiUrl: process.env.QUEUEBASE_API_URL ?? config.apiUrl ?? (isDev ? import_core.DEFAULT_DEV_API_URL : import_core.DEFAULT_PROD_API_URL)
|
|
53
52
|
};
|
|
54
53
|
}
|
|
55
54
|
|
|
@@ -107,7 +106,7 @@ function createClient(router, config) {
|
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
// src/handler.ts
|
|
110
|
-
var
|
|
109
|
+
var import_core2 = require("@queuebase/core");
|
|
111
110
|
function readBody(req) {
|
|
112
111
|
const existing = req.body;
|
|
113
112
|
if (existing !== void 0) {
|
|
@@ -141,8 +140,8 @@ function createNodeHandler(router, options) {
|
|
|
141
140
|
res.end(JSON.stringify({ success: false, error: message }));
|
|
142
141
|
return;
|
|
143
142
|
}
|
|
144
|
-
const signatureHeader = req.headers[
|
|
145
|
-
const result = await (0,
|
|
143
|
+
const signatureHeader = req.headers[import_core2.WEBHOOK_HEADERS.SIGNATURE.toLowerCase()] ?? null;
|
|
144
|
+
const result = await (0, import_core2.processJobCallback)(router, { body, signatureHeader }, options);
|
|
146
145
|
res.writeHead(result.status, { "Content-Type": "application/json" });
|
|
147
146
|
res.end(JSON.stringify(result.body));
|
|
148
147
|
};
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,7 @@ import { job, createJobRouter } from "@queuebase/core";
|
|
|
7
7
|
import { processJobCallback } from "@queuebase/core";
|
|
8
8
|
|
|
9
9
|
// src/config.ts
|
|
10
|
-
|
|
11
|
-
var DEFAULT_PROD_API_URL = "https://api.queuebase.io";
|
|
10
|
+
import { DEFAULT_DEV_API_URL, DEFAULT_PROD_API_URL } from "@queuebase/core";
|
|
12
11
|
function defineConfig(config) {
|
|
13
12
|
return {
|
|
14
13
|
jobsDir: config.jobsDir ?? "./src/jobs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@queuebase/node",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"zod": "^3.24.1",
|
|
25
|
-
"@queuebase/core": "1.
|
|
25
|
+
"@queuebase/core": "1.6.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.10.5",
|