@0xsequence/builder 2.3.35 → 3.0.0-beta.2

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.
@@ -0,0 +1,5 @@
1
+
2
+ 
3
+ > @0xsequence/builder@3.0.0-beta.2 build /Users/taylan/Development/Horizon/sequence.js/packages/services/builder
4
+ > tsc
5
+
package/CHANGELOG.md ADDED
@@ -0,0 +1,167 @@
1
+ # @0xsequence/builder
2
+
3
+ ## 3.0.0-beta.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 3.0.0-beta.2 with identity instrument updates
8
+
9
+ ## 3.0.0-beta.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 3.0.0-beta.1
14
+
15
+ ## 2.3.8
16
+
17
+ ### Patch Changes
18
+
19
+ - indexer: update clients
20
+
21
+ ## 2.3.7
22
+
23
+ ### Patch Changes
24
+
25
+ - Metadata updates
26
+
27
+ ## 2.3.6
28
+
29
+ ### Patch Changes
30
+
31
+ - New chains
32
+
33
+ ## 2.3.5
34
+
35
+ ### Patch Changes
36
+
37
+ - Add Frequency Testnet
38
+
39
+ ## 2.3.4
40
+
41
+ ### Patch Changes
42
+
43
+ - metadata: exclude deprecated methods on rpc client
44
+
45
+ ## 2.3.3
46
+
47
+ ### Patch Changes
48
+
49
+ - metadata: client update
50
+
51
+ ## 2.3.2
52
+
53
+ ### Patch Changes
54
+
55
+ - metadata: update rpc client
56
+
57
+ ## 2.3.1
58
+
59
+ ### Patch Changes
60
+
61
+ - indexer: update rpc client
62
+
63
+ ## 2.3.0
64
+
65
+ ### Minor Changes
66
+
67
+ - update metadata rpc client
68
+
69
+ ## 2.2.15
70
+
71
+ ### Patch Changes
72
+
73
+ - API updates
74
+
75
+ ## 2.2.14
76
+
77
+ ### Patch Changes
78
+
79
+ - Somnia Testnet and Monad Testnet
80
+
81
+ ## 2.2.13
82
+
83
+ ### Patch Changes
84
+
85
+ - Add XR1 to all networks
86
+
87
+ ## 2.2.12
88
+
89
+ ### Patch Changes
90
+
91
+ - Add XR1
92
+
93
+ ## 2.2.11
94
+
95
+ ### Patch Changes
96
+
97
+ - Relayer updates
98
+
99
+ ## 2.2.10
100
+
101
+ ### Patch Changes
102
+
103
+ - Etherlink support
104
+
105
+ ## 2.2.9
106
+
107
+ ### Patch Changes
108
+
109
+ - Indexer gateway native token balances
110
+
111
+ ## 2.2.8
112
+
113
+ ### Patch Changes
114
+
115
+ - Add Moonbeam and Moonbase Alpha
116
+
117
+ ## 2.2.7
118
+
119
+ ### Patch Changes
120
+
121
+ - Update Builder package
122
+
123
+ ## 2.2.6
124
+
125
+ ### Patch Changes
126
+
127
+ - Update relayer package
128
+
129
+ ## 2.2.5
130
+
131
+ ### Patch Changes
132
+
133
+ - auth: fix sequence indexer gateway url
134
+ - account: immutable wallet proxy hook
135
+
136
+ ## 2.2.4
137
+
138
+ ### Patch Changes
139
+
140
+ - network: update soneium mainnet block explorer url
141
+ - waas: signTypedData intent support
142
+
143
+ ## 2.2.3
144
+
145
+ ### Patch Changes
146
+
147
+ - provider: updating initWallet to use connected network configs if they exist
148
+
149
+ ## 2.2.2
150
+
151
+ ### Patch Changes
152
+
153
+ - pass projectAccessKey to relayer at all times
154
+
155
+ ## 2.2.1
156
+
157
+ ### Patch Changes
158
+
159
+ - waas-ethers: sign typed data
160
+
161
+ ## 2.2.0
162
+
163
+ ### Minor Changes
164
+
165
+ - indexer: gateway client
166
+ - @0xsequence/builder
167
+ - upgrade puppeteer to v23.10.3
package/LICENSE CHANGED
@@ -1,20 +1,3 @@
1
- Copyright (c) 2017-present Horizon Blockchain Games Inc.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
14
-
15
-
16
- ------------------------------------------------------------------------
17
-
18
1
 
