@stormwateriq/api-client 0.0.1
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/LICENSE +201 -0
- package/README.md +75 -0
- package/dist/client.d.ts +34 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +67 -0
- package/dist/generated/client/client.gen.d.ts +3 -0
- package/dist/generated/client/client.gen.d.ts.map +1 -0
- package/dist/generated/client/client.gen.js +216 -0
- package/dist/generated/client/index.d.ts +10 -0
- package/dist/generated/client/index.d.ts.map +1 -0
- package/dist/generated/client/index.js +6 -0
- package/dist/generated/client/types.gen.d.ts +121 -0
- package/dist/generated/client/types.gen.d.ts.map +1 -0
- package/dist/generated/client/types.gen.js +2 -0
- package/dist/generated/client/utils.gen.d.ts +38 -0
- package/dist/generated/client/utils.gen.d.ts.map +1 -0
- package/dist/generated/client/utils.gen.js +228 -0
- package/dist/generated/client.gen.d.ts +13 -0
- package/dist/generated/client.gen.d.ts.map +1 -0
- package/dist/generated/client.gen.js +3 -0
- package/dist/generated/core/auth.gen.d.ts +26 -0
- package/dist/generated/core/auth.gen.d.ts.map +1 -0
- package/dist/generated/core/auth.gen.js +14 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +26 -0
- package/dist/generated/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/bodySerializer.gen.js +57 -0
- package/dist/generated/core/params.gen.d.ts +44 -0
- package/dist/generated/core/params.gen.d.ts.map +1 -0
- package/dist/generated/core/params.gen.js +100 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +34 -0
- package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/pathSerializer.gen.js +106 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.js +92 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.js +132 -0
- package/dist/generated/core/types.gen.d.ts +79 -0
- package/dist/generated/core/types.gen.d.ts.map +1 -0
- package/dist/generated/core/types.gen.js +2 -0
- package/dist/generated/core/utils.gen.d.ts +20 -0
- package/dist/generated/core/utils.gen.d.ts.map +1 -0
- package/dist/generated/core/utils.gen.js +87 -0
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +2 -0
- package/dist/generated/sdk.gen.d.ts +90 -0
- package/dist/generated/sdk.gen.d.ts.map +1 -0
- package/dist/generated/sdk.gen.js +136 -0
- package/dist/generated/types.gen.d.ts +535 -0
- package/dist/generated/types.gen.d.ts.map +1 -0
- package/dist/generated/types.gen.js +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/retry.d.ts +16 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +31 -0
- package/dist/webhooks.d.ts +28 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +65 -0
- package/package.json +45 -0
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
export type ClientOptions = {
|
|
2
|
+
baseUrl: 'https://api.stormwateriq.com' | (string & {});
|
|
3
|
+
};
|
|
4
|
+
export type Health = {
|
|
5
|
+
status: 'ok';
|
|
6
|
+
service: 'api-gateway';
|
|
7
|
+
version: string;
|
|
8
|
+
env: {
|
|
9
|
+
[key: string]: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type SitesPage = {
|
|
13
|
+
data: Array<Site>;
|
|
14
|
+
/**
|
|
15
|
+
* Opaque cursor for the next page, or null.
|
|
16
|
+
*/
|
|
17
|
+
next_cursor: string | null;
|
|
18
|
+
};
|
|
19
|
+
export type Site = {
|
|
20
|
+
id: string;
|
|
21
|
+
organization_id: string | null;
|
|
22
|
+
name: string | null;
|
|
23
|
+
updated_at: string | null;
|
|
24
|
+
vertical_extension: {
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type Error = {
|
|
29
|
+
error: string;
|
|
30
|
+
error_description?: string;
|
|
31
|
+
};
|
|
32
|
+
export type CreateSite = {
|
|
33
|
+
name: string;
|
|
34
|
+
longitude: number;
|
|
35
|
+
latitude: number;
|
|
36
|
+
address_line_1?: string | null;
|
|
37
|
+
city?: string | null;
|
|
38
|
+
state_region?: string | null;
|
|
39
|
+
notes?: string | null;
|
|
40
|
+
vertical_extension?: {
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type PatchSite = {
|
|
45
|
+
name?: string;
|
|
46
|
+
address_line_1?: string | null;
|
|
47
|
+
city?: string | null;
|
|
48
|
+
state_region?: string | null;
|
|
49
|
+
notes?: string | null;
|
|
50
|
+
vertical_extension?: {
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export type InspectionsPage = {
|
|
55
|
+
data: Array<Inspection>;
|
|
56
|
+
/**
|
|
57
|
+
* Opaque cursor for the next page, or null.
|
|
58
|
+
*/
|
|
59
|
+
next_cursor: string | null;
|
|
60
|
+
};
|
|
61
|
+
export type Inspection = {
|
|
62
|
+
id: string;
|
|
63
|
+
organization_id: string | null;
|
|
64
|
+
site_id: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* quality_status: pending|pass|fail|review_required.
|
|
67
|
+
*/
|
|
68
|
+
status: string | null;
|
|
69
|
+
condition_summary: string | null;
|
|
70
|
+
source: string | null;
|
|
71
|
+
started_at: string | null;
|
|
72
|
+
submitted_at: string | null;
|
|
73
|
+
completed_at: string | null;
|
|
74
|
+
reviewed_at: string | null;
|
|
75
|
+
inspector_user_id: string | null;
|
|
76
|
+
signature_signed_at: string | null;
|
|
77
|
+
weather_snapshot?: unknown;
|
|
78
|
+
};
|
|
79
|
+
export type InspectionPhotos = {
|
|
80
|
+
data: Array<InspectionPhoto>;
|
|
81
|
+
};
|
|
82
|
+
export type InspectionPhoto = {
|
|
83
|
+
id: string;
|
|
84
|
+
media_type: string;
|
|
85
|
+
sequence_no: number;
|
|
86
|
+
captured_at: string | null;
|
|
87
|
+
checksum_sha256: string | null;
|
|
88
|
+
signed_url: string | null;
|
|
89
|
+
};
|
|
90
|
+
export type ReportUrl = {
|
|
91
|
+
signed_url: string;
|
|
92
|
+
expires_at: string;
|
|
93
|
+
};
|
|
94
|
+
export type RegisteredWebhook = Webhook & {
|
|
95
|
+
/**
|
|
96
|
+
* HMAC signing secret — shown once, never returned again.
|
|
97
|
+
*/
|
|
98
|
+
signing_secret: string;
|
|
99
|
+
};
|
|
100
|
+
export type Webhook = {
|
|
101
|
+
id: string;
|
|
102
|
+
url: string;
|
|
103
|
+
event_types: Array<string>;
|
|
104
|
+
status?: string;
|
|
105
|
+
created_at: string | null;
|
|
106
|
+
};
|
|
107
|
+
export type RegisterWebhook = {
|
|
108
|
+
url: string;
|
|
109
|
+
/**
|
|
110
|
+
* Subset of the catalog; omit/empty = all events.
|
|
111
|
+
*/
|
|
112
|
+
event_types?: Array<'site.registered' | 'site.storm_impacted' | 'inspection.completed' | 'inspection.assigned' | 'inspection.deficiency_opened' | 'inspection.deficiency_closed' | 'site.compliance_status_changed' | 'sponsor.outcome_accrued' | 'certificate.ready' | 'permit.expiring_soon'>;
|
|
113
|
+
};
|
|
114
|
+
export type WebhookList = {
|
|
115
|
+
data: Array<Webhook>;
|
|
116
|
+
};
|
|
117
|
+
export type SponsorOutcomes = {
|
|
118
|
+
sponsor_id: string;
|
|
119
|
+
period: string;
|
|
120
|
+
sites: Array<{
|
|
121
|
+
tss_lb: number;
|
|
122
|
+
tn_lb: number;
|
|
123
|
+
tp_lb: number;
|
|
124
|
+
zn_lb: number;
|
|
125
|
+
site_id: string;
|
|
126
|
+
/**
|
|
127
|
+
* Share of the period the attribution window covered.
|
|
128
|
+
*/
|
|
129
|
+
fraction: number;
|
|
130
|
+
}>;
|
|
131
|
+
pollutant_reductions: {
|
|
132
|
+
tss_lb: number;
|
|
133
|
+
tn_lb: number;
|
|
134
|
+
tp_lb: number;
|
|
135
|
+
zn_lb: number;
|
|
136
|
+
};
|
|
137
|
+
ej_summary: {
|
|
138
|
+
[key: string]: unknown;
|
|
139
|
+
};
|
|
140
|
+
receiving_waters: Array<unknown>;
|
|
141
|
+
};
|
|
142
|
+
export type GetHealthData = {
|
|
143
|
+
body?: never;
|
|
144
|
+
path?: never;
|
|
145
|
+
query?: never;
|
|
146
|
+
url: '/v1/health';
|
|
147
|
+
};
|
|
148
|
+
export type GetHealthResponses = {
|
|
149
|
+
/**
|
|
150
|
+
* Service is healthy.
|
|
151
|
+
*/
|
|
152
|
+
200: Health;
|
|
153
|
+
};
|
|
154
|
+
export type GetHealthResponse = GetHealthResponses[keyof GetHealthResponses];
|
|
155
|
+
export type ListSitesData = {
|
|
156
|
+
body?: never;
|
|
157
|
+
path?: never;
|
|
158
|
+
query?: {
|
|
159
|
+
/**
|
|
160
|
+
* 1–200, default 50.
|
|
161
|
+
*/
|
|
162
|
+
limit?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Opaque pagination cursor.
|
|
165
|
+
*/
|
|
166
|
+
cursor?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Filter to sites with a BMP of this type.
|
|
169
|
+
*/
|
|
170
|
+
bmp_type?: string;
|
|
171
|
+
};
|
|
172
|
+
url: '/v1/sites';
|
|
173
|
+
};
|
|
174
|
+
export type ListSitesErrors = {
|
|
175
|
+
/**
|
|
176
|
+
* Invalid cursor.
|
|
177
|
+
*/
|
|
178
|
+
400: Error;
|
|
179
|
+
/**
|
|
180
|
+
* Missing or invalid token.
|
|
181
|
+
*/
|
|
182
|
+
401: Error;
|
|
183
|
+
/**
|
|
184
|
+
* Insufficient scope.
|
|
185
|
+
*/
|
|
186
|
+
403: Error;
|
|
187
|
+
};
|
|
188
|
+
export type ListSitesError = ListSitesErrors[keyof ListSitesErrors];
|
|
189
|
+
export type ListSitesResponses = {
|
|
190
|
+
/**
|
|
191
|
+
* A page of sites.
|
|
192
|
+
*/
|
|
193
|
+
200: SitesPage;
|
|
194
|
+
};
|
|
195
|
+
export type ListSitesResponse = ListSitesResponses[keyof ListSitesResponses];
|
|
196
|
+
export type CreateSiteData = {
|
|
197
|
+
body?: CreateSite;
|
|
198
|
+
path?: never;
|
|
199
|
+
query?: never;
|
|
200
|
+
url: '/v1/sites';
|
|
201
|
+
};
|
|
202
|
+
export type CreateSiteErrors = {
|
|
203
|
+
/**
|
|
204
|
+
* Invalid request.
|
|
205
|
+
*/
|
|
206
|
+
400: Error;
|
|
207
|
+
/**
|
|
208
|
+
* Missing or invalid token.
|
|
209
|
+
*/
|
|
210
|
+
401: Error;
|
|
211
|
+
/**
|
|
212
|
+
* Insufficient scope.
|
|
213
|
+
*/
|
|
214
|
+
403: Error;
|
|
215
|
+
};
|
|
216
|
+
export type CreateSiteError = CreateSiteErrors[keyof CreateSiteErrors];
|
|
217
|
+
export type CreateSiteResponses = {
|
|
218
|
+
/**
|
|
219
|
+
* The created site.
|
|
220
|
+
*/
|
|
221
|
+
201: Site;
|
|
222
|
+
};
|
|
223
|
+
export type CreateSiteResponse = CreateSiteResponses[keyof CreateSiteResponses];
|
|
224
|
+
export type GetSiteData = {
|
|
225
|
+
body?: never;
|
|
226
|
+
path: {
|
|
227
|
+
site_id: string;
|
|
228
|
+
};
|
|
229
|
+
query?: never;
|
|
230
|
+
url: '/v1/sites/{site_id}';
|
|
231
|
+
};
|
|
232
|
+
export type GetSiteErrors = {
|
|
233
|
+
/**
|
|
234
|
+
* Missing or invalid token.
|
|
235
|
+
*/
|
|
236
|
+
401: Error;
|
|
237
|
+
/**
|
|
238
|
+
* Insufficient scope.
|
|
239
|
+
*/
|
|
240
|
+
403: Error;
|
|
241
|
+
/**
|
|
242
|
+
* Not found.
|
|
243
|
+
*/
|
|
244
|
+
404: Error;
|
|
245
|
+
};
|
|
246
|
+
export type GetSiteError = GetSiteErrors[keyof GetSiteErrors];
|
|
247
|
+
export type GetSiteResponses = {
|
|
248
|
+
/**
|
|
249
|
+
* The site.
|
|
250
|
+
*/
|
|
251
|
+
200: Site;
|
|
252
|
+
};
|
|
253
|
+
export type GetSiteResponse = GetSiteResponses[keyof GetSiteResponses];
|
|
254
|
+
export type UpdateSiteData = {
|
|
255
|
+
body?: PatchSite;
|
|
256
|
+
path: {
|
|
257
|
+
site_id: string;
|
|
258
|
+
};
|
|
259
|
+
query?: never;
|
|
260
|
+
url: '/v1/sites/{site_id}';
|
|
261
|
+
};
|
|
262
|
+
export type UpdateSiteErrors = {
|
|
263
|
+
/**
|
|
264
|
+
* Invalid request.
|
|
265
|
+
*/
|
|
266
|
+
400: Error;
|
|
267
|
+
/**
|
|
268
|
+
* Missing or invalid token.
|
|
269
|
+
*/
|
|
270
|
+
401: Error;
|
|
271
|
+
/**
|
|
272
|
+
* Insufficient scope.
|
|
273
|
+
*/
|
|
274
|
+
403: Error;
|
|
275
|
+
/**
|
|
276
|
+
* Not found.
|
|
277
|
+
*/
|
|
278
|
+
404: Error;
|
|
279
|
+
};
|
|
280
|
+
export type UpdateSiteError = UpdateSiteErrors[keyof UpdateSiteErrors];
|
|
281
|
+
export type UpdateSiteResponses = {
|
|
282
|
+
/**
|
|
283
|
+
* The updated site.
|
|
284
|
+
*/
|
|
285
|
+
200: Site;
|
|
286
|
+
};
|
|
287
|
+
export type UpdateSiteResponse = UpdateSiteResponses[keyof UpdateSiteResponses];
|
|
288
|
+
export type ListInspectionsData = {
|
|
289
|
+
body?: never;
|
|
290
|
+
path?: never;
|
|
291
|
+
query?: {
|
|
292
|
+
/**
|
|
293
|
+
* 1–200, default 50.
|
|
294
|
+
*/
|
|
295
|
+
limit?: string;
|
|
296
|
+
/**
|
|
297
|
+
* Opaque pagination cursor.
|
|
298
|
+
*/
|
|
299
|
+
cursor?: string;
|
|
300
|
+
site_id?: string;
|
|
301
|
+
/**
|
|
302
|
+
* ISO timestamp; submitted at/after.
|
|
303
|
+
*/
|
|
304
|
+
since?: string;
|
|
305
|
+
/**
|
|
306
|
+
* quality_status filter.
|
|
307
|
+
*/
|
|
308
|
+
status?: string;
|
|
309
|
+
};
|
|
310
|
+
url: '/v1/inspections';
|
|
311
|
+
};
|
|
312
|
+
export type ListInspectionsErrors = {
|
|
313
|
+
/**
|
|
314
|
+
* Invalid cursor.
|
|
315
|
+
*/
|
|
316
|
+
400: Error;
|
|
317
|
+
/**
|
|
318
|
+
* Missing or invalid token.
|
|
319
|
+
*/
|
|
320
|
+
401: Error;
|
|
321
|
+
/**
|
|
322
|
+
* Insufficient scope.
|
|
323
|
+
*/
|
|
324
|
+
403: Error;
|
|
325
|
+
};
|
|
326
|
+
export type ListInspectionsError = ListInspectionsErrors[keyof ListInspectionsErrors];
|
|
327
|
+
export type ListInspectionsResponses = {
|
|
328
|
+
/**
|
|
329
|
+
* A page of inspections.
|
|
330
|
+
*/
|
|
331
|
+
200: InspectionsPage;
|
|
332
|
+
};
|
|
333
|
+
export type ListInspectionsResponse = ListInspectionsResponses[keyof ListInspectionsResponses];
|
|
334
|
+
export type GetInspectionData = {
|
|
335
|
+
body?: never;
|
|
336
|
+
path: {
|
|
337
|
+
inspection_id: string;
|
|
338
|
+
};
|
|
339
|
+
query?: never;
|
|
340
|
+
url: '/v1/inspections/{inspection_id}';
|
|
341
|
+
};
|
|
342
|
+
export type GetInspectionErrors = {
|
|
343
|
+
/**
|
|
344
|
+
* Missing or invalid token.
|
|
345
|
+
*/
|
|
346
|
+
401: Error;
|
|
347
|
+
/**
|
|
348
|
+
* Insufficient scope.
|
|
349
|
+
*/
|
|
350
|
+
403: Error;
|
|
351
|
+
/**
|
|
352
|
+
* Not found.
|
|
353
|
+
*/
|
|
354
|
+
404: Error;
|
|
355
|
+
};
|
|
356
|
+
export type GetInspectionError = GetInspectionErrors[keyof GetInspectionErrors];
|
|
357
|
+
export type GetInspectionResponses = {
|
|
358
|
+
/**
|
|
359
|
+
* The inspection.
|
|
360
|
+
*/
|
|
361
|
+
200: Inspection;
|
|
362
|
+
};
|
|
363
|
+
export type GetInspectionResponse = GetInspectionResponses[keyof GetInspectionResponses];
|
|
364
|
+
export type ListInspectionPhotosData = {
|
|
365
|
+
body?: never;
|
|
366
|
+
path: {
|
|
367
|
+
inspection_id: string;
|
|
368
|
+
};
|
|
369
|
+
query?: never;
|
|
370
|
+
url: '/v1/inspections/{inspection_id}/photos';
|
|
371
|
+
};
|
|
372
|
+
export type ListInspectionPhotosErrors = {
|
|
373
|
+
/**
|
|
374
|
+
* Missing or invalid token.
|
|
375
|
+
*/
|
|
376
|
+
401: Error;
|
|
377
|
+
/**
|
|
378
|
+
* Insufficient scope.
|
|
379
|
+
*/
|
|
380
|
+
403: Error;
|
|
381
|
+
/**
|
|
382
|
+
* Not found.
|
|
383
|
+
*/
|
|
384
|
+
404: Error;
|
|
385
|
+
};
|
|
386
|
+
export type ListInspectionPhotosError = ListInspectionPhotosErrors[keyof ListInspectionPhotosErrors];
|
|
387
|
+
export type ListInspectionPhotosResponses = {
|
|
388
|
+
/**
|
|
389
|
+
* Inspection photos.
|
|
390
|
+
*/
|
|
391
|
+
200: InspectionPhotos;
|
|
392
|
+
};
|
|
393
|
+
export type ListInspectionPhotosResponse = ListInspectionPhotosResponses[keyof ListInspectionPhotosResponses];
|
|
394
|
+
export type GetInspectionReportData = {
|
|
395
|
+
body?: never;
|
|
396
|
+
path: {
|
|
397
|
+
inspection_id: string;
|
|
398
|
+
};
|
|
399
|
+
query?: never;
|
|
400
|
+
url: '/v1/inspections/{inspection_id}/report.pdf';
|
|
401
|
+
};
|
|
402
|
+
export type GetInspectionReportErrors = {
|
|
403
|
+
/**
|
|
404
|
+
* Missing or invalid token.
|
|
405
|
+
*/
|
|
406
|
+
401: Error;
|
|
407
|
+
/**
|
|
408
|
+
* Insufficient scope.
|
|
409
|
+
*/
|
|
410
|
+
403: Error;
|
|
411
|
+
/**
|
|
412
|
+
* Not found.
|
|
413
|
+
*/
|
|
414
|
+
404: Error;
|
|
415
|
+
/**
|
|
416
|
+
* Report rendering not yet available.
|
|
417
|
+
*/
|
|
418
|
+
501: Error;
|
|
419
|
+
};
|
|
420
|
+
export type GetInspectionReportError = GetInspectionReportErrors[keyof GetInspectionReportErrors];
|
|
421
|
+
export type GetInspectionReportResponses = {
|
|
422
|
+
/**
|
|
423
|
+
* Signed report URL.
|
|
424
|
+
*/
|
|
425
|
+
200: ReportUrl;
|
|
426
|
+
};
|
|
427
|
+
export type GetInspectionReportResponse = GetInspectionReportResponses[keyof GetInspectionReportResponses];
|
|
428
|
+
export type ListWebhooksData = {
|
|
429
|
+
body?: never;
|
|
430
|
+
path?: never;
|
|
431
|
+
query?: never;
|
|
432
|
+
url: '/v1/webhooks';
|
|
433
|
+
};
|
|
434
|
+
export type ListWebhooksErrors = {
|
|
435
|
+
/**
|
|
436
|
+
* Missing or invalid token.
|
|
437
|
+
*/
|
|
438
|
+
401: Error;
|
|
439
|
+
};
|
|
440
|
+
export type ListWebhooksError = ListWebhooksErrors[keyof ListWebhooksErrors];
|
|
441
|
+
export type ListWebhooksResponses = {
|
|
442
|
+
/**
|
|
443
|
+
* The tenant's endpoints.
|
|
444
|
+
*/
|
|
445
|
+
200: WebhookList;
|
|
446
|
+
};
|
|
447
|
+
export type ListWebhooksResponse = ListWebhooksResponses[keyof ListWebhooksResponses];
|
|
448
|
+
export type CreateWebhookData = {
|
|
449
|
+
body?: RegisterWebhook;
|
|
450
|
+
path?: never;
|
|
451
|
+
query?: never;
|
|
452
|
+
url: '/v1/webhooks';
|
|
453
|
+
};
|
|
454
|
+
export type CreateWebhookErrors = {
|
|
455
|
+
/**
|
|
456
|
+
* Invalid request.
|
|
457
|
+
*/
|
|
458
|
+
400: Error;
|
|
459
|
+
/**
|
|
460
|
+
* Missing or invalid token.
|
|
461
|
+
*/
|
|
462
|
+
401: Error;
|
|
463
|
+
};
|
|
464
|
+
export type CreateWebhookError = CreateWebhookErrors[keyof CreateWebhookErrors];
|
|
465
|
+
export type CreateWebhookResponses = {
|
|
466
|
+
/**
|
|
467
|
+
* The registered endpoint, including the one-time signing secret.
|
|
468
|
+
*/
|
|
469
|
+
201: RegisteredWebhook;
|
|
470
|
+
};
|
|
471
|
+
export type CreateWebhookResponse = CreateWebhookResponses[keyof CreateWebhookResponses];
|
|
472
|
+
export type DeleteWebhookData = {
|
|
473
|
+
body?: never;
|
|
474
|
+
path: {
|
|
475
|
+
id: string;
|
|
476
|
+
};
|
|
477
|
+
query?: never;
|
|
478
|
+
url: '/v1/webhooks/{id}';
|
|
479
|
+
};
|
|
480
|
+
export type DeleteWebhookErrors = {
|
|
481
|
+
/**
|
|
482
|
+
* Missing or invalid token.
|
|
483
|
+
*/
|
|
484
|
+
401: Error;
|
|
485
|
+
/**
|
|
486
|
+
* Not found.
|
|
487
|
+
*/
|
|
488
|
+
404: Error;
|
|
489
|
+
};
|
|
490
|
+
export type DeleteWebhookError = DeleteWebhookErrors[keyof DeleteWebhookErrors];
|
|
491
|
+
export type DeleteWebhookResponses = {
|
|
492
|
+
/**
|
|
493
|
+
* Deleted.
|
|
494
|
+
*/
|
|
495
|
+
200: {
|
|
496
|
+
id: string;
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
export type DeleteWebhookResponse = DeleteWebhookResponses[keyof DeleteWebhookResponses];
|
|
500
|
+
export type GetSponsorOutcomesData = {
|
|
501
|
+
body?: never;
|
|
502
|
+
path: {
|
|
503
|
+
sponsor_id: string;
|
|
504
|
+
};
|
|
505
|
+
query: {
|
|
506
|
+
/**
|
|
507
|
+
* Quarter, e.g. 2026-Q2.
|
|
508
|
+
*/
|
|
509
|
+
period: string;
|
|
510
|
+
};
|
|
511
|
+
url: '/v1/sponsors/{sponsor_id}/outcomes';
|
|
512
|
+
};
|
|
513
|
+
export type GetSponsorOutcomesErrors = {
|
|
514
|
+
/**
|
|
515
|
+
* Invalid period.
|
|
516
|
+
*/
|
|
517
|
+
400: Error;
|
|
518
|
+
/**
|
|
519
|
+
* Missing or invalid token.
|
|
520
|
+
*/
|
|
521
|
+
401: Error;
|
|
522
|
+
/**
|
|
523
|
+
* Insufficient scope.
|
|
524
|
+
*/
|
|
525
|
+
403: Error;
|
|
526
|
+
};
|
|
527
|
+
export type GetSponsorOutcomesError = GetSponsorOutcomesErrors[keyof GetSponsorOutcomesErrors];
|
|
528
|
+
export type GetSponsorOutcomesResponses = {
|
|
529
|
+
/**
|
|
530
|
+
* The roll-up.
|
|
531
|
+
*/
|
|
532
|
+
200: SponsorOutcomes;
|
|
533
|
+
};
|
|
534
|
+
export type GetSponsorOutcomesResponse = GetSponsorOutcomesResponses[keyof GetSponsorOutcomesResponses];
|
|
535
|
+
//# sourceMappingURL=types.gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.gen.d.ts","sourceRoot":"","sources":["../../src/generated/types.gen.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,8BAA8B,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACjB,MAAM,EAAE,IAAI,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE;QACD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KAC1B,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAClB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACf,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI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CAAC;CACd,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,CAAC,MAAM,wBAAwB,CAAC,CAAC;AAE/F,MAAM,MAAM,2BAA2B,GAAG;IACtC;;OAEG;IACH,GAAG,EAAE,eAAe,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,2BAA2B,CAAC,MAAM,2BAA2B,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./generated/index.js";
|
|
2
|
+
export { createClient, ApiError, DEFAULT_BASE_URL, type StormwaterIQClientOptions, } from "./client.js";
|
|
3
|
+
export { createRetryingFetch, type RetryingFetchOptions } from "./retry.js";
|
|
4
|
+
export * as webhooks from "./webhooks.js";
|
|
5
|
+
export { verify as verifyWebhook, SIGNATURE_TOLERANCE_SECONDS, } from "./webhooks.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,KAAK,yBAAyB,GAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAG5E,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,MAAM,IAAI,aAAa,EACvB,2BAA2B,GAC5B,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Generated typed surface: operation functions (`listSites`, `getSite`, …) and
|
|
2
|
+
// all request/response types, derived from the gateway's OpenAPI document.
|
|
3
|
+
export * from "./generated/index.js";
|
|
4
|
+
// Configured-client factory + error envelope layered over the generated core.
|
|
5
|
+
export { createClient, ApiError, DEFAULT_BASE_URL, } from "./client.js";
|
|
6
|
+
export { createRetryingFetch } from "./retry.js";
|
|
7
|
+
// Reference webhook-signature verifier (byte-identical to the server + Python SDK).
|
|
8
|
+
export * as webhooks from "./webhooks.js";
|
|
9
|
+
export { verify as verifyWebhook, SIGNATURE_TOLERANCE_SECONDS, } from "./webhooks.js";
|
package/dist/retry.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrying `fetch` wrapper for the StormwaterIQ client. Plugs into the generated
|
|
3
|
+
* hey-api client's `fetch` option so every SDK call inherits the same policy:
|
|
4
|
+
* retry 429 (honoring `Retry-After`) and 5xx with exponential backoff (capped at
|
|
5
|
+
* 8s); everything else is returned to the client as-is and fails fast.
|
|
6
|
+
*
|
|
7
|
+
* Requests are cloned per attempt so retried POST/PATCH bodies aren't consumed.
|
|
8
|
+
*/
|
|
9
|
+
export type RetryingFetchOptions = {
|
|
10
|
+
/** Underlying fetch implementation (defaults to `globalThis.fetch`). */
|
|
11
|
+
fetch?: typeof fetch;
|
|
12
|
+
/** Max automatic retries on 429 / 5xx (default 3). */
|
|
13
|
+
maxRetries?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function createRetryingFetch(opts?: RetryingFetchOptions): typeof fetch;
|
|
16
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,MAAM,oBAAoB,GAAG;IACjC,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,IAAI,GAAE,oBAAyB,GAC9B,OAAO,KAAK,CAwBd"}
|
package/dist/retry.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrying `fetch` wrapper for the StormwaterIQ client. Plugs into the generated
|
|
3
|
+
* hey-api client's `fetch` option so every SDK call inherits the same policy:
|
|
4
|
+
* retry 429 (honoring `Retry-After`) and 5xx with exponential backoff (capped at
|
|
5
|
+
* 8s); everything else is returned to the client as-is and fails fast.
|
|
6
|
+
*
|
|
7
|
+
* Requests are cloned per attempt so retried POST/PATCH bodies aren't consumed.
|
|
8
|
+
*/
|
|
9
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
10
|
+
export function createRetryingFetch(opts = {}) {
|
|
11
|
+
const baseFetch = opts.fetch ?? globalThis.fetch;
|
|
12
|
+
const maxRetries = opts.maxRetries ?? 3;
|
|
13
|
+
return async (input, init) => {
|
|
14
|
+
let attempt = 0;
|
|
15
|
+
for (;;) {
|
|
16
|
+
// Clone the Request each attempt: a Request body is a single-use stream,
|
|
17
|
+
// so a bare retry of the same object would send an empty body.
|
|
18
|
+
const target = input instanceof Request ? input.clone() : input;
|
|
19
|
+
const res = await baseFetch(target, init);
|
|
20
|
+
const retryable = res.status === 429 || res.status >= 500;
|
|
21
|
+
if (!retryable || attempt >= maxRetries)
|
|
22
|
+
return res;
|
|
23
|
+
const retryAfter = Number(res.headers.get("retry-after"));
|
|
24
|
+
const waitMs = Number.isFinite(retryAfter) && retryAfter > 0
|
|
25
|
+
? retryAfter * 1000
|
|
26
|
+
: Math.min(2 ** attempt * 250, 8000);
|
|
27
|
+
await sleep(waitMs);
|
|
28
|
+
attempt += 1;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference webhook-signature verifier for the StormwaterIQ external API
|
|
3
|
+
* (docs/external-api.md §06). Byte-identical to the server's `verifyWebhook`
|
|
4
|
+
* (packages/api) and the Python SDK — all three are pinned to the shared vectors in
|
|
5
|
+
* fixtures/webhook-signature-vectors.json. Tenants call this rather than re-rolling
|
|
6
|
+
* HMAC code.
|
|
7
|
+
*
|
|
8
|
+
* Header form: `t=<unix_ts>,v1=<hmac_sha256_hex>` over the message `"<t>.<rawBody>"`.
|
|
9
|
+
* The timestamp is inside the signed material, so a tampered timestamp invalidates the
|
|
10
|
+
* signature — that is what lets us reject replays by age without trusting the clock.
|
|
11
|
+
*/
|
|
12
|
+
/** Deliveries older than this (seconds) are rejected as replays (§06). */
|
|
13
|
+
export declare const SIGNATURE_TOLERANCE_SECONDS = 300;
|
|
14
|
+
/**
|
|
15
|
+
* Verify a webhook delivery. Returns `true` only when the signature matches the
|
|
16
|
+
* payload under `secret` AND the signed timestamp is within `toleranceSec` of now.
|
|
17
|
+
* Tampered bodies, wrong secrets, malformed headers, and stale/replayed deliveries
|
|
18
|
+
* all return `false`.
|
|
19
|
+
*
|
|
20
|
+
* @param payload the raw request body string exactly as received
|
|
21
|
+
* @param signature the `X-StormwaterIQ-Signature` header value
|
|
22
|
+
* @param secret the endpoint's signing secret
|
|
23
|
+
*/
|
|
24
|
+
export declare function verify(payload: string, signature: string, secret: string, opts?: {
|
|
25
|
+
toleranceSec?: number;
|
|
26
|
+
nowSec?: number;
|
|
27
|
+
}): boolean;
|
|
28
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B,MAAM,CAAC;AA4B/C;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,OAAO,CAYT"}
|