@develit-io/backend-sdk 5.17.7 → 5.19.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 +6 -2
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +6 -2
- package/dist/node/index.cjs +12 -0
- package/dist/node/index.d.cts +7 -0
- package/dist/node/index.d.mts +7 -0
- package/dist/node/index.d.ts +7 -0
- package/dist/node/index.mjs +10 -0
- package/package.json +8 -3
package/dist/index.cjs
CHANGED
|
@@ -8,9 +8,9 @@ const text = require('@std/text');
|
|
|
8
8
|
require('http-status-codes');
|
|
9
9
|
const z = require('zod/v4/core');
|
|
10
10
|
const h3 = require('h3');
|
|
11
|
-
const fs = require('fs');
|
|
11
|
+
const fs = require('node:fs');
|
|
12
12
|
const crypto$1 = require('node:crypto');
|
|
13
|
-
const path = require('path');
|
|
13
|
+
const path = require('node:path');
|
|
14
14
|
const commentJson = require('comment-json');
|
|
15
15
|
const superjson = require('superjson');
|
|
16
16
|
|
|
@@ -863,6 +863,10 @@ function develitWorker(Worker) {
|
|
|
863
863
|
}))
|
|
864
864
|
);
|
|
865
865
|
}
|
|
866
|
+
recordAuditLogMessage(queue, message) {
|
|
867
|
+
const msg = { service: this.name, ...message, createdAt: /* @__PURE__ */ new Date() };
|
|
868
|
+
return this.pushToQueue(queue, msg);
|
|
869
|
+
}
|
|
866
870
|
async handleAction(input, options = {}, actionExecution) {
|
|
867
871
|
return handleAction(this, input, options, actionExecution);
|
|
868
872
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -224,6 +224,7 @@ interface DevelitWorkerMethods {
|
|
|
224
224
|
logOutput(data: object): void;
|
|
225
225
|
logError(error: object): void;
|
|
226
226
|
pushToQueue<T>(queue: Queue, message: T | T[]): Promise<void>;
|
|
227
|
+
recordAuditLogMessage<T>(queue: Queue, message: T | T[]): Promise<void>;
|
|
227
228
|
handleInput<T extends z.$ZodType>(args: {
|
|
228
229
|
input: z.infer<T>;
|
|
229
230
|
schema: T;
|
package/dist/index.d.mts
CHANGED
|
@@ -224,6 +224,7 @@ interface DevelitWorkerMethods {
|
|
|
224
224
|
logOutput(data: object): void;
|
|
225
225
|
logError(error: object): void;
|
|
226
226
|
pushToQueue<T>(queue: Queue, message: T | T[]): Promise<void>;
|
|
227
|
+
recordAuditLogMessage<T>(queue: Queue, message: T | T[]): Promise<void>;
|
|
227
228
|
handleInput<T extends z.$ZodType>(args: {
|
|
228
229
|
input: z.infer<T>;
|
|
229
230
|
schema: T;
|
package/dist/index.d.ts
CHANGED
|
@@ -224,6 +224,7 @@ interface DevelitWorkerMethods {
|
|
|
224
224
|
logOutput(data: object): void;
|
|
225
225
|
logError(error: object): void;
|
|
226
226
|
pushToQueue<T>(queue: Queue, message: T | T[]): Promise<void>;
|
|
227
|
+
recordAuditLogMessage<T>(queue: Queue, message: T | T[]): Promise<void>;
|
|
227
228
|
handleInput<T extends z.$ZodType>(args: {
|
|
228
229
|
input: z.infer<T>;
|
|
229
230
|
schema: T;
|
package/dist/index.mjs
CHANGED
|
@@ -6,9 +6,9 @@ import { toSnakeCase } from '@std/text';
|
|
|
6
6
|
import 'http-status-codes';
|
|
7
7
|
import * as z from 'zod/v4/core';
|
|
8
8
|
import { createError } from 'h3';
|
|
9
|
-
import fs from 'fs';
|
|
9
|
+
import fs from 'node:fs';
|
|
10
10
|
import crypto$1 from 'node:crypto';
|
|
11
|
-
import path from 'path';
|
|
11
|
+
import path from 'node:path';
|
|
12
12
|
import { parse } from 'comment-json';
|
|
13
13
|
import superjson from 'superjson';
|
|
14
14
|
|
|
@@ -841,6 +841,10 @@ function develitWorker(Worker) {
|
|
|
841
841
|
}))
|
|
842
842
|
);
|
|
843
843
|
}
|
|
844
|
+
recordAuditLogMessage(queue, message) {
|
|
845
|
+
const msg = { service: this.name, ...message, createdAt: /* @__PURE__ */ new Date() };
|
|
846
|
+
return this.pushToQueue(queue, msg);
|
|
847
|
+
}
|
|
844
848
|
async handleAction(input, options = {}, actionExecution) {
|
|
845
849
|
return handleAction(this, input, options, actionExecution);
|
|
846
850
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const commentJson = require('comment-json');
|
|
4
|
+
const fs = require('node:fs');
|
|
5
|
+
const path = require('@std/path');
|
|
6
|
+
|
|
7
|
+
async function loadWorkerConfig({ path: path$1 }) {
|
|
8
|
+
const workerConfigFile = fs.readFileSync(path.join(path$1, "./wrangler.jsonc"), "utf-8");
|
|
9
|
+
return commentJson.parse(workerConfigFile);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.loadWorkerConfig = loadWorkerConfig;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { parse } from 'comment-json';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { join } from '@std/path';
|
|
4
|
+
|
|
5
|
+
async function loadWorkerConfig({ path }) {
|
|
6
|
+
const workerConfigFile = readFileSync(join(path, "./wrangler.jsonc"), "utf-8");
|
|
7
|
+
return parse(workerConfigFile);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { loadWorkerConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@develit-io/backend-sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.19.0",
|
|
4
4
|
"description": "Develit Backend SDK",
|
|
5
5
|
"author": "Develit.io",
|
|
6
6
|
"license": "ISC",
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
"require": "./dist/index.cjs",
|
|
23
23
|
"types": "./dist/index.d.ts"
|
|
24
24
|
},
|
|
25
|
+
"./node": {
|
|
26
|
+
"import": "./dist/node/index.mjs",
|
|
27
|
+
"require": "./dist/node/index.cjs",
|
|
28
|
+
"types": "./dist/node/index.d.ts"
|
|
29
|
+
},
|
|
25
30
|
"./package.json": "./package.json"
|
|
26
31
|
},
|
|
27
32
|
"main": "./dist/index.cjs",
|
|
@@ -30,8 +35,8 @@
|
|
|
30
35
|
"dist"
|
|
31
36
|
],
|
|
32
37
|
"dependencies": {
|
|
33
|
-
"@cloudflare/workers-types": "4.
|
|
34
|
-
"@pulumi/cloudflare": "^6.9.
|
|
38
|
+
"@cloudflare/workers-types": "4.20250923.0",
|
|
39
|
+
"@pulumi/cloudflare": "^6.9.1",
|
|
35
40
|
"@std/path": "npm:@jsr/std__path",
|
|
36
41
|
"@std/text": "npm:@jsr/std__text",
|
|
37
42
|
"comment-json": "^4.2.5",
|