Browse Source

后台数据源、填报、租户、租户用户管理完成

newMaster
zzc 4 months ago
parent
commit
827b85655d
  1. 69
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminDataSourceController.java
  2. 108
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminDmsUserController.java
  3. 83
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminReportController.java
  4. 74
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminTenantsController.java
  5. 54
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminDataSourceDto.java
  6. 76
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminReportDto.java
  7. 74
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantUserDto.java
  8. 69
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantsDto.java
  9. 11
      acupuncture-system/src/main/java/com/acupuncture/system/domain/po/FmsPatientQueueRelation.java
  10. 60
      acupuncture-system/src/main/java/com/acupuncture/system/domain/po/FmsPatientQueueRelationExample.java
  11. 6
      acupuncture-system/src/main/java/com/acupuncture/system/domain/po/RmsReportType.java
  12. 20
      acupuncture-system/src/main/java/com/acupuncture/system/domain/po/RmsReportTypeExample.java
  13. 35
      acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/AdminDataSourceVo.java
  14. 45
      acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/AdminReportVo.java
  15. 41
      acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/AdminTenantUserVo.java
  16. 37
      acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/AdminTenantsVo.java
  17. 30
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminDataSourceDao.java
  18. 24
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminDmsUserDao.java
  19. 26
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminTenantDao.java
  20. 5
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/DmsUserDao.java
  21. 19
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/RmsReportDao.java
  22. 4
      acupuncture-system/src/main/java/com/acupuncture/system/persist/mapper/RmsReportTypeMapper.java
  23. 24
      acupuncture-system/src/main/java/com/acupuncture/system/service/AdminDataSourceService.java
  24. 70
      acupuncture-system/src/main/java/com/acupuncture/system/service/AdminReportService.java
  25. 24
      acupuncture-system/src/main/java/com/acupuncture/system/service/AdminTenantUserService.java
  26. 21
      acupuncture-system/src/main/java/com/acupuncture/system/service/AdminTenantsService.java
  27. 11
      acupuncture-system/src/main/java/com/acupuncture/system/service/DmsLoginService.java
  28. 64
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminDataSourceServiceImpl.java
  29. 97
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminReportServiceImpl.java
  30. 65
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminTenantUserServiceImpl.java
  31. 63
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminTenantsServiceImpl.java
  32. 36
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/DmsLoginServiceImpl.java
  33. 2
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/RmsReportServiceImpl.java
  34. 31
      acupuncture-system/src/main/resources/mapper/dao/AdminDataSourceDao.xml
  35. 32
      acupuncture-system/src/main/resources/mapper/dao/AdminDmsUserDao.xml
  36. 34
      acupuncture-system/src/main/resources/mapper/dao/AdminRmsReportDao.xml
  37. 31
      acupuncture-system/src/main/resources/mapper/dao/AdminTenantDao.xml
  38. 8
      acupuncture-system/src/main/resources/mapper/dao/SysPowerDao.xml
  39. 25
      acupuncture-system/src/main/resources/mapper/system/FmsPatientQueueRelationMapper.xml
  40. 22
      acupuncture-system/src/main/resources/mapper/system/RmsReportTypeMapper.xml
  41. 2
      acupuncture-system/src/main/resources/mapper/system/SysUserMapper.xml
  42. 103
      doc/若依环境使用手册.docx
  43. 12
      node_modules/.bin/acorn
  44. 17
      node_modules/.bin/acorn.cmd
  45. 28
      node_modules/.bin/acorn.ps1
  46. 12
      node_modules/.bin/atob
  47. 17
      node_modules/.bin/atob.cmd
  48. 28
      node_modules/.bin/atob.ps1
  49. 12
      node_modules/.bin/errno
  50. 17
      node_modules/.bin/errno.cmd
  51. 28
      node_modules/.bin/errno.ps1
  52. 12
      node_modules/.bin/json5
  53. 17
      node_modules/.bin/json5.cmd
  54. 28
      node_modules/.bin/json5.ps1
  55. 12
      node_modules/.bin/miller-rabin
  56. 17
      node_modules/.bin/miller-rabin.cmd
  57. 28
      node_modules/.bin/miller-rabin.ps1
  58. 12
      node_modules/.bin/mkdirp
  59. 17
      node_modules/.bin/mkdirp.cmd
  60. 28
      node_modules/.bin/mkdirp.ps1
  61. 12
      node_modules/.bin/rimraf
  62. 17
      node_modules/.bin/rimraf.cmd
  63. 28
      node_modules/.bin/rimraf.ps1
  64. 12
      node_modules/.bin/semver
  65. 17
      node_modules/.bin/semver.cmd
  66. 28
      node_modules/.bin/semver.ps1
  67. 12
      node_modules/.bin/sha.js
  68. 17
      node_modules/.bin/sha.js.cmd
  69. 28
      node_modules/.bin/sha.js.ps1
  70. 12
      node_modules/.bin/terser
  71. 17
      node_modules/.bin/terser.cmd
  72. 28
      node_modules/.bin/terser.ps1
  73. 12
      node_modules/.bin/webpack
  74. 17
      node_modules/.bin/webpack.cmd
  75. 28
      node_modules/.bin/webpack.ps1
  76. 4133
      node_modules/.package-lock.json
  77. 21
      node_modules/@types/json-schema/LICENSE
  78. 15
      node_modules/@types/json-schema/README.md
  79. 749
      node_modules/@types/json-schema/index.d.ts
  80. 40
      node_modules/@types/json-schema/package.json
  81. 21
      node_modules/@webassemblyjs/ast/LICENSE
  82. 167
      node_modules/@webassemblyjs/ast/README.md
  83. 10
      node_modules/@webassemblyjs/ast/esm/clone.js
  84. 663
      node_modules/@webassemblyjs/ast/esm/definitions.js
  85. 6
      node_modules/@webassemblyjs/ast/esm/index.js
  86. 84
      node_modules/@webassemblyjs/ast/esm/node-helpers.js
  87. 137
      node_modules/@webassemblyjs/ast/esm/node-path.js
  88. 915
      node_modules/@webassemblyjs/ast/esm/nodes.js
  89. 199
      node_modules/@webassemblyjs/ast/esm/signatures.js
  90. 76
      node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js
  91. 216
      node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js
  92. 96
      node_modules/@webassemblyjs/ast/esm/traverse.js
  93. 0
      node_modules/@webassemblyjs/ast/esm/types/basic.js
  94. 0
      node_modules/@webassemblyjs/ast/esm/types/nodes.js
  95. 0
      node_modules/@webassemblyjs/ast/esm/types/traverse.js
  96. 265
      node_modules/@webassemblyjs/ast/esm/utils.js
  97. 17
      node_modules/@webassemblyjs/ast/lib/clone.js
  98. 663
      node_modules/@webassemblyjs/ast/lib/definitions.js
  99. 118
      node_modules/@webassemblyjs/ast/lib/index.js
  100. 107
      node_modules/@webassemblyjs/ast/lib/node-helpers.js

69
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminDataSourceController.java

@ -0,0 +1,69 @@
package com.acupuncture.web.controller.web;
import com.acupuncture.common.core.domain.BaseDto;
import com.acupuncture.common.core.domain.JsonResponse;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.dto.AdminDataSourceDto;
import com.acupuncture.system.domain.vo.AdminDataSourceVo;
import com.acupuncture.system.service.AdminDataSourceService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @Author zzc
* @Package com.acupuncture.web.controller.web
* @Date 2025/2/14 10:50
* @description:
*/
@Slf4j
@Api(tags = "管理端数据源")
@RestController
@RequestMapping("/dataSources")
public class AdminDataSourceController {
@Resource
private AdminDataSourceService adminDataSourceService;
@ApiOperation("添加数据源")
@PostMapping("/add")
public JsonResponse<Integer> insert(@RequestBody @Validated AdminDataSourceDto.AddDto dto) {
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
return JsonResponse.ok().fail("无权限");
}
return JsonResponse.ok(adminDataSourceService.insert(dto));
}
@ApiOperation("修改数据源")
@PostMapping("/upd")
public JsonResponse<Integer> update(@RequestBody @Validated AdminDataSourceDto.UpdDto dto) {
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
return JsonResponse.ok().fail("无权限");
}
return JsonResponse.ok(adminDataSourceService.update(dto));
}
@ApiOperation("删除数据源")
@PostMapping("/del")
public JsonResponse<Integer> delete(@RequestBody @Validated AdminDataSourceDto.DeleteDto dto) {
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
return JsonResponse.ok().fail("无权限");
}
return JsonResponse.ok(adminDataSourceService.delete(dto));
}
@ApiOperation("查询数据源")
@PostMapping("/list")
public JsonResponse<PageInfo<AdminDataSourceVo.Result>> query(@RequestBody @Validated BaseDto<AdminDataSourceDto.Query> dto) {
return JsonResponse.ok(new PageInfo<>(adminDataSourceService.query(dto.getParam())));
}
}

108
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminDmsUserController.java

@ -0,0 +1,108 @@
package com.acupuncture.web.controller.web;
import cn.hutool.core.bean.BeanUtil;
import com.acupuncture.common.core.domain.BaseDto;
import com.acupuncture.common.core.domain.JsonResponse;
import com.acupuncture.common.core.domain.entity.SysUser;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.common.utils.StringUtils;
import com.acupuncture.framework.datasource.DynamicDataSourceContextHolder;
import com.acupuncture.system.domain.dto.AdminTenantUserDto;
import com.acupuncture.system.domain.vo.AdminTenantUserVo;
import com.acupuncture.system.domain.vo.UmsDataSourceVo;
import com.acupuncture.system.service.AdminTenantUserService;
import com.acupuncture.system.service.DmsLoginService;
import com.acupuncture.system.service.ISysUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.web.controller.web
* @Date 2025/2/14 11:42
* @description:
*/
@Slf4j
@Api(tags = "管理端租户用户管理")
@RestController
@RequestMapping("/tenantUsers")
public class AdminDmsUserController {
@Resource
private AdminTenantUserService adminTenantUserService;
@Resource
private DmsLoginService dmsLoginService;
@Resource
private ISysUserService userService;
@ApiOperation("添加租户用户")
@PostMapping("/add")
public JsonResponse<Integer> insert(@RequestBody @Validated AdminTenantUserDto.AddDto dto) {
//新增分库数据,
SysUser user = BeanUtil.copyProperties(dto, SysUser.class);
if (!userService.checkUserNameUnique(user))
{
return JsonResponse.ok().fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{
return JsonResponse.ok().fail("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
}
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{
return JsonResponse.ok().fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setTenantId(SecurityUtils.getTenantId());
user.setCreateBy(SecurityUtils.getUsername());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
int insert = userService.insertUser(user);
//新增主库
if (insert > 0) {
DynamicDataSourceContextHolder.setDataSourceType("MASTER");
if (!dmsLoginService.checkUserNameUnique(dto))
{
return JsonResponse.ok().fail("新增用户'" + dto.getUserName() + "'失败,登录账号已存在");
}
else if (StringUtils.isNotEmpty(dto.getPhonenumber()) && !dmsLoginService.checkPhoneUnique(dto))
{
return JsonResponse.ok().fail("新增用户'" + dto.getUserName() + "'失败,手机号码已存在");
}
dto.setPassword(user.getPassword());
adminTenantUserService.insert(dto);
}
return JsonResponse.ok(insert);
}
@ApiOperation("修改租户用户")
@PostMapping("/upd")
public JsonResponse<Integer> update(@RequestBody @Validated AdminTenantUserDto.UpdDto dto) {
return JsonResponse.ok(adminTenantUserService.update(dto));
}
@ApiOperation("删除租户用户")
@PostMapping("/del")
public JsonResponse<Integer> delete(@RequestBody @Validated AdminTenantUserDto.DeleteDto dto) {
return JsonResponse.ok(adminTenantUserService.delete(dto));
}
@ApiOperation("查询租户用户")
@PostMapping("/list")
public JsonResponse<PageInfo<AdminTenantUserVo.Result>> query(@RequestBody @Validated BaseDto<AdminTenantUserDto.Query> dto) {
if (dto.getPageNum() > 0) {
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
}
return JsonResponse.ok(new PageInfo<>(adminTenantUserService.query(dto.getParam())));
}
}

83
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminReportController.java

@ -0,0 +1,83 @@
package com.acupuncture.web.controller.web;
import com.acupuncture.common.core.domain.BaseDto;
import com.acupuncture.common.core.domain.JsonResponse;
import com.acupuncture.system.domain.dto.AdminReportDto;
import com.acupuncture.system.domain.vo.AdminReportVo;
import com.acupuncture.system.service.AdminReportService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @Author zzc
* @Package com.acupuncture.web.controller.web
* @Date 2025/2/14 16:20
* @description:
*/
@Slf4j
@Api(tags = "上报管理")
@RestController
@RequestMapping("/report")
public class AdminReportController {
@Resource
private AdminReportService reportService;
@ApiOperation("查询上报类型")
@PostMapping("/list")
public JsonResponse<PageInfo<AdminReportVo.TypeResult>> queryTypeList(@RequestBody @Validated BaseDto<AdminReportDto.Query> dto){
return JsonResponse.ok(new PageInfo<>(reportService.queryTypeList(dto.getParam().getName())));
}
@ApiOperation("新增上报类型")
@PostMapping("/add")
public JsonResponse<Integer> insert(@RequestBody @Validated AdminReportDto.AddDto dto){
return JsonResponse.ok(reportService.insert(dto));
}
@ApiOperation("修改上报类型")
@PostMapping("/upd")
public JsonResponse<Integer> update(@RequestBody @Validated AdminReportDto.UpdDto dto){
return JsonResponse.ok(reportService.update(dto));
}
@ApiOperation("删除上报类型")
@PostMapping("/del")
public JsonResponse<Integer> delete(@RequestBody @Validated AdminReportDto.DeleteDto dto){
return JsonResponse.ok(reportService.delete(dto));
}
@ApiOperation("查询上报管理")
@PostMapping("/queryManager")
public JsonResponse<PageInfo<AdminReportVo.Result>> queryManagerList(@RequestBody @Validated BaseDto<AdminReportDto.QueryManagerDto> dto){
return JsonResponse.ok(new PageInfo<>(reportService.queryManagerList(dto.getParam())));
}
@ApiOperation("新增上报管理")
@PostMapping("/addManager")
public JsonResponse<Integer> insertManager(@RequestBody @Validated AdminReportDto.AddManagerDto dto){
return JsonResponse.ok(reportService.insertManager(dto));
}
@ApiOperation("修改上报管理")
@PostMapping("/updManager")
public JsonResponse<Integer> updateManager(@RequestBody @Validated AdminReportDto.UpdManagerDto dto){
return JsonResponse.ok(reportService.updateManager(dto));
}
@ApiOperation("删除上报管理")
@PostMapping("/delManager")
public JsonResponse<Integer> deleteManager(@RequestBody @Validated AdminReportDto.DeleteManagerDto dto){
return JsonResponse.ok(reportService.deleteManager(dto));
}
}

74
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminTenantsController.java

@ -0,0 +1,74 @@
package com.acupuncture.web.controller.web;
import com.acupuncture.common.core.domain.BaseDto;
import com.acupuncture.common.core.domain.JsonResponse;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.dto.AdminTenantsDto;
import com.acupuncture.system.domain.vo.AdminTenantsVo;
import com.acupuncture.system.service.AdminTenantsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.parameters.P;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @Author zzc
* @Package com.acupuncture.web.controller.web
* @Date 2025/2/14 10:24
* @description:
*/
@Slf4j
@Api(tags = "管理端租户管理")
@RestController
@RequestMapping("/tenants")
public class AdminTenantsController {
@Resource
private AdminTenantsService adminTenantsService;
@ApiOperation("添加租户")
@PostMapping("/add")
public JsonResponse<Integer> insert(@RequestBody @Validated AdminTenantsDto.AddDto dto) {
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
return JsonResponse.ok().fail("无权限");
}
return JsonResponse.ok(adminTenantsService.insert(dto));
}
@ApiOperation("修改租户")
@PostMapping("/upd")
public JsonResponse<Integer> update(@RequestBody @Validated AdminTenantsDto.UpdDto dto) {
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
return JsonResponse.ok().fail("无权限");
}
return JsonResponse.ok(adminTenantsService.update(dto));
}
@ApiOperation("删除租户")
@PostMapping("/del")
public JsonResponse<Integer> delete(@RequestBody @Validated AdminTenantsDto.DeleteDto dto) {
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
return JsonResponse.ok().fail("无权限");
}
return JsonResponse.ok(adminTenantsService.delete(dto));
}
@ApiOperation("查询租户")
@PostMapping("/list")
public JsonResponse<PageInfo<AdminTenantsVo.Result>> query(@RequestBody @Validated BaseDto<AdminTenantsDto.Query> dto) {
if (dto.getPageNum() > 0) {
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
}
return JsonResponse.ok(new PageInfo<>(adminTenantsService.query(dto.getParam())));
}
}

54
acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminDataSourceDto.java

@ -0,0 +1,54 @@
package com.acupuncture.system.domain.dto;
import com.acupuncture.common.annotation.DataSource;
import com.acupuncture.system.domain.po.UmsDataSource;
import lombok.Data;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.domain.dto
* @Date 2025/2/14 10:51
* @description:
*/
public class AdminDataSourceDto {
@Data
public static class AddDto {
private String dataSourceKey;
private Long hospitalId;
private String url;
private String username;
private String password;
}
@Data
public static class UpdDto {
private Long id;
private String dataSourceKey;
private Long hospitalId;
private String url;
private String username;
private String password;
}
@Data
public static class DeleteDto {
private List<Long> idList;
}
@Data
public static class Query{
private String dataSourceKey;
}
}

76
acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminReportDto.java

@ -0,0 +1,76 @@
package com.acupuncture.system.domain.dto;
import com.acupuncture.system.domain.po.RmsReportManagement;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.domain.dto
* @Date 2025/2/14 16:31
* @description:
*/
public class AdminReportDto {
@Data
public static class AddDto {
private String name;
}
@Data
public static class UpdDto {
private Long id;
private String name;
}
@Data
public static class DeleteDto {
private List<Long> idList;
}
@Data
public static class Query {
private String name;
}
@Data
public static class AddManagerDto {
private String reportTitle;
private Long reportType;
private Date timeRangeStart;
private Date timeRangeEnd;
private Byte status;
}
@Data
public static class UpdManagerDto {
private Long id;
private String reportTitle;
private Long reportType;
private Date timeRangeStart;
private Date timeRangeEnd;
private Byte status;
}
@Data
public static class DeleteManagerDto {
private List<Long> idList;
}
@Data
public static class QueryManagerDto {
private String reportTitle;
}
}

74
acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantUserDto.java

@ -0,0 +1,74 @@
package com.acupuncture.system.domain.dto;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.po.DmsUser;
import com.acupuncture.system.service.AdminTenantUserService;
import lombok.Data;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.domain.dto
* @Date 2025/2/14 11:28
* @description:
*/
public class AdminTenantUserDto {
@Data
public static class AddDto {
private Integer id;
private Long tenantId;
private String userName;
private String password;
private String nickName;
private String email;
private String phonenumber;
private String sex;
private String status;
public Long getTenantId() {
return SecurityUtils.getTenantId();
}
}
@Data
public static class UpdDto {
private Integer id;
private Long tenantId;
private String userName;
private String password;
private String nickName;
private String email;
private String phonenumber;
private String sex;
private String status;
}
@Data
public static class DeleteDto {
private List<Integer> idList;
}
@Data
public static class Query {
private Long tenantId;
}
}

69
acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantsDto.java

@ -0,0 +1,69 @@
package com.acupuncture.system.domain.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.domain.dto
* @Date 2025/2/14 10:25
* @description:
*/
public class AdminTenantsDto {
@Data
public static class AddDto{
private String code;
private String name;
private String leader;
private String contactPhone;
private Long dataSourceId;
private String status;
private String createBy;
private Date createTime;
private String remark;
}
@Data
public static class UpdDto{
private Long id;
private String code;
private String name;
private String leader;
private String contactPhone;
private Long dataSourceId;
private String status;
private String createBy;
private Date createTime;
private String remark;
}
@Data
public static class DeleteDto{
@NotNull(message = "请选择租户删除")
private List<Long> idList;
}
@Data
public static class Query{
private String name;
}
}

11
acupuncture-system/src/main/java/com/acupuncture/system/domain/po/FmsPatientQueueRelation.java

@ -38,6 +38,8 @@ public class FmsPatientQueueRelation extends FmsPatientQueueRelationKey implemen
private String remark;
private Date dischargeTime;
private static final long serialVersionUID = 1L;
public String getName() {
@ -176,6 +178,14 @@ public class FmsPatientQueueRelation extends FmsPatientQueueRelationKey implemen
this.remark = remark == null ? null : remark.trim();
}
public Date getDischargeTime() {
return dischargeTime;
}
public void setDischargeTime(Date dischargeTime) {
this.dischargeTime = dischargeTime;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -199,6 +209,7 @@ public class FmsPatientQueueRelation extends FmsPatientQueueRelationKey implemen
sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime);
sb.append(", remark=").append(remark);
sb.append(", dischargeTime=").append(dischargeTime);
sb.append("]");
return sb.toString();
}

