@forgezero/providers 0.1.20 → 0.1.22

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 CHANGED
@@ -11,7 +11,7 @@ Send through whichever provider is up. Priority and failover, reordered live.
11
11
 
12
12
  ## Package overview
13
13
 
14
- Anyone calling somebody else's API who needs the failure classified rather than guessed. Provider capabilities stay independent from application-owned services, which attach named methods by priority with health tracking. Supported runtimes: bun, node, workers, deno. Package root: @forgezero/providers. The sections below show the actual named imports emitted by each declaration entry point; wildcard imports are intentionally not used in the documentation.
14
+ Anyone calling somebody else's API who needs the failure classified rather than guessed. Provider capabilities stay independent from application-owned services, which attach named methods by priority with health tracking. Supported runtimes: bun, node, workers, deno. Package root: @forgezero/providers. Consumer documentation is curated with each module's explicit public flag; the complete internal/export inventory remains in the typed SSOT and declaration files.
15
15
 
16
16
  ```text
17
17
  bun add @forgezero/providers
@@ -29,9 +29,9 @@ The five packages are installation boundaries. Choose a package by who installs
29
29
  | @forgezero/runtime | Portable runtime primitives for queries, jobs, events, schemas and finance. | bun, node | [Open](https://www.forgezero.net/docs/runtime) |
30
30
  | @forgezero/agent | Operator CLI and managed-node agent for bootstrap, deploy and lifecycle. | bun, node | [Open](https://www.forgezero.net/docs/agent) |
31
31
 
32
- ## @forgezero/providers public imports and commands
32
+ ## @forgezero/providers supported imports and commands
33
33
 
34
- Every row links to the detailed explanation and named-import/example area below. This table and those details are generated from the package inventory and emitted declarations.
34
+ These are supported consumer entry points, not every internal module shipped for ForgeZero managed installation. Each row links to its task-oriented usage.
35
35
 
36
36
  | public entry | short description | runtime | details |
37
37
  |---|---|---|---|
@@ -59,61 +59,11 @@ 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. This entry exposes 17 named value exports and 31 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
62
+ The registry: priority, health, and a terminal-versus-retryable verdict per failure. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
63
63
 
64
64
  ```text
65
65
  import {
66
66
  ProviderError,
67
- STRIKES_TO_OFFLINE,
68
- VERSION,
69
- chainCredentials,
70
- chainScopedCredentials,
71
- createRegistry,
72
- createService,
73
- defineProvider,
74
- defineProviderMethod,
75
- defineProviderMethodBranches,
76
- defineService,
77
- defineSingleMethodProvider,
78
- envCredentials,
79
- nextHealth,
80
- scopeCredentials,
81
- serviceMethod,
82
- staticConfig,
83
- } from '@forgezero/providers';
84
-
85
- import type {
86
- AnyProviderMethod,
87
- Attempt,
88
- CallOptions,
89
- CallResult,
90
- ConfigSource,
91
- CredentialSource,
92
- DirectAttempt,
93
- DirectCallResult,
94
- DirectServiceAttachment,
95
- DirectServiceConfig,
96
- DirectServiceOptions,
97
- EmailBatch,
98
- EmailBatchItemResult,
99
- EmailBatchResult,
100
- EmailMessage,
101
- FailureKind,
102
- InvokeContext,
103
- ProviderDefinition,
104
- ProviderHealth,
105
- ProviderInstanceConfig,
106
- ProviderMethodBranches,
107
- ProviderMethodEntry,
108
- ProviderMethodSpec,
109
- ProviderMethods,
110
- RegistryOptions,
111
- ScopedCredentialSource,
112
- ServiceDefinition,
113
- ServiceMethodAttachment,
114
- ServiceMethodContract,
115
- ServiceMethods,
116
- StaticRegistryConfig,
117
67
  } from '@forgezero/providers';
118
68
  ```
119
69
 
@@ -189,19 +139,11 @@ const credentials = chainScopedCredentials(
189
139
  <a id="forgezero-providers-email"></a>
190
140
  ## @forgezero/providers/email
191
141
 
192
- 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.
142
+ JetEmail (`send`, `sendBatch`), SMTP (`send` only), and the typed email service contract; SMTP transport is injected. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
193
143
 
194
144
  ```text
195
145
  import {
196
146
  emailProviders,
197
- emailService,
198
- jetemail,
199
- smtp,
200
- } from '@forgezero/providers/email';
201
-
202
- import type {
203
- JetEmailConfig,
204
- SmtpTransport,
205
147
  } from '@forgezero/providers/email';
