diff --git a/api/client/node/clients/client.ts b/api/client/node/clients/client.ts index 3a52da936..f188b7b70 100644 --- a/api/client/node/clients/client.ts +++ b/api/client/node/clients/client.ts @@ -1,6 +1,5 @@ import { IncomingHttpHeaders } from 'http' import { Dispatcher, request } from 'undici' -import { components } from '../schemas/openapi.js' export type OpenMeterConfig = { baseUrl: string @@ -14,7 +13,38 @@ export type RequestOptions = { headers?: IncomingHttpHeaders } -export type Problem = components['schemas']['Problem'] +export type Problem = { + /** + * Format: uri + * @description Type contains a URI that identifies the problem type. + * @default about:blank + * @example about:blank + */ + type: string + /** + * @description A a short, human-readable summary of the problem type. + * @example Bad Request + */ + title: string + /** + * Format: int16 + * @description The HTTP status code generated by the origin server for this occurrence of the problem. + * @example 400 + */ + status?: number + /** + * @description A human-readable explanation specific to this occurrence of the problem. + * @example The request body must be a JSON object. + */ + detail: string + /** + * Format: uri + * @description A URI reference that identifies the specific occurrence of the problem. + * @example urn:request:local/JMOlctsKV8-000001 + */ + instance: string + [key: string]: (string | number) | undefined +} type UndiciRequestOptions = { dispatcher?: Dispatcher } & Omit< Dispatcher.RequestOptions, diff --git a/api/client/node/clients/entitlement.ts b/api/client/node/clients/entitlement.ts index 517939051..f35a22c8b 100644 --- a/api/client/node/clients/entitlement.ts +++ b/api/client/node/clients/entitlement.ts @@ -9,7 +9,7 @@ export type Entitlement = export type EntitlementMetered = components['schemas']['EntitlementMetered'] export type EntitlementStatic = components['schemas']['EntitlementStatic'] export type EntitlementBoolean = components['schemas']['EntitlementBoolean'] -export type RecurringPeriodEnum = components['schemas']['RecurringPeriodEnum'] +export type RecurringPeriodEnum = components['schemas']['RecurringPeriod'] export type EntitlementValue = components['schemas']['EntitlementValue'] export type WindowedBalanceHistory = components['schemas']['WindowedBalanceHistory'] diff --git a/api/client/node/clients/event.ts b/api/client/node/clients/event.ts index 071832957..ff4f37180 100644 --- a/api/client/node/clients/event.ts +++ b/api/client/node/clients/event.ts @@ -104,6 +104,7 @@ export class EventsClient extends BaseClient { time: ev.time?.toISOString(), datacontenttype: ev.datacontenttype, dataschema: ev.dataschema, + // @ts-expect-error data type data: ev.data, } diff --git a/api/client/node/clients/notifications.ts b/api/client/node/clients/notifications.ts index d6ba72702..617e92bdc 100644 --- a/api/client/node/clients/notifications.ts +++ b/api/client/node/clients/notifications.ts @@ -7,7 +7,7 @@ export type NotificationChannelCreateRequest = export type ListNotificationChannelsQueryParams = operations['listNotificationChannels']['parameters']['query'] export type NotificationChannelsResponse = - components['schemas']['NotificationChannelsResponse'] + components['schemas']['NotificationChannelPaginatedResponse'] export type NotificationRule = components['schemas']['NotificationRule'] export type NotificationRuleCreateRequest = @@ -15,13 +15,13 @@ export type NotificationRuleCreateRequest = export type ListNotificationRulesQueryParams = operations['listNotificationRules']['parameters']['query'] export type NotificationRulesResponse = - components['schemas']['NotificationRulesResponse'] + components['schemas']['NotificationRulePaginatedResponse'] export type NotificationEvent = components['schemas']['NotificationEvent'] export type ListNotificationEventsQueryParams = operations['listNotificationEvents']['parameters']['query'] export type NotificationEventsResponse = - components['schemas']['NotificationEventsResponse'] + components['schemas']['NotificationEventPaginatedResponse'] export class NotificationClient extends BaseClient { public channels: NotificationChannelsClient diff --git a/api/client/node/pnpm-lock.yaml b/api/client/node/pnpm-lock.yaml index a9397d568..6dbeb9ea7 100644 --- a/api/client/node/pnpm-lock.yaml +++ b/api/client/node/pnpm-lock.yaml @@ -78,57 +78,37 @@ importers: packages: - '@babel/code-frame@7.24.6': - resolution: {integrity: sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==} + '@babel/code-frame@7.26.2': + resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} - '@babel/generator@7.24.6': - resolution: {integrity: sha512-S7m4eNa6YAPJRHmKsLHIDJhNAGNKoWNiWefz1MBbpnt8g9lvMDl1hir4P9bo/57bQEmuwEhnRU/AMWsD0G/Fbg==} + '@babel/generator@7.26.2': + resolution: {integrity: sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==} engines: {node: '>=6.9.0'} - '@babel/helper-environment-visitor@7.24.6': - resolution: {integrity: sha512-Y50Cg3k0LKLMjxdPjIl40SdJgMB85iXn27Vk/qbHZCFx/o5XO3PSnpi675h1KEmmDb6OFArfd5SCQEQ5Q4H88g==} + '@babel/helper-string-parser@7.25.9': + resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} engines: {node: '>=6.9.0'} - '@babel/helper-function-name@7.24.6': - resolution: {integrity: sha512-xpeLqeeRkbxhnYimfr2PC+iA0Q7ljX/d1eZ9/inYbmfG2jpl8Lu3DyXvpOAnrS5kxkfOWJjioIMQsaMBXFI05w==} + '@babel/helper-validator-identifier@7.25.9': + resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} - '@babel/helper-hoist-variables@7.24.6': - resolution: {integrity: sha512-SF/EMrC3OD7dSta1bLJIlrsVxwtd0UpjRJqLno6125epQMJ/kyFmpTT4pbvPbdQHzCHg+biQ7Syo8lnDtbR+uA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-split-export-declaration@7.24.6': - resolution: {integrity: sha512-CvLSkwXGWnYlF9+J3iZUvwgAxKiYzK3BWuo+mLzD/MDGOZDj7Gq8+hqaOkMxmJwmlv0iu86uH5fdADd9Hxkymw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.24.6': - resolution: {integrity: sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.24.6': - resolution: {integrity: sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==} - engines: {node: '>=6.9.0'} - - '@babel/highlight@7.24.6': - resolution: {integrity: sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.24.6': - resolution: {integrity: sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==} + '@babel/parser@7.26.2': + resolution: {integrity: sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/template@7.24.6': - resolution: {integrity: sha512-3vgazJlLwNXi9jhrR1ef8qiB65L1RK90+lEQwv4OxveHnqC3BfmnHdgySwRLzf6akhlOYenT+b7AfWq+a//AHw==} + '@babel/template@7.25.9': + resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.24.6': - resolution: {integrity: sha512-OsNjaJwT9Zn8ozxcfoBc+RaHdj3gFmCmYoQLUII1o6ZrUwku0BMg80FoOTPx+Gi6XhcQxAYE4xyjPTo4SxEQqw==} + '@babel/traverse@7.25.9': + resolution: {integrity: sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==} engines: {node: '>=6.9.0'} - '@babel/types@7.24.6': - resolution: {integrity: sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==} + '@babel/types@7.26.0': + resolution: {integrity: sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==} engines: {node: '>=6.9.0'} '@esbuild/aix-ppc64@0.21.5': @@ -269,14 +249,14 @@ packages: cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + '@eslint-community/eslint-utils@4.4.1': + resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.11.0': - resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/eslintrc@2.1.4': @@ -294,6 +274,7 @@ packages: '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -301,6 +282,7 @@ packages: '@humanwhocodes/object-schema@2.0.3': resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} @@ -318,9 +300,6 @@ packages: resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} engines: {node: '>=6.0.0'} - '@jridgewell/sourcemap-codec@1.4.15': - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} @@ -338,8 +317,8 @@ packages: resolution: {integrity: sha512-LArFWJN7wGGLU1P3TeEHgO6wGKWEYq/o4/Yij7rnKk0ng1HbQn1wythI0E9Q7B3+7LRnposEtaeY9AZlE3Cg+Q==} engines: {node: '>=14'} - '@mdn/browser-compat-data@5.5.47': - resolution: {integrity: sha512-M/lmqoDgbKz0LP9K5mjqzNWpbTDmgBeGsh5A+o9KcJuI3KbJ/PCiXFs7XKR1nabQxwYtcHpl9Bn0OGUnijcXiw==} + '@mdn/browser-compat-data@5.6.13': + resolution: {integrity: sha512-eZOraBiugKZewtS10c7M78OKwL6CBhVzqSQvb5j+WGw/7MdPRfHrP7LuiEoLCeHXfmE414geJjnHPGQ0iAnCyg==} '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -475,9 +454,6 @@ packages: '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} - '@types/semver@7.5.8': - resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@typescript-eslint/eslint-plugin@7.16.1': resolution: {integrity: sha512-SxdPak/5bO0EnGktV05+Hq8oatjAYVY3Zh2bye9pGZy6+jwyR3LG3YKkV4YatlsgqXP28BTeVm9pqwJM96vf2A==} engines: {node: ^18.18.0 || >=20.0.0} @@ -503,8 +479,8 @@ packages: resolution: {integrity: sha512-nYpyv6ALte18gbMz323RM+vpFpTjfNdyakbf3nsLvF43uF9KeNC289SUEW3QLZ1xPtyINJ1dIsZOuWuSRIWygw==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@7.7.1': - resolution: {integrity: sha512-PytBif2SF+9SpEUKynYn5g1RHFddJUcyynGpztX3l/ik7KmZEv19WCMhUBkHXPU9es/VWGD3/zg3wg90+Dh2rA==} + '@typescript-eslint/scope-manager@7.18.0': + resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} engines: {node: ^18.18.0 || >=20.0.0} '@typescript-eslint/type-utils@7.16.1': @@ -521,8 +497,8 @@ packages: resolution: {integrity: sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@7.7.1': - resolution: {integrity: sha512-AmPmnGW1ZLTpWa+/2omPrPfR7BcbUU4oha5VIbSbS1a1Tv966bklvLNXxp3mrbc+P2j4MNOTfDffNsk4o0c6/w==} + '@typescript-eslint/types@7.18.0': + resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} engines: {node: ^18.18.0 || >=20.0.0} '@typescript-eslint/typescript-estree@7.16.1': @@ -534,8 +510,8 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@7.7.1': - resolution: {integrity: sha512-CXe0JHCXru8Fa36dteXqmH2YxngKJjkQLjxzoj6LYwzZ7qZvgsLSc+eqItCrqIop8Vl2UKoAi0StVWu97FQZIQ==} + '@typescript-eslint/typescript-estree@7.18.0': + resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' @@ -549,8 +525,8 @@ packages: peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/utils@7.7.1': - resolution: {integrity: sha512-QUvBxPEaBXf41ZBbaidKICgVL8Hin0p6prQDu6bbetWo39BKbWJxRsErOzMNT1rXvTll+J7ChrbmMCXM9rsvOQ==} + '@typescript-eslint/utils@7.18.0': + resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -559,8 +535,8 @@ packages: resolution: {integrity: sha512-Qlzzx4sE4u3FsHTPQAAQFJFNOuqtuY0LFrZHwQ8IHK705XxBiWOFkfKRWu6niB7hwfgnwIpO4jTC75ozW1PHWg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/visitor-keys@7.7.1': - resolution: {integrity: sha512-gBL3Eq25uADw1LQ9kVpf3hRM+DWzs0uZknHYK3hq4jcTPqVCClHGDnB6UUUV2SFeBeA4KWHWbbLqmbGcZ4FYbw==} + '@typescript-eslint/visitor-keys@7.18.0': + resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} engines: {node: ^18.18.0 || >=20.0.0} '@ungap/structured-clone@1.2.0': @@ -600,8 +576,8 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} hasBin: true @@ -624,10 +600,6 @@ packages: resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} engines: {node: '>=12'} - ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} - ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -694,8 +666,8 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - browserslist@4.23.3: - resolution: {integrity: sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==} + browserslist@4.24.2: + resolution: {integrity: sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -711,17 +683,13 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - caniuse-lite@1.0.30001651: - resolution: {integrity: sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==} + caniuse-lite@1.0.30001677: + resolution: {integrity: sha512-fmfjsOlJUpMWu+mAAtZZZHz7UEwsUxIIvu1TJfO1HqFQvB/B+ii0xr9B5HpbZY/mC4XZ8SvjHJqtAY6pDPQEog==} chai@5.1.2: resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} engines: {node: '>=12'} - chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} - chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -734,16 +702,10 @@ packages: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} - color-convert@1.9.3: - resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} - color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} - color-name@1.1.3: - resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -778,24 +740,6 @@ packages: supports-color: optional: true - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - debug@4.3.6: - resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - debug@4.3.7: resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} @@ -839,8 +783,8 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - electron-to-chromium@1.5.13: - resolution: {integrity: sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==} + electron-to-chromium@1.5.51: + resolution: {integrity: sha512-kKeWV57KSS8jH4alKt/jKnvHPmJgBxXzGUSbMd4eQF+iOsVPl7bz2KUmu6eo80eMP8wVioTfTyTzdMgM15WXNg==} emoji-regex@10.4.0: resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} @@ -887,14 +831,10 @@ packages: engines: {node: '>=12'} hasBin: true - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} - escape-string-regexp@1.0.5: - resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} - engines: {node: '>=0.8.0'} - escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -1051,8 +991,8 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fastq@1.15.0: - resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} + fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} @@ -1084,16 +1024,12 @@ packages: for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} - foreground-child@3.1.1: - resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} - engines: {node: '>=14'} - - foreground-child@3.2.1: - resolution: {integrity: sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==} + foreground-child@3.3.0: + resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + form-data@4.0.1: + resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} engines: {node: '>= 6'} fs.realpath@1.0.0: @@ -1114,8 +1050,8 @@ packages: functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - get-east-asian-width@1.2.0: - resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} + get-east-asian-width@1.3.0: + resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} engines: {node: '>=18'} get-intrinsic@1.2.4: @@ -1137,9 +1073,8 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - glob@10.4.1: - resolution: {integrity: sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==} - engines: {node: '>=16 || 14 >=14.18'} + glob@10.4.5: + resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true glob@11.0.0: @@ -1149,6 +1084,7 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -1178,10 +1114,6 @@ packages: has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -1201,10 +1133,6 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} - hasown@2.0.0: - resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} - engines: {node: '>= 0.4'} - hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -1213,10 +1141,6 @@ packages: resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==} engines: {node: ^16.14.0 || >=18.0.0} - ignore@5.3.1: - resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} - engines: {node: '>= 4'} - ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -1235,6 +1159,7 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -1265,9 +1190,6 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.13.1: - resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} - is-core-module@2.15.1: resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} engines: {node: '>= 0.4'} @@ -1341,12 +1263,11 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - jackspeak@3.1.2: - resolution: {integrity: sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==} - engines: {node: '>=14'} + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - jackspeak@4.0.1: - resolution: {integrity: sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==} + jackspeak@4.0.2: + resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} engines: {node: 20 || >=22} js-tokens@4.0.0: @@ -1356,9 +1277,9 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} + jsesc@3.0.2: + resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + engines: {node: '>=6'} hasBin: true json-buffer@3.0.1: @@ -1374,8 +1295,8 @@ packages: resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} hasBin: true - jsonc-parser@3.2.1: - resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -1405,21 +1326,13 @@ packages: loupe@3.1.2: resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} - lru-cache@10.2.2: - resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} - engines: {node: 14 || >=16.14} + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.0.0: - resolution: {integrity: sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==} + lru-cache@11.0.2: + resolution: {integrity: sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==} engines: {node: 20 || >=22} - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - magic-string@0.30.10: - resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} - magic-string@0.30.12: resolution: {integrity: sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==} @@ -1446,10 +1359,6 @@ packages: minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - minimatch@9.0.4: - resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} - engines: {node: '>=16 || 14 >=14.17'} - minimatch@9.0.5: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} @@ -1461,9 +1370,6 @@ packages: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -1478,8 +1384,8 @@ packages: node-releases@2.0.18: resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} - normalize-package-data@6.0.1: - resolution: {integrity: sha512-6rvCfeRW+OEZagAB4lMLSNuTNYZWLVtKccK79VSTf//yTY5VOCgcpH80O+bZK8Neps7pUnd5G+QlMg1yV/2iZQ==} + normalize-package-data@6.0.2: + resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} engines: {node: ^16.14.0 || >=18.0.0} object-inspect@1.13.2: @@ -1533,8 +1439,8 @@ packages: resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - package-json-from-dist@1.0.0: - resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} @@ -1582,9 +1488,6 @@ packages: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -1649,6 +1552,7 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rimraf@6.0.1: @@ -1676,16 +1580,6 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - semver@7.6.3: resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} @@ -1735,8 +1629,8 @@ packages: spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - spdx-license-ids@3.0.18: - resolution: {integrity: sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==} + spdx-license-ids@3.0.20: + resolution: {integrity: sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==} stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -1783,10 +1677,6 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -1828,16 +1718,12 @@ packages: resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} engines: {node: '>=14.0.0'} - to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} - ts-api-utils@1.3.0: - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + ts-api-utils@1.4.0: + resolution: {integrity: sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' @@ -1856,8 +1742,8 @@ packages: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} - type-fest@4.18.3: - resolution: {integrity: sha512-Q08/0IrpvM+NMY9PA2rti9Jb+JejTddwmwmVQGskAlhtcrw1wsRzoR6ode6mR+OAabNa75w/dxedSUY2mlphaQ==} + type-fest@4.26.1: + resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==} engines: {node: '>=16'} typed-array-buffer@1.0.2: @@ -1899,8 +1785,8 @@ packages: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} - update-browserslist-db@1.1.0: - resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} + update-browserslist-db@1.1.1: + resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -2004,9 +1890,6 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -2015,80 +1898,56 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yocto-queue@1.0.0: - resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + yocto-queue@1.1.1: + resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} snapshots: - '@babel/code-frame@7.24.6': + '@babel/code-frame@7.26.2': dependencies: - '@babel/highlight': 7.24.6 - picocolors: 1.0.1 + '@babel/helper-validator-identifier': 7.25.9 + js-tokens: 4.0.0 + picocolors: 1.1.1 - '@babel/generator@7.24.6': + '@babel/generator@7.26.2': dependencies: - '@babel/types': 7.24.6 + '@babel/parser': 7.26.2 + '@babel/types': 7.26.0 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - jsesc: 2.5.2 + jsesc: 3.0.2 - '@babel/helper-environment-visitor@7.24.6': {} + '@babel/helper-string-parser@7.25.9': {} - '@babel/helper-function-name@7.24.6': - dependencies: - '@babel/template': 7.24.6 - '@babel/types': 7.24.6 + '@babel/helper-validator-identifier@7.25.9': {} - '@babel/helper-hoist-variables@7.24.6': + '@babel/parser@7.26.2': dependencies: - '@babel/types': 7.24.6 + '@babel/types': 7.26.0 - '@babel/helper-split-export-declaration@7.24.6': + '@babel/template@7.25.9': dependencies: - '@babel/types': 7.24.6 - - '@babel/helper-string-parser@7.24.6': {} + '@babel/code-frame': 7.26.2 + '@babel/parser': 7.26.2 + '@babel/types': 7.26.0 - '@babel/helper-validator-identifier@7.24.6': {} - - '@babel/highlight@7.24.6': + '@babel/traverse@7.25.9': dependencies: - '@babel/helper-validator-identifier': 7.24.6 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.0.1 - - '@babel/parser@7.24.6': - dependencies: - '@babel/types': 7.24.6 - - '@babel/template@7.24.6': - dependencies: - '@babel/code-frame': 7.24.6 - '@babel/parser': 7.24.6 - '@babel/types': 7.24.6 - - '@babel/traverse@7.24.6': - dependencies: - '@babel/code-frame': 7.24.6 - '@babel/generator': 7.24.6 - '@babel/helper-environment-visitor': 7.24.6 - '@babel/helper-function-name': 7.24.6 - '@babel/helper-hoist-variables': 7.24.6 - '@babel/helper-split-export-declaration': 7.24.6 - '@babel/parser': 7.24.6 - '@babel/types': 7.24.6 - debug: 4.3.4 + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.2 + '@babel/parser': 7.26.2 + '@babel/template': 7.25.9 + '@babel/types': 7.26.0 + debug: 4.3.7 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/types@7.24.6': + '@babel/types@7.26.0': dependencies: - '@babel/helper-string-parser': 7.24.6 - '@babel/helper-validator-identifier': 7.24.6 - to-fast-properties: 2.0.0 + '@babel/helper-string-parser': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 '@esbuild/aix-ppc64@0.21.5': optional: true @@ -2159,17 +2018,17 @@ snapshots: '@esbuild/win32-x64@0.21.5': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': + '@eslint-community/eslint-utils@4.4.1(eslint@8.57.0)': dependencies: eslint: 8.57.0 eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.11.0': {} + '@eslint-community/regexpp@4.12.1': {} '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.6 + debug: 4.3.7 espree: 9.6.1 globals: 13.24.0 ignore: 5.3.2 @@ -2187,7 +2046,7 @@ snapshots: '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.6 + debug: 4.3.7 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -2208,28 +2067,26 @@ snapshots: '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 '@jridgewell/trace-mapping': 0.3.25 '@jridgewell/resolve-uri@3.1.2': {} '@jridgewell/set-array@1.2.1': {} - '@jridgewell/sourcemap-codec@1.4.15': {} - '@jridgewell/sourcemap-codec@1.5.0': {} '@jridgewell/trace-mapping@0.3.25': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 '@knighted/duel@1.0.8(typescript@5.6.3)': dependencies: '@knighted/specifier': 1.0.1 find-up: 6.3.0 - glob: 10.4.1 - jsonc-parser: 3.2.1 + glob: 10.4.5 + jsonc-parser: 3.3.1 read-package-up: 11.0.0 typescript: 5.6.3 transitivePeerDependencies: @@ -2237,13 +2094,13 @@ snapshots: '@knighted/specifier@1.0.1': dependencies: - '@babel/parser': 7.24.6 - '@babel/traverse': 7.24.6 - magic-string: 0.30.10 + '@babel/parser': 7.26.2 + '@babel/traverse': 7.25.9 + magic-string: 0.30.12 transitivePeerDependencies: - supports-color - '@mdn/browser-compat-data@5.5.47': {} + '@mdn/browser-compat-data@5.6.13': {} '@nodelib/fs.scandir@2.1.5': dependencies: @@ -2255,7 +2112,7 @@ snapshots: '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.15.0 + fastq: 1.17.1 '@nolyfill/is-core-module@1.0.39': {} @@ -2332,7 +2189,7 @@ snapshots: '@types/node-fetch@2.6.11': dependencies: '@types/node': 22.8.4 - form-data: 4.0.0 + form-data: 4.0.1 '@types/node@22.8.4': dependencies: @@ -2340,11 +2197,9 @@ snapshots: '@types/normalize-package-data@2.4.4': {} - '@types/semver@7.5.8': {} - '@typescript-eslint/eslint-plugin@7.16.1(@typescript-eslint/parser@7.16.1(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3)': dependencies: - '@eslint-community/regexpp': 4.11.0 + '@eslint-community/regexpp': 4.12.1 '@typescript-eslint/parser': 7.16.1(eslint@8.57.0)(typescript@5.6.3) '@typescript-eslint/scope-manager': 7.16.1 '@typescript-eslint/type-utils': 7.16.1(eslint@8.57.0)(typescript@5.6.3) @@ -2354,7 +2209,7 @@ snapshots: graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: @@ -2366,7 +2221,7 @@ snapshots: '@typescript-eslint/types': 7.16.1 '@typescript-eslint/typescript-estree': 7.16.1(typescript@5.6.3) '@typescript-eslint/visitor-keys': 7.16.1 - debug: 4.3.6 + debug: 4.3.7 eslint: 8.57.0 optionalDependencies: typescript: 5.6.3 @@ -2378,10 +2233,10 @@ snapshots: '@typescript-eslint/types': 7.16.1 '@typescript-eslint/visitor-keys': 7.16.1 - '@typescript-eslint/scope-manager@7.7.1': + '@typescript-eslint/scope-manager@7.18.0': dependencies: - '@typescript-eslint/types': 7.7.1 - '@typescript-eslint/visitor-keys': 7.7.1 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 '@typescript-eslint/type-utils@7.16.1(eslint@8.57.0)(typescript@5.6.3)': dependencies: @@ -2389,7 +2244,7 @@ snapshots: '@typescript-eslint/utils': 7.16.1(eslint@8.57.0)(typescript@5.6.3) debug: 4.3.7 eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: @@ -2397,33 +2252,33 @@ snapshots: '@typescript-eslint/types@7.16.1': {} - '@typescript-eslint/types@7.7.1': {} + '@typescript-eslint/types@7.18.0': {} '@typescript-eslint/typescript-estree@7.16.1(typescript@5.6.3)': dependencies: '@typescript-eslint/types': 7.16.1 '@typescript-eslint/visitor-keys': 7.16.1 - debug: 4.3.6 + debug: 4.3.7 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.7.1(typescript@5.6.3)': + '@typescript-eslint/typescript-estree@7.18.0(typescript@5.6.3)': dependencies: - '@typescript-eslint/types': 7.7.1 - '@typescript-eslint/visitor-keys': 7.7.1 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 debug: 4.3.7 globby: 11.1.0 is-glob: 4.0.3 - minimatch: 9.0.4 - semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.6.3) + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.4.0(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: @@ -2431,7 +2286,7 @@ snapshots: '@typescript-eslint/utils@7.16.1(eslint@8.57.0)(typescript@5.6.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.0) '@typescript-eslint/scope-manager': 7.16.1 '@typescript-eslint/types': 7.16.1 '@typescript-eslint/typescript-estree': 7.16.1(typescript@5.6.3) @@ -2440,16 +2295,13 @@ snapshots: - supports-color - typescript - '@typescript-eslint/utils@7.7.1(eslint@8.57.0)(typescript@5.6.3)': + '@typescript-eslint/utils@7.18.0(eslint@8.57.0)(typescript@5.6.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.7.1 - '@typescript-eslint/types': 7.7.1 - '@typescript-eslint/typescript-estree': 7.7.1(typescript@5.6.3) + '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.0) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3) eslint: 8.57.0 - semver: 7.6.0 transitivePeerDependencies: - supports-color - typescript @@ -2459,9 +2311,9 @@ snapshots: '@typescript-eslint/types': 7.16.1 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@7.7.1': + '@typescript-eslint/visitor-keys@7.18.0': dependencies: - '@typescript-eslint/types': 7.7.1 + '@typescript-eslint/types': 7.18.0 eslint-visitor-keys: 3.4.3 '@ungap/structured-clone@1.2.0': {} @@ -2506,11 +2358,11 @@ snapshots: loupe: 3.1.2 tinyrainbow: 1.2.0 - acorn-jsx@5.3.2(acorn@8.12.1): + acorn-jsx@5.3.2(acorn@8.14.0): dependencies: - acorn: 8.12.1 + acorn: 8.14.0 - acorn@8.12.1: {} + acorn@8.14.0: {} ajv@6.12.6: dependencies: @@ -2527,10 +2379,6 @@ snapshots: ansi-regex@6.1.0: {} - ansi-styles@3.2.1: - dependencies: - color-convert: 1.9.3 - ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 @@ -2593,7 +2441,7 @@ snapshots: ast-metadata-inferer@0.8.0: dependencies: - '@mdn/browser-compat-data': 5.5.47 + '@mdn/browser-compat-data': 5.6.13 asynckit@0.4.0: {} @@ -2616,12 +2464,12 @@ snapshots: dependencies: fill-range: 7.1.1 - browserslist@4.23.3: + browserslist@4.24.2: dependencies: - caniuse-lite: 1.0.30001651 - electron-to-chromium: 1.5.13 + caniuse-lite: 1.0.30001677 + electron-to-chromium: 1.5.51 node-releases: 2.0.18 - update-browserslist-db: 1.1.0(browserslist@4.23.3) + update-browserslist-db: 1.1.1(browserslist@4.24.2) cac@6.7.14: {} @@ -2635,7 +2483,7 @@ snapshots: callsites@3.1.0: {} - caniuse-lite@1.0.30001651: {} + caniuse-lite@1.0.30001677: {} chai@5.1.2: dependencies: @@ -2645,12 +2493,6 @@ snapshots: loupe: 3.1.2 pathval: 2.0.0 - chalk@2.4.2: - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - chalk@4.1.2: dependencies: ansi-styles: 4.3.0 @@ -2660,16 +2502,10 @@ snapshots: check-error@2.1.1: {} - color-convert@1.9.3: - dependencies: - color-name: 1.1.3 - color-convert@2.0.1: dependencies: color-name: 1.1.4 - color-name@1.1.3: {} - color-name@1.1.4: {} combined-stream@1.0.8: @@ -2706,14 +2542,6 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.4: - dependencies: - ms: 2.1.2 - - debug@4.3.6: - dependencies: - ms: 2.1.2 - debug@4.3.7: dependencies: ms: 2.1.3 @@ -2750,7 +2578,7 @@ snapshots: eastasianwidth@0.2.0: {} - electron-to-chromium@1.5.13: {} + electron-to-chromium@1.5.51: {} emoji-regex@10.4.0: {} @@ -2864,9 +2692,7 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 - escalade@3.1.2: {} - - escape-string-regexp@1.0.5: {} + escalade@3.2.0: {} escape-string-regexp@4.0.0: {} @@ -2925,10 +2751,10 @@ snapshots: eslint-plugin-compat@4.2.0(eslint@8.57.0): dependencies: - '@mdn/browser-compat-data': 5.5.47 + '@mdn/browser-compat-data': 5.6.13 ast-metadata-inferer: 0.8.0 - browserslist: 4.23.3 - caniuse-lite: 1.0.30001651 + browserslist: 4.24.2 + caniuse-lite: 1.0.30001677 eslint: 8.57.0 find-up: 5.0.0 lodash.memoize: 4.1.2 @@ -2976,7 +2802,7 @@ snapshots: eslint-plugin-vitest@0.5.4(@typescript-eslint/eslint-plugin@7.16.1(@typescript-eslint/parser@7.16.1(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3)(vitest@2.1.4(@types/node@22.8.4)): dependencies: - '@typescript-eslint/utils': 7.7.1(eslint@8.57.0)(typescript@5.6.3) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.6.3) eslint: 8.57.0 optionalDependencies: '@typescript-eslint/eslint-plugin': 7.16.1(@typescript-eslint/parser@7.16.1(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3) @@ -2998,8 +2824,8 @@ snapshots: eslint@8.57.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@eslint-community/regexpp': 4.11.0 + '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.0) + '@eslint-community/regexpp': 4.12.1 '@eslint/eslintrc': 2.1.4 '@eslint/js': 8.57.0 '@humanwhocodes/config-array': 0.11.14 @@ -3009,7 +2835,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.6 + debug: 4.3.7 doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -3041,8 +2867,8 @@ snapshots: espree@9.6.1: dependencies: - acorn: 8.12.1 - acorn-jsx: 5.3.2(acorn@8.12.1) + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) eslint-visitor-keys: 3.4.3 esquery@1.6.0: @@ -3077,7 +2903,7 @@ snapshots: fast-levenshtein@2.0.6: {} - fastq@1.15.0: + fastq@1.17.1: dependencies: reusify: 1.0.4 @@ -3113,17 +2939,12 @@ snapshots: dependencies: is-callable: 1.2.7 - foreground-child@3.1.1: + foreground-child@3.3.0: dependencies: cross-spawn: 7.0.3 signal-exit: 4.1.0 - foreground-child@3.2.1: - dependencies: - cross-spawn: 7.0.3 - signal-exit: 4.1.0 - - form-data@4.0.0: + form-data@4.0.1: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 @@ -3145,7 +2966,7 @@ snapshots: functions-have-names@1.2.3: {} - get-east-asian-width@1.2.0: {} + get-east-asian-width@1.3.0: {} get-intrinsic@1.2.4: dependencies: @@ -3173,21 +2994,22 @@ snapshots: dependencies: is-glob: 4.0.3 - glob@10.4.1: + glob@10.4.5: dependencies: - foreground-child: 3.1.1 - jackspeak: 3.1.2 - minimatch: 9.0.4 + foreground-child: 3.3.0 + jackspeak: 3.4.3 + minimatch: 9.0.5 minipass: 7.1.2 + package-json-from-dist: 1.0.1 path-scurry: 1.11.1 glob@11.0.0: dependencies: - foreground-child: 3.2.1 - jackspeak: 4.0.1 + foreground-child: 3.3.0 + jackspeak: 4.0.2 minimatch: 10.0.1 minipass: 7.1.2 - package-json-from-dist: 1.0.0 + package-json-from-dist: 1.0.1 path-scurry: 2.0.0 glob@7.2.3: @@ -3215,7 +3037,7 @@ snapshots: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.3.2 - ignore: 5.3.1 + ignore: 5.3.2 merge2: 1.4.1 slash: 3.0.0 @@ -3229,8 +3051,6 @@ snapshots: has-bigints@1.0.2: {} - has-flag@3.0.0: {} - has-flag@4.0.0: {} has-property-descriptors@1.0.2: @@ -3245,19 +3065,13 @@ snapshots: dependencies: has-symbols: 1.0.3 - hasown@2.0.0: - dependencies: - function-bind: 1.1.2 - hasown@2.0.2: dependencies: function-bind: 1.1.2 hosted-git-info@7.0.2: dependencies: - lru-cache: 10.2.2 - - ignore@5.3.1: {} + lru-cache: 10.4.3 ignore@5.3.2: {} @@ -3305,10 +3119,6 @@ snapshots: is-callable@1.2.7: {} - is-core-module@2.13.1: - dependencies: - hasown: 2.0.0 - is-core-module@2.15.1: dependencies: hasown: 2.0.2 @@ -3370,17 +3180,15 @@ snapshots: isexe@2.0.0: {} - jackspeak@3.1.2: + jackspeak@3.4.3: dependencies: '@isaacs/cliui': 8.0.2 optionalDependencies: '@pkgjs/parseargs': 0.11.0 - jackspeak@4.0.1: + jackspeak@4.0.2: dependencies: '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 js-tokens@4.0.0: {} @@ -3388,7 +3196,7 @@ snapshots: dependencies: argparse: 2.0.1 - jsesc@2.5.2: {} + jsesc@3.0.2: {} json-buffer@3.0.1: {} @@ -3400,7 +3208,7 @@ snapshots: dependencies: minimist: 1.2.8 - jsonc-parser@3.2.1: {} + jsonc-parser@3.3.1: {} keyv@4.5.4: dependencies: @@ -3430,17 +3238,9 @@ snapshots: loupe@3.1.2: {} - lru-cache@10.2.2: {} + lru-cache@10.4.3: {} - lru-cache@11.0.0: {} - - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - magic-string@0.30.10: - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 + lru-cache@11.0.2: {} magic-string@0.30.12: dependencies: @@ -3467,10 +3267,6 @@ snapshots: dependencies: brace-expansion: 1.1.11 - minimatch@9.0.4: - dependencies: - brace-expansion: 2.0.1 - minimatch@9.0.5: dependencies: brace-expansion: 2.0.1 @@ -3479,8 +3275,6 @@ snapshots: minipass@7.1.2: {} - ms@2.1.2: {} - ms@2.1.3: {} nanoid@3.3.7: {} @@ -3489,11 +3283,10 @@ snapshots: node-releases@2.0.18: {} - normalize-package-data@6.0.1: + normalize-package-data@6.0.2: dependencies: hosted-git-info: 7.0.2 - is-core-module: 2.13.1 - semver: 7.6.2 + semver: 7.6.3 validate-npm-package-license: 3.0.4 object-inspect@1.13.2: {} @@ -3554,7 +3347,7 @@ snapshots: p-limit@4.0.0: dependencies: - yocto-queue: 1.0.0 + yocto-queue: 1.1.1 p-locate@5.0.0: dependencies: @@ -3564,7 +3357,7 @@ snapshots: dependencies: p-limit: 4.0.0 - package-json-from-dist@1.0.0: {} + package-json-from-dist@1.0.1: {} parent-module@1.0.1: dependencies: @@ -3572,9 +3365,9 @@ snapshots: parse-json@8.1.0: dependencies: - '@babel/code-frame': 7.24.6 + '@babel/code-frame': 7.26.2 index-to-position: 0.1.2 - type-fest: 4.18.3 + type-fest: 4.26.1 path-exists@4.0.0: {} @@ -3588,12 +3381,12 @@ snapshots: path-scurry@1.11.1: dependencies: - lru-cache: 10.2.2 + lru-cache: 10.4.3 minipass: 7.1.2 path-scurry@2.0.0: dependencies: - lru-cache: 11.0.0 + lru-cache: 11.0.2 minipass: 7.1.2 path-type@4.0.0: {} @@ -3602,8 +3395,6 @@ snapshots: pathval@2.0.0: {} - picocolors@1.0.1: {} - picocolors@1.1.1: {} picomatch@2.3.1: {} @@ -3632,14 +3423,14 @@ snapshots: dependencies: find-up-simple: 1.0.0 read-pkg: 9.0.1 - type-fest: 4.18.3 + type-fest: 4.26.1 read-pkg@9.0.1: dependencies: '@types/normalize-package-data': 2.4.4 - normalize-package-data: 6.0.1 + normalize-package-data: 6.0.2 parse-json: 8.1.0 - type-fest: 4.18.3 + type-fest: 4.26.1 unicorn-magic: 0.1.0 regexp.prototype.flags@1.5.3: @@ -3668,7 +3459,7 @@ snapshots: rimraf@6.0.1: dependencies: glob: 11.0.0 - package-json-from-dist: 1.0.0 + package-json-from-dist: 1.0.1 rollup@4.24.3: dependencies: @@ -3713,12 +3504,6 @@ snapshots: semver@6.3.1: {} - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - - semver@7.6.2: {} - semver@7.6.3: {} set-function-length@1.2.2: @@ -3761,16 +3546,16 @@ snapshots: spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.18 + spdx-license-ids: 3.0.20 spdx-exceptions@2.5.0: {} spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.18 + spdx-license-ids: 3.0.20 - spdx-license-ids@3.0.18: {} + spdx-license-ids@3.0.20: {} stackback@0.0.2: {} @@ -3791,7 +3576,7 @@ snapshots: string-width@7.2.0: dependencies: emoji-regex: 10.4.0 - get-east-asian-width: 1.2.0 + get-east-asian-width: 1.3.0 strip-ansi: 7.1.0 string.prototype.trim@1.2.9: @@ -3825,10 +3610,6 @@ snapshots: strip-json-comments@3.1.1: {} - supports-color@5.5.0: - dependencies: - has-flag: 3.0.0 - supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -3856,13 +3637,11 @@ snapshots: tinyspy@3.0.2: {} - to-fast-properties@2.0.0: {} - to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - ts-api-utils@1.3.0(typescript@5.6.3): + ts-api-utils@1.4.0(typescript@5.6.3): dependencies: typescript: 5.6.3 @@ -3881,7 +3660,7 @@ snapshots: type-fest@0.20.2: {} - type-fest@4.18.3: {} + type-fest@4.26.1: {} typed-array-buffer@1.0.2: dependencies: @@ -3934,11 +3713,11 @@ snapshots: unicorn-magic@0.1.0: {} - update-browserslist-db@1.1.0(browserslist@4.23.3): + update-browserslist-db@1.1.1(browserslist@4.24.2): dependencies: - browserslist: 4.23.3 - escalade: 3.1.2 - picocolors: 1.0.1 + browserslist: 4.24.2 + escalade: 3.2.0 + picocolors: 1.1.1 uri-js@4.4.1: dependencies: @@ -4051,10 +3830,8 @@ snapshots: wrappy@1.0.2: {} - yallist@4.0.0: {} - yargs-parser@21.1.1: {} yocto-queue@0.1.0: {} - yocto-queue@1.0.0: {} + yocto-queue@1.1.1: {} diff --git a/api/client/node/schemas/openapi.ts b/api/client/node/schemas/openapi.ts index 765e83dcc..4a34b4415 100644 --- a/api/client/node/schemas/openapi.ts +++ b/api/client/node/schemas/openapi.ts @@ -3,301 +3,329 @@ * Do not make direct changes to the file. */ +/** WithRequired type helpers */ +type WithRequired = T & { [P in K]-?: T[P] } + export interface paths { - '/api/v1/customers': { - /** @description List customers. */ - get: operations['listCustomers'] - /** @description Create a new customer. */ - post: operations['createCustomer'] + '/api/v1/apps': { + /** @description List apps. */ + get: operations['listApps'] } - '/api/v1/customers/{customerIdOrKey}': { - /** @description Get a customer by ID or key. */ - get: operations['getCustomer'] - /** @description Update a customer by ID or key. */ - put: operations['updateCustomer'] - /** @description Delete a customer by ID or key. */ - delete: operations['deleteCustomer'] + '/api/v1/apps/{id}': { + /** @description Get the app. */ + get: operations['getApp'] + /** @description Uninstall an app. */ + delete: operations['uninstallApp'] } - '/api/v1/events': { + '/api/v1/apps/{id}/stripe/webhook': { + /** @description Stripe webhook. */ + post: operations['appStripeWebhook'] + } + '/api/v1/billing/customer': { /** - * List ingested events - * @description List ingested events within a time range. - * If the from query param is not provided it defaults to last 72 hours. + * List customer overrides + * @description List customer overrides */ - get: operations['listEvents'] + get: operations['billingListCustomerOverrides'] + } + '/api/v1/billing/customer/{customerId}': { /** - * Ingest events - * @description Ingests an event or batch of events following the CloudEvents specification. + * Get a customer override + * @description Get a customer override by id. */ - post: operations['ingestEvents'] + get: operations['billingGetCustomerOverrideById'] + /** + * Create/update a customer override + * @description Create/update a new customer override. + */ + post: operations['billingUpsertCustomerOverride'] + /** + * Delete a customer override + * @description Delete a customer override by id. + */ + delete: operations['billingDeleteCustomerOverride'] } - '/api/v1/meters': { + '/api/v1/billing/invoices': { /** - * List meters - * @description List meters. + * List invoices + * @description List invoices */ - get: operations['listMeters'] + get: operations['billingListInvoices'] + } + '/api/v1/billing/invoices/{customerId}': { /** - * ☁ Create meter - * @description *Available in OpenMeter Cloud.* - * *In the open-source version, meters are created in the configuration file.* + * List invoices + * @description List invoices for a specific customer + */ + get: operations['billingListInvoicesByCustomer'] + /** + * Create an invoice + * @description Create a new invoice from the pending line items. + * + * This should be only called if for some reason we need to invoice a customer outside of the normal billing cycle. + * + * When creating an invoice, the pending line items will be marked as invoiced and the invoice will be created with the total amount of the pending items. * - * Create a meter. + * New pending line items will be created for the period between now() and the next billing cycle's begining date for any metered item. + * + * The call can return multiple invoices if the pending line items are in different currencies. */ - post: operations['createMeter'] + post: operations['billingCreateInvoice'] } - '/api/v1/meters/{meterIdOrSlug}': { + '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}': { /** - * Get meter - * @description Get meter by ID or slug + * Get an invoice + * @description Get an invoice by ID. */ - get: operations['getMeter'] + get: operations['billingGetInvoiceByCustomerInvoiceId'] /** - * ☁ Delete meter - * @description *Available in OpenMeter Cloud.* + * Delete an invoice + * @description Delete an invoice * - * Delete a meter by ID or slug. + * Only invoices that are in the draft (or earlier) status can be deleted. */ - delete: operations['deleteMeter'] + delete: operations['billingDeleteInvoiceByCustomerInvoiceId'] } - '/api/v1/meters/{meterIdOrSlug}/query': { + '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/advance': { /** - * Query meter - * @description Query meter for usage. + * Advance the invoice's state to the next status + * @description Advance the invoice's state to the next status. + * + * The call doesn't "approve the invoice", it only advances the invoice to the next status if the transition would be automatic. + * + * The action can be called when the invoice's statusDetails' actions field contain the "advance" action. */ - get: operations['queryMeter'] + post: operations['billingInvoiceAdvance'] } - '/api/v1/meters/{meterIdOrSlug}/subjects': { + '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/approve': { /** - * List meter subjects - * @description List subjects for a meter. + * Send the invoice to the customer + * @description Approve an invoice and start executing the payment workflow. + * + * This call instantly sends the invoice to the customer using the configured billing profile app. + * + * This call is valid in two invoice statuses: + * - `draft`: the invoice will be sent to the customer, the invluce state becomes issued + * - `manual_approval_needed`: the invoice will be sent to the customer, the invoice state becomes issued */ - get: operations['listMeterSubjects'] + post: operations['billingApproveInvoice'] } - '/api/v1/portal/tokens': { + '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/lines/{lineId}': { /** - * ☁ List portal tokens - * @description *Available in OpenMeter Cloud.* - * - * List consumer portal tokens. + * Update an invoice line + * @description Update an invoice line */ - get: operations['listPortalTokens'] + put: operations['billingUpdateInvoiceLine'] /** - * Create portal token - * @description Create a consumer portal token. + * Delete an invoice line + * @description Delete an invoice line */ - post: operations['createPortalToken'] + delete: operations['billingDeleteInvoiceLine'] } - '/api/v1/portal/tokens/invalidate': { + '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/retry': { /** - * ☁ Invalidate portal tokens - * @description *Available in OpenMeter Cloud.* + * Retry advancing the invoice after a failed attempt. + * @description Retry advancing the invoice after a failed attempt. * - * Invalidates consumer portal tokens by ID or subject. + * The action can be called when the invoice's statusDetails' actions field contain the "retry" action. */ - post: operations['invalidatePortalTokens'] + post: operations['billingInvoiceRetry'] } - '/api/v1/subjects': { + '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/tax/recalculate': { /** - * ☁ List subjects - * @description *Available in OpenMeter Cloud.* + * Recalculate an invoice's tax amounts + * @description Recalculate an invoice's tax amounts (using the app set in the customer's billing profile) * - * List subjects. + * Note: charges might apply, depending on the tax provider. */ - get: operations['listSubjects'] + post: operations['billingRecalculateInvoiceTax'] + } + '/api/v1/billing/invoices/{customerId}/invoices/{invoiceId}/void': { /** - * ☁ Upsert subject - * @description *Available in OpenMeter Cloud.* + * Void an invoice + * @description Void an invoice * - * Upserts a subject. Creates or updates subject. - * If the subject doesn't exist, it will be created. - * If the subject exists, it will be partially updated with the provided fields. + * Only invoices that have been alread issued can be voided. + * + * Voiding an invoice will mark it as voided, the user can specify how to handle the voided line items. */ - post: operations['upsertSubject'] + post: operations['billingVoidInvoice'] } - '/api/v1/subjects/{subjectIdOrKey}': { + '/api/v1/billing/invoices/{customerId}/lines': { /** - * ☁ Get subject - * @description *Available in OpenMeter Cloud.* + * Create line items + * @description Create a new pending line item (charge). + * + * This call is used to create a new pending line item for the customer without explicitly + * assigning it to an invoice. * - * Get subject by ID or key. + * The line item will be either allocated to an existing invoice in gathering state or a new invoice is + * created for the line item. + * + * A new invoice will be created if: + * - there is no invoice in gathering state + * - the currency of the line item doesn't match the currency of any invoices in gathering state */ - get: operations['getSubject'] + post: operations['billingCreateLineByCustomer'] + } + '/api/v1/billing/profile': { + /** @description List all billing profiles */ + get: operations['billingListProfiles'] /** - * ☁ Delete subject - * @description *Available in OpenMeter Cloud.* + * Create a new billing profile + * @description Create a new billing profile * - * Delete a subject by ID or key. + * Billing profiles are representations of a customer's billing information. Customer overrides + * can be applied to a billing profile to customize the billing behavior for a specific customer. */ - delete: operations['deleteSubject'] + post: operations['billingCreateProfile'] } - '/api/v1/portal/meters/{meterSlug}/query': { + '/api/v1/billing/profile/{id}': { /** - * Query portal meter - * @description Query meter for consumer portal. This endpoint is publicly exposable to consumers. + * Get a billing profile by ID + * @description Get a billing profile by ID */ - get: operations['queryPortalMeter'] + get: operations['billingGetProfile'] + /** + * Update a billing profile + * @description Update a billing profile + */ + put: operations['billingUpdateProfile'] + /** + * Archive a billing profile + * @description Archive a billing profile + */ + delete: operations['billingArchiveProfile'] + } + '/api/v1/customers': { + /** @description List customers. */ + get: operations['listCustomers'] + /** @description Create a new customer. */ + post: operations['createCustomer'] + } + '/api/v1/customers/{id}': { + /** @description Get a customer by ID. */ + get: operations['getCustomer'] + /** @description Update a customer by ID. */ + put: operations['updateCustomer'] + /** @description Delete a customer by ID. */ + delete: operations['deleteCustomer'] + } + '/api/v1/debug/metrics': { + /** + * Get event metrics + * @description Returns debug metrics (in OpenMetrics format) like the number of ingested events since mindnight UTC. + * + * The OpenMetrics Counter(s) reset every day at midnight UTC. + */ + get: operations['getDebugMetrics'] } '/api/v1/entitlements': { /** - * List entitlements - * @description List all entitlements regardless of subject. This endpoint is intended for administrative purposes. + * List all entitlements + * @description List all entitlements for all the subjects and features. This endpoint is intended for administrative purposes only. + * To fetch the entitlements of a specific subject please use the /api/v1/subjects/{subjectKeyOrID}/entitlements endpoint. * If page is provided that takes precedence and the paginated response is returned. */ get: operations['listEntitlements'] } '/api/v1/entitlements/{entitlementId}': { - /** - * Get an entitlement - * @description Get entitlement by id. - */ + /** @description Get entitlement by id. */ get: operations['getEntitlementById'] } - '/api/v1/features': { + '/api/v1/events': { /** - * List features - * @description List all features. If page is provided that takes precedence and the paginated response is returned. + * List ingested events + * @description List ingested events within a time range. + * + * If the from query param is not provided it defaults to last 72 hours. */ + get: operations['listEvents'] + /** @description Ingests an event or batch of events following the CloudEvents specification. */ + post: operations['ingestEvents'] + } + '/api/v1/features': { + /** @description List features. */ get: operations['listFeatures'] /** - * Create a feature * @description Features are either metered or static. A feature is metered if meterSlug is provided at creation. - * For metered features you can pass additional filters that will be applied when calculating feature usage, based on the meter's groupBy fields. Only meters with SUM and COUNT aggregation are supported for features. - * + * For metered features you can pass additional filters that will be applied when calculating feature usage, based on the meter's groupBy fields. + * Only meters with SUM and COUNT aggregation are supported for features. * Features cannot be updated later, only archived. */ post: operations['createFeature'] } '/api/v1/features/{featureId}': { - /** - * Get feature - * @description Get a feature by id. - */ + /** @description Get a feature by ID. */ get: operations['getFeature'] /** - * Archive a feature - * @description Once a feature is archived it cannot be unarchived. If a feature is archived, new entitlements cannot be created for it, but archiving the feature does not affect existing entitlements. This means, if you want to create a new feature with the same key, and then create entitlements for it, the previous entitlements have to be deleted first on a per subject basis. + * @description Archive a feature by ID. + * + * Once a feature is archived it cannot be unarchived. If a feature is archived, new entitlements cannot be created for it, but archiving the feature does not affect existing entitlements. + * This means, if you want to create a new feature with the same key, and then create entitlements for it, the previous entitlements have to be deleted first on a per subject basis. */ delete: operations['deleteFeature'] } '/api/v1/grants': { /** - * List grants - * @description List all grants for all the subjects and entitlements. This endpoint is intended for administrative purposes only. To fetch the grants of a specific entitlement please use the /api/v1/subjects/{subjectKeyOrID}/entitlements/{entitlementOrFeatureID}/grants endpoint. - * + * @description List all grants for all the subjects and entitlements. This endpoint is intended for administrative purposes only. + * To fetch the grants of a specific entitlement please use the /api/v1/subjects/{subjectKeyOrID}/entitlements/{entitlementOrFeatureID}/grants endpoint. * If page is provided that takes precedence and the paginated response is returned. */ get: operations['listGrants'] } '/api/v1/grants/{grantId}': { /** - * Void a grant * @description Voiding a grant means it is no longer valid, it doesn't take part in further balance calculations. Voiding a grant does not retroactively take effect, meaning any usage that has already been attributed to the grant will remain, but future usage cannot be burnt down from the grant. - * * For example, if you have a single grant for your metered entitlement with an initial amount of 100, and so far 60 usage has been metered, the grant (and the entitlement itself) would have a balance of 40. If you then void that grant, balance becomes 0, but the 60 previous usage will not be affected. */ delete: operations['voidGrant'] } - '/api/v1/subjects/{subjectIdOrKey}/entitlements': { - /** - * List entitlements of a subject - * @description List all entitlements for a subject. For checking entitlement access, use the /value endpoint instead. - */ - get: operations['listSubjectEntitlements'] - /** - * Create an entitlement - * @description OpenMeter has three types of entitlements: metered, boolean, and static. The type property determines the type of entitlement. The underlying feature has to be compatible with the entitlement type specified in the request (e.g., a metered entitlement needs a feature associated with a meter). - * - * - Boolean entitlements define static feature access, e.g. "Can use SSO authentication". - * - Static entitlements let you pass along a configuration while granting access, e.g. "Using this feature with X Y settings" (passed in the config). - * - Metered entitlements have many use cases, from setting up usage-based access to implementing complex credit systems. Example: The customer can use 10000 AI tokens during the usage period of the entitlement. - * - * A given subject can only have one active (non-deleted) entitlement per featureKey. If you try to create a new entitlement for a featureKey that already has an active entitlement, the request will fail with a 409 error. - * - * Once an entitlement is created you cannot modify it, only delete it. - */ - post: operations['createEntitlement'] + '/api/v1/integration/stripe/checkout/sessions': { + /** @description Create checkout session. */ + post: operations['createStripeCheckoutSession'] } - '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementId}': { - /** - * Get an entitlement - * @description Get entitlement by id. For checking entitlement access, use the /value endpoint instead. - */ - get: operations['getEntitlement'] - /** - * Delete an entitlement - * @description Deleting an entitlement revokes access to the associated feature. As a single subject can only have one entitlement per featureKey, when "migrating" features you have to delete the old entitlements as well. - * As access and status checks can be historical queries, deleting an entitlement populates the deletedAt timestamp. When queried for a time before that, the entitlement is still considered active, you cannot have retroactive changes to access, which is important for, among other things, auditing. - */ - delete: operations['deleteEntitlement'] + '/api/v1/marketplace/listings': { + /** @description List available apps of the app marketplace. */ + get: operations['listMarketplaceListings'] } - '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/override': { - /** - * Override an entitlement - * @description Overriding an entitlement creates a new entitlement from the provided inputs and soft deletes the previous entitlement for the provided subject-feature pair. If the previous entitlement is already deleted or otherwise doesnt exist, the override will fail. - * - * This endpoint is useful for upgrades, downgrades, or other changes to entitlements that require a new entitlement to be created with zero downtime. - */ - put: operations['overrideEntitlement'] + '/api/v1/marketplace/listings/{type}': { + /** @description Get a marketplace listing by type. */ + get: operations['getMarketplaceListing'] } - '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/grants': { - /** - * List grants for an entitlement - * @description List all grants issued for an entitlement. The entitlement can be defined either by its id or featureKey. - */ - get: operations['listEntitlementGrants'] - /** - * Create a grant - * @description Grants define a behavior of granting usage for a metered entitlement. They can have complicated recurrence and rollover rules, thanks to which you can define a wide range of access patterns with a single grant, in most cases you don't have to periodically create new grants. You can only issue grants for active metered entitlements. - * - * A grant defines a given amount of usage that can be consumed for the entitlement. The grant is in effect between its effective date and its expiration date. Specifying both is mandatory for new grants. - * - * Grants have a priority setting that determines their order of use. Lower numbers have higher priority, with 0 being the highest priority. - * - * Grants can have a recurrence setting intended to automate the manual reissuing of grants. For example, a daily recurrence is equal to reissuing that same grant every day (ignoring rollover settings). - * - * Rollover settings define what happens to the remaining balance of a grant at a reset. Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) - * - * Grants cannot be changed once created, only deleted. This is to ensure that balance is deterministic regardless of when it is queried. - */ - post: operations['createGrant'] + '/api/v1/marketplace/listings/{type}/install/apikey': { + /** @description Install an marketplace via API Key. */ + post: operations['marketplaceAppAPIKeyInstall'] } - '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/value': { + '/api/v1/marketplace/listings/{type}/install/oauth2': { /** - * Get the current value and access of an entitlement - * @description This endpoint should be used for access checks and enforcement. All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type. - * - * For convenience reasons, /value works with both entitlementId and featureKey. + * @description Install an app via OAuth. + * Returns a URL to start the OAuth 2.0 flow. */ - get: operations['getEntitlementValue'] + get: operations['marketplaceOAuth2InstallGetURL'] } - '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementId}/history': { + '/api/v1/marketplace/listings/{type}/install/oauth2/authorize': { /** - * Get the balance history of a specific entitlement. - * @description Returns historical balance and usage data for the entitlement. The queried history can span accross multiple reset events. - * - * BurndownHistory returns a continous history of segments, where the segments are seperated by events that changed either the grant burndown priority or the usage period. - * - * WindowedHistory returns windowed usage data for the period enriched with balance information and the list of grants that were being burnt down in that window. + * @description Authorize OAuth2 code. + * Verifies the OAuth code and exchanges it for a token and refresh token */ - get: operations['getEntitlementHistory'] + get: operations['marketplaceOAuth2InstallAuthorize'] } - '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementId}/reset': { - /** - * Reset an entitlement - * @description Reset marks the start of a new usage period for the entitlement and initiates grant rollover. At the start of a period usage is zerod out and grants are rolled over based on their rollover settings. It would typically be synced with the subjects billing period to enforce usage based on their subscription. - * - * Usage is automatically reset for metered entitlements based on their usage period, but this endpoint allows to manually reset it at any time. When doing so the period anchor of the entitlement can be changed if needed. - */ - post: operations['resetEntitlementUsage'] + '/api/v1/meters': { + /** @description List meters. */ + get: operations['listMeters'] } - '/api/v1/debug/metrics': { - /** - * Get event metrics - * @description Returns debug metrics like the number of ingested events since mindnight UTC. - * The OpenMetrics Counter(s) reset every day at midnight UTC. - */ - get: operations['getDebugMetrics'] + '/api/v1/meters/{meterIdOrSlug}': { + /** @description Get a meter by ID or slug. */ + get: operations['getMeter'] + } + '/api/v1/meters/{meterIdOrSlug}/query': { + /** @description Query meter for usage. Query meter for usage. */ + get: operations['queryMeter'] + } + '/api/v1/meters/{meterIdOrSlug}/subjects': { + /** @description List subjects for a meter. */ + get: operations['listMeterSubjects'] } '/api/v1/notification/channels': { /** @@ -318,16 +346,32 @@ export interface paths { */ get: operations['getNotificationChannel'] /** - * Update notification channel - * @description Update a notification channel by id. + * Update a notification channel + * @description Update notification channel. */ put: operations['updateNotificationChannel'] /** * Delete a notification channel - * @description Delete notification channel by id. + * @description Soft delete notification channel by id. + * + * Once a notification channel is deleted it cannot be undeleted. */ delete: operations['deleteNotificationChannel'] } + '/api/v1/notification/events': { + /** + * List notification events + * @description List all notification events. + */ + get: operations['listNotificationEvents'] + } + '/api/v1/notification/events/{eventId}': { + /** + * Get notification event + * @description Get a notification event by id. + */ + get: operations['getNotificationEvent'] + } '/api/v1/notification/rules': { /** * List notification rules @@ -348,217 +392,274 @@ export interface paths { get: operations['getNotificationRule'] /** * Update a notification rule - * @description Update a notification rule by id. + * @description Update notification rule. */ put: operations['updateNotificationRule'] /** * Delete a notification rule - * @description Delete notification rule by id. + * @description Soft delete notification rule by id. + * + * Once a notification rule is deleted it cannot be undeleted. */ delete: operations['deleteNotificationRule'] } '/api/v1/notification/rules/{ruleId}/test': { + /** @description Test a notification rule by sending a test event with random data. */ + post: operations['testNotificationRule'] + } + '/api/v1/notification/webhook/svix': { /** - * Test notification rule - * @description Test a notification rule by sending a test event with random data. + * Receive Svix operational events + * @description Callback endpoint used by Svix to notify about operational events. */ - post: operations['testNotificationRule'] + post: operations['receiveSvixOperationalEvent'] } - '/api/v1/notification/events': { + '/api/v1/plans': { /** - * List notification evens - * @description List all notification events. + * List plans + * @description List all plans. */ - get: operations['listNotificationEvents'] + get: operations['listPlans'] + /** + * Create a plan + * @description Create a new plan. + */ + post: operations['createPlan'] } - '/api/v1/notification/events/{eventId}': { + '/api/v1/plans/{planIdOrKey}/next': { /** - * Get notification event - * @description Get a notification event by id. + * New draft plan + * @description Create a new draft version from plan. + * It returns error if there is already a plan in draft or planId does not reference the latest published version. */ - get: operations['getNotificationEvent'] + post: operations['newDraftPlan'] } - '/api/v1/notification/webhook/svix': { + '/api/v1/plans/{planId}': { /** - * Receive Svix operational events - * @description Callback endpoint used by Svix to notify about operational events + * Get plan + * @description Get a plan by id or key. The latest published version is returned if latter is used. */ - post: operations['receiveSvixOperationalEvent'] + get: operations['getPlan'] + /** + * Update a plan + * @description Update plan by id. + */ + put: operations['updatePlan'] + /** + * Delete plan + * @description Soft delete plan by plan.id. + * + * Once a plan is deleted it cannot be undeleted. + */ + delete: operations['deletePlan'] } -} - -export type webhooks = Record - -export interface components { - schemas: { - /** @description Address */ - Address: { - country?: components['schemas']['CountryCode'] - postalCode?: string - state?: string - city?: string - line1?: string - line2?: string - phoneNumber?: string - } + '/api/v1/plans/{planId}/phases': { /** - * @description Metadata fields for all resources. - * These fields are automatically populated by the system for managed entities. Their use and meaning is uniform across all resources. + * List phases in plan + * @description List all phases in plan. */ - SharedMetaFields: { - /** - * @description Readonly unique ULID identifier. - * - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV - */ - id: string - /** - * Format: date-time - * @description The date and time the resource was created. - * @example 2023-01-01T00:00:00Z - */ - createdAt: string - /** - * Format: date-time - * @description The date and time the resource was last updated. The initial value is the same as createdAt. - * @example 2023-01-01T00:00:00Z - */ - updatedAt: string - /** - * Format: date-time - * @description The date and time the resource was deleted. - * @example 2023-01-01T00:00:00Z - */ - deletedAt?: string - } + get: operations['listPlanPhases'] /** - * @description Conflict - * @example { - * "type": "about:blank", - * "title": "Conflict", - * "status": 409, - * "detail": "ledger (default.01HXVNDJR532E8GTBVSC2XK5D4) already exitst for subject subject-1", - * "instance": "urn:request:local/JMOlctsKV8-000001", - * "conflictingEntityId": "01HXVNDJR532E8GTBVSC2XK5D4" - * } + * Create new phase in plan + * @description Create new phase in plan. */ - ConflictProblem: { - /** - * Format: uri - * @description Type contains a URI that identifies the problem type. - * @example urn:problem-type:bad-request - */ - type: string - /** - * @description A a short, human-readable summary of the problem type. - * @example Bad Request - */ - title: string - /** - * Format: int32 - * @description The HTTP status code generated by the origin server for this occurrence of the problem. - * @example 400 - */ - status: number - /** - * @description A human-readable explanation specific to this occurrence of the problem. - * @example body must be a JSON object - */ - detail: string - /** - * Format: uri - * @description A URI reference that identifies the specific occurrence of the problem. - * @example urn:request:local/JMOlctsKV8-000001 - */ - instance?: string - extensions?: { - /** - * @description The id of the conflicting entity. - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV - */ - conflictingEntityId: string - } - [key: string]: unknown + post: operations['createPlanPhases'] + } + '/api/v1/plans/{planId}/phases/{planPhaseKey}': { + /** + * Get phase for plan + * @description Get phase in plan. + */ + get: operations['getPlanPhases'] + /** + * Update phase in plan + * @description Update phase in plan. + */ + put: operations['updatePlanPhases'] + /** + * Delete phase for plan + * @description Delete phase in plan. + * + * Once a phase is deleted it cannot be undeleted. + */ + delete: operations['deletePlanPhases'] + } + '/api/v1/plans/{planId}/publish': { + /** + * Publish plan + * @description Publish a new plan. + */ + post: operations['publishPlan'] + } + '/api/v1/plans/{planId}/unpublish': { + /** + * Unpublish plan + * @description Unpublish a new plan. + */ + post: operations['unpublishPlan'] + } + '/api/v1/portal/meters/{meterSlug}/query': { + /** @description Query meter for consumer portal. This endpoint is publicly exposable to consumers. Query meter for consumer portal. This endpoint is publicly exposable to consumers. */ + get: operations['queryPortalMeter'] + } + '/api/v1/portal/tokens': { + /** @description List tokens. */ + get: operations['listPortalTokens'] + /** @description Create a consumer portal token. */ + post: operations['createPortalToken'] + } + '/api/v1/subjects/{subjectIdOrKey}/entitlements': { + /** @description List all entitlements for a subject. For checking entitlement access, use the /value endpoint instead. */ + get: operations['listSubjectEntitlements'] + /** + * Create an entitlement + * @description OpenMeter has three types of entitlements: metered, boolean, and static. The type property determines the type of entitlement. The underlying feature has to be compatible with the entitlement type specified in the request (e.g., a metered entitlement needs a feature associated with a meter). + * + * - Boolean entitlements define static feature access, e.g. "Can use SSO authentication". + * - Static entitlements let you pass along a configuration while granting access, e.g. "Using this feature with X Y settings" (passed in the config). + * - Metered entitlements have many use cases, from setting up usage-based access to implementing complex credit systems. Example: The customer can use 10000 AI tokens during the usage period of the entitlement. + * + * A given subject can only have one active (non-deleted) entitlement per featureKey. If you try to create a new entitlement for a featureKey that already has an active entitlement, the request will fail with a 409 error. + * + * Once an entitlement is created you cannot modify it, only delete it. + */ + post: operations['createEntitlement'] + } + '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/grants': { + /** @description List all grants issued for an entitlement. The entitlement can be defined either by its id or featureKey. */ + get: operations['listEntitlementGrants'] + /** + * @description Grants define a behavior of granting usage for a metered entitlement. They can have complicated recurrence and rollover rules, thanks to which you can define a wide range of access patterns with a single grant, in most cases you don't have to periodically create new grants. You can only issue grants for active metered entitlements. + * + * A grant defines a given amount of usage that can be consumed for the entitlement. The grant is in effect between its effective date and its expiration date. Specifying both is mandatory for new grants. + * + * Grants have a priority setting that determines their order of use. Lower numbers have higher priority, with 0 being the highest priority. + * + * Grants can have a recurrence setting intended to automate the manual reissuing of grants. For example, a daily recurrence is equal to reissuing that same grant every day (ignoring rollover settings). + * + * Rollover settings define what happens to the remaining balance of a grant at a reset. Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * + * Grants cannot be changed once created, only deleted. This is to ensure that balance is deterministic regardless of when it is queried. + */ + post: operations['createGrant'] + } + '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/override': { + /** + * @description Overriding an entitlement creates a new entitlement from the provided inputs and soft deletes the previous entitlement for the provided subject-feature pair. If the previous entitlement is already deleted or otherwise doesnt exist, the override will fail. + * + * This endpoint is useful for upgrades, downgrades, or other changes to entitlements that require a new entitlement to be created with zero downtime. + */ + put: operations['overrideEntitlement'] + } + '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/value': { + /** + * @description This endpoint should be used for access checks and enforcement. All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type. + * + * For convenience reasons, /value works with both entitlementId and featureKey. + */ + get: operations['getEntitlementValue'] + } + '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementId}': { + /** @description Get entitlement by id. For checking entitlement access, use the /value endpoint instead. */ + get: operations['getEntitlement'] + /** + * @description Deleting an entitlement revokes access to the associated feature. As a single subject can only have one entitlement per featureKey, when "migrating" features you have to delete the old entitlements as well. + * As access and status checks can be historical queries, deleting an entitlement populates the deletedAt timestamp. When queried for a time before that, the entitlement is still considered active, you cannot have retroactive changes to access, which is important for, among other things, auditing. + */ + delete: operations['deleteEntitlement'] + } + '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementId}/history': { + /** + * @description Returns historical balance and usage data for the entitlement. The queried history can span accross multiple reset events. + * + * BurndownHistory returns a continous history of segments, where the segments are seperated by events that changed either the grant burndown priority or the usage period. + * + * WindowedHistory returns windowed usage data for the period enriched with balance information and the list of grants that were being burnt down in that window. + */ + get: operations['getEntitlementHistory'] + } + '/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementId}/reset': { + /** + * @description Reset marks the start of a new usage period for the entitlement and initiates grant rollover. At the start of a period usage is zerod out and grants are rolled over based on their rollover settings. It would typically be synced with the subjects billing period to enforce usage based on their subscription. + * + * Usage is automatically reset for metered entitlements based on their usage period, but this endpoint allows to manually reset it at any time. When doing so the period anchor of the entitlement can be changed if needed. + */ + post: operations['resetEntitlementUsage'] + } + '/api/v1/subscriptions': { + post: operations['Subscriptions_create'] + } + '/api/v1/subscriptions/{subscriptionId}': { + get: operations['getSubscription_getSubscription'] + /** + * @description Batch processing commands for manipulating running subscriptions. + * The key format is `/phases/{phaseKey}` or `/phases/{phaseKey}/items/{itemKey}`. + * + * Add operations insert a new member based on the creation input without altering the existing members. + * + * Remove operations remove the member from the collection / document. + * + * The extend operation extends the specific phase if possible, while delaying all subsequent phases by the same amount. + */ + patch: operations['editSubscription'] + } + '/api/v1/subscriptions/{subscriptionId}/cancel': { + /** @description Cancels the subscription. */ + post: operations['cancelSubscription'] + } + '/api/v1/subscriptions/{subscriptionId}/migrate': { + /** @description Migrates the subscripiton to the procided version of the plan. */ + post: operations['migrateSubscription'] + } + '/api/v1/subscriptions/{subscriptionId}/unschedule-cancelation': { + /** @description Cancels the scheduled cancelation. */ + post: operations['unscheduleCancelation'] + } +} + +export type webhooks = Record + +export interface components { + schemas: { + /** @description Address */ + Address: { + country?: components['schemas']['CountryCode'] + postalCode?: string + state?: string + city?: string + line1?: string + line2?: string + phoneNumber?: string } /** - * @description A Problem Details object (RFC 7807). - * Additional properties specific to the problem type may be present. + * @description Set of key-value pairs managed by the system. Cannot be modified by user. * @example { - * "type": "urn:problem-type:bad-request", - * "title": "Bad Request", - * "status": 400, - * "detail": "body must be a JSON object" + * "externalId": "019142cc-a016-796a-8113-1a942fecd26d" * } */ - Problem: { - /** - * Format: uri - * @description Type contains a URI that identifies the problem type. - * @example urn:problem-type:bad-request - */ - type: string - /** - * @description A a short, human-readable summary of the problem type. - * @example Bad Request - */ - title: string - /** - * Format: int32 - * @description The HTTP status code generated by the origin server for this occurrence of the problem. - * @example 400 - */ - status: number - /** - * @description A human-readable explanation specific to this occurrence of the problem. - * @example body must be a JSON object - */ - detail: string - /** - * Format: uri - * @description A URI reference that identifies the specific occurrence of the problem. - * @example urn:request:local/JMOlctsKV8-000001 - */ - instance?: string + Annotations: { [key: string]: unknown } /** - * @description [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 country code. - * Custom two-letter country codes are also supported for convenience. - * @example US - */ - CountryCode: string - /** - * @description Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. - * Custom three-letter currency codes are also supported for convenience. - * @example USD + * @description App. + * One of: stripe */ - CurrencyCode: string + App: + | components['schemas']['StripeApp'] + | components['schemas']['SandboxApp'] /** - * @description A customer object. - * @example { - * "id": "01G65Z755AFWAKHE12NY0CQ9FH", - * "key": "my_customer_key", - * "name": "ACME Inc.", - * "usageAttribution": { - * "subjectKeys": [ - * "my_subject_key" - * ] - * }, - * "taxProvider": "stripe_tax", - * "invoicingProvider": "stripe_invoicing", - * "paymentProvider": "stripe_payments", - * "external": { - * "stripeCustomerId": "cus_xxxxxxxxxxxxxx" - * } - * } + * @description Abstract base model for installed apps. + * + * Represent an app installed to the organization. + * This is an actual instance, with its own configuration and credentials. */ - Customer: { + AppBase: { /** * ID - * @description A unique identifier for the customer. + * @description A unique identifier for the resource. * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - id: components['schemas']['ULID'] + id: string /** * Display name * @description Human-readable name for the resource. Between 1 and 256 characters. @@ -576,2446 +677,11079 @@ export interface components { metadata?: components['schemas']['Metadata'] /** * Creation Time + * Format: date-time * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ - createdAt?: components['schemas']['DateTime'] + createdAt: string /** * Last Update Time + * Format: date-time * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" */ - updatedAt?: components['schemas']['DateTime'] + updatedAt: string /** * Deletion Time + * Format: date-time * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ - deletedAt?: components['schemas']['DateTime'] + deletedAt?: string + /** @description The marketplace listing that this installed app is based on. */ + listing: components['schemas']['MarketplaceListing'] + /** @description Status of the app connection. */ + status: components['schemas']['AppStatus'] + } + /** + * @description App capability. + * + * Capabilities only exist in config so they don't extend the Resource model. + * @example { + * "type": "collectPayments", + * "key": "stripe_collect_payment", + * "name": "Collect Payments", + * "description": "Stripe payments collects outstanding revenue with Stripe customer's default payment method." + * } + */ + AppCapability: { + /** @description The capability type. */ + type: components['schemas']['AppCapabilityType'] + /** @description Key */ + key: string + /** @description The capability name. */ + name: string + /** @description The capability description. */ + description: string + } + /** + * @description App capability type. + * @enum {string} + */ + AppCapabilityType: + | 'reportUsage' + | 'reportEvents' + | 'calculateTax' + | 'invoiceCustomers' + | 'collectPayments' + /** @description A page of results. */ + AppList: { + /** @description The page number. */ + page: number + /** @description The number of items in the page. */ + pageSize: number + /** @description The total number of items. */ + totalCount: number + /** @description The items in the page. */ + items: components['schemas']['App'][] + } + /** + * @description App reference + * + * Can be used as a short reference to an app if the full app object is not needed. + */ + AppReference: { /** - * Archival Time - * @description Timestamp of when the resource was archived. + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - archivedAt?: components['schemas']['DateTime'] - /** - * Usage Attribution - * @description Mapping to attribute metered usage to the customer + id: string + } + /** + * @description App installed status. + * @enum {string} + */ + AppStatus: 'ready' | 'unauthorized' + /** + * @description Type of the app. + * @enum {string} + */ + AppType: 'stripe' | 'sandbox' + /** @description A discount on plan. One of: percentage or amount. */ + AppliedDiscount: components['schemas']['AppliedDiscountPercentage'] + /** @description Percentage discount on plan. */ + AppliedDiscountPercentage: { + /** + * Type + * @description The type of the discount. + * @enum {string} */ - usageAttribution: components['schemas']['CustomerUsageAttribution'] + type: 'percentage' /** - * Primary Email - * @description The primary email address of the customer. + * Percentage + * @description The percentage of the discount. */ - primaryEmail?: string + percentage: number /** - * Currency - * @description Currency of the customer. - * Used for billing, tax and invoicing. + * Applies To + * @description The rate cards that the discount applies to. + * When not specified, the discount applies to all rate cards. */ - currency?: components['schemas']['CurrencyCode'] + appliesTo?: string[] + } + /** @description Percentage discount on plan. */ + AppliedDiscountPercentageUpdateItem: { /** - * Timezone - * @description Timezone of the customer. + * Percentage + * @description The percentage of the discount. */ - timezone?: string + percentage: number /** - * Billing Address - * @description The billing address of the customer. - * Used for tax and invoicing. + * Applies To + * @description The rate cards that the discount applies to. + * When not specified, the discount applies to all rate cards. */ - billingAddress?: components['schemas']['Address'] + appliesTo?: string[] + } + /** @description A discount on plan. One of: percentage or amount. */ + AppliedDiscountUpdateItem: components['schemas']['AppliedDiscountPercentageUpdateItem'] + /** @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). */ + BadRequestProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** @description The balance history window. */ + BalanceHistoryWindow: { + period: components['schemas']['Period'] /** - * External Mappings - * @description External mappings for the customer. + * Format: double + * @description The total usage of the feature in the period. + * @example 100 */ - external?: components['schemas']['CustomerExternalMapping'] - } - /** @description A unique customer identifier. */ - CustomerIdentifier: - | components['schemas']['ULID'] - | components['schemas']['Key'] - /** @description External mappings for the customer. */ - CustomerExternalMapping: { + usage: number /** - * Stripe Customer - * @description The Stripe customer ID. - * Mapping to a Stripe Customer object. - * Required to use Stripe as an invocing provider. + * Format: double + * @description The entitlement balance at the start of the period. + * @example 100 */ - stripeCustomerId?: string + balanceAtStart: number } - /** @description A page of results. */ - CustomerList: { - /** @description The page number. */ - page: number - /** @description The number of items in the page. */ - pageSize: number - /** @description The total number of items. */ - totalCount: number - /** @description The items in the page. */ - items: components['schemas']['Customer'][] + /** @description Response for creating a pending charge */ + BillingCreateLineResult: { + /** The created line items */ + lines: components['schemas']['BillingInvoiceLine'][] } - /** - * @description Mapping to attribute metered usage to the customer. - * One customer can have multiple subjects, - * but one subject can only belong to one customer. - */ - CustomerUsageAttribution: { + /** @description CreateLinesRequest is the request for creating manual line items. */ + BillingCreateLinesRequest: { + /** The line to create */ + lines: components['schemas']['BillingInvoiceLineCreateItem'][] + } + BillingCreditNoteOriginalInvoiceRef: WithRequired< + { + /** @enum {string} */ + type: 'credit_node_original_invoice' + /** + * IssueAt reflects the time the document was issued. + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + issuedAt?: string + /** (Serial) Number of the referenced document. */ + number?: components['schemas']['BillingInvoiceNumber'] + /** + * Link to the source document. + * Format: uri + */ + url: string + } & components['schemas']['BillingGenericDocumentRef'], + 'type' | 'url' + > + /** @description Customer specific workflow overrides. */ + BillingCustomerOverride: { /** - * SubjectKeys - * @description The subjects that are attributed to the customer. + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ - subjectKeys: string[] + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + workflow: components['schemas']['BillingCustomerWorkflowOverride'] + /** + * @description The billing profile this override is associated with. + * + * If not provided, the default billing profile is chosen if available. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + billingProfile?: string } /** - * @description CloudEvents Specification JSON Schema - * @example { - * "id": "5c10fade-1c9e-4d6c-8275-c52c36731d3c", - * "source": "service-name", - * "specversion": "1.0", - * "type": "prompt", - * "subject": "customer-id", - * "time": "2023-01-01T01:01:01.001Z", - * "data": { - * "tokens": "1234", - * "model": "gpt-4-turbo", - * "type": "input" - * } - * } + * @description Order by options for customers. + * @enum {string} */ - Event: { + BillingCustomerOverrideOrderBy: 'id' + BillingCustomerWorkflowOverride: { /** - * @description Identifies the event. - * @example 5c10fade-1c9e-4d6c-8275-c52c36731d3c + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ - id: string + createdAt: string /** - * Format: uri-reference - * @description Identifies the context in which an event happened. - * @example service-name + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" */ - source: string + updatedAt: string /** - * @description The version of the CloudEvents specification which the event uses. - * @example 1.0 + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ - specversion: string + deletedAt?: string + /** The collection settings for this workflow */ + collection?: components['schemas']['BillingWorkflowCollectionSettings'] + /** The invoicing settings for this workflow */ + invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] + /** The payment settings for this workflow */ + payment?: components['schemas']['BillingWorkflowPaymentSettings'] /** - * @description Describes the type of event related to the originating occurrence. - * @example prompt + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - type: string + id: string + /** The tax app used for this workflow */ + taxApp: { + type: 'BillingCustomerWorkflowOverride' + } & Omit + /** The invoicing app used for this workflow */ + invoicingApp: { + type: 'BillingCustomerWorkflowOverride' + } & Omit + /** The payment app used for this workflow */ + paymentApp: { + type: 'BillingCustomerWorkflowOverride' + } & Omit + } + BillingCustomerWorkflowOverrideCreate: { + /** The collection settings for this workflow */ + collection?: components['schemas']['BillingWorkflowCollectionSettings'] + /** The invoicing settings for this workflow */ + invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] + /** The payment settings for this workflow */ + payment?: components['schemas']['BillingWorkflowPaymentSettings'] + } + /** DocumentRef is used to describe a reference to an existing document (invoice). */ + BillingDocumentRef: components['schemas']['BillingCreditNoteOriginalInvoiceRef'] + /** @enum {string} */ + BillingDocumentRefType: 'credit_node_original_invoice' + /** DueDate contains an amount that should be paid by the given date. */ + BillingDueDate: { /** - * @description Content type of the data value. Must adhere to RFC 2046 format. - * @example application/json - * @enum {string|null} + * When the payment is due. + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + dueAt: string + /** Other details to take into account for the due date. */ + notes?: string + /** How much needs to be paid by the date. */ + amount: components['schemas']['Numeric'] + /** Percentage of the total that should be paid by the date. */ + percent?: components['schemas']['Percentage'] + /** If different from the parent document's base currency. */ + currency?: components['schemas']['CurrencyCode'] + } + /** + * @description BillingFlatFeeLine represents a line item that is sold to the customer as a flat fee. + * + * This object represents an item added via subscriptions. + */ + BillingFlatFeeLine: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - datacontenttype?: 'application/json' | null + name: string /** - * Format: uri - * @description Identifies the schema that data adheres to. + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - dataschema?: string | null + description?: string /** - * @description Describes the subject of the event in the context of the event producer (identified by source). - * @example customer-id + * Metadata + * @description Additional metadata for the resource. */ - subject: string + metadata?: components['schemas']['Metadata'] /** + * Creation Time * Format: date-time - * @description Timestamp of when the occurrence happened. Must adhere to RFC 3339. - * @example 2023-01-01T01:01:01.001Z + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ - time?: string | null + createdAt: string /** - * @description The event payload. - * @example { - * "tokens": "1234", - * "model": "gpt-4-turbo" - * } + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" */ - data?: { - [key: string]: unknown - } - } - /** - * @description An ingested event with optional validation error. - * @example { - * "event": { - * "id": "5c10fade-1c9e-4d6c-8275-c52c36731d3d", - * "source": "service-name", - * "specversion": "1.0", - * "type": "prompt", - * "subject": "customer-id", - * "time": "2024-01-01T01:01:01.001Z", - * "data": { - * "tokens": "1234", - * "model": "gpt-4-turbo" - * } - * }, - * "validationError": "meter not found for event", - * "ingestedAt": "2024-01-01T00:00:00Z", - * "storedAt": "2024-01-01T00:00:00Z" - * } - */ - readonly IngestedEvent: { - readonly event: components['schemas']['Event'] - /** @example invalid event */ - readonly validationError?: string + updatedAt: string /** + * Deletion Time * Format: date-time - * @description The date and time the event was ingested. - * @example 2024-01-01T00:00:00Z + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ - readonly ingestedAt: string + deletedAt?: string /** + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + status: components['schemas']['BillingLineStatus'] + /** Discounts applied to this line. */ + discounts?: components['schemas']['BillingLineDiscount'][] + /** Charges applied to this line. */ + charges?: components['schemas']['BillingLineCharge'][] + /** The invoice this item belongs to. */ + invoice?: components['schemas']['BillingInvoiceReference'] + /** The currency of this line */ + currency: components['schemas']['CurrencyCode'] + /** Map of taxes to be applied and used in the invoice totals. */ + taxes?: components['schemas']['BillingTaxItem'][] + /** Tax overrides specify the tax configuration for this line. */ + taxOverrides?: components['schemas']['TaxConfig'] | null + /** Total sum of the line, including discounts and charges. */ + total: components['schemas']['Numeric'] + /** Period of the line item applies to for revenue recognition pruposes. */ + period: components['schemas']['BillingPeriod'] + /** + * The time this line item should be invoiced. * Format: date-time - * @description The date and time the event was stored. - * @example 2024-01-01T00:00:00Z + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" */ - readonly storedAt: string + invoiceAt: string + /** @enum {string} */ + type: 'flat_fee' + /** Details about what is being sold. */ + item: components['schemas']['RateCardFlatFee'] } /** - * @description A invoicing provider. - * @enum {string} - */ - InvoicingProvider: 'openmeter_sandbox' | 'stripe_invoicing' - /** - * @description A feature is a feature or service offered to a customer. - * For example: CPU-Hours, Tokens, API Calls, etc. + * @description BillingFlatFeeLine represents a line item that is sold to the customer as a flat fee. + * + * This object represents an item added via subscriptions. */ - FeatureCreateInputs: { - /** - * @description The key is an immutable unique identifier of the feature used throughout the API, for example when interacting with a subject's entitlements. The key has to be unique across all active features, but archived features can share the same key. The key should consist of lowercase alphanumeric characters and dashes. - * - * @example gpt4_tokens - */ - key: string + BillingFlatFeeLineCreateItem: { /** - * @description The name of the feature. - * - * @example AI Tokens + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ name: string - /** @description Additional metadata for the feature, useful for syncing with external systems and annotating custom fields. */ - metadata?: { - [key: string]: string - } /** - * @description The meter that the feature is associated with and and based on which usage is calculated. - * The meter selected must have SUM or COUNT aggregation. - * - * @example tokens_total + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - meterSlug?: string + description?: string /** - * @description Optional meter group by filters. Useful if the meter scope is broader than what feature tracks. Example scenario would be a meter tracking all token use with groupBy fields for the model, then the feature could filter for model=gpt-4. - * - * @example { - * "model": "gpt-4" - * } + * Metadata + * @description Additional metadata for the resource. */ - meterGroupByFilters?: { - [key: string]: string - } + metadata?: components['schemas']['Metadata'] + /** Discounts applied to this line. */ + discounts?: components['schemas']['BillingLineDiscount'][] + /** Charges applied to this line. */ + charges?: components['schemas']['BillingLineCharge'][] + /** The invoice this item belongs to. */ + invoice?: components['schemas']['BillingInvoiceReference'] + /** The currency of this line */ + currency: components['schemas']['CurrencyCode'] + /** Tax overrides specify the tax configuration for this line. */ + taxOverrides?: components['schemas']['TaxConfig'] | null + /** Period of the line item applies to for revenue recognition pruposes. */ + period: components['schemas']['BillingPeriod'] + /** + * The time this line item should be invoiced. + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + invoiceAt: string + /** @enum {string} */ + type: 'flat_fee' + /** Details about what is being sold. */ + item: components['schemas']['RateCardFlatFee'] } /** - * @description A feature is a feature or service offered to a customer. - * For example: CPU-Hours, Tokens, API Calls, etc. + * @description BillingFlatFeeLine represents a line item that is sold to the customer as a flat fee. + * + * This object represents an item added via subscriptions. */ - Feature: { + BillingFlatFeeLineCreateOrUpdate: { /** - * Format: date-time - * @description If the feature is archived, no new entitlements can be created for it. - * - * @example 2023-01-01T00:00:00Z + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - archivedAt?: string - } & components['schemas']['FeatureCreateInputs'] & - components['schemas']['SharedMetaFields'] - 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: { + name: string /** - * @description A unique identifier for the notification rule. - * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - id: string + description?: string /** - * @description The key is an immutable unique identifier of the feature used throughout the API, - * for example when interacting with a subject's entitlements. - * - * @example gpt4_tokens + * Metadata + * @description Additional metadata for the resource. */ - key: string + metadata?: components['schemas']['Metadata'] + /** + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + /** Discounts applied to this line. */ + discounts?: components['schemas']['BillingLineDiscount'][] + /** Charges applied to this line. */ + charges?: components['schemas']['BillingLineCharge'][] + /** The invoice this item belongs to. */ + invoice?: components['schemas']['BillingInvoiceReference'] + /** The currency of this line */ + currency: components['schemas']['CurrencyCode'] + /** Tax overrides specify the tax configuration for this line. */ + taxOverrides?: components['schemas']['TaxConfig'] | null + /** Period of the line item applies to for revenue recognition pruposes. */ + period: components['schemas']['BillingPeriod'] + /** + * The time this line item should be invoiced. + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + invoiceAt: string + /** @enum {string} */ + type: 'flat_fee' + /** Details about what is being sold. */ + item: components['schemas']['RateCardFlatFee'] } /** - * Format: date-time - * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. - * @example "2023-01-01T01:01:01.001Z" + * DocumentRef is used to describe an existing document or a specific part of it's contents. + * @description Omitted fields: + * period: Tax period in which the referred document had an effect required by some tax regimes and formats. + * stamps: Seals of approval from other organisations that may need to be listed. + * ext: Extensions for additional codes that may be required. */ - DateTime: string - EntitlementCreateSharedFields: { + BillingGenericDocumentRef: { + /** Type of the document referenced. */ + type: components['schemas']['BillingDocumentRefType'] + /** Human readable description on why this reference is here or needs to be used. */ + reason?: string + /** Additional details about the document. */ + description?: string + } + /** Invoice represents an invoice in the system. */ + BillingInvoice: { /** - * @description The feature the subject is entitled to use. - * Either featureKey or featureId is required. - * - * @example example-feature-key + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - featureKey?: string + id: string /** - * @description The feature the subject is entitled to use. - * Either featureKey or featureId is required. - * - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - featureId?: string - /** @description Additional metadata for the feature. */ - metadata?: { - [key: string]: string - } - usagePeriod?: components['schemas']['RecurringPeriodCreateInput'] - } - EntitlementSharedFields: components['schemas']['SharedMetaFields'] & - components['schemas']['EntitlementCreateSharedFields'] & { - /** - * @description The feature the subject is entitled to use. - * Either featureKey or featureId is required. - * - * @example example-feature-key - */ - featureKey: string - /** - * @description The feature the subject is entitled to use. - * Either featureKey or featureId is required. - * - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV - */ - featureId: string - /** - * @description The identifier key unique to the subject - * @example customer-1 - */ - subjectKey: string - usagePeriod?: components['schemas']['RecurringPeriod'] - currentUsagePeriod?: components['schemas']['Period'] - } - /** @enum {string} */ - MeasureUsageFromEnum: 'CURRENT_PERIOD_START' | 'NOW' - /** Format: date-time */ - MeasureUsageFromTime: string - /** - * @description The time from which usage is measured, defaults to the entitlement creation time. - * The provided value is truncated to the granularity of the underlying meter. - */ - MeasureUsageFrom: - | components['schemas']['MeasureUsageFromEnum'] - | components['schemas']['MeasureUsageFromTime'] - EntitlementMeteredCreateInputs: components['schemas']['EntitlementCreateSharedFields'] & { + description?: string /** - * @example metered - * @enum {string} + * Metadata + * @description Additional metadata for the resource. */ - type: 'metered' + metadata?: components['schemas']['Metadata'] /** - * @description If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true. - * - * @default false + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ - isSoftLimit?: boolean + createdAt: string /** - * @description Deprecated, ignored by the backend. Please use isSoftLimit instead; this field will be removed in the future. - * - * @default false + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ - isUnlimited?: boolean - usagePeriod: components['schemas']['RecurringPeriodCreateInput'] - measureUsageFrom?: components['schemas']['MeasureUsageFrom'] + deletedAt?: string /** - * Format: double - * @description You can grant usage automatically alongside the entitlement, the example scenario would be creating a starting balance. If an amount is specified here, a grant will be created alongside the entitlement with the specified amount. - * That grant will have it's rollover settings configured in a way that after each reset operation, the balance will return the original amount specified here. + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. * - * Manually creating such a grant would mean having the "amount", "minRolloverAmount", and "maxRolloverAmount" fields all be the same. + * For updates the updatedAt field is used to detect conflicts. + * @example "2024-01-01T01:01:01.001Z" */ - issueAfterReset?: number - /** - * @description Defines the grant priority for the default grant. If provided, issueAfterReset must have a value. + updatedAt: string + type: components['schemas']['BillingInvoiceType'] + /** The taxable entity supplying the goods or services. */ + supplier: components['schemas']['BillingParty'] + /** Legal entity receiving the goods or services. */ + customer: components['schemas']['BillingParty'] + /** + * (Serial) Number of the invoice + * @description Number specifies the human readable key used to reference this Invoice. * - * @default 1 - * @example 1 - */ - issueAfterResetPriority?: number - /** - * @description If true, the overage is preserved at reset. If false, the usage is forgiven. + * The number only gets populated after the invoice had been issued. * - * @default false + * Please note that the number is (depending on the upstream settings) either unique for the + * whole organization or unique for the customer, or in multi (stripe) account setups unique for the + * account. + */ + number?: components['schemas']['BillingInvoiceNumber'] + /** Currency for all invoice totals. */ + currency: components['schemas']['CurrencyCode'] + /** Key information regarding previous invoices and potentially details as to why they were corrected. */ + preceding?: components['schemas']['BillingDocumentRef'][] + /** Summary of all the invoice totals, including taxes (calculated). */ + totals: components['schemas']['BillingInvoiceTotals'] + /** The status of the invoice. */ + status: components['schemas']['BillingInvoiceStatus'] + /** The details of the current invoice status */ + statusDetails: components['schemas']['BillingInvoiceStatusDetails'] + /** + * The time the invoice was issued. + * Format: date-time + * @description The time the invoice was issued. + * + * Depending on the status of the invoice this can mean multiple things: + * - draft, gathering: The time the invoice will be issued based on the workflow settings. + * - issued: The time the invoice was issued. + * @example "2023-01-01T01:01:01.001Z" */ - preserveOverageAtReset?: boolean - } - EntitlementCreateInputs: - | components['schemas']['EntitlementMeteredCreateInputs'] - | components['schemas']['EntitlementStaticCreateInputs'] - | components['schemas']['EntitlementBooleanCreateInputs'] - /** @description Metered entitlements are useful for many different use cases, from setting up usage based access to implementing complex credit systems. Access is determined based on feature usage using a balance calculation (the "usage allowance" provided by the issued grants is "burnt down" by the usage). */ - EntitlementMetered: components['schemas']['EntitlementMeteredCreateInputs'] & - components['schemas']['EntitlementMeteredCalculatedFields'] & - components['schemas']['EntitlementSharedFields'] - /** @description Calculated fields for a metered entitlement. */ - EntitlementMeteredCalculatedFields: { + issuedAt?: string /** + * The time until the invoice is in draft status. * Format: date-time - * @description The last time a reset happened. + * @description The time until the invoice is in draft status. * - * @example 2023-01-01T00:00:00Z + * On draft invoice creation it is calculated from the workflow settings. + * + * If manual approval is required, the draftUntil time is set. + * @example "2023-01-01T01:01:01.001Z" */ - lastReset: string - currentUsagePeriod: components['schemas']['Period'] + draftUntil?: string /** + * Due time of the fulfillment of the invoice. * Format: date-time - * @description The time from which usage is measured. If not specified on creation, defaults to the entitlement creation time. + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" */ - measureUsageFrom: string - } - EntitlementStaticCreateInputs: components['schemas']['EntitlementCreateSharedFields'] & { + dueAt?: string + /** The period the invoice covers. If the invoice has no line items, it's not set. */ + period?: components['schemas']['BillingPeriod'] /** - * @example static - * @enum {string} + * The time the invoice was voided. + * Format: date-time + * @description The time the invoice was voided. + * + * If the invoice was voided, this field will be set to the time the invoice was voided. + * @example "2023-01-01T01:01:01.001Z" */ - type: 'static' + voidedAt?: string /** - * @description The JSON parsable config of the entitlement. This value is also returned when checking entitlement access and it is useful for configuring fine-grained access settings to the feature, implemented in your own system. Has to be an object. + * The workflow settings associated with this invoice + * @description The workflow associated with the invoice. * - * @example {"key1": "value1"} - */ - config: string + * It is always a snapshot of the workflow settings at the time of invoice creation. The + * field is optional as it should be explicitly requested with expand options. + */ + workflow?: components['schemas']['BillingInvoiceWorkflowSettings'] + /** List of invoice lines representing each of the items sold to the customer. */ + lines?: components['schemas']['BillingInvoiceLine'][] + /** Discounts or allowances applied to the complete invoice. */ + discounts?: components['schemas']['BillingInvoiceDiscount'][] + /** Information on when, how, and to whom the invoice should be paid. */ + payment?: components['schemas']['BillingInvoicePayment'] + /** Validation issues reported by the invoice workflow. */ + validationIssues?: components['schemas']['BillingValidationIssue'][] } - /** @description Entitles a subject to use a feature. */ - EntitlementStatic: components['schemas']['EntitlementStaticCreateInputs'] & - components['schemas']['EntitlementSharedFields'] - EntitlementBooleanCreateInputs: components['schemas']['EntitlementCreateSharedFields'] & { + /** @enum {string} */ + BillingInvoiceAction: 'advance' | 'approve' | 'delete' | 'retry' | 'void' + BillingInvoiceCreateInput: { /** - * @example boolean - * @enum {string} + * @description The pending line items to include in the invoice, if not provided: + * - all line items that have invoice_at < asOf will be included + * - all usage based line items will be included up to asOf, new usage-based line items will be staged for the rest + * of the billing cycle */ - type: 'boolean' - } - /** @description Entitles a subject to use a feature. */ - EntitlementBoolean: components['schemas']['EntitlementBooleanCreateInputs'] & - components['schemas']['EntitlementSharedFields'] - Entitlement: - | components['schemas']['EntitlementMetered'] - | components['schemas']['EntitlementStatic'] - | components['schemas']['EntitlementBoolean'] - ListEntitlementPaginatedResponse: components['schemas']['PaginationInfo'] & { - /** @description List of entitlements. */ - items: components['schemas']['Entitlement'][] + IncludePendingLines?: string[] + /** + * Format: date-time + * @description The time as of which the invoice is created. + * + * If not provided, the current time is used. + * @example "2023-01-01T01:01:01.001Z" + */ + AsOf?: string + } + /** Discount represents an allowance applied to the complete document independent from the individual lines. */ + BillingInvoiceDiscount: { + /** Base represents the value used as a base for percent calculations instead of the invoice's sum of lines. */ + base?: components['schemas']['Numeric'] + /** Percentage to apply to the base or invoice's sum. */ + percent?: components['schemas']['Percentage'] + /** Amount to apply (calculated if percent present). */ + amount: components['schemas']['Numeric'] + /** Text description as to why the discount was applied */ + reason?: string } - ListEntitlementResponse: - | components['schemas']['Entitlement'][] - | components['schemas']['ListEntitlementPaginatedResponse'] /** - * @description A segment of the grant burn down history. + * @description InvoiceExpand specifies the parts of the invoice to expand in the list output. + * @enum {string} + */ + BillingInvoiceExpand: + | '*' + | 'lines' + | 'preceding' + | 'workflow' + | 'workflow.apps' + /** + * @description InvoiceExtendedStatus describes the extended status of an invoice. * - * A given segment represents the usage of a grant between events that changed either the grant burn down priority order or the usag period. + * This is used to provide more detailed information about the status of the invoice. Useful for + * troubelshooting invoice workflow issues. + * @enum {string} */ - GrantBurnDownHistorySegment: { - period?: components['schemas']['Period'] - /** - * Format: double - * @description The usage of the grant in the period. - * - * @example 100 + BillingInvoiceExtendedStatus: + | 'gathering' + | 'draft' + | 'issuing' + | 'issued' + | 'draft_created' + | 'draft_manual_approval_needed' + | 'draft_validating' + | 'draft_invalid' + | 'draft_syncing' + | 'draft_sync_failed' + | 'draft_waiting_auto_approval' + | 'draft_ready_to_issue' + | 'issuing_syncing' + | 'issuing_sync_failed' + /** UnitPriceLine represents a line item that is sold to the customer based on a specific (unit) price. */ + BillingInvoiceLine: + | components['schemas']['BillingFlatFeeLine'] + | components['schemas']['BillingManualFeeLine'] + /** UnitPriceLine represents a line item that is sold to the customer based on a specific (unit) price. */ + BillingInvoiceLineCreateItem: + | components['schemas']['BillingFlatFeeLineCreateItem'] + | components['schemas']['BillingManualFeeLineCreateItem'] + /** UnitPriceLine represents a line item that is sold to the customer based on a specific (unit) price. */ + BillingInvoiceLineCreateOrUpdate: + | components['schemas']['BillingFlatFeeLineCreateOrUpdate'] + | components['schemas']['BillingManualFeeLineCreateOrUpdate'] + /** + * @description InvoiceNumber is a unique identifier for the invoice, generated by the + * invoicing app. + * + * The uniqueness depends on a lot of factors: + * - app setting (unique per app or unique per customer) + * - multiple app scenarios (multiple apps generating invoices with the same prefix) + * @example INV-2024-01-01-01 + */ + BillingInvoiceNumber: string + /** + * @description InvoiceOrderBy specifies the ordering options for invoice listing. + * @enum {string} + */ + BillingInvoiceOrderBy: + | 'customer.name' + | 'issuedAt' + | 'status' + | 'createdAt' + | 'updatedAt' + /** Payment contains details as to how the invoice should be paid. */ + BillingInvoicePayment: { + terms?: components['schemas']['BillingPaymentTerms'] + } + /** Reference to an invoice. */ + BillingInvoiceReference: { + /** + * The ID of the invoice. + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - usage?: number + id: string + /** The number of the invoice. */ + number?: components['schemas']['BillingInvoiceNumber'] + } + /** + * @description InvoiceStatus describes the status of an invoice. + * @enum {string} + */ + BillingInvoiceStatus: 'gathering' | 'draft' | 'issuing' | 'issued' + BillingInvoiceStatusDetails: { + /** Is the invoice editable? */ + immutable: boolean + /** Is the invoice in a failed state? */ + failed: boolean + /** Extended status information for the invoice. */ + extendedStatus: components['schemas']['BillingInvoiceExtendedStatus'] + /** The actions that can be performed on the invoice. */ + availableActions: components['schemas']['BillingInvoiceAction'][] + } + /** Totals contains the summaries of all calculations for the invoice. */ + BillingInvoiceTotals: { + /** Sum of all line item sums */ + sum: components['schemas']['Numeric'] + /** Sum of all document level discounts */ + discount?: components['schemas']['Numeric'] + /** Sum of all document level charges */ + charge?: components['schemas']['Numeric'] + /** If prices include tax, this is the total tax included in the price. */ + taxIncluded?: components['schemas']['Numeric'] + /** Sum of all line sums minus the discounts, plus the charges, without tax. */ + total: components['schemas']['Numeric'] + /** Total amount of tax to apply to the invoice. */ + tax?: components['schemas']['Numeric'] + /** Grand total after all taxes have been applied. */ + totalWithTax: components['schemas']['Numeric'] + /** Rounding amount to apply to the invoice in case the total and payable amounts don't quite match. */ + rounding?: components['schemas']['Numeric'] + /** Total amount to be paid after applying taxes and outlays. */ + payable: components['schemas']['Numeric'] + /** Total amount already paid in advance. */ + advance?: components['schemas']['Numeric'] + /** How much actually needs to be paid now. */ + due?: components['schemas']['Numeric'] + } + /** @enum {string} */ + BillingInvoiceType: 'standard' | 'credit_note' + BillingInvoiceWorkflowSettings: { + /** The apps that will be used to orchestrate the invoice's workflow. */ + apps?: components['schemas']['BillingProfileAppsOrReference'] /** - * Format: double - * @description Overuse that wasn't covered by grants. + * The billing profile on which the workflow was based on. + * @description sourceBillingProfileID is the billing profile on which the workflow was based on. * - * @example 25 + * The profile is snapshotted on invoice creation, after which it can be altered independently + * of the profile itself. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - overage?: number + sourceBillingProfileID: string + /** The workflow details used by this invoice. */ + workflow: components['schemas']['BillingWorkflowSettings'] + /** Timezone of the invoice's date fields. */ + timezone: string + } + /** LineCharge represents an amount added to the line, and will be applied before taxes. */ + BillingLineCharge: { /** - * Format: double - * @description The entitlement balance at the start of the period. - * - * @example 100 + * Percent + * @description Percentage if fixed amount not applied */ - balanceAtStart?: number + percent?: components['schemas']['Percentage'] /** - * @description The balance breakdown of each active grant at the start of the period: GrantID: Balance - * - * @example { - * "01ARZ3NDEKTSV4RRFFQ69G5FAV": 100 - * } + * Amount + * @description Fixed discount amount to apply (calculated if percent present). */ - grantBalancesAtStart?: { - [key: string]: number - } + amount: components['schemas']['Numeric'] + /** Reason code. */ + code?: string + /** Text description as to why the discount was applied. */ + reason?: string + } + /** LineDiscount represents an amount deducted from the line, and will be applied before taxes. */ + BillingLineDiscount: { /** - * Format: double - * @description The entitlement balance at the end of the period. - * - * @example 100 + * Percent + * @description Percentage if fixed amount not applied */ - balanceAtEnd?: number + percent?: components['schemas']['Percentage'] /** - * @description The balance breakdown of each active grant at the start of the period: GrantID: Balance - * - * @example { - * "01ARZ3NDEKTSV4RRFFQ69G5FAV": 100 - * } + * Amount + * @description Fixed discount amount to apply (calculated if percent present). */ - grantBalancesAtEnd?: { - [key: string]: number - } - /** @description Which grants were actually burnt down in the period and by what amount. */ - grantUsages?: readonly components['schemas']['GrantUsageRecord'][] + amount: components['schemas']['Numeric'] + /** Reason code. */ + code?: string + /** Text description as to why the discount was applied. */ + reason?: string } - GrantUsageRecord: { + /** + * Line status specifies the status of the line. + * @enum {string} + */ + BillingLineStatus: 'valid' | 'deleted' | 'split' + /** @description BillingManualFeeLine represents a line item that is sold to the customer as a manually added fee. */ + BillingManualFeeLine: { /** - * @description The id of the grant. - * - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - grantId?: string + name: string /** - * Format: double - * @description The usage of the grant. - * - * @example 100 + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - usage?: number - } - /** @description Windowed usage and balance information. */ - BalanceHistoryWindow: { - period?: components['schemas']['Period'] + description?: string /** - * Format: double - * @description The total usage of the feature in the period. - * - * @example 100 + * Metadata + * @description Additional metadata for the resource. */ - usage?: number + metadata?: components['schemas']['Metadata'] /** - * Format: double - * @description The entitlement balance at the start of the period. - * - * @example 100 + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ - balanceAtStart?: number - } - /** @description The windowed balance history. */ - WindowedBalanceHistory: { + createdAt: string /** - * @description The windowed balance history. - * - It only returns rows for windows where there was usage. - * - The windows are inclusive at their start and exclusive at their end. - * - The last window may be smaller than the window size and is inclusive at both ends. + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" */ - windowedHistory?: components['schemas']['BalanceHistoryWindow'][] - /** @description Grant burndown history. */ - burndownHistory?: components['schemas']['GrantBurnDownHistorySegment'][] - } - /** @description A time period */ - Period: { + updatedAt: string /** + * Deletion Time * Format: date-time - * @description Period start time where the amount was applied. If applicable. - * - * @example 2023-01-01T00:00:00Z + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ - from: string + deletedAt?: string /** + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + status: components['schemas']['BillingLineStatus'] + /** Discounts applied to this line. */ + discounts?: components['schemas']['BillingLineDiscount'][] + /** Charges applied to this line. */ + charges?: components['schemas']['BillingLineCharge'][] + /** The invoice this item belongs to. */ + invoice?: components['schemas']['BillingInvoiceReference'] + /** The currency of this line */ + currency: components['schemas']['CurrencyCode'] + /** Map of taxes to be applied and used in the invoice totals. */ + taxes?: components['schemas']['BillingTaxItem'][] + /** Tax overrides specify the tax configuration for this line. */ + taxOverrides?: components['schemas']['TaxConfig'] | null + /** Total sum of the line, including discounts and charges. */ + total: components['schemas']['Numeric'] + /** Period of the line item applies to for revenue recognition pruposes. */ + period: components['schemas']['BillingPeriod'] + /** + * The time this line item should be invoiced. * Format: date-time - * @description Period end time where the amount was applied. If applicable. - * - * @example 2023-01-01T00:00:00Z + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" */ - to: string + invoiceAt: string + /** @enum {string} */ + type: 'manual_fee' + /** Price of the item being sold. */ + price: components['schemas']['Numeric'] + /** Quantity of the item being sold. */ + quantity: components['schemas']['Numeric'] } - /** - * @description List of pre-defined periods that can be used for recurring & scheduling. - * - * DAY: Every day - * WEEK: Every week - * MONTH: Every month - * YEAR: Every year - * - * @enum {string} - */ - RecurringPeriodEnum: 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' - /** @description Recurring period of an entitlement. */ - RecurringPeriodCreateInput: { - interval: components['schemas']['RecurringPeriodEnum'] + /** @description BillingManualFeeLine represents a line item that is sold to the customer as a manually added fee. */ + BillingManualFeeLineCreateItem: { /** - * Format: date-time - * @description An arbitrary anchor to base the recurring period on. - * If not provided then defaults to now truncated to the hour. + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - anchor?: string - } - /** @description Recurring period of an entitlement. */ - RecurringPeriod: { - interval: components['schemas']['RecurringPeriodEnum'] + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** Discounts applied to this line. */ + discounts?: components['schemas']['BillingLineDiscount'][] + /** Charges applied to this line. */ + charges?: components['schemas']['BillingLineCharge'][] + /** The invoice this item belongs to. */ + invoice?: components['schemas']['BillingInvoiceReference'] + /** The currency of this line */ + currency: components['schemas']['CurrencyCode'] + /** Tax overrides specify the tax configuration for this line. */ + taxOverrides?: components['schemas']['TaxConfig'] | null + /** Period of the line item applies to for revenue recognition pruposes. */ + period: components['schemas']['BillingPeriod'] + /** + * The time this line item should be invoiced. * Format: date-time - * @description An arbitrary anchor to base the recurring period on. + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" */ - anchor: string + invoiceAt: string + /** @enum {string} */ + type: 'manual_fee' + /** Price of the item being sold. */ + price: components['schemas']['Numeric'] + /** Quantity of the item being sold. */ + quantity: components['schemas']['Numeric'] } - /** @description Grants are used to increase balance of specific subjects. */ - EntitlementGrantCreateInput: { + /** @description BillingManualFeeLine represents a line item that is sold to the customer as a manually added fee. */ + BillingManualFeeLineCreateOrUpdate: { /** - * Format: double - * @description The amount to grant. Should be a positive number. - * - * @example 100 + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - amount: number + name: string /** - * @description The priority of the grant. Grants with higher priority are applied first. - * Priority is a positive decimal numbers. With lower numbers indicating higher importance. - * For example, a priority of 1 is more urgent than a priority of 2. - * When there are several grants available for the same subject, the system selects the grant with the highest priority. - * In cases where grants share the same priority level, the grant closest to its expiration will be used first. - * In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first. - * - * @default 1 - * @example 1 + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - priority?: number + description?: string /** - * Format: date-time - * @description Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute). - * - * @example 2023-01-01T00:00:00Z + * Metadata + * @description Additional metadata for the resource. */ - effectiveAt: string - expiration: components['schemas']['ExpirationPeriod'] + metadata?: components['schemas']['Metadata'] /** - * Format: double - * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. - * - * Balance after the reset is calculated as: - * Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) - * - * @default 0 - * @example 100 + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - maxRolloverAmount?: number + id: string + /** Discounts applied to this line. */ + discounts?: components['schemas']['BillingLineDiscount'][] + /** Charges applied to this line. */ + charges?: components['schemas']['BillingLineCharge'][] + /** The invoice this item belongs to. */ + invoice?: components['schemas']['BillingInvoiceReference'] + /** The currency of this line */ + currency: components['schemas']['CurrencyCode'] + /** Tax overrides specify the tax configuration for this line. */ + taxOverrides?: components['schemas']['TaxConfig'] | null + /** Period of the line item applies to for revenue recognition pruposes. */ + period: components['schemas']['BillingPeriod'] + /** + * The time this line item should be invoiced. + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + invoiceAt: string + /** @enum {string} */ + type: 'manual_fee' + /** Price of the item being sold. */ + price: components['schemas']['Numeric'] + /** Quantity of the item being sold. */ + quantity: components['schemas']['Numeric'] + } + /** Party represents a person or business entity. */ + BillingParty: { /** - * Format: double - * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. - * - * Balance after the reset is calculated as: - * Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) - * - * @default 0 - * @example 100 + * ID of the party. + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - minRolloverAmount?: number + id?: string + /** Legal name or representation of the organization. */ + name?: string + /** The entity's legal ID code used for tax purposes. They may have other numbers, but we're only interested in those valid for tax purposes. */ + taxId?: components['schemas']['BillingTaxIdentity'] + /** Regular post addresses for where information should be sent if needed. */ + addresses?: components['schemas']['Address'][] + } + /** Party represents a person or business entity. */ + BillingPartyCreate: { + /** Legal name or representation of the organization. */ + name?: string + /** The entity's legal ID code used for tax purposes. They may have other numbers, but we're only interested in those valid for tax purposes. */ + taxId?: components['schemas']['BillingTaxIdentity'] + /** Regular post addresses for where information should be sent if needed. */ + addresses?: components['schemas']['Address'][] + } + /** PaymentTermDueDate defines the terms for payment on a specific date. */ + BillingPaymentTermDueDate: { + /** + * Type of terms to be applied. + * @enum {string} + */ + type: 'due_date' + /** Text detail of the chosen payment terms. */ + detail?: string + /** Description of the conditions for payment. */ + notes?: string + /** When the payment is due. */ + dueAt: components['schemas']['BillingDueDate'][] + } + /** PaymentTermInstant defines the terms for payment on receipt of invoice. */ + BillingPaymentTermInstant: { /** - * @example { - * "stripePaymentId": "pi_4OrAkhLvyihio9p51h9iiFnB" - * } + * Type of terms to be applied. + * @enum {string} */ - metadata?: { - [key: string]: string - } - recurrence?: components['schemas']['RecurringPeriodCreateInput'] + type: 'instant' + /** Text detail of the chosen payment terms. */ + detail?: string + /** Description of the conditions for payment. */ + notes?: string } - EntitlementGrant: components['schemas']['EntitlementGrantCreateInput'] & - components['schemas']['SharedMetaFields'] & { - /** - * @description The unique entitlement ULID that the grant is associated with. - * - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV - */ - entitlementId: string - /** - * Format: date-time - * @description The next time the grant will recurr. - * - * @example 2023-01-01T00:00:00Z - */ - nextRecurrence?: string - /** - * Format: date-time - * @description The expiration date of the grant. - * - * @example 2023-01-01T00:00:00Z - */ - expiresAt?: string - /** - * Format: date-time - * @description The date and time the grant was voided (cannot be used after that). - */ - voidedAt?: string - recurrence?: components['schemas']['RecurringPeriod'] - } - ListEntitlementGrantPaginatedResponse: components['schemas']['PaginationInfo'] & { - /** @description List of grants. */ - items: components['schemas']['EntitlementGrant'][] + /** PaymentTerms defines the terms for payment. */ + BillingPaymentTerms: + | components['schemas']['BillingPaymentTermInstant'] + | components['schemas']['BillingPaymentTermDueDate'] + /** Period represents a time range. */ + BillingPeriod: { + /** + * Start of the period. + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + start: string + /** + * End of the period. + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + end: string } - ListEntitlementGrantResponse: - | components['schemas']['EntitlementGrant'][] - | components['schemas']['ListEntitlementGrantPaginatedResponse'] - EntitlementValue: { + /** @description Profile represents a billing profile */ + BillingProfile: { /** - * @description Whether the subject has access to the feature. Shared accross all entitlement types. - * - * @example true + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - hasAccess: boolean + id: string /** - * Format: double - * @description Only available for metered entitlements. Metered entitlements are built around a balance calculation where feature usage is deducted from the issued grants. Balance represents the remaining balance of the entitlement, it's value never turns negative. - * - * @example 100 + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - balance?: number + name: string /** - * Format: double - * @description Only available for metered entitlements. Returns the total feature usage in the current period. - * - * @example 50 + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - usage?: number + description?: string /** - * Format: double - * @description Only available for metered entitlements. Overage represents the usage that wasn't covered by grants, e.g. if the subject had a total feature usage of 100 in the period but they were only granted 80, there would be 20 overage. - * - * @example 0 + * Metadata + * @description Additional metadata for the resource. */ - overage?: number + metadata?: components['schemas']['Metadata'] /** - * @description Only available for static entitlements. The JSON parsable config of the entitlement. - * - * @example {"key1": "value1"} + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ - config?: string - } - /** @description Expiration period of a grant. */ - ExpirationPeriod: { + createdAt: string /** - * @description The expiration period duration like month. - * - * @enum {string} + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ - duration: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' + deletedAt?: string /** - * @description The expiration period count like 12 months. + * Last update time of the resource + * Format: date-time + * @description When the resource was last updated. * - * @example 12 + * For updates this field must be set to the last update time to detect conflicts. + * @example "2023-01-01T01:01:01.001Z" */ - count: number - } - /** - * @description A meter is a configuration that defines how to match and aggregate events. - * @example { - * "slug": "tokens_total", - * "description": "AI token usage", - * "aggregation": "SUM", - * "windowSize": "MINUTE", - * "eventType": "prompt", - * "valueProperty": "$.tokens", - * "groupBy": { - * "model": "$.model", - * "type": "$.type" - * } - * } - */ - Meter: { + updatedAt: string + /** The name and contact information for the supplier this billing profile represents */ + supplier: components['schemas']['BillingParty'] + /** The billing workflow settings for this profile */ + workflow: components['schemas']['BillingWorkflow'] + /** The applications used by this billing profile */ + apps: components['schemas']['BillingProfileAppsOrReference'] + /** Is this the default profile? */ + default: boolean + } + /** @description ProfileAppsReference represents the references (id, type) to the apps used by a billing profile */ + BillingProfileAppReferences: { + /** The tax app used for this workflow */ + tax: components['schemas']['AppReference'] + /** The invoicing app used for this workflow */ + invoicing: components['schemas']['AppReference'] + /** The payment app used for this workflow */ + payment: components['schemas']['AppReference'] + } + /** @description ProfileApps represents the applications used by a billing profile */ + BillingProfileApps: { + /** The tax app used for this workflow */ + tax: { + type: 'BillingProfileApps' + } & Omit + /** The invoicing app used for this workflow */ + invoicing: { + type: 'BillingProfileApps' + } & Omit + /** The payment app used for this workflow */ + payment: { + type: 'BillingProfileApps' + } & Omit + } + BillingProfileAppsOrReference: + | components['schemas']['BillingProfileApps'] + | components['schemas']['BillingProfileAppReferences'] + /** @description ProfileCreateAppsInput represents the input for creating a billing profile's apps */ + BillingProfileCreateAppsInput: { + /** The tax app used for this workflow */ + tax: components['schemas']['BillingWorkflowAppIdOrType'] + /** The invoicing app used for this workflow */ + invoicing: components['schemas']['BillingWorkflowAppIdOrType'] + /** The payment app used for this workflow */ + payment: components['schemas']['BillingWorkflowAppIdOrType'] + } + /** @description ProfileCreateInput represents the input for creating a billing profile */ + BillingProfileCreateInput: { /** - * @description A unique identifier for the meter. - * @example 01G65Z755AFWAKHE12NY0CQ9FH + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - id?: string + name: string /** - * @description A unique, human-readable identifier for the meter. Must consist only alphanumeric and underscore characters. - * @example tokens_total + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - slug: string + description?: string /** - * @description A description of the meter. - * @example AI Token Usage + * Metadata + * @description Additional metadata for the resource. */ - description?: string | null - aggregation: components['schemas']['MeterAggregation'] - windowSize: components['schemas']['WindowSize'] + metadata?: components['schemas']['Metadata'] + /** The name and contact information for the supplier this billing profile represents */ + supplier: components['schemas']['BillingPartyCreate'] + /** The billing workflow settings for this profile */ + workflow: components['schemas']['BillingWorkflow'] + /** Is this the default profile? */ + default: boolean + apps: components['schemas']['BillingProfileCreateAppsInput'] + } + /** @description Profile represents a billing profile */ + BillingProfileCreateOrUpdate: { /** - * @description The event type to aggregate. - * @example prompt + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - eventType: string + name: string /** - * @description JSONPath expression to extract the value from the ingested event's data property. - * The ingested value for SUM, AVG, MIN, and MAX aggregations is a number or a string that can be parsed to a number. - * For UNIQUE_COUNT aggregation, the ingested value must be a string. For COUNT aggregation the valueProperty is ignored. - * - * @example $.tokens + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - valueProperty?: string + description?: string /** - * @description Named JSONPath expressions to extract the group by values from the event data. Keys must be unique and consist only alphanumeric and underscore characters. - * @example { - * "model": "$.model", - * "type": "$.type" - * } + * Metadata + * @description Additional metadata for the resource. */ - groupBy?: { - [key: string]: string - } + metadata?: components['schemas']['Metadata'] + /** + * Last update time of the resource + * Format: date-time + * @description When the resource was last updated. + * + * For updates this field must be set to the last update time to detect conflicts. + * @example "2023-01-01T01:01:01.001Z" + */ + updatedAt: string + /** The name and contact information for the supplier this billing profile represents */ + supplier: components['schemas']['BillingParty'] + /** The billing workflow settings for this profile */ + workflow: components['schemas']['BillingWorkflow'] + /** Is this the default profile? */ + default: boolean } /** - * @description The aggregation type to use for the meter. - * @example SUM + * @description ProfileExpand details what profile fields to expand * @enum {string} */ - MeterAggregation: 'SUM' | 'COUNT' | 'UNIQUE_COUNT' | 'AVG' | 'MIN' | 'MAX' + BillingProfileExpand: 'apps' | '*' /** - * @description Set of key-value pairs. - * Metadata can be used to store additional information about a resource. - * @example { - * "externalId": "019142cc-a016-796a-8113-1a942fecd26d" - * } + * @description ProfileOrderBy specifies the ordering options for profiles + * @enum {string} */ - Metadata: { - [key: string]: string + BillingProfileOrderBy: 'createdAt' | 'updatedAt' | 'default' | 'name' + /** @enum {string} */ + BillingTaxBehavior: 'inclusive' | 'exclusive' + BillingTaxIdentificationCode: string + /** Identity stores the details required to identify an entity for tax purposes in a specific country. */ + BillingTaxIdentity: { + /** Normalized tax code shown on the original identity document. */ + code?: components['schemas']['BillingTaxIdentificationCode'] + } + BillingTaxItem: { + /** Tax provider configuration. */ + config?: components['schemas']['TaxConfig'] + /** + * Percent defines the percentage set manually or determined from the rate + * key (calculated if rate present). A nil percent implies that this tax combo + * is **exempt** from tax. + */ + percent?: components['schemas']['Percentage'] + /** Some countries require an additional surcharge (calculated if rate present). */ + surcharge?: components['schemas']['Numeric'] + /** Is the tax item inclusive or exclusive of the base amount. */ + behavior?: components['schemas']['BillingTaxBehavior'] } /** - * @description Aggregation window size. - * @example MINUTE - * @enum {string} + * @description ValidationIssue captures any validation issues related to the invoice. + * + * Issues with severity "critical" will prevent the invoice from being issued. */ - WindowSize: 'MINUTE' | 'HOUR' | 'DAY' + BillingValidationIssue: { + /** The severity of the issue. */ + severity: components['schemas']['BillingValidationIssueSeverity'] + /** The field that the issue is related to, if available in JSON path format. */ + field?: string + /** Machine indentifiable code for the issue, if available. */ + code?: string + /** Component reporting the issue. */ + component: string + /** A human-readable description of the issue. */ + message: string + /** Metadata */ + metadata?: components['schemas']['Metadata'] + } /** - * @description The result of a meter query. - * @example { - * "from": "2023-01-01T00:00:00Z", - * "to": "2023-01-02T00:00:00Z", - * "windowSize": "MINUTE", - * "data": [ - * { - * "value": 12, - * "windowStart": "2023-01-01T00:00:00Z", - * "windowEnd": "2023-01-02T00:00:00Z", - * "subject": "customer-id", - * "groupBy": { - * "model": "gpt-4-turbo", - * "type": "prompt" - * } - * } - * ] - * } + * @description ValidationIssueSeverity describes the severity of a validation issue. + * + * Issues with severity "critical" will prevent the invoice from being issued. + * @enum {string} */ - MeterQueryResult: { + BillingValidationIssueSeverity: 'critical' | 'warning' + /** @description InvoiceVoidAction describes how to handle the voided line items. */ + BillingVoidInvoiceAction: { + /** How much of the total line items to be voided? (e.g. 100% means all charges are voided) */ + percentage: components['schemas']['Percentage'] + /** How to handle the voided line items, default: pending */ + action: components['schemas']['BillingVoidInvoiceLineAction'] + } + /** @description Request to void an invoice */ + BillingVoidInvoiceInput: { /** - * Format: date-time - * @example 2023-01-01T00:00:00Z + * The action to take on the voided lines. + * @description The action to take on the voided line items. */ - from?: string + action: components['schemas']['BillingVoidInvoiceAction'] /** - * Format: date-time - * @example 2023-01-02T00:00:00Z + * The reason for voiding the invoice + * @description The reason for voiding the invoice. */ - to?: string - windowSize?: components['schemas']['WindowSize'] + reason: string /** - * @example [ - * { - * "value": 12, - * "windowStart": "2023-01-01T00:00:00Z", - * "windowEnd": "2023-01-02T00:00:00Z", - * "subject": "customer-id", - * "groupBy": { - * "model": "gpt-4-turbo", - * "type": "prompt" - * } - * } - * ] + * @description Per line item overrides for the action. + * + * If not specified, the `action` will be applied to all line items. */ - data: components['schemas']['MeterQueryRow'][] + overrides: + | components['schemas']['BillingVoidInvoiceLineOverride'][] + | null } /** - * @description A row in the result of a meter query. - * @example { - * "value": 12, - * "windowStart": "2023-01-01T00:00:00Z", - * "windowEnd": "2023-01-02T00:00:00Z", - * "subject": "customer-id", - * "groupBy": { - * "model": "gpt-4-turbo", - * "type": "prompt" - * } - * } + * VoidInvoiceLineAction describes how to handle the voidied line item in the invoice. + * @enum {string} */ - MeterQueryRow: { - /** @example 12 */ - value: number + BillingVoidInvoiceLineAction: 'discard' | 'pending' | 'pending_next_cycle' + /** @description VoidInvoiceLineOverride describes how to handle a specific line item in the invoice when voiding. */ + BillingVoidInvoiceLineOverride: { /** - * Format: date-time - * @example 2023-01-01T00:00:00Z + * The line item ID to override + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - windowStart: string + lineId: string + /** The action to take on the line item */ + action: components['schemas']['BillingVoidInvoiceAction'] + } + /** @description Workflow represents a billing workflow */ + BillingWorkflow: { /** + * Creation Time * Format: date-time - * @example 2023-01-02T00:00:00Z - */ - windowEnd: string - /** - * @description The subject of the meter value. - * @example customer-id + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ - subject?: string | null + createdAt: string /** - * @example { - * "model": "gpt-4-turbo", - * "type": "prompt" - * } + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" */ - groupBy?: { - [key: string]: string - } | null - } - /** - * @description A consumer portal token. - * @example { - * "id": "01G65Z755AFWAKHE12NY0CQ9FH", - * "subject": "customer-id", - * "expiresAt": "2023-01-02T00:00:00Z", - * "expired": false, - * "createdAt": "2023-01-01T00:00:00Z", - * "token": "om_portal_IAnD3PpWW2A2Wr8m9jfzeHlGX8xmCXwG.y5q4S-AWqFu6qjfaFz0zQq4Ez28RsnyVwJffX5qxMvo", - * "allowedMeterSlugs": [ - * "tokens_total" - * ] - * } - */ - PortalToken: { - /** @example 01G65Z755AFWAKHE12NY0CQ9FH */ - id?: string - /** @example customer-id */ - subject: string + updatedAt: string /** + * Deletion Time * Format: date-time - * @example 2023-01-02T00:00:00Z + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ - expiresAt?: string - expired?: boolean + deletedAt?: string + /** The collection settings for this workflow */ + collection?: components['schemas']['BillingWorkflowCollectionSettings'] + /** The invoicing settings for this workflow */ + invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] + /** The payment settings for this workflow */ + payment?: components['schemas']['BillingWorkflowPaymentSettings'] /** - * Format: date-time - * @example 2023-01-01T00:00:00Z + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - createdAt?: string + id: string + } + /** + * @description AppIdOrType can be used to reference an app during creation only. + * + * This can be either an AppType or the ULID of an app. + */ + BillingWorkflowAppIdOrType: string + /** + * App reference type specifies the type of reference inside an app reference + * @enum {string} + */ + BillingWorkflowAppReferenceType: 'app_id' | 'app_type' + /** + * Collection alignment + * @description CollectionAlignment specifies when the pending line items should be collected into + * an invoice. + * @enum {string} + */ + BillingWorkflowCollectionAlignment: 'subscription' + /** + * Collection method + * @description CollectionMethod specifies how the invoice should be collected (automatic vs manual) + * @enum {string} + */ + BillingWorkflowCollectionMethod: 'charge_automatically' | 'send_invoice' + /** Workflow collection specifies how to collect the pending line items for an invoice */ + BillingWorkflowCollectionSettings: { /** - * @description The token is only returned at creation. - * @example om_portal_IAnD3PpWW2A2Wr8m9jfzeHlGX8xmCXwG.y5q4S-AWqFu6qjfaFz0zQq4Ez28RsnyVwJffX5qxMvo + * @description When to collect the pending line items into an invoice. + * @default subscription */ - token?: string + alignment?: components['schemas']['BillingWorkflowCollectionAlignment'] /** - * @description Optional, if defined only the specified meters will be allowed - * @example [ - * "tokens_total" - * ] + * Format: ISO8601 + * @description The interval for collecting the pending line items into an invoice. + * @default PT1H + * @example P1D */ - allowedMeterSlugs?: string[] + interval?: string } /** - * @description A subject is a unique identifier for a user or entity. - * @example { - * "id": "01G65Z755AFWAKHE12NY0CQ9FH", - * "key": "customer-id", - * "displayName": "Customer Name", - * "metadata": { - * "hubspotId": "123456" - * }, - * "currentPeriodStart": "2023-01-01T00:00:00Z", - * "currentPeriodEnd": "2023-02-01T00:00:00Z", - * "stripeCustomerId": "cus_JMOlctsKV8" - * } + * Workflow invoice settings + * @description WorkflowInvoice represents the invoice settings for a billing workflow */ - Subject: { - /** @example 01G65Z755AFWAKHE12NY0CQ9FH */ - id: string - /** @example customer-id */ - key: string - /** @example Customer Name */ - displayName?: string | null + BillingWorkflowInvoicingSettings: { /** - * @example { - * "hubspotId": "123456" - * } + * @description Whether to automatically issue the invoice after the draftPeriod has passed. + * @default true */ - metadata?: { - [key: string]: unknown - } | null + autoAdvance?: boolean /** - * Format: date-time - * @example 2023-01-01T00:00:00Z + * Format: ISO8601 + * @description The period for the invoice to be kept in draft status for manual reviews. + * @default P1D + * @example P1D */ - currentPeriodStart?: string | null + draftPeriod?: string /** - * Format: date-time - * @example 2023-02-01T00:00:00Z + * Format: ISO8601 + * @description The period after which the invoice is due. + * @default P7D + * @example P1D */ - currentPeriodEnd?: string | null - /** @example cus_JMOlctsKV8 */ - stripeCustomerId?: string | null + dueAfter?: string } /** - * @description A unique identifier. - * @example tokens_total + * Item resolution + * @description LineResolution specifies how the line items should be resolved in the invoice + * @enum {string} */ - IdOrSlug: string - NotificationChannelCreateRequest: components['schemas']['NotificationChannelWebhookCreateRequest'] - NotificationChannel: components['schemas']['NotificationChannelWebhook'] - /** @description List of channels. */ - NotificationChannels: components['schemas']['NotificationChannel'][] - NotificationChannelsResponse: components['schemas']['PaginationInfo'] & { - items: components['schemas']['NotificationChannels'] + BillingWorkflowLineResolution: 'day' | 'period' + /** + * Workflow payment settings + * @description WorkflowPaymentSettings represents the payment settings for a billing workflow + */ + BillingWorkflowPaymentSettings: { + /** @default charge_automatically */ + collectionMethod?: components['schemas']['BillingWorkflowCollectionMethod'] + } + BillingWorkflowSettings: { + /** The collection settings for this workflow */ + collection?: components['schemas']['BillingWorkflowCollectionSettings'] + /** The invoicing settings for this workflow */ + invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'] + /** The payment settings for this workflow */ + payment?: components['schemas']['BillingWorkflowPaymentSettings'] } - NotificationChannelWebhookCreateRequest: components['schemas']['NotificationChannelCommonCreateRequest'] & { + /** @description Stripe CheckoutSession.custom_text */ + CheckoutSessionCustomTextAfterSubmitParams: { + afterSubmit?: { + message?: string + } + shippingAddress?: { + message?: string + } + submit?: { + message?: string + } + termsOfServiceAcceptance?: { + message?: string + } + } + /** + * @description Stripe CheckoutSession.ui_mode + * @enum {string} + */ + CheckoutSessionUIMode: 'embedded' | 'hosted' + /** @description Response from the client app (OpenMeter backend) to start the OAuth2 flow. */ + ClientAppStartResponse: { + /** @description The URL to start the OAuth2 authorization code grant flow. */ + url: string + } + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + ConflictProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** + * @description [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 country code. + * Custom two-letter country codes are also supported for convenience. + * @example US + */ + CountryCode: string + /** @description Create Stripe checkout session request. */ + CreateStripeCheckoutSessionRequest: { /** - * @description Webhook URL where the notification is sent. - * @example https://example.com/webhook + * @description If not provided, the default Stripe app is used if any. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - url: string + appId?: string /** - * @description Custom HTTP headers sent as part of the webhook request. - * @example { - * "X-CUSTOM-HEADER": "value" - * } + * @description Provide a customer ID to use an existing OpenMeter customer. + * or provide a customer object to create a new customer. */ - customHeaders?: { - [key: string]: unknown - } | null + customer: + | components['schemas']['CustomerId'] + | components['schemas']['Customer'] /** - * @description Signing secret used for webhook request validation on the receiving end. Automatically generated if not provided. - * - * Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24 - * - * @example whsec_S6g2HLnTwd9AhHwUIMFggVS9OfoPafN8 + * @description Stripe customer ID. + * If not provided OpenMeter creates a new Stripe customer or + * uses the OpenMeter customer's default Stripe customer ID. */ - signingSecret?: string | null + stripeCustomerId?: string + /** @description Options passed to Stripe when creating the checkout session. */ + options: components['schemas']['CreateStripeCheckoutSessionRequestOptions'] } - /** @description Notification channel with webhook type. */ - NotificationChannelWebhook: components['schemas']['NotificationChannelCommon'] & { + /** @description Create Stripe checkout session options */ + CreateStripeCheckoutSessionRequestOptions: { + currency?: components['schemas']['CurrencyCode'] + cancelURL?: string + clientReferenceID?: string + customText?: components['schemas']['CheckoutSessionCustomTextAfterSubmitParams'] + metadata?: { + [key: string]: string + } + returnURL?: string + successURL?: string + uiMode?: components['schemas']['CheckoutSessionUIMode'] + paymentMethodTypes?: string[] + } + /** @description Create Stripe Checkout Session response. */ + CreateStripeCheckoutSessionResult: { /** - * @description Webhook URL where the notification is sent. - * @example https://example.com/webhook + * @description The OpenMeter customer ID. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ + customerId: string + /** @description The Stripe customer ID. */ + stripeCustomerId: string + /** @description The checkout session ID. */ + sessionId: string + /** @description The checkout session setup intent ID. */ + setupIntentId: string + /** @description URL to show the checkout session. */ url: string /** - * @description Custom HTTP headers sent as part of the webhook request. - * @example { - * "X-CUSTOM-HEADER": "value" - * } + * @description Mode + * Always `setup` for now. */ - customHeaders?: { - [key: string]: unknown - } | null + mode: components['schemas']['StripeCheckoutSessionMode'] + /** @description Cancel URL. */ + cancelURL?: string + /** @description Success URL. */ + successURL?: string + /** @description Return URL. */ + returnURL?: string + } + /** @description Create subscription request body. */ + CreateSubscriptionRequestBody: { /** - * @description Signing secret used for webhook request validation on the receiving end. + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + customerId: string + plan: { + /** @description A key is a unique string that is used to identify a resource. */ + key: string + version: number + } + currency: components['schemas']['CurrencyCode'] + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + activeFrom: string + /** + * @description Batch processing commands for customizing the susbcription. + * The key format is `/phases/{phaseKey}/items/{itemKey}`. * - * Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24 + * Add operations insert a new member based on the creation input without altering the existing members. * - * @example whsec_S6g2HLnTwd9AhHwUIMFggVS9OfoPafN8 + * Remove operations remove the member from the document. */ - signingSecret: string + customizations: ( + | components['schemas']['SubscriptionEditAddItem'] + | components['schemas']['SubscriptionEditRemoveItem'] + )[] } /** - * @description The type of the notification channel. - * @example WEBHOOK - * @enum {string} + * @description Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. + * Custom three-letter currency codes are also supported for convenience. + * @example USD */ - NotificationChannelType: 'WEBHOOK' - /** @description Common fields for create notification channel request. */ - NotificationChannelCommonCreateRequest: { + CurrencyCode: string + /** + * @description A customer object. + * @example { + * "id": "01G65Z755AFWAKHE12NY0CQ9FH", + * "name": "ACME Inc.", + * "usageAttribution": { + * "subjectKeys": [ + * "my_subject_key" + * ] + * }, + * "external": { + * "stripeCustomerId": "cus_xxxxxxxxxxxxxx" + * }, + * "createdAt": "2024-01-01T01:01:01.001Z", + * "updatedAt": "2024-01-01T01:01:01.001Z" + * } + */ + Customer: { /** - * @description User friendly name of the channel. - * @example customer-webhook + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - name: string + id: string /** - * @description Whether the channel is disabled or not. - * @default false - * @example false + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. */ - disabled?: boolean - type: components['schemas']['NotificationChannelType'] - } - /** @description Limited representation of notification channel which includes only the channel identifier and its type. */ - NotificationChannelMeta: { + name: string /** - * @description A unique identifier for the notification channel. - * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 + * Description + * @description Optional description of the resource. Maximum 1024 characters. */ - id: string - type: components['schemas']['NotificationChannelType'] - } - /** @description Common fields for notification channel resources. */ - NotificationChannelCommon: components['schemas']['NotificationChannelMeta'] & { + description?: string /** - * @description User friendly name of the channel. - * @example customer-webhook + * Metadata + * @description Additional metadata for the resource. */ - name: string + metadata?: components['schemas']['Metadata'] /** + * Creation Time * Format: date-time - * @description Timestamp when the channel was created. - * @example 2023-01-01T00:00:00Z + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ createdAt: string /** + * Last Update Time * Format: date-time - * @description Timestamp when the channel was modified. - * @example 2023-01-02T00:00:00Z + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" */ updatedAt: string /** + * Deletion Time * Format: date-time - * @description Timestamp when the channel was deleted. - * @example 2023-01-02T00:00:00Z + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ deletedAt?: string /** - * @description Whether the channel is disabled or not. - * @default false - * @example false - */ - disabled: boolean - } - NotificationRuleCreateRequest: components['schemas']['NotificationRuleBalanceThresholdCreateRequest'] - NotificationRule: components['schemas']['NotificationRuleBalanceThreshold'] - /** @description List of rules. */ - NotificationRules: components['schemas']['NotificationRule'][] - NotificationRulesResponse: components['schemas']['PaginationInfo'] & { - items: components['schemas']['NotificationRules'] - } - /** - * @description Request for creating new notification rule for triggering notification events base on conditions - * applied to current balance of entitlements. - */ - NotificationRuleBalanceThresholdCreateRequest: components['schemas']['NotificationRuleCommonCreateRequest'] & { - /** - * @description List of thresholds the rule suppose to be triggered. - * @example [ - * { - * "value": 100, - * "type": "PERCENT" - * }, - * { - * "value": 10000, - * "type": "NUMBER" - * } - * ] + * Timezone + * @description Timezone of the customer. */ - thresholds: components['schemas']['NotificationRuleBalanceThresholdValue'][] + timezone?: string /** - * @description Optional field for defining the scope of notification by feature. It may contain features by id or key. - * - * @example [ - * "gpt4_tokens", - * "01ARZ3NDEKTSV4RRFFQ69G5FAV" - * ] + * Usage Attribution + * @description Mapping to attribute metered usage to the customer */ - features?: string[] | null - } - /** @description Threshold value with multiple supported types. */ - NotificationRuleBalanceThresholdValue: { - /** Format: double */ - value: number - /** @enum {string} */ - type: 'NUMBER' | 'PERCENT' - } - /** @description Notification rule for triggering notification events by applying conditions to current balance of entitlements. */ - NotificationRuleBalanceThreshold: components['schemas']['NotificationRuleCommon'] & { + usageAttribution: components['schemas']['CustomerUsageAttribution'] /** - * @description List of thresholds the rule suppose to be triggered. - * @example [ - * { - * "value": 100, - * "type": "PERCENT" - * }, - * { - * "value": 10000, - * "type": "NUMBER" - * } - * ] + * Primary Email + * @description The primary email address of the customer. */ - thresholds: components['schemas']['NotificationRuleBalanceThresholdValue'][] - /** @description Optional field containing list of features the rule applies to. */ - features?: components['schemas']['FeatureMeta'][] | null - } - /** - * @description The type of the notification event. - * @example entitlements.balance.threshold - * @enum {string} - */ - NotificationEventType: 'entitlements.balance.threshold' - /** @description Defines the common fields for create notification rule request. */ - NotificationRuleCommonCreateRequest: { - type: components['schemas']['NotificationEventType'] + primaryEmail?: string /** - * @description The user friendly name of the notification rule. - * @example Balance threshold reached + * Currency + * @description Currency of the customer. + * Used for billing, tax and invoicing. */ - name: string + currency?: components['schemas']['CurrencyCode'] /** - * @description List of notification channel identifiers or names the rule applies to. - * @example [ - * "01G65Z755AFWAKHE12NY0CQ9FH" - * ] + * Billing Address + * @description The billing address of the customer. + * Used for tax and invoicing. */ - channels: string[] + billingAddress?: components['schemas']['Address'] /** - * @description Whether the rule is disabled or not. - * @default false - * @example false + * External Mappings + * @description External mappings for the customer. */ - disabled?: boolean + external?: components['schemas']['CustomerExternalMapping'] } - /** @description Defines the common fields of a notification rule. */ - NotificationRuleMeta: { + /** @description External mappings for the customer. */ + CustomerExternalMapping: { /** - * @description A unique identifier for the notification rule. - * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 + * Stripe Customer + * @description The Stripe customer ID. + * Mapping to a Stripe Customer object. + * Required to use Stripe as an invocing provider. */ - id: string - type: components['schemas']['NotificationEventType'] + stripeCustomerId?: string } - /** @description Common fields for notification rules. */ - NotificationRuleCommon: components['schemas']['NotificationRuleMeta'] & { + /** @description Create Stripe checkout session customer ID. */ + CustomerId: { /** - * @description The user friendly name of the notification rule. - * @example Balance threshold reached + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH */ - name: string - /** @description List of notification channels the rule applies to. */ - channels: components['schemas']['NotificationChannelMeta'][] + id: string + } + /** @description A page of results. */ + CustomerList: { + /** @description The page number. */ + page: number + /** @description The number of items in the page. */ + pageSize: number + /** @description The total number of items. */ + totalCount: number + /** @description The items in the page. */ + items: components['schemas']['Customer'][] + } + /** + * @description Order by options for customers. + * @enum {string} + */ + CustomerOrderBy: 'id' | 'name' | 'createdAt' + /** @description Paginated response */ + CustomerOverridePaginatedResponse: { /** - * Format: date-time - * @description Timestamp when the rule was created. - * @example 2023-01-01T00:00:00Z + * @description The items in the current page. + * @example 500 */ - createdAt: string + totalCount: number /** - * Format: date-time - * @description Timestamp when the rule was modified. - * @example 2023-01-02T00:00:00Z + * @description The items in the current page. + * @example 1 */ - updatedAt: string + page: number /** - * Format: date-time - * @description Timestamp when the channel was deleted. - * @example 2023-01-02T00:00:00Z + * @description The items in the current page. + * @example 100 */ - deletedAt?: string + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['BillingCustomerOverride'][] + } + /** + * @description Mapping to attribute metered usage to the customer. + * One customer can have multiple subjects, + * but one subject can only belong to one customer. + */ + CustomerUsageAttribution: { /** - * @description Whether the rule is disabled or not. - * @default false - * @example false + * SubjectKeys + * @description The subjects that are attributed to the customer. */ - disabled: boolean - } - /** @description Request for creating new notification event with specific type and payload. */ - NotificationEventCreateRequest: { - type: components['schemas']['NotificationEventType'] - payload: components['schemas']['NotificationEventPayload'] - /** @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 */ - ruleId: string + subjectKeys: string[] } /** - * @description Notification event generated by the system based on the criteria defined in the corresponding - * a notification rule. - * - * The `payload` field contains the actual message sent to the notification channel. + * @description A discount on a price. + * One of: percentage, amount, or usage. */ - NotificationEvent: { + Discount: components['schemas']['DiscountPercentage'] + /** @description Percentage discount. */ + DiscountPercentage: { /** - * @description A unique identifier for the notification event. - * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 + * Type + * @description The type of the discount. + * @enum {string} */ - id: string - type: components['schemas']['NotificationEventType'] + type: 'percentage' + /** + * Percentage + * @description The percentage of the discount. + */ + percentage: number + } + /** + * @description The type of the discount. + * @enum {string} + */ + DiscountType: 'percentage' + /** + * @description Entitlement templates are used to define the entitlements of a plan. + * Features are omitted from the entitlement template, as they are defined in the rate card. + */ + Entitlement: + | components['schemas']['EntitlementMetered'] + | components['schemas']['EntitlementStatic'] + | components['schemas']['EntitlementBoolean'] + /** @description Shared fields of the entitlement templates. */ + EntitlementBaseTemplate: { /** + * Creation Time * Format: date-time - * @description Timestamp when the notification event was created. - * @example 2023-01-01T00:00:00Z + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ createdAt: string - rule: components['schemas']['NotificationRule'] - /** @description The delivery status of the notification event. */ - deliveryStatus: components['schemas']['NotificationEventDeliveryStatus'][] - payload: components['schemas']['NotificationEventPayload'] /** - * @description List of annotations managed by the system. - * - * @example { - * "test-event": "true" - * } + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" */ - annotations?: { - [key: string]: unknown - } - } - /** @description The actual payload sent to channel as part of the notification event. */ - NotificationEventPayload: components['schemas']['NotificationEventBalanceThresholdPayload'] - /** @description Common fields for notification event payload. */ - NotificationEventCommonPayload: { + updatedAt: string /** - * @description A unique identifier for the notification event the payload belongs to. - * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ - id: string - type: components['schemas']['NotificationEventType'] + deletedAt?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] /** - * Format: date-time - * @description Timestamp when the notification event was created. - * @example 2023-01-01T00:00:00Z + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - timestamp: string - } - /** - * @description Defines payload for notification event which is triggered when the `balance` of the `entitlement` - * surpass the user defined `threshold`. - */ - NotificationEventBalanceThresholdPayload: components['schemas']['NotificationEventCommonPayload'] & { - data: { - entitlement: components['schemas']['EntitlementMetered'] - feature: components['schemas']['Feature'] - subject: components['schemas']['Subject'] - value: components['schemas']['EntitlementValue'] - threshold: components['schemas']['NotificationRuleBalanceThresholdValue'] - } - } - NotificationEventDeliveryStatus: { - channel: components['schemas']['NotificationChannelMeta'] - /** @enum {string} */ - state: 'SUCCESS' | 'FAILED' | 'SENDING' | 'PENDING' - /** @example Failed to dispatch event */ - reason?: string + id: string /** - * Format: date-time - * @example 2023-01-01T00:00:00Z + * Type + * @description The type of the entitlement. */ - updatedAt: string - } - /** @description List of notification events. */ - NotificationEvents: components['schemas']['NotificationEvent'][] - NotificationEventsResponse: components['schemas']['PaginationInfo'] & { - items: components['schemas']['NotificationEvents'] - } - SvixOperationalWebhookRequest: { - /** @enum {string} */ - type: - | 'endpoint.created' - | 'endpoint.deleted' - | 'endpoint.disabled' - | 'endpoint.updated' - | 'message.attempt.exhausted' - | 'message.attempt.failing' - | 'message.attempt.recovered' - data: { - [key: string]: unknown - } - } - /** @description Pagination information. */ - PaginationInfo: { + type: components['schemas']['EntitlementType'] /** - * @description Total number of items. - * @example 500 + * @description The identifier key unique to the subject + * @example customer-1 */ - totalCount: number + subjectKey: string /** - * @description Current page number. - * @example 1 + * @description The feature the subject is entitled to use. + * @example example-feature-key */ - page: number + featureKey: string /** - * @description Number of items per page. - * @example 100 + * @description The feature the subject is entitled to use. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - pageSize: number - } - /** - * @description A payment provider. - * @enum {string} - */ - PaymentProvider: 'openmeter_sandbox' | 'stripe_payments' - /** @description Represents common fields of resources. */ - Resource: { + featureId: string + /** @description The current usage period. */ + currentUsagePeriod?: components['schemas']['Period'] + /** @description The defined usage period of the entitlement */ + usagePeriod?: components['schemas']['RecurringPeriod'] + } + /** @description Entitlement template of a boolean entitlement. */ + EntitlementBoolean: WithRequired< + { + /** @enum {string} */ + type: 'boolean' + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + /** + * @description The identifier key unique to the subject + * @example customer-1 + */ + subjectKey: string + /** + * @description The feature the subject is entitled to use. + * @example example-feature-key + */ + featureKey: string + /** + * @description The feature the subject is entitled to use. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + featureId: string + /** @description The current usage period. */ + currentUsagePeriod?: components['schemas']['Period'] + /** @description The defined usage period of the entitlement */ + usagePeriod?: components['schemas']['RecurringPeriod'] + } & components['schemas']['EntitlementBaseTemplate'], + | 'type' + | 'createdAt' + | 'updatedAt' + | 'id' + | 'subjectKey' + | 'featureKey' + | 'featureId' + > + /** @description Create inputs for boolean entitlement */ + EntitlementBooleanCreateInputs: { /** - * Key - * @description A semi-unique identifier for the resource. + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example example-feature-key */ - key: components['schemas']['Key'] + featureKey?: string /** - * Display name - * @description Human-readable name for the resource. Between 1 and 256 characters. + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ - name: string + featureId?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** @description The usage period associated with the entitlement. */ + usagePeriod?: components['schemas']['RecurringPeriodCreateInput'] + /** @enum {string} */ + type: 'boolean' + } + /** @description Create inputs for entitlement */ + EntitlementCreateInputs: + | components['schemas']['EntitlementMeteredCreateInputs'] + | components['schemas']['EntitlementStaticCreateInputs'] + | components['schemas']['EntitlementBooleanCreateInputs'] + /** @description Shared fields for entitlement creation */ + EntitlementCreateSharedFields: { /** - * Description - * @description Optional description of the resource. Maximum 1024 characters. + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example example-feature-key */ - description?: string + featureKey?: string /** - * Metadata - * @description Additional metadata for the resource. + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV */ + featureId?: string + /** @description Additional metadata for the feature. */ metadata?: components['schemas']['Metadata'] + /** @description The usage period associated with the entitlement. */ + usagePeriod?: components['schemas']['RecurringPeriodCreateInput'] + } + /** @description The grant. */ + EntitlementGrant: { /** * Creation Time + * Format: date-time * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" */ - createdAt?: components['schemas']['DateTime'] + createdAt: string /** * Last Update Time + * Format: date-time * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" */ - updatedAt?: components['schemas']['DateTime'] + updatedAt: string /** * Deletion Time + * Format: date-time * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" */ - deletedAt?: components['schemas']['DateTime'] + deletedAt?: string /** - * Archival Time - * @description Timestamp of when the resource was archived. + * Format: double + * @description The amount to grant. Should be a positive number. + * @example 100 */ - archivedAt?: components['schemas']['DateTime'] - } - /** - * @description A tax provider. - * @enum {string} - */ - TaxProvider: 'openmeter_sandbox' | 'stripe_tax' - /** @description A key is a unique string that is used to identify a resource. */ - Key: string - /** - * @description ULID (Universally Unique Lexicographically Sortable Identifier). - * @example 01G65Z755AFWAKHE12NY0CQ9FH - */ - ULID: string - } - responses: { - /** @description Conflict */ - ConflictProblemResponse: { - content: { - 'application/problem+json': components['schemas']['ConflictProblem'] - } - } - /** @description Bad Request */ - BadRequestProblemResponse: { - content: { - 'application/problem+json': components['schemas']['Problem'] - } - } - /** @description Unauthorized */ - UnauthorizedProblemResponse: { - content: { - 'application/problem+json': components['schemas']['Problem'] - } - } - /** @description Not Found */ - NotFoundProblemResponse: { - content: { - 'application/problem+json': components['schemas']['Problem'] - } - } - /** @description Not Implemented */ - NotImplementedProblemResponse: { - content: { - 'application/problem+json': components['schemas']['Problem'] - } - } - /** @description Unexpected error */ - UnexpectedProblemResponse: { - content: { - 'application/problem+json': components['schemas']['Problem'] - } - } + amount: number + /** + * Format: uint8 + * @description The priority of the grant. Grants with higher priority are applied first. + * Priority is a positive decimal numbers. With lower numbers indicating higher importance. + * For example, a priority of 1 is more urgent than a priority of 2. + * When there are several grants available for the same subject, the system selects the grant with the highest priority. + * In cases where grants share the same priority level, the grant closest to its expiration will be used first. + * In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first. + * @example 1 + */ + priority?: number + /** + * Format: date-time + * @description Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute). + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveAt: string + /** @description The grant expiration definition */ + expiration: components['schemas']['ExpirationPeriod'] + /** + * Format: double + * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. + * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * @default 0 + * @example 100 + */ + maxRolloverAmount?: number + /** + * Format: double + * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. + * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * @default 0 + * @example 100 + */ + minRolloverAmount?: number + /** + * @description The grant metadata. + * @example { + * "stripePaymentId": "pi_4OrAkhLvyihio9p51h9iiFnB" + * } + */ + metadata?: components['schemas']['Metadata'] + /** + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + /** + * @description The unique entitlement ULID that the grant is associated with. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + entitlementId: string + /** + * Format: date-time + * @description The next time the grant will recurr. + * @example "2023-01-01T01:01:01.001Z" + */ + nextRecurrence?: string + /** + * Format: date-time + * @description The time the grant expires. + * @example "2023-01-01T01:01:01.001Z" + */ + expiresAt?: string + /** + * Format: date-time + * @description The time the grant was voided. + * @example "2023-01-01T01:01:01.001Z" + */ + voidedAt?: string + /** @description The recurrence period of the grant. */ + recurrence?: components['schemas']['RecurringPeriod'] + } + /** @description The grant creation input. */ + EntitlementGrantCreateInput: { + /** + * Format: double + * @description The amount to grant. Should be a positive number. + * @example 100 + */ + amount: number + /** + * Format: uint8 + * @description The priority of the grant. Grants with higher priority are applied first. + * Priority is a positive decimal numbers. With lower numbers indicating higher importance. + * For example, a priority of 1 is more urgent than a priority of 2. + * When there are several grants available for the same subject, the system selects the grant with the highest priority. + * In cases where grants share the same priority level, the grant closest to its expiration will be used first. + * In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first. + * @example 1 + */ + priority?: number + /** + * Format: date-time + * @description Effective date for grants and anchor for recurring grants. Provided value will be ceiled to metering windowSize (minute). + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveAt: string + /** @description The grant expiration definition */ + expiration: components['schemas']['ExpirationPeriod'] + /** + * Format: double + * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. + * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * @default 0 + * @example 100 + */ + maxRolloverAmount?: number + /** + * Format: double + * @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset. + * Balance after the reset is calculated as: Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * @default 0 + * @example 100 + */ + minRolloverAmount?: number + /** + * @description The grant metadata. + * @example { + * "stripePaymentId": "pi_4OrAkhLvyihio9p51h9iiFnB" + * } + */ + metadata?: components['schemas']['Metadata'] + /** @description The subject of the grant. */ + recurrence?: components['schemas']['RecurringPeriodCreateInput'] + } + /** + * @description Metered entitlements are useful for many different use cases, from setting up usage based access to implementing complex credit systems. + * Access is determined based on feature usage using a balance calculation (the "usage allowance" provided by the issued grants is "burnt down" by the usage). + */ + EntitlementMetered: { + /** @enum {string} */ + type: 'metered' + /** + * Soft limit + * @description If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true. + * @default false + */ + isSoftLimit?: boolean + /** + * @deprecated + * @description Deprecated, ignored by the backend. Please use isSoftLimit instead; this field will be removed in the future. + * @default false + */ + isUnlimited?: boolean + /** + * Initial grant amount + * Format: double + * @description You can grant usage automatically alongside the entitlement, the example scenario would be creating a starting balance. + * If an amount is specified here, a grant will be created alongside the entitlement with the specified amount. + * That grant will have it's rollover settings configured in a way that after each reset operation, the balance will return the original amount specified here. + * Manually creating such a grant would mean having the "amount", "minRolloverAmount", and "maxRolloverAmount" fields all be the same. + */ + issueAfterReset?: number + /** + * Issue grant after reset priority + * Format: uint8 + * @description Defines the grant priority for the default grant. + * @default 1 + */ + issueAfterResetPriority?: number + /** + * Preserve overage at reset + * @description If true, the overage is preserved at reset. If false, the usage is reset to 0. + * @default false + */ + preserveOverageAtReset?: boolean + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + /** + * @description The identifier key unique to the subject + * @example customer-1 + */ + subjectKey: string + /** + * @description The feature the subject is entitled to use. + * @example example-feature-key + */ + featureKey: string + /** + * @description The feature the subject is entitled to use. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + featureId: string + /** + * Format: date-time + * @description The time the last reset happened. + * @example "2023-01-01T01:01:01.001Z" + */ + lastReset: string + /** @description The current usage period. */ + currentUsagePeriod: components['schemas']['Period'] + /** + * Format: date-time + * @description The time from which usage is measured. If not specified on creation, defaults to entitlement creation time. + * @example "2023-01-01T01:01:01.001Z" + */ + measureUsageFrom: string + /** @description THe usage period of the entitlement. */ + usagePeriod: components['schemas']['RecurringPeriod'] + } + /** @description Calculated fields for metered entitlements. */ + EntitlementMeteredCalculatedFields: { + /** + * Format: date-time + * @description The time the last reset happened. + * @example "2023-01-01T01:01:01.001Z" + */ + lastReset: string + /** @description The current usage period. */ + currentUsagePeriod: components['schemas']['Period'] + /** + * Format: date-time + * @description The time from which usage is measured. If not specified on creation, defaults to entitlement creation time. + * @example "2023-01-01T01:01:01.001Z" + */ + measureUsageFrom: string + /** @description THe usage period of the entitlement. */ + usagePeriod: components['schemas']['RecurringPeriod'] + } + /** @description Create inpurs for metered entitlement */ + EntitlementMeteredCreateInputs: { + /** + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example example-feature-key + */ + featureKey?: string + /** + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + featureId?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** @enum {string} */ + type: 'metered' + /** + * Soft limit + * @description If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true. + * @default false + */ + isSoftLimit?: boolean + /** + * @deprecated + * @description Deprecated, ignored by the backend. Please use isSoftLimit instead; this field will be removed in the future. + * @default false + */ + isUnlimited?: boolean + /** @description The usage period associated with the entitlement. */ + usagePeriod: components['schemas']['RecurringPeriodCreateInput'] + /** @description Defines the time from which usage is measured. If not specified on creation, defaults to entitlement creation time. */ + measureUsageFrom?: components['schemas']['MeasureUsageFrom'] + /** + * Initial grant amount + * Format: double + * @description You can grant usage automatically alongside the entitlement, the example scenario would be creating a starting balance. + * If an amount is specified here, a grant will be created alongside the entitlement with the specified amount. + * That grant will have it's rollover settings configured in a way that after each reset operation, the balance will return the original amount specified here. + * Manually creating such a grant would mean having the "amount", "minRolloverAmount", and "maxRolloverAmount" fields all be the same. + */ + issueAfterReset?: number + /** + * Issue grant after reset priority + * Format: uint8 + * @description Defines the grant priority for the default grant. + * @default 1 + */ + issueAfterResetPriority?: number + /** + * Preserve overage at reset + * @description If true, the overage is preserved at reset. If false, the usage is reset to 0. + * @default false + */ + preserveOverageAtReset?: boolean + } + /** + * @description Order by options for entitlements. + * @enum {string} + */ + EntitlementOrderBy: 'createdAt' | 'updatedAt' + /** @description Paginated response */ + EntitlementPaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['Entitlement'][] + } + /** @description A static entitlement. */ + EntitlementStatic: { + /** @enum {string} */ + type: 'static' + /** + * Format: json + * @description The JSON parsable config of the entitlement. This value is also returned when checking entitlement access and it is useful for configuring fine-grained access settings to the feature, implemented in your own system. Has to be an object. + * @example { "integrations": ["github"] } + */ + config: string + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + /** + * @description The identifier key unique to the subject + * @example customer-1 + */ + subjectKey: string + /** + * @description The feature the subject is entitled to use. + * @example example-feature-key + */ + featureKey: string + /** + * @description The feature the subject is entitled to use. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + featureId: string + /** @description The current usage period. */ + currentUsagePeriod?: components['schemas']['Period'] + /** @description The defined usage period of the entitlement */ + usagePeriod?: components['schemas']['RecurringPeriod'] + } + /** @description Create inputs for static entitlement */ + EntitlementStaticCreateInputs: { + /** + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example example-feature-key + */ + featureKey?: string + /** + * @description The feature the subject is entitled to use. + * Either featureKey or featureId is required. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + featureId?: string + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** @description The usage period associated with the entitlement. */ + usagePeriod?: components['schemas']['RecurringPeriodCreateInput'] + /** @enum {string} */ + type: 'static' + /** + * Format: json + * @description The JSON parsable config of the entitlement. This value is also returned when checking entitlement access and it is useful for configuring fine-grained access settings to the feature, implemented in your own system. Has to be an object. + * @example { "integrations": ["github"] } + */ + config: string + } + /** + * @description Type of the entitlement. + * @enum {string} + */ + EntitlementType: 'metered' | 'boolean' | 'static' + /** @description Entitlements are the core of OpenMeter access management. They define access to features for subjects. Entitlements can be metered, boolean, or static. */ + EntitlementValue: { + /** + * @description Whether the subject has access to the feature. Shared accross all entitlement types. + * @example true + */ + hasAccess: boolean + /** + * Format: double + * @description Only available for metered entitlements. Metered entitlements are built around a balance calculation where feature usage is deducted from the issued grants. Balance represents the remaining balance of the entitlement, it's value never turns negative. + * @example 100 + */ + balance?: number + /** + * Format: double + * @description Only available for metered entitlements. Returns the total feature usage in the current period. + * @example 50 + */ + usage?: number + /** + * Format: double + * @description Only available for metered entitlements. Overage represents the usage that wasn't covered by grants, e.g. if the subject had a total feature usage of 100 in the period but they were only granted 80, there would be 20 overage. + * @example 0 + */ + overage?: number + /** + * @description Only available for static entitlements. The JSON parsable config of the entitlement. + * @example { key: "value" } + */ + config?: string + } + /** + * @description CloudEvents Specification JSON Schema + * @example { + * "id": "5c10fade-1c9e-4d6c-8275-c52c36731d3c", + * "source": "service-name", + * "specversion": "1.0", + * "type": "prompt", + * "subject": "customer-id", + * "time": "2023-01-01T01:01:01.001Z" + * } + */ + Event: { + /** + * @description Identifies the event. + * @example 5c10fade-1c9e-4d6c-8275-c52c36731d3c + */ + id: string + /** + * Format: uri-reference + * @description Identifies the context in which an event happened. + * @example service-name + */ + source: string + /** + * @description The version of the CloudEvents specification which the event uses. + * @default 1.0 + * @example 1.0 + */ + specversion: string + /** + * @description Contains a value describing the type of event related to the originating occurrence. + * @example com.example.someevent + */ + type: string + /** + * @description Content type of the data value. Must adhere to RFC 2046 format. + * @example application/json + */ + datacontenttype?: string | null + /** + * Format: uri + * @description Identifies the schema that data adheres to. + */ + dataschema?: string | null + /** + * @description Describes the subject of the event in the context of the event producer (identified by source). + * @example customer-id + */ + subject: string + /** + * Format: date-time + * @description Timestamp of when the occurrence happened. Must adhere to RFC 3339. + * @example "2023-01-01T01:01:01.001Z" + */ + time?: string | null + /** @description The event payload. */ + data?: Record | string | null + } + /** + * @description The expiration duration enum + * @enum {string} + */ + ExpirationDuration: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' + /** @description The grant expiration definition */ + ExpirationPeriod: { + /** @description The unit of time for the expiration period. */ + duration: components['schemas']['ExpirationDuration'] + /** + * @description The number of time units in the expiration period. + * @example 12 + */ + count: number + } + /** + * @description Represents a feature that can be enabled or disabled for a plan. + * Used both for product catalog and entitlements. + */ + Feature: { + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** + * Archival Time + * Format: date-time + * @description Timestamp of when the resource was archived. + * @example "2023-01-01T01:01:01.001Z" + */ + archivedAt?: string + /** + * The unique key of the feature + * @description A key is a unique string that is used to identify a resource. + */ + key: string + /** The human-readable name of the feature */ + name: string + /** + * Optional metadata + * @example { + * "key": "value" + * } + */ + metadata?: components['schemas']['Metadata'] + /** + * Meter slug + * @description A key is a unique string that is used to identify a resource. + * @example tokens_total + */ + meterSlug?: string + /** + * Meter group by filters + * @description Optional meter group by filters. + * Useful if the meter scope is broader than what feature tracks. + * Example scenario would be a meter tracking all token use with groupBy fields for the model, + * then the feature could filter for model=gpt-4. + * @example { + * "model": "gpt-4", + * "type": "input" + * } + */ + meterGroupByFilters?: { + [key: string]: string + } + /** + * @description Readonly unique ULID identifier. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + } + /** + * @description Represents a feature that can be enabled or disabled for a plan. + * Used both for product catalog and entitlements. + */ + FeatureCreateInputs: { + /** + * The unique key of the feature + * @description A key is a unique string that is used to identify a resource. + */ + key: string + /** The human-readable name of the feature */ + name: string + /** + * Optional metadata + * @example { + * "key": "value" + * } + */ + metadata?: components['schemas']['Metadata'] + /** + * Meter slug + * @description A key is a unique string that is used to identify a resource. + * @example tokens_total + */ + meterSlug?: string + /** + * Meter group by filters + * @description Optional meter group by filters. + * Useful if the meter scope is broader than what feature tracks. + * Example scenario would be a meter tracking all token use with groupBy fields for the model, + * then the feature could filter for model=gpt-4. + * @example { + * "model": "gpt-4", + * "type": "input" + * } + */ + meterGroupByFilters?: { + [key: string]: string + } + } + /** @description Limited representation of a feature resource which includes only its unique identifiers (id, key). */ + FeatureMeta: { + /** + * Feature Unique Identifier + * @description Unique identifier of a feature. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + /** + * Feature Key + * @description The key is an immutable unique identifier of the feature used throughout the API, + * for example when interacting with a subject's entitlements. + * @example gpt4_tokens + */ + key: string + } + /** + * @description Order by options for features. + * @enum {string} + */ + FeatureOrderBy: 'id' | 'createdAt' | 'updatedAt' + /** @description Paginated response */ + FeaturePaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['Feature'][] + } + /** @description Flat price. */ + FlatPrice: { + /** @enum {string} */ + type: 'flat' + /** @description The amount of the flat price. */ + amount: components['schemas']['Numeric'] + } + /** @description Flat price. */ + FlatPriceUpdateItem: { + /** @description The amount of the flat price. */ + amount: components['schemas']['Numeric'] + } + /** @description Flat price with payment term. */ + FlatPriceWithPaymentTerm: { + /** @enum {string} */ + type: 'flat' + /** @description The amount of the flat price. */ + amount: components['schemas']['Numeric'] + /** + * @description The payment term of the flat price. + * Defaults to in advance. + * @default in_advance + */ + paymentTerm?: components['schemas']['PricePaymentTerm'] + } + /** @description Flat price with payment term. */ + FlatPriceWithPaymentTermUpdateItem: { + /** @description The amount of the flat price. */ + amount: components['schemas']['Numeric'] + /** + * @description The payment term of the flat price. + * Defaults to in advance. + * @default in_advance + */ + paymentTerm?: components['schemas']['PricePaymentTerm'] + } + /** @description The server understood the request but refuses to authorize it. */ + ForbiddenProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** @description The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request. */ + GatewayTimeoutProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** + * @description A segment of the grant burn down history. + * + * A given segment represents the usage of a grant between events that changed either the grant burn down priority order or the usag period. + */ + GrantBurnDownHistorySegment: { + /** @description The period of the segment. */ + period: components['schemas']['Period'] + /** + * Format: double + * @description The total usage of the grant in the period. + * @example 100 + */ + usage: number + /** + * Format: double + * @description Overuse that wasn't covered by grants. + * @example 100 + */ + overage: number + /** + * Format: double + * @description entitlement balance at the start of the period. + * @example 100 + */ + balanceAtStart: number + /** + * @description The balance breakdown of each active grant at the start of the period: GrantID: Balance + * @example { + * "01G65Z755AFWAKHE12NY0CQ9FH": 100 + * } + */ + grantBalancesAtStart: { + [key: string]: number + } + /** + * Format: double + * @description The entitlement balance at the end of the period. + * @example 100 + */ + balanceAtEnd: number + /** + * @description The balance breakdown of each active grant at the end of the period: GrantID: Balance + * @example { + * "01G65Z755AFWAKHE12NY0CQ9FH": 100 + * } + */ + grantBalancesAtEnd: { + [key: string]: number + } + /** @description Which grants were actually burnt down in the period and by what amount. */ + grantUsages: readonly components['schemas']['GrantUsageRecord'][] + } + /** + * @description Order by options for grants. + * @enum {string} + */ + GrantOrderBy: 'id' | 'createdAt' | 'updatedAt' + /** @description Paginated response */ + GrantPaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['EntitlementGrant'][] + } + /** @description Usage Record */ + GrantUsageRecord: { + /** + * @description The id of the grant + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + grantId: string + /** + * Format: double + * @description The usage in the period + * @example 100 + */ + usage: number + } + /** + * @description An ingested event with optional validation error. + * @example { + * "event": { + * "id": "5c10fade-1c9e-4d6c-8275-c52c36731d3c", + * "source": "service-name", + * "specversion": "1.0", + * "type": "prompt", + * "subject": "customer-id", + * "time": "2023-01-01T01:01:01.001Z" + * }, + * "ingestedAt": "2023-01-01T01:01:01.001Z", + * "storedAt": "2023-01-01T01:01:02.001Z" + * } + */ + IngestedEvent: { + event: components['schemas']['Event'] + /** @description The validation error if the event failed validation. */ + validationError?: string + /** + * Format: date-time + * @description The date and time the event was ingested. + * @example "2023-01-01T01:01:01.001Z" + */ + ingestedAt: string + /** + * Format: date-time + * @description The date and time the event was stored. + * @example "2023-01-01T01:01:01.001Z" + */ + storedAt: string + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + InternalServerErrorProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** @description Paginated response */ + InvoicePaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['BillingInvoice'][] + } + /** @description Query params for listing installed apps */ + ListAppsRequest: components['schemas']['PaginatedQuery'] + ListEntitlementsResult: + | components['schemas']['Entitlement'][] + | components['schemas']['EntitlementPaginatedResponse'] + ListFeaturesResult: + | components['schemas']['Feature'][] + | components['schemas']['FeaturePaginatedResponse'] + /** + * @description A marketplace listing. + * Represent an available app in the app marketplace that can be installed to the organization. + * + * Marketplace apps only exist in config so they don't extend the Resource model. + * @example { + * "type": "stripe", + * "name": "Stripe", + * "description": "Stripe interation allows you to collect payments with Stripe.", + * "iconUrl": "/images/stripe.png", + * "capabilities": [ + * { + * "type": "calculateTax", + * "key": "stripe_calculate_tax", + * "name": "Calculate Tax", + * "description": "Stripe Tax calculates tax portion of the invoices." + * }, + * { + * "type": "invoiceCustomers", + * "key": "stripe_invoice_customers", + * "name": "Invoice Customers", + * "description": "Stripe invoices customers with due amount." + * }, + * { + * "type": "collectPayments", + * "key": "stripe_collect_payments", + * "name": "Collect Payments", + * "description": "Stripe payments collects outstanding revenue with Stripe customer's default payment method." + * } + * ] + * } + */ + MarketplaceListing: { + /** @description The app's type */ + type: components['schemas']['AppType'] + /** @description The app's name. */ + name: string + /** @description The app's description. */ + description: string + /** @description The app's icon URL. */ + iconUrl: string + /** @description The app's capabilities. */ + capabilities: components['schemas']['AppCapability'][] + } + /** @description A page of results. */ + MarketplaceListingList: { + /** @description The page number. */ + page: number + /** @description The number of items in the page. */ + pageSize: number + /** @description The total number of items. */ + totalCount: number + /** @description The items in the page. */ + items: components['schemas']['MarketplaceListing'][] + } + /** @description Measure usage from */ + MeasureUsageFrom: + | components['schemas']['MeasureUsageFromPreset'] + | components['schemas']['MeasureUsageFromTime'] + /** + * @description Start of measurement options + * @enum {string} + */ + MeasureUsageFromPreset: 'CURRENT_PERIOD_START' | 'NOW' + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + MeasureUsageFromTime: string + /** + * @description Set of key-value pairs. + * Metadata can be used to store additional information about a resource. + * @example { + * "externalId": "019142cc-a016-796a-8113-1a942fecd26d" + * } + */ + Metadata: { + [key: string]: string + } + /** + * @description A meter is a configuration that defines how to match and aggregate events. + * @example { + * "id": "01G65Z755AFWAKHE12NY0CQ9FH", + * "slug": "tokens_total", + * "description": "AI Token Usage", + * "aggregation": "SUM", + * "windowSize": "MINUTE", + * "eventType": "prompt", + * "valueProperty": "$.tokens", + * "groupBy": { + * "model": "$.model", + * "type": "$.type" + * } + * } + */ + Meter: { + /** + * @description A unique identifier for the meter. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + /** + * @description A unique, human-readable identifier for the meter. + * Must consist only alphanumeric and underscore characters. + * @example tokens_total + */ + slug: string + /** + * @description A description of the meter. + * @example AI Token Usage + */ + description?: string + /** @example SUM */ + aggregation: components['schemas']['MeterAggregation'] + /** @example MINUTE */ + windowSize: components['schemas']['WindowSize'] + /** + * @description The event type to aggregate. + * @example prompt + */ + eventType: string + /** + * @description JSONPath expression to extract the value from the ingested event's data property. + * + * The ingested value for SUM, AVG, MIN, and MAX aggregations is a number or a string that can be parsed to a number. + * + * For UNIQUE_COUNT aggregation, the ingested value must be a string. For COUNT aggregation the valueProperty is ignored. + * @example $.tokens + */ + valueProperty?: string + /** + * @description Named JSONPath expressions to extract the group by values from the event data. + * + * Keys must be unique and consist only alphanumeric and underscore characters. + * + * TODO: add key format enforcement + * @example { + * "type": "$.type" + * } + */ + groupBy?: { + [key: string]: string + } + } + /** + * @description The aggregation type to use for the meter. + * @enum {string} + */ + MeterAggregation: 'SUM' | 'COUNT' | 'UNIQUE_COUNT' | 'AVG' | 'MIN' | 'MAX' + /** + * @description The result of a meter query. + * @example { + * "from": "2023-01-01T00:00:00.000Z", + * "to": "2023-01-02T00:00:00.000Z", + * "windowSize": "DAY", + * "data": [ + * { + * "value": 12, + * "windowStart": "2023-01-01T00:00:00.000Z", + * "windowEnd": "2023-01-02T00:00:00.000Z", + * "subject": "customer-1", + * "groupBy": { + * "model": "gpt-4-turbo", + * "type": "prompt" + * } + * } + * ] + * } + */ + MeterQueryResult: { + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + from?: string + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + to?: string + windowSize?: components['schemas']['WindowSize'] + data: components['schemas']['MeterQueryRow'][] + } + /** + * @description A row in the result of a meter query. + * @example { + * "value": 12, + * "windowStart": "2023-01-01T00:00:00.000Z", + * "windowEnd": "2023-01-02T00:00:00.000Z", + * "subject": "customer-1", + * "groupBy": { + * "model": "gpt-4-turbo", + * "type": "prompt" + * } + * } + */ + MeterQueryRow: { + value: number + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + windowStart: string + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + windowEnd: string + subject?: string + groupBy?: { + [key: string]: string + } + } + /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */ + NotFoundProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** @description The server does not support the functionality required to fulfill the request. */ + NotImplementedProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** @description Notification channel. */ + NotificationChannel: components['schemas']['NotificationChannelWebhook'] + /** @description Union type for requests creating new notification channel with certain type. */ + NotificationChannelCreateRequest: components['schemas']['NotificationChannelWebhookCreateRequest'] + /** @description Metadata only fields of a notification channel. */ + NotificationChannelMeta: { + /** + * Channel Unique Identifier + * @description Identifies the notification channel. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + /** + * Channel Type + * @description Notification channel type. + */ + type: components['schemas']['NotificationChannelType'] + } + /** + * @description Order by options for notification channels. + * @enum {string} + */ + NotificationChannelOrderBy: 'id' | 'type' | 'createdAt' | 'updatedAt' + /** @description Paginated response */ + NotificationChannelPaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['NotificationChannel'][] + } + /** + * @description Type of the notification channel. + * @enum {string} + */ + NotificationChannelType: 'WEBHOOK' + /** @description Notification channel with webhook type. */ + NotificationChannelWebhook: { + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** + * Channel Unique Identifier + * @description Identifies the notification channel. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + /** + * Channel Type + * @description Notification channel type. + * @enum {string} + */ + type: 'WEBHOOK' + /** + * Channel Name + * @description User friendly name of the channel. + * @example customer-webhook + */ + name: string + /** + * Channel Disabled + * @description Whether the channel is disabled or not. + * @default false + * @example true + */ + disabled?: boolean + /** + * Webhook URL + * @description Webhook URL where the notification is sent. + * @example https://example.com/webhook + */ + url: string + /** + * Custom HTTP Headers + * @description Custom HTTP headers sent as part of the webhook request. + */ + customHeaders?: { + [key: string]: string + } + /** + * Signing Secret + * @description Signing secret used for webhook request validation on the receiving end. + * + * Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24 + * @example whsec_S6g2HLnTwd9AhHwUIMFggVS9OfoPafN8 + */ + signingSecret?: string + } + /** @description Request with input parameters for creating new notification channel with webhook type. */ + NotificationChannelWebhookCreateRequest: { + /** + * Channel Type + * @description Notification channel type. + * @enum {string} + */ + type: 'WEBHOOK' + /** + * Channel Name + * @description User friendly name of the channel. + * @example customer-webhook + */ + name: string + /** + * Channel Disabled + * @description Whether the channel is disabled or not. + * @default false + * @example true + */ + disabled?: boolean + /** + * Webhook URL + * @description Webhook URL where the notification is sent. + * @example https://example.com/webhook + */ + url: string + /** + * Custom HTTP Headers + * @description Custom HTTP headers sent as part of the webhook request. + */ + customHeaders?: { + [key: string]: string + } + /** + * Signing Secret + * @description Signing secret used for webhook request validation on the receiving end. + * + * Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24 + * @example whsec_S6g2HLnTwd9AhHwUIMFggVS9OfoPafN8 + */ + signingSecret?: string + } + /** @description Type of the notification event. */ + NotificationEvent: { + /** + * Event Identifier + * @description A unique identifier of the notification event. + * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 + */ + id: string + /** + * Event Type + * @description Type of the notification event. + */ + type: components['schemas']['NotificationEventType'] + /** + * Creation Time + * Format: date-time + * @description Timestamp when the notification event was created in RFC 3339 format. + * @example "2023-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Owner Rule + * @description The nnotification rule which generated this event. + */ + rule: components['schemas']['NotificationRule'] + /** + * Delivery Status + * @description The delivery status of the notification event. + */ + deliveryStatus: readonly components['schemas']['NotificationEventDeliveryStatus'][] + /** + * Event Payload + * @description Timestamp when the notification event was created in RFC 3339 format. + */ + payload: components['schemas']['NotificationEventPayload'] + /** + * Annotations + * @description Set of key-value pairs managed by the system. Cannot be modified by user. + */ + annotations?: components['schemas']['Annotations'] + } + /** @description Payload for notification event with `entitlements.balance.threshold` type. */ + NotificationEventBalanceThresholdPayload: { + /** + * Notification Event Identifier + * @description A unique identifier for the notification event the payload belongs to. + * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0 + */ + id: string + /** + * Notification Event Type + * @description Type of the notification event. + * @enum {string} + */ + type: 'entitlements.balance.threshold' + /** + * Creation Time + * Format: date-time + * @description Timestamp when the notification event was created in RFC 3339 format. + * @example "2023-01-01T01:01:01.001Z" + */ + timestamp: string + /** + * Payload Data + * @description The data of the payload. + */ + data: components['schemas']['NotificationEventBalanceThresholdPayloadData'] + } + /** @description Data of the payload for notification event with `entitlements.balance.threshold` type. */ + NotificationEventBalanceThresholdPayloadData: { + /** Entitlement */ + entitlement: components['schemas']['EntitlementMetered'] + /** Feature */ + feature: components['schemas']['Feature'] + /** Subject */ + subject: components['schemas']['Subject'] + /** Entitlement Value */ + value: components['schemas']['EntitlementValue'] + /** Threshold */ + threshold: components['schemas']['NotificationRuleBalanceThresholdValue'] + } + /** @description The delivery status of the notification event. */ + NotificationEventDeliveryStatus: { + /** + * @description Delivery state of the notification event to the channel. + * @example SUCCESS + */ + state: components['schemas']['NotificationEventDeliveryStatusState'] + /** + * State Reason + * @description The reason of the last deliverry state update. + * @example Failed to dispatch event due to provider error. + */ + reason: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the status was last updated in RFC 3339 format. + * @example "2023-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Notification Channel + * @description Notification channel the delivery sattus associated with. + */ + channel: components['schemas']['NotificationChannelMeta'] + } + /** + * Delivery State + * @description The delivery state of the notification event to the channel. + * @enum {string} + */ + NotificationEventDeliveryStatusState: + | 'SUCCESS' + | 'FAILED' + | 'SENDING' + | 'PENDING' + /** + * @description Order by options for notification channels. + * @enum {string} + */ + NotificationEventOrderBy: 'id' | 'createdAt' + /** @description Paginated response */ + NotificationEventPaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['NotificationEvent'][] + } + /** @description The delivery status of the notification event. */ + NotificationEventPayload: components['schemas']['NotificationEventBalanceThresholdPayload'] + /** + * @description Type of the notification event. + * @enum {string} + */ + NotificationEventType: 'entitlements.balance.threshold' + /** @description Notification Rule. */ + NotificationRule: components['schemas']['NotificationRuleBalanceThreshold'] + /** @description Notification rule with entitlements.balance.threshold type. */ + NotificationRuleBalanceThreshold: { + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** + * Rule Unique Identifier + * @description Identifies the notification rule. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + /** + * Rule Type + * @description Notification rule type. + * @enum {string} + */ + type: 'entitlements.balance.threshold' + /** + * Rule Name + * @description The user friendly name of the notification rule. + * @example Balance threshold reached + */ + name: string + /** + * Rule Disabled + * @description Whether the rule is disabled or not. + * @default false + * @example true + */ + disabled?: boolean + /** + * Channels assigned to Rule + * @description List of notification channels the rule applies to. + */ + channels: components['schemas']['NotificationChannelMeta'][] + /** + * Entitlement Balance Thresholds + * @description List of thresholds the rule suppose to be triggered. + */ + thresholds: components['schemas']['NotificationRuleBalanceThresholdValue'][] + /** + * Features + * @description Optional field containing list of features the rule applies to. + */ + features?: components['schemas']['FeatureMeta'][] + } + /** @description Request with input parameters for creating new notification rule with entitlements.balance.threashold type. */ + NotificationRuleBalanceThresholdCreateRequest: { + /** + * Rule Type + * @description Notification rule type. + * @enum {string} + */ + type: 'entitlements.balance.threshold' + /** + * Rule Name + * @description The user friendly name of the notification rule. + * @example Balance threshold reached + */ + name: string + /** + * Rule Disabled + * @description Whether the rule is disabled or not. + * @default false + * @example true + */ + disabled?: boolean + /** + * Entitlement Balance Thresholds + * @description List of thresholds the rule suppose to be triggered. + */ + thresholds: components['schemas']['NotificationRuleBalanceThresholdValue'][] + /** + * Channels + * @description List of notification channels the rule is applied to. + */ + channels: string[] + /** + * Features + * @description Optional field for defining the scope of notification by feature. It may contain features by id or key. + */ + features?: string[] + } + /** @description Threshold value with multiple supported types. */ + NotificationRuleBalanceThresholdValue: { + /** + * Threshold Value + * Format: double + * @description Value of the threshold. + * @example 100 + */ + value: number + /** + * @description Type of the threshold. + * @example NUMBER + */ + type: components['schemas']['NotificationRuleBalanceThresholdValueType'] + } + /** + * Notification balance threshold type + * @description Type of the rule in the balance threshold specification. + * @enum {string} + */ + NotificationRuleBalanceThresholdValueType: 'PERCENT' | 'NUMBER' + /** @description Union type for requests creating new notification rule with certain type. */ + NotificationRuleCreateRequest: components['schemas']['NotificationRuleBalanceThresholdCreateRequest'] + /** @description Metadata only fields of a notification channel. */ + NotificationRuleMeta: { + /** + * Rule Unique Identifier + * @description Identifies the notification rule. + * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV + */ + id: string + /** + * Rule Type + * @description Notification rule type. + */ + type: components['schemas']['NotificationEventType'] + } + /** + * @description Order by options for notification channels. + * @enum {string} + */ + NotificationRuleOrderBy: 'id' | 'type' | 'createdAt' | 'updatedAt' + /** @description Paginated response */ + NotificationRulePaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['NotificationRule'][] + } + /** @description Numeric represents an arbitrary precision number. */ + Numeric: string + /** + * @description OAuth2 authorization code grant error types. + * @enum {string} + */ + OAuth2AuthorizationCodeGrantErrorType: + | 'invalid_request' + | 'unauthorized_client' + | 'access_denied' + | 'unsupported_response_type' + | 'invalid_scope' + | 'server_error' + | 'temporarily_unavailable' + /** @description Paginated query parameters. */ + PaginatedQuery: { + /** + * @description The page number. + * @default 1 + */ + page?: number + /** + * @description The number of items in the page. + * @default 100 + */ + pageSize?: number + } + /** @description Numeric representation of a percentage */ + Percentage: string + /** @description A period with a start and end time. */ + Period: { + /** + * Format: date-time + * @description Period start time. + * @example "2023-01-01T01:01:01.001Z" + */ + from: string + /** + * Format: date-time + * @description Period end time. + * @example "2023-02-01T01:01:01.001Z" + */ + to: string + } + /** + * @description Order by options for plan phases. + * @enum {string} + */ + PhasesOrderBy: 'key' + /** @description Plans provide a template for subscriptions. */ + Plan: { + /** + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** + * Key + * @description A semi-unique identifier for the resource. + */ + key: string + /** + * Version + * @description Version of the plan. Incremented when the plan is updated. + * @default 1 + */ + version: number + /** + * Currency + * @description The currency code of the plan. + * @default USD + */ + currency: components['schemas']['CurrencyCode'] + /** + * Effective start date + * Format: date-time + * @description The date and time when the plan becomes effective. When not specified, the plan is a draft. + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveFrom?: string + /** + * Effective end date + * Format: date-time + * @description The date and time when the plan is no longer effective. When not specified, the plan is effective indefinitely. + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveTo?: string + /** + * Status + * @description The status of the plan. + * Computed based on the effective start and end dates: + * - draft = no effectiveStartDate + * - active = effectiveStartDate <= now < effectiveEndDate + * - archived / inactive = effectiveEndDate <= now + */ + status: components['schemas']['PlanStatus'] + /** + * Plan phases + * @description The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. + * A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices. + */ + phases: components['schemas']['PlanPhase'][] + } + /** @description Resource create operation model. */ + PlanCreate: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Key + * @description A semi-unique identifier for the resource. + */ + key: string + /** + * Currency + * @description The currency code of the plan. + * @default USD + */ + currency: components['schemas']['CurrencyCode'] + /** + * Effective start date + * Format: date-time + * @description The date and time when the plan becomes effective. When not specified, the plan is a draft. + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveFrom?: string + /** + * Effective end date + * Format: date-time + * @description The date and time when the plan is no longer effective. When not specified, the plan is effective indefinitely. + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveTo?: string + /** + * Plan phases + * @description The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. + * A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices. + */ + phases: components['schemas']['PlanPhase'][] + } + /** + * @description Order by options for plans. + * @enum {string} + */ + PlanOrderBy: 'id' | 'key' + /** @description Paginated response */ + PlanPaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['Plan'][] + } + /** @description The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. */ + PlanPhase: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** @description Unique key among the plan phases. Used to reference the phase in the subscription & plan. */ + key: string + /** + * Rate cards + * @description The rate cards of the plan. + */ + rateCards: components['schemas']['RateCard'][] + /** + * Duration + * Format: duration + * @description The time after which the plan starts compared to subscription start + * @example P1Y1D + */ + startAfter: string | null + /** + * Discount + * @description The discounts on the plan. + */ + discounts?: components['schemas']['AppliedDiscount'][] + } + /** @description Resource create operation model. */ + PlanPhaseCreate: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** @description Unique key among the plan phases. Used to reference the phase in the subscription & plan. */ + key: string + /** + * Rate cards + * @description The rate cards of the plan. + */ + rateCards: components['schemas']['RateCard'][] + /** + * Duration + * Format: duration + * @description The time after which the plan starts compared to subscription start + * @example P1Y1D + */ + startAfter: string | null + /** + * Discount + * @description The discounts on the plan. + */ + discounts?: components['schemas']['AppliedDiscount'][] + } + /** @description Paginated response */ + PlanPhasePaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['PlanPhase'][] + } + /** @description Resource create or update operation model. */ + PlanPhaseUpdate: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name?: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** @description Unique key among the plan phases. Used to reference the phase in the subscription & plan. */ + key?: string + /** + * Rate cards + * @description The rate cards of the plan. + */ + rateCards?: components['schemas']['RateCard'][] + /** + * Duration + * Format: duration + * @description The time after which the plan starts compared to subscription start + * @example P1Y1D + */ + startAfter?: string | null + /** + * Discount + * @description The discounts on the plan. + */ + discounts?: components['schemas']['AppliedDiscount'][] + } + /** @description Referebces an exact plan. */ + PlanReference: { + /** @description The plan key. */ + key: string + /** @description The plan version. */ + version: number + } + /** + * @description The status of a plan. + * @enum {string} + */ + PlanStatus: 'draft' | 'active' | 'archived' + /** @description Resource create or update operation model. */ + PlanUpdate: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name?: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Currency + * @description The currency code of the plan. + * @default USD + */ + currency?: components['schemas']['CurrencyCode'] + /** + * Effective start date + * Format: date-time + * @description The date and time when the plan becomes effective. When not specified, the plan is a draft. + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveFrom?: string + /** + * Effective end date + * Format: date-time + * @description The date and time when the plan is no longer effective. When not specified, the plan is effective indefinitely. + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveTo?: string + /** + * Plan phases + * @description The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses. + * A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices. + */ + phases?: components['schemas']['PlanPhase'][] + } + /** + * @description A plan variant. + * A set of properties that can be used to select a specific configuration of a plan. + */ + PlanVariant: { + currency: components['schemas']['CurrencyCode'] + } + /** @description Plan variant override preset. */ + PlanVariantOverridePreset: { + /** + * Variant + * @description The variant of the plan. + * @example { + * "currency": "USD" + * } + */ + variant: components['schemas']['PlanVariant'] + /** + * Currency + * @description The currency code. + */ + currency?: components['schemas']['CurrencyCode'] + /** + * Rate card overrides + * @description The rate card overrides. + */ + rateCards?: { + /** + * Add rate card + * @description Add rate cards to the plan. + */ + add?: components['schemas']['RateCard'][] + /** + * Remove rate card + * @description Remove rate cards from the plan. + */ + remove?: string[] + } + /** + * Discount + * @description The discount on the plan. + */ + discount?: components['schemas']['AppliedDiscount'] + } + /** + * @description A consumer portal token. + * + * Validator doesn't obey required for readOnly properties + * See: https://github.com/stoplightio/spectral/issues/1274 + */ + PortalToken: { + /** + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id?: string + /** @example customer-1 */ + subject: string + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + expiresAt?: string + expired?: boolean + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T01:01:01.001Z" + */ + createdAt?: string + /** + * @description The token is only returned at creation. + * @example om_portal_IAnD3PpWW2A2Wr8m9jfzeHlGX8xmCXwG.y5q4S-AWqFu6qjfaFz0zQq4Ez28RsnyVwJffX5qxMvo + */ + token?: string + /** + * @description Optional, if defined only the specified meters will be allowed. + * @example [ + * "tokens_total" + * ] + */ + allowedMeterSlugs?: string[] + } + /** @description One or more conditions given in the request header fields evaluated to false when tested on the server. */ + PreconditionFailedProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** + * @description Price. + * One of: flat, unit, or tiered. + */ + Price: + | components['schemas']['FlatPrice'] + | components['schemas']['UnitPrice'] + | components['schemas']['TieredPrice'] + /** + * @description The payment term of a flat price. + * One of: in_advance or in_arrears. + * @enum {string} + */ + PricePaymentTerm: 'in_advance' | 'in_arrears' + /** + * @description A price tier. + * At least one price component is required in each tier. + */ + PriceTier: { + /** + * Up to quantity + * Format: double + * @description Up to and including to this quantity will be contained in the tier. + * If null, the tier is open-ended. + */ + upToAmount: number | null + /** + * Flat price component + * @description The flat price component of the tier. + */ + flatPrice: components['schemas']['FlatPrice'] | null + /** + * Unit price component + * @description The unit price component of the tier. + */ + unitPrice: components['schemas']['UnitPrice'] | null + } + /** + * @description A price tier. + * At least one price component is required in each tier. + */ + PriceTierUpdateItem: { + /** + * Up to quantity + * Format: double + * @description Up to and including to this quantity will be contained in the tier. + * If null, the tier is open-ended. + */ + upToAmount: number | null + /** + * Flat price component + * @description The flat price component of the tier. + */ + flatPrice: components['schemas']['FlatPriceUpdateItem'] | null + /** + * Unit price component + * @description The unit price component of the tier. + */ + unitPrice: components['schemas']['UnitPriceUpdateItem'] | null + } + /** + * @description The type of the price. + * @enum {string} + */ + PriceType: 'flat' | 'unit' | 'tiered' + /** @description Paginated response */ + ProfilePaginatedResponse: { + /** + * @description The items in the current page. + * @example 500 + */ + totalCount: number + /** + * @description The items in the current page. + * @example 1 + */ + page: number + /** + * @description The items in the current page. + * @example 100 + */ + pageSize: number + /** @description The items in the current page. */ + items: components['schemas']['BillingProfile'][] + } + /** @description A rate card defines the pricing and entitlement of a feature or service. */ + RateCard: + | components['schemas']['RateCardFlatFee'] + | components['schemas']['RateCardUsageBased'] + /** @description Entitlement template of a boolean entitlement. */ + RateCardBooleanEntitlement: { + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** @enum {string} */ + type: 'boolean' + } + /** + * @description Entitlement templates are used to define the entitlements of a plan. + * Features are omitted from the entitlement template, as they are defined in the rate card. + */ + RateCardEntitlement: + | components['schemas']['RateCardMeteredEntitlement'] + | components['schemas']['RateCardStaticEntitlement'] + | components['schemas']['RateCardBooleanEntitlement'] + /** @description A flat fee rate card defines a one-time purchase or a recurring fee. */ + RateCardFlatFee: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** + * Key + * @description A semi-unique identifier for the resource. + */ + key: string + /** + * RateCard type + * @description The type of the RateCard. + * @enum {string} + */ + type: 'flat_fee' + /** + * Feature key + * @description The feature the customer is entitled to use. + */ + featureKey?: string + /** + * Entitlement template + * @description The entitlement of the rate card. + * Only available when featureKey is set. + */ + entitlementTemplate?: { + type: 'RateCardFlatFee' + } & Omit + /** + * Tax config + * @description The tax config of the rate card. + * When undefined, the tax config of the feature or the default tax config of the plan is used. + */ + taxConfig?: components['schemas']['TaxConfig'] + /** + * Billing cadence + * Format: duration + * @description The billing cadence of the rate card. + */ + billingCadence: string | null + /** + * Price + * @description The price of the rate card. + * When null, the feature or service is free. + * @example {} + */ + price: components['schemas']['FlatPriceWithPaymentTerm'] | null + } + /** @description A flat fee rate card defines a one-time purchase or a recurring fee. */ + RateCardFlatFeeUpdateItem: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * RateCard type + * @description The type of the RateCard. + * @enum {string} + */ + type: 'flat_fee' + /** + * Feature key + * @description The feature the customer is entitled to use. + */ + featureKey?: string + /** + * Entitlement template + * @description The entitlement of the rate card. + * Only available when featureKey is set. + */ + entitlementTemplate?: { + type: 'RateCardFlatFeeUpdateItem' + } & Omit + /** + * Tax config + * @description The tax config of the rate card. + * When undefined, the tax config of the feature or the default tax config of the plan is used. + */ + taxConfig?: components['schemas']['TaxConfig'] + /** + * Billing cadence + * Format: duration + * @description The billing cadence of the rate card. + */ + billingCadence: string | null + /** + * Price + * @description The price of the rate card. + * When null, the feature or service is free. + * @example {} + */ + price: components['schemas']['FlatPriceWithPaymentTermUpdateItem'] | null + } + /** @description The entitlement template with a metered entitlement. */ + RateCardMeteredEntitlement: { + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** @enum {string} */ + type: 'metered' + /** + * Soft limit + * @description If softLimit=true the subject can use the feature even if the entitlement is exhausted, hasAccess will always be true. + * @default false + */ + isSoftLimit?: boolean + /** + * Initial grant amount + * Format: double + * @description You can grant usage automatically alongside the entitlement, the example scenario would be creating a starting balance. + * If an amount is specified here, a grant will be created alongside the entitlement with the specified amount. + * That grant will have it's rollover settings configured in a way that after each reset operation, the balance will return the original amount specified here. + * Manually creating such a grant would mean having the "amount", "minRolloverAmount", and "maxRolloverAmount" fields all be the same. + */ + issueAfterReset?: number + /** + * Issue grant after reset priority + * Format: uint8 + * @description Defines the grant priority for the default grant. + * @default 1 + */ + issueAfterResetPriority?: number + /** + * Preserve overage at reset + * @description If true, the overage is preserved at reset. If false, the usage is reset to 0. + * @default false + */ + preserveOverageAtReset?: boolean + /** + * Usage Period + * Format: duration + * @description The interval of the metered entitlement. + * Defaults to the billing cadence of the rate card. + */ + usagePeriod?: string + } + /** @description Rate card override. */ + RateCardOverride: + | components['schemas']['RateCardOverrideFlatFee'] + | components['schemas']['RateCardOverrideUsageBased'] + /** @description Flat fee rate card override. */ + RateCardOverrideFlatFee: { + /** + * RateCard type + * @description The type of the RateCard. + * @enum {string} + */ + type: 'flat_fee' + /** + * Price + * @description The price of the rate card. + * When null, the feature or service is free. + * @example {} + */ + price: components['schemas']['FlatPriceWithPaymentTerm'] | null + } + /** @description Usage-based rate card override. */ + RateCardOverrideUsageBased: { + /** + * RateCard type + * @description The type of the RateCard. + * @enum {string} + */ + type: 'usage_based' + /** + * Price + * @description The price of the rate card. + * When null, the feature or service is free. + * @example {} + */ + price: + | (components['schemas']['UnitPriceWithCommitments'] | null) + | (components['schemas']['TieredPriceWithCommitments'] | null) + | (components['schemas']['FlatPriceWithPaymentTerm'] | null) + } + /** @description Entitlement template of a static entitlement. */ + RateCardStaticEntitlement: { + /** @description Additional metadata for the feature. */ + metadata?: components['schemas']['Metadata'] + /** @enum {string} */ + type: 'static' + /** + * Format: json + * @description The JSON parsable config of the entitlement. This value is also returned when checking entitlement access and it is useful for configuring fine-grained access settings to the feature, implemented in your own system. Has to be an object. + * @example { "integrations": ["github"] } + */ + config: string + } + /** + * @description The type of the rate card. + * @enum {string} + */ + RateCardType: 'flat_fee' | 'usage_based' + /** @description A rate card defines the pricing and entitlement of a feature or service. */ + RateCardUpdateItem: + | components['schemas']['RateCardFlatFeeUpdateItem'] + | components['schemas']['RateCardUsageBasedUpdateItem'] + /** @description A usage-based rate card defines a price based on usage. */ + RateCardUsageBased: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** + * Key + * @description A semi-unique identifier for the resource. + */ + key: string + /** + * RateCard type + * @description The type of the RateCard. + * @enum {string} + */ + type: 'usage_based' + /** + * Feature key + * @description The feature the customer is entitled to use. + */ + featureKey?: string + /** + * Entitlement template + * @description The entitlement of the rate card. + * Only available when featureKey is set. + */ + entitlementTemplate?: { + type: 'RateCardUsageBased' + } & Omit + /** + * Tax config + * @description The tax config of the rate card. + * When undefined, the tax config of the feature or the default tax config of the plan is used. + */ + taxConfig?: components['schemas']['TaxConfig'] + /** + * Billing cadence + * Format: duration + * @description The billing cadence of the rate card. + * When null, the rate card is a one-time purchase. + */ + billingCadence: string + /** + * Price + * @description The price of the rate card. + * When null, the feature or service is free. + * @example {} + */ + price: + | (components['schemas']['UnitPriceWithCommitments'] | null) + | (components['schemas']['TieredPriceWithCommitments'] | null) + | (components['schemas']['FlatPriceWithPaymentTerm'] | null) + } + /** @description A usage-based rate card defines a price based on usage. */ + RateCardUsageBasedUpdateItem: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * RateCard type + * @description The type of the RateCard. + * @enum {string} + */ + type: 'usage_based' + /** + * Feature key + * @description The feature the customer is entitled to use. + */ + featureKey?: string + /** + * Entitlement template + * @description The entitlement of the rate card. + * Only available when featureKey is set. + */ + entitlementTemplate?: { + type: 'RateCardUsageBasedUpdateItem' + } & Omit + /** + * Tax config + * @description The tax config of the rate card. + * When undefined, the tax config of the feature or the default tax config of the plan is used. + */ + taxConfig?: components['schemas']['TaxConfig'] + /** + * Billing cadence + * Format: duration + * @description The billing cadence of the rate card. + * When null, the rate card is a one-time purchase. + */ + billingCadence: string + /** + * Price + * @description The price of the rate card. + * When null, the feature or service is free. + * @example {} + */ + price: + | (components['schemas']['UnitPriceWithCommitmentsUpdateItem'] | null) + | (components['schemas']['TieredPriceWithCommitmentsUpdateItem'] | null) + | (components['schemas']['FlatPriceWithPaymentTermUpdateItem'] | null) + } + /** + * @description Recurring period with an interval and an anchor. + * @example { + * "interval": "DAY", + * "anchor": "2023-01-01T01:01:01.001Z" + * } + */ + RecurringPeriod: { + /** + * Interval + * @description The unit of time for the interval. + */ + interval: components['schemas']['RecurringPeriodInterval'] + /** + * Anchor time + * Format: date-time + * @description A date-time anchor to base the recurring period on. + * @example "2023-01-01T01:01:01.001Z" + */ + anchor: string + } + /** + * @description Recurring period with an interval and an anchor. + * @example { + * "interval": "DAY", + * "anchor": "2023-01-01T01:01:01.001Z" + * } + */ + RecurringPeriodCreateInput: { + /** + * Interval + * @description The unit of time for the interval. + */ + interval: components['schemas']['RecurringPeriodInterval'] + /** + * Anchor time + * Format: date-time + * @description A date-time anchor to base the recurring period on. + * @example "2023-01-01T01:01:01.001Z" + */ + anchor?: string + } + /** + * @description The unit of time for the interval. + * One of: `day`, `week`, `month`, or `year`. + * @enum {string} + */ + RecurringPeriodInterval: 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' + /** + * @description The direction of the phase shift when a phase is removed. + * @enum {string} + */ + RemovePhaseShifting: 'Next' | 'Prev' + /** @description Reset parameters */ + ResetEntitlementUsageInput: { + /** + * Format: date-time + * @description The time at which the reset takes effect, defaults to now. The reset cannot be in the future. The provided value is truncated to the minute due to how historical meter data is stored. + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveAt?: string + /** + * @description Determines whether the usage period anchor is retained or reset to the effectiveAt time. + * - If true, the usage period anchor is retained. + * - If false, the usage period anchor is reset to the effectiveAt time. + */ + retainAnchor?: boolean + /** + * @description Determines whether the overage is preserved or forgiven, overriding the entitlement's default behavior. + * - If true, the overage is preserved. + * - If false, the overage is forgiven. + */ + preserveOverage?: boolean + } + SandboxApp: { + /** + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** @description The marketplace listing that this installed app is based on. */ + listing: components['schemas']['MarketplaceListing'] + /** @description Status of the app connection. */ + status: components['schemas']['AppStatus'] + /** + * @description The app's type is Sandbox. + * @enum {string} + */ + type: 'sandbox' + } + /** @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. */ + ServiceUnavailableProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** + * @description The order direction. + * @enum {string} + */ + SortOrder: 'ASC' | 'DESC' + /** + * @description Spending commitments. + * The customer is committed to spend at least the minimum amount and at most the maximum amount. + */ + SpendCommitments: { + /** + * Minimum amount + * @description The customer is committed to spend at least the amount. + */ + minimumAmount?: components['schemas']['Numeric'] + /** + * Maximum amount + * @description The customer is limited to spend at most the amount. + */ + maximumAmount?: components['schemas']['Numeric'] + } + /** + * @description A installed Stripe app object. + * @example { + * "id": "01G65Z755AFWAKHE12NY0CQ9FH", + * "type": "stripe", + * "name": "Stripe", + * "status": "ready", + * "listing": { + * "type": "stripe", + * "name": "Stripe", + * "description": "Stripe interation allows you to collect payments with Stripe.", + * "iconUrl": "/images/stripe.png", + * "capabilities": [ + * { + * "type": "calculateTax", + * "key": "stripe_calculate_tax", + * "name": "Calculate Tax", + * "description": "Stripe Tax calculates tax portion of the invoices." + * }, + * { + * "type": "invoiceCustomers", + * "key": "stripe_invoice_customers", + * "name": "Invoice Customers", + * "description": "Stripe invoices customers with due amount." + * }, + * { + * "type": "collectPayments", + * "key": "stripe_collect_payments", + * "name": "Collect Payments", + * "description": "Stripe payments collects outstanding revenue with Stripe customer's default payment method." + * } + * ] + * }, + * "createdAt": "2024-01-01T01:01:01.001Z", + * "updatedAt": "2024-01-01T01:01:01.001Z", + * "stripeAccountId": "acct_123456789", + * "livemode": true + * } + */ + StripeApp: { + /** + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** @description The marketplace listing that this installed app is based on. */ + listing: components['schemas']['MarketplaceListing'] + /** @description Status of the app connection. */ + status: components['schemas']['AppStatus'] + /** + * @description The app's type is Stripe. + * @enum {string} + */ + type: 'stripe' + /** @description The Stripe account ID. */ + stripeAccountId: string + /** @description Livemode, true if the app is in production mode. */ + livemode: boolean + } + /** + * @description Stripe CheckoutSession.mode + * @enum {string} + */ + StripeCheckoutSessionMode: 'setup' + /** + * @description Stripe payment intent status. + * @enum {string} + */ + StripePaymentIntentStatus: + | 'canceled' + | 'processing' + | 'requires_action' + | 'requires_confirmation' + | 'requires_payment_method' + | 'succeeded' + /** @description Stripe setup intent. */ + StripeSetupIntent: { + /** @description The setup intent id. */ + id: string + /** @description The setup intent status. */ + status: components['schemas']['StripePaymentIntentStatus'] + /** @description The setup intent payment method. */ + payment_method?: string + /** @description The setup intent payment method types. */ + payment_method_types?: string[] + /** @description The setup intent customer. */ + customer: string + /** @description The setup intent metadata. */ + metadata: { + [key: string]: string + } + } + /** @description The tax config for Stripe. */ + StripeTaxConfig: { + /** + * Tax code + * @description Product tax code. + * + * See: https://docs.stripe.com/tax/tax-codes + * @example txcd_10000000 + */ + code: string + } + /** @description Stripe webhook event. */ + StripeWebhookEvent: { + /** @description The event ID. */ + id: string + /** @description The event type. */ + type: string + /** @description Live mode. */ + livemode: boolean + /** + * Format: int32 + * @description The event created timestamp. + */ + created: number + /** @description The event data. */ + data: { + object: components['schemas']['StripeSetupIntent'] + } + } + /** @description Stripe webhook response. */ + StripeWebhookResponse: { + /** + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + namespaceId: string + /** + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + appId: string + /** + * @description ULID (Universally Unique Lexicographically Sortable Identifier). + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + customerId?: string + } + /** + * @description A subject is a unique identifier for a user or entity. + * @example { + * "id": "01G65Z755AFWAKHE12NY0CQ9FH", + * "key": "customer-id", + * "displayName": "Customer Name", + * "metadata": { + * "hubspotId": "123456" + * }, + * "currentPeriodStart": "2023-01-01T00:00:00.000Z", + * "currentPeriodEnd": "2023-02-01T00:00:00.000Z", + * "stripeCustomerId": "cus_JMOlctsKV8" + * } + */ + Subject: { + /** + * @description A unique identifier for the subject. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + /** + * @description A unique, human-readable identifier for the subject. + * @example customer-id + */ + key: string + /** + * @description A human-readable display name for the subject. + * @example Customer Name + */ + displayName?: string | null + /** @example {} */ + metadata?: { + [key: string]: unknown + } | null + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-01-01T00:00:00.000Z" + */ + currentPeriodStart?: string + /** + * Format: date-time + * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC. + * @example "2023-02-01T00:00:00.000Z" + */ + currentPeriodEnd?: string + /** @example cus_JMOlctsKV8 */ + stripeCustomerId?: string | null + } + /** @description Subscription is an exact subscription instance. */ + Subscription: { + /** + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** + * @description The customer ID of the subscription. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + customerId: string + /** @description The base plan of the subscription. */ + plan: components['schemas']['PlanReference'] + /** + * Currency + * @description The currency code of the subscription. + * Will be revised once we add multi currency support. + * @default USD + */ + currency: components['schemas']['CurrencyCode'] + /** + * Format: date-time + * @description If the subscription is canceled or otherwise have to end activeTo denotes the end date. + * @example "2023-01-01T01:01:01.001Z" + */ + activeTo?: string + } + /** @description Subscription item add operation. */ + SubscriptionEditAdd: { + /** @enum {string} */ + op: 'add' + path: string + value: components['schemas']['SubscriptionPhaseCreate'] + } + /** @description Subscription item add operation. */ + SubscriptionEditAddItem: { + /** @enum {string} */ + op: 'add' + path: string + value: components['schemas']['RateCard'] + } + /** @description Subscription item add operation. */ + SubscriptionEditAddUpdateItem: { + /** @enum {string} */ + op: 'add' + path: string + value: components['schemas']['RateCardUpdateItem'] + } + /** @description Subscription phase extend operation. */ + SubscriptionEditExtend: { + /** @enum {string} */ + op: 'extend' + path: string + value: { + /** Format: duration */ + extendBy: string + } + } + /** @description Subscription phase remove operation. */ + SubscriptionEditRemoveItem: { + /** @enum {string} */ + op: 'remove' + path: string + } + /** @description Subscription phase remove operation. */ + SubscriptionEditRemoveUpdateItem: { + /** @enum {string} */ + op: 'remove' + path: string + } + /** @description Subscription item remove operation with a value. */ + SubscriptionEditRemoveWithValue: { + /** @enum {string} */ + op: 'remove' + path: string + value: { + shift: components['schemas']['RemovePhaseShifting'] + } + } + /** @description Expanded subscription */ + SubscriptionExpanded: { + /** + * ID + * @description A unique identifier for the resource. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + id: string + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** + * @description The customer ID of the subscription. + * @example 01G65Z755AFWAKHE12NY0CQ9FH + */ + customerId: string + /** @description The base plan of the subscription. */ + plan: components['schemas']['PlanReference'] + /** + * Currency + * @description The currency code of the subscription. + * Will be revised once we add multi currency support. + * @default USD + */ + currency: components['schemas']['CurrencyCode'] + /** + * Format: date-time + * @description If the subscription is canceled or otherwise have to end activeTo denotes the end date. + * @example "2023-01-01T01:01:01.001Z" + */ + activeTo?: string + phases: components['schemas']['SubscriptionPhaseExpanded'][] + } + /** @description The actual contents of the Subscription, what the user gets, what they pay, etc... */ + SubscriptionItem: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** + * @description The identifier of the RateCard. + * SubscriptionItem/RateCard can be identified, it has a reference: + * + * 1. If a Feature is associated with the SubscriptionItem, it is identified by the Feature + * 1.1 It can be an ID reference, for an exact version of the Feature (Features can change across versions) + * 1.2 It can be a Key reference, which always refers to the latest (active or inactive) version of a Feature + * + * 2. If a Feature is not associated with the SubscriptionItem, it is referenced by the Price + * + * We say “referenced by the Price” regardless of how a price itself is referenced, it colloquially makes sense to say “paying the same price for the same thing”. In practice this should be derived from what's printed on the invoice line-item. + */ + key: string + /** + * Billing cadence + * Format: duration + * @description The billing cadence of the rate card. + * When null, the rate card is a one-time purchase. + */ + billingCandence: string | null + /** + * Price + * @description The price of the rate card. + * When null, the feature or service is free. + * @example {} + */ + price: + | (components['schemas']['FlatPriceWithPaymentTerm'] | null) + | (components['schemas']['UnitPriceWithCommitments'] | null) + | (components['schemas']['TieredPriceWithCommitments'] | null) + /** @description Describes what access is gained via the SubscriptionItem */ + included?: { + /** @description The feature the customer is entitled to use. */ + feature: components['schemas']['Feature'] + /** @description The entitlement of the Subscription Item. */ + entitlement?: { + type: 'SubscriptionItem' + } & Omit + } + } + /** @description Subscription phase, analogous to plan phases. */ + SubscriptionPhase: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** @description A locally unique identifier for the resource. */ + key: string + /** + * Duration + * Format: duration + * @description The intended duration of the new phase. + * @example P1M + */ + duration: string + /** + * Discount + * @description The discounts on the plan. + */ + discounts?: components['schemas']['AppliedDiscount'][] + /** + * Format: date-time + * @description The time from which the phase is active. + * @example "2023-01-01T01:01:01.001Z" + */ + activeFrom: string + } + /** @description Subscription phase create input. */ + SubscriptionPhaseCreate: { + /** + * Start after + * Format: duration + * @description Interval after the subscription starts to transition to the phase. + * When null, the phase starts immediately after the subscription starts. + * @example P1Y1D + */ + startAfter: string | null + /** + * Duration + * Format: duration + * @description The intended duration of the new phase. + * @example P1M + */ + duration: string + /** + * Discount + * @description The discounts on the plan. + */ + discounts?: components['schemas']['AppliedDiscountUpdateItem'][] + } + /** @description Expanded subscription phase */ + SubscriptionPhaseExpanded: { + /** + * Display name + * @description Human-readable name for the resource. Between 1 and 256 characters. + */ + name: string + /** + * Description + * @description Optional description of the resource. Maximum 1024 characters. + */ + description?: string + /** + * Metadata + * @description Additional metadata for the resource. + */ + metadata?: components['schemas']['Metadata'] + /** + * Creation Time + * Format: date-time + * @description Timestamp of when the resource was created. + * @example "2024-01-01T01:01:01.001Z" + */ + createdAt: string + /** + * Last Update Time + * Format: date-time + * @description Timestamp of when the resource was last updated. + * @example "2024-01-01T01:01:01.001Z" + */ + updatedAt: string + /** + * Deletion Time + * Format: date-time + * @description Timestamp of when the resource was permanently deleted. + * @example "2024-01-01T01:01:01.001Z" + */ + deletedAt?: string + /** @description A locally unique identifier for the resource. */ + key: string + /** + * Duration + * Format: duration + * @description The intended duration of the new phase. + * @example P1M + */ + duration: string + /** + * Discount + * @description The discounts on the plan. + */ + discounts?: components['schemas']['AppliedDiscount'][] + /** + * Format: date-time + * @description The time from which the phase is active. + * @example "2023-01-01T01:01:01.001Z" + */ + activeFrom: string + items: components['schemas']['SubscriptionItem'][] + } + /** @description Operational webhook reqeuest sent by Svix. */ + SvixOperationalWebhookRequest: { + /** + * Operational Webhook Type + * @description The type of the Svix operational webhook request. + * @enum {string} + */ + type: + | 'endpoint.created' + | 'endpoint.deleted' + | 'endpoint.disabled' + | 'endpoint.updated' + | 'message.attempt.exhausted' + | 'message.attempt.failing' + | 'message.attempt.recovered' + /** + * Operational Webhook Payload + * @description The payload of the Svix operational webhook request. + */ + data: { + [key: string]: string + } + } + /** @description Set of provider specific tax configs. */ + TaxConfig: { + /** + * Stripe tax config + * @description Stripe tax config. + */ + stripe?: components['schemas']['StripeTaxConfig'] + } + /** @description Tiered price. */ + TieredPrice: { + /** @enum {string} */ + type: 'tiered' + /** + * Mode + * @description Defines if the tiering mode is volume-based or graduated: + * - In `volume`-based tiering, the maximum quantity within a period determines the per unit price. + * - In `graduated` tiering, pricing can change as the quantity grows. + */ + mode: components['schemas']['TieredPriceMode'] + /** + * Tiers + * @description The tiers of the tiered price. + * At least one price component is required in each tier. + */ + tiers: components['schemas']['PriceTier'][] + } + /** + * @description The mode of the tiered price. + * @enum {string} + */ + TieredPriceMode: 'volume' | 'graduated' + /** @description Tiered price with spend commitments. */ + TieredPriceWithCommitments: { + /** @enum {string} */ + type: 'tiered' + /** + * Mode + * @description Defines if the tiering mode is volume-based or graduated: + * - In `volume`-based tiering, the maximum quantity within a period determines the per unit price. + * - In `graduated` tiering, pricing can change as the quantity grows. + */ + mode: components['schemas']['TieredPriceMode'] + /** + * Tiers + * @description The tiers of the tiered price. + * At least one price component is required in each tier. + */ + tiers: components['schemas']['PriceTier'][] + /** + * Minimum amount + * @description The customer is committed to spend at least the amount. + */ + minimumAmount?: components['schemas']['Numeric'] + /** + * Maximum amount + * @description The customer is limited to spend at most the amount. + */ + maximumAmount?: components['schemas']['Numeric'] + } + /** @description Tiered price with spend commitments. */ + TieredPriceWithCommitmentsUpdateItem: { + /** + * Mode + * @description Defines if the tiering mode is volume-based or graduated: + * - In `volume`-based tiering, the maximum quantity within a period determines the per unit price. + * - In `graduated` tiering, pricing can change as the quantity grows. + */ + mode: components['schemas']['TieredPriceMode'] + /** + * Tiers + * @description The tiers of the tiered price. + * At least one price component is required in each tier. + */ + tiers: components['schemas']['PriceTierUpdateItem'][] + /** + * Minimum amount + * @description The customer is committed to spend at least the amount. + */ + minimumAmount?: components['schemas']['Numeric'] + /** + * Maximum amount + * @description The customer is limited to spend at most the amount. + */ + maximumAmount?: components['schemas']['Numeric'] + } + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + UnauthorizedProblemResponse: components['schemas']['UnexpectedProblemResponse'] + /** + * @description A Problem Details object (RFC 7807). + * Additional properties specific to the problem type may be present. + */ + UnexpectedProblemResponse: { + /** + * Format: uri + * @description Type contains a URI that identifies the problem type. + * @default about:blank + * @example about:blank + */ + type: string + /** + * @description A a short, human-readable summary of the problem type. + * @example Bad Request + */ + title: string + /** + * Format: int16 + * @description The HTTP status code generated by the origin server for this occurrence of the problem. + * @example 400 + */ + status?: number + /** + * @description A human-readable explanation specific to this occurrence of the problem. + * @example The request body must be a JSON object. + */ + detail: string + /** + * Format: uri + * @description A URI reference that identifies the specific occurrence of the problem. + * @example urn:request:local/JMOlctsKV8-000001 + */ + instance: string + [key: string]: (string | number) | undefined + } + /** @description Unit price. */ + UnitPrice: { + /** @enum {string} */ + type: 'unit' + /** @description The amount of the unit price. */ + amount: components['schemas']['Numeric'] + } + /** @description Unit price. */ + UnitPriceUpdateItem: { + /** @description The amount of the unit price. */ + amount: components['schemas']['Numeric'] + } + /** @description Unit price with spend commitments. */ + UnitPriceWithCommitments: { + /** @enum {string} */ + type: 'unit' + /** @description The amount of the unit price. */ + amount: components['schemas']['Numeric'] + /** + * Minimum amount + * @description The customer is committed to spend at least the amount. + */ + minimumAmount?: components['schemas']['Numeric'] + /** + * Maximum amount + * @description The customer is limited to spend at most the amount. + */ + maximumAmount?: components['schemas']['Numeric'] + } + /** @description Unit price with spend commitments. */ + UnitPriceWithCommitmentsUpdateItem: { + /** @description The amount of the unit price. */ + amount: components['schemas']['Numeric'] + /** + * Minimum amount + * @description The customer is committed to spend at least the amount. + */ + minimumAmount?: components['schemas']['Numeric'] + /** + * Maximum amount + * @description The customer is limited to spend at most the amount. + */ + maximumAmount?: components['schemas']['Numeric'] + } + /** + * @description Aggregation window size. + * @enum {string} + */ + WindowSize: 'MINUTE' | 'HOUR' | 'DAY' + /** @description The windowed balance history. */ + WindowedBalanceHistory: { + /** + * @description The windowed balance history. + * - It only returns rows for windows where there was usage. + * - The windows are inclusive at their start and exclusive at their end. + * - The last window may be smaller than the window size and is inclusive at both ends. + */ + windowedHistory: components['schemas']['BalanceHistoryWindow'][] + /** @description Grant burndown history. */ + burndownHistory: components['schemas']['GrantBurnDownHistorySegment'][] + } + /** @description Query params for listing customers. */ + queryCustomerList: { + /** + * @description The order direction. + * @default ASC + * @example ASC + */ + order?: components['schemas']['SortOrder'] + /** @description The order by field. */ + orderBy?: components['schemas']['CustomerOrderBy'] + /** + * @description Include deleted customers. + * @default false + */ + includeDeleted?: boolean + /** + * @description Filter customers by name. + * Case-insensitive partial match. + * @example ACME + */ + name?: string + /** + * @description Filter customers by primary email. + * Case-insensitive partial match. + * @example acme@test.com + */ + primaryEmail?: string + /** + * @description Filter customers by usage attribution subject. + * Case-insensitive partial match. + * @example my_subject_key + */ + subject?: string + } & components['schemas']['PaginatedQuery'] + } + responses: never + parameters: { + 'BillingInvoiceListParams.expand'?: components['schemas']['BillingInvoiceExpand'][] + 'BillingInvoiceListParams.extendedStatuses'?: components['schemas']['BillingInvoiceExtendedStatus'][] + 'BillingInvoiceListParams.issuedAfter'?: string + 'BillingInvoiceListParams.issuedBefore'?: string + 'BillingInvoiceListParams.statuses'?: components['schemas']['BillingInvoiceStatus'][] + /** @description The order direction. */ + 'CustomerOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'CustomerOrderByOrdering.orderBy'?: components['schemas']['CustomerOrderBy'] + /** @description The order direction. */ + 'CustomerOverrideOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'CustomerOverrideOrderByOrdering.orderBy'?: components['schemas']['BillingCustomerOverrideOrderBy'] + /** @description The order direction. */ + 'EntitlementOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'EntitlementOrderByOrdering.orderBy'?: components['schemas']['EntitlementOrderBy'] + /** @description The order direction. */ + 'FeatureOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'FeatureOrderByOrdering.orderBy'?: components['schemas']['FeatureOrderBy'] + /** @description The order direction. */ + 'GrantOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'GrantOrderByOrdering.orderBy'?: components['schemas']['GrantOrderBy'] + /** @description The order direction. */ + 'InvoiceOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'InvoiceOrderByOrdering.orderBy'?: components['schemas']['BillingInvoiceOrderBy'] + /** + * @description Number of items to return. + * + * Default is 100. + */ + 'LimitOffset.limit'?: number + /** + * @description Number of items to skip. + * + * Default is 0. + */ + 'LimitOffset.offset'?: number + /** @description The type of the app to install. */ + 'MarketplaceApiKeyInstallRequest.type': components['schemas']['AppType'] + /** @description The type of the app to install. */ + 'MarketplaceOAuth2InstallAuthorizeRequest.type': components['schemas']['AppType'] + /** @description Simple filter for group bys with exact match. */ + 'MeterQuery.filterGroupBy'?: { + [key: string]: string + } + /** + * @description Start date-time in RFC 3339 format. + * + * Inclusive. + */ + 'MeterQuery.from'?: string + /** + * @description If not specified a single aggregate will be returned for each subject and time window. + * `subject` is a reserved group by value. + */ + 'MeterQuery.groupBy'?: string[] + /** @description Filtering by multiple subjects. */ + 'MeterQuery.subject'?: string[] + /** + * @description End date-time in RFC 3339 format. + * + * Inclusive. + */ + 'MeterQuery.to'?: string + /** @description If not specified, a single usage aggregate will be returned for the entirety of the specified period for each subject and group. */ + 'MeterQuery.windowSize'?: components['schemas']['WindowSize'] + /** + * @description The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). + * If not specified, the UTC timezone will be used. + */ + 'MeterQuery.windowTimeZone'?: string + /** @description The order direction. */ + 'NotificationChannelOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'NotificationChannelOrderByOrdering.orderBy'?: components['schemas']['NotificationChannelOrderBy'] + /** @description The order direction. */ + 'NotificationEventOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'NotificationEventOrderByOrdering.orderBy'?: components['schemas']['NotificationEventOrderBy'] + /** @description The order direction. */ + 'NotificationRuleOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'NotificationRuleOrderByOrdering.orderBy'?: components['schemas']['NotificationRuleOrderBy'] + /** + * @description Error code. + * Required with the error response. + */ + 'OAuth2AuthorizationCodeGrantErrorParams.error'?: components['schemas']['OAuth2AuthorizationCodeGrantErrorType'] + /** + * @description Optional human-readable text providing additional information, + * used to assist the client developer in understanding the error that occurred. + */ + 'OAuth2AuthorizationCodeGrantErrorParams.error_description'?: string + /** + * @description Optional uri identifying a human-readable web page with + * information about the error, used to provide the client + * developer with additional information about the error + */ + 'OAuth2AuthorizationCodeGrantErrorParams.error_uri'?: string + /** + * @description Authorization code which the client will later exchange for an access token. + * Required with the success response. + */ + 'OAuth2AuthorizationCodeGrantSuccessParams.code'?: string + /** + * @description Required if the "state" parameter was present in the client authorization request. + * The exact value received from the client: + * + * Unique, randomly generated, opaque, and non-guessable string that is sent + * when starting an authentication request and validated when processing the response. + */ + 'OAuth2AuthorizationCodeGrantSuccessParams.state'?: string + /** @description The page number. */ + 'PaginatedQuery.page'?: number + /** @description The number of items in the page. */ + 'PaginatedQuery.pageSize'?: number + /** + * @description Start date-time in RFC 3339 format. + * + * Inclusive. + */ + 'Pagination.page'?: number + /** + * @description Number of items per page. + * + * Default is 100. + */ + 'Pagination.pageSize'?: number + /** @description The order direction. */ + 'PhasesOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'PhasesOrderByOrdering.orderBy'?: components['schemas']['PhasesOrderBy'] + /** @description The order direction. */ + 'PlanOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'PlanOrderByOrdering.orderBy'?: components['schemas']['PlanOrderBy'] + /** @description The order direction. */ + 'ProfileOrderByOrdering.order'?: components['schemas']['SortOrder'] + /** @description The order by field. */ + 'ProfileOrderByOrdering.orderBy'?: components['schemas']['BillingProfileOrderBy'] + /** @description Include deleted customers. */ + 'queryCustomerList.includeDeleted'?: boolean + /** + * @description Filter customers by name. + * Case-insensitive partial match. + */ + 'queryCustomerList.name'?: string + /** + * @description Filter customers by primary email. + * Case-insensitive partial match. + */ + 'queryCustomerList.primaryEmail'?: string + /** + * @description Filter customers by usage attribution subject. + * Case-insensitive partial match. + */ + 'queryCustomerList.subject'?: string + } + requestBodies: never + headers: never + pathItems: never +} + +export type $defs = Record + +export type external = Record + +export interface operations { + /** @description List apps. */ + listApps: { + parameters: { + query?: { + page?: components['parameters']['PaginatedQuery.page'] + pageSize?: components['parameters']['PaginatedQuery.pageSize'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['AppList'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Get the app. */ + getApp: { + parameters: { + path: { + id: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['App'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Uninstall an app. */ + uninstallApp: { + parameters: { + path: { + id: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Stripe webhook. */ + appStripeWebhook: { + parameters: { + path: { + id: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['StripeWebhookEvent'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['StripeWebhookResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List customer overrides + * @description List customer overrides + */ + billingListCustomerOverrides: { + parameters: { + query?: { + billingProfile?: string[] + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + offset?: components['parameters']['LimitOffset.offset'] + limit?: components['parameters']['LimitOffset.limit'] + order?: components['parameters']['CustomerOverrideOrderByOrdering.order'] + orderBy?: components['parameters']['CustomerOverrideOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['CustomerOverridePaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Get a customer override + * @description Get a customer override by id. + */ + billingGetCustomerOverrideById: { + parameters: { + path: { + customerId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingCustomerOverride'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Create/update a customer override + * @description Create/update a new customer override. + */ + billingUpsertCustomerOverride: { + parameters: { + path: { + customerId: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['BillingCustomerWorkflowOverrideCreate'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingCustomerOverride'] + } + } + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['BillingCustomerOverride'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Delete a customer override + * @description Delete a customer override by id. + */ + billingDeleteCustomerOverride: { + parameters: { + path: { + customerId: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List invoices + * @description List invoices + */ + billingListInvoices: { + parameters: { + query?: { + customers?: string[] + statuses?: components['parameters']['BillingInvoiceListParams.statuses'] + extendedStatuses?: components['parameters']['BillingInvoiceListParams.extendedStatuses'] + issuedAfter?: components['parameters']['BillingInvoiceListParams.issuedAfter'] + issuedBefore?: components['parameters']['BillingInvoiceListParams.issuedBefore'] + expand?: components['parameters']['BillingInvoiceListParams.expand'] + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + offset?: components['parameters']['LimitOffset.offset'] + limit?: components['parameters']['LimitOffset.limit'] + order?: components['parameters']['InvoiceOrderByOrdering.order'] + orderBy?: components['parameters']['InvoiceOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['InvoicePaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List invoices + * @description List invoices for a specific customer + */ + billingListInvoicesByCustomer: { + parameters: { + query?: { + statuses?: components['parameters']['BillingInvoiceListParams.statuses'] + extendedStatuses?: components['parameters']['BillingInvoiceListParams.extendedStatuses'] + issuedAfter?: components['parameters']['BillingInvoiceListParams.issuedAfter'] + issuedBefore?: components['parameters']['BillingInvoiceListParams.issuedBefore'] + expand?: components['parameters']['BillingInvoiceListParams.expand'] + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + offset?: components['parameters']['LimitOffset.offset'] + limit?: components['parameters']['LimitOffset.limit'] + order?: components['parameters']['InvoiceOrderByOrdering.order'] + orderBy?: components['parameters']['InvoiceOrderByOrdering.orderBy'] + } + path: { + customerId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['InvoicePaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Create an invoice + * @description Create a new invoice from the pending line items. + * + * This should be only called if for some reason we need to invoice a customer outside of the normal billing cycle. + * + * When creating an invoice, the pending line items will be marked as invoiced and the invoice will be created with the total amount of the pending items. + * + * New pending line items will be created for the period between now() and the next billing cycle's begining date for any metered item. + * + * The call can return multiple invoices if the pending line items are in different currencies. + */ + billingCreateInvoice: { + parameters: { + path: { + customerId: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['BillingInvoiceCreateInput'] + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['BillingInvoice'][] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Get an invoice + * @description Get an invoice by ID. + */ + billingGetInvoiceByCustomerInvoiceId: { + parameters: { + query: { + expand: components['schemas']['BillingInvoiceExpand'][] + } + path: { + customerId: string + invoiceId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingInvoice'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Delete an invoice + * @description Delete an invoice + * + * Only invoices that are in the draft (or earlier) status can be deleted. + */ + billingDeleteInvoiceByCustomerInvoiceId: { + parameters: { + path: { + customerId: string + invoiceId: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Advance the invoice's state to the next status + * @description Advance the invoice's state to the next status. + * + * The call doesn't "approve the invoice", it only advances the invoice to the next status if the transition would be automatic. + * + * The action can be called when the invoice's statusDetails' actions field contain the "advance" action. + */ + billingInvoiceAdvance: { + parameters: { + path: { + customerId: string + invoiceId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingInvoice'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Send the invoice to the customer + * @description Approve an invoice and start executing the payment workflow. + * + * This call instantly sends the invoice to the customer using the configured billing profile app. + * + * This call is valid in two invoice statuses: + * - `draft`: the invoice will be sent to the customer, the invluce state becomes issued + * - `manual_approval_needed`: the invoice will be sent to the customer, the invoice state becomes issued + */ + billingApproveInvoice: { + parameters: { + path: { + customerId: string + invoiceId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingInvoice'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Update an invoice line + * @description Update an invoice line + */ + billingUpdateInvoiceLine: { + parameters: { + path: { + customerId: string + invoiceId: string + lineId: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['BillingInvoiceLineCreateOrUpdate'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingInvoiceLine'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Delete an invoice line + * @description Delete an invoice line + */ + billingDeleteInvoiceLine: { + parameters: { + path: { + customerId: string + invoiceId: string + lineId: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Retry advancing the invoice after a failed attempt. + * @description Retry advancing the invoice after a failed attempt. + * + * The action can be called when the invoice's statusDetails' actions field contain the "retry" action. + */ + billingInvoiceRetry: { + parameters: { + path: { + customerId: string + invoiceId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingInvoice'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Recalculate an invoice's tax amounts + * @description Recalculate an invoice's tax amounts (using the app set in the customer's billing profile) + * + * Note: charges might apply, depending on the tax provider. + */ + billingRecalculateInvoiceTax: { + parameters: { + path: { + customerId: string + invoiceId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingInvoice'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Void an invoice + * @description Void an invoice + * + * Only invoices that have been alread issued can be voided. + * + * Voiding an invoice will mark it as voided, the user can specify how to handle the voided line items. + */ + billingVoidInvoice: { + parameters: { + path: { + customerId: string + invoiceId: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['BillingVoidInvoiceInput'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingInvoice'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Create line items + * @description Create a new pending line item (charge). + * + * This call is used to create a new pending line item for the customer without explicitly + * assigning it to an invoice. + * + * The line item will be either allocated to an existing invoice in gathering state or a new invoice is + * created for the line item. + * + * A new invoice will be created if: + * - there is no invoice in gathering state + * - the currency of the line item doesn't match the currency of any invoices in gathering state + */ + billingCreateLineByCustomer: { + parameters: { + path: { + customerId: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['BillingCreateLinesRequest'] + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['BillingCreateLineResult'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description List all billing profiles */ + billingListProfiles: { + parameters: { + query?: { + includeArchived?: boolean + expand?: components['schemas']['BillingProfileExpand'][] + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + offset?: components['parameters']['LimitOffset.offset'] + limit?: components['parameters']['LimitOffset.limit'] + order?: components['parameters']['ProfileOrderByOrdering.order'] + orderBy?: components['parameters']['ProfileOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['ProfilePaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Create a new billing profile + * @description Create a new billing profile + * + * Billing profiles are representations of a customer's billing information. Customer overrides + * can be applied to a billing profile to customize the billing behavior for a specific customer. + */ + billingCreateProfile: { + requestBody: { + content: { + 'application/json': components['schemas']['BillingProfileCreateInput'] + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['BillingProfile'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Get a billing profile by ID + * @description Get a billing profile by ID + */ + billingGetProfile: { + parameters: { + query?: { + expand?: components['schemas']['BillingProfileExpand'][] + } + path: { + id: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingProfile'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Update a billing profile + * @description Update a billing profile + */ + billingUpdateProfile: { + parameters: { + path: { + id: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['BillingProfileCreateOrUpdate'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['BillingProfile'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Archive a billing profile + * @description Archive a billing profile + */ + billingArchiveProfile: { + parameters: { + path: { + id: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description List customers. */ + listCustomers: { + parameters: { + query?: { + order?: components['parameters']['CustomerOrderByOrdering.order'] + orderBy?: components['parameters']['CustomerOrderByOrdering.orderBy'] + includeDeleted?: components['parameters']['queryCustomerList.includeDeleted'] + name?: components['parameters']['queryCustomerList.name'] + primaryEmail?: components['parameters']['queryCustomerList.primaryEmail'] + subject?: components['parameters']['queryCustomerList.subject'] + page?: components['parameters']['PaginatedQuery.page'] + pageSize?: components['parameters']['PaginatedQuery.pageSize'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['CustomerList'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Create a new customer. */ + createCustomer: { + requestBody: { + content: { + 'application/json': components['schemas']['Customer'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Customer'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Get a customer by ID. */ + getCustomer: { + parameters: { + path: { + id: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Customer'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Update a customer by ID. */ + updateCustomer: { + parameters: { + path: { + id: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['Customer'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Customer'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Delete a customer by ID. */ + deleteCustomer: { + parameters: { + path: { + id: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Customer'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Get event metrics + * @description Returns debug metrics (in OpenMetrics format) like the number of ingested events since mindnight UTC. + * + * The OpenMetrics Counter(s) reset every day at midnight UTC. + */ + getDebugMetrics: { + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'text/plain': string + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List all entitlements + * @description List all entitlements for all the subjects and features. This endpoint is intended for administrative purposes only. + * To fetch the entitlements of a specific subject please use the /api/v1/subjects/{subjectKeyOrID}/entitlements endpoint. + * If page is provided that takes precedence and the paginated response is returned. + */ + listEntitlements: { + parameters: { + query?: { + /** + * @description Filtering by multiple features. + * + * Usage: `?feature=feature-1&feature=feature-2` + */ + feature?: string[] + /** + * @description Filtering by multiple subjects. + * + * Usage: `?subject=customer-1&subject=customer-2` + */ + subject?: string[] + /** + * @description Filtering by multiple entitlement types. + * + * Usage: `?entitlementType=metered&entitlementType=boolean` + */ + entitlementType?: components['schemas']['EntitlementType'][] + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + offset?: components['parameters']['LimitOffset.offset'] + limit?: components['parameters']['LimitOffset.limit'] + order?: components['parameters']['EntitlementOrderByOrdering.order'] + orderBy?: components['parameters']['EntitlementOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['ListEntitlementsResult'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Get entitlement by id. */ + getEntitlementById: { + parameters: { + path: { + entitlementId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Entitlement'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List ingested events + * @description List ingested events within a time range. + * + * If the from query param is not provided it defaults to last 72 hours. + */ + listEvents: { + parameters: { + query?: { + /** + * @description Start date-time in RFC 3339 format. + * + * Inclusive. + */ + ingestedAtFrom?: string + /** + * @description End date-time in RFC 3339 format. + * + * Inclusive. + */ + ingestedAtTo?: string + /** + * @description If not provided lists all events. + * + * If provided with true, only list events with processing error. + * + * If provided with false, only list events without processing error. + */ + hasError?: boolean + /** + * @description The event ID. + * + * Accepts partial ID. + */ + id?: string + /** + * @description The event subject. + * + * Accepts partial subject. + */ + subject?: string + /** + * @description Start date-time in RFC 3339 format. + * + * Inclusive. + */ + from?: string + /** + * @description End date-time in RFC 3339 format. + * + * Inclusive. + */ + to?: string + /** @description Number of events to return. */ + limit?: number + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['IngestedEvent'][] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Ingests an event or batch of events following the CloudEvents specification. */ + ingestEvents: { + requestBody: { + content: { + 'application/cloudevents+json': components['schemas']['Event'] + 'application/cloudevents-batch+json': components['schemas']['Event'][] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/cloudevents+json': components['schemas']['Event'] + 'application/cloudevents-batch+json': components['schemas']['Event'][] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description List features. */ + listFeatures: { + parameters: { + query?: { + /** @description Filter by meterSlug */ + meterSlug?: string[] + /** @description Filter by meterGroupByFilters */ + includeArchived?: boolean + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + offset?: components['parameters']['LimitOffset.offset'] + limit?: components['parameters']['LimitOffset.limit'] + order?: components['parameters']['FeatureOrderByOrdering.order'] + orderBy?: components['parameters']['FeatureOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['ListFeaturesResult'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * @description Features are either metered or static. A feature is metered if meterSlug is provided at creation. + * For metered features you can pass additional filters that will be applied when calculating feature usage, based on the meter's groupBy fields. + * Only meters with SUM and COUNT aggregation are supported for features. + * Features cannot be updated later, only archived. + */ + createFeature: { + requestBody: { + content: { + 'application/json': components['schemas']['FeatureCreateInputs'] + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['Feature'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Get a feature by ID. */ + getFeature: { + parameters: { + path: { + featureId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Feature'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * @description Archive a feature by ID. + * + * Once a feature is archived it cannot be unarchived. If a feature is archived, new entitlements cannot be created for it, but archiving the feature does not affect existing entitlements. + * This means, if you want to create a new feature with the same key, and then create entitlements for it, the previous entitlements have to be deleted first on a per subject basis. + */ + deleteFeature: { + parameters: { + path: { + featureId: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * @description List all grants for all the subjects and entitlements. This endpoint is intended for administrative purposes only. + * To fetch the grants of a specific entitlement please use the /api/v1/subjects/{subjectKeyOrID}/entitlements/{entitlementOrFeatureID}/grants endpoint. + * If page is provided that takes precedence and the paginated response is returned. + */ + listGrants: { + parameters: { + query?: { + /** + * @description Filtering by multiple features. + * + * Usage: `?feature=feature-1&feature=feature-2` + */ + feature?: string[] + /** + * @description Filtering by multiple subjects. + * + * Usage: `?subject=customer-1&subject=customer-2` + */ + subject?: string[] + /** @description Include deleted */ + includeDeleted?: boolean + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + offset?: components['parameters']['LimitOffset.offset'] + limit?: components['parameters']['LimitOffset.limit'] + order?: components['parameters']['GrantOrderByOrdering.order'] + orderBy?: components['parameters']['GrantOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': + | components['schemas']['EntitlementGrant'][] + | components['schemas']['GrantPaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * @description Voiding a grant means it is no longer valid, it doesn't take part in further balance calculations. Voiding a grant does not retroactively take effect, meaning any usage that has already been attributed to the grant will remain, but future usage cannot be burnt down from the grant. + * For example, if you have a single grant for your metered entitlement with an initial amount of 100, and so far 60 usage has been metered, the grant (and the entitlement itself) would have a balance of 40. If you then void that grant, balance becomes 0, but the 60 previous usage will not be affected. + */ + voidGrant: { + parameters: { + path: { + grantId: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + 409: { + content: { + 'application/problem+json': components['schemas']['ConflictProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Create checkout session. */ + createStripeCheckoutSession: { + requestBody: { + content: { + 'application/json': components['schemas']['CreateStripeCheckoutSessionRequest'] + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['CreateStripeCheckoutSessionResult'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description List available apps of the app marketplace. */ + listMarketplaceListings: { + parameters: { + query?: { + page?: components['parameters']['PaginatedQuery.page'] + pageSize?: components['parameters']['PaginatedQuery.pageSize'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['MarketplaceListingList'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Get a marketplace listing by type. */ + getMarketplaceListing: { + parameters: { + path: { + type: components['schemas']['AppType'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['MarketplaceListing'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Install an marketplace via API Key. */ + marketplaceAppAPIKeyInstall: { + parameters: { + path: { + type: components['parameters']['MarketplaceApiKeyInstallRequest.type'] + } + } + requestBody: { + content: { + 'application/json': { + /** + * @description The API key for the provider. + * For example, the Stripe API key. + */ + apiKey: string + /** + * @description Name of the application to install. + * + * If not set defaults to the marketplace item's description. + */ + name?: string + } + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['AppBase'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * @description Install an app via OAuth. + * Returns a URL to start the OAuth 2.0 flow. + */ + marketplaceOAuth2InstallGetURL: { + parameters: { + path: { + type: components['schemas']['AppType'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['ClientAppStartResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * @description Authorize OAuth2 code. + * Verifies the OAuth code and exchanges it for a token and refresh token + */ + marketplaceOAuth2InstallAuthorize: { + parameters: { + query?: { + state?: components['parameters']['OAuth2AuthorizationCodeGrantSuccessParams.state'] + code?: components['parameters']['OAuth2AuthorizationCodeGrantSuccessParams.code'] + error?: components['parameters']['OAuth2AuthorizationCodeGrantErrorParams.error'] + error_description?: components['parameters']['OAuth2AuthorizationCodeGrantErrorParams.error_description'] + error_uri?: components['parameters']['OAuth2AuthorizationCodeGrantErrorParams.error_uri'] + } + path: { + type: components['parameters']['MarketplaceOAuth2InstallAuthorizeRequest.type'] + } + } + responses: { + /** @description Redirection */ + 303: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description List meters. */ + listMeters: { + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Meter'][] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Get a meter by ID or slug. */ + getMeter: { + parameters: { + path: { + meterIdOrSlug: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Meter'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Query meter for usage. Query meter for usage. */ + queryMeter: { + parameters: { + query?: { + from?: components['parameters']['MeterQuery.from'] + to?: components['parameters']['MeterQuery.to'] + windowSize?: components['parameters']['MeterQuery.windowSize'] + windowTimeZone?: components['parameters']['MeterQuery.windowTimeZone'] + subject?: components['parameters']['MeterQuery.subject'] + filterGroupBy?: components['parameters']['MeterQuery.filterGroupBy'] + groupBy?: components['parameters']['MeterQuery.groupBy'] + } + path: { + meterIdOrSlug: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['MeterQueryResult'] + 'text/csv': string + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description List subjects for a meter. */ + listMeterSubjects: { + parameters: { + path: { + meterIdOrSlug: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': string[] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List notification channels + * @description List all notification channels. + */ + listNotificationChannels: { + parameters: { + query?: { + /** + * @description Include deleted notification channels in response. + * + * Usage: `?includeDeleted=true` + */ + includeDeleted?: boolean + /** + * @description Include disabled notification channels in response. + * + * Usage: `?includeDisabled=false` + */ + includeDisabled?: boolean + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + order?: components['parameters']['NotificationChannelOrderByOrdering.order'] + orderBy?: components['parameters']['NotificationChannelOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['NotificationChannelPaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Create a notification channel + * @description Create a new notification channel. + */ + createNotificationChannel: { + requestBody: { + content: { + 'application/json': components['schemas']['NotificationChannelCreateRequest'] + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['NotificationChannel'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Get notification channel + * @description Get a notification channel by id. + */ + getNotificationChannel: { + parameters: { + path: { + channelId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['NotificationChannel'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Update a notification channel + * @description Update notification channel. + */ + updateNotificationChannel: { + parameters: { + path: { + channelId: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['NotificationChannelCreateRequest'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['NotificationChannel'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Delete a notification channel + * @description Soft delete notification channel by id. + * + * Once a notification channel is deleted it cannot be undeleted. + */ + deleteNotificationChannel: { + parameters: { + path: { + channelId: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List notification events + * @description List all notification events. + */ + listNotificationEvents: { + parameters: { + query?: { + /** + * @description Start date-time in RFC 3339 format. + * Inclusive. + */ + from?: string + /** + * @description End date-time in RFC 3339 format. + * Inclusive. + */ + to?: string + /** + * @description Filtering by multiple feature ids or keys. + * + * Usage: `?feature=feature-1&feature=feature-2` + */ + feature?: string[] + /** + * @description Filtering by multiple subject ids or keys. + * + * Usage: `?subject=subject-1&subject=subject-2` + */ + subject?: string[] + /** + * @description Filtering by multiple rule ids. + * + * Usage: `?rule=01J8J2XYZ2N5WBYK09EDZFBSZM&rule=01J8J4R4VZH180KRKQ63NB2VA5` + */ + rule?: string[] + /** + * @description Filtering by multiple channel ids. + * + * Usage: `?channel=01J8J4RXH778XB056JS088PCYT&channel=01J8J4S1R1G9EVN62RG23A9M6J` + */ + channel?: string[] + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + order?: components['parameters']['NotificationEventOrderByOrdering.order'] + orderBy?: components['parameters']['NotificationEventOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['NotificationEventPaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Get notification event + * @description Get a notification event by id. + */ + getNotificationEvent: { + parameters: { + path: { + eventId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['NotificationEvent'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List notification rules + * @description List all notification rules. + */ + listNotificationRules: { + parameters: { + query?: { + /** + * @description Include deleted notification rules in response. + * + * Usage: `?includeDeleted=true` + */ + includeDeleted?: boolean + /** + * @description Include disabled notification rules in response. + * + * Usage: `?includeDisabled=false` + */ + includeDisabled?: boolean + /** + * @description Filtering by multiple feature ids/keys. + * + * Usage: `?feature=feature-1&feature=feature-2` + */ + feature?: string[] + /** + * @description Filtering by multiple notifiaction channel ids. + * + * Usage: `?channel=01ARZ3NDEKTSV4RRFFQ69G5FAV&channel=01J8J2Y5X4NNGQS32CF81W95E3` + */ + channel?: string[] + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + order?: components['parameters']['NotificationRuleOrderByOrdering.order'] + orderBy?: components['parameters']['NotificationRuleOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['NotificationRulePaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Create a notification rule + * @description Create a new notification rule. + */ + createNotificationRule: { + requestBody: { + content: { + 'application/json': components['schemas']['NotificationRuleCreateRequest'] + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['NotificationRule'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Get notification rule + * @description Get a notification rule by id. + */ + getNotificationRule: { + parameters: { + path: { + ruleId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['NotificationRule'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Update a notification rule + * @description Update notification rule. + */ + updateNotificationRule: { + parameters: { + path: { + ruleId: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['NotificationRuleCreateRequest'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['NotificationRule'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Delete a notification rule + * @description Soft delete notification rule by id. + * + * Once a notification rule is deleted it cannot be undeleted. + */ + deleteNotificationRule: { + parameters: { + path: { + ruleId: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** @description Test a notification rule by sending a test event with random data. */ + testNotificationRule: { + parameters: { + path: { + ruleId: string + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['NotificationEvent'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Receive Svix operational events + * @description Callback endpoint used by Svix to notify about operational events. + */ + receiveSvixOperationalEvent: { + requestBody: { + content: { + 'application/json': components['schemas']['SvixOperationalWebhookRequest'] + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List plans + * @description List all plans. + */ + listPlans: { + parameters: { + query?: { + /** + * @description Include deleted plans in response. + * + * Usage: `?includeDeleted=true` + */ + includeDeleted?: boolean + /** @description Filter by plan.id attribute */ + id?: string[] + /** @description Filter by plan.key attribute */ + key?: string[] + /** @description Filter by plan.key and plan.version attributes */ + keyVersion?: { + [key: string]: number + } + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + order?: components['parameters']['PlanOrderByOrdering.order'] + orderBy?: components['parameters']['PlanOrderByOrdering.orderBy'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['PlanPaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } } - parameters: { - /** @description The page number. */ - 'PaginatedQuery.page'?: number - /** @description The number of items in the page. */ - 'PaginatedQuery.pageSize'?: number - /** @description Include deleted customers. */ - queryCustomerList?: boolean - /** @description A unique identifier for the meter. */ - meterIdOrSlug: components['schemas']['IdOrSlug'] - /** @description A unique identifier for a subject. */ - subjectIdOrKey: string - /** @description A unique ULID identifier for a feature. */ - featureId: string - /** @description A unique identifier for a grant. */ - grantId: string - /** @description A unique ULID for an entitlement. */ - entitlementId: string - /** @description The id of the entitlement or the key of the feature. */ - entitlementIdOrFeatureKey: string - /** @description Include deleted entries. */ - includeDeleted?: boolean - /** @description Page number to return */ - queryPage?: number - /** @description Number of entries to return per page */ - queryPageSize?: number - /** @description Number of entries to return */ - queryLimit?: number - /** @description Number of entries to skip */ - queryOffset?: number - /** - * @description Start date-time in RFC 3339 format. - * Inclusive. - */ - queryFrom?: string - /** - * @description End date-time in RFC 3339 format. - * Inclusive. - */ - queryTo?: string - /** @description If not specified, a single usage aggregate will be returned for the entirety of the specified period for each subject and group. */ - queryWindowSize?: components['schemas']['WindowSize'] - /** - * @description The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). - * If not specified, the UTC timezone will be used. - */ - queryWindowTimeZone?: string - /** - * @description Filtering by multiple subjects. - * - * Usage: `?subject=customer-1&subject=customer-2` - */ - queryFilterSubject?: string[] - /** - * @description Filtering by multiple features. - * - * Usage: `?feature=feature-1&feature=feature-2` - */ - queryFilterFeature?: string[] - /** - * @description Filtering by multiple meterSlug. - * - * Usage: `?meterSlug=meter-1&meterSlug=meter-2` - */ - queryFilterMeterSlug?: string[] - /** - * @description Filtering by multiple entitlement types. - * - * Usage: `?entitlementType=metered&entitlementType=static` - */ - queryFilterEntitlementType?: string[] - /** - * @description Filtering by multiple notification channels. - * - * Usage: `?channel=channel-1&channel=channel-2` - */ - queryFilterChannel?: string[] - queryFilterGroupBy?: { - [key: string]: string + /** + * Create a plan + * @description Create a new plan. + */ + createPlan: { + requestBody: { + content: { + 'application/json': components['schemas']['PlanCreate'] + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['Plan'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } } - /** - * @description If not specified a single aggregate will be returned for each subject and time window. - * `subject` is a reserved group by value. - */ - queryGroupBy?: string[] - /** @description A unique ULID identifier for a notification channel. */ - channelId: string - /** @description A unique ULID identifier for a notification rule. */ - ruleId: string - /** @description A unique ULID identifier for a notification event. */ - eventId: string - /** @description Include disabled entries. */ - queryIncludeDisabled?: boolean - /** - * @description Order by field. - * - * Usage: `?order=ASC` - */ - order?: 'ASC' | 'DESC' } - requestBodies: never - headers: never - pathItems: never -} - -export type $defs = Record - -export type external = Record - -export interface operations { - /** @description List customers. */ - listCustomers: { + /** + * New draft plan + * @description Create a new draft version from plan. + * It returns error if there is already a plan in draft or planId does not reference the latest published version. + */ + newDraftPlan: { + parameters: { + path: { + planIdOrKey: string + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['Plan'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Get plan + * @description Get a plan by id or key. The latest published version is returned if latter is used. + */ + getPlan: { + parameters: { + path: { + planId: string + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Plan'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Update a plan + * @description Update plan by id. + */ + updatePlan: { + parameters: { + path: { + planId: string + } + } + requestBody: { + content: { + 'application/json': components['schemas']['PlanUpdate'] + } + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['Plan'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * Delete plan + * @description Soft delete plan by plan.id. + * + * Once a plan is deleted it cannot be undeleted. + */ + deletePlan: { + parameters: { + path: { + planId: string + } + } + responses: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } + } + } + /** + * List phases in plan + * @description List all phases in plan. + */ + listPlanPhases: { parameters: { query?: { - includeDeleted?: components['parameters']['queryCustomerList'] - page?: components['parameters']['PaginatedQuery.page'] - pageSize?: components['parameters']['PaginatedQuery.pageSize'] + /** @description Filter by phase.key attribute */ + key?: string[] + page?: components['parameters']['Pagination.page'] + pageSize?: components['parameters']['Pagination.pageSize'] + order?: components['parameters']['PhasesOrderByOrdering.order'] + orderBy?: components['parameters']['PhasesOrderByOrdering.orderBy'] + } + path: { + planId: string } } responses: { /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['CustomerList'][] + 'application/json': components['schemas']['PlanPhasePaginatedResponse'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** @description Create a new customer. */ - createCustomer: { + /** + * Create new phase in plan + * @description Create new phase in plan. + */ + createPlanPhases: { + parameters: { + path: { + planId: string + } + } requestBody: { content: { - 'application/json': components['schemas']['Customer'] + 'application/json': components['schemas']['PlanPhaseCreate'] } } responses: { - /** @description The request has succeeded. */ - 200: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { content: { - 'application/json': components['schemas']['Customer'] + 'application/json': components['schemas']['PlanPhase'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** @description Get a customer by ID or key. */ - getCustomer: { + /** + * Get phase for plan + * @description Get phase in plan. + */ + getPlanPhases: { parameters: { path: { - customerIdOrKey: components['schemas']['CustomerIdentifier'] + planId: string + planPhaseKey: string } } responses: { /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['Customer'] + 'application/json': components['schemas']['PlanPhase'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** @description Update a customer by ID or key. */ - updateCustomer: { + /** + * Update phase in plan + * @description Update phase in plan. + */ + updatePlanPhases: { parameters: { path: { - customerIdOrKey: components['schemas']['CustomerIdentifier'] + planId: string + planPhaseKey: string } } requestBody: { content: { - 'application/json': components['schemas']['Customer'] + 'application/json': components['schemas']['PlanPhaseUpdate'] } } responses: { /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['Customer'] + 'application/json': components['schemas']['PlanPhase'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** @description Delete a customer by ID or key. */ - deleteCustomer: { - parameters: { - path: { - customerIdOrKey: components['schemas']['CustomerIdentifier'] + /** @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: { + content: { + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] + } } - } - responses: { - /** @description The request has succeeded. */ - 200: { + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { content: { - 'application/json': components['schemas']['Customer'] + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * List ingested events - * @description List ingested events within a time range. - * If the from query param is not provided it defaults to last 72 hours. - */ - listEvents: { - parameters: { - query?: { - from?: components['parameters']['queryFrom'] - to?: components['parameters']['queryTo'] - /** - * @description Start date-time in RFC 3339 format. - * Inclusive. - */ - ingestedAtFrom?: string - /** - * @description End date-time in RFC 3339 format. - * Inclusive. - */ - ingestedAtTo?: string - /** - * @description If not provided lists all events. - * If provided with true, only list events with processing error. - * If provided with false, only list events without processing error. - */ - hasError?: boolean - /** - * @description The event ID. - * Accepts partial ID. - */ - id?: string - /** @description The event subject. Full match. */ - subject?: string - /** @description Number of events to return */ - limit?: number + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } } - } - responses: { - /** @description List of events for debugging. */ - 200: { + /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */ + 404: { content: { - 'application/json': components['schemas']['IngestedEvent'][] + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } /** - * Ingest events - * @description Ingests an event or batch of events following the CloudEvents specification. + * Delete phase for plan + * @description Delete phase in plan. + * + * Once a phase is deleted it cannot be undeleted. */ - ingestEvents: { - /** - * @description The event or batch of events to ingest. - * The request body must be a CloudEvents JSON object or an array of CloudEvents JSON objects. - * The CloudEvents JSON object must adhere to the CloudEvents Specification JSON Schema. - */ - requestBody: { - content: { - 'application/cloudevents+json': components['schemas']['Event'] - 'application/cloudevents-batch+json': components['schemas']['Event'][] + deletePlanPhases: { + parameters: { + path: { + planId: string + planPhaseKey: string } } responses: { - /** @description Successfully ingested. */ + /** @description There is no content to send for this request, but the headers may be useful. */ 204: { content: never } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * List meters - * @description List meters. - */ - listMeters: { - responses: { - /** @description List of meters. */ - 200: { + /** @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: { content: { - 'application/json': components['schemas']['Meter'][] + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * ☁ Create meter - * @description *Available in OpenMeter Cloud.* - * *In the open-source version, meters are created in the configuration file.* - * - * Create a meter. - */ - createMeter: { - /** @description The meter to create. */ - requestBody: { - content: { - 'application/json': components['schemas']['Meter'] + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } } - } - responses: { - /** @description Created. */ - 201: { + /** @description The server understood the request but refuses to authorize it. */ + 403: { content: { - 'application/json': components['schemas']['Meter'] + '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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } /** - * Get meter - * @description Get meter by ID or slug + * Publish plan + * @description Publish a new plan. */ - getMeter: { + publishPlan: { parameters: { path: { - meterIdOrSlug: components['parameters']['meterIdOrSlug'] + planId: string } } responses: { - /** @description Meter found. */ - 200: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { content: { - 'application/json': components['schemas']['Meter'] + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] + } + } + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } /** - * ☁ Delete meter - * @description *Available in OpenMeter Cloud.* - * - * Delete a meter by ID or slug. + * Unpublish plan + * @description Unpublish a new plan. */ - deleteMeter: { + unpublishPlan: { parameters: { path: { - meterIdOrSlug: components['parameters']['meterIdOrSlug'] + planId: string } } responses: { - /** @description Meter deleted. */ + /** @description There is no content to send for this request, but the headers may be useful. */ 204: { content: never } - 404: components['responses']['NotFoundProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } } } - /** - * Query meter - * @description Query meter for usage. - */ - queryMeter: { + /** @description Query meter for consumer portal. This endpoint is publicly exposable to consumers. Query meter for consumer portal. This endpoint is publicly exposable to consumers. */ + queryPortalMeter: { parameters: { query?: { - from?: components['parameters']['queryFrom'] - to?: components['parameters']['queryTo'] - windowSize?: components['parameters']['queryWindowSize'] - windowTimeZone?: components['parameters']['queryWindowTimeZone'] - subject?: components['parameters']['queryFilterSubject'] - filterGroupBy?: components['parameters']['queryFilterGroupBy'] - groupBy?: components['parameters']['queryGroupBy'] + from?: components['parameters']['MeterQuery.from'] + to?: components['parameters']['MeterQuery.to'] + windowSize?: components['parameters']['MeterQuery.windowSize'] + windowTimeZone?: components['parameters']['MeterQuery.windowTimeZone'] + filterGroupBy?: components['parameters']['MeterQuery.filterGroupBy'] + groupBy?: components['parameters']['MeterQuery.groupBy'] } path: { - meterIdOrSlug: components['parameters']['meterIdOrSlug'] + meterSlug: string } } responses: { - /** @description Usage data. */ + /** @description The request has succeeded. */ 200: { content: { 'application/json': components['schemas']['MeterQueryResult'] 'text/csv': string } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * List meter subjects - * @description List subjects for a meter. - */ - listMeterSubjects: { - parameters: { - path: { - meterIdOrSlug: components['parameters']['meterIdOrSlug'] + /** @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: { + content: { + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] + } } - } - responses: { - /** @description List of subjects. */ - 200: { + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { content: { - 'application/json': string[] + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** - * ☁ List portal tokens - * @description *Available in OpenMeter Cloud.* - * - * List consumer portal tokens. - */ + /** @description List tokens. */ listPortalTokens: { parameters: { query?: { - /** @description Number of portal tokens to return. Default is 25. */ limit?: number } - } - responses: { - /** @description List of portal tokens. */ - 200: { + } + responses: { + /** @description The request has succeeded. */ + 200: { + content: { + 'application/json': components['schemas']['PortalToken'][] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { content: { - 'application/json': components['schemas']['PortalToken'][] + '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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** - * Create portal token - * @description Create a consumer portal token. - */ + /** @description Create a consumer portal token. */ createPortalToken: { - /** @description The portal token to create. */ requestBody: { content: { - /** - * @example { - * "subject": "customer-id", - * "allowedMeterSlugs": [ - * "tokens_total" - * ] - * } - */ 'application/json': components['schemas']['PortalToken'] } } responses: { - /** @description Created. */ + /** @description The request has succeeded. */ 200: { content: { 'application/json': components['schemas']['PortalToken'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * ☁ Invalidate portal tokens - * @description *Available in OpenMeter Cloud.* - * - * Invalidates consumer portal tokens by ID or subject. - */ - invalidatePortalTokens: { - /** @description If no id or subject is specified, all tokens will be invalidated. */ - requestBody: { - content: { - 'application/json': { - /** @description Invalidate a portal token by ID. */ - id?: string - /** @description Invalidate all portal tokens for a subject. */ - subject?: string + /** @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: { + content: { + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] } } - } - responses: { - /** @description Portal tokens invalidated. */ - 204: { - content: never - } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * ☁ List subjects - * @description *Available in OpenMeter Cloud.* - * - * List subjects. - */ - listSubjects: { - responses: { - /** @description List of subjects. */ - 200: { + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { content: { - 'application/json': components['schemas']['Subject'][] + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * ☁ Upsert subject - * @description *Available in OpenMeter Cloud.* - * - * Upserts a subject. Creates or updates subject. - * If the subject doesn't exist, it will be created. - * If the subject exists, it will be partially updated with the provided fields. - */ - upsertSubject: { - /** @description The subject to upsert. */ - requestBody: { - content: { - 'application/json': components['schemas']['Subject'][] - } - } - responses: { - /** @description Subject upserted. */ - 200: { + /** @description The server understood the request but refuses to authorize it. */ + 403: { content: { - 'application/json': components['schemas']['Subject'][] + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * ☁ Get subject - * @description *Available in OpenMeter Cloud.* - * - * Get subject by ID or key. - */ - getSubject: { - parameters: { - path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] - } - } - responses: { - /** @description Subject found. */ - 200: { + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { content: { - 'application/json': components['schemas']['Subject'] + 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * ☁ Delete subject - * @description *Available in OpenMeter Cloud.* - * - * Delete a subject by ID or key. - */ - deleteSubject: { - parameters: { - path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] + /** @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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } } - } - responses: { - /** @description Subject deleted. */ - 204: { - content: never + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** - * Query portal meter - * @description Query meter for consumer portal. This endpoint is publicly exposable to consumers. - */ - queryPortalMeter: { + /** @description List all entitlements for a subject. For checking entitlement access, use the /value endpoint instead. */ + listSubjectEntitlements: { parameters: { query?: { - from?: components['parameters']['queryFrom'] - to?: components['parameters']['queryTo'] - windowSize?: components['parameters']['queryWindowSize'] - windowTimeZone?: components['parameters']['queryWindowTimeZone'] - filterGroupBy?: components['parameters']['queryFilterGroupBy'] - groupBy?: components['parameters']['queryGroupBy'] + includeDeleted?: boolean } path: { - /** @description A unique identifier for the meter. */ - meterSlug: string + subjectIdOrKey: string } } responses: { - /** @description Usage data. */ + /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['MeterQueryResult'] - 'text/csv': string + 'application/json': components['schemas']['Entitlement'][] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * List entitlements - * @description List all entitlements regardless of subject. This endpoint is intended for administrative purposes. - * If page is provided that takes precedence and the paginated response is returned. - */ - listEntitlements: { - parameters: { - query?: { - page?: components['parameters']['queryPage'] - pageSize?: components['parameters']['queryPageSize'] - limit?: components['parameters']['queryLimit'] - offset?: components['parameters']['queryOffset'] - subject?: components['parameters']['queryFilterSubject'] - feature?: components['parameters']['queryFilterFeature'] - entitlementType?: components['parameters']['queryFilterEntitlementType'] - order?: components['parameters']['order'] - /** @description Order by field */ - orderBy?: 'createdAt' | 'updatedAt' + /** @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: { + content: { + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] + } } - } - responses: { - /** @description List of entitlements. If page is provided that takes precedence and the paginated response is returned. */ - 200: { + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { content: { - 'application/json': components['schemas']['ListEntitlementResponse'] + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Get an entitlement - * @description Get entitlement by id. - */ - getEntitlementById: { - parameters: { - path: { - entitlementId: components['parameters']['entitlementId'] + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } } - } - responses: { - /** @description Entitlement found. */ - 200: { + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { content: { - 'application/json': { - type: 'json' - } & Omit & { - /** - * Format: date-time - * @description The last time usage was reset. - * @example 2023-01-01T00:00:00Z - */ - lastReset?: string - } + 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * List features - * @description List all features. If page is provided that takes precedence and the paginated response is returned. - */ - listFeatures: { - parameters: { - query?: { - page?: components['parameters']['queryPage'] - pageSize?: components['parameters']['queryPageSize'] - limit?: components['parameters']['queryLimit'] - offset?: components['parameters']['queryOffset'] - meterSlug?: components['parameters']['queryFilterMeterSlug'] - order?: components['parameters']['order'] - /** @description Order by field */ - orderBy?: 'id' | 'createdAt' | 'updatedAt' - /** @description Include archived features. */ - includeArchived?: boolean + /** @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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } } - } - responses: { - /** @description List of features. If page is provided that takes precedence and the paginated response is returned. */ - 200: { + /** @description An unexpected error response. */ + default: { content: { - 'application/json': components['schemas']['ListFeatureResponse'] + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } /** - * Create a feature - * @description Features are either metered or static. A feature is metered if meterSlug is provided at creation. - * For metered features you can pass additional filters that will be applied when calculating feature usage, based on the meter's groupBy fields. Only meters with SUM and COUNT aggregation are supported for features. + * Create an entitlement + * @description OpenMeter has three types of entitlements: metered, boolean, and static. The type property determines the type of entitlement. The underlying feature has to be compatible with the entitlement type specified in the request (e.g., a metered entitlement needs a feature associated with a meter). * - * Features cannot be updated later, only archived. + * - Boolean entitlements define static feature access, e.g. "Can use SSO authentication". + * - Static entitlements let you pass along a configuration while granting access, e.g. "Using this feature with X Y settings" (passed in the config). + * - Metered entitlements have many use cases, from setting up usage-based access to implementing complex credit systems. Example: The customer can use 10000 AI tokens during the usage period of the entitlement. + * + * A given subject can only have one active (non-deleted) entitlement per featureKey. If you try to create a new entitlement for a featureKey that already has an active entitlement, the request will fail with a 409 error. + * + * Once an entitlement is created you cannot modify it, only delete it. */ - createFeature: { - /** @description The feature to create. */ + createEntitlement: { + parameters: { + path: { + subjectIdOrKey: string + } + } requestBody: { content: { - 'application/json': components['schemas']['FeatureCreateInputs'] + 'application/json': components['schemas']['EntitlementCreateInputs'] } } responses: { - /** @description Feature created. */ + /** @description The request has succeeded and a new resource has been created as a result. */ 201: { content: { - 'application/json': components['schemas']['Feature'] + 'application/json': components['schemas']['Entitlement'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Get feature - * @description Get a feature by id. - */ - getFeature: { - parameters: { - path: { - featureId: components['parameters']['featureId'] - } - } - responses: { - /** @description Feature found. */ - 200: { + /** @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: { content: { - 'application/json': components['schemas']['Feature'] + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Archive a feature - * @description Once a feature is archived it cannot be unarchived. If a feature is archived, new entitlements cannot be created for it, but archiving the feature does not affect existing entitlements. This means, if you want to create a new feature with the same key, and then create entitlements for it, the previous entitlements have to be deleted first on a per subject basis. - */ - deleteFeature: { - parameters: { - path: { - featureId: components['parameters']['featureId'] + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } } - } - responses: { - /** @description Feature deleted. */ - 204: { - content: never + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * List grants - * @description List all grants for all the subjects and entitlements. This endpoint is intended for administrative purposes only. To fetch the grants of a specific entitlement please use the /api/v1/subjects/{subjectKeyOrID}/entitlements/{entitlementOrFeatureID}/grants endpoint. - * - * If page is provided that takes precedence and the paginated response is returned. - */ - listGrants: { - parameters: { - query?: { - page?: components['parameters']['queryPage'] - pageSize?: components['parameters']['queryPageSize'] - limit?: components['parameters']['queryLimit'] - offset?: components['parameters']['queryOffset'] - subject?: components['parameters']['queryFilterSubject'] - feature?: components['parameters']['queryFilterFeature'] - order?: components['parameters']['order'] - /** @description Order by field */ - orderBy?: 'id' | 'createdAt' | 'updatedAt' - includeDeleted?: components['parameters']['includeDeleted'] + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + 409: { + content: { + 'application/problem+json': components['schemas']['ConflictProblemResponse'] + } } - } - responses: { - /** @description List of grants. If page is provided that takes precedence and the paginated response is returned. */ - 200: { + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { content: { - 'application/json': components['schemas']['ListEntitlementGrantResponse'] + 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Void a grant - * @description Voiding a grant means it is no longer valid, it doesn't take part in further balance calculations. Voiding a grant does not retroactively take effect, meaning any usage that has already been attributed to the grant will remain, but future usage cannot be burnt down from the grant. - * - * For example, if you have a single grant for your metered entitlement with an initial amount of 100, and so far 60 usage has been metered, the grant (and the entitlement itself) would have a balance of 40. If you then void that grant, balance becomes 0, but the 60 previous usage will not be affected. - */ - voidGrant: { - parameters: { - path: { - grantId: components['parameters']['grantId'] + /** @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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } } - } - responses: { - /** @description Grant has been voided. */ - 204: { - content: never + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - 409: components['responses']['ConflictProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** - * List entitlements of a subject - * @description List all entitlements for a subject. For checking entitlement access, use the /value endpoint instead. - */ - listSubjectEntitlements: { + /** @description List all grants issued for an entitlement. The entitlement can be defined either by its id or featureKey. */ + listEntitlementGrants: { parameters: { query?: { - includeDeleted?: components['parameters']['includeDeleted'] + includeDeleted?: boolean + orderBy?: components['schemas']['GrantOrderBy'] } path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] + subjectIdOrKey: string + entitlementIdOrFeatureKey: string } } responses: { - /** @description List of entitlements. */ + /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['Entitlement'][] + 'application/json': components['schemas']['EntitlementGrant'][] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } /** - * Create an entitlement - * @description OpenMeter has three types of entitlements: metered, boolean, and static. The type property determines the type of entitlement. The underlying feature has to be compatible with the entitlement type specified in the request (e.g., a metered entitlement needs a feature associated with a meter). + * @description Grants define a behavior of granting usage for a metered entitlement. They can have complicated recurrence and rollover rules, thanks to which you can define a wide range of access patterns with a single grant, in most cases you don't have to periodically create new grants. You can only issue grants for active metered entitlements. * - * - Boolean entitlements define static feature access, e.g. "Can use SSO authentication". - * - Static entitlements let you pass along a configuration while granting access, e.g. "Using this feature with X Y settings" (passed in the config). - * - Metered entitlements have many use cases, from setting up usage-based access to implementing complex credit systems. Example: The customer can use 10000 AI tokens during the usage period of the entitlement. + * A grant defines a given amount of usage that can be consumed for the entitlement. The grant is in effect between its effective date and its expiration date. Specifying both is mandatory for new grants. * - * A given subject can only have one active (non-deleted) entitlement per featureKey. If you try to create a new entitlement for a featureKey that already has an active entitlement, the request will fail with a 409 error. + * Grants have a priority setting that determines their order of use. Lower numbers have higher priority, with 0 being the highest priority. * - * Once an entitlement is created you cannot modify it, only delete it. + * Grants can have a recurrence setting intended to automate the manual reissuing of grants. For example, a daily recurrence is equal to reissuing that same grant every day (ignoring rollover settings). + * + * Rollover settings define what happens to the remaining balance of a grant at a reset. Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) + * + * Grants cannot be changed once created, only deleted. This is to ensure that balance is deterministic regardless of when it is queried. */ - createEntitlement: { + createGrant: { parameters: { path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] + subjectIdOrKey: string + entitlementIdOrFeatureKey: string } } - /** @description The entitlement to create. */ requestBody: { content: { - 'application/json': components['schemas']['EntitlementCreateInputs'] + 'application/json': components['schemas']['EntitlementGrantCreateInput'] + } + } + responses: { + /** @description The request has succeeded and a new resource has been created as a result. */ + 201: { + content: { + 'application/json': components['schemas']['EntitlementGrant'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } } - } - responses: { - /** @description Entitlement created. */ - 201: { + /** @description The server understood the request but refuses to authorize it. */ + 403: { content: { - 'application/json': components['schemas']['Entitlement'] + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 409: components['responses']['ConflictProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Get an entitlement - * @description Get entitlement by id. For checking entitlement access, use the /value endpoint instead. - */ - getEntitlement: { - parameters: { - path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] - entitlementId: components['parameters']['entitlementId'] + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + 409: { + content: { + 'application/problem+json': components['schemas']['ConflictProblemResponse'] + } } - } - responses: { - /** @description Entitlement found. */ - 200: { + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { content: { - 'application/json': { - type: 'json' - } & Omit & { - /** - * Format: date-time - * @description The last time usage was reset. - * @example 2023-01-01T00:00:00Z - */ - lastReset?: string - } + 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Delete an entitlement - * @description Deleting an entitlement revokes access to the associated feature. As a single subject can only have one entitlement per featureKey, when "migrating" features you have to delete the old entitlements as well. - * As access and status checks can be historical queries, deleting an entitlement populates the deletedAt timestamp. When queried for a time before that, the entitlement is still considered active, you cannot have retroactive changes to access, which is important for, among other things, auditing. - */ - deleteEntitlement: { - parameters: { - path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] - entitlementId: components['parameters']['entitlementId'] + /** @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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } } - } - responses: { - /** @description Entitlement deleted. */ - 204: { - content: never + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } /** - * Override an entitlement * @description Overriding an entitlement creates a new entitlement from the provided inputs and soft deletes the previous entitlement for the provided subject-feature pair. If the previous entitlement is already deleted or otherwise doesnt exist, the override will fail. * * This endpoint is useful for upgrades, downgrades, or other changes to entitlements that require a new entitlement to be created with zero downtime. @@ -3023,130 +11757,258 @@ export interface operations { overrideEntitlement: { parameters: { path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] - entitlementIdOrFeatureKey: components['parameters']['entitlementIdOrFeatureKey'] + subjectIdOrKey: string + entitlementIdOrFeatureKey: string } } - /** @description The entitlement to create. */ requestBody: { content: { 'application/json': components['schemas']['EntitlementCreateInputs'] } } responses: { - /** @description Entitlement created. */ + /** @description The request has succeeded and a new resource has been created as a result. */ 201: { content: { 'application/json': components['schemas']['Entitlement'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - 409: components['responses']['ConflictProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + 409: { + content: { + 'application/problem+json': components['schemas']['ConflictProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } } } /** - * List grants for an entitlement - * @description List all grants issued for an entitlement. The entitlement can be defined either by its id or featureKey. + * @description This endpoint should be used for access checks and enforcement. All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type. + * + * For convenience reasons, /value works with both entitlementId and featureKey. */ - listEntitlementGrants: { + getEntitlementValue: { parameters: { query?: { - includeDeleted?: components['parameters']['includeDeleted'] - /** @description Order by field */ - orderBy?: 'id' | 'createdAt' | 'updatedAt' + time?: string } path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] - entitlementIdOrFeatureKey: components['parameters']['entitlementIdOrFeatureKey'] + subjectIdOrKey: string + entitlementIdOrFeatureKey: string } } responses: { - /** @description List of grants. */ + /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['EntitlementGrant'][] + 'application/json': components['schemas']['EntitlementValue'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** - * Create a grant - * @description Grants define a behavior of granting usage for a metered entitlement. They can have complicated recurrence and rollover rules, thanks to which you can define a wide range of access patterns with a single grant, in most cases you don't have to periodically create new grants. You can only issue grants for active metered entitlements. - * - * A grant defines a given amount of usage that can be consumed for the entitlement. The grant is in effect between its effective date and its expiration date. Specifying both is mandatory for new grants. - * - * Grants have a priority setting that determines their order of use. Lower numbers have higher priority, with 0 being the highest priority. - * - * Grants can have a recurrence setting intended to automate the manual reissuing of grants. For example, a daily recurrence is equal to reissuing that same grant every day (ignoring rollover settings). - * - * Rollover settings define what happens to the remaining balance of a grant at a reset. Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount)) - * - * Grants cannot be changed once created, only deleted. This is to ensure that balance is deterministic regardless of when it is queried. - */ - createGrant: { + /** @description Get entitlement by id. For checking entitlement access, use the /value endpoint instead. */ + getEntitlement: { parameters: { path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] - entitlementIdOrFeatureKey: components['parameters']['entitlementIdOrFeatureKey'] - } - } - /** @description The grant to create. */ - requestBody: { - content: { - 'application/json': components['schemas']['EntitlementGrantCreateInput'] + subjectIdOrKey: string + entitlementId: string } } responses: { - /** @description Grant created. */ - 201: { + /** @description The request has succeeded. */ + 200: { content: { - 'application/json': components['schemas']['EntitlementGrant'] + 'application/json': components['schemas']['Entitlement'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } /** - * Get the current value and access of an entitlement - * @description This endpoint should be used for access checks and enforcement. All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type. - * - * For convenience reasons, /value works with both entitlementId and featureKey. + * @description Deleting an entitlement revokes access to the associated feature. As a single subject can only have one entitlement per featureKey, when "migrating" features you have to delete the old entitlements as well. + * As access and status checks can be historical queries, deleting an entitlement populates the deletedAt timestamp. When queried for a time before that, the entitlement is still considered active, you cannot have retroactive changes to access, which is important for, among other things, auditing. */ - getEntitlementValue: { + deleteEntitlement: { parameters: { - query?: { - /** @description Point of time to check value: date-time in RFC 3339 format. Defaults to now. */ - time?: string - } path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] - entitlementIdOrFeatureKey: components['parameters']['entitlementIdOrFeatureKey'] + subjectIdOrKey: string + entitlementId: string } } responses: { - /** @description The entitlement value. */ - 200: { + /** @description There is no content to send for this request, but the headers may be useful. */ + 204: { + content: never + } + /** @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: { content: { - 'application/json': components['schemas']['EntitlementValue'] + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] + } + } + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } /** - * Get the balance history of a specific entitlement. * @description Returns historical balance and usage data for the entitlement. The queried history can span accross multiple reset events. * * BurndownHistory returns a continous history of segments, where the segments are seperated by events that changed either the grant burndown priority or the usage period. @@ -3156,41 +12018,75 @@ export interface operations { getEntitlementHistory: { parameters: { query: { - /** - * @description Start of time range to query entitlement: date-time in RFC 3339 format. Defaults to - * the last reset. - * Gets truncated to the granularity of the underlying meter. - */ + /** @description Start of time range to query entitlement: date-time in RFC 3339 format. Defaults to the last reset. Gets truncated to the granularity of the underlying meter. */ from?: string /** * @description End of time range to query entitlement: date-time in RFC 3339 format. Defaults to now. * If not now then gets truncated to the granularity of the underlying meter. */ to?: string - /** @description Size of the time window to group the history by. Cannot be shorter than meter granularity. */ - windowSize: 'MINUTE' | 'HOUR' | 'DAY' - windowTimeZone?: components['parameters']['queryWindowTimeZone'] + /** @description Windowsize */ + windowSize: components['schemas']['WindowSize'] + /** @description The timezone used when calculating the windows. */ + windowTimeZone?: string } path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] - entitlementId: components['parameters']['entitlementId'] + subjectIdOrKey: string + entitlementId: string } } responses: { - /** @description The history response. */ + /** @description The request has succeeded. */ 200: { content: { 'application/json': components['schemas']['WindowedBalanceHistory'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } } } /** - * Reset an entitlement * @description Reset marks the start of a new usage period for the entitlement and initiates grant rollover. At the start of a period usage is zerod out and grants are rolled over based on their rollover settings. It would typically be synced with the subjects billing period to enforce usage based on their subscription. * * Usage is automatically reset for metered entitlements based on their usage period, but this endpoint allows to manually reset it at any time. When doing so the period anchor of the entitlement can be changed if needed. @@ -3198,417 +12094,478 @@ export interface operations { resetEntitlementUsage: { parameters: { path: { - subjectIdOrKey: components['parameters']['subjectIdOrKey'] - entitlementId: components['parameters']['entitlementId'] + subjectIdOrKey: string + entitlementId: string } } requestBody: { content: { - 'application/json': { - /** - * Format: date-time - * @description The time at which the reset takes effect, defaults to now. The reset cannot be in the future. The provided value is truncated to the minute due to how historical meter data is stored. - * - * @example 2023-01-01T00:00:00Z - */ - effectiveAt?: string - /** - * @description Determines whether the usage period anchor is retained or reset to the effectiveAt time. - * - If true, the usage period anchor is retained. - * - If false, the usage period anchor is reset to the effectiveAt time. - */ - retainAnchor?: boolean - /** - * @description Determines whether the overage is preserved or forgiven, overriding the entitlement's default behavior. - * - If true, the overage is preserved. - * - If false, the overage is forgiven. - */ - preserveOverage?: boolean - } + 'application/json': components['schemas']['ResetEntitlementUsageInput'] } } responses: { - /** @description Entitlement reset. */ + /** @description There is no content to send for this request, but the headers may be useful. */ 204: { content: never } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } + } } } - /** - * Get event metrics - * @description Returns debug metrics like the number of ingested events since mindnight UTC. - * The OpenMetrics Counter(s) reset every day at midnight UTC. - */ - getDebugMetrics: { + Subscriptions_create: { + requestBody: { + content: { + 'application/json': components['schemas']['CreateSubscriptionRequestBody'] + } + } responses: { - /** @description Dbeug metrics, like number of ingested events. */ + /** @description The request has succeeded. */ 200: { content: { - 'text/plain': string + 'application/json': components['schemas']['Subscription'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } + } + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + 409: { + content: { + 'application/problem+json': components['schemas']['ConflictProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** - * List notification channels - * @description List all notification channels. - */ - listNotificationChannels: { + getSubscription_getSubscription: { parameters: { query?: { - page?: components['parameters']['queryPage'] - pageSize?: components['parameters']['queryPageSize'] - /** @description Order by field */ - orderBy?: 'id' | 'type' | 'createdAt' | 'updatedAt' - order?: components['parameters']['order'] - includeDisabled?: components['parameters']['queryIncludeDisabled'] - includeDeleted?: components['parameters']['includeDeleted'] + expand?: false | true + /** @description The time at which the subscription should be queried. If not provided the current time is used. */ + at?: string + } + path: { + subscriptionId: string } } responses: { - /** @description List of notification channels. */ + /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['NotificationChannelsResponse'] + 'application/json': + | components['schemas']['Subscription'] + | components['schemas']['SubscriptionExpanded'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Create a notification channel - * @description Create a new notification channel. - */ - createNotificationChannel: { - /** @description The notification channel to create. */ - requestBody: { - content: { - 'application/json': components['schemas']['NotificationChannelCreateRequest'] + /** @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: { + content: { + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] + } } - } - responses: { - /** @description Notification channel created. */ - 201: { + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { content: { - 'application/json': components['schemas']['NotificationChannel'] + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 409: components['responses']['ConflictProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Get notification channel - * @description Get a notification channel by id. - */ - getNotificationChannel: { - parameters: { - path: { - channelId: components['parameters']['channelId'] + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } } - } - responses: { - /** @description Notification channel found. */ - 200: { + /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */ + 404: { content: { - 'application/json': components['schemas']['NotificationChannel'] + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } /** - * Update notification channel - * @description Update a notification channel by id. + * @description Batch processing commands for manipulating running subscriptions. + * The key format is `/phases/{phaseKey}` or `/phases/{phaseKey}/items/{itemKey}`. + * + * Add operations insert a new member based on the creation input without altering the existing members. + * + * Remove operations remove the member from the collection / document. + * + * The extend operation extends the specific phase if possible, while delaying all subsequent phases by the same amount. */ - updateNotificationChannel: { + editSubscription: { parameters: { path: { - channelId: components['parameters']['channelId'] + subscriptionId: string } } - /** @description The notification channel to update. */ requestBody: { content: { - 'application/json': components['schemas']['NotificationChannelCreateRequest'] + 'application/json': ( + | components['schemas']['SubscriptionEditAddUpdateItem'] + | components['schemas']['SubscriptionEditRemoveUpdateItem'] + | components['schemas']['SubscriptionEditAdd'] + | components['schemas']['SubscriptionEditExtend'] + | components['schemas']['SubscriptionEditRemoveWithValue'] + )[] } } responses: { - /** @description Notification channel updated. */ + /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['NotificationChannel'] + 'application/json': components['schemas']['Subscription'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Delete a notification channel - * @description Delete notification channel by id. - */ - deleteNotificationChannel: { - parameters: { - path: { - channelId: components['parameters']['channelId'] + /** @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: { + content: { + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] + } } - } - responses: { - /** @description Notification channel deleted. */ - 204: { - content: never + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * List notification rules - * @description List all notification rules. - */ - listNotificationRules: { - parameters: { - query?: { - page?: components['parameters']['queryPage'] - pageSize?: components['parameters']['queryPageSize'] - /** @description Order by field */ - orderBy?: 'id' | 'type' | 'createdAt' | 'updatedAt' - order?: components['parameters']['order'] - includeDisabled?: components['parameters']['queryIncludeDisabled'] - includeDeleted?: components['parameters']['includeDeleted'] - feature?: components['parameters']['queryFilterFeature'] - channel?: components['parameters']['queryFilterChannel'] + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } } - } - responses: { - /** @description List of notification rules. */ - 200: { + /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */ + 404: { content: { - 'application/json': components['schemas']['NotificationRulesResponse'] + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Create a notification rule - * @description Create a new notification rule. - */ - createNotificationRule: { - /** @description The notification rule to create. */ - requestBody: { - content: { - 'application/json': components['schemas']['NotificationRuleCreateRequest'] + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + 409: { + content: { + 'application/problem+json': components['schemas']['ConflictProblemResponse'] + } } - } - responses: { - /** @description Notification rule created. */ - 201: { + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { content: { - 'application/json': components['schemas']['NotificationRule'] + '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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 409: components['responses']['ConflictProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** - * Get notification rule - * @description Get a notification rule by id. - */ - getNotificationRule: { + /** @description Cancels the subscription. */ + cancelSubscription: { parameters: { path: { - ruleId: components['parameters']['ruleId'] + subscriptionId: string + } + } + requestBody: { + content: { + 'application/json': { + /** + * Format: date-time + * @description If not provided the subscription is canceled immediately. + * @example "2023-01-01T01:01:01.001Z" + */ + effectiveDate?: string + } } } responses: { - /** @description Rule found. */ + /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['NotificationRule'] + 'application/json': components['schemas']['Subscription'] + } + } + /** @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: { + 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: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + 409: { + content: { + 'application/problem+json': components['schemas']['ConflictProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** - * Update a notification rule - * @description Update a notification rule by id. - */ - updateNotificationRule: { + /** @description Migrates the subscripiton to the procided version of the plan. */ + migrateSubscription: { parameters: { path: { - ruleId: components['parameters']['ruleId'] + subscriptionId: string } } - /** @description The notification rule to update. */ requestBody: { content: { - 'application/json': components['schemas']['NotificationRuleCreateRequest'] + 'application/json': { + targetVersion: number + } } } responses: { - /** @description Notification Rule updated. */ + /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['NotificationRule'] + 'application/json': components['schemas']['Subscription'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Delete a notification rule - * @description Delete notification rule by id. - */ - deleteNotificationRule: { - parameters: { - path: { - ruleId: components['parameters']['ruleId'] + /** @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: { + content: { + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] + } } - } - responses: { - /** @description Notification rule deleted. */ - 204: { - content: never + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Test notification rule - * @description Test a notification rule by sending a test event with random data. - */ - testNotificationRule: { - parameters: { - path: { - ruleId: components['parameters']['ruleId'] + /** @description The server understood the request but refuses to authorize it. */ + 403: { + content: { + 'application/problem+json': components['schemas']['ForbiddenProblemResponse'] + } } - } - responses: { - /** @description Test notification event sent. */ - 201: { + /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */ + 404: { content: { - 'application/json': components['schemas']['NotificationEvent'] + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 409: components['responses']['ConflictProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * List notification evens - * @description List all notification events. - */ - listNotificationEvents: { - parameters: { - query?: { - page?: components['parameters']['queryPage'] - pageSize?: components['parameters']['queryPageSize'] - /** @description Order by field */ - orderBy?: 'id' | 'createdAt' - order?: components['parameters']['order'] - from?: components['parameters']['queryFrom'] - to?: components['parameters']['queryTo'] - feature?: components['parameters']['queryFilterFeature'] - subject?: components['parameters']['queryFilterSubject'] - /** - * @description Filtering by multiple rules. - * - * Usage: `?rule=ID1&rule=rule=ID2` - */ - rule?: string[] - /** - * @description Filtering by multiple channels. - * - * Usage: `?channel=ID1&channel=ID2` - */ - channel?: string[] + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + 409: { + content: { + 'application/problem+json': components['schemas']['ConflictProblemResponse'] + } } - } - responses: { - /** @description List of notification events. */ - 200: { + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { content: { - 'application/json': components['schemas']['NotificationEventsResponse'] + '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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } - /** - * Get notification event - * @description Get a notification event by id. - */ - getNotificationEvent: { + /** @description Cancels the scheduled cancelation. */ + unscheduleCancelation: { parameters: { path: { - eventId: components['parameters']['eventId'] + subscriptionId: string } } responses: { - /** @description Notification event found. */ + /** @description The request has succeeded. */ 200: { content: { - 'application/json': components['schemas']['NotificationEvent'] + 'application/json': components['schemas']['Subscription'] } } - 401: components['responses']['UnauthorizedProblemResponse'] - 404: components['responses']['NotFoundProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] - } - } - /** - * Receive Svix operational events - * @description Callback endpoint used by Svix to notify about operational events - */ - receiveSvixOperationalEvent: { - /** @description The operational event. */ - requestBody: { - content: { - 'application/json': components['schemas']['SvixOperationalWebhookRequest'] + /** @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: { + content: { + 'application/problem+json': components['schemas']['BadRequestProblemResponse'] + } } - } - responses: { - /** @description Operational webhook request accepted */ - 204: { - content: never + /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */ + 401: { + content: { + 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'] + } + } + /** @description The server understood the request but refuses to authorize it. */ + 403: { + 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: { + content: { + 'application/problem+json': components['schemas']['NotFoundProblemResponse'] + } + } + /** @description The request could not be completed due to a conflict with the current state of the target resource. */ + 409: { + content: { + 'application/problem+json': components['schemas']['ConflictProblemResponse'] + } + } + /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */ + 500: { + 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: { + content: { + 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'] + } + } + /** @description An unexpected error response. */ + default: { + content: { + 'application/problem+json': components['schemas']['UnexpectedProblemResponse'] + } } - 400: components['responses']['BadRequestProblemResponse'] - 401: components['responses']['UnauthorizedProblemResponse'] - 501: components['responses']['NotImplementedProblemResponse'] - default: components['responses']['UnexpectedProblemResponse'] } } } diff --git a/api/client/node/test/mocks.ts b/api/client/node/test/mocks.ts index ebfa93639..8f20b0466 100644 --- a/api/client/node/test/mocks.ts +++ b/api/client/node/test/mocks.ts @@ -25,6 +25,7 @@ export const mockEvent: Event = { } export const mockMeter: Meter = { + id: 'meter-1', slug: 'm1', aggregation: 'SUM', eventType: 'api_requests',