@openmeter/client 1.0.0-beta-441a124e06f8 → 1.0.0-beta-56dac5f2b68e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -428,6 +428,7 @@ they can change or be removed without notice or semver consideration.
428
428
  | `client.internal.customers.entitlements.get` | `GET /openmeter/customers/{customerId}/entitlements/{entitlementId}` | Get an entitlement of the customer by ID. For checking entitlement access, use the entitlement access endpoints instead. |
429
429
  | `client.internal.customers.entitlements.list` | `GET /openmeter/customers/{customerId}/entitlements` | List the entitlements of the customer that are active at the time of the request. For checking entitlement access, use the entitlement access endpoints instead. |
430
430
  | `client.internal.customers.entitlements.resetUsage` | `POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/reset` | Reset the usage of a metered entitlement. The reset starts a new usage period: usage is zeroed and grants roll over according to their rollover settings. Usage is reset automatically at the end of each usage period. Use this operation to reset it earlier, for example to align the entitlement with the customer's billing period. The usage period anchor can be moved at the same time. |
431
+ | `client.internal.customers.entitlements.delete` | `DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId}` | Deletes the entitlement and revokes access to its feature. A customer can hold only one active entitlement per feature, so migrating a feature requires deleting the previous entitlement first. Deletion sets the `deleted_at` timestamp instead of removing history. Access and status queries for earlier points in time still treat the entitlement as active, so access changes are never retroactive. |
431
432
  | `client.internal.customers.credits.grants.void` | `POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void` | Void a credit grant, forfeiting the remaining unused balance. Voiding is a forward-looking, irreversible operation. Credits already consumed by usage remain unaffected — only the remaining balance is forfeited. The grant reads as `voided` status afterwards. Payment state is not adjusted when `payment_adjustment` is `none`, so invoice-backed or externally collected payments may still collect the original amount. Only `active` grants can be voided; voiding a pending, expired, or fully consumed grant returns a conflict. Retrying a successful void is an idempotent success. |
432
433
  | `client.internal.customers.charges.list` | `GET /openmeter/customers/{customerId}/charges` | List customer charges. Returns the customer's charges that are represented as either flat fee or usage-based charges. |
433
434
  | `client.internal.customers.charges.create` | `POST /openmeter/customers/{customerId}/charges` | Create customer charge. |
@@ -1,6 +1,6 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type Result, type RequestOptions } from '../lib/types.js';
3
- import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
3
+ import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
4
4
  /**
5
5
  * Create customer
6
6
  *
@@ -138,6 +138,20 @@ export declare function listCustomerEntitlements(client: Client, req: ListCustom
138
138
  * POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/reset
139
139
  */
140
140
  export declare function resetCustomerEntitlementUsage(client: Client, req: ResetCustomerEntitlementUsageRequest, options?: RequestOptions): Promise<Result<ResetCustomerEntitlementUsageResponse>>;
