Skip to content

Commit 887e717

Browse files
authored
fix(ipfs): replace usage meta by info (#706)
1 parent 787c7c6 commit 887e717

File tree

3 files changed

+35
-28
lines changed

3 files changed

+35
-28
lines changed

packages/clients/src/api/ipfs/v1alpha1/api.gen.ts

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ export class API extends ParentAPI {
5050
public static readonly LOCALITIES: Region[] = ['fr-par', 'nl-ams', 'pl-waw']
5151

5252
/**
53-
* Create a new volume from a Project ID. Volume is identified by an ID and
54-
* used to host pin references. Volume is personal (at least to your
55-
* organization) even if IPFS blocks and CID are available to anyone. Should
56-
* be the first command you made because every pin must be attached to a
57-
* volume.
53+
* Create a new volume. Create a new volume from a Project ID. Volume is
54+
* identified by an ID and used to host pin references. Volume is personal (at
55+
* least to your organization) even if IPFS blocks and CID are available to
56+
* anyone. Should be the first command you made because every pin must be
57+
* attached to a volume.
5858
*
5959
* @param request - The request {@link CreateVolumeRequest}
6060
* @returns A Promise of Volume
@@ -76,7 +76,8 @@ export class API extends ParentAPI {
7676
)
7777

7878
/**
79-
* Retrieve information about a specific volume.
79+
* Get information about a volume. Retrieve information about a specific
80+
* volume.
8081
*
8182
* @param request - The request {@link GetVolumeRequest}
8283
* @returns A Promise of Volume
@@ -118,7 +119,8 @@ export class API extends ParentAPI {
118119
)
119120

120121
/**
121-
* Retrieve information about all volumes from a Project ID.
122+
* List all volumes by a Project ID. Retrieve information about all volumes
123+
* from a Project ID.
122124
*
123125
* @param request - The request {@link ListVolumesRequest}
124126
* @returns A Promise of ListVolumesResponse
@@ -127,7 +129,7 @@ export class API extends ParentAPI {
127129
enrichForPagination('volumes', this.pageOfListVolumes, request)
128130

129131
/**
130-
* Update volume information (tag, name...).
132+
* Update volume information. Update volume information (tag, name...).
131133
*
132134
* @param request - The request {@link UpdateVolumeRequest}
133135
* @returns A Promise of Volume
@@ -149,8 +151,9 @@ export class API extends ParentAPI {
149151
)
150152

151153
/**
152-
* Delete a volume by its ID and every pin attached to this volume. Can take a
153-
* while, depending of your pinned content.
154+
* Delete an existing volume. Delete a volume by its ID and every pin attached
155+
* to this volume. This process can take a while to conclude, depending on the
156+
* size of your pinned content.
154157
*
155158
* @param request - The request {@link DeleteVolumeRequest}
156159
*/
@@ -164,7 +167,7 @@ export class API extends ParentAPI {
164167
})
165168

166169
/**
167-
* Create a pin request. Will fetch and store the content pointed by the
170+
* Create a pin by URL. Will fetch and store the content pointed by the
168171
* provided URL. The content must be available on the public IPFS network. The
169172
* content (IPFS blocks) will be host by the pinning service until pin
170173
* deletion. From that point, any other IPFS peer can fetch and host your
@@ -192,7 +195,7 @@ export class API extends ParentAPI {
192195
)
193196

194197
/**
195-
* Create a pin request. Will fetch and store the content pointed by the
198+
* Create a pin by CID. Will fetch and store the content pointed by the
196199
* provided CID. The content must be available on the public IPFS network. The
197200
* content (IPFS blocks) will be host by the pinning service until pin
198201
* deletion. From that point, any other IPFS peer can fetch and host your
@@ -236,8 +239,8 @@ export class API extends ParentAPI {
236239
)
237240

238241
/**
239-
* Retrieve information about the provided pin ID (not the CID): status, last
240-
* modification, CID.
242+
* Get pin information. Retrieve information about the provided **pin ID**,
243+
* such as status, last modification, and CID.
241244
*
242245
* @param request - The request {@link GetPinRequest}
243246
* @returns A Promise of Pin
@@ -299,7 +302,8 @@ export class API extends ParentAPI {
299302
)
300303

301304
/**
302-
* Retrieve information about all pins into a volume.
305+
* List all pins within a volume. Retrieve information about all pins into a
306+
* volume.
303307
*
304308
* @param request - The request {@link ListPinsRequest}
305309
* @returns A Promise of ListPinsResponse
@@ -308,8 +312,9 @@ export class API extends ParentAPI {
308312
enrichForPagination('pins', this.pageOfListPins, request)
309313

310314
/**
311-
* Create an unpin request. If the pin was the last to target a specific CID,
312-
* the content will be erase from storage. The function is indempotent.
315+
* Create an unpin request. An unpin request means that you no longer own the
316+
* content. This content can therefore be removed and no longer provided on
317+
* the IPFS network.
313318
*
314319
* @param request - The request {@link DeletePinRequest}
315320
*/

packages/clients/src/api/ipfs/v1alpha1/marshalling.gen.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ const unmarshalPinCIDMeta = (data: unknown) => {
3030
)
3131
}
3232

33-
return {
34-
id: data.id,
35-
progress: data.progress,
36-
size: data.size,
37-
url: data.url,
38-
} as PinCIDMeta
33+
return { id: data.id } as PinCIDMeta
3934
}
4035

4136
const unmarshalPinCID = (data: unknown) => {
@@ -60,7 +55,13 @@ const unmarshalPinInfo = (data: unknown) => {
6055
)
6156
}
6257

63-
return { statusDetails: data.status_details } as PinInfo
58+
return {
59+
id: data.id,
60+
progress: data.progress,
61+
size: data.size,
62+
statusDetails: data.status_details,
63+
url: data.url,
64+
} as PinInfo
6465
}
6566

6667
export const unmarshalPin = (data: unknown) => {

packages/clients/src/api/ipfs/v1alpha1/types.gen.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ export interface PinCID {
4040
}
4141

4242
export interface PinCIDMeta {
43-
id: string
44-
url?: string
45-
size?: number
46-
progress?: number
43+
id?: string
4744
}
4845

4946
export interface PinInfo {
5047
statusDetails?: string
48+
id?: string
49+
url?: string
50+
size?: number
51+
progress?: number
5152
}
5253

5354
export interface PinOptions {

0 commit comments

Comments
 (0)