@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
@@ -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
  *
@@ -16,10 +16,10 @@
16
16
  * You should have received a copy of the GNU Affero General Public License
17
17
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
18
  */
19
- import { ArweaveSigner } from 'arbundles/web';
19
+ import { ArweaveSigner } from 'arbundles';
20
20
  import { ReadableStream } from 'node:stream/web';
21
- import { JWKInterface } from '../types/arweave.js';
22
- import { TurboWalletSigner } from '../types/turbo.js';
21
+ import { JWKInterface } from '../common/jwk.js';
22
+ import { TurboWalletSigner } from '../types.js';
23
23
  export declare class TurboWebArweaveSigner implements TurboWalletSigner {
24
24
  protected privateKey: JWKInterface;
25
25
  protected signer: ArweaveSigner;
@@ -35,3 +35,4 @@ export declare class TurboWebArweaveSigner implements TurboWalletSigner {
35
35
  'x-signature': string;
36
36
  }>;
37
37
  }
38
+ //# sourceMappingURL=signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/web/signer.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,aAAa,EAAc,MAAM,WAAW,CAAC;AAGtD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD,qBAAa,qBAAsB,YAAW,iBAAiB;IAC7D,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC;IACnC,SAAS,CAAC,MAAM,EAAE,aAAa,CAAC;gBAEpB,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,YAAY,CAAA;KAAE;IAKlD,YAAY,CAAC,EACjB,iBAAiB,GAClB,EAAE;QACD,iBAAiB,EAAE,MAAM,cAAc,CAAC;KACzC,GAAG,OAAO,CAAC,MAAM,CAAC;IAYb,4BAA4B;;;;;CAanC"}
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@ardrive/turbo-sdk",
3
- "version": "1.0.0-alpha.2",
4
- "main": "./lib/node/index.js",
5
- "types": "./lib/types/index.d.ts",
3
+ "version": "1.0.0-alpha.21",
4
+ "main": "./lib/cjs/node/index.js",
5
+ "types": "./lib/types/node/index.d.ts",
6
+ "module": "./lib/esm/node/index.js",
7
+ "browser": "./bundles/web.bundle.min.js",
6
8
  "type": "module",
7
9
  "repository": {
8
10
  "type": "git",
@@ -21,20 +23,19 @@
21
23
  },
22
24
  "exports": {
23
25
  ".": {
24
- "import": "./lib/node/index.js",
25
- "require": "./lib/node/index.js",
26
- "types": "./lib/types/index.d.ts",
27
- "browser": "./bundles/web.bundle.min.js"
26
+ "import": "./lib/esm/node/index.js",
27
+ "require": "./lib/cjs/node/index.js",
28
+ "types": "./lib/types/node/index.d.ts"
28
29
  },
29
30
  "./node": {
30
- "import": "./lib/node/index.js",
31
- "require": "./lib/node/index.js",
32
- "types": "./lib/types/index.d.ts"
31
+ "import": "./lib/esm/node/index.js",
32
+ "require": "./lib/cjs/node/index.js",
33
+ "types": "./lib/types/node/index.d.ts"
33
34
  },
34
35
  "./web": {
35
36
  "import": "./lib/web/index.js",
36
37
  "require": "./lib/web/index.js",
37
- "types": "./lib/types/index.d.ts",
38
+ "types": "./lib/types/web/index.d.ts",
38
39
  "browser": "./bundles/web.bundle.min.js"
39
40
  }
40
41
  },
@@ -44,8 +45,10 @@
44
45
  "license": "AGPL-3.0-or-later",
45
46
  "scripts": {
46
47
  "build:web": "node bundle.cjs",
47
- "build:esm": "yarn tsc -p tsconfig.node.json && yarn tsc -p tsconfig.web.json && cp package.json README.md LICENSE.md ./lib",
48
- "build": "yarn clean && yarn build:web && yarn build:esm",
48
+ "build:esm": "yarn tsc -p tsconfig.json",
49
+ "build:cjs": "yarn tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > lib/cjs/package.json",
50
+ "build:types": "yarn tsc -p tsconfig.types.json",
51
+ "build": "yarn clean && yarn build:web && yarn build:esm && yarn build:cjs && yarn build:types",
49
52
  "clean": "rimraf [ lib coverage bundles ]",
50
53
  "lint": "eslint src",
51
54
  "lint:fix": "eslint src --fix",
@@ -55,15 +58,15 @@
55
58
  "test:web": "c8 mocha --config .mocharc --exclude tests/**/*.node.test.ts --exit",
56
59
  "test:node": "c8 mocha --config .mocharc --exclude tests/**/*.web.test.ts --exit",
57
60
  "prepare": "husky install",
58
- "example:mjs": "yarn build:esm && node examples/node/index.mjs",
59
- "example:cjs": "yarn build:esm && node examples/node/index.cjs",
61
+ "example:mjs": "cd examples/mjs && yarn && node index.mjs",
62
+ "example:cjs": "cd examples/cjs && yarn && node index.cjs",
60
63
  "example:web": "yarn build:web && cp -r bundles/* examples/web && http-server --port 8080 --host -o examples/web"
61
64
  },
62
65
  "dependencies": {
63
66
  "arbundles": "^0.9.9",
64
67
  "arweave": "^1.14.4",
65
68
  "axios": "^1.4.0",
66
- "retry-axios": "^3.0.0",
69
+ "axios-retry": "^3.7.0",
67
70
  "winston": "^3.10.0"
68
71
  },
69
72
  "devDependencies": {