@uappi/public-sdk 2.0.0 → 2.1.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/README.md CHANGED
@@ -25,6 +25,12 @@ Duas coisas que continuam valendo em qualquer framework: os dois módulos usam A
25
25
  navegador (`window`, `sessionStorage`), então não rodam em Node nem em SSR; e o
26
26
  `Tracking` lê `import.meta.env`, o que exige bundler no estilo Vite.
27
27
 
28
+ Esses caminhos funcionam por resolução normal de diretório, e o pacote **não declara um
29
+ campo `exports`** de propósito. A 2.0.0 declarou, e isso quebrou os 96 imports de
30
+ diretório que os consumidores fazem (`@uappi/public-sdk/modules/Api/types` e similares):
31
+ subpath de `exports` não resolve `index.ts` de diretório, nem com coringa. Não reintroduza
32
+ sem testar os três checkouts.
33
+
28
34
  ## Setup
29
35
 
30
36
  ```
@@ -4,6 +4,7 @@ import type {
4
4
  ApiParams,
5
5
  CustomerResponse,
6
6
  SignupCustomer,
7
+ SignupCustomerBySocialLogin,
7
8
  SigninCustomerByDocument,
8
9
  SigninCustomerByEmail,
9
10
  ResponseSigninCustomer,
@@ -58,7 +59,7 @@ export function detail(
58
59
  >({ endpoint: '/customer', params: options });
59
60
  }
60
61
 
61
- export function signup(payload: SignupCustomer) {
62
+ export function signup(payload: SignupCustomer | SignupCustomerBySocialLogin) {
62
63
  return usePublicApi<CustomerResponse>({
63
64
  endpoint: '/customer',
64
65
  method: 'POST',
@@ -85,6 +85,13 @@ export interface SignupCustomer {
85
85
  documents?: Array<CustomerDocument>;
86
86
  }
87
87
 
88
+ export interface SignupCustomerBySocialLogin
89
+ extends Omit<SignupCustomer, 'email' | 'password'> {
90
+ socialLoginToken: string;
91
+ email?: never;
92
+ password?: never;
93
+ }
94
+
88
95
  export interface CustomerDocument {
89
96
  type: 'cpf' | 'rg' | 'cnpj' | 'ie' | 'document1' | 'document2' | 'document3';
90
97
  document: string;
@@ -91,6 +91,7 @@ import type {
91
91
  SigninCustomerByDocument,
92
92
  SigninCustomerByEmail,
93
93
  SignupCustomer,
94
+ SignupCustomerBySocialLogin,
94
95
  ResponseSigninCustomer,
95
96
  CustomerDocument,
96
97
  UpsertCustomerAddressRequest,
@@ -476,6 +477,7 @@ export type {
476
477
  ResponseSigninCustomer,
477
478
  CustomerDocument,
478
479
  SignupCustomer,
480
+ SignupCustomerBySocialLogin,
479
481
  CustomerGender,
480
482
  CustomerOrigin,
481
483
  CustomerConditionFields,
@@ -16,6 +16,7 @@ import type {
16
16
  SigninCustomerByDocument,
17
17
  SigninCustomerByEmail,
18
18
  SignupCustomer,
19
+ SignupCustomerBySocialLogin,
19
20
  } from '../../Api/types';
20
21
 
21
22
  export function detail(
@@ -42,7 +43,7 @@ export function detail(
42
43
  });
43
44
  }
44
45
 
45
- export function signup(payload: SignupCustomer) {
46
+ export function signup(payload: SignupCustomer | SignupCustomerBySocialLogin) {
46
47
  return publicApi.customer.signup(payload).then(data => {
47
48
  signupAction();
48
49
  return data;
package/package.json CHANGED
@@ -1,16 +1,8 @@
1
1
  {
2
2
  "name": "@uappi/public-sdk",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Pacotes públicos para desenvolvimento do ecossistema Uappi",
5
5
  "main": "main.ts",
6
- "exports": {
7
- ".": "./main.ts",
8
- "./modules": "./modules/index.ts",
9
- "./modules/Api": "./modules/Api/index.ts",
10
- "./modules/Tracking": "./modules/Tracking/index.ts",
11
- "./components": "./components/index.ts",
12
- "./*": "./*"
13
- },
14
6
  "scripts": {
15
7
  "lint": "eslint .",
16
8
  "type-check": "tsc --noEmit",