@nathapp/na-cli 1.0.1-rc.6 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -20
- package/dist/index.js +36 -2
- package/dist/index.js.map +1 -1
- package/dist/templates/k8s-cert-manager/README.md +60 -0
- package/dist/templates/k8s-cert-manager/cloudflare-cert-manager-issuer.yaml +26 -0
- package/dist/templates/k8s-deployment/templates/_deployment.tpl +1 -1
- package/dist/templates/k8s-deployment/templates/_endpointslice.tpl +42 -0
- package/dist/templates/k8s-deployment/templates/_gateway.tpl +94 -0
- package/dist/templates/k8s-deployment/templates/_grpcroute.tpl +186 -0
- package/dist/templates/k8s-deployment/templates/_httproute.tpl +209 -0
- package/dist/templates/k8s-deployment/templates/_ingressroute.tpl +178 -0
- package/dist/templates/k8s-deployment/templates/_middleware.tpl +553 -0
- package/dist/templates/k8s-deployment/templates/_serverstransport.tpl +73 -0
- package/dist/templates/k8s-deployment/templates/_service.tpl +4 -1
- package/dist/templates/k8s-helm-chart/templates/endpointslice.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/gateway.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/grpcroute.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/httproute.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/ingressroute.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/middleware.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/serverstransport.yaml +1 -0
- package/dist/templates/k8s-helm-chart/values.yaml +3 -5
- package/dist/templates/nestjs-api/{.env → .env.local} +5 -0
- package/dist/templates/nestjs-api/.gitignore-rename +2 -1
- package/dist/templates/nestjs-api/Dockerfile +33 -13
- package/dist/templates/nestjs-api/package.json +49 -39
- package/dist/templates/nestjs-api/src/i18n/en_US/date.json +7 -0
- package/dist/templates/nestjs-api/src/i18n/en_US/validation.json +16 -0
- package/dist/templates/nestjs-api/src/i18n/zh_CN/date.json +7 -0
- package/dist/templates/nestjs-api/src/i18n/zh_CN/validation.json +16 -0
- package/dist/templates/nestjs-api/src/i18n/zh_TW/date.json +7 -0
- package/dist/templates/nestjs-api/src/i18n/zh_TW/validation.json +16 -0
- package/dist/templates/nestjs-api/test/jest-test.json +26 -0
- package/dist/templates/nestjs-library/.npmignore-rename +4 -0
- package/dist/templates/nestjs-library/package.json +8 -8
- package/dist/templates/ts-library/.npmignore-rename +4 -0
- package/dist/templates/turbo-nestjs-vuexy/README.md +3 -0
- package/dist/templates/turbo-nestjs-vuexy/package.json +49 -0
- package/dist/templates/turbo-nestjs-vuexy/packages/eslint-config/README.md +3 -0
- package/dist/templates/turbo-nestjs-vuexy/packages/eslint-config/library.js +43 -0
- package/dist/templates/turbo-nestjs-vuexy/packages/eslint-config/package.json +18 -0
- package/dist/templates/turbo-nestjs-vuexy/packages/eslint-config/vue.js +236 -0
- package/dist/templates/{ts-library/tsconfig.json → turbo-nestjs-vuexy/packages/typescript-config/base.json} +4 -6
- package/dist/templates/turbo-nestjs-vuexy/packages/typescript-config/nestjs.json +12 -0
- package/dist/templates/turbo-nestjs-vuexy/packages/typescript-config/package.json +9 -0
- package/dist/templates/turbo-nestjs-vuexy/packages/typescript-config/vue.json +82 -0
- package/dist/templates/turbo-nestjs-vuexy/turbo.json +24 -0
- package/dist/templates/vuexy-portal/.editorconfig +1 -0
- package/dist/templates/vuexy-portal/.eslintrc.cjs +237 -0
- package/dist/templates/vuexy-portal/.gitignore-rename +42 -0
- package/dist/templates/vuexy-portal/.stylelintrc.json +46 -0
- package/dist/templates/vuexy-portal/Dockerfile +43 -0
- package/dist/templates/vuexy-portal/README.md +35 -0
- package/dist/templates/vuexy-portal/auto-imports.d.ts +1131 -0
- package/dist/templates/vuexy-portal/components.d.ts +68 -0
- package/dist/templates/vuexy-portal/dev.Dockerfile +25 -0
- package/dist/templates/vuexy-portal/docker-compose.dev.yml +14 -0
- package/dist/templates/vuexy-portal/docker-compose.prod.yml +13 -0
- package/dist/templates/vuexy-portal/entrypoint.sh +6 -0
- package/dist/templates/vuexy-portal/env.d.ts +12 -0
- package/dist/templates/vuexy-portal/index.html +57 -0
- package/dist/templates/vuexy-portal/nginx.conf +14 -0
- package/dist/templates/vuexy-portal/package.json +140 -0
- package/dist/templates/vuexy-portal/pnpm-lock.yaml +7963 -0
- package/dist/templates/vuexy-portal/prod.Dockerfile +41 -0
- package/dist/templates/vuexy-portal/public/favicon.ico +0 -0
- package/dist/templates/vuexy-portal/public/images/avatars/avatar-1.png +0 -0
- package/dist/templates/vuexy-portal/public/images/avatars/avatar-2.png +0 -0
- package/dist/templates/vuexy-portal/public/images/svg/discord.svg +10 -0
- package/dist/templates/vuexy-portal/public/images/svg/gift.svg +8 -0
- package/dist/templates/vuexy-portal/public/images/svg/keyboard.svg +8 -0
- package/dist/templates/vuexy-portal/public/images/svg/laptop.svg +8 -0
- package/dist/templates/vuexy-portal/public/images/svg/lightbulb.svg +8 -0
- package/dist/templates/vuexy-portal/public/images/svg/rocket.svg +8 -0
- package/dist/templates/vuexy-portal/public/loader.css +79 -0
- package/dist/templates/vuexy-portal/public/mockServiceWorker.js +287 -0
- package/dist/templates/vuexy-portal/shims.d.ts +15 -0
- package/dist/templates/vuexy-portal/src/@core/components/AppBarSearch.vue +278 -0
- package/dist/templates/vuexy-portal/src/@core/components/AppDrawerHeaderSection.vue +30 -0
- package/dist/templates/vuexy-portal/src/@core/components/AppStepper.vue +371 -0
- package/dist/templates/vuexy-portal/src/@core/components/BuyNow.vue +92 -0
- package/dist/templates/vuexy-portal/src/@core/components/CardStatisticsVerticalSimple.vue +35 -0
- package/dist/templates/vuexy-portal/src/@core/components/CustomizerSection.vue +27 -0
- package/dist/templates/vuexy-portal/src/@core/components/DialogCloseBtn.vue +25 -0
- package/dist/templates/vuexy-portal/src/@core/components/DropZone.vue +135 -0
- package/dist/templates/vuexy-portal/src/@core/components/I18n.vue +48 -0
- package/dist/templates/vuexy-portal/src/@core/components/MoreBtn.vue +24 -0
- package/dist/templates/vuexy-portal/src/@core/components/Notifications.vue +245 -0
- package/dist/templates/vuexy-portal/src/@core/components/ProductDescriptionEditor.vue +198 -0
- package/dist/templates/vuexy-portal/src/@core/components/ScrollToTop.vue +41 -0
- package/dist/templates/vuexy-portal/src/@core/components/Shortcuts.vue +99 -0
- package/dist/templates/vuexy-portal/src/@core/components/TablePagination.vue +39 -0
- package/dist/templates/vuexy-portal/src/@core/components/TheCustomizer.vue +618 -0
- package/dist/templates/vuexy-portal/src/@core/components/ThemeSwitcher.vue +61 -0
- package/dist/templates/vuexy-portal/src/@core/components/TiptapEditor.vue +166 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/AppAutocomplete.vue +57 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/AppCombobox.vue +57 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/AppDateTimePicker.vue +543 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/AppSelect.vue +50 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/AppTextField.vue +78 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/AppTextarea.vue +50 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/CustomCheckboxes.vue +81 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/CustomCheckboxesWithIcon.vue +95 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/CustomCheckboxesWithImage.vue +93 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/CustomRadios.vue +81 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/CustomRadiosWithIcon.vue +88 -0
- package/dist/templates/vuexy-portal/src/@core/components/app-form-elements/CustomRadiosWithImage.vue +99 -0
- package/dist/templates/vuexy-portal/src/@core/components/cards/AppCardActions.vue +167 -0
- package/dist/templates/vuexy-portal/src/@core/components/cards/AppCardCode.vue +152 -0
- package/dist/templates/vuexy-portal/src/@core/components/cards/CardStatisticsHorizontal.vue +41 -0
- package/dist/templates/vuexy-portal/src/@core/components/cards/CardStatisticsVertical.vue +48 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_components.scss +185 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_dark.scss +16 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_default-layout-w-horizontal-nav.scss +45 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_default-layout-w-vertical-nav.scss +103 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_default-layout.scss +16 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_horizontal-nav.scss +194 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_index.scss +48 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_layouts.scss +63 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_misc.scss +20 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_mixins.scss +63 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_route-transitions.scss +70 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_utilities.scss +181 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_utils.scss +90 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_variables.scss +198 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/_vertical-nav.scss +255 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/libs/_perfect-scrollbar.scss +35 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/libs/vuetify/_index.scss +1 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/libs/vuetify/_overrides.scss +264 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/libs/vuetify/_variables.scss +62 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/placeholders/_default-layout-horizontal-nav.scss +27 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/placeholders/_default-layout-vertical-nav.scss +45 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/placeholders/_default-layout.scss +3 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/placeholders/_horizontal-nav.scss +98 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/placeholders/_index.scss +7 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/placeholders/_misc.scss +7 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/placeholders/_nav.scss +33 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/placeholders/_vertical-nav.scss +80 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/skins/_bordered.scss +72 -0
- package/dist/templates/vuexy-portal/src/@core/scss/base/skins/_index.scss +1 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/_default-layout-w-horizontal-nav.scss +9 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/_default-layout-w-vertical-nav.scss +20 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/_horizontal-nav.scss +40 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/_mixins.scss +6 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/_utilities.scss +49 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/_variables.scss +102 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/_vertical-nav.scss +47 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/index.scss +17 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/apex-chart.scss +108 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/full-calendar.scss +351 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/shepherd.scss +94 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/swiper.scss +5 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/_variables.scss +351 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_alert.scss +114 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_avatar.scss +27 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_badge.scss +25 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_button.scss +280 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_cards.scss +3 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_checkbox.scss +57 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_chip.scss +102 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_dialog.scss +27 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_expansion-panels.scss +106 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_field.scss +308 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_list.scss +30 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_menu.scss +35 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_otp-input.scss +17 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_pagination.scss +140 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_progress.scss +13 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_radio.scss +46 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_rating.scss +20 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_slider.scss +27 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_snackbar.scss +10 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_switch.scss +58 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_table.scss +48 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_tabs.scss +91 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_textarea.scss +9 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_timeline.scss +99 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/_tooltip.scss +6 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/components/index.scss +25 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/index.scss +3 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/libs/vuetify/overrides.scss +18 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/pages/misc.scss +20 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/pages/page-auth.scss +63 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/placeholders/_default-layout-horizontal-nav.scss +7 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/placeholders/_default-layout-vertical-nav.scss +8 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/placeholders/_horizontal-nav.scss +47 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/placeholders/_index.scss +6 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/placeholders/_misc.scss +3 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/placeholders/_nav.scss +27 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/placeholders/_vertical-nav.scss +35 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/skins/_bordered.scss +82 -0
- package/dist/templates/vuexy-portal/src/@core/scss/template/skins/_index.scss +1 -0
- package/dist/templates/vuexy-portal/src/@custom/assets/images/user-profile-header.png +0 -0
- package/dist/templates/vuexy-portal/src/@custom/components/ConfirmationDialog.vue +155 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/HorizontalNav.vue +35 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/HorizontalNavGroup.vue +110 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/HorizontalNavLayout.vue +150 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/HorizontalNavLink.vue +56 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/HorizontalNavPopper.vue +175 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/TransitionExpand.vue +92 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/VNodeRenderer.tsx +17 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/VerticalNav.vue +236 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/VerticalNavGroup.vue +267 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/VerticalNavLayout.vue +232 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/VerticalNavLink.vue +68 -0
- package/dist/templates/vuexy-portal/src/@layouts/components/VerticalNavSectionTitle.vue +37 -0
- package/dist/templates/vuexy-portal/src/@layouts/styles/_classes.scss +3 -0
- package/dist/templates/vuexy-portal/src/@layouts/styles/_default-layout.scss +35 -0
- package/dist/templates/vuexy-portal/src/@layouts/styles/_global.scss +10 -0
- package/dist/templates/vuexy-portal/src/@layouts/styles/_mixins.scss +30 -0
- package/dist/templates/vuexy-portal/src/@layouts/styles/_placeholders.scss +53 -0
- package/dist/templates/vuexy-portal/src/@layouts/styles/_rtl.scss +7 -0
- package/dist/templates/vuexy-portal/src/@layouts/styles/_variables.scss +29 -0
- package/dist/templates/vuexy-portal/src/@layouts/styles/index.scss +3 -0
- package/dist/templates/vuexy-portal/src/App.vue +26 -0
- package/dist/templates/vuexy-portal/src/assets/images/avatars/avatar-1.png +0 -0
- package/dist/templates/vuexy-portal/src/assets/images/customizer-icons/border-light.svg +16 -0
- package/dist/templates/vuexy-portal/src/assets/images/customizer-icons/collapsed-light.svg +17 -0
- package/dist/templates/vuexy-portal/src/assets/images/customizer-icons/compact-light.svg +11 -0
- package/dist/templates/vuexy-portal/src/assets/images/customizer-icons/default-light.svg +17 -0
- package/dist/templates/vuexy-portal/src/assets/images/customizer-icons/horizontal-light.svg +12 -0
- package/dist/templates/vuexy-portal/src/assets/images/customizer-icons/ltr-light.svg +15 -0
- package/dist/templates/vuexy-portal/src/assets/images/customizer-icons/rtl-light.svg +15 -0
- package/dist/templates/vuexy-portal/src/assets/images/customizer-icons/wide-light.svg +11 -0
- package/dist/templates/vuexy-portal/src/assets/images/logo.svg +6 -0
- package/dist/templates/vuexy-portal/src/assets/images/misc/3d-safe-box-with-golden-dollar-coins.png +0 -0
- package/dist/templates/vuexy-portal/src/assets/images/misc/3d-space-rocket-with-smoke.png +0 -0
- package/dist/templates/vuexy-portal/src/assets/images/misc/dollar-coins-flying-pink-piggy-bank.png +0 -0
- package/dist/templates/vuexy-portal/src/assets/images/misc/fleet-car.png +0 -0
- package/dist/templates/vuexy-portal/src/assets/images/pages/misc-mask-dark.png +0 -0
- package/dist/templates/vuexy-portal/src/assets/images/pages/misc-mask-light.png +0 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/Card.svg +8 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/Check.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/Diamond.svg +12 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/Suitcase.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/Wallet.svg +10 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/address.svg +25 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/auth-v1-bottom-shape.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/auth-v1-top-shape.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/cart.svg +5 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/checkbox-checked.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/checkbox-indeterminate.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/checkbox-unchecked.svg +10 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/discord.svg +10 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/gift.svg +8 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/home.svg +5 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/keyboard.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/laptop.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/lightbulb.svg +8 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/office.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/paper-send.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/payment.svg +21 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/radio-checked.svg +3 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/radio-unchecked.svg +3 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/rocket.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/trending.svg +14 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/user-info.svg +4 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/user.svg +6 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/wizard-account.svg +6 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/wizard-address.svg +18 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/wizard-personal.svg +6 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/wizard-social-link.svg +6 -0
- package/dist/templates/vuexy-portal/src/assets/images/svg/wizard-submit.svg +6 -0
- package/dist/templates/vuexy-portal/src/assets/styles/styles.scss +1 -0
- package/dist/templates/vuexy-portal/src/assets/styles/variables/_template.scss +6 -0
- package/dist/templates/vuexy-portal/src/assets/styles/variables/_vuetify.scss +7 -0
- package/dist/templates/vuexy-portal/src/components/AppLoadingIndicator.vue +63 -0
- package/dist/templates/vuexy-portal/src/components/AppPricing.vue +247 -0
- package/dist/templates/vuexy-portal/src/components/AppSearchHeader.vue +77 -0
- package/dist/templates/vuexy-portal/src/components/ErrorHeader.vue +40 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/AddAuthenticatorAppDialog.vue +101 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/AddEditAddressDialog.vue +238 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/AddEditPermissionDialog.vue +93 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/AddEditRoleDialog.vue +302 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/AddPaymentMethodDialog.vue +120 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/CardAddEditDialog.vue +153 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/ConfirmDialog.vue +151 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/CreateAppDialog.vue +459 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/EnableOneTimePasswordDialog.vue +85 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/PaymentProvidersDialog.vue +123 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/PricingPlanDialog.vue +34 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/ReferAndEarnDialog.vue +181 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/ShareProjectDialog.vue +198 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/TwoFactorAuthDialog.vue +120 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/UserInfoEditDialog.vue +246 -0
- package/dist/templates/vuexy-portal/src/components/dialogs/UserUpgradePlanDialog.vue +101 -0
- package/dist/templates/vuexy-portal/src/layouts/blank.vue +42 -0
- package/dist/templates/vuexy-portal/src/layouts/components/DefaultLayoutWithHorizontalNav.vue +75 -0
- package/dist/templates/vuexy-portal/src/layouts/components/DefaultLayoutWithVerticalNav.vue +79 -0
- package/dist/templates/vuexy-portal/src/layouts/components/Footer.vue +17 -0
- package/dist/templates/vuexy-portal/src/layouts/components/NavSearchBar.vue +266 -0
- package/dist/templates/vuexy-portal/src/layouts/components/NavbarShortcuts.vue +45 -0
- package/dist/templates/vuexy-portal/src/layouts/components/NavbarThemeSwitcher.vue +22 -0
- package/dist/templates/vuexy-portal/src/layouts/components/UserProfile.vue +114 -0
- package/dist/templates/vuexy-portal/src/layouts/default.vue +30 -0
- package/dist/templates/vuexy-portal/src/pages/[...error].vue +46 -0
- package/dist/templates/vuexy-portal/src/pages/account-settings/[tab].vue +57 -0
- package/dist/templates/vuexy-portal/src/pages/index.vue +32 -0
- package/dist/templates/vuexy-portal/src/pages/login.vue +178 -0
- package/dist/templates/vuexy-portal/src/pages/not-authorized.vue +47 -0
- package/dist/templates/vuexy-portal/src/pages/second-page.vue +13 -0
- package/dist/templates/vuexy-portal/src/plugins/casl/shims-ability.d.ts +8 -0
- package/dist/templates/vuexy-portal/src/plugins/i18n/locales/en_US.json +88 -0
- package/dist/templates/vuexy-portal/src/plugins/i18n/locales/zh_CN.json +88 -0
- package/dist/templates/vuexy-portal/src/plugins/i18n/vue-i18n.d.ts +17 -0
- package/dist/templates/vuexy-portal/src/plugins/iconify/icons.css +21039 -0
- package/dist/templates/vuexy-portal/src/plugins/iconify/package.json +3 -0
- package/dist/templates/vuexy-portal/src/views/account-settings/AccountSettingsSecurity.vue +179 -0
- package/dist/templates/vuexy-portal/typed-router.d.ts +146 -0
- package/dist/utils/template.js +122 -47
- package/dist/utils/template.js.map +1 -1
- package/package.json +1 -1
- package/.gitlab-ci.yml +0 -143
- package/Makefile +0 -62
- package/dist/templates/db-schema/.gitlab-ci.yml +0 -139
- package/dist/templates/db-schema/Makefile +0 -885
- package/dist/templates/k8s-deployment/.gitlab-ci.yml +0 -128
- package/dist/templates/k8s-deployment/Makefile +0 -196
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/script/Makefile +0 -12
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/script/Makefile +0 -8
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/Makefile +0 -49
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Makefile +0 -9
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/script/Makefile +0 -14
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/_t-0100-readiness-liveness.ts +0 -84
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/hub.ts +0 -372
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contact.ts +0 -158
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contract.ts +0 -328
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-kyc.ts +0 -304
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-app.ts +0 -823
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-web.ts +0 -493
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-profile.ts +0 -277
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-whitelist.ts +0 -133
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/t-0200-start.ts +0 -172
- package/dist/templates/mxw-base-api-express/.dockerignore +0 -2
- package/dist/templates/mxw-base-api-express/.env +0 -10
- package/dist/templates/mxw-base-api-express/.gitignore-rename +0 -3
- package/dist/templates/mxw-base-api-express/.gitlab-ci.yml +0 -174
- package/dist/templates/mxw-base-api-express/.nvmrc +0 -1
- package/dist/templates/mxw-base-api-express/Dockerfile +0 -14
- package/dist/templates/mxw-base-api-express/Makefile +0 -84
- package/dist/templates/mxw-base-api-express/README.md +0 -71
- package/dist/templates/mxw-base-api-express/package.json +0 -55
- package/dist/templates/mxw-base-api-express/src/app-service.test.ts +0 -94
- package/dist/templates/mxw-base-api-express/src/app-service.ts +0 -498
- package/dist/templates/mxw-base-api-express/src/auth/auth-user.test.ts +0 -215
- package/dist/templates/mxw-base-api-express/src/auth/auth-user.ts +0 -86
- package/dist/templates/mxw-base-api-express/src/auth/auth.ts +0 -81
- package/dist/templates/mxw-base-api-express/src/core-service.ts +0 -72
- package/dist/templates/mxw-base-api-express/src/crud.ts +0 -84
- package/dist/templates/mxw-base-api-express/src/http-handler.ts +0 -71
- package/dist/templates/mxw-base-api-express/src/server.ts +0 -54
- package/dist/templates/mxw-base-api-express/src/test.ts +0 -38
- package/dist/templates/mxw-base-api-express/src/utils/api-utilities.ts +0 -52
- package/dist/templates/mxw-base-api-express/src/utils/file-utilities.ts +0 -55
- package/dist/templates/mxw-base-api-express/tsconfig.json +0 -32
- package/dist/templates/nestjs-api/.dockerignore +0 -6
- package/dist/templates/nestjs-api/.gitlab-ci.yml +0 -174
- package/dist/templates/nestjs-api/.nvmrc +0 -1
- package/dist/templates/nestjs-api/.prettierrc +0 -4
- package/dist/templates/nestjs-api/Makefile +0 -95
- package/dist/templates/nestjs-api/nest-cli.json +0 -11
- package/dist/templates/nestjs-api/src/app.controller.spec.ts +0 -24
- package/dist/templates/nestjs-api/src/app.controller.ts +0 -27
- package/dist/templates/nestjs-api/src/app.module.ts +0 -49
- package/dist/templates/nestjs-api/src/app.service.ts +0 -27
- package/dist/templates/nestjs-api/src/main.ts +0 -26
- package/dist/templates/nestjs-api/test/app.e2e-spec.ts +0 -47
- package/dist/templates/nestjs-api/tsconfig.build.json +0 -4
- package/dist/templates/nestjs-api/tsconfig.json +0 -24
- package/dist/templates/nestjs-library/.eslintrc.js +0 -24
- package/dist/templates/nestjs-library/.gitlab-ci.yml +0 -138
- package/dist/templates/nestjs-library/.prettierrc +0 -6
- package/dist/templates/nestjs-library/Makefile +0 -60
- package/dist/templates/nestjs-library/index.ts +0 -1
- package/dist/templates/nestjs-library/lib/index.ts +0 -2
- package/dist/templates/nestjs-library/test/app/controller/hello.controller.ts +0 -7
- package/dist/templates/nestjs-library/tsconfig.build.json +0 -7
- package/dist/templates/nestjs-library/tsconfig.json +0 -18
- package/dist/templates/ts-library/.dockerignore +0 -2
- package/dist/templates/ts-library/.eslintrc.js +0 -24
- package/dist/templates/ts-library/.gitlab-ci.yml +0 -136
- package/dist/templates/ts-library/.prettierrc +0 -6
- package/dist/templates/ts-library/Makefile +0 -58
- package/dist/templates/ts-library/index.ts +0 -1
- package/dist/templates/ts-library/lib/index.ts +0 -1
- package/dist/templates/ts-library/lib/samples/index.ts +0 -5
- package/dist/templates/ts-library/lib/samples/samples-function.ts +0 -3
- package/dist/templates/ts-library/test/sample.e2e-spec.ts +0 -10
- package/dist/templates/ts-library/tsconfig.build.json +0 -4
- package/dist/utils/help.js +0 -8
- package/dist/utils/help.js.map +0 -1
- package/tsconfig.json +0 -24
- /package/dist/templates/{nestjs-api/.eslintrc.js → turbo-nestjs-vuexy/packages/eslint-config/nest.js} +0 -0
|
@@ -1,372 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { it } from 'mocha';
|
|
5
|
-
import chai, { expect } from 'chai';
|
|
6
|
-
import chaihttp from 'chai-http';
|
|
7
|
-
import { errors, throwError } from "mxw-libs-errors";
|
|
8
|
-
import { bigNumberify, hexlify, isUndefinedOrNullOrEmpty } from 'mxw-libs-utils';
|
|
9
|
-
import { mxw, utils } from "mxw-sdk-js";
|
|
10
|
-
|
|
11
|
-
chai.use(chaihttp);
|
|
12
|
-
|
|
13
|
-
let indent = " ";
|
|
14
|
-
|
|
15
|
-
export class User {
|
|
16
|
-
code: string;
|
|
17
|
-
id?: number
|
|
18
|
-
|
|
19
|
-
username?: string
|
|
20
|
-
password?: string
|
|
21
|
-
domain?: string
|
|
22
|
-
|
|
23
|
-
wallet?: mxw.Wallet
|
|
24
|
-
loginWallet?: mxw.Wallet
|
|
25
|
-
|
|
26
|
-
jwt?: string
|
|
27
|
-
mxwJwt?: string
|
|
28
|
-
|
|
29
|
-
kyc: {
|
|
30
|
-
kycId?: number
|
|
31
|
-
idType?: number
|
|
32
|
-
flow?: string
|
|
33
|
-
ocrAlter?: boolean
|
|
34
|
-
status?: number
|
|
35
|
-
} = {};
|
|
36
|
-
|
|
37
|
-
profile?: {
|
|
38
|
-
gender?: string
|
|
39
|
-
country?: string
|
|
40
|
-
language?: string
|
|
41
|
-
religion?: string
|
|
42
|
-
dob?: number
|
|
43
|
-
address?: {
|
|
44
|
-
value: string
|
|
45
|
-
street: string
|
|
46
|
-
postcode: string
|
|
47
|
-
city: string
|
|
48
|
-
state: string
|
|
49
|
-
province: string
|
|
50
|
-
country: string
|
|
51
|
-
},
|
|
52
|
-
alias?: string
|
|
53
|
-
} = {}
|
|
54
|
-
|
|
55
|
-
constructor(code: string) {
|
|
56
|
-
this.code = code;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public get email() {
|
|
60
|
-
return this.username + "@" + this.domain;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default class HubService {
|
|
65
|
-
private static self: HubService;
|
|
66
|
-
|
|
67
|
-
public users: {
|
|
68
|
-
[code: string]: User
|
|
69
|
-
} = {};
|
|
70
|
-
|
|
71
|
-
public static get Instance(): HubService {
|
|
72
|
-
return this.self || (this.self = new this());
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public silent: boolean = false;
|
|
76
|
-
public appId: number;
|
|
77
|
-
|
|
78
|
-
public init(silent: boolean = true): HubService {
|
|
79
|
-
this.silent = silent;
|
|
80
|
-
|
|
81
|
-
let i = hexlify(utils.randomBytes(1));
|
|
82
|
-
this.appId = bigNumberify(hexlify(utils.randomBytes(1))).toNumber();
|
|
83
|
-
|
|
84
|
-
if (process.env.CI_DEBUG === "true") {
|
|
85
|
-
process.env.SERVICE_BASE_SCHEMA = "https";
|
|
86
|
-
process.env.SERVICE_BASE_DOMAIN = "dev-hk-service.usdp.io";
|
|
87
|
-
process.env.SERVICE_BASE_NAME = "bdss";
|
|
88
|
-
process.env.SERVICE_DOMAIN = "BDSS";
|
|
89
|
-
|
|
90
|
-
process.env.MXW_V1_SERVICE_BASE_SCHEMA = "https";
|
|
91
|
-
process.env.MXW_V1_SERVICE_BASE_DOMAIN = "dev-hk-api-mxw.usdp.io";
|
|
92
|
-
process.env.MXW_V1_SERVICE_BASE_NAME = "";
|
|
93
|
-
process.env.MXW_V1_SERVICE_DOMAIN = "MXW";
|
|
94
|
-
|
|
95
|
-
process.env.MXW_SERVICE_BASE_SCHEMA = "https";
|
|
96
|
-
process.env.MXW_SERVICE_BASE_DOMAIN = "dev-hk-service.usdp.io";
|
|
97
|
-
process.env.MXW_SERVICE_BASE_NAME = "mxw";
|
|
98
|
-
process.env.MXW_SERVICE_DOMAIN = "MXW";
|
|
99
|
-
|
|
100
|
-
process.env.EMAIL_SERVER_URL = "https://dev-hk-mail.usdp.io";
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return this;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
public term() {
|
|
107
|
-
return Promise.resolve();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
HubService.Instance.init();
|
|
112
|
-
|
|
113
|
-
export function challengeIt(topic: string, func, emptyParams, challenge: boolean) {
|
|
114
|
-
if (!challenge) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
for (let loop of [
|
|
119
|
-
{
|
|
120
|
-
message: "challenge missing request",
|
|
121
|
-
params: undefined
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
message: "challenge empty request",
|
|
125
|
-
params: {}
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
message: "challenge null params",
|
|
129
|
-
params: null
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
message: "challenge empty params",
|
|
133
|
-
params: ""
|
|
134
|
-
}
|
|
135
|
-
]) {
|
|
136
|
-
it(topic + " - " + loop.message, function () {
|
|
137
|
-
if (null === loop.params) {
|
|
138
|
-
loop.params = nullObject(emptyParams);
|
|
139
|
-
}
|
|
140
|
-
else if ("" === loop.params) {
|
|
141
|
-
loop.params = emptyParams;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return func.apply(this, loop.params);
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function nullObject(obj) {
|
|
150
|
-
if ("object" == typeof obj) {
|
|
151
|
-
let ret = (Array.isArray(obj)) ? [] : {};
|
|
152
|
-
|
|
153
|
-
Object.keys(obj).forEach(function (key) {
|
|
154
|
-
if (null == obj[key]) {
|
|
155
|
-
ret[key] = null;
|
|
156
|
-
}
|
|
157
|
-
else if ("object" == typeof obj[key] && 0 < Object.keys(obj[key]).length) {
|
|
158
|
-
ret[key] = nullObject(obj[key]);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
if (Array.isArray(ret)) {
|
|
162
|
-
ret.push(null);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
if ("" === obj[key] || 0 === obj[key]) {
|
|
166
|
-
ret[key] = null;
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
ret[key] = obj[key];
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
return ret;
|
|
175
|
-
}
|
|
176
|
-
return obj;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export function getActivationToken(username: string, prefix: string) {
|
|
180
|
-
let emailServerUrl = process.env.EMAIL_SERVER_URL;
|
|
181
|
-
|
|
182
|
-
return chai.request(emailServerUrl).get("/api/v1/mailbox/" + username)
|
|
183
|
-
.type("application/json")
|
|
184
|
-
.retry(3)
|
|
185
|
-
.then((res) => {
|
|
186
|
-
goodRes(res);
|
|
187
|
-
expect(res.body).to.be.an("array").have.length.greaterThan(0);
|
|
188
|
-
expect(res.body[res.body.length - 1]).have.property("id");
|
|
189
|
-
return res.body[res.body.length - 1].id;
|
|
190
|
-
}).then((mailId) => {
|
|
191
|
-
return chai.request(emailServerUrl).get("/api/v1/mailbox/" + username + "/" + mailId)
|
|
192
|
-
.type("application/json")
|
|
193
|
-
.then((res) => {
|
|
194
|
-
goodRes(res);
|
|
195
|
-
expect(res.body).have.property("body").have.property("text").contains(prefix);
|
|
196
|
-
|
|
197
|
-
let bodyText: string = res.body.body.text;
|
|
198
|
-
return bodyText.split(prefix)[1].split(" )")[0];
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export function getOTP(username: string, prefix: string) {
|
|
204
|
-
let retry = 5;
|
|
205
|
-
|
|
206
|
-
return new Promise<string>((resolve, reject) => {
|
|
207
|
-
let get = (interval = 500) => {
|
|
208
|
-
setTimeout(() => {
|
|
209
|
-
let emailServerUrl = process.env.EMAIL_SERVER_URL;
|
|
210
|
-
|
|
211
|
-
return chai.request(emailServerUrl).get("/api/v1/mailbox/" + username)
|
|
212
|
-
.type("application/json")
|
|
213
|
-
.then((res) => {
|
|
214
|
-
goodRes(res);
|
|
215
|
-
expect(res.body).to.be.an("array").have.length.greaterThan(0);
|
|
216
|
-
expect(res.body[res.body.length - 1]).have.property("id");
|
|
217
|
-
return res.body[res.body.length - 1].id;
|
|
218
|
-
}).then((mailId) => {
|
|
219
|
-
return chai.request(emailServerUrl).get("/api/v1/mailbox/" + username + "/" + mailId)
|
|
220
|
-
.type("application/json")
|
|
221
|
-
.then((res) => {
|
|
222
|
-
goodRes(res);
|
|
223
|
-
expect(res.body).have.property("body").have.property("text").contains(prefix);
|
|
224
|
-
|
|
225
|
-
let bodyText: string = res.body.body.text;
|
|
226
|
-
let raw = bodyText.split(prefix)[1].split(".")[0];
|
|
227
|
-
let otp: string = "";
|
|
228
|
-
|
|
229
|
-
for (let i = 0; 20 > i; i++) {
|
|
230
|
-
let char = raw.charAt(i);
|
|
231
|
-
if (isUndefinedOrNullOrEmpty(char) || ! /[0-9]/.test(char)) {
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
otp += char;
|
|
235
|
-
}
|
|
236
|
-
return resolve(otp);
|
|
237
|
-
});
|
|
238
|
-
}).catch(error => {
|
|
239
|
-
if (0 >= --retry) {
|
|
240
|
-
return reject(error);
|
|
241
|
-
}
|
|
242
|
-
get();
|
|
243
|
-
});
|
|
244
|
-
}, interval);
|
|
245
|
-
}
|
|
246
|
-
return get(0);
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export function uploadOSS(user: User, serviceUrl: string, servicePath: string, params: any, file: string, mime: string) {
|
|
251
|
-
return chai.request(serviceUrl).get(servicePath)
|
|
252
|
-
.type("application/json")
|
|
253
|
-
.set("Authorization", "Bearer " + user.mxwJwt)
|
|
254
|
-
.query(params)
|
|
255
|
-
.then((res) => {
|
|
256
|
-
goodRet(res);
|
|
257
|
-
expect(res.body).have.property("data").property("host").is.a("string").lengthOf.greaterThan(0);
|
|
258
|
-
expect(res.body).have.property("data").property("accessid").is.a("string").lengthOf.greaterThan(0);
|
|
259
|
-
expect(res.body).have.property("data").property("policy").is.a("string").lengthOf.greaterThan(0);
|
|
260
|
-
expect(res.body).have.property("data").property("dir").is.a("string").lengthOf.greaterThan(0);
|
|
261
|
-
expect(res.body).have.property("data").property("callback").is.a("string").lengthOf.greaterThan(0);
|
|
262
|
-
expect(res.body).have.property("data").property("signature").is.a("string").lengthOf.greaterThan(0);
|
|
263
|
-
|
|
264
|
-
return {
|
|
265
|
-
host: res.body.data.host as string,
|
|
266
|
-
policy: res.body.data.policy as string,
|
|
267
|
-
accessid: res.body.data.accessid as string,
|
|
268
|
-
success_action_status: '200',
|
|
269
|
-
callback: res.body.data.callback as string,
|
|
270
|
-
signature: res.body.data.signature as string,
|
|
271
|
-
dir: res.body.data.dir as string
|
|
272
|
-
};
|
|
273
|
-
}).then((credential) => {
|
|
274
|
-
let extName = path.extname(file);
|
|
275
|
-
let filename = credential.dir + extName;
|
|
276
|
-
|
|
277
|
-
return chai.request(credential.host).post("")
|
|
278
|
-
.type("application/x-www-form-urlencoded")
|
|
279
|
-
.field("name", credential.signature)
|
|
280
|
-
.field("policy", credential.policy)
|
|
281
|
-
.field("OSSAccessKeyId", credential.accessid)
|
|
282
|
-
.field("success_action_status", credential.success_action_status)
|
|
283
|
-
.field("callback", credential.callback)
|
|
284
|
-
.field("signature", credential.signature)
|
|
285
|
-
.field("key", filename)
|
|
286
|
-
.attach("file", file, { filename, contentType: mime })
|
|
287
|
-
.then((res) => {
|
|
288
|
-
goodRet(res);
|
|
289
|
-
expect(res.body).have.property("readCredential").is.a("string").lengthOf.greaterThan(0);
|
|
290
|
-
return res.body.readCredential as string;
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export function isKycPassed(status: number) {
|
|
296
|
-
return (1 /* Approved */ == status || 18 /* In Review */ == status);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export function isKycSubmitted(status: number) {
|
|
300
|
-
return (10 /* Submitted */ == status || isKycPassed(status));
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
export function goodRes(res) {
|
|
304
|
-
expect(res).to.have.status(200);
|
|
305
|
-
expect(res).is.json;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
export function goodRet(res) {
|
|
309
|
-
goodRes(res);
|
|
310
|
-
expect(res.body).have.property("ret").is.satisfy(function (value) {
|
|
311
|
-
if ("0" === value) {
|
|
312
|
-
return true;
|
|
313
|
-
}
|
|
314
|
-
else {
|
|
315
|
-
if (0 === value) {
|
|
316
|
-
console.log("\x1b[33m%s", indent, "WARNING: Response ret is numeric!", "\x1b[0m");
|
|
317
|
-
return true;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
if (res.body.msg) {
|
|
321
|
-
throwError(errors.INVALID_RESPONSE, res.body.ret + ": " + res.body.msg, { body: res.body });
|
|
322
|
-
}
|
|
323
|
-
throwError(errors.INVALID_RESPONSE, "Failed response", { body: res.body });
|
|
324
|
-
})
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
export function badRet(res, ret?: string, msg?: string) {
|
|
328
|
-
goodRes(res);
|
|
329
|
-
if (isUndefinedOrNullOrEmpty(ret)) {
|
|
330
|
-
expect(res.body).have.property("ret").is.a("string").is.not.eq("0");
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
expect(res.body).have.property("ret").is.a("string").eq(ret);
|
|
334
|
-
|
|
335
|
-
if (!isUndefinedOrNullOrEmpty(msg)) {
|
|
336
|
-
expect(res.body).have.property("msg").is.a("string").eq(msg);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
export function serviceUrl(path: string) {
|
|
342
|
-
let url = (process.env.SERVICE_BASE_SCHEMA ? process.env.SERVICE_BASE_SCHEMA : "https") + "://" + process.env.SERVICE_BASE_DOMAIN;
|
|
343
|
-
|
|
344
|
-
if (process.env.SERVICE_BASE_NAME) {
|
|
345
|
-
url += "/" + process.env.SERVICE_BASE_NAME;
|
|
346
|
-
}
|
|
347
|
-
url += path;
|
|
348
|
-
|
|
349
|
-
return url;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
export function mxwV1ServiceUrl(path: string) {
|
|
353
|
-
let url = (process.env.MXW_V1_SERVICE_BASE_SCHEMA ? process.env.MXW_V1_SERVICE_BASE_SCHEMA : "https") + "://" + process.env.MXW_V1_SERVICE_BASE_DOMAIN;
|
|
354
|
-
|
|
355
|
-
if (process.env.MXW_V1_SERVICE_BASE_NAME) {
|
|
356
|
-
url += "/" + process.env.MXW_V1_SERVICE_BASE_NAME;
|
|
357
|
-
}
|
|
358
|
-
url += path;
|
|
359
|
-
|
|
360
|
-
return url;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
export function mxwServiceUrl(path: string) {
|
|
364
|
-
let url = (process.env.MXW_SERVICE_BASE_SCHEMA ? process.env.MXW_SERVICE_BASE_SCHEMA : "https") + "://" + process.env.MXW_SERVICE_BASE_DOMAIN;
|
|
365
|
-
|
|
366
|
-
if (process.env.MXW_SERVICE_BASE_NAME) {
|
|
367
|
-
url += "/" + process.env.MXW_SERVICE_BASE_NAME;
|
|
368
|
-
}
|
|
369
|
-
url += path;
|
|
370
|
-
|
|
371
|
-
return url;
|
|
372
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import { describe, it } from 'mocha';
|
|
4
|
-
import chai, { expect } from 'chai';
|
|
5
|
-
import chaihttp from 'chai-http';
|
|
6
|
-
|
|
7
|
-
import HubService, { User, goodRet, mxwServiceUrl, serviceUrl, challengeIt, badRet } from "./hub";
|
|
8
|
-
import { toUtf8Bytes, sortObject, hexlify, checkSafeBigNumberString } from 'mxw-libs-utils';
|
|
9
|
-
import { utils, Wallet, auth } from 'mxw-sdk-js';
|
|
10
|
-
import { JsonRpcProvider } from 'mxw-sdk-js/dist/providers';
|
|
11
|
-
import moment from "moment";
|
|
12
|
-
import { throwError, errors } from 'mxw-libs-errors';
|
|
13
|
-
|
|
14
|
-
chai.use(chaihttp);
|
|
15
|
-
|
|
16
|
-
let indent = " ";
|
|
17
|
-
let silent = true;
|
|
18
|
-
|
|
19
|
-
export function createContact(user: User, target: User, challenge: boolean) {
|
|
20
|
-
describe('Suite: Contact: ' + user.code, function () {
|
|
21
|
-
let contactId: number;
|
|
22
|
-
let dialCode = hexlify(utils.randomBytes(2)).substr(2);
|
|
23
|
-
let phoneNo = hexlify(utils.randomBytes(8)).substr(2);
|
|
24
|
-
|
|
25
|
-
if (challenge) {
|
|
26
|
-
it("Create contact - challenge without JWT", function () {
|
|
27
|
-
return chai.request(serviceUrl("/user/api")).post("/set/contact")
|
|
28
|
-
.type("application/json")
|
|
29
|
-
.send({
|
|
30
|
-
name: target.username,
|
|
31
|
-
email: target.email,
|
|
32
|
-
company: target.domain,
|
|
33
|
-
dialCode: dialCode,
|
|
34
|
-
phoneNo: phoneNo
|
|
35
|
-
})
|
|
36
|
-
.then((res) => {
|
|
37
|
-
badRet(res, "Unauthorised");
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
it("Create contact", function () {
|
|
43
|
-
return chai.request(serviceUrl("/user/api")).post("/set/contact")
|
|
44
|
-
.type("application/json")
|
|
45
|
-
.set("Authorization", "Bearer " + user.jwt)
|
|
46
|
-
.send({
|
|
47
|
-
name: target.username + target.username,
|
|
48
|
-
email: target.email + target.email,
|
|
49
|
-
company: target.domain + target.domain,
|
|
50
|
-
dialCode: dialCode + dialCode,
|
|
51
|
-
phoneNo: phoneNo + phoneNo
|
|
52
|
-
})
|
|
53
|
-
.then((res) => {
|
|
54
|
-
goodRet(res);
|
|
55
|
-
expect(res.body).have.property("data").property("id").is.a("number").greaterThan(0);
|
|
56
|
-
|
|
57
|
-
contactId = res.body.data.id;
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
if (challenge) {
|
|
62
|
-
it("List contact - challenge without JWT", function () {
|
|
63
|
-
return chai.request(serviceUrl("/user/api")).get("/contact/list")
|
|
64
|
-
.type("application/json")
|
|
65
|
-
.then((res) => {
|
|
66
|
-
badRet(res, "Unauthorised");
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
it("Verify created contact", function () {
|
|
72
|
-
return chai.request(serviceUrl("/user/api")).get("/contact/list")
|
|
73
|
-
.type("application/json")
|
|
74
|
-
.set("Authorization", "Bearer " + user.jwt)
|
|
75
|
-
.then((res) => {
|
|
76
|
-
goodRet(res);
|
|
77
|
-
expect(res.body).have.property("data").is.an("array").lengthOf.greaterThan(0);
|
|
78
|
-
expect(res.body.data[0]).have.property("id").is.a("number").greaterThan(0).is.eq(contactId);
|
|
79
|
-
expect(res.body.data[0]).have.property("name").is.a("string").is.eq(target.username + target.username);
|
|
80
|
-
expect(res.body.data[0]).have.property("userId").is.a("number").is.eq(0);
|
|
81
|
-
expect(res.body.data[0]).have.property("email").is.a("string").is.eq(target.email + target.email);
|
|
82
|
-
expect(res.body.data[0]).have.property("company").is.a("string").is.eq(target.domain + target.domain);
|
|
83
|
-
expect(res.body.data[0]).have.property("dialCode").is.a("string").is.eq(dialCode + dialCode);
|
|
84
|
-
expect(res.body.data[0]).have.property("phoneNo").is.a("string").is.eq(phoneNo + phoneNo);
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
if (challenge) {
|
|
89
|
-
it("Update contact - challenge without JWT", function () {
|
|
90
|
-
return chai.request(serviceUrl("/user/api")).put("/upd/contact")
|
|
91
|
-
.type("application/json")
|
|
92
|
-
.send({
|
|
93
|
-
id: contactId,
|
|
94
|
-
name: target.username,
|
|
95
|
-
email: target.email,
|
|
96
|
-
company: target.domain,
|
|
97
|
-
dialCode: dialCode,
|
|
98
|
-
phoneNo: phoneNo
|
|
99
|
-
})
|
|
100
|
-
.then((res) => {
|
|
101
|
-
badRet(res, "Unauthorised");
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it("Update contact - challenge contact not belong to me", function () {
|
|
106
|
-
return chai.request(serviceUrl("/user/api")).put("/upd/contact")
|
|
107
|
-
.type("application/json")
|
|
108
|
-
.set("Authorization", "Bearer " + user.jwt)
|
|
109
|
-
.send({
|
|
110
|
-
id: 1,
|
|
111
|
-
name: target.username,
|
|
112
|
-
email: target.email,
|
|
113
|
-
company: target.domain,
|
|
114
|
-
dialCode: dialCode,
|
|
115
|
-
phoneNo: phoneNo
|
|
116
|
-
})
|
|
117
|
-
.then((res) => {
|
|
118
|
-
badRet(res, "2201", "User Not Found");
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
it("Update contact", function () {
|
|
124
|
-
return chai.request(serviceUrl("/user/api")).put("/upd/contact")
|
|
125
|
-
.type("application/json")
|
|
126
|
-
.set("Authorization", "Bearer " + user.jwt)
|
|
127
|
-
.send({
|
|
128
|
-
id: contactId,
|
|
129
|
-
name: target.username,
|
|
130
|
-
email: target.email,
|
|
131
|
-
company: target.domain,
|
|
132
|
-
dialCode: dialCode,
|
|
133
|
-
phoneNo: phoneNo
|
|
134
|
-
})
|
|
135
|
-
.then((res) => {
|
|
136
|
-
goodRet(res);
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it("Verify updated contact", function () {
|
|
141
|
-
return chai.request(serviceUrl("/user/api")).get("/contact/list")
|
|
142
|
-
.type("application/json")
|
|
143
|
-
.set("Authorization", "Bearer " + user.jwt)
|
|
144
|
-
.then((res) => {
|
|
145
|
-
goodRet(res);
|
|
146
|
-
expect(res.body).have.property("data").is.an("array").lengthOf.greaterThan(0);
|
|
147
|
-
expect(res.body.data[0]).have.property("id").is.a("number").greaterThan(0).is.eq(contactId);
|
|
148
|
-
expect(res.body.data[0]).have.property("name").is.a("string").is.eq(target.username);
|
|
149
|
-
expect(res.body.data[0]).have.property("userId").is.a("number").is.eq(target.id);
|
|
150
|
-
expect(res.body.data[0]).have.property("email").is.a("string").is.eq(target.email);
|
|
151
|
-
expect(res.body.data[0]).have.property("company").is.a("string").is.eq(target.domain);
|
|
152
|
-
expect(res.body.data[0]).have.property("dialCode").is.a("string").is.eq(dialCode);
|
|
153
|
-
expect(res.body.data[0]).have.property("phoneNo").is.a("string").is.eq(phoneNo);
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
});
|
|
158
|
-
}
|