oak-domain 6.0.0 → 6.1.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 (400) hide show
  1. package/README.md +5 -1
  2. package/es/actions/action.d.ts +1 -1
  3. package/es/base-app-domain/EntityDict.d.ts +27 -0
  4. package/es/base-app-domain/LocalizedContent/Schema.d.ts +19 -0
  5. package/es/base-app-domain/LocalizedContent/Schema.js +1 -0
  6. package/es/base-app-domain/LocalizedContent/Storage.d.ts +3 -0
  7. package/es/base-app-domain/LocalizedContent/Storage.js +75 -0
  8. package/es/base-app-domain/LocalizedContent/Style.d.ts +3 -0
  9. package/es/base-app-domain/LocalizedContent/Style.js +12 -0
  10. package/es/base-app-domain/LocalizedContent/_baseSchema.d.ts +58 -0
  11. package/es/base-app-domain/Storage.js +2 -0
  12. package/es/base-app-domain/StyleDict.js +2 -0
  13. package/es/compiler/customChecks/i18n.js +4 -1
  14. package/es/compiler/customChecks/runner.d.ts +1 -1
  15. package/es/compiler/customChecks/runner.js +1 -1
  16. package/es/compiler/customChecks/types.d.ts +2 -1
  17. package/es/compiler/dependencyBuilder.d.ts +11 -2
  18. package/es/compiler/dependencyBuilder.js +188 -199
  19. package/es/compiler/entityDescEnum.d.ts +5 -0
  20. package/es/compiler/entityDescEnum.js +443 -0
  21. package/es/compiler/entitySource.d.ts +28 -0
  22. package/es/compiler/entitySource.js +521 -0
  23. package/es/compiler/localeBuilder.d.ts +7 -2
  24. package/es/compiler/localeBuilder.js +52 -56
  25. package/es/compiler/routerBuilder.d.ts +32 -3
  26. package/es/compiler/routerBuilder.js +157 -45
  27. package/es/compiler/schemaBuilder.d.ts +12 -2
  28. package/es/compiler/schemaBuilder.js +653 -148
  29. package/es/compiler/tscBuilder.d.ts +20 -2
  30. package/es/compiler/tscBuilder.js +231 -45
  31. package/es/context/BackendRuntimeContext.d.ts +6 -4
  32. package/es/context/BackendRuntimeContext.js +9 -1
  33. package/es/context/ContextComposer.d.ts +93 -0
  34. package/es/context/ContextComposer.js +353 -0
  35. package/es/context/SerializedData.d.ts +2 -1
  36. package/es/data/i18n.d.ts +1 -1
  37. package/es/data/i18n.js +1 -86
  38. package/es/data/i18n.json +86 -0
  39. package/es/entities/ActionAuth.d.ts +3 -3
  40. package/es/entities/I18n.d.ts +2 -2
  41. package/es/entities/LocalizedContent.d.ts +22 -0
  42. package/es/entities/LocalizedContent.js +101 -0
  43. package/es/entities/Log.d.ts +3 -3
  44. package/es/entities/Modi.d.ts +2 -2
  45. package/es/entities/ModiEntity.d.ts +3 -3
  46. package/es/entities/Oper.d.ts +5 -5
  47. package/es/entities/OperEntity.d.ts +3 -3
  48. package/es/entities/Path.d.ts +2 -2
  49. package/es/entities/Relation.d.ts +2 -2
  50. package/es/entities/RelationAuth.d.ts +3 -3
  51. package/es/entities/User.d.ts +4 -4
  52. package/es/entities/UserEntityClaim.d.ts +6 -6
  53. package/es/entities/UserEntityGrant.d.ts +2 -2
  54. package/es/entities/UserRelation.d.ts +4 -4
  55. package/es/store/AsyncRowStore.d.ts +2 -2
  56. package/es/store/AsyncRowStore.js +2 -2
  57. package/es/store/CascadeStore.d.ts +5 -3
  58. package/es/store/CascadeStore.js +56 -24
  59. package/es/store/IntrinsicCheckers.d.ts +1 -1
  60. package/es/store/IntrinsicCheckers.js +2 -2
  61. package/es/store/IntrinsicLogics.d.ts +1 -1
  62. package/es/store/RelationAuth.js +3 -3
  63. package/es/store/SyncRowStore.d.ts +1 -1
  64. package/es/store/SyncRowStore.js +1 -1
  65. package/es/store/TriggerExecutor.d.ts +6 -4
  66. package/es/store/TriggerExecutor.js +16 -4
  67. package/es/store/checker.d.ts +2 -2
  68. package/es/store/checker.js +45 -9
  69. package/es/store/filter.d.ts +3 -3
  70. package/es/store/filter.js +4 -4
  71. package/es/store/modi.d.ts +5 -5
  72. package/es/store/modi.js +4 -4
  73. package/es/store/projection.d.ts +1 -1
  74. package/es/store/relation.js +1 -1
  75. package/es/store/triggers.d.ts +4 -4
  76. package/es/store/triggers.js +2 -2
  77. package/es/timers/oper.d.ts +3 -3
  78. package/es/timers/oper.js +1 -1
  79. package/es/timers/vaccum.d.ts +3 -3
  80. package/es/types/Action.d.ts +1 -1
  81. package/es/types/AppLoader.d.ts +1 -1
  82. package/es/types/Aspect.d.ts +1 -1
  83. package/es/types/Auth.d.ts +2 -2
  84. package/es/types/Configuration.d.ts +7 -6
  85. package/es/types/Connector.d.ts +47 -1
  86. package/es/types/DataType.d.ts +2 -2
  87. package/es/types/Demand.d.ts +40 -6
  88. package/es/types/Endpoint.d.ts +17 -1
  89. package/es/types/Entity.d.ts +21 -4
  90. package/es/types/Entity.js +23 -0
  91. package/es/types/EntityDesc.d.ts +9 -8
  92. package/es/types/Environment.d.ts +17 -0
  93. package/es/types/Exception.d.ts +1 -1
  94. package/es/types/Exception.js +1 -1
  95. package/es/types/Expression.d.ts +13 -2
  96. package/es/types/Expression.js +36 -1
  97. package/es/types/Locale.d.ts +14 -1
  98. package/es/types/Locale.js +13 -1
  99. package/es/types/OakPackage.d.ts +29 -0
  100. package/es/types/OakPackage.js +30 -0
  101. package/es/types/Port.d.ts +1 -1
  102. package/es/types/RowStore.d.ts +9 -7
  103. package/es/types/Storage.d.ts +11 -3
  104. package/es/types/Storage.js +12 -1
  105. package/es/types/Style.d.ts +2 -2
  106. package/es/types/Sync.d.ts +3 -3
  107. package/es/types/Timer.d.ts +14 -2
  108. package/es/types/Trigger.d.ts +1 -1
  109. package/es/types/Watcher.d.ts +1 -1
  110. package/es/types/index.d.ts +1 -0
  111. package/es/types/index.js +1 -0
  112. package/es/utils/SimpleConnector.d.ts +30 -4
  113. package/es/utils/SimpleConnector.js +294 -21
  114. package/es/utils/concurrent.js +1 -1
  115. package/es/utils/decimal.d.ts +26 -0
  116. package/es/utils/decimal.js +87 -0
  117. package/es/utils/fetch/index.d.ts +1 -0
  118. package/es/utils/fetch/index.js +3 -0
  119. package/es/utils/fetch/index.mp.d.ts +3 -0
  120. package/es/utils/fetch/index.mp.js +280 -0
  121. package/es/utils/fetch/index.native.d.ts +1 -0
  122. package/es/utils/fetch/index.native.js +3 -0
  123. package/es/utils/fetch/index.web.d.ts +1 -0
  124. package/es/utils/fetch/index.web.js +3 -0
  125. package/es/utils/fetch/shared.d.ts +6 -0
  126. package/es/utils/fetch/shared.js +23 -0
  127. package/es/utils/localizedContent.d.ts +11 -0
  128. package/es/utils/localizedContent.js +346 -0
  129. package/es/utils/lodash.d.ts +1 -35
  130. package/es/utils/lodash.js +1 -52
  131. package/es/utils/module/combine.common.d.ts +3 -3
  132. package/es/utils/module/combine.common.js +2 -2
  133. package/es/utils/module/combine.dev.d.ts +2 -2
  134. package/es/utils/module/combine.dev.js +2 -2
  135. package/es/utils/module/combine.prod.d.ts +1 -1
  136. package/es/utils/module/combine.server.d.ts +2 -2
  137. package/es/utils/module/combine.server.js +2 -2
  138. package/es/utils/money.d.ts +2 -2
  139. package/es/utils/money.js +2 -2
  140. package/es/utils/operationResult.js +1 -1
  141. package/es/utils/projection.d.ts +3 -3
  142. package/es/utils/projection.js +1 -1
  143. package/es/utils/relationPath.d.ts +1 -1
  144. package/es/utils/relationPath.js +1 -1
  145. package/es/utils/row.d.ts +3 -3
  146. package/es/utils/row.js +2 -2
  147. package/es/utils/sseEndpoint.d.ts +41 -0
  148. package/es/utils/sseEndpoint.js +151 -0
  149. package/es/utils/toolkit.d.ts +28 -0
  150. package/es/utils/toolkit.js +220 -0
  151. package/es/utils/url/index.d.ts +1 -3
  152. package/es/utils/url/index.js +1 -1
  153. package/es/utils/url/index.mp.d.ts +16 -3
  154. package/es/utils/url/index.mp.js +2 -2
  155. package/es/utils/url/index.native.d.ts +13 -1
  156. package/es/utils/url/index.native.js +3 -1
  157. package/es/utils/url/index.web.d.ts +13 -1
  158. package/es/utils/url/index.web.js +3 -1
  159. package/es/utils/url/lightweight.d.ts +65 -0
  160. package/es/utils/url/lightweight.js +530 -0
  161. package/es/utils/url/urlObject.d.ts +16 -0
  162. package/es/utils/validate/id.d.ts +5 -0
  163. package/es/utils/validate/id.js +28 -0
  164. package/es/utils/validate/index.d.ts +4 -0
  165. package/es/utils/validate/index.js +4 -0
  166. package/es/utils/validate/mobile.d.ts +6 -0
  167. package/es/utils/validate/mobile.js +49 -0
  168. package/es/utils/validate/nationality.d.ts +14 -0
  169. package/es/utils/validate/nationality.data.d.ts +9 -0
  170. package/es/utils/validate/nationality.data.js +257 -0
  171. package/es/utils/validate/nationality.js +64 -0
  172. package/es/utils/validate/passport.d.ts +3 -0
  173. package/es/utils/validate/passport.js +19 -0
  174. package/es/utils/validator.d.ts +10 -8
  175. package/es/utils/validator.js +24 -40
  176. package/lib/actions/action.d.ts +1 -1
  177. package/lib/base-app-domain/EntityDict.d.ts +27 -0
  178. package/lib/base-app-domain/LocalizedContent/Schema.d.ts +19 -0
  179. package/lib/base-app-domain/LocalizedContent/Schema.js +4 -0
  180. package/lib/base-app-domain/LocalizedContent/Storage.d.ts +3 -0
  181. package/lib/base-app-domain/LocalizedContent/Storage.js +78 -0
  182. package/lib/base-app-domain/LocalizedContent/Style.d.ts +3 -0
  183. package/lib/base-app-domain/LocalizedContent/Style.js +15 -0
  184. package/lib/base-app-domain/LocalizedContent/_baseSchema.d.ts +58 -0
  185. package/lib/base-app-domain/Storage.js +26 -24
  186. package/lib/base-app-domain/StyleDict.js +10 -8
  187. package/lib/compiler/customChecks/i18n.js +5 -2
  188. package/lib/compiler/customChecks/runner.d.ts +1 -1
  189. package/lib/compiler/customChecks/types.d.ts +2 -1
  190. package/lib/compiler/dependencyBuilder.d.ts +11 -2
  191. package/lib/compiler/dependencyBuilder.js +237 -243
  192. package/lib/compiler/entityDescEnum.d.ts +5 -0
  193. package/lib/compiler/entityDescEnum.js +450 -0
  194. package/lib/compiler/entitySource.d.ts +28 -0
  195. package/lib/compiler/entitySource.js +529 -0
  196. package/lib/compiler/localeBuilder.d.ts +7 -2
  197. package/lib/compiler/localeBuilder.js +52 -56
  198. package/lib/compiler/routerBuilder.d.ts +32 -3
  199. package/lib/compiler/routerBuilder.js +160 -48
  200. package/lib/compiler/schemaBuilder.d.ts +12 -2
  201. package/lib/compiler/schemaBuilder.js +855 -350
  202. package/lib/compiler/tscBuilder.d.ts +20 -2
  203. package/lib/compiler/tscBuilder.js +217 -37
  204. package/lib/context/BackendRuntimeContext.d.ts +6 -4
  205. package/lib/context/BackendRuntimeContext.js +10 -3
  206. package/lib/context/ContextComposer.d.ts +93 -0
  207. package/lib/context/ContextComposer.js +361 -0
  208. package/lib/context/SerializedData.d.ts +2 -1
  209. package/lib/data/i18n.d.ts +1 -1
  210. package/lib/data/i18n.js +1 -86
  211. package/lib/data/i18n.json +86 -0
  212. package/lib/entities/ActionAuth.d.ts +3 -3
  213. package/lib/entities/I18n.d.ts +2 -2
  214. package/lib/entities/LocalizedContent.d.ts +22 -0
  215. package/lib/entities/LocalizedContent.js +104 -0
  216. package/lib/entities/Log.d.ts +3 -3
  217. package/lib/entities/Modi.d.ts +2 -2
  218. package/lib/entities/ModiEntity.d.ts +3 -3
  219. package/lib/entities/Oper.d.ts +5 -5
  220. package/lib/entities/OperEntity.d.ts +3 -3
  221. package/lib/entities/Path.d.ts +2 -2
  222. package/lib/entities/Relation.d.ts +2 -2
  223. package/lib/entities/RelationAuth.d.ts +3 -3
  224. package/lib/entities/User.d.ts +4 -4
  225. package/lib/entities/UserEntityClaim.d.ts +6 -6
  226. package/lib/entities/UserEntityGrant.d.ts +2 -2
  227. package/lib/entities/UserRelation.d.ts +4 -4
  228. package/lib/store/AsyncRowStore.d.ts +2 -2
  229. package/lib/store/AsyncRowStore.js +6 -7
  230. package/lib/store/CascadeStore.d.ts +5 -3
  231. package/lib/store/CascadeStore.js +101 -70
  232. package/lib/store/IntrinsicCheckers.d.ts +1 -1
  233. package/lib/store/IntrinsicCheckers.js +12 -13
  234. package/lib/store/IntrinsicLogics.d.ts +1 -1
  235. package/lib/store/RelationAuth.js +42 -43
  236. package/lib/store/SyncRowStore.d.ts +1 -1
  237. package/lib/store/SyncRowStore.js +4 -5
  238. package/lib/store/TriggerExecutor.d.ts +6 -4
  239. package/lib/store/TriggerExecutor.js +39 -28
  240. package/lib/store/checker.d.ts +2 -2
  241. package/lib/store/checker.js +55 -20
  242. package/lib/store/filter.d.ts +3 -3
  243. package/lib/store/filter.js +47 -48
  244. package/lib/store/modi.d.ts +5 -5
  245. package/lib/store/modi.js +5 -6
  246. package/lib/store/projection.d.ts +1 -1
  247. package/lib/store/relation.js +4 -5
  248. package/lib/store/triggers.d.ts +4 -4
  249. package/lib/store/triggers.js +13 -14
  250. package/lib/timers/oper.d.ts +3 -3
  251. package/lib/timers/vaccum.d.ts +3 -3
  252. package/lib/types/Action.d.ts +1 -1
  253. package/lib/types/AppLoader.d.ts +1 -1
  254. package/lib/types/Aspect.d.ts +1 -1
  255. package/lib/types/Auth.d.ts +2 -2
  256. package/lib/types/Configuration.d.ts +7 -6
  257. package/lib/types/Connector.d.ts +47 -1
  258. package/lib/types/DataType.d.ts +2 -2
  259. package/lib/types/Demand.d.ts +40 -6
  260. package/lib/types/Endpoint.d.ts +17 -1
  261. package/lib/types/Entity.d.ts +21 -4
  262. package/lib/types/Entity.js +27 -0
  263. package/lib/types/EntityDesc.d.ts +9 -8
  264. package/lib/types/Environment.d.ts +17 -0
  265. package/lib/types/Exception.d.ts +1 -1
  266. package/lib/types/Exception.js +2 -2
  267. package/lib/types/Expression.d.ts +13 -2
  268. package/lib/types/Expression.js +40 -5
  269. package/lib/types/Locale.d.ts +14 -1
  270. package/lib/types/Locale.js +14 -0
  271. package/lib/types/OakPackage.d.ts +29 -0
  272. package/lib/types/OakPackage.js +36 -0
  273. package/lib/types/Port.d.ts +1 -1
  274. package/lib/types/RowStore.d.ts +9 -7
  275. package/lib/types/Storage.d.ts +11 -3
  276. package/lib/types/Storage.js +13 -0
  277. package/lib/types/Style.d.ts +2 -2
  278. package/lib/types/Sync.d.ts +3 -3
  279. package/lib/types/Timer.d.ts +14 -2
  280. package/lib/types/Trigger.d.ts +1 -1
  281. package/lib/types/Watcher.d.ts +1 -1
  282. package/lib/types/index.d.ts +1 -0
  283. package/lib/types/index.js +1 -0
  284. package/lib/utils/SimpleConnector.d.ts +30 -4
  285. package/lib/utils/SimpleConnector.js +297 -24
  286. package/lib/utils/concurrent.js +4 -5
  287. package/lib/utils/decimal.d.ts +26 -0
  288. package/lib/utils/decimal.js +112 -0
  289. package/lib/utils/fetch/index.d.ts +1 -0
  290. package/lib/utils/fetch/index.js +6 -0
  291. package/lib/utils/fetch/index.mp.d.ts +3 -0
  292. package/lib/utils/fetch/index.mp.js +285 -0
  293. package/lib/utils/fetch/index.native.d.ts +1 -0
  294. package/lib/utils/fetch/index.native.js +6 -0
  295. package/lib/utils/fetch/index.web.d.ts +1 -0
  296. package/lib/utils/fetch/index.web.js +6 -0
  297. package/lib/utils/fetch/shared.d.ts +6 -0
  298. package/lib/utils/fetch/shared.js +28 -0
  299. package/lib/utils/localizedContent.d.ts +11 -0
  300. package/lib/utils/localizedContent.js +352 -0
  301. package/lib/utils/lodash.d.ts +1 -35
  302. package/lib/utils/lodash.js +1 -76
  303. package/lib/utils/module/combine.common.d.ts +3 -3
  304. package/lib/utils/module/combine.common.js +6 -7
  305. package/lib/utils/module/combine.dev.d.ts +2 -2
  306. package/lib/utils/module/combine.dev.js +19 -19
  307. package/lib/utils/module/combine.prod.d.ts +1 -1
  308. package/lib/utils/module/combine.server.d.ts +2 -2
  309. package/lib/utils/module/combine.server.js +19 -19
  310. package/lib/utils/money.d.ts +2 -2
  311. package/lib/utils/money.js +2 -2
  312. package/lib/utils/operationResult.js +4 -4
  313. package/lib/utils/projection.d.ts +3 -3
  314. package/lib/utils/relationPath.d.ts +1 -1
  315. package/lib/utils/relationPath.js +10 -11
  316. package/lib/utils/row.d.ts +3 -3
  317. package/lib/utils/row.js +4 -5
  318. package/lib/utils/sseEndpoint.d.ts +41 -0
  319. package/lib/utils/sseEndpoint.js +156 -0
  320. package/lib/utils/toolkit.d.ts +28 -0
  321. package/lib/utils/toolkit.js +253 -0
  322. package/lib/utils/url/index.d.ts +1 -3
  323. package/lib/utils/url/index.js +3 -1
  324. package/lib/utils/url/index.mp.d.ts +16 -3
  325. package/lib/utils/url/index.mp.js +6 -4
  326. package/lib/utils/url/index.native.d.ts +13 -1
  327. package/lib/utils/url/index.native.js +5 -1
  328. package/lib/utils/url/index.web.d.ts +13 -1
  329. package/lib/utils/url/index.web.js +5 -1
  330. package/lib/utils/url/lightweight.d.ts +65 -0
  331. package/lib/utils/url/lightweight.js +535 -0
  332. package/lib/utils/url/urlObject.d.ts +16 -0
  333. package/lib/utils/url/urlObject.js +2 -0
  334. package/lib/utils/url/whatwg-url/lib/URL-impl.d.ts +8 -15
  335. package/lib/utils/url/whatwg-url/lib/infra.js +5 -4
  336. package/lib/utils/url/whatwg-url/lib/urlencoded.d.ts +3 -1
  337. package/lib/utils/url/whatwg-url/lib/utils.d.ts +1 -1
  338. package/lib/utils/validate/id.d.ts +5 -0
  339. package/lib/utils/validate/id.js +35 -0
  340. package/lib/utils/validate/index.d.ts +4 -0
  341. package/lib/utils/validate/index.js +7 -0
  342. package/lib/utils/validate/mobile.d.ts +6 -0
  343. package/lib/utils/validate/mobile.js +57 -0
  344. package/lib/utils/validate/nationality.d.ts +14 -0
  345. package/lib/utils/validate/nationality.data.d.ts +9 -0
  346. package/lib/utils/validate/nationality.data.js +260 -0
  347. package/lib/utils/validate/nationality.js +76 -0
  348. package/lib/utils/validate/passport.d.ts +3 -0
  349. package/lib/utils/validate/passport.js +24 -0
  350. package/lib/utils/validator.d.ts +10 -8
  351. package/lib/utils/validator.js +38 -42
  352. package/package.json +19 -9
  353. package/es/utils/url/whatwg-url/index.d.ts +0 -3
  354. package/es/utils/url/whatwg-url/index.js +0 -12
  355. package/es/utils/url/whatwg-url/lib/URL-impl.d.ts +0 -27
  356. package/es/utils/url/whatwg-url/lib/URL-impl.js +0 -172
  357. package/es/utils/url/whatwg-url/lib/URL.js +0 -295
  358. package/es/utils/url/whatwg-url/lib/URLSearchParams-impl.d.ts +0 -19
  359. package/es/utils/url/whatwg-url/lib/URLSearchParams-impl.js +0 -123
  360. package/es/utils/url/whatwg-url/lib/URLSearchParams.js +0 -423
  361. package/es/utils/url/whatwg-url/lib/infra.d.ts +0 -12
  362. package/es/utils/url/whatwg-url/lib/infra.js +0 -19
  363. package/es/utils/url/whatwg-url/lib/url-state-machine.d.ts +0 -24
  364. package/es/utils/url/whatwg-url/lib/url-state-machine.js +0 -1228
  365. package/es/utils/url/whatwg-url/lib/urlencoded.d.ts +0 -14
  366. package/es/utils/url/whatwg-url/lib/urlencoded.js +0 -160
  367. package/es/utils/url/whatwg-url/lib/utils.d.ts +0 -37
  368. package/es/utils/url/whatwg-url/lib/utils.js +0 -99
  369. package/lib/store/diffSchema.d.ts +0 -1
  370. package/lib/utils/url/whatwg-url/index.d.ts +0 -3
  371. package/lib/utils/url/whatwg-url/index.js +0 -16
  372. package/lib/utils/url/whatwg-url/lib/URL-impl.js +0 -175
  373. package/lib/utils/url/whatwg-url/lib/URL.d.ts +0 -1
  374. package/lib/utils/url/whatwg-url/lib/URL.js +0 -298
  375. package/lib/utils/url/whatwg-url/lib/URLSearchParams-impl.d.ts +0 -19
  376. package/lib/utils/url/whatwg-url/lib/URLSearchParams-impl.js +0 -126
  377. package/lib/utils/url/whatwg-url/lib/URLSearchParams.d.ts +0 -1
  378. package/lib/utils/url/whatwg-url/lib/URLSearchParams.js +0 -426
  379. package/lib/utils/url/whatwg-url/lib/infra.d.ts +0 -12
  380. package/lib/utils/url/whatwg-url/lib/url-state-machine.d.ts +0 -24
  381. package/lib/utils/url/whatwg-url/lib/url-state-machine.js +0 -1238
  382. package/lib/utils/url/whatwg-url/lib/urlencoded.js +0 -162
  383. package/lib/utils/url/whatwg-url/lib/utils.js +0 -101
  384. package/src/entities/ActionAuth.ts +0 -50
  385. package/src/entities/I18n.ts +0 -53
  386. package/src/entities/Log.ts +0 -62
  387. package/src/entities/Modi.ts +0 -107
  388. package/src/entities/ModiEntity.ts +0 -35
  389. package/src/entities/Oper.ts +0 -115
  390. package/src/entities/OperEntity.ts +0 -36
  391. package/src/entities/Path.ts +0 -56
  392. package/src/entities/Relation.ts +0 -53
  393. package/src/entities/RelationAuth.ts +0 -53
  394. package/src/entities/User.ts +0 -85
  395. package/src/entities/UserEntityClaim.ts +0 -41
  396. package/src/entities/UserEntityGrant.ts +0 -33
  397. package/src/entities/UserRelation.ts +0 -60
  398. /package/es/{utils/url/whatwg-url/lib/URL.d.ts → base-app-domain/LocalizedContent/_baseSchema.js} +0 -0
  399. /package/es/utils/url/{whatwg-url/lib/URLSearchParams.d.ts → urlObject.js} +0 -0
  400. /package/lib/{store/diffSchema.js → base-app-domain/LocalizedContent/_baseSchema.js} +0 -0
