@pinata/sdk 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -2
- package/README.md +58 -695
- package/index.d.ts +9 -0
- package/index.js +6 -0
- package/index.mjs +4 -0
- package/legacy.js +15 -0
- package/package.json +58 -83
- package/react/index.d.ts +1 -0
- package/react/index.js +3 -0
- package/react/index.mjs +1 -0
- package/.babelrc +0 -5
- package/.editorconfig +0 -12
- package/.eslintrc +0 -173
- package/.husky/pre-commit +0 -6
- package/.nvmrc +0 -1
- package/.travis.yml +0 -5
- package/lib/pinata-sdk.js +0 -24526
- package/lib/pinata-sdk.min.js +0 -22
- package/pinata.png +0 -0
- package/src/commands/data/getFilesByCount/getFilesByCount.ts +0 -66
- package/src/commands/data/index.ts +0 -4
- package/src/commands/data/pinList/pinList.ts +0 -77
- package/src/commands/data/pinList/queryBuilder.ts +0 -239
- package/src/commands/data/testAuthentication.ts +0 -31
- package/src/commands/data/userPinnedDataTotal.ts +0 -24
- package/src/commands/pinning/hashMetadata.ts +0 -56
- package/src/commands/pinning/index.ts +0 -8
- package/src/commands/pinning/pinByHash.ts +0 -65
- package/src/commands/pinning/pinFileToIPFS.ts +0 -118
- package/src/commands/pinning/pinFromFS.ts +0 -60
- package/src/commands/pinning/pinJSONToIPFS.ts +0 -47
- package/src/commands/pinning/pinJobs/pinJobs.ts +0 -50
- package/src/commands/pinning/pinJobs/queryBuilder.ts +0 -75
- package/src/commands/pinning/unpin.ts +0 -32
- package/src/constants.ts +0 -4
- package/src/index.ts +0 -124
- package/src/require-babel-polyfill.ts +0 -5
- package/src/third-party/base-path-converter.d.ts +0 -3
- package/src/third-party/global.d.ts +0 -9
- package/src/third-party/is-ipfs.d.ts +0 -5
- package/src/util/errorResponse.ts +0 -10
- package/src/util/validators.ts +0 -182
- package/test/commands/data/getFilesByCount/getFilesByCount.test.ts +0 -212
- package/test/commands/data/pinList/pinList.test.ts +0 -102
- package/test/commands/data/pinList/queryBuilder.test.ts +0 -439
- package/test/commands/data/pinlist-sample-api.ts +0 -540
- package/test/commands/data/testAuthentication.test.ts +0 -34
- package/test/commands/data/userPinnedDataTotal.test.ts +0 -29
- package/test/commands/pinning/hashMetadata.test.ts +0 -76
- package/test/commands/pinning/pinByHash.test.ts +0 -46
- package/test/commands/pinning/pinFileToIPFS.test.ts +0 -53
- package/test/commands/pinning/pinFromFS.ts +0 -71
- package/test/commands/pinning/pinJSONToIPFS.test.ts +0 -42
- package/test/commands/pinning/pinJobs/pinJobs.test.ts +0 -29
- package/test/commands/pinning/pinJobs/queryBuilder.test.ts +0 -120
- package/test/commands/pinning/unpin.test.ts +0 -46
- package/test/util/validators.test.ts +0 -234
- package/tsconfig.json +0 -23
- package/types/commands/data/getFilesByCount/getFilesByCount.d.ts +0 -14
- package/types/commands/data/index.d.ts +0 -4
- package/types/commands/data/pinList/pinList.d.ts +0 -45
- package/types/commands/data/pinList/queryBuilder.d.ts +0 -1
- package/types/commands/data/testAuthentication.d.ts +0 -5
- package/types/commands/data/userPinnedDataTotal.d.ts +0 -2
- package/types/commands/pinning/hashMetadata.d.ts +0 -3
- package/types/commands/pinning/hashPinPolicy.d.ts +0 -9
- package/types/commands/pinning/index.d.ts +0 -8
- package/types/commands/pinning/pinByHash.d.ts +0 -14
- package/types/commands/pinning/pinFileToIPFS.d.ts +0 -25
- package/types/commands/pinning/pinFromFS.d.ts +0 -4
- package/types/commands/pinning/pinJSONToIPFS.d.ts +0 -3
- package/types/commands/pinning/pinJobs/pinJobs.d.ts +0 -20
- package/types/commands/pinning/pinJobs/queryBuilder.d.ts +0 -1
- package/types/commands/pinning/unpin.d.ts +0 -2
- package/types/commands/pinning/userPinPolicy.d.ts +0 -8
- package/types/constants.d.ts +0 -2
- package/types/index.d.ts +0 -39
- package/types/require-babel-polyfill.d.ts +0 -2
- package/types/util/errorResponse.d.ts +0 -1
- package/types/util/validators.d.ts +0 -37
- package/webpack.config.js +0 -58
package/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "pinata";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated The v2 default export was removed. Use the named export instead:
|
|
5
|
+
* `import { PinataSDK } from "@pinata/sdk"` with `new PinataSDK({ pinataJwt })`.
|
|
6
|
+
* Calling this throws.
|
|
7
|
+
*/
|
|
8
|
+
declare const LegacyPinataSDK: (...args: unknown[]) => never;
|
|
9
|
+
export default LegacyPinataSDK;
|
package/index.js
ADDED
package/index.mjs
ADDED
package/legacy.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// v2 of @pinata/sdk exported a constructor as the default export
|
|
4
|
+
// (`new pinataSDK(key, secret)`). v3 is the `pinata` package, so calling the
|
|
5
|
+
// old default export throws a migration hint instead of a cryptic TypeError.
|
|
6
|
+
function LegacyPinataSDK() {
|
|
7
|
+
throw new Error(
|
|
8
|
+
"@pinata/sdk v3 is an alias of the `pinata` package and the v2 API has been removed. " +
|
|
9
|
+
"Use `const { PinataSDK } = require('@pinata/sdk')` with `new PinataSDK({ pinataJwt })`, " +
|
|
10
|
+
"or pin `@pinata/sdk@2` to keep the old API. " +
|
|
11
|
+
"Migration guide: https://github.com/PinataCloud/pinata/tree/main/packages/sdk-alias#migrating-from-v2",
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = LegacyPinataSDK;
|
package/package.json
CHANGED
|
@@ -1,85 +1,60 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"typescript": "^4.8.4",
|
|
61
|
-
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
62
|
-
"webpack": "^4.41.6",
|
|
63
|
-
"webpack-cli": "^3.3.11"
|
|
64
|
-
},
|
|
65
|
-
"dependencies": {
|
|
66
|
-
"axios": "^0.21.1",
|
|
67
|
-
"form-data": "^2.3.3",
|
|
68
|
-
"is-ipfs": "^0.6.0",
|
|
69
|
-
"path": "^0.12.7"
|
|
70
|
-
},
|
|
71
|
-
"jest": {
|
|
72
|
-
"collectCoverage": true,
|
|
73
|
-
"coverageReporters": [
|
|
74
|
-
"text",
|
|
75
|
-
"html"
|
|
76
|
-
],
|
|
77
|
-
"moduleFileExtensions": [
|
|
78
|
-
"ts",
|
|
79
|
-
"tsx",
|
|
80
|
-
"js",
|
|
81
|
-
"jsx",
|
|
82
|
-
"json"
|
|
83
|
-
]
|
|
84
|
-
}
|
|
2
|
+
"name": "@pinata/sdk",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Alias of the official Pinata SDK (`pinata`)",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"module": "./index.mjs",
|
|
7
|
+
"types": "./index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"import": "./index.mjs",
|
|
12
|
+
"require": "./index.js"
|
|
13
|
+
},
|
|
14
|
+
"./react": {
|
|
15
|
+
"types": "./react/index.d.ts",
|
|
16
|
+
"import": "./react/index.mjs",
|
|
17
|
+
"require": "./react/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"index.js",
|
|
22
|
+
"index.mjs",
|
|
23
|
+
"index.d.ts",
|
|
24
|
+
"legacy.js",
|
|
25
|
+
"react"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"test": "node --test test/*.test.cjs test/*.test.mjs"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"pinata": "^2.5.7"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": ">=16.8.0",
|
|
35
|
+
"react-dom": ">=16.8.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependenciesMeta": {
|
|
38
|
+
"react": {
|
|
39
|
+
"optional": true
|
|
40
|
+
},
|
|
41
|
+
"react-dom": {
|
|
42
|
+
"optional": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=20"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/PinataCloud/pinata.git",
|
|
51
|
+
"directory": "packages/sdk-alias"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://docs.pinata.cloud/sdk",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/PinataCloud/pinata/issues"
|
|
56
|
+
},
|
|
57
|
+
"keywords": ["pinata", "ipfs", "sdk"],
|
|
58
|
+
"author": "Pinata Cloud Technologies",
|
|
59
|
+
"license": "MIT"
|
|
85
60
|
}
|
package/react/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "pinata/react";
|
package/react/index.js
ADDED
package/react/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "pinata/react";
|
package/.babelrc
DELETED
package/.editorconfig
DELETED
package/.eslintrc
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
|
3
|
-
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"plugins": ["@typescript-eslint"],
|
|
5
|
-
"root": true,
|
|
6
|
-
"env": {
|
|
7
|
-
"browser": true,
|
|
8
|
-
"es6": true,
|
|
9
|
-
"node": true,
|
|
10
|
-
"jest": true
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
"globals": {
|
|
14
|
-
"document": false,
|
|
15
|
-
"escape": false,
|
|
16
|
-
"navigator": false,
|
|
17
|
-
"unescape": false,
|
|
18
|
-
"window": false,
|
|
19
|
-
"describe": true,
|
|
20
|
-
"before": true,
|
|
21
|
-
"it": true,
|
|
22
|
-
"expect": true,
|
|
23
|
-
"sinon": true
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"rules": {
|
|
29
|
-
"block-scoped-var": 2,
|
|
30
|
-
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
|
|
31
|
-
"comma-dangle": [2, "never"],
|
|
32
|
-
"comma-spacing": [2, { "before": false, "after": true }],
|
|
33
|
-
"comma-style": [2, "last"],
|
|
34
|
-
"complexity": 0,
|
|
35
|
-
"consistent-return": 2,
|
|
36
|
-
"consistent-this": 0,
|
|
37
|
-
"curly": [2, "multi-line"],
|
|
38
|
-
"default-case": 0,
|
|
39
|
-
"dot-location": [2, "property"],
|
|
40
|
-
"dot-notation": 0,
|
|
41
|
-
"eol-last": 2,
|
|
42
|
-
"eqeqeq": [2, "allow-null"],
|
|
43
|
-
"func-names": 0,
|
|
44
|
-
"func-style": 0,
|
|
45
|
-
"generator-star-spacing": [2, "both"],
|
|
46
|
-
"guard-for-in": 0,
|
|
47
|
-
"handle-callback-err": [2, "^(err|error|anySpecificError)$" ],
|
|
48
|
-
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
|
|
49
|
-
"keyword-spacing": [2, {"before": true, "after": true}],
|
|
50
|
-
"linebreak-style": 0,
|
|
51
|
-
"max-depth": 0,
|
|
52
|
-
"max-nested-callbacks": 0,
|
|
53
|
-
"max-params": 0,
|
|
54
|
-
"max-statements": 0,
|
|
55
|
-
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
|
|
56
|
-
"new-parens": 2,
|
|
57
|
-
"no-alert": 0,
|
|
58
|
-
"no-array-constructor": 2,
|
|
59
|
-
"no-bitwise": 0,
|
|
60
|
-
"no-caller": 2,
|
|
61
|
-
"no-catch-shadow": 0,
|
|
62
|
-
"no-cond-assign": 2,
|
|
63
|
-
"no-console": 0,
|
|
64
|
-
"no-constant-condition": 0,
|
|
65
|
-
"no-continue": 0,
|
|
66
|
-
"no-control-regex": 2,
|
|
67
|
-
"no-debugger": 2,
|
|
68
|
-
"no-delete-var": 2,
|
|
69
|
-
"no-div-regex": 0,
|
|
70
|
-
"no-dupe-args": 2,
|
|
71
|
-
"no-dupe-keys": 2,
|
|
72
|
-
"no-duplicate-case": 2,
|
|
73
|
-
"no-else-return": 2,
|
|
74
|
-
"no-empty": 0,
|
|
75
|
-
"no-empty-character-class": 2,
|
|
76
|
-
"no-eq-null": 0,
|
|
77
|
-
"no-eval": 2,
|
|
78
|
-
"no-ex-assign": 2,
|
|
79
|
-
"no-extend-native": 2,
|
|
80
|
-
"no-extra-bind": 2,
|
|
81
|
-
"no-extra-boolean-cast": 2,
|
|
82
|
-
"no-extra-parens": 0,
|
|
83
|
-
"no-extra-semi": 0,
|
|
84
|
-
"no-extra-strict": 0,
|
|
85
|
-
"no-fallthrough": 2,
|
|
86
|
-
"no-floating-decimal": 2,
|
|
87
|
-
"no-func-assign": 2,
|
|
88
|
-
"no-implied-eval": 2,
|
|
89
|
-
"no-inline-comments": 0,
|
|
90
|
-
"no-inner-declarations": [2, "functions"],
|
|
91
|
-
"no-invalid-regexp": 2,
|
|
92
|
-
"no-irregular-whitespace": 2,
|
|
93
|
-
"no-iterator": 2,
|
|
94
|
-
"no-label-var": 2,
|
|
95
|
-
"no-labels": 2,
|
|
96
|
-
"no-lone-blocks": 0,
|
|
97
|
-
"no-lonely-if": 0,
|
|
98
|
-
"no-loop-func": 0,
|
|
99
|
-
"no-mixed-requires": 0,
|
|
100
|
-
"no-mixed-spaces-and-tabs": [2, false],
|
|
101
|
-
"no-multi-spaces": 2,
|
|
102
|
-
"no-multi-str": 2,
|
|
103
|
-
"no-multiple-empty-lines": [2, { "max": 1 }],
|
|
104
|
-
"no-native-reassign": 2,
|
|
105
|
-
"no-negated-in-lhs": 2,
|
|
106
|
-
"no-nested-ternary": 0,
|
|
107
|
-
"no-new": 2,
|
|
108
|
-
"no-new-func": 2,
|
|
109
|
-
"no-new-object": 2,
|
|
110
|
-
"no-new-require": 2,
|
|
111
|
-
"no-new-wrappers": 2,
|
|
112
|
-
"no-obj-calls": 2,
|
|
113
|
-
"no-octal": 2,
|
|
114
|
-
"no-octal-escape": 2,
|
|
115
|
-
"no-path-concat": 0,
|
|
116
|
-
"no-plusplus": 0,
|
|
117
|
-
"no-process-env": 0,
|
|
118
|
-
"no-process-exit": 0,
|
|
119
|
-
"no-proto": 2,
|
|
120
|
-
"no-redeclare": 2,
|
|
121
|
-
"no-regex-spaces": 2,
|
|
122
|
-
"no-reserved-keys": 0,
|
|
123
|
-
"no-restricted-modules": 0,
|
|
124
|
-
"no-return-assign": 2,
|
|
125
|
-
"no-script-url": 0,
|
|
126
|
-
"no-self-compare": 2,
|
|
127
|
-
"no-sequences": 2,
|
|
128
|
-
"no-shadow": 0,
|
|
129
|
-
"no-shadow-restricted-names": 2,
|
|
130
|
-
"no-spaced-func": 2,
|
|
131
|
-
"no-sparse-arrays": 2,
|
|
132
|
-
"no-sync": 0,
|
|
133
|
-
"no-ternary": 0,
|
|
134
|
-
"no-throw-literal": 2,
|
|
135
|
-
"no-trailing-spaces": 2,
|
|
136
|
-
"no-undef": 2,
|
|
137
|
-
"no-undef-init": 2,
|
|
138
|
-
"no-undefined": 0,
|
|
139
|
-
"no-underscore-dangle": 0,
|
|
140
|
-
"no-unneeded-ternary": 2,
|
|
141
|
-
"no-unreachable": 2,
|
|
142
|
-
"no-unused-expressions": 0,
|
|
143
|
-
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
|
|
144
|
-
"no-use-before-define": 2,
|
|
145
|
-
"no-var": 0,
|
|
146
|
-
"no-void": 0,
|
|
147
|
-
"no-warning-comments": 0,
|
|
148
|
-
"no-with": 2,
|
|
149
|
-
"one-var": 0,
|
|
150
|
-
"operator-assignment": 0,
|
|
151
|
-
"operator-linebreak": [2, "after"],
|
|
152
|
-
"padded-blocks": 0,
|
|
153
|
-
"quote-props": 0,
|
|
154
|
-
"quotes": [2, "single", "avoid-escape"],
|
|
155
|
-
"semi": [2, "always"],
|
|
156
|
-
"semi-spacing": 0,
|
|
157
|
-
"sort-vars": 0,
|
|
158
|
-
"space-before-blocks": [2, "always"],
|
|
159
|
-
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
|
|
160
|
-
"space-in-brackets": 0,
|
|
161
|
-
"space-in-parens": [2, "never"],
|
|
162
|
-
"space-infix-ops": 2,
|
|
163
|
-
"space-unary-ops": [2, { "words": true, "nonwords": false }],
|
|
164
|
-
"strict": 0,
|
|
165
|
-
"use-isnan": 2,
|
|
166
|
-
"valid-jsdoc": 0,
|
|
167
|
-
"valid-typeof": 2,
|
|
168
|
-
"vars-on-top": 2,
|
|
169
|
-
"wrap-iife": [2, "any"],
|
|
170
|
-
"wrap-regex": 0,
|
|
171
|
-
"yoda": [2, "never"]
|
|
172
|
-
}
|
|
173
|
-
}
|
package/.husky/pre-commit
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v14.0
|