@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.js CHANGED
@@ -69,7 +69,9 @@ var __async = (__this, __arguments, generator) => {
69
69
  // src/index.ts
70
70
  var src_exports = {};
71
71
  __export(src_exports, {
72
- FrontierClient: () => FrontierClient
72
+ FrontierClient: () => FrontierClient,
73
+ ProtobufNullValue: () => ProtobufNullValue,
74
+ V1Beta1: () => V1Beta1
73
75
  });
74
76
  module.exports = __toCommonJS(src_exports);
75
77
 
@@ -461,6 +463,37 @@ var V1Beta1 = class extends HttpClient {
461
463
  type: "application/json" /* Json */,
462
464
  format: "json"
463
465
  }, params));
466
+ /**
467
+ * @description List a group preferences by ID.
468
+ *
469
+ * @tags Preference
470
+ * @name FrontierServiceListGroupPreferences
471
+ * @summary List group preferences
472
+ * @request GET:/v1beta1/groups/{id}/preferences
473
+ * @secure
474
+ */
475
+ this.frontierServiceListGroupPreferences = (id, params = {}) => this.request(__spreadValues({
476
+ path: `/v1beta1/groups/${id}/preferences`,
477
+ method: "GET",
478
+ secure: true,
479
+ format: "json"
480
+ }, params));
481
+ /**
482
+ * @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.
483
+ *
484
+ * @tags Preference
485
+ * @name FrontierServiceCreateGroupPreferences
486
+ * @summary Create group preferences
487
+ * @request POST:/v1beta1/groups/{id}/preferences
488
+ * @secure
489
+ */
490
+ this.frontierServiceCreateGroupPreferences = (id, body, params = {}) => this.request(__spreadValues({
491
+ path: `/v1beta1/groups/${id}/preferences`,
492
+ method: "POST",
493
+ body,
494
+ secure: true,
495
+ format: "json"
496
+ }, params));
464
497
  /**
465
498
  * @description Returns a list of all metaschemas configured on an instance level in Frontier. e.g user, project, organization etc
466
499
  *
@@ -741,6 +774,37 @@ var V1Beta1 = class extends HttpClient {
741
774
  secure: true,
742
775
  format: "json"
743
776
  }, params));
777
+ /**
778
+ * @description List an organization preferences by ID.
779
+ *
780
+ * @tags Preference
781
+ * @name FrontierServiceListOrganizationPreferences
782
+ * @summary List organization preferences
783
+ * @request GET:/v1beta1/organizations/{id}/preferences
784
+ * @secure
785
+ */
786
+ this.frontierServiceListOrganizationPreferences = (id, params = {}) => this.request(__spreadValues({
787
+ path: `/v1beta1/organizations/${id}/preferences`,
788
+ method: "GET",
789
+ secure: true,
790
+ format: "json"
791
+ }, params));
792
+ /**
793
+ * @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.
794
+ *
795
+ * @tags Preference
796
+ * @name FrontierServiceCreateOrganizationPreferences
797
+ * @summary Create organization preferences
798
+ * @request POST:/v1beta1/organizations/{id}/preferences
799
+ * @secure
800
+ */
801
+ this.frontierServiceCreateOrganizationPreferences = (id, body, params = {}) => this.request(__spreadValues({
802
+ path: `/v1beta1/organizations/${id}/preferences`,
803
+ method: "POST",
804
+ body,
805
+ secure: true,
806
+ format: "json"
807
+ }, params));
744
808
  /**
745
809
  * @description Get all projects that belong to an organization
746
810
  *
@@ -820,6 +884,85 @@ var V1Beta1 = class extends HttpClient {
820
884
  secure: true,
821
885
  format: "json"
822
886
  }, params));
887
+ /**
888
+ * @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.
889
+ *
890
+ * @tags Organization
891
+ * @name FrontierServiceListOrganizationDomains
892
+ * @summary List org domains
893
+ * @request GET:/v1beta1/organizations/{orgId}/domains
894
+ * @secure
895
+ */
896
+ this.frontierServiceListOrganizationDomains = (orgId, query, params = {}) => this.request(__spreadValues({
897
+ path: `/v1beta1/organizations/${orgId}/domains`,
898
+ method: "GET",
899
+ query,
900
+ secure: true,
901
+ format: "json"
902
+ }, params));
903
+ /**
904
+ * @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.
905
+ *
906
+ * @tags Organization
907
+ * @name FrontierServiceCreateOrganizationDomain
908
+ * @summary Create org domain
909
+ * @request POST:/v1beta1/organizations/{orgId}/domains
910
+ * @secure
911
+ */
912
+ this.frontierServiceCreateOrganizationDomain = (orgId, body, params = {}) => this.request(__spreadValues({
913
+ path: `/v1beta1/organizations/${orgId}/domains`,
914
+ method: "POST",
915
+ body,
916
+ secure: true,
917
+ type: "application/json" /* Json */,
918
+ format: "json"
919
+ }, params));
920
+ /**
921
+ * @description Get a domain from the list of an organization's whitelisted domains. Returns both verified and unverified domains by their ID
922
+ *
923
+ * @tags Organization
924
+ * @name FrontierServiceGetOrganizationDomain
925
+ * @summary Get org domain
926
+ * @request GET:/v1beta1/organizations/{orgId}/domains/{id}
927
+ * @secure
928
+ */
929
+ this.frontierServiceGetOrganizationDomain = (orgId, id, params = {}) => this.request(__spreadValues({
930
+ path: `/v1beta1/organizations/${orgId}/domains/${id}`,
931
+ method: "GET",
932
+ secure: true,
933
+ format: "json"
934
+ }, params));
935
+ /**
936
+ * @description Remove a domain from the list of an organization's trusted domains list
937
+ *
938
+ * @tags Organization
939
+ * @name FrontierServiceDeleteOrganizationDomain
940
+ * @summary Delete org domain
941
+ * @request DELETE:/v1beta1/organizations/{orgId}/domains/{id}
942
+ * @secure
943
+ */
944
+ this.frontierServiceDeleteOrganizationDomain = (orgId, id, params = {}) => this.request(__spreadValues({
945
+ path: `/v1beta1/organizations/${orgId}/domains/${id}`,
946
+ method: "DELETE",
947
+ secure: true,
948
+ format: "json"
949
+ }, params));
950
+ /**
951
+ * @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.
952
+ *
953
+ * @tags Organization
954
+ * @name FrontierServiceVerifyOrganizationDomain
955
+ * @summary Verify org domain
956
+ * @request POST:/v1beta1/organizations/{orgId}/domains/{id}/verify
957
+ * @secure
958
+ */
959
+ this.frontierServiceVerifyOrganizationDomain = (orgId, id, body, params = {}) => this.request(__spreadValues({
960
+ path: `/v1beta1/organizations/${orgId}/domains/${id}/verify`,
961
+ method: "POST",
962
+ body,
963
+ secure: true,
964
+ format: "json"
965
+ }, params));
823
966
  /**
824
967
  * @description Get all groups that belong to an organization. The results can be filtered by state which can be either be enabled or disabled.
825
968
  *
@@ -994,7 +1137,7 @@ var V1Beta1 = class extends HttpClient {
994
1137
  format: "json"
995
1138
  }, params));
996
1139
  /**
997
- * @description Invite users to an organization, if the user doesn't exists, it will be created and notified. Invitations expire in 7 days
1140
+ * @description Invite users to an organization, if user is not registered on the platform, it will be notified. Invitations expire in 7 days
998
1141
  *
999
1142
  * @tags Organization
1000
1143
  * @name FrontierServiceCreateOrganizationInvitation
@@ -1055,6 +1198,21 @@ var V1Beta1 = class extends HttpClient {
1055
1198
  secure: true,
1056
1199
  format: "json"
1057
1200
  }, params));
1201
+ /**
1202
+ * @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.
1203
+ *
1204
+ * @tags Organization
1205
+ * @name FrontierServiceJoinOrganization
1206
+ * @summary Join organization
1207
+ * @request POST:/v1beta1/organizations/{orgId}/join
1208
+ * @secure
1209
+ */
1210
+ this.frontierServiceJoinOrganization = (orgId, params = {}) => this.request(__spreadValues({
1211
+ path: `/v1beta1/organizations/${orgId}/join`,
1212
+ method: "POST",
1213
+ secure: true,
1214
+ format: "json"
1215
+ }, params));
1058
1216
  /**
1059
1217
  * @description Returns a list of custom roles created under an organization with their associated permissions
1060
1218
  *
@@ -1290,6 +1448,53 @@ var V1Beta1 = class extends HttpClient {
1290
1448
  secure: true,
1291
1449
  format: "json"
1292
1450
  }, params));
1451
+ /**
1452
+ * @description Returns a list of all preferences configured on an instance in Frontier. e.g user, project, organization etc
1453
+ *
1454
+ * @tags Preference
1455
+ * @name AdminServiceListPreferences
1456
+ * @summary List platform preferences
1457
+ * @request GET:/v1beta1/preferences
1458
+ * @secure
1459
+ */
1460
+ this.adminServiceListPreferences = (params = {}) => this.request(__spreadValues({
1461
+ path: `/v1beta1/preferences`,
1462
+ method: "GET",
1463
+ secure: true,
1464
+ format: "json"
1465
+ }, params));
1466
+ /**
1467
+ * @description Create new platform preferences. The platform preferences **name** must be unique within the platform and can contain only alphanumeric characters, dashes and underscores.
1468
+ *
1469
+ * @tags Preference
1470
+ * @name AdminServiceCreatePreferences
1471
+ * @summary Create platform preferences
1472
+ * @request POST:/v1beta1/preferences
1473
+ * @secure
1474
+ */
1475
+ this.adminServiceCreatePreferences = (body, params = {}) => this.request(__spreadValues({
1476
+ path: `/v1beta1/preferences`,
1477
+ method: "POST",
1478
+ body,
1479
+ secure: true,
1480
+ type: "application/json" /* Json */,
1481
+ format: "json"
1482
+ }, params));
1483
+ /**
1484
+ * @description Returns a list of all preferences supported by Frontier.
1485
+ *
1486
+ * @tags Preference
1487
+ * @name FrontierServiceDescribePreferences
1488
+ * @summary Describe preferences
1489
+ * @request GET:/v1beta1/preferences/_describe
1490
+ * @secure
1491
+ */
1492
+ this.frontierServiceDescribePreferences = (params = {}) => this.request(__spreadValues({
1493
+ path: `/v1beta1/preferences/_describe`,
1494
+ method: "GET",
1495
+ secure: true,
1496
+ format: "json"
1497
+ }, params));
1293
1498
  /**
1294
1499
  * No description
1295
1500
  *
@@ -1399,6 +1604,37 @@ var V1Beta1 = class extends HttpClient {
1399
1604
  secure: true,
1400
1605
  format: "json"
1401
1606
  }, params));
1607
+ /**
1608
+ * @description List a project preferences by ID.
1609
+ *
1610
+ * @tags Preference
1611
+ * @name FrontierServiceListProjectPreferences
1612
+ * @summary List project preferences
1613
+ * @request GET:/v1beta1/projects/{id}/preferences
1614
+ * @secure
1615
+ */
1616
+ this.frontierServiceListProjectPreferences = (id, params = {}) => this.request(__spreadValues({
1617
+ path: `/v1beta1/projects/${id}/preferences`,
1618
+ method: "GET",
1619
+ secure: true,
1620
+ format: "json"
1621
+ }, params));
1622
+ /**
1623
+ * @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.
1624
+ *
1625
+ * @tags Preference
1626
+ * @name FrontierServiceCreateProjectPreferences
1627
+ * @summary Create project preferences
1628
+ * @request POST:/v1beta1/projects/{id}/preferences
1629
+ * @secure
1630
+ */
1631
+ this.frontierServiceCreateProjectPreferences = (id, body, params = {}) => this.request(__spreadValues({
1632
+ path: `/v1beta1/projects/${id}/preferences`,
1633
+ method: "POST",
1634
+ body,
1635
+ secure: true,
1636
+ format: "json"
1637
+ }, params));
1402
1638
  /**
1403
1639
  * @description Returns a collection of users of a project. Filter by user permissions is supported.
1404
1640
  *
@@ -1588,6 +1824,22 @@ var V1Beta1 = class extends HttpClient {
1588
1824
  secure: true,
1589
1825
  format: "json"
1590
1826
  }, params));
1827
+ /**
1828
+ * @description Update a role title, description and permissions.
1829
+ *
1830
+ * @tags Role
1831
+ * @name AdminServiceUpdateRole
1832
+ * @summary Update role
1833
+ * @request PUT:/v1beta1/roles/{id}
1834
+ * @secure
1835
+ */
1836
+ this.adminServiceUpdateRole = (id, body, params = {}) => this.request(__spreadValues({
1837
+ path: `/v1beta1/roles/${id}`,
1838
+ method: "PUT",
1839
+ body,
1840
+ secure: true,
1841
+ format: "json"
1842
+ }, params));
1591
1843
  /**
1592
1844
  * @description Returns the service user of an organization in a Frontier instance. It can be filter by it's state
1593
1845
  *
@@ -1899,7 +2151,7 @@ var V1Beta1 = class extends HttpClient {
1899
2151
  format: "json"
1900
2152
  }, params));
1901
2153
  /**
1902
- * @description Get all the organizations a user belongs to.
2154
+ * @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
1903
2155
  *
1904
2156
  * @tags User
1905
2157
  * @name FrontierServiceGetOrganizationsByUser
@@ -1913,6 +2165,37 @@ var V1Beta1 = class extends HttpClient {
1913
2165
  secure: true,
1914
2166
  format: "json"
1915
2167
  }, params));
2168
+ /**
2169
+ * @description List a user preferences by ID.
2170
+ *
2171
+ * @tags Preference
2172
+ * @name FrontierServiceListUserPreferences
2173
+ * @summary List user preferences
2174
+ * @request GET:/v1beta1/users/{id}/preferences
2175
+ * @secure
2176
+ */
2177
+ this.frontierServiceListUserPreferences = (id, params = {}) => this.request(__spreadValues({
2178
+ path: `/v1beta1/users/${id}/preferences`,
2179
+ method: "GET",
2180
+ secure: true,
2181
+ format: "json"
2182
+ }, params));
2183
+ /**
2184
+ * @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.
2185
+ *
2186
+ * @tags Preference
2187
+ * @name FrontierServiceCreateUserPreferences
2188
+ * @summary Create user preferences
2189
+ * @request POST:/v1beta1/users/{id}/preferences
2190
+ * @secure
2191
+ */
2192
+ this.frontierServiceCreateUserPreferences = (id, body, params = {}) => this.request(__spreadValues({
2193
+ path: `/v1beta1/users/${id}/preferences`,
2194
+ method: "POST",
2195
+ body,
2196
+ secure: true,
2197
+ format: "json"
2198
+ }, params));
1916
2199
  /**
1917
2200
  * @description Get all the projects a user belongs to.
1918
2201
  *
@@ -1975,7 +2258,7 @@ var V1Beta1 = class extends HttpClient {
1975
2258
  format: "json"
1976
2259
  }, params));
1977
2260
  /**
1978
- * @description Get all organizations the current user belongs to
2261
+ * @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
1979
2262
  *
1980
2263
  * @tags User
1981
2264
  * @name FrontierServiceGetOrganizationsByCurrentUser
@@ -1989,6 +2272,38 @@ var V1Beta1 = class extends HttpClient {
1989
2272
  secure: true,
1990
2273
  format: "json"
1991
2274
  }, params));
2275
+ /**
2276
+ * @description List a user preferences by ID.
2277
+ *
2278
+ * @tags Preference
2279
+ * @name FrontierServiceListCurrentUserPreferences
2280
+ * @summary List current user preferences
2281
+ * @request GET:/v1beta1/users/self/preferences
2282
+ * @secure
2283
+ */
2284
+ this.frontierServiceListCurrentUserPreferences = (params = {}) => this.request(__spreadValues({
2285
+ path: `/v1beta1/users/self/preferences`,
2286
+ method: "GET",
2287
+ secure: true,
2288
+ format: "json"
2289
+ }, params));
2290
+ /**
2291
+ * @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.
2292
+ *
2293
+ * @tags Preference
2294
+ * @name FrontierServiceCreateCurrentUserPreferences
2295
+ * @summary Create current user preferences
2296
+ * @request POST:/v1beta1/users/self/preferences
2297
+ * @secure
2298
+ */
2299
+ this.frontierServiceCreateCurrentUserPreferences = (body, params = {}) => this.request(__spreadValues({
2300
+ path: `/v1beta1/users/self/preferences`,
2301
+ method: "POST",
2302
+ body,
2303
+ secure: true,
2304
+ type: "application/json" /* Json */,
2305
+ format: "json"
2306
+ }, params));
1992
2307
  /**
1993
2308
  * @description Get all projects the current user belongs to
1994
2309
  *
@@ -2007,9 +2322,17 @@ var V1Beta1 = class extends HttpClient {
2007
2322
  }
2008
2323
  };
2009
2324
 
2325
+ // client/data-contracts.ts
2326
+ var ProtobufNullValue = /* @__PURE__ */ ((ProtobufNullValue2) => {
2327
+ ProtobufNullValue2["NULL_VALUE"] = "NULL_VALUE";
2328
+ return ProtobufNullValue2;
2329
+ })(ProtobufNullValue || {});
2330
+
2010
2331
  // src/index.ts
2011
2332
  var FrontierClient = V1Beta1;
2012
2333
  // Annotate the CommonJS export names for ESM import in node:
2013
2334
  0 && (module.exports = {
2014
- FrontierClient
2335
+ FrontierClient,
2336
+ ProtobufNullValue,
2337
+ V1Beta1
2015
2338
  });