@ardrive/turbo-sdk 1.0.0-alpha.2 → 1.0.0-alpha.21

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.
Files changed (86) hide show
  1. package/bundles/web.bundle.min.js +277 -38
  2. package/lib/cjs/common/factory.js +21 -0
  3. package/lib/cjs/common/http.js +36 -0
  4. package/lib/cjs/common/index.js +35 -0
  5. package/lib/cjs/common/jwk.js +2 -0
  6. package/lib/cjs/common/payment.js +63 -0
  7. package/lib/cjs/common/turbo.js +78 -0
  8. package/lib/cjs/common/upload.js +46 -0
  9. package/lib/cjs/node/factory.js +40 -0
  10. package/lib/cjs/node/index.js +36 -0
  11. package/lib/cjs/node/signer.js +50 -0
  12. package/lib/cjs/package.json +1 -0
  13. package/lib/cjs/types.js +2 -0
  14. package/lib/cjs/utils/axiosClient.js +69 -0
  15. package/lib/cjs/utils/base64.js +47 -0
  16. package/lib/cjs/utils/errors.js +33 -0
  17. package/lib/cjs/utils/readableStream.js +17 -0
  18. package/lib/cjs/web/factory.js +40 -0
  19. package/lib/cjs/web/index.js +36 -0
  20. package/lib/cjs/web/signer.js +57 -0
  21. package/lib/{common → esm/common}/factory.js +6 -2
  22. package/lib/esm/common/http.js +32 -0
  23. package/lib/esm/common/payment.js +58 -0
  24. package/lib/esm/common/turbo.js +73 -0
  25. package/lib/esm/common/upload.js +41 -0
  26. package/lib/{node → esm/node}/factory.js +8 -2
  27. package/lib/{web → esm/node}/index.js +1 -0
  28. package/lib/{node → esm/node}/signer.js +9 -20
  29. package/lib/{utils → esm/utils}/axiosClient.js +18 -9
  30. package/lib/esm/utils/readableStream.js +13 -0
  31. package/lib/{web → esm/web}/factory.js +8 -2
  32. package/lib/{node → esm/web}/index.js +1 -0
  33. package/lib/esm/web/signer.js +50 -0
  34. package/lib/{common → types/common}/factory.d.ts +2 -1
  35. package/lib/types/common/factory.d.ts.map +1 -0
  36. package/lib/{common → types/common}/http.d.ts +7 -6
  37. package/lib/types/common/http.d.ts.map +1 -0
  38. package/lib/{common → types/common}/index.d.ts +1 -0
  39. package/lib/types/common/index.d.ts.map +1 -0
  40. package/lib/types/{arweave.d.ts → common/jwk.d.ts} +1 -0
  41. package/lib/types/common/jwk.d.ts.map +1 -0
  42. package/lib/{common → types/common}/payment.d.ts +2 -2
  43. package/lib/types/common/payment.d.ts.map +1 -0
  44. package/lib/{common → types/common}/turbo.d.ts +6 -5
  45. package/lib/types/common/turbo.d.ts.map +1 -0
  46. package/lib/{common → types/common}/upload.d.ts +2 -2
  47. package/lib/types/common/upload.d.ts.map +1 -0
  48. package/lib/{node → types/node}/factory.d.ts +2 -1
  49. package/lib/types/node/factory.d.ts.map +1 -0
  50. package/lib/{web → types/node}/index.d.ts +2 -0
  51. package/lib/types/node/index.d.ts.map +1 -0
  52. package/lib/{node → types/node}/signer.d.ts +4 -3
  53. package/lib/types/node/signer.d.ts.map +1 -0
  54. package/lib/types/{turbo.d.ts → types.d.ts} +7 -6
  55. package/lib/types/types.d.ts.map +1 -0
  56. package/lib/{utils → types/utils}/axiosClient.d.ts +3 -2
  57. package/lib/types/utils/axiosClient.d.ts.map +1 -0
  58. package/lib/{utils → types/utils}/base64.d.ts +4 -3
  59. package/lib/types/utils/base64.d.ts.map +1 -0
  60. package/lib/{utils → types/utils}/errors.d.ts +1 -0
  61. package/lib/types/utils/errors.d.ts.map +1 -0
  62. package/lib/{utils → types/utils}/readableStream.d.ts +3 -2
  63. package/lib/types/utils/readableStream.d.ts.map +1 -0
  64. package/lib/{web → types/web}/factory.d.ts +2 -1
  65. package/lib/types/web/factory.d.ts.map +1 -0
  66. package/lib/{node → types/web}/index.d.ts +2 -0
  67. package/lib/types/web/index.d.ts.map +1 -0
  68. package/lib/{web → types/web}/signer.d.ts +6 -5
  69. package/lib/types/web/signer.d.ts.map +1 -0
  70. package/package.json +19 -16
  71. package/lib/LICENSE.md +0 -661
  72. package/lib/README.md +0 -114
  73. package/lib/common/http.js +0 -45
  74. package/lib/common/payment.js +0 -81
  75. package/lib/common/turbo.js +0 -100
  76. package/lib/common/upload.js +0 -54
  77. package/lib/package.json +0 -105
  78. package/lib/types/index.d.ts +0 -18
  79. package/lib/types/index.js +0 -18
  80. package/lib/utils/readableStream.js +0 -24
  81. package/lib/web/signer.js +0 -61
  82. /package/lib/{common → esm/common}/index.js +0 -0
  83. /package/lib/{types/arweave.js → esm/common/jwk.js} +0 -0
  84. /package/lib/{types/turbo.js → esm/types.js} +0 -0
  85. /package/lib/{utils → esm/utils}/base64.js +0 -0
  86. /package/lib/{utils → esm/utils}/errors.js +0 -0
