cja-phoenix 1.2.29 → 1.2.34

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": "cja-phoenix",
3
3
  "configKey": "cja-phoenix",
4
- "version": "1.2.29",
4
+ "version": "1.2.34",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,17 +1,17 @@
1
- import type { AnchorHTMLAttributes } from 'vue';
2
- import type { Icon } from '../types/Icon.js';
1
+ import type { AnchorHTMLAttributes } from "vue";
2
+ import type { Icon } from "../types/Icon.js";
3
3
  type __VLS_Props = {
4
- type?: 'primary' | 'secondary' | 'tertiary';
5
- color?: 'blue' | 'orange' | 'white' | 'light-blue' | 'gradient-green-blue';
6
- textAlign?: 'center' | 'left' | 'right';
7
- size?: 'sm' | 'md' | 'lg';
4
+ type?: "primary" | "secondary" | "tertiary";
5
+ color?: "blue" | "orange" | "white" | "light-blue" | "gradient-green-blue";
6
+ textAlign?: "center" | "left" | "right";
7
+ size?: "sm" | "md" | "lg";
8
8
  shadow?: boolean;
9
9
  iconRight?: Icon;
10
10
  iconLeft?: Icon;
11
11
  iconOnly?: boolean;
12
12
  loading?: boolean;
13
- href?: AnchorHTMLAttributes['href'];
14
- target?: AnchorHTMLAttributes['target'];
13
+ href?: AnchorHTMLAttributes["href"];
14
+ target?: AnchorHTMLAttributes["target"];
15
15
  };
16
16
  declare var __VLS_12: {};
17
17
  type __VLS_Slots = {} & {
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <component
3
+ external
3
4
  :is="href ? NuxtLink : 'button'"
4
5
  class="cja-btn"
5
6
  :href="href"
@@ -12,32 +13,14 @@
12
13
  { 'btn-loading': loading, 'btn-shadow': shadow, 'icon-only': iconOnly }
13
14
  ]"
14
15
  >
15
- <Transition
16
- name="fade"
17
- mode="out-in"
18
- >
19
- <div
20
- v-if="loading"
21
- class="spinner"
22
- />
23
- <div
24
- v-else
25
- class="text-wrapper"
26
- >
27
- <span
28
- v-if="iconLeft"
29
- :class="iconLeft"
30
- />
31
- <span
32
- v-if="!iconOnly"
33
- class="text"
34
- >
16
+ <Transition name="fade" mode="out-in">
17
+ <div v-if="loading" class="spinner" />
18
+ <div v-else class="text-wrapper">
19
+ <span v-if="iconLeft" :class="iconLeft" />
20
+ <span v-if="!iconOnly" class="text">
35
21
  <slot />
36
22
  </span>
37
- <span
38
- v-if="iconRight"
39
- :class="iconRight"
40
- />
23
+ <span v-if="iconRight" :class="iconRight" />
41
24
  </div>
42
25
  </Transition>
43
26
  </component>
@@ -1,17 +1,17 @@
1
- import type { AnchorHTMLAttributes } from 'vue';
2
- import type { Icon } from '../types/Icon.js';
1
+ import type { AnchorHTMLAttributes } from "vue";
2
+ import type { Icon } from "../types/Icon.js";
3
3
  type __VLS_Props = {
4
- type?: 'primary' | 'secondary' | 'tertiary';
5
- color?: 'blue' | 'orange' | 'white' | 'light-blue' | 'gradient-green-blue';
6
- textAlign?: 'center' | 'left' | 'right';
7
- size?: 'sm' | 'md' | 'lg';
4
+ type?: "primary" | "secondary" | "tertiary";
5
+ color?: "blue" | "orange" | "white" | "light-blue" | "gradient-green-blue";
6
+ textAlign?: "center" | "left" | "right";
7
+ size?: "sm" | "md" | "lg";
8
8
  shadow?: boolean;
9
9
  iconRight?: Icon;
10
10
  iconLeft?: Icon;
11
11
  iconOnly?: boolean;
12
12
  loading?: boolean;
13
- href?: AnchorHTMLAttributes['href'];
14
- target?: AnchorHTMLAttributes['target'];
13
+ href?: AnchorHTMLAttributes["href"];
14
+ target?: AnchorHTMLAttributes["target"];
15
15
  };
