@etsoo/appscript 1.3.2 → 1.3.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.
Files changed (94) hide show
  1. package/README.md +0 -1
  2. package/__tests__/app/CoreApp.ts +54 -16
  3. package/lib/cjs/address/AddressContinent.d.ts +5 -1
  4. package/lib/cjs/address/AddressContinent.js +1 -1
  5. package/lib/cjs/address/AddressRegion.d.ts +31 -15
  6. package/lib/cjs/address/AddressRegion.js +3 -2
  7. package/lib/cjs/address/AddressState.d.ts +17 -0
  8. package/lib/cjs/address/AddressState.js +2 -0
  9. package/lib/cjs/address/AddressUtils.d.ts +1 -17
  10. package/lib/cjs/address/AddressUtils.js +4 -35
  11. package/lib/cjs/app/CoreApp.d.ts +8 -22
  12. package/lib/cjs/app/CoreApp.js +16 -46
  13. package/lib/cjs/app/ExternalSettings.d.ts +1 -0
  14. package/lib/cjs/app/ExternalSettings.js +16 -10
  15. package/lib/cjs/app/IApp.d.ts +11 -21
  16. package/lib/cjs/business/BusinessUtils.d.ts +1 -43
  17. package/lib/cjs/business/BusinessUtils.js +0 -72
  18. package/lib/cjs/business/Currency.d.ts +8 -0
  19. package/lib/cjs/business/Currency.js +18 -0
  20. package/lib/cjs/erp/AddressApi.d.ts +38 -0
  21. package/lib/cjs/erp/AddressApi.js +102 -0
  22. package/lib/cjs/erp/BaseApi.d.ts +12 -0
  23. package/lib/cjs/erp/BaseApi.js +16 -0
  24. package/lib/cjs/erp/OrgApi.d.ts +20 -0
  25. package/lib/cjs/erp/OrgApi.js +37 -0
  26. package/lib/cjs/erp/PublicApi.d.ts +75 -0
  27. package/lib/cjs/erp/PublicApi.js +118 -0
  28. package/lib/cjs/erp/dto/CurrencyDto.d.ts +6 -0
  29. package/lib/cjs/erp/dto/CurrencyDto.js +2 -0
  30. package/lib/cjs/erp/dto/ExchangeRateDto.d.ts +13 -0
  31. package/lib/cjs/erp/dto/ExchangeRateDto.js +2 -0
  32. package/lib/cjs/erp/dto/ExchangeRateHistoryDto.d.ts +8 -0
  33. package/lib/cjs/erp/dto/ExchangeRateHistoryDto.js +2 -0
  34. package/lib/cjs/erp/dto/PublicProductDto.d.ts +35 -0
  35. package/lib/cjs/erp/dto/PublicProductDto.js +2 -0
  36. package/lib/cjs/index.d.ts +6 -0
  37. package/lib/cjs/index.js +7 -0
  38. package/lib/mjs/address/AddressContinent.d.ts +5 -1
  39. package/lib/mjs/address/AddressContinent.js +1 -1
  40. package/lib/mjs/address/AddressRegion.d.ts +31 -15
  41. package/lib/mjs/address/AddressRegion.js +3 -2
  42. package/lib/mjs/address/AddressState.d.ts +17 -0
  43. package/lib/mjs/address/AddressState.js +1 -0
  44. package/lib/mjs/address/AddressUtils.d.ts +1 -17
  45. package/lib/mjs/address/AddressUtils.js +1 -32
  46. package/lib/mjs/app/CoreApp.d.ts +8 -22
  47. package/lib/mjs/app/CoreApp.js +16 -46
  48. package/lib/mjs/app/ExternalSettings.d.ts +1 -0
  49. package/lib/mjs/app/ExternalSettings.js +16 -10
  50. package/lib/mjs/app/IApp.d.ts +11 -21
  51. package/lib/mjs/business/BusinessUtils.d.ts +1 -43
  52. package/lib/mjs/business/BusinessUtils.js +0 -72
  53. package/lib/mjs/business/Currency.d.ts +8 -0
  54. package/lib/mjs/business/Currency.js +15 -0
  55. package/lib/mjs/erp/AddressApi.d.ts +38 -0
  56. package/lib/mjs/erp/AddressApi.js +75 -0
  57. package/lib/mjs/erp/BaseApi.d.ts +12 -0
  58. package/lib/mjs/erp/BaseApi.js +12 -0
  59. package/lib/mjs/erp/OrgApi.d.ts +20 -0
  60. package/lib/mjs/erp/OrgApi.js +33 -0
  61. package/lib/mjs/erp/PublicApi.d.ts +75 -0
  62. package/lib/mjs/erp/PublicApi.js +114 -0
  63. package/lib/mjs/erp/dto/CurrencyDto.d.ts +6 -0
  64. package/lib/mjs/erp/dto/CurrencyDto.js +1 -0
  65. package/lib/mjs/erp/dto/ExchangeRateDto.d.ts +13 -0
  66. package/lib/mjs/erp/dto/ExchangeRateDto.js +1 -0
  67. package/lib/mjs/erp/dto/ExchangeRateHistoryDto.d.ts +8 -0
  68. package/lib/mjs/erp/dto/ExchangeRateHistoryDto.js +1 -0
  69. package/lib/mjs/erp/dto/PublicProductDto.d.ts +35 -0
  70. package/lib/mjs/erp/dto/PublicProductDto.js +1 -0
  71. package/lib/mjs/index.d.ts +6 -0
  72. package/lib/mjs/index.js +7 -0
  73. package/package.json +2 -2
  74. package/src/address/AddressContinent.ts +6 -1
  75. package/src/address/AddressRegion.ts +36 -16
  76. package/src/address/AddressState.ts +19 -0
  77. package/src/address/AddressUtils.ts +1 -35
  78. package/src/app/CoreApp.ts +22 -57
  79. package/src/app/ExternalSettings.ts +17 -13
  80. package/src/app/IApp.ts +12 -25
  81. package/src/business/BusinessUtils.ts +1 -105
  82. package/src/business/Currency.ts +20 -0
  83. package/src/erp/AddressApi.ts +97 -0
  84. package/src/erp/BaseApi.ts +12 -0
  85. package/src/erp/OrgApi.ts +39 -0
  86. package/src/erp/PublicApi.ts +156 -0
  87. package/src/erp/dto/CurrencyDto.ts +7 -0
  88. package/src/erp/dto/ExchangeRateDto.ts +14 -0
  89. package/src/erp/dto/ExchangeRateHistoryDto.ts +9 -0
  90. package/src/erp/dto/PublicProductDto.ts +41 -0
  91. package/src/i18n/address.en-US.json +21 -0
  92. package/src/i18n/address.zh-CN.json +21 -0
  93. package/src/i18n/address.zh-HK.json +21 -0
  94. package/src/index.ts +8 -0
