Skip to content

feat(ipfs): remove useless fields in ipfs api #959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/clients/src/api/ipfs/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export type {
PinCIDMeta,
PinDetails,
PinInfo,
PinOptions,
PinStatus,
ReplacePinRequest,
ReplacePinResponse,
Expand Down
18 changes: 0 additions & 18 deletions packages/clients/src/api/ipfs/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import type {
PinCID,
PinCIDMeta,
PinInfo,
PinOptions,
ReplacePinRequest,
ReplacePinResponse,
UpdateVolumeRequest,
Expand Down Expand Up @@ -196,24 +195,13 @@ export const unmarshalReplacePinResponse = (data: unknown) => {
} as ReplacePinResponse
}

const marshalPinOptions = (
request: PinOptions,
defaults: DefaultValues,
): Record<string, unknown> => ({
replication_count: request.replicationCount,
required_zones: request.requiredZones,
})

export const marshalCreatePinByCIDRequest = (
request: CreatePinByCIDRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
cid: request.cid,
name: request.name,
origins: request.origins,
pin_options: request.pinOptions
? marshalPinOptions(request.pinOptions, defaults)
: undefined,
volume_id: request.volumeId,
})

Expand All @@ -222,9 +210,6 @@ export const marshalCreatePinByURLRequest = (
defaults: DefaultValues,
): Record<string, unknown> => ({
name: request.name,
pin_options: request.pinOptions
? marshalPinOptions(request.pinOptions, defaults)
: undefined,
url: request.url,
volume_id: request.volumeId,
})
Expand Down Expand Up @@ -272,9 +257,6 @@ export const marshalReplacePinRequest = (
cid: request.cid,
name: request.name,
origins: request.origins,
pin_options: request.pinOptions
? marshalPinOptions(request.pinOptions, defaults)
: undefined,
volume_id: request.volumeId,
})

Expand Down
11 changes: 0 additions & 11 deletions packages/clients/src/api/ipfs/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ export interface PinInfo {
statusDetails: PinDetails
}

export interface PinOptions {
requiredZones: string[]
replicationCount: number
}

export interface ReplacePinResponse {
pin?: Pin
}
Expand Down Expand Up @@ -205,8 +200,6 @@ export type CreatePinByURLRequest = {
url: string
/** Pin name. */
name?: string
/** Pin options. */
pinOptions?: PinOptions
}

export type CreatePinByCIDRequest = {
Expand All @@ -223,8 +216,6 @@ export type CreatePinByCIDRequest = {
origins?: string[]
/** Pin name. */
name?: string
/** Pin options. */
pinOptions?: PinOptions
}

export type ReplacePinRequest = {
Expand All @@ -243,8 +234,6 @@ export type ReplacePinRequest = {
name?: string
/** Node containing the content you want to pin. */
origins?: string[]
/** Pin options. */
pinOptions?: PinOptions
}

export type GetPinRequest = {
Expand Down