@openmeter/client 1.0.0-beta-c47c2033c9a7 → 1.0.0-beta-9b0450f0db89
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 +16 -3
- package/dist/funcs/entitlements.d.ts +20 -1
- package/dist/funcs/entitlements.js +72 -2
- package/dist/funcs/index.d.ts +1 -0
- package/dist/funcs/index.js +1 -0
- package/dist/funcs/notifications.d.ts +43 -0
- package/dist/funcs/notifications.js +163 -0
- package/dist/index.d.ts +2 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/entitlements.d.ts +31 -1
- package/dist/models/operations/notifications.d.ts +46 -0
- package/dist/models/operations/notifications.js +2 -0
- package/dist/models/schemas.d.ts +968 -6
- package/dist/models/schemas.js +359 -20
- package/dist/models/types.d.ts +263 -3
- package/dist/sdk/internal.d.ts +90 -2
- package/dist/sdk/internal.js +111 -1
- package/dist/sdk/notifications.d.ts +58 -0
- package/dist/sdk/notifications.js +72 -0
- package/package.json +1 -1
package/dist/models/types.d.ts
CHANGED
|
@@ -2283,6 +2283,120 @@ export interface EntitlementAccessQueryError {
|
|
|
2283
2283
|
/** The customer identifier from the request that produced this error. */
|
|
2284
2284
|
customer?: string;
|
|
2285
2285
|
}
|
|
2286
|
+
/**
|
|
2287
|
+
* A notification channel delivers notification events, such as entitlement balance
|
|
2288
|
+
* threshold crossings, to an external system. Today the only supported channel
|
|
2289
|
+
* type is a webhook delivered via Svix.
|
|
2290
|
+
*/
|
|
2291
|
+
export interface NotificationChannel {
|
|
2292
|
+
id: string;
|
|
2293
|
+
/**
|
|
2294
|
+
* Display name of the resource.
|
|
2295
|
+
*
|
|
2296
|
+
* Between 1 and 256 characters.
|
|
2297
|
+
*/
|
|
2298
|
+
name: string;
|
|
2299
|
+
labels?: Labels;
|
|
2300
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2301
|
+
createdAt: Date;
|
|
2302
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2303
|
+
updatedAt: Date;
|
|
2304
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2305
|
+
deletedAt?: Date;
|
|
2306
|
+
/** The type of the channel. Immutable after creation. */
|
|
2307
|
+
type: 'webhook';
|
|
2308
|
+
/**
|
|
2309
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
2310
|
+
* events.
|
|
2311
|
+
*/
|
|
2312
|
+
disabled: boolean;
|
|
2313
|
+
/** The URL that webhook notification events are delivered to. */
|
|
2314
|
+
url: string;
|
|
2315
|
+
/**
|
|
2316
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
2317
|
+
* header name.
|
|
2318
|
+
*/
|
|
2319
|
+
customHeaders?: Record<string, string>;
|
|
2320
|
+
/**
|
|
2321
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
2322
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
2323
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
2324
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
2325
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
2326
|
+
*/
|
|
2327
|
+
signingSecret?: string;
|
|
2328
|
+
}
|
|
2329
|
+
/** NotificationChannel create request. */
|
|
2330
|
+
export interface CreateNotificationChannelRequest {
|
|
2331
|
+
/**
|
|
2332
|
+
* Display name of the resource.
|
|
2333
|
+
*
|
|
2334
|
+
* Between 1 and 256 characters.
|
|
2335
|
+
*/
|
|
2336
|
+
name: string;
|
|
2337
|
+
labels?: Labels;
|
|
2338
|
+
/** The type of the channel. Immutable after creation. */
|
|
2339
|
+
type: 'webhook';
|
|
2340
|
+
/**
|
|
2341
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
2342
|
+
* events.
|
|
2343
|
+
*/
|
|
2344
|
+
disabled: boolean;
|
|
2345
|
+
/** The URL that webhook notification events are delivered to. */
|
|
2346
|
+
url: string;
|
|
2347
|
+
/**
|
|
2348
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
2349
|
+
* header name.
|
|
2350
|
+
*/
|
|
2351
|
+
customHeaders?: Record<string, string>;
|
|
2352
|
+
/**
|
|
2353
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
2354
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
2355
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
2356
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
2357
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
2358
|
+
*/
|
|
2359
|
+
signingSecret?: string;
|
|
2360
|
+
}
|
|
2361
|
+
/**
|
|
2362
|
+
* Request body for updating a notification channel. Updates replace the channel's
|
|
2363
|
+
* mutable state rather than merging it: `type`, `name`, and `url` must always be
|
|
2364
|
+
* provided, and omitting `disabled`, `labels`, or `custom_headers` resets them to
|
|
2365
|
+
* their defaults (enabled, no labels, no custom headers). `signing_secret` is the
|
|
2366
|
+
* one exception: omitting it keeps the channel's current signing secret instead of
|
|
2367
|
+
* clearing the credential.
|
|
2368
|
+
*/
|
|
2369
|
+
export interface UpdateNotificationChannelRequest {
|
|
2370
|
+
/**
|
|
2371
|
+
* Display name of the resource.
|
|
2372
|
+
*
|
|
2373
|
+
* Between 1 and 256 characters.
|
|
2374
|
+
*/
|
|
2375
|
+
name: string;
|
|
2376
|
+
/** The type of the channel. Immutable after creation. */
|
|
2377
|
+
type: 'webhook';
|
|
2378
|
+
/** The URL that webhook notification events are delivered to. */
|
|
2379
|
+
url: string;
|
|
2380
|
+
labels?: Labels;
|
|
2381
|
+
/**
|
|
2382
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
2383
|
+
* events.
|
|
2384
|
+
*/
|
|
2385
|
+
disabled: boolean;
|
|
2386
|
+
/**
|
|
2387
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
2388
|
+
* header name.
|
|
2389
|
+
*/
|
|
2390
|
+
customHeaders?: Record<string, string>;
|
|
2391
|
+
/**
|
|
2392
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
2393
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
2394
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
2395
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
2396
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
2397
|
+
*/
|
|
2398
|
+
signingSecret?: string;
|
|
2399
|
+
}
|
|
2286
2400
|
/** App customer data. */
|
|
2287
2401
|
export interface AppCustomerData {
|
|
2288
2402
|
/**
|
|
@@ -2570,6 +2684,17 @@ export interface ListCustomerEntitlementsParamsFilter {
|
|
|
2570
2684
|
/** Filter entitlements by type (`metered`, `static` or `boolean`). */
|
|
2571
2685
|
type?: StringFieldFilterExact;
|
|
2572
2686
|
}
|
|
2687
|
+
/** Filter options for listing entitlements. */
|
|
2688
|
+
export interface ListEntitlementsParamsFilter {
|
|
2689
|
+
/** Filter entitlements by feature ID. */
|
|
2690
|
+
featureId?: UlidFieldFilter;
|
|
2691
|
+
/** Filter entitlements by feature key. */
|
|
2692
|
+
featureKey?: StringFieldFilterExact;
|
|
2693
|
+
/** Filter entitlements by type (`metered`, `static` or `boolean`). */
|
|
2694
|
+
type?: StringFieldFilterExact;
|
|
2695
|
+
/** Filter entitlements by customer ID. */
|
|
2696
|
+
customerId?: UlidFieldFilter;
|
|
2697
|
+
}
|
|
2573
2698
|
/** Filter options for listing subscriptions. */
|
|
2574
2699
|
export interface ListSubscriptionsParamsFilter {
|
|
2575
2700
|
id?: UlidFieldFilter;
|
|
@@ -2949,6 +3074,15 @@ export interface ListChargesParamsFilter {
|
|
|
2949
3074
|
/** Filter charges by the ID of their customer. */
|
|
2950
3075
|
customerId?: UlidFieldFilter;
|
|
2951
3076
|
}
|
|
3077
|
+
/** Filter options for listing notification channels. */
|
|
3078
|
+
export interface ListNotificationChannelsParamsFilter {
|
|
3079
|
+
id?: UlidFieldFilter;
|
|
3080
|
+
name?: StringFieldFilter;
|
|
3081
|
+
type?: StringFieldFilterExact;
|
|
3082
|
+
disabled?: BooleanFieldFilter;
|
|
3083
|
+
createdAt?: DateTimeFieldFilter;
|
|
3084
|
+
updatedAt?: DateTimeFieldFilter;
|
|
3085
|
+
}
|
|
2952
3086
|
/** Resource filters. */
|
|
2953
3087
|
export interface ResourceFilters {
|
|
2954
3088
|
name?: StringFieldFilter;
|
|
@@ -2960,9 +3094,7 @@ export interface ResourceFilters {
|
|
|
2960
3094
|
}
|
|
2961
3095
|
/** Field filters with all supported types. */
|
|
2962
3096
|
export interface FieldFilters {
|
|
2963
|
-
boolean?:
|
|
2964
|
-
eq: boolean;
|
|
2965
|
-
};
|
|
3097
|
+
boolean?: BooleanFieldFilter;
|
|
2966
3098
|
numeric?: number | {
|
|
2967
3099
|
eq?: number;
|
|
2968
3100
|
neq?: number;
|
|
@@ -3823,6 +3955,11 @@ export interface EntitlementFeatureAccess {
|
|
|
3823
3955
|
*/
|
|
3824
3956
|
reason?: EntitlementFeatureAccessReason;
|
|
3825
3957
|
}
|
|
3958
|
+
/** Page paginated response. */
|
|
3959
|
+
export interface NotificationChannelPagePaginatedResponse {
|
|
3960
|
+
data: NotificationChannel[];
|
|
3961
|
+
meta: PaginatedMeta;
|
|
3962
|
+
}
|
|
3826
3963
|
/** Billing customer data. */
|
|
3827
3964
|
export interface CustomerData {
|
|
3828
3965
|
/**
|
|
@@ -6737,6 +6874,10 @@ export type StringFieldFilterExact = string | {
|
|
|
6737
6874
|
};
|
|
6738
6875
|
/** The payment term of a flat price. */
|
|
6739
6876
|
export type PricePaymentTerm = 'in_advance' | 'in_arrears';
|
|
6877
|
+
/** Filter by a boolean value (true/false). */
|
|
6878
|
+
export type BooleanFieldFilter = boolean | {
|
|
6879
|
+
eq: boolean;
|
|
6880
|
+
};
|
|
6740
6881
|
/** Fiat or custom currency code. */
|
|
6741
6882
|
export type BillingCurrencyCode = string | string;
|
|
6742
6883
|
/** Fiat or custom currency code. */
|
|
@@ -7216,6 +7357,120 @@ export interface EntitlementAccessQueryRequestInput {
|
|
|
7216
7357
|
customer: EntitlementAccessQueryRequestCustomers;
|
|
7217
7358
|
feature?: EntitlementAccessQueryRequestFeatures;
|
|
7218
7359
|
}
|
|
7360
|
+
/**
|
|
7361
|
+
* A notification channel delivers notification events, such as entitlement balance
|
|
7362
|
+
* threshold crossings, to an external system. Today the only supported channel
|
|
7363
|
+
* type is a webhook delivered via Svix.
|
|
7364
|
+
*/
|
|
7365
|
+
export interface NotificationChannelInput {
|
|
7366
|
+
id: string;
|
|
7367
|
+
/**
|
|
7368
|
+
* Display name of the resource.
|
|
7369
|
+
*
|
|
7370
|
+
* Between 1 and 256 characters.
|
|
7371
|
+
*/
|
|
7372
|
+
name: string;
|
|
7373
|
+
labels?: Labels;
|
|
7374
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
7375
|
+
createdAt: Date;
|
|
7376
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
7377
|
+
updatedAt: Date;
|
|
7378
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
7379
|
+
deletedAt?: Date;
|
|
7380
|
+
/** The type of the channel. Immutable after creation. */
|
|
7381
|
+
type: 'webhook';
|
|
7382
|
+
/**
|
|
7383
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
7384
|
+
* events.
|
|
7385
|
+
*/
|
|
7386
|
+
disabled?: boolean;
|
|
7387
|
+
/** The URL that webhook notification events are delivered to. */
|
|
7388
|
+
url: string;
|
|
7389
|
+
/**
|
|
7390
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
7391
|
+
* header name.
|
|
7392
|
+
*/
|
|
7393
|
+
customHeaders?: Record<string, string>;
|
|
7394
|
+
/**
|
|
7395
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
7396
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
7397
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
7398
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
7399
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
7400
|
+
*/
|
|
7401
|
+
signingSecret?: string;
|
|
7402
|
+
}
|
|
7403
|
+
/** NotificationChannel create request. */
|
|
7404
|
+
export interface CreateNotificationChannelRequestInput {
|
|
7405
|
+
/**
|
|
7406
|
+
* Display name of the resource.
|
|
7407
|
+
*
|
|
7408
|
+
* Between 1 and 256 characters.
|
|
7409
|
+
*/
|
|
7410
|
+
name: string;
|
|
7411
|
+
labels?: Labels;
|
|
7412
|
+
/** The type of the channel. Immutable after creation. */
|
|
7413
|
+
type: 'webhook';
|
|
7414
|
+
/**
|
|
7415
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
7416
|
+
* events.
|
|
7417
|
+
*/
|
|
7418
|
+
disabled?: boolean;
|
|
7419
|
+
/** The URL that webhook notification events are delivered to. */
|
|
7420
|
+
url: string;
|
|
7421
|
+
/**
|
|
7422
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
7423
|
+
* header name.
|
|
7424
|
+
*/
|
|
7425
|
+
customHeaders?: Record<string, string>;
|
|
7426
|
+
/**
|
|
7427
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
7428
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
7429
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
7430
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
7431
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
7432
|
+
*/
|
|
7433
|
+
signingSecret?: string;
|
|
7434
|
+
}
|
|
7435
|
+
/**
|
|
7436
|
+
* Request body for updating a notification channel. Updates replace the channel's
|
|
7437
|
+
* mutable state rather than merging it: `type`, `name`, and `url` must always be
|
|
7438
|
+
* provided, and omitting `disabled`, `labels`, or `custom_headers` resets them to
|
|
7439
|
+
* their defaults (enabled, no labels, no custom headers). `signing_secret` is the
|
|
7440
|
+
* one exception: omitting it keeps the channel's current signing secret instead of
|
|
7441
|
+
* clearing the credential.
|
|
7442
|
+
*/
|
|
7443
|
+
export interface UpdateNotificationChannelRequestInput {
|
|
7444
|
+
/**
|
|
7445
|
+
* Display name of the resource.
|
|
7446
|
+
*
|
|
7447
|
+
* Between 1 and 256 characters.
|
|
7448
|
+
*/
|
|
7449
|
+
name: string;
|
|
7450
|
+
/** The type of the channel. Immutable after creation. */
|
|
7451
|
+
type: 'webhook';
|
|
7452
|
+
/** The URL that webhook notification events are delivered to. */
|
|
7453
|
+
url: string;
|
|
7454
|
+
labels?: Labels;
|
|
7455
|
+
/**
|
|
7456
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
7457
|
+
* events.
|
|
7458
|
+
*/
|
|
7459
|
+
disabled?: boolean;
|
|
7460
|
+
/**
|
|
7461
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
7462
|
+
* header name.
|
|
7463
|
+
*/
|
|
7464
|
+
customHeaders?: Record<string, string>;
|
|
7465
|
+
/**
|
|
7466
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
7467
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
7468
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
7469
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
7470
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
7471
|
+
*/
|
|
7472
|
+
signingSecret?: string;
|
|
7473
|
+
}
|
|
7219
7474
|
/** An ingested metering event with ingestion metadata. */
|
|
7220
7475
|
export interface IngestedEventInput {
|
|
7221
7476
|
/** The original event ingested. */
|
|
@@ -7412,6 +7667,11 @@ export interface UpdateBillingInvoiceWorkflowInput {
|
|
|
7412
7667
|
/** Payment settings for this invoice. */
|
|
7413
7668
|
payment?: UpdateBillingWorkflowPaymentSettingsInput;
|
|
7414
7669
|
}
|
|
7670
|
+
/** Page paginated response. */
|
|
7671
|
+
export interface NotificationChannelPagePaginatedResponseInput {
|
|
7672
|
+
data: NotificationChannelInput[];
|
|
7673
|
+
meta: PaginatedMeta;
|
|
7674
|
+
}
|
|
7415
7675
|
/** Purchase and payment terms of the grant. */
|
|
7416
7676
|
export interface CreateCreditGrantPurchaseInput {
|
|
7417
7677
|
/**
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
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
|
-
import type { GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse } from '../models/operations/entitlements.js';
|
|
4
|
+
import type { GetCustomerEntitlementAccessRequest, GetCustomerEntitlementAccessResponse, ListEntitlementsRequest, ListEntitlementsResponse, GetEntitlementRequest, GetEntitlementResponse } 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';
|
|
7
7
|
import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse, AdvanceInvoiceRequest, AdvanceInvoiceResponse, ApproveInvoiceRequest, ApproveInvoiceResponse, RetryInvoiceRequest, RetryInvoiceResponse, SnapshotQuantitiesInvoiceRequest, SnapshotQuantitiesInvoiceResponse } from '../models/operations/invoices.js';
|
|
@@ -9,7 +9,8 @@ import type { ListChargesRequest, ListChargesResponse } from '../models/operatio
|
|
|
9
9
|
import type { ListCurrenciesRequest, ListCurrenciesResponse, CreateCustomCurrencyRequest, CreateCustomCurrencyResponse, GetCustomCurrencyRequest, GetCustomCurrencyResponse, ListCostBasesRequest, ListCostBasesResponse, CreateCostBasisRequest, CreateCostBasisResponse } from '../models/operations/currencies.js';
|
|
10
10
|
import type { ListPlanAddonsRequest, ListPlanAddonsResponse } from '../models/operations/planAddons.js';
|
|
11
11
|
import type { QueryEntitlementAccessRequest, QueryEntitlementAccessResponse } from '../models/operations/entitlementAccess.js';
|
|
12
|
-
import type {
|
|
12
|
+
import type { ListNotificationChannelsRequest, ListNotificationChannelsResponse, CreateNotificationChannelRequest, CreateNotificationChannelResponse, GetNotificationChannelRequest, GetNotificationChannelResponse, UpdateNotificationChannelRequest, UpdateNotificationChannelResponse, DeleteNotificationChannelRequest, DeleteNotificationChannelResponse } from '../models/operations/notifications.js';
|
|
13
|
+
import type { AppCatalogItem, Charge, CostBasis, Currency, Entitlement, Invoice, NotificationChannel, PlanAddon } from '../models/types.js';
|
|
13
14
|
/**
|
|
14
15
|
* Operations marked internal in the API definition. They are not part of
|
|
15
16
|
* the customer surface: they may require additional permissions, and they
|
|
@@ -36,6 +37,8 @@ export declare class Internal {
|
|
|
36
37
|
get planAddons(): InternalPlanAddons;
|
|
37
38
|
private _entitlementAccess?;
|
|
38
39
|
get entitlementAccess(): InternalEntitlementAccess;
|
|
40
|
+
private _notifications?;
|
|
41
|
+
get notifications(): InternalNotifications;
|
|
39
42
|
}
|
|
40
43
|
export declare class InternalCustomers {
|
|
41
44
|
private readonly _client;
|
|
@@ -208,6 +211,37 @@ export declare class InternalEntitlements {
|
|
|
208
211
|
* GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}
|
|
209
212
|
*/
|
|
210
213
|
getCustomerAccess(request: GetCustomerEntitlementAccessRequest, options?: RequestOptions): Promise<GetCustomerEntitlementAccessResponse>;
|
|
214
|
+
/**
|
|
215
|
+
* List entitlements
|
|
216
|
+
*
|
|
217
|
+
* List the active entitlements of all customers. Intended for administrative use.
|
|
218
|
+
* To list the entitlements of a single customer, use the customer entitlements
|
|
219
|
+
* endpoints; to check entitlement access, use the entitlement access endpoints.
|
|
220
|
+
*
|
|
221
|
+
* GET /openmeter/entitlements
|
|
222
|
+
*/
|
|
223
|
+
list(request?: ListEntitlementsRequest, options?: RequestOptions): Promise<ListEntitlementsResponse>;
|
|
224
|
+
/**
|
|
225
|
+
* List entitlements
|
|
226
|
+
*
|
|
227
|
+
* List the active entitlements of all customers. Intended for administrative use.
|
|
228
|
+
* To list the entitlements of a single customer, use the customer entitlements
|
|
229
|
+
* endpoints; to check entitlement access, use the entitlement access endpoints.
|
|
230
|
+
*
|
|
231
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
232
|
+
*
|
|
233
|
+
* GET /openmeter/entitlements
|
|
234
|
+
*/
|
|
235
|
+
listAll(request?: ListEntitlementsRequest, options?: RequestOptions): AsyncIterable<Entitlement>;
|
|
236
|
+
/**
|
|
237
|
+
* Get entitlement
|
|
238
|
+
*
|
|
239
|
+
* Get an entitlement by ID. To check entitlement access, use the entitlement
|
|
240
|
+
* access endpoints instead.
|
|
241
|
+
*
|
|
242
|
+
* GET /openmeter/entitlements/{entitlementId}
|
|
243
|
+
*/
|
|
244
|
+
get(request: GetEntitlementRequest, options?: RequestOptions): Promise<GetEntitlementResponse>;
|
|
211
245
|
}
|
|
212
246
|
export declare class InternalSubscriptions {
|
|
213
247
|
private readonly _client;
|
|
@@ -582,3 +616,57 @@ export declare class InternalEntitlementAccess {
|
|
|
582
616
|
*/
|
|
583
617
|
query(request: QueryEntitlementAccessRequest, options?: RequestOptions): Promise<QueryEntitlementAccessResponse>;
|
|
584
618
|
}
|
|
619
|
+
export declare class InternalNotifications {
|
|
620
|
+
private readonly _client;
|
|
621
|
+
constructor(_client: Client);
|
|
622
|
+
/**
|
|
623
|
+
* List notification channels
|
|
624
|
+
*
|
|
625
|
+
* List all notification channels.
|
|
626
|
+
*
|
|
627
|
+
* GET /openmeter/notification/channels
|
|
628
|
+
*/
|
|
629
|
+
listChannels(request?: ListNotificationChannelsRequest, options?: RequestOptions): Promise<ListNotificationChannelsResponse>;
|
|
630
|
+
/**
|
|
631
|
+
* List notification channels
|
|
632
|
+
*
|
|
633
|
+
* List all notification channels.
|
|
634
|
+
*
|
|
635
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
636
|
+
*
|
|
637
|
+
* GET /openmeter/notification/channels
|
|
638
|
+
*/
|
|
639
|
+
listChannelsAll(request?: ListNotificationChannelsRequest, options?: RequestOptions): AsyncIterable<NotificationChannel>;
|
|
640
|
+
/**
|
|
641
|
+
* Create notification channel
|
|
642
|
+
*
|
|
643
|
+
* Create a notification channel.
|
|
644
|
+
*
|
|
645
|
+
* POST /openmeter/notification/channels
|
|
646
|
+
*/
|
|
647
|
+
createChannel(request: CreateNotificationChannelRequest, options?: RequestOptions): Promise<CreateNotificationChannelResponse>;
|
|
648
|
+
/**
|
|
649
|
+
* Get notification channel
|
|
650
|
+
*
|
|
651
|
+
* Get a notification channel by id.
|
|
652
|
+
*
|
|
653
|
+
* GET /openmeter/notification/channels/{notificationChannelId}
|
|
654
|
+
*/
|
|
655
|
+
getChannel(request: GetNotificationChannelRequest, options?: RequestOptions): Promise<GetNotificationChannelResponse>;
|
|
656
|
+
/**
|
|
657
|
+
* Update notification channel
|
|
658
|
+
*
|
|
659
|
+
* Update a notification channel by id.
|
|
660
|
+
*
|
|
661
|
+
* PUT /openmeter/notification/channels/{notificationChannelId}
|
|
662
|
+
*/
|
|
663
|
+
updateChannel(request: UpdateNotificationChannelRequest, options?: RequestOptions): Promise<UpdateNotificationChannelResponse>;
|
|
664
|
+
/**
|
|
665
|
+
* Delete notification channel
|
|
666
|
+
*
|
|
667
|
+
* Delete a notification channel by id.
|
|
668
|
+
*
|
|
669
|
+
* DELETE /openmeter/notification/channels/{notificationChannelId}
|
|
670
|
+
*/
|
|
671
|
+
deleteChannel(request: DeleteNotificationChannelRequest, options?: RequestOptions): Promise<DeleteNotificationChannelResponse>;
|
|
672
|
+
}
|
package/dist/sdk/internal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginatePages } from '../lib/paginate.js';
|
|
4
4
|
import { createCustomerEntitlement, getCustomerEntitlementHistory, getCustomerEntitlement, listCustomerEntitlements, resetCustomerEntitlementUsage, deleteCustomerEntitlement, voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
5
|
-
import { getCustomerEntitlementAccess } from '../funcs/entitlements.js';
|
|
5
|
+
import { getCustomerEntitlementAccess, listEntitlements, getEntitlement, } 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';
|
|
8
8
|
import { listInvoices, getInvoice, updateInvoice, deleteInvoice, advanceInvoice, approveInvoice, retryInvoice, snapshotQuantitiesInvoice, } from '../funcs/invoices.js';
|
|
@@ -10,6 +10,7 @@ import { listCharges } from '../funcs/charges.js';
|
|
|
10
10
|
import { listCurrencies, createCustomCurrency, getCustomCurrency, listCostBases, createCostBasis, } from '../funcs/currencies.js';
|
|
11
11
|
import { listPlanAddons } from '../funcs/planAddons.js';
|
|
12
12
|
import { queryEntitlementAccess } from '../funcs/entitlementAccess.js';
|
|
13
|
+
import { listNotificationChannels, createNotificationChannel, getNotificationChannel, updateNotificationChannel, deleteNotificationChannel, } from '../funcs/notifications.js';
|
|
13
14
|
/**
|
|
14
15
|
* Operations marked internal in the API definition. They are not part of
|
|
15
16
|
* the customer surface: they may require additional permissions, and they
|
|
@@ -56,6 +57,10 @@ export class Internal {
|
|
|
56
57
|
get entitlementAccess() {
|
|
57
58
|
return (this._entitlementAccess ??= new InternalEntitlementAccess(this._client));
|
|
58
59
|
}
|
|
60
|
+
_notifications;
|
|
61
|
+
get notifications() {
|
|
62
|
+
return (this._notifications ??= new InternalNotifications(this._client));
|
|
63
|
+
}
|
|
59
64
|
}
|
|
60
65
|
export class InternalCustomers {
|
|
61
66
|
_client;
|
|
@@ -272,6 +277,43 @@ export class InternalEntitlements {
|
|
|
272
277
|
async getCustomerAccess(request, options) {
|
|
273
278
|
return unwrap(await getCustomerEntitlementAccess(this._client, request, options));
|
|
274
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* List entitlements
|
|
282
|
+
*
|
|
283
|
+
* List the active entitlements of all customers. Intended for administrative use.
|
|
284
|
+
* To list the entitlements of a single customer, use the customer entitlements
|
|
285
|
+
* endpoints; to check entitlement access, use the entitlement access endpoints.
|
|
286
|
+
*
|
|
287
|
+
* GET /openmeter/entitlements
|
|
288
|
+
*/
|
|
289
|
+
async list(request, options) {
|
|
290
|
+
return unwrap(await listEntitlements(this._client, request, options));
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* List entitlements
|
|
294
|
+
*
|
|
295
|
+
* List the active entitlements of all customers. Intended for administrative use.
|
|
296
|
+
* To list the entitlements of a single customer, use the customer entitlements
|
|
297
|
+
* endpoints; to check entitlement access, use the entitlement access endpoints.
|
|
298
|
+
*
|
|
299
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
300
|
+
*
|
|
301
|
+
* GET /openmeter/entitlements
|
|
302
|
+
*/
|
|
303
|
+
listAll(request, options) {
|
|
304
|
+
return paginatePages((req, opts) => listEntitlements(this._client, req, opts), request ?? {}, options);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Get entitlement
|
|
308
|
+
*
|
|
309
|
+
* Get an entitlement by ID. To check entitlement access, use the entitlement
|
|
310
|
+
* access endpoints instead.
|
|
311
|
+
*
|
|
312
|
+
* GET /openmeter/entitlements/{entitlementId}
|
|
313
|
+
*/
|
|
314
|
+
async get(request, options) {
|
|
315
|
+
return unwrap(await getEntitlement(this._client, request, options));
|
|
316
|
+
}
|
|
275
317
|
}
|
|
276
318
|
export class InternalSubscriptions {
|
|
277
319
|
_client;
|
|
@@ -724,3 +766,71 @@ export class InternalEntitlementAccess {
|
|
|
724
766
|
return unwrap(await queryEntitlementAccess(this._client, request, options));
|
|
725
767
|
}
|
|
726
768
|
}
|
|
769
|
+
export class InternalNotifications {
|
|
770
|
+
_client;
|
|
771
|
+
constructor(_client) {
|
|
772
|
+
this._client = _client;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* List notification channels
|
|
776
|
+
*
|
|
777
|
+
* List all notification channels.
|
|
778
|
+
*
|
|
779
|
+
* GET /openmeter/notification/channels
|
|
780
|
+
*/
|
|
781
|
+
async listChannels(request, options) {
|
|
782
|
+
return unwrap(await listNotificationChannels(this._client, request, options));
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* List notification channels
|
|
786
|
+
*
|
|
787
|
+
* List all notification channels.
|
|
788
|
+
*
|
|
789
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
790
|
+
*
|
|
791
|
+
* GET /openmeter/notification/channels
|
|
792
|
+
*/
|
|
793
|
+
listChannelsAll(request, options) {
|
|
794
|
+
return paginatePages((req, opts) => listNotificationChannels(this._client, req, opts), request ?? {}, options);
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Create notification channel
|
|
798
|
+
*
|
|
799
|
+
* Create a notification channel.
|
|
800
|
+
*
|
|
801
|
+
* POST /openmeter/notification/channels
|
|
802
|
+
*/
|
|
803
|
+
async createChannel(request, options) {
|
|
804
|
+
return unwrap(await createNotificationChannel(this._client, request, options));
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Get notification channel
|
|
808
|
+
*
|
|
809
|
+
* Get a notification channel by id.
|
|
810
|
+
*
|
|
811
|
+
* GET /openmeter/notification/channels/{notificationChannelId}
|
|
812
|
+
*/
|
|
813
|
+
async getChannel(request, options) {
|
|
814
|
+
return unwrap(await getNotificationChannel(this._client, request, options));
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Update notification channel
|
|
818
|
+
*
|
|
819
|
+
* Update a notification channel by id.
|
|
820
|
+
*
|
|
821
|
+
* PUT /openmeter/notification/channels/{notificationChannelId}
|
|
822
|
+
*/
|
|
823
|
+
async updateChannel(request, options) {
|
|
824
|
+
return unwrap(await updateNotificationChannel(this._client, request, options));
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Delete notification channel
|
|
828
|
+
*
|
|
829
|
+
* Delete a notification channel by id.
|
|
830
|
+
*
|
|
831
|
+
* DELETE /openmeter/notification/channels/{notificationChannelId}
|
|
832
|
+
*/
|
|
833
|
+
async deleteChannel(request, options) {
|
|
834
|
+
return unwrap(await deleteNotificationChannel(this._client, request, options));
|
|
835
|
+
}
|
|
836
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type Client } from '../core.js';
|
|
2
|
+
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
+
import type { ListNotificationChannelsRequest, ListNotificationChannelsResponse, CreateNotificationChannelRequest, CreateNotificationChannelResponse, GetNotificationChannelRequest, GetNotificationChannelResponse, UpdateNotificationChannelRequest, UpdateNotificationChannelResponse, DeleteNotificationChannelRequest, DeleteNotificationChannelResponse } from '../models/operations/notifications.js';
|
|
4
|
+
import type { NotificationChannel } from '../models/types.js';
|
|
5
|
+
export declare class Notifications {
|
|
6
|
+
private readonly _client;
|
|
7
|
+
constructor(_client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* List notification channels
|
|
10
|
+
*
|
|
11
|
+
* List all notification channels.
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/notification/channels
|
|
14
|
+
*/
|
|
15
|
+
listChannels(request?: ListNotificationChannelsRequest, options?: RequestOptions): Promise<ListNotificationChannelsResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* List notification channels
|
|
18
|
+
*
|
|
19
|
+
* List all notification channels.
|
|
20
|
+
*
|
|
21
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
22
|
+
*
|
|
23
|
+
* GET /openmeter/notification/channels
|
|
24
|
+
*/
|
|
25
|
+
listChannelsAll(request?: ListNotificationChannelsRequest, options?: RequestOptions): AsyncIterable<NotificationChannel>;
|
|
26
|
+
/**
|
|
27
|
+
* Create notification channel
|
|
28
|
+
*
|
|
29
|
+
* Create a notification channel.
|
|
30
|
+
*
|
|
31
|
+
* POST /openmeter/notification/channels
|
|
32
|
+
*/
|
|
33
|
+
createChannel(request: CreateNotificationChannelRequest, options?: RequestOptions): Promise<CreateNotificationChannelResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Get notification channel
|
|
36
|
+
*
|
|
37
|
+
* Get a notification channel by id.
|
|
38
|
+
*
|
|
39
|
+
* GET /openmeter/notification/channels/{notificationChannelId}
|
|
40
|
+
*/
|
|
41
|
+
getChannel(request: GetNotificationChannelRequest, options?: RequestOptions): Promise<GetNotificationChannelResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Update notification channel
|
|
44
|
+
*
|
|
45
|
+
* Update a notification channel by id.
|
|
46
|
+
*
|
|
47
|
+
* PUT /openmeter/notification/channels/{notificationChannelId}
|
|
48
|
+
*/
|
|
49
|
+
updateChannel(request: UpdateNotificationChannelRequest, options?: RequestOptions): Promise<UpdateNotificationChannelResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Delete notification channel
|
|
52
|
+
*
|
|
53
|
+
* Delete a notification channel by id.
|
|
54
|
+
*
|
|
55
|
+
* DELETE /openmeter/notification/channels/{notificationChannelId}
|
|
56
|
+
*/
|
|
57
|
+
deleteChannel(request: DeleteNotificationChannelRequest, options?: RequestOptions): Promise<DeleteNotificationChannelResponse>;
|
|
58
|
+
}
|