@flipdish/authorization 0.2.57 → 0.2.58

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/api.ts CHANGED
@@ -51,6 +51,7 @@ export const AcceptJoinRequestRoleNameEnum = {
51
51
  PropertyManager: 'PropertyManager',
52
52
  FinanceManager: 'FinanceManager',
53
53
  StaffMember: 'StaffMember',
54
+ Courier: 'Courier',
54
55
  Kiosk: 'Kiosk',
55
56
  Terminal: 'Terminal'
56
57
  } as const;
@@ -275,6 +276,7 @@ export const AccessRequestResponseRoleNameEnum = {
275
276
  PropertyManager: 'PropertyManager',
276
277
  FinanceManager: 'FinanceManager',
277
278
  StaffMember: 'StaffMember',
279
+ Courier: 'Courier',
278
280
  Kiosk: 'Kiosk',
279
281
  Terminal: 'Terminal'
280
282
  } as const;
@@ -1379,6 +1381,7 @@ export const GetJoinAccessRequest200ResponseRoleNameEnum = {
1379
1381
  PropertyManager: 'PropertyManager',
1380
1382
  FinanceManager: 'FinanceManager',
1381
1383
  StaffMember: 'StaffMember',
1384
+ Courier: 'Courier',
1382
1385
  Kiosk: 'Kiosk',
1383
1386
  Terminal: 'Terminal'
1384
1387
  } as const;
@@ -1447,6 +1450,86 @@ export type GetUserPermissionsSuccessResponseResourcesValueResourceTypeEnum = ty
1447
1450
  */
1448
1451
  export interface GetUserPermissionsSuccessResponseResourcesValueResourceId {
1449
1452
  }
1453
+ /**
1454
+ * Successful user roles retrieval response
1455
+ * @export
1456
+ * @interface GetUserRolesSuccessResponse
1457
+ */
1458
+ export interface GetUserRolesSuccessResponse {
1459
+ /**
1460
+ *
1461
+ * @type {GetUserRolesSuccessResponseOrgId}
1462
+ * @memberof GetUserRolesSuccessResponse
1463
+ */
1464
+ 'orgId': GetUserRolesSuccessResponseOrgId;
1465
+ /**
1466
+ * List of roles that are assigned to the user in the org
1467
+ * @type {Array<string>}
1468
+ * @memberof GetUserRolesSuccessResponse
1469
+ */
1470
+ 'roles': Array<GetUserRolesSuccessResponseRolesEnum>;
1471
+ /**
1472
+ * Optional permission set keys applied to the roles
1473
+ * @type {Array<string>}
1474
+ * @memberof GetUserRolesSuccessResponse
1475
+ */
1476
+ 'optionalPermissionSetKeys'?: Array<string>;
1477
+ /**
1478
+ * Property IDs, or * for all properties, the roles are scoped to
1479
+ * @type {Array<GetJoinAccessRequest200ResponsePropertyIdsInner>}
1480
+ * @memberof GetUserRolesSuccessResponse
1481
+ */
1482
+ 'properties'?: Array<GetJoinAccessRequest200ResponsePropertyIdsInner>;
1483
+ /**
1484
+ * Brand IDs, or * for all brands, the roles are scoped to
1485
+ * @type {Array<GetUserRolesSuccessResponseBrandsInner>}
1486
+ * @memberof GetUserRolesSuccessResponse
1487
+ */
1488
+ 'brands'?: Array<GetUserRolesSuccessResponseBrandsInner>;
1489
+ /**
1490
+ * Sales channel IDs, or * for all sales channels, the roles are scoped to
1491
+ * @type {Array<GetUserRolesSuccessResponseSalesChannelsInner>}
1492
+ * @memberof GetUserRolesSuccessResponse
1493
+ */
1494
+ 'salesChannels'?: Array<GetUserRolesSuccessResponseSalesChannelsInner>;
1495
+ }
1496
+
1497
+ export const GetUserRolesSuccessResponseRolesEnum = {
1498
+ Owner: 'Owner',
1499
+ PropertyOwner: 'PropertyOwner',
1500
+ ManagedOwner: 'ManagedOwner',
1501
+ Integrator: 'Integrator',
1502
+ PropertyManager: 'PropertyManager',
1503
+ FinanceManager: 'FinanceManager',
1504
+ StaffMember: 'StaffMember',
1505
+ Courier: 'Courier',
1506
+ Kiosk: 'Kiosk',
1507
+ Terminal: 'Terminal'
1508
+ } as const;
1509
+
1510
+ export type GetUserRolesSuccessResponseRolesEnum = typeof GetUserRolesSuccessResponseRolesEnum[keyof typeof GetUserRolesSuccessResponseRolesEnum];
1511
+
1512
+ /**
1513
+ *
1514
+ * @export
1515
+ * @interface GetUserRolesSuccessResponseBrandsInner
1516
+ */
1517
+ export interface GetUserRolesSuccessResponseBrandsInner {
1518
+ }
1519
+ /**
1520
+ * ID of the org the roles are assigned in
1521
+ * @export
1522
+ * @interface GetUserRolesSuccessResponseOrgId
1523
+ */
1524
+ export interface GetUserRolesSuccessResponseOrgId {
1525
+ }
1526
+ /**
1527
+ *
1528
+ * @export
1529
+ * @interface GetUserRolesSuccessResponseSalesChannelsInner
1530
+ */
1531
+ export interface GetUserRolesSuccessResponseSalesChannelsInner {
1532
+ }
1450
1533
  /**
1451
1534
  *
1452
1535
  * @export
@@ -1790,6 +1873,7 @@ export const InviteTokenResponseRoleNameEnum = {
1790
1873
  PropertyManager: 'PropertyManager',
1791
1874
  FinanceManager: 'FinanceManager',
1792
1875
  StaffMember: 'StaffMember',
1876
+ Courier: 'Courier',
1793
1877
  Kiosk: 'Kiosk',
1794
1878
  Terminal: 'Terminal'
1795
1879
  } as const;
@@ -1868,6 +1952,19 @@ export const JoinAccessErrorResponseCodeEnum = {
1868
1952
 
1869
1953
  export type JoinAccessErrorResponseCodeEnum = typeof JoinAccessErrorResponseCodeEnum[keyof typeof JoinAccessErrorResponseCodeEnum];
1870
1954
 
1955
+ /**
1956
+ * Caller removed from org
1957
+ * @export
1958
+ * @interface LeaveOrgSuccessResponse
1959
+ */
1960
+ export interface LeaveOrgSuccessResponse {
1961
+ /**
1962
+ *
1963
+ * @type {string}
1964
+ * @memberof LeaveOrgSuccessResponse
1965
+ */
1966
+ 'message': string;
1967
+ }
1871
1968
  /**
1872
1969
  * An org\'s expired timed access grants, most recent first
1873
1970
  * @export
@@ -1913,6 +2010,25 @@ export interface ListJoinRequestsResponse {
1913
2010
  */
