@etsoo/appscript 1.4.26 → 1.4.27

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.
@@ -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
  });
@@ -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
@@ -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
@@ -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
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.4.26",
3
+ "version": "1.4.27",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -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