@uappi/public-sdk 1.2.7 → 1.2.9

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.
@@ -0,0 +1 @@
1
+ npm run prepush
@@ -0,0 +1,19 @@
1
+ import tseslint from 'typescript-eslint';
2
+
3
+ export default tseslint.config(
4
+ {
5
+ ignores: ['node_modules/**', 'package-lock.json'],
6
+ },
7
+ ...tseslint.configs.recommended,
8
+ {
9
+ files: ['**/*.ts'],
10
+ rules: {
11
+ '@typescript-eslint/consistent-type-imports': [
12
+ 'error',
13
+ { prefer: 'type-imports', fixStyle: 'separate-type-imports' },
14
+ ],
15
+ '@typescript-eslint/no-unused-vars': 'off',
16
+ '@typescript-eslint/no-explicit-any': 'off',
17
+ },
18
+ },
19
+ );
@@ -42,7 +42,7 @@ import type {
42
42
  AddProductToWishlistRequest,
43
43
  RequestSendMFA
44
44
  } from '../types';
45
- import { SalesChannelByEmailResponse } from '../types/endpoints/customer/customer.interfaces';
45
+ import { type SalesChannelByEmailResponse } from '../types/endpoints/customer/customer.interfaces';
46
46
 
47
47
  export function detail(
48
48
  options?: Pick<
@@ -10,7 +10,6 @@ export function upsells(
10
10
  location: string,
11
11
  options?: Pick<ApiParams<ProductFields>, 'fields'>,
12
12
  ) {
13
- options
14
13
  return usePublicApi<UpsellResponse, ProductFields>({
15
14
  endpoint: `/cart/upsell/${location}`,
16
15
  params: options,
@@ -19,7 +19,6 @@ export type ApiMethod =
19
19
  export interface ApiResponse<ResponseType> {
20
20
  data: Ref<ResponseType | undefined>;
21
21
  status: Ref<ApiStatus>;
22
- //eslint-disable-next-line
23
22
  error: Ref<any | null>;
24
23
  fetchData: () => Promise<void>;
25
24
  }
@@ -11,6 +11,7 @@ import type { CustomerLead } from '../types';
11
11
  import type {
12
12
  ApiParams,
13
13
  CustomerConditionFields,
14
+ CustomerFields,
14
15
  CustomerSortFields,
15
16
  SigninCustomerByDocument,
16
17
  SigninCustomerByEmail,
@@ -27,11 +28,13 @@ export function detail(
27
28
  'condition' | 'fields' | 'order'
28
29
  >,
29
30
  ) {
31
+
32
+ let fields: Array<CustomerFields> = ['addresses', 'flags'];
33
+
34
+ if (options?.fields) fields = [...options.fields, ...fields];
35
+
30
36
  return publicApi.customer
31
- .detail({
32
- ...options,
33
- fields: ['addresses', 'flags'],
34
- })
37
+ .detail({ ...options, fields })
35
38
  .then(data => {
36
39
  customerProfileAction(data);
37
40
 
@@ -2,7 +2,6 @@ import usePublicApi from '../Api';
2
2
 
3
3
  declare global {
4
4
  interface Window {
5
- // eslint-disable-next-line
6
5
  dataLayer: Array<Record<string, any>>;
7
6
  }
8
7
  }
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@uappi/public-sdk",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "Pacotes públicos para desenvolvimento do ecossistema Uappi",
5
5
  "main": "main.ts",
6
6
  "scripts": {
7
+ "lint": "eslint .",
8
+ "type-check": "tsc --noEmit",
9
+ "prepush": "npm run lint && npm run type-check",
10
+ "prepublishOnly": "npm run lint && npm run type-check",
11
+ "prepare": "husky",
7
12
  "publish": "npm publish --access public"
8
13
  },
9
14
  "repository": {
@@ -23,5 +28,16 @@
23
28
  "bugs": {
24
29
  "url": "https://gitlab.com/agenciawebart/uappi/plataforma/frontend/packages/public/composables/use-public-api/issues"
25
30
  },
26
- "homepage": "https://gitlab.com/agenciawebart/uappi/plataforma/frontend/packages/public/composables/use-public-api#readme"
31
+ "homepage": "https://gitlab.com/agenciawebart/uappi/plataforma/frontend/packages/public/composables/use-public-api#readme",
32
+ "dependencies": {
33
+ "axios": "^1.13.2"
34
+ },
35
+ "devDependencies": {
36
+ "eslint": "^10.7.0",
37
+ "husky": "^9.1.7",
38
+ "typescript": "^6.0.3",
39
+ "typescript-eslint": "^8.63.0",
40
+ "vite": "^8.1.4",
41
+ "vue": "^3.5.39"
42
+ }
27
43
  }
package/shims.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare module '*.vue' {
2
+ import type { DefineComponent } from 'vue';
3
+ const component: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>;
4
+ export default component;
5
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2021",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "lib": ["ES2021", "DOM"],
7
+ "types": ["vite/client"],
8
+ "strict": false,
9
+ "verbatimModuleSyntax": true,
10
+ "isolatedModules": true,
11
+ "esModuleInterop": true,
12
+ "skipLibCheck": true,
13
+ "resolveJsonModule": true,
14
+ "noEmit": true
15
+ },
16
+ "include": ["main.ts", "modules/**/*.ts", "components/**/*.ts", "shims.d.ts"]
17
+ }