@onylab/common-api 2.1.13 → 2.1.15
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/data/mockup/api/hubrise/location.json +13 -0
- package/dist/common-api.d.ts +39 -16
- package/dist/common-api.node.min.js +1 -1
- package/dist/common-api.node.min.js.map +1 -1
- package/dist/common-api.web.min.js +1 -1
- package/dist/common-api.web.min.js.map +1 -1
- package/dist/data/mockup/api/hubrise/location.json +13 -0
- package/package.json +1 -1
package/dist/common-api.d.ts
CHANGED
|
@@ -1221,8 +1221,9 @@ declare module "api/hubrise/model/user/HubriseUserContract" {
|
|
|
1221
1221
|
locales: HubriseLocale[];
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
declare module "api/hubrise/model/
|
|
1224
|
+
declare module "api/hubrise/model/auth/HubriseAuthContract" {
|
|
1225
1225
|
export interface HubriseAuthContract {
|
|
1226
|
+
app_instance_id?: string;
|
|
1226
1227
|
access_token: string;
|
|
1227
1228
|
token_type: 'Bearer';
|
|
1228
1229
|
account_id: string;
|
|
@@ -1254,7 +1255,7 @@ declare module "api/hubrise/model/callback/HubriseEventType" {
|
|
|
1254
1255
|
UPDATE = "update"
|
|
1255
1256
|
}
|
|
1256
1257
|
}
|
|
1257
|
-
declare module "api/hubrise/model/
|
|
1258
|
+
declare module "api/hubrise/model/auth/HubriseAuthResource" {
|
|
1258
1259
|
export enum HubriseAuthResource {
|
|
1259
1260
|
ORDERS = "orders",
|
|
1260
1261
|
CUSTOMER_LIST = "customer_list",
|
|
@@ -1264,12 +1265,19 @@ declare module "api/hubrise/model/account/HubriseAuthResource" {
|
|
|
1264
1265
|
ALL_CATALOG_LISTS = "all_catalogs"
|
|
1265
1266
|
}
|
|
1266
1267
|
}
|
|
1267
|
-
declare module "api/hubrise/model/
|
|
1268
|
+
declare module "api/hubrise/model/auth/HubriseRightAccess" {
|
|
1268
1269
|
export enum HubriseRightAccess {
|
|
1269
1270
|
READ = "read",
|
|
1270
1271
|
WRITE = "write"
|
|
1271
1272
|
}
|
|
1272
1273
|
}
|
|
1274
|
+
declare module "api/hubrise/model/auth/HubriseAccessLevel" {
|
|
1275
|
+
export enum HubriseAccessLevel {
|
|
1276
|
+
ACCOUNT = "account",
|
|
1277
|
+
LOCATION = "location",
|
|
1278
|
+
PROFILE = "profile"
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1273
1281
|
declare module "api/hubrise/service/HubriseApiContract" {
|
|
1274
1282
|
import { HubriseOrderContract } from "api/hubrise/model/order/HubriseOrderContract";
|
|
1275
1283
|
import { HubriseOrderStatus } from "api/hubrise/model/order/HubriseOrderStatus";
|
|
@@ -1278,18 +1286,20 @@ declare module "api/hubrise/service/HubriseApiContract" {
|
|
|
1278
1286
|
import { HubriseCustomerListContract } from "api/hubrise/model/customer/HubriseCustomerListContract";
|
|
1279
1287
|
import { HubriseLocationContract } from "api/hubrise/model/location/HubriseLocationContract";
|
|
1280
1288
|
import { HubriseUserContract } from "api/hubrise/model/user/HubriseUserContract";
|
|
1281
|
-
import { HubriseAuthContract } from "api/hubrise/model/
|
|
1289
|
+
import { HubriseAuthContract } from "api/hubrise/model/auth/HubriseAuthContract";
|
|
1282
1290
|
import { HubriseResourceType } from "api/hubrise/model/callback/HubriseResourceType";
|
|
1283
1291
|
import { HubriseEventType } from "api/hubrise/model/callback/HubriseEventType";
|
|
1284
|
-
import { HubriseAuthResource } from "api/hubrise/model/
|
|
1285
|
-
import { HubriseRightAccess } from "api/hubrise/model/
|
|
1292
|
+
import { HubriseAuthResource } from "api/hubrise/model/auth/HubriseAuthResource";
|
|
1293
|
+
import { HubriseRightAccess } from "api/hubrise/model/auth/HubriseRightAccess";
|
|
1286
1294
|
import { HubriseAccountContract } from "api/hubrise/model/account/HubriseAccountContract";
|
|
1295
|
+
import { HubriseAccessLevel } from "api/hubrise/model/auth/HubriseAccessLevel";
|
|
1287
1296
|
export interface HubriseApiContract {
|
|
1288
|
-
authorize(name: string, clientId: string,
|
|
1297
|
+
authorize(name: string, clientId: string, redirect: string, accessLevel: HubriseAccessLevel, rights?: Record<HubriseAuthResource, HubriseRightAccess>, profile?: boolean, appInstanceId?: string): Promise<string>;
|
|
1289
1298
|
getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract>;
|
|
1290
1299
|
getUser(): Promise<HubriseUserContract>;
|
|
1291
1300
|
getAccount(): Promise<HubriseAccountContract>;
|
|
1292
1301
|
getLocations(): Promise<HubriseLocationContract[]>;
|
|
1302
|
+
getLocation(hubriseLocationId?: string): Promise<HubriseLocationContract>;
|
|
1293
1303
|
createCustomer(hubriseCustomerListId: string, hubriseCustomer: HubriseCustomerContract): Promise<HubriseCustomerContract>;
|
|
1294
1304
|
getCustomer(hubriseCustomerListId: string, hubriseCustomerId: string): Promise<HubriseCustomerContract>;
|
|
1295
1305
|
getCustomers(hubriseCustomerListId: string, reference?: string, email?: string, phone?: string): Promise<HubriseCustomerContract[]>;
|
|
@@ -1387,6 +1397,13 @@ declare module "util/ValidatorUtil" {
|
|
|
1387
1397
|
static isISODate(str: string): boolean;
|
|
1388
1398
|
}
|
|
1389
1399
|
}
|
|
1400
|
+
declare module "api/hubrise/model/auth/HubriseAccessTokenContract" {
|
|
1401
|
+
import { HubriseAccessLevel } from "api/hubrise/model/auth/HubriseAccessLevel";
|
|
1402
|
+
export interface HubriseAccessTokenContract {
|
|
1403
|
+
access: HubriseAccessLevel;
|
|
1404
|
+
token: string;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1390
1407
|
declare module "api/hubrise/service/HubriseApi" {
|
|
1391
1408
|
import { HubriseApiContract } from "api/hubrise/service/HubriseApiContract";
|
|
1392
1409
|
import { HubriseOrderContract } from "api/hubrise/model/order/HubriseOrderContract";
|
|
@@ -1396,23 +1413,26 @@ declare module "api/hubrise/service/HubriseApi" {
|
|
|
1396
1413
|
import { HubriseCustomerListContract } from "api/hubrise/model/customer/HubriseCustomerListContract";
|
|
1397
1414
|
import { HubriseLocationContract } from "api/hubrise/model/location/HubriseLocationContract";
|
|
1398
1415
|
import { HubriseUserContract } from "api/hubrise/model/user/HubriseUserContract";
|
|
1399
|
-
import { HubriseAuthContract } from "api/hubrise/model/
|
|
1416
|
+
import { HubriseAuthContract } from "api/hubrise/model/auth/HubriseAuthContract";
|
|
1400
1417
|
import { HubriseResourceType } from "api/hubrise/model/callback/HubriseResourceType";
|
|
1401
1418
|
import { HubriseEventType } from "api/hubrise/model/callback/HubriseEventType";
|
|
1402
|
-
import { HubriseAuthResource } from "api/hubrise/model/
|
|
1403
|
-
import { HubriseRightAccess } from "api/hubrise/model/
|
|
1419
|
+
import { HubriseAuthResource } from "api/hubrise/model/auth/HubriseAuthResource";
|
|
1420
|
+
import { HubriseRightAccess } from "api/hubrise/model/auth/HubriseRightAccess";
|
|
1404
1421
|
import { HubriseAccountContract } from "api/hubrise/model/account/HubriseAccountContract";
|
|
1422
|
+
import { HubriseAccessTokenContract } from "api/hubrise/model/auth/HubriseAccessTokenContract";
|
|
1423
|
+
import { HubriseAccessLevel } from "api/hubrise/model/auth/HubriseAccessLevel";
|
|
1405
1424
|
export class HubriseApi implements HubriseApiContract {
|
|
1406
1425
|
static readonly BASE_URL: string;
|
|
1407
1426
|
static readonly BASE_AUTH_URL: string;
|
|
1408
1427
|
private static readonly TIMEOUT;
|
|
1409
|
-
private readonly
|
|
1410
|
-
constructor(
|
|
1411
|
-
authorize(name: string, clientId: string,
|
|
1428
|
+
private readonly accessToken;
|
|
1429
|
+
constructor(accessToken?: HubriseAccessTokenContract);
|
|
1430
|
+
authorize(name: string, clientId: string, redirect: string, accessLevel: HubriseAccessLevel, rights?: Record<HubriseAuthResource, HubriseRightAccess>, profile?: boolean, appInstanceId?: string): Promise<string>;
|
|
1412
1431
|
getToken(clientId: string, clientSecret: string, code: string): Promise<HubriseAuthContract>;
|
|
1413
1432
|
getUser(): Promise<HubriseUserContract>;
|
|
1414
1433
|
getAccount(): Promise<HubriseAccountContract>;
|
|
1415
1434
|
getLocations(): Promise<HubriseLocationContract[]>;
|
|
1435
|
+
getLocation(hubriseLocationId?: string): Promise<HubriseLocationContract>;
|
|
1416
1436
|
createCustomer(hubriseCustomerListId: string, hubriseCustomer: HubriseCustomerContract): Promise<HubriseCustomerContract>;
|
|
1417
1437
|
getCustomer(hubriseCustomerListId: string, hubriseCustomerId: string): Promise<HubriseCustomerContract>;
|
|
1418
1438
|
getCustomers(hubriseCustomerListId: string, reference?: string, email?: string, phone?: string): Promise<HubriseCustomerContract[]>;
|
|
@@ -1583,9 +1603,11 @@ declare module "api/hubrise/service/TotalHubriseCalculator" {
|
|
|
1583
1603
|
}
|
|
1584
1604
|
declare module "api/web" {
|
|
1585
1605
|
export * from "api/hubrise/model/account/HubriseAccountContract";
|
|
1586
|
-
export * from "api/hubrise/model/
|
|
1587
|
-
export * from "api/hubrise/model/
|
|
1588
|
-
export * from "api/hubrise/model/
|
|
1606
|
+
export * from "api/hubrise/model/auth/HubriseAccessLevel";
|
|
1607
|
+
export * from "api/hubrise/model/auth/HubriseAccessTokenContract";
|
|
1608
|
+
export * from "api/hubrise/model/auth/HubriseAuthContract";
|
|
1609
|
+
export * from "api/hubrise/model/auth/HubriseAuthResource";
|
|
1610
|
+
export * from "api/hubrise/model/auth/HubriseRightAccess";
|
|
1589
1611
|
export * from "api/hubrise/model/address/HubriseAddressContract";
|
|
1590
1612
|
export * from "api/hubrise/model/address/HubriseCountryCode";
|
|
1591
1613
|
export * from "api/hubrise/model/common/HubriseCurrencyCode";
|
|
@@ -1832,6 +1854,7 @@ declare module "mockup/HubriseApiMockup" {
|
|
|
1832
1854
|
static getUser(times?: number): void;
|
|
1833
1855
|
static getAccount(times?: number): void;
|
|
1834
1856
|
static getLocations(times?: number): void;
|
|
1857
|
+
static getLocation(times?: number): void;
|
|
1835
1858
|
static createCustomer(times?: number): void;
|
|
1836
1859
|
static getCustomer(times?: number): void;
|
|
1837
1860
|
static getCustomers(times?: number): void;
|