@dc-qash/sdk 1.3.1 → 1.3.3
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/dist/lib.js +18 -2
- package/package.json +1 -1
package/dist/lib.js
CHANGED
|
@@ -55,6 +55,8 @@ export default class QashSDK {
|
|
|
55
55
|
return resolve(_q);
|
|
56
56
|
}
|
|
57
57
|
catch (e) {
|
|
58
|
+
if (!Array.isArray(e))
|
|
59
|
+
console.error(e);
|
|
58
60
|
reject(Array.isArray(e) ? e : ["unexpected_issue"]);
|
|
59
61
|
}
|
|
60
62
|
});
|
|
@@ -76,6 +78,8 @@ class QashDatasets {
|
|
|
76
78
|
return resolve(_q);
|
|
77
79
|
}
|
|
78
80
|
catch (e) {
|
|
81
|
+
if (!Array.isArray(e))
|
|
82
|
+
console.error(e);
|
|
79
83
|
reject(Array.isArray(e) ? e : ["unexpected_issue"]);
|
|
80
84
|
}
|
|
81
85
|
});
|
|
@@ -90,6 +94,8 @@ class QashDatasets {
|
|
|
90
94
|
return resolve(_q);
|
|
91
95
|
}
|
|
92
96
|
catch (e) {
|
|
97
|
+
if (!Array.isArray(e))
|
|
98
|
+
console.error(e);
|
|
93
99
|
reject(Array.isArray(e) ? e : ["unexpected_issue"]);
|
|
94
100
|
}
|
|
95
101
|
});
|
|
@@ -113,6 +119,8 @@ class QashCBS {
|
|
|
113
119
|
return resolve(_q);
|
|
114
120
|
}
|
|
115
121
|
catch (e) {
|
|
122
|
+
if (!Array.isArray(e))
|
|
123
|
+
console.error(e);
|
|
116
124
|
reject(Array.isArray(e) ? e : ["unexpected_issue"]);
|
|
117
125
|
}
|
|
118
126
|
});
|
|
@@ -128,6 +136,8 @@ class QashCBS {
|
|
|
128
136
|
return resolve(_q);
|
|
129
137
|
}
|
|
130
138
|
catch (e) {
|
|
139
|
+
if (!Array.isArray(e))
|
|
140
|
+
console.error(e);
|
|
131
141
|
reject(Array.isArray(e) ? e : ["unexpected_issue"]);
|
|
132
142
|
}
|
|
133
143
|
});
|
|
@@ -142,6 +152,8 @@ class QashCBS {
|
|
|
142
152
|
return resolve(_q);
|
|
143
153
|
}
|
|
144
154
|
catch (e) {
|
|
155
|
+
if (!Array.isArray(e))
|
|
156
|
+
console.error(e);
|
|
145
157
|
reject(Array.isArray(e) ? e : ["unexpected_issue"]);
|
|
146
158
|
}
|
|
147
159
|
});
|
|
@@ -150,12 +162,14 @@ class QashCBS {
|
|
|
150
162
|
createIndividualAccountHolder(data) {
|
|
151
163
|
return new Promise(async (resolve, reject) => {
|
|
152
164
|
try {
|
|
153
|
-
let _q = await fetch(`${__classPrivateFieldGet(this, _QashCBS_sdk, "f").environment}/v1/cbs/account-holders`, { method: "POST", body: JSON.stringify(Object.assign({ type: "individual" }, data)), headers: { Authorization: `Basic ${__classPrivateFieldGet(this, _QashCBS_sdk, "f").apiKey}
|
|
165
|
+
let _q = await fetch(`${__classPrivateFieldGet(this, _QashCBS_sdk, "f").environment}/v1/cbs/account-holders`, { method: "POST", body: JSON.stringify(Object.assign({ type: "individual" }, data)), headers: { Authorization: `Basic ${__classPrivateFieldGet(this, _QashCBS_sdk, "f").apiKey}`, "Content-Type": "application/json" } }).then(r => r.json());
|
|
154
166
|
if (_q.error || _q.errors)
|
|
155
167
|
throw _q.errors || [_q.error];
|
|
156
168
|
return resolve(_q);
|
|
157
169
|
}
|
|
158
170
|
catch (e) {
|
|
171
|
+
if (!Array.isArray(e))
|
|
172
|
+
console.error(e);
|
|
159
173
|
reject(Array.isArray(e) ? e : ["unexpected_issue"]);
|
|
160
174
|
}
|
|
161
175
|
});
|
|
@@ -164,12 +178,14 @@ class QashCBS {
|
|
|
164
178
|
createCheckingAccount(data) {
|
|
165
179
|
return new Promise(async (resolve, reject) => {
|
|
166
180
|
try {
|
|
167
|
-
let _q = await fetch(`${__classPrivateFieldGet(this, _QashCBS_sdk, "f").environment}/v1/cbs/accounts`, { method: "POST", body: JSON.stringify(Object.assign({ type: "checking_account" }, data)), headers: { Authorization: `Basic ${__classPrivateFieldGet(this, _QashCBS_sdk, "f").apiKey}
|
|
181
|
+
let _q = await fetch(`${__classPrivateFieldGet(this, _QashCBS_sdk, "f").environment}/v1/cbs/accounts`, { method: "POST", body: JSON.stringify(Object.assign({ type: "checking_account" }, data)), headers: { Authorization: `Basic ${__classPrivateFieldGet(this, _QashCBS_sdk, "f").apiKey}`, "Content-Type": "application/json" } }).then(r => r.json());
|
|
168
182
|
if (_q.error || _q.errors)
|
|
169
183
|
throw _q.errors || [_q.error];
|
|
170
184
|
return resolve(_q);
|
|
171
185
|
}
|
|
172
186
|
catch (e) {
|
|
187
|
+
if (!Array.isArray(e))
|
|
188
|
+
console.error(e);
|
|
173
189
|
reject(Array.isArray(e) ? e : ["unexpected_issue"]);
|
|
174
190
|
}
|
|
175
191
|
});
|