206
148
  ```
207
149
 
@@ -250,27 +192,11 @@ console.log(outcome.result, outcome.attempts);
250
192
  <a id="forgezero-providers-database"></a>
251
193
  ## @forgezero/providers/database
252
194
 
253
- 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.
195
+ ArangoDB in the registry for credential rotation and health — with failover off by default. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
254
196
 
255
197
  ```text
256
198
  import {
257
199
  ARANGO_COMMUNITY_VERSION,
258
- ARANGO_SERVER_MODE_PATH,
259
- MAX_ARANGO_COORDINATORS,
260
- arangoCoordinatorUrls,
261
- arangodb,
262
- databaseProviders,
263
- resetPools,
264
- } from '@forgezero/providers/database';
265
-
266
- import type {
267
- ArangoConfig,
268
- ArangoConnectOptions,
269
- ArangoCoordinatorMember,
270
- ArangoLike,
271
- ArangoMembershipSnapshot,
272
- ArangoMembershipVerifier,
273
- Query,
274
200
  } from '@forgezero/providers/database';
275
201
  ```
276
202
 
@@ -289,27 +215,11 @@ export const selectedCapability = ARANGO_COMMUNITY_VERSION;
289
215
  <a id="forgezero-providers-http"></a>
290
216
  ## @forgezero/providers/http
291
217
 
292
- 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.
218
+ Outbound HTTP with a per-host weight budget reserved before the call and settled from the response. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
293
219
 
294
220
  ```text
295
221
  import {
296
222
  BudgetExhausted,
297
- binanceWeight,
298
- budgetState,
299
- createHttpClient,
300
- http,
301
- httpProviders,
302
- resetBudgets,
303
- settle,
304
- spend,
305
- } from '@forgezero/providers/http';
306
-
307
- import type {
308
- HostBudget,
309
- HttpClient,
310
- HttpConfig,
311
- HttpRequest,
312
- HttpResponse,
313
223
  } from '@forgezero/providers/http';
314
224
  ```
315
225
 
@@ -328,20 +238,11 @@ export const selectedCapability = BudgetExhausted;
328
238
  <a id="forgezero-providers-pool"></a>
329
239
  ## @forgezero/providers/pool
330
240
 
331
- 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.
241
+ Which outbound address a request leaves by, sticky per key, over the same budget as everything else. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
332
242
 
333
243
  ```text
334
244
  import {
335
245
  PoolEmpty,
336
- PoolExhausted,
337
- createAddressPool,
338
- } from '@forgezero/providers/pool';
339
-
340
- import type {
341
- AddressPool,
342
- Lease,
343
- PoolAddress,
344
- PoolOptions,
345
246
  } from '@forgezero/providers/pool';
346
247
  ```
347
248
 
@@ -360,19 +261,12 @@ export const selectedCapability = PoolEmpty;
360
261
  <a id="forgezero-providers-chain"></a>
361
262
  ## @forgezero/providers/chain
362
263
 
363
- 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.
264
+ An EVM node behind the same failover as any other service: read logs, broadcast, and never stop scanning because one endpoint rate-limited. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
364
265
 
365
266
  ```text
366
267
  import {
367
268
  evmRpc,
368
269
  } from '@forgezero/providers/chain';
369
-
370
- import type {
371
- ChainCall,
372
- ChainLog,
373
- ChainReceipt,
374
- ChainResult,
375
- } from '@forgezero/providers/chain';
376
270
  ```
377
271
 
378
272
  ## @forgezero/providers/chain — Use this entry point
@@ -390,19 +284,11 @@ export const selectedCapability = evmRpc;
390
284
  <a id="forgezero-providers-binance"></a>
391
285
  ## @forgezero/providers/binance
392
286
 
393
- 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.
287
+ Binance behind the venue adapter: three hosts, one weight budget, signed over the exact string that is sent. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
394
288
 
395
289
  ```text
396
290
  import {
397
291
  binanceSymbol,
398
- createBinanceAdapter,
399
- readBinanceError,
400
- toOrderStatus,
401
- } from '@forgezero/providers/binance';
402
-
403
- import type {
404
- BinanceCredentials,
405
- BinanceOptions,
406
292
  } from '@forgezero/providers/binance';
407
293
  ```
408
294
 
@@ -421,29 +307,11 @@ export const selectedCapability = binanceSymbol;
421
307
  <a id="forgezero-providers-storage"></a>
422
308
  ## @forgezero/providers/storage
423
309
 
424
- 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.
310
+ S3-compatible object storage, SigV4 signed with Web Crypto and no vendor SDK. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
425
311
 
426
312
  ```text
