@stepzen/sdk 0.11.0 → 0.11.1
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/lib/commands/account.js
CHANGED
|
@@ -14,10 +14,10 @@ exports.default = async (account, sdkConfig) => {
|
|
|
14
14
|
method: 'POST',
|
|
15
15
|
});
|
|
16
16
|
debug('stepzen:response')(response);
|
|
17
|
-
if (response.status
|
|
17
|
+
if (response.status === 401 || response.status === 403) {
|
|
18
18
|
throw new Error('Could not complete the request. Please check your authentication details are correct.');
|
|
19
19
|
}
|
|
20
|
-
if (response.status >=
|
|
20
|
+
if (response.status >= 400) {
|
|
21
21
|
return {
|
|
22
22
|
errors: [response.statusText],
|
|
23
23
|
success: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/commands/account.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAE9C,+BAA8B;AAC9B,2CAA8B;AAE9B,mDAAqD;AACrD,+CAAmD;AAGnD,kBAAe,KAAK,EAClB,OAAuB,EACvB,SAA2B,EAG3B,EAAE;IACF,MAAM,OAAO,GAAG,2BAAiB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IACrD,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,6BAAiB,EAAE,CAAA;IAEnD,KAAK,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAA;IAEjC,MAAM,QAAQ,GAAG,MAAM,oBAAK,CAAC,GAAG,EAAE;QAChC,OAAO,EAAE,OAAc;QACvB,MAAM,EAAE,MAAM;KACf,CAAC,CAAA;IAEF,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,CAAA;IAEnC,IAAI,QAAQ,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/commands/account.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAE9C,+BAA8B;AAC9B,2CAA8B;AAE9B,mDAAqD;AACrD,+CAAmD;AAGnD,kBAAe,KAAK,EAClB,OAAuB,EACvB,SAA2B,EAG3B,EAAE;IACF,MAAM,OAAO,GAAG,2BAAiB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IACrD,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,6BAAiB,EAAE,CAAA;IAEnD,KAAK,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAA;IAEjC,MAAM,QAAQ,GAAG,MAAM,oBAAK,CAAC,GAAG,EAAE;QAChC,OAAO,EAAE,OAAc;QACvB,MAAM,EAAE,MAAM;KACf,CAAC,CAAA;IAEF,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,CAAA;IAEnC,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;QACtD,MAAM,IAAI,KAAK,CACb,uFAAuF,CACxF,CAAA;KACF;IAED,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE;QAC1B,OAAO;YACL,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;YAC7B,OAAO,EAAE,KAAK;SACf,CAAA;KACF;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAClC,IAAI,IAAI,CAAA;IAER,IAAI;QACF,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;KACxB;IAAC,WAAM;QACN,OAAO;YACL,MAAM,EAAE,CAAC,oCAAoC,IAAI,EAAE,CAAC;YACpD,OAAO,EAAE,KAAK;SACf,CAAA;KACF;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|
package/package.json
CHANGED
package/src/commands/account.ts
CHANGED
|
@@ -25,13 +25,13 @@ export default async (
|
|
|
25
25
|
|
|
26
26
|
debug('stepzen:response')(response)
|
|
27
27
|
|
|
28
|
-
if (response.status
|
|
28
|
+
if (response.status === 401 || response.status === 403) {
|
|
29
29
|
throw new Error(
|
|
30
30
|
'Could not complete the request. Please check your authentication details are correct.',
|
|
31
31
|
)
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
if (response.status >=
|
|
34
|
+
if (response.status >= 400) {
|
|
35
35
|
return {
|
|
36
36
|
errors: [response.statusText],
|
|
37
37
|
success: false,
|