@forumulate/sdk 0.1.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/LICENSE +21 -0
- package/README.md +114 -0
- package/dist/index.d.ts +320 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +256 -0
- package/dist/index.js.map +1 -0
- package/dist/schema.d.ts +86204 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +7 -0
- package/dist/schema.js.map +1 -0
- package/dist/typed.d.ts +121 -0
- package/dist/typed.d.ts.map +1 -0
- package/dist/typed.js +14 -0
- package/dist/typed.js.map +1 -0
- package/dist/types.d.ts +179 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/webhooks.d.ts +78 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +65 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +51 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ForumulateClient = exports.ForumulateError = exports.verifyWebhookSignature = void 0;
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
var webhooks_1 = require("./webhooks");
|
|
20
|
+
Object.defineProperty(exports, "verifyWebhookSignature", { enumerable: true, get: function () { return webhooks_1.verifyWebhookSignature; } });
|
|
21
|
+
/** Thrown for any non-2xx API response. Mirrors the API's error envelope. */
|
|
22
|
+
class ForumulateError extends Error {
|
|
23
|
+
status;
|
|
24
|
+
code;
|
|
25
|
+
constructor(status, code, message) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.status = status;
|
|
28
|
+
this.code = code;
|
|
29
|
+
this.name = 'ForumulateError';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ForumulateError = ForumulateError;
|
|
33
|
+
/**
|
|
34
|
+
* Typed client for the Forumulate REST API.
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* const forumulate = new ForumulateClient({ baseUrl: 'http://localhost:4000', token: pat });
|
|
38
|
+
* const { organizations } = await forumulate.orgs.list();
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
class ForumulateClient {
|
|
42
|
+
baseUrl;
|
|
43
|
+
token;
|
|
44
|
+
credentials;
|
|
45
|
+
_fetch;
|
|
46
|
+
constructor(opts) {
|
|
47
|
+
this.baseUrl = opts.baseUrl.replace(/\/$/, '');
|
|
48
|
+
this.token = opts.token;
|
|
49
|
+
this.credentials = opts.credentials ?? false;
|
|
50
|
+
const f = opts.fetch ?? globalThis.fetch;
|
|
51
|
+
if (!f)
|
|
52
|
+
throw new Error('No fetch implementation available — pass one via options.fetch.');
|
|
53
|
+
this._fetch = f;
|
|
54
|
+
}
|
|
55
|
+
/** Low-level request. Exposed so callers can reach endpoints the typed helpers don't cover yet. */
|
|
56
|
+
async request(method, path, opts = {}) {
|
|
57
|
+
const url = new URL(this.baseUrl + path);
|
|
58
|
+
for (const [k, v] of Object.entries(opts.query ?? {})) {
|
|
59
|
+
if (v !== undefined)
|
|
60
|
+
url.searchParams.set(k, String(v));
|
|
61
|
+
}
|
|
62
|
+
const headers = {};
|
|
63
|
+
if (this.token)
|
|
64
|
+
headers.Authorization = `Bearer ${this.token}`;
|
|
65
|
+
if (opts.body !== undefined)
|
|
66
|
+
headers['Content-Type'] = 'application/json';
|
|
67
|
+
const res = await this._fetch(url.toString(), {
|
|
68
|
+
method,
|
|
69
|
+
headers,
|
|
70
|
+
credentials: this.credentials ? 'include' : 'same-origin',
|
|
71
|
+
body: opts.body !== undefined ? JSON.stringify(opts.body) : undefined,
|
|
72
|
+
});
|
|
73
|
+
if (opts.raw) {
|
|
74
|
+
if (!res.ok)
|
|
75
|
+
throw await this.toError(res);
|
|
76
|
+
return res;
|
|
77
|
+
}
|
|
78
|
+
const text = await res.text();
|
|
79
|
+
const json = text ? JSON.parse(text) : undefined;
|
|
80
|
+
if (!res.ok) {
|
|
81
|
+
const err = (json?.error ?? {});
|
|
82
|
+
throw new ForumulateError(res.status, err.code ?? 'error', err.message ?? res.statusText);
|
|
83
|
+
}
|
|
84
|
+
return json;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Fully-typed request against ANY endpoint in the OpenAPI spec.
|
|
88
|
+
*
|
|
89
|
+
* Where the ~30 hand-written helpers above cover the stable, ergonomic
|
|
90
|
+
* surface, `typed` covers the *whole* API: the generated `paths` interface
|
|
91
|
+
* (`src/schema.ts`, produced from `openapi.json`) infers the path params,
|
|
92
|
+
* query params, JSON body and success response for the `(method, path)` you
|
|
93
|
+
* pass, so every one of the 600+ routes gets types and autocomplete without a
|
|
94
|
+
* bespoke wrapper. Path templates like `/orgs/{orgId}/spaces` are filled from
|
|
95
|
+
* `init.params`.
|
|
96
|
+
*
|
|
97
|
+
* ```ts
|
|
98
|
+
* // GET a list — path param is required and checked; response is typed.
|
|
99
|
+
* const { spaces } = await forumulate.typed('get', '/orgs/{orgId}/spaces', {
|
|
100
|
+
* params: { orgId }, query: { deleted: 'false', limit: '50', cursor: '' },
|
|
101
|
+
* });
|
|
102
|
+
*
|
|
103
|
+
* // POST with a body the spec knows the shape of.
|
|
104
|
+
* await forumulate.typed('post', '/orgs/{orgId}/spaces', {
|
|
105
|
+
* params: { orgId },
|
|
106
|
+
* body: { name: 'Docs', slug: 'docs', type: 'DOCS', visibility: 'PUBLIC' },
|
|
107
|
+
* });
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* Regenerate the types after an API change with
|
|
111
|
+
* `pnpm --filter @forumulate/sdk dump-spec` then
|
|
112
|
+
* `npx openapi-typescript packages/sdk/openapi.json -o src/schema.ts`.
|
|
113
|
+
*/
|
|
114
|
+
typed(method, path, init) {
|
|
115
|
+
const opts = (init ?? {});
|
|
116
|
+
let concrete = path;
|
|
117
|
+
if (opts.params) {
|
|
118
|
+
for (const [k, v] of Object.entries(opts.params)) {
|
|
119
|
+
concrete = concrete.replace(`{${k}}`, encodeURIComponent(String(v)));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return this.request(String(method).toUpperCase(), concrete, {
|
|
123
|
+
body: opts.body,
|
|
124
|
+
query: opts.query,
|
|
125
|
+
raw: opts.raw,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async toError(res) {
|
|
129
|
+
let code = 'error';
|
|
130
|
+
let message = res.statusText;
|
|
131
|
+
try {
|
|
132
|
+
const j = await res.json();
|
|
133
|
+
code = j?.error?.code ?? code;
|
|
134
|
+
message = j?.error?.message ?? message;
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
/* non-JSON body */
|
|
138
|
+
}
|
|
139
|
+
return new ForumulateError(res.status, code, message);
|
|
140
|
+
}
|
|
141
|
+
// ── Identity ──────────────────────────────────────────────────────────────
|
|
142
|
+
auth = {
|
|
143
|
+
register: (input) => this.request('POST', '/auth/register', { body: input }),
|
|
144
|
+
login: (input) => this.request('POST', '/auth/login', { body: input }),
|
|
145
|
+
me: () => this.request('GET', '/auth/me'),
|
|
146
|
+
/** Mint a Personal Access Token (requires an authenticated session). */
|
|
147
|
+
createToken: (input) => this.request('POST', '/pats', { body: input }),
|
|
148
|
+
};
|
|
149
|
+
// ── Organizations ─────────────────────────────────────────────────────────
|
|
150
|
+
orgs = {
|
|
151
|
+
list: () => this.request('GET', '/orgs'),
|
|
152
|
+
create: (input) => this.request('POST', '/orgs', { body: input }),
|
|
153
|
+
};
|
|
154
|
+
// ── Spaces & content ───────────────────────────────────────────────────────
|
|
155
|
+
spaces = {
|
|
156
|
+
list: (orgId) => this.request('GET', `/orgs/${orgId}/spaces`),
|
|
157
|
+
create: (orgId, input) => this.request('POST', `/orgs/${orgId}/spaces`, { body: input }),
|
|
158
|
+
createCollection: (orgId, spaceId, input) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/collections`, { body: input }),
|
|
159
|
+
createPage: (orgId, spaceId, collectionId, input) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/collections/${collectionId}/pages`, { body: input }),
|
|
160
|
+
setPageContent: (orgId, spaceId, pageId, input) => this.request('PUT', `/orgs/${orgId}/spaces/${spaceId}/pages/${pageId}/content`, { body: input }),
|
|
161
|
+
publishPage: (orgId, spaceId, pageId) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/pages/${pageId}/publish`, { body: {} }),
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Shapes and pieces — the surface an agent works through.
|
|
165
|
+
*
|
|
166
|
+
* `shape` says what one piece of a space is made of and hands back JSON
|
|
167
|
+
* Schema; `items` writes one, whatever a piece happens to be in that space:
|
|
168
|
+
* a documentation page, a blog post, a release, an incident. The reply says
|
|
169
|
+
* which required sections are still empty, so an agent can create a piece,
|
|
170
|
+
* ask what it forgot, and close the gap.
|
|
171
|
+
*/
|
|
172
|
+
shapes = {
|
|
173
|
+
get: (orgId, spaceId) => this.request('GET', `/orgs/${orgId}/spaces/${spaceId}/shape`),
|
|
174
|
+
set: (orgId, spaceId, patch) => this.request('PUT', `/orgs/${orgId}/spaces/${spaceId}/shape`, { body: patch }),
|
|
175
|
+
applyPreset: (orgId, spaceId, name) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/shape/presets/${name}`, {
|
|
176
|
+
body: {},
|
|
177
|
+
}),
|
|
178
|
+
};
|
|
179
|
+
items = {
|
|
180
|
+
create: (orgId, spaceId, input) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/items`, { body: input }),
|
|
181
|
+
/**
|
|
182
|
+
* What is in a space: how something finds a piece it has no words for.
|
|
183
|
+
*
|
|
184
|
+
* Pass `include: ['body']` to get content. Asking for `sections` ALONE is
|
|
185
|
+
* the trap: it is populated only for pieces written against a shape, so a
|
|
186
|
+
* space of free-form pages answers with empty objects and a sync carries
|
|
187
|
+
* nothing while reporting success. Every row says which field holds its
|
|
188
|
+
* content in `contentIn`.
|
|
189
|
+
*
|
|
190
|
+
* Any option here puts the response in its paged form, so `page` and
|
|
191
|
+
* `sync` come back — `page.total` is what a walk should check its own
|
|
192
|
+
* count against, and `sync.checkpoint` is what an incremental sync stores.
|
|
193
|
+
*/
|
|
194
|
+
list: (orgId, spaceId, opts = {}) => {
|
|
195
|
+
// A bare number used to be the whole signature; keep it working.
|
|
196
|
+
const o = typeof opts === 'number' ? { limit: opts } : opts;
|
|
197
|
+
const query = {};
|
|
198
|
+
if (o.limit)
|
|
199
|
+
query.limit = o.limit;
|
|
200
|
+
if (o.include?.length)
|
|
201
|
+
query.include = o.include.join(',');
|
|
202
|
+
if (o.cursor)
|
|
203
|
+
query.cursor = o.cursor;
|
|
204
|
+
if (o.updatedSince)
|
|
205
|
+
query.updated_since = o.updatedSince;
|
|
206
|
+
if (o.includeDeleted)
|
|
207
|
+
query.include_deleted = 'true';
|
|
208
|
+
if (o.fields?.length)
|
|
209
|
+
query.fields = o.fields.join(',');
|
|
210
|
+
return this.request('GET', `/orgs/${orgId}/spaces/${spaceId}/items`, { query });
|
|
211
|
+
},
|
|
212
|
+
get: (orgId, spaceId, itemId) => this.request('GET', `/orgs/${orgId}/spaces/${spaceId}/items/${itemId}`),
|
|
213
|
+
/** Make it readable. Kinds that are live on creation say so and change nothing. */
|
|
214
|
+
publish: (orgId, spaceId, itemId) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/items/${itemId}/publish`, { body: {} }),
|
|
215
|
+
/** Replace one named section. Idempotent — sending it twice writes it once. */
|
|
216
|
+
setSection: (orgId, spaceId, itemId, key, markdown) => this.request('PUT', `/orgs/${orgId}/spaces/${spaceId}/items/${itemId}/sections/${key}`, { body: { markdown } }),
|
|
217
|
+
};
|
|
218
|
+
// ── Webhooks ───────────────────────────────────────────────────────────────
|
|
219
|
+
webhooks = {
|
|
220
|
+
list: (orgId) => this.request('GET', `/orgs/${orgId}/webhooks`),
|
|
221
|
+
create: (orgId, input) => this.request('POST', `/orgs/${orgId}/webhooks`, { body: input }),
|
|
222
|
+
};
|
|
223
|
+
// ── Space snapshots (version history) ───────────────────────────────────────
|
|
224
|
+
snapshots = {
|
|
225
|
+
list: (orgId, spaceId) => this.request('GET', `/orgs/${orgId}/spaces/${spaceId}/snapshots`),
|
|
226
|
+
create: (orgId, spaceId, label) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/snapshots`, { body: { label } }),
|
|
227
|
+
restore: (orgId, spaceId, id) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/snapshots/${id}/restore`, { body: {} }),
|
|
228
|
+
};
|
|
229
|
+
// ── Community (forum topics) ────────────────────────────────────────────────
|
|
230
|
+
forum = {
|
|
231
|
+
listTopics: (orgId, spaceId, query = {}) => this.request('GET', `/orgs/${orgId}/spaces/${spaceId}/forum`, { query }),
|
|
232
|
+
createTopic: (orgId, spaceId, input) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/forum`, { body: input }),
|
|
233
|
+
reply: (orgId, spaceId, topicId, content) => this.request('POST', `/orgs/${orgId}/spaces/${spaceId}/forum/${topicId}/replies`, { body: { content } }),
|
|
234
|
+
};
|
|
235
|
+
// ── Search & analytics (org-level) ──────────────────────────────────────────
|
|
236
|
+
search = {
|
|
237
|
+
unified: (orgId, q, opts = {}) => this.request('GET', `/orgs/${orgId}/search`, { query: { q, ...opts } }),
|
|
238
|
+
};
|
|
239
|
+
analytics = {
|
|
240
|
+
orgEvents: (orgId, days) => this.request('GET', `/orgs/${orgId}/analytics/events`, { query: days ? { days } : {} }),
|
|
241
|
+
};
|
|
242
|
+
// ── Public reader (no auth required) ────────────────────────────────────────
|
|
243
|
+
public = {
|
|
244
|
+
getPage: (orgId, spaceId, pageId) => this.request('GET', `/public/orgs/${orgId}/spaces/${spaceId}/pages/${pageId}`),
|
|
245
|
+
search: (orgId, spaceId, query) => this.request('GET', `/public/orgs/${orgId}/spaces/${spaceId}/search`, {
|
|
246
|
+
query: { q: query },
|
|
247
|
+
}),
|
|
248
|
+
listComments: (orgId, spaceId, pageId) => this.request('GET', `/public/orgs/${orgId}/spaces/${spaceId}/pages/${pageId}/comments`),
|
|
249
|
+
postComment: (orgId, spaceId, pageId, input) => this.request('POST', `/public/orgs/${orgId}/spaces/${spaceId}/pages/${pageId}/comments`, { body: input }),
|
|
250
|
+
reactToComment: (orgId, spaceId, commentId, emoji) => this.request('POST', `/public/orgs/${orgId}/spaces/${spaceId}/comments/${commentId}/react`, { body: { emoji } }),
|
|
251
|
+
/** Download the whole space as a PDF. Returns the raw `Response` (read `.blob()` / `.arrayBuffer()`). */
|
|
252
|
+
pdf: (orgId, spaceId) => this.request('GET', `/public/orgs/${orgId}/spaces/${spaceId}/pdf`, { raw: true }),
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
exports.ForumulateClient = ForumulateClient;
|
|
256
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,uCAA6E;AAApE,kHAAA,sBAAsB,OAAA;AAgC/B,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