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