@provablehq/sdk 0.11.9 → 0.11.10

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.
Files changed (55) hide show
  1. package/dist/mainnet/account.d.cts +3 -3
  2. package/dist/mainnet/account.d.ts +3 -3
  3. package/dist/mainnet/api-auth.d.cts +14 -9
  4. package/dist/mainnet/api-auth.d.ts +14 -9
  5. package/dist/mainnet/browser.cjs +545 -191
  6. package/dist/mainnet/browser.cjs.map +1 -1
  7. package/dist/mainnet/browser.d.cts +1 -1
  8. package/dist/mainnet/browser.d.ts +1 -1
  9. package/dist/mainnet/browser.js +545 -192
  10. package/dist/mainnet/browser.js.map +1 -1
  11. package/dist/mainnet/keys/provider/interface.d.cts +4 -4
  12. package/dist/mainnet/keys/provider/interface.d.ts +4 -4
  13. package/dist/mainnet/keys/provider/memory.d.cts +6 -6
  14. package/dist/mainnet/keys/provider/memory.d.ts +6 -6
  15. package/dist/mainnet/keys/provider/offline.d.cts +1 -1
  16. package/dist/mainnet/keys/provider/offline.d.ts +1 -1
  17. package/dist/mainnet/network-client.d.cts +40 -38
  18. package/dist/mainnet/network-client.d.ts +40 -38
  19. package/dist/mainnet/node.cjs +1 -0
  20. package/dist/mainnet/node.cjs.map +1 -1
  21. package/dist/mainnet/node.js +1 -1
  22. package/dist/mainnet/program-manager.d.cts +132 -35
  23. package/dist/mainnet/program-manager.d.ts +132 -35
  24. package/dist/mainnet/record-provider.d.cts +7 -7
  25. package/dist/mainnet/record-provider.d.ts +7 -7
  26. package/dist/mainnet/record-scanner.d.cts +3 -3
  27. package/dist/mainnet/record-scanner.d.ts +3 -3
  28. package/dist/testnet/account.d.cts +3 -3
  29. package/dist/testnet/account.d.ts +3 -3
  30. package/dist/testnet/api-auth.d.cts +14 -9
  31. package/dist/testnet/api-auth.d.ts +14 -9
  32. package/dist/testnet/browser.cjs +545 -191
  33. package/dist/testnet/browser.cjs.map +1 -1
  34. package/dist/testnet/browser.d.cts +1 -1
  35. package/dist/testnet/browser.d.ts +1 -1
  36. package/dist/testnet/browser.js +545 -192
  37. package/dist/testnet/browser.js.map +1 -1
  38. package/dist/testnet/keys/provider/interface.d.cts +4 -4
  39. package/dist/testnet/keys/provider/interface.d.ts +4 -4
  40. package/dist/testnet/keys/provider/memory.d.cts +6 -6
  41. package/dist/testnet/keys/provider/memory.d.ts +6 -6
  42. package/dist/testnet/keys/provider/offline.d.cts +1 -1
  43. package/dist/testnet/keys/provider/offline.d.ts +1 -1
  44. package/dist/testnet/network-client.d.cts +40 -38
  45. package/dist/testnet/network-client.d.ts +40 -38
  46. package/dist/testnet/node.cjs +1 -0
  47. package/dist/testnet/node.cjs.map +1 -1
  48. package/dist/testnet/node.js +1 -1
  49. package/dist/testnet/program-manager.d.cts +132 -35
  50. package/dist/testnet/program-manager.d.ts +132 -35
  51. package/dist/testnet/record-provider.d.cts +7 -7
  52. package/dist/testnet/record-provider.d.ts +7 -7
  53. package/dist/testnet/record-scanner.d.cts +3 -3
  54. package/dist/testnet/record-scanner.d.ts +3 -3
  55. package/package.json +2 -2
@@ -14,15 +14,18 @@ export declare const DEFAULT_API_KEY_HEADER = "X-API-Key";
14
14
  /**
15
15
  * Authentication configuration for Provable API services.
16
16
  *
17
- * Two live modes exist, matching the two gateways:
18
- * - `jwt` (api.provable.com): the apiKey + consumerId pair mints a short-lived JWT at
19
- * `/jwts/{consumerId}` which is sent as an `Authorization` header and refreshed near expiry.
20
- * - `api-key` (edge.provable.com): a provisioned key is sent verbatim on every request in a
17
+ * The SDK targets edge.provable.com/api by default. That gateway is unauthenticated: it never
18
+ * mints or accepts JWTs, and a provisioned key is optional. The legacy api.provable.com gateway
19
+ * authenticates with JWTs. The modes map onto the gateways as follows:
20
+ * - `none`: requests carry no auth headers of their own. This is the default for edge, and
21
+ * nothing ever calls `/jwts`. A token injected via `setJwtData` is still sent — the
22
+ * session-driven pattern, where an external session owns minting and hands a fresh token in.
23
+ * - `api-key`: edge with a provisioned key. The key is sent verbatim on every request in a
21
24
  * header (default `X-API-Key`). There is no registration, minting, or refresh in this mode;
22
25
  * a 401 means the key is invalid or revoked and retrying cannot help.
23
- * - `none`: requests carry no auth headers of their own. A token injected via
24
- * `setJwtData` is still sent — the session-driven pattern, where an external
25
- * session owns minting and hands a fresh token in before each request.
26
+ * - `jwt`: api.provable.com. The apiKey + consumerId pair mints a short-lived JWT at
27
+ * `/jwts/{consumerId}` which is sent as an `Authorization` header and refreshed near expiry.
28
+ * Edge has no `/jwts` route, so do not point a `jwt` configuration at it.
26
29
  */
