Skip to content

Commit 8043817

Browse files
authored
fix(ipfs): replace usage meta by info (#694)
1 parent dfab7da commit 8043817

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

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

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

33-
return { appId: data.app_id, url: data.url } as PinCIDMeta
33+
return { id: data.id } as PinCIDMeta
3434
}
3535

3636
const unmarshalPinCID = (data: unknown) => {
@@ -55,7 +55,13 @@ const unmarshalPinInfo = (data: unknown) => {
5555
)
5656
}
5757

58-
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
5965
}
6066

6167
export const unmarshalPin = (data: unknown) => {
@@ -89,6 +95,7 @@ export const unmarshalVolume = (data: unknown) => {
8995
name: data.name,
9096
projectId: data.project_id,
9197
region: data.region,
98+
size: data.size,
9299
tags: data.tags,
93100
updatedAt: unmarshalDate(data.updated_at),
94101
} as Volume
@@ -132,14 +139,6 @@ export const unmarshalReplacePinResponse = (data: unknown) => {
132139
} as ReplacePinResponse
133140
}
134141

135-
const marshalPinCIDMeta = (
136-
request: PinCIDMeta,
137-
defaults: DefaultValues,
138-
): Record<string, unknown> => ({
139-
app_id: request.appId,
140-
url: request.url,
141-
})
142-
143142
const marshalPinOptions = (
144143
request: PinOptions,
145144
defaults: DefaultValues,
@@ -153,7 +152,6 @@ export const marshalCreatePinByCIDRequest = (
153152
defaults: DefaultValues,
154153
): Record<string, unknown> => ({
155154
cid: request.cid,
156-
meta: request.meta ? marshalPinCIDMeta(request.meta, defaults) : undefined,
157155
name: request.name,
158156
origins: request.origins,
159157
pin_options: request.pinOptions
@@ -187,7 +185,6 @@ export const marshalReplacePinRequest = (
187185
defaults: DefaultValues,
188186
): Record<string, unknown> => ({
189187
cid: request.cid,
190-
meta: request.meta ? marshalPinCIDMeta(request.meta, defaults) : undefined,
191188
name: request.name,
192189
origins: request.origins,
193190
pin_options: request.pinOptions

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

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

4242
export interface PinCIDMeta {
43-
appId: string
44-
url?: string
43+
id?: string
4544
}
4645

4746
export interface PinInfo {
4847
statusDetails?: string
48+
id?: string
49+
url?: string
50+
size?: number
51+
progress?: number
4952
}
5053

5154
export interface PinOptions {
@@ -66,6 +69,7 @@ export interface Volume {
6669
updatedAt?: Date
6770
tags: string[]
6871
name: string
72+
size?: number
6973
}
7074

7175
export type CreateVolumeRequest = {
@@ -141,7 +145,6 @@ export type CreatePinByCIDRequest = {
141145
cid: string
142146
name?: string
143147
origins?: string[]
144-
meta?: PinCIDMeta
145148
pinOptions?: PinOptions
146149
}
147150

@@ -156,7 +159,6 @@ export type ReplacePinRequest = {
156159
cid: string
157160
name?: string
158161
origins?: string[]
159-
meta?: PinCIDMeta
160162
pinOptions?: PinOptions
161163
}
162164

0 commit comments

Comments
 (0)