141
+ /**
142
+ * Delete customer entitlement
143
+ *
144
+ * Deletes the entitlement and revokes access to its feature. A customer can hold
145
+ * only one active entitlement per feature, so migrating a feature requires
146
+ * deleting the previous entitlement first.
147
+ *
148
+ * Deletion sets the `deleted_at` timestamp instead of removing history. Access and
149
+ * status queries for earlier points in time still treat the entitlement as active,
150
+ * so access changes are never retroactive.
151
+ *
152
+ * DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId}
153
+ */
154
+ export declare function deleteCustomerEntitlement(client: Client, req: DeleteCustomerEntitlementRequest, options?: RequestOptions): Promise<Result<DeleteCustomerEntitlementResponse>>;
141
155
  /**
142
156
  * Create a new credit grant
143
157
  *
@@ -584,6 +584,45 @@ export function resetCustomerEntitlementUsage(client, req, options) {
584
584
  await http(client).post(path, { ...options, json: body });
585
585
  });
586
586
  }
587
+ /**
588
+ * Delete customer entitlement
589
+ *
590
+ * Deletes the entitlement and revokes access to its feature. A customer can hold
591
+ * only one active entitlement per feature, so migrating a feature requires
592
+ * deleting the previous entitlement first.
593
+ *
594
+ * Deletion sets the `deleted_at` timestamp instead of removing history. Access and
595
+ * status queries for earlier points in time still treat the entitlement as active,
596
+ * so access changes are never retroactive.
597
+ *
598
+ * DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId}
599
+ */
600
+ export function deleteCustomerEntitlement(client, req, options) {
601
+ return request(async () => {
602
+ const pathParamsInput = {
603
+ customerId: req.customerId,
604
+ entitlementId: req.entitlementId,
605
+ };
606
+ const pathParams = client._options.validate
607
+ ? toPathWire(pathParamsInput, schemas.deleteCustomerEntitlementPathParams)
608
+ : pathParamsInput;
609
+ if (client._options.validate) {
610
+ assertValid(schemas.deleteCustomerEntitlementPathParamsWire, pathParams);
611
+ }
612
+ const path = `openmeter/customers/${(() => {
613
+ if (pathParams.customerId === undefined) {
614
+ throw new Error('missing path parameter: customerId');
615
+ }
616
+ return encodeURIComponent(String(pathParams.customerId));
617
+ })()}/entitlements/${(() => {
618
+ if (pathParams.entitlementId === undefined) {
619
+ throw new Error('missing path parameter: entitlementId');
620
+ }
621
+ return encodeURIComponent(String(pathParams.entitlementId));
622
+ })()}`;
623
+ await http(client).delete(path, options);
624
+ });
625
+ }
587
626
  /**
588
627
  * Create a new credit grant
589
628
  *
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.0-beta-441a124e06f8";
1
+ export declare const SDK_VERSION = "1.0.0-beta-56dac5f2b68e";
@@ -2,4 +2,4 @@
2
2
  // The committed value is a dev placeholder. The publish flow
3
3
  // (`make -C api/spec publish-aip-sdk`) stamps the real release version here
4
4
  // before `pnpm publish`, after `pnpm version` updates package.json.
5
- export const SDK_VERSION = '1.0.0-beta-441a124e06f8';
5
+ export const SDK_VERSION = '1.0.0-beta-56dac5f2b68e';
@@ -130,6 +130,11 @@ export type ResetCustomerEntitlementUsageRequest = AcceptDateStrings<{
130
130
  body: ResetCustomerEntitlementUsageRequestInput;
131
131
  }>;
132
132
  export type ResetCustomerEntitlementUsageResponse = void;
133
+ export type DeleteCustomerEntitlementRequest = {
134
+ customerId: string;
135
+ entitlementId: string;
136
+ };
137
+ export type DeleteCustomerEntitlementResponse = void;
133
138
  export type CreateCreditGrantRequest = AcceptDateStrings<{
134
139
  customerId: string;
135
140
  body: CreateCreditGrantRequestInput;
@@ -18833,6 +18833,10 @@ export declare const resetCustomerEntitlementUsageBody: z.ZodObject<{
18833
18833
  retainAnchor: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
18834
18834
  preserveOverage: z.ZodOptional<z.ZodBoolean>;
18835
18835
  }, z.core.$strip>;
18836
+ export declare const deleteCustomerEntitlementPathParams: z.ZodObject<{
18837
+ customerId: z.ZodString;
18838
+ entitlementId: z.ZodString;
18839
+ }, z.core.$strip>;
18836
18840
  export declare const createCreditGrantPathParams: z.ZodObject<{
18837
18841
  customerId: z.ZodString;
18838
18842
  }, z.core.$strip>;
@@ -52562,6 +52566,10 @@ export declare const resetCustomerEntitlementUsageBodyWire: z.ZodObject<{
52562
52566
  retain_anchor: z.ZodOptional<z.ZodBoolean>;
52563
52567
  preserve_overage: z.ZodOptional<z.ZodBoolean>;
52564
52568
  }, z.core.$strict>;
52569
+ export declare const deleteCustomerEntitlementPathParamsWire: z.ZodObject<{
52570
+ customerId: z.ZodString;
52571
+ entitlementId: z.ZodString;
52572
+ }, z.core.$strip>;
52565
52573
  export declare const createCreditGrantPathParamsWire: z.ZodObject<{
52566
52574
  customerId: z.ZodString;
52567
52575
  }, z.core.$strip>;
@@ -5698,6 +5698,10 @@ export const resetCustomerEntitlementUsagePathParams = z.object({
5698
5698
  entitlementId: ulid,
5699
5699
  });
5700
5700
  export const resetCustomerEntitlementUsageBody = resetCustomerEntitlementUsageRequest;
5701
+ export const deleteCustomerEntitlementPathParams = z.object({
5702
+ customerId: ulid,
5703
+ entitlementId: ulid,
5704
+ });
5701
5705
  export const createCreditGrantPathParams = z.object({
5702
5706
  customerId: ulid,
5703
5707
  });
@@ -12024,6 +12028,10 @@ export const resetCustomerEntitlementUsagePathParamsWire = z.object({
12024
12028
  entitlementId: ulidWire,
12025
12029
  });
12026
12030
  export const resetCustomerEntitlementUsageBodyWire = resetCustomerEntitlementUsageRequestWire;
12031
+ export const deleteCustomerEntitlementPathParamsWire = z.object({
12032
+ customerId: ulidWire,
12033
+ entitlementId: ulidWire,
12034
+ });
12027
12035
  export const createCreditGrantPathParamsWire = z.object({
12028
12036
  customerId: ulidWire,
12029
12037
  });
@@ -1,6 +1,6 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
- import type { CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
3
+ import type { CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
4
4
  import type { GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse } from '../models/operations/entitlements.js';
5
5
  import type { UnscheduleSubscriptionRequest, UnscheduleSubscriptionResponse, RestoreSubscriptionRequest, RestoreSubscriptionResponse, MigrateSubscriptionRequest, MigrateSubscriptionResponse, CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse, UpdateSubscriptionAddonRequest, UpdateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
6
6
  import type { UninstallAppRequest, UninstallAppResponse, UpdateAppRequest, UpdateAppResponse, ListAppCatalogRequest, ListAppCatalogResponse, GetAppCatalogItemRequest, GetAppCatalogItemResponse, InstallAppRequest, InstallAppResponse } from '../models/operations/apps.js';
@@ -120,6 +120,20 @@ export declare class InternalCustomersEntitlements {
120
120
  * POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/reset
121
121
  */
