pinata 1.10.1 → 2.1.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/README.md CHANGED
@@ -4,9 +4,6 @@
4
4
 
5
5
  The new all-in-one Pinata SDK
6
6
 
7
- > [!IMPORTANT]
8
- > The `v1.*.*` release is a breaking change and does not support IPFS. Please use the [`pinata-web3`](https://github.com/PinataCloud/pinata-web3) SDK.
9
-
10
7
  ## Quickstart
11
8
 
12
9
  [View the full documentation here](https://docs.pinata.cloud/sdk-beta/getting-started)
@@ -45,7 +42,7 @@ const pinata = new PinataSDK({
45
42
  async function main() {
46
43
  try {
47
44
  const file = new File(["hello"], "Testing.txt", { type: "text/plain" });
48
- const upload = await pinata.upload.file(file);
45
+ const upload = await pinata.upload.public.file(file);
49
46
  console.log(upload);
50
47
  } catch (error) {
51
48
  console.log(error);
@@ -59,14 +56,17 @@ This will return an object like the following:
59
56
 
60
57
  ```typescript
61
58
  {
62
- id: "349f1bb2-5d59-4cab-9966-e94c028a05b7",
63
- name: "file.txt",
64
- cid: "bafybeihgxdzljxb26q6nf3r3eifqeedsvt2eubqtskghpme66cgjyw4fra",
65
- size: 4682779,
66
- number_of_files: 1,
67
- mime_type: "text/plain",
68
- user_id: "7a484d2c-4219-4f80-9d9d-86b42461e71a",
69
- group_id: null
59
+ id: "0195a5c4-242f-7c01-bee8-f34a9e8e804b",
60
+ user_id: "87ef31fe-519b-4ffe-90d9-987771247827",
61
+ group_id: null,
62
+ name: "hello.txt",
63
+ cid: "bafkreid7qoywk77r7rj3slobqfekdvs57qwuwh5d2z3sqsw52iabe3mqne",
64
+ created_at: "2025-03-17T20:20:50.057Z",
65
+ size: 12,
66
+ number_of_files: 1,
67
+ mime_type: "text/plain",
68
+ vectorized: false,
69
+ network: "public",
70
70
  }
71
71
  ```
72
72
 
@@ -84,7 +84,7 @@ const pinata = new PinataSDK({
84
84
 
85
85
  async function main() {
86
86
  try {
87
- const data = await pinata.gateways.get("bafkreibm6jg3ux5qumhcn2b3flc3tyu6dmlb4xa7u5bf44yegnrjhc4yeq");
87
+ const data = await pinata.gateways.public.get("bafkreibm6jg3ux5qumhcn2b3flc3tyu6dmlb4xa7u5bf44yegnrjhc4yeq");
88
88
  console.log(data)
89
89
  } catch (error) {
90
90
  console.log(error);