@@ -3,71 +3,74 @@
3
3
  */
4
4
  'use strict';
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isDomain = exports.isIP = exports.isIPV6 = exports.isIPV4 = exports.isEmail = exports.isVehicleNumber = exports.isMoney = exports.isNumber = exports.isTel = exports.isPhone = exports.isDigital = exports.isSizedCaptcha = exports.isNickname = exports.isUrl = exports.isSoldierNumber = exports.isBirthNumber = exports.isTwCardNumber = exports.isAmCardNumber = exports.isHkCardNumber = exports.isPassportNumber = exports.isIdCardNumber = exports.isCaptcha = exports.isPassword = exports.isMobile = void 0;
6
+ exports.isDomain = exports.isIP = exports.isIPV6 = exports.isIPV4 = exports.isEmail = exports.isVehicleNumber = exports.isMoney = exports.isNumber = exports.isTel = exports.isPhone = exports.isDigital = exports.isSizedCaptcha = exports.isNickname = exports.isUrl = exports.isSoldierNumber = exports.isBirthNumber = exports.isCaptcha = exports.isPassword = exports.isTaiwanNationality = exports.isMacauNationality = exports.isHongKongNationality = exports.isMainlandChinaNationality = exports.normalizeNationality = exports.isTaiwanMobile = exports.isMacauMobile = exports.isInternationalMobile = exports.isHongKongMobile = exports.isGenericPassportNumber = exports.isChinaMainlandMobile = exports.isChinaMainlandIdCardNumber = exports.isTwCardNumber = exports.isAmCardNumber = exports.isHkCardNumber = exports.isPassportNumber = exports.isIdCardNumber = exports.isMobile = void 0;
7
7
  exports.checkAttributesNotNull = checkAttributesNotNull;
