@bbloker/sdk 0.1.0 → 0.3.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/README.md +1 -1
- package/dist/adapters/express.cjs +3 -3
- package/dist/adapters/express.js +1 -1
- package/dist/adapters/fastify.cjs +3 -3
- package/dist/adapters/fastify.js +1 -1
- package/dist/adapters/hono.cjs +3 -3
- package/dist/adapters/hono.js +1 -1
- package/dist/adapters/nextjs.cjs +3 -3
- package/dist/adapters/nextjs.js +1 -1
- package/dist/adapters/node.cjs +3 -3
- package/dist/adapters/node.js +1 -1
- package/dist/{chunk-6P6B2RO7.js → chunk-FF5K5RBD.js} +1 -1
- package/dist/{chunk-KT5GDIXH.cjs → chunk-ONZGRQP4.cjs} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,7 +106,7 @@ const bbloker = new Bbloker({
|
|
|
106
106
|
apiKey: "bb-sk-...",
|
|
107
107
|
|
|
108
108
|
// Optional
|
|
109
|
-
apiUrl: "https://
|
|
109
|
+
apiUrl: "https://bbloker.com", // self-hosted API
|
|
110
110
|
syncInterval: 300_000, // rule sync interval (5 min)
|
|
111
111
|
flushInterval: 10_000, // telemetry flush interval (10s)
|
|
112
112
|
bufferSize: 100, // max fingerprints before force flush
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkONZGRQP4cjs = require('../chunk-ONZGRQP4.cjs');
|
|
4
4
|
|
|
5
5
|
// src/adapters/express.ts
|
|
6
6
|
function createMiddleware(config) {
|
|
7
|
-
const bbloker = new (0,
|
|
7
|
+
const bbloker = new (0, _chunkONZGRQP4cjs.Bbloker)(config);
|
|
8
8
|
return function middleware(req, res, next) {
|
|
9
9
|
const normalized = normalizeExpressRequest(req);
|
|
10
10
|
const decision = bbloker.analyze(normalized);
|
|
@@ -58,4 +58,4 @@ function normalizeExpressRequest(req) {
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.Bbloker =
|
|
61
|
+
exports.Bbloker = _chunkONZGRQP4cjs.Bbloker; exports.createMiddleware = createMiddleware;
|
package/dist/adapters/express.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkONZGRQP4cjs = require('../chunk-ONZGRQP4.cjs');
|
|
4
4
|
|
|
5
5
|
// src/adapters/fastify.ts
|
|
6
6
|
function createPlugin(config) {
|
|
7
|
-
const bbloker = new (0,
|
|
7
|
+
const bbloker = new (0, _chunkONZGRQP4cjs.Bbloker)(config);
|
|
8
8
|
return function bblokerPlugin(fastify, _opts, done) {
|
|
9
9
|
fastify.addHook("onRequest", (request, reply, hookDone) => {
|
|
10
10
|
const normalized = normalizeFastifyRequest(request);
|
|
@@ -61,4 +61,4 @@ function normalizeFastifyRequest(req) {
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
exports.Bbloker =
|
|
64
|
+
exports.Bbloker = _chunkONZGRQP4cjs.Bbloker; exports.createPlugin = createPlugin;
|
package/dist/adapters/fastify.js
CHANGED
package/dist/adapters/hono.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkONZGRQP4cjs = require('../chunk-ONZGRQP4.cjs');
|
|
4
4
|
|
|
5
5
|
// src/adapters/hono.ts
|
|
6
6
|
function createMiddleware(config) {
|
|
7
|
-
const bbloker = new (0,
|
|
7
|
+
const bbloker = new (0, _chunkONZGRQP4cjs.Bbloker)(config);
|
|
8
8
|
return async function middleware(c, next) {
|
|
9
9
|
const normalized = normalizeHonoRequest(c);
|
|
10
10
|
const decision = bbloker.analyze(normalized);
|
|
@@ -52,4 +52,4 @@ function normalizeHonoRequest(c) {
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
exports.Bbloker =
|
|
55
|
+
exports.Bbloker = _chunkONZGRQP4cjs.Bbloker; exports.createMiddleware = createMiddleware;
|
package/dist/adapters/hono.js
CHANGED
package/dist/adapters/nextjs.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkONZGRQP4cjs = require('../chunk-ONZGRQP4.cjs');
|
|
4
4
|
|
|
5
5
|
// src/adapters/nextjs.ts
|
|
6
6
|
function createMiddleware(config) {
|
|
7
|
-
const bbloker = new (0,
|
|
7
|
+
const bbloker = new (0, _chunkONZGRQP4cjs.Bbloker)(config);
|
|
8
8
|
return async function middleware(request) {
|
|
9
9
|
const { NextResponse } = await Promise.resolve().then(() => _interopRequireWildcard(require("next/server")));
|
|
10
10
|
const normalized = normalizeNextRequest(request);
|
|
@@ -50,4 +50,4 @@ function normalizeNextRequest(req) {
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
exports.Bbloker =
|
|
53
|
+
exports.Bbloker = _chunkONZGRQP4cjs.Bbloker; exports.createMiddleware = createMiddleware;
|
package/dist/adapters/nextjs.js
CHANGED
package/dist/adapters/node.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkONZGRQP4cjs = require('../chunk-ONZGRQP4.cjs');
|
|
4
4
|
|
|
5
5
|
// src/adapters/node.ts
|
|
6
6
|
function createHandler(config) {
|
|
7
|
-
const bbloker = new (0,
|
|
7
|
+
const bbloker = new (0, _chunkONZGRQP4cjs.Bbloker)(config);
|
|
8
8
|
return function handler(req, res) {
|
|
9
9
|
const normalized = normalizeNodeRequest(req);
|
|
10
10
|
const decision = bbloker.analyze(normalized);
|
|
@@ -57,4 +57,4 @@ function normalizeNodeRequest(req) {
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
exports.Bbloker =
|
|
60
|
+
exports.Bbloker = _chunkONZGRQP4cjs.Bbloker; exports.createHandler = createHandler;
|
package/dist/adapters/node.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkONZGRQP4cjs = require('./chunk-ONZGRQP4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
exports.Bbloker =
|
|
6
|
+
exports.Bbloker = _chunkONZGRQP4cjs.Bbloker;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface BblokerConfig {
|
|
2
2
|
/** API key from bbloker dashboard (bb-sk-xxx) */
|
|
3
3
|
apiKey: string;
|
|
4
|
-
/** API endpoint. Default: https://
|
|
4
|
+
/** API endpoint. Default: https://bbloker.com */
|
|
5
5
|
apiUrl?: string;
|
|
6
6
|
/** Rule sync interval in ms. Default: 300_000 (5 min) */
|
|
7
7
|
syncInterval?: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface BblokerConfig {
|
|
2
2
|
/** API key from bbloker dashboard (bb-sk-xxx) */
|
|
3
3
|
apiKey: string;
|
|
4
|
-
/** API endpoint. Default: https://
|
|
4
|
+
/** API endpoint. Default: https://bbloker.com */
|
|
5
5
|
apiUrl?: string;
|
|
6
6
|
/** Rule sync interval in ms. Default: 300_000 (5 min) */
|
|
7
7
|
syncInterval?: number;
|
package/dist/index.js
CHANGED