@openmeter/client 1.0.0-beta.233 → 1.0.0-beta.235
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 +125 -111
- package/dist/funcs/customers.d.ts +112 -1
- package/dist/funcs/customers.js +430 -0
- package/dist/funcs/entitlements.d.ts +38 -1
- package/dist/funcs/entitlements.js +169 -6
- package/dist/funcs/grants.d.ts +24 -0
- package/dist/funcs/grants.js +78 -0
- package/dist/funcs/index.d.ts +2 -0
- package/dist/funcs/index.js +2 -0
- package/dist/funcs/notifications.d.ts +43 -0
- package/dist/funcs/notifications.js +163 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +6 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/customers.d.ts +109 -1
- package/dist/models/operations/entitlements.d.ts +59 -4
- package/dist/models/operations/grants.d.ts +43 -0
- package/dist/models/operations/grants.js +2 -0
- package/dist/models/operations/notifications.d.ts +46 -0
- package/dist/models/operations/notifications.js +2 -0
- package/dist/models/schemas.d.ts +6556 -2713
- package/dist/models/schemas.js +1802 -365
- package/dist/models/types.d.ts +1177 -228
- package/dist/sdk/apps.d.ts +70 -1
- package/dist/sdk/apps.js +86 -1
- package/dist/sdk/charges.d.ts +32 -0
- package/dist/sdk/charges.js +38 -0
- package/dist/sdk/currencies.d.ts +71 -0
- package/dist/sdk/currencies.js +87 -0
- package/dist/sdk/customers.d.ts +205 -2
- package/dist/sdk/customers.js +246 -1
- package/dist/sdk/entitlementAccess.d.ts +22 -0
- package/dist/sdk/entitlementAccess.js +26 -0
- package/dist/sdk/entitlements.d.ts +51 -1
- package/dist/sdk/entitlements.js +61 -1
- package/dist/sdk/grants.d.ts +43 -0
- package/dist/sdk/grants.js +51 -0
- package/dist/sdk/internal.d.ts +5 -458
- package/dist/sdk/internal.js +6 -569
- package/dist/sdk/notifications.d.ts +58 -0
- package/dist/sdk/notifications.js +72 -0
- package/dist/sdk/planAddons.d.ts +20 -1
- package/dist/sdk/planAddons.js +24 -1
- package/dist/sdk/sdk.d.ts +18 -0
- package/dist/sdk/sdk.js +30 -0
- package/dist/sdk/subscriptions.d.ts +39 -9
- package/dist/sdk/subscriptions.js +45 -11
- package/package.json +1 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Entitlement, EntitlementAccessCheckResult, EntitlementFeatureValueResult, EntitlementPagePaginatedResponse, EntitlementValueResult, ListCustomerEntitlementAccessResponseData, ListEntitlementsParamsFilter, SortQueryInput } from '../types.js';
|
|
3
3
|
export type ListCustomerEntitlementAccessRequest = {
|
|
4
4
|
customerId: string;
|
|
5
5
|
};
|
|
6
6
|
export type ListCustomerEntitlementAccessResponse = ListCustomerEntitlementAccessResponseData;
|
|
7
|
-
export
|
|
7
|
+
export type GetCustomerEntitlementAccessRequest = {
|
|
8
|
+
customerId: string;
|
|
9
|
+
featureKey: string;
|
|
10
|
+
};
|
|
11
|
+
export type GetCustomerEntitlementAccessResponse = EntitlementAccessCheckResult;
|
|
12
|
+
export interface GetCustomerEntitlementValueByFeatureKeyQuery {
|
|
8
13
|
/**
|
|
9
14
|
* Expand computed fields.
|
|
10
15
|
*
|
|
@@ -14,9 +19,59 @@ export interface GetCustomerEntitlementAccessQuery {
|
|
|
14
19
|
* `value` field.
|
|
15
20
|
*/
|
|
16
21
|
expand?: 'value'[];
|
|
22
|
+
/** The point in time to evaluate the entitlement at. Defaults to the current time. */
|
|
23
|
+
at?: Date;
|
|
17
24
|
}
|
|
18
|
-
export type
|
|
25
|
+
export type GetCustomerEntitlementValueByFeatureKeyRequest = AcceptDateStrings<GetCustomerEntitlementValueByFeatureKeyQuery & {
|
|
19
26
|
customerId: string;
|
|
20
27
|
featureKey: string;
|
|
21
28
|
}>;
|
|
22
|
-
export type
|
|
29
|
+
export type GetCustomerEntitlementValueByFeatureKeyResponse = EntitlementFeatureValueResult;
|
|
30
|
+
export interface ListEntitlementsQuery {
|
|
31
|
+
/** Determines which page of the collection to retrieve. */
|
|
32
|
+
page?: {
|
|
33
|
+
size?: number;
|
|
34
|
+
number?: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Sort entitlements returned in the response. Supported sort attributes are:
|
|
38
|
+
*
|
|
39
|
+
* - `created_at` (default)
|
|
40
|
+
* - `updated_at`
|
|
41
|
+
*
|
|
42
|
+
* The `asc` suffix is optional as the default sort order is ascending. The `desc`
|
|
43
|
+
* suffix is used to specify a descending order.
|
|
44
|
+
*/
|
|
45
|
+
sort?: SortQueryInput;
|
|
46
|
+
/**
|
|
47
|
+
* Filter entitlements returned in the response.
|
|
48
|
+
*
|
|
49
|
+
* To filter entitlements by customer, add the following query param:
|
|
50
|
+
* `filter[customer_id]=01K4WAQ0J99ZZ0MD75HXR112H8`
|
|
51
|
+
*/
|
|
52
|
+
filter?: ListEntitlementsParamsFilter;
|
|
53
|
+
}
|
|
54
|
+
export type ListEntitlementsRequest = AcceptDateStrings<ListEntitlementsQuery>;
|
|
55
|
+
export type ListEntitlementsResponse = EntitlementPagePaginatedResponse;
|
|
56
|
+
export type GetEntitlementRequest = {
|
|
57
|
+
entitlementId: string;
|
|
58
|
+
};
|
|
59
|
+
export type GetEntitlementResponse = Entitlement;
|
|
60
|
+
export interface GetCustomerEntitlementValueQuery {
|
|
61
|
+
/**
|
|
62
|
+
* Expand computed fields.
|
|
63
|
+
*
|
|
64
|
+
* Supported values are:
|
|
65
|
+
*
|
|
66
|
+
* - `value`: Expand the balance details of a metered entitlement; it sets the
|
|
67
|
+
* `value` field.
|
|
68
|
+
*/
|
|
69
|
+
expand?: 'value'[];
|
|
70
|
+
/** The point in time to evaluate the entitlement at. Defaults to the current time. */
|
|
71
|
+
at?: Date;
|
|
72
|
+
}
|
|
73
|
+
export type GetCustomerEntitlementValueRequest = AcceptDateStrings<GetCustomerEntitlementValueQuery & {
|
|
74
|
+
customerId: string;
|
|
75
|
+
entitlementId: string;
|
|
76
|
+
}>;
|
|
77
|
+
export type GetCustomerEntitlementValueResponse = EntitlementValueResult;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
2
|
+
import type { EntitlementGrantPagePaginatedResponse, ListGrantsParamsFilter, SortQueryInput } from '../types.js';
|
|
3
|
+
export interface ListGrantsQuery {
|
|
4
|
+
/** Determines which page of the collection to retrieve. */
|
|
5
|
+
page?: {
|
|
6
|
+
size?: number;
|
|
7
|
+
number?: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Sort grants returned in the response. Supported sort attributes are:
|
|
11
|
+
*
|
|
12
|
+
* - `created_at` (default)
|
|
13
|
+
* - `updated_at`
|
|
14
|
+
* - `effective_at`
|
|
15
|
+
* - `expires_at`
|
|
16
|
+
*
|
|
17
|
+
* The `asc` suffix is optional as the default sort order is ascending. The `desc`
|
|
18
|
+
* suffix is used to specify a descending order.
|
|
19
|
+
*/
|
|
20
|
+
sort?: SortQueryInput;
|
|
21
|
+
/**
|
|
22
|
+
* Filter grants returned in the response.
|
|
23
|
+
*
|
|
24
|
+
* To filter grants by customer, add the following query param:
|
|
25
|
+
* `filter[customer_id]=01K4WAQ0J99ZZ0MD75HXR112H8`
|
|
26
|
+
*/
|
|
27
|
+
filter?: ListGrantsParamsFilter;
|
|
28
|
+
/** Include deleted grants in the response. */
|
|
29
|
+
includeDeleted?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export type ListGrantsRequest = AcceptDateStrings<ListGrantsQuery>;
|
|
32
|
+
export type ListGrantsResponse = EntitlementGrantPagePaginatedResponse;
|
|
33
|
+
export interface VoidGrantQuery {
|
|
34
|
+
/**
|
|
35
|
+
* The time the grant is voided from. Defaults to now; it cannot be in the future
|
|
36
|
+
* or before the start of the current usage period.
|
|
37
|
+
*/
|
|
38
|
+
voidedAt?: Date;
|
|
39
|
+
}
|
|
40
|
+
export type VoidGrantRequest = AcceptDateStrings<VoidGrantQuery & {
|
|
41
|
+
grantId: string;
|
|
42
|
+
}>;
|
|
43
|
+
export type VoidGrantResponse = void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
2
|
+
import type { CreateNotificationChannelRequestInput, ListNotificationChannelsParamsFilter, NotificationChannel, NotificationChannelPagePaginatedResponse, SortQueryInput, UpdateBillingNotificationChannelRequestInput } from '../types.js';
|
|
3
|
+
export interface ListNotificationChannelsQuery {
|
|
4
|
+
/** Determines which page of the collection to retrieve. */
|
|
5
|
+
page?: {
|
|
6
|
+
size?: number;
|
|
7
|
+
number?: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Sort notification channels returned in the response. Supported sort attributes
|
|
11
|
+
* are:
|
|
12
|
+
*
|
|
13
|
+
* - `id` (default)
|
|
14
|
+
* - `type`
|
|
15
|
+
* - `created_at`
|
|
16
|
+
* - `updated_at`
|
|
17
|
+
*
|
|
18
|
+
* The `asc` suffix is optional as the default sort order is ascending. The `desc`
|
|
19
|
+
* suffix is used to specify a descending order.
|
|
20
|
+
*/
|
|
21
|
+
sort?: SortQueryInput;
|
|
22
|
+
/**
|
|
23
|
+
* Filter notification channels returned in the response.
|
|
24
|
+
*
|
|
25
|
+
* To filter notification channels by type add the following query param:
|
|
26
|
+
* filter[type]=webhook
|
|
27
|
+
*/
|
|
28
|
+
filter?: ListNotificationChannelsParamsFilter;
|
|
29
|
+
}
|
|
30
|
+
export type ListNotificationChannelsRequest = AcceptDateStrings<ListNotificationChannelsQuery>;
|
|
31
|
+
export type ListNotificationChannelsResponse = NotificationChannelPagePaginatedResponse;
|
|
32
|
+
export type CreateNotificationChannelRequest = AcceptDateStrings<CreateNotificationChannelRequestInput>;
|
|
33
|
+
export type CreateNotificationChannelResponse = NotificationChannel;
|
|
34
|
+
export type GetNotificationChannelRequest = {
|
|
35
|
+
notificationChannelId: string;
|
|
36
|
+
};
|
|
37
|
+
export type GetNotificationChannelResponse = NotificationChannel;
|
|
38
|
+
export type UpdateNotificationChannelRequest = AcceptDateStrings<{
|
|
39
|
+
notificationChannelId: string;
|
|
40
|
+
body: UpdateBillingNotificationChannelRequestInput;
|
|
41
|
+
}>;
|
|
42
|
+
export type UpdateNotificationChannelResponse = NotificationChannel;
|
|
43
|
+
export type DeleteNotificationChannelRequest = {
|
|
44
|
+
notificationChannelId: string;
|
|
45
|
+
};
|
|
46
|
+
export type DeleteNotificationChannelResponse = void;
|