@envseal/core 0.1.0 → 0.1.2
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/broker.js +1 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/tickets.js +4 -4
- package/package.json +14 -5
package/dist/broker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHmac } from 'node:crypto';
|
|
2
|
-
import { SepError, isSepError,
|
|
2
|
+
import { SepError, isSepError, zero } from '@envseal/protocol';
|
|
3
3
|
import { getProvider, findKey } from '@envseal/registry';
|
|
4
4
|
import { selectPrompter } from '@envseal/prompters';
|
|
5
5
|
import { projectPaths, loadOrCreateSalt } from './paths.js';
|
|
@@ -12,7 +12,6 @@ import { runWithSecrets } from './exec.js';
|
|
|
12
12
|
import { getSink } from './sinks/registry.js';
|
|
13
13
|
import { getValidation, recordValidation } from './validation-state.js';
|
|
14
14
|
import { scanText, secretInRequestError } from './guard.js';
|
|
15
|
-
const LENGTH_BUCKETS = ['<8', '8-16', '16-32', '32-48', '48-64', '64-128', '128+'];
|
|
16
15
|
function getLengthBucket(length) {
|
|
17
16
|
if (length < 8)
|
|
18
17
|
return '<8';
|
|
@@ -121,7 +120,6 @@ export class Broker {
|
|
|
121
120
|
};
|
|
122
121
|
}
|
|
123
122
|
async declare(input) {
|
|
124
|
-
const manifest = loadManifest(this.paths) ?? emptyManifest();
|
|
125
123
|
const withDefaults = input.entries.map((entry) => {
|
|
126
124
|
if (entry.format || entry.provider || entry.verify) {
|
|
127
125
|
return entry;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/tickets.js
CHANGED
|
@@ -92,7 +92,7 @@ export class TicketStore {
|
|
|
92
92
|
}
|
|
93
93
|
this.expireIfDue(record);
|
|
94
94
|
let settled = false;
|
|
95
|
-
|
|
95
|
+
const timer = {};
|
|
96
96
|
const listener = () => {
|
|
97
97
|
if (record.state !== 'pending')
|
|
98
98
|
finish();
|
|
@@ -103,8 +103,8 @@ export class TicketStore {
|
|
|
103
103
|
settled = true;
|
|
104
104
|
this.unsubscribe(ticket, listener);
|
|
105
105
|
this.pendingAwaits.delete(finish);
|
|
106
|
-
if (
|
|
107
|
-
clearTimeout(
|
|
106
|
+
if (timer.handle !== undefined)
|
|
107
|
+
clearTimeout(timer.handle);
|
|
108
108
|
resolvePromise(this.toOutcome(record));
|
|
109
109
|
};
|
|
110
110
|
if (record.state !== 'pending') {
|
|
@@ -115,7 +115,7 @@ export class TicketStore {
|
|
|
115
115
|
// own expiry.
|
|
116
116
|
const untilExpiry = Math.max(0, record.expiresAt - Date.now());
|
|
117
117
|
const delay = Math.min(Math.max(0, timeoutMs), untilExpiry, MAX_TIMER_MS);
|
|
118
|
-
|
|
118
|
+
timer.handle = setTimeout(() => {
|
|
119
119
|
this.expireIfDue(record);
|
|
120
120
|
finish();
|
|
121
121
|
}, delay);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envseal/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,14 +22,23 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"jsonc-parser": "^3.3.1",
|
|
24
24
|
"ulid": "^2.3.0",
|
|
25
|
-
"@envseal/
|
|
26
|
-
"@envseal/
|
|
27
|
-
"@envseal/detector": "0.1.
|
|
28
|
-
"@envseal/
|
|
25
|
+
"@envseal/registry": "0.1.2",
|
|
26
|
+
"@envseal/prompters": "0.1.2",
|
|
27
|
+
"@envseal/detector": "0.1.2",
|
|
28
|
+
"@envseal/protocol": "0.1.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"fast-check": "^3.23.1"
|
|
32
32
|
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/NDilanka/envseal.git",
|
|
36
|
+
"directory": "core/package.json"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/NDilanka/envseal#readme",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/NDilanka/envseal/issues"
|
|
41
|
+
},
|
|
33
42
|
"scripts": {
|
|
34
43
|
"build": "tsc -p tsconfig.json",
|
|
35
44
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|