1914
2011
  'items': Array<GetJoinAccessRequest200Response>;
1915
2012
  }
2013
+ /**
2014
+ * The named roles held by a user
2015
+ * @export
2016
+ * @interface ListNamedRolesResponse
2017
+ */
2018
+ export interface ListNamedRolesResponse {
2019
+ /**
2020
+ *
2021
+ * @type {string}
2022
+ * @memberof ListNamedRolesResponse
2023
+ */
2024
+ 'userId': string;
2025
+ /**
2026
+ * The named roles currently held by this user
2027
+ * @type {Array<RoleNames>}
2028
+ * @memberof ListNamedRolesResponse
2029
+ */
2030
+ 'roles': Array<RoleNames>;
2031
+ }
1916
2032
  /**
1917
2033
  *
1918
2034
  * @export
@@ -1921,10 +2037,10 @@ export interface ListJoinRequestsResponse {
1921
2037
  export interface ListOrgRolesSuccessResponseValue {
1922
2038
  /**
1923
2039
  *
1924
- * @type {ListOrgRolesSuccessResponseValueOrgId}
2040
+ * @type {GetUserRolesSuccessResponseOrgId}
1925
2041
  * @memberof ListOrgRolesSuccessResponseValue
1926
2042
  */
1927
- 'orgId': ListOrgRolesSuccessResponseValueOrgId;
2043
+ 'orgId': GetUserRolesSuccessResponseOrgId;
1928
2044
  /**
1929
2045
  * List of roles that are assigned to the user in the org
1930
2046
  * @type {Array<string>}
@@ -1945,16 +2061,16 @@ export interface ListOrgRolesSuccessResponseValue {
1945
2061
  'properties'?: Array<GetJoinAccessRequest200ResponsePropertyIdsInner>;
1946
2062
  /**
1947
2063
  * Brand IDs, or * for all brands, the roles are scoped to
1948
- * @type {Array<ListOrgRolesSuccessResponseValueBrandsInner>}
2064
+ * @type {Array<GetUserRolesSuccessResponseBrandsInner>}
1949
2065
  * @memberof ListOrgRolesSuccessResponseValue
1950
2066
  */
1951
- 'brands'?: Array<ListOrgRolesSuccessResponseValueBrandsInner>;
2067
+ 'brands'?: Array<GetUserRolesSuccessResponseBrandsInner>;
1952
2068
  /**
1953
2069
  * Sales channel IDs, or * for all sales channels, the roles are scoped to
1954
- * @type {Array<ListOrgRolesSuccessResponseValueSalesChannelsInner>}
2070
+ * @type {Array<GetUserRolesSuccessResponseSalesChannelsInner>}
1955
2071
  * @memberof ListOrgRolesSuccessResponseValue
1956
2072
  */
1957
- 'salesChannels'?: Array<ListOrgRolesSuccessResponseValueSalesChannelsInner>;
2073
+ 'salesChannels'?: Array<GetUserRolesSuccessResponseSalesChannelsInner>;
1958
2074
  }
1959
2075
 
