@goable-io/sdk 0.1.0 → 0.2.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/src/index.ts CHANGED
@@ -9,11 +9,11 @@
9
9
  * })
10
10
  */
11
11
 
12
- export { GoableClient } from "./client.js"
13
- export type { FetchLike, GoableClientOptions } from "./client.js"
12
+ export { GoableClient } from "./client.ts"
13
+ export type { FetchLike, GoableClientOptions } from "./client.ts"
14
14
  export {
15
15
  GoableApiError,
16
16
  GoableNetworkError,
17
17
  type ZodIssueLike,
18
- } from "./errors.js"
19
- export type * from "./types.js"
18
+ } from "./errors.ts"
19
+ export type * from "./types.ts"
package/src/types.ts CHANGED
@@ -8,18 +8,14 @@
8
8
  * nicely (`ScoreRequest`, `ScoreResponse`) instead of deep index chains.
9
9
  */
10
10
 
11
- import type { components, paths } from "./generated/api.js"
11
+ import type { components, paths } from "./generated/api.ts"
12
12
 
13
13
  // ── helpers ────────────────────────────────────────────────────────────
14
14
  type JsonOf<T> = T extends { content: { "application/json": infer B } } ? B : never
15
15
  /** application/json request body of an operation. */
16
16
  type ReqOf<O> = O extends { requestBody?: infer RB } ? JsonOf<NonNullable<RB>> : never
17
17
  /** application/json body of a response status code. */
18
- type ResOf<O, C extends number> = O extends { responses: infer R }
19
- ? C extends keyof R
20
- ? JsonOf<R[C]>
21
- : never
22
- : never
18
+ type ResOf<O, C extends number> = O extends { responses: infer R } ? (C extends keyof R ? JsonOf<R[C]> : never) : never
23
19
 
24
20
  type Post<P extends keyof paths> = paths[P] extends { post: infer O } ? O : never
25
21
 
@@ -62,16 +58,26 @@ export type ProjectionsResponse = ResOf<Post<"/v1/projections">, 200>
62
58
  export type QuoteRequest = ReqOf<Post<"/v1/underwriting/quote">>
63
59
  export type QuoteResponse = ResOf<Post<"/v1/underwriting/quote">, 200>
64
60
 
61
+ export type RecommendSpotRequest = ReqOf<Post<"/v1/recommend-spot">>
62
+ export type RecommendSpotResponse = ResOf<Post<"/v1/recommend-spot">, 200>
63
+
65
64
  export type HealthResponse = ResOf<paths["/v1/health"] extends { get: infer O } ? O : never, 200>
66
65
 
67
66
  // ── SDK-specific result types (not wire schemas) ─────────────────────────
68
67
  /** GDPR erasure surfaces receipt headers from the 204 response. */
69
68
  export interface DeleteUserDataResult {
70
69
  status: number
70
+ /** Total rows anonymised across audit-log / behavioural model /
71
+ * decision_runs / recommendation_runs (the X-Anonymized-Rows
72
+ * header). The kind-specific counts below let callers attribute
73
+ * the deletion to each store for their own DSAR audit file. */
71
74
  anonymizedRows: number | null
72
75
  anonymizedDecisionRuns: number | null
76
+ /** L10 — count of recommendation_runs rows anonymised. Wired with
77
+ * migration 0030; older API deploys may return null. */
78
+ anonymizedRecommendationRuns: number | null
73
79
  receipt: string | null
74
80
  }
75
81
 
76
82
  // Re-export the raw generated surface for advanced consumers.
77
- export type { components, paths } from "./generated/api.js"
83
+ export type { components, paths } from "./generated/api.ts"