@prdb/sdk 0.3.0 → 0.4.0

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
@@ -8,7 +8,7 @@ TypeScript client for the [prdb Public API](https://apidocs.prdb.net/).
8
8
  npm install @prdb/sdk
9
9
  ```
10
10
 
11
- Requires Node 20 or newer. The package is ESM-only and ships type declarations.
11
+ Requires Node 22 or newer. The package is ESM-only and ships type declarations.
12
12
 
13
13
  ## Usage
14
14
 
@@ -89,6 +89,45 @@ const client = createClient({
89
89
  });
90
90
  ```
91
91
 
92
+ ## Reading the response status
93
+
94
+ A typed call returns the deserialised body, which is all you need until an
95
+ operation answers with more than one success status. `POST
96
+ /downloaded-from-indexers` is the one that does: **201** when it created the
97
+ entry, **200** when an equivalent one already existed and is being returned
98
+ unchanged. The bodies are the same shape, so the status is the only thing that
99
+ tells the two apart.
100
+
101
+ Pass a `ResponseStatusOption` to read it:
102
+
103
+ ```ts
104
+ import { ResponseStatusOption } from "@prdb/sdk";
105
+
106
+ const status = new ResponseStatusOption();
107
+
108
+ const entry = await client.downloadedFromIndexers.post(body, {
109
+ options: [status],
110
+ });
111
+
112
+ if (status.statusCode === 200) {
113
+ // An equivalent entry already existed; entry is the one the API has.
114
+ }
115
+ ```
116
+
117
+ Kiota's own native response handler cannot serve this: it surfaces the raw
118
+ `Response` but suppresses deserialisation while doing so, so the typed result
119
+ comes back `undefined`. The option is the other half — the call returns its
120
+ model as usual, and the status is on the option afterwards.
121
+
122
+ Use one instance per call. It is written when the response arrives, so sharing
123
+ one across concurrent calls means whichever finishes last wins.
124
+
125
+ The status recorded is the one the result was built from: after a redirect the
126
+ SDK followed, and after the last retry. A call that rejects records too, so an
127
+ error caught from a `403` still has its status alongside. It stays `undefined`
128
+ when no response was reached at all — a failed connection, a timeout, or a
129
+ refused cross-origin redirect.
130
+
92
131
  ## Generated code
93
132
 
94
133
  Everything under `src/generated/` is produced by Kiota from `spec/openapi.json`
package/dist/index.d.ts CHANGED
@@ -1,3 +1,20 @@
1
+ /**
2
+ * TypeScript SDK for the prdb Public API.
3
+ *
4
+ * The request builders mirror the API's URL structure:
5
+ *
6
+ * ```ts
7
+ * import { createClient } from "@prdb/sdk";
8
+ *
9
+ * const client = createClient({ apiKey: "..." });
10
+ * const page = await client.videos.get();
11
+ * const video = await client.videos.byId(videoId).get();
12
+ * ```
13
+ *
14
+ * Everything under `./generated` is produced by Kiota from `spec/openapi.json`
15
+ * and is overwritten on every regeneration. Do not edit it.
16
+ */
17
+ import { type RequestOption } from "@microsoft/kiota-abstractions";
1
18
  import { type PrdbClient } from "./generated/prdbClient.js";
2
19
  /** Header the API expects the key in. */
3
20
  export declare const API_KEY_HEADER = "X-Api-Key";
@@ -15,6 +32,53 @@ export type FetchLike = (url: string, init: RequestInit) => Promise<Response>;
15
32
  export declare class CrossOriginRedirectError extends Error {
16
33
  constructor(originalUrl: string, newUrl: string);
17
34
  }
35
+ /** Key the {@link ResponseStatusOption} travels under. */
36
+ export declare const RESPONSE_STATUS_OPTION_KEY = "prdb.responseStatus";
37
+ /**
38
+ * Per-request option reporting which status code the API answered with.
39
+ *
40
+ * A generated method returns the deserialised body and nothing else, which is a
41
+ * problem when an operation answers with more than one success status. `POST
42
+ * /downloaded-from-indexers` is the one that does: `201` when it created the
43
+ * entry, `200` when an equivalent one already existed and is being returned
44
+ * unchanged. The bodies are the same shape, so the status is the only thing
45
+ * that tells the two apart.
46
+ *
47
+ * Kiota's own way of reaching the response is a native response handler, which
48
+ * suppresses deserialisation while it does so — you get the raw response or the
49
+ * typed model, never both. This option is the other half: the call returns its
50
+ * model as usual, and the status is here afterwards.
51
+ *
52
+ * ```ts
53
+ * const status = new ResponseStatusOption();
54
+ *
55
+ * const entry = await client.downloadedFromIndexers.post(body, {
56
+ * options: [status],
57
+ * });
58
+ *
59
+ * if (status.statusCode === 200) {
60
+ * // An equivalent entry already existed and was returned unchanged.
61
+ * }
62
+ * ```
63
+ *
64
+ * Use one instance per call: it is written when the response arrives, so
65
+ * sharing one across concurrent calls means whichever finishes last wins.
66
+ *
67
+ * The status recorded is the one of the response the result was built from —
68
+ * after any redirect the SDK followed, and after the last retry. A call that
69
+ * rejects records too, so the status is there for a caller that catches the
70
+ * error.
71
+ */
72
+ export declare class ResponseStatusOption implements RequestOption {
73
+ /**
74
+ * The status the API answered with, or `undefined` until the call has
75
+ * produced a response — and for good if none was reached at all, as with a
76
+ * connection failure or a redirect refused by
77
+ * {@link CrossOriginRedirectError}.
78
+ */
79
+ statusCode?: number;
80
+ getKey(): string;
81
+ }
18
82
  /**
19
83
  * How the SDK retries a request the API refused with 429, 503 or 504.
20
84
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE9E,yCAAyC;AACzC,eAAO,MAAM,cAAc,cAAc,CAAC;AAE1C,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,yEAAyE;AACzE,MAAM,MAAM,SAAS,GAAG,CACvB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,WAAW,KACb,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBACtC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAO/C;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,8EAA8E;AAC9E,eAAO,MAAM,cAAc,EAAE,YAAgC,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC7B,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAA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;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,8EAA8E;AAC9E,eAAO,MAAM,cAAc,EAAE,YAAgC,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC7B,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAEnE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,UAAU,CAiB/D;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,GAAE,sBAA2B,GAClC,UAAU,CAUZ;AAuKD,YAAY,EAAE,UAAU,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -36,6 +36,80 @@ export class CrossOriginRedirectError extends Error {
36
36
  this.name = "CrossOriginRedirectError";
37
37
  }
38
38
  }
39
+ /** Key the {@link ResponseStatusOption} travels under. */
40
+ export const RESPONSE_STATUS_OPTION_KEY = "prdb.responseStatus";
41
+ /**
42
+ * Per-request option reporting which status code the API answered with.
43
+ *
44
+ * A generated method returns the deserialised body and nothing else, which is a
45
+ * problem when an operation answers with more than one success status. `POST
46
+ * /downloaded-from-indexers` is the one that does: `201` when it created the
47
+ * entry, `200` when an equivalent one already existed and is being returned
48
+ * unchanged. The bodies are the same shape, so the status is the only thing
49
+ * that tells the two apart.
50
+ *
51
+ * Kiota's own way of reaching the response is a native response handler, which
52
+ * suppresses deserialisation while it does so — you get the raw response or the
53
+ * typed model, never both. This option is the other half: the call returns its
54
+ * model as usual, and the status is here afterwards.
55
+ *
56
+ * ```ts
57
+ * const status = new ResponseStatusOption();
58
+ *
59
+ * const entry = await client.downloadedFromIndexers.post(body, {
60
+ * options: [status],
61
+ * });
62
+ *
63
+ * if (status.statusCode === 200) {
64
+ * // An equivalent entry already existed and was returned unchanged.
65
+ * }
66
+ * ```
67
+ *
68
+ * Use one instance per call: it is written when the response arrives, so
69
+ * sharing one across concurrent calls means whichever finishes last wins.
70
+ *
71
+ * The status recorded is the one of the response the result was built from —
72
+ * after any redirect the SDK followed, and after the last retry. A call that
73
+ * rejects records too, so the status is there for a caller that catches the
74
+ * error.
75
+ */
76
+ export class ResponseStatusOption {
77
+ /**
78
+ * The status the API answered with, or `undefined` until the call has
79
+ * produced a response — and for good if none was reached at all, as with a
80
+ * connection failure or a redirect refused by
81
+ * {@link CrossOriginRedirectError}.
82
+ */
83
+ statusCode;
84
+ getKey() {
85
+ return RESPONSE_STATUS_OPTION_KEY;
86
+ }
87
+ }
88
+ /**
89
+ * Records the response status into the {@link ResponseStatusOption} a request
90
+ * carries.
91
+ *
92
+ * Sits at the outer end of the SDK's pipeline, above the retry and redirect
93
+ * handlers, so what it records is the response the caller's result is built
94
+ * from rather than an attempt on the way there.
95
+ */
96
+ class ResponseStatusHandler {
97
+ next;
98
+ async execute(url, requestInit, requestOptions) {
99
+ if (!this.next) {
100
+ throw new Error("next middleware is undefined.");
101
+ }
102
+ const response = await this.next.execute(url, requestInit, requestOptions);
103
+ // Matched by key rather than `instanceof`: the key is ours alone, and two
104
+ // copies of this package in one dependency tree would still agree on it
105
+ // where a class identity check would not.
106
+ const option = requestOptions?.[RESPONSE_STATUS_OPTION_KEY];
107
+ if (option) {
108
+ option.statusCode = response.status;
109
+ }
110
+ return response;
111
+ }
112
+ }
39
113
  /** No retrying at all: a 429 or 503 reaches the caller as the API sent it. */
40
114
  export const RETRY_DISABLED = { maxRetries: 0 };
41
115
  /**
@@ -96,6 +170,10 @@ function buildHttpClient(customFetch, retry) {
96
170
  if (retry) {
97
171
  middlewares = applyRetryOptions(middlewares, retry);
98
172
  }
173
+ // First in the list is outermost, which puts it above the retry and redirect
174
+ // handlers: the status it records is the one the caller's result was built
175
+ // from, not that of an attempt on the way there.
176
+ middlewares = [new ResponseStatusHandler(), ...middlewares];
99
177
  return KiotaClientFactory.create(customFetch, middlewares);
100
178
  }
101
179
  /**
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACN,+BAA+B,EAC/B,4BAA4B,EAC5B,cAAc,GACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAEN,kBAAkB,EAElB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAmB,MAAM,2BAA2B,CAAC;AAE9E,yCAAyC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAQvD;;;;;;GAMG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAClD,YAAY,WAAmB,EAAE,MAAc;QAC9C,KAAK,CACJ,sCAAsC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,MAAM;YACpE,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,0CAA0C,CAClE,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACxC,CAAC;CACD;AA+BD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,cAAc,GAAiB,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;AA0B9D;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAsB;IAClD,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,g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CAAC,WAAW,EAAE;YACtC,KAAK,KAAK,eAAe;YACzB,KAAK,KAAK,QAAQ;YAClB,KAAK,KAAK,qBAAqB,EAC9B,CAAC;YACF,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;IACF,CAAC;IAED,MAAM,IAAI,wBAAwB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,MAAM,CACd,OAAe,EACf,EAAE,YAAY,EAA6B;IAE3C,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACJ,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,wCAAwC,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAAE,CAAC;QAC1E,MAAM,IAAI,KAAK,CAAC,wCAAwC,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,YAAY,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CACd,uEAAuE,OAAO,EAAE,CAChF,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prdb/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript SDK for the prdb Public API",
5
5
  "license": "MIT",
6
6
  "repository": {