@etsoo/appscript 1.3.2 → 1.3.3

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 (89) 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 +44 -0
  21. package/lib/cjs/erp/AddressApi.js +105 -0
  22. package/lib/cjs/erp/OrgApi.d.ts +26 -0
  23. package/lib/cjs/erp/OrgApi.js +43 -0
  24. package/lib/cjs/erp/PublicApi.d.ts +81 -0
  25. package/lib/cjs/erp/PublicApi.js +124 -0
  26. package/lib/cjs/erp/dto/CurrencyDto.d.ts +6 -0
  27. package/lib/cjs/erp/dto/CurrencyDto.js +2 -0
  28. package/lib/cjs/erp/dto/ExchangeRateDto.d.ts +13 -0
  29. package/lib/cjs/erp/dto/ExchangeRateDto.js +2 -0
  30. package/lib/cjs/erp/dto/ExchangeRateHistoryDto.d.ts +8 -0
  31. package/lib/cjs/erp/dto/ExchangeRateHistoryDto.js +2 -0
  32. package/lib/cjs/erp/dto/PublicProductDto.d.ts +35 -0
  33. package/lib/cjs/erp/dto/PublicProductDto.js +2 -0
  34. package/lib/cjs/index.d.ts +5 -0
  35. package/lib/cjs/index.js +6 -0
  36. package/lib/mjs/address/AddressContinent.d.ts +5 -1
  37. package/lib/mjs/address/AddressContinent.js +1 -1
  38. package/lib/mjs/address/AddressRegion.d.ts +31 -15
  39. package/lib/mjs/address/AddressRegion.js +3 -2
  40. package/lib/mjs/address/AddressState.d.ts +17 -0
  41. package/lib/mjs/address/AddressState.js +1 -0
  42. package/lib/mjs/address/AddressUtils.d.ts +1 -17
  43. package/lib/mjs/address/AddressUtils.js +1 -32
  44. package/lib/mjs/app/CoreApp.d.ts +8 -22
  45. package/lib/mjs/app/CoreApp.js +16 -46
  46. package/lib/mjs/app/ExternalSettings.d.ts +1 -0
  47. package/lib/mjs/app/ExternalSettings.js +16 -10
  48. package/lib/mjs/app/IApp.d.ts +11 -21
  49. package/lib/mjs/business/BusinessUtils.d.ts +1 -43
  50. package/lib/mjs/business/BusinessUtils.js +0 -72
  51. package/lib/mjs/business/Currency.d.ts +8 -0
  52. package/lib/mjs/business/Currency.js +15 -0
  53. package/lib/mjs/erp/AddressApi.d.ts +44 -0
  54. package/lib/mjs/erp/AddressApi.js +78 -0
  55. package/lib/mjs/erp/OrgApi.d.ts +26 -0
  56. package/lib/mjs/erp/OrgApi.js +39 -0
  57. package/lib/mjs/erp/PublicApi.d.ts +81 -0
  58. package/lib/mjs/erp/PublicApi.js +120 -0
  59. package/lib/mjs/erp/dto/CurrencyDto.d.ts +6 -0
  60. package/lib/mjs/erp/dto/CurrencyDto.js +1 -0
  61. package/lib/mjs/erp/dto/ExchangeRateDto.d.ts +13 -0
  62. package/lib/mjs/erp/dto/ExchangeRateDto.js +1 -0
  63. package/lib/mjs/erp/dto/ExchangeRateHistoryDto.d.ts +8 -0
  64. package/lib/mjs/erp/dto/ExchangeRateHistoryDto.js +1 -0
  65. package/lib/mjs/erp/dto/PublicProductDto.d.ts +35 -0
  66. package/lib/mjs/erp/dto/PublicProductDto.js +1 -0
  67. package/lib/mjs/index.d.ts +5 -0
  68. package/lib/mjs/index.js +6 -0
  69. package/package.json +2 -2
  70. package/src/address/AddressContinent.ts +6 -1
  71. package/src/address/AddressRegion.ts +36 -16
  72. package/src/address/AddressState.ts +19 -0
  73. package/src/address/AddressUtils.ts +1 -35
  74. package/src/app/CoreApp.ts +22 -57
  75. package/src/app/ExternalSettings.ts +17 -13
  76. package/src/app/IApp.ts +12 -25
  77. package/src/business/BusinessUtils.ts +1 -105
  78. package/src/business/Currency.ts +20 -0
  79. package/src/erp/AddressApi.ts +103 -0
  80. package/src/erp/OrgApi.ts +45 -0
  81. package/src/erp/PublicApi.ts +162 -0
  82. package/src/erp/dto/CurrencyDto.ts +7 -0
  83. package/src/erp/dto/ExchangeRateDto.ts +14 -0
  84. package/src/erp/dto/ExchangeRateHistoryDto.ts +9 -0
  85. package/src/erp/dto/PublicProductDto.ts +41 -0
  86. package/src/i18n/address.en-US.json +21 -0
  87. package/src/i18n/address.zh-CN.json +21 -0
  88. package/src/i18n/address.zh-HK.json +21 -0
  89. package/src/index.ts +7 -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,44 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import { AddressRegion, AddressRegionDb } from '../address/AddressRegion';
