@openmeter/sdk 1.0.0-beta.72 → 1.0.0-beta.73
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/dist/cjs/schemas/openapi.d.cts +99 -99
- package/dist/cjs/{tsconfig.0bf9d10b.tsbuildinfo → tsconfig.f8b03342.tsbuildinfo} +1 -1
- package/dist/cjs/{tsconfig.6d7b8953.tsbuildinfo → tsconfig.f9b53874.tsbuildinfo} +1 -1
- package/dist/schemas/openapi.d.ts +99 -99
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -163,53 +163,53 @@ export interface paths {
|
|
|
163
163
|
* Get the balance of a specific subject.
|
|
164
164
|
* @description Get the balance of a specific subject.
|
|
165
165
|
*/
|
|
166
|
-
get: operations['
|
|
166
|
+
get: operations['getLedgerBalance'];
|
|
167
167
|
};
|
|
168
168
|
'/api/v1/ledgers/{ledgerID}/history': {
|
|
169
169
|
/**
|
|
170
|
-
* Get
|
|
171
|
-
* @description Get
|
|
170
|
+
* Get the history of a ledger
|
|
171
|
+
* @description Get the history of a specific ledger
|
|
172
172
|
*/
|
|
173
|
-
get: operations['
|
|
173
|
+
get: operations['getLedgerHistory'];
|
|
174
174
|
};
|
|
175
175
|
'/api/v1/ledgers/{ledgerID}/reset': {
|
|
176
176
|
/**
|
|
177
|
-
* Reset
|
|
178
|
-
* @description Resets the
|
|
177
|
+
* Reset the ledger's balance
|
|
178
|
+
* @description Resets the ledger's balances to zero for a specific subject and re-apply active grants with rollover configuration.
|
|
179
179
|
*/
|
|
180
|
-
post: operations['
|
|
180
|
+
post: operations['resetLedger'];
|
|
181
181
|
};
|
|
182
182
|
'/api/v1/ledgers/grants': {
|
|
183
183
|
/**
|
|
184
|
-
* List
|
|
185
|
-
* @description List
|
|
184
|
+
* List grants for multiple ledgers.
|
|
185
|
+
* @description List grants for multiple ledgers.
|
|
186
186
|
*/
|
|
187
|
-
get: operations['
|
|
187
|
+
get: operations['listLedgerGrants'];
|
|
188
188
|
};
|
|
189
189
|
'/api/v1/ledgers/{ledgerID}/grants': {
|
|
190
190
|
/**
|
|
191
|
-
* List
|
|
192
|
-
* @description List
|
|
191
|
+
* List ledger grants
|
|
192
|
+
* @description List ledger grants for a specific ledger.
|
|
193
193
|
*/
|
|
194
|
-
get: operations['
|
|
194
|
+
get: operations['listLedgerGrantsByLedger'];
|
|
195
195
|
/**
|
|
196
|
-
* Create
|
|
197
|
-
* @description
|
|
196
|
+
* Create a grant on a specific ledger.
|
|
197
|
+
* @description Create a grant on a specific ledger.
|
|
198
198
|
*/
|
|
199
|
-
post: operations['
|
|
199
|
+
post: operations['createLedgerGrant'];
|
|
200
200
|
};
|
|
201
|
-
'/api/v1/ledgers/{ledgerID}/grants/{
|
|
201
|
+
'/api/v1/ledgers/{ledgerID}/grants/{ledgerGrantID}': {
|
|
202
202
|
/**
|
|
203
|
-
* Get
|
|
204
|
-
* @description
|
|
203
|
+
* Get a single grant.
|
|
204
|
+
* @description Gets the grant for a ledger by ID.
|
|
205
205
|
*/
|
|
206
|
-
get: operations['
|
|
206
|
+
get: operations['getLedgerGrant'];
|
|
207
207
|
/**
|
|
208
|
-
* Void
|
|
209
|
-
* @description Void a
|
|
210
|
-
* Voided
|
|
208
|
+
* Void ledger grant
|
|
209
|
+
* @description Void a ledger grant by ID. Partially or fully used grants cannot be voided.
|
|
210
|
+
* Voided grant won't be applied to the subject's balance anymore.
|
|
211
211
|
*/
|
|
212
|
-
delete: operations['
|
|
212
|
+
delete: operations['voidLedgerGrant'];
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
export type webhooks = Record<string, never>;
|
|
@@ -395,7 +395,7 @@ export interface components {
|
|
|
395
395
|
* subject.
|
|
396
396
|
*/
|
|
397
397
|
CreateLedger: {
|
|
398
|
-
/** @description The metering subject this ledger used to track
|
|
398
|
+
/** @description The metering subject this ledger used to track grants for. */
|
|
399
399
|
subject: string;
|
|
400
400
|
/**
|
|
401
401
|
* @example {
|
|
@@ -415,15 +415,15 @@ export interface components {
|
|
|
415
415
|
*/
|
|
416
416
|
id: string;
|
|
417
417
|
};
|
|
418
|
-
/** @description
|
|
419
|
-
|
|
418
|
+
/** @description A ledger entry. */
|
|
419
|
+
LedgerEntry: {
|
|
420
420
|
/**
|
|
421
421
|
* @description Readonly unique ULID identifier of the ledger entry.
|
|
422
422
|
*
|
|
423
423
|
* @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
|
|
424
424
|
*/
|
|
425
425
|
id: string;
|
|
426
|
-
type: components['schemas']['
|
|
426
|
+
type: components['schemas']['LedgerEntryType'];
|
|
427
427
|
/**
|
|
428
428
|
* Format: date-time
|
|
429
429
|
* @description The time the ledger entry was created.
|
|
@@ -460,16 +460,16 @@ export interface components {
|
|
|
460
460
|
* @example GRANT
|
|
461
461
|
* @enum {string}
|
|
462
462
|
*/
|
|
463
|
-
|
|
464
|
-
/** @description
|
|
465
|
-
|
|
463
|
+
LedgerEntryType: 'GRANT' | 'VOID' | 'RESET' | 'GRANT_USAGE';
|
|
464
|
+
/** @description Balance of a subject. */
|
|
465
|
+
LedgerBalance: {
|
|
466
466
|
/** @description Features with balances. */
|
|
467
467
|
features?: components['schemas']['FeatureBalance'][];
|
|
468
468
|
/** @description The grants applied to the subject. */
|
|
469
|
-
grants: components['schemas']['
|
|
469
|
+
grants: components['schemas']['LedgerGrantBalance'][];
|
|
470
470
|
};
|
|
471
|
-
/** @description
|
|
472
|
-
|
|
471
|
+
/** @description Ledger reset configuration. */
|
|
472
|
+
LedgerReset: {
|
|
473
473
|
/**
|
|
474
474
|
* @description Readonly unique ULID identifier of the reset.
|
|
475
475
|
*
|
|
@@ -478,13 +478,13 @@ export interface components {
|
|
|
478
478
|
id: string;
|
|
479
479
|
/**
|
|
480
480
|
* Format: date-time
|
|
481
|
-
* @description The time to reset the
|
|
481
|
+
* @description The time to reset the ledger. It cannot be in the future.
|
|
482
482
|
*
|
|
483
483
|
* @example 2023-01-01T00:00:00Z
|
|
484
484
|
*/
|
|
485
485
|
effectiveAt: string;
|
|
486
486
|
};
|
|
487
|
-
|
|
487
|
+
LedgerGrantBalance: components['schemas']['LedgerGrantResponse'] & {
|
|
488
488
|
/**
|
|
489
489
|
* @description The balance of the grant.
|
|
490
490
|
*
|
|
@@ -501,14 +501,14 @@ export interface components {
|
|
|
501
501
|
balance?: number;
|
|
502
502
|
};
|
|
503
503
|
/** @description Grants are used to increase balance of specific subjects. */
|
|
504
|
-
|
|
504
|
+
CreateLedgerGrantRequest: {
|
|
505
505
|
/**
|
|
506
506
|
* @description Readonly unique ULID identifier of the grant.
|
|
507
507
|
*
|
|
508
508
|
* @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
|
|
509
509
|
*/
|
|
510
510
|
id: string;
|
|
511
|
-
type: components['schemas']['
|
|
511
|
+
type: components['schemas']['LedgerGrantType'];
|
|
512
512
|
/**
|
|
513
513
|
* @description The amount to grant. Can be positive or negative number.
|
|
514
514
|
*
|
|
@@ -526,8 +526,8 @@ export interface components {
|
|
|
526
526
|
* Priority is a positive decimal numbers. With lower numbers indicating higher importance.
|
|
527
527
|
* For example, a priority of 1 is more urgent than a priority of 2.
|
|
528
528
|
* When there are several grants available for the same subject, the system selects the grant with the highest priority.
|
|
529
|
-
* In cases where
|
|
530
|
-
* In the case of two
|
|
529
|
+
* In cases where grants share the same priority level, the grant closest to its expiration will be used first.
|
|
530
|
+
* In the case of two grants have identical priorities and expiration dates, the system will use the grant that was created first.
|
|
531
531
|
*
|
|
532
532
|
* @default 1
|
|
533
533
|
* @example 1
|
|
@@ -540,8 +540,8 @@ export interface components {
|
|
|
540
540
|
* @example 2023-01-01T00:00:00Z
|
|
541
541
|
*/
|
|
542
542
|
effectiveAt: string;
|
|
543
|
-
expiration: components['schemas']['
|
|
544
|
-
rollover?: components['schemas']['
|
|
543
|
+
expiration: components['schemas']['LedgerGrantExpirationPeriod'];
|
|
544
|
+
rollover?: components['schemas']['LedgerGrantRollover'];
|
|
545
545
|
/**
|
|
546
546
|
* @example {
|
|
547
547
|
* "stripePaymentId": "pi_4OrAkhLvyihio9p51h9iiFnB"
|
|
@@ -551,7 +551,7 @@ export interface components {
|
|
|
551
551
|
[key: string]: string;
|
|
552
552
|
};
|
|
553
553
|
};
|
|
554
|
-
|
|
554
|
+
LedgerGrantResponse: components['schemas']['CreateLedgerGrantRequest'] & {
|
|
555
555
|
/**
|
|
556
556
|
* @description The subject to grant the amount to.
|
|
557
557
|
*
|
|
@@ -573,10 +573,10 @@ export interface components {
|
|
|
573
573
|
* @example USAGE
|
|
574
574
|
* @enum {string}
|
|
575
575
|
*/
|
|
576
|
-
|
|
576
|
+
LedgerGrantType: 'USAGE';
|
|
577
577
|
/** @description Grant rollover configuration. */
|
|
578
|
-
|
|
579
|
-
type: components['schemas']['
|
|
578
|
+
LedgerGrantRollover: {
|
|
579
|
+
type: components['schemas']['LedgerGrantRolloverType'];
|
|
580
580
|
/** @description Maximum amount to rollover. */
|
|
581
581
|
maxAmount?: number;
|
|
582
582
|
};
|
|
@@ -588,9 +588,9 @@ export interface components {
|
|
|
588
588
|
* @example ORIGINAL_AMOUNT
|
|
589
589
|
* @enum {string}
|
|
590
590
|
*/
|
|
591
|
-
|
|
592
|
-
/** @description Expiration period of a
|
|
593
|
-
|
|
591
|
+
LedgerGrantRolloverType: 'REMAINING_AMOUNT' | 'ORIGINAL_AMOUNT';
|
|
592
|
+
/** @description Expiration period of a ledger grant. */
|
|
593
|
+
LedgerGrantExpirationPeriod: {
|
|
594
594
|
/**
|
|
595
595
|
* @description The expiration period duration like month.
|
|
596
596
|
*
|
|
@@ -892,12 +892,12 @@ export interface components {
|
|
|
892
892
|
subjectIdOrKey: string;
|
|
893
893
|
/** @description A unique ULID identifier for a feature. */
|
|
894
894
|
featureID: string;
|
|
895
|
-
/** @description A unique identifier for a
|
|
896
|
-
|
|
897
|
-
/** @description A unique identifier for a
|
|
895
|
+
/** @description A unique identifier for a ledger grant. */
|
|
896
|
+
ledgerGrantID: string;
|
|
897
|
+
/** @description A unique identifier for a ledger. */
|
|
898
898
|
ledgerID: string;
|
|
899
899
|
/** @description Number of entries to return */
|
|
900
|
-
|
|
900
|
+
ledgerQueryLimit?: number;
|
|
901
901
|
/**
|
|
902
902
|
* @description Start date-time in RFC 3339 format.
|
|
903
903
|
* Inclusive.
|
|
@@ -1483,7 +1483,7 @@ export interface operations {
|
|
|
1483
1483
|
* Get the balance of a specific subject.
|
|
1484
1484
|
* @description Get the balance of a specific subject.
|
|
1485
1485
|
*/
|
|
1486
|
-
|
|
1486
|
+
getLedgerBalance: {
|
|
1487
1487
|
parameters: {
|
|
1488
1488
|
query?: {
|
|
1489
1489
|
/** @description Point of time to query balances: date-time in RFC 3339 format. Defaults to now. */
|
|
@@ -1494,10 +1494,10 @@ export interface operations {
|
|
|
1494
1494
|
};
|
|
1495
1495
|
};
|
|
1496
1496
|
responses: {
|
|
1497
|
-
/** @description
|
|
1497
|
+
/** @description Ledger balances available. */
|
|
1498
1498
|
200: {
|
|
1499
1499
|
content: {
|
|
1500
|
-
'application/json': components['schemas']['
|
|
1500
|
+
'application/json': components['schemas']['LedgerBalance'];
|
|
1501
1501
|
};
|
|
1502
1502
|
};
|
|
1503
1503
|
401: components['responses']['UnauthorizedProblemResponse'];
|
|
@@ -1506,13 +1506,13 @@ export interface operations {
|
|
|
1506
1506
|
};
|
|
1507
1507
|
};
|
|
1508
1508
|
/**
|
|
1509
|
-
* Get
|
|
1510
|
-
* @description Get
|
|
1509
|
+
* Get the history of a ledger
|
|
1510
|
+
* @description Get the history of a specific ledger
|
|
1511
1511
|
*/
|
|
1512
|
-
|
|
1512
|
+
getLedgerHistory: {
|
|
1513
1513
|
parameters: {
|
|
1514
1514
|
query: {
|
|
1515
|
-
limit?: components['parameters']['
|
|
1515
|
+
limit?: components['parameters']['ledgerQueryLimit'];
|
|
1516
1516
|
/** @description Start of time range to query ledger: date-time in RFC 3339 format. */
|
|
1517
1517
|
from: string;
|
|
1518
1518
|
/** @description End of time range to query ledger: date-time in RFC 3339 format. Defaults to now. */
|
|
@@ -1523,10 +1523,10 @@ export interface operations {
|
|
|
1523
1523
|
};
|
|
1524
1524
|
};
|
|
1525
1525
|
responses: {
|
|
1526
|
-
/** @description
|
|
1526
|
+
/** @description Ledger balance history. */
|
|
1527
1527
|
200: {
|
|
1528
1528
|
content: {
|
|
1529
|
-
'application/json': components['schemas']['
|
|
1529
|
+
'application/json': components['schemas']['LedgerEntry'][];
|
|
1530
1530
|
};
|
|
1531
1531
|
};
|
|
1532
1532
|
401: components['responses']['UnauthorizedProblemResponse'];
|
|
@@ -1535,10 +1535,10 @@ export interface operations {
|
|
|
1535
1535
|
};
|
|
1536
1536
|
};
|
|
1537
1537
|
/**
|
|
1538
|
-
* Reset
|
|
1539
|
-
* @description Resets the
|
|
1538
|
+
* Reset the ledger's balance
|
|
1539
|
+
* @description Resets the ledger's balances to zero for a specific subject and re-apply active grants with rollover configuration.
|
|
1540
1540
|
*/
|
|
1541
|
-
|
|
1541
|
+
resetLedger: {
|
|
1542
1542
|
parameters: {
|
|
1543
1543
|
path: {
|
|
1544
1544
|
ledgerID: components['parameters']['ledgerID'];
|
|
@@ -1547,14 +1547,14 @@ export interface operations {
|
|
|
1547
1547
|
/** @description Details for the reset. */
|
|
1548
1548
|
requestBody: {
|
|
1549
1549
|
content: {
|
|
1550
|
-
'application/json': components['schemas']['
|
|
1550
|
+
'application/json': components['schemas']['LedgerReset'];
|
|
1551
1551
|
};
|
|
1552
1552
|
};
|
|
1553
1553
|
responses: {
|
|
1554
|
-
/** @description
|
|
1554
|
+
/** @description Ledger balance reset. */
|
|
1555
1555
|
201: {
|
|
1556
1556
|
content: {
|
|
1557
|
-
'application/json': components['schemas']['
|
|
1557
|
+
'application/json': components['schemas']['LedgerReset'];
|
|
1558
1558
|
};
|
|
1559
1559
|
};
|
|
1560
1560
|
400: components['responses']['BadRequestProblemResponse'];
|
|
@@ -1564,21 +1564,21 @@ export interface operations {
|
|
|
1564
1564
|
};
|
|
1565
1565
|
};
|
|
1566
1566
|
/**
|
|
1567
|
-
* List
|
|
1568
|
-
* @description List
|
|
1567
|
+
* List grants for multiple ledgers.
|
|
1568
|
+
* @description List grants for multiple ledgers.
|
|
1569
1569
|
*/
|
|
1570
|
-
|
|
1570
|
+
listLedgerGrants: {
|
|
1571
1571
|
parameters: {
|
|
1572
1572
|
query?: {
|
|
1573
1573
|
ledgerID?: components['parameters']['queryFilterLedgerID'];
|
|
1574
|
-
limit?: components['parameters']['
|
|
1574
|
+
limit?: components['parameters']['ledgerQueryLimit'];
|
|
1575
1575
|
};
|
|
1576
1576
|
};
|
|
1577
1577
|
responses: {
|
|
1578
|
-
/** @description List of
|
|
1578
|
+
/** @description List of ledger grants. */
|
|
1579
1579
|
200: {
|
|
1580
1580
|
content: {
|
|
1581
|
-
'application/json': components['schemas']['
|
|
1581
|
+
'application/json': components['schemas']['LedgerGrantResponse'][];
|
|
1582
1582
|
};
|
|
1583
1583
|
};
|
|
1584
1584
|
400: components['responses']['BadRequestProblemResponse'];
|
|
@@ -1587,23 +1587,23 @@ export interface operations {
|
|
|
1587
1587
|
};
|
|
1588
1588
|
};
|
|
1589
1589
|
/**
|
|
1590
|
-
* List
|
|
1591
|
-
* @description List
|
|
1590
|
+
* List ledger grants
|
|
1591
|
+
* @description List ledger grants for a specific ledger.
|
|
1592
1592
|
*/
|
|
1593
|
-
|
|
1593
|
+
listLedgerGrantsByLedger: {
|
|
1594
1594
|
parameters: {
|
|
1595
1595
|
query?: {
|
|
1596
|
-
limit?: components['parameters']['
|
|
1596
|
+
limit?: components['parameters']['ledgerQueryLimit'];
|
|
1597
1597
|
};
|
|
1598
1598
|
path: {
|
|
1599
1599
|
ledgerID: components['parameters']['ledgerID'];
|
|
1600
1600
|
};
|
|
1601
1601
|
};
|
|
1602
1602
|
responses: {
|
|
1603
|
-
/** @description List of
|
|
1603
|
+
/** @description List of ledger grants created. */
|
|
1604
1604
|
200: {
|
|
1605
1605
|
content: {
|
|
1606
|
-
'application/json': components['schemas']['
|
|
1606
|
+
'application/json': components['schemas']['LedgerGrantResponse'][];
|
|
1607
1607
|
};
|
|
1608
1608
|
};
|
|
1609
1609
|
400: components['responses']['BadRequestProblemResponse'];
|
|
@@ -1612,26 +1612,26 @@ export interface operations {
|
|
|
1612
1612
|
};
|
|
1613
1613
|
};
|
|
1614
1614
|
/**
|
|
1615
|
-
* Create
|
|
1616
|
-
* @description
|
|
1615
|
+
* Create a grant on a specific ledger.
|
|
1616
|
+
* @description Create a grant on a specific ledger.
|
|
1617
1617
|
*/
|
|
1618
|
-
|
|
1618
|
+
createLedgerGrant: {
|
|
1619
1619
|
parameters: {
|
|
1620
1620
|
path: {
|
|
1621
1621
|
ledgerID: components['parameters']['ledgerID'];
|
|
1622
1622
|
};
|
|
1623
1623
|
};
|
|
1624
|
-
/** @description The
|
|
1624
|
+
/** @description The grant to create. */
|
|
1625
1625
|
requestBody: {
|
|
1626
1626
|
content: {
|
|
1627
|
-
'application/json': components['schemas']['
|
|
1627
|
+
'application/json': components['schemas']['CreateLedgerGrantRequest'];
|
|
1628
1628
|
};
|
|
1629
1629
|
};
|
|
1630
1630
|
responses: {
|
|
1631
|
-
/** @description
|
|
1631
|
+
/** @description LedgerGrant created. */
|
|
1632
1632
|
201: {
|
|
1633
1633
|
content: {
|
|
1634
|
-
'application/json': components['schemas']['
|
|
1634
|
+
'application/json': components['schemas']['LedgerGrantResponse'];
|
|
1635
1635
|
};
|
|
1636
1636
|
};
|
|
1637
1637
|
400: components['responses']['BadRequestProblemResponse'];
|
|
@@ -1640,21 +1640,21 @@ export interface operations {
|
|
|
1640
1640
|
};
|
|
1641
1641
|
};
|
|
1642
1642
|
/**
|
|
1643
|
-
* Get
|
|
1644
|
-
* @description
|
|
1643
|
+
* Get a single grant.
|
|
1644
|
+
* @description Gets the grant for a ledger by ID.
|
|
1645
1645
|
*/
|
|
1646
|
-
|
|
1646
|
+
getLedgerGrant: {
|
|
1647
1647
|
parameters: {
|
|
1648
1648
|
path: {
|
|
1649
1649
|
ledgerID: components['parameters']['ledgerID'];
|
|
1650
|
-
|
|
1650
|
+
ledgerGrantID: components['parameters']['ledgerGrantID'];
|
|
1651
1651
|
};
|
|
1652
1652
|
};
|
|
1653
1653
|
responses: {
|
|
1654
|
-
/** @description
|
|
1654
|
+
/** @description Ledger grant found. */
|
|
1655
1655
|
200: {
|
|
1656
1656
|
content: {
|
|
1657
|
-
'application/json': components['schemas']['
|
|
1657
|
+
'application/json': components['schemas']['LedgerGrantResponse'];
|
|
1658
1658
|
};
|
|
1659
1659
|
};
|
|
1660
1660
|
401: components['responses']['UnauthorizedProblemResponse'];
|
|
@@ -1663,19 +1663,19 @@ export interface operations {
|
|
|
1663
1663
|
};
|
|
1664
1664
|
};
|
|
1665
1665
|
/**
|
|
1666
|
-
* Void
|
|
1667
|
-
* @description Void a
|
|
1668
|
-
* Voided
|
|
1666
|
+
* Void ledger grant
|
|
1667
|
+
* @description Void a ledger grant by ID. Partially or fully used grants cannot be voided.
|
|
1668
|
+
* Voided grant won't be applied to the subject's balance anymore.
|
|
1669
1669
|
*/
|
|
1670
|
-
|
|
1670
|
+
voidLedgerGrant: {
|
|
1671
1671
|
parameters: {
|
|
1672
1672
|
path: {
|
|
1673
|
-
|
|
1673
|
+
ledgerGrantID: components['parameters']['ledgerGrantID'];
|
|
1674
1674
|
ledgerID: components['parameters']['ledgerID'];
|
|
1675
1675
|
};
|
|
1676
1676
|
};
|
|
1677
1677
|
responses: {
|
|
1678
|
-
/** @description
|
|
1678
|
+
/** @description Ledger grant voided. */
|
|
1679
1679
|
204: {
|
|
1680
1680
|
content: never;
|
|
1681
1681
|
};
|