1960
2076
  export const ListOrgRolesSuccessResponseValueRolesEnum = {
@@ -1965,33 +2081,13 @@ export const ListOrgRolesSuccessResponseValueRolesEnum = {
1965
2081
  PropertyManager: 'PropertyManager',
1966
2082
  FinanceManager: 'FinanceManager',
1967
2083
  StaffMember: 'StaffMember',
2084
+ Courier: 'Courier',
1968
2085
  Kiosk: 'Kiosk',
1969
2086
  Terminal: 'Terminal'
1970
2087
  } as const;
1971
2088
 
1972
2089
  export type ListOrgRolesSuccessResponseValueRolesEnum = typeof ListOrgRolesSuccessResponseValueRolesEnum[keyof typeof ListOrgRolesSuccessResponseValueRolesEnum];
1973
2090
 
1974
- /**
1975
- *
1976
- * @export
1977
- * @interface ListOrgRolesSuccessResponseValueBrandsInner
1978
- */
1979
- export interface ListOrgRolesSuccessResponseValueBrandsInner {
1980
- }
1981
- /**
1982
- * ID of the org the roles are assigned in
1983
- * @export
1984
- * @interface ListOrgRolesSuccessResponseValueOrgId
1985
- */
1986
- export interface ListOrgRolesSuccessResponseValueOrgId {
1987
- }
1988
- /**
1989
- *
1990
- * @export
1991
- * @interface ListOrgRolesSuccessResponseValueSalesChannelsInner
1992
- */
1993
- export interface ListOrgRolesSuccessResponseValueSalesChannelsInner {
1994
- }
1995
2091
  /**
1996
2092
  * Successful permissions retrieval response
1997
2093
  * @export
@@ -2065,6 +2161,7 @@ export const ListRoleDefinitionsSuccessResponseRolesInnerNameEnum = {
2065
2161
  PropertyManager: 'PropertyManager',
2066
2162
  FinanceManager: 'FinanceManager',
2067
2163
  StaffMember: 'StaffMember',
2164
+ Courier: 'Courier',
2068
2165
  Kiosk: 'Kiosk',
2069
2166
  Terminal: 'Terminal'
2070
2167
  } as const;
@@ -2183,6 +2280,7 @@ export const Permissions = {
2183
2280
  CreateTeammatePropertyManager: 'CreateTeammatePropertyManager',
2184
2281
  CreateTeammatePropertyOwner: 'CreateTeammatePropertyOwner',
2185
2282
  CreateTeammateStaffMember: 'CreateTeammateStaffMember',
2283
+ CreateTeammateCourier: 'CreateTeammateCourier',
2186
2284
  ViewApmConfigurations: 'ViewApmConfigurations',
2187
2285
  EditApmConfigurations: 'EditApmConfigurations',
2188
2286
  ViewCampaignsConfigurations: 'ViewCampaignsConfigurations',
@@ -2226,6 +2324,7 @@ export const Permissions = {
2226
2324
  CreateGlobalApiKey: 'CreateGlobalAPIKey',
2227
2325
  ListGlobalApiKeys: 'ListGlobalAPIKeys',
2228
2326
  BlockPrincipalAccess: 'BlockPrincipalAccess',
2327
+ ListPrincipalOrgs: 'ListPrincipalOrgs',
2229
2328
  CreateMenu: 'CreateMenu',
2230
2329
  UpdateMenu: 'UpdateMenu',
2231
2330
  DeleteMenu: 'DeleteMenu',
@@ -2396,6 +2495,7 @@ export const Permissions = {
2396
2495
  ViewWebhooks: 'ViewWebhooks',
2397
2496
  EditWebhooks: 'EditWebhooks',
2398
2497
  ViewOwnPermissions: 'ViewOwnPermissions',
2498
+ LeaveOrg: 'LeaveOrg',
2399
2499
  CreatePosSale: 'CreatePosSale',
2400
2500
  ComplimentPosItems: 'ComplimentPosItems',
2401
2501
  ApplyPosDiscounts: 'ApplyPosDiscounts',
@@ -2416,6 +2516,7 @@ export const Permissions = {
2416
2516
  SnoozePosItem: 'SnoozePosItem',
2417
2517
  SnoozePosItemIndefinitely: 'SnoozePosItemIndefinitely',
2418
2518
  SnoozePosProperty: 'SnoozePosProperty',
2519
+ SendSmsToCustomers: 'SendSmsToCustomers',
2419
2520
  RoleAdmin: 'RoleAdmin',
2420
2521
  RoleFactory: 'RoleFactory',
2421
2522
  RoleAuthDeveloper: 'RoleAuthDeveloper',
@@ -2478,6 +2579,25 @@ export const PrincipalInOrgTypeEnum = {
2478
2579
 
2479
2580
  export type PrincipalInOrgTypeEnum = typeof PrincipalInOrgTypeEnum[keyof typeof PrincipalInOrgTypeEnum];
2480
2581
 
2582
+ /**
2583
+ * A principal and its org memberships, read straight from the principals store. These are the orgs the principal holds permission assignments in, which is a superset of the orgs any given action is allowed on. No policy evaluation is performed.
2584
+ * @export
2585
+ * @interface PrincipalOrgsResponse
2586
+ */
2587
+ export interface PrincipalOrgsResponse {
2588
+ /**
2589
+ *
2590
+ * @type {AuthorizationRequestPrincipal}
2591
+ * @memberof PrincipalOrgsResponse
2592
+ */
2593
+ 'principal': AuthorizationRequestPrincipal;
2594
+ /**
2595
+ * Org ids the principal holds permission assignments in, ascending
2596
+ * @type {Array<string>}
2597
+ * @memberof PrincipalOrgsResponse
2598
+ */
2599
+ 'orgIds': Array<string>;
2600
+ }
2481
2601
  /**
2482
2602
  * Principals in org
2483
2603
  * @export
@@ -2745,16 +2865,16 @@ export interface RoleAssignmentRequestBody {
2745
2865
  'properties'?: Array<GetJoinAccessRequest200ResponsePropertyIdsInner>;
2746
2866
  /**
2747
2867
  * Brand resource ids (e.g. b123) when scoped to brands
2748
- * @type {Array<ListOrgRolesSuccessResponseValueBrandsInner>}
2868
+ * @type {Array<GetUserRolesSuccessResponseBrandsInner>}
2749
2869
  * @memberof RoleAssignmentRequestBody
2750
2870
  */
2751
- 'brands'?: Array<ListOrgRolesSuccessResponseValueBrandsInner>;
2871
+ 'brands'?: Array<GetUserRolesSuccessResponseBrandsInner>;
2752
2872
  /**
2753
2873
  * Sales channel resource ids (e.g. sc123) when scoped to sales channels
2754
- * @type {Array<ListOrgRolesSuccessResponseValueSalesChannelsInner>}
2874
+ * @type {Array<GetUserRolesSuccessResponseSalesChannelsInner>}
2755
2875
  * @memberof RoleAssignmentRequestBody
2756
2876
  */
2757
- 'salesChannels'?: Array<ListOrgRolesSuccessResponseValueSalesChannelsInner>;
2877
+ 'salesChannels'?: Array<GetUserRolesSuccessResponseSalesChannelsInner>;
2758
2878
  /**
2759
2879
  * Optional permission set keys to apply to this role assignment
2760
2880
  * @type {Array<string>}
@@ -2777,6 +2897,7 @@ export const RoleAssignmentRequestBodyRoleNameEnum = {
2777
2897
  PropertyManager: 'PropertyManager',
2778
2898
  FinanceManager: 'FinanceManager',
2779
2899
  StaffMember: 'StaffMember',
2900
+ Courier: 'Courier',
2780
2901
  Kiosk: 'Kiosk',
2781
2902
  Terminal: 'Terminal'
2782
2903
  } as const;
@@ -5428,6 +5549,43 @@ export const NamedRolesApiAxiosParamCreator = function (configuration?: Configur
5428
5549
  options: localVarRequestOptions,
5429
5550
  };
5430
5551
  },
5552
+ /**
5553
+ * Lists the named roles currently held by the given user. No org context needed, since named roles are global. Caller must hold Admin, Factory, or AuthDeveloper.
5554
+ * @summary List named roles for a user
5555
+ * @param {string} principalId
5556
+ * @param {*} [options] Override http request option.
5557
+ * @throws {RequiredError}
5558
+ */
5559
+ listNamedRoles: async (principalId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
5560
+ // verify required parameter 'principalId' is not null or undefined
5561
+ assertParamExists('listNamedRoles', 'principalId', principalId)
5562
+ const localVarPath = `/namedRoles/{principalId}`
5563
+ .replace(`{${"principalId"}}`, encodeURIComponent(String(principalId)));
5564
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
5565
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
5566
+ let baseOptions;
5567
+ if (configuration) {
5568
+ baseOptions = configuration.baseOptions;
5569
+ }
5570
+
5571
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
5572
+ const localVarHeaderParameter = {} as any;
5573
+ const localVarQueryParameter = {} as any;
5574
+
5575
+ // authentication ApiKeyAuth required
5576
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
5577
+
5578
+
5579
+
5580
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
5581
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
5582
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
5583
+
5584
+ return {
5585
+ url: toPathString(localVarUrlObj),
5586
+ options: localVarRequestOptions,
5587
+ };
5588
+ },
5431
5589
  /**
5432
5590
  * Removes the named role given in the body so the user can no longer act as it. Does not end passes already held; those run to their own expiry. Subject to the same privilege-level gate and AuthDeveloper block as assignment. Mirrors /orgs/{orgId}/roleAssignments/remove.
5433
5591
  * @summary Remove a named role
@@ -5488,6 +5646,19 @@ export const NamedRolesApiFp = function(configuration?: Configuration) {
5488
5646
  const localVarOperationServerBasePath = operationServerMap['NamedRolesApi.applyNamedRole']?.[localVarOperationServerIndex]?.url;
5489
5647
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
5490
5648
  },
5649
+ /**
5650
+ * Lists the named roles currently held by the given user. No org context needed, since named roles are global. Caller must hold Admin, Factory, or AuthDeveloper.
5651
+ * @summary List named roles for a user
5652
+ * @param {string} principalId
5653
+ * @param {*} [options] Override http request option.
5654
+ * @throws {RequiredError}
5655
+ */
5656
+ async listNamedRoles(principalId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListNamedRolesResponse>> {
5657
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listNamedRoles(principalId, options);
5658
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
5659
+ const localVarOperationServerBasePath = operationServerMap['NamedRolesApi.listNamedRoles']?.[localVarOperationServerIndex]?.url;
5660
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
5661
+ },
5491
5662
  /**
5492
5663
  * Removes the named role given in the body so the user can no longer act as it. Does not end passes already held; those run to their own expiry. Subject to the same privilege-level gate and AuthDeveloper block as assignment. Mirrors /orgs/{orgId}/roleAssignments/remove.
5493
5664
  * @summary Remove a named role
@@ -5521,6 +5692,16 @@ export const NamedRolesApiFactory = function (configuration?: Configuration, bas
5521
5692
  applyNamedRole(applyNamedRoleRequestBody?: ApplyNamedRoleRequestBody, options?: RawAxiosRequestConfig): AxiosPromise<NamedRoleAssignmentResponse> {
5522
5693
  return localVarFp.applyNamedRole(applyNamedRoleRequestBody, options).then((request) => request(axios, basePath));
5523
5694
  },
5695
+ /**
5696
+ * Lists the named roles currently held by the given user. No org context needed, since named roles are global. Caller must hold Admin, Factory, or AuthDeveloper.
5697
+ * @summary List named roles for a user
5698
+ * @param {string} principalId
5699
+ * @param {*} [options] Override http request option.
5700
+ * @throws {RequiredError}
5701
+ */
5702
+ listNamedRoles(principalId: string, options?: RawAxiosRequestConfig): AxiosPromise<ListNamedRolesResponse> {
5703
+ return localVarFp.listNamedRoles(principalId, options).then((request) => request(axios, basePath));
5704
+ },
5524
5705
  /**
5525
5706
  * Removes the named role given in the body so the user can no longer act as it. Does not end passes already held; those run to their own expiry. Subject to the same privilege-level gate and AuthDeveloper block as assignment. Mirrors /orgs/{orgId}/roleAssignments/remove.
5526
5707
  * @summary Remove a named role
@@ -5553,6 +5734,18 @@ export class NamedRolesApi extends BaseAPI {
5553
5734
  return NamedRolesApiFp(this.configuration).applyNamedRole(applyNamedRoleRequestBody, options).then((request) => request(this.axios, this.basePath));
5554
5735
  }
5555
5736
 
5737
+ /**
5738
+ * Lists the named roles currently held by the given user. No org context needed, since named roles are global. Caller must hold Admin, Factory, or AuthDeveloper.
5739
+ * @summary List named roles for a user
5740
+ * @param {string} principalId
5741
+ * @param {*} [options] Override http request option.
5742
+ * @throws {RequiredError}
5743
+ * @memberof NamedRolesApi
5744
+ */
5745
+ public listNamedRoles(principalId: string, options?: RawAxiosRequestConfig) {
5746
+ return NamedRolesApiFp(this.configuration).listNamedRoles(principalId, options).then((request) => request(this.axios, this.basePath));
5747
+ }
5748
+
5556
5749
  /**
5557
5750
  * Removes the named role given in the body so the user can no longer act as it. Does not end passes already held; those run to their own expiry. Subject to the same privilege-level gate and AuthDeveloper block as assignment. Mirrors /orgs/{orgId}/roleAssignments/remove.
5558
5751
  * @summary Remove a named role
@@ -5929,6 +6122,117 @@ export const ListPrincipalAccessBlocksTypeEnum = {
5929
6122
  export type ListPrincipalAccessBlocksTypeEnum = typeof ListPrincipalAccessBlocksTypeEnum[keyof typeof ListPrincipalAccessBlocksTypeEnum];
5930
6123
 
5931
6124
 
6125
+ /**
6126
+ * PrincipalsApi - axios parameter creator
6127
+ * @export
6128
+ */
6129
+ export const PrincipalsApiAxiosParamCreator = function (configuration?: Configuration) {
6130
+ return {
6131
+ /**
6132
+ * Returns the principal and the orgs it holds permission assignments in, read from the principals store with no policy evaluation. This is a superset of the orgs any single action is allowed on, so it is a sound negative filter (no membership means no permission) but not an authoritative allow. Intended as a cheap prefilter ahead of /authorize/batch/checks; use /getAuthorizedOrgs when you need a per-action answer. Requires ListPrincipalOrgs.
6133
+ * @summary Get principal org memberships
6134
+ * @param {string} principalId
6135
+ * @param {*} [options] Override http request option.
6136
+ * @throws {RequiredError}
6137
+ */
6138
+ getPrincipalOrgs: async (principalId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
6139
+ // verify required parameter 'principalId' is not null or undefined
6140
+ assertParamExists('getPrincipalOrgs', 'principalId', principalId)
6141
+ const localVarPath = `/principals/{principalId}/orgs`
6142
+ .replace(`{${"principalId"}}`, encodeURIComponent(String(principalId)));
6143
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
6144
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
6145
+ let baseOptions;
6146
+ if (configuration) {
6147
+ baseOptions = configuration.baseOptions;
6148
+ }
6149
+
6150
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
6151
+ const localVarHeaderParameter = {} as any;
6152
+ const localVarQueryParameter = {} as any;
6153
+
6154
+ // authentication ApiKeyAuth required
6155
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
6156
+
6157
+
6158
+
6159
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
6160
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
6161
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
6162
+
6163
+ return {
6164
+ url: toPathString(localVarUrlObj),
6165
+ options: localVarRequestOptions,
6166
+ };
6167
+ },
6168
+ }
6169
+ };
6170
+
6171
+ /**
6172
+ * PrincipalsApi - functional programming interface
6173
+ * @export
6174
+ */
6175
+ export const PrincipalsApiFp = function(configuration?: Configuration) {
6176
+ const localVarAxiosParamCreator = PrincipalsApiAxiosParamCreator(configuration)
6177
+ return {
6178
+ /**
6179
+ * Returns the principal and the orgs it holds permission assignments in, read from the principals store with no policy evaluation. This is a superset of the orgs any single action is allowed on, so it is a sound negative filter (no membership means no permission) but not an authoritative allow. Intended as a cheap prefilter ahead of /authorize/batch/checks; use /getAuthorizedOrgs when you need a per-action answer. Requires ListPrincipalOrgs.
6180
+ * @summary Get principal org memberships
6181
+ * @param {string} principalId
6182
+ * @param {*} [options] Override http request option.
6183
+ * @throws {RequiredError}
6184
+ */
6185
+ async getPrincipalOrgs(principalId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PrincipalOrgsResponse>> {
6186
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getPrincipalOrgs(principalId, options);
6187
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
6188
+ const localVarOperationServerBasePath = operationServerMap['PrincipalsApi.getPrincipalOrgs']?.[localVarOperationServerIndex]?.url;
6189
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
6190
+ },
6191
+ }
6192
+ };
6193
+
6194
+ /**
6195
+ * PrincipalsApi - factory interface
6196
+ * @export
6197
+ */
6198
+ export const PrincipalsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
6199
+ const localVarFp = PrincipalsApiFp(configuration)
6200
+ return {
6201
+ /**
6202
+ * Returns the principal and the orgs it holds permission assignments in, read from the principals store with no policy evaluation. This is a superset of the orgs any single action is allowed on, so it is a sound negative filter (no membership means no permission) but not an authoritative allow. Intended as a cheap prefilter ahead of /authorize/batch/checks; use /getAuthorizedOrgs when you need a per-action answer. Requires ListPrincipalOrgs.
6203
+ * @summary Get principal org memberships
6204
+ * @param {string} principalId
6205
+ * @param {*} [options] Override http request option.
6206
+ * @throws {RequiredError}
6207
+ */
6208
+ getPrincipalOrgs(principalId: string, options?: RawAxiosRequestConfig): AxiosPromise<PrincipalOrgsResponse> {
6209
+ return localVarFp.getPrincipalOrgs(principalId, options).then((request) => request(axios, basePath));
6210
+ },
6211
+ };
6212
+ };
6213
+
6214
+ /**
6215
+ * PrincipalsApi - object-oriented interface
6216
+ * @export
6217
+ * @class PrincipalsApi
6218
+ * @extends {BaseAPI}
6219
+ */
6220
+ export class PrincipalsApi extends BaseAPI {
6221
+ /**
6222
+ * Returns the principal and the orgs it holds permission assignments in, read from the principals store with no policy evaluation. This is a superset of the orgs any single action is allowed on, so it is a sound negative filter (no membership means no permission) but not an authoritative allow. Intended as a cheap prefilter ahead of /authorize/batch/checks; use /getAuthorizedOrgs when you need a per-action answer. Requires ListPrincipalOrgs.
6223
+ * @summary Get principal org memberships
6224
+ * @param {string} principalId
6225
+ * @param {*} [options] Override http request option.
6226
+ * @throws {RequiredError}
6227
+ * @memberof PrincipalsApi
6228
+ */
6229
+ public getPrincipalOrgs(principalId: string, options?: RawAxiosRequestConfig) {
6230
+ return PrincipalsApiFp(this.configuration).getPrincipalOrgs(principalId, options).then((request) => request(this.axios, this.basePath));
6231
+ }
6232
+ }
6233
+
6234
+
6235
+
5932
6236
  /**
5933
6237
  * RoleAssignmentApi - axios parameter creator
5934
6238
  * @export
@@ -5976,6 +6280,43 @@ export const RoleAssignmentApiAxiosParamCreator = function (configuration?: Conf
5976
6280
  options: localVarRequestOptions,
5977
6281
  };
5978
6282
  },
6283
+ /**
6284
+ * Removes the caller from the org: revokes all of their V2 role assignments, reconciles away their policies, and removes them from the org user list. Does not change their Zeus teammate record.
6285
+ * @summary Leave org
6286
+ * @param {string} orgId
6287
+ * @param {*} [options] Override http request option.
6288
+ * @throws {RequiredError}
6289
+ */
6290
+ leaveOrg: async (orgId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
6291
+ // verify required parameter 'orgId' is not null or undefined
6292
+ assertParamExists('leaveOrg', 'orgId', orgId)
6293
+ const localVarPath = `/orgs/{orgId}/leave`
6294
+ .replace(`{${"orgId"}}`, encodeURIComponent(String(orgId)));
6295
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
6296
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
6297
+ let baseOptions;
6298
+ if (configuration) {
6299
+ baseOptions = configuration.baseOptions;
6300
+ }
6301
+
6302
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
6303
+ const localVarHeaderParameter = {} as any;
6304
+ const localVarQueryParameter = {} as any;
6305
+
6306
+ // authentication ApiKeyAuth required
6307
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
6308
+
6309
+
6310
+
6311
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
6312
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
6313
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
6314
+
6315
+ return {
6316
+ url: toPathString(localVarUrlObj),
6317
+ options: localVarRequestOptions,
6318
+ };
6319
+ },
5979
6320
  /**
5980
6321
  * Reconciles policy assignments for the role assignment principal: creates missing policies and revokes leftovers that materialize no longer emits
5981
6322
  * @summary Rematerialize Role Assignment
@@ -6082,6 +6423,19 @@ export const RoleAssignmentApiFp = function(configuration?: Configuration) {
6082
6423
  const localVarOperationServerBasePath = operationServerMap['RoleAssignmentApi.applyRoleAssignment']?.[localVarOperationServerIndex]?.url;
6083
6424
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
6084
6425
  },
6426
+ /**
6427
+ * Removes the caller from the org: revokes all of their V2 role assignments, reconciles away their policies, and removes them from the org user list. Does not change their Zeus teammate record.
6428
+ * @summary Leave org
6429
+ * @param {string} orgId
6430
+ * @param {*} [options] Override http request option.
6431
+ * @throws {RequiredError}
6432
+ */
6433
+ async leaveOrg(orgId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<LeaveOrgSuccessResponse>> {
6434
+ const localVarAxiosArgs = await localVarAxiosParamCreator.leaveOrg(orgId, options);
6435
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
6436
+ const localVarOperationServerBasePath = operationServerMap['RoleAssignmentApi.leaveOrg']?.[localVarOperationServerIndex]?.url;
6437
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
6438
+ },
6085
6439
  /**
6086
6440
  * Reconciles policy assignments for the role assignment principal: creates missing policies and revokes leftovers that materialize no longer emits
6087
6441
  * @summary Rematerialize Role Assignment
@@ -6131,6 +6485,16 @@ export const RoleAssignmentApiFactory = function (configuration?: Configuration,
6131
6485
  applyRoleAssignment(orgId: string, roleAssignmentRequestBody?: RoleAssignmentRequestBody, options?: RawAxiosRequestConfig): AxiosPromise<RoleAssignmentSuccessResponse> {
6132
6486
  return localVarFp.applyRoleAssignment(orgId, roleAssignmentRequestBody, options).then((request) => request(axios, basePath));
6133
6487
  },
6488
+ /**
6489
+ * Removes the caller from the org: revokes all of their V2 role assignments, reconciles away their policies, and removes them from the org user list. Does not change their Zeus teammate record.
6490
+ * @summary Leave org
6491
+ * @param {string} orgId
6492
+ * @param {*} [options] Override http request option.
6493
+ * @throws {RequiredError}
6494
+ */
6495
+ leaveOrg(orgId: string, options?: RawAxiosRequestConfig): AxiosPromise<LeaveOrgSuccessResponse> {
6496
+ return localVarFp.leaveOrg(orgId, options).then((request) => request(axios, basePath));
6497
+ },
6134
6498
  /**
6135
6499
  * Reconciles policy assignments for the role assignment principal: creates missing policies and revokes leftovers that materialize no longer emits
6136
6500
  * @summary Rematerialize Role Assignment
@@ -6176,6 +6540,18 @@ export class RoleAssignmentApi extends BaseAPI {
6176
6540
  return RoleAssignmentApiFp(this.configuration).applyRoleAssignment(orgId, roleAssignmentRequestBody, options).then((request) => request(this.axios, this.basePath));
6177
6541
  }
6178
6542
 
6543
+ /**
6544
+ * Removes the caller from the org: revokes all of their V2 role assignments, reconciles away their policies, and removes them from the org user list. Does not change their Zeus teammate record.
6545
+ * @summary Leave org
6546
+ * @param {string} orgId
6547
+ * @param {*} [options] Override http request option.
6548
+ * @throws {RequiredError}
6549
+ * @memberof RoleAssignmentApi
6550
+ */
6551
+ public leaveOrg(orgId: string, options?: RawAxiosRequestConfig) {
6552
+ return RoleAssignmentApiFp(this.configuration).leaveOrg(orgId, options).then((request) => request(this.axios, this.basePath));
6553
+ }
6554
+
6179
6555
  /**
6180
6556
  * Reconciles policy assignments for the role assignment principal: creates missing policies and revokes leftovers that materialize no longer emits
6181
6557
  * @summary Rematerialize Role Assignment
@@ -6717,6 +7093,43 @@ export const UserPermissionsApiAxiosParamCreator = function (configuration?: Con
6717
7093
 
6718
7094
 
6719
7095
 
7096
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
7097
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
7098
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
7099
+
7100
+ return {
7101
+ url: toPathString(localVarUrlObj),
7102
+ options: localVarRequestOptions,
7103
+ };
7104
+ },
7105
+ /**
7106
+ * List the role assignments for the current user in the org
7107
+ * @summary List Own Roles
7108
+ * @param {string} orgId
7109
+ * @param {*} [options] Override http request option.
7110
+ * @throws {RequiredError}
7111
+ */
7112
+ listOwnRoles: async (orgId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
7113
+ // verify required parameter 'orgId' is not null or undefined
7114
+ assertParamExists('listOwnRoles', 'orgId', orgId)
7115
+ const localVarPath = `/orgs/{orgId}/user/roles`
7116
+ .replace(`{${"orgId"}}`, encodeURIComponent(String(orgId)));
7117
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
7118
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
7119
+ let baseOptions;
7120
+ if (configuration) {
7121
+ baseOptions = configuration.baseOptions;
7122
+ }
7123
+
7124
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
7125
+ const localVarHeaderParameter = {} as any;
7126
+ const localVarQueryParameter = {} as any;
7127
+
7128
+ // authentication ApiKeyAuth required
7129
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
7130
+
7131
+
7132
+
6720
7133
  setSearchParams(localVarUrlObj, localVarQueryParameter);
6721
7134
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
6722
7135
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -6816,6 +7229,19 @@ export const UserPermissionsApiFp = function(configuration?: Configuration) {
6816
7229
  const localVarOperationServerBasePath = operationServerMap['UserPermissionsApi.listOwnPermissions']?.[localVarOperationServerIndex]?.url;
6817
7230
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
6818
7231
  },
7232
+ /**
7233
+ * List the role assignments for the current user in the org
7234
+ * @summary List Own Roles
7235
+ * @param {string} orgId
7236
+ * @param {*} [options] Override http request option.
7237
+ * @throws {RequiredError}
7238
+ */
7239
+ async listOwnRoles(orgId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetUserRolesSuccessResponse>> {
7240
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listOwnRoles(orgId, options);
7241
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
7242
+ const localVarOperationServerBasePath = operationServerMap['UserPermissionsApi.listOwnRoles']?.[localVarOperationServerIndex]?.url;
7243
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
7244
+ },
6819
7245
  /**
6820
7246
  * List the available permissions for a given user
6821
7247
  * @summary List User Permissions
@@ -6870,6 +7296,16 @@ export const UserPermissionsApiFactory = function (configuration?: Configuration
6870
7296
  listOwnPermissions(orgId: string, options?: RawAxiosRequestConfig): AxiosPromise<GetUserPermissionsSuccessResponse> {
6871
7297
  return localVarFp.listOwnPermissions(orgId, options).then((request) => request(axios, basePath));
6872
7298
  },
7299
+ /**
7300
+ * List the role assignments for the current user in the org
7301
+ * @summary List Own Roles
7302
+ * @param {string} orgId
7303
+ * @param {*} [options] Override http request option.
7304
+ * @throws {RequiredError}
7305
+ */
7306
+ listOwnRoles(orgId: string, options?: RawAxiosRequestConfig): AxiosPromise<GetUserRolesSuccessResponse> {
7307
+ return localVarFp.listOwnRoles(orgId, options).then((request) => request(axios, basePath));
7308
+ },
6873
7309
  /**
6874
7310
  * List the available permissions for a given user
6875
7311
  * @summary List User Permissions
@@ -6927,6 +7363,18 @@ export class UserPermissionsApi extends BaseAPI {
6927
7363
  return UserPermissionsApiFp(this.configuration).listOwnPermissions(orgId, options).then((request) => request(this.axios, this.basePath));
6928
7364
  }
6929
7365
 
7366
+ /**
7367
+ * List the role assignments for the current user in the org
7368
+ * @summary List Own Roles
7369
+ * @param {string} orgId
7370
+ * @param {*} [options] Override http request option.
7371
+ * @throws {RequiredError}
7372
+ * @memberof UserPermissionsApi
7373
+ */
7374
+ public listOwnRoles(orgId: string, options?: RawAxiosRequestConfig) {
7375
+ return UserPermissionsApiFp(this.configuration).listOwnRoles(orgId, options).then((request) => request(this.axios, this.basePath));
7376
+ }
7377
+
6930
7378
  /**
6931
7379
  * List the available permissions for a given user
6932
7380
  * @summary List User Permissions