From 977f2e1577f9e66d35ad13062068232623e9c5f0 Mon Sep 17 00:00:00 2001 From: Andras Toth <4157749+tothandras@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:26:16 -0700 Subject: [PATCH] chore(api): update typespec prettier config --- api/spec/.prettierrc.json | 2 +- api/spec/lib/rules/casing.js | 5 +++- api/spec/lib/rules/docs.js | 15 ++++++++--- api/spec/lib/rules/friendlyName.js | 15 ++++++++--- api/spec/src/app/marketplace.tsp | 4 ++- api/spec/src/app/stripe.tsp | 5 +++- api/spec/src/billing/invoices.tsp | 11 ++++++-- api/spec/src/billing/profile.tsp | 4 ++- api/spec/src/cloud/main.tsp | 16 ++++++++---- api/spec/src/cloud/subjects.tsp | 8 ++++-- api/spec/src/customer.tsp | 13 +++++++--- api/spec/src/entitlements/entitlements.tsp | 29 ++++++++++++++++++---- api/spec/src/entitlements/feature.tsp | 4 ++- api/spec/src/entitlements/subjects.tsp | 22 +++++++++++++--- api/spec/src/events.tsp | 10 ++++++-- api/spec/src/meters.tsp | 4 ++- api/spec/src/notification/channel.tsp | 9 +++++-- api/spec/src/notification/event.tsp | 4 ++- api/spec/src/notification/rule.tsp | 4 ++- api/spec/src/portal.tsp | 10 ++++++-- api/spec/src/productcatalog/ratecards.tsp | 23 ++++++++++++++--- api/spec/src/productcatalog/routes.tsp | 14 ++++++++--- api/spec/src/types.tsp | 10 ++++++-- 23 files changed, 190 insertions(+), 51 deletions(-) diff --git a/api/spec/.prettierrc.json b/api/spec/.prettierrc.json index 6e61bbe42..f184d4132 100644 --- a/api/spec/.prettierrc.json +++ b/api/spec/.prettierrc.json @@ -2,7 +2,7 @@ "arrowParens": "always", "bracketSameLine": false, "tabWidth": 2, - "printWidth": 120, + "printWidth": 80, "semi": false, "singleQuote": true, "trailingComma": "all", diff --git a/api/spec/lib/rules/casing.js b/api/spec/lib/rules/casing.js index 9a1ea0111..940876938 100644 --- a/api/spec/lib/rules/casing.js +++ b/api/spec/lib/rules/casing.js @@ -21,7 +21,10 @@ export const casingRule = createRule({ }, enum: (node) => { for (const variant of node.members.values()) { - if (typeof variant.name === 'string' && !isSnakeCase(variant.value || variant.name)) { + if ( + typeof variant.name === 'string' && + !isSnakeCase(variant.value || variant.name) + ) { context.reportDiagnostic({ target: variant, format: { diff --git a/api/spec/lib/rules/docs.js b/api/spec/lib/rules/docs.js index 57f14abca..0b886116a 100644 --- a/api/spec/lib/rules/docs.js +++ b/api/spec/lib/rules/docs.js @@ -9,7 +9,10 @@ export const docDecoratorRule = createRule({ }, create: (context) => ({ model: (target) => { - if (target.name && !target.decorators.find((d) => d.decorator?.name === '$docFromComment')) { + if ( + target.name && + !target.decorators.find((d) => d.decorator?.name === '$docFromComment') + ) { context.reportDiagnostic({ target, format: { @@ -19,7 +22,10 @@ export const docDecoratorRule = createRule({ } }, enum: (target) => { - if (target.name && !target.decorators.find((d) => d.decorator?.name === '$docFromComment')) { + if ( + target.name && + !target.decorators.find((d) => d.decorator?.name === '$docFromComment') + ) { context.reportDiagnostic({ target, format: { @@ -29,7 +35,10 @@ export const docDecoratorRule = createRule({ } }, union: (target) => { - if (target.name && !target.decorators.find((d) => d.decorator?.name === '$docFromComment')) { + if ( + target.name && + !target.decorators.find((d) => d.decorator?.name === '$docFromComment') + ) { context.reportDiagnostic({ target, format: { diff --git a/api/spec/lib/rules/friendlyName.js b/api/spec/lib/rules/friendlyName.js index 92d25ac2c..a3b2b9a2e 100644 --- a/api/spec/lib/rules/friendlyName.js +++ b/api/spec/lib/rules/friendlyName.js @@ -9,7 +9,10 @@ export const friendlyNameRule = createRule({ }, create: (context) => ({ model: (node) => { - if (node.name && !node.decorators.some((d) => d.decorator.name === '$friendlyName')) { + if ( + node.name && + !node.decorators.some((d) => d.decorator.name === '$friendlyName') + ) { context.reportDiagnostic({ format: { type: node.kind, @@ -21,7 +24,10 @@ export const friendlyNameRule = createRule({ } }, enum: (node) => { - if (node.name && !node.decorators.some((d) => d.decorator.name === '$friendlyName')) { + if ( + node.name && + !node.decorators.some((d) => d.decorator.name === '$friendlyName') + ) { context.reportDiagnostic({ format: { type: node.kind, @@ -33,7 +39,10 @@ export const friendlyNameRule = createRule({ } }, union: (node) => { - if (node.name && !node.decorators.some((d) => d.decorator.name === '$friendlyName')) { + if ( + node.name && + !node.decorators.some((d) => d.decorator.name === '$friendlyName') + ) { context.reportDiagnostic({ format: { type: node.kind, diff --git a/api/spec/src/app/marketplace.tsp b/api/spec/src/app/marketplace.tsp index da404f3cb..70d4b0542 100644 --- a/api/spec/src/app/marketplace.tsp +++ b/api/spec/src/app/marketplace.tsp @@ -43,7 +43,9 @@ interface Marketplace { @get @route("/listings/{type}/install/oauth2") @operationId("marketplaceOAuth2InstallGetURL") - getOAuth2InstallURL(@path type: Type): OAuth2.ClientAppStartResponse | CommonErrors; + getOAuth2InstallURL( + @path type: Type, + ): OAuth2.ClientAppStartResponse | CommonErrors; /** * Authorize OAuth2 code. diff --git a/api/spec/src/app/stripe.tsp b/api/spec/src/app/stripe.tsp index b4cb5b924..88b2a8563 100644 --- a/api/spec/src/app/stripe.tsp +++ b/api/spec/src/app/stripe.tsp @@ -28,7 +28,10 @@ interface AppStripe { @post @route("/api/v1/apps/{id}/stripe/webhook") @operationId("appStripeWebhook") - webhook(@path id: ULID, @body body: StripeWebhookEvent): StripeWebhookResponse | NotFoundError | CommonErrors; + webhook( + @path id: ULID, + @body body: StripeWebhookEvent, + ): StripeWebhookResponse | NotFoundError | CommonErrors; /** * Create checkout session. diff --git a/api/spec/src/billing/invoices.tsp b/api/spec/src/billing/invoices.tsp index 76d605ffc..d47dcc891 100644 --- a/api/spec/src/billing/invoices.tsp +++ b/api/spec/src/billing/invoices.tsp @@ -89,7 +89,10 @@ interface CustomerInvoicesEndpoints { @route("/items") @summary("Create a new pending item") @operationId("billingCreatePendingItemByCustomer") - createPendingItem(@path customerIdOrKey: ULIDOrKey, @body request: Invoices.InvoiceLine): { + createPendingItem( + @path customerIdOrKey: ULIDOrKey, + @body request: Invoices.InvoiceLine, + ): { @statusCode _: 201; @body body: CreatePendingItemResponse; } | OpenMeter.CommonErrors; @@ -239,7 +242,11 @@ interface CustomerInvoiceEndpoints { @route("/lines/{lineId}") @summary("Delete an invoice line") @operationId("billingDeleteInvoiceLine") - deleteInvoiceLine(@path customerIdOrKey: ULIDOrKey, @path invoiceId: ULID, @path lineId: ULID): { + deleteInvoiceLine( + @path customerIdOrKey: ULIDOrKey, + @path invoiceId: ULID, + @path lineId: ULID, + ): { @statusCode _: 204; } | OpenMeter.NotFoundError | OpenMeter.CommonErrors; diff --git a/api/spec/src/billing/profile.tsp b/api/spec/src/billing/profile.tsp index ab23f7e15..604836ac9 100644 --- a/api/spec/src/billing/profile.tsp +++ b/api/spec/src/billing/profile.tsp @@ -52,7 +52,9 @@ interface Profiles { @get @summary("Get a billing profile by ID") @operationId("billingGetProfile") - get(@path id: string): Profile | OpenMeter.NotFoundError | OpenMeter.CommonErrors; + get( + @path id: string, + ): Profile | OpenMeter.NotFoundError | OpenMeter.CommonErrors; /** * Update a billing profile diff --git a/api/spec/src/cloud/main.tsp b/api/spec/src/cloud/main.tsp index 9604e9721..32ba48598 100644 --- a/api/spec/src/cloud/main.tsp +++ b/api/spec/src/cloud/main.tsp @@ -53,7 +53,9 @@ interface Meters extends OpenMeter.Meters { */ @delete @operationId("deleteMeter") - delete(@path meterIdOrSlug: OpenMeter.MeterIdentifier): void | OpenMeter.CommonErrors; + delete( + @path meterIdOrSlug: OpenMeter.MeterIdentifier, + ): void | OpenMeter.CommonErrors; } namespace OpenMeterCloud.Portal { @@ -129,7 +131,8 @@ namespace OpenMeterCloud.Notification { @route("/api/v1/notification/webhook/svix") @tag("Notification (Experimental)") - interface SvixOperationalWebhooks extends OpenMeter.Notification.SvixOperationalWebhooks {} + interface SvixOperationalWebhooks + extends OpenMeter.Notification.SvixOperationalWebhooks {} } namespace OpenMeterCloud.Entitlements { @@ -169,11 +172,13 @@ namespace OpenMeterCloud.Billing { @route("/api/v1/billing/invoices/{customerIdOrKey}") @tag("Billing (Experimental)") - interface CustomerInvoicesEndpoints extends OpenMeter.Billing.CustomerInvoicesEndpoints {} + interface CustomerInvoicesEndpoints + extends OpenMeter.Billing.CustomerInvoicesEndpoints {} @route("/api/v1/billing/invoices/{customerIdOrKey}/invoices/{invoiceId}") @tag("Billing (Experimental)") - interface CustomerInvoiceEndpoints extends OpenMeter.Billing.CustomerInvoiceEndpoints {} + interface CustomerInvoiceEndpoints + extends OpenMeter.Billing.CustomerInvoiceEndpoints {} } namespace OpenMeterCloud.ProductCatalog { @@ -191,7 +196,8 @@ namespace OpenMeterCloud.ProductCatalog { @route("/api/v1/plans/{planId}/next") @tag("Plan (Experimental)") - interface PlanNewDraftVersion extends OpenMeter.ProductCatalog.PlanNewDraftVersion {} + interface PlanNewDraftVersion + extends OpenMeter.ProductCatalog.PlanNewDraftVersion {} @route("/api/v1/plans/{planId}/phases") @tag("Plan (Experimental)") diff --git a/api/spec/src/cloud/subjects.tsp b/api/spec/src/cloud/subjects.tsp index ca03da3b4..c5623a516 100644 --- a/api/spec/src/cloud/subjects.tsp +++ b/api/spec/src/cloud/subjects.tsp @@ -23,7 +23,9 @@ interface Subjects { */ @get @operationId("getSubject") - get(@path subjectIdOrKey: string): OpenMeter.Subject | OpenMeter.NotFoundError | OpenMeter.CommonErrors; + get( + @path subjectIdOrKey: string, + ): OpenMeter.Subject | OpenMeter.NotFoundError | OpenMeter.CommonErrors; /** * Upserts a subject. Creates or updates subject. @@ -33,7 +35,9 @@ interface Subjects { */ @post @operationId("upsertSubject") - upsert(@body subject: SubjectUpsert[]): OpenMeter.Subject[] | OpenMeter.CommonErrors; + upsert( + @body subject: SubjectUpsert[], + ): OpenMeter.Subject[] | OpenMeter.CommonErrors; /** * Delete subject by ID or key. diff --git a/api/spec/src/customer.tsp b/api/spec/src/customer.tsp index 498b98748..416f28274 100644 --- a/api/spec/src/customer.tsp +++ b/api/spec/src/customer.tsp @@ -37,7 +37,9 @@ interface Customers { @get @route("/{customerIdOrKey}") @operationId("getCustomer") - get(@path customerIdOrKey: CustomerIdentifier): Customer | NotFoundError | CommonErrors; + get( + @path customerIdOrKey: CustomerIdentifier, + ): Customer | NotFoundError | CommonErrors; /** * Update a customer by ID or key. @@ -45,7 +47,10 @@ interface Customers { @put @route("/{customerIdOrKey}") @operationId("updateCustomer") - update(@path customerIdOrKey: CustomerIdentifier, @body customer: Customer): Customer | NotFoundError | CommonErrors; + update( + @path customerIdOrKey: CustomerIdentifier, + @body customer: Customer, + ): Customer | NotFoundError | CommonErrors; /** * Delete a customer by ID or key. @@ -53,7 +58,9 @@ interface Customers { @delete @route("/{customerIdOrKey}") @operationId("deleteCustomer") - delete(@path customerIdOrKey: CustomerIdentifier): Customer | NotFoundError | CommonErrors; + delete( + @path customerIdOrKey: CustomerIdentifier, + ): Customer | NotFoundError | CommonErrors; } /** diff --git a/api/spec/src/entitlements/entitlements.tsp b/api/spec/src/entitlements/entitlements.tsp index 8c46e8568..792a945fb 100644 --- a/api/spec/src/entitlements/entitlements.tsp +++ b/api/spec/src/entitlements/entitlements.tsp @@ -224,7 +224,10 @@ union EntitlementCreateInputs { @friendlyName("EntitlementBaseTemplate") model EntitlementSharedFields { ...ResourceTimestamps; - ...OmitProperties; + ...OmitProperties< + EntitlementCreateSharedFields, + "featureKey" | "featureId" | "usagePeriod" + >; /** * Readonly unique ULID identifier. @@ -308,9 +311,19 @@ model EntitlementMetered { type: EntitlementType.metered; ...OmitProperties< EntitlementMeteredCreateInputs, - "type" | "measureUsageFrom" | "metadata" | "usagePeriod" | "featureKey" | "featureId" | "currentUsagePeriod" + + | "type" + | "measureUsageFrom" + | "metadata" + | "usagePeriod" + | "featureKey" + | "featureId" + | "currentUsagePeriod" + >; + ...OmitProperties< + EntitlementSharedFields, + "type" | "currentUsagePeriod" | "usagePeriod" >; - ...OmitProperties; ...EntitlementMeteredCalculatedFields; } @@ -320,7 +333,10 @@ model EntitlementMetered { @friendlyName("EntitlementBoolean") model EntitlementBoolean extends EntitlementSharedFields { type: EntitlementType.boolean; - ...OmitProperties; + ...OmitProperties< + EntitlementBooleanCreateInputs, + "type" | "metadata" | "usagePeriod" | "featureKey" | "featureId" + >; ...OmitProperties; } @@ -330,7 +346,10 @@ model EntitlementBoolean extends EntitlementSharedFields { @friendlyName("EntitlementStatic") model EntitlementStatic { type: EntitlementType.static; - ...OmitProperties; + ...OmitProperties< + EntitlementStaticCreateInputs, + "type" | "metadata" | "usagePeriod" | "featureKey" | "featureId" + >; ...OmitProperties; } diff --git a/api/spec/src/entitlements/feature.tsp b/api/spec/src/entitlements/feature.tsp index 1697eafa2..94292b807 100644 --- a/api/spec/src/entitlements/feature.tsp +++ b/api/spec/src/entitlements/feature.tsp @@ -64,7 +64,9 @@ interface Features { */ @get @operationId("getFeature") - get(@path featureId: string): Feature | OpenMeter.NotFoundError | OpenMeter.CommonErrors; + get( + @path featureId: string, + ): Feature | OpenMeter.NotFoundError | OpenMeter.CommonErrors; /** * Archive a feature by ID. diff --git a/api/spec/src/entitlements/subjects.tsp b/api/spec/src/entitlements/subjects.tsp index dee76662c..b11cda99f 100644 --- a/api/spec/src/entitlements/subjects.tsp +++ b/api/spec/src/entitlements/subjects.tsp @@ -26,7 +26,10 @@ interface Subjects { @post @summary("Create an entitlement") @operationId("createEntitlement") - post(@path subjectIdOrKey: string, @body entitlement: EntitlementCreateInputs): { + post( + @path subjectIdOrKey: string, + @body entitlement: EntitlementCreateInputs, + ): { @statusCode _: 201; @body body: EntitlementCreateInputs; } | OpenMeter.CommonErrors | OpenMeter.ConflictError; @@ -36,7 +39,10 @@ interface Subjects { */ @get @operationId("listSubjectEntitlements") - list(@path subjectIdOrKey: string, @query includeDeleted?: boolean = false): Entitlement[] | OpenMeter.CommonErrors; + list( + @path subjectIdOrKey: string, + @query includeDeleted?: boolean = false, + ): Entitlement[] | OpenMeter.CommonErrors; /** * Get entitlement by id. For checking entitlement access, use the /value endpoint instead. @@ -108,7 +114,11 @@ interface Subjects { @post @operationId("createGrant") @route("/{entitlementIdOrFeatureKey}/grants") - createGrant(@path subjectIdOrKey: string, @path entitlementIdOrFeatureKey: string, @body grant: GrantCreateInput): { + createGrant( + @path subjectIdOrKey: string, + @path entitlementIdOrFeatureKey: string, + @body grant: GrantCreateInput, + ): { @statusCode _: 201; @body body: Grant; } | OpenMeter.CommonErrors | OpenMeter.ConflictError; @@ -171,7 +181,11 @@ interface Subjects { @post @operationId("resetEntitlementUsage") @route("/{entitlementId}/reset") - reset(@path subjectIdOrKey: string, @path entitlementId: string, @body reset: ResetEntitlementUsageInput): { + reset( + @path subjectIdOrKey: string, + @path entitlementId: string, + @body reset: ResetEntitlementUsageInput, + ): { @statusCode _: 204; } | OpenMeter.CommonErrors | OpenMeter.NotFoundError; } diff --git a/api/spec/src/events.tsp b/api/spec/src/events.tsp index 1815c7a2d..3eca39853 100644 --- a/api/spec/src/events.tsp +++ b/api/spec/src/events.tsp @@ -101,7 +101,10 @@ interface Events { @post @operationId("ingestEvents") @sharedRoute - ingestEvent(@header contentType: "application/cloudevents+json", @body body: Event): { + ingestEvent( + @header contentType: "application/cloudevents+json", + @body body: Event, + ): { @header contentType: "application/cloudevents+json"; @body _: Event; } | CommonErrors; @@ -109,7 +112,10 @@ interface Events { @post @operationId("ingestEvents") @sharedRoute - ingestEvents(@header contentType: "application/cloudevents-batch+json", @body body: Event[]): { + ingestEvents( + @header contentType: "application/cloudevents-batch+json", + @body body: Event[], + ): { @header contentType: "application/cloudevents-batch+json"; @body _: Event[]; } | CommonErrors; diff --git a/api/spec/src/meters.tsp b/api/spec/src/meters.tsp index 9015078af..712bc70a3 100644 --- a/api/spec/src/meters.tsp +++ b/api/spec/src/meters.tsp @@ -23,7 +23,9 @@ interface Meters { */ @get @operationId("getMeter") - get(@path meterIdOrSlug: MeterIdentifier): Meter | NotFoundError | CommonErrors; + get( + @path meterIdOrSlug: MeterIdentifier, + ): Meter | NotFoundError | CommonErrors; /** * Query meter for usage. diff --git a/api/spec/src/notification/channel.tsp b/api/spec/src/notification/channel.tsp index d2a02aa97..4c69307c3 100644 --- a/api/spec/src/notification/channel.tsp +++ b/api/spec/src/notification/channel.tsp @@ -196,7 +196,10 @@ interface Channels { @put @operationId("updateNotificationChannel") @summary("Update a notification channel") - update(@path channelId: ULID, @body request: NotificationChannelCreateRequest): { + update( + @path channelId: ULID, + @body request: NotificationChannelCreateRequest, + ): { @statusCode _: 200; @body body: NotificationChannel; } | OpenMeter.NotFoundError | OpenMeter.CommonErrors; @@ -207,7 +210,9 @@ interface Channels { @get @operationId("getNotificationChannel") @summary("Get notification channel") - get(@path channelId: ULID): NotificationChannel | OpenMeter.NotFoundError | OpenMeter.CommonErrors; + get( + @path channelId: ULID, + ): NotificationChannel | OpenMeter.NotFoundError | OpenMeter.CommonErrors; /** * Soft delete notification channel by id. diff --git a/api/spec/src/notification/event.tsp b/api/spec/src/notification/event.tsp index 7bb2964c4..c165d142c 100644 --- a/api/spec/src/notification/event.tsp +++ b/api/spec/src/notification/event.tsp @@ -281,5 +281,7 @@ interface Events { @get @operationId("getNotificationEvent") @summary("Get notification event") - get(@path eventId: string): Event | OpenMeter.NotFoundError | OpenMeter.CommonErrors; + get( + @path eventId: string, + ): Event | OpenMeter.NotFoundError | OpenMeter.CommonErrors; } diff --git a/api/spec/src/notification/rule.tsp b/api/spec/src/notification/rule.tsp index ccfd36023..89c45cf92 100644 --- a/api/spec/src/notification/rule.tsp +++ b/api/spec/src/notification/rule.tsp @@ -284,7 +284,9 @@ interface Rules { @get @operationId("getNotificationRule") @summary("Get notification rule") - get(@path ruleId: ULID): NotificationRule | OpenMeter.NotFoundError | OpenMeter.CommonErrors; + get( + @path ruleId: ULID, + ): NotificationRule | OpenMeter.NotFoundError | OpenMeter.CommonErrors; /** * Soft delete notification rule by id. diff --git a/api/spec/src/portal.tsp b/api/spec/src/portal.tsp index 9c43bc893..f9d7433f3 100644 --- a/api/spec/src/portal.tsp +++ b/api/spec/src/portal.tsp @@ -77,7 +77,10 @@ interface Meters { @route("/{meterSlug}/query") @operationId("queryPortalMeter") @sharedRoute - queryJson(@path meterSlug: Key, ...OmitProperties): { + queryJson( + @path meterSlug: Key, + ...OmitProperties, + ): { @header contentType: "application/json"; @body _: MeterQueryResult; } | NotFoundError | CommonErrors; @@ -89,7 +92,10 @@ interface Meters { @route("/{meterSlug}/query") @operationId("queryPortalMeter") @sharedRoute - queryCsv(@path meterSlug: Key, ...OmitProperties): { + queryCsv( + @path meterSlug: Key, + ...OmitProperties, + ): { @header contentType: "text/csv"; @body diff --git a/api/spec/src/productcatalog/ratecards.tsp b/api/spec/src/productcatalog/ratecards.tsp index 8ca4e7c79..4974aeb60 100644 --- a/api/spec/src/productcatalog/ratecards.tsp +++ b/api/spec/src/productcatalog/ratecards.tsp @@ -110,7 +110,11 @@ model RateCardUsageBased { */ @summary("Price") @example(#{ type: PriceType.unit, amount: "0.01", minimumAmount: "100" }) - price: UnitPriceWithCommitments | TieredPriceWithCommitments | FlatPriceWithPaymentTerm | null; + price: + | UnitPriceWithCommitments + | TieredPriceWithCommitments + | FlatPriceWithPaymentTerm + | null; /** * The discount of the rate card. @@ -164,7 +168,12 @@ union RateCardEntitlement { model RateCardMeteredEntitlement { ...OmitProperties< OpenMeter.Entitlements.EntitlementMeteredCreateInputs, - "featureKey" | "featureId" | "usagePeriod" | "measureUsageFrom" | "isUnlimited" + + | "featureKey" + | "featureId" + | "usagePeriod" + | "measureUsageFrom" + | "isUnlimited" >; /** @@ -181,7 +190,10 @@ model RateCardMeteredEntitlement { */ @friendlyName("RateCardStaticEntitlement") model RateCardStaticEntitlement { - ...OmitProperties; + ...OmitProperties< + EntitlementStaticCreateInputs, + "featureKey" | "featureId" | "usagePeriod" + >; } /** @@ -189,5 +201,8 @@ model RateCardStaticEntitlement { */ @friendlyName("RateCardBooleanEntitlement") model RateCardBooleanEntitlement { - ...OmitProperties; + ...OmitProperties< + EntitlementBooleanCreateInputs, + "featureKey" | "featureId" | "usagePeriod" + >; } diff --git a/api/spec/src/productcatalog/routes.tsp b/api/spec/src/productcatalog/routes.tsp index 98a4da35f..6749c23d5 100644 --- a/api/spec/src/productcatalog/routes.tsp +++ b/api/spec/src/productcatalog/routes.tsp @@ -169,7 +169,10 @@ interface PlanPhases { @post @operationId("createPlanPhases") @summary("Create new phase in plan") - create(@path planId: ULID, @body request: TypeSpec.Rest.Resource.ResourceCreateModel): { + create( + @path planId: ULID, + @body request: TypeSpec.Rest.Resource.ResourceCreateModel, + ): { @statusCode _: 201; @bodyRoot body: PlanPhase; } | OpenMeter.CommonErrors; @@ -183,7 +186,9 @@ interface PlanPhases { update( @path planId: ULID, @path planPhaseKey: Key, - @body request: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel, + + @body + request: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel, ): PlanPhase | OpenMeter.NotFoundError | OpenMeter.CommonErrors; /** @@ -192,7 +197,10 @@ interface PlanPhases { @get @operationId("getPlanPhases") @summary("Get phase for plan") - get(@path planId: ULID, @path planPhaseKey: Key): PlanPhase | OpenMeter.NotFoundError | OpenMeter.CommonErrors; + get( + @path planId: ULID, + @path planPhaseKey: Key, + ): PlanPhase | OpenMeter.NotFoundError | OpenMeter.CommonErrors; /** * Delete phase in plan. diff --git a/api/spec/src/types.tsp b/api/spec/src/types.tsp index d5c2f8c8c..55e0364b4 100644 --- a/api/spec/src/types.tsp +++ b/api/spec/src/types.tsp @@ -165,7 +165,10 @@ enum RecurringPeriodInterval { /** * Recurring period with an interval and an anchor. */ -@example(#{ interval: RecurringPeriodInterval.Day, anchor: DateTime.fromISO("2023-01-01T01:01:01.001Z") }) +@example(#{ + interval: RecurringPeriodInterval.Day, + anchor: DateTime.fromISO("2023-01-01T01:01:01.001Z"), +}) @friendlyName("RecurringPeriod") model RecurringPeriod { /** @@ -185,7 +188,10 @@ model RecurringPeriod { /** * Recurring period with an interval and an anchor. */ -@example(#{ interval: RecurringPeriodInterval.Day, anchor: DateTime.fromISO("2023-01-01T01:01:01.001Z") }) +@example(#{ + interval: RecurringPeriodInterval.Day, + anchor: DateTime.fromISO("2023-01-01T01:01:01.001Z"), +}) @friendlyName("RecurringPeriodCreateInput") model RecurringPeriodCreateInput { /**