prostgles-server 4.2.597 → 4.2.598
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prostgles-server",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.598",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"pg": "^8.23.0",
|
|
58
58
|
"pg-cursor": "^2.22.0",
|
|
59
59
|
"pg-promise": "^12.7.0",
|
|
60
|
-
"prostgles-types": "^4.0.
|
|
60
|
+
"prostgles-types": "^4.0.279"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@eslint/js": "^9.22.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runClientRequest.spec.d.ts","sourceRoot":"","sources":["../lib/runClientRequest.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const node_assert_1 = require("node:assert");
|
|
4
|
-
const node_test_1 = require("node:test");
|
|
5
|
-
const runClientRequest_1 = require("./runClientRequest");
|
|
6
|
-
void (0, node_test_1.describe)("runClientMethod", async () => {
|
|
7
|
-
const getProstgles = (run) => ({
|
|
8
|
-
dboBuilder: {
|
|
9
|
-
dboMap: new Map([["items", {}]]),
|
|
10
|
-
},
|
|
11
|
-
publishParser: {
|
|
12
|
-
getAllowedFunctions: () => Promise.resolve(new Map([
|
|
13
|
-
[
|
|
14
|
-
"testLookup",
|
|
15
|
-
{
|
|
16
|
-
input: { table: { type: "TableLookup" } },
|
|
17
|
-
run,
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
])),
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
await (0, node_test_1.test)("accepts valid lookup values", async () => {
|
|
24
|
-
const result = await runClientRequest_1.runClientMethod.call(getProstgles(() => "ok"), { name: "testLookup", input: { table: "items" } }, {});
|
|
25
|
-
node_assert_1.strict.equal(result, "ok");
|
|
26
|
-
});
|
|
27
|
-
await (0, node_test_1.test)("rejects invalid lookup values before running the function", async () => {
|
|
28
|
-
let didRun = false;
|
|
29
|
-
const error = await runClientRequest_1.runClientMethod
|
|
30
|
-
.call(getProstgles(() => {
|
|
31
|
-
didRun = true;
|
|
32
|
-
return "ok";
|
|
33
|
-
}), { name: "testLookup", input: { table: "missing" } }, {})
|
|
34
|
-
.catch((error) => error);
|
|
35
|
-
node_assert_1.strict.equal(error, 'table references an unknown table "missing"');
|
|
36
|
-
node_assert_1.strict.equal(didRun, false);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=runClientRequest.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runClientRequest.spec.js","sourceRoot":"","sources":["../lib/runClientRequest.spec.ts"],"names":[],"mappings":";;AAAA,6CAA+C;AAC/C,yCAA2C;AAG3C,yDAAqD;AAErD,KAAK,IAAA,oBAAQ,EAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;IAC1C,MAAM,YAAY,GAAG,CAAC,GAAiB,EAAE,EAAE,CACzC,CAAC;QACC,UAAU,EAAE;YACV,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;SACjC;QACD,aAAa,EAAE;YACb,mBAAmB,EAAE,GAAG,EAAE,CACxB,OAAO,CAAC,OAAO,CACb,IAAI,GAAG,CAAC;gBACN;oBACE,YAAY;oBACZ;wBACE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE;wBACzC,GAAG;qBACJ;iBACF;aACF,CAAC,CACH;SACJ;KACF,CAAyB,CAAC;IAE7B,MAAM,IAAA,gBAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,MAAM,GAAG,MAAM,kCAAe,CAAC,IAAI,CACvC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EACxB,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EACjD,EAAuB,CACxB,CAAC;QAEF,oBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,MAAM,IAAA,gBAAI,EAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QACjF,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,MAAM,KAAK,GAAG,MAAM,kCAAe;aAChC,IAAI,CACH,YAAY,CAAC,GAAG,EAAE;YAChB,MAAM,GAAG,IAAI,CAAC;YACd,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,EACF,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EACnD,EAAuB,CACxB;aACA,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;QAEpC,oBAAM,CAAC,KAAK,CAAC,KAAK,EAAE,6CAA6C,CAAC,CAAC;QACnE,oBAAM,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { strict as assert } from "node:assert";
|
|
2
|
-
import { describe, test } from "node:test";
|
|
3
|
-
import type { AuthClientRequest } from "./Auth/AuthTypes";
|
|
4
|
-
import type { Prostgles } from "./Prostgles";
|
|
5
|
-
import { runClientMethod } from "./runClientRequest";
|
|
6
|
-
|
|
7
|
-
void describe("runClientMethod", async () => {
|
|
8
|
-
const getProstgles = (run: () => string) =>
|
|
9
|
-
({
|
|
10
|
-
dboBuilder: {
|
|
11
|
-
dboMap: new Map([["items", {}]]),
|
|
12
|
-
},
|
|
13
|
-
publishParser: {
|
|
14
|
-
getAllowedFunctions: () =>
|
|
15
|
-
Promise.resolve(
|
|
16
|
-
new Map([
|
|
17
|
-
[
|
|
18
|
-
"testLookup",
|
|
19
|
-
{
|
|
20
|
-
input: { table: { type: "TableLookup" } },
|
|
21
|
-
run,
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
]),
|
|
25
|
-
),
|
|
26
|
-
},
|
|
27
|
-
}) as unknown as Prostgles;
|
|
28
|
-
|
|
29
|
-
await test("accepts valid lookup values", async () => {
|
|
30
|
-
const result = await runClientMethod.call(
|
|
31
|
-
getProstgles(() => "ok"),
|
|
32
|
-
{ name: "testLookup", input: { table: "items" } },
|
|
33
|
-
{} as AuthClientRequest,
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
assert.equal(result, "ok");
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
await test("rejects invalid lookup values before running the function", async () => {
|
|
40
|
-
let didRun = false;
|
|
41
|
-
const error = await runClientMethod
|
|
42
|
-
.call(
|
|
43
|
-
getProstgles(() => {
|
|
44
|
-
didRun = true;
|
|
45
|
-
return "ok";
|
|
46
|
-
}),
|
|
47
|
-
{ name: "testLookup", input: { table: "missing" } },
|
|
48
|
-
{} as AuthClientRequest,
|
|
49
|
-
)
|
|
50
|
-
.catch((error: unknown) => error);
|
|
51
|
-
|
|
52
|
-
assert.equal(error, 'table references an unknown table "missing"');
|
|
53
|
-
assert.equal(didRun, false);
|
|
54
|
-
});
|
|
55
|
-
});
|