@onylab/common-api 2.1.33 → 2.1.35
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
|
@@ -1252,6 +1252,7 @@ declare module "api/hubrise/model/callback/HubriseResourceType" {
|
|
|
1252
1252
|
export enum HubriseResourceType {
|
|
1253
1253
|
CATALOG = "catalog",
|
|
1254
1254
|
CUSTOMER = "customer",
|
|
1255
|
+
CUSTOMER_LIST = "customer_list",
|
|
1255
1256
|
DELIVERY = "delivery",
|
|
1256
1257
|
INVENTORY = "inventory",
|
|
1257
1258
|
LOCATION = "location",
|
|
@@ -1289,6 +1290,14 @@ declare module "api/hubrise/model/auth/HubriseAccessLevel" {
|
|
|
1289
1290
|
PROFILE = "profile"
|
|
1290
1291
|
}
|
|
1291
1292
|
}
|
|
1293
|
+
declare module "api/hubrise/model/callback/HubriseCallbackContract" {
|
|
1294
|
+
import { HubriseResourceType } from "api/hubrise/model/callback/HubriseResourceType";
|
|
1295
|
+
import { HubriseEventType } from "api/hubrise/model/callback/HubriseEventType";
|
|
1296
|
+
export interface HubriseCallbackContract {
|
|
1297
|
+
url: string;
|
|
1298
|
+
events: Partial<Record<HubriseResourceType, HubriseEventType[]>>;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1292
1301
|
declare module "api/hubrise/service/HubriseApiContract" {
|
|
1293
1302
|
import { HubriseOrderContract } from "api/hubrise/model/order/HubriseOrderContract";
|
|
1294
1303
|
import { HubriseOrderStatus } from "api/hubrise/model/order/HubriseOrderStatus";
|
|
@@ -1304,8 +1313,9 @@ declare module "api/hubrise/service/HubriseApiContract" {
|
|
|
1304
1313
|
import { HubriseRightAccess } from "api/hubrise/model/auth/HubriseRightAccess";
|
|
1305
1314
|
import { HubriseAccountContract } from "api/hubrise/model/account/HubriseAccountContract";
|
|
1306
1315
|
import { HubriseAccessLevel } from "api/hubrise/model/auth/HubriseAccessLevel";
|
|
1316
|
+
import { HubriseCallbackContract } from "api/hubrise/model/callback/HubriseCallbackContract";
|
|
1307
1317
|
export interface HubriseApiContract {
|
|
1308
|
-
authorize(name: string, clientId: string, redirect: string, accessLevel: HubriseAccessLevel, rights?: Record<HubriseAuthResource, HubriseRightAccess
|
|
1318
|
+
authorize(name: string, clientId: string, redirect: string, accessLevel: HubriseAccessLevel, rights?: Partial<Record<HubriseAuthResource, HubriseRightAccess>>, profile?: boolean, appInstanceId?: string): Promise<string>;
|
|
1309
1319
|
getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract>;
|
|
1310
1320
|
getUser(): Promise<HubriseUserContract>;
|
|
1311
1321
|
getAccount(): Promise<HubriseAccountContract>;
|
|
@@ -1322,7 +1332,9 @@ declare module "api/hubrise/service/HubriseApiContract" {
|
|
|
1322
1332
|
setOrderStatus(hubriseLocationId: string, hubriseOrderId: string, status: HubriseOrderStatus): Promise<void>;
|
|
1323
1333
|
getCatalog(hubriseCatalogId: string): Promise<HubriseMenuCatalogContract>;
|
|
1324
1334
|
getCatalogs(hubriseLocationId: string): Promise<HubriseMenuCatalogContract[]>;
|
|
1325
|
-
|
|
1335
|
+
updateWebhooks(url: string, events: Partial<Record<HubriseResourceType, HubriseEventType[]>>): Promise<void>;
|
|
1336
|
+
getWebhooks(): Promise<HubriseCallbackContract>;
|
|
1337
|
+
deleteWebhooks(): Promise<void>;
|
|
1326
1338
|
}
|
|
1327
1339
|
}
|
|
1328
1340
|
declare module "exception/ExceptionContract" {
|
|
@@ -1442,13 +1454,14 @@ declare module "api/hubrise/service/HubriseApi" {
|
|
|
1442
1454
|
import { HubriseAccountContract } from "api/hubrise/model/account/HubriseAccountContract";
|
|
1443
1455
|
import { HubriseAccessTokenContract } from "api/hubrise/model/auth/HubriseAccessTokenContract";
|
|
1444
1456
|
import { HubriseAccessLevel } from "api/hubrise/model/auth/HubriseAccessLevel";
|
|
1457
|
+
import { HubriseCallbackContract } from "api/hubrise/model/callback/HubriseCallbackContract";
|
|
1445
1458
|
export class HubriseApi implements HubriseApiContract {
|
|
1446
1459
|
static readonly BASE_URL: string;
|
|
1447
1460
|
static readonly BASE_AUTH_URL: string;
|
|
1448
1461
|
private static readonly TIMEOUT;
|
|
1449
1462
|
private readonly accessToken;
|
|
1450
1463
|
constructor(accessToken?: HubriseAccessTokenContract);
|
|
1451
|
-
authorize(name: string, clientId: string, redirect: string, accessLevel: HubriseAccessLevel, rights?: Record<HubriseAuthResource, HubriseRightAccess
|
|
1464
|
+
authorize(name: string, clientId: string, redirect: string, accessLevel: HubriseAccessLevel, rights?: Partial<Record<HubriseAuthResource, HubriseRightAccess>>, profile?: boolean, appInstanceId?: string): Promise<string>;
|
|
1452
1465
|
getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract>;
|
|
1453
1466
|
getUser(): Promise<HubriseUserContract>;
|
|
1454
1467
|
getAccount(): Promise<HubriseAccountContract>;
|
|
@@ -1465,7 +1478,9 @@ declare module "api/hubrise/service/HubriseApi" {
|
|
|
1465
1478
|
setOrderStatus(hubriseLocationId: string, hubriseOrderId: string, status: HubriseOrderStatus): Promise<void>;
|
|
1466
1479
|
getCatalog(hubriseCatalogId: string): Promise<HubriseMenuCatalogContract>;
|
|
1467
1480
|
getCatalogs(hubriseLocationId: string): Promise<HubriseMenuCatalogContract[]>;
|
|
1468
|
-
|
|
1481
|
+
updateWebhooks(url: string, events: Partial<Record<HubriseResourceType, HubriseEventType[]>>): Promise<void>;
|
|
1482
|
+
getWebhooks(): Promise<HubriseCallbackContract>;
|
|
1483
|
+
deleteWebhooks(): Promise<void>;
|
|
1469
1484
|
}
|
|
1470
1485
|
}
|
|
1471
1486
|
declare module "api/hubrise/model/common/HubriseLanguageCode" {
|
|
@@ -1478,6 +1493,21 @@ declare module "api/hubrise/model/common/HubriseLanguageCode" {
|
|
|
1478
1493
|
PT = "pt"
|
|
1479
1494
|
}
|
|
1480
1495
|
}
|
|
1496
|
+
declare module "api/hubrise/model/callback/HubriseEventContract" {
|
|
1497
|
+
import { HubriseResourceType } from "api/hubrise/model/callback/HubriseResourceType";
|
|
1498
|
+
import { HubriseEventType } from "api/hubrise/model/callback/HubriseEventType";
|
|
1499
|
+
export interface HubriseEventContract<AssetContract> {
|
|
1500
|
+
id: string;
|
|
1501
|
+
resource_type: HubriseResourceType;
|
|
1502
|
+
event_type: HubriseEventType;
|
|
1503
|
+
location_id?: string;
|
|
1504
|
+
customer_id?: string;
|
|
1505
|
+
customer_list_id?: string;
|
|
1506
|
+
previous_state: AssetContract;
|
|
1507
|
+
new_state: AssetContract;
|
|
1508
|
+
created_at: string;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1481
1511
|
declare module "api/hubrise/model/menu/HubriseMenuImageContract" {
|
|
1482
1512
|
export interface HubriseMenuImageContract {
|
|
1483
1513
|
id: string;
|
|
@@ -1688,6 +1718,8 @@ declare module "api/web" {
|
|
|
1688
1718
|
export * from "api/hubrise/model/common/HubriseLocale";
|
|
1689
1719
|
export * from "api/hubrise/model/common/HubriseTimezoneContract";
|
|
1690
1720
|
export * from "api/hubrise/model/common/HubriseTimezoneId";
|
|
1721
|
+
export * from "api/hubrise/model/callback/HubriseCallbackContract";
|
|
1722
|
+
export * from "api/hubrise/model/callback/HubriseEventContract";
|
|
1691
1723
|
export * from "api/hubrise/model/callback/HubriseEventType";
|
|
1692
1724
|
export * from "api/hubrise/model/callback/HubriseResourceType";
|
|
1693
1725
|
export * from "api/hubrise/model/customer/HubriseCustomerContract";
|
|
@@ -1934,7 +1966,9 @@ declare module "mockup/HubriseApiMockup" {
|
|
|
1934
1966
|
static setOrderStatus(times?: number): void;
|
|
1935
1967
|
static getCatalog(times?: number): void;
|
|
1936
1968
|
static getCatalogs(times?: number): void;
|
|
1937
|
-
static
|
|
1969
|
+
static updateWebhooks(times?: number): void;
|
|
1970
|
+
static getWebhooks(times?: number): void;
|
|
1971
|
+
static deleteWebhooks(times?: number): void;
|
|
1938
1972
|
}
|
|
1939
1973
|
}
|
|
1940
1974
|
declare module "mockup/index" {
|