427
313
  import {
428
314
  MAX_SINGLE_PUT_BYTES,
429
- StorageError,
430
- amzDate,
431
- createS3Client,
432
- encodeSegment,
433
- parseListXml,
434
- s3,
435
- signRequest,
436
- storageProviders,
437
- } from '@forgezero/providers/storage';
438
-
439
- import type {
440
- ObjectSummary,
441
- PutObjectArgs,
442
- S3Client,
443
- S3Config,
444
- S3Credentials,
445
- SignedRequest,
446
- StorageRequest,
447
315
  } from '@forgezero/providers/storage';
448
316
  ```
449
317
 
@@ -462,20 +330,11 @@ export const selectedCapability = MAX_SINGLE_PUT_BYTES;
462
330
  <a id="forgezero-providers-translation"></a>
463
331
  ## @forgezero/providers/translation
464
332
 
465
- 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.
333
+ Google AI Studio translation with strict batch alignment and classified quota failures. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
466
334
 
467
335
  ```text
468
336
  import {
469
337
  TranslationError,
470
- googleAiStudio,
471
- parseStrings,
472
- translationProviders,
473
- } from '@forgezero/providers/translation';
474
-
475
- import type {
476
- TranslateRequest,
477
- TranslateResult,
478
- TranslationProvider,
479
338
  } from '@forgezero/providers/translation';
480
339
  ```
481
340
 
@@ -494,16 +353,11 @@ export const selectedCapability = TranslationError;
494
353
  <a id="forgezero-providers-realtime"></a>
495
354
  ## @forgezero/providers/realtime
496
355
 
497
- 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.
356
+ Cloudflare KV node-directory and Durable Object fan-out clients for project-defined realtime services. This is a supported entry point. Import only the named values used by the adjacent task example; the declaration file remains the complete API reference.
498
357
 
499
358
  ```text
500
359
  import {
501
360
  RealtimeProviderError,
502
- cloudflareRealtime,
503
- } from '@forgezero/providers/realtime';
504
-
505
- import type {
506
- RealtimeProviderOptions,
507
361
  } from '@forgezero/providers/realtime';
