@0xsequence/builder 0.0.0-20250430130723 → 0.0.0-20250520201059
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/.turbo/turbo-build.log +5 -0
- package/CHANGELOG.md +161 -0
- package/LICENSE +0 -17
- package/README.md +1 -2
- package/dist/{declarations/src/builder.gen.d.ts → builder.gen.d.ts} +1 -0
- package/dist/builder.gen.d.ts.map +1 -0
- package/dist/builder.gen.js +419 -0
- package/dist/{declarations/src/index.d.ts → index.d.ts} +3 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/package.json +20 -11
- package/src/builder.gen.ts +72 -72
- package/src/index.ts +1 -1
- package/tsconfig.json +10 -0
- package/dist/0xsequence-builder.cjs.d.ts +0 -2
- package/dist/0xsequence-builder.cjs.dev.js +0 -487
- package/dist/0xsequence-builder.cjs.js +0 -7
- package/dist/0xsequence-builder.cjs.prod.js +0 -487
- package/dist/0xsequence-builder.esm.js +0 -449
package/dist/index.js
ADDED
@@ -0,0 +1,41 @@
|
|
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.SequenceBuilderClient = void 0;
|
18
|
+
__exportStar(require("./builder.gen"), exports);
|
19
|
+
const builder_gen_1 = require("./builder.gen");
|
20
|
+
class SequenceBuilderClient extends builder_gen_1.Builder {
|
21
|
+
projectAccessKey;
|
22
|
+
constructor(projectAccessKey, apiUrl) {
|
23
|
+
const hostname = apiUrl ?? 'https://api.sequence.build';
|
24
|
+
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
25
|
+
this.projectAccessKey = projectAccessKey;
|
26
|
+
this.fetch = this._fetch;
|
27
|
+
}
|
28
|
+
_fetch = (input, init) => {
|
29
|
+
// automatically include access key auth header to requests
|
30
|
+
// if its been set on the api client
|
31
|
+
const headers = {};
|
32
|
+
const projectAccessKey = this.projectAccessKey;
|
33
|
+
if (projectAccessKey && projectAccessKey.length > 0) {
|
34
|
+
headers['X-Access-Key'] = projectAccessKey;
|
35
|
+
}
|
36
|
+
// before the request is made
|
37
|
+
init.headers = { ...init.headers, ...headers };
|
38
|
+
return fetch(input, init);
|
39
|
+
};
|
40
|
+
}
|
41
|
+
exports.SequenceBuilderClient = SequenceBuilderClient;
|
package/package.json
CHANGED
@@ -1,21 +1,30 @@
|
|
1
1
|
{
|
2
2
|
"name": "@0xsequence/builder",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-20250520201059",
|
4
4
|
"description": "builder sub-package for Sequence",
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/builder",
|
6
|
-
"
|
7
|
-
"main": "dist/0xsequence-builder.cjs.js",
|
8
|
-
"module": "dist/0xsequence-builder.esm.js",
|
9
|
-
"author": "Horizon Blockchain Games",
|
6
|
+
"author": "Sequence Platforms Inc.",
|
10
7
|
"license": "Apache-2.0",
|
11
|
-
"
|
8
|
+
"private": false,
|
9
|
+
"publishConfig": {
|
10
|
+
"access": "public"
|
11
|
+
},
|
12
|
+
"exports": {
|
13
|
+
".": {
|
14
|
+
"types": "./src/index.ts",
|
15
|
+
"default": "./dist/index.js"
|
16
|
+
}
|
17
|
+
},
|
12
18
|
"peerDependencies": {},
|
13
|
-
"devDependencies": {
|
14
|
-
|
15
|
-
"
|
16
|
-
"
|
17
|
-
|
19
|
+
"devDependencies": {
|
20
|
+
"@types/node": "^22.13.9",
|
21
|
+
"typescript": "^5.7.3",
|
22
|
+
"@repo/typescript-config": "^0.0.0-20250520201059"
|
23
|
+
},
|
24
|
+
"dependencies": {},
|
18
25
|
"scripts": {
|
26
|
+
"build": "tsc",
|
27
|
+
"dev": "tsc --watch",
|
19
28
|
"test": "echo",
|
20
29
|
"typecheck": "tsc --noEmit"
|
21
30
|
}
|
package/src/builder.gen.ts
CHANGED
@@ -32,7 +32,7 @@ export function VersionFromHeader(headers: Headers): WebrpcGenVersions {
|
|
32
32
|
codeGenName: '',
|
33
33
|
codeGenVersion: '',
|
34
34
|
schemaName: '',
|
35
|
-
schemaVersion: ''
|
35
|
+
schemaVersion: '',
|
36
36
|
}
|
37
37
|
}
|
38
38
|
|
@@ -47,20 +47,20 @@ function parseWebrpcGenVersions(header: string): WebrpcGenVersions {
|
|
47
47
|
codeGenName: '',
|
48
48
|
codeGenVersion: '',
|
49
49
|
schemaName: '',
|
50
|
-
schemaVersion: ''
|
50
|
+
schemaVersion: '',
|
51
51
|
}
|
52
52
|
}
|
53
53
|
|
54
|
-
const [_, webrpcGenVersion] = versions[0]
|
55
|
-
const [codeGenName, codeGenVersion] = versions[1]
|
56
|
-
const [schemaName, schemaVersion] = versions[2]
|
54
|
+
const [_, webrpcGenVersion] = versions[0]!.split('@')
|
55
|
+
const [codeGenName, codeGenVersion] = versions[1]!.split('@')
|
56
|
+
const [schemaName, schemaVersion] = versions[2]!.split('@')
|
57
57
|
|
58
58
|
return {
|
59
|
-
webrpcGenVersion
|
60
|
-
codeGenName
|
61
|
-
codeGenVersion
|
62
|
-
schemaName
|
63
|
-
schemaVersion
|
59
|
+
webrpcGenVersion: webrpcGenVersion!,
|
60
|
+
codeGenName: codeGenName!,
|
61
|
+
codeGenVersion: codeGenVersion!,
|
62
|
+
schemaName: schemaName!,
|
63
|
+
schemaVersion: schemaVersion!,
|
64
64
|
}
|
65
65
|
}
|
66
66
|
|
@@ -97,22 +97,22 @@ export interface Builder {
|
|
97
97
|
registerAudienceContact(
|
98
98
|
args: RegisterAudienceContactArgs,
|
99
99
|
headers?: object,
|
100
|
-
signal?: AbortSignal
|
100
|
+
signal?: AbortSignal,
|
101
101
|
): Promise<RegisterAudienceContactReturn>
|
102
102
|
getRegisteredAudienceContact(
|
103
103
|
args: GetRegisteredAudienceContactArgs,
|
104
104
|
headers?: object,
|
105
|
-
signal?: AbortSignal
|
105
|
+
signal?: AbortSignal,
|
106
106
|
): Promise<GetRegisteredAudienceContactReturn>
|
107
107
|
getAudienceRegistrationPublicStatus(
|
108
108
|
args: GetAudienceRegistrationPublicStatusArgs,
|
109
109
|
headers?: object,
|
110
|
-
signal?: AbortSignal
|
110
|
+
signal?: AbortSignal,
|
111
111
|
): Promise<GetAudienceRegistrationPublicStatusReturn>
|
112
112
|
isAudienceContactRegistered(
|
113
113
|
args: IsAudienceContactRegisteredArgs,
|
114
114
|
headers?: object,
|
115
|
-
signal?: AbortSignal
|
115
|
+
signal?: AbortSignal,
|
116
116
|
): Promise<IsAudienceContactRegisteredReturn>
|
117
117
|
}
|
118
118
|
|
@@ -178,92 +178,92 @@ export class Builder implements Builder {
|
|
178
178
|
|
179
179
|
ping = (headers?: object, signal?: AbortSignal): Promise<PingReturn> => {
|
180
180
|
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers, signal)).then(
|
181
|
-
res => {
|
182
|
-
return buildResponse(res).then(_data => {
|
181
|
+
(res) => {
|
182
|
+
return buildResponse(res).then((_data) => {
|
183
183
|
return {
|
184
|
-
status: <boolean>_data.status
|
184
|
+
status: <boolean>_data.status,
|
185
185
|
}
|
186
186
|
})
|
187
187
|
},
|
188
|
-
error => {
|
188
|
+
(error) => {
|
189
189
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
190
|
-
}
|
190
|
+
},
|
191
191
|
)
|
192
192
|
}
|
193
193
|
|
194
194
|
registerAudienceContact = (
|
195
195
|
args: RegisterAudienceContactArgs,
|
196
196
|
headers?: object,
|
197
|
-
signal?: AbortSignal
|
197
|
+
signal?: AbortSignal,
|
198
198
|
): Promise<RegisterAudienceContactReturn> => {
|
199
199
|
return this.fetch(this.url('RegisterAudienceContact'), createHTTPRequest(args, headers, signal)).then(
|
200
|
-
res => {
|
201
|
-
return buildResponse(res).then(_data => {
|
200
|
+
(res) => {
|
201
|
+
return buildResponse(res).then((_data) => {
|
202
202
|
return {
|
203
|
-
ok: <boolean>_data.ok
|
203
|
+
ok: <boolean>_data.ok,
|
204
204
|
}
|
205
205
|
})
|
206
206
|
},
|
207
|
-
error => {
|
207
|
+
(error) => {
|
208
208
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
209
|
-
}
|
209
|
+
},
|
210
210
|
)
|
211
211
|
}
|
212
212
|
|
213
213
|
getRegisteredAudienceContact = (
|
214
214
|
args: GetRegisteredAudienceContactArgs,
|
215
215
|
headers?: object,
|
216
|
-
signal?: AbortSignal
|
216
|
+
signal?: AbortSignal,
|
217
217
|
): Promise<GetRegisteredAudienceContactReturn> => {
|
218
218
|
return this.fetch(this.url('GetRegisteredAudienceContact'), createHTTPRequest(args, headers, signal)).then(
|
219
|
-
res => {
|
220
|
-
return buildResponse(res).then(_data => {
|
219
|
+
(res) => {
|
220
|
+
return buildResponse(res).then((_data) => {
|
221
221
|
return {
|
222
|
-
contact: <AudienceContact>_data.contact
|
222
|
+
contact: <AudienceContact>_data.contact,
|
223
223
|
}
|
224
224
|
})
|
225
225
|
},
|
226
|
-
error => {
|
226
|
+
(error) => {
|
227
227
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
228
|
-
}
|
228
|
+
},
|
229
229
|
)
|
230
230
|
}
|
231
231
|
|
232
232
|
getAudienceRegistrationPublicStatus = (
|
233
233
|
args: GetAudienceRegistrationPublicStatusArgs,
|
234
234
|
headers?: object,
|
235
|
-
signal?: AbortSignal
|
235
|
+
signal?: AbortSignal,
|
236
236
|
): Promise<GetAudienceRegistrationPublicStatusReturn> => {
|
237
237
|
return this.fetch(this.url('GetAudienceRegistrationPublicStatus'), createHTTPRequest(args, headers, signal)).then(
|
238
|
-
res => {
|
239
|
-
return buildResponse(res).then(_data => {
|
238
|
+
(res) => {
|
239
|
+
return buildResponse(res).then((_data) => {
|
240
240
|
return {
|
241
|
-
status: <AudienceRegistrationStatus>_data.status
|
241
|
+
status: <AudienceRegistrationStatus>_data.status,
|
242
242
|
}
|
243
243
|
})
|
244
244
|
},
|
245
|
-
error => {
|
245
|
+
(error) => {
|
246
246
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
247
|
-
}
|
247
|
+
},
|
248
248
|
)
|
249
249
|
}
|
250
250
|
|
251
251
|
isAudienceContactRegistered = (
|
252
252
|
args: IsAudienceContactRegisteredArgs,
|
253
253
|
headers?: object,
|
254
|
-
signal?: AbortSignal
|
254
|
+
signal?: AbortSignal,
|
255
255
|
): Promise<IsAudienceContactRegisteredReturn> => {
|
256
256
|
return this.fetch(this.url('IsAudienceContactRegistered'), createHTTPRequest(args, headers, signal)).then(
|
257
|
-
res => {
|
258
|
-
return buildResponse(res).then(_data => {
|
257
|
+
(res) => {
|
258
|
+
return buildResponse(res).then((_data) => {
|
259
259
|
return {
|
260
|
-
registered: <boolean>_data.registered
|
260
|
+
registered: <boolean>_data.registered,
|
261
261
|
}
|
262
262
|
})
|
263
263
|
},
|
264
|
-
error => {
|
264
|
+
(error) => {
|
265
265
|
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
266
|
-
}
|
266
|
+
},
|
267
267
|
)
|
268
268
|
}
|
269
269
|
}
|
@@ -276,12 +276,12 @@ const createHTTPRequest = (body: object = {}, headers: object = {}, signal: Abor
|
|
276
276
|
method: 'POST',
|
277
277
|
headers: reqHeaders,
|
278
278
|
body: JSON.stringify(body || {}),
|
279
|
-
signal
|
279
|
+
signal,
|
280
280
|
}
|
281
281
|
}
|
282
282
|
|
283
283
|
const buildResponse = (res: Response): Promise<any> => {
|
284
|
-
return res.text().then(text => {
|
284
|
+
return res.text().then((text) => {
|
285
285
|
let data
|
286
286
|
try {
|
287
287
|
data = JSON.parse(text)
|
@@ -292,7 +292,7 @@ const buildResponse = (res: Response): Promise<any> => {
|
|
292
292
|
}
|
293
293
|
throw WebrpcBadResponseError.new({
|
294
294
|
status: res.status,
|
295
|
-
cause: `JSON.parse(): ${message}: response text: ${text}
|
295
|
+
cause: `JSON.parse(): ${message}: response text: ${text}`,
|
296
296
|
})
|
297
297
|
}
|
298
298
|
if (!res.ok) {
|
@@ -341,7 +341,7 @@ export class WebrpcEndpointError extends WebrpcError {
|
|
341
341
|
code: number = 0,
|
342
342
|
message: string = 'endpoint error',
|
343
343
|
status: number = 0,
|
344
|
-
cause?: string
|
344
|
+
cause?: string,
|
345
345
|
) {
|
346
346
|
super(name, code, message, status, cause)
|
347
347
|
Object.setPrototypeOf(this, WebrpcEndpointError.prototype)
|
@@ -354,7 +354,7 @@ export class WebrpcRequestFailedError extends WebrpcError {
|
|
354
354
|
code: number = -1,
|
355
355
|
message: string = 'request failed',
|
356
356
|
status: number = 0,
|
357
|
-
cause?: string
|
357
|
+
cause?: string,
|
358
358
|
) {
|
359
359
|
super(name, code, message, status, cause)
|
360
360
|
Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype)
|
@@ -367,7 +367,7 @@ export class WebrpcBadRouteError extends WebrpcError {
|
|
367
367
|
code: number = -2,
|
368
368
|
message: string = 'bad route',
|
369
369
|
status: number = 0,
|
370
|
-
cause?: string
|
370
|
+
cause?: string,
|
371
371
|
) {
|
372
372
|
super(name, code, message, status, cause)
|
373
373
|
Object.setPrototypeOf(this, WebrpcBadRouteError.prototype)
|
@@ -380,7 +380,7 @@ export class WebrpcBadMethodError extends WebrpcError {
|
|
380
380
|
code: number = -3,
|
381
381
|
message: string = 'bad method',
|
382
382
|
status: number = 0,
|
383
|
-
cause?: string
|
383
|
+
cause?: string,
|
384
384
|
) {
|
385
385
|
super(name, code, message, status, cause)
|
386
386
|
Object.setPrototypeOf(this, WebrpcBadMethodError.prototype)
|
@@ -393,7 +393,7 @@ export class WebrpcBadRequestError extends WebrpcError {
|
|
393
393
|
code: number = -4,
|
394
394
|
message: string = 'bad request',
|
395
395
|
status: number = 0,
|
396
|
-
cause?: string
|
396
|
+
cause?: string,
|
397
397
|
) {
|
398
398
|
super(name, code, message, status, cause)
|
399
399
|
Object.setPrototypeOf(this, WebrpcBadRequestError.prototype)
|
@@ -406,7 +406,7 @@ export class WebrpcBadResponseError extends WebrpcError {
|
|
406
406
|
code: number = -5,
|
407
407
|
message: string = 'bad response',
|
408
408
|
status: number = 0,
|
409
|
-
cause?: string
|
409
|
+
cause?: string,
|
410
410
|
) {
|
411
411
|
super(name, code, message, status, cause)
|
412
412
|
Object.setPrototypeOf(this, WebrpcBadResponseError.prototype)
|
@@ -419,7 +419,7 @@ export class WebrpcServerPanicError extends WebrpcError {
|
|
419
419
|
code: number = -6,
|
420
420
|
message: string = 'server panic',
|
421
421
|
status: number = 0,
|
422
|
-
cause?: string
|
422
|
+
cause?: string,
|
423
423
|
) {
|
424
424
|
super(name, code, message, status, cause)
|
425
425
|
Object.setPrototypeOf(this, WebrpcServerPanicError.prototype)
|
@@ -432,7 +432,7 @@ export class WebrpcInternalErrorError extends WebrpcError {
|
|
432
432
|
code: number = -7,
|
433
433
|
message: string = 'internal error',
|
434
434
|
status: number = 0,
|
435
|
-
cause?: string
|
435
|
+
cause?: string,
|
436
436
|
) {
|
437
437
|
super(name, code, message, status, cause)
|
438
438
|
Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype)
|
@@ -445,7 +445,7 @@ export class WebrpcClientDisconnectedError extends WebrpcError {
|
|
445
445
|
code: number = -8,
|
446
446
|
message: string = 'client disconnected',
|
447
447
|
status: number = 0,
|
448
|
-
cause?: string
|
448
|
+
cause?: string,
|
449
449
|
) {
|
450
450
|
super(name, code, message, status, cause)
|
451
451
|
Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype)
|
@@ -458,7 +458,7 @@ export class WebrpcStreamLostError extends WebrpcError {
|
|
458
458
|
code: number = -9,
|
459
459
|
message: string = 'stream lost',
|
460
460
|
status: number = 0,
|
461
|
-
cause?: string
|
461
|
+
cause?: string,
|
462
462
|
) {
|
463
463
|
super(name, code, message, status, cause)
|
464
464
|
Object.setPrototypeOf(this, WebrpcStreamLostError.prototype)
|
@@ -471,7 +471,7 @@ export class WebrpcStreamFinishedError extends WebrpcError {
|
|
471
471
|
code: number = -10,
|
472
472
|
message: string = 'stream finished',
|
473
473
|
status: number = 0,
|
474
|
-
cause?: string
|
474
|
+
cause?: string,
|
475
475
|
) {
|
476
476
|
super(name, code, message, status, cause)
|
477
477
|
Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype)
|
@@ -486,7 +486,7 @@ export class UnauthorizedError extends WebrpcError {
|
|
486
486
|
code: number = 1000,
|
487
487
|
message: string = 'Unauthorized access',
|
488
488
|
status: number = 0,
|
489
|
-
cause?: string
|
489
|
+
cause?: string,
|
490
490
|
) {
|
491
491
|
super(name, code, message, status, cause)
|
492
492
|
Object.setPrototypeOf(this, UnauthorizedError.prototype)
|
@@ -499,7 +499,7 @@ export class PermissionDeniedError extends WebrpcError {
|
|
499
499
|
code: number = 1001,
|
500
500
|
message: string = 'Permission denied',
|
501
501
|
status: number = 0,
|
502
|
-
cause?: string
|
502
|
+
cause?: string,
|
503
503
|
) {
|
504
504
|
super(name, code, message, status, cause)
|
505
505
|
Object.setPrototypeOf(this, PermissionDeniedError.prototype)
|
@@ -512,7 +512,7 @@ export class SessionExpiredError extends WebrpcError {
|
|
512
512
|
code: number = 1002,
|
513
513
|
message: string = 'Session expired',
|
514
514
|
status: number = 0,
|
515
|
-
cause?: string
|
515
|
+
cause?: string,
|
516
516
|
) {
|
517
517
|
super(name, code, message, status, cause)
|
518
518
|
Object.setPrototypeOf(this, SessionExpiredError.prototype)
|
@@ -525,7 +525,7 @@ export class MethodNotFoundError extends WebrpcError {
|
|
525
525
|
code: number = 1003,
|
526
526
|
message: string = 'Method not found',
|
527
527
|
status: number = 0,
|
528
|
-
cause?: string
|
528
|
+
cause?: string,
|
529
529
|
) {
|
530
530
|
super(name, code, message, status, cause)
|
531
531
|
Object.setPrototypeOf(this, MethodNotFoundError.prototype)
|
@@ -538,7 +538,7 @@ export class RequestConflictError extends WebrpcError {
|
|
538
538
|
code: number = 1004,
|
539
539
|
message: string = 'Conflict with target resource',
|
540
540
|
status: number = 0,
|
541
|
-
cause?: string
|
541
|
+
cause?: string,
|
542
542
|
) {
|
543
543
|
super(name, code, message, status, cause)
|
544
544
|
Object.setPrototypeOf(this, RequestConflictError.prototype)
|
@@ -551,7 +551,7 @@ export class ServiceDisabledError extends WebrpcError {
|
|
551
551
|
code: number = 1005,
|
552
552
|
message: string = 'Service disabled',
|
553
553
|
status: number = 0,
|
554
|
-
cause?: string
|
554
|
+
cause?: string,
|
555
555
|
) {
|
556
556
|
super(name, code, message, status, cause)
|
557
557
|
Object.setPrototypeOf(this, ServiceDisabledError.prototype)
|
@@ -564,7 +564,7 @@ export class TimeoutError extends WebrpcError {
|
|
564
564
|
code: number = 2000,
|
565
565
|
message: string = 'Request timed out',
|
566
566
|
status: number = 0,
|
567
|
-
cause?: string
|
567
|
+
cause?: string,
|
568
568
|
) {
|
569
569
|
super(name, code, message, status, cause)
|
570
570
|
Object.setPrototypeOf(this, TimeoutError.prototype)
|
@@ -577,7 +577,7 @@ export class InvalidArgumentError extends WebrpcError {
|
|
577
577
|
code: number = 2001,
|
578
578
|
message: string = 'Invalid argument',
|
579
579
|
status: number = 0,
|
580
|
-
cause?: string
|
580
|
+
cause?: string,
|
581
581
|
) {
|
582
582
|
super(name, code, message, status, cause)
|
583
583
|
Object.setPrototypeOf(this, InvalidArgumentError.prototype)
|
@@ -590,7 +590,7 @@ export class NotFoundError extends WebrpcError {
|
|
590
590
|
code: number = 3000,
|
591
591
|
message: string = 'Resource not found',
|
592
592
|
status: number = 0,
|
593
|
-
cause?: string
|
593
|
+
cause?: string,
|
594
594
|
) {
|
595
595
|
super(name, code, message, status, cause)
|
596
596
|
Object.setPrototypeOf(this, NotFoundError.prototype)
|
@@ -603,7 +603,7 @@ export class UserNotFoundError extends WebrpcError {
|
|
603
603
|
code: number = 3001,
|
604
604
|
message: string = 'User not found',
|
605
605
|
status: number = 0,
|
606
|
-
cause?: string
|
606
|
+
cause?: string,
|
607
607
|
) {
|
608
608
|
super(name, code, message, status, cause)
|
609
609
|
Object.setPrototypeOf(this, UserNotFoundError.prototype)
|
@@ -616,7 +616,7 @@ export class ProjectNotFoundError extends WebrpcError {
|
|
616
616
|
code: number = 3002,
|
617
617
|
message: string = 'Project not found',
|
618
618
|
status: number = 0,
|
619
|
-
cause?: string
|
619
|
+
cause?: string,
|
620
620
|
) {
|
621
621
|
super(name, code, message, status, cause)
|
622
622
|
Object.setPrototypeOf(this, ProjectNotFoundError.prototype)
|
@@ -629,7 +629,7 @@ export class AlreadyCollaboratorError extends WebrpcError {
|
|
629
629
|
code: number = 4001,
|
630
630
|
message: string = 'Already a collaborator',
|
631
631
|
status: number = 0,
|
632
|
-
cause?: string
|
632
|
+
cause?: string,
|
633
633
|
) {
|
634
634
|
super(name, code, message, status, cause)
|
635
635
|
Object.setPrototypeOf(this, AlreadyCollaboratorError.prototype)
|
@@ -658,7 +658,7 @@ export enum errors {
|
|
658
658
|
InvalidArgument = 'InvalidArgument',
|
659
659
|
NotFound = 'NotFound',
|
660
660
|
UserNotFound = 'UserNotFound',
|
661
|
-
ProjectNotFound = 'ProjectNotFound'
|
661
|
+
ProjectNotFound = 'ProjectNotFound',
|
662
662
|
}
|
663
663
|
|
664
664
|
export enum WebrpcErrorCodes {
|
@@ -683,7 +683,7 @@ export enum WebrpcErrorCodes {
|
|
683
683
|
InvalidArgument = 2001,
|
684
684
|
NotFound = 3000,
|
685
685
|
UserNotFound = 3001,
|
686
|
-
ProjectNotFound = 3002
|
686
|
+
ProjectNotFound = 3002,
|
687
687
|
}
|
688
688
|
|
689
689
|
export const webrpcErrorByCode: { [code: number]: any } = {
|
@@ -708,7 +708,7 @@ export const webrpcErrorByCode: { [code: number]: any } = {
|
|
708
708
|
[2001]: InvalidArgumentError,
|
709
709
|
[3000]: NotFoundError,
|
710
710
|
[3001]: UserNotFoundError,
|
711
|
-
[3002]: ProjectNotFoundError
|
711
|
+
[3002]: ProjectNotFoundError,
|
712
712
|
}
|
713
713
|
|
714
714
|
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|
package/src/index.ts
CHANGED
@@ -5,7 +5,7 @@ import { Builder as BuilderRpc } from './builder.gen'
|
|
5
5
|
export class SequenceBuilderClient extends BuilderRpc {
|
6
6
|
constructor(
|
7
7
|
public projectAccessKey: string,
|
8
|
-
apiUrl?: string
|
8
|
+
apiUrl?: string,
|
9
9
|
) {
|
10
10
|
const hostname = apiUrl ?? 'https://api.sequence.build'
|
11
11
|
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch)
|
package/tsconfig.json
ADDED
@@ -1,2 +0,0 @@
|
|
1
|
-
export * from "./declarations/src/index.js";
|
2
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMHhzZXF1ZW5jZS1idWlsZGVyLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
|