16
16
  declare var __VLS_12: {};
17
17
  type __VLS_Slots = {} & {
@@ -36,8 +36,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
36
36
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
37
37
  }>, {
38
38
  placeholder: string;
39
- disabled: boolean | "true" | "false";
40
39
  size: "sm" | "md" | "lg";
40
+ disabled: boolean | "true" | "false";
41
41
  errorDisplay: boolean;
42
42
  validationMode: "change" | "blur" | "none";
43
43
  layout: "vertical" | "horizontal";
@@ -36,8 +36,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
36
36
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
37
37
  }>, {
38
38
  placeholder: string;
39
- disabled: boolean | "true" | "false";
40
39
  size: "sm" | "md" | "lg";
40
+ disabled: boolean | "true" | "false";
41
41
  errorDisplay: boolean;
42
42
  validationMode: "change" | "blur" | "none";
43
43
  layout: "vertical" | "horizontal";
@@ -35,10 +35,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
35
35
  "onClick:option"?: ((...args: any[]) => any) | undefined;
36
36
  }>, {
37
37
  size: "sm" | "md" | "lg";
38
- icon: Icon;
39
38
  errorDisplay: boolean;
40
39
  validationMode: "change" | "none";
41
40
  layout: "list" | "grid" | "image";
41
+ icon: Icon;
42
42
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
43
  declare const _default: typeof __VLS_export;
44
44
  export default _default;
@@ -35,10 +35,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
35
35
  "onClick:option"?: ((...args: any[]) => any) | undefined;
36
36
  }>, {
37
37
  size: "sm" | "md" | "lg";
38
- icon: Icon;
39
38
  errorDisplay: boolean;
40
39
  validationMode: "change" | "none";
41
40
  layout: "list" | "grid" | "image";
41
+ icon: Icon;
42
42
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
43
  declare const _default: typeof __VLS_export;
44
44
  export default _default;
@@ -6,4 +6,4 @@ export declare const getAbTestVersion: (journeyId: string | undefined, config: {
6
6
  type: "utmSource";
7
7
  utmSource: string;
8
8
  };
9
- }) => Promise<string>;
9
+ }) => Promise<any>;
@@ -1,14 +1,21 @@
1
- import { useRuntimeConfig, useCookie, updateForm } from "#imports";
1
+ import {
2
+ useRuntimeConfig,
3
+ useCookie,
4
+ updateForm,
5
+ useRequestFetch
6
+ } from "#imports";
2
7
  export const getAbTestVersion = async (journeyId, config) => {
3
8
  const { apiURL } = useRuntimeConfig().public;
9
+ const requestFetch = useRequestFetch();
4
10
  const abTestCookie = useCookie(`abTestVersion_${config.experiment}`);
5
- const fetchAbTestVersion = async () => fetch(new URL("/core/apis/data/abTestServiceLookup", apiURL), {
11
+ const fetchAbTestVersion = async () => requestFetch("/core/apis/data/abTestServiceLookup", {
12
+ baseURL: apiURL,
6
13
  method: "post",
7
- body: JSON.stringify({
14
+ body: {
8
15
  experimentName: config.experiment,
9
16
  journeyId
10
- })
11
- }).then((r) => r.json()).then(async (d) => {
17
+ }
18
+ }).then(async (d) => {
12
19
  const abTestVersion = d.version || "control";
13
20
  abTestCookie.value = abTestVersion;
14
21
  await updateForm({
@@ -7,4 +7,4 @@ export declare const updateForm: (options: {
7
7
  sentToDialer?: boolean;
8
8
  eventType?: string;
9
9
  formType: string;
10
- }) => Promise<Response>;
10
+ }) => Promise<unknown>;
@@ -2,26 +2,23 @@ import { useRoute, useRuntimeConfig } from "#imports";
2
2
  export const updateForm = (options) => {
3
3
  const { apiURL } = useRuntimeConfig().public;
4
4
  const route = useRoute();
5
- return fetch(new URL("/core/apis/data/updateForm", apiURL), {
5
+ return $fetch("/core/apis/data/updateForm", {
6
+ baseURL: apiURL,
6
7
  method: "PUT",
7
- body: JSON.stringify(
8
- Object.fromEntries(
9
- Object.entries({
10
- eventType: options.eventType || "STEP_CHANGED",
11
- isActionEvent: true,
12
- journeyId: options.journeyId,
13
- stepName: options.stepName,
14
- isCompleted: options.isCompleted || false,
15
- sentToDialer: options.sentToDialer || true,
16
- lastStepNumber: options.step,
17
- lastStepType: options.formType,
18
- lastStepUrl: route.fullPath,
19
- data: JSON.stringify({
20
- ...options.payload,
21
- formType: options.formType
22
- })
23
- }).filter(([_, v]) => v != null)
24
- )
25
- )
8
+ body: {
9
+ eventType: options.eventType || "STEP_CHANGED",
10
+ isActionEvent: true,
11
+ journeyId: options.journeyId,
12
+ stepName: options.stepName,
13
+ isCompleted: options.isCompleted || false,
14
+ sentToDialer: options.sentToDialer || true,
15
+ lastStepNumber: options.step,
16
+ lastStepType: options.formType,
17
+ lastStepUrl: route.fullPath,
18
+ data: {
19
+ ...options.payload,
20
+ formType: options.formType
21
+ }
22
+ }
26
23
  });
27
24
  };
@@ -1,4 +1,4 @@
1
1
  export declare const updateMarketingConsent: (options: {
2
2
  email: string;
3
3
  journeyId?: string;
4
- }) => Promise<Response>;
4
+ }) => Promise<unknown>;
@@ -1,12 +1,13 @@
1
1
  import { useRuntimeConfig } from "#imports";
2
2
  export const updateMarketingConsent = (options) => {
3
3
  const { apiURL } = useRuntimeConfig().public;
4
- return fetch(new URL("/core/apis/data/verifyConsent", apiURL), {
4
+ return $fetch("/core/apis/data/verifyConsent", {
5
+ baseURL: apiURL,
5
6
  method: "POST",
6
- body: JSON.stringify({
7
+ body: {
7
8
  email: options.email,
8
9
  currentPageUrl: location.origin + location.pathname,
9
10
  journeyId: options.journeyId
10
- })
11
+ }
11
12
  });
12
13
  };
@@ -5,4 +5,4 @@ export declare const uploadFile: (options: {
5
5
  fileName: string;
6
6
  extension: string;
7
7
  bucketName: string;
8
- }) => Promise<Response>;
8
+ }) => Promise<unknown>;
@@ -1,15 +1,13 @@
1
1
  import { useRuntimeConfig } from "#imports";
2
2
  export const uploadFile = (options) => {
3
3
  const { apiURL } = useRuntimeConfig().public;
4
- const data = new FormData();
5
- data.append(
6
- "path",
7
- `${options.basePath}/${options.journeyId}/${options.fileName}.${options.extension}`
8
- );
9
- data.append("file", options.file);
10
- data.append("bucketName", options.bucketName);
11
- return fetch(new URL("/core/apis/data/saveFileToS3", apiURL), {
4
+ return $fetch("/core/apis/data/saveFileToS3", {
5
+ baseURL: apiURL,
12
6
  method: "POST",
13
- body: data
7
+ body: {
8
+ path: `${options.basePath}/${options.journeyId}/${options.fileName}.${options.extension}`,
9
+ file: options.file,
10
+ bucketName: options.bucketName
11
+ }
14
12
  });
15
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cja-phoenix",
3
- "version": "1.2.29",
3
+ "version": "1.2.34",
4
4
  "description": "Phoenix utility",
5
5
  "repository": "comparaja/phoenix",
6
6
  "license": "MIT",