122
122
  resetUsage(request: ResetCustomerEntitlementUsageRequest, options?: RequestOptions): Promise<ResetCustomerEntitlementUsageResponse>;
123
+ /**
124
+ * Delete customer entitlement
125
+ *
126
+ * Deletes the entitlement and revokes access to its feature. A customer can hold
127
+ * only one active entitlement per feature, so migrating a feature requires
128
+ * deleting the previous entitlement first.
129
+ *
130
+ * Deletion sets the `deleted_at` timestamp instead of removing history. Access and
131
+ * status queries for earlier points in time still treat the entitlement as active,
132
+ * so access changes are never retroactive.
133
+ *
134
+ * DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId}
135
+ */
136
+ delete(request: DeleteCustomerEntitlementRequest, options?: RequestOptions): Promise<DeleteCustomerEntitlementResponse>;
123
137
  }
124
138
  export declare class InternalCustomersCredits {
125
139
  private readonly _client;
@@ -1,7 +1,7 @@
1
1
  // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
2
2
  import { unwrap } from '../lib/types.js';
3
3
  import { paginatePages } from '../lib/paginate.js';
4
- import { createCustomerEntitlement, getCustomerEntitlementHistory, getCustomerEntitlement, listCustomerEntitlements, resetCustomerEntitlementUsage, voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
4
+ import { createCustomerEntitlement, getCustomerEntitlementHistory, getCustomerEntitlement, listCustomerEntitlements, resetCustomerEntitlementUsage, deleteCustomerEntitlement, voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
5
5
  import { getCustomerEntitlementAccess } from '../funcs/entitlements.js';
6
6
  import { unscheduleSubscription, restoreSubscription, migrateSubscription, createSubscriptionAddon, updateSubscriptionAddon, } from '../funcs/subscriptions.js';
7
7
  import { uninstallApp, updateApp, listAppCatalog, getAppCatalogItem, installApp, } from '../funcs/apps.js';
@@ -162,6 +162,22 @@ export class InternalCustomersEntitlements {
162
162
  async resetUsage(request, options) {
163
163
  return unwrap(await resetCustomerEntitlementUsage(this._client, request, options));
164
164
  }
165
+ /**
166
+ * Delete customer entitlement
167
+ *
168
+ * Deletes the entitlement and revokes access to its feature. A customer can hold
169
+ * only one active entitlement per feature, so migrating a feature requires
170
+ * deleting the previous entitlement first.
171
+ *
172
+ * Deletion sets the `deleted_at` timestamp instead of removing history. Access and
173
+ * status queries for earlier points in time still treat the entitlement as active,
174
+ * so access changes are never retroactive.
175
+ *
176
+ * DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId}
177
+ */
178
+ async delete(request, options) {
179
+ return unwrap(await deleteCustomerEntitlement(this._client, request, options));
180
+ }
165
181
  }
166
182
  export class InternalCustomersCredits {
167
183
  _client;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta-441a124e06f8",
3
+ "version": "1.0.0-beta-56dac5f2b68e",
4
4
  "description": "Official TypeScript SDK for the OpenMeter API — usage metering and billing",
5
5
  "keywords": [
6
6
  "openmeter",