vellum-ai 0.0.33 → 0.0.35
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.
|
@@ -31,6 +31,7 @@ export declare class Documents {
|
|
|
31
31
|
*
|
|
32
32
|
*/
|
|
33
33
|
partialUpdate(id: string, request?: Vellum.PatchedDocumentUpdateRequest): Promise<Vellum.DocumentRead>;
|
|
34
|
+
destroy(id: string): Promise<void>;
|
|
34
35
|
/**
|
|
35
36
|
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
36
37
|
*
|
|
@@ -147,6 +147,38 @@ class Documents {
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
+
async destroy(id) {
|
|
151
|
+
const _response = await core.fetcher({
|
|
152
|
+
url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, `v1/documents/${id}`),
|
|
153
|
+
method: "DELETE",
|
|
154
|
+
headers: {
|
|
155
|
+
X_API_KEY: await core.Supplier.get(this.options.apiKey),
|
|
156
|
+
},
|
|
157
|
+
contentType: "application/json",
|
|
158
|
+
});
|
|
159
|
+
if (_response.ok) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (_response.error.reason === "status-code") {
|
|
163
|
+
throw new errors.VellumError({
|
|
164
|
+
statusCode: _response.error.statusCode,
|
|
165
|
+
body: _response.error.body,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
switch (_response.error.reason) {
|
|
169
|
+
case "non-json":
|
|
170
|
+
throw new errors.VellumError({
|
|
171
|
+
statusCode: _response.error.statusCode,
|
|
172
|
+
body: _response.error.rawBody,
|
|
173
|
+
});
|
|
174
|
+
case "timeout":
|
|
175
|
+
throw new errors.VellumTimeoutError();
|
|
176
|
+
case "unknown":
|
|
177
|
+
throw new errors.VellumError({
|
|
178
|
+
message: _response.error.errorMessage,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
150
182
|
/**
|
|
151
183
|
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
152
184
|
*
|
|
@@ -31,6 +31,7 @@ export declare class Documents {
|
|
|
31
31
|
*
|
|
32
32
|
*/
|
|
33
33
|
partialUpdate(id: string, request?: Vellum.PatchedDocumentUpdateRequest): Promise<Vellum.DocumentRead>;
|
|
34
|
+
destroy(id: string): Promise<void>;
|
|
34
35
|
/**
|
|
35
36
|
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
36
37
|
*
|
|
@@ -147,6 +147,38 @@ class Documents {
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
+
async destroy(id) {
|
|
151
|
+
const _response = await core.fetcher({
|
|
152
|
+
url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, `v1/documents/${id}`),
|
|
153
|
+
method: "DELETE",
|
|
154
|
+
headers: {
|
|
155
|
+
X_API_KEY: await core.Supplier.get(this.options.apiKey),
|
|
156
|
+
},
|
|
157
|
+
contentType: "application/json",
|
|
158
|
+
});
|
|
159
|
+
if (_response.ok) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (_response.error.reason === "status-code") {
|
|
163
|
+
throw new errors.VellumError({
|
|
164
|
+
statusCode: _response.error.statusCode,
|
|
165
|
+
body: _response.error.body,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
switch (_response.error.reason) {
|
|
169
|
+
case "non-json":
|
|
170
|
+
throw new errors.VellumError({
|
|
171
|
+
statusCode: _response.error.statusCode,
|
|
172
|
+
body: _response.error.rawBody,
|
|
173
|
+
});
|
|
174
|
+
case "timeout":
|
|
175
|
+
throw new errors.VellumTimeoutError();
|
|
176
|
+
case "unknown":
|
|
177
|
+
throw new errors.VellumError({
|
|
178
|
+
message: _response.error.errorMessage,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
150
182
|
/**
|
|
151
183
|
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
152
184
|
*
|