@etsoo/appscript 1.4.39 → 1.4.41
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 +2 -0
- package/lib/cjs/app/CoreApp.d.ts +1 -1
- package/lib/cjs/app/IApp.d.ts +1 -1
- package/lib/cjs/erp/PublicApi.d.ts +6 -0
- package/lib/cjs/erp/PublicApi.js +8 -0
- package/lib/mjs/app/CoreApp.d.ts +1 -1
- package/lib/mjs/app/IApp.d.ts +1 -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 +1 -1
- package/src/app/IApp.ts +4 -1
- package/src/erp/PublicApi.ts +9 -0
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -349,5 +349,7 @@ test('Tests for publicApi', async () => {
|
|
|
349
349
|
const orgsQuery = await app.orgApi.query({ currentPage: 1, batchSize: 2 });
|
|
350
350
|
console.log(orgsQuery);
|
|
351
351
|
|
|
352
|
+
const cultures = await app.publicApi.supportedCultures();
|
|
353
|
+
expect(cultures?.some((culture) => culture.id === 'zh-Hans')).toBeTruthy();
|
|
352
354
|
*/
|
|
353
355
|
});
|
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -184,7 +184,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
184
184
|
* @param api Api
|
|
185
185
|
* @param handlerFor401 Handler for 401 error
|
|
186
186
|
*/
|
|
187
|
-
setApiErrorHandler(api: IApi, handlerFor401?: boolean | (() => void)): void;
|
|
187
|
+
setApiErrorHandler(api: IApi, handlerFor401?: boolean | (() => Promise<void>)): void;
|
|
188
188
|
/**
|
|
189
189
|
* Setup Api loading
|
|
190
190
|
* @param api Api
|
package/lib/cjs/app/IApp.d.ts
CHANGED
|
@@ -453,7 +453,7 @@ export interface IApp {
|
|
|
453
453
|
* @param api Api
|
|
454
454
|
* @param handlerFor401 Handler for 401 error
|
|
455
455
|
*/
|
|
456
|
-
setApiErrorHandler(api: IApi, handlerFor401?: boolean): void;
|
|
456
|
+
setApiErrorHandler(api: IApi, handlerFor401?: boolean | (() => Promise<void>)): void;
|
|
457
457
|
/**
|
|
458
458
|
* Setup Api loading
|
|
459
459
|
* @param api Api
|
|
@@ -114,6 +114,12 @@ export declare class PublicApi extends BaseApi {
|
|
|
114
114
|
* @returns Units
|
|
115
115
|
*/
|
|
116
116
|
repeatOptions(options?: string[], isJoined?: boolean): ListType[];
|
|
117
|
+
/**
|
|
118
|
+
* Get all supported cultures
|
|
119
|
+
* @param payload Payload
|
|
120
|
+
* @returns Result
|
|
121
|
+
*/
|
|
122
|
+
supportedCultures(payload?: IApiPayload<ListType1[]>): Promise<ListType1[] | undefined>;
|
|
117
123
|
/**
|
|
118
124
|
* Get all product units
|
|
119
125
|
* @returns Units
|
package/lib/cjs/erp/PublicApi.js
CHANGED
|
@@ -204,6 +204,14 @@ class PublicApi extends BaseApi_1.BaseApi {
|
|
|
204
204
|
options !== null && options !== void 0 ? options : (options = shared_1.DataTypes.getEnumKeys(RepeatOption_1.RepeatOption));
|
|
205
205
|
return this.units(options, isJoined);
|
|
206
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Get all supported cultures
|
|
209
|
+
* @param payload Payload
|
|
210
|
+
* @returns Result
|
|
211
|
+
*/
|
|
212
|
+
supportedCultures(payload) {
|
|
213
|
+
return this.api.get('Public/SupportedCultures', undefined, payload);
|
|
214
|
+
}
|
|
207
215
|
/**
|
|
208
216
|
*
|
|
209
217
|
* Get all product units
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -184,7 +184,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
184
184
|
* @param api Api
|
|
185
185
|
* @param handlerFor401 Handler for 401 error
|
|
186
186
|
*/
|
|
187
|
-
setApiErrorHandler(api: IApi, handlerFor401?: boolean | (() => void)): void;
|
|
187
|
+
setApiErrorHandler(api: IApi, handlerFor401?: boolean | (() => Promise<void>)): void;
|
|
188
188
|
/**
|
|
189
189
|
* Setup Api loading
|
|
190
190
|
* @param api Api
|
package/lib/mjs/app/IApp.d.ts
CHANGED
|
@@ -453,7 +453,7 @@ export interface IApp {
|
|
|
453
453
|
* @param api Api
|
|
454
454
|
* @param handlerFor401 Handler for 401 error
|
|
455
455
|
*/
|
|
456
|
-
setApiErrorHandler(api: IApi, handlerFor401?: boolean): void;
|
|
456
|
+
setApiErrorHandler(api: IApi, handlerFor401?: boolean | (() => Promise<void>)): void;
|
|
457
457
|
/**
|
|
458
458
|
* Setup Api loading
|
|
459
459
|
* @param api Api
|
|
@@ -114,6 +114,12 @@ export declare class PublicApi extends BaseApi {
|
|
|
114
114
|
* @returns Units
|
|
115
115
|
*/
|
|
116
116
|
repeatOptions(options?: string[], isJoined?: boolean): ListType[];
|
|
117
|
+
/**
|
|
118
|
+
* Get all supported cultures
|
|
119
|
+
* @param payload Payload
|
|
120
|
+
* @returns Result
|
|
121
|
+
*/
|
|
122
|
+
supportedCultures(payload?: IApiPayload<ListType1[]>): Promise<ListType1[] | undefined>;
|
|
117
123
|
/**
|
|
118
124
|
* Get all product units
|
|
119
125
|
* @returns Units
|
package/lib/mjs/erp/PublicApi.js
CHANGED
|
@@ -201,6 +201,14 @@ export class PublicApi extends BaseApi {
|
|
|
201
201
|
options !== null && options !== void 0 ? options : (options = DataTypes.getEnumKeys(RepeatOption));
|
|
202
202
|
return this.units(options, isJoined);
|
|
203
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Get all supported cultures
|
|
206
|
+
* @param payload Payload
|
|
207
|
+
* @returns Result
|
|
208
|
+
*/
|
|
209
|
+
supportedCultures(payload) {
|
|
210
|
+
return this.api.get('Public/SupportedCultures', undefined, payload);
|
|
211
|
+
}
|
|
204
212
|
/**
|
|
205
213
|
*
|
|
206
214
|
* Get all product units
|
package/package.json
CHANGED
package/src/app/CoreApp.ts
CHANGED
package/src/app/IApp.ts
CHANGED
|
@@ -611,7 +611,10 @@ export interface IApp {
|
|
|
611
611
|
* @param api Api
|
|
612
612
|
* @param handlerFor401 Handler for 401 error
|
|
613
613
|
*/
|
|
614
|
-
setApiErrorHandler(
|
|
614
|
+
setApiErrorHandler(
|
|
615
|
+
api: IApi,
|
|
616
|
+
handlerFor401?: boolean | (() => Promise<void>)
|
|
617
|
+
): void;
|
|
615
618
|
|
|
616
619
|
/**
|
|
617
620
|
* Setup Api loading
|
package/src/erp/PublicApi.ts
CHANGED
|
@@ -258,6 +258,15 @@ export class PublicApi extends BaseApi {
|
|
|
258
258
|
return this.units(options, isJoined);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Get all supported cultures
|
|
263
|
+
* @param payload Payload
|
|
264
|
+
* @returns Result
|
|
265
|
+
*/
|
|
266
|
+
supportedCultures(payload?: IApiPayload<ListType1[]>) {
|
|
267
|
+
return this.api.get('Public/SupportedCultures', undefined, payload);
|
|
268
|
+
}
|
|
269
|
+
|
|
261
270
|
/**
|
|
262
271
|
* Get all product units
|
|
263
272
|
* @returns Units
|