@etsoo/smarterp-core 1.0.0

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 (226) hide show
  1. package/.github/workflows/main.yml +60 -0
  2. package/LICENSE +21 -0
  3. package/README.md +17 -0
  4. package/__tests__/OrgApi.ts +132 -0
  5. package/__tests__/PublicApi.ts +130 -0
  6. package/__tests__/UserApi.ts +29 -0
  7. package/__tests__/app/TestApp.ts +138 -0
  8. package/__tests__/tsconfig.json +18 -0
  9. package/babel.config.json +11 -0
  10. package/lib/cjs/AppApi.d.ts +48 -0
  11. package/lib/cjs/AppApi.js +54 -0
  12. package/lib/cjs/CoreApp.d.ts +58 -0
  13. package/lib/cjs/CoreApp.js +68 -0
  14. package/lib/cjs/MemberApi.d.ts +38 -0
  15. package/lib/cjs/MemberApi.js +45 -0
  16. package/lib/cjs/OrgApi.d.ts +95 -0
  17. package/lib/cjs/OrgApi.js +110 -0
  18. package/lib/cjs/PublicApi.d.ts +105 -0
  19. package/lib/cjs/PublicApi.js +143 -0
  20. package/lib/cjs/UserApi.d.ts +53 -0
  21. package/lib/cjs/UserApi.js +68 -0
  22. package/lib/cjs/dto/IdentityType.d.ts +21 -0
  23. package/lib/cjs/dto/IdentityType.js +25 -0
  24. package/lib/cjs/dto/app/AppData.d.ts +31 -0
  25. package/lib/cjs/dto/app/AppData.js +2 -0
  26. package/lib/cjs/dto/app/AppListDto.d.ts +6 -0
  27. package/lib/cjs/dto/app/AppListDto.js +2 -0
  28. package/lib/cjs/dto/app/AppPurchasedQueryData.d.ts +28 -0
  29. package/lib/cjs/dto/app/AppPurchasedQueryData.js +2 -0
  30. package/lib/cjs/dto/app/AppQueryData.d.ts +42 -0
  31. package/lib/cjs/dto/app/AppQueryData.js +2 -0
  32. package/lib/cjs/dto/member/MemberListDto.d.ts +6 -0
  33. package/lib/cjs/dto/member/MemberListDto.js +2 -0
  34. package/lib/cjs/dto/member/MemberQueryDto.d.ts +35 -0
  35. package/lib/cjs/dto/member/MemberQueryDto.js +2 -0
  36. package/lib/cjs/dto/org/OrgGetMyData.d.ts +21 -0
  37. package/lib/cjs/dto/org/OrgGetMyData.js +2 -0
  38. package/lib/cjs/dto/org/OrgListDto.d.ts +6 -0
  39. package/lib/cjs/dto/org/OrgListDto.js +2 -0
  40. package/lib/cjs/dto/org/OrgQueryDto.d.ts +39 -0
  41. package/lib/cjs/dto/org/OrgQueryDto.js +2 -0
  42. package/lib/cjs/dto/org/OrgReadDto.d.ts +47 -0
  43. package/lib/cjs/dto/org/OrgReadDto.js +2 -0
  44. package/lib/cjs/dto/org/OrgUpdateReadDto.d.ts +39 -0
  45. package/lib/cjs/dto/org/OrgUpdateReadDto.js +2 -0
  46. package/lib/cjs/dto/public/CurrencyItem.d.ts +31 -0
  47. package/lib/cjs/dto/public/CurrencyItem.js +2 -0
  48. package/lib/cjs/dto/public/PlaceCommon.d.ts +43 -0
  49. package/lib/cjs/dto/public/PlaceCommon.js +2 -0
  50. package/lib/cjs/dto/public/PlaceLocation.d.ts +14 -0
  51. package/lib/cjs/dto/public/PlaceLocation.js +2 -0
  52. package/lib/cjs/dto/public/RegionData.d.ts +36 -0
  53. package/lib/cjs/dto/public/RegionData.js +2 -0
  54. package/lib/cjs/dto/user/AuditHistoryDto.d.ts +26 -0
  55. package/lib/cjs/dto/user/AuditHistoryDto.js +2 -0
  56. package/lib/cjs/dto/user/DeviceListDto.d.ts +8 -0
  57. package/lib/cjs/dto/user/DeviceListDto.js +2 -0
  58. package/lib/cjs/i18n/CoreCulture.d.ts +44 -0
  59. package/lib/cjs/i18n/CoreCulture.js +52 -0
  60. package/lib/cjs/i18n/en.json +40 -0
  61. package/lib/cjs/i18n/zh-Hans.json +40 -0
  62. package/lib/cjs/i18n/zh-Hant.json +40 -0
  63. package/lib/cjs/index.d.ts +39 -0
  64. package/lib/cjs/index.js +59 -0
  65. package/lib/cjs/rq/app/AppGetMyRQ.d.ts +19 -0
  66. package/lib/cjs/rq/app/AppGetMyRQ.js +2 -0
  67. package/lib/cjs/rq/app/AppListRQ.d.ts +18 -0
  68. package/lib/cjs/rq/app/AppListRQ.js +2 -0
  69. package/lib/cjs/rq/app/AppPurchasedQueryRQ.d.ts +17 -0
  70. package/lib/cjs/rq/app/AppPurchasedQueryRQ.js +2 -0
  71. package/lib/cjs/rq/app/AppQueryRQ.d.ts +6 -0
  72. package/lib/cjs/rq/app/AppQueryRQ.js +2 -0
  73. package/lib/cjs/rq/member/MemberListRQ.d.ts +18 -0
  74. package/lib/cjs/rq/member/MemberListRQ.js +2 -0
  75. package/lib/cjs/rq/member/MemberQueryRQ.d.ts +10 -0
  76. package/lib/cjs/rq/member/MemberQueryRQ.js +2 -0
  77. package/lib/cjs/rq/org/OrgCreateRQ.d.ts +37 -0
  78. package/lib/cjs/rq/org/OrgCreateRQ.js +2 -0
  79. package/lib/cjs/rq/org/OrgGetMyRQ.d.ts +11 -0
  80. package/lib/cjs/rq/org/OrgGetMyRQ.js +2 -0
  81. package/lib/cjs/rq/org/OrgListRQ.d.ts +12 -0
  82. package/lib/cjs/rq/org/OrgListRQ.js +2 -0
  83. package/lib/cjs/rq/org/OrgQueryRQ.d.ts +11 -0
  84. package/lib/cjs/rq/org/OrgQueryRQ.js +2 -0
  85. package/lib/cjs/rq/org/OrgUpdateRQ.d.ts +37 -0
  86. package/lib/cjs/rq/org/OrgUpdateRQ.js +2 -0
  87. package/lib/cjs/rq/public/CreateBarcodeRQ.d.ts +56 -0
  88. package/lib/cjs/rq/public/CreateBarcodeRQ.js +2 -0
  89. package/lib/cjs/rq/public/PinyinRQ.d.ts +38 -0
  90. package/lib/cjs/rq/public/PinyinRQ.js +21 -0
  91. package/lib/cjs/rq/public/PlaceQueryRQ.d.ts +58 -0
  92. package/lib/cjs/rq/public/PlaceQueryRQ.js +21 -0
  93. package/lib/cjs/rq/user/AuditHistoryRQ.d.ts +19 -0
  94. package/lib/cjs/rq/user/AuditHistoryRQ.js +2 -0
  95. package/lib/mjs/AppApi.d.ts +48 -0
  96. package/lib/mjs/AppApi.js +50 -0
  97. package/lib/mjs/CoreApp.d.ts +58 -0
  98. package/lib/mjs/CoreApp.js +64 -0
  99. package/lib/mjs/MemberApi.d.ts +38 -0
  100. package/lib/mjs/MemberApi.js +41 -0
  101. package/lib/mjs/OrgApi.d.ts +95 -0
  102. package/lib/mjs/OrgApi.js +106 -0
  103. package/lib/mjs/PublicApi.d.ts +105 -0
  104. package/lib/mjs/PublicApi.js +139 -0
  105. package/lib/mjs/UserApi.d.ts +53 -0
  106. package/lib/mjs/UserApi.js +64 -0
  107. package/lib/mjs/dto/IdentityType.d.ts +21 -0
  108. package/lib/mjs/dto/IdentityType.js +22 -0
  109. package/lib/mjs/dto/app/AppData.d.ts +31 -0
  110. package/lib/mjs/dto/app/AppData.js +1 -0
  111. package/lib/mjs/dto/app/AppListDto.d.ts +6 -0
  112. package/lib/mjs/dto/app/AppListDto.js +1 -0
  113. package/lib/mjs/dto/app/AppPurchasedQueryData.d.ts +28 -0
  114. package/lib/mjs/dto/app/AppPurchasedQueryData.js +1 -0
  115. package/lib/mjs/dto/app/AppQueryData.d.ts +42 -0
  116. package/lib/mjs/dto/app/AppQueryData.js +1 -0
  117. package/lib/mjs/dto/member/MemberListDto.d.ts +6 -0
  118. package/lib/mjs/dto/member/MemberListDto.js +1 -0
  119. package/lib/mjs/dto/member/MemberQueryDto.d.ts +35 -0
  120. package/lib/mjs/dto/member/MemberQueryDto.js +1 -0
  121. package/lib/mjs/dto/org/OrgGetMyData.d.ts +21 -0
  122. package/lib/mjs/dto/org/OrgGetMyData.js +1 -0
  123. package/lib/mjs/dto/org/OrgListDto.d.ts +6 -0
  124. package/lib/mjs/dto/org/OrgListDto.js +1 -0
  125. package/lib/mjs/dto/org/OrgQueryDto.d.ts +39 -0
  126. package/lib/mjs/dto/org/OrgQueryDto.js +1 -0
  127. package/lib/mjs/dto/org/OrgReadDto.d.ts +47 -0
  128. package/lib/mjs/dto/org/OrgReadDto.js +1 -0
  129. package/lib/mjs/dto/org/OrgUpdateReadDto.d.ts +39 -0
  130. package/lib/mjs/dto/org/OrgUpdateReadDto.js +1 -0
  131. package/lib/mjs/dto/public/CurrencyItem.d.ts +31 -0
  132. package/lib/mjs/dto/public/CurrencyItem.js +1 -0
  133. package/lib/mjs/dto/public/PlaceCommon.d.ts +43 -0
  134. package/lib/mjs/dto/public/PlaceCommon.js +1 -0
  135. package/lib/mjs/dto/public/PlaceLocation.d.ts +14 -0
  136. package/lib/mjs/dto/public/PlaceLocation.js +1 -0
  137. package/lib/mjs/dto/public/RegionData.d.ts +36 -0
  138. package/lib/mjs/dto/public/RegionData.js +1 -0
  139. package/lib/mjs/dto/user/AuditHistoryDto.d.ts +26 -0
  140. package/lib/mjs/dto/user/AuditHistoryDto.js +1 -0
  141. package/lib/mjs/dto/user/DeviceListDto.d.ts +8 -0
  142. package/lib/mjs/dto/user/DeviceListDto.js +1 -0
  143. package/lib/mjs/i18n/CoreCulture.d.ts +44 -0
  144. package/lib/mjs/i18n/CoreCulture.js +49 -0
  145. package/lib/mjs/i18n/en.json +40 -0
  146. package/lib/mjs/i18n/zh-Hans.json +40 -0
  147. package/lib/mjs/i18n/zh-Hant.json +40 -0
  148. package/lib/mjs/index.d.ts +39 -0
  149. package/lib/mjs/index.js +43 -0
  150. package/lib/mjs/rq/app/AppGetMyRQ.d.ts +19 -0
  151. package/lib/mjs/rq/app/AppGetMyRQ.js +1 -0
  152. package/lib/mjs/rq/app/AppListRQ.d.ts +18 -0
  153. package/lib/mjs/rq/app/AppListRQ.js +1 -0
  154. package/lib/mjs/rq/app/AppPurchasedQueryRQ.d.ts +17 -0
  155. package/lib/mjs/rq/app/AppPurchasedQueryRQ.js +1 -0
  156. package/lib/mjs/rq/app/AppQueryRQ.d.ts +6 -0
  157. package/lib/mjs/rq/app/AppQueryRQ.js +1 -0
  158. package/lib/mjs/rq/member/MemberListRQ.d.ts +18 -0
  159. package/lib/mjs/rq/member/MemberListRQ.js +1 -0
  160. package/lib/mjs/rq/member/MemberQueryRQ.d.ts +10 -0
  161. package/lib/mjs/rq/member/MemberQueryRQ.js +1 -0
  162. package/lib/mjs/rq/org/OrgCreateRQ.d.ts +37 -0
  163. package/lib/mjs/rq/org/OrgCreateRQ.js +1 -0
  164. package/lib/mjs/rq/org/OrgGetMyRQ.d.ts +11 -0
  165. package/lib/mjs/rq/org/OrgGetMyRQ.js +1 -0
  166. package/lib/mjs/rq/org/OrgListRQ.d.ts +12 -0
  167. package/lib/mjs/rq/org/OrgListRQ.js +1 -0
  168. package/lib/mjs/rq/org/OrgQueryRQ.d.ts +11 -0
  169. package/lib/mjs/rq/org/OrgQueryRQ.js +1 -0
  170. package/lib/mjs/rq/org/OrgUpdateRQ.d.ts +37 -0
  171. package/lib/mjs/rq/org/OrgUpdateRQ.js +1 -0
  172. package/lib/mjs/rq/public/CreateBarcodeRQ.d.ts +56 -0
  173. package/lib/mjs/rq/public/CreateBarcodeRQ.js +1 -0
  174. package/lib/mjs/rq/public/PinyinRQ.d.ts +38 -0
  175. package/lib/mjs/rq/public/PinyinRQ.js +18 -0
  176. package/lib/mjs/rq/public/PlaceQueryRQ.d.ts +58 -0
  177. package/lib/mjs/rq/public/PlaceQueryRQ.js +18 -0
  178. package/lib/mjs/rq/user/AuditHistoryRQ.d.ts +19 -0
  179. package/lib/mjs/rq/user/AuditHistoryRQ.js +1 -0
  180. package/package.json +75 -0
  181. package/src/AppApi.ts +66 -0
  182. package/src/CoreApp.ts +75 -0
  183. package/src/MemberApi.ts +51 -0
  184. package/src/OrgApi.ts +134 -0
  185. package/src/PublicApi.ts +183 -0
  186. package/src/UserApi.ts +77 -0
  187. package/src/dto/IdentityType.ts +23 -0
  188. package/src/dto/app/AppData.ts +35 -0
  189. package/src/dto/app/AppListDto.ts +7 -0
  190. package/src/dto/app/AppPurchasedQueryData.ts +32 -0
  191. package/src/dto/app/AppQueryData.ts +49 -0
  192. package/src/dto/member/MemberListDto.ts +7 -0
  193. package/src/dto/member/MemberQueryDto.ts +43 -0
  194. package/src/dto/org/OrgGetMyData.ts +23 -0
  195. package/src/dto/org/OrgListDto.ts +7 -0
  196. package/src/dto/org/OrgQueryDto.ts +47 -0
  197. package/src/dto/org/OrgReadDto.ts +57 -0
  198. package/src/dto/org/OrgUpdateReadDto.ts +47 -0
  199. package/src/dto/public/CurrencyItem.ts +35 -0
  200. package/src/dto/public/PlaceCommon.ts +52 -0
  201. package/src/dto/public/PlaceLocation.ts +15 -0
  202. package/src/dto/public/RegionData.ts +41 -0
  203. package/src/dto/user/AuditHistoryDto.ts +30 -0
  204. package/src/dto/user/DeviceListDto.ts +8 -0
  205. package/src/i18n/CoreCulture.ts +84 -0
  206. package/src/i18n/en.json +40 -0
  207. package/src/i18n/zh-Hans.json +40 -0
  208. package/src/i18n/zh-Hant.json +40 -0
  209. package/src/index.ts +54 -0
  210. package/src/rq/app/AppGetMyRQ.ts +21 -0
  211. package/src/rq/app/AppListRQ.ts +20 -0
  212. package/src/rq/app/AppPurchasedQueryRQ.ts +19 -0
  213. package/src/rq/app/AppQueryRQ.ts +7 -0
  214. package/src/rq/member/MemberListRQ.ts +21 -0
  215. package/src/rq/member/MemberQueryRQ.ts +11 -0
  216. package/src/rq/org/OrgCreateRQ.ts +43 -0
  217. package/src/rq/org/OrgGetMyRQ.ts +11 -0
  218. package/src/rq/org/OrgListRQ.ts +13 -0
  219. package/src/rq/org/OrgQueryRQ.ts +12 -0
  220. package/src/rq/org/OrgUpdateRQ.ts +43 -0
  221. package/src/rq/public/CreateBarcodeRQ.ts +65 -0
  222. package/src/rq/public/PinyinRQ.ts +43 -0
  223. package/src/rq/public/PlaceQueryRQ.ts +67 -0
  224. package/src/rq/user/AuditHistoryRQ.ts +22 -0
  225. package/tsconfig.cjs.json +19 -0
  226. package/tsconfig.json +19 -0
