@openmeter/sdk 1.0.0-beta.197 → 1.0.0-beta.199

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.
@@ -16,11 +16,16 @@ export declare class Meters {
16
16
  */
17
17
  create(meter: MeterCreate, options?: RequestOptions): Promise<{
18
18
  readonly id: string;
19
- slug: string;
20
19
  description?: string;
20
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
21
+ readonly createdAt: Date;
22
+ readonly updatedAt: Date;
23
+ readonly deletedAt?: Date;
24
+ name?: string;
25
+ slug: string;
21
26
  aggregation: import("./schemas.cjs").components["schemas"]["MeterAggregation"];
22
- windowSize?: import("./schemas.cjs").components["schemas"]["WindowSize"];
23
27
  eventType: string;
28
+ eventFrom?: Date;
24
29
  valueProperty?: string;
25
30
  groupBy?: {
26
31
  [key: string]: string;
@@ -34,11 +39,16 @@ export declare class Meters {
34
39
  */
35
40
  get(idOrSlug: operations['getMeter']['parameters']['path']['meterIdOrSlug'], options?: RequestOptions): Promise<{
36
41
  readonly id: string;
37
- slug: string;
38
42
  description?: string;
43
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
44
+ readonly createdAt: Date;
45
+ readonly updatedAt: Date;
46
+ readonly deletedAt?: Date;
47
+ name?: string;
48
+ slug: string;
39
49
  aggregation: import("./schemas.cjs").components["schemas"]["MeterAggregation"];
40
- windowSize?: import("./schemas.cjs").components["schemas"]["WindowSize"];
41
50
  eventType: string;
51
+ eventFrom?: Date;
42
52
  valueProperty?: string;
43
53
  groupBy?: {
44
54
  [key: string]: string;
@@ -51,11 +61,16 @@ export declare class Meters {
51
61
  */
52
62
  list(options?: RequestOptions): Promise<{
53
63
  readonly id: string;
54
- slug: string;
55
64
  description?: string;
65
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
66
+ readonly createdAt: Date;
67
+ readonly updatedAt: Date;
68
+ readonly deletedAt?: Date;
69
+ name?: string;
70
+ slug: string;
56
71
  aggregation: import("./schemas.cjs").components["schemas"]["MeterAggregation"];
57
- windowSize?: import("./schemas.cjs").components["schemas"]["WindowSize"];
58
72
  eventType: string;
73
+ eventFrom?: Date;
59
74
  valueProperty?: string;
60
75
  groupBy?: {
61
76
  [key: string]: string;
@@ -762,6 +762,26 @@ export interface paths {
762
762
  patch?: never;
763
763
  trace?: never;
764
764
  };
765
+ '/api/v1/info/progress/{id}': {
766
+ parameters: {
767
+ query?: never;
768
+ header?: never;
769
+ path?: never;
770
+ cookie?: never;
771
+ };
772
+ /**
773
+ * Get progress
774
+ * @description Get progress
775
+ */
776
+ get: operations['getProgress'];
777
+ put?: never;
778
+ post?: never;
779
+ delete?: never;
780
+ options?: never;
781
+ head?: never;
782
+ patch?: never;
783
+ trace?: never;
784
+ };
765
785
  '/api/v1/marketplace/listings': {
766
786
  parameters: {
767
787
  query?: never;
@@ -5082,53 +5102,87 @@ export interface components {
5082
5102
  * @example {
5083
5103
  * "id": "01G65Z755AFWAKHE12NY0CQ9FH",
5084
5104
  * "slug": "tokens_total",
5105
+ * "name": "Tokens Total",
5085
5106
  * "description": "AI Token Usage",
5086
5107
  * "aggregation": "SUM",
5087
- * "windowSize": "MINUTE",
5088
5108
  * "eventType": "prompt",
5089
5109
  * "valueProperty": "$.tokens",
5090
5110
  * "groupBy": {
5091
5111
  * "model": "$.model",
5092
5112
  * "type": "$.type"
5093
- * }
5113
+ * },
5114
+ * "createdAt": "2024-01-01T01:01:01.001Z",
5115
+ * "updatedAt": "2024-01-01T01:01:01.001Z"
5094
5116
  * }
5095
5117
  */
5096
5118
  Meter: {
5097
5119
  /**
5098
- * @description A unique identifier for the meter.
5120
+ * ID
5121
+ * @description A unique identifier for the resource.
5099
5122
  * @example 01G65Z755AFWAKHE12NY0CQ9FH
5100
5123
  */
5101
5124
  readonly id: string;
5125
+ /**
5126
+ * Description
5127
+ * @description Optional description of the resource. Maximum 1024 characters.
5128
+ */
5129
+ description?: string;
5130
+ /**
5131
+ * Metadata
5132
+ * @description Additional metadata for the resource.
5133
+ */
5134
+ metadata?: components['schemas']['Metadata'] | null;
5135
+ /**
5136
+ * Creation Time
5137
+ * Format: date-time
5138
+ * @description Timestamp of when the resource was created.
5139
+ * @example 2024-01-01T01:01:01.001Z
5140
+ */
5141
+ readonly createdAt: Date;
5142
+ /**
5143
+ * Last Update Time
5144
+ * Format: date-time
5145
+ * @description Timestamp of when the resource was last updated.
5146
+ * @example 2024-01-01T01:01:01.001Z
5147
+ */
5148
+ readonly updatedAt: Date;
5149
+ /**
5150
+ * Deletion Time
5151
+ * Format: date-time
5152
+ * @description Timestamp of when the resource was permanently deleted.
5153
+ * @example 2024-01-01T01:01:01.001Z
5154
+ */
5155
+ readonly deletedAt?: Date;
5156
+ /**
5157
+ * Display name
5158
+ * @description Human-readable name for the resource. Between 1 and 256 characters.
5159
+ * Defaults to the slug if not specified.
5160
+ */
5161
+ name?: string;
5102
5162
  /**
5103
5163
  * @description A unique, human-readable identifier for the meter.
5104
5164
  * Must consist only alphanumeric and underscore characters.
5105
5165
  * @example tokens_total
5106
5166
  */
5107
5167
  slug: string;
5108
- /**
5109
- * @description A description of the meter.
5110
- * @example AI Token Usage
5111
- */
5112
- description?: string;
5113
5168
  /**
5114
5169
  * @description The aggregation type to use for the meter.
5115
5170
  * @example SUM
5116
5171
  */
5117
5172
  aggregation: components['schemas']['MeterAggregation'];
5118
- /**
5119
- * @description The window size that the usage is stored in.
5120
- * This controls the query granularity of the usage data.
5121
- * The larger the window size, the less space is used to store the data.
5122
- * By default, the window size is a minute.
5123
- * @default MINUTE
5124
- * @example MINUTE
5125
- */
5126
- windowSize?: components['schemas']['WindowSize'];
5127
5173
  /**
5128
5174
  * @description The event type to aggregate.
5129
5175
  * @example prompt
5130
5176
  */
5131
5177
  eventType: string;
5178
+ /**
5179
+ * Format: date-time
5180
+ * @description The date since the meter should include events.
5181
+ * Useful to skip old events.
5182
+ * If not specified, all historical events are included.
5183
+ * @example 2023-01-01T01:01:01.001Z
5184
+ */
5185
+ eventFrom?: Date;
5132
5186
  /**
5133
5187
  * @description JSONPath expression to extract the value from the ingested event's data property.
5134
5188
  *
@@ -5161,9 +5215,9 @@ export interface components {
5161
5215
  * @description A meter is a configuration that defines how to match and aggregate events.
5162
5216
  * @example {
5163
5217
  * "slug": "tokens_total",
5218
+ * "name": "Tokens Total",
5164
5219
  * "description": "AI Token Usage",
5165
5220
  * "aggregation": "SUM",
5166
- * "windowSize": "MINUTE",
5167
5221
  * "eventType": "prompt",
5168
5222
  * "valueProperty": "$.tokens",
5169
5223
  * "groupBy": {
@@ -5173,36 +5227,46 @@ export interface components {
5173
5227
  * }
5174
5228
  */
5175
5229
  MeterCreate: {
5230
+ /**
5231
+ * Description
5232
+ * @description Optional description of the resource. Maximum 1024 characters.
5233
+ */
5234
+ description?: string;
5235
+ /**
5236
+ * Metadata
5237
+ * @description Additional metadata for the resource.
5238
+ */
5239
+ metadata?: components['schemas']['Metadata'] | null;
5240
+ /**
5241
+ * Display name
5242
+ * @description Human-readable name for the resource. Between 1 and 256 characters.
5243
+ * Defaults to the slug if not specified.
5244
+ */
5245
+ name?: string;
5176
5246
  /**
5177
5247
  * @description A unique, human-readable identifier for the meter.
5178
5248
  * Must consist only alphanumeric and underscore characters.
5179
5249
  * @example tokens_total
5180
5250
  */
5181
5251
  slug: string;
5182
- /**
5183
- * @description A description of the meter.
5184
- * @example AI Token Usage
5185
- */
5186
- description?: string;
5187
5252
  /**
5188
5253
  * @description The aggregation type to use for the meter.
5189
5254
  * @example SUM
5190
5255
  */
5191
5256
  aggregation: components['schemas']['MeterAggregation'];
5192
- /**
5193
- * @description The window size that the usage is stored in.
5194
- * This controls the query granularity of the usage data.
5195
- * The larger the window size, the less space is used to store the data.
5196
- * By default, the window size is a minute.
5197
- * @default MINUTE
5198
- * @example MINUTE
5199
- */
5200
- windowSize?: components['schemas']['WindowSize'];
5201
5257
  /**
5202
5258
  * @description The event type to aggregate.
5203
5259
  * @example prompt
5204
5260
  */
5205
5261
  eventType: string;
5262
+ /**
5263
+ * Format: date-time
5264
+ * @description The date since the meter should include events.
5265
+ * Useful to skip old events.
5266
+ * If not specified, all historical events are included.
5267
+ * @example 2023-01-01T01:01:01.001Z
5268
+ */
5269
+ eventFrom?: Date;
5206
5270
  /**
5207
5271
  * @description JSONPath expression to extract the value from the ingested event's data property.
5208
5272
  *
@@ -6185,6 +6249,30 @@ export interface components {
6185
6249
  */
6186
6250
  unitPrice: components['schemas']['UnitPrice'] | null;
6187
6251
  };
6252
+ /** @description Progress describes a progress of a task. */
6253
+ Progress: {
6254
+ /**
6255
+ * Format: uint64
6256
+ * @description Success is the number of items that succeeded
6257
+ */
6258
+ success: number;
6259
+ /**
6260
+ * Format: uint64
6261
+ * @description Failed is the number of items that failed
6262
+ */
6263
+ failed: number;
6264
+ /**
6265
+ * Format: uint64
6266
+ * @description The total number of items to process
6267
+ */
6268
+ total: number;
6269
+ /**
6270
+ * Format: date-time
6271
+ * @description The time the progress was last updated
6272
+ * @example 2023-01-01T01:01:01.001Z
6273
+ */
6274
+ updatedAt: Date;
6275
+ };
6188
6276
  /** @description A rate card defines the pricing and entitlement of a feature or service. */
6189
6277
  RateCard: components['schemas']['RateCardFlatFee'] | components['schemas']['RateCardUsageBased'];
6190
6278
  /** @description Entitlement template of a boolean entitlement. */
@@ -7567,6 +7655,9 @@ export interface components {
7567
7655
  'MarketplaceApiKeyInstallRequest.type': components['schemas']['AppType'];
7568
7656
  /** @description The type of the app to install. */
7569
7657
  'MarketplaceOAuth2InstallAuthorizeRequest.type': components['schemas']['AppType'];
7658
+ /** @description Client ID
7659
+ * Useful to track progress of a query. */
7660
+ 'MeterQuery.clientId': string;
7570
7661
  /** @description Simple filter for group bys with exact match. */
7571
7662
  'MeterQuery.filterGroupBy': {
7572
7663
  [key: string]: string;
@@ -7889,6 +7980,7 @@ export type PortalToken = components['schemas']['PortalToken'];
7889
7980
  export type PreconditionFailedProblemResponse = components['schemas']['PreconditionFailedProblemResponse'];
7890
7981
  export type PricePaymentTerm = components['schemas']['PricePaymentTerm'];
7891
7982
  export type PriceTier = components['schemas']['PriceTier'];
7983
+ export type Progress = components['schemas']['Progress'];
7892
7984
  export type RateCard = components['schemas']['RateCard'];
7893
7985
  export type RateCardBooleanEntitlement = components['schemas']['RateCardBooleanEntitlement'];
7894
7986
  export type RateCardEntitlement = components['schemas']['RateCardEntitlement'];
@@ -7978,6 +8070,7 @@ export type ParameterLimitOffsetLimit = components['parameters']['LimitOffset.li
7978
8070
  export type ParameterLimitOffsetOffset = components['parameters']['LimitOffset.offset'];
7979
8071
  export type ParameterMarketplaceApiKeyInstallRequestType = components['parameters']['MarketplaceApiKeyInstallRequest.type'];
7980
8072
  export type ParameterMarketplaceOAuth2InstallAuthorizeRequestType = components['parameters']['MarketplaceOAuth2InstallAuthorizeRequest.type'];
8073
+ export type ParameterMeterQueryClientId = components['parameters']['MeterQuery.clientId'];
7981
8074
  export type ParameterMeterQueryFilterGroupBy = components['parameters']['MeterQuery.filterGroupBy'];
7982
8075
  export type ParameterMeterQueryFrom = components['parameters']['MeterQuery.from'];
7983
8076
  export type ParameterMeterQueryGroupBy = components['parameters']['MeterQuery.groupBy'];
@@ -11402,6 +11495,9 @@ export interface operations {
11402
11495
  listEvents: {
11403
11496
  parameters: {
11404
11497
  query?: {
11498
+ /** @description Client ID
11499
+ * Useful to track progress of a query. */
11500
+ clientId?: string;
11405
11501
  /** @description Start date-time in RFC 3339 format.
11406
11502
  *
11407
11503
  * Inclusive. */
@@ -12200,6 +12296,91 @@ export interface operations {
12200
12296
  };
12201
12297
  };
12202
12298
  };
12299
+ getProgress: {
12300
+ parameters: {
12301
+ query?: never;
12302
+ header?: never;
12303
+ path: {
12304
+ id: string;
12305
+ };
12306
+ cookie?: never;
12307
+ };
12308
+ requestBody?: never;
12309
+ responses: {
12310
+ /** @description The request has succeeded. */
12311
+ 200: {
12312
+ headers: {
12313
+ [name: string]: unknown;
12314
+ };
12315
+ content: {
12316
+ 'application/json': components['schemas']['Progress'];
12317
+ };
12318
+ };
12319
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
12320
+ 400: {
12321
+ headers: {
12322
+ [name: string]: unknown;
12323
+ };
12324
+ content: {
12325
+ 'application/problem+json': components['schemas']['BadRequestProblemResponse'];
12326
+ };
12327
+ };
12328
+ /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
12329
+ 401: {
12330
+ headers: {
12331
+ [name: string]: unknown;
12332
+ };
12333
+ content: {
12334
+ 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'];
12335
+ };
12336
+ };
12337
+ /** @description The server understood the request but refuses to authorize it. */
12338
+ 403: {
12339
+ headers: {
12340
+ [name: string]: unknown;
12341
+ };
12342
+ content: {
12343
+ 'application/problem+json': components['schemas']['ForbiddenProblemResponse'];
12344
+ };
12345
+ };
12346
+ /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
12347
+ 404: {
12348
+ headers: {
12349
+ [name: string]: unknown;
12350
+ };
12351
+ content: {
12352
+ 'application/problem+json': components['schemas']['NotFoundProblemResponse'];
12353
+ };
12354
+ };
12355
+ /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
12356
+ 500: {
12357
+ headers: {
12358
+ [name: string]: unknown;
12359
+ };
12360
+ content: {
12361
+ 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'];
12362
+ };
12363
+ };
12364
+ /** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
12365
+ 503: {
12366
+ headers: {
12367
+ [name: string]: unknown;
12368
+ };
12369
+ content: {
12370
+ 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'];
12371
+ };
12372
+ };
12373
+ /** @description An unexpected error response. */
12374
+ default: {
12375
+ headers: {
12376
+ [name: string]: unknown;
12377
+ };
12378
+ content: {
12379
+ 'application/problem+json': components['schemas']['UnexpectedProblemResponse'];
12380
+ };
12381
+ };
12382
+ };
12383
+ };
12203
12384
  listMarketplaceListings: {
12204
12385
  parameters: {
12205
12386
  query?: {
@@ -12929,6 +13110,9 @@ export interface operations {
12929
13110
  queryMeter: {
12930
13111
  parameters: {
12931
13112
  query?: {
13113
+ /** @description Client ID
13114
+ * Useful to track progress of a query. */
13115
+ clientId?: components['parameters']['MeterQuery.clientId'];
12932
13116
  /** @description Start date-time in RFC 3339 format.
12933
13117
  *
12934
13118
  * Inclusive. */
@@ -15031,6 +15215,9 @@ export interface operations {
15031
15215
  queryPortalMeter: {
15032
15216
  parameters: {
15033
15217
  query?: {
15218
+ /** @description Client ID
15219
+ * Useful to track progress of a query. */
15220
+ clientId?: components['parameters']['MeterQuery.clientId'];
15034
15221
  /** @description Start date-time in RFC 3339 format.
15035
15222
  *
15036
15223
  * Inclusive. */