@jini-ai/platform 0.7.2 → 0.7.3-next.1
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 +2 -8
- package/README.md +16 -4
- package/dist/asset-cache.d.ts +13 -3
- package/dist/asset-cache.js +163 -154
- package/dist/blob-storage.d.ts +3 -32
- package/dist/blob-storage.js +1 -9
- package/dist/child-environment.d.ts +0 -16
- package/dist/child-environment.js +0 -25
- package/dist/command.d.ts +6 -11
- package/dist/command.js +8 -54
- package/dist/download-lock.d.ts +4 -0
- package/dist/download-lock.js +82 -0
- package/dist/download-maintenance.d.ts +5 -0
- package/dist/download-maintenance.js +82 -0
- package/dist/download-state.d.ts +8 -0
- package/dist/download-state.js +126 -0
- package/dist/download-store.d.ts +22 -0
- package/dist/download-store.js +174 -0
- package/dist/download-target.d.ts +10 -0
- package/dist/download-target.js +102 -0
- package/dist/download-transfer.d.ts +12 -0
- package/dist/download-transfer.js +174 -0
- package/dist/download-types.d.ts +162 -0
- package/dist/download-types.js +31 -0
- package/dist/download.d.ts +1 -89
- package/dist/download.js +8 -738
- package/dist/fetch-with-timeout.d.ts +7 -32
- package/dist/fetch-with-timeout.js +1 -77
- package/dist/fs/app-data-root.d.ts +28 -0
- package/dist/fs/app-data-root.js +35 -0
- package/dist/fs/atomic-write.js +1 -1
- package/dist/fs/boot-identity.d.ts +1 -4
- package/dist/fs/directory-delete-guard.d.ts +93 -0
- package/dist/fs/directory-delete-guard.js +148 -0
- package/dist/fs/directory-registry.js +45 -35
- package/dist/fs/directory-relocation.d.ts +82 -0
- package/dist/fs/directory-relocation.js +99 -0
- package/dist/fs/directory-running-lock.d.ts +1 -1
- package/dist/fs/directory-running-lock.js +24 -21
- package/dist/fs/directory-sync.js +1 -1
- package/dist/fs/directory-user-config.js +30 -3
- package/dist/fs/directory-workspace.d.ts +34 -30
- package/dist/fs/directory-workspace.js +70 -29
- package/dist/fs/durable-json.d.ts +6 -15
- package/dist/fs/durable-json.js +38 -35
- package/dist/fs/errno.d.ts +12 -3
- package/dist/fs/errno.js +5 -3
- package/dist/fs/file-lock.d.ts +3 -87
- package/dist/fs/file-lock.js +16 -30
- package/dist/fs/guarded-reader.js +335 -315
- package/dist/fs/index.d.ts +5 -0
- package/dist/fs/index.js +5 -0
- package/dist/fs/recent-directories.d.ts +46 -0
- package/dist/fs/recent-directories.js +68 -0
- package/dist/fs/remove-directory-tree.d.ts +20 -0
- package/dist/fs/remove-directory-tree.js +28 -0
- package/dist/fs/user-data-directories.js +2 -2
- package/dist/fs/workspace-directory.js +2 -1
- package/dist/fs.d.ts +16 -4
- package/dist/fs.js +4 -4
- package/dist/home-expansion.d.ts +7 -2
- package/dist/home-expansion.js +3 -3
- package/dist/http/guarded/client.d.ts +1 -2
- package/dist/http/guarded/client.js +2 -1
- package/dist/http/guarded/index.d.ts +0 -3
- package/dist/http/guarded/node-ports.d.ts +1 -1
- package/dist/http/guarded/transport.fetch.d.ts +2 -3
- package/dist/http/guarded/transport.fetch.js +64 -58
- package/dist/http.d.ts +3 -1
- package/dist/http.js +2 -2
- package/dist/index.d.ts +10 -11
- package/dist/index.js +7 -6
- package/dist/mail/activity/activity.d.ts +136 -0
- package/dist/mail/activity/activity.js +172 -0
- package/dist/mail/activity/ports.d.ts +113 -0
- package/dist/mail/activity/suppressions.d.ts +82 -0
- package/dist/mail/activity/suppressions.js +119 -0
- package/dist/mail/activity/vocabulary.d.ts +10 -0
- package/dist/mail/activity/vocabulary.js +8 -0
- package/dist/mail/builtin-providers.d.ts +12 -6
- package/dist/mail/builtin-providers.js +14 -11
- package/dist/mail/delivery-wrapper.js +2 -1
- package/dist/mail/email-sender-registry.d.ts +1 -1
- package/dist/mail/email-sender-registry.js +1 -1
- package/dist/mail/email-template-operations.d.ts +186 -0
- package/dist/mail/email-template-operations.js +226 -0
- package/dist/mail/email-template.d.ts +120 -0
- package/dist/mail/email-template.js +243 -0
- package/dist/mail/index.d.ts +4 -0
- package/dist/mail/index.js +3 -0
- package/dist/mail/prepare-sender-email.d.ts +1 -10
- package/dist/mail/prepare-sender-email.js +1 -11
- package/dist/mail/resolve-mailer.d.ts +2 -1
- package/dist/mail/resolve-mailer.js +5 -2
- package/dist/mail/senders.d.ts +0 -1
- package/dist/mail/senders.js +0 -1
- package/dist/mail/smtp.d.ts +1 -31
- package/dist/net/address.d.ts +1 -8
- package/dist/net/address.js +1 -18
- package/dist/net/index.d.ts +1 -1
- package/dist/net/index.js +1 -1
- package/dist/net/local-http-probe.js +1 -1
- package/dist/net/local-http-request.js +1 -1
- package/dist/process-probes.d.ts +36 -0
- package/dist/process-probes.js +151 -0
- package/dist/process-top-footprint.d.ts +7 -0
- package/dist/process-top-footprint.js +30 -0
- package/dist/process.d.ts +29 -31
- package/dist/process.js +18 -196
- package/dist/proxy-env.d.ts +12 -3
- package/dist/proxy-env.js +9 -8
- package/dist/resource-paths.d.ts +15 -3
- package/dist/resource-paths.js +7 -5
- package/dist/sandbox-env.d.ts +26 -5
- package/dist/sandbox-env.js +7 -7
- package/dist/secrets/credential-sets/contracts.d.ts +0 -1
- package/dist/secrets/credential-sets/contracts.js +0 -1
- package/dist/secrets/credential-sets/index.d.ts +2 -3
- package/dist/secrets/credential-sets/index.js +1 -1
- package/dist/secrets/credential-sets/provider-matches.d.ts +1 -1
- package/dist/secrets/credential-sets/provider-matches.js +1 -1
- package/dist/secrets/credential-sets/vault-archive.d.ts +1 -1
- package/dist/secrets/credential-sets/vault-archive.js +14 -8
- package/dist/secrets/credential-sets/vault.aad.d.ts +1 -1
- package/dist/secrets/credential-sets/vault.meta.d.ts +1 -1
- package/dist/secrets/credential-sets/vault.meta.js +1 -1
- package/dist/secrets/credential-sets/vault.repo.memory.d.ts +1 -1
- package/dist/secrets/credential-sets/vault.repo.memory.js +1 -1
- package/dist/secrets/credential-sets/vault.reseal-refused.d.ts +23 -0
- package/dist/secrets/credential-sets/vault.reseal-refused.js +36 -0
- package/dist/secrets/credential-sets/vault.service.d.ts +25 -5
- package/dist/secrets/credential-sets/vault.service.js +42 -8
- package/dist/secrets/index.d.ts +0 -3
- package/dist/secrets/index.js +5 -0
- package/dist/secrets/keyring.env.d.ts +1 -1
- package/dist/secrets/legacy-owner.d.ts +61 -0
- package/dist/secrets/legacy-owner.js +196 -0
- package/dist/secrets/root-key/decide.d.ts +89 -0
- package/dist/secrets/root-key/decide.js +60 -0
- package/dist/secrets/sealer-contract.d.ts +19 -0
- package/dist/secrets/sealer-contract.js +37 -0
- package/dist/secrets/secret-sealer.aesgcm.d.ts +1 -1
- package/dist/secrets/testing.d.ts +1 -0
- package/dist/secrets/testing.js +1 -0
- package/dist/shell.d.ts +4 -1
- package/dist/shell.js +1 -1
- package/dist/system.d.ts +6 -0
- package/dist/system.js +9 -0
- package/dist/terminal.d.ts +11 -96
- package/dist/terminal.js +80 -56
- package/dist/web/agent-tools.d.ts +107 -0
- package/dist/web/agent-tools.js +49 -0
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.js +1 -0
- package/package.json +38 -12
- package/dist/http/guarded/ports.d.ts +0 -56
- package/dist/http/guarded/types.d.ts +0 -8
- package/dist/http/guarded/types.js +0 -2
- package/dist/mail/email-sender.d.ts +0 -109
- package/dist/mail/email-sender.js +0 -10
- package/dist/net/endpoint-policy.d.ts +0 -39
- package/dist/net/endpoint-policy.js +0 -218
- package/dist/secrets/credential-sets/aad.d.ts +0 -7
- package/dist/secrets/credential-sets/aad.js +0 -7
- package/dist/secrets/credential-sets/repo.memory.d.ts +0 -44
- package/dist/secrets/credential-sets/repo.memory.js +0 -80
- package/dist/secrets/credential-sets/vault.types.d.ts +0 -27
- package/dist/secrets/credential-sets/vault.types.js +0 -49
- /package/dist/{http/guarded → mail/activity}/ports.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/platform",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3-next.1",
|
|
4
4
|
"description": "Generic OS/platform primitives: process exec and lifecycle, filesystem containment, HTTP readiness polling, toolchain discovery, blob storage, AWS signing, and an SSRF-safe asset cache.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -18,21 +18,25 @@
|
|
|
18
18
|
"./asset-cache": "node",
|
|
19
19
|
"./secrets": "node",
|
|
20
20
|
"./secrets/credential-sets": "node",
|
|
21
|
+
"./secrets/root-key": "node",
|
|
21
22
|
"./secrets/credential-sets/contracts": "universal",
|
|
22
23
|
"./secrets/testing": "node",
|
|
23
24
|
"./http/guarded": "node",
|
|
24
25
|
"./http/multipart": "node",
|
|
25
26
|
"./mail": "node",
|
|
26
27
|
"./mail/senders": "universal",
|
|
28
|
+
"./system": "universal",
|
|
29
|
+
"./mail/email-template": "node",
|
|
30
|
+
"./mail/email-template-operations": "node",
|
|
27
31
|
"./mail/smtp": "node",
|
|
28
32
|
"./fs/guarded-reader": "node",
|
|
29
33
|
"./fs/durable-json": "node",
|
|
30
34
|
"./fs": "node",
|
|
31
35
|
"./object-store": "node",
|
|
32
36
|
"./net": "node",
|
|
33
|
-
"./net/endpoint-policy": "universal",
|
|
34
37
|
"./fs/file-lock": "node",
|
|
35
38
|
"./secrets/credential-token": "universal",
|
|
39
|
+
"./secrets/legacy-owner": "node",
|
|
36
40
|
"./web": "node",
|
|
37
41
|
"./command": "node",
|
|
38
42
|
"./process": "node",
|
|
@@ -51,8 +55,10 @@
|
|
|
51
55
|
"./child-environment": "os"
|
|
52
56
|
},
|
|
53
57
|
"shared": [
|
|
58
|
+
"src/web/html-document.ts",
|
|
59
|
+
"src/web/first-distinct.ts",
|
|
60
|
+
"src/system.ts",
|
|
54
61
|
"src/net/address.ts",
|
|
55
|
-
"src/net/endpoint-policy.ts",
|
|
56
62
|
"src/fetch-with-timeout.ts",
|
|
57
63
|
"src/http/guarded/errors.ts"
|
|
58
64
|
]
|
|
@@ -62,7 +68,7 @@
|
|
|
62
68
|
"hast-util-to-mdast": "opt-in: html to markdown conversion; import @jini-ai/platform/web — HTML to Markdown conversion could not load hast-util-to-mdast. Install hast-util-to-mdast to enable this feature, or check its installed version and native binaries.",
|
|
63
69
|
"mdast-util-to-markdown": "opt-in: html to markdown conversion; import @jini-ai/platform/web — HTML to Markdown conversion could not load mdast-util-to-markdown. Install mdast-util-to-markdown to enable this feature, or check its installed version and native binaries.",
|
|
64
70
|
"mdast-util-gfm-table": "opt-in: markdown table conversion; import @jini-ai/platform/web — Markdown table conversion could not load mdast-util-gfm-table. Install mdast-util-gfm-table to enable this feature, or check its installed version and native binaries.",
|
|
65
|
-
"parse5": "opt-in: html parsing; import @jini-ai/platform/web — HTML parsing could not load parse5. Install parse5 to enable this feature, or check its installed version and native binaries."
|
|
71
|
+
"parse5": "opt-in: html parsing; import @jini-ai/platform/web, @jini-ai/platform/mail/email-template or @jini-ai/platform/mail/email-template-operations — HTML parsing could not load parse5. Install parse5 to enable this feature, or check its installed version and native binaries."
|
|
66
72
|
}
|
|
67
73
|
},
|
|
68
74
|
"type": "module",
|
|
@@ -95,6 +101,11 @@
|
|
|
95
101
|
"import": "./dist/secrets/credential-sets/index.js",
|
|
96
102
|
"default": "./dist/secrets/credential-sets/index.js"
|
|
97
103
|
},
|
|
104
|
+
"./secrets/root-key": {
|
|
105
|
+
"types": "./dist/secrets/root-key/decide.d.ts",
|
|
106
|
+
"import": "./dist/secrets/root-key/decide.js",
|
|
107
|
+
"default": "./dist/secrets/root-key/decide.js"
|
|
108
|
+
},
|
|
98
109
|
"./secrets/credential-sets/contracts": {
|
|
99
110
|
"types": "./dist/secrets/credential-sets/contracts.d.ts",
|
|
100
111
|
"import": "./dist/secrets/credential-sets/contracts.js",
|
|
@@ -120,11 +131,26 @@
|
|
|
120
131
|
"import": "./dist/mail/index.js",
|
|
121
132
|
"default": "./dist/mail/index.js"
|
|
122
133
|
},
|
|
134
|
+
"./system": {
|
|
135
|
+
"types": "./dist/system.d.ts",
|
|
136
|
+
"import": "./dist/system.js",
|
|
137
|
+
"default": "./dist/system.js"
|
|
138
|
+
},
|
|
123
139
|
"./mail/senders": {
|
|
124
140
|
"types": "./dist/mail/senders.d.ts",
|
|
125
141
|
"import": "./dist/mail/senders.js",
|
|
126
142
|
"default": "./dist/mail/senders.js"
|
|
127
143
|
},
|
|
144
|
+
"./mail/email-template": {
|
|
145
|
+
"types": "./dist/mail/email-template.d.ts",
|
|
146
|
+
"import": "./dist/mail/email-template.js",
|
|
147
|
+
"default": "./dist/mail/email-template.js"
|
|
148
|
+
},
|
|
149
|
+
"./mail/email-template-operations": {
|
|
150
|
+
"types": "./dist/mail/email-template-operations.d.ts",
|
|
151
|
+
"import": "./dist/mail/email-template-operations.js",
|
|
152
|
+
"default": "./dist/mail/email-template-operations.js"
|
|
153
|
+
},
|
|
128
154
|
"./mail/smtp": {
|
|
129
155
|
"types": "./dist/mail/smtp.d.ts",
|
|
130
156
|
"import": "./dist/mail/smtp.js",
|
|
@@ -155,11 +181,6 @@
|
|
|
155
181
|
"import": "./dist/net/index.js",
|
|
156
182
|
"default": "./dist/net/index.js"
|
|
157
183
|
},
|
|
158
|
-
"./net/endpoint-policy": {
|
|
159
|
-
"types": "./dist/net/endpoint-policy.d.ts",
|
|
160
|
-
"import": "./dist/net/endpoint-policy.js",
|
|
161
|
-
"default": "./dist/net/endpoint-policy.js"
|
|
162
|
-
},
|
|
163
184
|
"./fs/file-lock": {
|
|
164
185
|
"types": "./dist/fs/file-lock.d.ts",
|
|
165
186
|
"import": "./dist/fs/file-lock.js",
|
|
@@ -170,6 +191,11 @@
|
|
|
170
191
|
"import": "./dist/secrets/credential-token.js",
|
|
171
192
|
"default": "./dist/secrets/credential-token.js"
|
|
172
193
|
},
|
|
194
|
+
"./secrets/legacy-owner": {
|
|
195
|
+
"types": "./dist/secrets/legacy-owner.d.ts",
|
|
196
|
+
"import": "./dist/secrets/legacy-owner.js",
|
|
197
|
+
"default": "./dist/secrets/legacy-owner.js"
|
|
198
|
+
},
|
|
173
199
|
"./web": {
|
|
174
200
|
"types": "./dist/web/index.d.ts",
|
|
175
201
|
"import": "./dist/web/index.js",
|
|
@@ -219,8 +245,8 @@
|
|
|
219
245
|
"!dist/**/*.map"
|
|
220
246
|
],
|
|
221
247
|
"dependencies": {
|
|
222
|
-
"
|
|
223
|
-
"
|
|
248
|
+
"undici": "^7.30.1",
|
|
249
|
+
"@jini-ai/core": "^0.7.3-next.1"
|
|
224
250
|
},
|
|
225
251
|
"publishConfig": {
|
|
226
252
|
"access": "public",
|
|
@@ -228,7 +254,7 @@
|
|
|
228
254
|
},
|
|
229
255
|
"devDependencies": {
|
|
230
256
|
"@vitest/coverage-v8": "^2.1.9",
|
|
231
|
-
"undici": "^7.
|
|
257
|
+
"undici": "^7.30.1",
|
|
232
258
|
"hast-util-from-parse5": "8.0.3",
|
|
233
259
|
"hast-util-to-mdast": "10.1.2",
|
|
234
260
|
"mdast-util-to-markdown": "2.1.2",
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { Clock, HttpRequest, HttpResponse } from "@jini-ai/core/primitives";
|
|
2
|
-
import type { PinnedPeer } from "./types.js";
|
|
3
|
-
export type { PinnedPeer } from "./types.js";
|
|
4
|
-
/** Resolver returns every peer address; a mixed public/private answer is refused as a whole. */
|
|
5
|
-
export interface DnsResolver {
|
|
6
|
-
resolve(required: {
|
|
7
|
-
hostname: string;
|
|
8
|
-
}): Promise<readonly string[]>;
|
|
9
|
-
}
|
|
10
|
-
/** Supplies time and deadline cancellation without a global timer dependency in the guard. */
|
|
11
|
-
export type GuardedClock = Clock & {
|
|
12
|
-
timeoutSignal(required: {
|
|
13
|
-
timeoutMs: number;
|
|
14
|
-
}): AbortSignal;
|
|
15
|
-
};
|
|
16
|
-
/** Transport must dial the supplied IP, preserve authority/SNI, bound decoded bytes,
|
|
17
|
-
* enforce idleTimeoutMs per socket, and honor request.signal through body completion. */
|
|
18
|
-
export interface PinnedHttpTransport {
|
|
19
|
-
requestPinned(required: {
|
|
20
|
-
request: HttpRequest;
|
|
21
|
-
peer: PinnedPeer;
|
|
22
|
-
}): Promise<HttpResponse>;
|
|
23
|
-
}
|
|
24
|
-
export type HttpTransportAdapter = PinnedHttpTransport;
|
|
25
|
-
/** Policy must cover IPv4 and IPv6, mapped-address/hostname normalization, URL credentials and
|
|
26
|
-
* redirects. Re-verify each redirected peer and strip sensitive headers across origins. */
|
|
27
|
-
export interface EgressPolicy {
|
|
28
|
-
readonly allowedSchemes: readonly string[];
|
|
29
|
-
readonly denyPrivateAddresses: boolean;
|
|
30
|
-
/** Explicit development capability; IPv6 literals use their bracket-free hostname (e.g. fd00::1). */
|
|
31
|
-
readonly devHostAllowlist: readonly string[];
|
|
32
|
-
/** Trusted host configuration only: exact normalized scheme+host+port origins on localhost
|
|
33
|
-
* or loopback IP literals whose loopback peers may be dialed. Public DNS names cannot rebind
|
|
34
|
-
* to loopback through this exception. Other private classes remain denied, including mixed answers.
|
|
35
|
-
* Rechecked on every redirect; this never grants other ports or hostname aliases. */
|
|
36
|
-
readonly loopbackOriginAllowlist?: readonly string[];
|
|
37
|
-
readonly maxRedirects: number;
|
|
38
|
-
/** Historical name: ceiling on each socket's idle timeout, not total transfer time. */
|
|
39
|
-
readonly connectTimeoutMs: number;
|
|
40
|
-
readonly maxResponseBytes: number;
|
|
41
|
-
readonly maxDecompressedBytes: number;
|
|
42
|
-
/** Reserved descriptor, not an implemented pacing mechanism. Untrusted fan-out requires a host
|
|
43
|
-
* concurrency/budget limiter; omission is appropriate only for trusted low-fan-out callers. */
|
|
44
|
-
readonly rateLimit?: {
|
|
45
|
-
readonly maxConcurrent: number;
|
|
46
|
-
readonly maxPerMinute: number;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export type GuardedHttpRequired = {
|
|
50
|
-
transport: PinnedHttpTransport;
|
|
51
|
-
policy: EgressPolicy;
|
|
52
|
-
dns: DnsResolver;
|
|
53
|
-
clock: GuardedClock;
|
|
54
|
-
userAgent: string;
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MOVE: Event data and recipient authority belong to the originating feature, independently of
|
|
3
|
-
* delivery providers. Hosts bind authorization, templates and persistence; this surface sends nothing.
|
|
4
|
-
*/
|
|
5
|
-
import type { EmailAddress, MailerSendOptions } from "./types.js";
|
|
6
|
-
/** Explicit caller scope, including for background jobs running as a host service principal. */
|
|
7
|
-
export interface EmailSenderContext {
|
|
8
|
-
readonly workspaceId: string;
|
|
9
|
-
readonly principalId: string;
|
|
10
|
-
}
|
|
11
|
-
/** A concrete event source; the same event name may occur for several sources or senders. */
|
|
12
|
-
export interface EmailSourceRef {
|
|
13
|
-
readonly senderId: string;
|
|
14
|
-
readonly sourceId: string;
|
|
15
|
-
}
|
|
16
|
-
export interface EmailSourceSummary extends EmailSourceRef {
|
|
17
|
-
readonly label: string;
|
|
18
|
-
readonly eventName: string;
|
|
19
|
-
}
|
|
20
|
-
/** Token is the exact placeholder name, without braces. Labels are presentation only. */
|
|
21
|
-
export interface EmailSourceField {
|
|
22
|
-
readonly token: string;
|
|
23
|
-
readonly label: string;
|
|
24
|
-
readonly required: boolean;
|
|
25
|
-
}
|
|
26
|
-
/** Recipient ids are source-owned choices, never caller-supplied addresses or expressions. */
|
|
27
|
-
export interface EmailRecipientChoice {
|
|
28
|
-
readonly id: string;
|
|
29
|
-
readonly label: string;
|
|
30
|
-
}
|
|
31
|
-
export interface EmailReadiness {
|
|
32
|
-
readonly ready: boolean;
|
|
33
|
-
readonly blockers: readonly string[];
|
|
34
|
-
}
|
|
35
|
-
/** Persisted by the sender's existing write owner, never by a template-side relationship. */
|
|
36
|
-
export interface EmailBindingInput {
|
|
37
|
-
readonly bindingId: string;
|
|
38
|
-
readonly enabled: boolean;
|
|
39
|
-
readonly templateId: string;
|
|
40
|
-
readonly recipientId: string;
|
|
41
|
-
readonly replyTo: string;
|
|
42
|
-
}
|
|
43
|
-
export interface EmailBinding extends EmailBindingInput {
|
|
44
|
-
readonly activatedAt: string | null;
|
|
45
|
-
}
|
|
46
|
-
export interface EmailSourceDescription extends EmailSourceSummary {
|
|
47
|
-
readonly fields: readonly EmailSourceField[];
|
|
48
|
-
readonly permittedRecipients: readonly EmailRecipientChoice[];
|
|
49
|
-
readonly purpose: NonNullable<MailerSendOptions["purpose"]>;
|
|
50
|
-
readonly lane: NonNullable<MailerSendOptions["lane"]>;
|
|
51
|
-
readonly binding: EmailBinding | null;
|
|
52
|
-
readonly readiness: EmailReadiness;
|
|
53
|
-
}
|
|
54
|
-
/** Only allowlisted event values and recipients cross this boundary; no stored event row. */
|
|
55
|
-
export interface ResolvedEmailEvent {
|
|
56
|
-
/** Authoritative ISO event time, compared with the binding's latest activation to prevent backfill. */
|
|
57
|
-
readonly occurredAt: string;
|
|
58
|
-
readonly values: Readonly<Record<string, string>>;
|
|
59
|
-
readonly recipients: readonly {
|
|
60
|
-
readonly id: string;
|
|
61
|
-
readonly address: EmailAddress;
|
|
62
|
-
}[];
|
|
63
|
-
}
|
|
64
|
-
export type EmailSourceRequest = EmailSenderContext & {
|
|
65
|
-
readonly sourceId: string;
|
|
66
|
-
};
|
|
67
|
-
/** Every operation must authorize its own scope. Resolution also verifies event/source ownership.
|
|
68
|
-
* No example-listing API: hosts may offer an authorized latest submission or a labeled sample. */
|
|
69
|
-
export interface EmailSender {
|
|
70
|
-
readonly id: string;
|
|
71
|
-
readonly label: string;
|
|
72
|
-
listSources(required: EmailSenderContext, optional?: Record<string, never>): Promise<readonly EmailSourceSummary[]>;
|
|
73
|
-
describeSource(required: EmailSourceRequest, optional?: Record<string, never>): Promise<EmailSourceDescription>;
|
|
74
|
-
resolveEvent(required: EmailSourceRequest & {
|
|
75
|
-
readonly eventId: string;
|
|
76
|
-
}, optional?: Record<string, never>): Promise<ResolvedEmailEvent>;
|
|
77
|
-
configureEmail(required: EmailSourceRequest & {
|
|
78
|
-
readonly binding: EmailBindingInput;
|
|
79
|
-
}, optional?: Record<string, never>): Promise<EmailBinding>;
|
|
80
|
-
}
|
|
81
|
-
/** Describe must report all placeholders, including those absent from the template declarations.
|
|
82
|
-
* Render must use send-safe rendering, supplied values only, and refuse a changed version. */
|
|
83
|
-
export interface EmailTemplatePort {
|
|
84
|
-
describe(required: EmailSenderContext & {
|
|
85
|
-
readonly templateId: string;
|
|
86
|
-
}, optional?: Record<string, never>): Promise<{
|
|
87
|
-
readonly version: string;
|
|
88
|
-
readonly fields: readonly string[];
|
|
89
|
-
readonly placeholders: readonly string[];
|
|
90
|
-
}>;
|
|
91
|
-
render(required: EmailSenderContext & {
|
|
92
|
-
readonly templateId: string;
|
|
93
|
-
readonly version: string;
|
|
94
|
-
readonly values: Readonly<Record<string, string>>;
|
|
95
|
-
}, optional?: Record<string, never>): Promise<{
|
|
96
|
-
readonly subject: string;
|
|
97
|
-
readonly html: string;
|
|
98
|
-
readonly text: string;
|
|
99
|
-
readonly missingFields: readonly string[];
|
|
100
|
-
}>;
|
|
101
|
-
}
|
|
102
|
-
/** Caller-safe failures never include event values, recipients or credentials. */
|
|
103
|
-
export declare class EmailSenderError extends Error {
|
|
104
|
-
readonly code: "forbidden" | "not_found" | "ownership" | "configuration" | "not_ready" | "incompatible" | "missing_value";
|
|
105
|
-
constructor(required: {
|
|
106
|
-
readonly code: EmailSenderError["code"];
|
|
107
|
-
}, _optional?: Record<string, never>);
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=email-sender.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Caller-safe failures never include event values, recipients or credentials. */
|
|
2
|
-
export class EmailSenderError extends Error {
|
|
3
|
-
code;
|
|
4
|
-
constructor(required, _optional = {}) {
|
|
5
|
-
super(`Email sender: ${required.code}`);
|
|
6
|
-
this.code = required.code;
|
|
7
|
-
this.name = "EmailSenderError";
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=email-sender.js.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/** Expand an IPv6 literal (with `::` compression and/or an embedded dotted
|
|
2
|
-
* IPv4 tail) into its eight 16-bit groups, or null if it does not parse.
|
|
3
|
-
* Node's URL parser normalizes mapped literals to hex (`::ffff:127.0.0.1` →
|
|
4
|
-
* `::ffff:7f00:1`), so a string regex can't reliably spot the mapped range —
|
|
5
|
-
* we have to canonicalize.
|
|
6
|
-
*
|
|
7
|
-
* Exported (previously module-private) so its parse-failure guards are
|
|
8
|
-
* directly unit-testable: the IP classifier and guarded client gate
|
|
9
|
-
* calls behind `net.isIP(addr) === 6`, and Node's `isIP` already fully
|
|
10
|
-
* validates IPv6 syntax (including embedded-IPv4-tail octet ranges) before
|
|
11
|
-
* returning 6 — empirically verified in the original extraction by fuzzing ~10k
|
|
12
|
-
* `isIP`-accepted v6 literals through this function's guards with zero
|
|
13
|
-
* hits — so none of these guards are reachable through that path. They stay
|
|
14
|
-
* as real defense-in-depth (fail closed with `null` rather than trust a
|
|
15
|
-
* platform primitive never changing behavior), matching the asset cache's
|
|
16
|
-
* exported-for-direct-testing precedent (`readBodyCapped`'s abort parameter). */
|
|
17
|
-
export declare function expandIpv6({ address: addr }: {
|
|
18
|
-
address: string;
|
|
19
|
-
}): number[] | null;
|
|
20
|
-
export type AddressClass = 'public' | 'private' | 'loopback' | 'link-local' | 'reserved';
|
|
21
|
-
/** Pure literal classifier; null means malformed input or a hostname requiring DNS. */
|
|
22
|
-
export declare function classifyAddressLiteral({ address }: {
|
|
23
|
-
address: string;
|
|
24
|
-
}, _options?: Record<string, never>): AddressClass | null;
|
|
25
|
-
/** True for localhost and literal loopback, including embedded IPv4 forms. */
|
|
26
|
-
export declare function isLoopbackApiHost({ hostname }: {
|
|
27
|
-
hostname: string;
|
|
28
|
-
}): boolean;
|
|
29
|
-
/** Private/reserved literal hosts are blocked; configured local servers keep their loopback exception. */
|
|
30
|
-
export declare function isBlockedExternalApiHostname({ hostname }: {
|
|
31
|
-
hostname: string;
|
|
32
|
-
}): boolean;
|
|
33
|
-
/** Literal policy for a hostname from a deployed endpoint URL: local names and reserved
|
|
34
|
-
* addresses are excluded. DNS reachability remains the deployment host's responsibility.
|
|
35
|
-
* @complexity O(hostname length), no DNS or other I/O. */
|
|
36
|
-
export declare function isDeployedApiHostname({ hostname }: {
|
|
37
|
-
hostname: string;
|
|
38
|
-
}, _optional?: Record<string, never>): boolean;
|
|
39
|
-
//# sourceMappingURL=endpoint-policy.d.ts.map
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-safe literal endpoint hostname policy. No Node imports or DNS effects:
|
|
3
|
-
* operator-configured local model servers deliberately keep their loopback
|
|
4
|
-
* exception. Resolved-peer validation and strict IP parsing belong to the Node
|
|
5
|
-
* adapters, whose different trust boundaries must not be collapsed into this.
|
|
6
|
-
* SSRF peer classification is distinct from core's browser-development LAN origin allow-list.
|
|
7
|
-
*/
|
|
8
|
-
function normalizeBracketedIpv6(hostname) {
|
|
9
|
-
const stripped = hostname.startsWith('[') && hostname.endsWith(']')
|
|
10
|
-
? hostname.slice(1, -1)
|
|
11
|
-
: hostname;
|
|
12
|
-
// FQDN trailing-dot form (RFC 1034) resolves identically to the dotless
|
|
13
|
-
// form, so `localhost.` must normalize to `localhost` before the equality
|
|
14
|
-
// check below — and `0.0.0.0.`, `10.0.0.1.`, etc. must normalize before
|
|
15
|
-
// the IPv4 classifier parses them. Strips one or more trailing dots.
|
|
16
|
-
// A scan rather than /\.+$/, which backtracks quadratically on long interior dot runs. This module
|
|
17
|
-
// stays import-free (see its contract test), so it does not use core's trimCharsEnd.
|
|
18
|
-
const lowered = stripped.toLowerCase();
|
|
19
|
-
let end = lowered.length;
|
|
20
|
-
while (end > 0 && lowered[end - 1] === '.')
|
|
21
|
-
end -= 1;
|
|
22
|
-
return lowered.slice(0, end);
|
|
23
|
-
}
|
|
24
|
-
function parseIpv4(hostname) {
|
|
25
|
-
const parts = hostname.split('.');
|
|
26
|
-
if (parts.length !== 4)
|
|
27
|
-
return null;
|
|
28
|
-
const parsed = parts.map((part) => {
|
|
29
|
-
if (!/^\d{1,3}$/.test(part))
|
|
30
|
-
return null;
|
|
31
|
-
const value = Number(part);
|
|
32
|
-
return value >= 0 && value <= 255 ? value : null;
|
|
33
|
-
});
|
|
34
|
-
if (parsed.some((part) => part === null))
|
|
35
|
-
return null;
|
|
36
|
-
return [parsed[0], parsed[1], parsed[2], parsed[3]];
|
|
37
|
-
}
|
|
38
|
-
/** Expand an IPv6 literal (with `::` compression and/or an embedded dotted
|
|
39
|
-
* IPv4 tail) into its eight 16-bit groups, or null if it does not parse.
|
|
40
|
-
* Node's URL parser normalizes mapped literals to hex (`::ffff:127.0.0.1` →
|
|
41
|
-
* `::ffff:7f00:1`), so a string regex can't reliably spot the mapped range —
|
|
42
|
-
* we have to canonicalize.
|
|
43
|
-
*
|
|
44
|
-
* Exported (previously module-private) so its parse-failure guards are
|
|
45
|
-
* directly unit-testable: the IP classifier and guarded client gate
|
|
46
|
-
* calls behind `net.isIP(addr) === 6`, and Node's `isIP` already fully
|
|
47
|
-
* validates IPv6 syntax (including embedded-IPv4-tail octet ranges) before
|
|
48
|
-
* returning 6 — empirically verified in the original extraction by fuzzing ~10k
|
|
49
|
-
* `isIP`-accepted v6 literals through this function's guards with zero
|
|
50
|
-
* hits — so none of these guards are reachable through that path. They stay
|
|
51
|
-
* as real defense-in-depth (fail closed with `null` rather than trust a
|
|
52
|
-
* platform primitive never changing behavior), matching the asset cache's
|
|
53
|
-
* exported-for-direct-testing precedent (`readBodyCapped`'s abort parameter). */
|
|
54
|
-
export function expandIpv6({ address: addr }) {
|
|
55
|
-
// `String#split` always returns a non-empty array, so index 0 is never
|
|
56
|
-
// `undefined` — the `!` narrows a `noUncheckedIndexedAccess` false
|
|
57
|
-
// positive, not a real fallback path.
|
|
58
|
-
const literal = addr.toLowerCase().split('%')[0];
|
|
59
|
-
if (!literal.includes(':'))
|
|
60
|
-
return null;
|
|
61
|
-
const s = foldIpv4Tail(literal);
|
|
62
|
-
if (s === null)
|
|
63
|
-
return null;
|
|
64
|
-
const halves = s.split('::');
|
|
65
|
-
if (halves.length > 2)
|
|
66
|
-
return null;
|
|
67
|
-
const parse = (p) => p === '' ? [] : p.split(':').map((g) => (/^[0-9a-f]{1,4}$/.test(g) ? parseInt(g, 16) : Number.NaN));
|
|
68
|
-
// `halves` always has at least one element (split guarantee).
|
|
69
|
-
const left = parse(halves[0]);
|
|
70
|
-
let groups;
|
|
71
|
-
if (halves.length === 1) {
|
|
72
|
-
groups = left;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
// `halves.length === 2` here (the `> 2` case already returned above).
|
|
76
|
-
const right = parse(halves[1]);
|
|
77
|
-
const fill = 8 - left.length - right.length;
|
|
78
|
-
if (fill < 1)
|
|
79
|
-
return null;
|
|
80
|
-
groups = [...left, ...Array.from({ length: fill }, () => 0), ...right];
|
|
81
|
-
}
|
|
82
|
-
if (!validIpv6Groups(groups))
|
|
83
|
-
return null;
|
|
84
|
-
return groups;
|
|
85
|
-
}
|
|
86
|
-
/** Fold a dotted tail while retaining the parser's defense-in-depth octet validation. */
|
|
87
|
-
function foldIpv4Tail(s) {
|
|
88
|
-
// Fold a trailing dotted IPv4 (`…:1.2.3.4`) into two hex groups.
|
|
89
|
-
const v4 = /^(.*:)(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/.exec(s);
|
|
90
|
-
if (v4) {
|
|
91
|
-
// `v4[2]` is the regex's second (mandatory, non-optional) capture group
|
|
92
|
-
// of a successful match — always defined.
|
|
93
|
-
const o = v4[2].split('.').map((n) => Number(n));
|
|
94
|
-
if (o.length !== 4 || o.some((n) => !Number.isInteger(n) || n < 0 || n > 255))
|
|
95
|
-
return null;
|
|
96
|
-
// `o` is now a validated 4-element array — indices 0-3 always defined.
|
|
97
|
-
const hi = ((o[0] << 8) | o[1]).toString(16);
|
|
98
|
-
const lo = ((o[2] << 8) | o[3]).toString(16);
|
|
99
|
-
s = `${v4[1]}${hi}:${lo}`;
|
|
100
|
-
}
|
|
101
|
-
return s;
|
|
102
|
-
}
|
|
103
|
-
function validIpv6Groups(groups) {
|
|
104
|
-
return groups.length === 8 && groups.every(g => Number.isInteger(g) && g >= 0 && g <= 0xffff);
|
|
105
|
-
}
|
|
106
|
-
/** Classifies validated IPv4 bytes; shared by native and embedded-v4 literals. */
|
|
107
|
-
function classifyIpv4Bytes(bytes) {
|
|
108
|
-
const [a, b] = bytes;
|
|
109
|
-
if (a === 127)
|
|
110
|
-
return 'loopback';
|
|
111
|
-
// This range includes the cloud metadata address 169.254.169.254.
|
|
112
|
-
if (a === 169 && b === 254)
|
|
113
|
-
return 'link-local';
|
|
114
|
-
if (a === 0 || a >= 224)
|
|
115
|
-
return 'reserved'; // "this" network / unspecified; multicast + reserved
|
|
116
|
-
// The remaining blocked IPv4 ranges include RFC 6598 shared carrier space (100.64.0.0/10):
|
|
117
|
-
// it is not globally routable and belongs with RFC 1918 private ranges for egress decisions.
|
|
118
|
-
if (isPrivateIpv4Bytes(bytes))
|
|
119
|
-
return 'private';
|
|
120
|
-
return 'public';
|
|
121
|
-
}
|
|
122
|
-
function isPrivateIpv4Bytes([a, b]) {
|
|
123
|
-
if (a === 100)
|
|
124
|
-
return b >= 64 && b <= 127;
|
|
125
|
-
if (a === 172)
|
|
126
|
-
return b >= 16 && b <= 31;
|
|
127
|
-
if (a === 192)
|
|
128
|
-
return b === 168;
|
|
129
|
-
return a === 10;
|
|
130
|
-
}
|
|
131
|
-
// Each /96 prefix carries IPv4 in the final four bytes. Matching canonical
|
|
132
|
-
// bytes also handles expanded IPv6 and WHATWG URL's dotted-to-hex normalization.
|
|
133
|
-
const EMBEDDED_IPV4_PREFIXES = [
|
|
134
|
-
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // compatible ::/96 (except native ::/::1)
|
|
135
|
-
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255], // mapped ::ffff:0:0/96
|
|
136
|
-
[0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0], // translated ::ffff:0:0:0/96
|
|
137
|
-
[0, 100, 255, 155, 0, 0, 0, 0, 0, 0, 0, 0], // well-known NAT64 64:ff9b::/96
|
|
138
|
-
];
|
|
139
|
-
function hasEmbeddedIpv4(bytes) {
|
|
140
|
-
return EMBEDDED_IPV4_PREFIXES.some(prefix => hasPrefix(bytes, prefix));
|
|
141
|
-
}
|
|
142
|
-
function hasPrefix(bytes, prefix) {
|
|
143
|
-
return prefix.every((byte, index) => bytes[index] === byte);
|
|
144
|
-
}
|
|
145
|
-
// Teredo 2001::/32 obfuscates its client IPv4, and local-use NAT64 64:ff9b:1::/48 may embed
|
|
146
|
-
// IPv4 at any prefix length, so neither can be classified by position: both are refused.
|
|
147
|
-
const UNCLASSIFIABLE_TUNNEL_PREFIXES = [
|
|
148
|
-
[0x20, 0x01, 0, 0], // Teredo 2001::/32
|
|
149
|
-
[0, 0x64, 0xff, 0x9b, 0, 1], // local-use NAT64 64:ff9b:1::/48
|
|
150
|
-
];
|
|
151
|
-
/** Tunnel prefixes that reach IPv4 without a fixed /96 tail; null means not a tunnel prefix. */
|
|
152
|
-
function classifyTunnelIpv6(bytes) {
|
|
153
|
-
// 6to4 2002::/16 carries its IPv4 in bytes 2-5; a host with a 6to4 route encapsulates to it.
|
|
154
|
-
if (hasPrefix(bytes, [0x20, 0x02]))
|
|
155
|
-
return classifyIpv4Bytes(bytes.slice(2, 6));
|
|
156
|
-
if (UNCLASSIFIABLE_TUNNEL_PREFIXES.some(prefix => hasPrefix(bytes, prefix)))
|
|
157
|
-
return 'reserved';
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
/** Classifies 16 IPv6 bytes, independent of compression or dotted/hex tail spelling. */
|
|
161
|
-
function classifyIpv6Bytes(bytes) {
|
|
162
|
-
// Native :: and ::1 retain their own meaning before the deprecated compatible-v4 range.
|
|
163
|
-
if (bytes.every(n => n === 0))
|
|
164
|
-
return 'reserved'; // :: (unspecified)
|
|
165
|
-
if (bytes.slice(0, 15).every(n => n === 0) && bytes[15] === 1)
|
|
166
|
-
return 'loopback';
|
|
167
|
-
// IPv4-mapped (::ffff:0:0/96) and deprecated IPv4-compatible (::/96)
|
|
168
|
-
// carry an embedded IPv4: classify its real range so ::ffff:7f00:1 is caught.
|
|
169
|
-
if (hasEmbeddedIpv4(bytes))
|
|
170
|
-
return classifyIpv4Bytes(bytes.slice(12));
|
|
171
|
-
const tunnel = classifyTunnelIpv6(bytes);
|
|
172
|
-
if (tunnel)
|
|
173
|
-
return tunnel;
|
|
174
|
-
if (bytes[0] === 255)
|
|
175
|
-
return 'reserved'; // multicast ff00::/8
|
|
176
|
-
const first = (bytes[0] << 8) | bytes[1];
|
|
177
|
-
if ((first & 0xffc0) === 0xfe80)
|
|
178
|
-
return 'link-local'; // fe80::/10 (fe80–febf)
|
|
179
|
-
if ((first & 0xfe00) === 0xfc00)
|
|
180
|
-
return 'private'; // unique-local fc00::/7
|
|
181
|
-
return 'public';
|
|
182
|
-
}
|
|
183
|
-
/** Pure literal classifier; null means malformed input or a hostname requiring DNS. */
|
|
184
|
-
export function classifyAddressLiteral({ address }, _options = {}) {
|
|
185
|
-
if (!address.includes(':')) {
|
|
186
|
-
const ipv4 = parseIpv4(address);
|
|
187
|
-
return ipv4 ? classifyIpv4Bytes(ipv4) : null;
|
|
188
|
-
}
|
|
189
|
-
const groups = expandIpv6({ address });
|
|
190
|
-
if (!groups)
|
|
191
|
-
return null;
|
|
192
|
-
// The parser's length/regex checks guarantee complete groups and bytes here;
|
|
193
|
-
// non-null assertions in byte classification narrow index types, not a runtime fallback.
|
|
194
|
-
// Parse once, then all range decisions operate on the same 16 canonical bytes.
|
|
195
|
-
const bytes = groups.flatMap(group => [group >> 8, group & 255]);
|
|
196
|
-
return classifyIpv6Bytes(bytes);
|
|
197
|
-
}
|
|
198
|
-
/** True for localhost and literal loopback, including embedded IPv4 forms. */
|
|
199
|
-
export function isLoopbackApiHost({ hostname }) {
|
|
200
|
-
const host = normalizeBracketedIpv6(hostname);
|
|
201
|
-
return host === 'localhost' || classifyAddressLiteral({ address: host }) === 'loopback';
|
|
202
|
-
}
|
|
203
|
-
/** Private/reserved literal hosts are blocked; configured local servers keep their loopback exception. */
|
|
204
|
-
export function isBlockedExternalApiHostname({ hostname }) {
|
|
205
|
-
const host = normalizeBracketedIpv6(hostname);
|
|
206
|
-
const addressClass = classifyAddressLiteral({ address: host });
|
|
207
|
-
return addressClass !== null && addressClass !== 'public' && addressClass !== 'loopback';
|
|
208
|
-
}
|
|
209
|
-
/** Literal policy for a hostname from a deployed endpoint URL: local names and reserved
|
|
210
|
-
* addresses are excluded. DNS reachability remains the deployment host's responsibility.
|
|
211
|
-
* @complexity O(hostname length), no DNS or other I/O. */
|
|
212
|
-
export function isDeployedApiHostname({ hostname }, _optional = {}) {
|
|
213
|
-
const host = normalizeBracketedIpv6(hostname);
|
|
214
|
-
if (isLoopbackApiHost({ hostname: host }) || isBlockedExternalApiHostname({ hostname: host }))
|
|
215
|
-
return false;
|
|
216
|
-
return !host.endsWith('.localhost') && !host.endsWith('.local');
|
|
217
|
-
}
|
|
218
|
-
//# sourceMappingURL=endpoint-policy.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { formatAad } from "../aad.js";
|
|
2
|
-
const AAD_VERSION = "v1";
|
|
3
|
-
/** Stable v1 AAD binding workspace, vendor, and credential identity. */
|
|
4
|
-
export function buildVendorCredentialAad(input) {
|
|
5
|
-
return formatAad({ kind: "vendor-credential-set", version: AAD_VERSION, parts: [input.workspaceId, input.vendorId, input.id] });
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=aad.js.map
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { VendorCredentialSetRecord, VendorCredentialSetRepoPort } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* @file `VendorCredentialSetRepoPort`'s in-memory adapter — the ADR-006 rule-of-two test double,
|
|
4
|
-
* mirroring `../deployments/publish-credentials/repo.memory.ts`'s shape byte-for-byte with
|
|
5
|
-
* `providerId` swapped for `vendorId`. See that file's own header for the full reasoning (row
|
|
6
|
-
* keying, the enforced UNIQUE constraint matching better-sqlite3's own error wording, why no
|
|
7
|
-
* explicit lock is needed for the `isDefault` group invariant in a single-threaded JS process).
|
|
8
|
-
*/
|
|
9
|
-
export declare class InMemoryVendorCredentialSetRepo implements VendorCredentialSetRepoPort {
|
|
10
|
-
constructor(_required: Record<string, never>, _optional?: Record<string, never>);
|
|
11
|
-
private readonly rows;
|
|
12
|
-
private static rowKey;
|
|
13
|
-
private assertLabelAvailable;
|
|
14
|
-
private clearOtherDefaults;
|
|
15
|
-
insert(record: VendorCredentialSetRecord, _optional?: Record<string, never>): Promise<void>;
|
|
16
|
-
update(record: VendorCredentialSetRecord, _optional?: Record<string, never>): Promise<void>;
|
|
17
|
-
findById(input: {
|
|
18
|
-
workspaceId: string;
|
|
19
|
-
id: string;
|
|
20
|
-
}, _optional?: Record<string, never>): Promise<VendorCredentialSetRecord | null>;
|
|
21
|
-
findDefaultByVendor(input: {
|
|
22
|
-
workspaceId: string;
|
|
23
|
-
vendorId: string;
|
|
24
|
-
}, _optional?: Record<string, never>): Promise<VendorCredentialSetRecord | null>;
|
|
25
|
-
listByVendor(input: {
|
|
26
|
-
workspaceId: string;
|
|
27
|
-
vendorId: string;
|
|
28
|
-
}, _optional?: Record<string, never>): Promise<VendorCredentialSetRecord[]>;
|
|
29
|
-
listByWorkspace(input: {
|
|
30
|
-
workspaceId: string;
|
|
31
|
-
}, _optional?: Record<string, never>): Promise<VendorCredentialSetRecord[]>;
|
|
32
|
-
delete(input: {
|
|
33
|
-
workspaceId: string;
|
|
34
|
-
id: string;
|
|
35
|
-
}, _optional?: Record<string, never>): Promise<void>;
|
|
36
|
-
/** Mirrors the SQLite adapter's targeted single-column write — see
|
|
37
|
-
* `VendorCredentialSetRepoPort.updateAccountLabel`'s own doc. No-op if the row vanished. */
|
|
38
|
-
updateAccountLabel(input: {
|
|
39
|
-
workspaceId: string;
|
|
40
|
-
id: string;
|
|
41
|
-
accountLabel: string;
|
|
42
|
-
}, _optional?: Record<string, never>): Promise<void>;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=repo.memory.d.ts.map
|