27
30
  export type ApiAuthConfig = {
28
31
  mode: "jwt";
@@ -52,10 +55,12 @@ export interface LegacyAuthOptions {
52
55
  /**
53
56
  * Normalize legacy auth options into an explicit {@link ApiAuthConfig}.
54
57
  *
55
- * Rules, preserving the pre-mode behavior of both clients:
58
+ * Rules:
56
59
  * - An explicit `auth` wins. Combining it with legacy fields throws — the caller's intent
57
60
  * is ambiguous and guessing hides misconfiguration.
58
- * - A string `apiKey` (with or without `consumerId`) or a bare `jwtData` selects `jwt` mode.
61
+ * - A string `apiKey` on its own selects `api-key` mode with the default header: nothing can
62
+ * mint a JWT without a `consumerId`, so a lone key is a provisioned edge key.
63
+ * - A string `apiKey` with a `consumerId`, or a bare `jwtData`, selects `jwt` mode.
59
64
  * - An `{ header, value }` apiKey selects `api-key` mode with that header. Combining it with
60
65
  * a `consumerId` throws: keyed auth has no consumer and the pair would silently pick one.
61
66
  * - Nothing configured selects `none`.
@@ -14,15 +14,18 @@ export declare const DEFAULT_API_KEY_HEADER = "X-API-Key";
14
14
  /**
15
15
  * Authentication configuration for Provable API services.
16
16
  *
17
- * Two live modes exist, matching the two gateways:
18
- * - `jwt` (api.provable.com): the apiKey + consumerId pair mints a short-lived JWT at
19
- * `/jwts/{consumerId}` which is sent as an `Authorization` header and refreshed near expiry.
20
- * - `api-key` (edge.provable.com): a provisioned key is sent verbatim on every request in a
17
+ * The SDK targets edge.provable.com/api by default. That gateway is unauthenticated: it never
18
+ * mints or accepts JWTs, and a provisioned key is optional. The legacy api.provable.com gateway
19
+ * authenticates with JWTs. The modes map onto the gateways as follows:
20
+ * - `none`: requests carry no auth headers of their own. This is the default for edge, and
21
+ * nothing ever calls `/jwts`. A token injected via `setJwtData` is still sent — the
22
+ * session-driven pattern, where an external session owns minting and hands a fresh token in.
23
+ * - `api-key`: edge with a provisioned key. The key is sent verbatim on every request in a
21
24
  * header (default `X-API-Key`). There is no registration, minting, or refresh in this mode;
22
25
  * a 401 means the key is invalid or revoked and retrying cannot help.
23
- * - `none`: requests carry no auth headers of their own. A token injected via
24
- * `setJwtData` is still sent — the session-driven pattern, where an external
25
- * session owns minting and hands a fresh token in before each request.
26
+ * - `jwt`: api.provable.com. The apiKey + consumerId pair mints a short-lived JWT at
27
+ * `/jwts/{consumerId}` which is sent as an `Authorization` header and refreshed near expiry.
28
+ * Edge has no `/jwts` route, so do not point a `jwt` configuration at it.
26
29
  */
27
30
  export type ApiAuthConfig = {
28
31
  mode: "jwt";
@@ -52,10 +55,12 @@ export interface LegacyAuthOptions {
52
55
  /**
53
56
  * Normalize legacy auth options into an explicit {@link ApiAuthConfig}.
54
57
  *
55
- * Rules, preserving the pre-mode behavior of both clients:
58
+ * Rules:
56
59
  * - An explicit `auth` wins. Combining it with legacy fields throws — the caller's intent
57
60
  * is ambiguous and guessing hides misconfiguration.
58
- * - A string `apiKey` (with or without `consumerId`) or a bare `jwtData` selects `jwt` mode.
61
+ * - A string `apiKey` on its own selects `api-key` mode with the default header: nothing can
62
+ * mint a JWT without a `consumerId`, so a lone key is a provisioned edge key.
63
+ * - A string `apiKey` with a `consumerId`, or a bare `jwtData`, selects `jwt` mode.
59
64
  * - An `{ header, value }` apiKey selects `api-key` mode with that header. Combining it with
60
65
  * a `consumerId` throws: keyed auth has no consumer and the pair would silently pick one.
61
66
  * - Nothing configured selects `none`.