Skip to content

Commit

Permalink
feat(query): progress
Browse files Browse the repository at this point in the history
  • Loading branch information
hekike committed Feb 3, 2025
1 parent 4bea3b8 commit c511033
Show file tree
Hide file tree
Showing 54 changed files with 3,354 additions and 1,726 deletions.
1,659 changes: 878 additions & 781 deletions api/api.gen.go

Large diffs are not rendered by default.

1,865 changes: 1,057 additions & 808 deletions api/client/go/client.gen.go

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions api/client/javascript/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

144 changes: 144 additions & 0 deletions api/client/javascript/src/client/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,26 @@ export interface paths {
patch?: never
trace?: never
}
'/api/v1/info/progress/{id}': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
/**
* Get progress
* @description Get progress
*/
get: operations['getProgress']
put?: never
post?: never
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
'/api/v1/marketplace/listings': {
parameters: {
query?: never
Expand Down Expand Up @@ -6214,6 +6234,30 @@ export interface components {
*/
unitPrice: components['schemas']['UnitPrice'] | null
}
/** @description Progress describes a progress of a task. */
Progress: {
/**
* Format: uint64
* @description Success is the number of items that succeeded
*/
success: number
/**
* Format: uint64
* @description Failed is the number of items that failed
*/
failed: number
/**
* Format: uint64
* @description The total number of items to process
*/
total: number
/**
* Format: date-time
* @description The time the progress was last updated
* @example 2023-01-01T01:01:01.001Z
*/
updatedAt: Date
}
/** @description A rate card defines the pricing and entitlement of a feature or service. */
RateCard:
| components['schemas']['RateCardFlatFee']
Expand Down Expand Up @@ -7589,6 +7633,9 @@ export interface components {
'MarketplaceApiKeyInstallRequest.type': components['schemas']['AppType']
/** @description The type of the app to install. */
'MarketplaceOAuth2InstallAuthorizeRequest.type': components['schemas']['AppType']
/** @description Client ID
* Useful to track progress of a query. */
'MeterQuery.clientId': string
/** @description Simple filter for group bys with exact match. */
'MeterQuery.filterGroupBy': {
[key: string]: string
Expand Down Expand Up @@ -8037,6 +8084,7 @@ export type PreconditionFailedProblemResponse =
components['schemas']['PreconditionFailedProblemResponse']
export type PricePaymentTerm = components['schemas']['PricePaymentTerm']
export type PriceTier = components['schemas']['PriceTier']
export type Progress = components['schemas']['Progress']
export type RateCard = components['schemas']['RateCard']
export type RateCardBooleanEntitlement =
components['schemas']['RateCardBooleanEntitlement']
Expand Down Expand Up @@ -8182,6 +8230,8 @@ export type ParameterMarketplaceApiKeyInstallRequestType =
components['parameters']['MarketplaceApiKeyInstallRequest.type']
export type ParameterMarketplaceOAuth2InstallAuthorizeRequestType =
components['parameters']['MarketplaceOAuth2InstallAuthorizeRequest.type']
export type ParameterMeterQueryClientId =
components['parameters']['MeterQuery.clientId']
export type ParameterMeterQueryFilterGroupBy =
components['parameters']['MeterQuery.filterGroupBy']
export type ParameterMeterQueryFrom =
Expand Down Expand Up @@ -11638,6 +11688,9 @@ export interface operations {
listEvents: {
parameters: {
query?: {
/** @description Client ID
* Useful to track progress of a query. */
clientId?: string
/** @description Start date-time in RFC 3339 format.
*
* Inclusive. */
Expand Down Expand Up @@ -12438,6 +12491,91 @@ export interface operations {
}
}
}
getProgress: {
parameters: {
query?: never
header?: never
path: {
id: string
}
cookie?: never
}
requestBody?: never
responses: {
/** @description The request has succeeded. */
200: {
headers: {
[name: string]: unknown
}
content: {
'application/json': components['schemas']['Progress']
}
}
/** @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). */
400: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['BadRequestProblemResponse']
}
}
/** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
401: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnauthorizedProblemResponse']
}
}
/** @description The server understood the request but refuses to authorize it. */
403: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ForbiddenProblemResponse']
}
}
/** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
404: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['NotFoundProblemResponse']
}
}
/** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
500: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['InternalServerErrorProblemResponse']
}
}
/** @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. */
503: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse']
}
}
/** @description An unexpected error response. */
default: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnexpectedProblemResponse']
}
}
}
}
listMarketplaceListings: {
parameters: {
query?: {
Expand Down Expand Up @@ -13167,6 +13305,9 @@ export interface operations {
queryMeter: {
parameters: {
query?: {
/** @description Client ID
* Useful to track progress of a query. */
clientId?: components['parameters']['MeterQuery.clientId']
/** @description Start date-time in RFC 3339 format.
*
* Inclusive. */
Expand Down Expand Up @@ -15269,6 +15410,9 @@ export interface operations {
queryPortalMeter: {
parameters: {
query?: {
/** @description Client ID
* Useful to track progress of a query. */
clientId?: components['parameters']['MeterQuery.clientId']
/** @description Start date-time in RFC 3339 format.
*
* Inclusive. */
Expand Down
114 changes: 114 additions & 0 deletions api/openapi.cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ info:
OpenMeter is a cloud native usage metering service.
The OpenMeter API allows you to ingest events, query meter usage, and manage resources.
tags:
- name: Track Progress
- name: Meters
description: Meters specify how to aggregate events for billing and analytics purposes. Meters can be configured with multiple aggregation methods and groupings. Multiple meters can be created for the same event type, enabling flexible metering scenarios.
- name: Events
Expand Down Expand Up @@ -2662,6 +2663,17 @@ paths:

If the from query param is not provided it defaults to last 72 hours.
parameters:
- name: clientId
in: query
required: false
description: |-
Client ID
Useful to track progress of a query.
schema:
type: string
minLength: 1
maxLength: 36
explode: false
- name: ingestedAtFrom
in: query
required: false
Expand Down Expand Up @@ -3320,6 +3332,68 @@ paths:
$ref: '#/components/schemas/UnexpectedProblemResponse'
tags:
- Lookup Information
/api/v1/info/progress/{id}:
get:
operationId: getProgress
summary: Get progress
description: Get progress
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
$ref: '#/components/schemas/Progress'
'400':
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).
content:
application/problem+json:
schema:
$ref: '#/components/schemas/BadRequestProblemResponse'
'401':
description: The request has not been applied because it lacks valid authentication credentials for the target resource.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/UnauthorizedProblemResponse'
'403':
description: The server understood the request but refuses to authorize it.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ForbiddenProblemResponse'
'404':
description: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/NotFoundProblemResponse'
'500':
description: The server encountered an unexpected condition that prevented it from fulfilling the request.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/InternalServerErrorProblemResponse'
'503':
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.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ServiceUnavailableProblemResponse'
default:
description: An unexpected error response.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/UnexpectedProblemResponse'
tags:
- Track Progress
/api/v1/marketplace/listings:
get:
operationId: listMarketplaceListings
Expand Down Expand Up @@ -3854,6 +3928,7 @@ paths:
minLength: 1
maxLength: 64
pattern: ^[a-z0-9]+(?:_[a-z0-9]+)*$|^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
- $ref: '#/components/parameters/MeterQuery.clientId'
- $ref: '#/components/parameters/MeterQuery.from'
- $ref: '#/components/parameters/MeterQuery.to'
- $ref: '#/components/parameters/MeterQuery.windowSize'
Expand Down Expand Up @@ -5563,6 +5638,7 @@ paths:
minLength: 1
maxLength: 64
pattern: ^[a-z0-9]+(?:_[a-z0-9]+)*$
- $ref: '#/components/parameters/MeterQuery.clientId'
- $ref: '#/components/parameters/MeterQuery.from'
- $ref: '#/components/parameters/MeterQuery.to'
- $ref: '#/components/parameters/MeterQuery.windowSize'
Expand Down Expand Up @@ -7616,6 +7692,18 @@ components:
description: The type of the app to install.
schema:
$ref: '#/components/schemas/AppType'
MeterQuery.clientId:
name: clientId
in: query
required: false
description: |-
Client ID
Useful to track progress of a query.
schema:
type: string
minLength: 1
maxLength: 36
explode: false
MeterQuery.filterGroupBy:
name: filterGroupBy
in: query
Expand Down Expand Up @@ -14297,6 +14385,32 @@ components:
description: |-
A price tier.
At least one price component is required in each tier.
Progress:
type: object
required:
- success
- failed
- total
- updatedAt
properties:
success:
type: integer
format: uint64
description: Success is the number of items that succeeded
failed:
type: integer
format: uint64
description: Failed is the number of items that failed
total:
type: integer
format: uint64
description: The total number of items to process
updatedAt:
type: string
format: date-time
description: The time the progress was last updated
example: '2023-01-01T01:01:01.001Z'
description: Progress describes a progress of a task.
RateCard:
oneOf:
- $ref: '#/components/schemas/RateCardFlatFee'
Expand Down
Loading

0 comments on commit c511033

Please sign in to comment.