Skip to content

Commit

Permalink
chore(api): generate node client (#1449)
Browse files Browse the repository at this point in the history
Co-authored-by: hekike <1764512+hekike@users.noreply.github.com>
  • Loading branch information
openmeterbot and hekike authored Sep 2, 2024
1 parent aee03d7 commit 25dc688
Showing 1 changed file with 42 additions and 131 deletions.
173 changes: 42 additions & 131 deletions api/client/node/schemas/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
* Do not make direct changes to the file.
*/

/** OneOf type helpers */
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never }
type XOR<T, U> = T | U extends object
? (Without<T, U> & U) | (Without<U, T> & T)
: T | U
type OneOf<T extends any[]> = T extends [infer Only]
? Only
: T extends [infer A, infer B, ...infer Rest]
? OneOf<[XOR<A, B>, ...Rest]>
: never

export interface paths {
'/api/v1/events': {
/**
Expand Down Expand Up @@ -654,30 +643,13 @@ export interface components {
archivedAt?: string
} & components['schemas']['FeatureCreateInputs'] &
components['schemas']['SharedMetaFields']
ListFeatureResponse: OneOf<
[
components['schemas']['Feature'][],
{
/**
* @description Total number of features.
* @example 500
*/
totalCount: number
/**
* @description Current page number.
* @example 1
*/
page: number
/**
* @description Number of features per page.
* @example 100
*/
pageSize: number
/** @description List of features. */
items: components['schemas']['Feature'][]
},
]
>
ListFeaturePaginatedResponse: components['schemas']['PaginationInfo'] & {
/** @description List of features. */
items: components['schemas']['Feature'][]
}
ListFeatureResponse:
| components['schemas']['Feature'][]
| components['schemas']['ListFeaturePaginatedResponse']
/** @description Limited representation of a feature resource which includes only its unique identifiers (id, key). */
FeatureMeta: {
/**
Expand Down Expand Up @@ -845,30 +817,13 @@ export interface components {
| components['schemas']['EntitlementMetered']
| components['schemas']['EntitlementStatic']
| components['schemas']['EntitlementBoolean']
ListEntitlementResponse: OneOf<
[
components['schemas']['Entitlement'][],
{
/**
* @description Total number of entitlements.
* @example 500
*/
totalCount: number
/**
* @description Current page number.
* @example 1
*/
page: number
/**
* @description Number of entitlements per page.
* @example 100
*/
pageSize: number
/** @description List of entitlements. */
items: components['schemas']['Entitlement'][]
},
]
>
ListEntitlementPaginatedResponse: components['schemas']['PaginationInfo'] & {
/** @description List of entitlements. */
items: components['schemas']['Entitlement'][]
}
ListEntitlementResponse:
| components['schemas']['Entitlement'][]
| components['schemas']['ListEntitlementPaginatedResponse']
/**
* @description A segment of the grant burn down history.
*
Expand Down Expand Up @@ -1109,30 +1064,13 @@ export interface components {
voidedAt?: string
recurrence?: components['schemas']['RecurringPeriod']
}
ListEntitlementGrantResponse: OneOf<
[
components['schemas']['EntitlementGrant'][],
{
/**
* @description Total number of grants.
* @example 500
*/
totalCount: number
/**
* @description Current page number.
* @example 1
*/
page: number
/**
* @description Number of grants per page.
* @example 100
*/
pageSize: number
/** @description List of grants. */
items: components['schemas']['EntitlementGrant'][]
},
]
>
ListEntitlementGrantPaginatedResponse: components['schemas']['PaginationInfo'] & {
/** @description List of grants. */
items: components['schemas']['EntitlementGrant'][]
}
ListEntitlementGrantResponse:
| components['schemas']['EntitlementGrant'][]
| components['schemas']['ListEntitlementGrantPaginatedResponse']
EntitlementValue: {
/**
* @description Whether the subject has access to the feature. Shared accross all entitlement types.
Expand Down Expand Up @@ -1435,22 +1373,7 @@ export interface components {
NotificationChannel: components['schemas']['NotificationChannelWebhook']
/** @description List of channels. */
NotificationChannels: components['schemas']['NotificationChannel'][]
NotificationChannelsResponse: {
/**
* @description Total number of channels.
* @example 500
*/
totalCount: number
/**
* @description Current page number.
* @example 1
*/
page: number
/**
* @description Number of channels per page.
* @example 100
*/
pageSize: number
NotificationChannelsResponse: components['schemas']['PaginationInfo'] & {
items: components['schemas']['NotificationChannels']
}
NotificationChannelWebhookCreateRequest: components['schemas']['NotificationChannelCommonCreateRequest'] & {
Expand Down Expand Up @@ -1568,22 +1491,7 @@ export interface components {
NotificationRule: components['schemas']['NotificationRuleBalanceThreshold']
/** @description List of rules. */
NotificationRules: components['schemas']['NotificationRule'][]
NotificationRulesResponse: {
/**
* @description Total number of rules.
* @example 500
*/
totalCount: number
/**
* @description Current page number.
* @example 1
*/
page: number
/**
* @description Number of rules per page.
* @example 100
*/
pageSize: number
NotificationRulesResponse: components['schemas']['PaginationInfo'] & {
items: components['schemas']['NotificationRules']
}
/**
Expand Down Expand Up @@ -1797,22 +1705,7 @@ export interface components {
}
/** @description List of notification events. */
NotificationEvents: components['schemas']['NotificationEvent'][]
NotificationEventsResponse: {
/**
* @description Total number of rules.
* @example 500
*/
totalCount: number
/**
* @description Current page number.
* @example 1
*/
page: number
/**
* @description Number of rules per page.
* @example 100
*/
pageSize: number
NotificationEventsResponse: components['schemas']['PaginationInfo'] & {
items: components['schemas']['NotificationEvents']
}
SvixOperationalWebhookRequest: {
Expand All @@ -1829,6 +1722,24 @@ export interface components {
[key: string]: unknown
}
}
/** @description Pagination information. */
PaginationInfo: {
/**
* @description Total number of items.
* @example 500
*/
totalCount: number
/**
* @description Current page number.
* @example 1
*/
page: number
/**
* @description Number of items per page.
* @example 100
*/
pageSize: number
}
}
responses: {
/** @description Conflict */
Expand Down

0 comments on commit 25dc688

Please sign in to comment.