508
362
  ```
509
363
 
package/dist/binance.js CHANGED
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
336
336
  }
337
337
  };
338
338
  }
339
- var VERSION = "0.1.20";
339
+ var VERSION = "0.1.22";
340
340
 
341
341
  // src/http.ts
342
342
  class BudgetExhausted extends ProviderError {
package/dist/chain.js CHANGED
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
336
336
  }
337
337
  };
338
338
  }
339
- var VERSION = "0.1.20";
339
+ var VERSION = "0.1.22";
340
340
 
341
341
  // src/chain.ts
342
342
  var hexToNumber = (value) => Number(BigInt(value));
package/dist/database.js CHANGED
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
336
336
  }
337
337
  };
338
338
  }
339
- var VERSION = "0.1.20";
339
+ var VERSION = "0.1.22";
340
340
 
341
341
  // src/database.ts
342
342
  var pools = new Map;
package/dist/email.d.ts CHANGED
@@ -2,6 +2,10 @@ import { type EmailBatch, type EmailBatchResult, type EmailMessage } from './ind
2
2
  export interface JetEmailConfig {
3
3
  /** EU residency endpoint. */
4
4
  eu?: boolean;
5
+ /** Bare sender mailbox. JetEmail's wire API receives it as `Name <mailbox>`. */
6
+ from?: string;
7
+ /** Optional display name. Defaults to the sender mailbox local part. */
8
+ fromName?: string;
5
9
  endpoint?: string;
6
10
  batchEndpoint?: string;
7
11
  fetch?: typeof globalThis.fetch;
package/dist/email.js CHANGED
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
336
336
  }
337
337
  };
338
338
  }
339
- var VERSION = "0.1.20";
339
+ var VERSION = "0.1.22";
340
340
 
341
341
  // src/email.ts
342
342
  var recipients = (to) => Array.isArray(to) ? [...to] : [to];
@@ -348,6 +348,19 @@ function assertMessage(message) {
348
348
  throw new ProviderError("EMAIL_NO_BODY", "An email needs html, text, or both.");
349
349
  }
350
350
  }
351
+ var JETEMAIL_MAILBOX = /^[^\s<>@]+@[^\s<>@]+\.[^\s<>@]+$/;
352
+ function jetemailSender(config, override) {
353
+ const mailbox = (override ?? config.from ?? "").trim();
354
+ if (!JETEMAIL_MAILBOX.test(mailbox)) {
355
+ throw new ProviderError("JETEMAIL_FROM", "JetEmail needs a valid sender mailbox.");
356
+ }
357
+ const fallbackName = mailbox.slice(0, mailbox.indexOf("@"));
358
+ const name = (config.fromName ?? fallbackName).trim();
359
+ if (!name || /[\r\n<>]/.test(name)) {
360
+ throw new ProviderError("JETEMAIL_FROM_NAME", "JetEmail sender name must be non-empty and header-safe.");
361
+ }
362
+ return `${name} <${mailbox}>`;
363
+ }
351
364
  var jetemailCredentials = {
352
365
  type: "object",
353
366
  additionalProperties: false,
@@ -366,7 +379,8 @@ var jetemailConfig = {
366
379
  additionalProperties: false,
367
380
  properties: {
368
381
  eu: { type: "boolean", default: false, title: "EU residency" },
369
- from: { type: "string", format: "email", title: "Default from address" }
382
+ from: { type: "string", format: "email", title: "Default from address" },
383
+ fromName: { type: "string", minLength: 1, maxLength: 120, title: "Sender name" }
370
384
  }
371
385
  };
372
386
  var jetemailSend = defineProviderMethod({
@@ -386,7 +400,7 @@ var jetemailSend = defineProviderMethod({
386
400
  ...message.idempotencyKey ? { "idempotency-key": message.idempotencyKey } : {}
387
401
  },
388
402
  body: JSON.stringify({
389
- from: message.from ?? config.from,
403
+ from: jetemailSender(config, message.from),
390
404
  to: recipients(message.to),
391
405
  subject: message.subject,
392
406
  html: message.html,
@@ -395,7 +409,7 @@ var jetemailSend = defineProviderMethod({
395
409
  eu: config.eu ?? false
396
410
  })
397
411
  });
398
- if (response.status === 201 || response.status === 202) {
412
+ if (response.status === 200 || response.status === 201 || response.status === 202) {
399
413
  const payload = await response.json().catch(() => ({}));
400
414
  return { id: payload.id ?? "" };
401
415
  }
@@ -437,7 +451,7 @@ var jetemailSendBatch = defineProviderMethod({
437
451
  },
438
452
  body: JSON.stringify({
439
453
  emails: batch.emails.map((message) => ({
440
- from: message.from ?? config.from,
454
+ from: jetemailSender(config, message.from),
441
455
  to: recipients(message.to),
442
456
  subject: message.subject,
443
457
  html: message.html,
package/dist/http.js CHANGED
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
336
336
  }
337
337
  };
338
338
  }
339
- var VERSION = "0.1.20";
339
+ var VERSION = "0.1.22";
340
340
 
341
341
  // src/http.ts
342
342
  class BudgetExhausted extends ProviderError {
package/dist/index.d.ts CHANGED
@@ -303,5 +303,5 @@ export interface EmailBatchResult {
303
303
  };
304
304
  results: readonly EmailBatchItemResult[];
305
305
  }
306
- export declare const VERSION = "0.1.20";
306
+ export declare const VERSION = "0.1.22";
307
307
  export {};
package/dist/index.js CHANGED
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
336
336
  }
337
337
  };
338
338
  }
339
- var VERSION = "0.1.20";
339
+ var VERSION = "0.1.22";
340
340
  export {
341
341
  staticConfig,
342
342
  serviceMethod,
package/dist/pool.js CHANGED
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
336
336
  }
337
337
  };
338
338
  }
339
- var VERSION = "0.1.20";
339
+ var VERSION = "0.1.22";
340
340
 
341
341
  // src/http.ts
342
342
  class BudgetExhausted extends ProviderError {
package/dist/storage.js CHANGED
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
336
336
  }
337
337
  };
338
338
  }
339
- var VERSION = "0.1.20";
339
+ var VERSION = "0.1.22";
340
340
 
341
341
  // src/storage.ts
342
342
  var encoder = new TextEncoder;
@@ -336,7 +336,7 @@ function createService(definition, methods, options = {}) {
336
336
  }
337
337
  };
338
338
  }
339
- var VERSION = "0.1.20";
339
+ var VERSION = "0.1.22";
340
340
 
341
341
  // src/translation.ts
342
342
  var GOOGLE_ENDPOINT = "https://generativelanguage.googleapis.com/v1beta/models";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgezero/providers",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
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.13"
88
+ "@forgezero/runtime": "^0.1.14"
89
89
  }
90
90
  }