@onylab/common-api 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/common-api.d.ts
CHANGED
|
@@ -1046,6 +1046,22 @@ declare module "api/hubrise/model/callback/HubriseEventType" {
|
|
|
1046
1046
|
UPDATE = "update"
|
|
1047
1047
|
}
|
|
1048
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
|
+
}
|
|
1049
1065
|
declare module "api/hubrise/service/HubriseApiContract" {
|
|
1050
1066
|
import { HubriseOrderContract } from "api/hubrise/model/order/HubriseOrderContract";
|
|
1051
1067
|
import { HubriseOrderStatus } from "api/hubrise/model/order/HubriseOrderStatus";
|
|
@@ -1057,8 +1073,10 @@ declare module "api/hubrise/service/HubriseApiContract" {
|
|
|
1057
1073
|
import { HubriseAuthContract } from "api/hubrise/model/account/HubriseAuthContract";
|
|
1058
1074
|
import { HubriseResourceType } from "api/hubrise/model/callback/HubriseResourceType";
|
|
1059
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";
|
|
1060
1078
|
export interface HubriseApiContract {
|
|
1061
|
-
authorize(clientId: string, redirect: string): Promise<string>;
|
|
1079
|
+
authorize(clientId: string, access: 'account' | 'location', rights: Record<HubriseAuthResource, HubriseRightAccess>, redirect: string): Promise<string>;
|
|
1062
1080
|
getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract>;
|
|
1063
1081
|
getUser(): Promise<HubriseUserContract>;
|
|
1064
1082
|
getLocations(): Promise<HubriseLocationContract[]>;
|
|
@@ -1161,13 +1179,15 @@ declare module "api/hubrise/service/HubriseApi" {
|
|
|
1161
1179
|
import { HubriseAuthContract } from "api/hubrise/model/account/HubriseAuthContract";
|
|
1162
1180
|
import { HubriseResourceType } from "api/hubrise/model/callback/HubriseResourceType";
|
|
1163
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";
|
|
1164
1184
|
export class HubriseApi implements HubriseApiContract {
|
|
1165
1185
|
static readonly BASE_URL: string;
|
|
1166
1186
|
static readonly BASE_AUTH_URL: string;
|
|
1167
1187
|
private static readonly TIMEOUT;
|
|
1168
1188
|
private readonly token;
|
|
1169
1189
|
constructor(token: string);
|
|
1170
|
-
authorize(clientId: string, redirect: string): Promise<string>;
|
|
1190
|
+
authorize(clientId: string, access: 'account' | 'location', rights: Record<HubriseAuthResource, HubriseRightAccess>, redirect: string): Promise<string>;
|
|
1171
1191
|
getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract>;
|
|
1172
1192
|
getUser(): Promise<HubriseUserContract>;
|
|
1173
1193
|
getLocations(): Promise<HubriseLocationContract[]>;
|
|
@@ -1198,11 +1218,15 @@ declare module "api/index" {
|
|
|
1198
1218
|
export * from "api/hubrise/service/HubriseApi";
|
|
1199
1219
|
export * from "api/hubrise/model/account/HubriseAccountContract";
|
|
1200
1220
|
export * from "api/hubrise/model/account/HubriseAuthContract";
|
|
1221
|
+
export * from "api/hubrise/model/account/HubriseAuthResource";
|
|
1222
|
+
export * from "api/hubrise/model/account/HubriseRightAccess";
|
|
1201
1223
|
export * from "api/hubrise/model/common/HubriseCurrencyCode";
|
|
1202
1224
|
export * from "api/hubrise/model/common/HubriseCustomFieldsContract";
|
|
1203
1225
|
export * from "api/hubrise/model/common/HubriseLocale";
|
|
1204
1226
|
export * from "api/hubrise/model/common/HubriseTimezoneContract";
|
|
1205
1227
|
export * from "api/hubrise/model/common/HubriseTimezoneId";
|
|
1228
|
+
export * from "api/hubrise/model/callback/HubriseEventType";
|
|
1229
|
+
export * from "api/hubrise/model/callback/HubriseResourceType";
|
|
1206
1230
|
export * from "api/hubrise/model/customer/HubriseCustomerContract";
|
|
1207
1231
|
export * from "api/hubrise/model/customer/HubriseCustomerListContract";
|
|
1208
1232
|
export * from "api/hubrise/model/location/HubriseLocationContract";
|