@openmeter/client 1.0.0-beta-2b50cff9e992 → 1.0.0-beta-ae95f83a2a40
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 +2 -0
- package/dist/funcs/customers.d.ts +20 -1
- package/dist/funcs/customers.js +91 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/customers.d.ts +34 -1
- package/dist/models/schemas.d.ts +709 -88
- package/dist/models/schemas.js +149 -66
- package/dist/models/types.d.ts +39 -20
- package/dist/sdk/internal.d.ts +33 -2
- package/dist/sdk/internal.js +38 -1
- package/package.json +1 -1
package/dist/models/schemas.js
CHANGED
|
@@ -388,6 +388,25 @@ export const entitlementMeasureUsageFromPreset = z
|
|
|
388
388
|
export const entitlementHistoryWindowSize = z
|
|
389
389
|
.union([z.literal('PT1H'), z.literal('P1D')])
|
|
390
390
|
.describe('The meter query granularities the usage history can be grouped into. Sub-hour windows are too expensive to compute and monthly windows are not supported.');
|
|
391
|
+
export const stringFieldFilterExact = z
|
|
392
|
+
.union([
|
|
393
|
+
z.string(),
|
|
394
|
+
z.object({
|
|
395
|
+
eq: z
|
|
396
|
+
.string()
|
|
397
|
+
.optional()
|
|
398
|
+
.describe('Value strictly equals the given string value.'),
|
|
399
|
+
oeq: z
|
|
400
|
+
.array(z.string())
|
|
401
|
+
.optional()
|
|
402
|
+
.describe('Returns entities that exact match any of the comma-delimited phrases in the filter string.'),
|
|
403
|
+
neq: z
|
|
404
|
+
.string()
|
|
405
|
+
.optional()
|
|
406
|
+
.describe('Value does not equal the given string value.'),
|
|
407
|
+
}),
|
|
408
|
+
])
|
|
409
|
+
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
391
410
|
export const createLabels = z
|
|
392
411
|
.record(z.string(), z.string())
|
|
393
412
|
.describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
|
|
@@ -409,25 +428,6 @@ export const creditGrantStatus = z
|
|
|
409
428
|
export const validationIssueSeverity = z
|
|
410
429
|
.enum(['critical', 'warning'])
|
|
411
430
|
.describe('Severity level of a billing validation issue.');
|
|
412
|
-
export const stringFieldFilterExact = z
|
|
413
|
-
.union([
|
|
414
|
-
z.string(),
|
|
415
|
-
z.object({
|
|
416
|
-
eq: z
|
|
417
|
-
.string()
|
|
418
|
-
.optional()
|
|
419
|
-
.describe('Value strictly equals the given string value.'),
|
|
420
|
-
oeq: z
|
|
421
|
-
.array(z.string())
|
|
422
|
-
.optional()
|
|
423
|
-
.describe('Returns entities that exact match any of the comma-delimited phrases in the filter string.'),
|
|
424
|
-
neq: z
|
|
425
|
-
.string()
|
|
426
|
-
.optional()
|
|
427
|
-
.describe('Value does not equal the given string value.'),
|
|
428
|
-
}),
|
|
429
|
-
])
|
|
430
|
-
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
431
431
|
export const creditGrantVoidPaymentAdjustment = z
|
|
432
432
|
.enum(['none'])
|
|
433
433
|
.describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
|
|
@@ -2250,6 +2250,20 @@ export const subscriptionEditStretchPhase = z
|
|
|
2250
2250
|
export const entitlementMeasureUsageFrom = z
|
|
2251
2251
|
.union([entitlementMeasureUsageFromPreset, dateTime])
|
|
2252
2252
|
.describe('The time from which usage is measured, as a preset or an explicit timestamp.');
|
|
2253
|
+
export const getCreditBalanceParamsFilter = z
|
|
2254
|
+
.object({
|
|
2255
|
+
currency: stringFieldFilterExact.optional(),
|
|
2256
|
+
featureKey: stringFieldFilter.optional(),
|
|
2257
|
+
})
|
|
2258
|
+
.describe('Filter options for getting a credit balance.');
|
|
2259
|
+
export const listPlansParamsFilter = z
|
|
2260
|
+
.object({
|
|
2261
|
+
key: stringFieldFilter.optional(),
|
|
2262
|
+
name: stringFieldFilter.optional(),
|
|
2263
|
+
status: stringFieldFilterExact.optional(),
|
|
2264
|
+
currency: stringFieldFilterExact.optional(),
|
|
2265
|
+
})
|
|
2266
|
+
.describe('Filter options for listing plans.');
|
|
2253
2267
|
export const updateCreditGrantExternalSettlementRequest = z
|
|
2254
2268
|
.object({
|
|
2255
2269
|
status: creditPurchasePaymentSettlementStatus,
|
|
@@ -2281,20 +2295,6 @@ export const validationIssue = z
|
|
|
2281
2295
|
.describe('Component that reported the validation issue, if applicable.'),
|
|
2282
2296
|
})
|
|
2283
2297
|
.describe('A validation issue found while processing a billing resource.');
|
|
2284
|
-
export const getCreditBalanceParamsFilter = z
|
|
2285
|
-
.object({
|
|
2286
|
-
currency: stringFieldFilterExact.optional(),
|
|
2287
|
-
featureKey: stringFieldFilter.optional(),
|
|
2288
|
-
})
|
|
2289
|
-
.describe('Filter options for getting a credit balance.');
|
|
2290
|
-
export const listPlansParamsFilter = z
|
|
2291
|
-
.object({
|
|
2292
|
-
key: stringFieldFilter.optional(),
|
|
2293
|
-
name: stringFieldFilter.optional(),
|
|
2294
|
-
status: stringFieldFilterExact.optional(),
|
|
2295
|
-
currency: stringFieldFilterExact.optional(),
|
|
2296
|
-
})
|
|
2297
|
-
.describe('Filter options for listing plans.');
|
|
2298
2298
|
export const voidCreditGrantRequest = z
|
|
2299
2299
|
.object({
|
|
2300
2300
|
paymentAdjustment: creditGrantVoidPaymentAdjustment
|
|
@@ -2725,6 +2725,13 @@ export const listCustomersParamsFilter = z
|
|
|
2725
2725
|
billingProfileId: ulidFieldFilter.optional(),
|
|
2726
2726
|
})
|
|
2727
2727
|
.describe('Filter options for listing customers.');
|
|
2728
|
+
export const listCustomerEntitlementsParamsFilter = z
|
|
2729
|
+
.object({
|
|
2730
|
+
featureId: ulidFieldFilter.optional(),
|
|
2731
|
+
featureKey: stringFieldFilterExact.optional(),
|
|
2732
|
+
type: stringFieldFilterExact.optional(),
|
|
2733
|
+
})
|
|
2734
|
+
.describe('Filter options for listing customer entitlements.');
|
|
2728
2735
|
export const listSubscriptionsParamsFilter = z
|
|
2729
2736
|
.object({
|
|
2730
2737
|
id: ulidFieldFilter.optional(),
|
|
@@ -4402,6 +4409,12 @@ export const createEntitlementRequest = z
|
|
|
4402
4409
|
createEntitlementBooleanRequest,
|
|
4403
4410
|
])
|
|
4404
4411
|
.describe('Entitlement create request.');
|
|
4412
|
+
export const entitlementPagePaginatedResponse = z
|
|
4413
|
+
.object({
|
|
4414
|
+
data: z.array(entitlement),
|
|
4415
|
+
meta: paginatedMeta,
|
|
4416
|
+
})
|
|
4417
|
+
.describe('Page paginated response.');
|
|
4405
4418
|
export const workflowCollectionSettings = z
|
|
4406
4419
|
.object({
|
|
4407
4420
|
alignment: workflowCollectionAlignment.optional().default({
|
|
@@ -5557,6 +5570,33 @@ export const getCustomerEntitlementHistoryQueryParams = z.object({
|
|
|
5557
5570
|
.describe('The IANA time zone the windows are aligned to.'),
|
|
5558
5571
|
});
|
|
5559
5572
|
export const getCustomerEntitlementHistoryResponse = entitlementHistory;
|
|
5573
|
+
export const getCustomerEntitlementPathParams = z.object({
|
|
5574
|
+
customerId: ulid,
|
|
5575
|
+
entitlementId: ulid,
|
|
5576
|
+
});
|
|
5577
|
+
export const getCustomerEntitlementResponse = entitlement;
|
|
5578
|
+
export const listCustomerEntitlementsPathParams = z.object({
|
|
5579
|
+
customerId: ulid,
|
|
5580
|
+
});
|
|
5581
|
+
export const listCustomerEntitlementsQueryParams = z.object({
|
|
5582
|
+
page: z
|
|
5583
|
+
.object({
|
|
5584
|
+
size: z.coerce
|
|
5585
|
+
.number()
|
|
5586
|
+
.int()
|
|
5587
|
+
.optional()
|
|
5588
|
+
.describe('The number of items to include per page.'),
|
|
5589
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
5590
|
+
})
|
|
5591
|
+
.optional()
|
|
5592
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
5593
|
+
sort: sortQuery.optional(),
|
|
5594
|
+
filter: listCustomerEntitlementsParamsFilter.optional(),
|
|
5595
|
+
});
|
|
5596
|
+
export const listCustomerEntitlementsResponse = z.object({
|
|
5597
|
+
data: z.array(entitlement),
|
|
5598
|
+
meta: paginatedMeta,
|
|
5599
|
+
});
|
|
5560
5600
|
export const createCreditGrantPathParams = z.object({
|
|
5561
5601
|
customerId: ulid,
|
|
5562
5602
|
});
|
|
@@ -6598,6 +6638,25 @@ export const entitlementMeasureUsageFromPresetWire = z
|
|
|
6598
6638
|
export const entitlementHistoryWindowSizeWire = z
|
|
6599
6639
|
.union([z.literal('PT1H'), z.literal('P1D')])
|
|
6600
6640
|
.describe('The meter query granularities the usage history can be grouped into. Sub-hour windows are too expensive to compute and monthly windows are not supported.');
|
|
6641
|
+
export const stringFieldFilterExactWire = z
|
|
6642
|
+
.union([
|
|
6643
|
+
z.string(),
|
|
6644
|
+
z.strictObject({
|
|
6645
|
+
eq: z
|
|
6646
|
+
.string()
|
|
6647
|
+
.optional()
|
|
6648
|
+
.describe('Value strictly equals the given string value.'),
|
|
6649
|
+
oeq: z
|
|
6650
|
+
.array(z.string())
|
|
6651
|
+
.optional()
|
|
6652
|
+
.describe('Returns entities that exact match any of the comma-delimited phrases in the filter string.'),
|
|
6653
|
+
neq: z
|
|
6654
|
+
.string()
|
|
6655
|
+
.optional()
|
|
6656
|
+
.describe('Value does not equal the given string value.'),
|
|
6657
|
+
}),
|
|
6658
|
+
])
|
|
6659
|
+
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
6601
6660
|
export const createLabelsWire = z
|
|
6602
6661
|
.record(z.string(), z.string())
|
|
6603
6662
|
.describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
|
|
@@ -6619,25 +6678,6 @@ export const creditGrantStatusWire = z
|
|
|
6619
6678
|
export const validationIssueSeverityWire = z
|
|
6620
6679
|
.enum(['critical', 'warning'])
|
|
6621
6680
|
.describe('Severity level of a billing validation issue.');
|
|
6622
|
-
export const stringFieldFilterExactWire = z
|
|
6623
|
-
.union([
|
|
6624
|
-
z.string(),
|
|
6625
|
-
z.strictObject({
|
|
6626
|
-
eq: z
|
|
6627
|
-
.string()
|
|
6628
|
-
.optional()
|
|
6629
|
-
.describe('Value strictly equals the given string value.'),
|
|
6630
|
-
oeq: z
|
|
6631
|
-
.array(z.string())
|
|
6632
|
-
.optional()
|
|
6633
|
-
.describe('Returns entities that exact match any of the comma-delimited phrases in the filter string.'),
|
|
6634
|
-
neq: z
|
|
6635
|
-
.string()
|
|
6636
|
-
.optional()
|
|
6637
|
-
.describe('Value does not equal the given string value.'),
|
|
6638
|
-
}),
|
|
6639
|
-
])
|
|
6640
|
-
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
6641
6681
|
export const creditGrantVoidPaymentAdjustmentWire = z
|
|
6642
6682
|
.enum(['none'])
|
|
6643
6683
|
.describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
|
|
@@ -8442,6 +8482,20 @@ export const subscriptionEditStretchPhaseWire = z
|
|
|
8442
8482
|
export const entitlementMeasureUsageFromWire = z
|
|
8443
8483
|
.union([entitlementMeasureUsageFromPresetWire, dateTimeWire])
|
|
8444
8484
|
.describe('The time from which usage is measured, as a preset or an explicit timestamp.');
|
|
8485
|
+
export const getCreditBalanceParamsFilterWire = z
|
|
8486
|
+
.strictObject({
|
|
8487
|
+
currency: stringFieldFilterExactWire.optional(),
|
|
8488
|
+
feature_key: stringFieldFilterWire.optional(),
|
|
8489
|
+
})
|
|
8490
|
+
.describe('Filter options for getting a credit balance.');
|
|
8491
|
+
export const listPlansParamsFilterWire = z
|
|
8492
|
+
.strictObject({
|
|
8493
|
+
key: stringFieldFilterWire.optional(),
|
|
8494
|
+
name: stringFieldFilterWire.optional(),
|
|
8495
|
+
status: stringFieldFilterExactWire.optional(),
|
|
8496
|
+
currency: stringFieldFilterExactWire.optional(),
|
|
8497
|
+
})
|
|
8498
|
+
.describe('Filter options for listing plans.');
|
|
8445
8499
|
export const updateCreditGrantExternalSettlementRequestWire = z
|
|
8446
8500
|
.strictObject({
|
|
8447
8501
|
status: creditPurchasePaymentSettlementStatusWire,
|
|
@@ -8473,20 +8527,6 @@ export const validationIssueWire = z
|
|
|
8473
8527
|
.describe('Component that reported the validation issue, if applicable.'),
|
|
8474
8528
|
})
|
|
8475
8529
|
.describe('A validation issue found while processing a billing resource.');
|
|
8476
|
-
export const getCreditBalanceParamsFilterWire = z
|
|
8477
|
-
.strictObject({
|
|
8478
|
-
currency: stringFieldFilterExactWire.optional(),
|
|
8479
|
-
feature_key: stringFieldFilterWire.optional(),
|
|
8480
|
-
})
|
|
8481
|
-
.describe('Filter options for getting a credit balance.');
|
|
8482
|
-
export const listPlansParamsFilterWire = z
|
|
8483
|
-
.strictObject({
|
|
8484
|
-
key: stringFieldFilterWire.optional(),
|
|
8485
|
-
name: stringFieldFilterWire.optional(),
|
|
8486
|
-
status: stringFieldFilterExactWire.optional(),
|
|
8487
|
-
currency: stringFieldFilterExactWire.optional(),
|
|
8488
|
-
})
|
|
8489
|
-
.describe('Filter options for listing plans.');
|
|
8490
8530
|
export const voidCreditGrantRequestWire = z
|
|
8491
8531
|
.strictObject({
|
|
8492
8532
|
payment_adjustment: creditGrantVoidPaymentAdjustmentWire.optional(),
|
|
@@ -8908,6 +8948,13 @@ export const listCustomersParamsFilterWire = z
|
|
|
8908
8948
|
billing_profile_id: ulidFieldFilterWire.optional(),
|
|
8909
8949
|
})
|
|
8910
8950
|
.describe('Filter options for listing customers.');
|
|
8951
|
+
export const listCustomerEntitlementsParamsFilterWire = z
|
|
8952
|
+
.strictObject({
|
|
8953
|
+
feature_id: ulidFieldFilterWire.optional(),
|
|
8954
|
+
feature_key: stringFieldFilterExactWire.optional(),
|
|
8955
|
+
type: stringFieldFilterExactWire.optional(),
|
|
8956
|
+
})
|
|
8957
|
+
.describe('Filter options for listing customer entitlements.');
|
|
8911
8958
|
export const listSubscriptionsParamsFilterWire = z
|
|
8912
8959
|
.strictObject({
|
|
8913
8960
|
id: ulidFieldFilterWire.optional(),
|
|
@@ -10579,6 +10626,12 @@ export const createEntitlementRequestWire = z
|
|
|
10579
10626
|
createEntitlementBooleanRequestWire,
|
|
10580
10627
|
])
|
|
10581
10628
|
.describe('Entitlement create request.');
|
|
10629
|
+
export const entitlementPagePaginatedResponseWire = z
|
|
10630
|
+
.strictObject({
|
|
10631
|
+
data: z.array(entitlementWire),
|
|
10632
|
+
meta: paginatedMetaWire,
|
|
10633
|
+
})
|
|
10634
|
+
.describe('Page paginated response.');
|
|
10582
10635
|
export const workflowCollectionSettingsWire = z
|
|
10583
10636
|
.strictObject({
|
|
10584
10637
|
alignment: workflowCollectionAlignmentWire.optional(),
|
|
@@ -11740,6 +11793,36 @@ export const getCustomerEntitlementHistoryQueryParamsWire = z.object({
|
|
|
11740
11793
|
.describe('The IANA time zone the windows are aligned to.'),
|
|
11741
11794
|
});
|
|
11742
11795
|
export const getCustomerEntitlementHistoryResponseWire = entitlementHistoryWire;
|
|
11796
|
+
export const getCustomerEntitlementPathParamsWire = z.object({
|
|
11797
|
+
customerId: ulidWire,
|
|
11798
|
+
entitlementId: ulidWire,
|
|
11799
|
+
});
|
|
11800
|
+
export const getCustomerEntitlementResponseWire = entitlementWire;
|
|
11801
|
+
export const listCustomerEntitlementsPathParamsWire = z.object({
|
|
11802
|
+
customerId: ulidWire,
|
|
11803
|
+
});
|
|
11804
|
+
export const listCustomerEntitlementsQueryParamsWire = z.object({
|
|
11805
|
+
page: z
|
|
11806
|
+
.strictObject({
|
|
11807
|
+
size: z.coerce
|
|
11808
|
+
.number()
|
|
11809
|
+
.int()
|
|
11810
|
+
.optional()
|
|
11811
|
+
.describe('The number of items to include per page.'),
|
|
11812
|
+
number: z.coerce.number().int().optional().describe('The page number.'),
|
|
11813
|
+
})
|
|
11814
|
+
.optional()
|
|
11815
|
+
.describe('Determines which page of the collection to retrieve.'),
|
|
11816
|
+
sort: z
|
|
11817
|
+
.string()
|
|
11818
|
+
.optional()
|
|
11819
|
+
.describe('Sort entitlements returned in the response. Supported sort attributes are: - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
|
|
11820
|
+
filter: listCustomerEntitlementsParamsFilterWire.optional(),
|
|
11821
|
+
});
|
|
11822
|
+
export const listCustomerEntitlementsResponseWire = z.strictObject({
|
|
11823
|
+
data: z.array(entitlementWire),
|
|
11824
|
+
meta: paginatedMetaWire,
|
|
11825
|
+
});
|
|
11743
11826
|
export const createCreditGrantPathParamsWire = z.object({
|
|
11744
11827
|
customerId: ulidWire,
|
|
11745
11828
|
});
|
package/dist/models/types.d.ts
CHANGED
|
@@ -1881,6 +1881,26 @@ export interface SubscriptionEditStretchPhase {
|
|
|
1881
1881
|
/** The ISO-8601 duration to extend the phase by. */
|
|
1882
1882
|
extendBy: string;
|
|
1883
1883
|
}
|
|
1884
|
+
/** Filter options for getting a credit balance. */
|
|
1885
|
+
export interface GetCreditBalanceParamsFilter {
|
|
1886
|
+
/**
|
|
1887
|
+
* Filter credit balance by currency code. When historical custom currencies reuse
|
|
1888
|
+
* a code, each managed currency is returned as a separate balance row.
|
|
1889
|
+
*/
|
|
1890
|
+
currency?: StringFieldFilterExact;
|
|
1891
|
+
/**
|
|
1892
|
+
* Filter credit balance by feature key. Omit to return the total portfolio value.
|
|
1893
|
+
* Use `exists=false` to return only unrestricted balance.
|
|
1894
|
+
*/
|
|
1895
|
+
featureKey?: StringFieldFilter;
|
|
1896
|
+
}
|
|
1897
|
+
/** Filter options for listing plans. */
|
|
1898
|
+
export interface ListPlansParamsFilter {
|
|
1899
|
+
key?: StringFieldFilter;
|
|
1900
|
+
name?: StringFieldFilter;
|
|
1901
|
+
status?: StringFieldFilterExact;
|
|
1902
|
+
currency?: StringFieldFilterExact;
|
|
1903
|
+
}
|
|
1884
1904
|
/**
|
|
1885
1905
|
* Request body for updating the external payment settlement status of a credit
|
|
1886
1906
|
* grant.
|
|
@@ -1913,26 +1933,6 @@ export interface ValidationIssue {
|
|
|
1913
1933
|
/** Component that reported the validation issue, if applicable. */
|
|
1914
1934
|
component?: string;
|
|
1915
1935
|
}
|
|
1916
|
-
/** Filter options for getting a credit balance. */
|
|
1917
|
-
export interface GetCreditBalanceParamsFilter {
|
|
1918
|
-
/**
|
|
1919
|
-
* Filter credit balance by currency code. When historical custom currencies reuse
|
|
1920
|
-
* a code, each managed currency is returned as a separate balance row.
|
|
1921
|
-
*/
|
|
1922
|
-
currency?: StringFieldFilterExact;
|
|
1923
|
-
/**
|
|
1924
|
-
* Filter credit balance by feature key. Omit to return the total portfolio value.
|
|
1925
|
-
* Use `exists=false` to return only unrestricted balance.
|
|
1926
|
-
*/
|
|
1927
|
-
featureKey?: StringFieldFilter;
|
|
1928
|
-
}
|
|
1929
|
-
/** Filter options for listing plans. */
|
|
1930
|
-
export interface ListPlansParamsFilter {
|
|
1931
|
-
key?: StringFieldFilter;
|
|
1932
|
-
name?: StringFieldFilter;
|
|
1933
|
-
status?: StringFieldFilterExact;
|
|
1934
|
-
currency?: StringFieldFilterExact;
|
|
1935
|
-
}
|
|
1936
1936
|
/** Request body for voiding a credit grant. */
|
|
1937
1937
|
export interface VoidCreditGrantRequest {
|
|
1938
1938
|
/**
|
|
@@ -2523,6 +2523,15 @@ export interface ListCustomersParamsFilter {
|
|
|
2523
2523
|
planKey?: StringFieldFilter;
|
|
2524
2524
|
billingProfileId?: UlidFieldFilter;
|
|
2525
2525
|
}
|
|
2526
|
+
/** Filter options for listing customer entitlements. */
|
|
2527
|
+
export interface ListCustomerEntitlementsParamsFilter {
|
|
2528
|
+
/** Filter entitlements by feature ID. */
|
|
2529
|
+
featureId?: UlidFieldFilter;
|
|
2530
|
+
/** Filter entitlements by feature key. */
|
|
2531
|
+
featureKey?: StringFieldFilterExact;
|
|
2532
|
+
/** Filter entitlements by type (`metered`, `static` or `boolean`). */
|
|
2533
|
+
type?: StringFieldFilterExact;
|
|
2534
|
+
}
|
|
2526
2535
|
/** Filter options for listing subscriptions. */
|
|
2527
2536
|
export interface ListSubscriptionsParamsFilter {
|
|
2528
2537
|
id?: UlidFieldFilter;
|
|
@@ -4948,6 +4957,11 @@ export interface CustomerStripeCreateCheckoutSessionRequest {
|
|
|
4948
4957
|
*/
|
|
4949
4958
|
stripeOptions: AppStripeCreateCheckoutSessionRequestOptions;
|
|
4950
4959
|
}
|
|
4960
|
+
/** Page paginated response. */
|
|
4961
|
+
export interface EntitlementPagePaginatedResponse {
|
|
4962
|
+
data: Entitlement[];
|
|
4963
|
+
meta: PaginatedMeta;
|
|
4964
|
+
}
|
|
4951
4965
|
/**
|
|
4952
4966
|
* Workflow collection specifies how to collect the pending line items for an
|
|
4953
4967
|
* invoice.
|
|
@@ -7811,6 +7825,11 @@ export interface CustomerStripeCreateCheckoutSessionRequestInput {
|
|
|
7811
7825
|
*/
|
|
7812
7826
|
stripeOptions: AppStripeCreateCheckoutSessionRequestOptionsInput;
|
|
7813
7827
|
}
|
|
7828
|
+
/** Page paginated response. */
|
|
7829
|
+
export interface EntitlementPagePaginatedResponseInput {
|
|
7830
|
+
data: EntitlementInput[];
|
|
7831
|
+
meta: PaginatedMeta;
|
|
7832
|
+
}
|
|
7814
7833
|
/**
|
|
7815
7834
|
* Workflow collection specifies how to collect the pending line items for an
|
|
7816
7835
|
* invoice.
|
package/dist/sdk/internal.d.ts
CHANGED
|
@@ -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, VoidCreditGrantRequest, VoidCreditGrantResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
3
|
+
import type { CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, 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';
|
|
@@ -9,7 +9,7 @@ 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 { AppCatalogItem, Charge, CostBasis, Currency, Invoice, PlanAddon } from '../models/types.js';
|
|
12
|
+
import type { AppCatalogItem, Charge, CostBasis, Currency, Entitlement, Invoice, PlanAddon } from '../models/types.js';
|
|
13
13
|
/**
|
|
14
14
|
* Operations marked internal in the API definition. They are not part of
|
|
15
15
|
* the customer surface: they may require additional permissions, and they
|
|
@@ -76,6 +76,37 @@ export declare class InternalCustomersEntitlements {
|
|
|
76
76
|
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history
|
|
77
77
|
*/
|
|
78
78
|
getHistory(request: GetCustomerEntitlementHistoryRequest, options?: RequestOptions): Promise<GetCustomerEntitlementHistoryResponse>;
|
|
79
|
+
/**
|
|
80
|
+
* Get customer entitlement
|
|
81
|
+
*
|
|
82
|
+
* Get an entitlement of the customer by ID. For checking entitlement access, use
|
|
83
|
+
* the entitlement access endpoints instead.
|
|
84
|
+
*
|
|
85
|
+
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}
|
|
86
|
+
*/
|
|
87
|
+
get(request: GetCustomerEntitlementRequest, options?: RequestOptions): Promise<GetCustomerEntitlementResponse>;
|
|
88
|
+
/**
|
|
89
|
+
* List customer entitlements
|
|
90
|
+
*
|
|
91
|
+
* List the entitlements of the customer that are active at the time of the
|
|
92
|
+
* request. For checking entitlement access, use the entitlement access endpoints
|
|
93
|
+
* instead.
|
|
94
|
+
*
|
|
95
|
+
* GET /openmeter/customers/{customerId}/entitlements
|
|
96
|
+
*/
|
|
97
|
+
list(request: ListCustomerEntitlementsRequest, options?: RequestOptions): Promise<ListCustomerEntitlementsResponse>;
|
|
98
|
+
/**
|
|
99
|
+
* List customer entitlements
|
|
100
|
+
*
|
|
101
|
+
* List the entitlements of the customer that are active at the time of the
|
|
102
|
+
* request. For checking entitlement access, use the entitlement access endpoints
|
|
103
|
+
* instead.
|
|
104
|
+
*
|
|
105
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
106
|
+
*
|
|
107
|
+
* GET /openmeter/customers/{customerId}/entitlements
|
|
108
|
+
*/
|
|
109
|
+
listAll(request: ListCustomerEntitlementsRequest, options?: RequestOptions): AsyncIterable<Entitlement>;
|
|
79
110
|
}
|
|
80
111
|
export declare class InternalCustomersCredits {
|
|
81
112
|
private readonly _client;
|
package/dist/sdk/internal.js
CHANGED
|
@@ -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, voidCreditGrant, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
4
|
+
import { createCustomerEntitlement, getCustomerEntitlementHistory, getCustomerEntitlement, listCustomerEntitlements, 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';
|
|
@@ -110,6 +110,43 @@ export class InternalCustomersEntitlements {
|
|
|
110
110
|
async getHistory(request, options) {
|
|
111
111
|
return unwrap(await getCustomerEntitlementHistory(this._client, request, options));
|
|
112
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Get customer entitlement
|
|
115
|
+
*
|
|
116
|
+
* Get an entitlement of the customer by ID. For checking entitlement access, use
|
|
117
|
+
* the entitlement access endpoints instead.
|
|
118
|
+
*
|
|
119
|
+
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}
|
|
120
|
+
*/
|
|
121
|
+
async get(request, options) {
|
|
122
|
+
return unwrap(await getCustomerEntitlement(this._client, request, options));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* List customer entitlements
|
|
126
|
+
*
|
|
127
|
+
* List the entitlements of the customer that are active at the time of the
|
|
128
|
+
* request. For checking entitlement access, use the entitlement access endpoints
|
|
129
|
+
* instead.
|
|
130
|
+
*
|
|
131
|
+
* GET /openmeter/customers/{customerId}/entitlements
|
|
132
|
+
*/
|
|
133
|
+
async list(request, options) {
|
|
134
|
+
return unwrap(await listCustomerEntitlements(this._client, request, options));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* List customer entitlements
|
|
138
|
+
*
|
|
139
|
+
* List the entitlements of the customer that are active at the time of the
|
|
140
|
+
* request. For checking entitlement access, use the entitlement access endpoints
|
|
141
|
+
* instead.
|
|
142
|
+
*
|
|
143
|
+
* Iterates every item across all pages, fetching more as the returned iterable is consumed.
|
|
144
|
+
*
|
|
145
|
+
* GET /openmeter/customers/{customerId}/entitlements
|
|
146
|
+
*/
|
|
147
|
+
listAll(request, options) {
|
|
148
|
+
return paginatePages((req, opts) => listCustomerEntitlements(this._client, req, opts), request, options);
|
|
149
|
+
}
|
|
113
150
|
}
|
|
114
151
|
export class InternalCustomersCredits {
|
|
115
152
|
_client;
|