@flipdish/authorization 0.0.5-rc.1756734017 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  .gitignore
2
2
  .npmignore
3
- .openapi-generator-ignore
4
3
  README.md
5
4
  api.ts
6
5
  base.ts
package/README.md CHANGED
@@ -7,11 +7,11 @@ Internally the package utilizes the [axios](https://github.com/axios/axios) as i
7
7
  ### Example code
8
8
 
9
9
  ```typescript
10
- import { AuthorizationApi, Configuration, PermissionsApi, Permissions } from '@flipdish/authorization';
11
- import { describe, expect, test, it } from '@jest/globals';
10
+ import { AuthorizationApi, Configuration, PermissionsApi, Permissions } from '@flipdish/authorization';
11
+ import { describe, expect, test, it } from '@jest/globals';
12
12
 
13
- const basePath = "https://api.flipdish.co/auth/";
14
- const configuration = new Configuration({
13
+ const basePath = "https://api.flipdish.co/auth/";
14
+ const configuration = new Configuration({
15
15
  basePath,
16
16
  // to get the API key, you should follow these docs:
17
17
  // https://developers.flipdish.com/docs/getting-started
@@ -21,14 +21,14 @@ const configuration = new Configuration({
21
21
  // useDefaultUserAgent: true
22
22
  });
23
23
 
24
- const authorization = new AuthorizationApi(configuration);
25
- const permissions = new PermissionsApi(configuration);
24
+ const authorization = new AuthorizationApi(configuration);
25
+ const permissions = new PermissionsApi(configuration);
26
26
 
27
- describe('Authorization Tests', () => {
28
- describe('Authorisation', () => {
27
+ describe('Authorization Tests', () => {
28
+ describe('Authorization', () => {
29
29
 
30
- test('List Permissions', async () => {
31
- const permissionsResponse = await permissions.listPermissions();
30
+ test('List Permissions', async () => {
31
+ const permissionsResponse = await permissions.listPermissions();
32
32
  expect(permissionsResponse.status).toBe(200);
33
33
  expect(permissionsResponse.data.permissions).toBeDefined();
34
34
  expect(permissionsResponse.data.permissions.length).toBeGreaterThan(0);
@@ -39,82 +39,82 @@ describe('Authorization Tests', () => {
39
39
  expect(permissionsResponse.data.permissions).toContain(Permissions.EditAppAssets);
40
40
  });
41
41
 
42
- describe('Authenticate and Authorize', () => {
43
- it('should authenticate and authorise with a valid FD-Authorization cookie', async () => {
44
- const authorizationResponse = await authorization.authenticateAndAuthorize({
42
+ describe('Authenticate and Authorize', () => {
43
+ it('should authenticate and authorize with a valid FD-Authorization cookie', async () => {
44
+ const authorizationResponse = await authorization.authenticateAndAuthorize({
45
45
  headers: {
46
- 'Cookie': `FD-Authorization=${process.env.FD_AUTH_COOKIE_PROD};`,
46
+ 'Cookie': `FD-Authorization=${process.env.FD_AUTH_COOKIE_PROD};`,
47
47
  },
48
48
  action: Permissions.AnyAuditLogs,
49
49
  resource: {
50
- id: "org12345",
51
- type: "Org",
50
+ id: "org12345",
51
+ type: "Org",
52
52
  }
53
53
  });
54
54
 
55
55
  expect(authorizationResponse.status).toBe(200);
56
56
  expect(authorizationResponse.data.authentication.authenticated).toBe(true);
57
- expect(authorizationResponse.data.authentication.principal?.type).toBe("User");
58
- expect(authorizationResponse.data.authentication.principal?.id).toBe("8147747");
57
+ expect(authorizationResponse.data.authentication.principal?.type).toBe("User");
58
+ expect(authorizationResponse.data.authentication.principal?.id).toBe("8147747");
59
59
  });
60
60
 
61
- it('should not authenticate and authorize with an invalid FD-Authorization cookie', async () => {
61
+ it('should not authenticate and authorize with an invalid FD-Authorization cookie', async () => {
62
62
  try {
63
63
  await authorization.authenticateAndAuthorize({
64
64
  headers: {
65
- 'Cookie': `FD-Authorization=not-a-valid-cookie;`,
65
+ 'Cookie': `FD-Authorization=not-a-valid-cookie;`,
66
66
  },
67
67
  action: Permissions.AnyAuditLogs,
68
68
  resource: {
69
- id: "org12345",
70
- type: "Org",
69
+ id: "org12345",
70
+ type: "Org",
71
71
  },
72
72
  });
73
73
  } catch (error: any) {
74
74
  expect(error.response.status).toBe(401);
75
- expect(error.response.data.message).toBe("Unauthenticated");
75
+ expect(error.response.data.message).toBe("Unauthenticated");
76
76
  }
77
77
  });
78
78
 
79
- it('should authenticate and authorize with a valid Bearer token', async () => {
80
- const authorizationResponse = await authorization.authenticateAndAuthorize({
79
+ it('should authenticate and authorize with a valid Bearer token', async () => {
80
+ const authorizationResponse = await authorization.authenticateAndAuthorize({
81
81
  headers: {
82
- 'Authorization': `Bearer ${process.env.FLIPDISH_BEARER_TOKEN_PROD}`,
82
+ 'Authorization': `Bearer ${process.env.FLIPDISH_BEARER_TOKEN_PROD}`,
83
83
  },
84
84
  action: Permissions.AnyAuditLogs,
85
85
  resource: {
86
- id: "org12345",
87
- type: "Org",
86
+ id: "org12345",
87
+ type: "Org",
88
88
  }
89
89
  });
90
90
 
91
91
  expect(authorizationResponse.status).toBe(200);
92
92
  expect(authorizationResponse.data.authentication.authenticated).toBe(true);
93
- expect(authorizationResponse.data.authentication.principal?.type).toBe("User");
94
- expect(authorizationResponse.data.authentication.principal?.id).toBe("8147747");
93
+ expect(authorizationResponse.data.authentication.principal?.type).toBe("User");
94
+ expect(authorizationResponse.data.authentication.principal?.id).toBe("8147747");
95
95
  });
96
96
  });
97
97
 
98
98
 
99
- test('Authorize', async () => {
100
- let testPrincipal: any = {
101
- id: "12345",
102
- type: "User",
99
+ test('Authorize', async () => {
100
+ let testPrincipal: any = {
101
+ id: "12345",
102
+ type: "User",
103
103
  };
104
104
 
105
- let testResource: any = {
106
- id: "org12345",
107
- type: "Org",
105
+ let testResource: any = {
106
+ id: "org12345",
107
+ type: "Org",
108
108
  };
109
109
 
110
- const authorizationResponse = await authorization.authorize({
110
+ const authorizationResponse = await authorization.authorize({
111
111
  principal: testPrincipal,
112
112
  action: Permissions.AnyAuditLogs,
113
113
  resource: testResource
114
114
  });
115
115
  expect(authorizationResponse.status).toBe(200);
116
116
  expect(authorizationResponse.data.allowed).toBe(false);
117
- expect(authorizationResponse.data.decision).toBe("DENY");
117
+ expect(authorizationResponse.data.decision).toBe("DENY");
118
118
  });
119
119
  });
120
120
  });
package/api.ts CHANGED
@@ -30,7 +30,7 @@ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerM
30
30
  */
31
31
  export interface AssignRoleRequestBody {
32
32
  /**
33
- * Role to assign to the principal choose from: OrgViewer, OrgManager, OrgAdmin, BrandViewer, BrandManager, BrandAdmin, StoreViewer, StoreEditor, StoreManager, CustomerViewer, CustomerManager, VoucherViewer, VoucherEditor, VoucherManager, VoucherCampaignManager, VoucherStatisticsViewer, AnalyticsViewer, ReportsViewer, FinanceViewer, FinanceManager, TeamViewer, TeamManager, TeamAdmin, TechViewer, TechManager, AppStoreViewer, AppStoreManager, SalesChannelViewer, SalesChannelEditor, SalesChannelManager, DeliveryViewer, DeliveryManager, DriverManager, AuditViewer, AuditManager, AccountsViewer, AccountsEditor, DocumentExplorerViewer, DocumentExplorerEditor, PayrollViewer, PayrollEditor, PropertyViewer, PropertyManager, PropertyAdmin, WebsiteContentEditor, WebsiteContentViewer, WebsiteTechViewer, MenuViewer, MenuEditor, MenuManager, MenuMetaFieldManager, MenuMetaFieldEditor, MenuMetaFieldViewer, StoreDeliveryZoneManager, StoreDeliveryZoneEditor, StoreDeliveryZoneViewer, OrderFulfillmentManager, OrderManager, OrderEditor, OrderViewer, InventoryManager, InventoryEditor, InventoryViewer, PaymentManager, OnboardingManager, FeatureFlagManager, PropertyOwnerMisc, ManagedOwnerMisc, IntegratorMisc, PropertyManagerMisc, FinanceManagerMisc, SupportMisc
33
+ *
34
34
  * @type {string}
35
35
  * @memberof AssignRoleRequestBody
36
36
  */
@@ -47,6 +47,12 @@ export interface AssignRoleRequestBody {
47
47
  * @memberof AssignRoleRequestBody
48
48
  */
49
49
  'principal': AuthorizationRequestPrincipal;
50
+ /**
51
+ *
52
+ * @type {string}
53
+ * @memberof AssignRoleRequestBody
54
+ */
55
+ 'brandId': string;
50
56
  }
51
57
 
52
58
  export const AssignRoleRequestBodyRoleEnum = {
@@ -140,7 +146,7 @@ export interface AssignRoleSuccessResponse {
140
146
  'message': string;
141
147
  }
142
148
  /**
143
- * Request to check if a user is authorized to perform an action(s). If you pass in an array of permissions, you will receive a single allow / deny response (based on an AND of the result for each permission). For a granular response to multiple permissions, call the /authorize/batch endpoint.
149
+ *
144
150
  * @export
145
151
  * @interface AuthenticateAndAuthorizeRequest
146
152
  */
@@ -491,11 +497,17 @@ export interface GetPrincipalRolesSuccessResponseRolesInner {
491
497
  */
492
498
  'policyId': string;
493
499
  /**
494
- * Role name
500
+ *
501
+ * @type {GetPrincipalRolesSuccessResponseRolesInnerRoleName}
502
+ * @memberof GetPrincipalRolesSuccessResponseRolesInner
503
+ */
504
+ 'roleName': GetPrincipalRolesSuccessResponseRolesInnerRoleName;
505
+ /**
506
+ * Policy type
495
507
  * @type {string}
496
508
  * @memberof GetPrincipalRolesSuccessResponseRolesInner
497
509
  */
498
- 'roleName': GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum;
510
+ 'policyType': GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum;
499
511
  /**
500
512
  * Date and time the role was assigned
501
513
  * @type {string}
@@ -540,82 +552,14 @@ export interface GetPrincipalRolesSuccessResponseRolesInner {
540
552
  'salesChannelId'?: string;
541
553
  }
542
554
 
543
- export const GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum = {
544
- OrgViewer: 'OrgViewer',
545
- OrgManager: 'OrgManager',
546
- OrgAdmin: 'OrgAdmin',
547
- BrandViewer: 'BrandViewer',
548
- BrandManager: 'BrandManager',
549
- BrandAdmin: 'BrandAdmin',
550
- StoreViewer: 'StoreViewer',
551
- StoreEditor: 'StoreEditor',
552
- StoreManager: 'StoreManager',
553
- CustomerViewer: 'CustomerViewer',
554
- CustomerManager: 'CustomerManager',
555
- VoucherViewer: 'VoucherViewer',
556
- VoucherEditor: 'VoucherEditor',
557
- VoucherManager: 'VoucherManager',
558
- VoucherCampaignManager: 'VoucherCampaignManager',
559
- VoucherStatisticsViewer: 'VoucherStatisticsViewer',
560
- AnalyticsViewer: 'AnalyticsViewer',
561
- ReportsViewer: 'ReportsViewer',
562
- FinanceViewer: 'FinanceViewer',
563
- FinanceManager: 'FinanceManager',
564
- TeamViewer: 'TeamViewer',
565
- TeamManager: 'TeamManager',
566
- TeamAdmin: 'TeamAdmin',
567
- TechViewer: 'TechViewer',
568
- TechManager: 'TechManager',
569
- AppStoreViewer: 'AppStoreViewer',
570
- AppStoreManager: 'AppStoreManager',
571
- SalesChannelViewer: 'SalesChannelViewer',
572
- SalesChannelEditor: 'SalesChannelEditor',
573
- SalesChannelManager: 'SalesChannelManager',
574
- DeliveryViewer: 'DeliveryViewer',
575
- DeliveryManager: 'DeliveryManager',
576
- DriverManager: 'DriverManager',
577
- AuditViewer: 'AuditViewer',
578
- AuditManager: 'AuditManager',
579
- AccountsViewer: 'AccountsViewer',
580
- AccountsEditor: 'AccountsEditor',
581
- DocumentExplorerViewer: 'DocumentExplorerViewer',
582
- DocumentExplorerEditor: 'DocumentExplorerEditor',
583
- PayrollViewer: 'PayrollViewer',
584
- PayrollEditor: 'PayrollEditor',
585
- PropertyViewer: 'PropertyViewer',
586
- PropertyManager: 'PropertyManager',
587
- PropertyAdmin: 'PropertyAdmin',
588
- WebsiteContentEditor: 'WebsiteContentEditor',
589
- WebsiteContentViewer: 'WebsiteContentViewer',
590
- WebsiteTechViewer: 'WebsiteTechViewer',
591
- MenuViewer: 'MenuViewer',
592
- MenuEditor: 'MenuEditor',
593
- MenuManager: 'MenuManager',
594
- MenuMetaFieldManager: 'MenuMetaFieldManager',
595
- MenuMetaFieldEditor: 'MenuMetaFieldEditor',
596
- MenuMetaFieldViewer: 'MenuMetaFieldViewer',
597
- StoreDeliveryZoneManager: 'StoreDeliveryZoneManager',
598
- StoreDeliveryZoneEditor: 'StoreDeliveryZoneEditor',
599
- StoreDeliveryZoneViewer: 'StoreDeliveryZoneViewer',
600
- OrderFulfillmentManager: 'OrderFulfillmentManager',
601
- OrderManager: 'OrderManager',
602
- OrderEditor: 'OrderEditor',
603
- OrderViewer: 'OrderViewer',
604
- InventoryManager: 'InventoryManager',
605
- InventoryEditor: 'InventoryEditor',
606
- InventoryViewer: 'InventoryViewer',
607
- PaymentManager: 'PaymentManager',
608
- OnboardingManager: 'OnboardingManager',
609
- FeatureFlagManager: 'FeatureFlagManager',
610
- PropertyOwnerMisc: 'PropertyOwnerMisc',
611
- ManagedOwnerMisc: 'ManagedOwnerMisc',
612
- IntegratorMisc: 'IntegratorMisc',
613
- PropertyManagerMisc: 'PropertyManagerMisc',
614
- FinanceManagerMisc: 'FinanceManagerMisc',
615
- SupportMisc: 'SupportMisc'
555
+ export const GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum = {
556
+ Main: 'Main',
557
+ BrandOverride: 'BrandOverride',
558
+ OrgOverride: 'OrgOverride',
559
+ Forbidden: 'Forbidden'
616
560
  } as const;
617
561
 
618
- export type GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum = typeof GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum[keyof typeof GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum];
562
+ export type GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum = typeof GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum[keyof typeof GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum];
619
563
  export const GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum = {
620
564
  Property: 'Property',
621
565
  Org: 'Org',
@@ -625,6 +569,13 @@ export const GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum = {
625
569
 
626
570
  export type GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum = typeof GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum[keyof typeof GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum];
627
571
 
572
+ /**
573
+ * Role name
574
+ * @export
575
+ * @interface GetPrincipalRolesSuccessResponseRolesInnerRoleName
576
+ */
577
+ export interface GetPrincipalRolesSuccessResponseRolesInnerRoleName {
578
+ }
628
579
  /**
629
580
  * Successful roles retrieval response
630
581
  * @export
@@ -1227,7 +1178,7 @@ export type RevokeForbiddenRoleRequestBodyCompensatingRoleEnum = typeof RevokeFo
1227
1178
  */
1228
1179
  export interface RevokeRoleRequestBody {
1229
1180
  /**
1230
- * Role to assign to the principal choose from: OrgViewer, OrgManager, OrgAdmin, BrandViewer, BrandManager, BrandAdmin, StoreViewer, StoreEditor, StoreManager, CustomerViewer, CustomerManager, VoucherViewer, VoucherEditor, VoucherManager, VoucherCampaignManager, VoucherStatisticsViewer, AnalyticsViewer, ReportsViewer, FinanceViewer, FinanceManager, TeamViewer, TeamManager, TeamAdmin, TechViewer, TechManager, AppStoreViewer, AppStoreManager, SalesChannelViewer, SalesChannelEditor, SalesChannelManager, DeliveryViewer, DeliveryManager, DriverManager, AuditViewer, AuditManager, AccountsViewer, AccountsEditor, DocumentExplorerViewer, DocumentExplorerEditor, PayrollViewer, PayrollEditor, PropertyViewer, PropertyManager, PropertyAdmin, WebsiteContentEditor, WebsiteContentViewer, WebsiteTechViewer, MenuViewer, MenuEditor, MenuManager, MenuMetaFieldManager, MenuMetaFieldEditor, MenuMetaFieldViewer, StoreDeliveryZoneManager, StoreDeliveryZoneEditor, StoreDeliveryZoneViewer, OrderFulfillmentManager, OrderManager, OrderEditor, OrderViewer, InventoryManager, InventoryEditor, InventoryViewer, PaymentManager, OnboardingManager, FeatureFlagManager, PropertyOwnerMisc, ManagedOwnerMisc, IntegratorMisc, PropertyManagerMisc, FinanceManagerMisc, SupportMisc
1181
+ *
1231
1182
  * @type {string}
1232
1183
  * @memberof RevokeRoleRequestBody
1233
1184
  */
@@ -1397,11 +1348,13 @@ export const AuthenticationApiAxiosParamCreator = function (configuration?: Conf
1397
1348
  /**
1398
1349
  * Authenticate and authorize a user to perform an action
1399
1350
  * @summary Authenticate and authorize Request
1400
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1351
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1401
1352
  * @param {*} [options] Override http request option.
1402
1353
  * @throws {RequiredError}
1403
1354
  */
1404
- authenticateAndAuthorize: async (authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1355
+ authenticateAndAuthorize: async (authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1356
+ // verify required parameter 'authenticateAndAuthorizeRequest' is not null or undefined
1357
+ assertParamExists('authenticateAndAuthorize', 'authenticateAndAuthorizeRequest', authenticateAndAuthorizeRequest)
1405
1358
  const localVarPath = `/authenticateAndAuthorize`;
1406
1359
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1407
1360
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -1444,11 +1397,11 @@ export const AuthenticationApiFp = function(configuration?: Configuration) {
1444
1397
  /**
1445
1398
  * Authenticate and authorize a user to perform an action
1446
1399
  * @summary Authenticate and authorize Request
1447
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1400
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1448
1401
  * @param {*} [options] Override http request option.
1449
1402
  * @throws {RequiredError}
1450
1403
  */
1451
- async authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthenticateAndAuthorizeResponse>> {
1404
+ async authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthenticateAndAuthorizeResponse>> {
1452
1405
  const localVarAxiosArgs = await localVarAxiosParamCreator.authenticateAndAuthorize(authenticateAndAuthorizeRequest, options);
1453
1406
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1454
1407
  const localVarOperationServerBasePath = operationServerMap['AuthenticationApi.authenticateAndAuthorize']?.[localVarOperationServerIndex]?.url;
@@ -1467,11 +1420,11 @@ export const AuthenticationApiFactory = function (configuration?: Configuration,
1467
1420
  /**
1468
1421
  * Authenticate and authorize a user to perform an action
1469
1422
  * @summary Authenticate and authorize Request
1470
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1423
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1471
1424
  * @param {*} [options] Override http request option.
1472
1425
  * @throws {RequiredError}
1473
1426
  */
1474
- authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse> {
1427
+ authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse> {
1475
1428
  return localVarFp.authenticateAndAuthorize(authenticateAndAuthorizeRequest, options).then((request) => request(axios, basePath));
1476
1429
  },
1477
1430
  };
@@ -1487,12 +1440,12 @@ export class AuthenticationApi extends BaseAPI {
1487
1440
  /**
1488
1441
  * Authenticate and authorize a user to perform an action
1489
1442
  * @summary Authenticate and authorize Request
1490
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1443
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1491
1444
  * @param {*} [options] Override http request option.
1492
1445
  * @throws {RequiredError}
1493
1446
  * @memberof AuthenticationApi
1494
1447
  */
1495
- public authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) {
1448
+ public authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) {
1496
1449
  return AuthenticationApiFp(this.configuration).authenticateAndAuthorize(authenticateAndAuthorizeRequest, options).then((request) => request(this.axios, this.basePath));
1497
1450
  }
1498
1451
  }
@@ -1508,11 +1461,13 @@ export const AuthorizationApiAxiosParamCreator = function (configuration?: Confi
1508
1461
  /**
1509
1462
  * Authenticate and authorize a user to perform an action
1510
1463
  * @summary Authenticate and authorize Request
1511
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1464
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1512
1465
  * @param {*} [options] Override http request option.
1513
1466
  * @throws {RequiredError}
1514
1467
  */
1515
- authenticateAndAuthorize: async (authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1468
+ authenticateAndAuthorize: async (authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
1469
+ // verify required parameter 'authenticateAndAuthorizeRequest' is not null or undefined
1470
+ assertParamExists('authenticateAndAuthorize', 'authenticateAndAuthorizeRequest', authenticateAndAuthorizeRequest)
1516
1471
  const localVarPath = `/authenticateAndAuthorize`;
1517
1472
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1518
1473
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -1592,11 +1547,11 @@ export const AuthorizationApiFp = function(configuration?: Configuration) {
1592
1547
  /**
1593
1548
  * Authenticate and authorize a user to perform an action
1594
1549
  * @summary Authenticate and authorize Request
1595
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1550
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1596
1551
  * @param {*} [options] Override http request option.
1597
1552
  * @throws {RequiredError}
1598
1553
  */
1599
- async authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthenticateAndAuthorizeResponse>> {
1554
+ async authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthenticateAndAuthorizeResponse>> {
1600
1555
  const localVarAxiosArgs = await localVarAxiosParamCreator.authenticateAndAuthorize(authenticateAndAuthorizeRequest, options);
1601
1556
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1602
1557
  const localVarOperationServerBasePath = operationServerMap['AuthorizationApi.authenticateAndAuthorize']?.[localVarOperationServerIndex]?.url;
@@ -1628,11 +1583,11 @@ export const AuthorizationApiFactory = function (configuration?: Configuration,
1628
1583
  /**
1629
1584
  * Authenticate and authorize a user to perform an action
1630
1585
  * @summary Authenticate and authorize Request
1631
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1586
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1632
1587
  * @param {*} [options] Override http request option.
1633
1588
  * @throws {RequiredError}
1634
1589
  */
1635
- authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse> {
1590
+ authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse> {
1636
1591
  return localVarFp.authenticateAndAuthorize(authenticateAndAuthorizeRequest, options).then((request) => request(axios, basePath));
1637
1592
  },
1638
1593
  /**
@@ -1658,12 +1613,12 @@ export class AuthorizationApi extends BaseAPI {
1658
1613
  /**
1659
1614
  * Authenticate and authorize a user to perform an action
1660
1615
  * @summary Authenticate and authorize Request
1661
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1616
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1662
1617
  * @param {*} [options] Override http request option.
1663
1618
  * @throws {RequiredError}
1664
1619
  * @memberof AuthorizationApi
1665
1620
  */
1666
- public authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) {
1621
+ public authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) {
1667
1622
  return AuthorizationApiFp(this.configuration).authenticateAndAuthorize(authenticateAndAuthorizeRequest, options).then((request) => request(this.axios, this.basePath));
1668
1623
  }
1669
1624
 
package/configuration.ts CHANGED
@@ -100,7 +100,7 @@ export class Configuration {
100
100
 
101
101
  const extraHeaders = param.useDefaultUserAgent ? {} : {
102
102
  headers: {
103
- "user-agent": "Flipdish authorization typescript SDK / 0.0.5-rc.1756734017"
103
+ "user-agent": "Flipdish authorization typescript SDK / 0.1.0"
104
104
  }
105
105
  };
106
106
 
package/dist/api.d.ts CHANGED
@@ -20,7 +20,7 @@ import { BaseAPI } from './base';
20
20
  */
21
21
  export interface AssignRoleRequestBody {
22
22
  /**
23
- * Role to assign to the principal choose from: OrgViewer, OrgManager, OrgAdmin, BrandViewer, BrandManager, BrandAdmin, StoreViewer, StoreEditor, StoreManager, CustomerViewer, CustomerManager, VoucherViewer, VoucherEditor, VoucherManager, VoucherCampaignManager, VoucherStatisticsViewer, AnalyticsViewer, ReportsViewer, FinanceViewer, FinanceManager, TeamViewer, TeamManager, TeamAdmin, TechViewer, TechManager, AppStoreViewer, AppStoreManager, SalesChannelViewer, SalesChannelEditor, SalesChannelManager, DeliveryViewer, DeliveryManager, DriverManager, AuditViewer, AuditManager, AccountsViewer, AccountsEditor, DocumentExplorerViewer, DocumentExplorerEditor, PayrollViewer, PayrollEditor, PropertyViewer, PropertyManager, PropertyAdmin, WebsiteContentEditor, WebsiteContentViewer, WebsiteTechViewer, MenuViewer, MenuEditor, MenuManager, MenuMetaFieldManager, MenuMetaFieldEditor, MenuMetaFieldViewer, StoreDeliveryZoneManager, StoreDeliveryZoneEditor, StoreDeliveryZoneViewer, OrderFulfillmentManager, OrderManager, OrderEditor, OrderViewer, InventoryManager, InventoryEditor, InventoryViewer, PaymentManager, OnboardingManager, FeatureFlagManager, PropertyOwnerMisc, ManagedOwnerMisc, IntegratorMisc, PropertyManagerMisc, FinanceManagerMisc, SupportMisc
23
+ *
24
24
  * @type {string}
25
25
  * @memberof AssignRoleRequestBody
26
26
  */
@@ -37,6 +37,12 @@ export interface AssignRoleRequestBody {
37
37
  * @memberof AssignRoleRequestBody
38
38
  */
39
39
  'principal': AuthorizationRequestPrincipal;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof AssignRoleRequestBody
44
+ */
45
+ 'brandId': string;
40
46
  }
41
47
  export declare const AssignRoleRequestBodyRoleEnum: {
42
48
  readonly OrgViewer: "OrgViewer";
@@ -127,7 +133,7 @@ export interface AssignRoleSuccessResponse {
127
133
  'message': string;
128
134
  }
129
135
  /**
130
- * Request to check if a user is authorized to perform an action(s). If you pass in an array of permissions, you will receive a single allow / deny response (based on an AND of the result for each permission). For a granular response to multiple permissions, call the /authorize/batch endpoint.
136
+ *
131
137
  * @export
132
138
  * @interface AuthenticateAndAuthorizeRequest
133
139
  */
@@ -464,11 +470,17 @@ export interface GetPrincipalRolesSuccessResponseRolesInner {
464
470
  */
465
471
  'policyId': string;
466
472
  /**
467
- * Role name
473
+ *
474
+ * @type {GetPrincipalRolesSuccessResponseRolesInnerRoleName}
475
+ * @memberof GetPrincipalRolesSuccessResponseRolesInner
476
+ */
477
+ 'roleName': GetPrincipalRolesSuccessResponseRolesInnerRoleName;
478
+ /**
479
+ * Policy type
468
480
  * @type {string}
469
481
  * @memberof GetPrincipalRolesSuccessResponseRolesInner
470
482
  */
471
- 'roleName': GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum;
483
+ 'policyType': GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum;
472
484
  /**
473
485
  * Date and time the role was assigned
474
486
  * @type {string}
@@ -512,81 +524,13 @@ export interface GetPrincipalRolesSuccessResponseRolesInner {
512
524
  */
513
525
  'salesChannelId'?: string;
514
526
  }
515
- export declare const GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum: {
516
- readonly OrgViewer: "OrgViewer";
517
- readonly OrgManager: "OrgManager";
518
- readonly OrgAdmin: "OrgAdmin";
519
- readonly BrandViewer: "BrandViewer";
520
- readonly BrandManager: "BrandManager";
521
- readonly BrandAdmin: "BrandAdmin";
522
- readonly StoreViewer: "StoreViewer";
523
- readonly StoreEditor: "StoreEditor";
524
- readonly StoreManager: "StoreManager";
525
- readonly CustomerViewer: "CustomerViewer";
526
- readonly CustomerManager: "CustomerManager";
527
- readonly VoucherViewer: "VoucherViewer";
528
- readonly VoucherEditor: "VoucherEditor";
529
- readonly VoucherManager: "VoucherManager";
530
- readonly VoucherCampaignManager: "VoucherCampaignManager";
531
- readonly VoucherStatisticsViewer: "VoucherStatisticsViewer";
532
- readonly AnalyticsViewer: "AnalyticsViewer";
533
- readonly ReportsViewer: "ReportsViewer";
534
- readonly FinanceViewer: "FinanceViewer";
535
- readonly FinanceManager: "FinanceManager";
536
- readonly TeamViewer: "TeamViewer";
537
- readonly TeamManager: "TeamManager";
538
- readonly TeamAdmin: "TeamAdmin";
539
- readonly TechViewer: "TechViewer";
540
- readonly TechManager: "TechManager";
541
- readonly AppStoreViewer: "AppStoreViewer";
542
- readonly AppStoreManager: "AppStoreManager";
543
- readonly SalesChannelViewer: "SalesChannelViewer";
544
- readonly SalesChannelEditor: "SalesChannelEditor";
545
- readonly SalesChannelManager: "SalesChannelManager";
546
- readonly DeliveryViewer: "DeliveryViewer";
547
- readonly DeliveryManager: "DeliveryManager";
548
- readonly DriverManager: "DriverManager";
549
- readonly AuditViewer: "AuditViewer";
550
- readonly AuditManager: "AuditManager";
551
- readonly AccountsViewer: "AccountsViewer";
552
- readonly AccountsEditor: "AccountsEditor";
553
- readonly DocumentExplorerViewer: "DocumentExplorerViewer";
554
- readonly DocumentExplorerEditor: "DocumentExplorerEditor";
555
- readonly PayrollViewer: "PayrollViewer";
556
- readonly PayrollEditor: "PayrollEditor";
557
- readonly PropertyViewer: "PropertyViewer";
558
- readonly PropertyManager: "PropertyManager";
559
- readonly PropertyAdmin: "PropertyAdmin";
560
- readonly WebsiteContentEditor: "WebsiteContentEditor";
561
- readonly WebsiteContentViewer: "WebsiteContentViewer";
562
- readonly WebsiteTechViewer: "WebsiteTechViewer";
563
- readonly MenuViewer: "MenuViewer";
564
- readonly MenuEditor: "MenuEditor";
565
- readonly MenuManager: "MenuManager";
566
- readonly MenuMetaFieldManager: "MenuMetaFieldManager";
567
- readonly MenuMetaFieldEditor: "MenuMetaFieldEditor";
568
- readonly MenuMetaFieldViewer: "MenuMetaFieldViewer";
569
- readonly StoreDeliveryZoneManager: "StoreDeliveryZoneManager";
570
- readonly StoreDeliveryZoneEditor: "StoreDeliveryZoneEditor";
571
- readonly StoreDeliveryZoneViewer: "StoreDeliveryZoneViewer";
572
- readonly OrderFulfillmentManager: "OrderFulfillmentManager";
573
- readonly OrderManager: "OrderManager";
574
- readonly OrderEditor: "OrderEditor";
575
- readonly OrderViewer: "OrderViewer";
576
- readonly InventoryManager: "InventoryManager";
577
- readonly InventoryEditor: "InventoryEditor";
578
- readonly InventoryViewer: "InventoryViewer";
579
- readonly PaymentManager: "PaymentManager";
580
- readonly OnboardingManager: "OnboardingManager";
581
- readonly FeatureFlagManager: "FeatureFlagManager";
582
- readonly PropertyOwnerMisc: "PropertyOwnerMisc";
583
- readonly ManagedOwnerMisc: "ManagedOwnerMisc";
584
- readonly IntegratorMisc: "IntegratorMisc";
585
- readonly PropertyManagerMisc: "PropertyManagerMisc";
586
- readonly FinanceManagerMisc: "FinanceManagerMisc";
587
- readonly SupportMisc: "SupportMisc";
527
+ export declare const GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum: {
528
+ readonly Main: "Main";
529
+ readonly BrandOverride: "BrandOverride";
530
+ readonly OrgOverride: "OrgOverride";
531
+ readonly Forbidden: "Forbidden";
588
532
  };
589
- export type GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum = typeof GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum[keyof typeof GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum];
533
+ export type GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum = typeof GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum[keyof typeof GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum];
590
534
  export declare const GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum: {
591
535
  readonly Property: "Property";
592
536
  readonly Org: "Org";
@@ -594,6 +538,13 @@ export declare const GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum:
594
538
  readonly SalesChannel: "SalesChannel";
595
539
  };
596
540
  export type GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum = typeof GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum[keyof typeof GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum];
541
+ /**
542
+ * Role name
543
+ * @export
544
+ * @interface GetPrincipalRolesSuccessResponseRolesInnerRoleName
545
+ */
546
+ export interface GetPrincipalRolesSuccessResponseRolesInnerRoleName {
547
+ }
597
548
  /**
598
549
  * Successful roles retrieval response
599
550
  * @export
@@ -1187,7 +1138,7 @@ export type RevokeForbiddenRoleRequestBodyCompensatingRoleEnum = typeof RevokeFo
1187
1138
  */
1188
1139
  export interface RevokeRoleRequestBody {
1189
1140
  /**
1190
- * Role to assign to the principal choose from: OrgViewer, OrgManager, OrgAdmin, BrandViewer, BrandManager, BrandAdmin, StoreViewer, StoreEditor, StoreManager, CustomerViewer, CustomerManager, VoucherViewer, VoucherEditor, VoucherManager, VoucherCampaignManager, VoucherStatisticsViewer, AnalyticsViewer, ReportsViewer, FinanceViewer, FinanceManager, TeamViewer, TeamManager, TeamAdmin, TechViewer, TechManager, AppStoreViewer, AppStoreManager, SalesChannelViewer, SalesChannelEditor, SalesChannelManager, DeliveryViewer, DeliveryManager, DriverManager, AuditViewer, AuditManager, AccountsViewer, AccountsEditor, DocumentExplorerViewer, DocumentExplorerEditor, PayrollViewer, PayrollEditor, PropertyViewer, PropertyManager, PropertyAdmin, WebsiteContentEditor, WebsiteContentViewer, WebsiteTechViewer, MenuViewer, MenuEditor, MenuManager, MenuMetaFieldManager, MenuMetaFieldEditor, MenuMetaFieldViewer, StoreDeliveryZoneManager, StoreDeliveryZoneEditor, StoreDeliveryZoneViewer, OrderFulfillmentManager, OrderManager, OrderEditor, OrderViewer, InventoryManager, InventoryEditor, InventoryViewer, PaymentManager, OnboardingManager, FeatureFlagManager, PropertyOwnerMisc, ManagedOwnerMisc, IntegratorMisc, PropertyManagerMisc, FinanceManagerMisc, SupportMisc
1141
+ *
1191
1142
  * @type {string}
1192
1143
  * @memberof RevokeRoleRequestBody
1193
1144
  */
@@ -1352,11 +1303,11 @@ export declare const AuthenticationApiAxiosParamCreator: (configuration?: Config
1352
1303
  /**
1353
1304
  * Authenticate and authorize a user to perform an action
1354
1305
  * @summary Authenticate and authorize Request
1355
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1306
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1356
1307
  * @param {*} [options] Override http request option.
1357
1308
  * @throws {RequiredError}
1358
1309
  */
1359
- authenticateAndAuthorize: (authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1310
+ authenticateAndAuthorize: (authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1360
1311
  };
1361
1312
  /**
1362
1313
  * AuthenticationApi - functional programming interface
@@ -1366,11 +1317,11 @@ export declare const AuthenticationApiFp: (configuration?: Configuration) => {
1366
1317
  /**
1367
1318
  * Authenticate and authorize a user to perform an action
1368
1319
  * @summary Authenticate and authorize Request
1369
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1320
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1370
1321
  * @param {*} [options] Override http request option.
1371
1322
  * @throws {RequiredError}
1372
1323
  */
1373
- authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthenticateAndAuthorizeResponse>>;
1324
+ authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthenticateAndAuthorizeResponse>>;
1374
1325
  };
1375
1326
  /**
1376
1327
  * AuthenticationApi - factory interface
@@ -1380,11 +1331,11 @@ export declare const AuthenticationApiFactory: (configuration?: Configuration, b
1380
1331
  /**
1381
1332
  * Authenticate and authorize a user to perform an action
1382
1333
  * @summary Authenticate and authorize Request
1383
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1334
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1384
1335
  * @param {*} [options] Override http request option.
1385
1336
  * @throws {RequiredError}
1386
1337
  */
1387
- authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse>;
1338
+ authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse>;
1388
1339
  };
1389
1340
  /**
1390
1341
  * AuthenticationApi - object-oriented interface
@@ -1396,12 +1347,12 @@ export declare class AuthenticationApi extends BaseAPI {
1396
1347
  /**
1397
1348
  * Authenticate and authorize a user to perform an action
1398
1349
  * @summary Authenticate and authorize Request
1399
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1350
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1400
1351
  * @param {*} [options] Override http request option.
1401
1352
  * @throws {RequiredError}
1402
1353
  * @memberof AuthenticationApi
1403
1354
  */
1404
- authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AuthenticateAndAuthorizeResponse, any>>;
1355
+ authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AuthenticateAndAuthorizeResponse, any>>;
1405
1356
  }
1406
1357
  /**
1407
1358
  * AuthorizationApi - axios parameter creator
@@ -1411,11 +1362,11 @@ export declare const AuthorizationApiAxiosParamCreator: (configuration?: Configu
1411
1362
  /**
1412
1363
  * Authenticate and authorize a user to perform an action
1413
1364
  * @summary Authenticate and authorize Request
1414
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1365
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1415
1366
  * @param {*} [options] Override http request option.
1416
1367
  * @throws {RequiredError}
1417
1368
  */
1418
- authenticateAndAuthorize: (authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1369
+ authenticateAndAuthorize: (authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1419
1370
  /**
1420
1371
  * Check if a user is authorized to perform an action
1421
1372
  * @summary Authorize Request
@@ -1433,11 +1384,11 @@ export declare const AuthorizationApiFp: (configuration?: Configuration) => {
1433
1384
  /**
1434
1385
  * Authenticate and authorize a user to perform an action
1435
1386
  * @summary Authenticate and authorize Request
1436
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1387
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1437
1388
  * @param {*} [options] Override http request option.
1438
1389
  * @throws {RequiredError}
1439
1390
  */
1440
- authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthenticateAndAuthorizeResponse>>;
1391
+ authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthenticateAndAuthorizeResponse>>;
1441
1392
  /**
1442
1393
  * Check if a user is authorized to perform an action
1443
1394
  * @summary Authorize Request
@@ -1455,11 +1406,11 @@ export declare const AuthorizationApiFactory: (configuration?: Configuration, ba
1455
1406
  /**
1456
1407
  * Authenticate and authorize a user to perform an action
1457
1408
  * @summary Authenticate and authorize Request
1458
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1409
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1459
1410
  * @param {*} [options] Override http request option.
1460
1411
  * @throws {RequiredError}
1461
1412
  */
1462
- authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse>;
1413
+ authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse>;
1463
1414
  /**
1464
1415
  * Check if a user is authorized to perform an action
1465
1416
  * @summary Authorize Request
@@ -1479,12 +1430,12 @@ export declare class AuthorizationApi extends BaseAPI {
1479
1430
  /**
1480
1431
  * Authenticate and authorize a user to perform an action
1481
1432
  * @summary Authenticate and authorize Request
1482
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1433
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1483
1434
  * @param {*} [options] Override http request option.
1484
1435
  * @throws {RequiredError}
1485
1436
  * @memberof AuthorizationApi
1486
1437
  */
1487
- authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AuthenticateAndAuthorizeResponse, any>>;
1438
+ authenticateAndAuthorize(authenticateAndAuthorizeRequest: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AuthenticateAndAuthorizeResponse, any>>;
1488
1439
  /**
1489
1440
  * Check if a user is authorized to perform an action
1490
1441
  * @summary Authorize Request
package/dist/api.js CHANGED
@@ -48,8 +48,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
48
  });
49
49
  };
50
50
  var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
@@ -84,7 +84,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
84
84
  return to.concat(ar || Array.prototype.slice.call(from));
85
85
  };
86
86
  Object.defineProperty(exports, "__esModule", { value: true });
87
- exports.UserPermissionsApi = exports.UserPermissionsApiFactory = exports.UserPermissionsApiFp = exports.UserPermissionsApiAxiosParamCreator = exports.RoleAssignmentApi = exports.RoleAssignmentApiFactory = exports.RoleAssignmentApiFp = exports.RoleAssignmentApiAxiosParamCreator = exports.PermissionsApi = exports.PermissionsApiFactory = exports.PermissionsApiFp = exports.PermissionsApiAxiosParamCreator = exports.AuthorizationApi = exports.AuthorizationApiFactory = exports.AuthorizationApiFp = exports.AuthorizationApiAxiosParamCreator = exports.AuthenticationApi = exports.AuthenticationApiFactory = exports.AuthenticationApiFp = exports.AuthenticationApiAxiosParamCreator = exports.RevokeRoleRequestBodyRoleEnum = exports.RevokeForbiddenRoleRequestBodyCompensatingRoleEnum = exports.Permissions = exports.GetUserPermissionsSuccessResponseResourcesValuePermissionsEnum = exports.GetUserPermissionsSuccessResponseResourcesValueResourceTypeEnum = exports.GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum = exports.GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum = exports.AuthorizationRequestResourceOneOf3TypeEnum = exports.AuthorizationRequestResourceOneOf2TypeEnum = exports.AuthorizationRequestResourceOneOf1TypeEnum = exports.AuthorizationRequestResourceOneOfTypeEnum = exports.AuthorizationRequestPrincipalTypeEnum = exports.AssignRoleRequestBodyRoleEnum = void 0;
87
+ exports.UserPermissionsApi = exports.UserPermissionsApiFactory = exports.UserPermissionsApiFp = exports.UserPermissionsApiAxiosParamCreator = exports.RoleAssignmentApi = exports.RoleAssignmentApiFactory = exports.RoleAssignmentApiFp = exports.RoleAssignmentApiAxiosParamCreator = exports.PermissionsApi = exports.PermissionsApiFactory = exports.PermissionsApiFp = exports.PermissionsApiAxiosParamCreator = exports.AuthorizationApi = exports.AuthorizationApiFactory = exports.AuthorizationApiFp = exports.AuthorizationApiAxiosParamCreator = exports.AuthenticationApi = exports.AuthenticationApiFactory = exports.AuthenticationApiFp = exports.AuthenticationApiAxiosParamCreator = exports.RevokeRoleRequestBodyRoleEnum = exports.RevokeForbiddenRoleRequestBodyCompensatingRoleEnum = exports.Permissions = exports.GetUserPermissionsSuccessResponseResourcesValuePermissionsEnum = exports.GetUserPermissionsSuccessResponseResourcesValueResourceTypeEnum = exports.GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum = exports.GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum = exports.AuthorizationRequestResourceOneOf3TypeEnum = exports.AuthorizationRequestResourceOneOf2TypeEnum = exports.AuthorizationRequestResourceOneOf1TypeEnum = exports.AuthorizationRequestResourceOneOfTypeEnum = exports.AuthorizationRequestPrincipalTypeEnum = exports.AssignRoleRequestBodyRoleEnum = void 0;
88
88
  var axios_1 = require("axios");
89
89
  // Some imports not used depending on template conditions
90
90
  // @ts-ignore
@@ -181,79 +181,11 @@ exports.AuthorizationRequestResourceOneOf2TypeEnum = {
181
181
  exports.AuthorizationRequestResourceOneOf3TypeEnum = {
182
182
  SalesChannel: 'SalesChannel'
183
183
  };
184
- exports.GetPrincipalRolesSuccessResponseRolesInnerRoleNameEnum = {
185
- OrgViewer: 'OrgViewer',
186
- OrgManager: 'OrgManager',
187
- OrgAdmin: 'OrgAdmin',
188
- BrandViewer: 'BrandViewer',
189
- BrandManager: 'BrandManager',
190
- BrandAdmin: 'BrandAdmin',
191
- StoreViewer: 'StoreViewer',
192
- StoreEditor: 'StoreEditor',
193
- StoreManager: 'StoreManager',
194
- CustomerViewer: 'CustomerViewer',
195
- CustomerManager: 'CustomerManager',
196
- VoucherViewer: 'VoucherViewer',
197
- VoucherEditor: 'VoucherEditor',
198
- VoucherManager: 'VoucherManager',
199
- VoucherCampaignManager: 'VoucherCampaignManager',
200
- VoucherStatisticsViewer: 'VoucherStatisticsViewer',
201
- AnalyticsViewer: 'AnalyticsViewer',
202
- ReportsViewer: 'ReportsViewer',
203
- FinanceViewer: 'FinanceViewer',
204
- FinanceManager: 'FinanceManager',
205
- TeamViewer: 'TeamViewer',
206
- TeamManager: 'TeamManager',
207
- TeamAdmin: 'TeamAdmin',
208
- TechViewer: 'TechViewer',
209
- TechManager: 'TechManager',
210
- AppStoreViewer: 'AppStoreViewer',
211
- AppStoreManager: 'AppStoreManager',
212
- SalesChannelViewer: 'SalesChannelViewer',
213
- SalesChannelEditor: 'SalesChannelEditor',
214
- SalesChannelManager: 'SalesChannelManager',
215
- DeliveryViewer: 'DeliveryViewer',
216
- DeliveryManager: 'DeliveryManager',
217
- DriverManager: 'DriverManager',
218
- AuditViewer: 'AuditViewer',
219
- AuditManager: 'AuditManager',
220
- AccountsViewer: 'AccountsViewer',
221
- AccountsEditor: 'AccountsEditor',
222
- DocumentExplorerViewer: 'DocumentExplorerViewer',
223
- DocumentExplorerEditor: 'DocumentExplorerEditor',
224
- PayrollViewer: 'PayrollViewer',
225
- PayrollEditor: 'PayrollEditor',
226
- PropertyViewer: 'PropertyViewer',
227
- PropertyManager: 'PropertyManager',
228
- PropertyAdmin: 'PropertyAdmin',
229
- WebsiteContentEditor: 'WebsiteContentEditor',
230
- WebsiteContentViewer: 'WebsiteContentViewer',
231
- WebsiteTechViewer: 'WebsiteTechViewer',
232
- MenuViewer: 'MenuViewer',
233
- MenuEditor: 'MenuEditor',
234
- MenuManager: 'MenuManager',
235
- MenuMetaFieldManager: 'MenuMetaFieldManager',
236
- MenuMetaFieldEditor: 'MenuMetaFieldEditor',
237
- MenuMetaFieldViewer: 'MenuMetaFieldViewer',
238
- StoreDeliveryZoneManager: 'StoreDeliveryZoneManager',
239
- StoreDeliveryZoneEditor: 'StoreDeliveryZoneEditor',
240
- StoreDeliveryZoneViewer: 'StoreDeliveryZoneViewer',
241
- OrderFulfillmentManager: 'OrderFulfillmentManager',
242
- OrderManager: 'OrderManager',
243
- OrderEditor: 'OrderEditor',
244
- OrderViewer: 'OrderViewer',
245
- InventoryManager: 'InventoryManager',
246
- InventoryEditor: 'InventoryEditor',
247
- InventoryViewer: 'InventoryViewer',
248
- PaymentManager: 'PaymentManager',
249
- OnboardingManager: 'OnboardingManager',
250
- FeatureFlagManager: 'FeatureFlagManager',
251
- PropertyOwnerMisc: 'PropertyOwnerMisc',
252
- ManagedOwnerMisc: 'ManagedOwnerMisc',
253
- IntegratorMisc: 'IntegratorMisc',
254
- PropertyManagerMisc: 'PropertyManagerMisc',
255
- FinanceManagerMisc: 'FinanceManagerMisc',
256
- SupportMisc: 'SupportMisc'
184
+ exports.GetPrincipalRolesSuccessResponseRolesInnerPolicyTypeEnum = {
185
+ Main: 'Main',
186
+ BrandOverride: 'BrandOverride',
187
+ OrgOverride: 'OrgOverride',
188
+ Forbidden: 'Forbidden'
257
189
  };
258
190
  exports.GetPrincipalRolesSuccessResponseRolesInnerResourceTypeEnum = {
259
191
  Property: 'Property',
@@ -816,7 +748,7 @@ var AuthenticationApiAxiosParamCreator = function (configuration) {
816
748
  /**
817
749
  * Authenticate and authorize a user to perform an action
818
750
  * @summary Authenticate and authorize Request
819
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
751
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
820
752
  * @param {*} [options] Override http request option.
821
753
  * @throws {RequiredError}
822
754
  */
@@ -831,6 +763,8 @@ var AuthenticationApiAxiosParamCreator = function (configuration) {
831
763
  return __generator(this, function (_a) {
832
764
  switch (_a.label) {
833
765
  case 0:
766
+ // verify required parameter 'authenticateAndAuthorizeRequest' is not null or undefined
767
+ (0, common_1.assertParamExists)('authenticateAndAuthorize', 'authenticateAndAuthorizeRequest', authenticateAndAuthorizeRequest);
834
768
  localVarPath = "/authenticateAndAuthorize";
835
769
  localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
836
770
  if (configuration) {
@@ -870,7 +804,7 @@ var AuthenticationApiFp = function (configuration) {
870
804
  /**
871
805
  * Authenticate and authorize a user to perform an action
872
806
  * @summary Authenticate and authorize Request
873
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
807
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
874
808
  * @param {*} [options] Override http request option.
875
809
  * @throws {RequiredError}
876
810
  */
@@ -903,7 +837,7 @@ var AuthenticationApiFactory = function (configuration, basePath, axios) {
903
837
  /**
904
838
  * Authenticate and authorize a user to perform an action
905
839
  * @summary Authenticate and authorize Request
906
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
840
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
907
841
  * @param {*} [options] Override http request option.
908
842
  * @throws {RequiredError}
909
843
  */
@@ -927,7 +861,7 @@ var AuthenticationApi = /** @class */ (function (_super) {
927
861
  /**
928
862
  * Authenticate and authorize a user to perform an action
929
863
  * @summary Authenticate and authorize Request
930
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
864
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
931
865
  * @param {*} [options] Override http request option.
932
866
  * @throws {RequiredError}
933
867
  * @memberof AuthenticationApi
@@ -949,7 +883,7 @@ var AuthorizationApiAxiosParamCreator = function (configuration) {
949
883
  /**
950
884
  * Authenticate and authorize a user to perform an action
951
885
  * @summary Authenticate and authorize Request
952
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
886
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
953
887
  * @param {*} [options] Override http request option.
954
888
  * @throws {RequiredError}
955
889
  */
@@ -964,6 +898,8 @@ var AuthorizationApiAxiosParamCreator = function (configuration) {
964
898
  return __generator(this, function (_a) {
965
899
  switch (_a.label) {
966
900
  case 0:
901
+ // verify required parameter 'authenticateAndAuthorizeRequest' is not null or undefined
902
+ (0, common_1.assertParamExists)('authenticateAndAuthorize', 'authenticateAndAuthorizeRequest', authenticateAndAuthorizeRequest);
967
903
  localVarPath = "/authenticateAndAuthorize";
968
904
  localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
969
905
  if (configuration) {
@@ -1047,7 +983,7 @@ var AuthorizationApiFp = function (configuration) {
1047
983
  /**
1048
984
  * Authenticate and authorize a user to perform an action
1049
985
  * @summary Authenticate and authorize Request
1050
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
986
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1051
987
  * @param {*} [options] Override http request option.
1052
988
  * @throws {RequiredError}
1053
989
  */
@@ -1103,7 +1039,7 @@ var AuthorizationApiFactory = function (configuration, basePath, axios) {
1103
1039
  /**
1104
1040
  * Authenticate and authorize a user to perform an action
1105
1041
  * @summary Authenticate and authorize Request
1106
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1042
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1107
1043
  * @param {*} [options] Override http request option.
1108
1044
  * @throws {RequiredError}
1109
1045
  */
@@ -1137,7 +1073,7 @@ var AuthorizationApi = /** @class */ (function (_super) {
1137
1073
  /**
1138
1074
  * Authenticate and authorize a user to perform an action
1139
1075
  * @summary Authenticate and authorize Request
1140
- * @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
1076
+ * @param {AuthenticateAndAuthorizeRequest} authenticateAndAuthorizeRequest
1141
1077
  * @param {*} [options] Override http request option.
1142
1078
  * @throws {RequiredError}
1143
1079
  * @memberof AuthorizationApi
package/dist/common.d.ts CHANGED
@@ -62,4 +62,4 @@ export declare const toPathString: (url: URL) => string;
62
62
  *
63
63
  * @export
64
64
  */
65
- export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
65
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
package/dist/common.js CHANGED
@@ -33,8 +33,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  });
34
34
  };
35
35
  var __generator = (this && this.__generator) || function (thisArg, body) {
36
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
37
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
36
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
38
  function verb(n) { return function (v) { return step([n, v]); }; }
39
39
  function step(op) {
40
40
  if (f) throw new TypeError("Generator is already executing.");
@@ -36,7 +36,7 @@ var Configuration = /** @class */ (function () {
36
36
  this.serverIndex = param.serverIndex;
37
37
  var extraHeaders = param.useDefaultUserAgent ? {} : {
38
38
  headers: {
39
- "user-agent": "Flipdish authorization typescript SDK / 0.0.5-rc.1756734017"
39
+ "user-agent": "Flipdish authorization typescript SDK / 0.1.0"
40
40
  }
41
41
  };
42
42
  this.baseOptions = __assign(__assign({}, extraHeaders), param.baseOptions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flipdish/authorization",
3
- "version": "0.0.5-rc.1756734017",
3
+ "version": "0.1.0",
4
4
  "description": "OpenAPI client for @flipdish/authorization",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "repository": {