@onylab/common-api 2.0.2 → 2.0.4

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.
@@ -1018,12 +1018,13 @@ declare module "api/hubrise/model/account/HubriseAuthContract" {
1018
1018
  access_token: string;
1019
1019
  token_type: 'Bearer';
1020
1020
  account_id: string;
1021
- location_id: string;
1022
- catalog_id: string;
1023
- customer_list_id: string;
1024
1021
  account_name: string;
1022
+ user_id: string;
1023
+ location_id: string;
1025
1024
  location_name: string;
1025
+ catalog_id: string;
1026
1026
  catalog_name: string;
1027
+ customer_list_id: string;
1027
1028
  customer_list_name: string;
1028
1029
  }
1029
1030
  }
@@ -1045,6 +1046,22 @@ declare module "api/hubrise/model/callback/HubriseEventType" {
1045
1046
  UPDATE = "update"
1046
1047
  }
1047
1048
  }
1049
+ declare module "api/hubrise/model/account/HubriseAuthResource" {
1050
+ export enum HubriseAuthResource {
1051
+ ORDERS = "orders",
1052
+ CUSTOMER_LIST = "customer_list",
1053
+ CATALOG = "catalog",
1054
+ INVENTORY = "inventory",
1055
+ ALL_CUSTOMER_LISTS = "all_customer_lists",
1056
+ ALL_CATALOG_LISTS = "all_catalogs"
1057
+ }
1058
+ }
1059
+ declare module "api/hubrise/model/account/HubriseRightAccess" {
1060
+ export enum HubriseRightAccess {
1061
+ READ = "read",
1062
+ WRITE = "write"
1063
+ }
1064
+ }
1048
1065
  declare module "api/hubrise/service/HubriseApiContract" {
1049
1066
  import { HubriseOrderContract } from "api/hubrise/model/order/HubriseOrderContract";
1050
1067
  import { HubriseOrderStatus } from "api/hubrise/model/order/HubriseOrderStatus";
@@ -1056,8 +1073,10 @@ declare module "api/hubrise/service/HubriseApiContract" {
1056
1073
  import { HubriseAuthContract } from "api/hubrise/model/account/HubriseAuthContract";
1057
1074
  import { HubriseResourceType } from "api/hubrise/model/callback/HubriseResourceType";
1058
1075
  import { HubriseEventType } from "api/hubrise/model/callback/HubriseEventType";
1076
+ import { HubriseAuthResource } from "api/hubrise/model/account/HubriseAuthResource";
1077
+ import { HubriseRightAccess } from "api/hubrise/model/account/HubriseRightAccess";
1059
1078
  export interface HubriseApiContract {
1060
- authorize(clientId: string, redirect: string): Promise<string>;
1079
+ authorize(clientId: string, access: 'account' | 'location', rights: Record<HubriseAuthResource, HubriseRightAccess>, redirect: string): Promise<string>;
1061
1080
  getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract>;
1062
1081
  getUser(): Promise<HubriseUserContract>;
1063
1082
  getLocations(): Promise<HubriseLocationContract[]>;
@@ -1160,13 +1179,15 @@ declare module "api/hubrise/service/HubriseApi" {
1160
1179
  import { HubriseAuthContract } from "api/hubrise/model/account/HubriseAuthContract";
1161
1180
  import { HubriseResourceType } from "api/hubrise/model/callback/HubriseResourceType";
1162
1181
  import { HubriseEventType } from "api/hubrise/model/callback/HubriseEventType";
1182
+ import { HubriseAuthResource } from "api/hubrise/model/account/HubriseAuthResource";
1183
+ import { HubriseRightAccess } from "api/hubrise/model/account/HubriseRightAccess";
1163
1184
  export class HubriseApi implements HubriseApiContract {
1164
1185
  static readonly BASE_URL: string;
1165
1186
  static readonly BASE_AUTH_URL: string;
1166
1187
  private static readonly TIMEOUT;
1167
1188
  private readonly token;
1168
1189
  constructor(token: string);
1169
- authorize(clientId: string, redirect: string): Promise<string>;
1190
+ authorize(clientId: string, access: 'account' | 'location', rights: Record<HubriseAuthResource, HubriseRightAccess>, redirect: string): Promise<string>;
1170
1191
  getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract>;
1171
1192
  getUser(): Promise<HubriseUserContract>;
1172
1193
  getLocations(): Promise<HubriseLocationContract[]>;