@pinata/sdk 1.1.25 → 1.1.26
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/README.md +2 -108
- package/lib/pinata-sdk.js +3 -180
- package/lib/pinata-sdk.min.js +5 -5
- package/package.json +1 -1
- package/src/index.js +0 -25
- package/types/index.d.ts +0 -31
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import pinByHash from './commands/pinning/pinByHash';
|
|
2
2
|
import hashMetadata from './commands/pinning/hashMetadata';
|
|
3
|
-
import hashPinPolicy from './commands/pinning/hashPinPolicy';
|
|
4
3
|
import pinFileToIPFS from './commands/pinning/pinFileToIPFS';
|
|
5
4
|
import pinFromFS from './commands/pinning/pinFromFS';
|
|
6
5
|
import pinJSONToIPFS from './commands/pinning/pinJSONToIPFS';
|
|
7
6
|
import pinJobs from './commands/pinning/pinJobs/pinJobs';
|
|
8
7
|
import unpin from './commands/pinning/unpin';
|
|
9
|
-
import userPinPolicy from './commands/pinning/userPinPolicy';
|
|
10
8
|
import testAuthentication from './commands/data/testAuthentication';
|
|
11
9
|
import pinList from './commands/data/pinList/pinList';
|
|
12
10
|
import userPinnedDataTotal from './commands/data/userPinnedDataTotal';
|
|
@@ -135,14 +133,6 @@ import userPinnedDataTotal from './commands/data/userPinnedDataTotal';
|
|
|
135
133
|
* @returns {Promise<any>}
|
|
136
134
|
*/
|
|
137
135
|
|
|
138
|
-
/**
|
|
139
|
-
* Hash pin policy
|
|
140
|
-
* @callback hashPinPolicy
|
|
141
|
-
* @param {string} ipfsPinHash
|
|
142
|
-
* @param {{regions: PinataPinPolicyItem[]}} newPinPolicy
|
|
143
|
-
* @returns {Promise<any>}
|
|
144
|
-
*/
|
|
145
|
-
|
|
146
136
|
/**
|
|
147
137
|
* Pin by hash
|
|
148
138
|
* @callback pinByHash
|
|
@@ -189,13 +179,6 @@ import userPinnedDataTotal from './commands/data/userPinnedDataTotal';
|
|
|
189
179
|
* @returns {Promise<any>}
|
|
190
180
|
*/
|
|
191
181
|
|
|
192
|
-
/**
|
|
193
|
-
* User Pin Policy
|
|
194
|
-
* @callback userPinPolicy
|
|
195
|
-
* @param {{regions: PinataPinPolicyItem[]}} newPinPolicy
|
|
196
|
-
* @returns {Promise<any>}
|
|
197
|
-
*/
|
|
198
|
-
|
|
199
182
|
/**
|
|
200
183
|
* Test Authentication
|
|
201
184
|
* @callback testAuthentication
|
|
@@ -219,13 +202,11 @@ import userPinnedDataTotal from './commands/data/userPinnedDataTotal';
|
|
|
219
202
|
* @typedef PinataClient
|
|
220
203
|
* @property {pinByHash} pinByHash
|
|
221
204
|
* @property {hashMetadata} hashMetadata
|
|
222
|
-
* @property {hashPinPolicy} hashPinPolicy
|
|
223
205
|
* @property {pinFileToIPFS} pinFileToIPFS
|
|
224
206
|
* @property {pinFromFS} pinFromFS
|
|
225
207
|
* @property {pinJSONToIPFS} pinJSONToIPFS
|
|
226
208
|
* @property {pinJobs} pinJobs
|
|
227
209
|
* @property {unpin} unpin
|
|
228
|
-
* @property {userPinPolicy} userPinPolicy
|
|
229
210
|
* @property {testAuthentication} testAuthentication
|
|
230
211
|
* @property {pinList} pinList
|
|
231
212
|
* @property {userPinnedDataTotal} userPinnedDataTotal
|
|
@@ -248,9 +229,6 @@ export default function pinataClient(pinataApiKey, pinataSecretApiKey) {
|
|
|
248
229
|
client.hashMetadata = function (ipfsPinHash, metadata) {
|
|
249
230
|
return hashMetadata(pinataApiKey, pinataSecretApiKey, ipfsPinHash, metadata);
|
|
250
231
|
};
|
|
251
|
-
client.hashPinPolicy = function (ipfsPinHash, newPinPolicy) {
|
|
252
|
-
return hashPinPolicy(pinataApiKey, pinataSecretApiKey, ipfsPinHash, newPinPolicy);
|
|
253
|
-
};
|
|
254
232
|
client.pinFileToIPFS = function (readableStream, options) {
|
|
255
233
|
return pinFileToIPFS(pinataApiKey, pinataSecretApiKey, readableStream, options);
|
|
256
234
|
};
|
|
@@ -266,9 +244,6 @@ export default function pinataClient(pinataApiKey, pinataSecretApiKey) {
|
|
|
266
244
|
client.unpin = function (hashToUnpin) {
|
|
267
245
|
return unpin(pinataApiKey, pinataSecretApiKey, hashToUnpin);
|
|
268
246
|
};
|
|
269
|
-
client.userPinPolicy = function (newPinPolicy) {
|
|
270
|
-
return userPinPolicy(pinataApiKey, pinataSecretApiKey, newPinPolicy);
|
|
271
|
-
};
|
|
272
247
|
client.testAuthentication = function () {
|
|
273
248
|
return testAuthentication(pinataApiKey, pinataSecretApiKey);
|
|
274
249
|
};
|
package/types/index.d.ts
CHANGED
|
@@ -100,13 +100,6 @@
|
|
|
100
100
|
* @param {PinataMetadata} metadata
|
|
101
101
|
* @returns {Promise<any>}
|
|
102
102
|
*/
|
|
103
|
-
/**
|
|
104
|
-
* Hash pin policy
|
|
105
|
-
* @callback hashPinPolicy
|
|
106
|
-
* @param {string} ipfsPinHash
|
|
107
|
-
* @param {{regions: PinataPinPolicyItem[]}} newPinPolicy
|
|
108
|
-
* @returns {Promise<any>}
|
|
109
|
-
*/
|
|
110
103
|
/**
|
|
111
104
|
* Pin by hash
|
|
112
105
|
* @callback pinByHash
|
|
@@ -147,12 +140,6 @@
|
|
|
147
140
|
* @param {string} hashToUnpin
|
|
148
141
|
* @returns {Promise<any>}
|
|
149
142
|
*/
|
|
150
|
-
/**
|
|
151
|
-
* User Pin Policy
|
|
152
|
-
* @callback userPinPolicy
|
|
153
|
-
* @param {{regions: PinataPinPolicyItem[]}} newPinPolicy
|
|
154
|
-
* @returns {Promise<any>}
|
|
155
|
-
*/
|
|
156
143
|
/**
|
|
157
144
|
* Test Authentication
|
|
158
145
|
* @callback testAuthentication
|
|
@@ -173,13 +160,11 @@
|
|
|
173
160
|
* @typedef PinataClient
|
|
174
161
|
* @property {pinByHash} pinByHash
|
|
175
162
|
* @property {hashMetadata} hashMetadata
|
|
176
|
-
* @property {hashPinPolicy} hashPinPolicy
|
|
177
163
|
* @property {pinFileToIPFS} pinFileToIPFS
|
|
178
164
|
* @property {pinFromFS} pinFromFS
|
|
179
165
|
* @property {pinJSONToIPFS} pinJSONToIPFS
|
|
180
166
|
* @property {pinJobs} pinJobs
|
|
181
167
|
* @property {unpin} unpin
|
|
182
|
-
* @property {userPinPolicy} userPinPolicy
|
|
183
168
|
* @property {testAuthentication} testAuthentication
|
|
184
169
|
* @property {pinList} pinList
|
|
185
170
|
* @property {userPinnedDataTotal} userPinnedDataTotal
|
|
@@ -284,12 +269,6 @@ export type PinataPinListResponse = {
|
|
|
284
269
|
* Hash meta data
|
|
285
270
|
*/
|
|
286
271
|
export type hashMetadata = (ipfsPinHash: string, metadata: PinataMetadata) => Promise<any>;
|
|
287
|
-
/**
|
|
288
|
-
* Hash pin policy
|
|
289
|
-
*/
|
|
290
|
-
export type hashPinPolicy = (ipfsPinHash: string, newPinPolicy: {
|
|
291
|
-
regions: PinataPinPolicyItem[];
|
|
292
|
-
}) => Promise<any>;
|
|
293
272
|
/**
|
|
294
273
|
* Pin by hash
|
|
295
274
|
*/
|
|
@@ -314,12 +293,6 @@ export type pinJSONToIPFS = (body: Object, options?: PinataPinOptions | undefine
|
|
|
314
293
|
* Unpin
|
|
315
294
|
*/
|
|
316
295
|
export type unpin = (hashToUnpin: string) => Promise<any>;
|
|
317
|
-
/**
|
|
318
|
-
* User Pin Policy
|
|
319
|
-
*/
|
|
320
|
-
export type userPinPolicy = (newPinPolicy: {
|
|
321
|
-
regions: PinataPinPolicyItem[];
|
|
322
|
-
}) => Promise<any>;
|
|
323
296
|
/**
|
|
324
297
|
* Test Authentication
|
|
325
298
|
*/
|
|
@@ -337,26 +310,22 @@ export type userPinnedDataTotal = () => Promise<number>;
|
|
|
337
310
|
export type PinataClient = {
|
|
338
311
|
pinByHash: pinByHash;
|
|
339
312
|
hashMetadata: hashMetadata;
|
|
340
|
-
hashPinPolicy: hashPinPolicy;
|
|
341
313
|
pinFileToIPFS: pinFileToIPFS;
|
|
342
314
|
pinFromFS: pinFromFS;
|
|
343
315
|
pinJSONToIPFS: pinJSONToIPFS;
|
|
344
316
|
pinJobs: pinJobs;
|
|
345
317
|
unpin: unpin;
|
|
346
|
-
userPinPolicy: userPinPolicy;
|
|
347
318
|
testAuthentication: testAuthentication;
|
|
348
319
|
pinList: pinList;
|
|
349
320
|
userPinnedDataTotal: userPinnedDataTotal;
|
|
350
321
|
};
|
|
351
322
|
import pinByHash from "./commands/pinning/pinByHash";
|
|
352
323
|
import hashMetadata from "./commands/pinning/hashMetadata";
|
|
353
|
-
import hashPinPolicy from "./commands/pinning/hashPinPolicy";
|
|
354
324
|
import pinFileToIPFS from "./commands/pinning/pinFileToIPFS";
|
|
355
325
|
import pinFromFS from "./commands/pinning/pinFromFS";
|
|
356
326
|
import pinJSONToIPFS from "./commands/pinning/pinJSONToIPFS";
|
|
357
327
|
import pinJobs from "./commands/pinning/pinJobs/pinJobs";
|
|
358
328
|
import unpin from "./commands/pinning/unpin";
|
|
359
|
-
import userPinPolicy from "./commands/pinning/userPinPolicy";
|
|
360
329
|
import testAuthentication from "./commands/data/testAuthentication";
|
|
361
330
|
import pinList from "./commands/data/pinList/pinList";
|
|
362
331
|
import userPinnedDataTotal from "./commands/data/userPinnedDataTotal";
|