19
2
  Apache License
20
3
  Version 2.0, January 2004
package/README.md CHANGED
@@ -1,4 +1,3 @@
1
- @0xsequence/builder
2
- ===================
1
+ # @0xsequence/builder
3
2
 
4
3
  See [0xsequence project page](https://github.com/0xsequence/sequence.js).
@@ -221,3 +221,4 @@ export declare const webrpcErrorByCode: {
221
221
  };
222
222
  export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
223
223
  export {};
224
+ //# sourceMappingURL=builder.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.gen.d.ts","sourceRoot":"","sources":["../src/builder.gen.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,WAAW,CAAA;AAEpC,eAAO,MAAM,iBAAiB,kEAAkE,CAAA;AAGhG,eAAO,MAAM,aAAa,OAAO,CAAA;AAGjC,eAAO,MAAM,mBAAmB,WAAW,CAAA;AAG3C,eAAO,MAAM,gBAAgB,6CAA6C,CAAA;AAE1E,KAAK,iBAAiB,GAAG;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB,CAarE;AA+BD,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,E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IACrB,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;CACpC;AAED,oBAAY,gBAAgB;IAC1B,cAAc,IAAI;IAClB,mBAAmB,KAAK;IACxB,cAAc,KAAK;IACnB,eAAe,KAAK;IACpB,gBAAgB,KAAK;IACrB,iBAAiB,KAAK;IACtB,iBAAiB,KAAK;IACtB,mBAAmB,KAAK;IACxB,wBAAwB,KAAK;IAC7B,gBAAgB,KAAK;IACrB,oBAAoB,MAAM;IAC1B,YAAY,OAAO;IACnB,gBAAgB,OAAO;IACvB,cAAc,OAAO;IACrB,cAAc,OAAO;IACrB,eAAe,OAAO;IACtB,eAAe,OAAO;IACtB,OAAO,OAAO;IACd,eAAe,OAAO;IACtB,QAAQ,OAAO;IACf,YAAY,OAAO;IACnB,eAAe,OAAO;CACvB;AAED,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAuBpD,CAAA;AAED,MAAM,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA"}
@@ -0,0 +1,419 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.webrpcErrorByCode = exports.WebrpcErrorCodes = exports.errors = exports.AlreadyCollaboratorError = exports.ProjectNotFoundError = exports.UserNotFoundError = exports.NotFoundError = exports.InvalidArgumentError = exports.TimeoutError = exports.ServiceDisabledError = exports.RequestConflictError = exports.MethodNotFoundError = exports.SessionExpiredError = exports.PermissionDeniedError = exports.UnauthorizedError = exports.WebrpcStreamFinishedError = exports.WebrpcStreamLostError = exports.WebrpcClientDisconnectedError = exports.WebrpcInternalErrorError = exports.WebrpcServerPanicError = exports.WebrpcBadResponseError = exports.WebrpcBadRequestError = exports.WebrpcBadMethodError = exports.WebrpcBadRouteError = exports.WebrpcRequestFailedError = exports.WebrpcEndpointError = exports.WebrpcError = exports.Builder = exports.WebRPCSchemaHash = exports.WebRPCSchemaVersion = exports.WebRPCVersion = exports.WebrpcHeaderValue = exports.WebrpcHeader = void 0;
4
+ exports.VersionFromHeader = VersionFromHeader;
5
+ /* eslint-disable */
6
+ // NOTE: this is just a subset of the builder api to scope down the
7
+ // surface area of the client.
8
+ //
9
+ // In the future we can include additional interfaces as needed.
10
+ exports.WebrpcHeader = 'Webrpc';
11
+ exports.WebrpcHeaderValue = 'webrpc@v0.22.1;gen-typescript@v0.16.2;sequence-builder@v0.1.0';
12
+ // WebRPC description and code-gen version
13
+ exports.WebRPCVersion = 'v1';
14
+ // Schema version of your RIDL schema
15
+ exports.WebRPCSchemaVersion = 'v0.1.0';
16
+ // Schema hash generated from your RIDL schema
17
+ exports.WebRPCSchemaHash = '461bc324d241f4df14fbf63268fde2cfe4873e3e';
18
+ function VersionFromHeader(headers) {
19
+ const headerValue = headers.get(exports.WebrpcHeader);
20
+ if (!headerValue) {
21
+ return {
22
+ webrpcGenVersion: '',
23
+ codeGenName: '',
24
+ codeGenVersion: '',
25
+ schemaName: '',
26
+ schemaVersion: '',
27
+ };
28
+ }
29
+ return parseWebrpcGenVersions(headerValue);
30
+ }
31
+ function parseWebrpcGenVersions(header) {
32
+ const versions = header.split(';');
33
+ if (versions.length < 3) {
34
+ return {
35
+ webrpcGenVersion: '',
36
+ codeGenName: '',
37
+ codeGenVersion: '',
38
+ schemaName: '',
39
+ schemaVersion: '',
40
+ };
41
+ }
42
+ const [_, webrpcGenVersion] = versions[0].split('@');
43
+ const [codeGenName, codeGenVersion] = versions[1].split('@');
44
+ const [schemaName, schemaVersion] = versions[2].split('@');
45
+ return {
46
+ webrpcGenVersion: webrpcGenVersion,
47
+ codeGenName: codeGenName,
48
+ codeGenVersion: codeGenVersion,
49
+ schemaName: schemaName,
50
+ schemaVersion: schemaVersion,
51
+ };
52
+ }
53
+ //
54
+ // Client
55
+ //
56
+ class Builder {
57
+ hostname;
58
+ fetch;
59
+ path = '/rpc/Builder/';
60
+ constructor(hostname, fetch) {
61
+ this.hostname = hostname.replace(/\/*$/, '');
62
+ this.fetch = (input, init) => fetch(input, init);
63
+ }
64
+ url(name) {
65
+ return this.hostname + this.path + name;
66
+ }
67
+ ping = (headers, signal) => {
68
+ return this.fetch(this.url('Ping'), createHTTPRequest({}, headers, signal)).then((res) => {
69
+ return buildResponse(res).then((_data) => {
70
+ return {
71
+ status: _data.status,
72
+ };
73
+ });
74
+ }, (error) => {
75
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` });
76
+ });
77
+ };
78
+ registerAudienceContact = (args, headers, signal) => {
79
+ return this.fetch(this.url('RegisterAudienceContact'), createHTTPRequest(args, headers, signal)).then((res) => {
80
+ return buildResponse(res).then((_data) => {
81
+ return {
82
+ ok: _data.ok,
83
+ };
84
+ });
85
+ }, (error) => {
86
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` });
87
+ });
88
+ };
89
+ getRegisteredAudienceContact = (args, headers, signal) => {
90
+ return this.fetch(this.url('GetRegisteredAudienceContact'), createHTTPRequest(args, headers, signal)).then((res) => {
91
+ return buildResponse(res).then((_data) => {
92
+ return {
93
+ contact: _data.contact,
94
+ };
95
+ });
96
+ }, (error) => {
97
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` });
98
+ });
99
+ };
100
+ getAudienceRegistrationPublicStatus = (args, headers, signal) => {
101
+ return this.fetch(this.url('GetAudienceRegistrationPublicStatus'), createHTTPRequest(args, headers, signal)).then((res) => {
102
+ return buildResponse(res).then((_data) => {
103
+ return {
104
+ status: _data.status,
105
+ };
106
+ });
107
+ }, (error) => {
108
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` });
109
+ });
110
+ };
111
+ isAudienceContactRegistered = (args, headers, signal) => {
112
+ return this.fetch(this.url('IsAudienceContactRegistered'), createHTTPRequest(args, headers, signal)).then((res) => {
113
+ return buildResponse(res).then((_data) => {
114
+ return {
115
+ registered: _data.registered,
116
+ };
117
+ });
118
+ }, (error) => {
119
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` });
120
+ });
121
+ };
122
+ }
123
+ exports.Builder = Builder;
124
+ const createHTTPRequest = (body = {}, headers = {}, signal = null) => {
125
+ const reqHeaders = { ...headers, 'Content-Type': 'application/json' };
126
+ reqHeaders[exports.WebrpcHeader] = exports.WebrpcHeaderValue;
127
+ return {
128
+ method: 'POST',
129
+ headers: reqHeaders,
130
+ body: JSON.stringify(body || {}),
131
+ signal,
132
+ };
133
+ };
134
+ const buildResponse = (res) => {
135
+ return res.text().then((text) => {
136
+ let data;
137
+ try {
138
+ data = JSON.parse(text);
139
+ }
140
+ catch (error) {
141
+ let message = '';
142
+ if (error instanceof Error) {
143
+ message = error.message;
144
+ }
145
+ throw WebrpcBadResponseError.new({
146
+ status: res.status,
147
+ cause: `JSON.parse(): ${message}: response text: ${text}`,
148
+ });
149
+ }
150
+ if (!res.ok) {
151
+ const code = typeof data.code === 'number' ? data.code : 0;
152
+ throw (exports.webrpcErrorByCode[code] || WebrpcError).new(data);
153
+ }
154
+ return data;
155
+ });
156
+ };
157
+ //
158
+ // Errors
159
+ //
160
+ class WebrpcError extends Error {
161
+ name;
162
+ code;
163
+ message;
164
+ status;
165
+ cause;
166
+ /** @deprecated Use message instead of msg. Deprecated in webrpc v0.11.0. */
167
+ msg;
168
+ constructor(name, code, message, status, cause) {
169
+ super(message);
170
+ this.name = name || 'WebrpcError';
171
+ this.code = typeof code === 'number' ? code : 0;
172
+ this.message = message || `endpoint error ${this.code}`;
173
+ this.msg = this.message;
174
+ this.status = typeof status === 'number' ? status : 0;
175
+ this.cause = cause;
176
+ Object.setPrototypeOf(this, WebrpcError.prototype);
177
+ }
178
+ static new(payload) {
179
+ return new this(payload.error, payload.code, payload.message || payload.msg, payload.status, payload.cause);
180
+ }
181
+ }
182
+ exports.WebrpcError = WebrpcError;
183
+ // Webrpc errors
184
+ class WebrpcEndpointError extends WebrpcError {
185
+ constructor(name = 'WebrpcEndpoint', code = 0, message = 'endpoint error', status = 0, cause) {
186
+ super(name, code, message, status, cause);
187
+ Object.setPrototypeOf(this, WebrpcEndpointError.prototype);
188
+ }
189
+ }
190
+ exports.WebrpcEndpointError = WebrpcEndpointError;
191
+ class WebrpcRequestFailedError extends WebrpcError {
192
+ constructor(name = 'WebrpcRequestFailed', code = -1, message = 'request failed', status = 0, cause) {
193
+ super(name, code, message, status, cause);
194
+ Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype);
195
+ }
196
+ }
197
+ exports.WebrpcRequestFailedError = WebrpcRequestFailedError;
198
+ class WebrpcBadRouteError extends WebrpcError {
199
+ constructor(name = 'WebrpcBadRoute', code = -2, message = 'bad route', status = 0, cause) {
200
+ super(name, code, message, status, cause);
201
+ Object.setPrototypeOf(this, WebrpcBadRouteError.prototype);
202
+ }
203
+ }
204
+ exports.WebrpcBadRouteError = WebrpcBadRouteError;
205
+ class WebrpcBadMethodError extends WebrpcError {
206
+ constructor(name = 'WebrpcBadMethod', code = -3, message = 'bad method', status = 0, cause) {
207
+ super(name, code, message, status, cause);
208
+ Object.setPrototypeOf(this, WebrpcBadMethodError.prototype);
209
+ }
210
+ }
211
+ exports.WebrpcBadMethodError = WebrpcBadMethodError;
212
+ class WebrpcBadRequestError extends WebrpcError {
213
+ constructor(name = 'WebrpcBadRequest', code = -4, message = 'bad request', status = 0, cause) {
214
+ super(name, code, message, status, cause);
215
+ Object.setPrototypeOf(this, WebrpcBadRequestError.prototype);
216
+ }
217
+ }
218
+ exports.WebrpcBadRequestError = WebrpcBadRequestError;
219
+ class WebrpcBadResponseError extends WebrpcError {
220
+ constructor(name = 'WebrpcBadResponse', code = -5, message = 'bad response', status = 0, cause) {
221
+ super(name, code, message, status, cause);
222
+ Object.setPrototypeOf(this, WebrpcBadResponseError.prototype);
223
+ }
224
+ }
225
+ exports.WebrpcBadResponseError = WebrpcBadResponseError;
226
+ class WebrpcServerPanicError extends WebrpcError {
227
+ constructor(name = 'WebrpcServerPanic', code = -6, message = 'server panic', status = 0, cause) {
228
+ super(name, code, message, status, cause);
229
+ Object.setPrototypeOf(this, WebrpcServerPanicError.prototype);
230
+ }
231
+ }
232
+ exports.WebrpcServerPanicError = WebrpcServerPanicError;
233
+ class WebrpcInternalErrorError extends WebrpcError {
234
+ constructor(name = 'WebrpcInternalError', code = -7, message = 'internal error', status = 0, cause) {
235
+ super(name, code, message, status, cause);
236
+ Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype);
237
+ }
238
+ }
239
+ exports.WebrpcInternalErrorError = WebrpcInternalErrorError;
240
+ class WebrpcClientDisconnectedError extends WebrpcError {
241
+ constructor(name = 'WebrpcClientDisconnected', code = -8, message = 'client disconnected', status = 0, cause) {
242
+ super(name, code, message, status, cause);
243
+ Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype);
244
+ }
245
+ }
246
+ exports.WebrpcClientDisconnectedError = WebrpcClientDisconnectedError;
247
+ class WebrpcStreamLostError extends WebrpcError {
248
+ constructor(name = 'WebrpcStreamLost', code = -9, message = 'stream lost', status = 0, cause) {
249
+ super(name, code, message, status, cause);
250
+ Object.setPrototypeOf(this, WebrpcStreamLostError.prototype);
251
+ }
252
+ }
253
+ exports.WebrpcStreamLostError = WebrpcStreamLostError;
254
+ class WebrpcStreamFinishedError extends WebrpcError {
255
+ constructor(name = 'WebrpcStreamFinished', code = -10, message = 'stream finished', status = 0, cause) {
256
+ super(name, code, message, status, cause);
257
+ Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype);
258
+ }
259
+ }
260
+ exports.WebrpcStreamFinishedError = WebrpcStreamFinishedError;
261
+ // Schema errors
262
+ class UnauthorizedError extends WebrpcError {
263
+ constructor(name = 'Unauthorized', code = 1000, message = 'Unauthorized access', status = 0, cause) {
264
+ super(name, code, message, status, cause);
265
+ Object.setPrototypeOf(this, UnauthorizedError.prototype);
266
+ }
267
+ }
268
+ exports.UnauthorizedError = UnauthorizedError;
269
+ class PermissionDeniedError extends WebrpcError {
270
+ constructor(name = 'PermissionDenied', code = 1001, message = 'Permission denied', status = 0, cause) {
271
+ super(name, code, message, status, cause);
272
+ Object.setPrototypeOf(this, PermissionDeniedError.prototype);
273
+ }
274
+ }
275
+ exports.PermissionDeniedError = PermissionDeniedError;
276
+ class SessionExpiredError extends WebrpcError {
277
+ constructor(name = 'SessionExpired', code = 1002, message = 'Session expired', status = 0, cause) {
278
+ super(name, code, message, status, cause);
279
+ Object.setPrototypeOf(this, SessionExpiredError.prototype);
280
+ }
281
+ }
282
+ exports.SessionExpiredError = SessionExpiredError;
283
+ class MethodNotFoundError extends WebrpcError {
284
+ constructor(name = 'MethodNotFound', code = 1003, message = 'Method not found', status = 0, cause) {
285
+ super(name, code, message, status, cause);
286
+ Object.setPrototypeOf(this, MethodNotFoundError.prototype);
287
+ }
288
+ }
289
+ exports.MethodNotFoundError = MethodNotFoundError;
290
+ class RequestConflictError extends WebrpcError {
291
+ constructor(name = 'RequestConflict', code = 1004, message = 'Conflict with target resource', status = 0, cause) {
292
+ super(name, code, message, status, cause);
293
+ Object.setPrototypeOf(this, RequestConflictError.prototype);
294
+ }
295
+ }
296
+ exports.RequestConflictError = RequestConflictError;
297
+ class ServiceDisabledError extends WebrpcError {
298
+ constructor(name = 'ServiceDisabled', code = 1005, message = 'Service disabled', status = 0, cause) {
299
+ super(name, code, message, status, cause);
300
+ Object.setPrototypeOf(this, ServiceDisabledError.prototype);
301
+ }
302
+ }
303
+ exports.ServiceDisabledError = ServiceDisabledError;
304
+ class TimeoutError extends WebrpcError {
305
+ constructor(name = 'Timeout', code = 2000, message = 'Request timed out', status = 0, cause) {
306
+ super(name, code, message, status, cause);
307
+ Object.setPrototypeOf(this, TimeoutError.prototype);
308
+ }
309
+ }
310
+ exports.TimeoutError = TimeoutError;
311
+ class InvalidArgumentError extends WebrpcError {
312
+ constructor(name = 'InvalidArgument', code = 2001, message = 'Invalid argument', status = 0, cause) {
313
+ super(name, code, message, status, cause);
314
+ Object.setPrototypeOf(this, InvalidArgumentError.prototype);
315
+ }
316
+ }
317
+ exports.InvalidArgumentError = InvalidArgumentError;
318
+ class NotFoundError extends WebrpcError {
319
+ constructor(name = 'NotFound', code = 3000, message = 'Resource not found', status = 0, cause) {
320
+ super(name, code, message, status, cause);
321
+ Object.setPrototypeOf(this, NotFoundError.prototype);
322
+ }
323
+ }
324
+ exports.NotFoundError = NotFoundError;
325
+ class UserNotFoundError extends WebrpcError {
326
+ constructor(name = 'UserNotFound', code = 3001, message = 'User not found', status = 0, cause) {
327
+ super(name, code, message, status, cause);
328
+ Object.setPrototypeOf(this, UserNotFoundError.prototype);
329
+ }
330
+ }
331
+ exports.UserNotFoundError = UserNotFoundError;
332
+ class ProjectNotFoundError extends WebrpcError {
333
+ constructor(name = 'ProjectNotFound', code = 3002, message = 'Project not found', status = 0, cause) {
334
+ super(name, code, message, status, cause);
335
+ Object.setPrototypeOf(this, ProjectNotFoundError.prototype);
336
+ }
337
+ }
338
+ exports.ProjectNotFoundError = ProjectNotFoundError;
339
+ class AlreadyCollaboratorError extends WebrpcError {
340
+ constructor(name = 'AlreadyCollaborator', code = 4001, message = 'Already a collaborator', status = 0, cause) {
341
+ super(name, code, message, status, cause);
342
+ Object.setPrototypeOf(this, AlreadyCollaboratorError.prototype);
343
+ }
344
+ }
345
+ exports.AlreadyCollaboratorError = AlreadyCollaboratorError;
346
+ var errors;
347
+ (function (errors) {
348
+ errors["WebrpcEndpoint"] = "WebrpcEndpoint";
349
+ errors["WebrpcRequestFailed"] = "WebrpcRequestFailed";
350
+ errors["WebrpcBadRoute"] = "WebrpcBadRoute";
351
+ errors["WebrpcBadMethod"] = "WebrpcBadMethod";
352
+ errors["WebrpcBadRequest"] = "WebrpcBadRequest";
353
+ errors["WebrpcBadResponse"] = "WebrpcBadResponse";
354
+ errors["WebrpcServerPanic"] = "WebrpcServerPanic";
355
+ errors["WebrpcInternalError"] = "WebrpcInternalError";
356
+ errors["WebrpcClientDisconnected"] = "WebrpcClientDisconnected";
357
+ errors["WebrpcStreamLost"] = "WebrpcStreamLost";
358
+ errors["WebrpcStreamFinished"] = "WebrpcStreamFinished";
359
+ errors["Unauthorized"] = "Unauthorized";
360
+ errors["PermissionDenied"] = "PermissionDenied";
361
+ errors["SessionExpired"] = "SessionExpired";
362
+ errors["MethodNotFound"] = "MethodNotFound";
363
+ errors["RequestConflict"] = "RequestConflict";
364
+ errors["ServiceDisabled"] = "ServiceDisabled";
365
+ errors["Timeout"] = "Timeout";
366
+ errors["InvalidArgument"] = "InvalidArgument";
367
+ errors["NotFound"] = "NotFound";
368
+ errors["UserNotFound"] = "UserNotFound";
369
+ errors["ProjectNotFound"] = "ProjectNotFound";
370
+ })(errors || (exports.errors = errors = {}));
371
+ var WebrpcErrorCodes;
372
+ (function (WebrpcErrorCodes) {
373
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcEndpoint"] = 0] = "WebrpcEndpoint";
374
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcRequestFailed"] = -1] = "WebrpcRequestFailed";
375
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadRoute"] = -2] = "WebrpcBadRoute";
376
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadMethod"] = -3] = "WebrpcBadMethod";
377
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadRequest"] = -4] = "WebrpcBadRequest";
378
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcBadResponse"] = -5] = "WebrpcBadResponse";
379
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcServerPanic"] = -6] = "WebrpcServerPanic";
380
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcInternalError"] = -7] = "WebrpcInternalError";
381
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcClientDisconnected"] = -8] = "WebrpcClientDisconnected";
382
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamLost"] = -9] = "WebrpcStreamLost";
383
+ WebrpcErrorCodes[WebrpcErrorCodes["WebrpcStreamFinished"] = -10] = "WebrpcStreamFinished";
384
+ WebrpcErrorCodes[WebrpcErrorCodes["Unauthorized"] = 1000] = "Unauthorized";
385
+ WebrpcErrorCodes[WebrpcErrorCodes["PermissionDenied"] = 1001] = "PermissionDenied";
386
+ WebrpcErrorCodes[WebrpcErrorCodes["SessionExpired"] = 1002] = "SessionExpired";
387
+ WebrpcErrorCodes[WebrpcErrorCodes["MethodNotFound"] = 1003] = "MethodNotFound";
388
+ WebrpcErrorCodes[WebrpcErrorCodes["RequestConflict"] = 1004] = "RequestConflict";
389
+ WebrpcErrorCodes[WebrpcErrorCodes["ServiceDisabled"] = 1005] = "ServiceDisabled";
390
+ WebrpcErrorCodes[WebrpcErrorCodes["Timeout"] = 2000] = "Timeout";
391
+ WebrpcErrorCodes[WebrpcErrorCodes["InvalidArgument"] = 2001] = "InvalidArgument";
392
+ WebrpcErrorCodes[WebrpcErrorCodes["NotFound"] = 3000] = "NotFound";
393
+ WebrpcErrorCodes[WebrpcErrorCodes["UserNotFound"] = 3001] = "UserNotFound";
394
+ WebrpcErrorCodes[WebrpcErrorCodes["ProjectNotFound"] = 3002] = "ProjectNotFound";
395
+ })(WebrpcErrorCodes || (exports.WebrpcErrorCodes = WebrpcErrorCodes = {}));
396
+ exports.webrpcErrorByCode = {
397
+ [0]: WebrpcEndpointError,
398
+ [-1]: WebrpcRequestFailedError,
399
+ [-2]: WebrpcBadRouteError,
400
+ [-3]: WebrpcBadMethodError,
401
+ [-4]: WebrpcBadRequestError,
402
+ [-5]: WebrpcBadResponseError,
403
+ [-6]: WebrpcServerPanicError,
404
+ [-7]: WebrpcInternalErrorError,
405
+ [-8]: WebrpcClientDisconnectedError,
406
+ [-9]: WebrpcStreamLostError,
407
+ [-10]: WebrpcStreamFinishedError,
408
+ [1000]: UnauthorizedError,
409
+ [1001]: PermissionDeniedError,
410
+ [1002]: SessionExpiredError,
411
+ [1003]: MethodNotFoundError,
412
+ [1004]: RequestConflictError,
413
+ [1005]: ServiceDisabledError,
414
+ [2000]: TimeoutError,
415
+ [2001]: InvalidArgumentError,
416
+ [3000]: NotFoundError,
417
+ [3001]: UserNotFoundError,
418
+ [3002]: ProjectNotFoundError,
419
+ };
@@ -1,7 +1,8 @@
1
- export * from "./builder.gen.js";
2
- import { Builder as BuilderRpc } from "./builder.gen.js";
1
+ export * from './builder.gen';
2
+ import { Builder as BuilderRpc } from './builder.gen';
3
3
  export declare class SequenceBuilderClient extends BuilderRpc {
4
4
  projectAccessKey: string;
5
5
  constructor(projectAccessKey: string, apiUrl?: string);
6
6
  _fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
7
7
  }
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAA;AAErD,qBAAa,qBAAsB,SAAQ,UAAU;IAE1C,gBAAgB,EAAE,MAAM;gBAAxB,gBAAgB,EAAE,MAAM,EAC/B,MAAM,CAAC,EAAE,MAAM;IAOjB,MAAM,GAAI,OAAO,WAAW,EAAE,OAAO,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CAcnE;CACF"}