@sprucelabs/spruce-file-utils 15.1.24 → 15.1.25
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.
@@ -122,7 +122,8 @@ class ChunkingUploaderImpl extends AbstractEventEmitter {
|
|
122
122
|
}
|
123
123
|
post(path, postBody, headers) {
|
124
124
|
return __awaiter(this, void 0, void 0, function* () {
|
125
|
-
const
|
125
|
+
const url = this.restEndpointUrl + '/v1/uploads' + path;
|
126
|
+
const response = yield this.fetch(url, {
|
126
127
|
headers: Object.assign({ 'Content-Type': 'application/json' }, headers),
|
127
128
|
method: 'POST',
|
128
129
|
body: JSON.stringify(postBody),
|
@@ -132,7 +133,7 @@ class ChunkingUploaderImpl extends AbstractEventEmitter {
|
|
132
133
|
throw new SpruceError({
|
133
134
|
code: response.status === 400 ? 'BAD_REQUEST' : 'UNAUTHORIZED',
|
134
135
|
friendlyMessage: body.errorMessage,
|
135
|
-
endpoint:
|
136
|
+
endpoint: url,
|
136
137
|
});
|
137
138
|
}
|
138
139
|
return body;
|
@@ -107,7 +107,8 @@ class ChunkingUploaderImpl extends mercury_event_emitter_1.AbstractEventEmitter
|
|
107
107
|
return client;
|
108
108
|
}
|
109
109
|
async post(path, postBody, headers) {
|
110
|
-
const
|
110
|
+
const url = this.restEndpointUrl + '/v1/uploads' + path;
|
111
|
+
const response = await this.fetch(url, {
|
111
112
|
headers: {
|
112
113
|
'Content-Type': 'application/json',
|
113
114
|
...headers,
|
@@ -120,7 +121,7 @@ class ChunkingUploaderImpl extends mercury_event_emitter_1.AbstractEventEmitter
|
|
120
121
|
throw new SpruceError_1.default({
|
121
122
|
code: response.status === 400 ? 'BAD_REQUEST' : 'UNAUTHORIZED',
|
122
123
|
friendlyMessage: body.errorMessage,
|
123
|
-
endpoint:
|
124
|
+
endpoint: url,
|
124
125
|
});
|
125
126
|
}
|
126
127
|
return body;
|