@@ -0,0 +1,41 @@
1
+ import { TurboHTTPService } from './http.js';
2
+ export class TurboUnauthenticatedUploadService {
3
+ constructor({ url = 'https://upload.ardrive.dev', retryConfig, }) {
4
+ this.httpService = new TurboHTTPService({
5
+ url: `${url}/v1`,
6
+ retryConfig,
7
+ });
8
+ }
9
+ async uploadSignedDataItem({ dataItemStreamFactory, signal, }) {
10
+ // TODO: add p-limit constraint or replace with separate upload class
11
+ return this.httpService.post({
12
+ endpoint: `/tx`,
13
+ signal,
14
+ data: dataItemStreamFactory(),
15
+ headers: {
16
+ 'content-type': 'application/octet-stream',
17
+ },
18
+ });
19
+ }
20
+ }
21
+ // NOTE: to avoid redundancy, we use inheritance here - but generally prefer composition over inheritance
22
+ export class TurboAuthenticatedUploadService extends TurboUnauthenticatedUploadService {
23
+ constructor({ url = 'https://upload.ardrive.dev', retryConfig, signer, }) {
24
+ super({ url, retryConfig });
25
+ this.signer = signer;
26
+ }
27
+ async uploadFile({ fileStreamFactory, signal, }) {
28
+ const signedDataItem = await this.signer.signDataItem({
29
+ fileStreamFactory,
30
+ });
31
+ // TODO: add p-limit constraint or replace with separate upload class
32
+ return this.httpService.post({
33
+ endpoint: `/tx`,
34
+ signal,
35
+ data: signedDataItem,
36
+ headers: {
37
+ 'content-type': 'application/octet-stream',
38
+ },
39
+ });
40
+ }
41
+ }
@@ -20,8 +20,14 @@ import { TurboNodeArweaveSigner } from './signer.js';
20
20
  export class TurboFactory extends TurboBaseFactory {
21
21
  static authenticated({ privateKey, paymentServiceConfig = {}, uploadServiceConfig = {}, }) {
22
22
  const signer = new TurboNodeArweaveSigner({ privateKey });
23
- const paymentService = new TurboAuthenticatedPaymentService(Object.assign(Object.assign({}, paymentServiceConfig), { signer }));
24
- const uploadService = new TurboAuthenticatedUploadService(Object.assign(Object.assign({}, uploadServiceConfig), { signer }));
23
+ const paymentService = new TurboAuthenticatedPaymentService({
24
+ ...paymentServiceConfig,
25
+ signer,
26
+ });
27
+ const uploadService = new TurboAuthenticatedUploadService({
28
+ ...uploadServiceConfig,
29
+ signer,
30
+ });
25
31
  return new TurboAuthenticatedClient({
26
32
  uploadService,
27
33
  paymentService,
@@ -16,4 +16,5 @@
16
16
  */
17
17
  export * from './factory.js';
18
18
  export * from './signer.js';
19
+ export * from '../types.js';
19
20
  export * from '../common/index.js';
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  /**
11
2
  * Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
12
3
  *
@@ -39,16 +30,14 @@ export class TurboNodeArweaveSigner {
39
30
  return streamSigner(stream1, stream2, this.signer);
40
31
  }
41
32
  // NOTE: this might be better in a parent class or elsewhere - easy enough to leave in here now and does require specific environment version of crypto
42
- generateSignedRequestHeaders() {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- const nonce = randomBytes(16).toString('hex');
45
- const buffer = Buffer.from(nonce);
46
- const signature = yield Arweave.crypto.sign(this.privateKey, buffer);
47
- return {
48
- 'x-public-key': this.privateKey.n,
49
- 'x-nonce': nonce,
50
- 'x-signature': toB64Url(Buffer.from(signature)),
51
- };
52
- });
33
+ async generateSignedRequestHeaders() {
34
+ const nonce = randomBytes(16).toString('hex');
35
+ const buffer = Buffer.from(nonce);
36
+ const signature = await Arweave.crypto.sign(this.privateKey, buffer);
37
+ return {
38
+ 'x-public-key': this.privateKey.n,
39
+ 'x-nonce': nonce,
40
+ 'x-signature': toB64Url(Buffer.from(signature)),
41
+ };
53
42
  }
54
43
  }
@@ -14,17 +14,26 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- import axios from 'axios';
18
- import * as rax from 'retry-axios';
17
+ import axios, { CanceledError } from 'axios';
18
+ import axiosRetry from 'axios-retry';
19
19
  export const createAxiosInstance = ({ axiosConfig = {}, retryConfig = {
20
- backoffType: 'exponential',
21
- retry: 3,
22
- onRetryAttempt: (err) => {
23
- const cfg = rax.getConfig(err);
24
- console.debug(`Retry attempt #${cfg === null || cfg === void 0 ? void 0 : cfg.currentRetryAttempt}`);
20
+ retryDelay: axiosRetry.exponentialDelay,
21
+ retries: 3,
22
+ retryCondition: (error) => {
23
+ return (!(error instanceof CanceledError) &&
24
+ axiosRetry.isNetworkOrIdempotentRequestError(error));
25
+ },
26
+ onRetry: (retryCount, error) => {
27
+ console.debug(`Request failed, ${error}. Retry attempt #${retryCount}...`);
25
28
  },
26
29
  }, }) => {
27
- const axiosInstance = axios.create(Object.assign(Object.assign({}, axiosConfig), { validateStatus: () => true }));
28
- axiosInstance.defaults.raxConfig = Object.assign({ instance: axiosInstance }, retryConfig);
30
+ const axiosInstance = axios.create({
31
+ ...axiosConfig,
32
+ validateStatus: () => true, // don't throw on non-200 status codes
33
+ });
34
+ // eslint-disable-next-line
35
+ if (retryConfig.retries && retryConfig.retries > 0) {
36
+ axiosRetry(axiosInstance, retryConfig);
37
+ }
29
38
  return axiosInstance;
30
39
  };
@@ -0,0 +1,13 @@
1
+ export async function readableStreamToBuffer({ stream, }) {
2
+ const reader = stream.getReader();
3
+ const chunks = [];
4
+ let done = false;
5
+ while (!done) {
6
+ const { done: streamDone, value } = await reader.read();
7
+ done = streamDone;
8
+ if (!done) {
9
+ chunks.push(value);
10
+ }
11
+ }
12
+ return Buffer.concat(chunks);
13
+ }
@@ -20,8 +20,14 @@ import { TurboWebArweaveSigner } from './signer.js';
20
20
  export class TurboFactory extends TurboBaseFactory {
21
21
  static authenticated({ privateKey, paymentServiceConfig = {}, uploadServiceConfig = {}, }) {
22
22
  const signer = new TurboWebArweaveSigner({ privateKey });
23
- const paymentService = new TurboAuthenticatedPaymentService(Object.assign(Object.assign({}, paymentServiceConfig), { signer }));
24
- const uploadService = new TurboAuthenticatedUploadService(Object.assign(Object.assign({}, uploadServiceConfig), { signer }));
23
+ const paymentService = new TurboAuthenticatedPaymentService({
24
+ ...paymentServiceConfig,
25
+ signer,
26
+ });
27
+ const uploadService = new TurboAuthenticatedUploadService({
28
+ ...uploadServiceConfig,
29
+ signer,
30
+ });
25
31
  return new TurboAuthenticatedClient({
26
32
  uploadService,
27
33
  paymentService,
@@ -17,3 +17,4 @@
17
17
  export * from './factory.js';
18
18
  export * from './signer.js';
19
19
  export * from '../common/index.js';
20
+ export * from '../types.js';
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify
5
+ * it under the terms of the GNU Affero General Public License as published by
6
+ * the Free Software Foundation, either version 3 of the License, or
7
+ * (at your option) any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License
15
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { ArweaveSigner, createData } from 'arbundles';
18
+ import Arweave from 'arweave';
19
+ import { randomBytes } from 'node:crypto';
20
+ import { toB64Url } from '../utils/base64.js';
21
+ import { readableStreamToBuffer } from '../utils/readableStream.js';
22
+ export class TurboWebArweaveSigner {
23
+ constructor({ privateKey }) {
24
+ this.privateKey = privateKey;
25
+ this.signer = new ArweaveSigner(this.privateKey);
26
+ }
27
+ async signDataItem({ fileStreamFactory, }) {
28
+ // TODO: converts the readable stream to a buffer bc incrementally signing ReadableStreams is not trivial
29
+ const buffer = await readableStreamToBuffer({
30
+ stream: fileStreamFactory(),
31
+ // TODO: add payload size to get performance improvements
32
+ });
33
+ const signedDataItem = createData(buffer, this.signer);
34
+ await signedDataItem.sign(this.signer);
35
+ return signedDataItem.getRaw();
36
+ }
37
+ // NOTE: this might be better in a parent class or elsewhere - easy enough to leave in here now and does require specific environment version of crypto
38
+ async generateSignedRequestHeaders() {
39
+ // a bit hacky - but arweave exports cause issues in tests vs. browser
40
+ const arweave = Arweave.default ?? Arweave;
41
+ const nonce = randomBytes(16).toString('hex');
42
+ const buffer = Buffer.from(nonce);
43
+ const signature = await arweave.crypto.sign(this.privateKey, buffer, {});
44
+ return {
45
+ 'x-public-key': this.privateKey.n,
46
+ 'x-nonce': nonce,
47
+ 'x-signature': toB64Url(Buffer.from(signature)),
48
+ };
49
+ }
50
+ }
@@ -14,8 +14,9 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- import { TurboPublicConfiguration } from '../types/turbo.js';
17
+ import { TurboPublicConfiguration } from '../types.js';
18
18
  import { TurboUnauthenticatedClient } from './turbo.js';
19
19
  export declare class TurboBaseFactory {
20
20
  static unauthenticated({ paymentServiceConfig, uploadServiceConfig, }?: TurboPublicConfiguration): TurboUnauthenticatedClient;
21
21
  }
22
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/common/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAGxD,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,eAAe,CAAC,EACrB,oBAAyB,EACzB,mBAAwB,GACzB,GAAE,wBAA6B;CAYjC"}
@@ -1,6 +1,6 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- /// <reference types="node" resolution-mode="require"/>
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
4
  /**
5
5
  * Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
6
6
  *
@@ -18,15 +18,15 @@
18
18
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { AxiosInstance } from 'axios';
21
- import { RetryConfig } from 'retry-axios';
21
+ import { IAxiosRetryConfig } from 'axios-retry';
22
22
  import { Readable } from 'stream';
23
23
  import { ReadableStream } from 'stream/web';
24
- import { TurboHTTPServiceInterface, TurboSignedRequestHeaders } from '../types/turbo.js';
24
+ import { TurboHTTPServiceInterface, TurboSignedRequestHeaders } from '../types.js';
25
25
  export declare class TurboHTTPService implements TurboHTTPServiceInterface {
26
26
  protected axios: AxiosInstance;
27
27
  constructor({ url, retryConfig, }: {
28
28
  url: string;
29
- retryConfig?: RetryConfig;
29
+ retryConfig?: IAxiosRetryConfig;
30
30
  });
31
31
  get<T>({ endpoint, signal, allowedStatuses, headers, }: {
32
32
  endpoint: string;
@@ -42,3 +42,4 @@ export declare class TurboHTTPService implements TurboHTTPServiceInterface {
42
42
  data: Readable | Buffer | ReadableStream;
43
43
  }): Promise<T>;
44
44
  }
45
+ //# sourceMappingUR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tE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;KAC1C,GAAG,OAAO,CAAC,CAAC,CAAC;CAgBf"}
@@ -17,3 +17,4 @@
17
17
  export * from './upload.js';
18
18
  export * from './payment.js';
19
19
  export * from './turbo.js';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -27,3 +27,4 @@ export interface JWKInterface extends JWKPublicInterface {
27
27
  dq?: string;
28
28
  qi?: string;
29
29
  }
30
+ //# sourceMappingURL=jwk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwk.d.ts","sourceRoot":"","sources":["../../../src/common/jwk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AACD,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
@@ -14,7 +14,7 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- import { Currency, TurboAuthenticatedPaymentServiceInterface, TurboAuthenticatedPaymentServiceInterfaceConfiguration, TurboBalanceResponse, TurboCountriesResponse, TurboCurrenciesResponse, TurboFiatToArResponse, TurboPriceResponse, TurboRatesResponse, TurboUnauthenticatedPaymentServiceInterface, TurboUnauthenticatedPaymentServiceInterfaceConfiguration, TurboWalletSigner } from '../types/turbo.js';
17
+ import { Currency, TurboAuthenticatedPaymentServiceInterface, TurboAuthenticatedPaymentServiceInterfaceConfiguration, TurboBalanceResponse, TurboCountriesResponse, TurboCurrenciesResponse, TurboFiatToArResponse, TurboPriceResponse, TurboRatesResponse, TurboUnauthenticatedPaymentServiceInterface, TurboUnauthenticatedPaymentServiceInterfaceConfiguration, TurboWalletSigner } from '../types.js';
18
18
  import { TurboHTTPService } from './http.js';
19
19
  export declare class TurboUnauthenticatedPaymentService implements TurboUnauthenticatedPaymentServiceInterface {
20
20
  protected readonly httpService: TurboHTTPService;
@@ -34,8 +34,8 @@ export declare class TurboUnauthenticatedPaymentService implements TurboUnauthen
34
34
  }): Promise<TurboPriceResponse>;
35
35
  }
36
36
  export declare class TurboAuthenticatedPaymentService extends TurboUnauthenticatedPaymentService implements TurboAuthenticatedPaymentServiceInterface {
37
- protected readonly httpService: TurboHTTPService;
38
37
  protected readonly signer: TurboWalletSigner;
39
38
  constructor({ url, retryConfig, signer, }: TurboAuthenticatedPaymentServiceInterfaceConfiguration);
40
39
  getBalance(): Promise<TurboBalanceResponse>;
41
40
  }
41
+ //# sourceMappingURL=payment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/common/payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,QAAQ,EACR,yCAAyC,EACzC,sDAAsD,EACtD,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,2CAA2C,EAC3C,wDAAwD,EACxD,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,qBAAa,kCACX,YAAW,2CAA2C;IAEtD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;gBAErC,EACV,GAAmC,EACnC,WAAW,GACZ,EAAE,wDAAwD;IAOrD,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAM3C,WAAW,CAAC,EAChB,QAAQ,GACT,EAAE;QACD,QAAQ,EAAE,QAAQ,CAAC;KACpB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAM5B,qBAAqB,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAMxD,sBAAsB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAM1D,cAAc,CAAC,EACnB,KAAK,GACN,EAAE;QACD,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAW3B,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE;;;KAAA,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAKxE;AAGD,qBAAa,gCACX,SAAQ,kCACR,YAAW,yCAAyC;IAEpD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;gBAEjC,EACV,GAAmC,EACnC,WAAW,EACX,MAAM,GACP,EAAE,sDAAsD;IAKnD,UAAU,IAAI,OAAO,CAAC,oBAAoB,CAAC;CAWlD"}
@@ -14,10 +14,10 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- import { Currency, TurboAbortSignal, TurboAuthenticatedClientInterface, TurboAuthenticatedPaymentServiceInterface, TurboAuthenticatedUploadServiceInterface, TurboBalanceResponse, TurboCountriesResponse, TurboCurrenciesResponse, TurboFiatToArResponse, TurboFileFactory, TurboPriceResponse, TurboPrivateClientConfiguration, TurboPublicClientConfiguration, TurboRatesResponse, TurboSignedDataItemFactory, TurboUnauthenticatedClientInterface, TurboUnauthenticatedPaymentServiceInterface, TurboUnauthenticatedUploadServiceInterface, TurboUploadDataItemResponse } from '../types/index.js';
17
+ import { Currency, TurboAbortSignal, TurboAuthenticatedClientInterface, TurboAuthenticatedPaymentServiceInterface, TurboAuthenticatedUploadServiceInterface, TurboBalanceResponse, TurboCountriesResponse, TurboCurrenciesResponse, TurboFiatToArResponse, TurboFileFactory, TurboPriceResponse, TurboPrivateClientConfiguration, TurboPublicClientConfiguration, TurboRatesResponse, TurboSignedDataItemFactory, TurboUnauthenticatedClientInterface, TurboUnauthenticatedPaymentServiceInterface, TurboUnauthenticatedUploadServiceInterface, TurboUploadDataItemResponse } from '../types.js';
18
18
  export declare class TurboUnauthenticatedClient implements TurboUnauthenticatedClientInterface {
19
- protected readonly paymentService: TurboUnauthenticatedPaymentServiceInterface;
20
- protected readonly uploadService: TurboUnauthenticatedUploadServiceInterface;
19
+ protected paymentService: TurboUnauthenticatedPaymentServiceInterface;
20
+ protected uploadService: TurboUnauthenticatedUploadServiceInterface;
21
21
  constructor({ uploadService, paymentService, }: TurboPublicClientConfiguration);
22
22
  /**
23
23
  * Returns the supported fiat currency conversion rate for 1AR based on current market prices.
@@ -59,8 +59,8 @@ export declare class TurboUnauthenticatedClient implements TurboUnauthenticatedC
59
59
  uploadSignedDataItem({ dataItemStreamFactory, signal, }: TurboSignedDataItemFactory & TurboAbortSignal): Promise<TurboUploadDataItemResponse>;
60
60
  }
61
61
  export declare class TurboAuthenticatedClient extends TurboUnauthenticatedClient implements TurboAuthenticatedClientInterface {
62
- protected readonly paymentService: TurboAuthenticatedPaymentServiceInterface;
63
- protected readonly uploadService: TurboAuthenticatedUploadServiceInterface;
62
+ protected paymentService: TurboAuthenticatedPaymentServiceInterface;
63
+ protected uploadService: TurboAuthenticatedUploadServiceInterface;
64
64
  constructor({ paymentService, uploadService, }: TurboPrivateClientConfiguration);
65
65
  /**
66
66
  * Returns the current balance of the user's wallet in 'winc'.
@@ -71,3 +71,4 @@ export declare class TurboAuthenticatedClient extends TurboUnauthenticatedClient
71
71
  */
72
72
  uploadFile({ fileStreamFactory, signal, }: TurboFileFactory & TurboAbortSignal): Promise<TurboUploadDataItemResponse>;
73
73
  }
74
+ //# sourceMappingURL=turbo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turbo.d.ts","sourceRoot":"","sources":["../../../src/common/turbo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,iCAAiC,EACjC,yCAAyC,EACzC,wCAAwC,EACxC,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,+BAA+B,EAC/B,8BAA8B,EAC9B,kBAAkB,EAClB,0BAA0B,EAC1B,mCAAmC,EACnC,2CAA2C,EAC3C,0CAA0C,EAC1C,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AAIrB,qBAAa,0BACX,YAAW,mCAAmC;IAE9C,SAAS,CAAC,cAAc,EAAE,2CAA2C,CAAC;IACtE,SAAS,CAAC,aAAa,EAAE,0CAA0C,CAAC;gBAExD,EACV,aAAyD,EACzD,cAA2D,GAC5D,EAAE,8BAA8B;IAKjC;;OAEG;IACG,WAAW,CAAC,EAChB,QAAQ,GACT,EAAE;QACD,QAAQ,EAAE,QAAQ,CAAC;KACpB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIlC;;;;;OAKG;IACG,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAIjD;;OAEG;IACG,qBAAqB,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAI9D;;OAEG;IACG,sBAAsB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAIhE;;OAEG;IACG,cAAc,CAAC,EACnB,KAAK,GACN,EAAE;QACD,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAIjC;;OAEG;IACG,cAAc,CAAC,EACnB,MAAM,EACN,QAAQ,GACT,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,QAAQ,CAAC;KACpB,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,CAAC;IAIpD;;OAEG;IACG,oBAAoB,CAAC,EACzB,qBAAqB,EACrB,MAAM,GACP,EAAE,0BAA0B,GAC3B,gBAAgB,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAM1D;AAED,qBAAa,wBACX,SAAQ,0BACR,YAAW,iCAAiC;IAG5C,SAAS,CAAC,cAAc,EAAE,yCAAyC,CAAC;IACpE,SAAS,CAAC,aAAa,EAAE,wCAAwC,CAAC;gBAEtD,EACV,cAAc,EACd,aAAa,GACd,EAAE,+BAA+B;IAIlC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAIjD;;OAEG;IACG,UAAU,CAAC,EACf,iBAAiB,EACjB,MAAM,GACP,EAAE,gBAAgB,GACjB,gBAAgB,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAG1D"}
@@ -14,7 +14,7 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- import { TurboAbortSignal, TurboAuthenticatedUploadServiceConfiguration, TurboAuthenticatedUploadServiceInterface, TurboFileFactory, TurboSignedDataItemFactory, TurboUnauthenticatedUploadServiceInterface, TurboUnauthenticatedUploadServiceInterfaceConfiguration, TurboUploadDataItemResponse, TurboWalletSigner } from '../types/turbo.js';
17
+ import { TurboAbortSignal, TurboAuthenticatedUploadServiceConfiguration, TurboAuthenticatedUploadServiceInterface, TurboFileFactory, TurboSignedDataItemFactory, TurboUnauthenticatedUploadServiceInterface, TurboUnauthenticatedUploadServiceInterfaceConfiguration, TurboUploadDataItemResponse, TurboWalletSigner } from '../types.js';
18
18
  import { TurboHTTPService } from './http.js';
19
19
  export declare class TurboUnauthenticatedUploadService implements TurboUnauthenticatedUploadServiceInterface {
20
20
  protected httpService: TurboHTTPService;
@@ -22,8 +22,8 @@ export declare class TurboUnauthenticatedUploadService implements TurboUnauthent
22
22
  uploadSignedDataItem({ dataItemStreamFactory, signal, }: TurboSignedDataItemFactory & TurboAbortSignal): Promise<TurboUploadDataItemResponse>;
23
23
  }
24
24
  export declare class TurboAuthenticatedUploadService extends TurboUnauthenticatedUploadService implements TurboAuthenticatedUploadServiceInterface {
25
- protected httpService: TurboHTTPService;
26
25
  protected signer: TurboWalletSigner;
27
26
  constructor({ url, retryConfig, signer, }: TurboAuthenticatedUploadServiceConfiguration);
28
27
  uploadFile({ fileStreamFactory, signal, }: TurboFileFactory & TurboAbortSignal): Promise<TurboUploadDataItemResponse>;
29
28
  }
29
+ //# sourceMappingURL=upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/common/upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,gBAAgB,EAChB,4CAA4C,EAC5C,wCAAwC,EACxC,gBAAgB,EAChB,0BAA0B,EAC1B,0CAA0C,EAC1C,uDAAuD,EACvD,2BAA2B,EAC3B,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,qBAAa,iCACX,YAAW,0CAA0C;IAErD,SAAS,CAAC,WAAW,EAAE,gBAAgB,CAAC;gBAE5B,EACV,GAAkC,EAClC,WAAW,GACZ,EAAE,uDAAuD;IAOpD,oBAAoB,CAAC,EACzB,qBAAqB,EACrB,MAAM,GACP,EAAE,0BAA0B,GAC3B,gBAAgB,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAW1D;AAGD,qBAAa,+BACX,SAAQ,iCACR,YAAW,wCAAwC;IAEnD,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC;gBAExB,EACV,GAAkC,EAClC,WAAW,EACX,MAAM,GACP,EAAE,4CAA4C;IAKzC,UAAU,CAAC,EACf,iBAAiB,EACjB,MAAM,GACP,EAAE,gBAAgB,GACjB,gBAAgB,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAc1D"}
@@ -16,7 +16,8 @@
16
16
  */
17
17
  import { TurboBaseFactory } from '../common/factory.js';
18
18
  import { TurboAuthenticatedClient } from '../common/index.js';
19
- import { TurboPrivateConfiguration } from '../types/index.js';
19
+ import { TurboPrivateConfiguration } from '../types.js';
20
20
  export declare class TurboFactory extends TurboBaseFactory {
21
21
  static authenticated({ privateKey, paymentServiceConfig, uploadServiceConfig, }: TurboPrivateConfiguration): TurboAuthenticatedClient;
22
22
  }
23
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/node/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,wBAAwB,EAGzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGxD,qBAAa,YAAa,SAAQ,gBAAgB;IAChD,MAAM,CAAC,aAAa,CAAC,EACnB,UAAU,EACV,oBAAyB,EACzB,mBAAwB,GACzB,EAAE,yBAAyB;CAe7B"}
@@ -16,4 +16,6 @@
16
16
  */
17
17
  export * from './factory.js';
18
18
  export * from './signer.js';
19
+ export * from '../types.js';
19
20
  export * from '../common/index.js';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
@@ -1,4 +1,4 @@
1
- /// <reference types="node" resolution-mode="require"/>
1
+ /// <reference types="node" />
2
2
  /**
3
3
  * Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
4
4
  *
@@ -17,8 +17,8 @@
17
17
  */
18
18
  import { ArweaveSigner } from 'arbundles';
19
19
  import { Readable } from 'node:stream';
20
- import { JWKInterface } from '../types/arweave.js';
21
- import { TurboWalletSigner } from '../types/turbo.js';
20
+ import { JWKInterface } from '../common/jwk.js';
21
+ import { TurboWalletSigner } from '../types.js';
22
22
  export declare class TurboNodeArweaveSigner implements TurboWalletSigner {
23
23
  protected privateKey: JWKInterface;
24
24
  protected signer: ArweaveSigner;
@@ -34,3 +34,4 @@ export declare class TurboNodeArweaveSigner implements TurboWalletSigner {
34
34
  'x-signature': string;
35
35
  }>;
36
36
  }
37
+ //# sourceMappingURL=signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/node/signer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,aAAa,EAAgB,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,qBAAa,sBAAuB,YAAW,iBAAiB;IAC9D,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC;IACnC,SAAS,CAAC,MAAM,EAAE,aAAa,CAAC;gBAGpB,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,YAAY,CAAA;KAAE;IAKxD,YAAY,CAAC,EACX,iBAAiB,GAClB,EAAE;QACD,iBAAiB,EAAE,MAAM,QAAQ,CAAC;KACnC,GAAG,OAAO,CAAC,QAAQ,CAAC;IAOf,4BAA4B;;;;;CAWnC"}
@@ -1,6 +1,6 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- /// <reference types="node" resolution-mode="require"/>
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
4
  /**
5
5
  * Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
6
6
  *
@@ -17,11 +17,11 @@
17
17
  * You should have received a copy of the GNU Affero General Public License
18
18
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
  */
20
+ import { IAxiosRetryConfig } from 'axios-retry';
20
21
  import { Readable } from 'node:stream';
21
22
  import { ReadableStream } from 'node:stream/web';
22
- import { RetryConfig } from 'retry-axios';
23
23
  import winston from 'winston';
24
- import { JWKInterface } from './arweave.js';
24
+ import { JWKInterface } from './common/jwk.js';
25
25
  export type Base64String = string;
26
26
  export type PublicArweaveAddress = Base64String;
27
27
  export type TransactionId = Base64String;
@@ -66,7 +66,7 @@ type TurboAuthConfiguration = {
66
66
  };
67
67
  type TurboServiceConfiguration = {
68
68
  url?: string;
69
- retryConfig?: RetryConfig;
69
+ retryConfig?: IAxiosRetryConfig;
70
70
  logger?: winston.Logger;
71
71
  };
72
72
  export type TurboUnauthenticatedUploadServiceInterfaceConfiguration = TurboServiceConfiguration;
@@ -147,3 +147,4 @@ export interface TurboUnauthenticatedClientInterface extends TurboUnauthenticate
147
147
  export interface TurboAuthenticatedClientInterface extends TurboAuthenticatedPaymentServiceInterface, TurboAuthenticatedUploadServiceInterface {
148
148
  }
149
149
  export {};
150
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB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,yCAAyC,EAC/C,wCAAwC;CAAG"}
@@ -15,9 +15,10 @@
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
  import { AxiosInstance, AxiosRequestConfig } from 'axios';
18
- import * as rax from 'retry-axios';
18
+ import { IAxiosRetryConfig } from 'axios-retry';
19
19
  export interface AxiosInstanceParameters {
20
20
  axiosConfig?: Omit<AxiosRequestConfig, 'validateStatus'>;
21
- retryConfig?: rax.RetryConfig;
21
+ retryConfig?: IAxiosRetryConfig;
22
22
  }
23
23
  export declare const createAxiosInstance: ({ axiosConfig, retryConfig, }: AxiosInstanceParameters) => AxiosInstance;
24
+ //# sourceMappingURL=axiosClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axiosClient.d.ts","sourceRoot":"","sources":["../../../src/utils/axiosClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAc,EAAE,aAAa,EAAE,kBAAkB,EAAiB,MAAM,OAAO,CAAC;AAChF,OAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;IACzD,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAED,eAAO,MAAM,mBAAmB,kCAiB7B,uBAAuB,KAAG,aAU5B,CAAC"}
@@ -1,9 +1,10 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import { JWKInterface } from '../types/index.js';
3
- import { Base64String, PublicArweaveAddress } from '../types/index.js';
1
+ /// <reference types="node" />
2
+ import { JWKInterface } from '../common/jwk.js';
3
+ import { Base64String, PublicArweaveAddress } from '../types.js';
4
4
  export declare const base64URLRegex: RegExp;
5
5
  export declare function jwkToPublicArweaveAddress(jwk: JWKInterface): PublicArweaveAddress;
6
6
  export declare function ownerToAddress(owner: Base64String): PublicArweaveAddress;
7
7
  export declare function fromB64Url(input: Base64String): Buffer;
8
8
  export declare function toB64Url(buffer: Buffer): Base64String;
9
9
  export declare function sha256B64Url(input: Buffer): Base64String;
10
+ //# sourceMappingURL=base64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../../src/utils/base64.ts"],"names":[],"mappings":";AAmBA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEjE,eAAO,MAAM,cAAc,QAAwB,CAAC;AAEpD,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,YAAY,GAChB,oBAAoB,CAEtB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,oBAAoB,CAExE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAStD;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAErD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAExD"}
@@ -20,3 +20,4 @@ export declare class UnauthenticatedRequestError extends Error {
20
20
  export declare class FailedRequestError extends Error {
21
21
  constructor(status: number, message: string);
22
22
  }
23
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;;CAKrD;AAED,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAI5C"}
@@ -1,5 +1,5 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
3
  /**
4
4
  * Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
5
5
  *
@@ -20,3 +20,4 @@ import { ReadableStream } from 'node:stream/web';
20
20
  export declare function readableStreamToBuffer({ stream, }: {
21
21
  stream: ReadableStream;
22
22
  }): Promise<Buffer>;
23
+ //# sourceMappingURL=readableStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readableStream.d.ts","sourceRoot":"","sources":["../../../src/utils/readableStream.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,wBAAsB,sBAAsB,CAAC,EAC3C,MAAM,GACP,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CAalB"}
@@ -16,7 +16,8 @@
16
16
  */
17
17
  import { TurboBaseFactory } from '../common/factory.js';
18
18
  import { TurboAuthenticatedClient } from '../common/index.js';
19
- import { TurboPrivateConfiguration } from '../types/index.js';
19
+ import { TurboPrivateConfiguration } from '../types.js';
20
20
  export declare class TurboFactory extends TurboBaseFactory {
21
21
  static authenticated({ privateKey, paymentServiceConfig, uploadServiceConfig, }: TurboPrivateConfiguration): TurboAuthenticatedClient;
22
22
  }
23
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/web/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,wBAAwB,EAGzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGxD,qBAAa,YAAa,SAAQ,gBAAgB;IAChD,MAAM,CAAC,aAAa,CAAC,EACnB,UAAU,EACV,oBAAyB,EACzB,mBAAwB,GACzB,EAAE,yBAAyB;CAe7B"}
@@ -17,3 +17,5 @@
17
17
  export * from './factory.js';
18
18
  export * from './signer.js';
19
19
  export * from '../common/index.js';
20
+ export * from '../types.js';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/web/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}