shred-api-client 2.3.5-rc.0 → 2.3.5-rc.2
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/index.js +4 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/dist/index.d.mts +0 -2713
- package/dist/index.mjs +0 -2017
- package/dist/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -61,16 +61,17 @@ var OLD_HOSTS = {
|
|
|
61
61
|
};
|
|
62
62
|
var HTTPClient = class {
|
|
63
63
|
async makeRequest(env, uri, method, data, context, useLegacyApi) {
|
|
64
|
+
var _a;
|
|
64
65
|
const hostDict = useLegacyApi ? OLD_HOSTS : HOSTS;
|
|
65
66
|
const host = hostDict[env] || hostDict.staging;
|
|
66
67
|
const url = host + uri;
|
|
67
68
|
const headers = {
|
|
68
69
|
"Content-Type": useLegacyApi ? "application/x-www-form-urlencoded" : "application/json"
|
|
69
70
|
};
|
|
70
|
-
if (context
|
|
71
|
+
if (context == null ? void 0 : context.token) {
|
|
71
72
|
headers["Authorization"] = `Bearer ${context.token}`;
|
|
72
73
|
}
|
|
73
|
-
if (context
|
|
74
|
+
if (context == null ? void 0 : context.requestId) {
|
|
74
75
|
headers["X-Request-ID"] = context.requestId;
|
|
75
76
|
}
|
|
76
77
|
try {
|
|
@@ -95,7 +96,7 @@ var HTTPClient = class {
|
|
|
95
96
|
parsedBody = typeof error.response.data === "string" ? JSON.parse(error.response.data) : error.response.data;
|
|
96
97
|
} catch {
|
|
97
98
|
parsedBody = {
|
|
98
|
-
message: error.response.data
|
|
99
|
+
message: ((_a = error.response.data) == null ? void 0 : _a.message) || error.response.statusText || "Unknown error"
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
102
|
throw {
|
|
@@ -2041,20 +2042,4 @@ var core_exports = {};
|
|
|
2041
2042
|
|
|
2042
2043
|
// src/index.ts
|
|
2043
2044
|
var index_default = ShredAPI;
|
|
2044
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
2045
|
-
0 && (module.exports = {
|
|
2046
|
-
Asset,
|
|
2047
|
-
Core,
|
|
2048
|
-
Email,
|
|
2049
|
-
Exceptions,
|
|
2050
|
-
Goal,
|
|
2051
|
-
Note,
|
|
2052
|
-
Notification,
|
|
2053
|
-
Project,
|
|
2054
|
-
Prompt,
|
|
2055
|
-
Subscription,
|
|
2056
|
-
Tenant,
|
|
2057
|
-
Track,
|
|
2058
|
-
User
|
|
2059
|
-
});
|
|
2060
2045
|
//# sourceMappingURL=index.js.map
|