Skip to content

Commit f7f3d35

Browse files
authored
feat(api): update v3 spec (#4640)
1 parent afec0f5 commit f7f3d35

20 files changed

Lines changed: 1714 additions & 1022 deletions

api/spec/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ generate: ## Generate OpenAPI spec
1919
new_op="$${op/-addon/-product-catalog-addon}"; \
2020
OLD_OP="$$op" NEW_OP="$$new_op" yq -i '(.paths[][] | select(.operationId == strenv(OLD_OP)) | .operationId) = strenv(NEW_OP)' "$$FILE"; \
2121
done
22+
# Strip Go codegen vendor extensions from the v3 MeteringAndBilling output
23+
@FILE="packages/aip/output/definitions/metering-and-billing/v3/openapi.MeteringAndBilling.yaml"; \
24+
yq -i 'del(.. | select(has("x-go-type"))["x-go-type"], .. | select(has("x-go-type-import"))["x-go-type-import"])' "$$FILE"
2225
pnpm --filter @openmeter/api-spec-aip exec openapi bundle output/definitions/metering-and-billing/v3/openapi.OpenMeter.yaml -o ../../../v3/openapi.yaml
2326
cp packages/legacy/output/openapi.OpenMeter.yaml ../openapi.yaml
2427
cp packages/legacy/output/openapi.OpenMeterCloud.yaml ../openapi.cloud.yaml

api/spec/packages/aip/src/customers/charges/operations.tsp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ namespace Charges {
4141
* usage-based charges.
4242
*/
4343
@extension(Shared.UnstableExtension, true)
44-
@extension(Shared.InternalExtension, true)
4544
@get
4645
@operationId("list-customer-charges")
4746
@summary("List customer charges")
@@ -89,7 +88,6 @@ namespace Charges {
8988
* Create customer charge.
9089
*/
9190
@extension(Shared.UnstableExtension, true)
92-
@extension(Shared.InternalExtension, true)
9391
@post
9492
@operationId("create-customer-charges")
9593
@summary("Create customer charge")

api/spec/packages/aip/src/customers/credits/operations.tsp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ namespace Credits.Grants {
4343
* credits to a customer.
4444
*/
4545
@extension(Shared.UnstableExtension, true)
46-
@extension(Shared.InternalExtension, true)
4746
@post
4847
@operationId("create-credit-grant")
4948
@summary("Create a new credit grant")
@@ -60,7 +59,6 @@ namespace Credits.Grants {
6059
* Get a credit grant.
6160
*/
6261
@extension(Shared.UnstableExtension, true)
63-
@extension(Shared.InternalExtension, true)
6462
@get
6563
@operationId("get-credit-grant")
6664
@summary("Get a credit grant")
@@ -73,7 +71,6 @@ namespace Credits.Grants {
7371
* List credit grants.
7472
*/
7573
@extension(Shared.UnstableExtension, true)
76-
@extension(Shared.InternalExtension, true)
7774
@get
7875
@operationId("list-credit-grants")
7976
@summary("List credit grants")
@@ -133,7 +130,6 @@ namespace Credits.Grants {
133130
* the system so that revenue recognition and credit availability work as expected.
134131
*/
135132
@extension(Shared.UnstableExtension, true)
136-
@extension(Shared.InternalExtension, true)
137133
@post
138134
@operationId("update-credit-grant-external-settlement")
139135
@summary("Update credit grant external settlement status")
@@ -171,7 +167,6 @@ namespace Credits.Balance {
171167
* Get a credit balance.
172168
*/
173169
@extension(Shared.UnstableExtension, true)
174-
@extension(Shared.InternalExtension, true)
175170
@get
176171
@operationId("get-customer-credit-balance")
177172
@summary("Get a customer's credit balance")
@@ -230,7 +225,6 @@ namespace Credits.Transactions {
230225
* by default.
231226
*/
232227
@extension(Shared.UnstableExtension, true)
233-
@extension(Shared.InternalExtension, true)
234228
@get
235229
@operationId("list-credit-transactions")
236230
@summary("List credit transactions")
@@ -261,7 +255,6 @@ namespace Credits.Adjustments {
261255
* - Usage correction
262256
*/
263257
@extension(Shared.UnstableExtension, true)
264-
@extension(Shared.InternalExtension, true)
265258
@post
266259
@operationId("create-credit-adjustment")
267260
@summary("Create a credit adjustment")

api/spec/packages/aip/src/defaults/operations.tsp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ interface OrganizationDefaultTaxCodesOperations {
1616
@operationId("get-organization-default-tax-codes")
1717
@summary("Get organization default tax codes")
1818
@extension(Shared.UnstableExtension, true)
19-
@extension(Shared.InternalExtension, true)
2019
get():
2120
| Shared.GetResponse<OrganizationDefaultTaxCodes>
2221
| Common.NotFound
@@ -26,7 +25,6 @@ interface OrganizationDefaultTaxCodesOperations {
2625
@operationId("update-organization-default-tax-codes")
2726
@summary("Update organization default tax codes")
2827
@extension(Shared.UnstableExtension, true)
29-
@extension(Shared.InternalExtension, true)
3028
update(@body body: Shared.UpdateRequest<OrganizationDefaultTaxCodes>):
3129
| Shared.UpsertResponse<OrganizationDefaultTaxCodes>
3230
| Common.NotFound

api/spec/packages/aip/src/tax/operations.tsp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ interface TaxCodesOperations {
1717
@post
1818
@operationId("create-tax-code")
1919
@summary("Create tax code")
20-
@extension(Shared.InternalExtension, true)
2120
@extension(Shared.UnstableExtension, true)
2221
create(
2322
@body
@@ -27,7 +26,6 @@ interface TaxCodesOperations {
2726
@get
2827
@operationId("get-tax-code")
2928
@summary("Get tax code")
30-
@extension(Shared.InternalExtension, true)
3129
@extension(Shared.UnstableExtension, true)
3230
get(@path taxCodeId: Shared.ULID):
3331
| Shared.GetResponse<TaxCode>
@@ -37,7 +35,6 @@ interface TaxCodesOperations {
3735
@get
3836
@operationId("list-tax-codes")
3937
@summary("List tax codes")
40-
@extension(Shared.InternalExtension, true)
4138
@extension(Shared.UnstableExtension, true)
4239
list(
4340
...Common.PagePaginationQuery,
@@ -52,7 +49,6 @@ interface TaxCodesOperations {
5249
@put
5350
@operationId("upsert-tax-code")
5451
@summary("Upsert tax code")
55-
@extension(Shared.InternalExtension, true)
5652
@extension(Shared.UnstableExtension, true)
5753
upsert(
5854
@path taxCodeId: Shared.ULID,
@@ -68,7 +64,6 @@ interface TaxCodesOperations {
6864
@delete
6965
@operationId("delete-tax-code")
7066
@summary("Delete tax code")
71-
@extension(Shared.InternalExtension, true)
7267
@extension(Shared.UnstableExtension, true)
7368
delete(@path taxCodeId: Shared.ULID):
7469
| Shared.DeleteResponse

api/spec/packages/legacy/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@typespec/openapi3": "1.11.0",
2929
"@typespec/prettier-plugin-typespec": "1.12.0",
3030
"@typespec/rest": "0.81.0",
31+
"@typespec/streams": "0.81.0",
3132
"@typespec/versioning": "0.81.0"
3233
},
3334
"private": true,

api/spec/patches/@typespec__openapi3@1.11.0.patch

Lines changed: 850 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)