@raystack/frontier 0.0.0 → 0.0.2

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.
@@ -66,51 +66,1960 @@ import React, {
66
66
  useState
67
67
  } from "react";
68
68
 
69
- // react/frontier.ts
70
- import axios from "axios";
71
- var Frontier = class {
72
- constructor(options) {
73
- this.getAuthAtrategies = () => __async(this, null, function* () {
74
- return yield this.instance.get("/v1beta1/auth");
75
- });
76
- this.getAuthStrategyEndpoint = (strategy) => __async(this, null, function* () {
77
- return yield this.instance.get(`/v1beta1/auth/register/${strategy}`);
78
- });
79
- this.getMagicLinkAuthStrategyEndpoint = (email) => __async(this, null, function* () {
80
- return yield this.instance.get(
81
- `/v1beta1/auth/register/mailotp?email=${email}`
82
- );
83
- });
84
- this.verifyMagicLinkAuthStrategyEndpoint = (code, state) => __async(this, null, function* () {
85
- return yield this.instance.get(
86
- `/v1beta1/auth/callback?strategy_name=mailotp&code=${code}&state=${state}`
87
- );
88
- });
89
- this.getCurrentUser = () => __async(this, null, function* () {
90
- return yield this.instance.get("/v1beta1/users/self");
91
- });
92
- this.getUserGroups = (userId) => __async(this, null, function* () {
93
- return yield this.instance.get(`/v1beta1/users/${userId}/groups`);
94
- });
95
- this.getUserOrganisations = (userId) => __async(this, null, function* () {
96
- return yield this.instance.get(`/v1beta1/users/${userId}/organizations`);
97
- });
98
- this.createOrganisation = (data) => __async(this, null, function* () {
99
- return yield this.instance.post(`/v1beta1/organizations`, data);
69
+ // client/http-client.ts
70
+ var HttpClient = class {
71
+ constructor(apiConfig = {}) {
72
+ this.baseUrl = "http://127.0.0.1:7400";
73
+ this.securityData = null;
74
+ this.abortControllers = /* @__PURE__ */ new Map();
75
+ this.customFetch = (...fetchParams) => fetch(...fetchParams);
76
+ this.baseApiParams = {
77
+ credentials: "same-origin",
78
+ headers: {},
79
+ redirect: "follow",
80
+ referrerPolicy: "no-referrer"
81
+ };
82
+ this.setSecurityData = (data) => {
83
+ this.securityData = data;
84
+ };
85
+ this.contentFormatters = {
86
+ ["application/json" /* Json */]: (input) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
87
+ ["text/plain" /* Text */]: (input) => input !== null && typeof input !== "string" ? JSON.stringify(input) : input,
88
+ ["multipart/form-data" /* FormData */]: (input) => Object.keys(input || {}).reduce((formData, key) => {
89
+ const property = input[key];
90
+ formData.append(
91
+ key,
92
+ property instanceof Blob ? property : typeof property === "object" && property !== null ? JSON.stringify(property) : `${property}`
93
+ );
94
+ return formData;
95
+ }, new FormData()),
96
+ ["application/x-www-form-urlencoded" /* UrlEncoded */]: (input) => this.toQueryString(input)
97
+ };
98
+ this.createAbortSignal = (cancelToken) => {
99
+ if (this.abortControllers.has(cancelToken)) {
100
+ const abortController2 = this.abortControllers.get(cancelToken);
101
+ if (abortController2) {
102
+ return abortController2.signal;
103
+ }
104
+ return void 0;
105
+ }
106
+ const abortController = new AbortController();
107
+ this.abortControllers.set(cancelToken, abortController);
108
+ return abortController.signal;
109
+ };
110
+ this.abortRequest = (cancelToken) => {
111
+ const abortController = this.abortControllers.get(cancelToken);
112
+ if (abortController) {
113
+ abortController.abort();
114
+ this.abortControllers.delete(cancelToken);
115
+ }
116
+ };
117
+ this.request = (_a) => __async(this, null, function* () {
118
+ var _b = _a, {
119
+ body,
120
+ secure,
121
+ path,
122
+ type,
123
+ query,
124
+ format,
125
+ baseUrl,
126
+ cancelToken
127
+ } = _b, params = __objRest(_b, [
128
+ "body",
129
+ "secure",
130
+ "path",
131
+ "type",
132
+ "query",
133
+ "format",
134
+ "baseUrl",
135
+ "cancelToken"
136
+ ]);
137
+ const secureParams = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && (yield this.securityWorker(this.securityData)) || {};
138
+ const requestParams = this.mergeRequestParams(params, secureParams);
139
+ const queryString = query && this.toQueryString(query);
140
+ const payloadFormatter = this.contentFormatters[type || "application/json" /* Json */];
141
+ const responseFormat = format || requestParams.format;
142
+ return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, __spreadProps(__spreadValues({}, requestParams), {
143
+ headers: __spreadValues(__spreadValues({}, requestParams.headers || {}), type && type !== "multipart/form-data" /* FormData */ ? { "Content-Type": type } : {}),
144
+ signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
145
+ body: typeof body === "undefined" || body === null ? null : payloadFormatter(body)
146
+ })).then((response) => __async(this, null, function* () {
147
+ const r = response;
148
+ r.data = null;
149
+ r.error = null;
150
+ const data = !responseFormat ? r : yield response[responseFormat]().then((data2) => {
151
+ if (r.ok) {
152
+ r.data = data2;
153
+ } else {
154
+ r.error = data2;
155
+ }
156
+ return r;
157
+ }).catch((e) => {
158
+ r.error = e;
159
+ return r;
160
+ });
161
+ if (cancelToken) {
162
+ this.abortControllers.delete(cancelToken);
163
+ }
164
+ if (!response.ok)
165
+ throw data;
166
+ return data;
167
+ }));
100
168
  });
101
- this.options = options;
102
- this.instance = axios.create({
103
- baseURL: options.endpoint,
104
- withCredentials: true
169
+ Object.assign(this, apiConfig);
170
+ }
171
+ encodeQueryParam(key, value) {
172
+ const encodedKey = encodeURIComponent(key);
173
+ return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
174
+ }
175
+ addQueryParam(query, key) {
176
+ return this.encodeQueryParam(key, query[key]);
177
+ }
178
+ addArrayQueryParam(query, key) {
179
+ const value = query[key];
180
+ return value.map((v) => this.encodeQueryParam(key, v)).join("&");
181
+ }
182
+ toQueryString(rawQuery) {
183
+ const query = rawQuery || {};
184
+ const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]);
185
+ return keys.map((key) => Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key)).join("&");
186
+ }
187
+ addQueryParams(rawQuery) {
188
+ const queryString = this.toQueryString(rawQuery);
189
+ return queryString ? `?${queryString}` : "";
190
+ }
191
+ mergeRequestParams(params1, params2) {
192
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, this.baseApiParams), params1), params2 || {}), {
193
+ headers: __spreadValues(__spreadValues(__spreadValues({}, this.baseApiParams.headers || {}), params1.headers || {}), params2 && params2.headers || {})
105
194
  });
106
195
  }
