@emilia-protocol/gate 0.10.0 → 0.11.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/CHANGELOG.md +33 -0
- package/README.md +20 -0
- package/action-escrow-custodian.js +395 -0
- package/action-escrow-evidence.js +859 -0
- package/action-escrow-package.js +1669 -0
- package/action-escrow-postgres.js +338 -0
- package/action-escrow-state.js +397 -0
- package/action-escrow-verifiers.js +332 -0
- package/action-escrow.js +2448 -0
- package/package.json +17 -3
- package/strict-json.js +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emilia-protocol/gate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/emiliaprotocol/emilia-protocol.git",
|
|
@@ -47,6 +47,13 @@
|
|
|
47
47
|
"./evidence-postgres": "./evidence-postgres.js",
|
|
48
48
|
"./witness-postgres": "./witness-postgres.js",
|
|
49
49
|
"./evidence": "./evidence.js",
|
|
50
|
+
"./action-escrow": "./action-escrow.js",
|
|
51
|
+
"./action-escrow-evidence": "./action-escrow-evidence.js",
|
|
52
|
+
"./action-escrow-state": "./action-escrow-state.js",
|
|
53
|
+
"./action-escrow-postgres": "./action-escrow-postgres.js",
|
|
54
|
+
"./action-escrow-verifiers": "./action-escrow-verifiers.js",
|
|
55
|
+
"./action-escrow-custodian": "./action-escrow-custodian.js",
|
|
56
|
+
"./action-escrow-package": "./action-escrow-package.js",
|
|
50
57
|
"./reports/auditor-workpaper": "./reports/auditor-workpaper.js",
|
|
51
58
|
"./reports/reperform": "./reports/reperform.js",
|
|
52
59
|
"./reports/external-verification": "./reports/external-verification.js",
|
|
@@ -66,6 +73,13 @@
|
|
|
66
73
|
"evidence-postgres.js",
|
|
67
74
|
"witness-postgres.js",
|
|
68
75
|
"evidence.js",
|
|
76
|
+
"action-escrow.js",
|
|
77
|
+
"action-escrow-evidence.js",
|
|
78
|
+
"action-escrow-state.js",
|
|
79
|
+
"action-escrow-postgres.js",
|
|
80
|
+
"action-escrow-verifiers.js",
|
|
81
|
+
"action-escrow-custodian.js",
|
|
82
|
+
"action-escrow-package.js",
|
|
69
83
|
"action-packs.js",
|
|
70
84
|
"action-control-manifest.js",
|
|
71
85
|
"execution-binding.js",
|
|
@@ -140,8 +154,8 @@
|
|
|
140
154
|
"cf1": "node cf1.mjs"
|
|
141
155
|
},
|
|
142
156
|
"dependencies": {
|
|
143
|
-
"@emilia-protocol/require-receipt": "0.6.
|
|
144
|
-
"@emilia-protocol/verify": "3.
|
|
157
|
+
"@emilia-protocol/require-receipt": "0.6.1",
|
|
158
|
+
"@emilia-protocol/verify": "3.11.0"
|
|
145
159
|
},
|
|
146
160
|
"keywords": [
|
|
147
161
|
"emilia",
|
package/strict-json.js
CHANGED
|
@@ -4,8 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
export const MAX_JSON_DEPTH = 64;
|
|
6
6
|
|
|
7
|
+
function hasUnpairedUtf16Surrogate(value) {
|
|
8
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
9
|
+
const code = value.charCodeAt(index);
|
|
10
|
+
if (code >= 0xd800 && code <= 0xdbff) {
|
|
11
|
+
const next = value.charCodeAt(index + 1);
|
|
12
|
+
if (next < 0xdc00 || next > 0xdfff) return true;
|
|
13
|
+
index += 1;
|
|
14
|
+
} else if (code >= 0xdc00 && code <= 0xdfff) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
|
|
7
21
|
export function strictJsonGate(raw) {
|
|
8
22
|
if (typeof raw !== 'string') return { ok: false, reason: 'JSON input must be text' };
|
|
23
|
+
if (hasUnpairedUtf16Surrogate(raw)) {
|
|
24
|
+
return { ok: false, reason: 'unpaired Unicode surrogate' };
|
|
25
|
+
}
|
|
9
26
|
try { JSON.parse(raw); } catch { return { ok: false, reason: 'invalid JSON syntax' }; }
|
|
10
27
|
let index = 0;
|
|
11
28
|
const stack = [];
|