@honcho-ai/core 1.0.0
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/CHANGELOG.md +344 -0
- package/LICENSE +201 -0
- package/README.md +322 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +83 -0
- package/_shims/index.js +17 -0
- package/_shims/index.mjs +11 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +255 -0
- package/core.d.ts.map +1 -0
- package/core.js +922 -0
- package/core.js.map +1 -0
- package/core.mjs +890 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +134 -0
- package/index.d.ts +134 -0
- package/index.d.ts.map +1 -0
- package/index.js +141 -0
- package/index.js.map +1 -0
- package/index.mjs +98 -0
- package/index.mjs.map +1 -0
- package/package.json +103 -0
- package/pagination.d.ts +30 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +39 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +35 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/index.d.ts +3 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +10 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -0
- package/resources/keys.d.ts +29 -0
- package/resources/keys.d.ts.map +1 -0
- package/resources/keys.js +20 -0
- package/resources/keys.js.map +1 -0
- package/resources/keys.mjs +16 -0
- package/resources/keys.mjs.map +1 -0
- package/resources/workspaces/index.d.ts +4 -0
- package/resources/workspaces/index.d.ts.map +1 -0
- package/resources/workspaces/index.js +14 -0
- package/resources/workspaces/index.js.map +1 -0
- package/resources/workspaces/index.mjs +5 -0
- package/resources/workspaces/index.mjs.map +1 -0
- package/resources/workspaces/peers/index.d.ts +4 -0
- package/resources/workspaces/peers/index.d.ts.map +1 -0
- package/resources/workspaces/peers/index.js +12 -0
- package/resources/workspaces/peers/index.js.map +1 -0
- package/resources/workspaces/peers/index.mjs +5 -0
- package/resources/workspaces/peers/index.mjs.map +1 -0
- package/resources/workspaces/peers/messages.d.ts +35 -0
- package/resources/workspaces/peers/messages.d.ts.map +1 -0
- package/resources/workspaces/peers/messages.js +25 -0
- package/resources/workspaces/peers/messages.js.map +1 -0
- package/resources/workspaces/peers/messages.mjs +21 -0
- package/resources/workspaces/peers/messages.mjs.map +1 -0
- package/resources/workspaces/peers/peers.d.ts +120 -0
- package/resources/workspaces/peers/peers.d.ts.map +1 -0
- package/resources/workspaces/peers/peers.js +108 -0
- package/resources/workspaces/peers/peers.js.map +1 -0
- package/resources/workspaces/peers/peers.mjs +80 -0
- package/resources/workspaces/peers/peers.mjs.map +1 -0
- package/resources/workspaces/peers/sessions.d.ts +27 -0
- package/resources/workspaces/peers/sessions.d.ts.map +1 -0
- package/resources/workspaces/peers/sessions.js +24 -0
- package/resources/workspaces/peers/sessions.js.map +1 -0
- package/resources/workspaces/peers/sessions.mjs +20 -0
- package/resources/workspaces/peers/sessions.mjs.map +1 -0
- package/resources/workspaces/peers.d.ts +2 -0
- package/resources/workspaces/peers.d.ts.map +1 -0
- package/resources/workspaces/peers.js +19 -0
- package/resources/workspaces/peers.js.map +1 -0
- package/resources/workspaces/peers.mjs +3 -0
- package/resources/workspaces/peers.mjs.map +1 -0
- package/resources/workspaces/sessions/index.d.ts +4 -0
- package/resources/workspaces/sessions/index.d.ts.map +1 -0
- package/resources/workspaces/sessions/index.js +13 -0
- package/resources/workspaces/sessions/index.js.map +1 -0
- package/resources/workspaces/sessions/index.mjs +5 -0
- package/resources/workspaces/sessions/index.mjs.map +1 -0
- package/resources/workspaces/sessions/messages.d.ts +60 -0
- package/resources/workspaces/sessions/messages.d.ts.map +1 -0
- package/resources/workspaces/sessions/messages.js +46 -0
- package/resources/workspaces/sessions/messages.js.map +1 -0
- package/resources/workspaces/sessions/messages.mjs +41 -0
- package/resources/workspaces/sessions/messages.mjs.map +1 -0
- package/resources/workspaces/sessions/peers.d.ts +96 -0
- package/resources/workspaces/sessions/peers.d.ts.map +1 -0
- package/resources/workspaces/sessions/peers.js +63 -0
- package/resources/workspaces/sessions/peers.js.map +1 -0
- package/resources/workspaces/sessions/peers.mjs +59 -0
- package/resources/workspaces/sessions/peers.mjs.map +1 -0
- package/resources/workspaces/sessions/sessions.d.ts +129 -0
- package/resources/workspaces/sessions/sessions.d.ts.map +1 -0
- package/resources/workspaces/sessions/sessions.js +110 -0
- package/resources/workspaces/sessions/sessions.js.map +1 -0
- package/resources/workspaces/sessions/sessions.mjs +82 -0
- package/resources/workspaces/sessions/sessions.mjs.map +1 -0
- package/resources/workspaces/sessions.d.ts +2 -0
- package/resources/workspaces/sessions.d.ts.map +1 -0
- package/resources/workspaces/sessions.js +19 -0
- package/resources/workspaces/sessions.js.map +1 -0
- package/resources/workspaces/sessions.mjs +3 -0
- package/resources/workspaces/sessions.mjs.map +1 -0
- package/resources/workspaces/workspaces.d.ts +69 -0
- package/resources/workspaces/workspaces.d.ts.map +1 -0
- package/resources/workspaces/workspaces.js +92 -0
- package/resources/workspaces/workspaces.js.map +1 -0
- package/resources/workspaces/workspaces.mjs +64 -0
- package/resources/workspaces/workspaces.mjs.map +1 -0
- package/resources/workspaces.d.ts +2 -0
- package/resources/workspaces.d.ts.map +1 -0
- package/resources/workspaces.js +19 -0
- package/resources/workspaces.js.map +1 -0
- package/resources/workspaces.mjs +3 -0
- package/resources/workspaces.mjs.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +18 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +83 -0
- package/src/_shims/index.js +17 -0
- package/src/_shims/index.mjs +11 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1234 -0
- package/src/error.ts +130 -0
- package/src/index.ts +246 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +73 -0
- package/src/resource.ts +11 -0
- package/src/resources/index.ts +12 -0
- package/src/resources/keys.ts +51 -0
- package/src/resources/workspaces/index.ts +39 -0
- package/src/resources/workspaces/peers/index.ts +24 -0
- package/src/resources/workspaces/peers/messages.ts +81 -0
- package/src/resources/workspaces/peers/peers.ts +245 -0
- package/src/resources/workspaces/peers/sessions.ts +60 -0
- package/src/resources/workspaces/peers.ts +3 -0
- package/src/resources/workspaces/sessions/index.ts +35 -0
- package/src/resources/workspaces/sessions/messages.ts +149 -0
- package/src/resources/workspaces/sessions/peers.ts +200 -0
- package/src/resources/workspaces/sessions/sessions.ts +308 -0
- package/src/resources/workspaces/sessions.ts +3 -0
- package/src/resources/workspaces/workspaces.ts +194 -0
- package/src/resources/workspaces.ts +3 -0
- package/src/resources.ts +1 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
package/index.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var _Honcho_instances, _a, _Honcho_baseURLOverridden;
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.HonchoError = exports.fileFromPath = exports.toFile = exports.Honcho = void 0;
|
|
29
|
+
const Core = __importStar(require("./core.js"));
|
|
30
|
+
const Errors = __importStar(require("./error.js"));
|
|
31
|
+
const Pagination = __importStar(require("./pagination.js"));
|
|
32
|
+
const Uploads = __importStar(require("./uploads.js"));
|
|
33
|
+
const API = __importStar(require("./resources/index.js"));
|
|
34
|
+
const keys_1 = require("./resources/keys.js");
|
|
35
|
+
const workspaces_1 = require("./resources/workspaces/workspaces.js");
|
|
36
|
+
const environments = {
|
|
37
|
+
demo: 'https://demo.honcho.dev',
|
|
38
|
+
local: 'http://localhost:8000',
|
|
39
|
+
production: 'https://api.honcho.dev',
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* API Client for interfacing with the Honcho API.
|
|
43
|
+
*/
|
|
44
|
+
class Honcho extends Core.APIClient {
|
|
45
|
+
/**
|
|
46
|
+
* API Client for interfacing with the Honcho API.
|
|
47
|
+
*
|
|
48
|
+
* @param {string | null | undefined} [opts.apiKey=process.env['HONCHO_API_KEY'] ?? null]
|
|
49
|
+
* @param {Environment} [opts.environment=demo] - Specifies the environment URL to use for the API.
|
|
50
|
+
* @param {string} [opts.baseURL=process.env['HONCHO_BASE_URL'] ?? https://demo.honcho.dev] - Override the default base URL for the API.
|
|
51
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
52
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
53
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
54
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
55
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
56
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
57
|
+
*/
|
|
58
|
+
constructor({ baseURL = Core.readEnv('HONCHO_BASE_URL'), apiKey = Core.readEnv('HONCHO_API_KEY') ?? null, ...opts } = {}) {
|
|
59
|
+
const options = {
|
|
60
|
+
apiKey,
|
|
61
|
+
...opts,
|
|
62
|
+
baseURL,
|
|
63
|
+
environment: opts.environment ?? 'demo',
|
|
64
|
+
};
|
|
65
|
+
if (baseURL && opts.environment) {
|
|
66
|
+
throw new Errors.HonchoError('Ambiguous URL; The `baseURL` option (or HONCHO_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null');
|
|
67
|
+
}
|
|
68
|
+
super({
|
|
69
|
+
baseURL: options.baseURL || environments[options.environment || 'demo'],
|
|
70
|
+
baseURLOverridden: baseURL ? baseURL !== environments[options.environment || 'demo'] : false,
|
|
71
|
+
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
72
|
+
httpAgent: options.httpAgent,
|
|
73
|
+
maxRetries: options.maxRetries,
|
|
74
|
+
fetch: options.fetch,
|
|
75
|
+
});
|
|
76
|
+
_Honcho_instances.add(this);
|
|
77
|
+
this.workspaces = new API.Workspaces(this);
|
|
78
|
+
this.keys = new API.Keys(this);
|
|
79
|
+
this._options = options;
|
|
80
|
+
this.apiKey = apiKey;
|
|
81
|
+
}
|
|
82
|
+
defaultQuery() {
|
|
83
|
+
return this._options.defaultQuery;
|
|
84
|
+
}
|
|
85
|
+
defaultHeaders(opts) {
|
|
86
|
+
return {
|
|
87
|
+
...super.defaultHeaders(opts),
|
|
88
|
+
...this._options.defaultHeaders,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
authHeaders(opts) {
|
|
92
|
+
if (this.apiKey == null) {
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
95
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.Honcho = Honcho;
|
|
99
|
+
_a = Honcho, _Honcho_instances = new WeakSet(), _Honcho_baseURLOverridden = function _Honcho_baseURLOverridden() {
|
|
100
|
+
return this.baseURL !== environments[this._options.environment || 'demo'];
|
|
101
|
+
};
|
|
102
|
+
Honcho.Honcho = _a;
|
|
103
|
+
Honcho.DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
104
|
+
Honcho.HonchoError = Errors.HonchoError;
|
|
105
|
+
Honcho.APIError = Errors.APIError;
|
|
106
|
+
Honcho.APIConnectionError = Errors.APIConnectionError;
|
|
107
|
+
Honcho.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
108
|
+
Honcho.APIUserAbortError = Errors.APIUserAbortError;
|
|
109
|
+
Honcho.NotFoundError = Errors.NotFoundError;
|
|
110
|
+
Honcho.ConflictError = Errors.ConflictError;
|
|
111
|
+
Honcho.RateLimitError = Errors.RateLimitError;
|
|
112
|
+
Honcho.BadRequestError = Errors.BadRequestError;
|
|
113
|
+
Honcho.AuthenticationError = Errors.AuthenticationError;
|
|
114
|
+
Honcho.InternalServerError = Errors.InternalServerError;
|
|
115
|
+
Honcho.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
116
|
+
Honcho.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
117
|
+
Honcho.toFile = Uploads.toFile;
|
|
118
|
+
Honcho.fileFromPath = Uploads.fileFromPath;
|
|
119
|
+
Honcho.Workspaces = workspaces_1.Workspaces;
|
|
120
|
+
Honcho.WorkspacesPage = workspaces_1.WorkspacesPage;
|
|
121
|
+
Honcho.Keys = keys_1.Keys;
|
|
122
|
+
var uploads_1 = require("./uploads.js");
|
|
123
|
+
Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
|
|
124
|
+
Object.defineProperty(exports, "fileFromPath", { enumerable: true, get: function () { return uploads_1.fileFromPath; } });
|
|
125
|
+
var error_1 = require("./error.js");
|
|
126
|
+
Object.defineProperty(exports, "HonchoError", { enumerable: true, get: function () { return error_1.HonchoError; } });
|
|
127
|
+
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return error_1.APIError; } });
|
|
128
|
+
Object.defineProperty(exports, "APIConnectionError", { enumerable: true, get: function () { return error_1.APIConnectionError; } });
|
|
129
|
+
Object.defineProperty(exports, "APIConnectionTimeoutError", { enumerable: true, get: function () { return error_1.APIConnectionTimeoutError; } });
|
|
130
|
+
Object.defineProperty(exports, "APIUserAbortError", { enumerable: true, get: function () { return error_1.APIUserAbortError; } });
|
|
131
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return error_1.NotFoundError; } });
|
|
132
|
+
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return error_1.ConflictError; } });
|
|
133
|
+
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return error_1.RateLimitError; } });
|
|
134
|
+
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return error_1.BadRequestError; } });
|
|
135
|
+
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return error_1.AuthenticationError; } });
|
|
136
|
+
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
|
|
137
|
+
Object.defineProperty(exports, "PermissionDeniedError", { enumerable: true, get: function () { return error_1.PermissionDeniedError; } });
|
|
138
|
+
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
|
|
139
|
+
exports = module.exports = Honcho;
|
|
140
|
+
exports.default = Honcho;
|
|
141
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"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"}
|
package/index.mjs
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
var _Honcho_instances, _a, _Honcho_baseURLOverridden;
|
|
3
|
+
import * as Core from "./core.mjs";
|
|
4
|
+
import * as Errors from "./error.mjs";
|
|
5
|
+
import * as Pagination from "./pagination.mjs";
|
|
6
|
+
import * as Uploads from "./uploads.mjs";
|
|
7
|
+
import * as API from "./resources/index.mjs";
|
|
8
|
+
import { Keys } from "./resources/keys.mjs";
|
|
9
|
+
import { Workspaces, WorkspacesPage, } from "./resources/workspaces/workspaces.mjs";
|
|
10
|
+
const environments = {
|
|
11
|
+
demo: 'https://demo.honcho.dev',
|
|
12
|
+
local: 'http://localhost:8000',
|
|
13
|
+
production: 'https://api.honcho.dev',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* API Client for interfacing with the Honcho API.
|
|
17
|
+
*/
|
|
18
|
+
export class Honcho extends Core.APIClient {
|
|
19
|
+
/**
|
|
20
|
+
* API Client for interfacing with the Honcho API.
|
|
21
|
+
*
|
|
22
|
+
* @param {string | null | undefined} [opts.apiKey=process.env['HONCHO_API_KEY'] ?? null]
|
|
23
|
+
* @param {Environment} [opts.environment=demo] - Specifies the environment URL to use for the API.
|
|
24
|
+
* @param {string} [opts.baseURL=process.env['HONCHO_BASE_URL'] ?? https://demo.honcho.dev] - Override the default base URL for the API.
|
|
25
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
26
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
27
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
28
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
29
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
30
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
31
|
+
*/
|
|
32
|
+
constructor({ baseURL = Core.readEnv('HONCHO_BASE_URL'), apiKey = Core.readEnv('HONCHO_API_KEY') ?? null, ...opts } = {}) {
|
|
33
|
+
const options = {
|
|
34
|
+
apiKey,
|
|
35
|
+
...opts,
|
|
36
|
+
baseURL,
|
|
37
|
+
environment: opts.environment ?? 'demo',
|
|
38
|
+
};
|
|
39
|
+
if (baseURL && opts.environment) {
|
|
40
|
+
throw new Errors.HonchoError('Ambiguous URL; The `baseURL` option (or HONCHO_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null');
|
|
41
|
+
}
|
|
42
|
+
super({
|
|
43
|
+
baseURL: options.baseURL || environments[options.environment || 'demo'],
|
|
44
|
+
baseURLOverridden: baseURL ? baseURL !== environments[options.environment || 'demo'] : false,
|
|
45
|
+
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
46
|
+
httpAgent: options.httpAgent,
|
|
47
|
+
maxRetries: options.maxRetries,
|
|
48
|
+
fetch: options.fetch,
|
|
49
|
+
});
|
|
50
|
+
_Honcho_instances.add(this);
|
|
51
|
+
this.workspaces = new API.Workspaces(this);
|
|
52
|
+
this.keys = new API.Keys(this);
|
|
53
|
+
this._options = options;
|
|
54
|
+
this.apiKey = apiKey;
|
|
55
|
+
}
|
|
56
|
+
defaultQuery() {
|
|
57
|
+
return this._options.defaultQuery;
|
|
58
|
+
}
|
|
59
|
+
defaultHeaders(opts) {
|
|
60
|
+
return {
|
|
61
|
+
...super.defaultHeaders(opts),
|
|
62
|
+
...this._options.defaultHeaders,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
authHeaders(opts) {
|
|
66
|
+
if (this.apiKey == null) {
|
|
67
|
+
return {};
|
|
68
|
+
}
|
|
69
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
_a = Honcho, _Honcho_instances = new WeakSet(), _Honcho_baseURLOverridden = function _Honcho_baseURLOverridden() {
|
|
73
|
+
return this.baseURL !== environments[this._options.environment || 'demo'];
|
|
74
|
+
};
|
|
75
|
+
Honcho.Honcho = _a;
|
|
76
|
+
Honcho.DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
77
|
+
Honcho.HonchoError = Errors.HonchoError;
|
|
78
|
+
Honcho.APIError = Errors.APIError;
|
|
79
|
+
Honcho.APIConnectionError = Errors.APIConnectionError;
|
|
80
|
+
Honcho.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
81
|
+
Honcho.APIUserAbortError = Errors.APIUserAbortError;
|
|
82
|
+
Honcho.NotFoundError = Errors.NotFoundError;
|
|
83
|
+
Honcho.ConflictError = Errors.ConflictError;
|
|
84
|
+
Honcho.RateLimitError = Errors.RateLimitError;
|
|
85
|
+
Honcho.BadRequestError = Errors.BadRequestError;
|
|
86
|
+
Honcho.AuthenticationError = Errors.AuthenticationError;
|
|
87
|
+
Honcho.InternalServerError = Errors.InternalServerError;
|
|
88
|
+
Honcho.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
89
|
+
Honcho.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
90
|
+
Honcho.toFile = Uploads.toFile;
|
|
91
|
+
Honcho.fileFromPath = Uploads.fileFromPath;
|
|
92
|
+
Honcho.Workspaces = Workspaces;
|
|
93
|
+
Honcho.WorkspacesPage = WorkspacesPage;
|
|
94
|
+
Honcho.Keys = Keys;
|
|
95
|
+
export { toFile, fileFromPath } from "./uploads.mjs";
|
|
96
|
+
export { HonchoError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
|
|
97
|
+
export default Honcho;
|
|
98
|
+
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@honcho-ai/core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The official TypeScript library for the Honcho API",
|
|
5
|
+
"author": "Honcho <hello@plasticlabs.ai>",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"type": "commonjs",
|
|
9
|
+
"repository": "github:plastic-labs/honcho-node-core",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"packageManager": "yarn@1.22.22",
|
|
12
|
+
"files": [
|
|
13
|
+
"**/*"
|
|
14
|
+
],
|
|
15
|
+
"private": false,
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "./scripts/test",
|
|
18
|
+
"build": "./scripts/build",
|
|
19
|
+
"format": "prettier --write --cache --cache-strategy metadata . !dist",
|
|
20
|
+
"tsn": "ts-node -r tsconfig-paths/register",
|
|
21
|
+
"lint": "./scripts/lint",
|
|
22
|
+
"fix": "./scripts/format"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@types/node": "^18.11.18",
|
|
26
|
+
"@types/node-fetch": "^2.6.4",
|
|
27
|
+
"abort-controller": "^3.0.0",
|
|
28
|
+
"agentkeepalive": "^4.2.1",
|
|
29
|
+
"form-data-encoder": "1.7.2",
|
|
30
|
+
"formdata-node": "^4.3.2",
|
|
31
|
+
"node-fetch": "^2.6.7"
|
|
32
|
+
},
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"./_shims/index.js",
|
|
35
|
+
"./_shims/index.mjs",
|
|
36
|
+
"./shims/node.js",
|
|
37
|
+
"./shims/node.mjs",
|
|
38
|
+
"./shims/web.js",
|
|
39
|
+
"./shims/web.mjs"
|
|
40
|
+
],
|
|
41
|
+
"imports": {
|
|
42
|
+
"@honcho-ai/core": ".",
|
|
43
|
+
"@honcho-ai/core/*": "./src/*"
|
|
44
|
+
},
|
|
45
|
+
"exports": {
|
|
46
|
+
"./_shims/auto/*": {
|
|
47
|
+
"deno": {
|
|
48
|
+
"types": "./_shims/auto/*.d.ts",
|
|
49
|
+
"require": "./_shims/auto/*.js",
|
|
50
|
+
"default": "./_shims/auto/*.mjs"
|
|
51
|
+
},
|
|
52
|
+
"bun": {
|
|
53
|
+
"types": "./_shims/auto/*.d.ts",
|
|
54
|
+
"require": "./_shims/auto/*-bun.js",
|
|
55
|
+
"default": "./_shims/auto/*-bun.mjs"
|
|
56
|
+
},
|
|
57
|
+
"browser": {
|
|
58
|
+
"types": "./_shims/auto/*.d.ts",
|
|
59
|
+
"require": "./_shims/auto/*.js",
|
|
60
|
+
"default": "./_shims/auto/*.mjs"
|
|
61
|
+
},
|
|
62
|
+
"worker": {
|
|
63
|
+
"types": "./_shims/auto/*.d.ts",
|
|
64
|
+
"require": "./_shims/auto/*.js",
|
|
65
|
+
"default": "./_shims/auto/*.mjs"
|
|
66
|
+
},
|
|
67
|
+
"workerd": {
|
|
68
|
+
"types": "./_shims/auto/*.d.ts",
|
|
69
|
+
"require": "./_shims/auto/*.js",
|
|
70
|
+
"default": "./_shims/auto/*.mjs"
|
|
71
|
+
},
|
|
72
|
+
"node": {
|
|
73
|
+
"types": "./_shims/auto/*-node.d.ts",
|
|
74
|
+
"require": "./_shims/auto/*-node.js",
|
|
75
|
+
"default": "./_shims/auto/*-node.mjs"
|
|
76
|
+
},
|
|
77
|
+
"types": "./_shims/auto/*.d.ts",
|
|
78
|
+
"require": "./_shims/auto/*.js",
|
|
79
|
+
"default": "./_shims/auto/*.mjs"
|
|
80
|
+
},
|
|
81
|
+
".": {
|
|
82
|
+
"require": {
|
|
83
|
+
"types": "./index.d.ts",
|
|
84
|
+
"default": "./index.js"
|
|
85
|
+
},
|
|
86
|
+
"types": "./index.d.mts",
|
|
87
|
+
"default": "./index.mjs"
|
|
88
|
+
},
|
|
89
|
+
"./*.mjs": {
|
|
90
|
+
"types": "./*.d.ts",
|
|
91
|
+
"default": "./*.mjs"
|
|
92
|
+
},
|
|
93
|
+
"./*.js": {
|
|
94
|
+
"types": "./*.d.ts",
|
|
95
|
+
"default": "./*.js"
|
|
96
|
+
},
|
|
97
|
+
"./*": {
|
|
98
|
+
"types": "./*.d.ts",
|
|
99
|
+
"require": "./*.js",
|
|
100
|
+
"default": "./*.mjs"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
package/pagination.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from "./core.js";
|
|
2
|
+
export interface PageResponse<Item> {
|
|
3
|
+
total: number;
|
|
4
|
+
items: Array<Item>;
|
|
5
|
+
page: number;
|
|
6
|
+
size: number;
|
|
7
|
+
pages: number;
|
|
8
|
+
}
|
|
9
|
+
export interface PageParams {
|
|
10
|
+
/**
|
|
11
|
+
* The page number
|
|
12
|
+
*/
|
|
13
|
+
page?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The number of items in a page
|
|
16
|
+
*/
|
|
17
|
+
size?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class Page<Item> extends AbstractPage<Item> implements PageResponse<Item> {
|
|
20
|
+
total: number;
|
|
21
|
+
items: Array<Item>;
|
|
22
|
+
page: number;
|
|
23
|
+
size: number;
|
|
24
|
+
pages: number;
|
|
25
|
+
constructor(client: APIClient, response: Response, body: PageResponse<Item>, options: FinalRequestOptions);
|
|
26
|
+
getPaginatedItems(): Item[];
|
|
27
|
+
nextPageParams(): Partial<PageParams> | null;
|
|
28
|
+
nextPageInfo(): PageInfo | null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE1F,MAAM,WAAW,YAAY,CAAC,IAAI;IAChC,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,IAAI,CAAC,IAAI,CAAE,SAAQ,YAAY,CAAC,IAAI,CAAE,YAAW,YAAY,CAAC,IAAI,CAAC;IAC9E,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;gBAEF,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,mBAAmB;IAUzG,iBAAiB,IAAI,IAAI,EAAE;IAK3B,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI;IAS5C,YAAY,IAAI,QAAQ,GAAG,IAAI;CAShC"}
|
package/pagination.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Page = void 0;
|
|
5
|
+
const core_1 = require("./core.js");
|
|
6
|
+
class Page extends core_1.AbstractPage {
|
|
7
|
+
constructor(client, response, body, options) {
|
|
8
|
+
super(client, response, body, options);
|
|
9
|
+
this.total = body.total || 0;
|
|
10
|
+
this.items = body.items || [];
|
|
11
|
+
this.page = body.page || 0;
|
|
12
|
+
this.size = body.size || 0;
|
|
13
|
+
this.pages = body.pages || 0;
|
|
14
|
+
}
|
|
15
|
+
getPaginatedItems() {
|
|
16
|
+
return this.items ?? [];
|
|
17
|
+
}
|
|
18
|
+
// @deprecated Please use `nextPageInfo()` instead
|
|
19
|
+
nextPageParams() {
|
|
20
|
+
const info = this.nextPageInfo();
|
|
21
|
+
if (!info)
|
|
22
|
+
return null;
|
|
23
|
+
if ('params' in info)
|
|
24
|
+
return info.params;
|
|
25
|
+
const params = Object.fromEntries(info.url.searchParams);
|
|
26
|
+
if (!Object.keys(params).length)
|
|
27
|
+
return null;
|
|
28
|
+
return params;
|
|
29
|
+
}
|
|
30
|
+
nextPageInfo() {
|
|
31
|
+
const currentPage = this.page;
|
|
32
|
+
if (currentPage >= this.pages) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return { params: { page: currentPage + 1 } };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.Page = Page;
|
|
39
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAA0F;AA0B1F,MAAa,IAAW,SAAQ,mBAAkB;IAWhD,YAAY,MAAiB,EAAE,QAAkB,EAAE,IAAwB,EAAE,OAA4B;QACvG,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAEvC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED,kDAAkD;IAClD,cAAc;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,IAAI,QAAQ,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,YAAY;QACV,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC;QAE9B,IAAI,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE;YAC7B,OAAO,IAAI,CAAC;SACb;QAED,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,GAAG,CAAC,EAAE,EAAE,CAAC;IAC/C,CAAC;CACF;AA5CD,oBA4CC"}
|
package/pagination.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { AbstractPage } from "./core.mjs";
|
|
3
|
+
export class Page extends AbstractPage {
|
|
4
|
+
constructor(client, response, body, options) {
|
|
5
|
+
super(client, response, body, options);
|
|
6
|
+
this.total = body.total || 0;
|
|
7
|
+
this.items = body.items || [];
|
|
8
|
+
this.page = body.page || 0;
|
|
9
|
+
this.size = body.size || 0;
|
|
10
|
+
this.pages = body.pages || 0;
|
|
11
|
+
}
|
|
12
|
+
getPaginatedItems() {
|
|
13
|
+
return this.items ?? [];
|
|
14
|
+
}
|
|
15
|
+
// @deprecated Please use `nextPageInfo()` instead
|
|
16
|
+
nextPageParams() {
|
|
17
|
+
const info = this.nextPageInfo();
|
|
18
|
+
if (!info)
|
|
19
|
+
return null;
|
|
20
|
+
if ('params' in info)
|
|
21
|
+
return info.params;
|
|
22
|
+
const params = Object.fromEntries(info.url.searchParams);
|
|
23
|
+
if (!Object.keys(params).length)
|
|
24
|
+
return null;
|
|
25
|
+
return params;
|
|
26
|
+
}
|
|
27
|
+
nextPageInfo() {
|
|
28
|
+
const currentPage = this.page;
|
|
29
|
+
if (currentPage >= this.pages) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return { params: { page: currentPage + 1 } };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=pagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.mjs","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,YAAY,EAAsD;AA0B3E,MAAM,OAAO,IAAW,SAAQ,YAAkB;IAWhD,YAAY,MAAiB,EAAE,QAAkB,EAAE,IAAwB,EAAE,OAA4B;QACvG,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAEvC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED,kDAAkD;IAClD,cAAc;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,IAAI,QAAQ,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,YAAY;QACV,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC;QAE9B,IAAI,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE;YAC7B,OAAO,IAAI,CAAC;SACb;QAED,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,GAAG,CAAC,EAAE,EAAE,CAAC;IAC/C,CAAC;CACF"}
|
package/resource.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,8BAAsB,WAAW;IAC/B,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEd,MAAM,EAAE,MAAM;CAG3B"}
|
package/resource.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.APIResource = void 0;
|
|
5
|
+
class APIResource {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this._client = client;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.APIResource = APIResource;
|
|
11
|
+
//# sourceMappingURL=resource.js.map
|
package/resource.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAItF,MAAsB,WAAW;IAG/B,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF;AAND,kCAMC"}
|
package/resource.mjs
ADDED
package/resource.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,MAAM,OAAgB,WAAW;IAG/B,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Keys, type KeyCreateResponse, type KeyCreateParams } from "./keys.js";
|
|
2
|
+
export { WorkspacesPage, Workspaces, type Workspace, type WorkspaceUpdateParams, type WorkspaceListParams, type WorkspaceGetOrCreateParams, type WorkspaceSearchParams, } from "./workspaces/workspaces.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,UAAU,EACV,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Workspaces = exports.WorkspacesPage = exports.Keys = void 0;
|
|
5
|
+
var keys_1 = require("./keys.js");
|
|
6
|
+
Object.defineProperty(exports, "Keys", { enumerable: true, get: function () { return keys_1.Keys; } });
|
|
7
|
+
var workspaces_1 = require("./workspaces/workspaces.js");
|
|
8
|
+
Object.defineProperty(exports, "WorkspacesPage", { enumerable: true, get: function () { return workspaces_1.WorkspacesPage; } });
|
|
9
|
+
Object.defineProperty(exports, "Workspaces", { enumerable: true, get: function () { return workspaces_1.Workspaces; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA4E;AAAnE,4FAAA,IAAI,OAAA;AACb,yDAQiC;AAP/B,4GAAA,cAAc,OAAA;AACd,wGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAgD;OACtD,EACL,cAAc,EACd,UAAU,GAMX"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { APIResource } from "../resource.js";
|
|
2
|
+
import * as Core from "../core.js";
|
|
3
|
+
export declare class Keys extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Create a new Key
|
|
6
|
+
*/
|
|
7
|
+
create(params?: KeyCreateParams, options?: Core.RequestOptions): Core.APIPromise<unknown>;
|
|
8
|
+
create(options?: Core.RequestOptions): Core.APIPromise<unknown>;
|
|
9
|
+
}
|
|
10
|
+
export type KeyCreateResponse = unknown;
|
|
11
|
+
export interface KeyCreateParams {
|
|
12
|
+
expires_at?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* ID of the peer to scope the key to
|
|
15
|
+
*/
|
|
16
|
+
peer_id?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* ID of the session to scope the key to
|
|
19
|
+
*/
|
|
20
|
+
session_id?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* ID of the workspace to scope the key to
|
|
23
|
+
*/
|
|
24
|
+
workspace_id?: string | null;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace Keys {
|
|
27
|
+
export { type KeyCreateResponse as KeyCreateResponse, type KeyCreateParams as KeyCreateParams };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/resources/keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IACzF,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;CAchE;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAExC,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,KAAK,eAAe,IAAI,eAAe,EAAE,CAAC;CACjG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Keys = void 0;
|
|
5
|
+
const resource_1 = require("../resource.js");
|
|
6
|
+
const core_1 = require("../core.js");
|
|
7
|
+
class Keys extends resource_1.APIResource {
|
|
8
|
+
create(params = {}, options) {
|
|
9
|
+
if ((0, core_1.isRequestOptions)(params)) {
|
|
10
|
+
return this.create({}, params);
|
|
11
|
+
}
|
|
12
|
+
const { expires_at, peer_id, session_id, workspace_id } = params;
|
|
13
|
+
return this._client.post('/v1/keys', {
|
|
14
|
+
query: { expires_at, peer_id, session_id, workspace_id },
|
|
15
|
+
...options,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.Keys = Keys;
|
|
20
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/resources/keys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAG3C,MAAa,IAAK,SAAQ,sBAAW;IAMnC,MAAM,CACJ,SAAgD,EAAE,EAClD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,MAAM,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;SAChC;QACD,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE;YACnC,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE;YACxD,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,oBAmBC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../resource.mjs";
|
|
3
|
+
import { isRequestOptions } from "../core.mjs";
|
|
4
|
+
export class Keys extends APIResource {
|
|
5
|
+
create(params = {}, options) {
|
|
6
|
+
if (isRequestOptions(params)) {
|
|
7
|
+
return this.create({}, params);
|
|
8
|
+
}
|
|
9
|
+
const { expires_at, peer_id, session_id, workspace_id } = params;
|
|
10
|
+
return this._client.post('/v1/keys', {
|
|
11
|
+
query: { expires_at, peer_id, session_id, workspace_id },
|
|
12
|
+
...options,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=keys.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.mjs","sourceRoot":"","sources":["../src/resources/keys.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;AAG3B,MAAM,OAAO,IAAK,SAAQ,WAAW;IAMnC,MAAM,CACJ,SAAgD,EAAE,EAClD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;SAChC;QACD,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE;YACnC,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE;YACxD,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { PeersPage, Peers, type PageSession, type Peer, type SessionGet, type PeerChatResponse, type PeerWorkingRepresentationResponse, type PeerUpdateParams, type PeerListParams, type PeerChatParams, type PeerGetOrCreateParams, type PeerSearchParams, type PeerWorkingRepresentationParams, } from "./peers/index.js";
|
|
2
|
+
export { SessionsPage, Sessions, type Session, type SessionDeleteResponse, type SessionGetContextResponse, type SessionUpdateParams, type SessionListParams, type SessionCloneParams, type SessionGetContextParams, type SessionGetOrCreateParams, type SessionSearchParams, } from "./sessions/index.js";
|
|
3
|
+
export { WorkspacesPage, Workspaces, type Workspace, type WorkspaceUpdateParams, type WorkspaceListParams, type WorkspaceGetOrCreateParams, type WorkspaceSearchParams, } from "./workspaces.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|