@@ -0,0 +1,19 @@
1
+ import { IdentityType } from "../../dto/IdentityType";
2
+ /**
3
+ * Get user's latest accessed applications request data
4
+ * 获取用户最近访问的应用请求数据
5
+ */
6
+ export type AppGetMyRQ = {
7
+ /**
8
+ * Maximum items
9
+ * 最大项数
10
+ * @default 10
11
+ */
12
+ maxItems?: number;
13
+ /**
14
+ * Identity type
15
+ * 身份类型
16
+ * @default IdentityType.User
17
+ */
18
+ identityType?: IdentityType;
19
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { QueryRQ } from "@etsoo/appscript";
2
+ import { IdentityType } from "../../dto/IdentityType";
3
+ /**
4
+ * Application list request data
5
+ * 应用列表请求数据
6
+ */
7
+ export type AppListRQ = QueryRQ & {
8
+ /**
9
+ * Identity type
10
+ * 身份类型
11
+ */
12
+ identityType?: IdentityType;
13
+ /**
14
+ * Require local URL or not
15
+ * 是否需要本地地址
16
+ */
17
+ requireLocalUrl?: boolean;
18
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { AppListRQ } from "./AppListRQ";
2
+ /**
3
+ * Application purchased query request data
4
+ * 应用已购买查询请求数据
5
+ */
6
+ export type AppPurchasedQueryRQ = AppListRQ & {
7
+ /**
8
+ * Expiry date
9
+ * 过期日期
10
+ */
11
+ expiry?: Date | string;
12
+ /**
13
+ * Expiry days
14
+ * 过期天数
15
+ */
16
+ expiryDays?: number;
17
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { AppListRQ } from "./AppListRQ";
2
+ /**
3
+ * Application query request data
4
+ * 应用查询请求数据
5
+ */
6
+ export type AppQueryRQ = AppListRQ & {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { StatusQueryRQ, UserRole } from "@etsoo/appscript";
2
+ /**
3
+ * Member list request data
4
+ */
5
+ export type MemberListRQ = StatusQueryRQ & {
6
+ /**
7
+ * Exclude self user or not
8
+ */
9
+ excludeSelf?: boolean;
10
+ /**
11
+ * User role
12
+ */
13
+ userRole?: UserRole;
14
+ /**
15
+ * User role start
16
+ */
17
+ userRoleStart?: UserRole;
18
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { MemberListRQ } from "./MemberListRQ";
2
+ /**
3
+ * Member query request data
4
+ */
5
+ export type MemberQueryRQ = MemberListRQ & {
6
+ /**
7
+ * Assigned ID
8
+ */
9
+ assignedId?: string;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import { EntityStatus } from "@etsoo/appscript";
2
+ /**
3
+ * Create organization request data
4
+ * 创建组织请求数据
5
+ */
6
+ export type OrgCreateRQ = {
7
+ /**
8
+ * Organization name
9
+ * 组织名称
10
+ */
11
+ name: string;
12
+ /**
13
+ * Brand
14
+ * 品牌
15
+ */
16
+ brand?: string;
17
+ /**
18
+ * PIN, unique code
19
+ * PIN,唯一代码
20
+ */
21
+ pin?: string;
22
+ /**
23
+ * Parent id
24
+ * 父级编号
25
+ */
26
+ parentId?: number;
27
+ /**
28
+ * Status
29
+ * 状况
30
+ */
31
+ status?: EntityStatus;
32
+ /**
33
+ * Query keyword
34
+ * 查询关键字
35
+ */
36
+ queryKeyword?: string;
37
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Get user's latest accessed organizations request data
3
+ * 获取用户最近访问的机构请求数据
4
+ */
5
+ export type OrgGetMyRQ = {
6
+ /**
7
+ * Max items
8
+ * 最大项数
9
+ */
10
+ maxItems: number;
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import { StatusQueryRQ } from "@etsoo/appscript";
2
+ /**
3
+ * Organization list request data
4
+ * 机构列表请求数据
5
+ */
6
+ export type OrgListRQ = StatusQueryRQ & {
7
+ /**
8
+ * Parent org ID
9
+ * 父级机构编号
10
+ */
11
+ parentId?: number;
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { OrgListRQ } from "./OrgListRQ";
2
+ /**
3
+ * Organization Query Request data
4
+ * 机构查询请求数据
5
+ */
6
+ export type OrgQueryRQ = OrgListRQ & {
7
+ /**
8
+ * PIN
9
+ */
10
+ pin?: string;
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import { EntityStatus, UpdateModel } from "@etsoo/appscript";
2
+ /**
3
+ * Update organization request data
4
+ * 更新机构请求数据
5
+ */
6
+ export interface OrgUpdateRQ extends UpdateModel {
7
+ /**
8
+ * Organization name
9
+ * 机构名称
10
+ */
11
+ name?: string;
12
+ /**
13
+ * Brand
14
+ * 品牌
15
+ */
16
+ brand?: string;
17
+ /**
18
+ * PIN, unique code
19
+ * PIN,唯一代码
20
+ */
21
+ pin?: string;
22
+ /**
23
+ * Parent id
24
+ * 父级编号
25
+ */
26
+ parentId?: number;
27
+ /**
28
+ * Status
29
+ * 状况
30
+ */
31
+ status?: EntityStatus;
32
+ /**
33
+ * Query keyword
34
+ * 查询关键字
35
+ */
36
+ queryKeyword?: string;
37
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Create Barcode Request data
3
+ * 创建条码请求数据
4
+ */
5
+ export type CreateBarcodeRQ = {
6
+ /**
7
+ * Content
8
+ * 内容
9
+ */
10
+ content: string;
11
+ /**
12
+ * Type
13
+ * 类型
14
+ */
15
+ type?: string;
16
+ /**
17
+ * Background color text format
18
+ * 背景色文本格式
19
+ */
20
+ backgroundText?: string;
21
+ /**
22
+ * Foreground color text format
23
+ * 前景色文本格式
24
+ */
25
+ foregroundText?: string;
26
+ /**
27
+ * Width
28
+ * 宽度
29
+ */
30
+ width: number;
31
+ /**
32
+ * Height
33
+ * 高度
34
+ */
35
+ height: number;
36
+ /**
37
+ * Margin
38
+ * 边距
39
+ */
40
+ margin?: number;
41
+ /**
42
+ * Pure barcode, don't put the content string into the output image
43
+ * 纯条码,不将内容字符串放入输出图像
44
+ */
45
+ pureBarcode?: boolean;
46
+ /**
47
+ * GS1 format
48
+ * GS1格式
49
+ */
50
+ gs1Format?: boolean;
51
+ /**
52
+ * No padding
53
+ * 无填充
54
+ */
55
+ noPadding?: boolean;
56
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ export declare enum PinyinFormatType {
2
+ /**
3
+ * Full Pinyin without tone
4
+ * 不带声调的全拼
5
+ */
6
+ Full = 0,
7
+ /**
8
+ * Initial letter
9
+ * 首字母
10
+ */
11
+ Initial = 1,
12
+ /**
13
+ * Full Pinyin with tone
14
+ * 带声调的全拼
15
+ */
16
+ Tone = 2
17
+ }
18
+ /**
19
+ * Get Pinyin request data
20
+ * 获取拼音请求数据
21
+ */
22
+ export type PinyinRQ = {
23
+ /**
24
+ * Input string
25
+ * 输入的字符串
26
+ */
27
+ input: string;
28
+ /**
29
+ * Return format
30
+ * 返回格式
31
+ */
32
+ format: PinyinFormatType;
33
+ /**
34
+ * Is name
35
+ * 是否为姓名
36
+ */
37
+ isName?: boolean;
38
+ };
@@ -0,0 +1,18 @@
1
+ export var PinyinFormatType;
2
+ (function (PinyinFormatType) {
3
+ /**
4
+ * Full Pinyin without tone
5
+ * 不带声调的全拼
6
+ */
7
+ PinyinFormatType[PinyinFormatType["Full"] = 0] = "Full";
8
+ /**
9
+ * Initial letter
10
+ * 首字母
11
+ */
12
+ PinyinFormatType[PinyinFormatType["Initial"] = 1] = "Initial";
13
+ /**
14
+ * Full Pinyin with tone
15
+ * 带声调的全拼
16
+ */
17
+ PinyinFormatType[PinyinFormatType["Tone"] = 2] = "Tone";
18
+ })(PinyinFormatType || (PinyinFormatType = {}));
@@ -0,0 +1,58 @@
1
+ import { PlaceLocation } from "../../dto/public/PlaceLocation";
2
+ /**
3
+ * API output type
4
+ * API输出类型
5
+ */
6
+ export declare enum ApiOutput {
7
+ JSON = 0,
8
+ XML = 1
9
+ }
10
+ /**
11
+ * API provider
12
+ * 接口供应商
13
+ */
14
+ export declare enum ApiProvider {
15
+ Google = 0,
16
+ Baidu = 1
17
+ }
18
+ /**
19
+ * Place query request
20
+ * 地点查询请求
21
+ */
22
+ export type PlaceQueryRQ = {
23
+ /**
24
+ * Query input
25
+ * 查询输入
26
+ */
27
+ query: string;
28
+ /**
29
+ * Output type
30
+ * 输出类型
31
+ */
32
+ output?: ApiOutput;
33
+ /**
34
+ * API provider
35
+ * 接口供应商
36
+ */
37
+ provider?: ApiProvider;
38
+ /**
39
+ * Language, like zh-CN
40
+ * 语言
41
+ */
42
+ language?: string;
43
+ /**
44
+ * Region or country id, like CN
45
+ * 地区或国家编号
46
+ */
47
+ region?: string;
48
+ /**
49
+ * Center location
50
+ * 中心位置
51
+ */
52
+ location?: PlaceLocation;
53
+ /**
54
+ * Radius in meters
55
+ * 方圆距离,单位为米
56
+ */
57
+ radius?: number;
58
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * API output type
3
+ * API输出类型
4
+ */
5
+ export var ApiOutput;
6
+ (function (ApiOutput) {
7
+ ApiOutput[ApiOutput["JSON"] = 0] = "JSON";
8
+ ApiOutput[ApiOutput["XML"] = 1] = "XML";
9
+ })(ApiOutput || (ApiOutput = {}));
10
+ /**
11
+ * API provider
12
+ * 接口供应商
13
+ */
14
+ export var ApiProvider;
15
+ (function (ApiProvider) {
16
+ ApiProvider[ApiProvider["Google"] = 0] = "Google";
17
+ ApiProvider[ApiProvider["Baidu"] = 1] = "Baidu";
18
+ })(ApiProvider || (ApiProvider = {}));
@@ -0,0 +1,19 @@
1
+ import { QueryRQ } from "@etsoo/appscript";
2
+ /**
3
+ * Audit history request data
4
+ * 操作历史请求数据
5
+ */
6
+ export type AuditHistoryRQ = QueryRQ & {
7
+ /**
8
+ * Device id
9
+ */
10
+ deviceId?: number;
11
+ /**
12
+ * Creation start
13
+ */
14
+ creationStart?: Date | string;
15
+ /**
16
+ * Creation end
17
+ */
18
+ creationEnd?: Date | string;
19
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@etsoo/smarterp-core",
3
+ "version": "1.0.0",
4
+ "description": "TypeScript APIs for SmartERP Core",
5
+ "main": "lib/cjs/index.js",
6
+ "module": "lib/mjs/index.js",
7
+ "types": "lib/mjs/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./lib/mjs/index.js",
11
+ "require": "./lib/cjs/index.js"
12
+ }
13
+ },
14
+ "sideEffects": false,
15
+ "scripts": {
16
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
17
+ "test": "jest",
18
+ "localtest": "set NODE_ENV=local&&jest"
19
+ },
20
+ "jest": {
21
+ "automock": false,
22
+ "testMatch": [
23
+ "<rootDir>/__tests__/**/*.ts"
24
+ ],
25
+ "testPathIgnorePatterns": [
26
+ "<rootDir>/__tests__/app/TestApp.ts"
27
+ ],
28
+ "testEnvironment": "jsdom",
29
+ "moduleFileExtensions": [
30
+ "js",
31
+ "ts",
32
+ "d.ts"
33
+ ],
34
+ "transform": {
35
+ ".+\\.jsx?$": "babel-jest",
36
+ ".+\\.tsx?$": "ts-jest"
37
+ },
38
+ "transformIgnorePatterns": [
39
+ "/node_modules/(?!@etsoo/).+\\.js$"
40
+ ]
41
+ },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/ETSOO/etsoo-smarterp-core.git"
45
+ },
46
+ "keywords": [
47
+ "TypeScript",
48
+ "ETSOO",
49
+ "SmartERP",
50
+ "SmartERP Core APIs",
51
+ "青岛亿速思维",
52
+ "上海亿商",
53
+ "司友云平台",
54
+ "司友云平台核心接口"
55
+ ],
56
+ "author": "ETSOO",
57
+ "license": "MIT",
58
+ "homepage": "https://github.com/ETSOO/etsoo-smarterp-core#readme",
59
+ "devDependencies": {
60
+ "@babel/cli": "^7.26.4",
61
+ "@babel/core": "^7.26.0",
62
+ "@babel/plugin-transform-runtime": "^7.25.9",
63
+ "@babel/preset-env": "^7.26.0",
64
+ "@babel/runtime-corejs3": "^7.26.0",
65
+ "@types/jest": "^29.5.14",
66
+ "jest": "^29.7.0",
67
+ "jest-environment-jsdom": "^29.7.0",
68
+ "ts-jest": "^29.2.5",
69
+ "typescript": "^5.7.2"
70
+ },
71
+ "dependencies": {
72
+ "@etsoo/appscript": "^1.5.79",
73
+ "@etsoo/shared": "^1.2.55"
74
+ }
75
+ }
package/src/AppApi.ts ADDED
@@ -0,0 +1,66 @@
1
+ import { IApi, IApiPayload } from "@etsoo/restclient";
2
+ import { EntityApi, IApp } from "@etsoo/appscript";
3
+ import { AppGetMyRQ } from "./rq/app/AppGetMyRQ";
4
+ import { AppQueryData } from "./dto/app/AppQueryData";
5
+ import { AppListRQ } from "./rq/app/AppListRQ";
6
+ import { AppListDto } from "./dto/app/AppListDto";
7
+ import { AppQueryRQ } from "./rq/app/AppQueryRQ";
8
+ import { AppPurchasedQueryRQ } from "./rq/app/AppPurchasedQueryRQ";
9
+ import { AppPurchasedQueryData } from "./dto/app/AppPurchasedQueryData";
10
+
11
+ /**
12
+ * Application API
13
+ */
14
+ export class AppApi extends EntityApi {
15
+ /**
16
+ * Constructor
17
+ * @param app Application
18
+ * @param api API
19
+ */
20
+ constructor(app: IApp, api: IApi = app.api) {
21
+ super("App", app, api);
22
+ }
23
+
24
+ /**
25
+ * Get user's latest accessed applications
26
+ * @param rq Request data
27
+ * @param payload Payload
28
+ * @returns Result
29
+ */
30
+ getMy(rq: AppGetMyRQ, payload?: IApiPayload<AppQueryData[]>) {
31
+ return this.api.post(`${this.flag}/GetMy`, rq, payload);
32
+ }
33
+
34
+ /**
35
+ * List
36
+ * @param rq Request data
37
+ * @param payload Payload
38
+ * @returns Result
39
+ */
40
+ list(rq: AppListRQ, payload: IApiPayload<AppListDto[]>) {
41
+ return this.listBase(rq, payload);
42
+ }
43
+
44
+ /**
45
+ * Query
46
+ * @param rq Request data
47
+ * @param payload Payload
48
+ * @returns Result
49
+ */
50
+ query(rq: AppQueryRQ, payload?: IApiPayload<AppQueryData[]>) {
51
+ return this.queryBase(rq, payload);
52
+ }
53
+
54
+ /**
55
+ * Query purchased applications JSON data
56
+ * @param rq Request data
57
+ * @param payload Payload
58
+ * @returns Result
59
+ */
60
+ queryPurchased(
61
+ rq: AppPurchasedQueryRQ,
62
+ payload?: IApiPayload<AppPurchasedQueryData[]>
63
+ ) {
64
+ return this.queryBase(rq, payload);
65
+ }
66
+ }
package/src/CoreApp.ts ADDED
@@ -0,0 +1,75 @@
1
+ import { IApi } from "@etsoo/restclient";
2
+ import { MemberApi } from "./MemberApi";
3
+ import { OrgApi } from "./OrgApi";
4
+ import { AppApi } from "./AppApi";
5
+ import { PublicApi } from "./PublicApi";
6
+ import { UserApi } from "./UserApi";
7
+ import { AuthApi, IApp } from "@etsoo/appscript";
8
+
9
+ /**
10
+ * Core application
11
+ * 核心应用程序
12
+ */
13
+ export class CoreApp {
14
+ _appApi?: AppApi;
15
+ /**
16
+ * Application API
17
+ * 应用程序接口
18
+ */
19
+ get appApi() {
20
+ return (this._appApi ??= new AppApi(this.app, this.api));
21
+ }
22
+
23
+ _authApi?: AuthApi;
24
+ /**
25
+ * Authentication API
26
+ * 认证接口
27
+ */
28
+ get authApi() {
29
+ return (this._authApi ??= new AuthApi(this.app, this.api));
30
+ }
31
+
32
+ _memberApi?: MemberApi;
33
+ /**
34
+ * Member API
35
+ * 会员接口
36
+ */
37
+ get memberApi() {
38
+ return (this._memberApi ??= new MemberApi(this.app, this.api));
39
+ }
40
+
41
+ _orgApi?: OrgApi;
42
+ /**
43
+ * Organization API
44
+ * 机构接口
45
+ */
46
+ get orgApi() {
47
+ return (this._orgApi ??= new OrgApi(this.app, this.api));
48
+ }
49
+
50
+ _publicApi?: PublicApi;
51
+ /**
52
+ * Public API
53
+ * 公共接口
54
+ */
55
+ get publicApi() {
56
+ return (this._publicApi ??= new PublicApi(this.app, this.api));
57
+ }
58
+
59
+ _userApi?: UserApi;
60
+ /**
61
+ * User API
62
+ * 用户接口
63
+ */
64
+ get userApi() {
65
+ return (this._userApi ??= new UserApi(this.app, this.api));
66
+ }
67
+
68
+ /**
69
+ * Constructor
70
+ * 构造函数
71
+ * @param app Base application
72
+ * @param api API
73
+ */
74
+ constructor(protected app: IApp, protected api: IApi) {}
75
+ }