@forgezero/providers 0.1.13 → 0.1.14
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/README.md +222 -51
- package/dist/binance.js +1 -1
- package/dist/chain.js +1 -1
- package/dist/database.js +1 -1
- package/dist/email.js +1 -1
- package/dist/http.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/pool.js +1 -1
- package/dist/storage.js +1 -1
- package/dist/translation.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -59,17 +59,59 @@ bun test
|
|
|
59
59
|
<a id="forgezero-providers"></a>
|
|
60
60
|
## @forgezero/providers
|
|
61
61
|
|
|
62
|
-
The registry: priority, health, and a terminal-versus-retryable verdict per failure.
|
|
62
|
+
The registry: priority, health, and a terminal-versus-retryable verdict per failure. This entry exposes 16 named value exports and 29 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
|
-
import {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
import {
|
|
66
|
+
ProviderError,
|
|
67
|
+
STRIKES_TO_OFFLINE,
|
|
68
|
+
VERSION,
|
|
69
|
+
chainCredentials,
|
|
70
|
+
chainScopedCredentials,
|
|
71
|
+
createRegistry,
|
|
72
|
+
createService,
|
|
73
|
+
defineProvider,
|
|
74
|
+
defineProviderMethod,
|
|
75
|
+
defineService,
|
|
76
|
+
defineSingleMethodProvider,
|
|
77
|
+
envCredentials,
|
|
78
|
+
nextHealth,
|
|
79
|
+
scopeCredentials,
|
|
80
|
+
serviceMethod,
|
|
81
|
+
staticConfig,
|
|
82
|
+
} from '@forgezero/providers';
|
|
83
|
+
|
|
84
|
+
import type {
|
|
85
|
+
AnyProviderMethod,
|
|
86
|
+
Attempt,
|
|
87
|
+
CallOptions,
|
|
88
|
+
CallResult,
|
|
89
|
+
ConfigSource,
|
|
90
|
+
CredentialSource,
|
|
91
|
+
DirectAttempt,
|
|
92
|
+
DirectCallResult,
|
|
93
|
+
DirectServiceAttachment,
|
|
94
|
+
DirectServiceConfig,
|
|
95
|
+
DirectServiceOptions,
|
|
96
|
+
EmailBatch,
|
|
97
|
+
EmailBatchItemResult,
|
|
98
|
+
EmailBatchResult,
|
|
99
|
+
EmailMessage,
|
|
100
|
+
FailureKind,
|
|
101
|
+
InvokeContext,
|
|
102
|
+
ProviderDefinition,
|
|
103
|
+
ProviderHealth,
|
|
104
|
+
ProviderInstanceConfig,
|
|
105
|
+
ProviderMethodSpec,
|
|
106
|
+
ProviderMethods,
|
|
107
|
+
RegistryOptions,
|
|
108
|
+
ScopedCredentialSource,
|
|
109
|
+
ServiceDefinition,
|
|
110
|
+
ServiceMethodAttachment,
|
|
111
|
+
ServiceMethodContract,
|
|
112
|
+
ServiceMethods,
|
|
113
|
+
StaticRegistryConfig,
|
|
114
|
+
} from '@forgezero/providers';
|
|
73
115
|
```
|
|
74
116
|
|
|
75
117
|
## @forgezero/providers — Extend with a custom provider and service
|
|
@@ -77,9 +119,18 @@ import type { ServiceDefinition, ServiceMethodAttachment, ServiceMethodContract,
|
|
|
77
119
|
Public consumers define provider capabilities and application services independently, then attach them with the same ordered-array API.
|
|
78
120
|
|
|
79
121
|
```text
|
|
80
|
-
import {
|
|
81
|
-
|
|
82
|
-
|
|
122
|
+
import {
|
|
123
|
+
createService,
|
|
124
|
+
defineService,
|
|
125
|
+
defineSingleMethodProvider,
|
|
126
|
+
serviceMethod,
|
|
127
|
+
} from '@forgezero/providers';
|
|
128
|
+
import {
|
|
129
|
+
createVault,
|
|
130
|
+
} from '@forgezero/vault';
|
|
131
|
+
import {
|
|
132
|
+
vaultCredentials,
|
|
133
|
+
} from '@forgezero/vault/providers';
|
|
83
134
|
|
|
84
135
|
type Notice = { text: string };
|
|
85
136
|
type Receipt = { id: string };
|
|
@@ -111,9 +162,17 @@ const service = createService(notifications, {
|
|
|
111
162
|
Bootstrap tries the scoped Vault entry first and the identically named systemd credential second. If neither exists, the provider call fails.
|
|
112
163
|
|
|
113
164
|
```text
|
|
114
|
-
import {
|
|
115
|
-
|
|
116
|
-
|
|
165
|
+
import {
|
|
166
|
+
chainScopedCredentials,
|
|
167
|
+
scopeCredentials,
|
|
168
|
+
} from '@forgezero/providers';
|
|
169
|
+
import {
|
|
170
|
+
createVault,
|
|
171
|
+
systemdCredentials,
|
|
172
|
+
} from '@forgezero/vault';
|
|
173
|
+
import {
|
|
174
|
+
vaultCredentials,
|
|
175
|
+
} from '@forgezero/vault/providers';
|
|
117
176
|
|
|
118
177
|
const vault = createVault({ project: 'my-project', environment: 'production' });
|
|
119
178
|
const credentials = chainScopedCredentials(
|
|
@@ -127,11 +186,20 @@ const credentials = chainScopedCredentials(
|
|
|
127
186
|
<a id="forgezero-providers-email"></a>
|
|
128
187
|
## @forgezero/providers/email
|
|
129
188
|
|
|
130
|
-
JetEmail (`send`, `sendBatch`), SMTP (`send` only), and the typed email service contract; SMTP transport is injected.
|
|
189
|
+
JetEmail (`send`, `sendBatch`), SMTP (`send` only), and the typed email service contract; SMTP transport is injected. This entry exposes 4 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
131
190
|
|
|
132
191
|
```text
|
|
133
|
-
import {
|
|
134
|
-
|
|
192
|
+
import {
|
|
193
|
+
emailProviders,
|
|
194
|
+
emailService,
|
|
195
|
+
jetemail,
|
|
196
|
+
smtp,
|
|
197
|
+
} from '@forgezero/providers/email';
|
|
198
|
+
|
|
199
|
+
import type {
|
|
200
|
+
JetEmailConfig,
|
|
201
|
+
SmtpTransport,
|
|
202
|
+
} from '@forgezero/providers/email';
|
|
135
203
|
```
|
|
136
204
|
|
|
137
205
|
## @forgezero/providers/email — Email with ordered provider fallback
|
|
@@ -139,10 +207,22 @@ import type { JetEmailConfig, SmtpTransport } from '@forgezero/providers/email';
|
|
|
139
207
|
The service owns send/sendBatch. Attach provider methods directly in priority arrays; SMTP is never presented as batch-capable.
|
|
140
208
|
|
|
141
209
|
```text
|
|
142
|
-
import {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
210
|
+
import {
|
|
211
|
+
createService,
|
|
212
|
+
type EmailMessage,
|
|
213
|
+
} from '@forgezero/providers';
|
|
214
|
+
import {
|
|
215
|
+
emailService,
|
|
216
|
+
jetemail,
|
|
217
|
+
smtp,
|
|
218
|
+
type SmtpTransport,
|
|
219
|
+
} from '@forgezero/providers/email';
|
|
220
|
+
import {
|
|
221
|
+
createVault,
|
|
222
|
+
} from '@forgezero/vault';
|
|
223
|
+
import {
|
|
224
|
+
vaultCredentials,
|
|
225
|
+
} from '@forgezero/vault/providers';
|
|
146
226
|
|
|
147
227
|
// Adapt Nodemailer, Bun, or an HTTP SMTP relay once at the host boundary.
|
|
148
228
|
declare const transport: SmtpTransport;
|
|
@@ -167,86 +247,177 @@ console.log(outcome.result, outcome.attempts);
|
|
|
167
247
|
<a id="forgezero-providers-database"></a>
|
|
168
248
|
## @forgezero/providers/database
|
|
169
249
|
|
|
170
|
-
ArangoDB in the registry for credential rotation and health — with failover off by default.
|
|
250
|
+
ArangoDB in the registry for credential rotation and health — with failover off by default. This entry exposes 7 named value exports and 7 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
171
251
|
|
|
172
252
|
```text
|
|
173
|
-
import {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
253
|
+
import {
|
|
254
|
+
ARANGO_COMMUNITY_VERSION,
|
|
255
|
+
ARANGO_SERVER_MODE_PATH,
|
|
256
|
+
MAX_ARANGO_COORDINATORS,
|
|
257
|
+
arangoCoordinatorUrls,
|
|
258
|
+
arangodb,
|
|
259
|
+
databaseProviders,
|
|
260
|
+
resetPools,
|
|
261
|
+
} from '@forgezero/providers/database';
|
|
262
|
+
|
|
263
|
+
import type {
|
|
264
|
+
ArangoConfig,
|
|
265
|
+
ArangoConnectOptions,
|
|
266
|
+
ArangoCoordinatorMember,
|
|
267
|
+
ArangoLike,
|
|
268
|
+
ArangoMembershipSnapshot,
|
|
269
|
+
ArangoMembershipVerifier,
|
|
270
|
+
Query,
|
|
271
|
+
} from '@forgezero/providers/database';
|
|
177
272
|
```
|
|
178
273
|
|
|
179
274
|
<a id="forgezero-providers-http"></a>
|
|
180
275
|
## @forgezero/providers/http
|
|
181
276
|
|
|
182
|
-
Outbound HTTP with a per-host weight budget reserved before the call and settled from the response.
|
|
277
|
+
Outbound HTTP with a per-host weight budget reserved before the call and settled from the response. This entry exposes 9 named value exports and 5 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
183
278
|
|
|
184
279
|
```text
|
|
185
|
-
import {
|
|
186
|
-
|
|
187
|
-
|
|
280
|
+
import {
|
|
281
|
+
BudgetExhausted,
|
|
282
|
+
binanceWeight,
|
|
283
|
+
budgetState,
|
|
284
|
+
createHttpClient,
|
|
285
|
+
http,
|
|
286
|
+
httpProviders,
|
|
287
|
+
resetBudgets,
|
|
288
|
+
settle,
|
|
289
|
+
spend,
|
|
290
|
+
} from '@forgezero/providers/http';
|
|
291
|
+
|
|
292
|
+
import type {
|
|
293
|
+
HostBudget,
|
|
294
|
+
HttpClient,
|
|
295
|
+
HttpConfig,
|
|
296
|
+
HttpRequest,
|
|
297
|
+
HttpResponse,
|
|
298
|
+
} from '@forgezero/providers/http';
|
|
188
299
|
```
|
|
189
300
|
|
|
190
301
|
<a id="forgezero-providers-pool"></a>
|
|
191
302
|
## @forgezero/providers/pool
|
|
192
303
|
|
|
193
|
-
Which outbound address a request leaves by, sticky per key, over the same budget as everything else.
|
|
304
|
+
Which outbound address a request leaves by, sticky per key, over the same budget as everything else. This entry exposes 3 named value exports and 4 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
194
305
|
|
|
195
306
|
```text
|
|
196
|
-
import {
|
|
197
|
-
|
|
307
|
+
import {
|
|
308
|
+
PoolEmpty,
|
|
309
|
+
PoolExhausted,
|
|
310
|
+
createAddressPool,
|
|
311
|
+
} from '@forgezero/providers/pool';
|
|
312
|
+
|
|
313
|
+
import type {
|
|
314
|
+
AddressPool,
|
|
315
|
+
Lease,
|
|
316
|
+
PoolAddress,
|
|
317
|
+
PoolOptions,
|
|
318
|
+
} from '@forgezero/providers/pool';
|
|
198
319
|
```
|
|
199
320
|
|
|
200
321
|
<a id="forgezero-providers-chain"></a>
|
|
201
322
|
## @forgezero/providers/chain
|
|
202
323
|
|
|
203
|
-
An EVM node behind the same failover as any other service: read logs, broadcast, and never stop scanning because one endpoint rate-limited.
|
|
324
|
+
An EVM node behind the same failover as any other service: read logs, broadcast, and never stop scanning because one endpoint rate-limited. This entry exposes 1 named value export and 4 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
204
325
|
|
|
205
326
|
```text
|
|
206
|
-
import {
|
|
207
|
-
|
|
327
|
+
import {
|
|
328
|
+
evmRpc,
|
|
329
|
+
} from '@forgezero/providers/chain';
|
|
330
|
+
|
|
331
|
+
import type {
|
|
332
|
+
ChainCall,
|
|
333
|
+
ChainLog,
|
|
334
|
+
ChainReceipt,
|
|
335
|
+
ChainResult,
|
|
336
|
+
} from '@forgezero/providers/chain';
|
|
208
337
|
```
|
|
209
338
|
|
|
210
339
|
<a id="forgezero-providers-binance"></a>
|
|
211
340
|
## @forgezero/providers/binance
|
|
212
341
|
|
|
213
|
-
Binance behind the venue adapter: three hosts, one weight budget, signed over the exact string that is sent.
|
|
342
|
+
Binance behind the venue adapter: three hosts, one weight budget, signed over the exact string that is sent. This entry exposes 4 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
214
343
|
|
|
215
344
|
```text
|
|
216
|
-
import {
|
|
217
|
-
|
|
345
|
+
import {
|
|
346
|
+
binanceSymbol,
|
|
347
|
+
createBinanceAdapter,
|
|
348
|
+
readBinanceError,
|
|
349
|
+
toOrderStatus,
|
|
350
|
+
} from '@forgezero/providers/binance';
|
|
351
|
+
|
|
352
|
+
import type {
|
|
353
|
+
BinanceCredentials,
|
|
354
|
+
BinanceOptions,
|
|
355
|
+
} from '@forgezero/providers/binance';
|
|
218
356
|
```
|
|
219
357
|
|
|
220
358
|
<a id="forgezero-providers-storage"></a>
|
|
221
359
|
## @forgezero/providers/storage
|
|
222
360
|
|
|
223
|
-
S3-compatible object storage, SigV4 signed with Web Crypto and no vendor SDK.
|
|
361
|
+
S3-compatible object storage, SigV4 signed with Web Crypto and no vendor SDK. This entry exposes 9 named value exports and 7 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
224
362
|
|
|
225
363
|
```text
|
|
226
|
-
import {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
364
|
+
import {
|
|
365
|
+
MAX_SINGLE_PUT_BYTES,
|
|
366
|
+
StorageError,
|
|
367
|
+
amzDate,
|
|
368
|
+
createS3Client,
|
|
369
|
+
encodeSegment,
|
|
370
|
+
parseListXml,
|
|
371
|
+
s3,
|
|
372
|
+
signRequest,
|
|
373
|
+
storageProviders,
|
|
374
|
+
} from '@forgezero/providers/storage';
|
|
375
|
+
|
|
376
|
+
import type {
|
|
377
|
+
ObjectSummary,
|
|
378
|
+
PutObjectArgs,
|
|
379
|
+
S3Client,
|
|
380
|
+
S3Config,
|
|
381
|
+
S3Credentials,
|
|
382
|
+
SignedRequest,
|
|
383
|
+
StorageRequest,
|
|
384
|
+
} from '@forgezero/providers/storage';
|
|
230
385
|
```
|
|
231
386
|
|
|
232
387
|
<a id="forgezero-providers-translation"></a>
|
|
233
388
|
## @forgezero/providers/translation
|
|
234
389
|
|
|
235
|
-
Google AI Studio translation with strict batch alignment and classified quota failures.
|
|
390
|
+
Google AI Studio translation with strict batch alignment and classified quota failures. This entry exposes 4 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
236
391
|
|
|
237
392
|
```text
|
|
238
|
-
import {
|
|
239
|
-
|
|
393
|
+
import {
|
|
394
|
+
TranslationError,
|
|
395
|
+
googleAiStudio,
|
|
396
|
+
parseStrings,
|
|
397
|
+
translationProviders,
|
|
398
|
+
} from '@forgezero/providers/translation';
|
|
399
|
+
|
|
400
|
+
import type {
|
|
401
|
+
TranslateRequest,
|
|
402
|
+
TranslateResult,
|
|
403
|
+
TranslationProvider,
|
|
404
|
+
} from '@forgezero/providers/translation';
|
|
240
405
|
```
|
|
241
406
|
|
|
242
407
|
<a id="forgezero-providers-realtime"></a>
|
|
243
408
|
## @forgezero/providers/realtime
|
|
244
409
|
|
|
245
|
-
Cloudflare KV node-directory and Durable Object fan-out clients for project-defined realtime services.
|
|
410
|
+
Cloudflare KV node-directory and Durable Object fan-out clients for project-defined realtime services. This entry exposes 2 named value exports and 1 named type export. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
|
|
246
411
|
|
|
247
412
|
```text
|
|
248
|
-
import {
|
|
249
|
-
|
|
413
|
+
import {
|
|
414
|
+
RealtimeProviderError,
|
|
415
|
+
cloudflareRealtime,
|
|
416
|
+
} from '@forgezero/providers/realtime';
|
|
417
|
+
|
|
418
|
+
import type {
|
|
419
|
+
RealtimeProviderOptions,
|
|
420
|
+
} from '@forgezero/providers/realtime';
|
|
250
421
|
```
|
|
251
422
|
|
|
252
423
|
## Built-in provider capabilities
|
package/dist/binance.js
CHANGED
package/dist/chain.js
CHANGED
package/dist/database.js
CHANGED
package/dist/email.js
CHANGED
package/dist/http.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/pool.js
CHANGED
package/dist/storage.js
CHANGED
package/dist/translation.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgezero/providers",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -85,6 +85,6 @@
|
|
|
85
85
|
"LICENSE"
|
|
86
86
|
],
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@forgezero/runtime": "^0.1.
|
|
88
|
+
"@forgezero/runtime": "^0.1.9"
|
|
89
89
|
}
|
|
90
90
|
}
|