forked from PinataCloud/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbacklog
173 lines (128 loc) · 4.71 KB
/
backlog
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
--- GROUPS ---
### Listing Files in a Group
To list all the files that are part of a group you can use the [list](/sdk/files/list) method and the `group` filter.
```typescript
import { PinataSDK } from "pinata";
const pinata = new PinataSDK({
pinataJwt: process.env.PINATA_JWT!,
pinataGateway: "example-gateway.mypinata.cloud",
});
const files = await pinata
.listFiles()
.group('648767d5-0a80-4b3a-9669-93693e4a0519')
```
This will return an array of [PinListItem](/ipfs-sdk/types#pinlistitem) objects.
```typescript
[
{
id: "2fd6175d-9220-4ea4-8939-b9cb572f08a4",
name: "hello.txt",
cid: "bafkreibm6jg3ux5qumhcn2b3flc3tyu6dmlb4xa7u5bf44yegnrjhc4yeq",
size: 5,
number_of_files: 1,
mime_type: "text/plain",
group_id: null,
updated_at: "2024-08-27T19:14:36.978738Z",
created_at: "2024-08-27T17:14:42.315122Z",
}
]
```
### Add CIDs to a Group // TO DO
<Note>
At this time, CIDs can only belong to one group at a time. If a CID is added
to a Group while already being part of another, it will move the CID to the
latest requested Group.
</Note>
After a Group is created you can add CIDs to it using the [addCids](/ipfs-sdk/groups/add-cids) method. Just pass in the `groupId` and an array of `cids`.
```typescript
import { PinataSDK } from "pinata";
const pinata = new PinataSDK({
pinataJwt: process.env.PINATA_JWT!,
pinataGateway: "example-gateway.mypinata.cloud",
});
const group = await pinata.groups.addCids({
groupId: "3778c10d-452e-4def-8299-ee6bc548bdb0",
cids: ["QmVLwvmGehsrNEvhcCnnsw5RQNseohgEkFNN1848zNzdng"],
});
```
If successful, the endpoint will return an `OK` response.
### Removing CIDs from a Group // TO DO
To remove CIDs from a Group, you would follow the same pattern as `addCids` except using the [removeCids](/ipfs-sdk/groups/remove-files) method instead.
```typescript
import { PinataSDK } from "pinata";
const pinata = new PinataSDK({
pinataJwt: process.env.PINATA_JWT!,
pinataGateway: "example-gateway.mypinata.cloud",
});
const group = await pinata.groups.removeCids({
groupId: "3778c10d-452e-4def-8299-ee6bc548bdb0",
cids: ["QmVLwvmGehsrNEvhcCnnsw5RQNseohgEkFNN1848zNzdng"],
});
```
If successful, the endpoint will return an `OK` response.
## Pinata App
If you just need to organize your files through a web interface, then the Pinata Web App can do just that!
### Create a Group
Navigate to the Groups tab, click "New" in the top right corner, give it a name, then click "Create."
<video
autoPlay
muted
loop
playsinline
className="w-full aspect-video"
src="https://docs.mypinata.cloud/ipfs/bafybeic42gzphbbgnlpenvnaxfjvyohoj7p5nuhpjbfgep6xzxevnigety"
></video>
### Add Files to Groups
<Note>
At this time, CIDs can only belong to one group at a time. If a CID is added
to a Group while already being part of another, it will move the CID to the
latest requested Group.
</Note>
There are a few ways you can add files to a Group after you have created one.
#### Upload Directly
After creating a group, you can click on it, then click the "Add" button in the top right to add files directly to the group.
<video
autoPlay
muted
loop
playsinline
className="w-full aspect-video"
src="https://docs.mypinata.cloud/ipfs/bafybeiateld4izmgvjo27hnmq5n6y6zxc576qifww32pe22awuoqibubky"
></video>
#### File Details
If you already have files uploaded and you just need to add it to a Group, you can click on the file details button on the far right and select "Add to Group"
<video
autoPlay
muted
loop
playsinline
className="w-full aspect-video"
src="https://docs.mypinata.cloud/ipfs/bafybeifqkibs5htg56dtkjcwf2tmqvqst2wxomqvmlyxrln3vzur3km6nm"
></video>
#### Bulk Add
To add lots of files at once, you can select multiple files from the Files page then click the "Add to Group" button from the toolbar.
<video
autoPlay
muted
loop
playsinline
className="w-full aspect-video"
src="https://docs.mypinata.cloud/ipfs/bafybeiert2udnwy7ze3vrgaydqmprpjenbp5fpcbv7hyofovpitmcbtrzi"
></video>
### Remove Files from Group
While inside the Group view, you can remove files from a group by either clicking on the file detail for a single file or by using the multi-select tool.
### Deleting Groups
<Note>
Deleting a Group that has CIDs inside of it will not unpin/delete the CIDs.
Please follow the [unpin guide](pinning/deleting-files) to actually delete a
file from your account
</Note>
To delete a Group, navigate to the Groups page, click on the details of the Group, and select the "Delete Group" from the dropdown.
<video
autoPlay
muted
loop
playsinline
className="w-full aspect-video"
src="https://docs.mypinata.cloud/ipfs/bafybeidkxgiup4rmv5jhyra5g5tfoscutknifsuzsbbmgyqabzmmzsdt34"
></video>