@raystack/frontier 0.19.0 → 0.21.0

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/index.mjs CHANGED
@@ -298,6 +298,23 @@ var V1Beta1 = class extends HttpClient {
298
298
  type: "application/json" /* Json */,
299
299
  format: "json"
300
300
  }, params));
301
+ /**
302
+ * @description Checkout a product to buy it one time or start a subscription plan on a billing account manually. It bypasses billing engine.
303
+ *
304
+ * @tags Checkout
305
+ * @name AdminServiceDelegatedCheckout2
306
+ * @summary Checkout a product or subscription
307
+ * @request POST:/v1beta1/admin/organizations/{org_id}/billing/checkouts
308
+ * @secure
309
+ */
310
+ this.adminServiceDelegatedCheckout2 = (orgId, body, params = {}) => this.request(__spreadValues({
311
+ path: `/v1beta1/admin/organizations/${orgId}/billing/checkouts`,
312
+ method: "POST",
313
+ body,
314
+ secure: true,
315
+ type: "application/json" /* Json */,
316
+ format: "json"
317
+ }, params));
301
318
  /**
302
319
  * @description Lists all the users added to the platform.
303
320
  *
@@ -1364,6 +1381,21 @@ var V1Beta1 = class extends HttpClient {
1364
1381
  type: "application/json" /* Json */,
1365
1382
  format: "json"
1366
1383
  }, params));