8
8
  exports.checkAttributesScope = checkAttributesScope;
9
+ const tslib_1 = require("tslib");
9
10
  const types_1 = require("../types");
10
- const isMobile = (text) => {
11
- return ((text) && (typeof text === "string") && ((/^1[3|4|5|6|7|8|9]\d{9}$/.test(text))));
11
+ const validate_1 = require("./validate");
12
+ Object.defineProperty(exports, "isChinaMainlandIdCardNumber", { enumerable: true, get: function () { return validate_1.isChinaMainlandIdCardNumber; } });
13
+ Object.defineProperty(exports, "isChinaMainlandMobile", { enumerable: true, get: function () { return validate_1.isChinaMainlandMobile; } });
14
+ Object.defineProperty(exports, "isGenericPassportNumber", { enumerable: true, get: function () { return validate_1.isGenericPassportNumber; } });
15
+ Object.defineProperty(exports, "isHongKongMobile", { enumerable: true, get: function () { return validate_1.isHongKongMobile; } });
16
+ Object.defineProperty(exports, "isInternationalMobile", { enumerable: true, get: function () { return validate_1.isInternationalMobile; } });
17
+ Object.defineProperty(exports, "isMacauMobile", { enumerable: true, get: function () { return validate_1.isMacauMobile; } });
18
+ Object.defineProperty(exports, "isTaiwanMobile", { enumerable: true, get: function () { return validate_1.isTaiwanMobile; } });
19
+ Object.defineProperty(exports, "normalizeNationality", { enumerable: true, get: function () { return validate_1.normalizeNationality; } });
20
+ Object.defineProperty(exports, "isMainlandChinaNationality", { enumerable: true, get: function () { return validate_1.isMainlandChinaNationality; } });
21
+ Object.defineProperty(exports, "isHongKongNationality", { enumerable: true, get: function () { return validate_1.isHongKongNationality; } });
22
+ Object.defineProperty(exports, "isMacauNationality", { enumerable: true, get: function () { return validate_1.isMacauNationality; } });
23
+ Object.defineProperty(exports, "isTaiwanNationality", { enumerable: true, get: function () { return validate_1.isTaiwanNationality; } });
24
+ tslib_1.__exportStar(require("./validate"), exports);
25
+ const isMobile = (text, nationality) => {
26
+ return (0, validate_1.isMobile)(text, nationality);
12
27
  };
13
28
  exports.isMobile = isMobile;
14
- const isPassword = (text) => {
15
- return ((text) && (typeof text === "string") && (/^[a-zA-Z0-9!.@]{8,16}$/.test(text)));
16
- };
17
- exports.isPassword = isPassword;
18
- const isCaptcha = (text, num) => {
19
- const n = num || 4;
20
- const regex = new RegExp(`^\\d{${n}}$`);
21
- return ((text) && (typeof text === "string") && (regex.test(text)));
22
- };
23
- exports.isCaptcha = isCaptcha;
24
- const isIdCardNumber = (text) => {
25
- return ((typeof text === "string") && text.length === 18 && (/^\d{6}(18|19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(text)));
29
+ const isIdCardNumber = (text, nationality) => {
30
+ return (0, validate_1.isIdCardNumber)(text, nationality);
26
31
  };
27
32
  exports.isIdCardNumber = isIdCardNumber;
28
- const isPassportNumber = (text) => {
29
- // 护照
30
- // 规则: 14/15开头 + 7位数字, G + 8位数字, P + 7位数字, S/D + 7或8位数字,等
31
- // 样本: 141234567, G12345678, P1234567
32
- return typeof text === 'string' && /^([a-zA-z]|[0-9]){5,17}$/.test(text);
33
+ const isPassportNumber = (text, nationality) => {
34
+ return (0, validate_1.isPassportNumber)(text, nationality);
33
35
  };
34
36
  exports.isPassportNumber = isPassportNumber;
35
37
  const isHkCardNumber = (text) => {
36
- // 港澳居民来往内地通行证
37
- // 规则: H/M + 10位或6位数字
38
- // 样本: H1234567890
39
- return typeof text === 'string' && /^([A-Z]\d{6,10}(\(\w{1}\))?)$/.test(text);
38
+ return (0, validate_1.isHkCardNumber)(text);
40
39
  };
41
40
  exports.isHkCardNumber = isHkCardNumber;
42
41
  const isAmCardNumber = (text) => {
43
- return typeof text === 'string' && /^([A-Z]\d{6,10}(\(\w{1}\))?)$/.test(text);
42
+ return (0, validate_1.isAmCardNumber)(text);
44
43
  };
45
44
  exports.isAmCardNumber = isAmCardNumber;
46
45
  const isTwCardNumber = (text) => {
47
- // 台湾居民来往大陆通行证
48
- // 规则: 新版8位或18位数字, 旧版10位数字 + 英文字母
49
- // 样本: 12345678 或 1234567890B
50
- return typeof text === 'string' && /^\d{8}|^[a-zA-Z0-9]{10}|^\d{18}$/.test(text);
46
+ return (0, validate_1.isTwCardNumber)(text);
51
47
  };
52
48
  exports.isTwCardNumber = isTwCardNumber;
49
+ const isPassword = (text) => {
50
+ return !!(text && typeof text === 'string' && /^[a-zA-Z0-9!.@]{8,16}$/.test(text));
51
+ };
52
+ exports.isPassword = isPassword;
53
+ const isCaptcha = (text, num) => {
54
+ const n = num || 4;
55
+ const regex = new RegExp(`^\\d{${n}}$`);
56
+ return !!(text && typeof text === 'string' && regex.test(text));
57
+ };
58
+ exports.isCaptcha = isCaptcha;
53
59
  const isBirthNumber = (text) => {
54
60
  return typeof text === 'string' && /^[a-zA-Z0-9]{5,21}$/.test(text);
55
61
  };
56
62
  exports.isBirthNumber = isBirthNumber;
57
63
  const isSoldierNumber = (text) => {
58
- // 军官证
59
- // 规则: 军/兵/士/文/职/广/(其他中文) + "字第" + 4到8位字母或数字 + "号"
60
- // 样本: 军字第2001988号, 士字第P011816X号
61
64
  return typeof text === 'string' && /^[\u4E00-\u9FA5](字第)([0-9a-zA-Z]{4,8})(号?)$/.test(text);
62
65
  };
63
66
  exports.isSoldierNumber = isSoldierNumber;
64
67
  const isUrl = (str) => {
65
68
  const regex = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
66
- return typeof str === "string" && regex.test(str);
69
+ return typeof str === 'string' && regex.test(str);
67
70
  };
68
71
  exports.isUrl = isUrl;
69
72
  const isNickname = (str) => {
70
- return str && typeof str === "string" && str.trim().length > 0 && str.length < 16;
73
+ return !!(str && typeof str === 'string' && str.trim().length > 0 && str.length < 16);
71
74
  };
72
75
  exports.isNickname = isNickname;
73
76
  const isSizedCaptcha = (text, size) => {
@@ -79,12 +82,10 @@ const isDigital = (digital) => {
79
82
  };
80
83
  exports.isDigital = isDigital;
81
84
  const isPhone = (phone) => {
82
- // return /^((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/.test(phone);
83
85
  return /^(\(\d{3,4}\)|\d{3,4}-)?\d{7,8}$/.test(phone);
84
86
  };
85
87
  exports.isPhone = isPhone;
86
88
  const isTel = (text) => {
87
- // 1、133xxxx4545 2、0571-630xx239 3、400-123-1400
88
89
  const reg = /^(((\d{3,4}-)?[0-9]{7,8})|(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}|((400)-(\d{3})-(\d{4})(.)(\d{1,4})|(400)-(\d{3})-(\d{4}$)|(400)(\d{3})(\d{4}$)|(400)-(\d{4})-(\d{3}$)))$/.test(text);
89
90
  return reg;
90
91
  };
@@ -94,7 +95,6 @@ const isNumber = (str) => {
94
95
  };
95
96
  exports.isNumber = isNumber;
96
97
  const isMoney = (str, disableZero) => {
97
- // 金额,最多可以有两位小数 默认包含零
98
98
  if (disableZero) {
99
99
  return /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/.test(str);
100
100
  }
@@ -102,7 +102,7 @@ const isMoney = (str, disableZero) => {
102
102
  };
103
103
  exports.isMoney = isMoney;
104
104
  const isVehicleNumber = (str) => {
105
- const reg = /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/;
105
+ const reg = /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z])([A-HJ-NP-Z0-9]{5}|[DF][A-HJ-NP-Z0-9]{4}|[0-9]{5}[DF])$/;
106
106
  return reg.test(str);
107
107
  };
108
108
  exports.isVehicleNumber = isVehicleNumber;
@@ -124,7 +124,6 @@ function checkAttributesNotNull(entity, data, attributes, allowEmpty) {
124
124
  throw new types_1.OakAttrNotNullException(entity, attrs, 'error::attributesNull');
125
125
  }
126
126
  }
127
- ;
128
127
  function checkAttributesScope(entity, data, attributes) {
129
128
  const attrs = attributes.filter(attr => !data.hasOwnProperty(attr));
130
129
  if (attrs.length > 0) {
@@ -132,13 +131,11 @@ function checkAttributesScope(entity, data, attributes) {
132
131
  }
133
132
  }
134
133
  const isIPV4 = (ip) => {
135
- // IPv4正则
136
134
  const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
137
135
  return ipv4Regex.test(ip);
138
136
  };
139
137
  exports.isIPV4 = isIPV4;
140
138
  const isIPV6 = (ip) => {
141
- // IPv6正则(简化版,匹配常见格式)
142
139
  const ipv6Regex = /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$|^::([0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}$|^[0-9a-fA-F]{1,4}::([0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4}$|^([0-9a-fA-F]{1,4}:){1}:([0-9a-fA-F]{1,4}:){0,4}[0-9a-fA-F]{1,4}$|^([0-9a-fA-F]{1,4}:){2}:([0-9a-fA-F]{1,4}:){0,3}[0-9a-fA-F]{1,4}$|^([0-9a-fA-F]{1,4}:){3}:([0-9a-fA-F]{1,4}:){0,2}[0-9a-fA-F]{1,4}$|^([0-9a-fA-F]{1,4}:){4}:([0-9a-fA-F]{1,4}:){0,1}[0-9a-fA-F]{1,4}$|^([0-9a-fA-F]{1,4}:){5}:[0-9a-fA-F]{1,4}$|^([0-9a-fA-F]{1,4}:){1,6}:$/;
143
140
  return ipv6Regex.test(ip);
144
141
  };
@@ -148,7 +145,6 @@ const isIP = (ip) => {
148
145
  };
149
146
  exports.isIP = isIP;
150
147
  const isDomain = (domain) => {
151
- //基础域名验证正则
152
148
  const domainRegex = /^(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.[A-Za-z0-9-]{1,63}(?<!-))*\.[A-Za-z]{2,}$/;
153
149
  return domainRegex.test(domain);
154
150
  };
package/package.json CHANGED
@@ -1,9 +1,21 @@
1
1
  {
2
2
  "name": "oak-domain",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "oak": {
5
5
  "package": true,
6
- "i18n": true
6
+ "i18n": true,
7
+ "es": {
8
+ "optimize": {
9
+ "includeDeps": [
10
+ "dayjs",
11
+ "dayjs/plugin/weekOfYear",
12
+ "dayjs/plugin/weekYear",
13
+ "dayjs/plugin/dayOfYear",
14
+ "es-toolkit",
15
+ "uuid"
16
+ ]
17
+ }
18
+ }
7
19
  },
8
20
  "author": {
9
21
  "name": "XuChang"
@@ -19,8 +31,7 @@
19
31
  },
20
32
  "files": [
21
33
  "lib/**/*",
22
- "es/**/*",
23
- "src/entities/*"
34
+ "es/**/*"
24
35
  ],
25
36
  "main": "lib/index",
26
37
  "module": "es/index",
@@ -35,7 +46,6 @@
35
46
  "@types/fs-extra": "^9.0.13",
36
47
  "@types/koa": "^2.15.0",
37
48
  "@types/koa-router": "^7.4.8",
38
- "@types/lodash": "^4.14.182",
39
49
  "@types/mocha": "^8.2.0",
40
50
  "@types/node": "^20.6.1",
41
51
  "@types/node-schedule": "^2.1.0",
@@ -48,20 +58,20 @@
48
58
  "cross-env": "^7.0.2",
49
59
  "cross-spawn": "^7.0.3",
50
60
  "fs-extra": "^10.0.0",
51
- "lodash": "^4.17.21",
52
61
  "mocha": "^8.2.1",
53
62
  "node-watch": "^0.7.4",
54
63
  "ts-node": "^10.9.1",
55
64
  "tslib": "^2.4.0",
56
- "typescript": "^5.2.2"
65
+ "typescript": "^5.9.0"
57
66
  },
58
67
  "dependencies": {
68
+ "bignumber.js": "^11.1.1",
59
69
  "dayjs": "^1.11.9",
70
+ "es-toolkit": "^1.45.1",
60
71
  "koa": "^2.16.1",
61
72
  "koa-body": "^5.0.0",
62
73
  "node-schedule": "^2.1.1",
63
74
  "socket.io": "^4.8.1",
64
- "uuid": "^9.0.0",
65
- "webidl-conversions": "^5.0.0"
75
+ "uuid": "^9.0.0"
66
76
  }
67
77
  }
@@ -1,3 +0,0 @@
1
- declare const URL: URL;
2
- declare const URLSearchParams: URLSearchParams;
3
- export { URL, URLSearchParams };
@@ -1,12 +0,0 @@
1
- /**
2
- * 为了能在小程序中使用URL、URLSearchParams
3
- * 但whatwg-url-without-unicode这个库未更新,把其的代码放本地进行更新
4
- */
5
- const whatwgUrl = require('./lib/URL');
6
- const whatwgUrlSearchParams = require('./lib/URLSearchParams');
7
- const sharedGlobalObject = {};
8
- whatwgUrl.install(sharedGlobalObject);
9
- whatwgUrlSearchParams.install(sharedGlobalObject);
10
- const URL = sharedGlobalObject.URL;
11
- const URLSearchParams = sharedGlobalObject.URLSearchParams;
12
- export { URL, URLSearchParams };
@@ -1,27 +0,0 @@
1
- declare const _default: {
2
- implementation: {
3
- new (globalObject: any, constructorArgs: any): {
4
- get href(): string;
5
- set href(v: string);
6
- get origin(): any;
7
- get protocol(): string;
8
- set protocol(v: string);
9
- username: any;
10
- password: any;
11
- get host(): any;
12
- set host(v: any);
13
- get hostname(): any;
14
- set hostname(v: any);
15
- get port(): string;
16
- set port(v: string);
17
- pathname: any;
18
- get search(): string;
19
- set search(v: string);
20
- readonly searchParams: any;
21
- get hash(): string;
22
- set hash(v: string);
23
- toJSON(): string;
24
- };
25
- };
26
- };
27
- export default _default;
@@ -1,172 +0,0 @@
1
- // @ts-nocheck
2
- import usm from './url-state-machine';
3
- import urlencoded from './urlencoded';
4
- import URLSearchParams from './URLSearchParams';
5
- const implementation = class URLImpl {
6
- constructor(globalObject, constructorArgs) {
7
- const url = constructorArgs[0];
8
- const base = constructorArgs[1];
9
- let parsedBase = null;
10
- if (base !== undefined) {
11
- parsedBase = usm.basicURLParse(base);
12
- if (parsedBase === null) {
13
- throw new TypeError(`Invalid base URL: ${base}`);
14
- }
15
- }
16
- const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
17
- if (parsedURL === null) {
18
- throw new TypeError(`Invalid URL: ${url}`);
19
- }
20
- const query = parsedURL.query !== null ? parsedURL.query : "";
21
- this._url = parsedURL;
22
- // We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips
23
- // question mark by default. Therefore the doNotStripQMark hack is used.
24
- this._query = URLSearchParams.createImpl(globalObject, [query], { doNotStripQMark: true });
25
- this._query._url = this;
26
- }
27
- get href() {
28
- return usm.serializeURL(this._url);
29
- }
30
- set href(v) {
31
- const parsedURL = usm.basicURLParse(v);
32
- if (parsedURL === null) {
33
- throw new TypeError(`Invalid URL: ${v}`);
34
- }
35
- this._url = parsedURL;
36
- this._query._list.splice(0);
37
- const { query } = parsedURL;
38
- if (query !== null) {
39
- this._query._list = urlencoded.parseUrlencoded(query);
40
- }
41
- }
42
- get origin() {
43
- return usm.serializeURLOrigin(this._url);
44
- }
45
- get protocol() {
46
- return this._url.scheme + ":";
47
- }
48
- set protocol(v) {
49
- usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" });
50
- }
51
- get username() {
52
- return this._url.username;
53
- }
54
- set username(v) {
55
- if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
56
- return;
57
- }
58
- usm.setTheUsername(this._url, v);
59
- }
60
- get password() {
61
- return this._url.password;
62
- }
63
- set password(v) {
64
- if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
65
- return;
66
- }
67
- usm.setThePassword(this._url, v);
68
- }
69
- get host() {
70
- const url = this._url;
71
- if (url.host === null) {
72
- return "";
73
- }
74
- if (url.port === null) {
75
- return usm.serializeHost(url.host);
76
- }
77
- return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port);
78
- }
79
- set host(v) {
80
- if (this._url.cannotBeABaseURL) {
81
- return;
82
- }
83
- usm.basicURLParse(v, { url: this._url, stateOverride: "host" });
84
- }
85
- get hostname() {
86
- if (this._url.host === null) {
87
- return "";
88
- }
89
- return usm.serializeHost(this._url.host);
90
- }
91
- set hostname(v) {
92
- if (this._url.cannotBeABaseURL) {
93
- return;
94
- }
95
- usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" });
96
- }
97
- get port() {
98
- if (this._url.port === null) {
99
- return "";
100
- }
101
- return usm.serializeInteger(this._url.port);
102
- }
103
- set port(v) {
104
- if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
105
- return;
106
- }
107
- if (v === "") {
108
- this._url.port = null;
109
- }
110
- else {
111
- usm.basicURLParse(v, { url: this._url, stateOverride: "port" });
112
- }
113
- }
114
- get pathname() {
115
- if (this._url.cannotBeABaseURL) {
116
- return this._url.path[0];
117
- }
118
- if (this._url.path.length === 0) {
119
- return "";
120
- }
121
- return "/" + this._url.path.join("/");
122
- }
123
- set pathname(v) {
124
- if (this._url.cannotBeABaseURL) {
125
- return;
126
- }
127
- this._url.path = [];
128
- usm.basicURLParse(v, { url: this._url, stateOverride: "path start" });
129
- }
130
- get search() {
131
- if (this._url.query === null || this._url.query === "") {
132
- return "";
133
- }
134
- return "?" + this._url.query;
135
- }
136
- set search(v) {
137
- const url = this._url;
138
- if (v === "") {
139
- url.query = null;
140
- this._query._list = [];
141
- return;
142
- }
143
- const input = v[0] === "?" ? v.substring(1) : v;
144
- url.query = "";
145
- usm.basicURLParse(input, { url, stateOverride: "query" });
146
- this._query._list = urlencoded.parseUrlencoded(input);
147
- }
148
- get searchParams() {
149
- return this._query;
150
- }
151
- get hash() {
152
- if (this._url.fragment === null || this._url.fragment === "") {
153
- return "";
154
- }
155
- return "#" + this._url.fragment;
156
- }
157
- set hash(v) {
158
- if (v === "") {
159
- this._url.fragment = null;
160
- return;
161
- }
162
- const input = v[0] === "#" ? v.substring(1) : v;
163
- this._url.fragment = "";
164
- usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" });
165
- }
166
- toJSON() {
167
- return this.href;
168
- }
169
- };
170
- export default {
171
- implementation
172
- };