@@ -1,6 +1,3 @@
1
- import { DataTypes } from '@etsoo/shared';
2
- import { ProductUnit } from './ProductUnit';
3
- import { RepeatOption } from './RepeatOption';
4
1
  /**
5
2
  * Business utils
6
3
  */
@@ -38,22 +35,6 @@ export var BusinessUtils;
38
35
  return defaultTitle;
39
36
  }
40
37
  BusinessUtils.formatAvatarTitle = formatAvatarTitle;
41
- /**
42
- * Get currency collection
43
- * @param currencyNames Names like CNY, USD
44
- * @param func Label delegate
45
- * @returns Collection
46
- */
47
- function getCurrencies(currencyNames, func) {
48
- return currencyNames.map((name) => {
49
- var _a;
50
- return ({
51
- id: name,
52
- label: (_a = func(`currency${name}`)) !== null && _a !== void 0 ? _a : name
53
- });
54
- });
55
- }
56
- BusinessUtils.getCurrencies = getCurrencies;
57
38
  /**
58
39
  * Get 12-month items
59
40
  * @param monthLabels Month labels
@@ -71,59 +52,6 @@ export var BusinessUtils;
71
52
  return months;
72
53
  }
73
54
  BusinessUtils.getMonths = getMonths;
74
- /**
75
- * Get product unit's label
76
- * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
77
- * @param unit Unit
78
- * @param func Label delegate
79
- * @param isJoined Add the join label like 'per Kg' for Kg
80
- * @returns Label
81
- */
82
- function getUnitLabel(unit, func, isJoined) {
83
- var _a;
84
- const key = ProductUnit[unit];
85
- const label = (_a = func('unit' + key)) !== null && _a !== void 0 ? _a : key;
86
- if (isJoined) {
87
- const jLabel = func('unitJoin');
88
- if (jLabel)
89
- return jLabel.format(label);
90
- }
91
- return label;
92
- }
93
- BusinessUtils.getUnitLabel = getUnitLabel;
94
- /**
95
- *
96
- * Get all product units
97
- * @param func Label delegate
98
- * @param options Define the order and limit the items
99
- * @param isJoined Add the join label like 'per Kg' for Kg
100
- * @returns Units
101
- */
102
- function getUnits(func, options, isJoined) {
103
- options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(ProductUnit));
104
- return options.map((key) => {
105
- const id = DataTypes.getEnumByKey(ProductUnit, key);
106
- return {
107
- id,
108
- label: getUnitLabel(id, func, isJoined).formatInitial(true)
109
- };
110
- });
111
- }
112
- BusinessUtils.getUnits = getUnits;
113
- /**
114
- *
115
- * Get all repeat options
116
- * @param func Label delegate
117
- * @param options Define the order and limit the items
118
- * @param isJoined Add the join label like 'per Kg' for Kg
119
- * @returns Units
120
- */
121
- function getRepeatOptions(func, options, isJoined = true) {
122
- options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(RepeatOption));
123
- isJoined !== null && isJoined !== void 0 ? isJoined : (isJoined = true);
124
- return getUnits(func, options, isJoined);
125
- }
126
- BusinessUtils.getRepeatOptions = getRepeatOptions;
127
55
  /**
128
56
  * Set id value
129
57
  * @param item QueryRQ or TiplistRQ or similiar item
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Currency array
3
+ */
4
+ export declare const Currencies: readonly ["AUD", "CAD", "CNY", "EUR", "GBP", "HKD", "JPY", "NZD", "SGD", "USD"];
5
+ /**
6
+ * Currency type
7
+ */
8
+ export declare type Currency = typeof Currencies[number];
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Currency array
3
+ */
4
+ export const Currencies = [
5
+ 'AUD',
6
+ 'CAD',
7
+ 'CNY',
8
+ 'EUR',
9
+ 'GBP',
10
+ 'HKD',
11
+ 'JPY',
12
+ 'NZD',
13
+ 'SGD',
14
+ 'USD'
15
+ ];
@@ -0,0 +1,38 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import { AddressRegion, AddressRegionDb } from '../address/AddressRegion';
3
+ import { AddressState } from '../address/AddressState';
4
+ import { IdLabelConditional } from '../dto/IdLabelDto';
5
+ import { BaseApi } from './BaseApi';
6
+ /**
7
+ * Address Api
8
+ */
9
+ export declare class AddressApi extends BaseApi {
10
+ private languageLabels;
11
+ /**
12
+ * Get address labels
13
+ * @param language Language
14
+ * @returns Result
15
+ */
16
+ getLabels(language?: string): Promise<DataTypes.StringRecord>;
17
+ /**
18
+ * Get all continents
19
+ * @param language Language
20
+ * @param isNumberKey Is number key or key as id
21
+ * @returns Continents
22
+ */
23
+ continents<T extends boolean>(language?: string, isNumberKey?: T): Promise<IdLabelConditional<T>>;
24
+ /**
25
+ * Get region list from database
26
+ * @param language Language
27
+ * @param isLocal Is local version
28
+ * @returns Result
29
+ */
30
+ regions<T extends boolean = true>(language?: string, isLocal?: T): Promise<T extends true | undefined ? AddressRegion[] : AddressRegionDb[] | undefined>;
31
+ /**
32
+ * Get state list from database
33
+ * @param regionId Region id
34
+ * @param language Language
35
+ * @returns Result
36
+ */
37
+ states(regionId: string, language?: string): Promise<AddressState[] | undefined>;
38
+ }
@@ -0,0 +1,75 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import { AddressContinent } from '../address/AddressContinent';
3
+ import { AddressRegion } from '../address/AddressRegion';
4
+ import { BaseApi } from './BaseApi';
5
+ /**
6
+ * Address Api
7
+ */
8
+ export class AddressApi extends BaseApi {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.languageLabels = {};
12
+ }
13
+ /**
14
+ * Get address labels
15
+ * @param language Language
16
+ * @returns Result
17
+ */
18
+ async getLabels(language) {
19
+ const l = this.app.checkLanguage(language);
20
+ let labels = this.languageLabels[l];
21
+ if (labels == null) {
22
+ labels = await import(`./../i18n/address.${l}.json`);
23
+ // Cache
24
+ this.languageLabels[l] = labels;
25
+ }
26
+ return labels;
27
+ }
28
+ /**
29
+ * Get all continents
30
+ * @param language Language
31
+ * @param isNumberKey Is number key or key as id
32
+ * @returns Continents
33
+ */
34
+ async continents(language, isNumberKey = false) {
35
+ const labels = await this.getLabels(language);
36
+ return DataTypes.getEnumKeys(AddressContinent).map((key) => {
37
+ var _a;
38
+ return ({
39
+ id: isNumberKey
40
+ ? DataTypes.getEnumByKey(AddressContinent, key)
41
+ : key.toString(),
42
+ label: (_a = labels['continent' + key]) !== null && _a !== void 0 ? _a : key
43
+ });
44
+ });
45
+ }
46
+ /**
47
+ * Get region list from database
48
+ * @param language Language
49
+ * @param isLocal Is local version
50
+ * @returns Result
51
+ */
52
+ async regions(language, isLocal) {
53
+ language = this.app.checkLanguage(language);
54
+ if (isLocal == null || isLocal) {
55
+ const labels = await this.getLabels(language);
56
+ return AddressRegion.all.map((region) => {
57
+ region.label = labels['region' + region.id];
58
+ return { ...region };
59
+ });
60
+ }
61
+ else {
62
+ return (await this.app.api.get(`Address/RegionList?language=${language}`, undefined, { defaultValue: [] }));
63
+ }
64
+ }
65
+ /**
66
+ * Get state list from database
67
+ * @param regionId Region id
68
+ * @param language Language
69
+ * @returns Result
70
+ */
71
+ states(regionId, language) {
72
+ language = this.app.checkLanguage(language);
73
+ return this.app.api.get(`Address/StateList?regionId=${regionId}&language=${language}`, undefined, { defaultValue: [] });
74
+ }
75
+ }
@@ -0,0 +1,12 @@
1
+ import { IApp } from '../app/IApp';
2
+ /**
3
+ * SmartERP base API
4
+ */
5
+ export declare class BaseApi {
6
+ protected app: IApp;
7
+ /**
8
+ * Constructor
9
+ * @param app Application
10
+ */
11
+ constructor(app: IApp);
12
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * SmartERP base API
3
+ */
4
+ export class BaseApi {
5
+ /**
6
+ * Constructor
7
+ * @param app Application
8
+ */
9
+ constructor(app) {
10
+ this.app = app;
11
+ }
12
+ }
@@ -0,0 +1,20 @@
1
+ import { ListType } from '@etsoo/shared';
2
+ import { BaseApi } from './BaseApi';
3
+ /**
4
+ * Organization API
5
+ */
6
+ export declare class OrgApi extends BaseApi {
7
+ /**
8
+ * Get organization list
9
+ * @param items Max items
10
+ * @param serviceId Service id
11
+ * @returns Result
12
+ */
13
+ list(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
14
+ /**
15
+ * Switch organization
16
+ * @param id Organization id
17
+ * @param serviceId Service id
18
+ */
19
+ switch(id: number, serviceId?: number): Promise<boolean | undefined>;
20
+ }
@@ -0,0 +1,33 @@
1
+ import { BaseApi } from './BaseApi';
2
+ /**
3
+ * Organization API
4
+ */
5
+ export class OrgApi extends BaseApi {
6
+ /**
7
+ * Get organization list
8
+ * @param items Max items
9
+ * @param serviceId Service id
10
+ * @returns Result
11
+ */
12
+ list(items, serviceId) {
13
+ return this.app.api.post('Organization/List', {
14
+ items,
15
+ serviceId
16
+ }, { defaultValue: [], showLoading: false });
17
+ }
18
+ /**
19
+ * Switch organization
20
+ * @param id Organization id
21
+ * @param serviceId Service id
22
+ */
23
+ async switch(id, serviceId) {
24
+ const result = await this.app.api.put('Organization/Switch', {
25
+ id,
26
+ serviceId,
27
+ deviceId: this.app.deviceId
28
+ });
29
+ if (result)
30
+ return await this.app.refreshToken();
31
+ return result;
32
+ }
33
+ }
@@ -0,0 +1,75 @@
1
+ import { ListType, ListType1 } from '@etsoo/shared';
2
+ import { Currency } from '../business/Currency';
3
+ import { ProductUnit } from '../business/ProductUnit';
4
+ import { BaseApi } from './BaseApi';
5
+ import { CurrencyDto } from './dto/CurrencyDto';
6
+ import { ExchangeRateDto } from './dto/ExchangeRateDto';
7
+ import { ExchangeRateHistoryDto } from './dto/ExchangeRateHistoryDto';
8
+ import { PublicOrgProductDto, PublicProductDto } from './dto/PublicProductDto';
9
+ /**
10
+ * Public API
11
+ */
12
+ export declare class PublicApi extends BaseApi {
13
+ /**
14
+ * Get currencies
15
+ * @param currencyNames Limited currency names for local data, undefined will try to retrive remoately
16
+ * @returns Result
17
+ */
18
+ currencies<T extends string[] | Currency[] | undefined>(currencyNames?: T): Promise<T extends undefined ? CurrencyDto[] | undefined : ListType1[]>;
19
+ /**
20
+ * Get exchange rate
21
+ * @param currency Currency
22
+ * @returns Result
23
+ */
24
+ exchangeRate(currency: Currency): Promise<ExchangeRateDto | undefined>;
25
+ /**
26
+ * Get exchange rate history
27
+ * @param currencies Currencies
28
+ * @param months Max months
29
+ * @returns Result
30
+ */
31
+ exchangeRateHistory(currencies: Currency[], months?: number): Promise<ExchangeRateHistoryDto[] | undefined>;
32
+ /**
33
+ * Get product unit's label
34
+ * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
35
+ * @param unit Unit
36
+ * @param isJoined Add the join label like 'per Kg' for Kg
37
+ * @returns Label
38
+ */
39
+ getUnitLabel(unit: ProductUnit, isJoined?: boolean | string): string;
40
+ private getUnitJoin;
41
+ /**
42
+ * Get mobile base64 QRCode
43
+ * @param id User id
44
+ * @param host Host URL
45
+ */
46
+ mobileQRCode(id?: string, host?: string): Promise<string | undefined>;
47
+ /**
48
+ * Get public and valid product data
49
+ * @param id Product/Service Id or Uid
50
+ * @param culture Language
51
+ * @returns Result
52
+ */
53
+ product<T extends number | string>(id: T, culture?: string): T extends number ? PublicProductDto : PublicOrgProductDto;
54
+ /**
55
+ *
56
+ * Get all repeat options
57
+ * @param options Define the order and limit the items
58
+ * @param isJoined Add the join label like 'per Kg' for Kg
59
+ * @returns Units
60
+ */
61
+ repeatOptions(options?: string[], isJoined?: boolean): ListType[];
62
+ /**
63
+ * Get all product units
64
+ * @returns Units
65
+ */
66
+ units(): ListType[];
67
+ /**
68
+ *
69
+ * Get all product units
70
+ * @param options Define the order and limit the items
71
+ * @param isJoined Add the join label like 'per Kg' for Kg
72
+ * @returns Units
73
+ */
74
+ units(options?: string[], isJoined?: boolean): ListType[];
75
+ }
@@ -0,0 +1,114 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import { ProductUnit } from '../business/ProductUnit';
3
+ import { RepeatOption } from '../business/RepeatOption';
4
+ import { BaseApi } from './BaseApi';
5
+ /**
6
+ * Public API
7
+ */
8
+ export class PublicApi extends BaseApi {
9
+ /**
10
+ * Get currencies
11
+ * @param currencyNames Limited currency names for local data, undefined will try to retrive remoately
12
+ * @returns Result
13
+ */
14
+ async currencies(currencyNames) {
15
+ if (currencyNames == null)
16
+ return (await this.app.api.get('Public/GetCurrencies'));
17
+ else
18
+ return currencyNames.map((name) => {
19
+ var _a;
20
+ return ({
21
+ id: name,
22
+ label: (_a = this.app.get(`currency${name}`)) !== null && _a !== void 0 ? _a : name
23
+ });
24
+ });
25
+ }
26
+ /**
27
+ * Get exchange rate
28
+ * @param currency Currency
29
+ * @returns Result
30
+ */
31
+ exchangeRate(currency) {
32
+ return this.app.api.get(`Public/ExchangeRate/${currency}`);
33
+ }
34
+ /**
35
+ * Get exchange rate history
36
+ * @param currencies Currencies
37
+ * @param months Max months
38
+ * @returns Result
39
+ */
40
+ exchangeRateHistory(currencies, months) {
41
+ return this.app.api.post('Public/ExchangeRateHistory', { currencies, months }, { defaultValue: [] });
42
+ }
43
+ /**
44
+ * Get product unit's label
45
+ * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
46
+ * @param unit Unit
47
+ * @param isJoined Add the join label like 'per Kg' for Kg
48
+ * @returns Label
49
+ */
50
+ getUnitLabel(unit, isJoined) {
51
+ var _a;
52
+ const key = ProductUnit[unit];
53
+ const label = (_a = this.app.get('unit' + key)) !== null && _a !== void 0 ? _a : key;
54
+ const join = this.getUnitJoin(isJoined);
55
+ if (join) {
56
+ return join.format(label);
57
+ }
58
+ return label;
59
+ }
60
+ getUnitJoin(isJoined) {
61
+ var _a;
62
+ return typeof isJoined === 'string'
63
+ ? (_a = this.app.get(isJoined)) !== null && _a !== void 0 ? _a : isJoined
64
+ : isJoined
65
+ ? this.app.get('unitJoin')
66
+ : undefined;
67
+ }
68
+ /**
69
+ * Get mobile base64 QRCode
70
+ * @param id User id
71
+ * @param host Host URL
72
+ */
73
+ mobileQRCode(id, host) {
74
+ return this.app.api.post('Public/MobileQRCode', { id, host });
75
+ }
76
+ /**
77
+ * Get public and valid product data
78
+ * @param id Product/Service Id or Uid
79
+ * @param culture Language
80
+ * @returns Result
81
+ */
82
+ product(id, culture) {
83
+ culture = this.app.checkLanguage(culture);
84
+ return this.app.api.post(`Public/Product/${id}/${culture}`);
85
+ }
86
+ /**
87
+ *
88
+ * Get all repeat options
89
+ * @param options Define the order and limit the items
90
+ * @param isJoined Add the join label like 'per Kg' for Kg
91
+ * @returns Units
92
+ */
93
+ repeatOptions(options, isJoined = true) {
94
+ options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(RepeatOption));
95
+ return this.units(options, isJoined);
96
+ }
97
+ /**
98
+ *
99
+ * Get all product units
100
+ * @param options Define the order and limit the items
101
+ * @param isJoined Add the join label like 'per Kg' for Kg
102
+ * @returns Units
103
+ */
104
+ units(options, isJoined) {
105
+ options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(ProductUnit));
106
+ return options.map((key) => {
107
+ const id = DataTypes.getEnumByKey(ProductUnit, key);
108
+ return {
109
+ id,
110
+ label: this.getUnitLabel(id, this.getUnitJoin(isJoined)).formatInitial(true)
111
+ };
112
+ });
113
+ }
114
+ }
@@ -0,0 +1,6 @@
1
+ import { ListType1 } from '@etsoo/shared';
2
+ import { ExchangeRateDto } from './ExchangeRateDto';
3
+ /**
4
+ * Currency data
5
+ */
6
+ export declare type CurrencyDto = ListType1 & ExchangeRateDto;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Exchange rate data
3
+ */
4
+ export declare type ExchangeRateDto = {
5
+ /**
6
+ * Exchange rate
7
+ */
8
+ exchangeRate: number;
9
+ /**
10
+ * Update time
11
+ */
12
+ updateTime: string | Date;
13
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Currency } from '../../business/Currency';
2
+ import { ExchangeRateDto } from './ExchangeRateDto';
3
+ /**
4
+ * Exchange rate history data
5
+ */
6
+ export declare type ExchangeRateHistoryDto = ExchangeRateDto & {
7
+ id: Currency;
8
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ import { EntityStatus } from '../../business/EntityStatus';
2
+ /**
3
+ * Public product data
4
+ */
5
+ export declare type PublicProductDto = {
6
+ /**
7
+ * Id
8
+ */
9
+ id: number;
10
+ /**
11
+ * Name
12
+ */
13
+ name: string;
14
+ /**
15
+ * Logo
16
+ */
17
+ logo?: string;
18
+ /**
19
+ * Web URL for access
20
+ */
21
+ webUrl: string;
22
+ };
23
+ /**
24
+ * Public product with organization data
25
+ */
26
+ export declare type PublicOrgProductDto = PublicProductDto & {
27
+ /**
28
+ * Purchased service status
29
+ */
30
+ serviceEntityStatus?: EntityStatus;
31
+ /**
32
+ * Purchased service expiry
33
+ */
34
+ serviceExpiry?: string | Date;
35
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  export * from './address/AddressContinent';
2
2
  export * from './address/AddressRegion';
3
+ export * from './address/AddressState';
3
4
  export * from './address/AddressUtils';
4
5
  export * from './app/AppSettings';
5
6
  export * from './app/CoreApp';
@@ -10,6 +11,7 @@ export * from './bridges/BridgeUtils';
10
11
  export * from './bridges/IBridgeHost';
11
12
  export * from './business/BusinessTax';
12
13
  export * from './business/BusinessUtils';
14
+ export * from './business/Currency';
13
15
  export * from './business/EntityStatus';
14
16
  export * from './business/ProductUnit';
15
17
  export * from './business/RepeatOption';
@@ -17,6 +19,10 @@ export * from './def/ListItem';
17
19
  export * from './dto/IdLabelDto';
18
20
  export * from './dto/IdLabelPrimaryDto';
19
21
  export * from './dto/InitCallDto';
22
+ export * from './erp/AddressApi';
23
+ export * from './erp/BaseApi';
24
+ export * from './erp/OrgApi';
25
+ export * from './erp/PublicApi';
20
26
  export * from './i18n/enUS';
21
27
  export * from './i18n/zhCN';
22
28
  export * from './i18n/zhHK';
package/lib/mjs/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // address
2
2
  export * from './address/AddressContinent';
3
3
  export * from './address/AddressRegion';
4
+ export * from './address/AddressState';
4
5
  export * from './address/AddressUtils';
5
6
  // app
6
7
  export * from './app/AppSettings';
@@ -14,6 +15,7 @@ export * from './bridges/IBridgeHost';
14
15
  // business
15
16
  export * from './business/BusinessTax';
16
17
  export * from './business/BusinessUtils';
18
+ export * from './business/Currency';
17
19
  export * from './business/EntityStatus';
18
20
  export * from './business/ProductUnit';
19
21
  export * from './business/RepeatOption';
@@ -23,6 +25,11 @@ export * from './def/ListItem';
23
25
  export * from './dto/IdLabelDto';
24
26
  export * from './dto/IdLabelPrimaryDto';
25
27
  export * from './dto/InitCallDto';
28
+ // erp
29
+ export * from './erp/AddressApi';
30
+ export * from './erp/BaseApi';
31
+ export * from './erp/OrgApi';
32
+ export * from './erp/PublicApi';
26
33
  // i18n
27
34
  export * from './i18n/enUS';
28
35
  export * from './i18n/zhCN';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "@etsoo/notificationbase": "^1.1.12",
56
56
  "@etsoo/restclient": "^1.0.74",
57
- "@etsoo/shared": "^1.1.59",
57
+ "@etsoo/shared": "^1.1.60",
58
58
  "@types/crypto-js": "^4.1.1",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Continent
2
+ * Address continent
3
3
  */
4
4
  export enum AddressContinent {
5
5
  /// <summary>
@@ -44,3 +44,8 @@ export enum AddressContinent {
44
44
  /// </summary>
45
45
  SA = 7
46
46
  }
47
+
48
+ /**
49
+ * Address continent ids
50
+ */
51
+ export type AddressContinentId = keyof typeof AddressContinent;