@zennify/sdk-js 1.16.0 → 1.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zennify/sdk-js",
3
- "version": "1.16.0",
3
+ "version": "1.18.0",
4
4
  "description": "A simple package to work with https://api.zennify.app",
5
5
  "main": "dist/main.js",
6
6
  "keywords": [],
package/src/errors.ts CHANGED
@@ -55,6 +55,7 @@ export interface APIErrors {
55
55
  'WEBHOOK_RECEIVED_INVALID_DATA': { status: number };
56
56
  /// payment errors
57
57
  'INVALID_PAYMENT_METHOD': {};
58
+ 'BANK_INTERNAL_ERROR': {};
58
59
  // Order Errors
59
60
  'YOU_NEED_TO_INSERT_AT_LEAST_1_ITEM': {};
60
61
  'ONE_PROVIDED_PRODUCT_IS_OUT_OF_STOCK': {
@@ -90,10 +91,21 @@ export interface APIErrors {
90
91
  'FAILED_REFUND': {};
91
92
  'INVALID_METADATA': { details: string };
92
93
  // MP errors
93
- 'MP_INTERNAL_ERROR': {};
94
+ 'MP_INVALID_TOKEN': {};
94
95
  'MP_ACCOUNT_OFFLINE': {};
95
96
  'MP_PIX_KEY_NOT_CONFIGURED': {};
96
97
  'MP_NOT_ALLOWED_TO_SELL': {};
98
+ 'MP_RATE_LIMIT': {};
99
+ // Efi Errors
100
+ 'EFIBANK_INVALID_PIX_KEY': {};
101
+ 'EFIBANK_INVALID_CREDENTIALS': {};
102
+ 'EFIBANK_INVALID_SCOPES': {};
103
+ 'EFIBANK_INVALID_CERTIFICATE': {};
104
+ 'EFIBANK_INVALID_CLIENT_ID': {};
105
+ 'EFIBANK_INVALID_CLIENT_SECRET': {};
106
+ 'EFIBANK_BLOCKED_ACCOUNT': {};
107
+ 'EFIBANK_UNKNOWN_TRANSACTION': {};
108
+ 'EFIBANK_RATE_LIMIT': {};
97
109
  /// bad preference configuration
98
110
  'THIS_SELLER_HAS_NOT_YET_CONFIGURED_RECEIPT_VIA_PIX': {};
99
111
  'THIS_SELLER_HAS_NOT_YET_CONFIGURED_RECEIPT_VIA_BOLETO': {};
@@ -112,9 +124,7 @@ export interface APIErrors {
112
124
  // store errors
113
125
  'UNKNOWN_STORE': {};
114
126
  'EXPIRED_STORE': {},
115
- 'UNKNOWN_BANK': {
116
- received: string
117
- };
127
+ 'UNKNOWN_BANK': { received: string };
118
128
  'INVALID_STORE_NAME': {};
119
129
  'YOU_HAVE_ALREADY_MIGRATED': {};
120
130
  /// AUTOROLE
@@ -175,6 +175,10 @@
175
175
  "name": "Invalid payment method",
176
176
  "message": "Try again with another method."
177
177
  },
178
+ "BANK_INTERNAL_ERROR": {
179
+ "name": "The bank returned an unknown error, please try again or wait for them to resolve it.",
180
+ "message": "Note that this error is not a problem of Zennify, but rather of the bank."
181
+ },
178
182
  "YOU_NEED_TO_INSERT_AT_LEAST_1_ITEM": {
179
183
  "name": "You need to insert at least 1 item",
180
184
  "message": "Add an item to the order."
@@ -211,9 +215,13 @@
211
215
  "name": "Transaction not found.",
212
216
  "message": "It may not exist or may belong to another user."
213
217
  },
214
- "MP_INTERNAL_ERROR": {
215
- "name": "Mercado Pago returned an unknown error, please try again or wait for them to fix it.",
216
- "message": "Please note that this error is not a Zennify problem, but a Mercado Pago problem."
218
+ "MP_INVALID_TOKEN": {
219
+ "name": "The Mercado Pago access token is invalid.",
220
+ "message": "Try re-authenticating via the dashboard."
221
+ },
222
+ "MP_RATE_LIMIT": {
223
+ "name": "Action limit reached, please try again.",
224
+ "message": "Note that this limit is imposed by Mercado Pago, not by Zennify."
217
225
  },
218
226
  "MP_ACCOUNT_OFFLINE": {
219
227
  "name": "Unable to generate an order",
@@ -227,6 +235,42 @@
227
235
  "name": "Not authorized by Mercado Pago to sell",
228
236
  "message": "Please contact Mercado Pago support."
229
237
  },
238
+ "EFIBANK_INVALID_PIX_KEY": {
239
+ "name": "The configured random Pix key is invalid or does not exist.",
240
+ "message": "Try generating a new random Pix key and configure it via the dashboard."
241
+ },
242
+ "EFIBANK_INVALID_CREDENTIALS": {
243
+ "name": "Efí credentials are invalid.",
244
+ "message": "Enter a valid client id, client secret, and certificate."
245
+ },
246
+ "EFIBANK_INVALID_SCOPES": {
247
+ "name": "The configured application's scopes are invalid.",
248
+ "message": "Configure the scopes correctly. Contact the Zennify team if you have any questions."
249
+ },
250
+ "EFIBANK_INVALID_CERTIFICATE": {
251
+ "name": "The configured certificate is invalid or does not exist.",
252
+ "message": "Remember to use the production certificate, not the test certificate."
253
+ },
254
+ "EFIBANK_INVALID_CLIENT_ID": {
255
+ "name": "The configured Client ID is invalid or does not exist.",
256
+ "message": "Remember to use the production Client ID, not the test Client ID."
257
+ },
258
+ "EFIBANK_INVALID_CLIENT_SECRET": {
259
+ "name": "The configured Client Secret is invalid or does not exist.",
260
+ "message": "Remember to use the production Client Secret, not the test Client Secret."
261
+ },
262
+ "EFIBANK_BLOCKED_ACCOUNT": {
263
+ "name": "The associated efí account is suspended from selling.",
264
+ "message": "Try contacting the Banco Efí team."
265
+ },
266
+ "EFIBANK_RATE_LIMIT": {
267
+ "name": "Action limit reached, please try again.",
268
+ "message": "Note that this limit is imposed by Banco Efí, not by Zennify."
269
+ },
270
+ "EFIBANK_UNKNOWN_TRANSACTION": {
271
+ "name": "This transaction could not be found.",
272
+ "message": "Maybe it does not exist or belongs to another account."
273
+ },
230
274
  "INVALID_OPERATION_FOR_CURRENT_TRANSACTION_STATUS": {
231
275
  "name": "Invalid operation for this transaction.",
232
276
  "message": "The current status doesn't allow this operation."
@@ -132,8 +132,8 @@
132
132
  "message": ""
133
133
  },
134
134
  "THE_PIX_KEY_INSERTED_ISNT_VALID": {
135
- "name": "A chave pix inserida não é válida",
136
- "message": "Aceitamos CPF, email, telefone e chave aletória"
135
+ "name": "A chave pix inserida não é válida, configure uma chave válida.",
136
+ "message": "Aceitamos CPF, email, telefone e chave aletória."
137
137
  },
138
138
  "INSERT_A_VALID_URL": {
139
139
  "name": "Insira uma URL válida",
@@ -171,6 +171,10 @@
171
171
  "name": "Método de pagamento inválido",
172
172
  "message": "Tente novamente com outro método."
173
173
  },
174
+ "BANK_INTERNAL_ERROR": {
175
+ "name": "O banco retornou um erro desconhecido, tente novamente ou aguarde a correção deles.",
176
+ "message": "Note que esse erro não é um problema do Zennify, mas sim do banco."
177
+ },
174
178
  "YOU_NEED_TO_INSERT_AT_LEAST_1_ITEM": {
175
179
  "name": "Insira pelo menos 1 item",
176
180
  "message": "Adicione um item ao pedido."
@@ -207,9 +211,13 @@
207
211
  "name": "Transação não encontrada.",
208
212
  "message": "Talvez não exista ou pertença a outra pessoa."
209
213
  },
210
- "MP_INTERNAL_ERROR": {
211
- "name": "O Mercado Pago retornou um erro desconhecido, tente novamente ou aguarde a correção deles.",
212
- "message": "Note que esse erro não é um problema do Zennify, mas sim do Mercado Pago."
214
+ "MP_INVALID_TOKEN": {
215
+ "name": "A chave de acesso do Mercado Pago é inválida.",
216
+ "message": "Tente se autenticar novamente via dashboard."
217
+ },
218
+ "MP_RATE_LIMIT": {
219
+ "name": "O limite de ações foi atingido, tente novamente.",
220
+ "message": "Note que esse limite é imposto pelo Mercado Pago, não pelo Zennify."
213
221
  },
214
222
  "MP_ACCOUNT_OFFLINE": {
215
223
  "name": "Não foi possível gerar um pedido",
@@ -223,6 +231,42 @@
223
231
  "name": "Sem autorização do Mercado Pago para vender",
224
232
  "message": "Entre em contato com o Mercado Pago."
225
233
  },
234
+ "EFIBANK_INVALID_PIX_KEY": {
235
+ "name": "A chave pix aleatória configurada é inválida ou não existe.",
236
+ "message": "Tente gerar uma nova chave pix aleatória e configurar novamente."
237
+ },
238
+ "EFIBANK_INVALID_CREDENTIALS": {
239
+ "name": "As credenciais da Efí estão inválidas.",
240
+ "message": "Insira um client id, client secret e certificado válido."
241
+ },
242
+ "EFIBANK_INVALID_SCOPES": {
243
+ "name": "Os escopos da aplicação configurada são inválidos.",
244
+ "message": "Configure os escopos corretamente. Entre em contato com a equipe do Zennify caso tenha dúvidas."
245
+ },
246
+ "EFIBANK_INVALID_CERTIFICATE": {
247
+ "name": "O certificado configurado é inválido ou não existe.",
248
+ "message": "Lembre-se de usar o certificado de produção, não de homologação."
249
+ },
250
+ "EFIBANK_INVALID_CLIENT_ID": {
251
+ "name": "O Client ID configurado é inválido ou não existe.",
252
+ "message": "Lembre-se de usar o Client ID de produção, não de homologação."
253
+ },
254
+ "EFIBANK_INVALID_CLIENT_SECRET": {
255
+ "name": "O Client Secret configurado é inválido ou não existe.",
256
+ "message": "Lembre-se de usar o Client Secret de produção, não de homologação."
257
+ },
258
+ "EFIBANK_BLOCKED_ACCOUNT": {
259
+ "name": "A conta efí associada está suspensa de vender.",
260
+ "message": "Tente entrar em contato com a equipe do Banco Efí."
261
+ },
262
+ "EFIBANK_RATE_LIMIT": {
263
+ "name": "O limite de ações foi atingido, tente novamente.",
264
+ "message": "Note que esse limite é imposto pelo Banco Efí, não pelo Zennify."
265
+ },
266
+ "EFIBANK_UNKNOWN_TRANSACTION": {
267
+ "name": "Não foi possível encontrar essa transação.",
268
+ "message": "Talvez ela não existe ou seja pertencente a outra conta."
269
+ },
226
270
  "INVALID_OPERATION_FOR_CURRENT_TRANSACTION_STATUS": {
227
271
  "name": "Operação inválida para essa transação.",
228
272
  "message": "O estado atual não permite que a operação seja realizada."
package/types/errors.d.ts CHANGED
@@ -49,6 +49,7 @@ export interface APIErrors {
49
49
  status: number;
50
50
  };
51
51
  'INVALID_PAYMENT_METHOD': {};
52
+ 'BANK_INTERNAL_ERROR': {};
52
53
  'YOU_NEED_TO_INSERT_AT_LEAST_1_ITEM': {};
53
54
  'ONE_PROVIDED_PRODUCT_IS_OUT_OF_STOCK': {
54
55
  name: string;
@@ -83,10 +84,20 @@ export interface APIErrors {
83
84
  'INVALID_METADATA': {
84
85
  details: string;
85
86
  };
86
- 'MP_INTERNAL_ERROR': {};
87
+ 'MP_INVALID_TOKEN': {};
87
88
  'MP_ACCOUNT_OFFLINE': {};
88
89
  'MP_PIX_KEY_NOT_CONFIGURED': {};
89
90
  'MP_NOT_ALLOWED_TO_SELL': {};
91
+ 'MP_RATE_LIMIT': {};
92
+ 'EFIBANK_INVALID_PIX_KEY': {};
93
+ 'EFIBANK_INVALID_CREDENTIALS': {};
94
+ 'EFIBANK_INVALID_SCOPES': {};
95
+ 'EFIBANK_INVALID_CERTIFICATE': {};
96
+ 'EFIBANK_INVALID_CLIENT_ID': {};
97
+ 'EFIBANK_INVALID_CLIENT_SECRET': {};
98
+ 'EFIBANK_BLOCKED_ACCOUNT': {};
99
+ 'EFIBANK_UNKNOWN_TRANSACTION': {};
100
+ 'EFIBANK_RATE_LIMIT': {};
90
101
  'THIS_SELLER_HAS_NOT_YET_CONFIGURED_RECEIPT_VIA_PIX': {};
91
102
  'THIS_SELLER_HAS_NOT_YET_CONFIGURED_RECEIPT_VIA_BOLETO': {};
92
103
  'THIS_SELLER_HAS_NOT_YET_CONFIGURED_RECEIPT_VIA_CRYPTO': {};