107
- static getOrCreateInstance(options) {
108
- if (!this.classInstance) {
109
- return new Frontier(options);
196
+ };
197
+
198
+ // client/V1Beta1.ts
199
+ var V1Beta1 = class extends HttpClient {
200
+ constructor() {
201
+ super(...arguments);
202
+ /**
203
+ * @description Lists all the groups from all the organizations in a Frontier instance. It can be filtered by organization and state.
204
+ *
205
+ * @tags Group
206
+ * @name AdminServiceListGroups
207
+ * @summary List all groups
208
+ * @request GET:/v1beta1/admin/groups
209
+ * @secure
210
+ */
211
+ this.adminServiceListGroups = (query, params = {}) => this.request(__spreadValues({
212
+ path: `/v1beta1/admin/groups`,
213
+ method: "GET",
214
+ query,
215
+ secure: true,
216
+ format: "json"
217
+ }, params));
218
+ /**
219
+ * @description Lists all the organizations in a Frontier instance. It can be filtered by user and state.
220
+ *
221
+ * @tags Organization
222
+ * @name AdminServiceListAllOrganizations
223
+ * @summary List all organizations
224
+ * @request GET:/v1beta1/admin/organizations
225
+ * @secure
226
+ */
227
+ this.adminServiceListAllOrganizations = (query, params = {}) => this.request(__spreadValues({
228
+ path: `/v1beta1/admin/organizations`,
229
+ method: "GET",
230
+ query,
231
+ secure: true,
232
+ format: "json"
233
+ }, params));
234
+ /**
235
+ * @description Lists all the projects from all the organizations in a Frontier instance. It can be filtered by organization and state.
236
+ *
237
+ * @tags Project
238
+ * @name AdminServiceListProjects
239
+ * @summary List all projects
240
+ * @request GET:/v1beta1/admin/projects
241
+ * @secure
242
+ */
243
+ this.adminServiceListProjects = (query, params = {}) => this.request(__spreadValues({
244
+ path: `/v1beta1/admin/projects`,
245
+ method: "GET",
246
+ query,
247
+ secure: true,
248
+ format: "json"
249
+ }, params));
250
+ /**
251
+ * No description
252
+ *
253
+ * @tags Relation
254
+ * @name AdminServiceListRelations
255
+ * @summary List all relations
256
+ * @request GET:/v1beta1/admin/relations
257
+ * @secure
258
+ */
259
+ this.adminServiceListRelations = (params = {}) => this.request(__spreadValues({
260
+ path: `/v1beta1/admin/relations`,
261
+ method: "GET",
262
+ secure: true,
263
+ format: "json"
264
+ }, params));
265
+ /**
266
+ * @description Lists all the resources from all the organizations in a Frontier instance. It can be filtered by user, project, organization and namespace.
267
+ *
268
+ * @tags Resource
269
+ * @name AdminServiceListResources
270
+ * @summary List all resources
271
+ * @request GET:/v1beta1/admin/resources
272
+ * @secure
273
+ */
274
+ this.adminServiceListResources = (query, params = {}) => this.request(__spreadValues({
275
+ path: `/v1beta1/admin/resources`,
276
+ method: "GET",
277
+ query,
278
+ secure: true,
279
+ format: "json"
280
+ }, params));
281
+ /**
282
+ * @description Lists all the users from all the organizations in a Frontier instance. It can be filtered by keyword, organization, group and state.
283
+ *
284
+ * @tags User
285
+ * @name AdminServiceListAllUsers
286
+ * @summary List all users
287
+ * @request GET:/v1beta1/admin/users
288
+ * @secure
289
+ */
290
+ this.adminServiceListAllUsers = (query, params = {}) => this.request(__spreadValues({
291
+ path: `/v1beta1/admin/users`,
292
+ method: "GET",
293
+ query,
294
+ secure: true,
295
+ format: "json"
296
+ }, params));
297
+ /**
298
+ * @description Returns a list of identity providers configured on an instance level in Frontier. e.g Google, AzureAD, Github etc
299
+ *
300
+ * @tags Authn
301
+ * @name FrontierServiceListAuthStrategies
302
+ * @summary List authentication strategies
303
+ * @request GET:/v1beta1/auth
304
+ * @secure
305
+ */
306
+ this.frontierServiceListAuthStrategies = (params = {}) => this.request(__spreadValues({
307
+ path: `/v1beta1/auth`,
308
+ method: "GET",
309
+ secure: true,
310
+ format: "json"
311
+ }, params));
312
+ /**
313
+ * @description Callback from a strategy. This is the endpoint where the strategy will redirect the user after successful authentication. This endpoint will be called with the code and state query parameters. The code will be used to get the access token from the strategy and the state will be used to get the return_to url from the session and redirect the user to that url.
314
+ *
315
+ * @tags Authn
316
+ * @name FrontierServiceAuthCallback
317
+ * @summary Callback from a strategy
318
+ * @request GET:/v1beta1/auth/callback
319
+ * @secure
320
+ */
321
+ this.frontierServiceAuthCallback = (query, params = {}) => this.request(__spreadValues({
322
+ path: `/v1beta1/auth/callback`,
323
+ method: "GET",
324
+ query,
325
+ secure: true,
326
+ format: "json"
327
+ }, params));
328
+ /**
329
+ * @description Callback from a strategy. This is the endpoint where the strategy will redirect the user after successful authentication. This endpoint will be called with the code and state query parameters. The code will be used to get the access token from the strategy and the state will be used to get the return_to url from the session and redirect the user to that url.
330
+ *
331
+ * @tags Authn
332
+ * @name FrontierServiceAuthCallback2
333
+ * @summary Callback from a strategy
334
+ * @request POST:/v1beta1/auth/callback
335
+ * @secure
336
+ */
337
+ this.frontierServiceAuthCallback2 = (body, params = {}) => this.request(__spreadValues({
338
+ path: `/v1beta1/auth/callback`,
339
+ method: "POST",
340
+ body,
341
+ secure: true,
342
+ type: "application/json" /* Json */,
343
+ format: "json"
344
+ }, params));
345
+ /**
346
+ * No description
347
+ *
348
+ * @tags Authz
349
+ * @name FrontierServiceGetJwKs
350
+ * @summary Get well known JWKs
351
+ * @request GET:/v1beta1/auth/jwks
352
+ * @secure
353
+ */
354
+ this.frontierServiceGetJwKs = (params = {}) => this.request(__spreadValues({
355
+ path: `/v1beta1/auth/jwks`,
356
+ method: "GET",
357
+ secure: true,
358
+ format: "json"
359
+ }, params));
360
+ /**
361
+ * No description
362
+ *
363
+ * @tags Authn
364
+ * @name FrontierServiceAuthLogout
365
+ * @summary Logout from a strategy
366
+ * @request GET:/v1beta1/auth/logout
367
+ * @secure
368
+ */
369
+ this.frontierServiceAuthLogout = (params = {}) => this.request(__spreadValues({
370
+ path: `/v1beta1/auth/logout`,
371
+ method: "GET",
372
+ secure: true,
373
+ format: "json"
374
+ }, params));
375
+ /**
376
+ * No description
377
+ *
378
+ * @tags Authn
379
+ * @name FrontierServiceAuthLogout2
380
+ * @summary Logout from a strategy
381
+ * @request DELETE:/v1beta1/auth/logout
382
+ * @secure
383
+ */
384
+ this.frontierServiceAuthLogout2 = (params = {}) => this.request(__spreadValues({
385
+ path: `/v1beta1/auth/logout`,
386
+ method: "DELETE",
387
+ secure: true,
388
+ format: "json"
389
+ }, params));
390
+ /**
391
+ * @description Authenticate a user with a strategy. By default, after successful authentication no operation will be performed to apply redirection in case of browsers, provide a url in the authenticate request body that will be used for redirection after authentication. Also set redirect as true for redirecting the user request to the redirect_url after successful authentication.
392
+ *
393
+ * @tags Authn
394
+ * @name FrontierServiceAuthenticate
395
+ * @summary Authenticate with a strategy
396
+ * @request GET:/v1beta1/auth/register/{strategyName}
397
+ * @secure
398
+ */
399
+ this.frontierServiceAuthenticate = (strategyName, query, params = {}) => this.request(__spreadValues({
400
+ path: `/v1beta1/auth/register/${strategyName}`,
401
+ method: "GET",
402
+ query,
403
+ secure: true,
404
+ format: "json"
405
+ }, params));
406
+ /**
407
+ * @description Authenticate a user with a strategy. By default, after successful authentication no operation will be performed to apply redirection in case of browsers, provide a url in the authenticate request body that will be used for redirection after authentication. Also set redirect as true for redirecting the user request to the redirect_url after successful authentication.
408
+ *
409
+ * @tags Authn
410
+ * @name FrontierServiceAuthenticate2
411
+ * @summary Authenticate with a strategy
412
+ * @request POST:/v1beta1/auth/register/{strategyName}
413
+ * @secure
414
+ */
415
+ this.frontierServiceAuthenticate2 = (strategyName, body, params = {}) => this.request(__spreadValues({
416
+ path: `/v1beta1/auth/register/${strategyName}`,
417
+ method: "POST",
418
+ body,
419
+ secure: true,
420
+ type: "application/json" /* Json */,
421
+ format: "json"
422
+ }, params));
423
+ /**
424
+ * @description Access token can be generated by providing the credentials in the request body/header. The credentials can be client id and secret or service account generated key jwt. Use the generated access token in Authorization header to access the frontier resources.
425
+ *
426
+ * @tags Authn
427
+ * @name FrontierServiceAuthToken
428
+ * @summary Generate access token by given credentials
429
+ * @request POST:/v1beta1/auth/token
430
+ * @secure
431
+ */
432
+ this.frontierServiceAuthToken = (body, params = {}) => this.request(__spreadValues({
433
+ path: `/v1beta1/auth/token`,
434
+ method: "POST",
435
+ body,
436
+ secure: true,
437
+ type: "application/json" /* Json */,
438
+ format: "json"
439
+ }, params));
440
+ /**
441
+ * @description Returns true if a principal has required permissions to access a resource and false otherwise.<br/> Note the principal can be a user or a service account, and Frontier will the credentials from the current logged in principal from the session cookie (if any), or the client id and secret (in case of service users) or the access token (in case of human user accounts).
442
+ *
443
+ * @tags Authz
444
+ * @name FrontierServiceCheckResourcePermission
445
+ * @summary Check
446
+ * @request POST:/v1beta1/check
447
+ * @secure
448
+ */
449
+ this.frontierServiceCheckResourcePermission = (body, params = {}) => this.request(__spreadValues({
450
+ path: `/v1beta1/check`,
451
+ method: "POST",
452
+ body,
453
+ secure: true,
454
+ type: "application/json" /* Json */,
455
+ format: "json"
456
+ }, params));
457
+ /**
458
+ * @description Returns a list of all metaschemas configured on an instance level in Frontier. e.g user, project, organization etc
459
+ *
460
+ * @tags MetaSchema
461
+ * @name FrontierServiceListMetaSchemas
462
+ * @summary List metaschemas
463
+ * @request GET:/v1beta1/meta/schemas
464
+ * @secure
465
+ */
466
+ this.frontierServiceListMetaSchemas = (params = {}) => this.request(__spreadValues({
467
+ path: `/v1beta1/meta/schemas`,
468
+ method: "GET",
469
+ secure: true,
470
+ format: "json"
471
+ }, params));
472
+ /**
473
+ * @description Create a new metadata schema. The metaschema **name** must be unique within the entire Frontier instance and can contain only alphanumeric characters, dashes and underscores. The metaschema **schema** must be a valid JSON schema.Please refer to https://json-schema.org/ to know more about json schema. <br/>*Example:* `{name:"user",schema:{"type":"object","properties":{"label":{"type":"object","additionalProperties":{"type":"string"}},"description":{"type":"string"}}}}`
474
+ *
475
+ * @tags MetaSchema
476
+ * @name FrontierServiceCreateMetaSchema
477
+ * @summary Create metaschema
478
+ * @request POST:/v1beta1/meta/schemas
479
+ * @secure
480
+ */
481
+ this.frontierServiceCreateMetaSchema = (body, params = {}) => this.request(__spreadValues({
482
+ path: `/v1beta1/meta/schemas`,
483
+ method: "POST",
484
+ body,
485
+ secure: true,
486
+ format: "json"
487
+ }, params));
488
+ /**
489
+ * @description Get a metadata schema by ID.
490
+ *
491
+ * @tags MetaSchema
492
+ * @name FrontierServiceGetMetaSchema
493
+ * @summary Get metaschema
494
+ * @request GET:/v1beta1/meta/schemas/{id}
495
+ * @secure
496
+ */
497
+ this.frontierServiceGetMetaSchema = (id, params = {}) => this.request(__spreadValues({
498
+ path: `/v1beta1/meta/schemas/${id}`,
499
+ method: "GET",
500
+ secure: true,
501
+ format: "json"
502
+ }, params));
503
+ /**
504
+ * @description Delete a metadata schema permanently. Once deleted the metaschema won't be used to validate the metadata. For example, if a metaschema(with `label` and `description` fields) is used to validate the metadata of a user, then deleting the metaschema will not validate the metadata of the user and metadata field can contain any key-value pair(and say another field called `foo` can be inserted in a user's metadata).
505
+ *
506
+ * @tags MetaSchema
507
+ * @name FrontierServiceDeleteMetaSchema
508
+ * @summary Delete metaschema
509
+ * @request DELETE:/v1beta1/meta/schemas/{id}
510
+ * @secure
511
+ */
512
+ this.frontierServiceDeleteMetaSchema = (id, params = {}) => this.request(__spreadValues({
513
+ path: `/v1beta1/meta/schemas/${id}`,
514
+ method: "DELETE",
515
+ secure: true,
516
+ format: "json"
517
+ }, params));
518
+ /**
519
+ * @description Update a metadata schema. Only `schema` field of a metaschema can be updated. The metaschema `schema` must be a valid JSON schema.Please refer to https://json-schema.org/ to know more about json schema. <br/>*Example:* `{name:"user",schema:{"type":"object","properties":{"label":{"type":"object","additionalProperties":{"type":"string"}},"description":{"type":"string"}}}}`
520
+ *
521
+ * @tags MetaSchema
522
+ * @name FrontierServiceUpdateMetaSchema
523
+ * @summary Update metaschema
524
+ * @request PUT:/v1beta1/meta/schemas/{id}
525
+ * @secure
526
+ */
527
+ this.frontierServiceUpdateMetaSchema = (id, body, params = {}) => this.request(__spreadValues({
528
+ path: `/v1beta1/meta/schemas/${id}`,
529
+ method: "PUT",
530
+ body,
531
+ secure: true,
532
+ format: "json"
533
+ }, params));
534
+ /**
535
+ * @description Returns the list of all namespaces in a Frontier instance
536
+ *
537
+ * @tags Namespace
538
+ * @name FrontierServiceListNamespaces
539
+ * @summary Get all namespaces
540
+ * @request GET:/v1beta1/namespaces
541
+ * @secure
542
+ */
543
+ this.frontierServiceListNamespaces = (params = {}) => this.request(__spreadValues({
544
+ path: `/v1beta1/namespaces`,
545
+ method: "GET",
546
+ secure: true,
547
+ format: "json"
548
+ }, params));
549
+ /**
550
+ * @description Returns a namespace by ID
551
+ *
552
+ * @tags Namespace
553
+ * @name FrontierServiceGetNamespace
554
+ * @summary Get namespace
555
+ * @request GET:/v1beta1/namespaces/{id}
556
+ * @secure
557
+ */
558
+ this.frontierServiceGetNamespace = (id, params = {}) => this.request(__spreadValues({
559
+ path: `/v1beta1/namespaces/${id}`,
560
+ method: "GET",
561
+ secure: true,
562
+ format: "json"
563
+ }, params));
564
+ /**
565
+ * @description Returns a list of audit logs of an organization in Frontier.
566
+ *
567
+ * @tags AuditLog
568
+ * @name FrontierServiceListOrganizationAuditLogs
569
+ * @summary List audit logs
570
+ * @request GET:/v1beta1/organization/{orgId}/auditlogs
571
+ * @secure
572
+ */
573
+ this.frontierServiceListOrganizationAuditLogs = (orgId, query, params = {}) => this.request(__spreadValues({
574
+ path: `/v1beta1/organization/${orgId}/auditlogs`,
575
+ method: "GET",
576
+ query,
577
+ secure: true,
578
+ format: "json"
579
+ }, params));
580
+ /**
581
+ * @description Create new audit logs in a batch.
582
+ *
583
+ * @tags AuditLog
584
+ * @name FrontierServiceCreateOrganizationAuditLogs
585
+ * @summary Create audit log
586
+ * @request POST:/v1beta1/organization/{orgId}/auditlogs
587
+ * @secure
588
+ */
589
+ this.frontierServiceCreateOrganizationAuditLogs = (orgId, body, params = {}) => this.request(__spreadValues({
590
+ path: `/v1beta1/organization/${orgId}/auditlogs`,
591
+ method: "POST",
592
+ body,
593
+ secure: true,
594
+ type: "application/json" /* Json */,
595
+ format: "json"
596
+ }, params));
597
+ /**
598
+ * @description Get an audit log by ID.
599
+ *
600
+ * @tags AuditLog
601
+ * @name FrontierServiceGetOrganizationAuditLog
602
+ * @summary Get audit log
603
+ * @request GET:/v1beta1/organization/{orgId}/auditlogs/{id}
604
+ * @secure
605
+ */
606
+ this.frontierServiceGetOrganizationAuditLog = (orgId, id, params = {}) => this.request(__spreadValues({
607
+ path: `/v1beta1/organization/${orgId}/auditlogs/${id}`,
608
+ method: "GET",
609
+ secure: true,
610
+ format: "json"
611
+ }, params));
612
+ /**
613
+ * @description Returns a list of organizations. It can be filtered by userID or organization state.
614
+ *
615
+ * @tags Organization
616
+ * @name FrontierServiceListOrganizations
617
+ * @summary List organizations
618
+ * @request GET:/v1beta1/organizations
619
+ * @secure
620
+ */
621
+ this.frontierServiceListOrganizations = (query, params = {}) => this.request(__spreadValues({
622
+ path: `/v1beta1/organizations`,
623
+ method: "GET",
624
+ query,
625
+ secure: true,
626
+ format: "json"
627
+ }, params));
628
+ /**
629
+ * No description
630
+ *
631
+ * @tags Organization
632
+ * @name FrontierServiceCreateOrganization
633
+ * @summary Create organization
634
+ * @request POST:/v1beta1/organizations
635
+ * @secure
636
+ */
637
+ this.frontierServiceCreateOrganization = (body, params = {}) => this.request(__spreadValues({
638
+ path: `/v1beta1/organizations`,
639
+ method: "POST",
640
+ body,
641
+ secure: true,
642
+ format: "json"
643
+ }, params));
644
+ /**
645
+ * @description Get organization by ID or name
646
+ *
647
+ * @tags Organization
648
+ * @name FrontierServiceGetOrganization
649
+ * @summary Get organization
650
+ * @request GET:/v1beta1/organizations/{id}
651
+ * @secure
652
+ */
653
+ this.frontierServiceGetOrganization = (id, params = {}) => this.request(__spreadValues({
654
+ path: `/v1beta1/organizations/${id}`,
655
+ method: "GET",
656
+ secure: true,
657
+ format: "json"
658
+ }, params));
659
+ /**
660
+ * @description Delete an organization and all of its relations permanently. The organization users will not be deleted from Frontier.
661
+ *
662
+ * @tags Organization
663
+ * @name FrontierServiceDeleteOrganization
664
+ * @summary Delete organization
665
+ * @request DELETE:/v1beta1/organizations/{id}
666
+ * @secure
667
+ */
668
+ this.frontierServiceDeleteOrganization = (id, params = {}) => this.request(__spreadValues({
669
+ path: `/v1beta1/organizations/${id}`,
670
+ method: "DELETE",
671
+ secure: true,
672
+ format: "json"
673
+ }, params));
674
+ /**
675
+ * @description Update organization by ID
676
+ *
677
+ * @tags Organization
678
+ * @name FrontierServiceUpdateOrganization
679
+ * @summary Update organization
680
+ * @request PUT:/v1beta1/organizations/{id}
681
+ * @secure
682
+ */
683
+ this.frontierServiceUpdateOrganization = (id, body, params = {}) => this.request(__spreadValues({
684
+ path: `/v1beta1/organizations/${id}`,
685
+ method: "PUT",
686
+ body,
687
+ secure: true,
688
+ format: "json"
689
+ }, params));
690
+ /**
691
+ * @description Returns a list admins of an organization
692
+ *
693
+ * @tags Organization
694
+ * @name FrontierServiceListOrganizationAdmins
695
+ * @summary List organization admins
696
+ * @request GET:/v1beta1/organizations/{id}/admins
697
+ * @secure
698
+ */
699
+ this.frontierServiceListOrganizationAdmins = (id, params = {}) => this.request(__spreadValues({
700
+ path: `/v1beta1/organizations/${id}/admins`,
701
+ method: "GET",
702
+ secure: true,
703
+ format: "json"
704
+ }, params));
705
+ /**
706
+ * @description Sets the state of the organization as disabled. The existing users in the org will not be able to access any organization resources.
707
+ *
708
+ * @tags Organization
709
+ * @name FrontierServiceDisableOrganization
710
+ * @summary Disable organization
711
+ * @request POST:/v1beta1/organizations/{id}/disable
712
+ * @secure
713
+ */
714
+ this.frontierServiceDisableOrganization = (id, body, params = {}) => this.request(__spreadValues({
715
+ path: `/v1beta1/organizations/${id}/disable`,
716
+ method: "POST",
717
+ body,
718
+ secure: true,
719
+ format: "json"
720
+ }, params));
721
+ /**
722
+ * @description Sets the state of the organization as enabled. The existing users in the org will be able to access any organization resources.
723
+ *
724
+ * @tags Organization
725
+ * @name FrontierServiceEnableOrganization
726
+ * @summary Enable organization
727
+ * @request POST:/v1beta1/organizations/{id}/enable
728
+ * @secure
729
+ */
730
+ this.frontierServiceEnableOrganization = (id, body, params = {}) => this.request(__spreadValues({
731
+ path: `/v1beta1/organizations/${id}/enable`,
732
+ method: "POST",
733
+ body,
734
+ secure: true,
735
+ format: "json"
736
+ }, params));
737
+ /**
738
+ * @description Get all projects that belong to an organization
739
+ *
740
+ * @tags Organization
741
+ * @name FrontierServiceListOrganizationProjects
742
+ * @summary Get organization projects
743
+ * @request GET:/v1beta1/organizations/{id}/projects
744
+ * @secure
745
+ */
746
+ this.frontierServiceListOrganizationProjects = (id, query, params = {}) => this.request(__spreadValues({
747
+ path: `/v1beta1/organizations/${id}/projects`,
748
+ method: "GET",
749
+ query,
750
+ secure: true,
751
+ format: "json"
752
+ }, params));
753
+ /**
754
+ * No description
755
+ *
756
+ * @tags Organization
757
+ * @name FrontierServiceListOrganizationServiceUsers
758
+ * @summary List organization service users
759
+ * @request GET:/v1beta1/organizations/{id}/serviceusers
760
+ * @secure
761
+ */
762
+ this.frontierServiceListOrganizationServiceUsers = (id, params = {}) => this.request(__spreadValues({
763
+ path: `/v1beta1/organizations/${id}/serviceusers`,
764
+ method: "GET",
765
+ secure: true,
766
+ format: "json"
767
+ }, params));
768
+ /**
769
+ * No description
770
+ *
771
+ * @tags Organization
772
+ * @name FrontierServiceListOrganizationUsers
773
+ * @summary List organization users
774
+ * @request GET:/v1beta1/organizations/{id}/users
775
+ * @secure
776
+ */
777
+ this.frontierServiceListOrganizationUsers = (id, query, params = {}) => this.request(__spreadValues({
778
+ path: `/v1beta1/organizations/${id}/users`,
779
+ method: "GET",
780
+ query,
781
+ secure: true,
782
+ format: "json"
783
+ }, params));
784
+ /**
785
+ * @description Add a user to an organization. A user must exists in Frontier before adding it to an org. This request will fail if the user doesn't exists
786
+ *
787
+ * @tags Organization
788
+ * @name FrontierServiceAddOrganizationUsers
789
+ * @summary Add organization user
790
+ * @request POST:/v1beta1/organizations/{id}/users
791
+ * @secure
792
+ */
793
+ this.frontierServiceAddOrganizationUsers = (id, body, params = {}) => this.request(__spreadValues({
794
+ path: `/v1beta1/organizations/${id}/users`,
795
+ method: "POST",
796
+ body,
797
+ secure: true,
798
+ type: "application/json" /* Json */,
799
+ format: "json"
800
+ }, params));
801
+ /**
802
+ * @description Remove a user from an organization
803
+ *
804
+ * @tags Organization
805
+ * @name FrontierServiceRemoveOrganizationUser
806
+ * @summary Remove organization user
807
+ * @request DELETE:/v1beta1/organizations/{id}/users/{userId}
808
+ * @secure
809
+ */
810
+ this.frontierServiceRemoveOrganizationUser = (id, userId, params = {}) => this.request(__spreadValues({
811
+ path: `/v1beta1/organizations/${id}/users/${userId}`,
812
+ method: "DELETE",
813
+ secure: true,
814
+ format: "json"
815
+ }, params));
816
+ /**
817
+ * @description Get all groups that belong to an organization. The results can be filtered by state which can be either be enabled or disabled.
818
+ *
819
+ * @tags Group
820
+ * @name FrontierServiceListOrganizationGroups
821
+ * @summary List organization groups
822
+ * @request GET:/v1beta1/organizations/{orgId}/groups
823
+ * @secure
824
+ */
825
+ this.frontierServiceListOrganizationGroups = (orgId, query, params = {}) => this.request(__spreadValues({
826
+ path: `/v1beta1/organizations/${orgId}/groups`,
827
+ method: "GET",
828
+ query,
829
+ secure: true,
830
+ format: "json"
831
+ }, params));
832
+ /**
833
+ * @description Create a new group in an organization which serves as a container for users. The group can be assigned roles and permissions and can be used to manage access to resources. Also a group can also be assigned to other groups.
834
+ *
835
+ * @tags Group
836
+ * @name FrontierServiceCreateGroup
837
+ * @summary Create group
838
+ * @request POST:/v1beta1/organizations/{orgId}/groups
839
+ * @secure
840
+ */
841
+ this.frontierServiceCreateGroup = (orgId, body, params = {}) => this.request(__spreadValues({
842
+ path: `/v1beta1/organizations/${orgId}/groups`,
843
+ method: "POST",
844
+ body,
845
+ secure: true,
846
+ format: "json"
847
+ }, params));
848
+ /**
849
+ * No description
850
+ *
851
+ * @tags Group
852
+ * @name FrontierServiceGetGroup
853
+ * @summary Get group
854
+ * @request GET:/v1beta1/organizations/{orgId}/groups/{id}
855
+ * @secure
856
+ */
857
+ this.frontierServiceGetGroup = (orgId, id, params = {}) => this.request(__spreadValues({
858
+ path: `/v1beta1/organizations/${orgId}/groups/${id}`,
859
+ method: "GET",
860
+ secure: true,
861
+ format: "json"
862
+ }, params));
863
+ /**
864
+ * @description Delete an organization group permanently and all of its relations
865
+ *
866
+ * @tags Group
867
+ * @name FrontierServiceDeleteGroup
868
+ * @summary Delete group
869
+ * @request DELETE:/v1beta1/organizations/{orgId}/groups/{id}
870
+ * @secure
871
+ */
872
+ this.frontierServiceDeleteGroup = (orgId, id, params = {}) => this.request(__spreadValues({
873
+ path: `/v1beta1/organizations/${orgId}/groups/${id}`,
874
+ method: "DELETE",
875
+ secure: true,
876
+ format: "json"
877
+ }, params));
878
+ /**
879
+ * No description
880
+ *
881
+ * @tags Group
882
+ * @name FrontierServiceUpdateGroup
883
+ * @summary Update group
884
+ * @request PUT:/v1beta1/organizations/{orgId}/groups/{id}
885
+ * @secure
886
+ */
887
+ this.frontierServiceUpdateGroup = (orgId, id, body, params = {}) => this.request(__spreadValues({
888
+ path: `/v1beta1/organizations/${orgId}/groups/${id}`,
889
+ method: "PUT",
890
+ body,
891
+ secure: true,
892
+ format: "json"
893
+ }, params));
894
+ /**
895
+ * @description Sets the state of the group as disabled. The group will not be available for access control and the existing users in the group will not be able to access any resources that are assigned to the group. No other users can be added to the group while it is disabled.
896
+ *
897
+ * @tags Group
898
+ * @name FrontierServiceDisableGroup
899
+ * @summary Disable group
900
+ * @request POST:/v1beta1/organizations/{orgId}/groups/{id}/disable
901
+ * @secure
902
+ */
903
+ this.frontierServiceDisableGroup = (orgId, id, body, params = {}) => this.request(__spreadValues({
904
+ path: `/v1beta1/organizations/${orgId}/groups/${id}/disable`,
905
+ method: "POST",
906
+ body,
907
+ secure: true,
908
+ format: "json"
909
+ }, params));
910
+ /**
911
+ * @description Sets the state of the group as enabled. The `enabled` flag is used to determine if the group can be used for access control.
912
+ *
913
+ * @tags Group
914
+ * @name FrontierServiceEnableGroup
915
+ * @summary Enable group
916
+ * @request POST:/v1beta1/organizations/{orgId}/groups/{id}/enable
917
+ * @secure
918
+ */
919
+ this.frontierServiceEnableGroup = (orgId, id, body, params = {}) => this.request(__spreadValues({
920
+ path: `/v1beta1/organizations/${orgId}/groups/${id}/enable`,
921
+ method: "POST",
922
+ body,
923
+ secure: true,
924
+ format: "json"
925
+ }, params));
926
+ /**
927
+ * @description Returns a list of users that belong to a group.
928
+ *
929
+ * @tags Group
930
+ * @name FrontierServiceListGroupUsers
931
+ * @summary List group users
932
+ * @request GET:/v1beta1/organizations/{orgId}/groups/{id}/users
933
+ * @secure
934
+ */
935
+ this.frontierServiceListGroupUsers = (orgId, id, params = {}) => this.request(__spreadValues({
936
+ path: `/v1beta1/organizations/${orgId}/groups/${id}/users`,
937
+ method: "GET",
938
+ secure: true,
939
+ format: "json"
940
+ }, params));
941
+ /**
942
+ * @description Adds a principle(user and service-users) to a group, existing users in the group will be ignored. A group can't have nested groups as members.
943
+ *
944
+ * @tags Group
945
+ * @name FrontierServiceAddGroupUsers
946
+ * @summary Add group user
947
+ * @request POST:/v1beta1/organizations/{orgId}/groups/{id}/users
948
+ * @secure
949
+ */
950
+ this.frontierServiceAddGroupUsers = (orgId, id, body, params = {}) => this.request(__spreadValues({
951
+ path: `/v1beta1/organizations/${orgId}/groups/${id}/users`,
952
+ method: "POST",
953
+ body,
954
+ secure: true,
955
+ type: "application/json" /* Json */,
956
+ format: "json"
957
+ }, params));
958
+ /**
959
+ * @description Removes a principle(user and service-users) from a group. If the user is not in the group, the request will succeed but no changes will be made.
960
+ *
961
+ * @tags Group
962
+ * @name FrontierServiceRemoveGroupUser
963
+ * @summary Remove group user
964
+ * @request DELETE:/v1beta1/organizations/{orgId}/groups/{id}/users/{userId}
965
+ * @secure
966
+ */
967
+ this.frontierServiceRemoveGroupUser = (orgId, id, userId, params = {}) => this.request(__spreadValues({
968
+ path: `/v1beta1/organizations/${orgId}/groups/${id}/users/${userId}`,
969
+ method: "DELETE",
970
+ secure: true,
971
+ format: "json"
972
+ }, params));
973
+ /**
974
+ * @description Returns all pending invitations queued for an organization
975
+ *
976
+ * @tags Organization
977
+ * @name FrontierServiceListOrganizationInvitations
978
+ * @summary List pending invitations
979
+ * @request GET:/v1beta1/organizations/{orgId}/invitations
980
+ * @secure
981
+ */
982
+ this.frontierServiceListOrganizationInvitations = (orgId, query, params = {}) => this.request(__spreadValues({
983
+ path: `/v1beta1/organizations/${orgId}/invitations`,
984
+ method: "GET",
985
+ query,
986
+ secure: true,
987
+ format: "json"
988
+ }, params));
989
+ /**
990
+ * @description Invite users to an organization, if the user doesn't exists, it will be created and notified. Invitations expire in 7 days
991
+ *
992
+ * @tags Organization
993
+ * @name FrontierServiceCreateOrganizationInvitation
994
+ * @summary Invite user
995
+ * @request POST:/v1beta1/organizations/{orgId}/invitations
996
+ * @secure
997
+ */
998
+ this.frontierServiceCreateOrganizationInvitation = (orgId, body, params = {}) => this.request(__spreadValues({
999
+ path: `/v1beta1/organizations/${orgId}/invitations`,
1000
+ method: "POST",
1001
+ body,
1002
+ secure: true,
1003
+ type: "application/json" /* Json */,
1004
+ format: "json"
1005
+ }, params));
1006
+ /**
1007
+ * @description Returns a pending invitation queued for an organization
1008
+ *
1009
+ * @tags Organization
1010
+ * @name FrontierServiceGetOrganizationInvitation
1011
+ * @summary Get pending invitation
1012
+ * @request GET:/v1beta1/organizations/{orgId}/invitations/{id}
1013
+ * @secure
1014
+ */
1015
+ this.frontierServiceGetOrganizationInvitation = (orgId, id, params = {}) => this.request(__spreadValues({
1016
+ path: `/v1beta1/organizations/${orgId}/invitations/${id}`,
1017
+ method: "GET",
1018
+ secure: true,
1019
+ format: "json"
1020
+ }, params));
1021
+ /**
1022
+ * @description Delete a pending invitation queued for an organization
1023
+ *
1024
+ * @tags Organization
1025
+ * @name FrontierServiceDeleteOrganizationInvitation
1026
+ * @summary Delete pending invitation
1027
+ * @request DELETE:/v1beta1/organizations/{orgId}/invitations/{id}
1028
+ * @secure
1029
+ */
1030
+ this.frontierServiceDeleteOrganizationInvitation = (orgId, id, params = {}) => this.request(__spreadValues({
1031
+ path: `/v1beta1/organizations/${orgId}/invitations/${id}`,
1032
+ method: "DELETE",
1033
+ secure: true,
1034
+ format: "json"
1035
+ }, params));
1036
+ /**
1037
+ * @description Accept pending invitation queued for an organization. The user will be added to the organization and groups defined in the invitation
1038
+ *
1039
+ * @tags Organization
1040
+ * @name FrontierServiceAcceptOrganizationInvitation
1041
+ * @summary Accept pending invitation
1042
+ * @request POST:/v1beta1/organizations/{orgId}/invitations/{id}/accept
1043
+ * @secure
1044
+ */
1045
+ this.frontierServiceAcceptOrganizationInvitation = (orgId, id, params = {}) => this.request(__spreadValues({
1046
+ path: `/v1beta1/organizations/${orgId}/invitations/${id}/accept`,
1047
+ method: "POST",
1048
+ secure: true,
1049
+ format: "json"
1050
+ }, params));
1051
+ /**
1052
+ * @description Returns a list of custom roles created under an organization with their associated permissions
1053
+ *
1054
+ * @tags Role
1055
+ * @name FrontierServiceListOrganizationRoles
1056
+ * @summary List organization roles
1057
+ * @request GET:/v1beta1/organizations/{orgId}/roles
1058
+ * @secure
1059
+ */
1060
+ this.frontierServiceListOrganizationRoles = (orgId, query, params = {}) => this.request(__spreadValues({
1061
+ path: `/v1beta1/organizations/${orgId}/roles`,
1062
+ method: "GET",
1063
+ query,
1064
+ secure: true,
1065
+ format: "json"
1066
+ }, params));
1067
+ /**
1068
+ * @description Create a custom role under an organization. This custom role will only be available for assignment to the principles within the organization.
1069
+ *
1070
+ * @tags Role
1071
+ * @name FrontierServiceCreateOrganizationRole
1072
+ * @summary Create organization role
1073
+ * @request POST:/v1beta1/organizations/{orgId}/roles
1074
+ * @secure
1075
+ */
1076
+ this.frontierServiceCreateOrganizationRole = (orgId, body, params = {}) => this.request(__spreadValues({
1077
+ path: `/v1beta1/organizations/${orgId}/roles`,
1078
+ method: "POST",
1079
+ body,
1080
+ secure: true,
1081
+ format: "json"
1082
+ }, params));
1083
+ /**
1084
+ * @description Returns a custom role under an organization along with its associated permissions
1085
+ *
1086
+ * @tags Role
1087
+ * @name FrontierServiceGetOrganizationRole
1088
+ * @summary Get organization role
1089
+ * @request GET:/v1beta1/organizations/{orgId}/roles/{id}
1090
+ * @secure
1091
+ */
1092
+ this.frontierServiceGetOrganizationRole = (orgId, id, params = {}) => this.request(__spreadValues({
1093
+ path: `/v1beta1/organizations/${orgId}/roles/${id}`,
1094
+ method: "GET",
1095
+ secure: true,
1096
+ format: "json"
1097
+ }, params));
1098
+ /**
1099
+ * @description Delete a custom role and all of its relations under an organization permanently.
1100
+ *
1101
+ * @tags Role
1102
+ * @name FrontierServiceDeleteOrganizationRole
1103
+ * @summary Delete organization role
1104
+ * @request DELETE:/v1beta1/organizations/{orgId}/roles/{id}
1105
+ * @secure
1106
+ */
1107
+ this.frontierServiceDeleteOrganizationRole = (orgId, id, params = {}) => this.request(__spreadValues({
1108
+ path: `/v1beta1/organizations/${orgId}/roles/${id}`,
1109
+ method: "DELETE",
1110
+ secure: true,
1111
+ format: "json"
1112
+ }, params));
1113
+ /**
1114
+ * @description Update a custom role under an organization. This custom role will only be available for assignment to the principles within the organization.
1115
+ *
1116
+ * @tags Role
1117
+ * @name FrontierServiceUpdateOrganizationRole
1118
+ * @summary Update organization role
1119
+ * @request PUT:/v1beta1/organizations/{orgId}/roles/{id}
1120
+ * @secure
1121
+ */
1122
+ this.frontierServiceUpdateOrganizationRole = (orgId, id, body, params = {}) => this.request(__spreadValues({
1123
+ path: `/v1beta1/organizations/${orgId}/roles/${id}`,
1124
+ method: "PUT",
1125
+ body,
1126
+ secure: true,
1127
+ format: "json"
1128
+ }, params));
1129
+ /**
1130
+ * No description
1131
+ *
1132
+ * @tags Permission
1133
+ * @name FrontierServiceListPermissions
1134
+ * @summary Get all permissions
1135
+ * @request GET:/v1beta1/permissions
1136
+ * @secure
1137
+ */
1138
+ this.frontierServiceListPermissions = (params = {}) => this.request(__spreadValues({
1139
+ path: `/v1beta1/permissions`,
1140
+ method: "GET",
1141
+ secure: true,
1142
+ format: "json"
1143
+ }, params));
1144
+ /**
1145
+ * @description Creates a permission. It can be used to grant permissions to all the resources in a Frontier instance.
1146
+ *
1147
+ * @tags Permission
1148
+ * @name AdminServiceCreatePermission
1149
+ * @summary Create platform permission
1150
+ * @request POST:/v1beta1/permissions
1151
+ * @secure
1152
+ */
1153
+ this.adminServiceCreatePermission = (body, params = {}) => this.request(__spreadValues({
1154
+ path: `/v1beta1/permissions`,
1155
+ method: "POST",
1156
+ body,
1157
+ secure: true,
1158
+ type: "application/json" /* Json */,
1159
+ format: "json"
1160
+ }, params));
1161
+ /**
1162
+ * @description Returns a permission by ID
1163
+ *
1164
+ * @tags Permission
1165
+ * @name FrontierServiceGetPermission
1166
+ * @summary Get permission
1167
+ * @request GET:/v1beta1/permissions/{id}
1168
+ * @secure
1169
+ */
1170
+ this.frontierServiceGetPermission = (id, params = {}) => this.request(__spreadValues({
1171
+ path: `/v1beta1/permissions/${id}`,
1172
+ method: "GET",
1173
+ secure: true,
1174
+ format: "json"
1175
+ }, params));
1176
+ /**
1177
+ * No description
1178
+ *
1179
+ * @tags Permission
1180
+ * @name AdminServiceDeletePermission
1181
+ * @summary Delete platform permission
1182
+ * @request DELETE:/v1beta1/permissions/{id}
1183
+ * @secure
1184
+ */
1185
+ this.adminServiceDeletePermission = (id, params = {}) => this.request(__spreadValues({
1186
+ path: `/v1beta1/permissions/${id}`,
1187
+ method: "DELETE",
1188
+ secure: true,
1189
+ format: "json"
1190
+ }, params));
1191
+ /**
1192
+ * @description Updates a permission by ID. It can be used to grant permissions to all the resources in a Frontier instance.
1193
+ *
1194
+ * @tags Permission
1195
+ * @name AdminServiceUpdatePermission
1196
+ * @summary Update platform permission
1197
+ * @request PUT:/v1beta1/permissions/{id}
1198
+ * @secure
1199
+ */
1200
+ this.adminServiceUpdatePermission = (id, body, params = {}) => this.request(__spreadValues({
1201
+ path: `/v1beta1/permissions/${id}`,
1202
+ method: "PUT",
1203
+ body,
1204
+ secure: true,
1205
+ type: "application/json" /* Json */,
1206
+ format: "json"
1207
+ }, params));
1208
+ /**
1209
+ * @description Lists all the policies from all the organizations in a Frontier instance. It can be filtered by organization, project, user, role and group.
1210
+ *
1211
+ * @tags Policy
1212
+ * @name AdminServiceListPolicies
1213
+ * @summary List all policies
1214
+ * @request GET:/v1beta1/policies
1215
+ * @secure
1216
+ */
1217
+ this.adminServiceListPolicies = (query, params = {}) => this.request(__spreadValues({
1218
+ path: `/v1beta1/policies`,
1219
+ method: "GET",
1220
+ query,
1221
+ secure: true,
1222
+ format: "json"
1223
+ }, params));
1224
+ /**
1225
+ * @description Creates a policy
1226
+ *
1227
+ * @tags Policy
1228
+ * @name FrontierServiceCreatePolicy
1229
+ * @summary Create policy
1230
+ * @request POST:/v1beta1/policies
1231
+ * @secure
1232
+ */
1233
+ this.frontierServiceCreatePolicy = (body, params = {}) => this.request(__spreadValues({
1234
+ path: `/v1beta1/policies`,
1235
+ method: "POST",
1236
+ body,
1237
+ secure: true,
1238
+ format: "json"
1239
+ }, params));
1240
+ /**
1241
+ * @description Returns a policy by ID
1242
+ *
1243
+ * @tags Policy
1244
+ * @name FrontierServiceGetPolicy
1245
+ * @summary Get policy
1246
+ * @request GET:/v1beta1/policies/{id}
1247
+ * @secure
1248
+ */
1249
+ this.frontierServiceGetPolicy = (id, params = {}) => this.request(__spreadValues({
1250
+ path: `/v1beta1/policies/${id}`,
1251
+ method: "GET",
1252
+ secure: true,
1253
+ format: "json"
1254
+ }, params));
1255
+ /**
1256
+ * @description Delete a policy all of its relations permanently.
1257
+ *
1258
+ * @tags Policy
1259
+ * @name FrontierServiceDeletePolicy
1260
+ * @summary Delete Policy
1261
+ * @request DELETE:/v1beta1/policies/{id}
1262
+ * @secure
1263
+ */
1264
+ this.frontierServiceDeletePolicy = (id, params = {}) => this.request(__spreadValues({
1265
+ path: `/v1beta1/policies/${id}`,
1266
+ method: "DELETE",
1267
+ secure: true,
1268
+ format: "json"
1269
+ }, params));
1270
+ /**
1271
+ * @description Updates a policy by ID
1272
+ *
1273
+ * @tags Policy
1274
+ * @name FrontierServiceUpdatePolicy
1275
+ * @summary Update policy
1276
+ * @request PUT:/v1beta1/policies/{id}
1277
+ * @secure
1278
+ */
1279
+ this.frontierServiceUpdatePolicy = (id, body, params = {}) => this.request(__spreadValues({
1280
+ path: `/v1beta1/policies/${id}`,
1281
+ method: "PUT",
1282
+ body,
1283
+ secure: true,
1284
+ format: "json"
1285
+ }, params));
1286
+ /**
1287
+ * No description
1288
+ *
1289
+ * @tags Project
1290
+ * @name FrontierServiceCreateProject
1291
+ * @summary Create project
1292
+ * @request POST:/v1beta1/projects
1293
+ * @secure
1294
+ */
1295
+ this.frontierServiceCreateProject = (body, params = {}) => this.request(__spreadValues({
1296
+ path: `/v1beta1/projects`,
1297
+ method: "POST",
1298
+ body,
1299
+ secure: true,
1300
+ format: "json"
1301
+ }, params));
1302
+ /**
1303
+ * @description Returns a project by ID
1304
+ *
1305
+ * @tags Project
1306
+ * @name FrontierServiceGetProject
1307
+ * @summary Get project
1308
+ * @request GET:/v1beta1/projects/{id}
1309
+ * @secure
1310
+ */
1311
+ this.frontierServiceGetProject = (id, params = {}) => this.request(__spreadValues({
1312
+ path: `/v1beta1/projects/${id}`,
1313
+ method: "GET",
1314
+ secure: true,
1315
+ format: "json"
1316
+ }, params));
1317
+ /**
1318
+ * @description Delete a project all of its relations permanently.
1319
+ *
1320
+ * @tags Project
1321
+ * @name FrontierServiceDeleteProject
1322
+ * @summary Delete Project
1323
+ * @request DELETE:/v1beta1/projects/{id}
1324
+ * @secure
1325
+ */
1326
+ this.frontierServiceDeleteProject = (id, params = {}) => this.request(__spreadValues({
1327
+ path: `/v1beta1/projects/${id}`,
1328
+ method: "DELETE",
1329
+ secure: true,
1330
+ format: "json"
1331
+ }, params));
1332
+ /**
1333
+ * @description Updates a project by ID
1334
+ *
1335
+ * @tags Project
1336
+ * @name FrontierServiceUpdateProject
1337
+ * @summary Update project
1338
+ * @request PUT:/v1beta1/projects/{id}
1339
+ * @secure
1340
+ */
1341
+ this.frontierServiceUpdateProject = (id, body, params = {}) => this.request(__spreadValues({
1342
+ path: `/v1beta1/projects/${id}`,
1343
+ method: "PUT",
1344
+ body,
1345
+ secure: true,
1346
+ format: "json"
1347
+ }, params));
1348
+ /**
1349
+ * @description Returns a collection of admins of a project
1350
+ *
1351
+ * @tags Project
1352
+ * @name FrontierServiceListProjectAdmins
1353
+ * @summary List project admins
1354
+ * @request GET:/v1beta1/projects/{id}/admins
1355
+ * @secure
1356
+ */
1357
+ this.frontierServiceListProjectAdmins = (id, params = {}) => this.request(__spreadValues({
1358
+ path: `/v1beta1/projects/${id}/admins`,
1359
+ method: "GET",
1360
+ secure: true,
1361
+ format: "json"
1362
+ }, params));
1363
+ /**
1364
+ * No description
1365
+ *
1366
+ * @tags Project
1367
+ * @name FrontierServiceDisableProject
1368
+ * @summary Disable project
1369
+ * @request POST:/v1beta1/projects/{id}/disable
1370
+ * @secure
1371
+ */
1372
+ this.frontierServiceDisableProject = (id, body, params = {}) => this.request(__spreadValues({
1373
+ path: `/v1beta1/projects/${id}/disable`,
1374
+ method: "POST",
1375
+ body,
1376
+ secure: true,
1377
+ format: "json"
1378
+ }, params));
1379
+ /**
1380
+ * No description
1381
+ *
1382
+ * @tags Project
1383
+ * @name FrontierServiceEnableProject
1384
+ * @summary Enable project
1385
+ * @request POST:/v1beta1/projects/{id}/enable
1386
+ * @secure
1387
+ */
1388
+ this.frontierServiceEnableProject = (id, body, params = {}) => this.request(__spreadValues({
1389
+ path: `/v1beta1/projects/${id}/enable`,
1390
+ method: "POST",
1391
+ body,
1392
+ secure: true,
1393
+ format: "json"
1394
+ }, params));
1395
+ /**
1396
+ * @description Returns a collection of users of a project. Filter by user permissions is supported.
1397
+ *
1398
+ * @tags Project
1399
+ * @name FrontierServiceListProjectUsers
1400
+ * @summary List project users
1401
+ * @request GET:/v1beta1/projects/{id}/users
1402
+ * @secure
1403
+ */
1404
+ this.frontierServiceListProjectUsers = (id, query, params = {}) => this.request(__spreadValues({
1405
+ path: `/v1beta1/projects/${id}/users`,
1406
+ method: "GET",
1407
+ query,
1408
+ secure: true,
1409
+ format: "json"
1410
+ }, params));
1411
+ /**
1412
+ * No description
1413
+ *
1414
+ * @tags Resource
1415
+ * @name FrontierServiceListProjectResources
1416
+ * @summary Get all resources
1417
+ * @request GET:/v1beta1/projects/{projectId}/resources
1418
+ * @secure
1419
+ */
1420
+ this.frontierServiceListProjectResources = (projectId, query, params = {}) => this.request(__spreadValues({
1421
+ path: `/v1beta1/projects/${projectId}/resources`,
1422
+ method: "GET",
1423
+ query,
1424
+ secure: true,
1425
+ format: "json"
1426
+ }, params));
1427
+ /**
1428
+ * @description Creates a resource in a project
1429
+ *
1430
+ * @tags Resource
1431
+ * @name FrontierServiceCreateProjectResource
1432
+ * @summary Create resource
1433
+ * @request POST:/v1beta1/projects/{projectId}/resources
1434
+ * @secure
1435
+ */
1436
+ this.frontierServiceCreateProjectResource = (projectId, body, query, params = {}) => this.request(__spreadValues({
1437
+ path: `/v1beta1/projects/${projectId}/resources`,
1438
+ method: "POST",
1439
+ query,
1440
+ body,
1441
+ secure: true,
1442
+ format: "json"
1443
+ }, params));
1444
+ /**
1445
+ * @description Returns a project resource by ID
1446
+ *
1447
+ * @tags Resource
1448
+ * @name FrontierServiceGetProjectResource
1449
+ * @summary Get resource
1450
+ * @request GET:/v1beta1/projects/{projectId}/resources/{id}
1451
+ * @secure
1452
+ */
1453
+ this.frontierServiceGetProjectResource = (projectId, id, params = {}) => this.request(__spreadValues({
1454
+ path: `/v1beta1/projects/${projectId}/resources/${id}`,
1455
+ method: "GET",
1456
+ secure: true,
1457
+ format: "json"
1458
+ }, params));
1459
+ /**
1460
+ * @description Deletes a resource from a project permanently
1461
+ *
1462
+ * @tags Resource
1463
+ * @name FrontierServiceDeleteProjectResource
1464
+ * @summary Delete resource
1465
+ * @request DELETE:/v1beta1/projects/{projectId}/resources/{id}
1466
+ * @secure
1467
+ */
1468
+ this.frontierServiceDeleteProjectResource = (projectId, id, params = {}) => this.request(__spreadValues({
1469
+ path: `/v1beta1/projects/${projectId}/resources/${id}`,
1470
+ method: "DELETE",
1471
+ secure: true,
1472
+ format: "json"
1473
+ }, params));
1474
+ /**
1475
+ * @description Updates a resource in a project
1476
+ *
1477
+ * @tags Resource
1478
+ * @name FrontierServiceUpdateProjectResource
1479
+ * @summary Update resource
1480
+ * @request PUT:/v1beta1/projects/{projectId}/resources/{id}
1481
+ * @secure
1482
+ */
1483
+ this.frontierServiceUpdateProjectResource = (projectId, id, body, params = {}) => this.request(__spreadValues({
1484
+ path: `/v1beta1/projects/${projectId}/resources/${id}`,
1485
+ method: "PUT",
1486
+ body,
1487
+ secure: true,
1488
+ format: "json"
1489
+ }, params));
1490
+ /**
1491
+ * No description
1492
+ *
1493
+ * @tags Relation
1494
+ * @name FrontierServiceCreateRelation
1495
+ * @summary Create relation
1496
+ * @request POST:/v1beta1/relations
1497
+ * @secure
1498
+ */
1499
+ this.frontierServiceCreateRelation = (body, params = {}) => this.request(__spreadValues({
1500
+ path: `/v1beta1/relations`,
1501
+ method: "POST",
1502
+ body,
1503
+ secure: true,
1504
+ type: "application/json" /* Json */,
1505
+ format: "json"
1506
+ }, params));
1507
+ /**
1508
+ * @description Returns a relation by ID
1509
+ *
1510
+ * @tags Relation
1511
+ * @name FrontierServiceGetRelation
1512
+ * @summary Get relation
1513
+ * @request GET:/v1beta1/relations/{id}
1514
+ * @secure
1515
+ */
1516
+ this.frontierServiceGetRelation = (id, params = {}) => this.request(__spreadValues({
1517
+ path: `/v1beta1/relations/${id}`,
1518
+ method: "GET",
1519
+ secure: true,
1520
+ format: "json"
1521
+ }, params));
1522
+ /**
1523
+ * @description Remove a subject having a relation from an object
1524
+ *
1525
+ * @tags Relation
1526
+ * @name FrontierServiceDeleteRelation
1527
+ * @summary Delete relation
1528
+ * @request DELETE:/v1beta1/relations/{relation}/object/{object}/subject/{subject}
1529
+ * @secure
1530
+ */
1531
+ this.frontierServiceDeleteRelation = (relation, object2, subject, params = {}) => this.request(__spreadValues({
1532
+ path: `/v1beta1/relations/${relation}/object/${object2}/subject/${subject}`,
1533
+ method: "DELETE",
1534
+ secure: true,
1535
+ format: "json"
1536
+ }, params));
1537
+ /**
1538
+ * @description Returns a list of platform wide roles available in enitre Frontier instance along with their associated permissions
1539
+ *
1540
+ * @tags Role
1541
+ * @name FrontierServiceListRoles
1542
+ * @summary List platform roles
1543
+ * @request GET:/v1beta1/roles
1544
+ * @secure
1545
+ */
1546
+ this.frontierServiceListRoles = (query, params = {}) => this.request(__spreadValues({
1547
+ path: `/v1beta1/roles`,
1548
+ method: "GET",
1549
+ query,
1550
+ secure: true,
1551
+ format: "json"
1552
+ }, params));
1553
+ /**
1554
+ * @description Creates a platform wide role. It can be used to grant permissions to all the resources in a Frontier instance.
1555
+ *
1556
+ * @tags Role
1557
+ * @name AdminServiceCreateRole
1558
+ * @summary Create platform role
1559
+ * @request POST:/v1beta1/roles
1560
+ * @secure
1561
+ */
1562
+ this.adminServiceCreateRole = (body, params = {}) => this.request(__spreadValues({
1563
+ path: `/v1beta1/roles`,
1564
+ method: "POST",
1565
+ body,
1566
+ secure: true,
1567
+ format: "json"
1568
+ }, params));
1569
+ /**
1570
+ * @description Delete a platform wide role and all of its relations.
1571
+ *
1572
+ * @tags Role
1573
+ * @name AdminServiceDeleteRole
1574
+ * @summary Delete platform role
1575
+ * @request DELETE:/v1beta1/roles/{id}
1576
+ * @secure
1577
+ */
1578
+ this.adminServiceDeleteRole = (id, params = {}) => this.request(__spreadValues({
1579
+ path: `/v1beta1/roles/${id}`,
1580
+ method: "DELETE",
1581
+ secure: true,
1582
+ format: "json"
1583
+ }, params));
1584
+ /**
1585
+ * @description Returns the service user of an organization in a Frontier instance. It can be filter by it's state
1586
+ *
1587
+ * @tags ServiceUser
1588
+ * @name FrontierServiceListServiceUsers
1589
+ * @summary List org service users
1590
+ * @request GET:/v1beta1/serviceusers
1591
+ * @secure
1592
+ */
1593
+ this.frontierServiceListServiceUsers = (query, params = {}) => this.request(__spreadValues({
1594
+ path: `/v1beta1/serviceusers`,
1595
+ method: "GET",
1596
+ query,
1597
+ secure: true,
1598
+ format: "json"
1599
+ }, params));
1600
+ /**
1601
+ * @description Create a service user.
1602
+ *
1603
+ * @tags ServiceUser
1604
+ * @name FrontierServiceCreateServiceUser
1605
+ * @summary Create service user
1606
+ * @request POST:/v1beta1/serviceusers
1607
+ * @secure
1608
+ */
1609
+ this.frontierServiceCreateServiceUser = (body, params = {}) => this.request(__spreadValues({
1610
+ path: `/v1beta1/serviceusers`,
1611
+ method: "POST",
1612
+ body,
1613
+ secure: true,
1614
+ type: "application/json" /* Json */,
1615
+ format: "json"
1616
+ }, params));
1617
+ /**
1618
+ * @description Get service user details by its id.
1619
+ *
1620
+ * @tags ServiceUser
1621
+ * @name FrontierServiceGetServiceUser
1622
+ * @summary Get service user
1623
+ * @request GET:/v1beta1/serviceusers/{id}
1624
+ * @secure
1625
+ */
1626
+ this.frontierServiceGetServiceUser = (id, params = {}) => this.request(__spreadValues({
1627
+ path: `/v1beta1/serviceusers/${id}`,
1628
+ method: "GET",
1629
+ secure: true,
1630
+ format: "json"
1631
+ }, params));
1632
+ /**
1633
+ * @description Delete a service user permanently and all of its relations (keys, organizations, roles, etc)
1634
+ *
1635
+ * @tags ServiceUser
1636
+ * @name FrontierServiceDeleteServiceUser
1637
+ * @summary Delete service user
1638
+ * @request DELETE:/v1beta1/serviceusers/{id}
1639
+ * @secure
1640
+ */
1641
+ this.frontierServiceDeleteServiceUser = (id, query, params = {}) => this.request(__spreadValues({
1642
+ path: `/v1beta1/serviceusers/${id}`,
1643
+ method: "DELETE",
1644
+ query,
1645
+ secure: true,
1646
+ format: "json"
1647
+ }, params));
1648
+ /**
1649
+ * @description List all the keys of a service user with its details except jwk.
1650
+ *
1651
+ * @tags ServiceUser
1652
+ * @name FrontierServiceListServiceUserKeys
1653
+ * @summary List service user keys
1654
+ * @request GET:/v1beta1/serviceusers/{id}/keys
1655
+ * @secure
1656
+ */
1657
+ this.frontierServiceListServiceUserKeys = (id, params = {}) => this.request(__spreadValues({
1658
+ path: `/v1beta1/serviceusers/${id}/keys`,
1659
+ method: "GET",
1660
+ secure: true,
1661
+ format: "json"
1662
+ }, params));
1663
+ /**
1664
+ * @description Generate a service user key and return it, the private key part of the response will not be persisted and should be kept securely by client.
1665
+ *
1666
+ * @tags ServiceUser
1667
+ * @name FrontierServiceCreateServiceUserKey
1668
+ * @summary Create service user key
1669
+ * @request POST:/v1beta1/serviceusers/{id}/keys
1670
+ * @secure
1671
+ */
1672
+ this.frontierServiceCreateServiceUserKey = (id, body, params = {}) => this.request(__spreadValues({
1673
+ path: `/v1beta1/serviceusers/${id}/keys`,
1674
+ method: "POST",
1675
+ body,
1676
+ secure: true,
1677
+ format: "json"
1678
+ }, params));
1679
+ /**
1680
+ * @description Get a service user public RSA JWK set.
1681
+ *
1682
+ * @tags ServiceUser
1683
+ * @name FrontierServiceGetServiceUserKey
1684
+ * @summary Get service user key
1685
+ * @request GET:/v1beta1/serviceusers/{id}/keys/{keyId}
1686
+ * @secure
1687
+ */
1688
+ this.frontierServiceGetServiceUserKey = (id, keyId, params = {}) => this.request(__spreadValues({
1689
+ path: `/v1beta1/serviceusers/${id}/keys/${keyId}`,
1690
+ method: "GET",
1691
+ secure: true,
1692
+ format: "json"
1693
+ }, params));
1694
+ /**
1695
+ * @description Delete a service user key permanently.
1696
+ *
1697
+ * @tags ServiceUser
1698
+ * @name FrontierServiceDeleteServiceUserKey
1699
+ * @summary Delete service user key
1700
+ * @request DELETE:/v1beta1/serviceusers/{id}/keys/{keyId}
1701
+ * @secure
1702
+ */
1703
+ this.frontierServiceDeleteServiceUserKey = (id, keyId, params = {}) => this.request(__spreadValues({
1704
+ path: `/v1beta1/serviceusers/${id}/keys/${keyId}`,
1705
+ method: "DELETE",
1706
+ secure: true,
1707
+ format: "json"
1708
+ }, params));
1709
+ /**
1710
+ * @description List all the secrets of a service user.
1711
+ *
1712
+ * @tags ServiceUser
1713
+ * @name FrontierServiceListServiceUserSecrets
1714
+ * @summary List service user secrets
1715
+ * @request GET:/v1beta1/serviceusers/{id}/secrets
1716
+ * @secure
1717
+ */
1718
+ this.frontierServiceListServiceUserSecrets = (id, params = {}) => this.request(__spreadValues({
1719
+ path: `/v1beta1/serviceusers/${id}/secrets`,
1720
+ method: "GET",
1721
+ secure: true,
1722
+ format: "json"
1723
+ }, params));
1724
+ /**
1725
+ * @description Generate a service user secret and return it. The secret value will not be persisted and should be securely stored by client.
1726
+ *
1727
+ * @tags ServiceUser
1728
+ * @name FrontierServiceCreateServiceUserSecret
1729
+ * @summary Create service user secret
1730
+ * @request POST:/v1beta1/serviceusers/{id}/secrets
1731
+ * @secure
1732
+ */
1733
+ this.frontierServiceCreateServiceUserSecret = (id, body, params = {}) => this.request(__spreadValues({
1734
+ path: `/v1beta1/serviceusers/${id}/secrets`,
1735
+ method: "POST",
1736
+ body,
1737
+ secure: true,
1738
+ format: "json"
1739
+ }, params));
1740
+ /**
1741
+ * @description Delete a service user secret credential.
1742
+ *
1743
+ * @tags ServiceUser
1744
+ * @name FrontierServiceDeleteServiceUserSecret
1745
+ * @summary Delete service user secret
1746
+ * @request DELETE:/v1beta1/serviceusers/{id}/secrets/{secretId}
1747
+ * @secure
1748
+ */
1749
+ this.frontierServiceDeleteServiceUserSecret = (id, secretId, params = {}) => this.request(__spreadValues({
1750
+ path: `/v1beta1/serviceusers/${id}/secrets/${secretId}`,
1751
+ method: "DELETE",
1752
+ secure: true,
1753
+ format: "json"
1754
+ }, params));
1755
+ /**
1756
+ * @description Returns the users from all the organizations in a Frontier instance. It can be filtered by keyword, organization, group and state. Additionally you can include page number and page size for pagination.
1757
+ *
1758
+ * @tags User
1759
+ * @name FrontierServiceListUsers
1760
+ * @summary List public users
1761
+ * @request GET:/v1beta1/users
1762
+ * @secure
1763
+ */
1764
+ this.frontierServiceListUsers = (query, params = {}) => this.request(__spreadValues({
1765
+ path: `/v1beta1/users`,
1766
+ method: "GET",
1767
+ query,
1768
+ secure: true,
1769
+ format: "json"
1770
+ }, params));
1771
+ /**
1772
+ * @description Create a user with the given details. A user is not attached to an organization or a group by default,and can be invited to the org/group. The name of the user must be unique within the entire Frontier instance. If a user name is not provided, Frontier automatically generates a name from the user email. The user metadata is validated against the user metaschema. By default the user metaschema contains `labels` and `descriptions` for the user. The `title` field can be optionally added for a user-friendly name. <br/><br/>*Example:*`{"email":"john.doe@raystack.org","title":"John Doe",metadata:{"label": {"key1": "value1"}, "description": "User Description"}}`
1773
+ *
1774
+ * @tags User
1775
+ * @name FrontierServiceCreateUser
1776
+ * @summary Create user
1777
+ * @request POST:/v1beta1/users
1778
+ */
1779
+ this.frontierServiceCreateUser = (body, params = {}) => this.request(__spreadValues({
1780
+ path: `/v1beta1/users`,
1781
+ method: "POST",
1782
+ body,
1783
+ format: "json"
1784
+ }, params));
1785
+ /**
1786
+ * @description Get a user by id searched over all organizations in Frontier.
1787
+ *
1788
+ * @tags User
1789
+ * @name FrontierServiceGetUser
1790
+ * @summary Get user
1791
+ * @request GET:/v1beta1/users/{id}
1792
+ * @secure
1793
+ */
1794
+ this.frontierServiceGetUser = (id, params = {}) => this.request(__spreadValues({
1795
+ path: `/v1beta1/users/${id}`,
1796
+ method: "GET",
1797
+ secure: true,
1798
+ format: "json"
1799
+ }, params));
1800
+ /**
1801
+ * @description Delete an user permanently forever and all of its relations (organizations, groups, etc)
1802
+ *
1803
+ * @tags User
1804
+ * @name FrontierServiceDeleteUser
1805
+ * @summary Delete user
1806
+ * @request DELETE:/v1beta1/users/{id}
1807
+ * @secure
1808
+ */
1809
+ this.frontierServiceDeleteUser = (id, params = {}) => this.request(__spreadValues({
1810
+ path: `/v1beta1/users/${id}`,
1811
+ method: "DELETE",
1812
+ secure: true,
1813
+ format: "json"
1814
+ }, params));
1815
+ /**
1816
+ * No description
1817
+ *
1818
+ * @tags User
1819
+ * @name FrontierServiceUpdateUser
1820
+ * @summary Update user
1821
+ * @request PUT:/v1beta1/users/{id}
1822
+ * @secure
1823
+ */
1824
+ this.frontierServiceUpdateUser = (id, body, params = {}) => this.request(__spreadValues({
1825
+ path: `/v1beta1/users/${id}`,
1826
+ method: "PUT",
1827
+ body,
1828
+ secure: true,
1829
+ format: "json"
1830
+ }, params));
1831
+ /**
1832
+ * @description Sets the state of the user as diabled.The user's membership to groups and organizations will still exist along with all it's roles for access control, but the user will not be able to log in and access the Frontier instance.
1833
+ *
1834
+ * @tags User
1835
+ * @name FrontierServiceDisableUser
1836
+ * @summary Disable user
1837
+ * @request POST:/v1beta1/users/{id}/disable
1838
+ * @secure
1839
+ */
1840
+ this.frontierServiceDisableUser = (id, body, params = {}) => this.request(__spreadValues({
1841
+ path: `/v1beta1/users/${id}/disable`,
1842
+ method: "POST",
1843
+ body,
1844
+ secure: true,
1845
+ format: "json"
1846
+ }, params));
1847
+ /**
1848
+ * @description Sets the state of the user as enabled. The user will be able to log in and access the Frontier instance.
1849
+ *
1850
+ * @tags User
1851
+ * @name FrontierServiceEnableUser
1852
+ * @summary Enable user
1853
+ * @request POST:/v1beta1/users/{id}/enable
1854
+ * @secure
1855
+ */
1856
+ this.frontierServiceEnableUser = (id, body, params = {}) => this.request(__spreadValues({
1857
+ path: `/v1beta1/users/${id}/enable`,
1858
+ method: "POST",
1859
+ body,
1860
+ secure: true,
1861
+ format: "json"
1862
+ }, params));
1863
+ /**
1864
+ * @description Lists all the groups a user belongs to across all organization in Frontier. To get the groups of a user in a specific organization, use the org_id filter in the query parameter.
1865
+ *
1866
+ * @tags User
1867
+ * @name FrontierServiceListUserGroups
1868
+ * @summary List user groups
1869
+ * @request GET:/v1beta1/users/{id}/groups
1870
+ * @secure
1871
+ */
1872
+ this.frontierServiceListUserGroups = (id, query, params = {}) => this.request(__spreadValues({
1873
+ path: `/v1beta1/users/${id}/groups`,
1874
+ method: "GET",
1875
+ query,
1876
+ secure: true,
1877
+ format: "json"
1878
+ }, params));
1879
+ /**
1880
+ * @description List all the invitations sent to a user.
1881
+ *
1882
+ * @tags User
1883
+ * @name FrontierServiceListUserInvitations
1884
+ * @summary List user invitations
1885
+ * @request GET:/v1beta1/users/{id}/invitations
1886
+ * @secure
1887
+ */
1888
+ this.frontierServiceListUserInvitations = (id, params = {}) => this.request(__spreadValues({
1889
+ path: `/v1beta1/users/${id}/invitations`,
1890
+ method: "GET",
1891
+ secure: true,
1892
+ format: "json"
1893
+ }, params));
1894
+ /**
1895
+ * @description Get all the organizations a user belongs to.
1896
+ *
1897
+ * @tags User
1898
+ * @name FrontierServiceGetOrganizationsByUser
1899
+ * @summary Get user organizations
1900
+ * @request GET:/v1beta1/users/{id}/organizations
1901
+ * @secure
1902
+ */
1903
+ this.frontierServiceGetOrganizationsByUser = (id, params = {}) => this.request(__spreadValues({
1904
+ path: `/v1beta1/users/${id}/organizations`,
1905
+ method: "GET",
1906
+ secure: true,
1907
+ format: "json"
1908
+ }, params));
1909
+ /**
1910
+ * @description Get all the projects a user belongs to.
1911
+ *
1912
+ * @tags User
1913
+ * @name FrontierServiceGetProjectsByUser
1914
+ * @summary Get user projects
1915
+ * @request GET:/v1beta1/users/{id}/projects
1916
+ * @secure
1917
+ */
1918
+ this.frontierServiceGetProjectsByUser = (id, params = {}) => this.request(__spreadValues({
1919
+ path: `/v1beta1/users/${id}/projects`,
1920
+ method: "GET",
1921
+ secure: true,
1922
+ format: "json"
1923
+ }, params));
1924
+ /**
1925
+ * No description
1926
+ *
1927
+ * @tags User
1928
+ * @name FrontierServiceGetCurrentUser
1929
+ * @summary Get current user
1930
+ * @request GET:/v1beta1/users/self
1931
+ * @secure
1932
+ */
1933
+ this.frontierServiceGetCurrentUser = (params = {}) => this.request(__spreadValues({
1934
+ path: `/v1beta1/users/self`,
1935
+ method: "GET",
1936
+ secure: true,
1937
+ format: "json"
1938
+ }, params));
1939
+ /**
1940
+ * No description
1941
+ *
1942
+ * @tags User
1943
+ * @name FrontierServiceUpdateCurrentUser
1944
+ * @summary Update current user
1945
+ * @request PUT:/v1beta1/users/self
1946
+ * @secure
1947
+ */
1948
+ this.frontierServiceUpdateCurrentUser = (body, params = {}) => this.request(__spreadValues({
1949
+ path: `/v1beta1/users/self`,
1950
+ method: "PUT",
1951
+ body,
1952
+ secure: true,
1953
+ format: "json"
1954
+ }, params));
1955
+ /**
1956
+ * No description
1957
+ *
1958
+ * @tags User
1959
+ * @name FrontierServiceListCurrentUserGroups
1960
+ * @summary List my groups
1961
+ * @request GET:/v1beta1/users/self/groups
1962
+ * @secure
1963
+ */
1964
+ this.frontierServiceListCurrentUserGroups = (params = {}) => this.request(__spreadValues({
1965
+ path: `/v1beta1/users/self/groups`,
1966
+ method: "GET",
1967
+ secure: true,
1968
+ format: "json"
1969
+ }, params));
1970
+ /**
1971
+ * @description Get all organizations the current user belongs to
1972
+ *
1973
+ * @tags User
1974
+ * @name FrontierServiceGetOrganizationsByCurrentUser
1975
+ * @summary Get my organizations
1976
+ * @request GET:/v1beta1/users/self/organizations
1977
+ * @secure
1978
+ */
1979
+ this.frontierServiceGetOrganizationsByCurrentUser = (params = {}) => this.request(__spreadValues({
1980
+ path: `/v1beta1/users/self/organizations`,
1981
+ method: "GET",
1982
+ secure: true,
1983
+ format: "json"
1984
+ }, params));
1985
+ /**
1986
+ * @description Get all projects the current user belongs to
1987
+ *
1988
+ * @tags User
1989
+ * @name FrontierServiceGetProjectsByCurrentUser
1990
+ * @summary Get my projects
1991
+ * @request GET:/v1beta1/users/self/projects
1992
+ * @secure
1993
+ */
1994
+ this.frontierServiceGetProjectsByCurrentUser = (params = {}) => this.request(__spreadValues({
1995
+ path: `/v1beta1/users/self/projects`,
1996
+ method: "GET",
1997
+ secure: true,
1998
+ format: "json"
1999
+ }, params));
2000
+ }
2001
+ };
2002
+
2003
+ // src/index.ts
2004
+ var FrontierClient = V1Beta1;
2005
+
2006
+ // react/frontier.ts
2007
+ var Frontier = class {
2008
+ constructor() {
2009
+ }
2010
+ static getInstance({ endpoint }) {
2011
+ if (!this.instance) {
2012
+ this.instance = new FrontierClient({
2013
+ baseUrl: endpoint,
2014
+ baseApiParams: {
2015
+ credentials: "include"
2016
+ }
2017
+ });
110
2018
  }
111
- return this.classInstance;
2019
+ return this.instance;
112
2020
  }
113
2021
  };
2022
+ Frontier.instance = null;
114
2023
 
115
2024
  // react/contexts/FrontierContext.tsx
116
2025
  import { jsx } from "react/jsx-runtime";
@@ -122,14 +2031,14 @@ var defaultConfig = {
122
2031
  };
123
2032
  var initialValues = {
124
2033
  config: defaultConfig,
125
- client: Frontier.getOrCreateInstance(defaultConfig),
2034
+ client: void 0,
126
2035
  organizations: [],
127
2036
  setOrganizations: () => void 0,
128
2037
  groups: [],
129
2038
  setGroups: () => void 0,
130
2039
  strategies: [],
131
2040
  setStrategies: () => void 0,
132
- user: null,
2041
+ user: void 0,
133
2042
  setUser: () => void 0
134
2043
  };
135
2044
  var FrontierContext = createContext(initialValues);
@@ -148,14 +2057,14 @@ var FrontierContextProvider = (_a) => {
148
2057
  const [organizations, setOrganizations] = useState([]);
149
2058
  const [groups, setGroups] = useState([]);
150
2059
  const [strategies, setStrategies] = useState([]);
151
- const [user, setUser] = useState(null);
2060
+ const [user, setUser] = useState();
152
2061
  useEffect(() => {
153
2062
  function getFrontierInformation() {
154
2063
  return __async(this, null, function* () {
155
2064
  try {
156
2065
  const {
157
- data: { strategies: strategies2 }
158
- } = yield frontierClient.getAuthAtrategies();
2066
+ data: { strategies: strategies2 = [] }
2067
+ } = yield frontierClient.frontierServiceListAuthStrategies();
159
2068
  setStrategies(strategies2);
160
2069
  } catch (error) {
161
2070
  console.error(
@@ -172,7 +2081,7 @@ var FrontierContextProvider = (_a) => {
172
2081
  try {
173
2082
  const {
174
2083
  data: { user: user2 }
175
- } = yield frontierClient.getCurrentUser();
2084
+ } = yield frontierClient.frontierServiceGetCurrentUser();
176
2085
  setUser(user2);
177
2086
  } catch (error) {
178
2087
  console.error(
@@ -188,8 +2097,8 @@ var FrontierContextProvider = (_a) => {
188
2097
  return __async(this, null, function* () {
189
2098
  try {
190
2099
  const {
191
- data: { groups: groups2 }
192
- } = yield frontierClient.getUserGroups(userId);
2100
+ data: { groups: groups2 = [] }
2101
+ } = yield frontierClient.frontierServiceListUserGroups(userId);
193
2102
  setGroups(groups2);
194
2103
  } catch (error) {
195
2104
  console.error(
@@ -198,7 +2107,7 @@ var FrontierContextProvider = (_a) => {
198
2107
  }
199
2108
  });
200
2109
  }
201
- if (user) {
2110
+ if (user == null ? void 0 : user.id) {
202
2111
  getFrontierCurrentUserGroups(user.id);
203
2112
  }
204
2113
  }, [user]);
@@ -207,8 +2116,8 @@ var FrontierContextProvider = (_a) => {
207
2116
  return __async(this, null, function* () {
208
2117
  try {
209
2118
  const {
210
- data: { organizations: organizations2 }
211
- } = yield frontierClient.getUserOrganisations(userId);
2119
+ data: { organizations: organizations2 = [] }
2120
+ } = yield frontierClient.frontierServiceGetOrganizationsByUser(userId);
212
2121
  setOrganizations(organizations2);
213
2122
  } catch (error) {
214
2123
  console.error(
@@ -217,7 +2126,7 @@ var FrontierContextProvider = (_a) => {
217
2126
  }
218
2127
  });
219
2128
  }
220
- if (user) {
2129
+ if (user == null ? void 0 : user.id) {
221
2130
  getFrontierCurrentUserOrganizations(user.id);
222
2131
  }
223
2132
  }, [user]);
@@ -241,10 +2150,7 @@ var FrontierContextProvider = (_a) => {
241
2150
  );
242
2151
  };
243
2152
  var useFrontierClient = (options) => {
244
- const frontierClient = React.useMemo(
245
- () => Frontier.getOrCreateInstance(options),
246
- []
247
- );
2153
+ const frontierClient = React.useMemo(() => Frontier.getInstance(options), []);
248
2154
  return { frontierClient };
249
2155
  };
250
2156
  function useFrontier() {
@@ -386,9 +2292,13 @@ var MagicLink = (_a) => {
386
2292
  const magicLinkClickHandler = useCallback(() => __async(void 0, null, function* () {
387
2293
  setLoading(true);
388
2294
  try {
2295
+ if (!client)
2296
+ return;
389
2297
  const {
390
- data: { state: state2 }
391
- } = yield client.getMagicLinkAuthStrategyEndpoint(email);
2298
+ data: { state: state2 = "" }
2299
+ } = yield client.frontierServiceAuthenticate("mailotp", {
2300
+ email
2301
+ });
392
2302
  const searchParams = new URLSearchParams({ state: state2, email });
393
2303
  window.location = `${config.redirectMagicLinkVerify}?${searchParams.toString()}`;
394
2304
  } finally {
@@ -470,25 +2380,32 @@ var styles5 = {
470
2380
  var SignedIn = (_a) => {
471
2381
  var _b = _a, {
472
2382
  logo,
473
- title = "Login to Raypoint"
2383
+ title = "Login to Raypoint",
2384
+ excludes = []
474
2385
  } = _b, props = __objRest(_b, [
475
2386
  "logo",
476
- "title"
2387
+ "title",
2388
+ "excludes"
477
2389
  ]);
478
- const { config } = useFrontier();
479
- const { client, strategies = [] } = useFrontier();
2390
+ const { config, client, strategies = [] } = useFrontier();
480
2391
  const clickHandler = useCallback2(
481
2392
  (name) => __async(void 0, null, function* () {
2393
+ if (!name)
2394
+ return;
2395
+ if (!client)
2396
+ return;
482
2397
  const {
483
- data: { endpoint }
484
- } = yield client.getAuthStrategyEndpoint(name);
2398
+ data: { endpoint = "" }
2399
+ } = yield client.frontierServiceAuthenticate(name);
485
2400
  window.location.href = endpoint;
486
2401
  }),
487
- // eslint-disable-next-line react-hooks/exhaustive-deps
488
2402
  [strategies]
489
2403
  );
490
2404
  const mailotp = strategies.find((s) => s.name === "mailotp");
491
- const filteredOIDC = strategies.filter((s) => s.name !== "mailotp");
2405
+ const filteredOIDC = strategies.filter((s) => s.name !== "mailotp").filter((s) => {
2406
+ var _a2;
2407
+ return !excludes.includes((_a2 = s.name) != null ? _a2 : "");
2408
+ });
492
2409
  return /* @__PURE__ */ jsxs4(Container, __spreadProps(__spreadValues({}, props), { children: [
493
2410
  /* @__PURE__ */ jsx6(Header, { logo, title }),
494
2411
  /* @__PURE__ */ jsxs4(Flex3, { direction: "column", style: { width: "100%", gap: "var(--pd-16)" }, children: [
@@ -562,7 +2479,13 @@ var MagicLinkVerify = (_a) => {
562
2479
  const OTPVerifyClickHandler = useCallback3(() => __async(void 0, null, function* () {
563
2480
  setLoading(true);
564
2481
  try {
565
- yield client.verifyMagicLinkAuthStrategyEndpoint(otp, stateParam);
2482
+ if (!client)
2483
+ return;
2484
+ yield client.frontierServiceAuthCallback({
2485
+ strategyName: "mailotp",
2486
+ code: otp,
2487
+ state: stateParam
2488
+ });
566
2489
  const searchParams = new URLSearchParams(
567
2490
  hasWindow() ? window.location.search : ``
568
2491
  );
@@ -665,9 +2588,11 @@ var CreateOrganization = (_a) => {
665
2588
  const { client } = useFrontier();
666
2589
  function onSubmit(data) {
667
2590
  return __async(this, null, function* () {
2591
+ if (!client)
2592
+ return;
668
2593
  const {
669
2594
  data: { organization }
670
- } = yield client.createOrganisation(data);
2595
+ } = yield client.frontierServiceCreateOrganization(data);
671
2596
  window.location = `${window.location.origin}/${organization.name}`;
672
2597
  });
673
2598
  }
@@ -745,24 +2670,33 @@ var styles8 = {
745
2670
  var Signup = (_a) => {
746
2671
  var _b = _a, {
747
2672
  logo,
748
- title = "Create your account"
2673
+ title = "Create your account",
2674
+ excludes = []
749
2675
  } = _b, props = __objRest(_b, [
750
2676
  "logo",
751
- "title"
2677
+ "title",
2678
+ "excludes"
752
2679
  ]);
753
2680
  const { config } = useFrontier();
754
2681
  const { client, strategies = [] } = useFrontier();
755
2682
  const clickHandler = useCallback4(
756
2683
  (name) => __async(void 0, null, function* () {
2684
+ if (!name)
2685
+ return;
2686
+ if (!client)
2687
+ return;
757
2688
  const {
758
- data: { endpoint }
759
- } = yield client.getAuthStrategyEndpoint(name);
2689
+ data: { endpoint = "" }
2690
+ } = yield client.frontierServiceAuthenticate(name);
760
2691
  window.location.href = endpoint;
761
2692
  }),
762
2693
  [strategies]
763
2694
  );
764
2695
  const mailotp = strategies.find((s) => s.name === "mailotp");
765
- const filteredOIDC = strategies.filter((s) => s.name !== "mailotp");
2696
+ const filteredOIDC = strategies.filter((s) => s.name !== "mailotp").filter((s) => {
2697
+ var _a2;
2698
+ return !excludes.includes((_a2 = s.name) != null ? _a2 : "");
2699
+ });
766
2700
  return /* @__PURE__ */ jsxs7(Container, __spreadProps(__spreadValues({}, props), { children: [
767
2701
  /* @__PURE__ */ jsx9(Header, { logo, title }),
768
2702
  /* @__PURE__ */ jsxs7(Flex6, { direction: "column", style: { width: "100%", gap: "8px" }, children: [