1384
+ /**
1385
+ * @description Get a checkout by ID.
1386
+ *
1387
+ * @tags Checkout
1388
+ * @name FrontierServiceGetCheckout
1389
+ * @summary Get checkout
1390
+ * @request GET:/v1beta1/organizations/{org_id}/billing/{billing_id}/checkouts/{id}
1391
+ * @secure
1392
+ */
1393
+ this.frontierServiceGetCheckout = (orgId, billingId, id, params = {}) => this.request(__spreadValues({
1394
+ path: `/v1beta1/organizations/${orgId}/billing/${billingId}/checkouts/${id}`,
1395
+ method: "GET",
1396
+ secure: true,
1397
+ format: "json"
1398
+ }, params));
1367
1399
  /**
1368
1400
  * @description List all invoices of a billing account.
1369
1401
  *
@@ -1574,6 +1606,38 @@ var V1Beta1 = class extends HttpClient {
1574
1606
  secure: true,
1575
1607
  format: "json"
1576
1608
  }, params));
1609
+ /**
1610
+ * @description Disable a billing account by ID. Disabling a billing account doesn't automatically disable it's active subscriptions.
1611
+ *
1612
+ * @tags Billing
1613
+ * @name FrontierServiceDisableBillingAccount
1614
+ * @summary Disable billing account
1615
+ * @request POST:/v1beta1/organizations/{org_id}/billing/{id}/disable
1616
+ * @secure
1617
+ */
1618
+ this.frontierServiceDisableBillingAccount = (orgId, id, body, params = {}) => this.request(__spreadValues({
1619
+ path: `/v1beta1/organizations/${orgId}/billing/${id}/disable`,
1620
+ method: "POST",
1621
+ body,
1622
+ secure: true,
1623
+ format: "json"
1624
+ }, params));
1625
+ /**
1626
+ * @description Enable a billing account by ID.
1627
+ *
1628
+ * @tags Billing
1629
+ * @name FrontierServiceEnableBillingAccount
1630
+ * @summary Enable billing account
1631
+ * @request POST:/v1beta1/organizations/{org_id}/billing/{id}/enable
1632
+ * @secure
1633
+ */
1634
+ this.frontierServiceEnableBillingAccount = (orgId, id, body, params = {}) => this.request(__spreadValues({
1635
+ path: `/v1beta1/organizations/${orgId}/billing/${id}/enable`,
1636
+ method: "POST",
1637
+ body,
1638
+ secure: true,
1639
+ format: "json"
1640
+ }, params));
1577
1641
  /**
1578
1642
  * @description Check if a billing account has trialed.
1579
1643
  *
@@ -1589,6 +1653,71 @@ var V1Beta1 = class extends HttpClient {
1589
1653
  secure: true,
1590
1654
  format: "json"
1591
1655
  }, params));
1656
+ /**
1657
+ * @description Register a billing account to a provider if it's not already.
1658
+ *
1659
+ * @tags Billing
1660
+ * @name FrontierServiceRegisterBillingAccount
1661
+ * @summary Register billing account to provider
1662
+ * @request POST:/v1beta1/organizations/{org_id}/billing/{id}/register
1663
+ * @secure
1664
+ */
1665
+ this.frontierServiceRegisterBillingAccount = (orgId, id, body, params = {}) => this.request(__spreadValues({
1666
+ path: `/v1beta1/organizations/${orgId}/billing/${id}/register`,
1667
+ method: "POST",
1668
+ body,
1669
+ secure: true,
1670
+ format: "json"
1671
+ }, params));
1672
+ /**
1673
+ * @description List all checkouts of a billing account.
1674
+ *
1675
+ * @tags Checkout
1676
+ * @name FrontierServiceListCheckouts2
1677
+ * @summary List checkouts
1678
+ * @request GET:/v1beta1/organizations/{org_id}/billing/checkouts
1679
+ * @secure
1680
+ */
1681
+ this.frontierServiceListCheckouts2 = (orgId, query, params = {}) => this.request(__spreadValues({
1682
+ path: `/v1beta1/organizations/${orgId}/billing/checkouts`,
1683
+ method: "GET",
1684
+ query,
1685
+ secure: true,
1686
+ format: "json"
1687
+ }, params));
1688
+ /**
1689
+ * @description Checkout a product to buy it one time or start a subscription plan on a billing account.
1690
+ *
1691
+ * @tags Checkout
1692
+ * @name FrontierServiceCreateCheckout2
1693
+ * @summary Checkout a product or subscription
1694
+ * @request POST:/v1beta1/organizations/{org_id}/billing/checkouts
1695
+ * @secure
1696
+ */
1697
+ this.frontierServiceCreateCheckout2 = (orgId, body, params = {}) => this.request(__spreadValues({
1698
+ path: `/v1beta1/organizations/${orgId}/billing/checkouts`,
1699
+ method: "POST",
1700
+ body,
1701
+ secure: true,
1702
+ type: "application/json" /* Json */,
1703
+ format: "json"
1704
+ }, params));
1705
+ /**
1706
+ * @description Get a checkout by ID.
1707
+ *
1708
+ * @tags Checkout
1709
+ * @name FrontierServiceGetCheckout2
1710
+ * @summary Get checkout
1711
+ * @request GET:/v1beta1/organizations/{org_id}/billing/checkouts/{id}
1712
+ * @secure
1713
+ */
1714
+ this.frontierServiceGetCheckout2 = (orgId, id, query, params = {}) => this.request(__spreadValues({
1715
+ path: `/v1beta1/organizations/${orgId}/billing/checkouts/${id}`,
1716
+ method: "GET",
1717
+ query,
1718
+ secure: true,
1719
+ format: "json"
1720
+ }, params));
1592
1721
  /**
1593
1722
  * @description List all invoices of a billing account.
1594
1723
  *
@@ -1621,6 +1750,105 @@ var V1Beta1 = class extends HttpClient {
1621
1750
  secure: true,
1622
1751
  format: "json"
1623
1752
  }, params));
1753
+ /**
1754
+ * @description List subscriptions of a billing account.
1755
+ *
1756
+ * @tags Subscription
1757
+ * @name FrontierServiceListSubscriptions2
1758
+ * @summary List subscriptions
1759
+ * @request GET:/v1beta1/organizations/{org_id}/billing/subscriptions
1760
+ * @secure
1761
+ */
1762
+ this.frontierServiceListSubscriptions2 = (orgId, query, params = {}) => this.request(__spreadValues({
1763
+ path: `/v1beta1/organizations/${orgId}/billing/subscriptions`,
1764
+ method: "GET",
1765
+ query,
1766
+ secure: true,
1767
+ format: "json"
1768
+ }, params));
1769
+ /**
1770
+ * @description Get a subscription by ID.
1771
+ *
1772
+ * @tags Subscription
1773
+ * @name FrontierServiceGetSubscription2
1774
+ * @summary Get subscription
1775
+ * @request GET:/v1beta1/organizations/{org_id}/billing/subscriptions/{id}
1776
+ * @secure
1777
+ */
1778
+ this.frontierServiceGetSubscription2 = (orgId, id, query, params = {}) => this.request(__spreadValues({
1779
+ path: `/v1beta1/organizations/${orgId}/billing/subscriptions/${id}`,
1780
+ method: "GET",
1781
+ query,
1782
+ secure: true,
1783
+ format: "json"
1784
+ }, params));
1785
+ /**
1786
+ * @description Update a subscription by ID.
1787
+ *
1788
+ * @tags Subscription
1789
+ * @name FrontierServiceUpdateSubscription2
1790
+ * @summary Update subscription
1791
+ * @request POST:/v1beta1/organizations/{org_id}/billing/subscriptions/{id}
1792
+ * @secure
1793
+ */
1794
+ this.frontierServiceUpdateSubscription2 = (orgId, id, body, params = {}) => this.request(__spreadValues({
1795
+ path: `/v1beta1/organizations/${orgId}/billing/subscriptions/${id}`,
1796
+ method: "POST",
1797
+ body,
1798
+ secure: true,
1799
+ type: "application/json" /* Json */,
1800
+ format: "json"
1801
+ }, params));
1802
+ /**
1803
+ * @description Cancel a subscription by ID.
1804
+ *
1805
+ * @tags Subscription
1806
+ * @name FrontierServiceCancelSubscription2
1807
+ * @summary Cancel subscription
1808
+ * @request POST:/v1beta1/organizations/{org_id}/billing/subscriptions/{id}/cancel
1809
+ * @secure
1810
+ */
1811
+ this.frontierServiceCancelSubscription2 = (orgId, id, body, params = {}) => this.request(__spreadValues({
1812
+ path: `/v1beta1/organizations/${orgId}/billing/subscriptions/${id}/cancel`,
1813
+ method: "POST",
1814
+ body,
1815
+ secure: true,
1816
+ type: "application/json" /* Json */,
1817
+ format: "json"
1818
+ }, params));
1819
+ /**
1820
+ * @description Change a subscription plan by ID.
1821
+ *
1822
+ * @tags Subscription
1823
+ * @name FrontierServiceChangeSubscription2
1824
+ * @summary Change subscription plan
1825
+ * @request POST:/v1beta1/organizations/{org_id}/billing/subscriptions/{id}/change
1826
+ * @secure
1827
+ */
1828
+ this.frontierServiceChangeSubscription2 = (orgId, id, body, params = {}) => this.request(__spreadValues({
1829
+ path: `/v1beta1/organizations/${orgId}/billing/subscriptions/${id}/change`,
1830
+ method: "POST",
1831
+ body,
1832
+ secure: true,
1833
+ type: "application/json" /* Json */,
1834
+ format: "json"
1835
+ }, params));
1836
+ /**
1837
+ * @description List all transactions of a billing account.
1838
+ *
1839
+ * @tags Transaction
1840
+ * @name FrontierServiceListBillingTransactions2
1841
+ * @summary List billing transactions
1842
+ * @request GET:/v1beta1/organizations/{org_id}/billing/transactions
1843
+ * @secure
1844
+ */
1845
+ this.frontierServiceListBillingTransactions2 = (orgId, query, params = {}) => this.request(__spreadValues({
1846
+ path: `/v1beta1/organizations/${orgId}/billing/transactions`,
1847
+ method: "GET",
1848
+ query,
1849
+ secure: true,
1850
+ format: "json"
1851
+ }, params));
1624
1852
  /**
1625
1853
  * @description Returns all domains whitelisted for an organization (both pending and verified if no filters are provided for the state). The verified domains allow users email with the org's whitelisted domain to join the organization without invitation.
1626
1854
  *
@@ -2240,6 +2468,23 @@ var V1Beta1 = class extends HttpClient {
2240
2468
  secure: true,
2241
2469
  format: "json"
2242
2470
  }, params));
2471
+ /**
2472
+ * @description Create a policy for a project
2473
+ *
2474
+ * @tags Policy
2475
+ * @name FrontierServiceCreatePolicyForProject
2476
+ * @summary Create Policy for Project
2477
+ * @request POST:/v1beta1/policies/projects/{project_id}
2478
+ * @secure
2479
+ */
2480
+ this.frontierServiceCreatePolicyForProject = (projectId, body, params = {}) => this.request(__spreadValues({
2481
+ path: `/v1beta1/policies/projects/${projectId}`,
2482
+ method: "POST",
2483
+ body,
2484
+ secure: true,
2485
+ type: "application/json" /* Json */,
2486
+ format: "json"
2487
+ }, params));
2243
2488
  /**
2244
2489
  * @description Returns a list of all preferences configured on an instance in Frontier. e.g user, project, organization etc
2245
2490
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raystack/frontier",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "description": "A js library for frontier",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -54,6 +54,7 @@
54
54
  "devDependencies": {
55
55
  "@jest/globals": "^29.7.0",
56
56
  "@radix-ui/react-icons": "^1.3.0",
57
+ "@raystack/eslint-config": "workspace:^",
57
58
  "@raystack/frontier-tsconfig": "workspace:^",
58
59
  "@size-limit/preset-small-lib": "^8.2.6",
59
60
  "@tanstack/react-table": "^8.10.1",
@@ -65,7 +66,6 @@
65
66
  "esbuild-css-modules-plugin": "^2.7.1",
66
67
  "esbuild-plugin-external-global": "^1.0.1",
67
68
  "eslint": "^7.32.0",
68
- "@raystack/eslint-config": "workspace:^",
69
69
  "jest": "^29.7.0",
70
70
  "np": "^7.7.0",
71
71
  "prettier": "^2.8.8",
@@ -79,7 +79,7 @@
79
79
  },
80
80
  "dependencies": {
81
81
  "@hookform/resolvers": "^3.3.1",
82
- "@raystack/apsara": "^0.11.10",
82
+ "@raystack/apsara": "^0.15.0",
83
83
  "@tanstack/react-router": "0.0.1-beta.194",
84
84
  "axios": "^1.5.0",
85
85
  "class-variance-authority": "^0.7.0",