60
acupuncture-system/src/main/java/com/acupuncture/system/domain/po/FmsPatientQueueRelationExample.java

@ -1361,6 +1361,66 @@ public class FmsPatientQueueRelationExample {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andDischargeTimeIsNull() {
addCriterion("discharge_time is null");
return (Criteria) this;
}
public Criteria andDischargeTimeIsNotNull() {
addCriterion("discharge_time is not null");
return (Criteria) this;
}
public Criteria andDischargeTimeEqualTo(Date value) {
addCriterion("discharge_time =", value, "dischargeTime");
return (Criteria) this;
}
public Criteria andDischargeTimeNotEqualTo(Date value) {
addCriterion("discharge_time <>", value, "dischargeTime");
return (Criteria) this;
}
public Criteria andDischargeTimeGreaterThan(Date value) {
addCriterion("discharge_time >", value, "dischargeTime");
return (Criteria) this;
}
public Criteria andDischargeTimeGreaterThanOrEqualTo(Date value) {
addCriterion("discharge_time >=", value, "dischargeTime");
return (Criteria) this;
}
public Criteria andDischargeTimeLessThan(Date value) {
addCriterion("discharge_time <", value, "dischargeTime");
return (Criteria) this;
}
public Criteria andDischargeTimeLessThanOrEqualTo(Date value) {
addCriterion("discharge_time <=", value, "dischargeTime");
return (Criteria) this;
}
public Criteria andDischargeTimeIn(List<Date> values) {
addCriterion("discharge_time in", values, "dischargeTime");
return (Criteria) this;
}
public Criteria andDischargeTimeNotIn(List<Date> values) {
addCriterion("discharge_time not in", values, "dischargeTime");
return (Criteria) this;
}
public Criteria andDischargeTimeBetween(Date value1, Date value2) {
addCriterion("discharge_time between", value1, value2, "dischargeTime");
return (Criteria) this;
}
public Criteria andDischargeTimeNotBetween(Date value1, Date value2) {
addCriterion("discharge_time not between", value1, value2, "dischargeTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

6
acupuncture-system/src/main/java/com/acupuncture/system/domain/po/RmsReportType.java

@ -4,7 +4,7 @@ import java.io.Serializable;
import java.util.Date;
public class RmsReportType implements Serializable {
private Integer id;
private Long id;
private String typeName;
@ -22,11 +22,11 @@ public class RmsReportType implements Serializable {
private static final long serialVersionUID = 1L;
public Integer getId() {
public Long getId() {
return id;
}
public void setId(Integer id) {
public void setId(Long id) {
this.id = id;
}

20
acupuncture-system/src/main/java/com/acupuncture/system/domain/po/RmsReportTypeExample.java

@ -115,52 +115,52 @@ public class RmsReportTypeExample {
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}

35
acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/AdminDataSourceVo.java

@ -0,0 +1,35 @@
package com.acupuncture.system.domain.vo;
import com.acupuncture.system.domain.po.UmsDataSource;
import lombok.Data;
import java.util.Date;
/**
* @Author zzc
* @Package com.acupuncture.system.domain.vo
* @Date 2025/2/14 10:53
* @description:
*/
public class AdminDataSourceVo {
@Data
public static class Result {
private Long id;
private String dataSourceKey;
private Long hospitalId;
private String url;
private String username;
private String password;
private String createBy;
private Date createTime;
}
}

45
acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/AdminReportVo.java

@ -0,0 +1,45 @@
package com.acupuncture.system.domain.vo;
import com.acupuncture.system.domain.po.RmsReportManagement;
import com.acupuncture.system.domain.po.RmsReportType;
import lombok.Data;
import java.util.Date;
/**
* @Author zzc
* @Package com.acupuncture.system.domain.vo
* @Date 2025/2/14 16:29
* @description:
*/
public class AdminReportVo {
@Data
public static class TypeResult {
private Integer id;
private String typeName;
}
@Data
public static class Result {
private Long id;
private String reportTitle;
private Long reportType;
private Date timeRangeStart;
private Date timeRangeEnd;
private Byte status;
private Byte delFlag;
private String createBy;
private Date createTime;
}
}

41
acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/AdminTenantUserVo.java

@ -0,0 +1,41 @@
package com.acupuncture.system.domain.vo;
import com.acupuncture.system.domain.po.DmsUser;
import lombok.Data;
import java.util.Date;
/**
* @Author zzc
* @Package com.acupuncture.system.domain.vo
* @Date 2025/2/14 11:30
* @description:
*/
public class AdminTenantUserVo {
@Data
public static class Result {
private Integer id;
private Long tenantId;
private String userName;
private String password;
private String nickName;
private String email;
private String phonenumber;
private String sex;
private String status;
private String createBy;
private Date createTime;
}
}

37
acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/AdminTenantsVo.java

@ -0,0 +1,37 @@
package com.acupuncture.system.domain.vo;
import com.acupuncture.system.domain.po.DmsTenant;
import lombok.Data;
import java.util.Date;
/**
* @Author zzc
* @Package com.acupuncture.system.domain.vo
* @Date 2025/2/14 10:25
* @description:
*/
public class AdminTenantsVo {
@Data
public static class Result{
private Long id;
private String code;
private String name;
private String leader;
private String contactPhone;
private Long dataSourceId;
private String status;
private String createBy;
private Date createTime;
private String remark;
}
}

30
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminDataSourceDao.java

@ -0,0 +1,30 @@
package com.acupuncture.system.persist.dao;
import com.acupuncture.common.annotation.DataSource;
import com.acupuncture.common.enums.DataSourceType;
import com.acupuncture.system.domain.dto.AdminDataSourceDto;
import com.acupuncture.system.domain.dto.AdminTenantsDto;
import com.acupuncture.system.domain.vo.AdminDataSourceVo;
import com.acupuncture.system.domain.vo.AdminTenantsVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.persist.dao
* @Date 2025/2/10 9:48
* @description:
*/
public interface AdminDataSourceDao {
/**
* 查询数据源
* @param dto
* @return
*/
@DataSource(value = DataSourceType.MASTER)
List<AdminDataSourceVo.Result> query(@Param("query") AdminDataSourceDto.Query dto,
@Param("userId") Long userId,
@Param("tenantId")Long tenantId);
}

24
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminDmsUserDao.java

@ -0,0 +1,24 @@
package com.acupuncture.system.persist.dao;
import com.acupuncture.system.domain.dto.AdminTenantUserDto;
import com.acupuncture.system.domain.vo.AdminTenantUserVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.persist.dao
* @Date 2025/2/10 9:48
* @description:
*/
public interface AdminDmsUserDao {
/**
* 查询患者信息
*
* @param dto
* @return
*/
List<AdminTenantUserVo.Result> query(@Param("dto") AdminTenantUserDto.Query dto);
}

26
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminTenantDao.java

@ -0,0 +1,26 @@
package com.acupuncture.system.persist.dao;
import com.acupuncture.system.domain.dto.AdminTenantsDto;
import com.acupuncture.system.domain.vo.AdminTenantsVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.persist.dao
* @Date 2025/2/10 9:48
* @description:
*/
public interface AdminTenantDao {
/**
* 查询租户
*
* @param dto
* @return
*/
List<AdminTenantsVo.Result> query(@Param("dto") AdminTenantsDto.Query dto,
@Param("userId") Long userId,
@Param("tenantId")Long tenantId);
}

5
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/DmsUserDao.java

@ -3,6 +3,7 @@ package com.acupuncture.system.persist.dao;
import com.acupuncture.common.annotation.DataSource;
import com.acupuncture.common.core.domain.entity.SysUser;
import com.acupuncture.common.enums.DataSourceType;
import com.acupuncture.system.domain.po.DmsUser;
import com.acupuncture.system.domain.vo.DmsLoginUserVo;
import org.apache.ibatis.annotations.Param;
@ -36,4 +37,8 @@ public interface DmsUserDao {
* @return 结果
*/
public int updateUser(DmsLoginUserVo.DmsUserVo user);
DmsLoginUserVo.DmsUserVo checkUserNameUnique(String userName);
DmsLoginUserVo.DmsUserVo checkPhoneUnique(String phonenumber);
}

19
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/RmsReportDao.java

@ -0,0 +1,19 @@
package com.acupuncture.system.persist.dao;
import com.acupuncture.system.domain.dto.AdminReportDto;
import com.acupuncture.system.domain.vo.AdminReportVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.persist.dao
* @Date 2025/2/14 17:00
* @description:
*/
public interface RmsReportDao {
List<AdminReportVo.TypeResult> queryTypeList(@Param("typeName") String typeName);
List<AdminReportVo.Result> queryManagerList(@Param("reportTitle") String reportTitle);
}

4
acupuncture-system/src/main/java/com/acupuncture/system/persist/mapper/RmsReportTypeMapper.java

@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param;
public interface RmsReportTypeMapper {
long countByExample(RmsReportTypeExample example);
int deleteByPrimaryKey(Integer id);
int deleteByPrimaryKey(Long id);
int insert(RmsReportType record);
@ -16,7 +16,7 @@ public interface RmsReportTypeMapper {
List<RmsReportType> selectByExample(RmsReportTypeExample example);
RmsReportType selectByPrimaryKey(Integer id);
RmsReportType selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") RmsReportType record, @Param("example") RmsReportTypeExample example);

24
acupuncture-system/src/main/java/com/acupuncture/system/service/AdminDataSourceService.java

@ -0,0 +1,24 @@
package com.acupuncture.system.service;
import com.acupuncture.system.domain.dto.AdminDataSourceDto;
import com.acupuncture.system.domain.vo.AdminDataSourceVo;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.service
* @Date 2025/2/14 10:50
* @description:
*/
public interface AdminDataSourceService {
int insert(AdminDataSourceDto.AddDto dto);
int update(AdminDataSourceDto.UpdDto dto);
int delete(AdminDataSourceDto.DeleteDto dto);
List<AdminDataSourceVo.Result> query(AdminDataSourceDto.Query dto);
}

70
acupuncture-system/src/main/java/com/acupuncture/system/service/AdminReportService.java

@ -0,0 +1,70 @@
package com.acupuncture.system.service;
import com.acupuncture.system.domain.dto.AdminReportDto;
import com.acupuncture.system.domain.vo.AdminReportVo;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.service
* @Date 2025/2/14 16:22
* @description:
*/
public interface AdminReportService {
/**
* 查询上报类型
* @param typeName
* @return
*/
List<AdminReportVo.TypeResult> queryTypeList(String typeName);
/**
* 新增上报类型
* @param dto
* @return
*/
Integer insert(AdminReportDto.AddDto dto);
/**
* 修改上报类型
* @param dto
* @return
*/
Integer update(AdminReportDto.UpdDto dto);
/**
* 删除上报类型
* @param dto
* @return
*/
Integer delete(AdminReportDto.DeleteDto dto);
/**
* 查询上报管理
* @param dto
* @return
*/
List<AdminReportVo.Result> queryManagerList(AdminReportDto.QueryManagerDto dto);
/**
* 新增上报管理
* @param dto
* @return
*/
Integer insertManager(AdminReportDto.AddManagerDto dto);
/**
* 修改上报管理
* @param dto
* @return
*/
Integer updateManager(AdminReportDto.UpdManagerDto dto);
/**
* 删除上报管理
* @param dto
* @return
*/
Integer deleteManager(AdminReportDto.DeleteManagerDto dto);
}

24
acupuncture-system/src/main/java/com/acupuncture/system/service/AdminTenantUserService.java

@ -0,0 +1,24 @@
package com.acupuncture.system.service;
import com.acupuncture.system.domain.dto.AdminTenantUserDto;
import com.acupuncture.system.domain.vo.AdminTenantUserVo;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.service
* @Date 2025/2/14 11:27
* @description:
*/
public interface AdminTenantUserService {
int insert(AdminTenantUserDto.AddDto dto);
int update(AdminTenantUserDto.UpdDto dto);
int delete(AdminTenantUserDto.DeleteDto dto);
List<AdminTenantUserVo.Result> query(AdminTenantUserDto.Query dto);
}

21
acupuncture-system/src/main/java/com/acupuncture/system/service/AdminTenantsService.java

@ -0,0 +1,21 @@
package com.acupuncture.system.service;
import com.acupuncture.system.domain.dto.AdminTenantsDto;
import com.acupuncture.system.domain.vo.AdminTenantsVo;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.service
* @Date 2025/2/14 10:24
* @description:
*/
public interface AdminTenantsService {
int insert(AdminTenantsDto.AddDto dto);
int update(AdminTenantsDto.UpdDto dto);
int delete(AdminTenantsDto.DeleteDto dto);
List<AdminTenantsVo.Result> query(AdminTenantsDto.Query dto);
}

11
acupuncture-system/src/main/java/com/acupuncture/system/service/DmsLoginService.java

@ -1,6 +1,7 @@
package com.acupuncture.system.service;
import com.acupuncture.common.core.domain.entity.SysUser;
import com.acupuncture.system.domain.dto.AdminTenantUserDto;
import com.acupuncture.system.domain.po.DmsUser;
import com.acupuncture.system.domain.po.UmsDataSource;
import com.acupuncture.system.domain.vo.DmsLoginUserVo;
@ -21,6 +22,14 @@ public interface DmsLoginService {
*/
public DmsLoginUserVo.DataScoreVo selectUserByUserName(String userName);
/**
* 校验用户名称是否唯一
*
* @param user 用户信息
* @return 结果
*/
public boolean checkUserNameUnique(AdminTenantUserDto.AddDto dto);
/**
* 重置用户密码
*
@ -35,4 +44,6 @@ public interface DmsLoginService {
* @return
*/
UmsDataSource getDataSourceByTenantId(Long tenantId);
boolean checkPhoneUnique(AdminTenantUserDto.AddDto dto);
}

64
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminDataSourceServiceImpl.java

@ -0,0 +1,64 @@
package com.acupuncture.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.dto.AdminDataSourceDto;
import com.acupuncture.system.domain.po.DmsTenant;
import com.acupuncture.system.domain.po.DmsTenantExample;
import com.acupuncture.system.domain.po.UmsDataSource;
import com.acupuncture.system.domain.po.UmsDataSourceExample;
import com.acupuncture.system.domain.vo.AdminDataSourceVo;
import com.acupuncture.system.persist.dao.AdminDataSourceDao;
import com.acupuncture.system.persist.mapper.UmsDataSourceMapper;
import com.acupuncture.system.service.AdminDataSourceService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.service
* @Date 2025/2/14 10:50
* @description:
*/
@Service
public class AdminDataSourceServiceImpl implements AdminDataSourceService {
@Resource
private UmsDataSourceMapper umsDataSourceMapper;
@Resource
private AdminDataSourceDao adminDataSourceDao;
@Override
public int insert(AdminDataSourceDto.AddDto dto) {
UmsDataSource umsDataSource = BeanUtil.copyProperties(dto, UmsDataSource.class);
umsDataSource.setId(IdUtil.getSnowflakeNextId());
umsDataSource.setCreateBy(SecurityUtils.getUsername());
umsDataSource.setCreateTime(new Date());
return umsDataSourceMapper.insertSelective(umsDataSource);
}
@Override
public int update(AdminDataSourceDto.UpdDto dto) {
UmsDataSource umsDataSource = BeanUtil.copyProperties(dto, UmsDataSource.class);
umsDataSource.setUpdateBy(SecurityUtils.getUsername());
umsDataSource.setCreateTime(new Date());
return umsDataSourceMapper.updateByPrimaryKeySelective(umsDataSource);
}
@Override
public int delete(AdminDataSourceDto.DeleteDto dto) {
UmsDataSourceExample umsDataSourceExample = new UmsDataSourceExample();
umsDataSourceExample.createCriteria().andIdIn(dto.getIdList());
UmsDataSource umsDataSource = new UmsDataSource();
umsDataSource.setDelFlag((byte) 1);
return umsDataSourceMapper.updateByExampleSelective(umsDataSource, umsDataSourceExample);
}
@Override
public List<AdminDataSourceVo.Result> query(AdminDataSourceDto.Query dto) {
return adminDataSourceDao.query(dto, SecurityUtils.getUserId(), SecurityUtils.getTenantId());
}
}

97
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminReportServiceImpl.java

@ -0,0 +1,97 @@
package com.acupuncture.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.acupuncture.common.core.domain.R;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.dto.AdminReportDto;
import com.acupuncture.system.domain.po.*;
import com.acupuncture.system.domain.vo.AdminReportVo;
import com.acupuncture.system.persist.dao.RmsReportDao;
import com.acupuncture.system.persist.mapper.RmsReportManagementMapper;
import com.acupuncture.system.persist.mapper.RmsReportTypeMapper;
import com.acupuncture.system.service.AdminReportService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.service
* @Date 2025/2/14 16:22
* @description:
*/
@Service
public class AdminReportServiceImpl implements AdminReportService {
@Resource
private RmsReportTypeMapper rmsReportTypeMapper;
@Resource
private RmsReportManagementMapper rmsReportManagementMapper;
@Resource
private RmsReportDao rmsReportDao;
@Override
public List<AdminReportVo.TypeResult> queryTypeList(String typeName) {
return rmsReportDao.queryTypeList(typeName);
}
@Override
public Integer insert(AdminReportDto.AddDto dto) {
RmsReportType reportType = BeanUtil.copyProperties(dto, RmsReportType.class);
reportType.setId(IdUtil.getSnowflakeNextId());
reportType.setCreateBy(SecurityUtils.getUsername());
reportType.setCreateTime(new Date());
return rmsReportTypeMapper.insertSelective(reportType);
}
@Override
public Integer update(AdminReportDto.UpdDto dto) {
RmsReportType reportType = BeanUtil.copyProperties(dto, RmsReportType.class);
reportType.setUpdateBy(SecurityUtils.getUsername());
reportType.setCreateTime(new Date());
return rmsReportTypeMapper.updateByPrimaryKeySelective(reportType);
}
@Override
public Integer delete(AdminReportDto.DeleteDto dto) {
RmsReportTypeExample rmsReportTypeExample = new RmsReportTypeExample();
rmsReportTypeExample.createCriteria().andIdIn(dto.getIdList());
RmsReportType reportType = new RmsReportType();
reportType.setDelFlag((byte) 1);
return rmsReportTypeMapper.updateByExampleSelective(reportType, rmsReportTypeExample);
}
@Override
public List<AdminReportVo.Result> queryManagerList(AdminReportDto.QueryManagerDto dto) {
return rmsReportDao.queryManagerList(dto.getReportTitle());
}
@Override
public Integer insertManager(AdminReportDto.AddManagerDto dto) {
RmsReportManagement reportManagement = BeanUtil.copyProperties(dto, RmsReportManagement.class);
reportManagement.setId(IdUtil.getSnowflakeNextId());
reportManagement.setCreateBy(SecurityUtils.getUsername());
reportManagement.setCreateTime(new Date());
return rmsReportManagementMapper.insertSelective(reportManagement);
}
@Override
public Integer updateManager(AdminReportDto.UpdManagerDto dto) {
RmsReportManagement reportManagement = BeanUtil.copyProperties(dto, RmsReportManagement.class);
reportManagement.setUpdateBy(SecurityUtils.getUsername());
reportManagement.setCreateTime(new Date());
return rmsReportManagementMapper.updateByPrimaryKeySelective(reportManagement);
}
@Override
public Integer deleteManager(AdminReportDto.DeleteManagerDto dto) {
RmsReportManagementExample reportManagementExample = new RmsReportManagementExample();
reportManagementExample.createCriteria().andIdIn(dto.getIdList());
RmsReportManagement reportManagement = new RmsReportManagement();
reportManagement.setDelFlag((byte) 1);
return rmsReportManagementMapper.updateByExampleSelective(reportManagement, reportManagementExample);
}
}

65
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminTenantUserServiceImpl.java

@ -0,0 +1,65 @@
package com.acupuncture.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.dto.AdminTenantUserDto;
import com.acupuncture.system.domain.po.DmsTenant;
import com.acupuncture.system.domain.po.DmsTenantExample;
import com.acupuncture.system.domain.po.DmsUser;
import com.acupuncture.system.domain.po.DmsUserExample;
import com.acupuncture.system.domain.vo.AdminTenantUserVo;
import com.acupuncture.system.persist.dao.AdminDmsUserDao;
import com.acupuncture.system.persist.mapper.DmsUserMapper;
import com.acupuncture.system.service.AdminTenantUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.service.impl
* @Date 2025/2/14 11:27
* @description:
*/
@Service
public class AdminTenantUserServiceImpl implements AdminTenantUserService {
@Resource
private DmsUserMapper dmsUserMapper;
@Resource
private AdminDmsUserDao adminDmsUserDao;
@Override
public int insert(AdminTenantUserDto.AddDto dto) {
DmsUser dmsUser = BeanUtil.copyProperties(dto, DmsUser.class);
dmsUser.setId((int) IdUtil.getSnowflakeNextId());
dmsUser.setCreateBy(SecurityUtils.getUsername());
dmsUser.setCreateTime(new Date());
return dmsUserMapper.insertSelective(dmsUser);
}
@Override
public int update(AdminTenantUserDto.UpdDto dto) {
DmsUser dmsUser = BeanUtil.copyProperties(dto, DmsUser.class);
dmsUser.setUpdateBy(SecurityUtils.getUsername());
dmsUser.setCreateTime(new Date());
return dmsUserMapper.updateByPrimaryKeySelective(dmsUser);
}
@Override
public int delete(AdminTenantUserDto.DeleteDto dto) {
DmsUserExample dmsUserExample = new DmsUserExample();
dmsUserExample.createCriteria().andIdIn(dto.getIdList());
DmsUser dmsUser = new DmsUser();
dmsUser.setDelFlag((byte) 1);
return dmsUserMapper.updateByExampleSelective(dmsUser, dmsUserExample);
}
@Override
public List<AdminTenantUserVo.Result> query(AdminTenantUserDto.Query dto) {
return adminDmsUserDao.query(dto);
}
}

63
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminTenantsServiceImpl.java

@ -0,0 +1,63 @@
package com.acupuncture.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.dto.AdminTenantsDto;
import com.acupuncture.system.domain.po.DmsTenant;
import com.acupuncture.system.domain.po.DmsTenantExample;
import com.acupuncture.system.domain.vo.AdminTenantsVo;
import com.acupuncture.system.persist.dao.AdminTenantDao;
import com.acupuncture.system.persist.mapper.DmsTenantMapper;
import com.acupuncture.system.service.AdminTenantsService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @Author zzc
* @Package com.acupuncture.system.service
* @Date 2025/2/14 10:24
* @description:
*/
@Service
public class AdminTenantsServiceImpl implements AdminTenantsService {
@Resource
private DmsTenantMapper dmsTenantMapper;
@Resource
private AdminTenantDao adminTenantDao;
@Override
public int insert(AdminTenantsDto.AddDto dto) {
DmsTenant dmsTenant = BeanUtil.copyProperties(dto, DmsTenant.class);
dmsTenant.setId(IdUtil.getSnowflakeNextId());
dmsTenant.setCreateBy(SecurityUtils.getUsername());
dmsTenant.setCreateTime(new Date());
return dmsTenantMapper.insertSelective(dmsTenant);
}
@Override
public int update(AdminTenantsDto.UpdDto dto) {
DmsTenant dmsTenant = BeanUtil.copyProperties(dto, DmsTenant.class);
dmsTenant.setUpdateBy(SecurityUtils.getUsername());
dmsTenant.setCreateTime(new Date());
return dmsTenantMapper.updateByPrimaryKeySelective(dmsTenant);
}
@Override
public int delete(AdminTenantsDto.DeleteDto dto) {
DmsTenantExample dmsTenantExample = new DmsTenantExample();
dmsTenantExample.createCriteria().andIdIn(dto.getIdList());
DmsTenant dmsTenant = new DmsTenant();
dmsTenant.setDelFlag((byte) 1);
return dmsTenantMapper.updateByExampleSelective(dmsTenant, dmsTenantExample);
}
@Override
public List<AdminTenantsVo.Result> query(AdminTenantsDto.Query dto) {
return adminTenantDao.query(dto, SecurityUtils.getUserId(), SecurityUtils.getTenantId());
}
}

36
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/DmsLoginServiceImpl.java

@ -1,5 +1,9 @@
package com.acupuncture.system.service.impl;
import com.acupuncture.common.constant.UserConstants;
import com.acupuncture.common.core.domain.entity.SysUser;
import com.acupuncture.common.utils.StringUtils;
import com.acupuncture.system.domain.dto.AdminTenantUserDto;
import com.acupuncture.system.domain.po.DmsTenant;
import com.acupuncture.system.domain.po.DmsUser;
import com.acupuncture.system.domain.po.UmsDataSource;
@ -37,6 +41,18 @@ public class DmsLoginServiceImpl implements DmsLoginService {
return dmsUserDao.queryLoginUserDataScore(userName);
}
@Override
public boolean checkUserNameUnique(AdminTenantUserDto.AddDto dto)
{
Long userId = StringUtils.isNull(dto.getId()) ? -1L : dto.getId();
DmsLoginUserVo.DmsUserVo info = dmsUserDao.checkUserNameUnique(dto.getUserName());
if (StringUtils.isNotNull(info) && info.getId().longValue() != userId)
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
@Override
public int resetPwd(DmsLoginUserVo.DmsUserVo user) {
return dmsUserDao.updateUser(user);
@ -57,4 +73,24 @@ public class DmsLoginServiceImpl implements DmsLoginService {
}
return null;
}
/**
* 校验手机号码是否唯一
*
* @param user 用户信息
* @return
*/
@Override
public boolean checkPhoneUnique(AdminTenantUserDto.AddDto dto)
{
Long userId = StringUtils.isNull(dto.getId()) ? -1L : dto.getId();
DmsLoginUserVo.DmsUserVo info = dmsUserDao.checkPhoneUnique(dto.getPhonenumber());
if (StringUtils.isNotNull(info) && info.getId().longValue() != userId)
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
}

2
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/RmsReportServiceImpl.java

@ -2,6 +2,7 @@ package com.acupuncture.system.service.impl;
import com.acupuncture.system.domain.vo.RmsReportVo;
import com.acupuncture.system.service.RmsReportService;
import org.springframework.stereotype.Service;
import java.util.List;
@ -11,6 +12,7 @@ import java.util.List;
* @Date 2025/2/10 15:59
* @description:
*/
@Service
public class RmsReportServiceImpl implements RmsReportService {
@Override
public List<RmsReportVo.TypeResult> queryTypeList(String typeName) {

31
acupuncture-system/src/main/resources/mapper/dao/AdminDataSourceDao.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.acupuncture.system.persist.dao.AdminDataSourceDao">
<select id="query" resultType="com.acupuncture.system.domain.vo.AdminDataSourceVo$Result"
parameterType="com.acupuncture.system.domain.dto.AdminDataSourceDto$Query">
SELECT
s.id,
s.data_source_key as dataSourceKey,
s.hospital_id as hospitalId,
s.url,
s.username,
s.password,
s.create_by as createBy,
s.create_time as createTime
FROM
ums_data_source s
left join
dms_tenant t on s.id = t.data_source_id
<where>
s.del_flag = 0
<if test="query.dataSourceKey != null and query.dataSourceKey != ''">
AND s.data_source_key LIKE CONCAT('%', #{query.dataSourceKey}, '%')
</if>
<if test="userId != null and userId != 1 and tenantId != null">
and t.id = #{tenantId}
</if>
</where>
order by s.create_time desc
</select>
</mapper>

32
acupuncture-system/src/main/resources/mapper/dao/AdminDmsUserDao.xml

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.acupuncture.system.persist.dao.AdminDmsUserDao">
<select id="query" resultType="com.acupuncture.system.domain.vo.AdminTenantUserVo$Result">
SELECT
id,
tenant_id as tenantId,
user_name as userName,
password,
nick_name as nickName,
email,
phonenumber,
sex,
status,
del_flag as delFlag,
create_by as createBy,
create_time as createTime,
update_by as updateBy,
update_time as updateTime,
remark
FROM
dms_user
<where>
del_flag = 0
<if test="tenantId != null">
AND tenant_id = #{dto.tenantId}
</if>
</where>
</select>
</mapper>

34
acupuncture-system/src/main/resources/mapper/dao/AdminRmsReportDao.xml

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.acupuncture.system.persist.dao.RmsReportDao">
<select id="queryTypeList" resultType="com.acupuncture.system.domain.vo.AdminReportVo$TypeResult">
select
id,
type_name as typeName,
create_by as createBy,
create_time as createTime
from rms_report_type
where del_flag = 0
<if test="typeName != null and typeName != ''">
and type_name like concat('%', #{typeName}, '%')
</if>
</select>
<select id="queryManagerList" resultType="com.acupuncture.system.domain.vo.AdminReportVo$Result">
select
id,
report_title as reportTitle,
report_type as reportType,
time_range_start as timeRangeStart,
time_range_end as timeRangeEnd,
status,
create_by as createBy,
create_time as createTime
from rms_report_manager
where del_flag = 0
<if test="reportTitle != null and reportTitle != ''">
and report_title like concat('%', #{reportTitle}, '%')
</if>
</select>
</mapper>

31
acupuncture-system/src/main/resources/mapper/dao/AdminTenantDao.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.acupuncture.system.persist.dao.AdminTenantDao">
<select id="query" resultType="com.acupuncture.system.domain.vo.AdminTenantsVo$Result"
parameterType="com.acupuncture.system.domain.dto.AdminTenantsDto$Query">
SELECT
id,
code,
name,
leader,
contact_phone as contactPhone,
data_source_id as dataSourceId,
status,
create_by as createBy,
create_time as createTime,
remark
FROM
dms_tenant
<where>
del_flag = 0
<if test="dto.name != null and dto.name != ''">
AND name like concat('%', #{dto.name}, '%')
</if>
<if test="userId != null and userId != 1 and tenantId != null">
and id = #{tenantId}
</if>
</where>
order by create_time desc
</select>
</mapper>

8
acupuncture-system/src/main/resources/mapper/dao/SysPowerDao.xml

@ -69,4 +69,12 @@
</set>
where id = #{id}
</update>
<select id="checkUserNameUnique" parameterType="String" resultType="com.acupuncture.system.domain.vo.DmsLoginUserVo$DmsUserVo">
select id, user_name from dms_user where user_name = #{userName} and del_flag = '0' limit 1
</select>
<select id="checkPhoneUnique" parameterType="String" resultType="com.acupuncture.system.domain.vo.DmsLoginUserVo$DmsUserVo">
select id, user_name from dms_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
</select>
</mapper>

25
acupuncture-system/src/main/resources/mapper/system/FmsPatientQueueRelationMapper.xml

@ -21,6 +21,7 @@
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="discharge_time" jdbcType="TIMESTAMP" property="dischargeTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -83,7 +84,7 @@
<sql id="Base_Column_List">
patient_id, queue_id, name, pinyin_full, pinyin_simple, gender, birth_date, ethnicity,
education_years, phone, id_card_type, id_card, tenant_id, del_flag, create_by, create_time,
update_by, update_time, remark
update_by, update_time, remark, discharge_time
</sql>
<select id="selectByExample" parameterType="com.acupuncture.system.domain.po.FmsPatientQueueRelationExample" resultMap="BaseResultMap">
select
@ -118,14 +119,14 @@
phone, id_card_type, id_card,
tenant_id, del_flag, create_by,
create_time, update_by, update_time,
remark)
remark, discharge_time)
values (#{patientId,jdbcType=BIGINT}, #{queueId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{pinyinFull,jdbcType=VARCHAR}, #{pinyinSimple,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT},
#{birthDate,jdbcType=DATE}, #{ethnicity,jdbcType=VARCHAR}, #{educationYears,jdbcType=INTEGER},
#{phone,jdbcType=VARCHAR}, #{idCardType,jdbcType=TINYINT}, #{idCard,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{delFlag,jdbcType=TINYINT}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR})
#{remark,jdbcType=VARCHAR}, #{dischargeTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.acupuncture.system.domain.po.FmsPatientQueueRelation">
insert into fms_patient_queue_relation
@ -187,6 +188,9 @@
<if test="remark != null">
remark,
</if>
<if test="dischargeTime != null">
discharge_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">
@ -246,6 +250,9 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="dischargeTime != null">
#{dischargeTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.acupuncture.system.domain.po.FmsPatientQueueRelationExample" resultType="java.lang.Long">
@ -314,6 +321,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.dischargeTime != null">
discharge_time = #{record.dischargeTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -339,7 +349,8 @@
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
remark = #{record.remark,jdbcType=VARCHAR}
remark = #{record.remark,jdbcType=VARCHAR},
discharge_time = #{record.dischargeTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -398,6 +409,9 @@
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="dischargeTime != null">
discharge_time = #{dischargeTime,jdbcType=TIMESTAMP},
</if>
</set>
where patient_id = #{patientId,jdbcType=BIGINT}
and queue_id = #{queueId,jdbcType=BIGINT}
@ -420,7 +434,8 @@
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}
remark = #{remark,jdbcType=VARCHAR},
discharge_time = #{dischargeTime,jdbcType=TIMESTAMP}
where patient_id = #{patientId,jdbcType=BIGINT}
and queue_id = #{queueId,jdbcType=BIGINT}
</update>

22
acupuncture-system/src/main/resources/mapper/system/RmsReportTypeMapper.xml

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.acupuncture.system.persist.mapper.RmsReportTypeMapper">
<resultMap id="BaseResultMap" type="com.acupuncture.system.domain.po.RmsReportType">
<id column="id" jdbcType="INTEGER" property="id" />
<id column="id" jdbcType="BIGINT" property="id" />
<result column="type_name" jdbcType="VARCHAR" property="typeName" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
@ -86,21 +86,21 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from rms_report_type
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from rms_report_type
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.acupuncture.system.domain.po.RmsReportType">
insert into rms_report_type (id, type_name, del_flag,
create_by, create_time, update_by,
update_time, remark)
values (#{id,jdbcType=INTEGER}, #{typeName,jdbcType=VARCHAR}, #{delFlag,jdbcType=TINYINT},
values (#{id,jdbcType=BIGINT}, #{typeName,jdbcType=VARCHAR}, #{delFlag,jdbcType=TINYINT},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR})
</insert>
@ -134,7 +134,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
#{id,jdbcType=BIGINT},
</if>
<if test="typeName != null">
#{typeName,jdbcType=VARCHAR},
@ -169,7 +169,7 @@
update rms_report_type
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.typeName != null">
type_name = #{record.typeName,jdbcType=VARCHAR},
@ -199,7 +199,7 @@
</update>
<update id="updateByExample" parameterType="map">
update rms_report_type
set id = #{record.id,jdbcType=INTEGER},
set id = #{record.id,jdbcType=BIGINT},
type_name = #{record.typeName,jdbcType=VARCHAR},
del_flag = #{record.delFlag,jdbcType=TINYINT},
create_by = #{record.createBy,jdbcType=VARCHAR},
@ -236,7 +236,7 @@
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.acupuncture.system.domain.po.RmsReportType">
update rms_report_type
@ -247,6 +247,6 @@
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

2
acupuncture-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -152,6 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="tenantId != null and tenantId != 0">tenant_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="email != null and email != ''">email,</if>
@ -166,6 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)values(
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null and email != ''">#{email},</if>

103
doc/若依环境使用手册.docx

@ -1,103 +0,0 @@
若依系统开发环境搭建手册
1. 准备工作
1.1 前置环境准备 -- -- 安装Maven
若依基于Maven管理项目的构建,需要先安装好相应的版本。
1.2 开发工具
若依系统采用Eclipse作为开发工具。但不局限于Eclipse。此处仅介绍在Eclipse搭建开发环境所需的操作。
2. 开发环境搭建
2.1 开发工具的配置
2.1.1 配置Maven
进入Window->Preferences->Maven->Installations页面,设置已经安装好的Maven
2.1.2 配置Maven仓库路径
进入Window->Preferences->Maven->User Settings页面,配置仓库路径
2.1.4 关闭校验
进入Window->Preferences->Validation页面,勾选"Suspend all validators",关闭校验
2.2 导入工程
通过Eclipse导入工程,步骤如下:
(1)点击左侧项目区域 -- >Import...
(2)选择RuoYi
(3)点击Finish
(4)RuoYi的代码就被导出到Eclipse中了,此时可以在工程视图中看到。
3. 运行若依系统
3.1 必要的配置
3.1.1 修改数据库连接
编辑src/main/ resources目录下的application-druid.yml 文件,修改数据库地址账号信息。
执行sql/ ry_20180423.sql,quartz.sql 两个文件 日期随版本变化
3.1.2 开发环境配置
编辑src/main/ resources目录下的application.yml 文件,
默认端口为80
3.1.3 代码生成配置
编辑src/main/ resources目录下的application.yml 文件,
默认为module,根据实际情况修改即可。生成的表要有注释
注:如对模板有特殊需求,可自行修改。编辑src/main/ resources/templates/vm目录下
3.1.4 日志配置
编辑src/main/ resources目录下的logback.yml 文件
<property name="log.path" value="/home/ruoyi/logs" />
改为自己需要的路径
3.2 启动及验证(后台)
启动RuoYiApplication.java 出现如下图表示启动成功
打开浏览器,输入:http://localhost:8080/captchaImage
若能正确显示返回信息,搭建后台成功。
3.3 启动及验证(前台)
# 进入项目目录
cd ruoyi-ui
npm install --registry=https://registry.npm.taobao.org
npm run dev
打开浏览器,输入:http://localhost:80 (默认账户 admin/admin123)
若能正确展示登录页面,并能成功登录,菜单及页面展示正常,则表明环境搭建成功
注意:执行npm命令需要配置node环境
4. 部署若依系统
4.1 war部署方式
4.1.1 修改pom.xml文件。将jar修改为war
如果是分模块需要修改ruoyi-admin
4.1.2 在spring-boot-starter依赖中移除tomcat模块
<exclusions>
<exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
</exclusions>
4.1.3 部署到tomcat的webapps目录下面
默认为RuoYi.war
4.1.4 启动及验证
运行startup.bat 出现如下图即部署成功
4.2 Jar方式部署
执行命令:java - jar RuoYi.jar
脚本执行:ry.sh start 启动stop 停止
4.2 前端部署
# 打包正式环境
npm run build:prod
# 打包预发布环境
npm run build:stage
构建打包成功之后,会在根目录生成 dist 文件夹,里面就是构建打包好的文件,通常是 ***.js 、***.css、index.html 等静态文件。发布到你的 nginx 或者静态服务器即可,其中的 index.html 是后台服务的入口页面。
演示地址:ruoyi.vip
文档地址:doc.ruoyi.vip

12
node_modules/.bin/acorn

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@"
else
exec node "$basedir/../acorn/bin/acorn" "$@"
fi

17
node_modules/.bin/acorn.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\acorn\bin\acorn" %*

28
node_modules/.bin/acorn.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args
} else {
& "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../acorn/bin/acorn" $args
} else {
& "node$exe" "$basedir/../acorn/bin/acorn" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/atob

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../atob/bin/atob.js" "$@"
else
exec node "$basedir/../atob/bin/atob.js" "$@"
fi

17
node_modules/.bin/atob.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\atob\bin\atob.js" %*

28
node_modules/.bin/atob.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../atob/bin/atob.js" $args
} else {
& "$basedir/node$exe" "$basedir/../atob/bin/atob.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../atob/bin/atob.js" $args
} else {
& "node$exe" "$basedir/../atob/bin/atob.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/errno

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../errno/cli.js" "$@"
else
exec node "$basedir/../errno/cli.js" "$@"
fi

17
node_modules/.bin/errno.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\errno\cli.js" %*

28
node_modules/.bin/errno.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../errno/cli.js" $args
} else {
& "$basedir/node$exe" "$basedir/../errno/cli.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../errno/cli.js" $args
} else {
& "node$exe" "$basedir/../errno/cli.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/json5

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../json5/lib/cli.js" "$@"
else
exec node "$basedir/../json5/lib/cli.js" "$@"
fi

17
node_modules/.bin/json5.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json5\lib\cli.js" %*

28
node_modules/.bin/json5.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args
} else {
& "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../json5/lib/cli.js" $args
} else {
& "node$exe" "$basedir/../json5/lib/cli.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/miller-rabin

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../miller-rabin/bin/miller-rabin" "$@"
else
exec node "$basedir/../miller-rabin/bin/miller-rabin" "$@"
fi

17
node_modules/.bin/miller-rabin.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\miller-rabin\bin\miller-rabin" %*

28
node_modules/.bin/miller-rabin.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args
} else {
& "$basedir/node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args
} else {
& "node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/mkdirp

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
else
exec node "$basedir/../mkdirp/bin/cmd.js" "$@"
fi

17
node_modules/.bin/mkdirp.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %*

28
node_modules/.bin/mkdirp.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
} else {
& "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
} else {
& "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/rimraf

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../rimraf/bin.js" "$@"
else
exec node "$basedir/../rimraf/bin.js" "$@"
fi

17
node_modules/.bin/rimraf.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rimraf\bin.js" %*

28
node_modules/.bin/rimraf.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args
} else {
& "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../rimraf/bin.js" $args
} else {
& "node$exe" "$basedir/../rimraf/bin.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/semver

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../semver/bin/semver" "$@"
else
exec node "$basedir/../semver/bin/semver" "$@"
fi

17
node_modules/.bin/semver.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver" %*

28
node_modules/.bin/semver.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
} else {
& "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../semver/bin/semver" $args
} else {
& "node$exe" "$basedir/../semver/bin/semver" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/sha.js

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../sha.js/bin.js" "$@"
else
exec node "$basedir/../sha.js/bin.js" "$@"
fi

17
node_modules/.bin/sha.js.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sha.js\bin.js" %*

28
node_modules/.bin/sha.js.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../sha.js/bin.js" $args
} else {
& "$basedir/node$exe" "$basedir/../sha.js/bin.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../sha.js/bin.js" $args
} else {
& "node$exe" "$basedir/../sha.js/bin.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/terser

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../terser/bin/terser" "$@"
else
exec node "$basedir/../terser/bin/terser" "$@"
fi

17
node_modules/.bin/terser.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\terser\bin\terser" %*

28
node_modules/.bin/terser.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../terser/bin/terser" $args
} else {
& "$basedir/node$exe" "$basedir/../terser/bin/terser" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../terser/bin/terser" $args
} else {
& "node$exe" "$basedir/../terser/bin/terser" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/webpack

@ -1,12 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../webpack/bin/webpack.js" "$@"
else
exec node "$basedir/../webpack/bin/webpack.js" "$@"
fi

17
node_modules/.bin/webpack.cmd

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\webpack\bin\webpack.js" %*

28
node_modules/.bin/webpack.ps1

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../webpack/bin/webpack.js" $args
} else {
& "$basedir/node$exe" "$basedir/../webpack/bin/webpack.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../webpack/bin/webpack.js" $args
} else {
& "node$exe" "$basedir/../webpack/bin/webpack.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

4133
node_modules/.package-lock.json

File diff suppressed because it is too large

21
node_modules/@types/json-schema/LICENSE

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

15
node_modules/@types/json-schema/README.md

@ -1,15 +0,0 @@
# Installation
> `npm install --save @types/json-schema`
# Summary
This package contains type definitions for json-schema (https://github.com/kriszyp/json-schema).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema.
### Additional Details
* Last updated: Tue, 07 Nov 2023 03:09:37 GMT
* Dependencies: none
# Credits
These definitions were written by [Boris Cherny](https://github.com/bcherny), [Lucian Buzzo](https://github.com/lucianbuzzo), [Roland Groza](https://github.com/rolandjitsu), and [Jason Kwok](https://github.com/JasonHK).

749
node_modules/@types/json-schema/index.d.ts

@ -1,749 +0,0 @@
// ==================================================================================================
// JSON Schema Draft 04
// ==================================================================================================
/**
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
*/
export type JSONSchema4TypeName =
| "string" //
| "number"
| "integer"
| "boolean"
| "object"
| "array"
| "null"
| "any";
/**
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
*/
export type JSONSchema4Type =
| string //
| number
| boolean
| JSONSchema4Object
| JSONSchema4Array
| null;
// Workaround for infinite type recursion
export interface JSONSchema4Object {
[key: string]: JSONSchema4Type;
}
// Workaround for infinite type recursion
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
export interface JSONSchema4Array extends Array<JSONSchema4Type> {}
/**
* Meta schema
*
* Recommended values:
* - 'http://json-schema.org/schema#'
* - 'http://json-schema.org/hyper-schema#'
* - 'http://json-schema.org/draft-04/schema#'
* - 'http://json-schema.org/draft-04/hyper-schema#'
* - 'http://json-schema.org/draft-03/schema#'
* - 'http://json-schema.org/draft-03/hyper-schema#'
*
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
*/
export type JSONSchema4Version = string;
/**
* JSON Schema V4
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04
*/
export interface JSONSchema4 {
id?: string | undefined;
$ref?: string | undefined;
$schema?: JSONSchema4Version | undefined;
/**
* This attribute is a string that provides a short description of the
* instance property.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
*/
title?: string | undefined;
/**
* This attribute is a string that provides a full description of the of
* purpose the instance property.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
*/
description?: string | undefined;
default?: JSONSchema4Type | undefined;
multipleOf?: number | undefined;
maximum?: number | undefined;
exclusiveMaximum?: boolean | undefined;
minimum?: number | undefined;
exclusiveMinimum?: boolean | undefined;
maxLength?: number | undefined;
minLength?: number | undefined;
pattern?: string | undefined;
/**
* May only be defined when "items" is defined, and is a tuple of JSONSchemas.
*
* This provides a definition for additional items in an array instance
* when tuple definitions of the items is provided. This can be false
* to indicate additional items in the array are not allowed, or it can
* be a schema that defines the schema of the additional items.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
*/
additionalItems?: boolean | JSONSchema4 | undefined;
/**
* This attribute defines the allowed items in an instance array, and
* MUST be a schema or an array of schemas. The default value is an
* empty schema which allows any value for items in the instance array.
*
* When this attribute value is a schema and the instance value is an
* array, then all the items in the array MUST be valid according to the
* schema.
*
* When this attribute value is an array of schemas and the instance
* value is an array, each position in the instance array MUST conform
* to the schema in the corresponding position for this array. This
* called tuple typing. When tuple typing is used, additional items are
* allowed, disallowed, or constrained by the "additionalItems"
* (Section 5.6) attribute using the same rules as
* "additionalProperties" (Section 5.4) for objects.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
*/
items?: JSONSchema4 | JSONSchema4[] | undefined;
maxItems?: number | undefined;
minItems?: number | undefined;
uniqueItems?: boolean | undefined;
maxProperties?: number | undefined;
minProperties?: number | undefined;
/**
* This attribute indicates if the instance must have a value, and not
* be undefined. This is false by default, making the instance
* optional.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
*/
required?: boolean | string[] | undefined;
/**
* This attribute defines a schema for all properties that are not
* explicitly defined in an object type definition. If specified, the
* value MUST be a schema or a boolean. If false is provided, no
* additional properties are allowed beyond the properties defined in
* the schema. The default value is an empty schema which allows any
* value for additional properties.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
*/
additionalProperties?: boolean | JSONSchema4 | undefined;
definitions?: {
[k: string]: JSONSchema4;
} | undefined;
/**
* This attribute is an object with property definitions that define the
* valid values of instance object property values. When the instance
* value is an object, the property values of the instance object MUST
* conform to the property definitions in this object. In this object,
* each property definition's value MUST be a schema, and the property's
* name MUST be the name of the instance property that it defines. The
* instance property value MUST be valid according to the schema from
* the property definition. Properties are considered unordered, the
* order of the instance properties MAY be in any order.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
*/
properties?: {
[k: string]: JSONSchema4;
} | undefined;
/**
* This attribute is an object that defines the schema for a set of
* property names of an object instance. The name of each property of
* this attribute's object is a regular expression pattern in the ECMA
* 262/Perl 5 format, while the value is a schema. If the pattern
* matches the name of a property on the instance object, the value of
* the instance's property MUST be valid against the pattern name's
* schema value.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
*/
patternProperties?: {
[k: string]: JSONSchema4;
} | undefined;
dependencies?: {
[k: string]: JSONSchema4 | string[];
} | undefined;
/**
* This provides an enumeration of all possible values that are valid
* for the instance property. This MUST be an array, and each item in
* the array represents a possible value for the instance value. If
* this attribute is defined, the instance value MUST be one of the
* values in the array in order for the schema to be valid.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
*/
enum?: JSONSchema4Type[] | undefined;
/**
* A single type, or a union of simple types
*/
type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
allOf?: JSONSchema4[] | undefined;
anyOf?: JSONSchema4[] | undefined;
oneOf?: JSONSchema4[] | undefined;
not?: JSONSchema4 | undefined;
/**
* The value of this property MUST be another schema which will provide
* a base schema which the current schema will inherit from. The
* inheritance rules are such that any instance that is valid according
* to the current schema MUST be valid according to the referenced
* schema. This MAY also be an array, in which case, the instance MUST
* be valid for all the schemas in the array. A schema that extends
* another schema MAY define additional attributes, constrain existing
* attributes, or add other constraints.
*
* Conceptually, the behavior of extends can be seen as validating an
* instance against all constraints in the extending schema as well as
* the extended schema(s).
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
*/
extends?: string | string[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
*/
[k: string]: any;
format?: string | undefined;
}
// ==================================================================================================
// JSON Schema Draft 06
// ==================================================================================================
export type JSONSchema6TypeName =
| "string" //
| "number"
| "integer"
| "boolean"
| "object"
| "array"
| "null"
| "any";
export type JSONSchema6Type =
| string //
| number
| boolean
| JSONSchema6Object
| JSONSchema6Array
| null;
// Workaround for infinite type recursion
export interface JSONSchema6Object {
[key: string]: JSONSchema6Type;
}
// Workaround for infinite type recursion
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
export interface JSONSchema6Array extends Array<JSONSchema6Type> {}
/**
* Meta schema
*
* Recommended values:
* - 'http://json-schema.org/schema#'
* - 'http://json-schema.org/hyper-schema#'
* - 'http://json-schema.org/draft-06/schema#'
* - 'http://json-schema.org/draft-06/hyper-schema#'
*
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
*/
export type JSONSchema6Version = string;
/**
* JSON Schema V6
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01
*/
export type JSONSchema6Definition = JSONSchema6 | boolean;
export interface JSONSchema6 {
$id?: string | undefined;
$ref?: string | undefined;
$schema?: JSONSchema6Version | undefined;
/**
* Must be strictly greater than 0.
* A numeric instance is valid only if division by this keyword's value results in an integer.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1
*/
multipleOf?: number | undefined;
/**
* Representing an inclusive upper limit for a numeric instance.
* This keyword validates only if the instance is less than or exactly equal to "maximum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2
*/
maximum?: number | undefined;
/**
* Representing an exclusive upper limit for a numeric instance.
* This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3
*/
exclusiveMaximum?: number | undefined;
/**
* Representing an inclusive lower limit for a numeric instance.
* This keyword validates only if the instance is greater than or exactly equal to "minimum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4
*/
minimum?: number | undefined;
/**
* Representing an exclusive lower limit for a numeric instance.
* This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5
*/
exclusiveMinimum?: number | undefined;
/**
* Must be a non-negative integer.
* A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6
*/
maxLength?: number | undefined;
/**
* Must be a non-negative integer.
* A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
* Omitting this keyword has the same behavior as a value of 0.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7
*/
minLength?: number | undefined;
/**
* Should be a valid regular expression, according to the ECMA 262 regular expression dialect.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8
*/
pattern?: string | undefined;
/**
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
* Omitting this keyword has the same behavior as an empty schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9
*/
items?: JSONSchema6Definition | JSONSchema6Definition[] | undefined;
/**
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
* If "items" is an array of schemas, validation succeeds if every instance element
* at a position greater than the size of "items" validates against "additionalItems".
* Otherwise, "additionalItems" MUST be ignored, as the "items" schema
* (possibly the default value of an empty schema) is applied to all elements.
* Omitting this keyword has the same behavior as an empty schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10
*/
additionalItems?: JSONSchema6Definition | undefined;
/**
* Must be a non-negative integer.
* An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11
*/
maxItems?: number | undefined;
/**
* Must be a non-negative integer.
* An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword.
* Omitting this keyword has the same behavior as a value of 0.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12
*/
minItems?: number | undefined;
/**
* If this keyword has boolean value false, the instance validates successfully.
* If it has boolean value true, the instance validates successfully if all of its elements are unique.
* Omitting this keyword has the same behavior as a value of false.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13
*/
uniqueItems?: boolean | undefined;
/**
* An array instance is valid against "contains" if at least one of its elements is valid against the given schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14
*/
contains?: JSONSchema6Definition | undefined;
/**
* Must be a non-negative integer.
* An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15
*/
maxProperties?: number | undefined;
/**
* Must be a non-negative integer.
* An object instance is valid against "maxProperties" if its number of properties is greater than,
* or equal to, the value of this keyword.
* Omitting this keyword has the same behavior as a value of 0.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16
*/
minProperties?: number | undefined;
/**
* Elements of this array must be unique.
* An object instance is valid against this keyword if every item in the array is the name of a property in the instance.
* Omitting this keyword has the same behavior as an empty array.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17
*/
required?: string[] | undefined;
/**
* This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.
* Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value,
* the child instance for that name successfully validates against the corresponding schema.
* Omitting this keyword has the same behavior as an empty object.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18
*/
properties?: {
[k: string]: JSONSchema6Definition;
} | undefined;
/**
* This attribute is an object that defines the schema for a set of property names of an object instance.
* The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema.
* If the pattern matches the name of a property on the instance object, the value of the instance's property
* MUST be valid against the pattern name's schema value.
* Omitting this keyword has the same behavior as an empty object.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19
*/
patternProperties?: {
[k: string]: JSONSchema6Definition;
} | undefined;
/**
* This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
* If specified, the value MUST be a schema or a boolean.
* If false is provided, no additional properties are allowed beyond the properties defined in the schema.
* The default value is an empty schema which allows any value for additional properties.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
*/
additionalProperties?: JSONSchema6Definition | undefined;
/**
* This keyword specifies rules that are evaluated if the instance is an object and contains a certain property.
* Each property specifies a dependency.
* If the dependency value is an array, each element in the array must be unique.
* Omitting this keyword has the same behavior as an empty object.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21
*/
dependencies?: {
[k: string]: JSONSchema6Definition | string[];
} | undefined;
/**
* Takes a schema which validates the names of all properties rather than their values.
* Note the property name that the schema is testing will always be a string.
* Omitting this keyword has the same behavior as an empty schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22
*/
propertyNames?: JSONSchema6Definition | undefined;
/**
* This provides an enumeration of all possible values that are valid
* for the instance property. This MUST be an array, and each item in
* the array represents a possible value for the instance value. If
* this attribute is defined, the instance value MUST be one of the
* values in the array in order for the schema to be valid.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23
*/
enum?: JSONSchema6Type[] | undefined;
/**
* More readable form of a one-element "enum"
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24
*/
const?: JSONSchema6Type | undefined;
/**
* A single type, or a union of simple types
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25
*/
type?: JSONSchema6TypeName | JSONSchema6TypeName[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
*/
allOf?: JSONSchema6Definition[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
*/
anyOf?: JSONSchema6Definition[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
*/
oneOf?: JSONSchema6Definition[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29
*/
not?: JSONSchema6Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1
*/
definitions?: {
[k: string]: JSONSchema6Definition;
} | undefined;
/**
* This attribute is a string that provides a short description of the instance property.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
*/
title?: string | undefined;
/**
* This attribute is a string that provides a full description of the of purpose the instance property.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
*/
description?: string | undefined;
/**
* This keyword can be used to supply a default JSON value associated with a particular schema.
* It is RECOMMENDED that a default value be valid against the associated schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3
*/
default?: JSONSchema6Type | undefined;
/**
* Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4
*/
examples?: JSONSchema6Type[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8
*/
format?: string | undefined;
}
// ==================================================================================================
// JSON Schema Draft 07
// ==================================================================================================
// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
// --------------------------------------------------------------------------------------------------
/**
* Primitive type
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
*/
export type JSONSchema7TypeName =
| "string" //
| "number"
| "integer"
| "boolean"
| "object"
| "array"
| "null";
/**
* Primitive type
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
*/
export type JSONSchema7Type =
| string //
| number
| boolean
| JSONSchema7Object
| JSONSchema7Array
| null;
// Workaround for infinite type recursion
export interface JSONSchema7Object {
[key: string]: JSONSchema7Type;
}
// Workaround for infinite type recursion
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
export interface JSONSchema7Array extends Array<JSONSchema7Type> {}
/**
* Meta schema
*
* Recommended values:
* - 'http://json-schema.org/schema#'
* - 'http://json-schema.org/hyper-schema#'
* - 'http://json-schema.org/draft-07/schema#'
* - 'http://json-schema.org/draft-07/hyper-schema#'
*
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
*/
export type JSONSchema7Version = string;
/**
* JSON Schema v7
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
*/
export type JSONSchema7Definition = JSONSchema7 | boolean;
export interface JSONSchema7 {
$id?: string | undefined;
$ref?: string | undefined;
$schema?: JSONSchema7Version | undefined;
$comment?: string | undefined;
/**
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
*/
$defs?: {
[key: string]: JSONSchema7Definition;
} | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
*/
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
enum?: JSONSchema7Type[] | undefined;
const?: JSONSchema7Type | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
*/
multipleOf?: number | undefined;
maximum?: number | undefined;
exclusiveMaximum?: number | undefined;
minimum?: number | undefined;
exclusiveMinimum?: number | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
*/
maxLength?: number | undefined;
minLength?: number | undefined;
pattern?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
*/
items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
additionalItems?: JSONSchema7Definition | undefined;
maxItems?: number | undefined;
minItems?: number | undefined;
uniqueItems?: boolean | undefined;
contains?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
*/
maxProperties?: number | undefined;
minProperties?: number | undefined;
required?: string[] | undefined;
properties?: {
[key: string]: JSONSchema7Definition;
} | undefined;
patternProperties?: {
[key: string]: JSONSchema7Definition;
} | undefined;
additionalProperties?: JSONSchema7Definition | undefined;
dependencies?: {
[key: string]: JSONSchema7Definition | string[];
} | undefined;
propertyNames?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
*/
if?: JSONSchema7Definition | undefined;
then?: JSONSchema7Definition | undefined;
else?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
*/
allOf?: JSONSchema7Definition[] | undefined;
anyOf?: JSONSchema7Definition[] | undefined;
oneOf?: JSONSchema7Definition[] | undefined;
not?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
*/
format?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
*/
contentMediaType?: string | undefined;
contentEncoding?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
*/
definitions?: {
[key: string]: JSONSchema7Definition;
} | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
*/
title?: string | undefined;
description?: string | undefined;
default?: JSONSchema7Type | undefined;
readOnly?: boolean | undefined;
writeOnly?: boolean | undefined;
examples?: JSONSchema7Type | undefined;
}
export interface ValidationResult {
valid: boolean;
errors: ValidationError[];
}
export interface ValidationError {
property: string;
message: string;
}
/**
* To use the validator call JSONSchema.validate with an instance object and an optional schema object.
* If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
* that schema will be used to validate and the schema parameter is not necessary (if both exist,
* both validations will occur).
*/
export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONSchema7): ValidationResult;
/**
* The checkPropertyChange method will check to see if an value can legally be in property with the given schema
* This is slightly different than the validate method in that it will fail if the schema is readonly and it will
* not check for self-validation, it is assumed that the passed in value is already internally valid.
*/
export function checkPropertyChange(
value: any,
schema: JSONSchema4 | JSONSchema6 | JSONSchema7,
property: string,
): ValidationResult;
/**
* This checks to ensure that the result is valid and will throw an appropriate error message if it is not.
*/
export function mustBeValid(result: ValidationResult): void;

40
node_modules/@types/json-schema/package.json

@ -1,40 +0,0 @@
{
"name": "@types/json-schema",
"version": "7.0.15",
"description": "TypeScript definitions for json-schema",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema",
"license": "MIT",
"contributors": [
{
"name": "Boris Cherny",
"githubUsername": "bcherny",
"url": "https://github.com/bcherny"
},
{
"name": "Lucian Buzzo",
"githubUsername": "lucianbuzzo",
"url": "https://github.com/lucianbuzzo"
},
{
"name": "Roland Groza",
"githubUsername": "rolandjitsu",
"url": "https://github.com/rolandjitsu"
},
{
"name": "Jason Kwok",
"githubUsername": "JasonHK",
"url": "https://github.com/JasonHK"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/json-schema"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "79984fd70cd25c3f7d72b84368778c763c89728ea0073832d745d4691b705257",
"typeScriptVersion": "4.5"
}

21
node_modules/@webassemblyjs/ast/LICENSE

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2018 Sven Sauleau <sven@sauleau.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

167
node_modules/@webassemblyjs/ast/README.md

@ -1,167 +0,0 @@
# @webassemblyjs/ast
> AST utils for webassemblyjs
## Installation
```sh
yarn add @webassemblyjs/ast
```
## Usage
### Traverse
```js
import { traverse } from "@webassemblyjs/ast";
traverse(ast, {
Module(path) {
console.log(path.node);
}
});
```
### Instruction signatures
```js
import { signatures } from "@webassemblyjs/ast";
console.log(signatures);
```
### Path methods
- `findParent: NodeLocator`
- `replaceWith: Node => void`
- `remove: () => void`
- `insertBefore: Node => void`
- `insertAfter: Node => void`
- `stop: () => void`
### AST utils
- function `module(id, fields, metadata)`
- function `moduleMetadata(sections, functionNames, localNames)`
- function `moduleNameMetadata(value)`
- function `functionNameMetadata(value, index)`
- function `localNameMetadata(value, localIndex, functionIndex)`
- function `binaryModule(id, blob)`
- function `quoteModule(id, string)`
- function `sectionMetadata(section, startOffset, size, vectorOfSize)`
- function `loopInstruction(label, resulttype, instr)`
- function `instruction(id, args, namedArgs)`
- function `objectInstruction(id, object, args, namedArgs)`
- function `ifInstruction(testLabel, test, result, consequent, alternate)`
- function `stringLiteral(value)`
- function `numberLiteralFromRaw(value, raw)`
- function `longNumberLiteral(value, raw)`
- function `floatLiteral(value, nan, inf, raw)`
- function `elem(table, offset, funcs)`
- function `indexInFuncSection(index)`
- function `valtypeLiteral(name)`
- function `typeInstruction(id, functype)`
- function `start(index)`
- function `globalType(valtype, mutability)`
- function `leadingComment(value)`
- function `blockComment(value)`
- function `data(memoryIndex, offset, init)`
- function `global(globalType, init, name)`
- function `table(elementType, limits, name, elements)`
- function `memory(limits, id)`
- function `funcImportDescr(id, signature)`
- function `moduleImport(module, name, descr)`
- function `moduleExportDescr(exportType, id)`
- function `moduleExport(name, descr)`
- function `limit(min, max)`
- function `signature(params, results)`
- function `program(body)`
- function `identifier(value, raw)`
- function `blockInstruction(label, instr, result)`
- function `callInstruction(index, instrArgs)`
- function `callIndirectInstruction(signature, intrs)`
- function `byteArray(values)`
- function `func(name, signature, body, isExternal, metadata)`
- Constant`isModule`
- Constant`isModuleMetadata`
- Constant`isModuleNameMetadata`
- Constant`isFunctionNameMetadata`
- Constant`isLocalNameMetadata`
- Constant`isBinaryModule`
- Constant`isQuoteModule`
- Constant`isSectionMetadata`
- Constant`isLoopInstruction`
- Constant`isInstruction`
- Constant`isObjectInstruction`
- Constant`isIfInstruction`
- Constant`isStringLiteral`
- Constant`isNumberLiteral`
- Constant`isLongNumberLiteral`
- Constant`isFloatLiteral`
- Constant`isElem`
- Constant`isIndexInFuncSection`
- Constant`isValtypeLiteral`
- Constant`isTypeInstruction`
- Constant`isStart`
- Constant`isGlobalType`
- Constant`isLeadingComment`
- Constant`isBlockComment`
- Constant`isData`
- Constant`isGlobal`
- Constant`isTable`
- Constant`isMemory`
- Constant`isFuncImportDescr`
- Constant`isModuleImport`
- Constant`isModuleExportDescr`
- Constant`isModuleExport`
- Constant`isLimit`
- Constant`isSignature`
- Constant`isProgram`
- Constant`isIdentifier`
- Constant`isBlockInstruction`
- Constant`isCallInstruction`
- Constant`isCallIndirectInstruction`
- Constant`isByteArray`
- Constant`isFunc`
- Constant`assertModule`
- Constant`assertModuleMetadata`
- Constant`assertModuleNameMetadata`
- Constant`assertFunctionNameMetadata`
- Constant`assertLocalNameMetadata`
- Constant`assertBinaryModule`
- Constant`assertQuoteModule`
- Constant`assertSectionMetadata`
- Constant`assertLoopInstruction`
- Constant`assertInstruction`
- Constant`assertObjectInstruction`
- Constant`assertIfInstruction`
- Constant`assertStringLiteral`
- Constant`assertNumberLiteral`
- Constant`assertLongNumberLiteral`
- Constant`assertFloatLiteral`
- Constant`assertElem`
- Constant`assertIndexInFuncSection`
- Constant`assertValtypeLiteral`
- Constant`assertTypeInstruction`
- Constant`assertStart`
- Constant`assertGlobalType`
- Constant`assertLeadingComment`
- Constant`assertBlockComment`
- Constant`assertData`
- Constant`assertGlobal`
- Constant`assertTable`
- Constant`assertMemory`
- Constant`assertFuncImportDescr`
- Constant`assertModuleImport`
- Constant`assertModuleExportDescr`
- Constant`assertModuleExport`
- Constant`assertLimit`
- Constant`assertSignature`
- Constant`assertProgram`
- Constant`assertIdentifier`
- Constant`assertBlockInstruction`
- Constant`assertCallInstruction`
- Constant`assertCallIndirectInstruction`
- Constant`assertByteArray`
- Constant`assertFunc`

10
node_modules/@webassemblyjs/ast/esm/clone.js

@ -1,10 +0,0 @@
export function cloneNode(n) {
// $FlowIgnore
var newObj = {};
for (var k in n) {
newObj[k] = n[k];
}
return newObj;
}

663
node_modules/@webassemblyjs/ast/esm/definitions.js

@ -1,663 +0,0 @@
var definitions = {};
function defineType(typeName, metadata) {
definitions[typeName] = metadata;
}
defineType("Module", {
spec: {
wasm: "https://webassembly.github.io/spec/core/binary/modules.html#binary-module",
wat: "https://webassembly.github.io/spec/core/text/modules.html#text-module"
},
doc: "A module consists of a sequence of sections (termed fields in the text format).",
unionType: ["Node"],
fields: {
id: {
maybe: true,
type: "string"
},
fields: {
array: true,
type: "Node"
},
metadata: {
optional: true,
type: "ModuleMetadata"
}
}
});
defineType("ModuleMetadata", {
unionType: ["Node"],
fields: {
sections: {
array: true,
type: "SectionMetadata"
},
functionNames: {
optional: true,
array: true,
type: "FunctionNameMetadata"
},
localNames: {
optional: true,
array: true,
type: "ModuleMetadata"
},
producers: {
optional: true,
array: true,
type: "ProducersSectionMetadata"
}
}
});
defineType("ModuleNameMetadata", {
unionType: ["Node"],
fields: {
value: {
type: "string"
}
}
});
defineType("FunctionNameMetadata", {
unionType: ["Node"],
fields: {
value: {
type: "string"
},
index: {
type: "number"
}
}
});
defineType("LocalNameMetadata", {
unionType: ["Node"],
fields: {
value: {
type: "string"
},
localIndex: {
type: "number"
},
functionIndex: {
type: "number"
}
}
});
defineType("BinaryModule", {
unionType: ["Node"],
fields: {
id: {
maybe: true,
type: "string"
},
blob: {
array: true,
type: "string"
}
}
});
defineType("QuoteModule", {
unionType: ["Node"],
fields: {
id: {
maybe: true,
type: "string"
},
string: {
array: true,
type: "string"
}
}
});
defineType("SectionMetadata", {
unionType: ["Node"],
fields: {
section: {
type: "SectionName"
},
startOffset: {
type: "number"
},
size: {
type: "NumberLiteral"
},
vectorOfSize: {
comment: "Size of the vector in the section (if any)",
type: "NumberLiteral"
}
}
});
defineType("ProducersSectionMetadata", {
unionType: ["Node"],
fields: {
producers: {
array: true,
type: "ProducerMetadata"
}
}
});
defineType("ProducerMetadata", {
unionType: ["Node"],
fields: {
language: {
type: "ProducerMetadataVersionedName",
array: true
},
processedBy: {
type: "ProducerMetadataVersionedName",
array: true
},
sdk: {
type: "ProducerMetadataVersionedName",
array: true
}
}
});
defineType("ProducerMetadataVersionedName", {
unionType: ["Node"],
fields: {
name: {
type: "string"
},
version: {
type: "string"
}
}
});
/*
Instructions
*/
defineType("LoopInstruction", {
unionType: ["Node", "Block", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "loop"
},
label: {
maybe: true,
type: "Identifier"
},
resulttype: {
maybe: true,
type: "Valtype"
},
instr: {
array: true,
type: "Instruction"
}
}
});
defineType("Instr", {
unionType: ["Node", "Expression", "Instruction"],
fields: {
id: {
type: "string"
},
object: {
optional: true,
type: "Valtype"
},
args: {
array: true,
type: "Expression"
},
namedArgs: {
optional: true,
type: "Object"
}
}
});
defineType("IfInstruction", {
unionType: ["Node", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "if"
},
testLabel: {
comment: "only for WAST",
type: "Identifier"
},
test: {
array: true,
type: "Instruction"
},
result: {
maybe: true,
type: "Valtype"
},
consequent: {
array: true,
type: "Instruction"
},
alternate: {
array: true,
type: "Instruction"
}
}
});
/*
Concrete value types
*/
defineType("StringLiteral", {
unionType: ["Node", "Expression"],
fields: {
value: {
type: "string"
}
}
});
defineType("NumberLiteral", {
unionType: ["Node", "NumericLiteral", "Expression"],
fields: {
value: {
type: "number"
},
raw: {
type: "string"
}
}
});
defineType("LongNumberLiteral", {
unionType: ["Node", "NumericLiteral", "Expression"],
fields: {
value: {
type: "LongNumber"
},
raw: {
type: "string"
}
}
});
defineType("FloatLiteral", {
unionType: ["Node", "NumericLiteral", "Expression"],
fields: {
value: {
type: "number"
},
nan: {
optional: true,
type: "boolean"
},
inf: {
optional: true,
type: "boolean"
},
raw: {
type: "string"
}
}
});
defineType("Elem", {
unionType: ["Node"],
fields: {
table: {
type: "Index"
},
offset: {
array: true,
type: "Instruction"
},
funcs: {
array: true,
type: "Index"
}
}
});
defineType("IndexInFuncSection", {
unionType: ["Node"],
fields: {
index: {
type: "Index"
}
}
});
defineType("ValtypeLiteral", {
unionType: ["Node", "Expression"],
fields: {
name: {
type: "Valtype"
}
}
});
defineType("TypeInstruction", {
unionType: ["Node", "Instruction"],
fields: {
id: {
maybe: true,
type: "Index"
},
functype: {
type: "Signature"
}
}
});
defineType("Start", {
unionType: ["Node"],
fields: {
index: {
type: "Index"
}
}
});
defineType("GlobalType", {
unionType: ["Node", "ImportDescr"],
fields: {
valtype: {
type: "Valtype"
},
mutability: {
type: "Mutability"
}
}
});
defineType("LeadingComment", {
unionType: ["Node"],
fields: {
value: {
type: "string"
}
}
});
defineType("BlockComment", {
unionType: ["Node"],
fields: {
value: {
type: "string"
}
}
});
defineType("Data", {
unionType: ["Node"],
fields: {
memoryIndex: {
type: "Memidx"
},
offset: {
type: "Instruction"
},
init: {
type: "ByteArray"
}
}
});
defineType("Global", {
unionType: ["Node"],
fields: {
globalType: {
type: "GlobalType"
},
init: {
array: true,
type: "Instruction"
},
name: {
maybe: true,
type: "Identifier"
}
}
});
defineType("Table", {
unionType: ["Node", "ImportDescr"],
fields: {
elementType: {
type: "TableElementType"
},
limits: {
assertNodeType: true,
type: "Limit"
},
name: {
maybe: true,
type: "Identifier"
},
elements: {
array: true,
optional: true,
type: "Index"
}
}
});
defineType("Memory", {
unionType: ["Node", "ImportDescr"],
fields: {
limits: {
type: "Limit"
},
id: {
maybe: true,
type: "Index"
}
}
});
defineType("FuncImportDescr", {
unionType: ["Node", "ImportDescr"],
fields: {
id: {
type: "Identifier"
},
signature: {
type: "Signature"
}
}
});
defineType("ModuleImport", {
unionType: ["Node"],
fields: {
module: {
type: "string"
},
name: {
type: "string"
},
descr: {
type: "ImportDescr"
}
}
});
defineType("ModuleExportDescr", {
unionType: ["Node"],
fields: {
exportType: {
type: "ExportDescrType"
},
id: {
type: "Index"
}
}
});
defineType("ModuleExport", {
unionType: ["Node"],
fields: {
name: {
type: "string"
},
descr: {
type: "ModuleExportDescr"
}
}
});
defineType("Limit", {
unionType: ["Node"],
fields: {
min: {
type: "number"
},
max: {
optional: true,
type: "number"
}
}
});
defineType("Signature", {
unionType: ["Node"],
fields: {
params: {
array: true,
type: "FuncParam"
},
results: {
array: true,
type: "Valtype"
}
}
});
defineType("Program", {
unionType: ["Node"],
fields: {
body: {
array: true,
type: "Node"
}
}
});
defineType("Identifier", {
unionType: ["Node", "Expression"],
fields: {
value: {
type: "string"
},
raw: {
optional: true,
type: "string"
}
}
});
defineType("BlockInstruction", {
unionType: ["Node", "Block", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "block"
},
label: {
maybe: true,
type: "Identifier"
},
instr: {
array: true,
type: "Instruction"
},
result: {
maybe: true,
type: "Valtype"
}
}
});
defineType("CallInstruction", {
unionType: ["Node", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "call"
},
index: {
type: "Index"
},
instrArgs: {
array: true,
optional: true,
type: "Expression"
},
numeric: {
type: "Index",
optional: true
}
}
});
defineType("CallIndirectInstruction", {
unionType: ["Node", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "call_indirect"
},
signature: {
type: "SignatureOrTypeRef"
},
intrs: {
array: true,
optional: true,
type: "Expression"
}
}
});
defineType("ByteArray", {
unionType: ["Node"],
fields: {
values: {
array: true,
type: "Byte"
}
}
});
defineType("Func", {
unionType: ["Node", "Block"],
fields: {
name: {
maybe: true,
type: "Index"
},
signature: {
type: "SignatureOrTypeRef"
},
body: {
array: true,
type: "Instruction"
},
isExternal: {
comment: "means that it has been imported from the outside js",
optional: true,
type: "boolean"
},
metadata: {
optional: true,
type: "FuncMetadata"
}
}
});
/**
* Intrinsics
*/
defineType("InternalBrUnless", {
unionType: ["Node", "Intrinsic"],
fields: {
target: {
type: "number"
}
}
});
defineType("InternalGoto", {
unionType: ["Node", "Intrinsic"],
fields: {
target: {
type: "number"
}
}
});
defineType("InternalCallExtern", {
unionType: ["Node", "Intrinsic"],
fields: {
target: {
type: "number"
}
}
}); // function bodies are terminated by an `end` instruction but are missing a
// return instruction
//
// Since we can't inject a new instruction we are injecting a new instruction.
defineType("InternalEndAndReturn", {
unionType: ["Node", "Intrinsic"],
fields: {}
});
module.exports = definitions;

6
node_modules/@webassemblyjs/ast/esm/index.js

@ -1,6 +0,0 @@
export * from "./nodes";
export { numberLiteralFromRaw, withLoc, withRaw, funcParam, indexLiteral, memIndexLiteral, instruction, objectInstruction } from "./node-helpers.js";
export { traverse } from "./traverse";
export { signatures } from "./signatures";
export * from "./utils";
export { cloneNode } from "./clone";

84
node_modules/@webassemblyjs/ast/esm/node-helpers.js

@ -1,84 +0,0 @@
import { parse32F, parse64F, parse32I, parse64I, parseU32, isNanLiteral, isInfLiteral } from "@webassemblyjs/wast-parser";
import { longNumberLiteral, floatLiteral, numberLiteral, instr } from "./nodes";
export function numberLiteralFromRaw(rawValue) {
var instructionType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "i32";
var original = rawValue; // Remove numeric separators _
if (typeof rawValue === "string") {
rawValue = rawValue.replace(/_/g, "");
}
if (typeof rawValue === "number") {
return numberLiteral(rawValue, String(original));
} else {
switch (instructionType) {
case "i32":
{
return numberLiteral(parse32I(rawValue), String(original));
}
case "u32":
{
return numberLiteral(parseU32(rawValue), String(original));
}
case "i64":
{
return longNumberLiteral(parse64I(rawValue), String(original));
}
case "f32":
{
return floatLiteral(parse32F(rawValue), isNanLiteral(rawValue), isInfLiteral(rawValue), String(original));
}
// f64
default:
{
return floatLiteral(parse64F(rawValue), isNanLiteral(rawValue), isInfLiteral(rawValue), String(original));
}
}
}
}
export function instruction(id) {
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var namedArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return instr(id, undefined, args, namedArgs);
}
export function objectInstruction(id, object) {
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
var namedArgs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
return instr(id, object, args, namedArgs);
}
/**
* Decorators
*/
export function withLoc(n, end, start) {
var loc = {
start: start,
end: end
};
n.loc = loc;
return n;
}
export function withRaw(n, raw) {
n.raw = raw;
return n;
}
export function funcParam(valtype, id) {
return {
id: id,
valtype: valtype
};
}
export function indexLiteral(value) {
// $FlowIgnore
var x = numberLiteralFromRaw(value, "u32");
return x;
}
export function memIndexLiteral(value) {
// $FlowIgnore
var x = numberLiteralFromRaw(value, "u32");
return x;
}

137
node_modules/@webassemblyjs/ast/esm/node-path.js

@ -1,137 +0,0 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function findParent(_ref, cb) {
var parentPath = _ref.parentPath;
if (parentPath == null) {
throw new Error("node is root");
}
var currentPath = parentPath;
while (cb(currentPath) !== false) {
// Hit the root node, stop
// $FlowIgnore
if (currentPath.parentPath == null) {
return null;
} // $FlowIgnore
currentPath = currentPath.parentPath;
}
return currentPath.node;
}
function insertBefore(context, newNode) {
return insert(context, newNode);
}
function insertAfter(context, newNode) {
return insert(context, newNode, 1);
}
function insert(_ref2, newNode) {
var node = _ref2.node,
inList = _ref2.inList,
parentPath = _ref2.parentPath,
parentKey = _ref2.parentKey;
var indexOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
if (!inList) {
throw new Error('inList' + " error: " + ("insert can only be used for nodes that are within lists" || "unknown"));
}
if (!(parentPath != null)) {
throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown"));
}
// $FlowIgnore
var parentList = parentPath.node[parentKey];
var indexInList = parentList.findIndex(function (n) {
return n === node;
});
parentList.splice(indexInList + indexOffset, 0, newNode);
}
function remove(_ref3) {
var node = _ref3.node,
parentKey = _ref3.parentKey,
parentPath = _ref3.parentPath;
if (!(parentPath != null)) {
throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown"));
}
// $FlowIgnore
var parentNode = parentPath.node; // $FlowIgnore
var parentProperty = parentNode[parentKey];
if (Array.isArray(parentProperty)) {
// $FlowIgnore
parentNode[parentKey] = parentProperty.filter(function (n) {
return n !== node;
});
} else {
// $FlowIgnore
delete parentNode[parentKey];
}
node._deleted = true;
}
function stop(context) {
context.shouldStop = true;
}
function replaceWith(context, newNode) {
// $FlowIgnore
var parentNode = context.parentPath.node; // $FlowIgnore
var parentProperty = parentNode[context.parentKey];
if (Array.isArray(parentProperty)) {
var indexInList = parentProperty.findIndex(function (n) {
return n === context.node;
});
parentProperty.splice(indexInList, 1, newNode);
} else {
// $FlowIgnore
parentNode[context.parentKey] = newNode;
}
context.node._deleted = true;
context.node = newNode;
} // bind the context to the first argument of node operations
function bindNodeOperations(operations, context) {
var keys = Object.keys(operations);
var boundOperations = {};
keys.forEach(function (key) {
boundOperations[key] = operations[key].bind(null, context);
});
return boundOperations;
}
function createPathOperations(context) {
// $FlowIgnore
return bindNodeOperations({
findParent: findParent,
replaceWith: replaceWith,
remove: remove,
insertBefore: insertBefore,
insertAfter: insertAfter,
stop: stop
}, context);
}
export function createPath(context) {
var path = _extends({}, context); // $FlowIgnore
Object.assign(path, createPathOperations(path)); // $FlowIgnore
return path;
}

915
node_modules/@webassemblyjs/ast/esm/nodes.js

@ -1,915 +0,0 @@
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
// THIS FILE IS AUTOGENERATED
// see scripts/generateNodeUtils.js
function isTypeOf(t) {
return function (n) {
return n.type === t;
};
}
function assertTypeOf(t) {
return function (n) {
return function () {
if (!(n.type === t)) {
throw new Error('n.type === t' + " error: " + (undefined || "unknown"));
}
}();
};
}
export function module(id, fields, metadata) {
if (id !== null && id !== undefined) {
if (!(typeof id === "string")) {
throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
}
}
if (!(_typeof(fields) === "object" && typeof fields.length !== "undefined")) {
throw new Error('typeof fields === "object" && typeof fields.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "Module",
id: id,
fields: fields
};
if (typeof metadata !== "undefined") {
node.metadata = metadata;
}
return node;
}
export function moduleMetadata(sections, functionNames, localNames, producers) {
if (!(_typeof(sections) === "object" && typeof sections.length !== "undefined")) {
throw new Error('typeof sections === "object" && typeof sections.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
if (functionNames !== null && functionNames !== undefined) {
if (!(_typeof(functionNames) === "object" && typeof functionNames.length !== "undefined")) {
throw new Error('typeof functionNames === "object" && typeof functionNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
}
if (localNames !== null && localNames !== undefined) {
if (!(_typeof(localNames) === "object" && typeof localNames.length !== "undefined")) {
throw new Error('typeof localNames === "object" && typeof localNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
}
if (producers !== null && producers !== undefined) {
if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
}
var node = {
type: "ModuleMetadata",
sections: sections
};
if (typeof functionNames !== "undefined" && functionNames.length > 0) {
node.functionNames = functionNames;
}
if (typeof localNames !== "undefined" && localNames.length > 0) {
node.localNames = localNames;
}
if (typeof producers !== "undefined" && producers.length > 0) {
node.producers = producers;
}
return node;
}
export function moduleNameMetadata(value) {
if (!(typeof value === "string")) {
throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
}
var node = {
type: "ModuleNameMetadata",
value: value
};
return node;
}
export function functionNameMetadata(value, index) {
if (!(typeof value === "string")) {
throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
}
if (!(typeof index === "number")) {
throw new Error('typeof index === "number"' + " error: " + ("Argument index must be of type number, given: " + _typeof(index) || "unknown"));
}
var node = {
type: "FunctionNameMetadata",
value: value,
index: index
};
return node;
}
export function localNameMetadata(value, localIndex, functionIndex) {
if (!(typeof value === "string")) {
throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
}
if (!(typeof localIndex === "number")) {
throw new Error('typeof localIndex === "number"' + " error: " + ("Argument localIndex must be of type number, given: " + _typeof(localIndex) || "unknown"));
}
if (!(typeof functionIndex === "number")) {
throw new Error('typeof functionIndex === "number"' + " error: " + ("Argument functionIndex must be of type number, given: " + _typeof(functionIndex) || "unknown"));
}
var node = {
type: "LocalNameMetadata",
value: value,
localIndex: localIndex,
functionIndex: functionIndex
};
return node;
}
export function binaryModule(id, blob) {
if (id !== null && id !== undefined) {
if (!(typeof id === "string")) {
throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
}
}
if (!(_typeof(blob) === "object" && typeof blob.length !== "undefined")) {
throw new Error('typeof blob === "object" && typeof blob.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "BinaryModule",
id: id,
blob: blob
};
return node;
}
export function quoteModule(id, string) {
if (id !== null && id !== undefined) {
if (!(typeof id === "string")) {
throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
}
}
if (!(_typeof(string) === "object" && typeof string.length !== "undefined")) {
throw new Error('typeof string === "object" && typeof string.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "QuoteModule",
id: id,
string: string
};
return node;
}
export function sectionMetadata(section, startOffset, size, vectorOfSize) {
if (!(typeof startOffset === "number")) {
throw new Error('typeof startOffset === "number"' + " error: " + ("Argument startOffset must be of type number, given: " + _typeof(startOffset) || "unknown"));
}
var node = {
type: "SectionMetadata",
section: section,
startOffset: startOffset,
size: size,
vectorOfSize: vectorOfSize
};
return node;
}
export function producersSectionMetadata(producers) {
if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "ProducersSectionMetadata",
producers: producers
};
return node;
}
export function producerMetadata(language, processedBy, sdk) {
if (!(_typeof(language) === "object" && typeof language.length !== "undefined")) {
throw new Error('typeof language === "object" && typeof language.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
if (!(_typeof(processedBy) === "object" && typeof processedBy.length !== "undefined")) {
throw new Error('typeof processedBy === "object" && typeof processedBy.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
if (!(_typeof(sdk) === "object" && typeof sdk.length !== "undefined")) {
throw new Error('typeof sdk === "object" && typeof sdk.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "ProducerMetadata",
language: language,
processedBy: processedBy,
sdk: sdk
};
return node;
}
export function producerMetadataVersionedName(name, version) {
if (!(typeof name === "string")) {
throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
}
if (!(typeof version === "string")) {
throw new Error('typeof version === "string"' + " error: " + ("Argument version must be of type string, given: " + _typeof(version) || "unknown"));
}
var node = {
type: "ProducerMetadataVersionedName",
name: name,
version: version
};
return node;
}
export function loopInstruction(label, resulttype, instr) {
if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "LoopInstruction",
id: "loop",
label: label,
resulttype: resulttype,
instr: instr
};
return node;
}
export function instr(id, object, args, namedArgs) {
if (!(typeof id === "string")) {
throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
}
if (!(_typeof(args) === "object" && typeof args.length !== "undefined")) {
throw new Error('typeof args === "object" && typeof args.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "Instr",
id: id,
args: args
};
if (typeof object !== "undefined") {
node.object = object;
}
if (typeof namedArgs !== "undefined" && Object.keys(namedArgs).length !== 0) {
node.namedArgs = namedArgs;
}
return node;
}
export function ifInstruction(testLabel, test, result, consequent, alternate) {
if (!(_typeof(test) === "object" && typeof test.length !== "undefined")) {
throw new Error('typeof test === "object" && typeof test.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
if (!(_typeof(consequent) === "object" && typeof consequent.length !== "undefined")) {
throw new Error('typeof consequent === "object" && typeof consequent.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
if (!(_typeof(alternate) === "object" && typeof alternate.length !== "undefined")) {
throw new Error('typeof alternate === "object" && typeof alternate.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "IfInstruction",
id: "if",
testLabel: testLabel,
test: test,
result: result,
consequent: consequent,
alternate: alternate
};
return node;
}
export function stringLiteral(value) {
if (!(typeof value === "string")) {
throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
}
var node = {
type: "StringLiteral",
value: value
};
return node;
}
export function numberLiteral(value, raw) {
if (!(typeof value === "number")) {
throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
}
if (!(typeof raw === "string")) {
throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
}
var node = {
type: "NumberLiteral",
value: value,
raw: raw
};
return node;
}
export function longNumberLiteral(value, raw) {
if (!(typeof raw === "string")) {
throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
}
var node = {
type: "LongNumberLiteral",
value: value,
raw: raw
};
return node;
}
export function floatLiteral(value, nan, inf, raw) {
if (!(typeof value === "number")) {
throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
}
if (nan !== null && nan !== undefined) {
if (!(typeof nan === "boolean")) {
throw new Error('typeof nan === "boolean"' + " error: " + ("Argument nan must be of type boolean, given: " + _typeof(nan) || "unknown"));
}
}
if (inf !== null && inf !== undefined) {
if (!(typeof inf === "boolean")) {
throw new Error('typeof inf === "boolean"' + " error: " + ("Argument inf must be of type boolean, given: " + _typeof(inf) || "unknown"));
}
}
if (!(typeof raw === "string")) {
throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
}
var node = {
type: "FloatLiteral",
value: value,
raw: raw
};
if (nan === true) {
node.nan = true;
}
if (inf === true) {
node.inf = true;
}
return node;
}
export function elem(table, offset, funcs) {
if (!(_typeof(offset) === "object" && typeof offset.length !== "undefined")) {
throw new Error('typeof offset === "object" && typeof offset.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
if (!(_typeof(funcs) === "object" && typeof funcs.length !== "undefined")) {
throw new Error('typeof funcs === "object" && typeof funcs.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "Elem",
table: table,
offset: offset,
funcs: funcs
};
return node;
}
export function indexInFuncSection(index) {
var node = {
type: "IndexInFuncSection",
index: index
};
return node;
}
export function valtypeLiteral(name) {
var node = {
type: "ValtypeLiteral",
name: name
};
return node;
}
export function typeInstruction(id, functype) {
var node = {
type: "TypeInstruction",
id: id,
functype: functype
};
return node;
}
export function start(index) {
var node = {
type: "Start",
index: index
};
return node;
}
export function globalType(valtype, mutability) {
var node = {
type: "GlobalType",
valtype: valtype,
mutability: mutability
};
return node;
}
export function leadingComment(value) {
if (!(typeof value === "string")) {
throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
}
var node = {
type: "LeadingComment",
value: value
};
return node;
}
export function blockComment(value) {
if (!(typeof value === "string")) {
throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
}
var node = {
type: "BlockComment",
value: value
};
return node;
}
export function data(memoryIndex, offset, init) {
var node = {
type: "Data",
memoryIndex: memoryIndex,
offset: offset,
init: init
};
return node;
}
export function global(globalType, init, name) {
if (!(_typeof(init) === "object" && typeof init.length !== "undefined")) {
throw new Error('typeof init === "object" && typeof init.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "Global",
globalType: globalType,
init: init,
name: name
};
return node;
}
export function table(elementType, limits, name, elements) {
if (!(limits.type === "Limit")) {
throw new Error('limits.type === "Limit"' + " error: " + ("Argument limits must be of type Limit, given: " + limits.type || "unknown"));
}
if (elements !== null && elements !== undefined) {
if (!(_typeof(elements) === "object" && typeof elements.length !== "undefined")) {
throw new Error('typeof elements === "object" && typeof elements.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
}
var node = {
type: "Table",
elementType: elementType,
limits: limits,
name: name
};
if (typeof elements !== "undefined" && elements.length > 0) {
node.elements = elements;
}
return node;
}
export function memory(limits, id) {
var node = {
type: "Memory",
limits: limits,
id: id
};
return node;
}
export function funcImportDescr(id, signature) {
var node = {
type: "FuncImportDescr",
id: id,
signature: signature
};
return node;
}
export function moduleImport(module, name, descr) {
if (!(typeof module === "string")) {
throw new Error('typeof module === "string"' + " error: " + ("Argument module must be of type string, given: " + _typeof(module) || "unknown"));
}
if (!(typeof name === "string")) {
throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
}
var node = {
type: "ModuleImport",
module: module,
name: name,
descr: descr
};
return node;
}
export function moduleExportDescr(exportType, id) {
var node = {
type: "ModuleExportDescr",
exportType: exportType,
id: id
};
return node;
}
export function moduleExport(name, descr) {
if (!(typeof name === "string")) {
throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
}
var node = {
type: "ModuleExport",
name: name,
descr: descr
};
return node;
}
export function limit(min, max) {
if (!(typeof min === "number")) {
throw new Error('typeof min === "number"' + " error: " + ("Argument min must be of type number, given: " + _typeof(min) || "unknown"));
}
if (max !== null && max !== undefined) {
if (!(typeof max === "number")) {
throw new Error('typeof max === "number"' + " error: " + ("Argument max must be of type number, given: " + _typeof(max) || "unknown"));
}
}
var node = {
type: "Limit",
min: min
};
if (typeof max !== "undefined") {
node.max = max;
}
return node;
}
export function signature(params, results) {
if (!(_typeof(params) === "object" && typeof params.length !== "undefined")) {
throw new Error('typeof params === "object" && typeof params.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
if (!(_typeof(results) === "object" && typeof results.length !== "undefined")) {
throw new Error('typeof results === "object" && typeof results.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "Signature",
params: params,
results: results
};
return node;
}
export function program(body) {
if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "Program",
body: body
};
return node;
}
export function identifier(value, raw) {
if (!(typeof value === "string")) {
throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
}
if (raw !== null && raw !== undefined) {
if (!(typeof raw === "string")) {
throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
}
}
var node = {
type: "Identifier",
value: value
};
if (typeof raw !== "undefined") {
node.raw = raw;
}
return node;
}
export function blockInstruction(label, instr, result) {
if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "BlockInstruction",
id: "block",
label: label,
instr: instr,
result: result
};
return node;
}
export function callInstruction(index, instrArgs, numeric) {
if (instrArgs !== null && instrArgs !== undefined) {
if (!(_typeof(instrArgs) === "object" && typeof instrArgs.length !== "undefined")) {
throw new Error('typeof instrArgs === "object" && typeof instrArgs.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
}
var node = {
type: "CallInstruction",
id: "call",
index: index
};
if (typeof instrArgs !== "undefined" && instrArgs.length > 0) {
node.instrArgs = instrArgs;
}
if (typeof numeric !== "undefined") {
node.numeric = numeric;
}
return node;
}
export function callIndirectInstruction(signature, intrs) {
if (intrs !== null && intrs !== undefined) {
if (!(_typeof(intrs) === "object" && typeof intrs.length !== "undefined")) {
throw new Error('typeof intrs === "object" && typeof intrs.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
}
var node = {
type: "CallIndirectInstruction",
id: "call_indirect",
signature: signature
};
if (typeof intrs !== "undefined" && intrs.length > 0) {
node.intrs = intrs;
}
return node;
}
export function byteArray(values) {
if (!(_typeof(values) === "object" && typeof values.length !== "undefined")) {
throw new Error('typeof values === "object" && typeof values.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
var node = {
type: "ByteArray",
values: values
};
return node;
}
export function func(name, signature, body, isExternal, metadata) {
if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
}
if (isExternal !== null && isExternal !== undefined) {
if (!(typeof isExternal === "boolean")) {
throw new Error('typeof isExternal === "boolean"' + " error: " + ("Argument isExternal must be of type boolean, given: " + _typeof(isExternal) || "unknown"));
}
}
var node = {
type: "Func",
name: name,
signature: signature,
body: body
};
if (isExternal === true) {
node.isExternal = true;
}
if (typeof metadata !== "undefined") {
node.metadata = metadata;
}
return node;
}
export function internalBrUnless(target) {
if (!(typeof target === "number")) {
throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
}
var node = {
type: "InternalBrUnless",
target: target
};
return node;
}
export function internalGoto(target) {
if (!(typeof target === "number")) {
throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
}
var node = {
type: "InternalGoto",
target: target
};
return node;
}
export function internalCallExtern(target) {
if (!(typeof target === "number")) {
throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
}
var node = {
type: "InternalCallExtern",
target: target
};
return node;
}
export function internalEndAndReturn() {
var node = {
type: "InternalEndAndReturn"
};
return node;
}
export var isModule = isTypeOf("Module");
export var isModuleMetadata = isTypeOf("ModuleMetadata");
export var isModuleNameMetadata = isTypeOf("ModuleNameMetadata");
export var isFunctionNameMetadata = isTypeOf("FunctionNameMetadata");
export var isLocalNameMetadata = isTypeOf("LocalNameMetadata");
export var isBinaryModule = isTypeOf("BinaryModule");
export var isQuoteModule = isTypeOf("QuoteModule");
export var isSectionMetadata = isTypeOf("SectionMetadata");
export var isProducersSectionMetadata = isTypeOf("ProducersSectionMetadata");
export var isProducerMetadata = isTypeOf("ProducerMetadata");
export var isProducerMetadataVersionedName = isTypeOf("ProducerMetadataVersionedName");
export var isLoopInstruction = isTypeOf("LoopInstruction");
export var isInstr = isTypeOf("Instr");
export var isIfInstruction = isTypeOf("IfInstruction");
export var isStringLiteral = isTypeOf("StringLiteral");
export var isNumberLiteral = isTypeOf("NumberLiteral");
export var isLongNumberLiteral = isTypeOf("LongNumberLiteral");
export var isFloatLiteral = isTypeOf("FloatLiteral");
export var isElem = isTypeOf("Elem");
export var isIndexInFuncSection = isTypeOf("IndexInFuncSection");
export var isValtypeLiteral = isTypeOf("ValtypeLiteral");
export var isTypeInstruction = isTypeOf("TypeInstruction");
export var isStart = isTypeOf("Start");
export var isGlobalType = isTypeOf("GlobalType");
export var isLeadingComment = isTypeOf("LeadingComment");
export var isBlockComment = isTypeOf("BlockComment");
export var isData = isTypeOf("Data");
export var isGlobal = isTypeOf("Global");
export var isTable = isTypeOf("Table");
export var isMemory = isTypeOf("Memory");
export var isFuncImportDescr = isTypeOf("FuncImportDescr");
export var isModuleImport = isTypeOf("ModuleImport");
export var isModuleExportDescr = isTypeOf("ModuleExportDescr");
export var isModuleExport = isTypeOf("ModuleExport");
export var isLimit = isTypeOf("Limit");
export var isSignature = isTypeOf("Signature");
export var isProgram = isTypeOf("Program");
export var isIdentifier = isTypeOf("Identifier");
export var isBlockInstruction = isTypeOf("BlockInstruction");
export var isCallInstruction = isTypeOf("CallInstruction");
export var isCallIndirectInstruction = isTypeOf("CallIndirectInstruction");
export var isByteArray = isTypeOf("ByteArray");
export var isFunc = isTypeOf("Func");
export var isInternalBrUnless = isTypeOf("InternalBrUnless");
export var isInternalGoto = isTypeOf("InternalGoto");
export var isInternalCallExtern = isTypeOf("InternalCallExtern");
export var isInternalEndAndReturn = isTypeOf("InternalEndAndReturn");
export var isNode = function isNode(node) {
return isModule(node) || isModuleMetadata(node) || isModuleNameMetadata(node) || isFunctionNameMetadata(node) || isLocalNameMetadata(node) || isBinaryModule(node) || isQuoteModule(node) || isSectionMetadata(node) || isProducersSectionMetadata(node) || isProducerMetadata(node) || isProducerMetadataVersionedName(node) || isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isElem(node) || isIndexInFuncSection(node) || isValtypeLiteral(node) || isTypeInstruction(node) || isStart(node) || isGlobalType(node) || isLeadingComment(node) || isBlockComment(node) || isData(node) || isGlobal(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node) || isModuleImport(node) || isModuleExportDescr(node) || isModuleExport(node) || isLimit(node) || isSignature(node) || isProgram(node) || isIdentifier(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node) || isByteArray(node) || isFunc(node) || isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
};
export var isBlock = function isBlock(node) {
return isLoopInstruction(node) || isBlockInstruction(node) || isFunc(node);
};
export var isInstruction = function isInstruction(node) {
return isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isTypeInstruction(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node);
};
export var isExpression = function isExpression(node) {
return isInstr(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isValtypeLiteral(node) || isIdentifier(node);
};
export var isNumericLiteral = function isNumericLiteral(node) {
return isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node);
};
export var isImportDescr = function isImportDescr(node) {
return isGlobalType(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node);
};
export var isIntrinsic = function isIntrinsic(node) {
return isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
};
export var assertModule = assertTypeOf("Module");
export var assertModuleMetadata = assertTypeOf("ModuleMetadata");
export var assertModuleNameMetadata = assertTypeOf("ModuleNameMetadata");
export var assertFunctionNameMetadata = assertTypeOf("FunctionNameMetadata");
export var assertLocalNameMetadata = assertTypeOf("LocalNameMetadata");
export var assertBinaryModule = assertTypeOf("BinaryModule");
export var assertQuoteModule = assertTypeOf("QuoteModule");
export var assertSectionMetadata = assertTypeOf("SectionMetadata");
export var assertProducersSectionMetadata = assertTypeOf("ProducersSectionMetadata");
export var assertProducerMetadata = assertTypeOf("ProducerMetadata");
export var assertProducerMetadataVersionedName = assertTypeOf("ProducerMetadataVersionedName");
export var assertLoopInstruction = assertTypeOf("LoopInstruction");
export var assertInstr = assertTypeOf("Instr");
export var assertIfInstruction = assertTypeOf("IfInstruction");
export var assertStringLiteral = assertTypeOf("StringLiteral");
export var assertNumberLiteral = assertTypeOf("NumberLiteral");
export var assertLongNumberLiteral = assertTypeOf("LongNumberLiteral");
export var assertFloatLiteral = assertTypeOf("FloatLiteral");
export var assertElem = assertTypeOf("Elem");
export var assertIndexInFuncSection = assertTypeOf("IndexInFuncSection");
export var assertValtypeLiteral = assertTypeOf("ValtypeLiteral");
export var assertTypeInstruction = assertTypeOf("TypeInstruction");
export var assertStart = assertTypeOf("Start");
export var assertGlobalType = assertTypeOf("GlobalType");
export var assertLeadingComment = assertTypeOf("LeadingComment");
export var assertBlockComment = assertTypeOf("BlockComment");
export var assertData = assertTypeOf("Data");
export var assertGlobal = assertTypeOf("Global");
export var assertTable = assertTypeOf("Table");
export var assertMemory = assertTypeOf("Memory");
export var assertFuncImportDescr = assertTypeOf("FuncImportDescr");
export var assertModuleImport = assertTypeOf("ModuleImport");
export var assertModuleExportDescr = assertTypeOf("ModuleExportDescr");
export var assertModuleExport = assertTypeOf("ModuleExport");
export var assertLimit = assertTypeOf("Limit");
export var assertSignature = assertTypeOf("Signature");
export var assertProgram = assertTypeOf("Program");
export var assertIdentifier = assertTypeOf("Identifier");
export var assertBlockInstruction = assertTypeOf("BlockInstruction");
export var assertCallInstruction = assertTypeOf("CallInstruction");
export var assertCallIndirectInstruction = assertTypeOf("CallIndirectInstruction");
export var assertByteArray = assertTypeOf("ByteArray");
export var assertFunc = assertTypeOf("Func");
export var assertInternalBrUnless = assertTypeOf("InternalBrUnless");
export var assertInternalGoto = assertTypeOf("InternalGoto");
export var assertInternalCallExtern = assertTypeOf("InternalCallExtern");
export var assertInternalEndAndReturn = assertTypeOf("InternalEndAndReturn");
export var unionTypesMap = {
Module: ["Node"],
ModuleMetadata: ["Node"],
ModuleNameMetadata: ["Node"],
FunctionNameMetadata: ["Node"],
LocalNameMetadata: ["Node"],
BinaryModule: ["Node"],
QuoteModule: ["Node"],
SectionMetadata: ["Node"],
ProducersSectionMetadata: ["Node"],
ProducerMetadata: ["Node"],
ProducerMetadataVersionedName: ["Node"],
LoopInstruction: ["Node", "Block", "Instruction"],
Instr: ["Node", "Expression", "Instruction"],
IfInstruction: ["Node", "Instruction"],
StringLiteral: ["Node", "Expression"],
NumberLiteral: ["Node", "NumericLiteral", "Expression"],
LongNumberLiteral: ["Node", "NumericLiteral", "Expression"],
FloatLiteral: ["Node", "NumericLiteral", "Expression"],
Elem: ["Node"],
IndexInFuncSection: ["Node"],
ValtypeLiteral: ["Node", "Expression"],
TypeInstruction: ["Node", "Instruction"],
Start: ["Node"],
GlobalType: ["Node", "ImportDescr"],
LeadingComment: ["Node"],
BlockComment: ["Node"],
Data: ["Node"],
Global: ["Node"],
Table: ["Node", "ImportDescr"],
Memory: ["Node", "ImportDescr"],
FuncImportDescr: ["Node", "ImportDescr"],
ModuleImport: ["Node"],
ModuleExportDescr: ["Node"],
ModuleExport: ["Node"],
Limit: ["Node"],
Signature: ["Node"],
Program: ["Node"],
Identifier: ["Node", "Expression"],
BlockInstruction: ["Node", "Block", "Instruction"],
CallInstruction: ["Node", "Instruction"],
CallIndirectInstruction: ["Node", "Instruction"],
ByteArray: ["Node"],
Func: ["Node", "Block"],
InternalBrUnless: ["Node", "Intrinsic"],
InternalGoto: ["Node", "Intrinsic"],
InternalCallExtern: ["Node", "Intrinsic"],
InternalEndAndReturn: ["Node", "Intrinsic"]
};
export var nodeAndUnionTypes = ["Module", "ModuleMetadata", "ModuleNameMetadata", "FunctionNameMetadata", "LocalNameMetadata", "BinaryModule", "QuoteModule", "SectionMetadata", "ProducersSectionMetadata", "ProducerMetadata", "ProducerMetadataVersionedName", "LoopInstruction", "Instr", "IfInstruction", "StringLiteral", "NumberLiteral", "LongNumberLiteral", "FloatLiteral", "Elem", "IndexInFuncSection", "ValtypeLiteral", "TypeInstruction", "Start", "GlobalType", "LeadingComment", "BlockComment", "Data", "Global", "Table", "Memory", "FuncImportDescr", "ModuleImport", "ModuleExportDescr", "ModuleExport", "Limit", "Signature", "Program", "Identifier", "BlockInstruction", "CallInstruction", "CallIndirectInstruction", "ByteArray", "Func", "InternalBrUnless", "InternalGoto", "InternalCallExtern", "InternalEndAndReturn", "Node", "Block", "Instruction", "Expression", "NumericLiteral", "ImportDescr", "Intrinsic"];

199
node_modules/@webassemblyjs/ast/esm/signatures.js

@ -1,199 +0,0 @@
function sign(input, output) {
return [input, output];
}
var u32 = "u32";
var i32 = "i32";
var i64 = "i64";
var f32 = "f32";
var f64 = "f64";
var vector = function vector(t) {
var vecType = [t]; // $FlowIgnore
vecType.vector = true;
return vecType;
};
var controlInstructions = {
unreachable: sign([], []),
nop: sign([], []),
// block ?
// loop ?
// if ?
// if else ?
br: sign([u32], []),
br_if: sign([u32], []),
br_table: sign(vector(u32), []),
return: sign([], []),
call: sign([u32], []),
call_indirect: sign([u32], [])
};
var parametricInstructions = {
drop: sign([], []),
select: sign([], [])
};
var variableInstructions = {
get_local: sign([u32], []),
set_local: sign([u32], []),
tee_local: sign([u32], []),
get_global: sign([u32], []),
set_global: sign([u32], [])
};
var memoryInstructions = {
"i32.load": sign([u32, u32], [i32]),
"i64.load": sign([u32, u32], []),
"f32.load": sign([u32, u32], []),
"f64.load": sign([u32, u32], []),
"i32.load8_s": sign([u32, u32], [i32]),
"i32.load8_u": sign([u32, u32], [i32]),
"i32.load16_s": sign([u32, u32], [i32]),
"i32.load16_u": sign([u32, u32], [i32]),
"i64.load8_s": sign([u32, u32], [i64]),
"i64.load8_u": sign([u32, u32], [i64]),
"i64.load16_s": sign([u32, u32], [i64]),
"i64.load16_u": sign([u32, u32], [i64]),
"i64.load32_s": sign([u32, u32], [i64]),
"i64.load32_u": sign([u32, u32], [i64]),
"i32.store": sign([u32, u32], []),
"i64.store": sign([u32, u32], []),
"f32.store": sign([u32, u32], []),
"f64.store": sign([u32, u32], []),
"i32.store8": sign([u32, u32], []),
"i32.store16": sign([u32, u32], []),
"i64.store8": sign([u32, u32], []),
"i64.store16": sign([u32, u32], []),
"i64.store32": sign([u32, u32], []),
current_memory: sign([], []),
grow_memory: sign([], [])
};
var numericInstructions = {
"i32.const": sign([i32], [i32]),
"i64.const": sign([i64], [i64]),
"f32.const": sign([f32], [f32]),
"f64.const": sign([f64], [f64]),
"i32.eqz": sign([i32], [i32]),
"i32.eq": sign([i32, i32], [i32]),
"i32.ne": sign([i32, i32], [i32]),
"i32.lt_s": sign([i32, i32], [i32]),
"i32.lt_u": sign([i32, i32], [i32]),
"i32.gt_s": sign([i32, i32], [i32]),
"i32.gt_u": sign([i32, i32], [i32]),
"i32.le_s": sign([i32, i32], [i32]),
"i32.le_u": sign([i32, i32], [i32]),
"i32.ge_s": sign([i32, i32], [i32]),
"i32.ge_u": sign([i32, i32], [i32]),
"i64.eqz": sign([i64], [i64]),
"i64.eq": sign([i64, i64], [i32]),
"i64.ne": sign([i64, i64], [i32]),
"i64.lt_s": sign([i64, i64], [i32]),
"i64.lt_u": sign([i64, i64], [i32]),
"i64.gt_s": sign([i64, i64], [i32]),
"i64.gt_u": sign([i64, i64], [i32]),
"i64.le_s": sign([i64, i64], [i32]),
"i64.le_u": sign([i64, i64], [i32]),
"i64.ge_s": sign([i64, i64], [i32]),
"i64.ge_u": sign([i64, i64], [i32]),
"f32.eq": sign([f32, f32], [i32]),
"f32.ne": sign([f32, f32], [i32]),
"f32.lt": sign([f32, f32], [i32]),
"f32.gt": sign([f32, f32], [i32]),
"f32.le": sign([f32, f32], [i32]),
"f32.ge": sign([f32, f32], [i32]),
"f64.eq": sign([f64, f64], [i32]),
"f64.ne": sign([f64, f64], [i32]),
"f64.lt": sign([f64, f64], [i32]),
"f64.gt": sign([f64, f64], [i32]),
"f64.le": sign([f64, f64], [i32]),
"f64.ge": sign([f64, f64], [i32]),
"i32.clz": sign([i32], [i32]),
"i32.ctz": sign([i32], [i32]),
"i32.popcnt": sign([i32], [i32]),
"i32.add": sign([i32, i32], [i32]),
"i32.sub": sign([i32, i32], [i32]),
"i32.mul": sign([i32, i32], [i32]),
"i32.div_s": sign([i32, i32], [i32]),
"i32.div_u": sign([i32, i32], [i32]),
"i32.rem_s": sign([i32, i32], [i32]),
"i32.rem_u": sign([i32, i32], [i32]),
"i32.and": sign([i32, i32], [i32]),
"i32.or": sign([i32, i32], [i32]),
"i32.xor": sign([i32, i32], [i32]),
"i32.shl": sign([i32, i32], [i32]),
"i32.shr_s": sign([i32, i32], [i32]),
"i32.shr_u": sign([i32, i32], [i32]),
"i32.rotl": sign([i32, i32], [i32]),
"i32.rotr": sign([i32, i32], [i32]),
"i64.clz": sign([i64], [i64]),
"i64.ctz": sign([i64], [i64]),
"i64.popcnt": sign([i64], [i64]),
"i64.add": sign([i64, i64], [i64]),
"i64.sub": sign([i64, i64], [i64]),
"i64.mul": sign([i64, i64], [i64]),
"i64.div_s": sign([i64, i64], [i64]),
"i64.div_u": sign([i64, i64], [i64]),
"i64.rem_s": sign([i64, i64], [i64]),
"i64.rem_u": sign([i64, i64], [i64]),
"i64.and": sign([i64, i64], [i64]),
"i64.or": sign([i64, i64], [i64]),
"i64.xor": sign([i64, i64], [i64]),
"i64.shl": sign([i64, i64], [i64]),
"i64.shr_s": sign([i64, i64], [i64]),
"i64.shr_u": sign([i64, i64], [i64]),
"i64.rotl": sign([i64, i64], [i64]),
"i64.rotr": sign([i64, i64], [i64]),
"f32.abs": sign([f32], [f32]),
"f32.neg": sign([f32], [f32]),
"f32.ceil": sign([f32], [f32]),
"f32.floor": sign([f32], [f32]),
"f32.trunc": sign([f32], [f32]),
"f32.nearest": sign([f32], [f32]),
"f32.sqrt": sign([f32], [f32]),
"f32.add": sign([f32, f32], [f32]),
"f32.sub": sign([f32, f32], [f32]),
"f32.mul": sign([f32, f32], [f32]),
"f32.div": sign([f32, f32], [f32]),
"f32.min": sign([f32, f32], [f32]),
"f32.max": sign([f32, f32], [f32]),
"f32.copysign": sign([f32, f32], [f32]),
"f64.abs": sign([f64], [f64]),
"f64.neg": sign([f64], [f64]),
"f64.ceil": sign([f64], [f64]),
"f64.floor": sign([f64], [f64]),
"f64.trunc": sign([f64], [f64]),
"f64.nearest": sign([f64], [f64]),
"f64.sqrt": sign([f64], [f64]),
"f64.add": sign([f64, f64], [f64]),
"f64.sub": sign([f64, f64], [f64]),
"f64.mul": sign([f64, f64], [f64]),
"f64.div": sign([f64, f64], [f64]),
"f64.min": sign([f64, f64], [f64]),
"f64.max": sign([f64, f64], [f64]),
"f64.copysign": sign([f64, f64], [f64]),
"i32.wrap/i64": sign([i64], [i32]),
"i32.trunc_s/f32": sign([f32], [i32]),
"i32.trunc_u/f32": sign([f32], [i32]),
"i32.trunc_s/f64": sign([f32], [i32]),
"i32.trunc_u/f64": sign([f64], [i32]),
"i64.extend_s/i32": sign([i32], [i64]),
"i64.extend_u/i32": sign([i32], [i64]),
"i64.trunc_s/f32": sign([f32], [i64]),
"i64.trunc_u/f32": sign([f32], [i64]),
"i64.trunc_s/f64": sign([f64], [i64]),
"i64.trunc_u/f64": sign([f64], [i64]),
"f32.convert_s/i32": sign([i32], [f32]),
"f32.convert_u/i32": sign([i32], [f32]),
"f32.convert_s/i64": sign([i64], [f32]),
"f32.convert_u/i64": sign([i64], [f32]),
"f32.demote/f64": sign([f64], [f32]),
"f64.convert_s/i32": sign([i32], [f64]),
"f64.convert_u/i32": sign([i32], [f64]),
"f64.convert_s/i64": sign([i64], [f64]),
"f64.convert_u/i64": sign([i64], [f64]),
"f64.promote/f32": sign([f32], [f64]),
"i32.reinterpret/f32": sign([f32], [i32]),
"i64.reinterpret/f64": sign([f64], [i64]),
"f32.reinterpret/i32": sign([i32], [f32]),
"f64.reinterpret/i64": sign([i64], [f64])
};
export var signatures = Object.assign({}, controlInstructions, parametricInstructions, variableInstructions, memoryInstructions, numericInstructions);

76
node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js

@ -1,76 +0,0 @@
var t = require("../../index"); // func and call_indirect instructions can either define a signature inline, or
// reference a signature, e.g.
//
// ;; inline signature
// (func (result i64)
// (i64.const 2)
// )
// ;; signature reference
// (type (func (result i64)))
// (func (type 0)
// (i64.const 2))
// )
//
// this AST transform denormalises the type references, making all signatures within the module
// inline.
export function transform(ast) {
var typeInstructions = [];
t.traverse(ast, {
TypeInstruction: function TypeInstruction(_ref) {
var node = _ref.node;
typeInstructions.push(node);
}
});
if (!typeInstructions.length) {
return;
}
function denormalizeSignature(signature) {
// signature referenced by identifier
if (signature.type === "Identifier") {
var identifier = signature;
var typeInstruction = typeInstructions.find(function (t) {
return t.id.type === identifier.type && t.id.value === identifier.value;
});
if (!typeInstruction) {
throw new Error("A type instruction reference was not found ".concat(JSON.stringify(signature)));
}
return typeInstruction.functype;
} // signature referenced by index
if (signature.type === "NumberLiteral") {
var signatureRef = signature;
var _typeInstruction = typeInstructions[signatureRef.value];
return _typeInstruction.functype;
}
return signature;
}
t.traverse(ast, {
Func: function (_Func) {
function Func(_x) {
return _Func.apply(this, arguments);
}
Func.toString = function () {
return _Func.toString();
};
return Func;
}(function (_ref2) {
var node = _ref2.node;
node.signature = denormalizeSignature(node.signature);
}),
CallIndirectInstruction: function CallIndirectInstruction(_ref3) {
var node = _ref3.node;
node.signature = denormalizeSignature(node.signature);
}
});
}

216
node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js

@ -1,216 +0,0 @@
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }
import { isBlock, isFunc, isIdentifier, numberLiteralFromRaw, traverse } from "../../index";
import { moduleContextFromModuleAST } from "@webassemblyjs/helper-module-context"; // FIXME(sven): do the same with all block instructions, must be more generic here
function newUnexpectedFunction(i) {
return new Error("unknown function at offset: " + i);
}
export function transform(ast) {
var module;
traverse(ast, {
Module: function (_Module) {
function Module(_x) {
return _Module.apply(this, arguments);
}
Module.toString = function () {
return _Module.toString();
};
return Module;
}(function (path) {
module = path.node;
})
});
var moduleContext = moduleContextFromModuleAST(module); // Transform the actual instruction in function bodies
traverse(ast, {
Func: function (_Func) {
function Func(_x2) {
return _Func.apply(this, arguments);
}
Func.toString = function () {
return _Func.toString();
};
return Func;
}(function (path) {
transformFuncPath(path, moduleContext);
}),
Start: function (_Start) {
function Start(_x3) {
return _Start.apply(this, arguments);
}
Start.toString = function () {
return _Start.toString();
};
return Start;
}(function (path) {
var index = path.node.index;
if (isIdentifier(index) === true) {
var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value);
if (typeof offsetInModule === "undefined") {
throw newUnexpectedFunction(index.value);
} // Replace the index Identifier
// $FlowIgnore: reference?
path.node.index = numberLiteralFromRaw(offsetInModule);
}
})
});
}
function transformFuncPath(funcPath, moduleContext) {
var funcNode = funcPath.node;
var signature = funcNode.signature;
if (signature.type !== "Signature") {
throw new Error("Function signatures must be denormalised before execution");
}
var params = signature.params; // Add func locals in the context
params.forEach(function (p) {
return moduleContext.addLocal(p.valtype);
});
traverse(funcNode, {
Instr: function (_Instr) {
function Instr(_x4) {
return _Instr.apply(this, arguments);
}
Instr.toString = function () {
return _Instr.toString();
};
return Instr;
}(function (instrPath) {
var instrNode = instrPath.node;
/**
* Local access
*/
if (instrNode.id === "get_local" || instrNode.id === "set_local" || instrNode.id === "tee_local") {
var _instrNode$args = _slicedToArray(instrNode.args, 1),
firstArg = _instrNode$args[0];
if (firstArg.type === "Identifier") {
var offsetInParams = params.findIndex(function (_ref) {
var id = _ref.id;
return id === firstArg.value;
});
if (offsetInParams === -1) {
throw new Error("".concat(firstArg.value, " not found in ").concat(instrNode.id, ": not declared in func params"));
} // Replace the Identifer node by our new NumberLiteral node
instrNode.args[0] = numberLiteralFromRaw(offsetInParams);
}
}
/**
* Global access
*/
if (instrNode.id === "get_global" || instrNode.id === "set_global") {
var _instrNode$args2 = _slicedToArray(instrNode.args, 1),
_firstArg = _instrNode$args2[0];
if (isIdentifier(_firstArg) === true) {
var globalOffset = moduleContext.getGlobalOffsetByIdentifier( // $FlowIgnore: reference?
_firstArg.value);
if (typeof globalOffset === "undefined") {
// $FlowIgnore: reference?
throw new Error("global ".concat(_firstArg.value, " not found in module"));
} // Replace the Identifer node by our new NumberLiteral node
instrNode.args[0] = numberLiteralFromRaw(globalOffset);
}
}
/**
* Labels lookup
*/
if (instrNode.id === "br") {
var _instrNode$args3 = _slicedToArray(instrNode.args, 1),
_firstArg2 = _instrNode$args3[0];
if (isIdentifier(_firstArg2) === true) {
// if the labels is not found it is going to be replaced with -1
// which is invalid.
var relativeBlockCount = -1; // $FlowIgnore: reference?
instrPath.findParent(function (_ref2) {
var node = _ref2.node;
if (isBlock(node)) {
relativeBlockCount++; // $FlowIgnore: reference?
var name = node.label || node.name;
if (_typeof(name) === "object") {
// $FlowIgnore: isIdentifier ensures that
if (name.value === _firstArg2.value) {
// Found it
return false;
}
}
}
if (isFunc(node)) {
return false;
}
}); // Replace the Identifer node by our new NumberLiteral node
instrNode.args[0] = numberLiteralFromRaw(relativeBlockCount);
}
}
}),
/**
* Func lookup
*/
CallInstruction: function (_CallInstruction) {
function CallInstruction(_x5) {
return _CallInstruction.apply(this, arguments);
}
CallInstruction.toString = function () {
return _CallInstruction.toString();
};
return CallInstruction;
}(function (_ref3) {
var node = _ref3.node;
var index = node.index;
if (isIdentifier(index) === true) {
var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value);
if (typeof offsetInModule === "undefined") {
throw newUnexpectedFunction(index.value);
} // Replace the index Identifier
// $FlowIgnore: reference?
node.index = numberLiteralFromRaw(offsetInModule);
}
})
});
}

96
node_modules/@webassemblyjs/ast/esm/traverse.js

@ -1,96 +0,0 @@
import { createPath } from "./node-path";
import { unionTypesMap, nodeAndUnionTypes } from "./nodes"; // recursively walks the AST starting at the given node. The callback is invoked for
// and object that has a 'type' property.
function walk(context, callback) {
var stop = false;
function innerWalk(context, callback) {
if (stop) {
return;
}
var node = context.node;
if (node === undefined) {
console.warn("traversing with an empty context");
return;
}
if (node._deleted === true) {
return;
}
var path = createPath(context);
callback(node.type, path);
if (path.shouldStop) {
stop = true;
return;
}
Object.keys(node).forEach(function (prop) {
var value = node[prop];
if (value === null || value === undefined) {
return;
}
var valueAsArray = Array.isArray(value) ? value : [value];
valueAsArray.forEach(function (childNode) {
if (typeof childNode.type === "string") {
var childContext = {
node: childNode,
parentKey: prop,
parentPath: path,
shouldStop: false,
inList: Array.isArray(value)
};
innerWalk(childContext, callback);
}
});
});
}
innerWalk(context, callback);
}
var noop = function noop() {};
export function traverse(node, visitors) {
var before = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
var after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop;
Object.keys(visitors).forEach(function (visitor) {
if (!nodeAndUnionTypes.includes(visitor)) {
throw new Error("Unexpected visitor ".concat(visitor));
}
});
var context = {
node: node,
inList: false,
shouldStop: false,
parentPath: null,
parentKey: null
};
walk(context, function (type, path) {
if (typeof visitors[type] === "function") {
before(type, path);
visitors[type](path);
after(type, path);
}
var unionTypes = unionTypesMap[type];
if (!unionTypes) {
throw new Error("Unexpected node type ".concat(type));
}
unionTypes.forEach(function (unionType) {
if (typeof visitors[unionType] === "function") {
before(unionType, path);
visitors[unionType](path);
after(unionType, path);
}
});
});
}

0
node_modules/@webassemblyjs/ast/esm/types/basic.js

0
node_modules/@webassemblyjs/ast/esm/types/nodes.js

0
node_modules/@webassemblyjs/ast/esm/types/traverse.js

265
node_modules/@webassemblyjs/ast/esm/utils.js

@ -1,265 +0,0 @@
function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
import { signatures } from "./signatures";
import { traverse } from "./traverse";
import constants from "@webassemblyjs/helper-wasm-bytecode";
import { getSectionForNode } from "@webassemblyjs/helper-wasm-bytecode";
export function isAnonymous(ident) {
return ident.raw === "";
}
export function getSectionMetadata(ast, name) {
var section;
traverse(ast, {
SectionMetadata: function (_SectionMetadata) {
function SectionMetadata(_x) {
return _SectionMetadata.apply(this, arguments);
}
SectionMetadata.toString = function () {
return _SectionMetadata.toString();
};
return SectionMetadata;
}(function (_ref) {
var node = _ref.node;
if (node.section === name) {
section = node;
}
})
});
return section;
}
export function getSectionMetadatas(ast, name) {
var sections = [];
traverse(ast, {
SectionMetadata: function (_SectionMetadata2) {
function SectionMetadata(_x2) {
return _SectionMetadata2.apply(this, arguments);
}
SectionMetadata.toString = function () {
return _SectionMetadata2.toString();
};
return SectionMetadata;
}(function (_ref2) {
var node = _ref2.node;
if (node.section === name) {
sections.push(node);
}
})
});
return sections;
}
export function sortSectionMetadata(m) {
if (m.metadata == null) {
console.warn("sortSectionMetadata: no metadata to sort");
return;
} // $FlowIgnore
m.metadata.sections.sort(function (a, b) {
var aId = constants.sections[a.section];
var bId = constants.sections[b.section];
if (typeof aId !== "number" || typeof bId !== "number") {
throw new Error("Section id not found");
}
return aId - bId;
});
}
export function orderedInsertNode(m, n) {
assertHasLoc(n);
var didInsert = false;
if (n.type === "ModuleExport") {
m.fields.push(n);
return;
}
m.fields = m.fields.reduce(function (acc, field) {
var fieldEndCol = Infinity;
if (field.loc != null) {
// $FlowIgnore
fieldEndCol = field.loc.end.column;
} // $FlowIgnore: assertHasLoc ensures that
if (didInsert === false && n.loc.start.column < fieldEndCol) {
didInsert = true;
acc.push(n);
}
acc.push(field);
return acc;
}, []); // Handles empty modules or n is the last element
if (didInsert === false) {
m.fields.push(n);
}
}
export function assertHasLoc(n) {
if (n.loc == null || n.loc.start == null || n.loc.end == null) {
throw new Error("Internal failure: node (".concat(JSON.stringify(n.type), ") has no location information"));
}
}
export function getEndOfSection(s) {
assertHasLoc(s.size);
return s.startOffset + s.size.value + ( // $FlowIgnore
s.size.loc.end.column - s.size.loc.start.column);
}
export function shiftLoc(node, delta) {
// $FlowIgnore
node.loc.start.column += delta; // $FlowIgnore
node.loc.end.column += delta;
}
export function shiftSection(ast, node, delta) {
if (node.type !== "SectionMetadata") {
throw new Error("Can not shift node " + JSON.stringify(node.type));
}
node.startOffset += delta;
if (_typeof(node.size.loc) === "object") {
shiftLoc(node.size, delta);
} // Custom sections doesn't have vectorOfSize
if (_typeof(node.vectorOfSize) === "object" && _typeof(node.vectorOfSize.loc) === "object") {
shiftLoc(node.vectorOfSize, delta);
}
var sectionName = node.section; // shift node locations within that section
traverse(ast, {
Node: function Node(_ref3) {
var node = _ref3.node;
var section = getSectionForNode(node);
if (section === sectionName && _typeof(node.loc) === "object") {
shiftLoc(node, delta);
}
}
});
}
export function signatureForOpcode(object, name) {
var opcodeName = name;
if (object !== undefined && object !== "") {
opcodeName = object + "." + name;
}
var sign = signatures[opcodeName];
if (sign == undefined) {
// TODO: Uncomment this when br_table and others has been done
//throw new Error("Invalid opcode: "+opcodeName);
return [object, object];
}
return sign[0];
}
export function getUniqueNameGenerator() {
var inc = {};
return function () {
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
if (!(prefix in inc)) {
inc[prefix] = 0;
} else {
inc[prefix] = inc[prefix] + 1;
}
return prefix + "_" + inc[prefix];
};
}
export function getStartByteOffset(n) {
// $FlowIgnore
if (typeof n.loc === "undefined" || typeof n.loc.start === "undefined") {
throw new Error( // $FlowIgnore
"Can not get byte offset without loc informations, node: " + String(n.id));
}
return n.loc.start.column;
}
export function getEndByteOffset(n) {
// $FlowIgnore
if (typeof n.loc === "undefined" || typeof n.loc.end === "undefined") {
throw new Error("Can not get byte offset without loc informations, node: " + n.type);
}
return n.loc.end.column;
}
export function getFunctionBeginingByteOffset(n) {
if (!(n.body.length > 0)) {
throw new Error('n.body.length > 0' + " error: " + (undefined || "unknown"));
}
var _n$body = _slicedToArray(n.body, 1),
firstInstruction = _n$body[0];
return getStartByteOffset(firstInstruction);
}
export function getEndBlockByteOffset(n) {
// $FlowIgnore
if (!(n.instr.length > 0 || n.body.length > 0)) {
throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown"));
}
var lastInstruction;
if (n.instr) {
// $FlowIgnore
lastInstruction = n.instr[n.instr.length - 1];
}
if (n.body) {
// $FlowIgnore
lastInstruction = n.body[n.body.length - 1];
}
if (!(_typeof(lastInstruction) === "object")) {
throw new Error('typeof lastInstruction === "object"' + " error: " + (undefined || "unknown"));
}
// $FlowIgnore
return getStartByteOffset(lastInstruction);
}
export function getStartBlockByteOffset(n) {
// $FlowIgnore
if (!(n.instr.length > 0 || n.body.length > 0)) {
throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown"));
}
var fistInstruction;
if (n.instr) {
// $FlowIgnore
var _n$instr = _slicedToArray(n.instr, 1);
fistInstruction = _n$instr[0];
}
if (n.body) {
// $FlowIgnore
var _n$body2 = _slicedToArray(n.body, 1);
fistInstruction = _n$body2[0];
}
if (!(_typeof(fistInstruction) === "object")) {
throw new Error('typeof fistInstruction === "object"' + " error: " + (undefined || "unknown"));
}
// $FlowIgnore
return getStartByteOffset(fistInstruction);
}

17
node_modules/@webassemblyjs/ast/lib/clone.js

@ -1,17 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cloneNode = cloneNode;
function cloneNode(n) {
// $FlowIgnore
var newObj = {};
for (var k in n) {
newObj[k] = n[k];
}
return newObj;
}

663
node_modules/@webassemblyjs/ast/lib/definitions.js

@ -1,663 +0,0 @@
var definitions = {};
function defineType(typeName, metadata) {
definitions[typeName] = metadata;
}
defineType("Module", {
spec: {
wasm: "https://webassembly.github.io/spec/core/binary/modules.html#binary-module",
wat: "https://webassembly.github.io/spec/core/text/modules.html#text-module"
},
doc: "A module consists of a sequence of sections (termed fields in the text format).",
unionType: ["Node"],
fields: {
id: {
maybe: true,
type: "string"
},
fields: {
array: true,
type: "Node"
},
metadata: {
optional: true,
type: "ModuleMetadata"
}
}
});
defineType("ModuleMetadata", {
unionType: ["Node"],
fields: {
sections: {
array: true,
type: "SectionMetadata"
},
functionNames: {
optional: true,
array: true,
type: "FunctionNameMetadata"
},
localNames: {
optional: true,
array: true,
type: "ModuleMetadata"
},
producers: {
optional: true,
array: true,
type: "ProducersSectionMetadata"
}
}
});
defineType("ModuleNameMetadata", {
unionType: ["Node"],
fields: {
value: {
type: "string"
}
}
});
defineType("FunctionNameMetadata", {
unionType: ["Node"],
fields: {
value: {
type: "string"
},
index: {
type: "number"
}
}
});
defineType("LocalNameMetadata", {
unionType: ["Node"],
fields: {
value: {
type: "string"
},
localIndex: {
type: "number"
},
functionIndex: {
type: "number"
}
}
});
defineType("BinaryModule", {
unionType: ["Node"],
fields: {
id: {
maybe: true,
type: "string"
},
blob: {
array: true,
type: "string"
}
}
});
defineType("QuoteModule", {
unionType: ["Node"],
fields: {
id: {
maybe: true,
type: "string"
},
string: {
array: true,
type: "string"
}
}
});
defineType("SectionMetadata", {
unionType: ["Node"],
fields: {
section: {
type: "SectionName"
},
startOffset: {
type: "number"
},
size: {
type: "NumberLiteral"
},
vectorOfSize: {
comment: "Size of the vector in the section (if any)",
type: "NumberLiteral"
}
}
});
defineType("ProducersSectionMetadata", {
unionType: ["Node"],
fields: {
producers: {
array: true,
type: "ProducerMetadata"
}
}
});
defineType("ProducerMetadata", {
unionType: ["Node"],
fields: {
language: {
type: "ProducerMetadataVersionedName",
array: true
},
processedBy: {
type: "ProducerMetadataVersionedName",
array: true
},
sdk: {
type: "ProducerMetadataVersionedName",
array: true
}
}
});
defineType("ProducerMetadataVersionedName", {
unionType: ["Node"],
fields: {
name: {
type: "string"
},
version: {
type: "string"
}
}
});
/*
Instructions
*/
defineType("LoopInstruction", {
unionType: ["Node", "Block", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "loop"
},
label: {
maybe: true,
type: "Identifier"
},
resulttype: {
maybe: true,
type: "Valtype"
},
instr: {
array: true,
type: "Instruction"
}
}
});
defineType("Instr", {
unionType: ["Node", "Expression", "Instruction"],
fields: {
id: {
type: "string"
},
object: {
optional: true,
type: "Valtype"
},
args: {
array: true,
type: "Expression"
},
namedArgs: {
optional: true,
type: "Object"
}
}
});
defineType("IfInstruction", {
unionType: ["Node", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "if"
},
testLabel: {
comment: "only for WAST",
type: "Identifier"
},
test: {
array: true,
type: "Instruction"
},
result: {
maybe: true,
type: "Valtype"
},
consequent: {
array: true,
type: "Instruction"
},
alternate: {
array: true,
type: "Instruction"
}
}
});
/*
Concrete value types
*/
defineType("StringLiteral", {
unionType: ["Node", "Expression"],
fields: {
value: {
type: "string"
}
}
});
defineType("NumberLiteral", {
unionType: ["Node", "NumericLiteral", "Expression"],
fields: {
value: {
type: "number"
},
raw: {
type: "string"
}
}
});
defineType("LongNumberLiteral", {
unionType: ["Node", "NumericLiteral", "Expression"],
fields: {
value: {
type: "LongNumber"
},
raw: {
type: "string"
}
}
});
defineType("FloatLiteral", {
unionType: ["Node", "NumericLiteral", "Expression"],
fields: {
value: {
type: "number"
},
nan: {
optional: true,
type: "boolean"
},
inf: {
optional: true,
type: "boolean"
},
raw: {
type: "string"
}
}
});
defineType("Elem", {
unionType: ["Node"],
fields: {
table: {
type: "Index"
},
offset: {
array: true,
type: "Instruction"
},
funcs: {
array: true,
type: "Index"
}
}
});
defineType("IndexInFuncSection", {
unionType: ["Node"],
fields: {
index: {
type: "Index"
}
}
});
defineType("ValtypeLiteral", {
unionType: ["Node", "Expression"],
fields: {
name: {
type: "Valtype"
}
}
});
defineType("TypeInstruction", {
unionType: ["Node", "Instruction"],
fields: {
id: {
maybe: true,
type: "Index"
},
functype: {
type: "Signature"
}
}
});
defineType("Start", {
unionType: ["Node"],
fields: {
index: {
type: "Index"
}
}
});
defineType("GlobalType", {
unionType: ["Node", "ImportDescr"],
fields: {
valtype: {
type: "Valtype"
},
mutability: {
type: "Mutability"
}
}
});
defineType("LeadingComment", {
unionType: ["Node"],
fields: {
value: {
type: "string"
}
}
});
defineType("BlockComment", {
unionType: ["Node"],
fields: {
value: {
type: "string"
}
}
});
defineType("Data", {
unionType: ["Node"],
fields: {
memoryIndex: {
type: "Memidx"
},
offset: {
type: "Instruction"
},
init: {
type: "ByteArray"
}
}
});
defineType("Global", {
unionType: ["Node"],
fields: {
globalType: {
type: "GlobalType"
},
init: {
array: true,
type: "Instruction"
},
name: {
maybe: true,
type: "Identifier"
}
}
});
defineType("Table", {
unionType: ["Node", "ImportDescr"],
fields: {
elementType: {
type: "TableElementType"
},
limits: {
assertNodeType: true,
type: "Limit"
},
name: {
maybe: true,
type: "Identifier"
},
elements: {
array: true,
optional: true,
type: "Index"
}
}
});
defineType("Memory", {
unionType: ["Node", "ImportDescr"],
fields: {
limits: {
type: "Limit"
},
id: {
maybe: true,
type: "Index"
}
}
});
defineType("FuncImportDescr", {
unionType: ["Node", "ImportDescr"],
fields: {
id: {
type: "Identifier"
},
signature: {
type: "Signature"
}
}
});
defineType("ModuleImport", {
unionType: ["Node"],
fields: {
module: {
type: "string"
},
name: {
type: "string"
},
descr: {
type: "ImportDescr"
}
}
});
defineType("ModuleExportDescr", {
unionType: ["Node"],
fields: {
exportType: {
type: "ExportDescrType"
},
id: {
type: "Index"
}
}
});
defineType("ModuleExport", {
unionType: ["Node"],
fields: {
name: {
type: "string"
},
descr: {
type: "ModuleExportDescr"
}
}
});
defineType("Limit", {
unionType: ["Node"],
fields: {
min: {
type: "number"
},
max: {
optional: true,
type: "number"
}
}
});
defineType("Signature", {
unionType: ["Node"],
fields: {
params: {
array: true,
type: "FuncParam"
},
results: {
array: true,
type: "Valtype"
}
}
});
defineType("Program", {
unionType: ["Node"],
fields: {
body: {
array: true,
type: "Node"
}
}
});
defineType("Identifier", {
unionType: ["Node", "Expression"],
fields: {
value: {
type: "string"
},
raw: {
optional: true,
type: "string"
}
}
});
defineType("BlockInstruction", {
unionType: ["Node", "Block", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "block"
},
label: {
maybe: true,
type: "Identifier"
},
instr: {
array: true,
type: "Instruction"
},
result: {
maybe: true,
type: "Valtype"
}
}
});
defineType("CallInstruction", {
unionType: ["Node", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "call"
},
index: {
type: "Index"
},
instrArgs: {
array: true,
optional: true,
type: "Expression"
},
numeric: {
type: "Index",
optional: true
}
}
});
defineType("CallIndirectInstruction", {
unionType: ["Node", "Instruction"],
fields: {
id: {
constant: true,
type: "string",
value: "call_indirect"
},
signature: {
type: "SignatureOrTypeRef"
},
intrs: {
array: true,
optional: true,
type: "Expression"
}
}
});
defineType("ByteArray", {
unionType: ["Node"],
fields: {
values: {
array: true,
type: "Byte"
}
}
});
defineType("Func", {
unionType: ["Node", "Block"],
fields: {
name: {
maybe: true,
type: "Index"
},
signature: {
type: "SignatureOrTypeRef"
},
body: {
array: true,
type: "Instruction"
},
isExternal: {
comment: "means that it has been imported from the outside js",
optional: true,
type: "boolean"
},
metadata: {
optional: true,
type: "FuncMetadata"
}
}
});
/**
* Intrinsics
*/
defineType("InternalBrUnless", {
unionType: ["Node", "Intrinsic"],
fields: {
target: {
type: "number"
}
}
});
defineType("InternalGoto", {
unionType: ["Node", "Intrinsic"],
fields: {
target: {
type: "number"
}
}
});
defineType("InternalCallExtern", {
unionType: ["Node", "Intrinsic"],
fields: {
target: {
type: "number"
}
}
}); // function bodies are terminated by an `end` instruction but are missing a
// return instruction
//
// Since we can't inject a new instruction we are injecting a new instruction.
defineType("InternalEndAndReturn", {
unionType: ["Node", "Intrinsic"],
fields: {}
});
module.exports = definitions;

118
node_modules/@webassemblyjs/ast/lib/index.js

@ -1,118 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
numberLiteralFromRaw: true,
withLoc: true,
withRaw: true,
funcParam: true,
indexLiteral: true,
memIndexLiteral: true,
instruction: true,
objectInstruction: true,
traverse: true,
signatures: true,
cloneNode: true
};
Object.defineProperty(exports, "numberLiteralFromRaw", {
enumerable: true,
get: function get() {
return _nodeHelpers.numberLiteralFromRaw;
}
});
Object.defineProperty(exports, "withLoc", {
enumerable: true,
get: function get() {
return _nodeHelpers.withLoc;
}
});
Object.defineProperty(exports, "withRaw", {
enumerable: true,
get: function get() {
return _nodeHelpers.withRaw;
}
});
Object.defineProperty(exports, "funcParam", {
enumerable: true,
get: function get() {
return _nodeHelpers.funcParam;
}
});
Object.defineProperty(exports, "indexLiteral", {
enumerable: true,
get: function get() {
return _nodeHelpers.indexLiteral;
}
});
Object.defineProperty(exports, "memIndexLiteral", {
enumerable: true,
get: function get() {
return _nodeHelpers.memIndexLiteral;
}
});
Object.defineProperty(exports, "instruction", {
enumerable: true,
get: function get() {
return _nodeHelpers.instruction;
}
});
Object.defineProperty(exports, "objectInstruction", {
enumerable: true,
get: function get() {
return _nodeHelpers.objectInstruction;
}
});
Object.defineProperty(exports, "traverse", {
enumerable: true,
get: function get() {
return _traverse.traverse;
}
});
Object.defineProperty(exports, "signatures", {
enumerable: true,
get: function get() {
return _signatures.signatures;
}
});
Object.defineProperty(exports, "cloneNode", {
enumerable: true,
get: function get() {
return _clone.cloneNode;
}
});
var _nodes = require("./nodes");
Object.keys(_nodes).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _nodes[key];
}
});
});
var _nodeHelpers = require("./node-helpers.js");
var _traverse = require("./traverse");
var _signatures = require("./signatures");
var _utils = require("./utils");
Object.keys(_utils).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _utils[key];
}
});
});
var _clone = require("./clone");

107
node_modules/@webassemblyjs/ast/lib/node-helpers.js

@ -1,107 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.numberLiteralFromRaw = numberLiteralFromRaw;
exports.instruction = instruction;
exports.objectInstruction = objectInstruction;
exports.withLoc = withLoc;
exports.withRaw = withRaw;
exports.funcParam = funcParam;
exports.indexLiteral = indexLiteral;
exports.memIndexLiteral = memIndexLiteral;
var _wastParser = require("@webassemblyjs/wast-parser");
var _nodes = require("./nodes");
function numberLiteralFromRaw(rawValue) {
var instructionType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "i32";
var original = rawValue; // Remove numeric separators _
if (typeof rawValue === "string") {
rawValue = rawValue.replace(/_/g, "");
}
if (typeof rawValue === "number") {
return (0, _nodes.numberLiteral)(rawValue, String(original));
} else {
switch (instructionType) {
case "i32":
{
return (0, _nodes.numberLiteral)((0, _wastParser.parse32I)(rawValue), String(original));
}
case "u32":
{
return (0, _nodes.numberLiteral)((0, _wastParser.parseU32)(rawValue), String(original));
}
case "i64":
{
return (0, _nodes.longNumberLiteral)((0, _wastParser.parse64I)(rawValue), String(original));
}
case "f32":
{
return (0, _nodes.floatLiteral)((0, _wastParser.parse32F)(rawValue), (0, _wastParser.isNanLiteral)(rawValue), (0, _wastParser.isInfLiteral)(rawValue), String(original));
}
// f64
default:
{
return (0, _nodes.floatLiteral)((0, _wastParser.parse64F)(rawValue), (0, _wastParser.isNanLiteral)(rawValue), (0, _wastParser.isInfLiteral)(rawValue), String(original));
}
}
}
}
function instruction(id) {
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var namedArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return (0, _nodes.instr)(id, undefined, args, namedArgs);
}
function objectInstruction(id, object) {
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
var namedArgs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
return (0, _nodes.instr)(id, object, args, namedArgs);
}
/**
* Decorators
*/
function withLoc(n, end, start) {
var loc = {
start: start,
end: end
};
n.loc = loc;
return n;
}
function withRaw(n, raw) {
n.raw = raw;
return n;
}
function funcParam(valtype, id) {
return {
id: id,
valtype: valtype
};
}
function indexLiteral(value) {
// $FlowIgnore
var x = numberLiteralFromRaw(value, "u32");
return x;
}
function memIndexLiteral(value) {
// $FlowIgnore
var x = numberLiteralFromRaw(value, "u32");
return x;
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save