@raystack/frontier 0.0.1 → 0.0.3

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
@@ -438,6 +438,37 @@ var V1Beta1 = class extends HttpClient {
438
438
  type: "application/json" /* Json */,
439
439
  format: "json"
440
440
  }, params));
441
+ /**
442
+ * @description List a group preferences by ID.
443
+ *
444
+ * @tags Preference
445
+ * @name FrontierServiceListGroupPreferences
446
+ * @summary List group preferences
447
+ * @request GET:/v1beta1/groups/{id}/preferences
448
+ * @secure
449
+ */
450
+ this.frontierServiceListGroupPreferences = (id, params = {}) => this.request(__spreadValues({
451
+ path: `/v1beta1/groups/${id}/preferences`,
452
+ method: "GET",
453
+ secure: true,
454
+ format: "json"
455
+ }, params));
456
+ /**
457
+ * @description Create a new group preferences. The group preferences **name** must be unique within the group and can contain only alphanumeric characters, dashes and underscores.
458
+ *
459
+ * @tags Preference
460
+ * @name FrontierServiceCreateGroupPreferences
461
+ * @summary Create group preferences
462
+ * @request POST:/v1beta1/groups/{id}/preferences
463
+ * @secure
464
+ */
465
+ this.frontierServiceCreateGroupPreferences = (id, body, params = {}) => this.request(__spreadValues({
466
+ path: `/v1beta1/groups/${id}/preferences`,
467
+ method: "POST",
468
+ body,
469
+ secure: true,
470
+ format: "json"
471
+ }, params));
441
472
  /**
442
473
  * @description Returns a list of all metaschemas configured on an instance level in Frontier. e.g user, project, organization etc
443
474
  *
@@ -718,6 +749,37 @@ var V1Beta1 = class extends HttpClient {
718
749
  secure: true,
719
750
  format: "json"
720
751
  }, params));
752
+ /**
753
+ * @description List an organization preferences by ID.
754
+ *
755
+ * @tags Preference
756
+ * @name FrontierServiceListOrganizationPreferences
757
+ * @summary List organization preferences
758
+ * @request GET:/v1beta1/organizations/{id}/preferences
759
+ * @secure
760
+ */
761
+ this.frontierServiceListOrganizationPreferences = (id, params = {}) => this.request(__spreadValues({
762
+ path: `/v1beta1/organizations/${id}/preferences`,
763
+ method: "GET",
764
+ secure: true,
765
+ format: "json"
766
+ }, params));
767
+ /**
768
+ * @description Create a new organization preferences. The organization preferences **name** must be unique within the organization and can contain only alphanumeric characters, dashes and underscores.
769
+ *
770
+ * @tags Preference
771
+ * @name FrontierServiceCreateOrganizationPreferences
772
+ * @summary Create organization preferences
773
+ * @request POST:/v1beta1/organizations/{id}/preferences
774
+ * @secure
775
+ */
776
+ this.frontierServiceCreateOrganizationPreferences = (id, body, params = {}) => this.request(__spreadValues({
777
+ path: `/v1beta1/organizations/${id}/preferences`,
778
+ method: "POST",
779
+ body,
780
+ secure: true,
781
+ format: "json"
782
+ }, params));
721
783
  /**
722
784
  * @description Get all projects that belong to an organization
723
785
  *
@@ -797,6 +859,85 @@ var V1Beta1 = class extends HttpClient {
797
859
  secure: true,
798
860
  format: "json"
799
861
  }, params));
862
+ /**
863
+ * @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.
864
+ *
865
+ * @tags Organization
866
+ * @name FrontierServiceListOrganizationDomains
867
+ * @summary List org domains
868
+ * @request GET:/v1beta1/organizations/{orgId}/domains
869
+ * @secure
870
+ */
871
+ this.frontierServiceListOrganizationDomains = (orgId, query, params = {}) => this.request(__spreadValues({
872
+ path: `/v1beta1/organizations/${orgId}/domains`,
873
+ method: "GET",
874
+ query,
875
+ secure: true,
876
+ format: "json"
877
+ }, params));
878
+ /**
879
+ * @description Add a domain to an organization which if verified allows all users of the same domain to be signed up to the organization without invitation. This API generates a verification token for a domain which must be added to your domain's DNS provider as a TXT record should be verified with Frontier VerifyOrganizationDomain API before it can be used as an Organization's trusted domain to sign up users.
880
+ *
881
+ * @tags Organization
882
+ * @name FrontierServiceCreateOrganizationDomain
883
+ * @summary Create org domain
884
+ * @request POST:/v1beta1/organizations/{orgId}/domains
885
+ * @secure
886
+ */
887
+ this.frontierServiceCreateOrganizationDomain = (orgId, body, params = {}) => this.request(__spreadValues({
888
+ path: `/v1beta1/organizations/${orgId}/domains`,
889
+ method: "POST",
890
+ body,
891
+ secure: true,
892
+ type: "application/json" /* Json */,
893
+ format: "json"
894
+ }, params));
895
+ /**
896
+ * @description Get a domain from the list of an organization's whitelisted domains. Returns both verified and unverified domains by their ID
897
+ *
898
+ * @tags Organization
899
+ * @name FrontierServiceGetOrganizationDomain
900
+ * @summary Get org domain
901
+ * @request GET:/v1beta1/organizations/{orgId}/domains/{id}
902
+ * @secure
903
+ */
904
+ this.frontierServiceGetOrganizationDomain = (orgId, id, params = {}) => this.request(__spreadValues({
905
+ path: `/v1beta1/organizations/${orgId}/domains/${id}`,
906
+ method: "GET",
907
+ secure: true,
908
+ format: "json"
909
+ }, params));
910
+ /**
911
+ * @description Remove a domain from the list of an organization's trusted domains list
912
+ *
913
+ * @tags Organization
914
+ * @name FrontierServiceDeleteOrganizationDomain
915
+ * @summary Delete org domain
916
+ * @request DELETE:/v1beta1/organizations/{orgId}/domains/{id}
917
+ * @secure
918
+ */
919
+ this.frontierServiceDeleteOrganizationDomain = (orgId, id, params = {}) => this.request(__spreadValues({
920
+ path: `/v1beta1/organizations/${orgId}/domains/${id}`,
921
+ method: "DELETE",
922
+ secure: true,
923
+ format: "json"
924
+ }, params));
925
+ /**
926
+ * @description Verify a domain for an organization with a verification token generated by Frontier GenerateDomainVerificationToken API. The token must be added to your domain's DNS provider as a TXT record before it can be verified. This API returns the state of the domain (pending/verified) after verification.
927
+ *
928
+ * @tags Organization
929
+ * @name FrontierServiceVerifyOrganizationDomain
930
+ * @summary Verify org domain
931
+ * @request POST:/v1beta1/organizations/{orgId}/domains/{id}/verify
932
+ * @secure
933
+ */
934
+ this.frontierServiceVerifyOrganizationDomain = (orgId, id, body, params = {}) => this.request(__spreadValues({
935
+ path: `/v1beta1/organizations/${orgId}/domains/${id}/verify`,
936
+ method: "POST",
937
+ body,
938
+ secure: true,
939
+ format: "json"
940
+ }, params));
800
941
  /**
801
942
  * @description Get all groups that belong to an organization. The results can be filtered by state which can be either be enabled or disabled.
802
943
  *
@@ -971,7 +1112,7 @@ var V1Beta1 = class extends HttpClient {
971
1112
  format: "json"
972
1113
  }, params));
973
1114
  /**
974
- * @description Invite users to an organization, if the user doesn't exists, it will be created and notified. Invitations expire in 7 days
1115
+ * @description Invite users to an organization, if user is not registered on the platform, it will be notified. Invitations expire in 7 days
975
1116
  *
976
1117
  * @tags Organization
977
1118
  * @name FrontierServiceCreateOrganizationInvitation
@@ -1032,6 +1173,21 @@ var V1Beta1 = class extends HttpClient {
1032
1173
  secure: true,
1033
1174
  format: "json"
1034
1175
  }, params));
1176
+ /**
1177
+ * @description Allows the current logged in user to join the Org if one is not a part of it. The user will only be able to join when the user email's domain matches the organization's whitelisted domains.
1178
+ *
1179
+ * @tags Organization
1180
+ * @name FrontierServiceJoinOrganization
1181
+ * @summary Join organization
1182
+ * @request POST:/v1beta1/organizations/{orgId}/join
1183
+ * @secure
1184
+ */
1185
+ this.frontierServiceJoinOrganization = (orgId, params = {}) => this.request(__spreadValues({
1186
+ path: `/v1beta1/organizations/${orgId}/join`,
1187
+ method: "POST",
1188
+ secure: true,
1189
+ format: "json"
1190
+ }, params));
1035
1191
  /**
1036
1192
  * @description Returns a list of custom roles created under an organization with their associated permissions
1037
1193
  *
@@ -1267,6 +1423,53 @@ var V1Beta1 = class extends HttpClient {
1267
1423
  secure: true,
1268
1424
  format: "json"
1269
1425
  }, params));
1426
+ /**
1427
+ * @description Returns a list of all preferences configured on an instance in Frontier. e.g user, project, organization etc
1428
+ *
1429
+ * @tags Preference
1430
+ * @name AdminServiceListPreferences
1431
+ * @summary List platform preferences
1432
+ * @request GET:/v1beta1/preferences
1433
+ * @secure
1434
+ */
1435
+ this.adminServiceListPreferences = (params = {}) => this.request(__spreadValues({
1436
+ path: `/v1beta1/preferences`,
1437
+ method: "GET",
1438
+ secure: true,
1439
+ format: "json"
1440
+ }, params));
1441
+ /**
1442
+ * @description Create new platform preferences. The platform preferences **name** must be unique within the platform and can contain only alphanumeric characters, dashes and underscores.
1443
+ *
1444
+ * @tags Preference
1445
+ * @name AdminServiceCreatePreferences
1446
+ * @summary Create platform preferences
1447
+ * @request POST:/v1beta1/preferences
1448
+ * @secure
1449
+ */
1450
+ this.adminServiceCreatePreferences = (body, params = {}) => this.request(__spreadValues({
1451
+ path: `/v1beta1/preferences`,
1452
+ method: "POST",
1453
+ body,
1454
+ secure: true,
1455
+ type: "application/json" /* Json */,
1456
+ format: "json"
1457
+ }, params));
1458
+ /**
1459
+ * @description Returns a list of all preferences supported by Frontier.
1460
+ *
1461
+ * @tags Preference
1462
+ * @name FrontierServiceDescribePreferences
1463
+ * @summary Describe preferences
1464
+ * @request GET:/v1beta1/preferences/_describe
1465
+ * @secure
1466
+ */
1467
+ this.frontierServiceDescribePreferences = (params = {}) => this.request(__spreadValues({
1468
+ path: `/v1beta1/preferences/_describe`,
1469
+ method: "GET",
1470
+ secure: true,
1471
+ format: "json"
1472
+ }, params));
1270
1473
  /**
1271
1474
  * No description
1272
1475
  *
@@ -1376,6 +1579,37 @@ var V1Beta1 = class extends HttpClient {
1376
1579
  secure: true,
1377
1580
  format: "json"
1378
1581
  }, params));
1582
+ /**
1583
+ * @description List a project preferences by ID.
1584
+ *
1585
+ * @tags Preference
1586
+ * @name FrontierServiceListProjectPreferences
1587
+ * @summary List project preferences
1588
+ * @request GET:/v1beta1/projects/{id}/preferences
1589
+ * @secure
1590
+ */
1591
+ this.frontierServiceListProjectPreferences = (id, params = {}) => this.request(__spreadValues({
1592
+ path: `/v1beta1/projects/${id}/preferences`,
1593
+ method: "GET",
1594
+ secure: true,
1595
+ format: "json"
1596
+ }, params));
1597
+ /**
1598
+ * @description Create a new project preferences. The project preferences **name** must be unique within the project and can contain only alphanumeric characters, dashes and underscores.
1599
+ *
1600
+ * @tags Preference
1601
+ * @name FrontierServiceCreateProjectPreferences
1602
+ * @summary Create project preferences
1603
+ * @request POST:/v1beta1/projects/{id}/preferences
1604
+ * @secure
1605
+ */
1606
+ this.frontierServiceCreateProjectPreferences = (id, body, params = {}) => this.request(__spreadValues({
1607
+ path: `/v1beta1/projects/${id}/preferences`,
1608
+ method: "POST",
1609
+ body,
1610
+ secure: true,
1611
+ format: "json"
1612
+ }, params));
1379
1613
  /**
1380
1614
  * @description Returns a collection of users of a project. Filter by user permissions is supported.
1381
1615
  *
@@ -1565,6 +1799,22 @@ var V1Beta1 = class extends HttpClient {
1565
1799
  secure: true,
1566
1800
  format: "json"
1567
1801
  }, params));
1802
+ /**
1803
+ * @description Update a role title, description and permissions.
1804
+ *
1805
+ * @tags Role
1806
+ * @name AdminServiceUpdateRole
1807
+ * @summary Update role
1808
+ * @request PUT:/v1beta1/roles/{id}
1809
+ * @secure
1810
+ */
1811
+ this.adminServiceUpdateRole = (id, body, params = {}) => this.request(__spreadValues({
1812
+ path: `/v1beta1/roles/${id}`,
1813
+ method: "PUT",
1814
+ body,
1815
+ secure: true,
1816
+ format: "json"
1817
+ }, params));
1568
1818
  /**
1569
1819
  * @description Returns the service user of an organization in a Frontier instance. It can be filter by it's state
1570
1820
  *
@@ -1876,7 +2126,7 @@ var V1Beta1 = class extends HttpClient {
1876
2126
  format: "json"
1877
2127
  }, params));
1878
2128
  /**
1879
- * @description Get all the organizations a user belongs to.
2129
+ * @description This API returns two list of organizations for the user. i) The list of orgs which the current user is already a part of ii) The list of organizations the user can join directly (based on domain whitelisted and verified by the org). This list will also contain orgs of which user is already a part of. Note: the domain needs to be verified by the org before the it is returned as one of the joinable orgs by domain
1880
2130
  *
1881
2131
  * @tags User
1882
2132
  * @name FrontierServiceGetOrganizationsByUser
@@ -1890,6 +2140,37 @@ var V1Beta1 = class extends HttpClient {
1890
2140
  secure: true,
1891
2141
  format: "json"
1892
2142
  }, params));
2143
+ /**
2144
+ * @description List a user preferences by ID.
2145
+ *
2146
+ * @tags Preference
2147
+ * @name FrontierServiceListUserPreferences
2148
+ * @summary List user preferences
2149
+ * @request GET:/v1beta1/users/{id}/preferences
2150
+ * @secure
2151
+ */
2152
+ this.frontierServiceListUserPreferences = (id, params = {}) => this.request(__spreadValues({
2153
+ path: `/v1beta1/users/${id}/preferences`,
2154
+ method: "GET",
2155
+ secure: true,
2156
+ format: "json"
2157
+ }, params));
2158
+ /**
2159
+ * @description Create a new user preferences. The user preferences **name** must be unique within the user and can contain only alphanumeric characters, dashes and underscores.
2160
+ *
2161
+ * @tags Preference
2162
+ * @name FrontierServiceCreateUserPreferences
2163
+ * @summary Create user preferences
2164
+ * @request POST:/v1beta1/users/{id}/preferences
2165
+ * @secure
2166
+ */
2167
+ this.frontierServiceCreateUserPreferences = (id, body, params = {}) => this.request(__spreadValues({
2168
+ path: `/v1beta1/users/${id}/preferences`,
2169
+ method: "POST",
2170
+ body,
2171
+ secure: true,
2172
+ format: "json"
2173
+ }, params));
1893
2174
  /**
1894
2175
  * @description Get all the projects a user belongs to.
1895
2176
  *
@@ -1952,7 +2233,7 @@ var V1Beta1 = class extends HttpClient {
1952
2233
  format: "json"
1953
2234
  }, params));
1954
2235
  /**
1955
- * @description Get all organizations the current user belongs to
2236
+ * @description This API returns two list of organizations for the current logged in user. i) The list of orgs which the current user is already a part of ii) The list of organizations the user can join directly (based on domain whitelisted and verified by the org). This list will also contain orgs of which user is already a part of. Note: the domain needs to be verified by the org before the it is returned as one of the joinable orgs by domain
1956
2237
  *
1957
2238
  * @tags User
1958
2239
  * @name FrontierServiceGetOrganizationsByCurrentUser
@@ -1966,6 +2247,38 @@ var V1Beta1 = class extends HttpClient {
1966
2247
  secure: true,
1967
2248
  format: "json"
1968
2249
  }, params));
2250
+ /**
2251
+ * @description List a user preferences by ID.
2252
+ *
2253
+ * @tags Preference
2254
+ * @name FrontierServiceListCurrentUserPreferences
2255
+ * @summary List current user preferences
2256
+ * @request GET:/v1beta1/users/self/preferences
2257
+ * @secure
2258
+ */
2259
+ this.frontierServiceListCurrentUserPreferences = (params = {}) => this.request(__spreadValues({
2260
+ path: `/v1beta1/users/self/preferences`,
2261
+ method: "GET",
2262
+ secure: true,
2263
+ format: "json"
2264
+ }, params));
2265
+ /**
2266
+ * @description Create a new user preferences. The user preferences **name** must be unique within the user and can contain only alphanumeric characters, dashes and underscores.
2267
+ *
2268
+ * @tags Preference
2269
+ * @name FrontierServiceCreateCurrentUserPreferences
2270
+ * @summary Create current user preferences
2271
+ * @request POST:/v1beta1/users/self/preferences
2272
+ * @secure
2273
+ */
2274
+ this.frontierServiceCreateCurrentUserPreferences = (body, params = {}) => this.request(__spreadValues({
2275
+ path: `/v1beta1/users/self/preferences`,
2276
+ method: "POST",
2277
+ body,
2278
+ secure: true,
2279
+ type: "application/json" /* Json */,
2280
+ format: "json"
2281
+ }, params));
1969
2282
  /**
1970
2283
  * @description Get all projects the current user belongs to
1971
2284
  *
@@ -1984,8 +2297,16 @@ var V1Beta1 = class extends HttpClient {
1984
2297
  }
1985
2298
  };
1986
2299
 
2300
+ // client/data-contracts.ts
2301
+ var ProtobufNullValue = /* @__PURE__ */ ((ProtobufNullValue2) => {
2302
+ ProtobufNullValue2["NULL_VALUE"] = "NULL_VALUE";
2303
+ return ProtobufNullValue2;
2304
+ })(ProtobufNullValue || {});
2305
+
1987
2306
  // src/index.ts
