@openmeter/sdk 1.0.0-beta.5 → 1.0.0-beta.51
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 +89 -5
- package/dist/clients/client.js +3 -1
- package/dist/clients/event.d.ts +16 -2
- package/dist/clients/event.js +39 -18
- package/dist/clients/meter.d.ts +26 -7
- package/dist/clients/meter.js +13 -3
- package/dist/clients/portal.d.ts +22 -0
- package/dist/clients/portal.js +36 -0
- package/dist/clients/subject.d.ts +27 -0
- package/dist/clients/subject.js +55 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +7 -1
- package/dist/schemas/openapi.d.ts +337 -123
- package/dist/test/agent.js +153 -3
- package/dist/test/mocks.d.ts +4 -1
- package/dist/test/mocks.js +19 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/index.ts +8 -7
- package/package.json +30 -31
|
@@ -3,29 +3,54 @@
|
|
|
3
3
|
* Do not make direct changes to the file.
|
|
4
4
|
*/
|
|
5
5
|
export interface paths {
|
|
6
|
-
|
|
6
|
+
'/api/v1/events': {
|
|
7
|
+
/** @description Retrieve latest raw events. */
|
|
8
|
+
get: operations['listEvents'];
|
|
7
9
|
/** @description Ingest events */
|
|
8
|
-
post: operations[
|
|
10
|
+
post: operations['ingestEvents'];
|
|
9
11
|
};
|
|
10
|
-
|
|
12
|
+
'/api/v1/meters': {
|
|
11
13
|
/** @description List meters */
|
|
12
|
-
get: operations[
|
|
14
|
+
get: operations['listMeters'];
|
|
13
15
|
/** @description Create meter */
|
|
14
|
-
post: operations[
|
|
16
|
+
post: operations['createMeter'];
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
'/api/v1/meters/{meterIdOrSlug}': {
|
|
17
19
|
/** @description Get meter by slugs */
|
|
18
|
-
get: operations[
|
|
20
|
+
get: operations['getMeter'];
|
|
19
21
|
/** @description Delete meter by slug */
|
|
20
|
-
delete: operations[
|
|
22
|
+
delete: operations['deleteMeter'];
|
|
21
23
|
};
|
|
22
|
-
|
|
23
|
-
/** @description
|
|
24
|
-
get: operations[
|
|
24
|
+
'/api/v1/meters/{meterIdOrSlug}/query': {
|
|
25
|
+
/** @description Query meter */
|
|
26
|
+
get: operations['queryMeter'];
|
|
25
27
|
};
|
|
26
|
-
|
|
27
|
-
/** @description
|
|
28
|
-
|
|
28
|
+
'/api/v1/meters/{meterIdOrSlug}/subjects': {
|
|
29
|
+
/** @description List meter subjects */
|
|
30
|
+
get: operations['listMeterSubjects'];
|
|
31
|
+
};
|
|
32
|
+
'/api/v1/portal/tokens': {
|
|
33
|
+
get: operations['listPortalTokens'];
|
|
34
|
+
post: operations['createPortalToken'];
|
|
35
|
+
};
|
|
36
|
+
'/api/v1/portal/tokens/invalidate': {
|
|
37
|
+
post: operations['invalidatePortalTokens'];
|
|
38
|
+
};
|
|
39
|
+
'/api/v1/subjects': {
|
|
40
|
+
get: operations['listSubjects'];
|
|
41
|
+
/**
|
|
42
|
+
* @description Upserts a subject. Creates or updates subject.
|
|
43
|
+
* If the subject doesn't exist, it will be created.
|
|
44
|
+
* If the subject exists, it will be partially updated with the provided fields.
|
|
45
|
+
*/
|
|
46
|
+
post: operations['upsertSubject'];
|
|
47
|
+
};
|
|
48
|
+
'/api/v1/subjects/{subjectIdOrKey}': {
|
|
49
|
+
get: operations['getSubject'];
|
|
50
|
+
delete: operations['deleteSubject'];
|
|
51
|
+
};
|
|
52
|
+
'/api/v1/portal/meters/{meterSlug}/query': {
|
|
53
|
+
get: operations['queryPortalMeter'];
|
|
29
54
|
};
|
|
30
55
|
}
|
|
31
56
|
export type webhooks = Record<string, never>;
|
|
@@ -100,7 +125,7 @@ export interface components {
|
|
|
100
125
|
* @example application/json
|
|
101
126
|
* @enum {string|null}
|
|
102
127
|
*/
|
|
103
|
-
datacontenttype?:
|
|
128
|
+
datacontenttype?: 'application/json' | null;
|
|
104
129
|
/**
|
|
105
130
|
* Format: uri
|
|
106
131
|
* @description Identifies the schema that data adheres to.
|
|
@@ -128,6 +153,10 @@ export interface components {
|
|
|
128
153
|
[key: string]: unknown;
|
|
129
154
|
};
|
|
130
155
|
};
|
|
156
|
+
IngestedEvent: {
|
|
157
|
+
event: components['schemas']['Event'];
|
|
158
|
+
validationError?: string;
|
|
159
|
+
};
|
|
131
160
|
Meter: {
|
|
132
161
|
/**
|
|
133
162
|
* @description A unique identifier for the meter.
|
|
@@ -136,7 +165,7 @@ export interface components {
|
|
|
136
165
|
id?: string;
|
|
137
166
|
/**
|
|
138
167
|
* @description A unique identifier for the meter.
|
|
139
|
-
* @example
|
|
168
|
+
* @example my_meter
|
|
140
169
|
*/
|
|
141
170
|
slug: string;
|
|
142
171
|
/**
|
|
@@ -144,7 +173,8 @@ export interface components {
|
|
|
144
173
|
* @example My Meter Description
|
|
145
174
|
*/
|
|
146
175
|
description?: string | null;
|
|
147
|
-
aggregation: components[
|
|
176
|
+
aggregation: components['schemas']['MeterAggregation'];
|
|
177
|
+
windowSize: components['schemas']['WindowSize'];
|
|
148
178
|
/**
|
|
149
179
|
* @description The event type to aggregate.
|
|
150
180
|
* @example api_request
|
|
@@ -154,101 +184,177 @@ export interface components {
|
|
|
154
184
|
* @description JSONPath expression to extract the value from the event data.
|
|
155
185
|
* @example $.duration_ms
|
|
156
186
|
*/
|
|
157
|
-
valueProperty
|
|
187
|
+
valueProperty?: string;
|
|
158
188
|
/**
|
|
159
189
|
* @description Named JSONPath expressions to extract the group by values from the event data.
|
|
160
190
|
* @example {
|
|
161
|
-
* "
|
|
191
|
+
* "method": "$.method",
|
|
162
192
|
* "path": "$.path"
|
|
163
193
|
* }
|
|
164
194
|
*/
|
|
165
195
|
groupBy?: {
|
|
166
196
|
[key: string]: string;
|
|
167
197
|
};
|
|
168
|
-
windowSize: components["schemas"]["WindowSize"];
|
|
169
198
|
};
|
|
170
199
|
/**
|
|
171
200
|
* @description The aggregation type to use for the meter.
|
|
172
201
|
* @enum {string}
|
|
173
202
|
*/
|
|
174
|
-
MeterAggregation:
|
|
175
|
-
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
203
|
+
MeterAggregation: 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX';
|
|
204
|
+
/**
|
|
205
|
+
* @description Aggregation window size.
|
|
206
|
+
* @enum {string}
|
|
207
|
+
*/
|
|
208
|
+
WindowSize: 'MINUTE' | 'HOUR' | 'DAY';
|
|
209
|
+
MeterQueryResult: {
|
|
210
|
+
/** Format: date-time */
|
|
211
|
+
from?: string;
|
|
212
|
+
/** Format: date-time */
|
|
213
|
+
to?: string;
|
|
214
|
+
windowSize?: components['schemas']['WindowSize'];
|
|
215
|
+
data: components['schemas']['MeterQueryRow'][];
|
|
216
|
+
};
|
|
217
|
+
MeterQueryRow: {
|
|
218
|
+
value: number;
|
|
180
219
|
/** Format: date-time */
|
|
181
220
|
windowStart: string;
|
|
182
221
|
/** Format: date-time */
|
|
183
222
|
windowEnd: string;
|
|
184
|
-
value
|
|
223
|
+
/** @description The subject of the meter value. */
|
|
224
|
+
subject?: string | null;
|
|
185
225
|
groupBy?: {
|
|
186
226
|
[key: string]: string;
|
|
187
227
|
} | null;
|
|
188
228
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
229
|
+
PortalToken: {
|
|
230
|
+
id: string;
|
|
231
|
+
subject: string;
|
|
232
|
+
/** Format: date-time */
|
|
233
|
+
expiresAt: string;
|
|
234
|
+
expired?: boolean;
|
|
235
|
+
/** Format: date-time */
|
|
236
|
+
createdAt: string;
|
|
237
|
+
/** @description The token is only returned at creation. */
|
|
238
|
+
token?: string;
|
|
239
|
+
/** @description Optional, if defined only the specified meters will be allowed */
|
|
240
|
+
allowedMeterSlugs?: string[];
|
|
241
|
+
};
|
|
242
|
+
Subject: {
|
|
243
|
+
id: string;
|
|
244
|
+
key: string;
|
|
245
|
+
displayName?: string | null;
|
|
246
|
+
metadata?: {
|
|
247
|
+
[key: string]: unknown;
|
|
248
|
+
};
|
|
249
|
+
/** Format: date-time */
|
|
250
|
+
currentPeriodStart?: string | null;
|
|
251
|
+
/** Format: date-time */
|
|
252
|
+
currentPeriodEnd?: string | null;
|
|
253
|
+
stripeCustomerId?: string | null;
|
|
196
254
|
};
|
|
255
|
+
IdOrSlug: string;
|
|
197
256
|
};
|
|
198
257
|
responses: {
|
|
199
258
|
/** @description Bad Request */
|
|
200
259
|
BadRequestProblemResponse: {
|
|
201
260
|
content: {
|
|
202
|
-
|
|
261
|
+
'application/problem+json': components['schemas']['Problem'];
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
/** @description Unauthorized */
|
|
265
|
+
UnauthorizedProblemResponse: {
|
|
266
|
+
content: {
|
|
267
|
+
'application/problem+json': components['schemas']['Problem'];
|
|
203
268
|
};
|
|
204
269
|
};
|
|
205
270
|
/** @description Method not allowed, feature not supported */
|
|
206
271
|
MethodNotAllowedProblemResponse: {
|
|
207
272
|
content: {
|
|
208
|
-
|
|
273
|
+
'application/problem+json': components['schemas']['Problem'];
|
|
209
274
|
};
|
|
210
275
|
};
|
|
211
276
|
/** @description Not Found */
|
|
212
277
|
NotFoundProblemResponse: {
|
|
213
278
|
content: {
|
|
214
|
-
|
|
279
|
+
'application/problem+json': components['schemas']['Problem'];
|
|
215
280
|
};
|
|
216
281
|
};
|
|
217
282
|
/** @description Not Implemented */
|
|
218
283
|
NotImplementedProblemResponse: {
|
|
219
284
|
content: {
|
|
220
|
-
|
|
285
|
+
'application/problem+json': components['schemas']['Problem'];
|
|
221
286
|
};
|
|
222
287
|
};
|
|
223
288
|
/** @description Unexpected error */
|
|
224
289
|
UnexpectedProblemResponse: {
|
|
225
290
|
content: {
|
|
226
|
-
|
|
291
|
+
'application/problem+json': components['schemas']['Problem'];
|
|
227
292
|
};
|
|
228
293
|
};
|
|
229
294
|
};
|
|
230
295
|
parameters: {
|
|
231
296
|
/** @description A unique identifier for the meter. */
|
|
232
|
-
meterIdOrSlug: components[
|
|
233
|
-
/** @description
|
|
234
|
-
|
|
297
|
+
meterIdOrSlug: components['schemas']['IdOrSlug'];
|
|
298
|
+
/** @description A unique identifier for a subject. */
|
|
299
|
+
subjectIdOrKey: string;
|
|
300
|
+
/**
|
|
301
|
+
* @description Start date-time in RFC 3339 format.
|
|
302
|
+
* Inclusive.
|
|
303
|
+
*/
|
|
304
|
+
queryFrom?: string;
|
|
305
|
+
/**
|
|
306
|
+
* @description End date-time in RFC 3339 format.
|
|
307
|
+
* Inclusive.
|
|
308
|
+
*/
|
|
309
|
+
queryTo?: string;
|
|
310
|
+
/** @description If not specified, a single usage aggregate will be returned for the entirety of the specified period for each subject and group. */
|
|
311
|
+
queryWindowSize?: components['schemas']['WindowSize'];
|
|
312
|
+
/**
|
|
313
|
+
* @description The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones).
|
|
314
|
+
* If not specified, the UTC timezone will be used.
|
|
315
|
+
*/
|
|
316
|
+
queryWindowTimeZone?: string;
|
|
317
|
+
querySubject?: string[];
|
|
318
|
+
/**
|
|
319
|
+
* @description If not specified a single aggregate will be returned for each subject and time window.
|
|
320
|
+
* `subject` is a reserved group by value.
|
|
321
|
+
*/
|
|
322
|
+
queryGroupBy?: string[];
|
|
235
323
|
};
|
|
236
324
|
requestBodies: never;
|
|
237
325
|
headers: never;
|
|
238
326
|
pathItems: never;
|
|
239
327
|
}
|
|
328
|
+
export type $defs = Record<string, never>;
|
|
240
329
|
export type external = Record<string, never>;
|
|
241
330
|
export interface operations {
|
|
242
|
-
/** @description
|
|
243
|
-
|
|
331
|
+
/** @description Retrieve latest raw events. */
|
|
332
|
+
listEvents: {
|
|
244
333
|
parameters: {
|
|
245
|
-
|
|
246
|
-
|
|
334
|
+
query?: {
|
|
335
|
+
from?: components['parameters']['queryFrom'];
|
|
336
|
+
to?: components['parameters']['queryTo'];
|
|
337
|
+
/** @description Number of events to return. */
|
|
338
|
+
limit?: number;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
responses: {
|
|
342
|
+
/** @description Events response */
|
|
343
|
+
200: {
|
|
344
|
+
content: {
|
|
345
|
+
'application/json': components['schemas']['IngestedEvent'][];
|
|
346
|
+
};
|
|
247
347
|
};
|
|
348
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
349
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
248
350
|
};
|
|
351
|
+
};
|
|
352
|
+
/** @description Ingest events */
|
|
353
|
+
ingestEvents: {
|
|
249
354
|
requestBody: {
|
|
250
355
|
content: {
|
|
251
|
-
|
|
356
|
+
'application/cloudevents+json': components['schemas']['Event'];
|
|
357
|
+
'application/cloudevents-batch+json': components['schemas']['Event'][];
|
|
252
358
|
};
|
|
253
359
|
};
|
|
254
360
|
responses: {
|
|
@@ -256,80 +362,64 @@ export interface operations {
|
|
|
256
362
|
204: {
|
|
257
363
|
content: never;
|
|
258
364
|
};
|
|
259
|
-
400: components[
|
|
260
|
-
default: components[
|
|
365
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
366
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
261
367
|
};
|
|
262
368
|
};
|
|
263
369
|
/** @description List meters */
|
|
264
370
|
listMeters: {
|
|
265
|
-
parameters: {
|
|
266
|
-
header?: {
|
|
267
|
-
"OM-Namespace"?: components["parameters"]["namespaceParam"];
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
371
|
responses: {
|
|
271
372
|
/** @description Meters response */
|
|
272
373
|
200: {
|
|
273
374
|
content: {
|
|
274
|
-
|
|
375
|
+
'application/json': components['schemas']['Meter'][];
|
|
275
376
|
};
|
|
276
377
|
};
|
|
277
|
-
default: components[
|
|
378
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
278
379
|
};
|
|
279
380
|
};
|
|
280
381
|
/** @description Create meter */
|
|
281
382
|
createMeter: {
|
|
282
|
-
parameters: {
|
|
283
|
-
header?: {
|
|
284
|
-
"OM-Namespace"?: components["parameters"]["namespaceParam"];
|
|
285
|
-
};
|
|
286
|
-
};
|
|
287
383
|
requestBody: {
|
|
288
384
|
content: {
|
|
289
|
-
|
|
385
|
+
'application/json': components['schemas']['Meter'];
|
|
290
386
|
};
|
|
291
387
|
};
|
|
292
388
|
responses: {
|
|
293
389
|
/** @description Created */
|
|
294
390
|
201: {
|
|
295
391
|
content: {
|
|
296
|
-
|
|
392
|
+
'application/json': components['schemas']['Meter'];
|
|
297
393
|
};
|
|
298
394
|
};
|
|
299
|
-
400: components[
|
|
300
|
-
501: components[
|
|
301
|
-
default: components[
|
|
395
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
396
|
+
501: components['responses']['NotImplementedProblemResponse'];
|
|
397
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
302
398
|
};
|
|
303
399
|
};
|
|
304
400
|
/** @description Get meter by slugs */
|
|
305
401
|
getMeter: {
|
|
306
402
|
parameters: {
|
|
307
|
-
header?: {
|
|
308
|
-
"OM-Namespace"?: components["parameters"]["namespaceParam"];
|
|
309
|
-
};
|
|
310
403
|
path: {
|
|
311
|
-
meterIdOrSlug: components[
|
|
404
|
+
meterIdOrSlug: components['parameters']['meterIdOrSlug'];
|
|
312
405
|
};
|
|
313
406
|
};
|
|
314
407
|
responses: {
|
|
315
408
|
/** @description OK */
|
|
316
409
|
200: {
|
|
317
410
|
content: {
|
|
318
|
-
|
|
411
|
+
'application/json': components['schemas']['Meter'];
|
|
319
412
|
};
|
|
320
413
|
};
|
|
321
|
-
404: components[
|
|
322
|
-
default: components[
|
|
414
|
+
404: components['responses']['NotFoundProblemResponse'];
|
|
415
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
323
416
|
};
|
|
324
417
|
};
|
|
325
418
|
/** @description Delete meter by slug */
|
|
326
419
|
deleteMeter: {
|
|
327
420
|
parameters: {
|
|
328
|
-
header?: {
|
|
329
|
-
"OM-Namespace"?: components["parameters"]["namespaceParam"];
|
|
330
|
-
};
|
|
331
421
|
path: {
|
|
332
|
-
meterIdOrSlug: components[
|
|
422
|
+
meterIdOrSlug: components['parameters']['meterIdOrSlug'];
|
|
333
423
|
};
|
|
334
424
|
};
|
|
335
425
|
responses: {
|
|
@@ -337,75 +427,199 @@ export interface operations {
|
|
|
337
427
|
204: {
|
|
338
428
|
content: never;
|
|
339
429
|
};
|
|
340
|
-
404: components[
|
|
341
|
-
501: components[
|
|
342
|
-
default: components[
|
|
430
|
+
404: components['responses']['NotFoundProblemResponse'];
|
|
431
|
+
501: components['responses']['NotImplementedProblemResponse'];
|
|
432
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
343
433
|
};
|
|
344
434
|
};
|
|
345
|
-
/** @description
|
|
346
|
-
|
|
435
|
+
/** @description Query meter */
|
|
436
|
+
queryMeter: {
|
|
347
437
|
parameters: {
|
|
348
438
|
query?: {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
from?: string;
|
|
356
|
-
/**
|
|
357
|
-
* @description End date-time in RFC 3339 format.
|
|
358
|
-
* Must be aligned with the window size.
|
|
359
|
-
* Inclusive.
|
|
360
|
-
*/
|
|
361
|
-
to?: string;
|
|
362
|
-
/** @description If not specified, a single usage aggregate will be returned for the entirety of the specified period for each subject and group. */
|
|
363
|
-
windowSize?: components["schemas"]["WindowSize"];
|
|
364
|
-
/**
|
|
365
|
-
* @description If not specified, OpenMeter will use the default aggregation type.
|
|
366
|
-
* As OpenMeter stores aggregates defined by meter config, passing a different aggregate can lead to inaccurate results.
|
|
367
|
-
* For example getting the MIN of SUMs.
|
|
368
|
-
*/
|
|
369
|
-
aggregation?: components["schemas"]["MeterAggregation"];
|
|
370
|
-
/** @description If not specified a single aggregate will be returned for each subject and time window. */
|
|
371
|
-
groupBy?: string;
|
|
372
|
-
};
|
|
373
|
-
header?: {
|
|
374
|
-
"OM-Namespace"?: components["parameters"]["namespaceParam"];
|
|
439
|
+
from?: components['parameters']['queryFrom'];
|
|
440
|
+
to?: components['parameters']['queryTo'];
|
|
441
|
+
windowSize?: components['parameters']['queryWindowSize'];
|
|
442
|
+
windowTimeZone?: components['parameters']['queryWindowTimeZone'];
|
|
443
|
+
subject?: components['parameters']['querySubject'];
|
|
444
|
+
groupBy?: components['parameters']['queryGroupBy'];
|
|
375
445
|
};
|
|
376
446
|
path: {
|
|
377
|
-
meterIdOrSlug: components[
|
|
447
|
+
meterIdOrSlug: components['parameters']['meterIdOrSlug'];
|
|
378
448
|
};
|
|
379
449
|
};
|
|
380
450
|
responses: {
|
|
381
451
|
/** @description OK */
|
|
382
452
|
200: {
|
|
383
453
|
content: {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
data: components["schemas"]["MeterValue"][];
|
|
387
|
-
};
|
|
454
|
+
'application/json': components['schemas']['MeterQueryResult'];
|
|
455
|
+
'text/csv': string;
|
|
388
456
|
};
|
|
389
457
|
};
|
|
390
|
-
400: components[
|
|
391
|
-
default: components[
|
|
458
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
459
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
392
460
|
};
|
|
393
461
|
};
|
|
394
|
-
/** @description
|
|
395
|
-
|
|
396
|
-
|
|
462
|
+
/** @description List meter subjects */
|
|
463
|
+
listMeterSubjects: {
|
|
464
|
+
parameters: {
|
|
465
|
+
path: {
|
|
466
|
+
meterIdOrSlug: components['parameters']['meterIdOrSlug'];
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
responses: {
|
|
470
|
+
/** @description OK */
|
|
471
|
+
200: {
|
|
472
|
+
content: {
|
|
473
|
+
'application/json': string[];
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
477
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
listPortalTokens: {
|
|
481
|
+
parameters: {
|
|
482
|
+
query?: {
|
|
483
|
+
/** @description Number of portal tokens to return. Default is 25. */
|
|
484
|
+
limit?: number;
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
responses: {
|
|
488
|
+
/** @description OK */
|
|
489
|
+
200: {
|
|
490
|
+
content: {
|
|
491
|
+
'application/json': components['schemas']['PortalToken'][];
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
495
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
createPortalToken: {
|
|
499
|
+
requestBody?: {
|
|
397
500
|
content: {
|
|
398
|
-
|
|
501
|
+
'application/json': components['schemas']['PortalToken'];
|
|
399
502
|
};
|
|
400
503
|
};
|
|
401
504
|
responses: {
|
|
402
|
-
/** @description
|
|
403
|
-
|
|
505
|
+
/** @description OK */
|
|
506
|
+
200: {
|
|
507
|
+
content: {
|
|
508
|
+
'application/json': components['schemas']['PortalToken'];
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
512
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
invalidatePortalTokens: {
|
|
516
|
+
requestBody?: {
|
|
517
|
+
content: {
|
|
518
|
+
'application/json': {
|
|
519
|
+
/** @description Optional portal token ID to invalidate one token by. */
|
|
520
|
+
id?: string;
|
|
521
|
+
/** @description Optional subject to invalidate all tokens for subject. */
|
|
522
|
+
subject?: string;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
responses: {
|
|
527
|
+
/** @description No Content */
|
|
528
|
+
204: {
|
|
529
|
+
content: never;
|
|
530
|
+
};
|
|
531
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
532
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
listSubjects: {
|
|
536
|
+
responses: {
|
|
537
|
+
/** @description OK */
|
|
538
|
+
200: {
|
|
539
|
+
content: {
|
|
540
|
+
'application/json': components['schemas']['Subject'][];
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* @description Upserts a subject. Creates or updates subject.
|
|
548
|
+
* If the subject doesn't exist, it will be created.
|
|
549
|
+
* If the subject exists, it will be partially updated with the provided fields.
|
|
550
|
+
*/
|
|
551
|
+
upsertSubject: {
|
|
552
|
+
requestBody?: {
|
|
553
|
+
content: {
|
|
554
|
+
'application/json': components['schemas']['Subject'][];
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
responses: {
|
|
558
|
+
/** @description OK */
|
|
559
|
+
200: {
|
|
560
|
+
content: {
|
|
561
|
+
'application/json': components['schemas']['Subject'][];
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
565
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
getSubject: {
|
|
569
|
+
parameters: {
|
|
570
|
+
path: {
|
|
571
|
+
subjectIdOrKey: components['parameters']['subjectIdOrKey'];
|
|
572
|
+
};
|
|
573
|
+
};
|
|
574
|
+
responses: {
|
|
575
|
+
/** @description OK */
|
|
576
|
+
200: {
|
|
577
|
+
content: {
|
|
578
|
+
'application/json': components['schemas']['Subject'];
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
deleteSubject: {
|
|
585
|
+
parameters: {
|
|
586
|
+
path: {
|
|
587
|
+
subjectIdOrKey: components['parameters']['subjectIdOrKey'];
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
responses: {
|
|
591
|
+
/** @description No Content */
|
|
592
|
+
204: {
|
|
593
|
+
content: never;
|
|
594
|
+
};
|
|
595
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
596
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
queryPortalMeter: {
|
|
600
|
+
parameters: {
|
|
601
|
+
query?: {
|
|
602
|
+
from?: components['parameters']['queryFrom'];
|
|
603
|
+
to?: components['parameters']['queryTo'];
|
|
604
|
+
windowSize?: components['parameters']['queryWindowSize'];
|
|
605
|
+
windowTimeZone?: components['parameters']['queryWindowTimeZone'];
|
|
606
|
+
groupBy?: components['parameters']['queryGroupBy'];
|
|
607
|
+
};
|
|
608
|
+
path: {
|
|
609
|
+
meterSlug: string;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
responses: {
|
|
613
|
+
/** @description OK */
|
|
614
|
+
200: {
|
|
404
615
|
content: {
|
|
405
|
-
|
|
616
|
+
'application/json': components['schemas']['MeterQueryResult'];
|
|
617
|
+
'text/csv': string;
|
|
406
618
|
};
|
|
407
619
|
};
|
|
408
|
-
|
|
620
|
+
400: components['responses']['BadRequestProblemResponse'];
|
|
621
|
+
401: components['responses']['UnauthorizedProblemResponse'];
|
|
622
|
+
default: components['responses']['UnexpectedProblemResponse'];
|
|
409
623
|
};
|
|
410
624
|
};
|
|
411
625
|
}
|