@etsoo/appscript 1.4.26 → 1.4.28
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/__tests__/app/CoreApp.ts +6 -0
- package/lib/cjs/app/CoreApp.js +3 -1
- package/lib/cjs/erp/PublicApi.d.ts +6 -0
- package/lib/cjs/erp/PublicApi.js +8 -0
- package/lib/mjs/app/CoreApp.js +3 -1
- package/lib/mjs/erp/PublicApi.d.ts +6 -0
- package/lib/mjs/erp/PublicApi.js +8 -0
- package/package.json +1 -1
- package/src/app/CoreApp.ts +4 -1
- package/src/erp/PublicApi.ts +9 -0
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -333,6 +333,11 @@ test('Tests for publicApi', async () => {
|
|
|
333
333
|
});
|
|
334
334
|
expect(defaultExchangeRate?.exchangeRate).toBe(100);
|
|
335
335
|
|
|
336
|
+
const url = app.publicApi.getOrgAvatar(1);
|
|
337
|
+
expect(url).toBe(
|
|
338
|
+
'http://localhost/com.etsoo.SmartERPApi/api/Storage/OrgAvatar/1'
|
|
339
|
+
);
|
|
340
|
+
|
|
336
341
|
/*
|
|
337
342
|
const amount1 = await app.publicApi.exchangeAmount(1000, 'NZD', 'CNY');
|
|
338
343
|
const amount2 = await app.publicApi.exchangeAmount(100, 'NZD', 'USD');
|
|
@@ -343,5 +348,6 @@ test('Tests for publicApi', async () => {
|
|
|
343
348
|
|
|
344
349
|
const orgsQuery = await app.orgApi.query({ currentPage: 1, batchSize: 2 });
|
|
345
350
|
console.log(orgsQuery);
|
|
351
|
+
|
|
346
352
|
*/
|
|
347
353
|
});
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -1299,7 +1299,9 @@ class CoreApp {
|
|
|
1299
1299
|
* @param tryLogin Try to login again
|
|
1300
1300
|
*/
|
|
1301
1301
|
toLoginPage(tryLogin) {
|
|
1302
|
-
const url = '
|
|
1302
|
+
const url = '/?url=' +
|
|
1303
|
+
encodeURIComponent(location.href) +
|
|
1304
|
+
(tryLogin ? '' : '&tryLogin=false');
|
|
1303
1305
|
this.navigate(url);
|
|
1304
1306
|
}
|
|
1305
1307
|
/**
|
|
@@ -63,6 +63,12 @@ export declare class PublicApi extends BaseApi {
|
|
|
63
63
|
* @returns Result
|
|
64
64
|
*/
|
|
65
65
|
exchangeRateHistory(currencies: (Currency | string)[], months?: number, payload?: IApiPayload<ExchangeRateHistoryDto[]>): Promise<ExchangeRateHistoryDto[] | undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* Get organization's avatar URL
|
|
68
|
+
* @param id Organization id
|
|
69
|
+
* @returns Result
|
|
70
|
+
*/
|
|
71
|
+
getOrgAvatar(id: number): string;
|
|
66
72
|
/**
|
|
67
73
|
* Get currency label
|
|
68
74
|
* @param currency Currency
|
package/lib/cjs/erp/PublicApi.js
CHANGED
|
@@ -118,6 +118,14 @@ class PublicApi extends BaseApi_1.BaseApi {
|
|
|
118
118
|
payload !== null && payload !== void 0 ? payload : (payload = { defaultValue: [] });
|
|
119
119
|
return this.api.post('Public/ExchangeRateHistory', { currencies, months }, payload);
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Get organization's avatar URL
|
|
123
|
+
* @param id Organization id
|
|
124
|
+
* @returns Result
|
|
125
|
+
*/
|
|
126
|
+
getOrgAvatar(id) {
|
|
127
|
+
return `${this.api.baseUrl}Storage/OrgAvatar/${id}`;
|
|
128
|
+
}
|
|
121
129
|
/**
|
|
122
130
|
* Get currency label
|
|
123
131
|
* @param currency Currency
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -1273,7 +1273,9 @@ export class CoreApp {
|
|
|
1273
1273
|
* @param tryLogin Try to login again
|
|
1274
1274
|
*/
|
|
1275
1275
|
toLoginPage(tryLogin) {
|
|
1276
|
-
const url = '
|
|
1276
|
+
const url = '/?url=' +
|
|
1277
|
+
encodeURIComponent(location.href) +
|
|
1278
|
+
(tryLogin ? '' : '&tryLogin=false');
|
|
1277
1279
|
this.navigate(url);
|
|
1278
1280
|
}
|
|
1279
1281
|
/**
|
|
@@ -63,6 +63,12 @@ export declare class PublicApi extends BaseApi {
|
|
|
63
63
|
* @returns Result
|
|
64
64
|
*/
|
|
65
65
|
exchangeRateHistory(currencies: (Currency | string)[], months?: number, payload?: IApiPayload<ExchangeRateHistoryDto[]>): Promise<ExchangeRateHistoryDto[] | undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* Get organization's avatar URL
|
|
68
|
+
* @param id Organization id
|
|
69
|
+
* @returns Result
|
|
70
|
+
*/
|
|
71
|
+
getOrgAvatar(id: number): string;
|
|
66
72
|
/**
|
|
67
73
|
* Get currency label
|
|
68
74
|
* @param currency Currency
|
package/lib/mjs/erp/PublicApi.js
CHANGED
|
@@ -115,6 +115,14 @@ export class PublicApi extends BaseApi {
|
|
|
115
115
|
payload !== null && payload !== void 0 ? payload : (payload = { defaultValue: [] });
|
|
116
116
|
return this.api.post('Public/ExchangeRateHistory', { currencies, months }, payload);
|
|
117
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Get organization's avatar URL
|
|
120
|
+
* @param id Organization id
|
|
121
|
+
* @returns Result
|
|
122
|
+
*/
|
|
123
|
+
getOrgAvatar(id) {
|
|
124
|
+
return `${this.api.baseUrl}Storage/OrgAvatar/${id}`;
|
|
125
|
+
}
|
|
118
126
|
/**
|
|
119
127
|
* Get currency label
|
|
120
128
|
* @param currency Currency
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
|
@@ -1667,7 +1667,10 @@ export abstract class CoreApp<
|
|
|
1667
1667
|
* @param tryLogin Try to login again
|
|
1668
1668
|
*/
|
|
1669
1669
|
toLoginPage(tryLogin?: boolean) {
|
|
1670
|
-
const url =
|
|
1670
|
+
const url =
|
|
1671
|
+
'/?url=' +
|
|
1672
|
+
encodeURIComponent(location.href) +
|
|
1673
|
+
(tryLogin ? '' : '&tryLogin=false');
|
|
1671
1674
|
this.navigate(url);
|
|
1672
1675
|
}
|
|
1673
1676
|
|
package/src/erp/PublicApi.ts
CHANGED
|
@@ -158,6 +158,15 @@ export class PublicApi extends BaseApi {
|
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Get organization's avatar URL
|
|
163
|
+
* @param id Organization id
|
|
164
|
+
* @returns Result
|
|
165
|
+
*/
|
|
166
|
+
getOrgAvatar(id: number) {
|
|
167
|
+
return `${this.api.baseUrl}Storage/OrgAvatar/${id}`;
|
|
168
|
+
}
|
|
169
|
+
|
|
161
170
|
/**
|
|
162
171
|
* Get currency label
|
|
163
172
|
* @param currency Currency
|