3
+ import { AddressState } from '../address/AddressState';
4
+ import { IApp } from '../app/IApp';
5
+ import { IdLabelConditional } from '../dto/IdLabelDto';
6
+ /**
7
+ * Address Api
8
+ */
9
+ export declare class AddressApi {
10
+ private app;
11
+ private languageLabels;
12
+ /**
13
+ * Constructor
14
+ * @param app Application
15
+ */
16
+ constructor(app: IApp);
17
+ /**
18
+ * Get address labels
19
+ * @param language Language
20
+ * @returns Result
21
+ */
22
+ getLabels(language?: string): Promise<DataTypes.StringRecord>;
23
+ /**
24
+ * Get all continents
25
+ * @param language Language
26
+ * @param isNumberKey Is number key or key as id
27
+ * @returns Continents
28
+ */
29
+ continents<T extends boolean>(language?: string, isNumberKey?: T): Promise<IdLabelConditional<T>>;
30
+ /**
31
+ * Get region list from database
32
+ * @param language Language
33
+ * @param isLocal Is local version
34
+ * @returns Result
35
+ */
36
+ regions<T extends boolean = true>(language?: string, isLocal?: T): Promise<T extends true | undefined ? AddressRegion[] : AddressRegionDb[] | undefined>;
37
+ /**
38
+ * Get state list from database
39
+ * @param regionId Region id
40
+ * @param language Language
41
+ * @returns Result
42
+ */
43
+ states(regionId: string, language?: string): Promise<AddressState[] | undefined>;
44
+ }
@@ -0,0 +1,78 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import { AddressContinent } from '../address/AddressContinent';
3
+ import { AddressRegion } from '../address/AddressRegion';
4
+ /**
5
+ * Address Api
6
+ */
7
+ export class AddressApi {
8
+ /**
9
+ * Constructor
10
+ * @param app Application
11
+ */
12
+ constructor(app) {
13
+ this.app = app;
14
+ this.languageLabels = {};
15
+ }
16
+ /**
17
+ * Get address labels
18
+ * @param language Language
19
+ * @returns Result
20
+ */
21
+ async getLabels(language) {
22
+ const l = this.app.checkLanguage(language);
23
+ let labels = this.languageLabels[l];
24
+ if (labels == null) {
25
+ labels = await import(`./../i18n/address.${l}.json`);
26
+ // Cache
27
+ this.languageLabels[l] = labels;
28
+ }
29
+ return labels;
30
+ }
31
+ /**
32
+ * Get all continents
33
+ * @param language Language
34
+ * @param isNumberKey Is number key or key as id
35
+ * @returns Continents
36
+ */
37
+ async continents(language, isNumberKey = false) {
38
+ const labels = await this.getLabels(language);
39
+ return DataTypes.getEnumKeys(AddressContinent).map((key) => {
40
+ var _a;
41
+ return ({
42
+ id: isNumberKey
43
+ ? DataTypes.getEnumByKey(AddressContinent, key)
44
+ : key.toString(),
45
+ label: (_a = labels['continent' + key]) !== null && _a !== void 0 ? _a : key
46
+ });
47
+ });
48
+ }
49
+ /**
50
+ * Get region list from database
51
+ * @param language Language
52
+ * @param isLocal Is local version
53
+ * @returns Result
54
+ */
55
+ async regions(language, isLocal) {
56
+ language = this.app.checkLanguage(language);
57
+ if (isLocal == null || isLocal) {
58
+ const labels = await this.getLabels(language);
59
+ return AddressRegion.all.map((region) => {
60
+ region.label = labels['region' + region.id];
61
+ return { ...region };
62
+ });
63
+ }
64
+ else {
65
+ return (await this.app.api.get(`Address/RegionList?language=${language}`, undefined, { defaultValue: [] }));
66
+ }
67
+ }
68
+ /**
69
+ * Get state list from database
70
+ * @param regionId Region id
71
+ * @param language Language
72
+ * @returns Result
73
+ */
74
+ states(regionId, language) {
75
+ language = this.app.checkLanguage(language);
76
+ return this.app.api.get(`Address/StateList?regionId=${regionId}&language=${language}`, undefined, { defaultValue: [] });
77
+ }
78
+ }
@@ -0,0 +1,26 @@
1
+ import { ListType } from '@etsoo/shared';
2
+ import { IApp } from '../app/IApp';
3
+ /**
4
+ * Organization API
5
+ */
6
+ export declare class OrgApi {
7
+ private app;
8
+ /**
9
+ * Constructor
10
+ * @param app Application
11
+ */
12
+ constructor(app: IApp);
13
+ /**
14
+ * Get organization list
15
+ * @param items Max items
16
+ * @param serviceId Service id
17
+ * @returns Result
18
+ */
19
+ list(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
20
+ /**
21
+ * Switch organization
22
+ * @param id Organization id
23
+ * @param serviceId Service id
24
+ */
25
+ switch(id: number, serviceId?: number): Promise<boolean | undefined>;
26
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Organization API
3
+ */
4
+ export class OrgApi {
5
+ /**
6
+ * Constructor
7
+ * @param app Application
8
+ */
9
+ constructor(app) {
10
+ this.app = app;
11
+ }
12
+ /**
13
+ * Get organization list
14
+ * @param items Max items
15
+ * @param serviceId Service id
16
+ * @returns Result
17
+ */
18
+ list(items, serviceId) {
19
+ return this.app.api.post('Organization/List', {
20
+ items,
21
+ serviceId
22
+ }, { defaultValue: [], showLoading: false });
23
+ }
24
+ /**
25
+ * Switch organization
26
+ * @param id Organization id
27
+ * @param serviceId Service id
28
+ */
29
+ async switch(id, serviceId) {
30
+ const result = await this.app.api.put('Organization/Switch', {
31
+ id,
32
+ serviceId,
33
+ deviceId: this.app.deviceId
34
+ });
35
+ if (result)
36
+ return await this.app.refreshToken();
37
+ return result;
38
+ }
39
+ }
@@ -0,0 +1,81 @@
1
+ import { ListType, ListType1 } from '@etsoo/shared';
2
+ import { IApp } from '../app/IApp';
3
+ import { Currency } from '../business/Currency';
4
+ import { ProductUnit } from '../business/ProductUnit';
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 {
13
+ private app;
14
+ /**
15
+ * Constructor
16
+ * @param app Application
17
+ */
18
+ constructor(app: IApp);
19
+ /**
20
+ * Get currencies
21
+ * @param currencyNames Limited currency names for local data, undefined will try to retrive remoately
22
+ * @returns Result
23
+ */
24
+ currencies<T extends string[] | Currency[] | undefined>(currencyNames?: T): Promise<T extends undefined ? CurrencyDto[] | undefined : ListType1[]>;
25
+ /**
26
+ * Get exchange rate
27
+ * @param currency Currency
28
+ * @returns Result
29
+ */
30
+ exchangeRate(currency: Currency): Promise<ExchangeRateDto | undefined>;
31
+ /**
32
+ * Get exchange rate history
33
+ * @param currencies Currencies
34
+ * @param months Max months
35
+ * @returns Result
36
+ */
37
+ exchangeRateHistory(currencies: Currency[], months?: number): Promise<ExchangeRateHistoryDto[] | undefined>;
38
+ /**
39
+ * Get product unit's label
40
+ * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
41
+ * @param unit Unit
42
+ * @param isJoined Add the join label like 'per Kg' for Kg
43
+ * @returns Label
44
+ */
45
+ getUnitLabel(unit: ProductUnit, isJoined?: boolean | string): string;
46
+ private getUnitJoin;
47
+ /**
48
+ * Get mobile base64 QRCode
49
+ * @param id User id
50
+ * @param host Host URL
51
+ */
52
+ mobileQRCode(id?: string, host?: string): Promise<string | undefined>;
53
+ /**
54
+ * Get public and valid product data
55
+ * @param id Product/Service Id or Uid
56
+ * @param culture Language
57
+ * @returns Result
58
+ */
59
+ product<T extends number | string>(id: T, culture?: string): T extends number ? PublicProductDto : PublicOrgProductDto;
60
+ /**
61
+ *
62
+ * Get all repeat options
63
+ * @param options Define the order and limit the items
64
+ * @param isJoined Add the join label like 'per Kg' for Kg
65
+ * @returns Units
66
+ */
67
+ repeatOptions(options?: string[], isJoined?: boolean): ListType[];
68
+ /**
69
+ * Get all product units
70
+ * @returns Units
71
+ */
72
+ units(): ListType[];
73
+ /**
74
+ *
75
+ * Get all product units
76
+ * @param options Define the order and limit the items
77
+ * @param isJoined Add the join label like 'per Kg' for Kg
78
+ * @returns Units
79
+ */
80
+ units(options?: string[], isJoined?: boolean): ListType[];
81
+ }
@@ -0,0 +1,120 @@
1
+ import { DataTypes } from '@etsoo/shared';
2
+ import { ProductUnit } from '../business/ProductUnit';
3
+ import { RepeatOption } from '../business/RepeatOption';
4
+ /**
5
+ * Public API
6
+ */
7
+ export class PublicApi {
8
+ /**
9
+ * Constructor
10
+ * @param app Application
11
+ */
12
+ constructor(app) {
13
+ this.app = app;
14
+ }
15
+ /**
16
+ * Get currencies
17
+ * @param currencyNames Limited currency names for local data, undefined will try to retrive remoately
18
+ * @returns Result
19
+ */
20
+ async currencies(currencyNames) {
21
+ if (currencyNames == null)
22
+ return (await this.app.api.get('Public/GetCurrencies'));
23
+ else
24
+ return currencyNames.map((name) => {
25
+ var _a;
26
+ return ({
27
+ id: name,
28
+ label: (_a = this.app.get(`currency${name}`)) !== null && _a !== void 0 ? _a : name
29
+ });
30
+ });
31
+ }
32
+ /**
33
+ * Get exchange rate
34
+ * @param currency Currency
35
+ * @returns Result
36
+ */
37
+ exchangeRate(currency) {
38
+ return this.app.api.get(`Public/ExchangeRate/${currency}`);
39
+ }
40
+ /**
41
+ * Get exchange rate history
42
+ * @param currencies Currencies
43
+ * @param months Max months
44
+ * @returns Result
45
+ */
46
+ exchangeRateHistory(currencies, months) {
47
+ return this.app.api.post('Public/ExchangeRateHistory', { currencies, months }, { defaultValue: [] });
48
+ }
49
+ /**
50
+ * Get product unit's label
51
+ * Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
52
+ * @param unit Unit
53
+ * @param isJoined Add the join label like 'per Kg' for Kg
54
+ * @returns Label
55
+ */
56
+ getUnitLabel(unit, isJoined) {
57
+ var _a;
58
+ const key = ProductUnit[unit];
59
+ const label = (_a = this.app.get('unit' + key)) !== null && _a !== void 0 ? _a : key;
60
+ const join = this.getUnitJoin(isJoined);
61
+ if (join) {
62
+ return join.format(label);
63
+ }
64
+ return label;
65
+ }
66
+ getUnitJoin(isJoined) {
67
+ var _a;
68
+ return typeof isJoined === 'string'
69
+ ? (_a = this.app.get(isJoined)) !== null && _a !== void 0 ? _a : isJoined
70
+ : isJoined
71
+ ? this.app.get('unitJoin')
72
+ : undefined;
73
+ }
74
+ /**
75
+ * Get mobile base64 QRCode
76
+ * @param id User id
77
+ * @param host Host URL
78
+ */
79
+ mobileQRCode(id, host) {
80
+ return this.app.api.post('Public/MobileQRCode', { id, host });
81
+ }
82
+ /**
83
+ * Get public and valid product data
84
+ * @param id Product/Service Id or Uid
85
+ * @param culture Language
86
+ * @returns Result
87
+ */
88
+ product(id, culture) {
89
+ culture = this.app.checkLanguage(culture);
90
+ return this.app.api.post(`Public/Product/${id}/${culture}`);
91
+ }
92
+ /**
93
+ *
94
+ * Get all repeat options
95
+ * @param options Define the order and limit the items
96
+ * @param isJoined Add the join label like 'per Kg' for Kg
97
+ * @returns Units
98
+ */
99
+ repeatOptions(options, isJoined = true) {
100
+ options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(RepeatOption));
101
+ return this.units(options, isJoined);
102
+ }
103
+ /**
104
+ *
105
+ * Get all product units
106
+ * @param options Define the order and limit the items
107
+ * @param isJoined Add the join label like 'per Kg' for Kg
108
+ * @returns Units
109
+ */
110
+ units(options, isJoined) {
111
+ options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(ProductUnit));
112
+ return options.map((key) => {
113
+ const id = DataTypes.getEnumByKey(ProductUnit, key);
114
+ return {
115
+ id,
116
+ label: this.getUnitLabel(id, this.getUnitJoin(isJoined)).formatInitial(true)
117
+ };
118
+ });
119
+ }
120
+ }
@@ -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,9 @@ 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/OrgApi';
24
+ export * from './erp/PublicApi';
20
25
  export * from './i18n/enUS';
21
26
  export * from './i18n/zhCN';
22
27
  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,10 @@ 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/OrgApi';
31
+ export * from './erp/PublicApi';
26
32
  // i18n
27
33
  export * from './i18n/enUS';
28
34
  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.3",
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;