@deepraxis/sdk 0.2.0-dev.af2cf98 → 0.2.0-dev.bc5a12b

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/METHODS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SDK methods
2
2
 
3
- Generated by `bun run generate`. 970 HTTP operations, plus product aliases. Version segments and path parameters are omitted from resource names. Inputs use typed `{ path, query, body, headers }` options. Collections form nested resource objects; POST actions retain their verb. Naming rules are documented in `scripts/resources.ts`; semantic exceptions and aliases with reasons are in `scripts/naming-overrides.ts`.
3
+ Generated by `bun run generate`. 971 HTTP operations, plus product aliases. Version segments and path parameters are omitted from resource names. Inputs use typed `{ path, query, body, headers }` options. Collections form nested resource objects; POST actions retain their verb. Naming rules are documented in `scripts/resources.ts`; semantic exceptions and aliases with reasons are in `scripts/naming-overrides.ts`.
4
4
 
5
5
  `always` returns an AsyncIterable; `optional` streams with `{ stream: true }`; `yes` pagination returns a Page. Only `{ data, next_cursor }` + `cursor` query contracts are automatically paginated.
6
6
 
@@ -2121,6 +2121,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2121
2121
  | list | GET | `/organization/v1/notifications/letters` | no | no |
2122
2122
  | read | POST | `/organization/v1/notifications/letters/{id}:read` | no | no |
2123
2123
  | readAll | POST | `/organization/v1/notifications/letters:readAll` | no | no |
2124
+ | retrieve | GET | `/organization/v1/notifications/letters/{id}` | no | no |
2124
2125
 
2125
2126
  ### organization.notifications.organizationDefault
2126
2127
 
@@ -37,6 +37,8 @@ export async function fetchWithRetry(request, fetcher, options) {
37
37
  let response;
38
38
  try {
39
39
  // Preserve a replayable request; never reuse a consumed body on the next attempt.
40
+ // `Request` is generic over the request-init type (`Request<CfHostMetadata, Cf>` under the Workers types), which
41
+ // `RequestInfo` does not name; the clone is still the same request the platform accepts.
40
42
  response = await abortable(fetcher(request.clone()), options.signal);
41
43
  }
42
44
  catch (cause) {
@@ -7,9 +7,17 @@ import { isBinaryOperation } from "./binary-operations.js";
7
7
  import { envSilencesDeprecations } from "./deprecation.js";
8
8
  /** Our own per-call keys, beyond what the generated hey-api client accepts. */
9
9
  const SDK_OPTION_KEYS = ['timeoutMs', 'maxRetries', 'stream', 'lastEventId'];
10
- /** Every key of the generated client's per-call RequestOptions (request parts, fetch/RequestInit, serializers,
11
- * auth, SSE hooks, ...). Typed as a total record so a regenerated client that adds a key fails to typecheck here
12
- * until the key is classified, instead of being rejected at runtime by the guard below. */
10
+ /**
11
+ * Every key of the generated client's per-call RequestOptions (request parts, fetch/RequestInit, serializers,
12
+ * auth, SSE hooks, ...), classified by whether the guard below should accept it. The exhaustiveness check after the
13
+ * literal is what keeps this true: a regenerated client that adds a key leaves it out of `HeyApiOptionKey` and fails
14
+ * to typecheck here, instead of being rejected at runtime by the guard.
15
+ *
16
+ * Written as a plain literal plus a mapped assertion rather than as a `Record<keyof GeneratedRequestOptions, true>`:
17
+ * the generated type's key set differs with the compiler's lib (the Workers types add `cf`, hey-api's Config adds
18
+ * `fetcher` and `encodeResponseBody`), so a total Record literal is rejected as excess in one configuration and as
19
+ * incomplete in the other.
20
+ */
13
21
  const HEY_API_OPTION_KEYS = {
14
22
  body: true, path: true, query: true, headers: true, security: true, baseUrl: true, fetch: true, parseAs: true,
15
23
  responseStyle: true, throwOnError: true, auth: true, bodySerializer: true, querySerializer: true,
@@ -18,7 +26,11 @@ const HEY_API_OPTION_KEYS = {
18
26
  // Config extends RequestInit (minus body/headers/method).
19
27
  signal: true, cache: true, credentials: true, integrity: true, keepalive: true, mode: true, priority: true,
20
28
  redirect: true, referrer: true, referrerPolicy: true, window: true,
29
+ // hey-api's own transport hooks: the fetch implementation, the Workers `cf` bag and the body encoder.
30
+ fetcher: true, cf: true, encodeResponseBody: true,
21
31
  };
32
+ const classified = {};
33
+ void classified;
22
34
  const OPTION_KEYS = new Set([...Object.keys(HEY_API_OPTION_KEYS), ...SDK_OPTION_KEYS]);
23
35
  /** Client-side guard: flat params like `{ limit: 20 }` would otherwise be silently dropped by the generated client. */
24
36
  function assertKnownOptions(options) {