@etsoo/appscript 1.3.35 → 1.3.37
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/lib/cjs/address/AddressRegion.d.ts +5 -0
- package/lib/cjs/erp/AddressApi.js +11 -2
- package/lib/cjs/erp/rq/RegionsRQ.d.ts +4 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/mjs/address/AddressRegion.d.ts +5 -0
- package/lib/mjs/erp/AddressApi.js +11 -2
- package/lib/mjs/erp/rq/RegionsRQ.d.ts +4 -0
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +1 -0
- package/package.json +1 -1
- package/src/address/AddressRegion.ts +6 -0
- package/src/erp/AddressApi.ts +9 -2
- package/src/erp/rq/RegionsRQ.ts +5 -0
- package/src/index.ts +1 -0
|
@@ -48,10 +48,19 @@ class AddressApi extends BaseApi_1.BaseApi {
|
|
|
48
48
|
return undefined;
|
|
49
49
|
cachedRegions[culture] = regions;
|
|
50
50
|
}
|
|
51
|
-
const { favoredIds = [], items = 8, keyword } = rq !== null && rq !== void 0 ? rq : {};
|
|
51
|
+
const { id, favoredIds = [], items = 8, keyword } = rq !== null && rq !== void 0 ? rq : {};
|
|
52
|
+
// Id first
|
|
53
|
+
if (id) {
|
|
54
|
+
return regions.filter((region) => region.id === id);
|
|
55
|
+
}
|
|
52
56
|
// Keyword filter
|
|
53
57
|
if (keyword)
|
|
54
|
-
regions = regions.filter((region) =>
|
|
58
|
+
regions = regions.filter((region) => {
|
|
59
|
+
var _a;
|
|
60
|
+
return region.label.includes(keyword) ||
|
|
61
|
+
((_a = region.py) === null || _a === void 0 ? void 0 : _a.includes(keyword.toUpperCase())) ||
|
|
62
|
+
region.id === keyword.toUpperCase();
|
|
63
|
+
});
|
|
55
64
|
// Order by favoredIds
|
|
56
65
|
if (favoredIds.length > 0) {
|
|
57
66
|
regions = [...regions].sort((r1, r2) => {
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export * from './erp/rq/OrgListRQ';
|
|
|
32
32
|
export * from './erp/rq/OrgQueryRQ';
|
|
33
33
|
export * from './erp/rq/QueryRQ';
|
|
34
34
|
export * from './erp/rq/RefreshTokenRQ';
|
|
35
|
+
export * from './erp/rq/RegionsRQ';
|
|
35
36
|
export * from './erp/rq/TiplistRQ';
|
|
36
37
|
export * from './erp/AddressApi';
|
|
37
38
|
export * from './erp/BaseApi';
|
package/lib/cjs/index.js
CHANGED
|
@@ -56,6 +56,7 @@ __exportStar(require("./erp/rq/OrgListRQ"), exports);
|
|
|
56
56
|
__exportStar(require("./erp/rq/OrgQueryRQ"), exports);
|
|
57
57
|
__exportStar(require("./erp/rq/QueryRQ"), exports);
|
|
58
58
|
__exportStar(require("./erp/rq/RefreshTokenRQ"), exports);
|
|
59
|
+
__exportStar(require("./erp/rq/RegionsRQ"), exports);
|
|
59
60
|
__exportStar(require("./erp/rq/TiplistRQ"), exports);
|
|
60
61
|
// erp api
|
|
61
62
|
__exportStar(require("./erp/AddressApi"), exports);
|
|
@@ -45,10 +45,19 @@ export class AddressApi extends BaseApi {
|
|
|
45
45
|
return undefined;
|
|
46
46
|
cachedRegions[culture] = regions;
|
|
47
47
|
}
|
|
48
|
-
const { favoredIds = [], items = 8, keyword } = rq !== null && rq !== void 0 ? rq : {};
|
|
48
|
+
const { id, favoredIds = [], items = 8, keyword } = rq !== null && rq !== void 0 ? rq : {};
|
|
49
|
+
// Id first
|
|
50
|
+
if (id) {
|
|
51
|
+
return regions.filter((region) => region.id === id);
|
|
52
|
+
}
|
|
49
53
|
// Keyword filter
|
|
50
54
|
if (keyword)
|
|
51
|
-
regions = regions.filter((region) =>
|
|
55
|
+
regions = regions.filter((region) => {
|
|
56
|
+
var _a;
|
|
57
|
+
return region.label.includes(keyword) ||
|
|
58
|
+
((_a = region.py) === null || _a === void 0 ? void 0 : _a.includes(keyword.toUpperCase())) ||
|
|
59
|
+
region.id === keyword.toUpperCase();
|
|
60
|
+
});
|
|
52
61
|
// Order by favoredIds
|
|
53
62
|
if (favoredIds.length > 0) {
|
|
54
63
|
regions = [...regions].sort((r1, r2) => {
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export * from './erp/rq/OrgListRQ';
|
|
|
32
32
|
export * from './erp/rq/OrgQueryRQ';
|
|
33
33
|
export * from './erp/rq/QueryRQ';
|
|
34
34
|
export * from './erp/rq/RefreshTokenRQ';
|
|
35
|
+
export * from './erp/rq/RegionsRQ';
|
|
35
36
|
export * from './erp/rq/TiplistRQ';
|
|
36
37
|
export * from './erp/AddressApi';
|
|
37
38
|
export * from './erp/BaseApi';
|
package/lib/mjs/index.js
CHANGED
|
@@ -39,6 +39,7 @@ export * from './erp/rq/OrgListRQ';
|
|
|
39
39
|
export * from './erp/rq/OrgQueryRQ';
|
|
40
40
|
export * from './erp/rq/QueryRQ';
|
|
41
41
|
export * from './erp/rq/RefreshTokenRQ';
|
|
42
|
+
export * from './erp/rq/RegionsRQ';
|
|
42
43
|
export * from './erp/rq/TiplistRQ';
|
|
43
44
|
// erp api
|
|
44
45
|
export * from './erp/AddressApi';
|
package/package.json
CHANGED
package/src/erp/AddressApi.ts
CHANGED
|
@@ -59,13 +59,20 @@ export class AddressApi extends BaseApi {
|
|
|
59
59
|
cachedRegions[culture] = regions;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const { favoredIds = [], items = 8, keyword } = rq ?? {};
|
|
62
|
+
const { id, favoredIds = [], items = 8, keyword } = rq ?? {};
|
|
63
|
+
|
|
64
|
+
// Id first
|
|
65
|
+
if (id) {
|
|
66
|
+
return regions.filter((region) => region.id === id);
|
|
67
|
+
}
|
|
63
68
|
|
|
64
69
|
// Keyword filter
|
|
65
70
|
if (keyword)
|
|
66
71
|
regions = regions.filter(
|
|
67
72
|
(region) =>
|
|
68
|
-
region.label.includes(keyword) ||
|
|
73
|
+
region.label.includes(keyword) ||
|
|
74
|
+
region.py?.includes(keyword.toUpperCase()) ||
|
|
75
|
+
region.id === keyword.toUpperCase()
|
|
69
76
|
);
|
|
70
77
|
|
|
71
78
|
// Order by favoredIds
|
package/src/erp/rq/RegionsRQ.ts
CHANGED
package/src/index.ts
CHANGED