@goable-io/sdk 0.4.0 → 0.5.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 +107 -9
- package/dist/client.d.ts +37 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +60 -11
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +34 -10
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +28 -2
- package/dist/errors.js.map +1 -1
- package/dist/generated/api.d.ts +459 -46
- package/dist/generated/api.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +38 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +107 -10
- package/src/errors.ts +55 -15
- package/src/generated/api.ts +459 -46
- package/src/index.ts +2 -0
- package/src/types.ts +40 -0
package/src/generated/api.ts
CHANGED
|
@@ -131,6 +131,12 @@ export interface paths {
|
|
|
131
131
|
/** @description Score 0-100 + verdict + confidence + eco + calibration_provenance */
|
|
132
132
|
200: {
|
|
133
133
|
headers: {
|
|
134
|
+
/** @description Daily safety cap for this endpoint + plan (not the monthly billing quota). Omitted on unlimited (Scale) plans. */
|
|
135
|
+
"X-RateLimit-Limit"?: number;
|
|
136
|
+
/** @description Requests remaining in the current UTC-midnight daily window. Omitted on unlimited (Scale) plans. */
|
|
137
|
+
"X-RateLimit-Remaining"?: number;
|
|
138
|
+
/** @description Unix timestamp (seconds) at which the daily window resets. Omitted on unlimited (Scale) plans. */
|
|
139
|
+
"X-RateLimit-Reset"?: number;
|
|
134
140
|
[name: string]: unknown;
|
|
135
141
|
};
|
|
136
142
|
content: {
|
|
@@ -164,6 +170,17 @@ export interface paths {
|
|
|
164
170
|
"application/json": components["schemas"]["Error"];
|
|
165
171
|
};
|
|
166
172
|
};
|
|
173
|
+
/** @description Daily rate limit (safety cap) exceeded for this endpoint + plan. */
|
|
174
|
+
429: {
|
|
175
|
+
headers: {
|
|
176
|
+
/** @description Seconds until the daily rate-limit window resets. Present only on this 429 response. */
|
|
177
|
+
"Retry-After"?: number;
|
|
178
|
+
[name: string]: unknown;
|
|
179
|
+
};
|
|
180
|
+
content: {
|
|
181
|
+
"application/json": components["schemas"]["Error"];
|
|
182
|
+
};
|
|
183
|
+
};
|
|
167
184
|
};
|
|
168
185
|
};
|
|
169
186
|
delete?: never;
|
|
@@ -487,7 +504,7 @@ export interface paths {
|
|
|
487
504
|
binding_constraint?: boolean;
|
|
488
505
|
best_window_24h?: boolean;
|
|
489
506
|
best_nearby_spot_km?: number;
|
|
490
|
-
/** @description LLM explanation (
|
|
507
|
+
/** @description LLM explanation. Available on any plan (Anthropic BYOK) — resolves the tenant's own Anthropic key set via PUT /v1/tenant/llm-key; no key configured degrades to a deterministic template (natural_language.degraded_mode=true) rather than an error. */
|
|
491
508
|
natural_language?: boolean;
|
|
492
509
|
};
|
|
493
510
|
};
|
|
@@ -505,15 +522,6 @@ export interface paths {
|
|
|
505
522
|
};
|
|
506
523
|
};
|
|
507
524
|
};
|
|
508
|
-
/** @description natural_language=true requires Pro+ */
|
|
509
|
-
402: {
|
|
510
|
-
headers: {
|
|
511
|
-
[name: string]: unknown;
|
|
512
|
-
};
|
|
513
|
-
content: {
|
|
514
|
-
"application/json": components["schemas"]["Error"];
|
|
515
|
-
};
|
|
516
|
-
};
|
|
517
525
|
/** @description No profile for activity */
|
|
518
526
|
404: {
|
|
519
527
|
headers: {
|
|
@@ -549,7 +557,7 @@ export interface paths {
|
|
|
549
557
|
};
|
|
550
558
|
get?: never;
|
|
551
559
|
put?: never;
|
|
552
|
-
/** Personalized go/no-go decision (
|
|
560
|
+
/** Personalized go/no-go decision (any plan — Anthropic BYOK) */
|
|
553
561
|
post: {
|
|
554
562
|
parameters: {
|
|
555
563
|
query?: never;
|
|
@@ -579,7 +587,7 @@ export interface paths {
|
|
|
579
587
|
};
|
|
580
588
|
};
|
|
581
589
|
responses: {
|
|
582
|
-
/** @description score + verdict + decision block + degraded_mode + advisory_notice */
|
|
590
|
+
/** @description score + verdict + decision block + degraded_mode + advisory_notice. Available on any plan; the LLM reasoning narrative requires the tenant's own Anthropic key (PUT /v1/tenant/llm-key) — without one, degraded_mode=true and a deterministic template is returned instead of an error. */
|
|
583
591
|
200: {
|
|
584
592
|
headers: {
|
|
585
593
|
[name: string]: unknown;
|
|
@@ -590,15 +598,6 @@ export interface paths {
|
|
|
590
598
|
};
|
|
591
599
|
};
|
|
592
600
|
};
|
|
593
|
-
/** @description Requires Pro+ plan */
|
|
594
|
-
402: {
|
|
595
|
-
headers: {
|
|
596
|
-
[name: string]: unknown;
|
|
597
|
-
};
|
|
598
|
-
content: {
|
|
599
|
-
"application/json": components["schemas"]["Error"];
|
|
600
|
-
};
|
|
601
|
-
};
|
|
602
601
|
/** @description No profile for activity */
|
|
603
602
|
404: {
|
|
604
603
|
headers: {
|
|
@@ -670,7 +669,10 @@ export interface paths {
|
|
|
670
669
|
};
|
|
671
670
|
get?: never;
|
|
672
671
|
put?: never;
|
|
673
|
-
/**
|
|
672
|
+
/**
|
|
673
|
+
* LLM narrative explanation of a score (L2c, any plan — Anthropic BYOK)
|
|
674
|
+
* @description Requires the tenant to have its own Anthropic key set via PUT /v1/tenant/llm-key — no longer plan-gated. No key configured → 503 INTELLIGENCE_UNAVAILABLE.
|
|
675
|
+
*/
|
|
674
676
|
post: {
|
|
675
677
|
parameters: {
|
|
676
678
|
query?: never;
|
|
@@ -704,8 +706,8 @@ export interface paths {
|
|
|
704
706
|
};
|
|
705
707
|
};
|
|
706
708
|
};
|
|
707
|
-
/** @description
|
|
708
|
-
|
|
709
|
+
/** @description Validation error */
|
|
710
|
+
422: {
|
|
709
711
|
headers: {
|
|
710
712
|
[name: string]: unknown;
|
|
711
713
|
};
|
|
@@ -713,8 +715,8 @@ export interface paths {
|
|
|
713
715
|
"application/json": components["schemas"]["Error"];
|
|
714
716
|
};
|
|
715
717
|
};
|
|
716
|
-
/** @description
|
|
717
|
-
|
|
718
|
+
/** @description No Anthropic key configured for this tenant */
|
|
719
|
+
503: {
|
|
718
720
|
headers: {
|
|
719
721
|
[name: string]: unknown;
|
|
720
722
|
};
|
|
@@ -739,7 +741,10 @@ export interface paths {
|
|
|
739
741
|
};
|
|
740
742
|
get?: never;
|
|
741
743
|
put?: never;
|
|
742
|
-
/**
|
|
744
|
+
/**
|
|
745
|
+
* LLM multi-slot briefing (L2c, any plan — Anthropic BYOK)
|
|
746
|
+
* @description Requires the tenant to have its own Anthropic key set via PUT /v1/tenant/llm-key — no longer plan-gated. No key configured → 503 INTELLIGENCE_UNAVAILABLE.
|
|
747
|
+
*/
|
|
743
748
|
post: {
|
|
744
749
|
parameters: {
|
|
745
750
|
query?: never;
|
|
@@ -773,8 +778,8 @@ export interface paths {
|
|
|
773
778
|
};
|
|
774
779
|
};
|
|
775
780
|
};
|
|
776
|
-
/** @description
|
|
777
|
-
|
|
781
|
+
/** @description Validation error */
|
|
782
|
+
422: {
|
|
778
783
|
headers: {
|
|
779
784
|
[name: string]: unknown;
|
|
780
785
|
};
|
|
@@ -782,8 +787,8 @@ export interface paths {
|
|
|
782
787
|
"application/json": components["schemas"]["Error"];
|
|
783
788
|
};
|
|
784
789
|
};
|
|
785
|
-
/** @description
|
|
786
|
-
|
|
790
|
+
/** @description No Anthropic key configured for this tenant */
|
|
791
|
+
503: {
|
|
787
792
|
headers: {
|
|
788
793
|
[name: string]: unknown;
|
|
789
794
|
};
|
|
@@ -799,6 +804,146 @@ export interface paths {
|
|
|
799
804
|
patch?: never;
|
|
800
805
|
trace?: never;
|
|
801
806
|
};
|
|
807
|
+
"/v1/tenant/llm-key": {
|
|
808
|
+
parameters: {
|
|
809
|
+
query?: never;
|
|
810
|
+
header?: never;
|
|
811
|
+
path?: never;
|
|
812
|
+
cookie?: never;
|
|
813
|
+
};
|
|
814
|
+
/**
|
|
815
|
+
* Get the tenant's Anthropic key status (Anthropic BYOK)
|
|
816
|
+
* @description Never returns the key — only whether one is set, its last 4 characters, and timestamps.
|
|
817
|
+
*/
|
|
818
|
+
get: {
|
|
819
|
+
parameters: {
|
|
820
|
+
query?: never;
|
|
821
|
+
header?: never;
|
|
822
|
+
path?: never;
|
|
823
|
+
cookie?: never;
|
|
824
|
+
};
|
|
825
|
+
requestBody?: never;
|
|
826
|
+
responses: {
|
|
827
|
+
/** @description Masked key status */
|
|
828
|
+
200: {
|
|
829
|
+
headers: {
|
|
830
|
+
[name: string]: unknown;
|
|
831
|
+
};
|
|
832
|
+
content: {
|
|
833
|
+
"application/json": {
|
|
834
|
+
set: boolean;
|
|
835
|
+
last4?: string;
|
|
836
|
+
/** Format: date-time */
|
|
837
|
+
setAt?: string;
|
|
838
|
+
/** Format: date-time */
|
|
839
|
+
lastValidatedAt?: string | null;
|
|
840
|
+
};
|
|
841
|
+
};
|
|
842
|
+
};
|
|
843
|
+
/** @description BYOK storage not configured on this deployment */
|
|
844
|
+
503: {
|
|
845
|
+
headers: {
|
|
846
|
+
[name: string]: unknown;
|
|
847
|
+
};
|
|
848
|
+
content: {
|
|
849
|
+
"application/json": components["schemas"]["Error"];
|
|
850
|
+
};
|
|
851
|
+
};
|
|
852
|
+
};
|
|
853
|
+
};
|
|
854
|
+
/**
|
|
855
|
+
* Set/rotate the tenant's Anthropic API key (Anthropic BYOK)
|
|
856
|
+
* @description Validates the key with one cheap Anthropic API call before storing. Encrypts at rest (AES-256-GCM); the plaintext key is NEVER echoed back by this or any other endpoint. Available to any authenticated plan. Rate-limited (this call itself makes one real Anthropic API request).
|
|
857
|
+
*/
|
|
858
|
+
put: {
|
|
859
|
+
parameters: {
|
|
860
|
+
query?: never;
|
|
861
|
+
header?: never;
|
|
862
|
+
path?: never;
|
|
863
|
+
cookie?: never;
|
|
864
|
+
};
|
|
865
|
+
requestBody: {
|
|
866
|
+
content: {
|
|
867
|
+
"application/json": {
|
|
868
|
+
/** @description The tenant's own Anthropic API key (sk-ant-...). */
|
|
869
|
+
apiKey: string;
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
};
|
|
873
|
+
responses: {
|
|
874
|
+
/** @description Key validated, encrypted, and stored. */
|
|
875
|
+
204: {
|
|
876
|
+
headers: {
|
|
877
|
+
[name: string]: unknown;
|
|
878
|
+
};
|
|
879
|
+
content?: never;
|
|
880
|
+
};
|
|
881
|
+
/** @description Validation error, or Anthropic rejected the key (LLM_KEY_INVALID) */
|
|
882
|
+
422: {
|
|
883
|
+
headers: {
|
|
884
|
+
[name: string]: unknown;
|
|
885
|
+
};
|
|
886
|
+
content: {
|
|
887
|
+
"application/json": components["schemas"]["Error"];
|
|
888
|
+
};
|
|
889
|
+
};
|
|
890
|
+
/** @description Rate limited */
|
|
891
|
+
429: {
|
|
892
|
+
headers: {
|
|
893
|
+
[name: string]: unknown;
|
|
894
|
+
};
|
|
895
|
+
content: {
|
|
896
|
+
"application/json": components["schemas"]["Error"];
|
|
897
|
+
};
|
|
898
|
+
};
|
|
899
|
+
/** @description BYOK storage or BYOK_MASTER_KEY not configured on this deployment */
|
|
900
|
+
503: {
|
|
901
|
+
headers: {
|
|
902
|
+
[name: string]: unknown;
|
|
903
|
+
};
|
|
904
|
+
content: {
|
|
905
|
+
"application/json": components["schemas"]["Error"];
|
|
906
|
+
};
|
|
907
|
+
};
|
|
908
|
+
};
|
|
909
|
+
};
|
|
910
|
+
post?: never;
|
|
911
|
+
/**
|
|
912
|
+
* Remove the tenant's Anthropic key (Anthropic BYOK)
|
|
913
|
+
* @description Hard-deletes the stored ciphertext. LLM routes revert to the no-key degraded/503 path for this tenant.
|
|
914
|
+
*/
|
|
915
|
+
delete: {
|
|
916
|
+
parameters: {
|
|
917
|
+
query?: never;
|
|
918
|
+
header?: never;
|
|
919
|
+
path?: never;
|
|
920
|
+
cookie?: never;
|
|
921
|
+
};
|
|
922
|
+
requestBody?: never;
|
|
923
|
+
responses: {
|
|
924
|
+
/** @description Key removed. */
|
|
925
|
+
204: {
|
|
926
|
+
headers: {
|
|
927
|
+
[name: string]: unknown;
|
|
928
|
+
};
|
|
929
|
+
content?: never;
|
|
930
|
+
};
|
|
931
|
+
/** @description BYOK storage not configured on this deployment */
|
|
932
|
+
503: {
|
|
933
|
+
headers: {
|
|
934
|
+
[name: string]: unknown;
|
|
935
|
+
};
|
|
936
|
+
content: {
|
|
937
|
+
"application/json": components["schemas"]["Error"];
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
};
|
|
942
|
+
options?: never;
|
|
943
|
+
head?: never;
|
|
944
|
+
patch?: never;
|
|
945
|
+
trace?: never;
|
|
946
|
+
};
|
|
802
947
|
"/v1/projections": {
|
|
803
948
|
parameters: {
|
|
804
949
|
query?: never;
|
|
@@ -1079,12 +1224,15 @@ export interface paths {
|
|
|
1079
1224
|
put?: never;
|
|
1080
1225
|
/**
|
|
1081
1226
|
* Bind a parametric policy (Scale)
|
|
1082
|
-
* @description Convert a bindable quote (≤24h old) into a bound policy for a specific coverage year. Returns the serialised policy + the quoteId + optional `driftAdvisories` — a soft warning surfaced when the resolved cell has an open watch-level L9 drift event. A warning/critical drift event at bind time REFUSES the bind with 422 DRIFT_ACTIVE (see the 422 response). Fires the `underwriting.policy.bound` webhook on success.
|
|
1227
|
+
* @description Convert a bindable quote (≤24h old) into a bound policy for a specific coverage year. Returns the serialised policy + the quoteId + optional `driftAdvisories` — a soft warning surfaced when the resolved cell has an open watch-level L9 drift event. A warning/critical drift event at bind time REFUSES the bind with 422 DRIFT_ACTIVE (see the 422 response). Fires the `underwriting.policy.bound` webhook on success. Supports the optional `Idempotency-Key` header (see parameter description) so a client-side retry after a network timeout can't double-bind.
|
|
1083
1228
|
*/
|
|
1084
1229
|
post: {
|
|
1085
1230
|
parameters: {
|
|
1086
1231
|
query?: never;
|
|
1087
|
-
header?:
|
|
1232
|
+
header?: {
|
|
1233
|
+
/** @description Optional client-generated key (unique per logical request, scoped to your tenant). A retry with the SAME key and the SAME request body replays the original response verbatim without re-executing the request. A retry with the same key and a DIFFERENT body, or one that arrives while the original is still in flight, returns 409 IDEMPOTENCY_KEY_CONFLICT. Claims expire after 24h. */
|
|
1234
|
+
"Idempotency-Key"?: string;
|
|
1235
|
+
};
|
|
1088
1236
|
path?: never;
|
|
1089
1237
|
cookie?: never;
|
|
1090
1238
|
};
|
|
@@ -1142,7 +1290,7 @@ export interface paths {
|
|
|
1142
1290
|
"application/json": components["schemas"]["Error"];
|
|
1143
1291
|
};
|
|
1144
1292
|
};
|
|
1145
|
-
/** @description Quote already bound to another policy */
|
|
1293
|
+
/** @description Quote already bound to another policy (QUOTE_ALREADY_BOUND), or IDEMPOTENCY_KEY_CONFLICT — a request with this Idempotency-Key is still in flight, or was already used with a different request body */
|
|
1146
1294
|
409: {
|
|
1147
1295
|
headers: {
|
|
1148
1296
|
[name: string]: unknown;
|
|
@@ -1510,12 +1658,15 @@ export interface paths {
|
|
|
1510
1658
|
put?: never;
|
|
1511
1659
|
/**
|
|
1512
1660
|
* Report observed outcome for a scored session
|
|
1513
|
-
* @description Close the calibration loop. Submit the actual outcome (ran/cancelled/no_show/rescheduled/note) of a /v1/score session. The calibration pipeline + forecast verification + drift monitor consume these. Requires the `outcomes:write` scope (live keys carry it by default; test keys don't).
|
|
1661
|
+
* @description Close the calibration loop. Submit the actual outcome (ran/cancelled/no_show/rescheduled/note) of a /v1/score session. The calibration pipeline + forecast verification + drift monitor consume these. Requires the `outcomes:write` scope (live keys carry it by default; test keys don't). Supports the optional `Idempotency-Key` header (see parameter description) so a client-side retry can't record the same outcome twice.
|
|
1514
1662
|
*/
|
|
1515
1663
|
post: {
|
|
1516
1664
|
parameters: {
|
|
1517
1665
|
query?: never;
|
|
1518
|
-
header?:
|
|
1666
|
+
header?: {
|
|
1667
|
+
/** @description Optional client-generated key (unique per logical request, scoped to your tenant). A retry with the SAME key and the SAME request body replays the original response verbatim without re-executing the request. A retry with the same key and a DIFFERENT body, or one that arrives while the original is still in flight, returns 409 IDEMPOTENCY_KEY_CONFLICT. Claims expire after 24h. */
|
|
1668
|
+
"Idempotency-Key"?: string;
|
|
1669
|
+
};
|
|
1519
1670
|
path: {
|
|
1520
1671
|
/** @description Session UUID returned in the /v1/score response metadata. */
|
|
1521
1672
|
sessionId: string;
|
|
@@ -1563,6 +1714,15 @@ export interface paths {
|
|
|
1563
1714
|
"application/json": components["schemas"]["Error"];
|
|
1564
1715
|
};
|
|
1565
1716
|
};
|
|
1717
|
+
/** @description IDEMPOTENCY_KEY_CONFLICT — a request with this Idempotency-Key is still in flight, or was already used with a different request body */
|
|
1718
|
+
409: {
|
|
1719
|
+
headers: {
|
|
1720
|
+
[name: string]: unknown;
|
|
1721
|
+
};
|
|
1722
|
+
content: {
|
|
1723
|
+
"application/json": components["schemas"]["Error"];
|
|
1724
|
+
};
|
|
1725
|
+
};
|
|
1566
1726
|
/** @description Validation error */
|
|
1567
1727
|
422: {
|
|
1568
1728
|
headers: {
|
|
@@ -1716,6 +1876,12 @@ export interface paths {
|
|
|
1716
1876
|
/** @description Ranked top-K sub-spots + observability metadata. The optional `coverage` field appears only on empty results from a catalog gap (not from hard-gating). */
|
|
1717
1877
|
200: {
|
|
1718
1878
|
headers: {
|
|
1879
|
+
/** @description Daily safety cap for this endpoint + plan (not the monthly billing quota). Omitted on unlimited (Scale) plans. */
|
|
1880
|
+
"X-RateLimit-Limit"?: number;
|
|
1881
|
+
/** @description Requests remaining in the current UTC-midnight daily window. Omitted on unlimited (Scale) plans. */
|
|
1882
|
+
"X-RateLimit-Remaining"?: number;
|
|
1883
|
+
/** @description Unix timestamp (seconds) at which the daily window resets. Omitted on unlimited (Scale) plans. */
|
|
1884
|
+
"X-RateLimit-Reset"?: number;
|
|
1719
1885
|
[name: string]: unknown;
|
|
1720
1886
|
};
|
|
1721
1887
|
content: {
|
|
@@ -1786,6 +1952,17 @@ export interface paths {
|
|
|
1786
1952
|
"application/json": components["schemas"]["Error"];
|
|
1787
1953
|
};
|
|
1788
1954
|
};
|
|
1955
|
+
/** @description Daily rate limit (safety cap) exceeded for this endpoint + plan. */
|
|
1956
|
+
429: {
|
|
1957
|
+
headers: {
|
|
1958
|
+
/** @description Seconds until the daily rate-limit window resets. Present only on this 429 response. */
|
|
1959
|
+
"Retry-After"?: number;
|
|
1960
|
+
[name: string]: unknown;
|
|
1961
|
+
};
|
|
1962
|
+
content: {
|
|
1963
|
+
"application/json": components["schemas"]["Error"];
|
|
1964
|
+
};
|
|
1965
|
+
};
|
|
1789
1966
|
/** @description Spatial resolver not wired */
|
|
1790
1967
|
503: {
|
|
1791
1968
|
headers: {
|
|
@@ -1813,8 +1990,8 @@ export interface paths {
|
|
|
1813
1990
|
get?: never;
|
|
1814
1991
|
put?: never;
|
|
1815
1992
|
/**
|
|
1816
|
-
* LLM analysis of a borderline / surprising score (L2c,
|
|
1817
|
-
* @description Asks the LLM to inspect a score that's near a verdict boundary or contradicts operator intuition. Returns a narrative + a structured `limiting_class` taxonomy entry.
|
|
1993
|
+
* LLM analysis of a borderline / surprising score (L2c, any plan — Anthropic BYOK)
|
|
1994
|
+
* @description Asks the LLM to inspect a score that's near a verdict boundary or contradicts operator intuition. Returns a narrative + a structured `limiting_class` taxonomy entry. Requires the tenant's own Anthropic key (PUT /v1/tenant/llm-key) — no longer plan-gated.
|
|
1818
1995
|
*/
|
|
1819
1996
|
post: {
|
|
1820
1997
|
parameters: {
|
|
@@ -1849,8 +2026,8 @@ export interface paths {
|
|
|
1849
2026
|
};
|
|
1850
2027
|
};
|
|
1851
2028
|
};
|
|
1852
|
-
/** @description
|
|
1853
|
-
|
|
2029
|
+
/** @description Validation error */
|
|
2030
|
+
422: {
|
|
1854
2031
|
headers: {
|
|
1855
2032
|
[name: string]: unknown;
|
|
1856
2033
|
};
|
|
@@ -1858,8 +2035,8 @@ export interface paths {
|
|
|
1858
2035
|
"application/json": components["schemas"]["Error"];
|
|
1859
2036
|
};
|
|
1860
2037
|
};
|
|
1861
|
-
/** @description
|
|
1862
|
-
|
|
2038
|
+
/** @description No Anthropic key configured for this tenant */
|
|
2039
|
+
503: {
|
|
1863
2040
|
headers: {
|
|
1864
2041
|
[name: string]: unknown;
|
|
1865
2042
|
};
|
|
@@ -2755,6 +2932,239 @@ export interface paths {
|
|
|
2755
2932
|
patch?: never;
|
|
2756
2933
|
trace?: never;
|
|
2757
2934
|
};
|
|
2935
|
+
"/v1/outcomes": {
|
|
2936
|
+
parameters: {
|
|
2937
|
+
query?: never;
|
|
2938
|
+
header?: never;
|
|
2939
|
+
path?: never;
|
|
2940
|
+
cookie?: never;
|
|
2941
|
+
};
|
|
2942
|
+
get?: never;
|
|
2943
|
+
put?: never;
|
|
2944
|
+
/**
|
|
2945
|
+
* Report a standalone activity outcome
|
|
2946
|
+
* @description Submit an observed outcome for an activity session not tied to a specific /v1/score call — the operator-reported behavioural signal behind the calibration + research datasets. For an outcome linked to a specific scored session, use POST /v1/score/{sessionId}/outcome instead. Requires the `outcomes:write` scope (live keys carry it by default; test keys don't).
|
|
2947
|
+
*/
|
|
2948
|
+
post: {
|
|
2949
|
+
parameters: {
|
|
2950
|
+
query?: never;
|
|
2951
|
+
header?: never;
|
|
2952
|
+
path?: never;
|
|
2953
|
+
cookie?: never;
|
|
2954
|
+
};
|
|
2955
|
+
requestBody: {
|
|
2956
|
+
content: {
|
|
2957
|
+
"application/json": {
|
|
2958
|
+
/** Format: date-time */
|
|
2959
|
+
occurred_at: string;
|
|
2960
|
+
activity_slug: string;
|
|
2961
|
+
/** @enum {string} */
|
|
2962
|
+
outcome_type: "ran" | "cancelled" | "rescheduled" | "no_show" | "note";
|
|
2963
|
+
/** @description Optional catalogue sub-spot slug. */
|
|
2964
|
+
spot_id?: string;
|
|
2965
|
+
/** @description Optional link back to a scoring_audit_log row. */
|
|
2966
|
+
audit_log_id?: string;
|
|
2967
|
+
detail?: {
|
|
2968
|
+
[key: string]: unknown;
|
|
2969
|
+
};
|
|
2970
|
+
/**
|
|
2971
|
+
* @description Stream G equipment-transition signal.
|
|
2972
|
+
* @enum {string}
|
|
2973
|
+
*/
|
|
2974
|
+
equipment_type?: "electric" | "combustion" | "manual";
|
|
2975
|
+
};
|
|
2976
|
+
};
|
|
2977
|
+
};
|
|
2978
|
+
responses: {
|
|
2979
|
+
/** @description Accepted (queued for the next calibration batch) */
|
|
2980
|
+
202: {
|
|
2981
|
+
headers: {
|
|
2982
|
+
[name: string]: unknown;
|
|
2983
|
+
};
|
|
2984
|
+
content: {
|
|
2985
|
+
"application/json": {
|
|
2986
|
+
[key: string]: unknown;
|
|
2987
|
+
};
|
|
2988
|
+
};
|
|
2989
|
+
};
|
|
2990
|
+
/** @description Missing scope: outcomes:write */
|
|
2991
|
+
403: {
|
|
2992
|
+
headers: {
|
|
2993
|
+
[name: string]: unknown;
|
|
2994
|
+
};
|
|
2995
|
+
content: {
|
|
2996
|
+
"application/json": components["schemas"]["Error"];
|
|
2997
|
+
};
|
|
2998
|
+
};
|
|
2999
|
+
/** @description Validation error */
|
|
3000
|
+
422: {
|
|
3001
|
+
headers: {
|
|
3002
|
+
[name: string]: unknown;
|
|
3003
|
+
};
|
|
3004
|
+
content: {
|
|
3005
|
+
"application/json": components["schemas"]["Error"];
|
|
3006
|
+
};
|
|
3007
|
+
};
|
|
3008
|
+
};
|
|
3009
|
+
};
|
|
3010
|
+
delete?: never;
|
|
3011
|
+
options?: never;
|
|
3012
|
+
head?: never;
|
|
3013
|
+
patch?: never;
|
|
3014
|
+
trace?: never;
|
|
3015
|
+
};
|
|
3016
|
+
"/v1/audit/export": {
|
|
3017
|
+
parameters: {
|
|
3018
|
+
query?: never;
|
|
3019
|
+
header?: never;
|
|
3020
|
+
path?: never;
|
|
3021
|
+
cookie?: never;
|
|
3022
|
+
};
|
|
3023
|
+
/**
|
|
3024
|
+
* Export the caller's own score + outcome audit history
|
|
3025
|
+
* @description Tenant-scoped export of your own scoring_audit_log activity (one row per /v1/score call, with any linked outcome inline), date-range filtered. The tenant is always the calling API key's tenant — there is no way to request another tenant's data. Outcomes reported via the free-standing POST /v1/outcomes (i.e. not linked to a specific score via audit_log_id) are not included. Offset-paginated; `X-Total-Count` on every response carries the total row count for the window.
|
|
3026
|
+
*/
|
|
3027
|
+
get: {
|
|
3028
|
+
parameters: {
|
|
3029
|
+
query: {
|
|
3030
|
+
from: string;
|
|
3031
|
+
to: string;
|
|
3032
|
+
format?: "csv" | "json";
|
|
3033
|
+
limit?: number;
|
|
3034
|
+
offset?: number;
|
|
3035
|
+
};
|
|
3036
|
+
header?: never;
|
|
3037
|
+
path?: never;
|
|
3038
|
+
cookie?: never;
|
|
3039
|
+
};
|
|
3040
|
+
requestBody?: never;
|
|
3041
|
+
responses: {
|
|
3042
|
+
/** @description CSV (format=csv) or JSON (format=json, default) export of the window. */
|
|
3043
|
+
200: {
|
|
3044
|
+
headers: {
|
|
3045
|
+
[name: string]: unknown;
|
|
3046
|
+
};
|
|
3047
|
+
content: {
|
|
3048
|
+
"application/json": {
|
|
3049
|
+
rows: {
|
|
3050
|
+
[key: string]: unknown;
|
|
3051
|
+
}[];
|
|
3052
|
+
meta: {
|
|
3053
|
+
total: number;
|
|
3054
|
+
limit: number;
|
|
3055
|
+
offset: number;
|
|
3056
|
+
window: {
|
|
3057
|
+
from?: string;
|
|
3058
|
+
to?: string;
|
|
3059
|
+
};
|
|
3060
|
+
};
|
|
3061
|
+
};
|
|
3062
|
+
"text/csv": string;
|
|
3063
|
+
};
|
|
3064
|
+
};
|
|
3065
|
+
/** @description Validation error, `to` before `from`, or WINDOW_TOO_LARGE (range exceeds 366 days) */
|
|
3066
|
+
422: {
|
|
3067
|
+
headers: {
|
|
3068
|
+
[name: string]: unknown;
|
|
3069
|
+
};
|
|
3070
|
+
content: {
|
|
3071
|
+
"application/json": components["schemas"]["Error"];
|
|
3072
|
+
};
|
|
3073
|
+
};
|
|
3074
|
+
/** @description Audit export is not configured */
|
|
3075
|
+
503: {
|
|
3076
|
+
headers: {
|
|
3077
|
+
[name: string]: unknown;
|
|
3078
|
+
};
|
|
3079
|
+
content: {
|
|
3080
|
+
"application/json": components["schemas"]["Error"];
|
|
3081
|
+
};
|
|
3082
|
+
};
|
|
3083
|
+
};
|
|
3084
|
+
};
|
|
3085
|
+
put?: never;
|
|
3086
|
+
post?: never;
|
|
3087
|
+
delete?: never;
|
|
3088
|
+
options?: never;
|
|
3089
|
+
head?: never;
|
|
3090
|
+
patch?: never;
|
|
3091
|
+
trace?: never;
|
|
3092
|
+
};
|
|
3093
|
+
"/v1/legal/{kind}/current": {
|
|
3094
|
+
parameters: {
|
|
3095
|
+
query?: never;
|
|
3096
|
+
header?: never;
|
|
3097
|
+
path?: never;
|
|
3098
|
+
cookie?: never;
|
|
3099
|
+
};
|
|
3100
|
+
/**
|
|
3101
|
+
* Fetch the current published legal document (no auth)
|
|
3102
|
+
* @description Public read of the currently-published version of a legal document (Terms of Service, Privacy Policy, DPA, SLA, Acceptable Use, Cookie Policy). Returns the full body + content hash + published timestamp. Used by the signup flow + marketing site to render always-current legal copy without hardcoding it.
|
|
3103
|
+
*/
|
|
3104
|
+
get: {
|
|
3105
|
+
parameters: {
|
|
3106
|
+
query?: never;
|
|
3107
|
+
header?: never;
|
|
3108
|
+
path: {
|
|
3109
|
+
/** @description Legal document kind. */
|
|
3110
|
+
kind: "terms_of_service" | "privacy_policy" | "data_processing_agreement" | "sla" | "acceptable_use" | "cookie_policy";
|
|
3111
|
+
};
|
|
3112
|
+
cookie?: never;
|
|
3113
|
+
};
|
|
3114
|
+
requestBody?: never;
|
|
3115
|
+
responses: {
|
|
3116
|
+
/** @description The current published document of the requested kind */
|
|
3117
|
+
200: {
|
|
3118
|
+
headers: {
|
|
3119
|
+
[name: string]: unknown;
|
|
3120
|
+
};
|
|
3121
|
+
content: {
|
|
3122
|
+
"application/json": {
|
|
3123
|
+
document: {
|
|
3124
|
+
/** Format: uuid */
|
|
3125
|
+
id: string;
|
|
3126
|
+
kind: string;
|
|
3127
|
+
version: string;
|
|
3128
|
+
title: string;
|
|
3129
|
+
body: string;
|
|
3130
|
+
contentHash: string;
|
|
3131
|
+
status: string;
|
|
3132
|
+
/** Format: date-time */
|
|
3133
|
+
createdAt: string;
|
|
3134
|
+
/** Format: date-time */
|
|
3135
|
+
publishedAt: string | null;
|
|
3136
|
+
};
|
|
3137
|
+
};
|
|
3138
|
+
};
|
|
3139
|
+
};
|
|
3140
|
+
/** @description Unknown document kind, or no published document */
|
|
3141
|
+
404: {
|
|
3142
|
+
headers: {
|
|
3143
|
+
[name: string]: unknown;
|
|
3144
|
+
};
|
|
3145
|
+
content: {
|
|
3146
|
+
"application/json": components["schemas"]["Error"];
|
|
3147
|
+
};
|
|
3148
|
+
};
|
|
3149
|
+
/** @description Legal document store not wired */
|
|
3150
|
+
503: {
|
|
3151
|
+
headers: {
|
|
3152
|
+
[name: string]: unknown;
|
|
3153
|
+
};
|
|
3154
|
+
content: {
|
|
3155
|
+
"application/json": components["schemas"]["Error"];
|
|
3156
|
+
};
|
|
3157
|
+
};
|
|
3158
|
+
};
|
|
3159
|
+
};
|
|
3160
|
+
put?: never;
|
|
3161
|
+
post?: never;
|
|
3162
|
+
delete?: never;
|
|
3163
|
+
options?: never;
|
|
3164
|
+
head?: never;
|
|
3165
|
+
patch?: never;
|
|
3166
|
+
trace?: never;
|
|
3167
|
+
};
|
|
2758
3168
|
}
|
|
2759
3169
|
export type webhooks = Record<string, never>;
|
|
2760
3170
|
export interface components {
|
|
@@ -2789,10 +3199,12 @@ export interface components {
|
|
|
2789
3199
|
verdict: components["schemas"]["Verdict"];
|
|
2790
3200
|
confidence: number;
|
|
2791
3201
|
breakdown: ({
|
|
2792
|
-
|
|
2793
|
-
|
|
3202
|
+
name?: string;
|
|
3203
|
+
value?: number;
|
|
3204
|
+
suitability?: number;
|
|
2794
3205
|
weight?: number;
|
|
2795
3206
|
contribution?: number;
|
|
3207
|
+
hasData?: boolean;
|
|
2796
3208
|
} & {
|
|
2797
3209
|
[key: string]: unknown;
|
|
2798
3210
|
})[];
|
|
@@ -2800,9 +3212,10 @@ export interface components {
|
|
|
2800
3212
|
[key: string]: unknown;
|
|
2801
3213
|
};
|
|
2802
3214
|
alerts: ({
|
|
3215
|
+
/** @enum {string} */
|
|
3216
|
+
level?: "info" | "warning" | "critical";
|
|
2803
3217
|
code?: string;
|
|
2804
|
-
|
|
2805
|
-
message?: string;
|
|
3218
|
+
description?: string;
|
|
2806
3219
|
} & {
|
|
2807
3220
|
[key: string]: unknown;
|
|
2808
3221
|
})[];
|