swiftyper-node 1.0.11 → 1.0.12
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 +25 -0
- package/lib/resources/Complaints.js +13 -0
- package/lib/resources/Places.js +1 -1
- package/lib/resources/Translation.js +1 -1
- package/lib/resources/Withdrawals.js +13 -0
- package/lib/resources.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,6 +49,31 @@ const swiftyper = new Swiftyper('VÁŠ_API_KĽÚČ_SLUŽBY_PLACES');
|
|
|
49
49
|
})();
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
### Odstúpenie od zmluvy a reklamácie
|
|
53
|
+
|
|
54
|
+
Zaznamenanie odstúpenia od zmluvy alebo reklamácie z vlastného e-shopu. Použite API kľúč projektu Odstúpenie od zmluvy. Každé volanie zaznamená nové podanie a spotrebiteľovi odošle potvrdenie, preto požiadavku, ktorá mohla prejsť, neopakujte. Fotografie k reklamácii zatiaľ táto knižnica neposiela; ak ich potrebujete, pošlite požiadavku ako `multipart/form-data` priamo podľa [dokumentácie](https://developers.swiftyper.sk/withdrawals).
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
const swiftyper = require('swiftyper-node')('VÁŠ_API_KĽÚČ_SLUŽBY_WITHDRAWALS');
|
|
58
|
+
|
|
59
|
+
const withdrawal = await swiftyper.withdrawals.create({
|
|
60
|
+
name: 'Jana Nováková',
|
|
61
|
+
email: 'jana@example.com',
|
|
62
|
+
order_number: '2026-15',
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
console.log(withdrawal.reference); // #12
|
|
66
|
+
|
|
67
|
+
await swiftyper.complaints.create({
|
|
68
|
+
name: 'Jana Nováková',
|
|
69
|
+
email: 'jana@example.com',
|
|
70
|
+
order_number: '2026-15',
|
|
71
|
+
product: 'Bezdrôtové slúchadlá',
|
|
72
|
+
defect: 'Ľavé slúchadlo prestalo hrať.',
|
|
73
|
+
requested_resolution: 'repair',
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
52
77
|
## Konfigurácia
|
|
53
78
|
|
|
54
79
|
### Inicializácia pomocou konfiguračného objektu
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const SwiftyperResource = require('../SwiftyperResource');
|
|
4
|
+
const swiftyperMethod = SwiftyperResource.method;
|
|
5
|
+
|
|
6
|
+
module.exports = SwiftyperResource.extend({
|
|
7
|
+
path: 'complaints',
|
|
8
|
+
|
|
9
|
+
create: swiftyperMethod({
|
|
10
|
+
method: 'POST',
|
|
11
|
+
path: '',
|
|
12
|
+
}),
|
|
13
|
+
});
|
package/lib/resources/Places.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const SwiftyperResource = require('../SwiftyperResource');
|
|
4
|
+
const swiftyperMethod = SwiftyperResource.method;
|
|
5
|
+
|
|
6
|
+
module.exports = SwiftyperResource.extend({
|
|
7
|
+
path: 'withdrawals',
|
|
8
|
+
|
|
9
|
+
create: swiftyperMethod({
|
|
10
|
+
method: 'POST',
|
|
11
|
+
path: '',
|
|
12
|
+
}),
|
|
13
|
+
});
|
package/lib/resources.js
CHANGED
|
@@ -10,6 +10,8 @@ module.exports = {
|
|
|
10
10
|
EmailUtil: require('./resources/EmailUtil'),
|
|
11
11
|
IpUtil: require('./resources/IpUtil'),
|
|
12
12
|
ViesUtil: require('./resources/ViesUtil'),
|
|
13
|
+
Withdrawals: require('./resources/Withdrawals'),
|
|
14
|
+
Complaints: require('./resources/Complaints'),
|
|
13
15
|
Business: require('./resources/Business'),
|
|
14
16
|
Phrases: require('./resources/Phrase'),
|
|
15
17
|
Places: require('./resources/Places'),
|