@freedom_sky/feige-lib 5.12.0 → 5.13.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.
@@ -134,6 +134,7 @@ declare class Const {
134
134
  DISH_DESCRIPTION_MAX_LENGTH: number;
135
135
  SPECIFICATION_NAME_MAX_LENGTH: number;
136
136
  SPECIFICATION_DESCRIPTION_MAX_LENGTH: number;
137
+ CLASSIFICATION_NAME_MAX_LENGTH: number;
137
138
  STORE_NAME_MAX_LENGTH: number;
138
139
  STORE_DESCRIPTION_MAX_LENGTH: number;
139
140
  TABLE_NAME_MAX_LENGTH: number;
@@ -173,6 +174,10 @@ declare class Const {
173
174
  ID: string;
174
175
  NAME: string;
175
176
  };
177
+ AI_TOKEN: {
178
+ ID: string;
179
+ NAME: string;
180
+ };
176
181
  };
177
182
  PROBATION: number;
178
183
  LANGUAGE: LanguageItem[];
@@ -211,6 +216,7 @@ declare class Const {
211
216
  MEMBER: string;
212
217
  SMS_NUM: string;
213
218
  PAY: string;
219
+ AI_TOKEN: string;
214
220
  };
215
221
  ORDER_EVENT: {
216
222
  CREATE: string;
@@ -327,6 +333,10 @@ declare class Const {
327
333
  DINE: string;
328
334
  TAKEOUT: string;
329
335
  };
336
+ AI_MENU_IMAGE_PARSE_TIMEOUT: number;
337
+ AI_MENU_TRANSLATE_TIMEOUT: number;
338
+ AI_MENU_TRANSLATE_MAX_ITEMS: number;
339
+ DISH_IMG_DEFAULT: string;
330
340
  AREA_CODE: {
331
341
  continent: ContinentEnum;
332
342
  en: string;
@@ -139,6 +139,7 @@ var Const = /** @class */ (function () {
139
139
  DISH_DESCRIPTION_MAX_LENGTH: 300,
140
140
  SPECIFICATION_NAME_MAX_LENGTH: 60,
141
141
  SPECIFICATION_DESCRIPTION_MAX_LENGTH: 60,
142
+ CLASSIFICATION_NAME_MAX_LENGTH: 30,
142
143
  STORE_NAME_MAX_LENGTH: 30,
143
144
  STORE_DESCRIPTION_MAX_LENGTH: 500,
144
145
  TABLE_NAME_MAX_LENGTH: 30,
@@ -178,6 +179,10 @@ var Const = /** @class */ (function () {
178
179
  ID: 'mp',
179
180
  NAME: '小程序功能',
180
181
  },
182
+ AI_TOKEN: {
183
+ ID: 'aiToken',
184
+ NAME: 'AI Token',
185
+ },
181
186
  };
182
187
  this.PROBATION = 10; // 公共试用期,当具体模块下没有该字段时,取这里的数据,单位:日
183
188
  this.LANGUAGE = [
@@ -707,6 +712,7 @@ var Const = /** @class */ (function () {
707
712
  MEMBER: 'member',
708
713
  SMS_NUM: 'smsNum',
709
714
  PAY: 'pay',
715
+ AI_TOKEN: 'aiToken',
710
716
  };
711
717
  this.ORDER_EVENT = {
712
718
  CREATE: 'create',
@@ -823,6 +829,10 @@ var Const = /** @class */ (function () {
823
829
  DINE: 'dine',
824
830
  TAKEOUT: 'takeout',
825
831
  };
832
+ this.AI_MENU_IMAGE_PARSE_TIMEOUT = 600000; // 10 minutes
833
+ this.AI_MENU_TRANSLATE_TIMEOUT = 300000; // 5 minutes
834
+ this.AI_MENU_TRANSLATE_MAX_ITEMS = 6000; // max source-target pairs for translation
835
+ this.DISH_IMG_DEFAULT = 'https://feige-img-hub.oss-cn-hangzhou.aliyuncs.com/1592144190779-QRTrDtCm2n.jpg';
826
836
  this.AREA_CODE = [
827
837
  {
828
838
  en: 'Angola',
@@ -0,0 +1,10 @@
1
+ export declare enum AiTokenTransactionTypeEnum {
2
+ Supplement = "supplement",
3
+ Consume = "consume"
4
+ }
5
+ export declare enum AiTokenActionTypeEnum {
6
+ Send = "send",
7
+ Buy = "buy",
8
+ Translate = "translate",
9
+ ImageParse = "imageParse"
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var AiTokenTransactionTypeEnum;
4
+ (function (AiTokenTransactionTypeEnum) {
5
+ AiTokenTransactionTypeEnum["Supplement"] = "supplement";
6
+ AiTokenTransactionTypeEnum["Consume"] = "consume";
7
+ })(AiTokenTransactionTypeEnum = exports.AiTokenTransactionTypeEnum || (exports.AiTokenTransactionTypeEnum = {}));
8
+ var AiTokenActionTypeEnum;
9
+ (function (AiTokenActionTypeEnum) {
10
+ AiTokenActionTypeEnum["Send"] = "send";
11
+ AiTokenActionTypeEnum["Buy"] = "buy";
12
+ AiTokenActionTypeEnum["Translate"] = "translate";
13
+ AiTokenActionTypeEnum["ImageParse"] = "imageParse";
14
+ })(AiTokenActionTypeEnum = exports.AiTokenActionTypeEnum || (exports.AiTokenActionTypeEnum = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum MenuImportModeEnum {
2
+ APPEND = "append",
3
+ REPLACE = "replace"
4
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var MenuImportModeEnum;
4
+ (function (MenuImportModeEnum) {
5
+ MenuImportModeEnum["APPEND"] = "append";
6
+ MenuImportModeEnum["REPLACE"] = "replace";
7
+ })(MenuImportModeEnum = exports.MenuImportModeEnum || (exports.MenuImportModeEnum = {}));
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './enum/time-menu.enum';
11
11
  export * from './enum/printer.enum';
12
12
  export * from './enum/member.enum';
13
13
  export * from './enum/sms.enum';
14
+ export * from './enum/ai-token.enum';
14
15
  export * from './enum/checkout.enum';
15
16
  export * from './enum/yeepay.enum';
16
17
  export * from './enum/timezone.emum';
@@ -30,6 +31,10 @@ export * from './interfaces/store/store.interface';
30
31
  export * from './interfaces/common/language.interface';
31
32
  export * from './interfaces/store/subscription.interface';
32
33
  export * from './interfaces/store/dish.interface';
34
+ export * from './interfaces/store/classification.interface';
35
+ export * from './interfaces/store/specification.interface';
36
+ export * from './interfaces/store/menu-export.interface';
37
+ export { MenuImportModeEnum } from './enum/menu-io.enum';
33
38
  export * from './interfaces/order';
34
39
  export { PayCompanyEnum } from './enum/pay-company.enum';
35
40
  import * as moment from 'moment';
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ __export(require("./enum/time-menu.enum"));
15
15
  __export(require("./enum/printer.enum"));
16
16
  __export(require("./enum/member.enum"));
17
17
  __export(require("./enum/sms.enum"));
18
+ __export(require("./enum/ai-token.enum"));
18
19
  __export(require("./enum/checkout.enum"));
19
20
  __export(require("./enum/yeepay.enum"));
20
21
  __export(require("./enum/timezone.emum"));
@@ -28,6 +29,8 @@ __export(require("./enum/from.enum"));
28
29
  __export(require("./enum/role.enum"));
29
30
  __export(require("./enum/continent.enum"));
30
31
  __export(require("./announcement/enum/announcement.enum"));
32
+ var menu_io_enum_1 = require("./enum/menu-io.enum");
33
+ exports.MenuImportModeEnum = menu_io_enum_1.MenuImportModeEnum;
31
34
  __export(require("./interfaces/order"));
32
35
  var pay_company_enum_1 = require("./enum/pay-company.enum");
33
36
  exports.PayCompanyEnum = pay_company_enum_1.PayCompanyEnum;
@@ -3,5 +3,5 @@ export interface Classification {
3
3
  readonly names?: object;
4
4
  readonly content: Array<string>;
5
5
  readonly noFullOrderDiscount: boolean;
6
- readonly date: Date;
6
+ readonly date: string | Date;
7
7
  }
@@ -0,0 +1,12 @@
1
+ import { Dish } from './dish.interface';
2
+ import { Classification } from './classification.interface';
3
+ import { Specification } from './specification.interface';
4
+ export interface MenuExportData {
5
+ version: string;
6
+ exportedAt: string;
7
+ storeId?: string;
8
+ storeNames?: object;
9
+ dishes: Dish[];
10
+ classifications: Classification[];
11
+ specifications: Specification[];
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -12,6 +12,6 @@ export interface Specification {
12
12
  fare: number;
13
13
  fareType: string;
14
14
  }[];
15
- date: Date | string;
15
+ date: string | Date;
16
16
  __v: number;
17
17
  }
@@ -138,6 +138,9 @@ export interface Store {
138
138
  };
139
139
  };
140
140
  readonly smsNum: number;
141
+ readonly resource: {
142
+ aiToken: number;
143
+ };
141
144
  readonly smsNotificationSetting: {
142
145
  becomeMember: boolean;
143
146
  memberSave: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freedom_sky/feige-lib",
3
- "version": "5.12.0",
3
+ "version": "5.13.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -137,6 +137,7 @@ class Const {
137
137
  DISH_DESCRIPTION_MAX_LENGTH: 300,
138
138
  SPECIFICATION_NAME_MAX_LENGTH: 60,
139
139
  SPECIFICATION_DESCRIPTION_MAX_LENGTH: 60,
140
+ CLASSIFICATION_NAME_MAX_LENGTH: 30,
140
141
  STORE_NAME_MAX_LENGTH: 30,
141
142
  STORE_DESCRIPTION_MAX_LENGTH: 500,
142
143
  TABLE_NAME_MAX_LENGTH: 30,
@@ -176,6 +177,10 @@ class Const {
176
177
  ID: 'mp',
177
178
  NAME: '小程序功能',
178
179
  },
180
+ AI_TOKEN: {
181
+ ID: 'aiToken',
182
+ NAME: 'AI Token',
183
+ },
179
184
  };
180
185
  PROBATION = 10; // 公共试用期,当具体模块下没有该字段时,取这里的数据,单位:日
181
186
  LANGUAGE: LanguageItem[] = [
@@ -705,6 +710,7 @@ class Const {
705
710
  MEMBER: 'member',
706
711
  SMS_NUM: 'smsNum',
707
712
  PAY: 'pay',
713
+ AI_TOKEN: 'aiToken',
708
714
  };
709
715
  ORDER_EVENT = {
710
716
  CREATE: 'create',
@@ -821,6 +827,10 @@ class Const {
821
827
  DINE: 'dine',
822
828
  TAKEOUT: 'takeout',
823
829
  };
830
+ AI_MENU_IMAGE_PARSE_TIMEOUT = 600000; // 10 minutes
831
+ AI_MENU_TRANSLATE_TIMEOUT = 300000; // 5 minutes
832
+ AI_MENU_TRANSLATE_MAX_ITEMS = 6000; // max source-target pairs for translation
833
+ DISH_IMG_DEFAULT = 'https://feige-img-hub.oss-cn-hangzhou.aliyuncs.com/1592144190779-QRTrDtCm2n.jpg';
824
834
  AREA_CODE: {
825
835
  continent: ContinentEnum;
826
836
  en: string;
@@ -0,0 +1,10 @@
1
+ export enum AiTokenTransactionTypeEnum {
2
+ Supplement = 'supplement',
3
+ Consume = 'consume',
4
+ }
5
+ export enum AiTokenActionTypeEnum {
6
+ Send = 'send',
7
+ Buy = 'buy',
8
+ Translate = 'translate',
9
+ ImageParse = 'imageParse',
10
+ }
@@ -0,0 +1,4 @@
1
+ export enum MenuImportModeEnum {
2
+ APPEND = 'append',
3
+ REPLACE = 'replace',
4
+ }
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ export * from './enum/time-menu.enum';
12
12
  export * from './enum/printer.enum';
13
13
  export * from './enum/member.enum';
14
14
  export * from './enum/sms.enum';
15
+ export * from './enum/ai-token.enum';
15
16
  export * from './enum/checkout.enum';
16
17
  export * from './enum/yeepay.enum';
17
18
  export * from './enum/timezone.emum';
@@ -31,6 +32,10 @@ export * from './interfaces/store/store.interface';
31
32
  export * from './interfaces/common/language.interface';
32
33
  export * from './interfaces/store/subscription.interface';
33
34
  export * from './interfaces/store/dish.interface';
35
+ export * from './interfaces/store/classification.interface';
36
+ export * from './interfaces/store/specification.interface';
37
+ export * from './interfaces/store/menu-export.interface';
38
+ export { MenuImportModeEnum } from './enum/menu-io.enum';
34
39
  export * from './interfaces/order';
35
40
  export { PayCompanyEnum } from './enum/pay-company.enum';
36
41
  import * as moment from 'moment';
@@ -3,5 +3,5 @@ export interface Classification {
3
3
  readonly names?: object;
4
4
  readonly content: Array<string>;
5
5
  readonly noFullOrderDiscount: boolean;
6
- readonly date: Date;
6
+ readonly date: string | Date;
7
7
  }
@@ -0,0 +1,13 @@
1
+ import { Dish } from './dish.interface';
2
+ import { Classification } from './classification.interface';
3
+ import { Specification } from './specification.interface';
4
+
5
+ export interface MenuExportData {
6
+ version: string;
7
+ exportedAt: string;
8
+ storeId?: string;
9
+ storeNames?: object;
10
+ dishes: Dish[];
11
+ classifications: Classification[];
12
+ specifications: Specification[];
13
+ }
@@ -12,6 +12,6 @@ export interface Specification {
12
12
  fare: number;
13
13
  fareType: string;
14
14
  }[];
15
- date: Date | string;
15
+ date: string | Date;
16
16
  __v: number;
17
17
  }
@@ -149,6 +149,9 @@ export interface Store {
149
149
  };
150
150
  };
151
151
  readonly smsNum: number;
152
+ readonly resource: {
153
+ aiToken: number;
154
+ };
152
155
  readonly smsNotificationSetting: {
153
156
  becomeMember: boolean;
154
157
  memberSave: boolean;