@bundleup/sdk 0.0.18 → 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 +898 -148
- package/dist/index.d.mts +221 -105
- package/dist/index.d.ts +221 -105
- package/dist/index.js +346 -238
- package/dist/index.mjs +346 -238
- package/package.json +31 -10
- package/dist/chunk-B6T6V2FR.mjs +0 -24
- package/dist/chunk-GKEHPYLJ.mjs +0 -17
- package/dist/chunk-U6VVRHFA.mjs +0 -17
- package/dist/client.d.mts +0 -8
- package/dist/client.d.ts +0 -8
- package/dist/client.js +0 -119
- package/dist/client.mjs +0 -84
- package/dist/server.d.mts +0 -21
- package/dist/server.d.ts +0 -21
- package/dist/server.js +0 -94
- package/dist/server.mjs +0 -61
- package/dist/utils.d.mts +0 -5
- package/dist/utils.d.ts +0 -5
- package/dist/utils.js +0 -50
- package/dist/utils.mjs +0 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,86 +1,3 @@
|
|
|
1
|
-
declare abstract class Base$1<T> {
|
|
2
|
-
private apiKey;
|
|
3
|
-
protected abstract namespace: string;
|
|
4
|
-
private baseUrl;
|
|
5
|
-
private version;
|
|
6
|
-
constructor(apiKey: string);
|
|
7
|
-
protected buildUrl(path?: string | null, searchParams?: Record<string, string>): URL;
|
|
8
|
-
protected get headers(): Record<string, string>;
|
|
9
|
-
/**
|
|
10
|
-
* List resources with optional query parameters.
|
|
11
|
-
* @param searchParams - Query parameters for filtering the list.
|
|
12
|
-
* @returns A promise that resolves to an array of resources.
|
|
13
|
-
* @throws If params is not an object or if the fetch request fails.
|
|
14
|
-
*/
|
|
15
|
-
list<K extends Record<string, string>>(searchParams?: K): Promise<T[]>;
|
|
16
|
-
/**
|
|
17
|
-
* Create a new resource.
|
|
18
|
-
* @param body - The request body containing resource details.
|
|
19
|
-
* @returns A promise that resolves to the created resource.
|
|
20
|
-
* @throws If body is not an object or if the fetch request fails.
|
|
21
|
-
*/
|
|
22
|
-
create<K extends Record<string, unknown>>(body: K): Promise<T>;
|
|
23
|
-
/**
|
|
24
|
-
* Retrieve a specific resource by ID.
|
|
25
|
-
* @param id - The ID of the resource to retrieve.
|
|
26
|
-
* @returns A promise that resolves to the retrieved resource.
|
|
27
|
-
* @throws If id is not provided or if the fetch request fails.
|
|
28
|
-
*/
|
|
29
|
-
retrieve(id: string): Promise<T>;
|
|
30
|
-
/**
|
|
31
|
-
* Update a specific resource by ID.
|
|
32
|
-
* @param id - The ID of the resource to update.
|
|
33
|
-
* @param body - The request body containing updated resource details.
|
|
34
|
-
* @returns A promise that resolves to the updated resource.
|
|
35
|
-
* @throws If id is not provided, if body is not an object, or if the fetch request fails.
|
|
36
|
-
*/
|
|
37
|
-
update<K extends Record<string, unknown>>(id: string, body: K): Promise<T>;
|
|
38
|
-
/**
|
|
39
|
-
* Delete a specific resource by ID.
|
|
40
|
-
* @param id - The ID of the resource to delete.
|
|
41
|
-
* @returns A promise that resolves when the resource is deleted.
|
|
42
|
-
* @throws If id is not provided or if the fetch request fails.
|
|
43
|
-
*/
|
|
44
|
-
del(id: string): Promise<void>;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
interface Connection {
|
|
48
|
-
id: string;
|
|
49
|
-
externalId?: string;
|
|
50
|
-
expiresAt: Date;
|
|
51
|
-
integrationId: string;
|
|
52
|
-
isValid: boolean;
|
|
53
|
-
refreshedAt?: Date;
|
|
54
|
-
createdAt: Date;
|
|
55
|
-
updatedAt: Date;
|
|
56
|
-
}
|
|
57
|
-
declare class Connections extends Base$1<Connection> {
|
|
58
|
-
protected namespace: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface Integration {
|
|
62
|
-
id: string;
|
|
63
|
-
identifier: string;
|
|
64
|
-
createdAt: Date;
|
|
65
|
-
updatedAt: Date;
|
|
66
|
-
}
|
|
67
|
-
declare class Integrations extends Base$1<Integration> {
|
|
68
|
-
protected namespace: string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
interface Webhook {
|
|
72
|
-
id: string;
|
|
73
|
-
name: string;
|
|
74
|
-
url: string;
|
|
75
|
-
events: Record<string, boolean>;
|
|
76
|
-
createdAt: Date;
|
|
77
|
-
updatedAt: Date;
|
|
78
|
-
lastTriggeredAt?: Date;
|
|
79
|
-
}
|
|
80
|
-
declare class Webhooks extends Base$1<Webhook> {
|
|
81
|
-
protected namespace: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
1
|
declare class Proxy {
|
|
85
2
|
private apiKey;
|
|
86
3
|
private connectionId;
|
|
@@ -98,7 +15,7 @@ declare class Proxy {
|
|
|
98
15
|
interface Params {
|
|
99
16
|
limit?: number;
|
|
100
17
|
after?: string;
|
|
101
|
-
|
|
18
|
+
include_raw?: boolean;
|
|
102
19
|
}
|
|
103
20
|
interface Response$1<T> {
|
|
104
21
|
data: T;
|
|
@@ -107,27 +24,27 @@ interface Response$1<T> {
|
|
|
107
24
|
next: string | null;
|
|
108
25
|
};
|
|
109
26
|
}
|
|
110
|
-
declare abstract class Base {
|
|
27
|
+
declare abstract class Base$1 {
|
|
111
28
|
private apiKey;
|
|
112
29
|
private connectionId;
|
|
113
30
|
private baseUrl;
|
|
114
31
|
private version;
|
|
115
32
|
protected abstract namespace: string;
|
|
116
33
|
protected get headers(): Record<string, string>;
|
|
117
|
-
protected buildUrl(path?: string | null, searchParams?: Record<string,
|
|
34
|
+
protected buildUrl(path?: string | null, searchParams?: Record<string, unknown>): URL;
|
|
118
35
|
constructor(apiKey: string, connectionId: string);
|
|
119
36
|
}
|
|
120
37
|
|
|
121
|
-
declare class Chat extends Base {
|
|
38
|
+
declare class Chat extends Base$1 {
|
|
122
39
|
protected namespace: string;
|
|
123
40
|
/**
|
|
124
41
|
* Fetch chat channels
|
|
125
42
|
* @param limit - Maximum number of channels to retrieve.
|
|
126
43
|
* @param after - Cursor for pagination.
|
|
127
|
-
* @param
|
|
44
|
+
* @param include_raw - Whether to include raw response data.
|
|
128
45
|
* @returns A promise that resolves to the fetch response.
|
|
129
46
|
*/
|
|
130
|
-
channels({ limit, after,
|
|
47
|
+
channels({ limit, after, include_raw }?: Params): Promise<Response$1<{
|
|
131
48
|
id: string;
|
|
132
49
|
name: string;
|
|
133
50
|
}[]>>;
|
|
@@ -136,7 +53,7 @@ declare class Chat extends Base {
|
|
|
136
53
|
interface RepoParams extends Params {
|
|
137
54
|
repoName: string;
|
|
138
55
|
}
|
|
139
|
-
declare class Git extends Base {
|
|
56
|
+
declare class Git extends Base$1 {
|
|
140
57
|
protected namespace: string;
|
|
141
58
|
/**
|
|
142
59
|
* Fetch repositories
|
|
@@ -145,7 +62,7 @@ declare class Git extends Base {
|
|
|
145
62
|
* @param includeRaw - Whether to include raw response data.
|
|
146
63
|
* @returns A promise that resolves to the fetch response.
|
|
147
64
|
*/
|
|
148
|
-
repos({ limit, after,
|
|
65
|
+
repos({ limit, after, include_raw }?: Params): Promise<Response$1<{
|
|
149
66
|
id: string;
|
|
150
67
|
name: string;
|
|
151
68
|
full_name: string;
|
|
@@ -160,11 +77,11 @@ declare class Git extends Base {
|
|
|
160
77
|
* @param repoName - The name of the repository.
|
|
161
78
|
* @param limit - Maximum number of pull requests to retrieve.
|
|
162
79
|
* @param after - Cursor for pagination.
|
|
163
|
-
* @param
|
|
80
|
+
* @param include_raw - Whether to include raw response data.
|
|
164
81
|
* @returns A promise that resolves to the fetch response.
|
|
165
82
|
* @throws If repoName is not provided.
|
|
166
83
|
*/
|
|
167
|
-
pulls(
|
|
84
|
+
pulls(repoName: string, { limit, after, include_raw }: RepoParams): Promise<Response$1<{
|
|
168
85
|
id: string;
|
|
169
86
|
number: number;
|
|
170
87
|
title: string;
|
|
@@ -182,11 +99,11 @@ declare class Git extends Base {
|
|
|
182
99
|
* @param repoName - The name of the repository.
|
|
183
100
|
* @param limit - Maximum number of tags to retrieve.
|
|
184
101
|
* @param after - Cursor for pagination.
|
|
185
|
-
* @param
|
|
102
|
+
* @param include_raw - Whether to include raw response data.
|
|
186
103
|
* @returns A promise that resolves to the fetch response.
|
|
187
104
|
* @throws If repoName is not provided.
|
|
188
105
|
*/
|
|
189
|
-
tags(
|
|
106
|
+
tags(repoName: string, { limit, after, include_raw }: RepoParams): Promise<Response$1<{
|
|
190
107
|
name: string;
|
|
191
108
|
commit_sha: string;
|
|
192
109
|
}[]>>;
|
|
@@ -195,11 +112,11 @@ declare class Git extends Base {
|
|
|
195
112
|
* @param repoName - The name of the repository.
|
|
196
113
|
* @param limit - Maximum number of releases to retrieve.
|
|
197
114
|
* @param after - Cursor for pagination.
|
|
198
|
-
* @param
|
|
115
|
+
* @param include_raw - Whether to include raw response data.
|
|
199
116
|
* @returns A promise that resolves to the fetch response.
|
|
200
117
|
* @throws If repoName is not provided.
|
|
201
118
|
*/
|
|
202
|
-
releases(
|
|
119
|
+
releases(repoName: string, { limit, after, include_raw }: RepoParams): Promise<Response$1<{
|
|
203
120
|
id: string;
|
|
204
121
|
name: string;
|
|
205
122
|
tag_name: string;
|
|
@@ -211,16 +128,16 @@ declare class Git extends Base {
|
|
|
211
128
|
}[]>>;
|
|
212
129
|
}
|
|
213
130
|
|
|
214
|
-
declare class PM extends Base {
|
|
131
|
+
declare class PM extends Base$1 {
|
|
215
132
|
protected namespace: string;
|
|
216
133
|
/**
|
|
217
134
|
* Fetch issues
|
|
218
135
|
* @param limit - Maximum number of issues to retrieve.
|
|
219
136
|
* @param after - Cursor for pagination.
|
|
220
|
-
* @param
|
|
137
|
+
* @param include_raw - Whether to include raw response data.
|
|
221
138
|
* @returns A promise that resolves to the fetch response.
|
|
222
139
|
*/
|
|
223
|
-
issues({ limit, after,
|
|
140
|
+
issues({ limit, after, include_raw }?: Params): Promise<Response$1<{
|
|
224
141
|
id: string;
|
|
225
142
|
url: string;
|
|
226
143
|
title: string;
|
|
@@ -231,6 +148,209 @@ declare class PM extends Base {
|
|
|
231
148
|
}[]>>;
|
|
232
149
|
}
|
|
233
150
|
|
|
151
|
+
declare class Unify {
|
|
152
|
+
private apiKey;
|
|
153
|
+
private connectionId;
|
|
154
|
+
constructor(apiKey: string, connectionId: string);
|
|
155
|
+
/**
|
|
156
|
+
* Access the Chat API for the connection.
|
|
157
|
+
*/
|
|
158
|
+
get chat(): Chat;
|
|
159
|
+
/**
|
|
160
|
+
* Access the Git API for the connection.
|
|
161
|
+
*/
|
|
162
|
+
get git(): Git;
|
|
163
|
+
/**
|
|
164
|
+
* Access the PM API for the connection.
|
|
165
|
+
*/
|
|
166
|
+
get pm(): PM;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
declare abstract class Base<T> {
|
|
170
|
+
private apiKey;
|
|
171
|
+
protected abstract namespace: string;
|
|
172
|
+
private baseUrl;
|
|
173
|
+
private version;
|
|
174
|
+
constructor(apiKey: string);
|
|
175
|
+
private buildUrl;
|
|
176
|
+
private get headers();
|
|
177
|
+
/**
|
|
178
|
+
* List resources with optional query parameters.
|
|
179
|
+
* @param searchParams - Query parameters for filtering the list.
|
|
180
|
+
* @returns A promise that resolves to an array of resources.
|
|
181
|
+
* @throws If params is not an object or if the fetch request fails.
|
|
182
|
+
*/
|
|
183
|
+
protected list(searchParams?: Record<string, unknown>): Promise<T[]>;
|
|
184
|
+
/**
|
|
185
|
+
* Create a new resource.
|
|
186
|
+
* @param body - The request body containing resource details.
|
|
187
|
+
* @returns A promise that resolves to the created resource.
|
|
188
|
+
* @throws If body is not an object or if the fetch request fails.
|
|
189
|
+
*/
|
|
190
|
+
protected create(body: Record<string, unknown>): Promise<T>;
|
|
191
|
+
/**
|
|
192
|
+
* Retrieve a specific resource by ID.
|
|
193
|
+
* @param id - The ID of the resource to retrieve.
|
|
194
|
+
* @returns A promise that resolves to the retrieved resource.
|
|
195
|
+
* @throws If id is not provided or if the fetch request fails.
|
|
196
|
+
*/
|
|
197
|
+
protected retrieve(id: string): Promise<T>;
|
|
198
|
+
/**
|
|
199
|
+
* Update a specific resource by ID.
|
|
200
|
+
* @param id - The ID of the resource to update.
|
|
201
|
+
* @param body - The request body containing updated resource details.
|
|
202
|
+
* @returns A promise that resolves to the updated resource.
|
|
203
|
+
* @throws If id is not provided, if body is not an object, or if the fetch request fails.
|
|
204
|
+
*/
|
|
205
|
+
protected update(id: string, body: Record<string, unknown>): Promise<T>;
|
|
206
|
+
/**
|
|
207
|
+
* Delete a specific resource by ID.
|
|
208
|
+
* @param id - The ID of the resource to delete.
|
|
209
|
+
* @returns A promise that resolves when the resource is deleted.
|
|
210
|
+
* @throws If id is not provided or if the fetch request fails.
|
|
211
|
+
*/
|
|
212
|
+
protected del(id: string): Promise<void>;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
interface Connection {
|
|
216
|
+
id: string;
|
|
217
|
+
externalId?: string;
|
|
218
|
+
expiresAt: Date;
|
|
219
|
+
integrationId: string;
|
|
220
|
+
isValid: boolean;
|
|
221
|
+
refreshedAt?: Date;
|
|
222
|
+
createdAt: Date;
|
|
223
|
+
updatedAt: Date;
|
|
224
|
+
}
|
|
225
|
+
interface ConnectionListParams {
|
|
226
|
+
offset: number;
|
|
227
|
+
limit: number;
|
|
228
|
+
integration_id: string;
|
|
229
|
+
integration_identifier: string;
|
|
230
|
+
external_id: string;
|
|
231
|
+
}
|
|
232
|
+
declare class Connections extends Base<Connection> {
|
|
233
|
+
protected namespace: string;
|
|
234
|
+
/**
|
|
235
|
+
* List all connections with optional query parameters.
|
|
236
|
+
* @param searchParams - Query parameters for filtering the list of connections.
|
|
237
|
+
* - offset: The number of items to skip before starting to collect the result set.
|
|
238
|
+
* - limit: The number of items to return.
|
|
239
|
+
* - integration_id: Filter connections by integration ID.
|
|
240
|
+
* - integration_identifier: Filter connections by integration identifier.
|
|
241
|
+
* - external_id: Filter connections by external ID.
|
|
242
|
+
* @returns A promise that resolves to an array of connection objects.
|
|
243
|
+
* @throws If the fetch request fails or if the search parameters are invalid.
|
|
244
|
+
*/
|
|
245
|
+
list(searchParams?: Partial<ConnectionListParams>): Promise<Connection[]>;
|
|
246
|
+
/**
|
|
247
|
+
* Retrieve a specific connection by ID.
|
|
248
|
+
* @param id - The ID of the connection to retrieve.
|
|
249
|
+
* @returns A promise that resolves to the connection object.
|
|
250
|
+
* @throws If the fetch request fails or if the ID is invalid.
|
|
251
|
+
*/
|
|
252
|
+
retrieve(id: string): Promise<Connection>;
|
|
253
|
+
/**
|
|
254
|
+
* Delete a specific connection by ID.
|
|
255
|
+
* @param id - The ID of the connection to delete.
|
|
256
|
+
* @returns A promise that resolves when the connection is deleted.
|
|
257
|
+
* @throws If the fetch request fails or if the ID is invalid.
|
|
258
|
+
*/
|
|
259
|
+
del(id: string): Promise<void>;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
interface Integration {
|
|
263
|
+
id: string;
|
|
264
|
+
identifier: string;
|
|
265
|
+
createdAt: Date;
|
|
266
|
+
updatedAt: Date;
|
|
267
|
+
}
|
|
268
|
+
interface IntegrationListParams {
|
|
269
|
+
offset: number;
|
|
270
|
+
limit: number;
|
|
271
|
+
status: string;
|
|
272
|
+
}
|
|
273
|
+
declare class Integrations extends Base<Integration> {
|
|
274
|
+
protected namespace: string;
|
|
275
|
+
/**
|
|
276
|
+
* List all integrations with optional query parameters.
|
|
277
|
+
* @param searchParams - Query parameters for filtering the list of integrations.
|
|
278
|
+
* - offset: The number of items to skip before starting to collect the result set.
|
|
279
|
+
* - limit: The number of items to return.
|
|
280
|
+
* - status: Filter integrations by status (e.g., 'active', 'inactive').
|
|
281
|
+
* @returns A promise that resolves to an array of integration objects.
|
|
282
|
+
* @throws If the fetch request fails or if the search parameters are invalid.
|
|
283
|
+
*/
|
|
284
|
+
list(searchParams?: Partial<IntegrationListParams>): Promise<Integration[]>;
|
|
285
|
+
/**
|
|
286
|
+
* Retrieve a specific integration by ID.
|
|
287
|
+
* @param id - The ID of the integration to retrieve.
|
|
288
|
+
* @returns A promise that resolves to the integration object.
|
|
289
|
+
* @throws If the fetch request fails or if the ID is invalid.
|
|
290
|
+
*/
|
|
291
|
+
retrieve(id: string): Promise<Integration>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
interface Webhook {
|
|
295
|
+
id: string;
|
|
296
|
+
name: string;
|
|
297
|
+
url: string;
|
|
298
|
+
events: Record<string, boolean>;
|
|
299
|
+
createdAt: Date;
|
|
300
|
+
updatedAt: Date;
|
|
301
|
+
lastTriggeredAt?: Date;
|
|
302
|
+
}
|
|
303
|
+
interface WebhookListParams {
|
|
304
|
+
offset: number;
|
|
305
|
+
limit: number;
|
|
306
|
+
}
|
|
307
|
+
interface WebhookBody extends Record<string, unknown> {
|
|
308
|
+
name: string;
|
|
309
|
+
url: string;
|
|
310
|
+
events: Record<string, boolean>;
|
|
311
|
+
}
|
|
312
|
+
declare class Webhooks extends Base<Webhook> {
|
|
313
|
+
protected namespace: string;
|
|
314
|
+
/**
|
|
315
|
+
* List all webhooks with optional query parameters.
|
|
316
|
+
* @param searchParams - Query parameters for filtering the list of webhooks.
|
|
317
|
+
* - offset: The number of items to skip before starting to collect the result set.
|
|
318
|
+
* - limit: The number of items to return.
|
|
319
|
+
* @returns A promise that resolves to an array of webhook objects.
|
|
320
|
+
* @throws If the fetch request fails or if the search parameters are invalid.
|
|
321
|
+
*/
|
|
322
|
+
list(searchParams?: Partial<WebhookListParams>): Promise<Webhook[]>;
|
|
323
|
+
/**
|
|
324
|
+
* Retrieve a specific webhook by ID.
|
|
325
|
+
* @param id - The ID of the webhook to retrieve.
|
|
326
|
+
* @returns A promise that resolves to the webhook object.
|
|
327
|
+
* @throws If the fetch request fails or if the ID is invalid.
|
|
328
|
+
*/
|
|
329
|
+
retrieve(id: string): Promise<Webhook>;
|
|
330
|
+
/**
|
|
331
|
+
* Create a new webhook with the specified data.
|
|
332
|
+
* @param data - An object containing the properties of the webhook to create.
|
|
333
|
+
* @returns A promise that resolves to the created webhook object.
|
|
334
|
+
* @throws If the fetch request fails or if the data is invalid.
|
|
335
|
+
*/
|
|
336
|
+
create(data: WebhookBody): Promise<Webhook>;
|
|
337
|
+
/**
|
|
338
|
+
* Update an existing webhook with the specified data.
|
|
339
|
+
* @param id - The ID of the webhook to update.
|
|
340
|
+
* @param data - An object containing the properties of the webhook to update.
|
|
341
|
+
* @returns A promise that resolves to the updated webhook object.
|
|
342
|
+
* @throws If the fetch request fails, if the ID is invalid, or if the data is invalid.
|
|
343
|
+
*/
|
|
344
|
+
update(id: string, data: WebhookBody): Promise<Webhook>;
|
|
345
|
+
/**
|
|
346
|
+
* Delete a specific webhook by ID.
|
|
347
|
+
* @param id - The ID of the webhook to delete.
|
|
348
|
+
* @returns A promise that resolves when the webhook is deleted.
|
|
349
|
+
* @throws If the fetch request fails or if the ID is invalid.
|
|
350
|
+
*/
|
|
351
|
+
del(id: string): Promise<void>;
|
|
352
|
+
}
|
|
353
|
+
|
|
234
354
|
declare class BundleUp {
|
|
235
355
|
private apiKey;
|
|
236
356
|
constructor(apiKey: string);
|
|
@@ -257,11 +377,7 @@ declare class BundleUp {
|
|
|
257
377
|
* @param connectionId - The ID of the connection.
|
|
258
378
|
* @returns An object containing Unify methods.
|
|
259
379
|
*/
|
|
260
|
-
unify(connectionId: string):
|
|
261
|
-
chat: Chat;
|
|
262
|
-
git: Git;
|
|
263
|
-
pm: PM;
|
|
264
|
-
};
|
|
380
|
+
unify(connectionId: string): Unify;
|
|
265
381
|
}
|
|
266
382
|
|
|
267
383
|
export { BundleUp };
|