/
opt
/
canhelp
/
node_modules
/
@anthropic-ai
/
sdk
/
core
/
/opt/canhelp/node_modules/@anthropic-ai/sdk/core
mkdir
upload
Name
Size
Mode
Actions
api-promise.d.mts
2426
0644
edit
dl
rm
api-promise.d.mts.map
1504
0644
edit
dl
rm
api-promise.d.ts
2422
0644
edit
dl
rm
api-promise.d.ts.map
1503
0644
edit
dl
rm
api-promise.js
3189
0644
edit
dl
rm
api-promise.js.map
1716
0644
edit
dl
rm
api-promise.mjs
3080
0644
edit
dl
rm
api-promise.mjs.map
1720
0644
edit
dl
rm
error.d.mts
2040
0644
edit
dl
rm
error.d.mts.map
1698
0644
edit
dl
rm
error.d.ts
2039
0644
edit
dl
rm
error.d.ts.map
1697
0644
edit
dl
rm
error.js
4377
0644
edit
dl
rm
error.js.map
3286
0644
edit
dl
rm
error.mjs
3401
0644
edit
dl
rm
error.mjs.map
3188
0644
edit
dl
rm
pagination.d.mts
3914
0644
edit
dl
rm
pagination.d.mts.map
3181
0644
edit
dl
rm
pagination.d.ts
3909
0644
edit
dl
rm
pagination.d.ts.map
3180
0644
edit
dl
rm
pagination.js
5835
0644
edit
dl
rm
pagination.js.map
4584
0644
edit
dl
rm
pagination.mjs
5477
0644
edit
dl
rm
pagination.mjs.map
4545
0644
edit
dl
rm
resource.d.mts
210
0644
edit
dl
rm
resource.d.mts.map
217
0644
edit
dl
rm
resource.d.ts
208
0644
edit
dl
rm
resource.d.ts.map
216
0644
edit
dl
rm
resource.js
350
0644
edit
dl
rm
resource.js.map
224
0644
edit
dl
rm
resource.mjs
216
0644
edit
dl
rm
resource.mjs.map
216
0644
edit
dl
rm
streaming.d.mts
1486
0644
edit
dl
rm
streaming.d.mts.map
1050
0644
edit
dl
rm
streaming.d.ts
1483
0644
edit
dl
rm
streaming.d.ts.map
1049
0644
edit
dl
rm
streaming.js
10631
0644
edit
dl
rm
streaming.js.map
8330
0644
edit
dl
rm
streaming.mjs
10386
0644
edit
dl
rm
streaming.mjs.map
8339
0644
edit
dl
rm
uploads.d.mts
165
0644
edit
dl
rm
uploads.d.mts.map
174
0644
edit
dl
rm
uploads.d.ts
162
0644
edit
dl
rm
uploads.d.ts.map
173
0644
edit
dl
rm
uploads.js
299
0644
edit
dl
rm
uploads.js.map
147
0644
edit
dl
rm
uploads.mjs
86
0644
edit
dl
rm
uploads.mjs.map
132
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/@anthropic-ai/sdk/core/api-promise.mjs
(3080B)
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. var _APIPromise_client; import { __classPrivateFieldGet, __classPrivateFieldSet } from "../internal/tslib.mjs"; import { defaultParseResponse, addRequestID, } from "../internal/parse.mjs"; /** * A subclass of `Promise` providing additional helper methods * for interacting with the SDK. */ export class APIPromise extends Promise { constructor(client, responsePromise, parseResponse = defaultParseResponse) { super((resolve) => { // this is maybe a bit weird but this has to be a no-op to not implicitly // parse the response body; instead .then, .catch, .finally are overridden // to parse the response resolve(null); }); this.responsePromise = responsePromise; this.parseResponse = parseResponse; _APIPromise_client.set(this, void 0); __classPrivateFieldSet(this, _APIPromise_client, client, "f"); } _thenUnwrap(transform) { return new APIPromise(__classPrivateFieldGet(this, _APIPromise_client, "f"), this.responsePromise, async (client, props) => addRequestID(transform(await this.parseResponse(client, props), props), props.response)); } /** * Gets the raw `Response` instance instead of parsing the response * data. * * If you want to parse the response body but still get the `Response` * instance, you can use {@link withResponse()}. * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` * to your `tsconfig.json`. */ asResponse() { return this.responsePromise.then((p) => p.response); } /** * Gets the parsed response data, the raw `Response` instance and the ID of the request, * returned via the `request-id` header which is useful for debugging requests and resporting * issues to Anthropic. * * If you just want to get the raw `Response` instance without parsing it, * you can use {@link asResponse()}. * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` or add `"lib": ["DOM"]` * to your `tsconfig.json`. */ async withResponse() { const [data, response] = await Promise.all([this.parse(), this.asResponse()]); return { data, response, request_id: response.headers.get('request-id') }; } parse() { if (!this.parsedPromise) { this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, "f"), data)); } return this.parsedPromise; } then(onfulfilled, onrejected) { return this.parse().then(onfulfilled, onrejected); } catch(onrejected) { return this.parse().catch(onrejected); } finally(onfinally) { return this.parse().finally(onfinally); } } _APIPromise_client = new WeakMap(); //# sourceMappingURL=api-promise.mjs.map
Save
cmd:
run