1988
2307
  var FrontierClient = V1Beta1;
1989
2308
  export {
1990
- FrontierClient
2309
+ FrontierClient,
2310
+ ProtobufNullValue,
2311
+ V1Beta1
1991
2312
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raystack/frontier",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "A js library for frontier",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -48,8 +48,10 @@
48
48
  }
49
49
  },
50
50
  "devDependencies": {
51
+ "@radix-ui/react-icons": "^1.3.0",
51
52
  "@raystack/frontier-tsconfig": "workspace:^",
52
53
  "@size-limit/preset-small-lib": "^8.2.6",
54
+ "@tanstack/react-table": "^8.9.3",
53
55
  "@types/node": "^20.4.5",
54
56
  "@types/react": "^18.2.5",
55
57
  "@types/react-dom": "^18.2.7",
@@ -59,14 +61,17 @@
59
61
  "np": "^7.7.0",
60
62
  "prettier": "^2.5.1",
61
63
  "size-limit": "^8.2.6",
64
+ "swagger-typescript-api": "^13.0.2",
62
65
  "tsup": "^6.7.0",
63
66
  "typescript": "^5.1.6"
64
67
  },
65
68
  "dependencies": {
66
69
  "@hookform/resolvers": "^3.1.1",
67
- "@raystack/apsara": "^0.10.5",
70
+ "@raystack/apsara": "0.10.8",
68
71
  "axios": "^1.4.0",
69
72
  "react-hook-form": "^7.45.2",
73
+ "react-router-dom": "^6.14.2",
74
+ "sonner": "^0.6.2",
70
75
  "yup": "^1.2.0"
71
76
  },
72
77
  "peerDependencies": {