pukaad-ui-lib 1.155.0 → 1.157.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
3
  "configKey": "pukaadUI",
4
- "version": "1.155.0",
4
+ "version": "1.157.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
- background: boolean;
68
- modal: boolean;
69
67
  responsive: boolean;
70
68
  restore: boolean;
71
69
  checkCrossOrigin: boolean;
72
70
  checkOrientation: boolean;
73
71
  crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  highlight: boolean;
75
+ background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -64,15 +64,15 @@ declare const __VLS_export: import("vue").DefineComponent<ImageCropperProps, {
64
64
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageCropperProps> & Readonly<{}>, {
65
65
  src: string;
66
66
  center: boolean;
67
- background: boolean;
68
- modal: boolean;
69
67
  responsive: boolean;
70
68
  restore: boolean;
71
69
  checkCrossOrigin: boolean;
72
70
  checkOrientation: boolean;
73
71
  crossorigin: "" | "anonymous" | "use-credentials";
72
+ modal: boolean;
74
73
  guides: boolean;
75
74
  highlight: boolean;
75
+ background: boolean;
76
76
  autoCrop: boolean;
77
77
  movable: boolean;
78
78
  rotatable: boolean;
@@ -66,8 +66,8 @@
66
66
  <script setup>
67
67
  import { ref, watch } from "vue";
68
68
  import { useClipboard } from "@/runtime/composables/useCopy";
69
- import { useRuntimeConfig } from "nuxt/app";
70
- const { BASE_URL_API } = useRuntimeConfig().public;
69
+ import { useApi } from "../../composables/useApi";
70
+ const api = useApi();
71
71
  const { copyToClipboard } = useClipboard();
72
72
  const emit = defineEmits(["complete"]);
73
73
  const props = defineProps({
@@ -86,9 +86,7 @@ const isDisabled = ref(true);
86
86
  const twoFaGenerate = async () => {
87
87
  try {
88
88
  isLoading.value = true;
89
- const { status, data } = await $fetch(`${BASE_URL_API}/me/two-fa-generate`, {
90
- credentials: "include"
91
- });
89
+ const { status, data } = await api("/me/two-fa-generate");
92
90
  if (status !== "success") throw "Generate \u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08";
93
91
  key.value = data.key;
94
92
  barcode2FA.value = data.qr_code;
@@ -24,8 +24,8 @@
24
24
 
25
25
  <script setup>
26
26
  import { ref, watch } from "vue";
27
- import { useRuntimeConfig } from "nuxt/app";
28
- const { BASE_URL_API } = useRuntimeConfig().public;
27
+ import { useApi } from "../../composables/useApi";
28
+ const api = useApi();
29
29
  const emit = defineEmits(["complete"]);
30
30
  const props = defineProps({
31
31
  phone: { type: String, required: false },
@@ -42,15 +42,14 @@ const valueOTP = ref("");
42
42
  const isLoading = ref(false);
43
43
  const onVerify2FA = async () => {
44
44
  try {
45
- const { data } = await $fetch(
46
- !props.phone ? `${BASE_URL_API}/me/two-fa-verify` : `${BASE_URL_API}/auth/two-fa-verify`,
45
+ const { data } = await api(
46
+ !props.phone ? "/me/two-fa-verify" : "/auth/two-fa-verify",
47
47
  {
48
48
  method: "POST",
49
49
  body: {
50
50
  phone: props.phone,
51
51
  code: valueOTP.value
52
- },
53
- credentials: "include"
52
+ }
54
53
  }
55
54
  );
56
55
  if (!data) throw "error";
@@ -12,8 +12,9 @@
12
12
  </template>
13
13
 
14
14
  <script setup>
15
- import { useNuxtApp, useRuntimeConfig } from "nuxt/app";
15
+ import { useNuxtApp } from "nuxt/app";
16
16
  import { reactive, watch, ref } from "vue";
17
+ import { useApi } from "../../composables/useApi";
17
18
  import ModalPasswordVerify from "@/runtime/components/modal/modal-password-verify.vue";
18
19
  import ModalPasswordNew from "@/runtime/components/modal/modal-password-new.vue";
19
20
  import Modal2FA from "@/runtime/components/modal/modal-2FA.vue";
@@ -21,7 +22,7 @@ import Modal2FAGenerate from "@/runtime/components/modal/modal-2FA-generate.vue"
21
22
  import ModalPhoneOTP from "@/runtime/components/modal/modal-phone-OTP.vue";
22
23
  import ModalEmailOTP from "@/runtime/components/modal/modal-email-OTP.vue";
23
24
  const { $toast } = useNuxtApp();
24
- const { BASE_URL_API } = useRuntimeConfig().public;
25
+ const api = useApi();
25
26
  const emit = defineEmits(["complete"]);
26
27
  const props = defineProps({
27
28
  state: { type: String, required: true },
@@ -126,13 +127,9 @@ const handleComplete = (key) => {
126
127
  };
127
128
  const onEnabled2FA = async () => {
128
129
  try {
129
- const { status } = await $fetch(
130
- `${BASE_URL_API}/me/two-fa-enabled`,
131
- {
132
- method: "POST",
133
- credentials: "include"
134
- }
135
- );
130
+ const { status } = await api("/me/two-fa-enabled", {
131
+ method: "POST"
132
+ });
136
133
  if (status != "success") throw "2FA \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07";
137
134
  $toast.success("\u0E40\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E15\u0E31\u0E27\u0E15\u0E19\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08 !");
138
135
  isOpen.value = false;
@@ -144,13 +141,9 @@ const onEnabled2FA = async () => {
144
141
  };
145
142
  const onDisabled2FA = async () => {
146
143
  try {
147
- const { status } = await $fetch(
148
- `${BASE_URL_API}/me/two-fa-disabled`,
149
- {
150
- method: "POST",
151
- credentials: "include"
152
- }
153
- );
144
+ const { status } = await api("/me/two-fa-disabled", {
145
+ method: "POST"
146
+ });
154
147
  if (status != "success") throw "2FA \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07";
155
148
  $toast.success("\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19\u0E15\u0E31\u0E27\u0E15\u0E19\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08 !");
156
149
  isOpen.value = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pukaad-ui-lib",
3
- "version": "1.155.0",
3
+ "version": "1.157.0",
4
4
  "description": "pukaad-ui for MeMSG",
5
5
  "repository": {
6
6
  "type": "git",