@textile/buckets-grpc
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -52,2 +52,11 @@ // package: buckets.pb | ||
type APIListIpfsPath = { | ||
readonly methodName: string; | ||
readonly service: typeof API; | ||
readonly requestStream: false; | ||
readonly responseStream: false; | ||
readonly requestType: typeof buckets_pb.ListIpfsPathRequest; | ||
readonly responseType: typeof buckets_pb.ListIpfsPathReply; | ||
}; | ||
type APIPushPath = { | ||
@@ -71,2 +80,20 @@ readonly methodName: string; | ||
type APIPullIpfsPath = { | ||
readonly methodName: string; | ||
readonly service: typeof API; | ||
readonly requestStream: false; | ||
readonly responseStream: true; | ||
readonly requestType: typeof buckets_pb.PullIpfsPathRequest; | ||
readonly responseType: typeof buckets_pb.PullIpfsPathReply; | ||
}; | ||
type APISetPath = { | ||
readonly methodName: string; | ||
readonly service: typeof API; | ||
readonly requestStream: false; | ||
readonly responseStream: false; | ||
readonly requestType: typeof buckets_pb.SetPathRequest; | ||
readonly responseType: typeof buckets_pb.SetPathReply; | ||
}; | ||
type APIRemove = { | ||
@@ -133,4 +160,7 @@ readonly methodName: string; | ||
static readonly ListPath: APIListPath; | ||
static readonly ListIpfsPath: APIListIpfsPath; | ||
static readonly PushPath: APIPushPath; | ||
static readonly PullPath: APIPullPath; | ||
static readonly PullIpfsPath: APIPullIpfsPath; | ||
static readonly SetPath: APISetPath; | ||
static readonly Remove: APIRemove; | ||
@@ -221,4 +251,23 @@ static readonly RemovePath: APIRemovePath; | ||
): UnaryResponse; | ||
listIpfsPath( | ||
requestMessage: buckets_pb.ListIpfsPathRequest, | ||
metadata: grpc.Metadata, | ||
callback: (error: ServiceError|null, responseMessage: buckets_pb.ListIpfsPathReply|null) => void | ||
): UnaryResponse; | ||
listIpfsPath( | ||
requestMessage: buckets_pb.ListIpfsPathRequest, | ||
callback: (error: ServiceError|null, responseMessage: buckets_pb.ListIpfsPathReply|null) => void | ||
): UnaryResponse; | ||
pushPath(metadata?: grpc.Metadata): BidirectionalStream<buckets_pb.PushPathRequest, buckets_pb.PushPathReply>; | ||
pullPath(requestMessage: buckets_pb.PullPathRequest, metadata?: grpc.Metadata): ResponseStream<buckets_pb.PullPathReply>; | ||
pullIpfsPath(requestMessage: buckets_pb.PullIpfsPathRequest, metadata?: grpc.Metadata): ResponseStream<buckets_pb.PullIpfsPathReply>; | ||
setPath( | ||
requestMessage: buckets_pb.SetPathRequest, | ||
metadata: grpc.Metadata, | ||
callback: (error: ServiceError|null, responseMessage: buckets_pb.SetPathReply|null) => void | ||
): UnaryResponse; | ||
setPath( | ||
requestMessage: buckets_pb.SetPathRequest, | ||
callback: (error: ServiceError|null, responseMessage: buckets_pb.SetPathReply|null) => void | ||
): UnaryResponse; | ||
remove( | ||
@@ -225,0 +274,0 @@ requestMessage: buckets_pb.RemoveRequest, |
@@ -58,2 +58,11 @@ // package: buckets.pb | ||
API.ListIpfsPath = { | ||
methodName: "ListIpfsPath", | ||
service: API, | ||
requestStream: false, | ||
responseStream: false, | ||
requestType: buckets_pb.ListIpfsPathRequest, | ||
responseType: buckets_pb.ListIpfsPathReply | ||
}; | ||
API.PushPath = { | ||
@@ -77,2 +86,20 @@ methodName: "PushPath", | ||
API.PullIpfsPath = { | ||
methodName: "PullIpfsPath", | ||
service: API, | ||
requestStream: false, | ||
responseStream: true, | ||
requestType: buckets_pb.PullIpfsPathRequest, | ||
responseType: buckets_pb.PullIpfsPathReply | ||
}; | ||
API.SetPath = { | ||
methodName: "SetPath", | ||
service: API, | ||
requestStream: false, | ||
responseStream: false, | ||
requestType: buckets_pb.SetPathRequest, | ||
responseType: buckets_pb.SetPathReply | ||
}; | ||
API.Remove = { | ||
@@ -294,2 +321,33 @@ methodName: "Remove", | ||
APIClient.prototype.listIpfsPath = function listIpfsPath(requestMessage, metadata, callback) { | ||
if (arguments.length === 2) { | ||
callback = arguments[1]; | ||
} | ||
var client = grpc.unary(API.ListIpfsPath, { | ||
request: requestMessage, | ||
host: this.serviceHost, | ||
metadata: metadata, | ||
transport: this.options.transport, | ||
debug: this.options.debug, | ||
onEnd: function (response) { | ||
if (callback) { | ||
if (response.status !== grpc.Code.OK) { | ||
var err = new Error(response.statusMessage); | ||
err.code = response.status; | ||
err.metadata = response.trailers; | ||
callback(err, null); | ||
} else { | ||
callback(null, response.message); | ||
} | ||
} | ||
} | ||
}); | ||
return { | ||
cancel: function () { | ||
callback = null; | ||
client.close(); | ||
} | ||
}; | ||
}; | ||
APIClient.prototype.pushPath = function pushPath(metadata) { | ||
@@ -379,2 +437,72 @@ var listeners = { | ||
APIClient.prototype.pullIpfsPath = function pullIpfsPath(requestMessage, metadata) { | ||
var listeners = { | ||
data: [], | ||
end: [], | ||
status: [] | ||
}; | ||
var client = grpc.invoke(API.PullIpfsPath, { | ||
request: requestMessage, | ||
host: this.serviceHost, | ||
metadata: metadata, | ||
transport: this.options.transport, | ||
debug: this.options.debug, | ||
onMessage: function (responseMessage) { | ||
listeners.data.forEach(function (handler) { | ||
handler(responseMessage); | ||
}); | ||
}, | ||
onEnd: function (status, statusMessage, trailers) { | ||
listeners.status.forEach(function (handler) { | ||
handler({ code: status, details: statusMessage, metadata: trailers }); | ||
}); | ||
listeners.end.forEach(function (handler) { | ||
handler({ code: status, details: statusMessage, metadata: trailers }); | ||
}); | ||
listeners = null; | ||
} | ||
}); | ||
return { | ||
on: function (type, handler) { | ||
listeners[type].push(handler); | ||
return this; | ||
}, | ||
cancel: function () { | ||
listeners = null; | ||
client.close(); | ||
} | ||
}; | ||
}; | ||
APIClient.prototype.setPath = function setPath(requestMessage, metadata, callback) { | ||
if (arguments.length === 2) { | ||
callback = arguments[1]; | ||
} | ||
var client = grpc.unary(API.SetPath, { | ||
request: requestMessage, | ||
host: this.serviceHost, | ||
metadata: metadata, | ||
transport: this.options.transport, | ||
debug: this.options.debug, | ||
onEnd: function (response) { | ||
if (callback) { | ||
if (response.status !== grpc.Code.OK) { | ||
var err = new Error(response.statusMessage); | ||
err.code = response.status; | ||
err.metadata = response.trailers; | ||
callback(err, null); | ||
} else { | ||
callback(null, response.message); | ||
} | ||
} | ||
} | ||
}); | ||
return { | ||
cancel: function () { | ||
callback = null; | ||
client.close(); | ||
} | ||
}; | ||
}; | ||
APIClient.prototype.remove = function remove(requestMessage, metadata, callback) { | ||
@@ -381,0 +509,0 @@ if (arguments.length === 2) { |
@@ -46,2 +46,5 @@ // package: buckets.pb | ||
getBootstrapcid(): string; | ||
setBootstrapcid(value: string): void; | ||
serializeBinary(): Uint8Array; | ||
@@ -60,2 +63,3 @@ toObject(includeInstance?: boolean): InitRequest.AsObject; | ||
name: string, | ||
bootstrapcid: string, | ||
} | ||
@@ -253,4 +257,4 @@ } | ||
clearItem(): void; | ||
getItem(): ListPathReply.Item | undefined; | ||
setItem(value?: ListPathReply.Item): void; | ||
getItem(): ListPathItem | undefined; | ||
setItem(value?: ListPathItem): void; | ||
@@ -274,49 +278,91 @@ hasRoot(): boolean; | ||
export type AsObject = { | ||
item?: ListPathReply.Item.AsObject, | ||
item?: ListPathItem.AsObject, | ||
root?: Root.AsObject, | ||
} | ||
} | ||
export class Item extends jspb.Message { | ||
getCid(): string; | ||
setCid(value: string): void; | ||
export class ListPathItem extends jspb.Message { | ||
getCid(): string; | ||
setCid(value: string): void; | ||
getName(): string; | ||
setName(value: string): void; | ||
getName(): string; | ||
setName(value: string): void; | ||
getPath(): string; | ||
setPath(value: string): void; | ||
getPath(): string; | ||
setPath(value: string): void; | ||
getSize(): number; | ||
setSize(value: number): void; | ||
getSize(): number; | ||
setSize(value: number): void; | ||
getIsdir(): boolean; | ||
setIsdir(value: boolean): void; | ||
getIsdir(): boolean; | ||
setIsdir(value: boolean): void; | ||
clearItemsList(): void; | ||
getItemsList(): Array<ListPathReply.Item>; | ||
setItemsList(value: Array<ListPathReply.Item>): void; | ||
addItems(value?: ListPathReply.Item, index?: number): ListPathReply.Item; | ||
clearItemsList(): void; | ||
getItemsList(): Array<ListPathItem>; | ||
setItemsList(value: Array<ListPathItem>): void; | ||
addItems(value?: ListPathItem, index?: number): ListPathItem; | ||
serializeBinary(): Uint8Array; | ||
toObject(includeInstance?: boolean): Item.AsObject; | ||
static toObject(includeInstance: boolean, msg: Item): Item.AsObject; | ||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; | ||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; | ||
static serializeBinaryToWriter(message: Item, writer: jspb.BinaryWriter): void; | ||
static deserializeBinary(bytes: Uint8Array): Item; | ||
static deserializeBinaryFromReader(message: Item, reader: jspb.BinaryReader): Item; | ||
serializeBinary(): Uint8Array; | ||
toObject(includeInstance?: boolean): ListPathItem.AsObject; | ||
static toObject(includeInstance: boolean, msg: ListPathItem): ListPathItem.AsObject; | ||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; | ||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; | ||
static serializeBinaryToWriter(message: ListPathItem, writer: jspb.BinaryWriter): void; | ||
static deserializeBinary(bytes: Uint8Array): ListPathItem; | ||
static deserializeBinaryFromReader(message: ListPathItem, reader: jspb.BinaryReader): ListPathItem; | ||
} | ||
export namespace ListPathItem { | ||
export type AsObject = { | ||
cid: string, | ||
name: string, | ||
path: string, | ||
size: number, | ||
isdir: boolean, | ||
itemsList: Array<ListPathItem.AsObject>, | ||
} | ||
} | ||
export namespace Item { | ||
export type AsObject = { | ||
cid: string, | ||
name: string, | ||
path: string, | ||
size: number, | ||
isdir: boolean, | ||
itemsList: Array<ListPathReply.Item.AsObject>, | ||
} | ||
export class ListIpfsPathRequest extends jspb.Message { | ||
getPath(): string; | ||
setPath(value: string): void; | ||
serializeBinary(): Uint8Array; | ||
toObject(includeInstance?: boolean): ListIpfsPathRequest.AsObject; | ||
static toObject(includeInstance: boolean, msg: ListIpfsPathRequest): ListIpfsPathRequest.AsObject; | ||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; | ||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; | ||
static serializeBinaryToWriter(message: ListIpfsPathRequest, writer: jspb.BinaryWriter): void; | ||
static deserializeBinary(bytes: Uint8Array): ListIpfsPathRequest; | ||
static deserializeBinaryFromReader(message: ListIpfsPathRequest, reader: jspb.BinaryReader): ListIpfsPathRequest; | ||
} | ||
export namespace ListIpfsPathRequest { | ||
export type AsObject = { | ||
path: string, | ||
} | ||
} | ||
export class ListIpfsPathReply extends jspb.Message { | ||
hasItem(): boolean; | ||
clearItem(): void; | ||
getItem(): ListPathItem | undefined; | ||
setItem(value?: ListPathItem): void; | ||
serializeBinary(): Uint8Array; | ||
toObject(includeInstance?: boolean): ListIpfsPathReply.AsObject; | ||
static toObject(includeInstance: boolean, msg: ListIpfsPathReply): ListIpfsPathReply.AsObject; | ||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; | ||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; | ||
static serializeBinaryToWriter(message: ListIpfsPathReply, writer: jspb.BinaryWriter): void; | ||
static deserializeBinary(bytes: Uint8Array): ListIpfsPathReply; | ||
static deserializeBinaryFromReader(message: ListIpfsPathReply, reader: jspb.BinaryReader): ListIpfsPathReply; | ||
} | ||
export namespace ListIpfsPathReply { | ||
export type AsObject = { | ||
item?: ListPathItem.AsObject, | ||
} | ||
} | ||
export class PushPathRequest extends jspb.Message { | ||
@@ -506,2 +552,88 @@ hasHeader(): boolean; | ||
export class PullIpfsPathRequest extends jspb.Message { | ||
getPath(): string; | ||
setPath(value: string): void; | ||
serializeBinary(): Uint8Array; | ||
toObject(includeInstance?: boolean): PullIpfsPathRequest.AsObject; | ||
static toObject(includeInstance: boolean, msg: PullIpfsPathRequest): PullIpfsPathRequest.AsObject; | ||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; | ||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; | ||
static serializeBinaryToWriter(message: PullIpfsPathRequest, writer: jspb.BinaryWriter): void; | ||
static deserializeBinary(bytes: Uint8Array): PullIpfsPathRequest; | ||
static deserializeBinaryFromReader(message: PullIpfsPathRequest, reader: jspb.BinaryReader): PullIpfsPathRequest; | ||
} | ||
export namespace PullIpfsPathRequest { | ||
export type AsObject = { | ||
path: string, | ||
} | ||
} | ||
export class PullIpfsPathReply extends jspb.Message { | ||
getChunk(): Uint8Array | string; | ||
getChunk_asU8(): Uint8Array; | ||
getChunk_asB64(): string; | ||
setChunk(value: Uint8Array | string): void; | ||
serializeBinary(): Uint8Array; | ||
toObject(includeInstance?: boolean): PullIpfsPathReply.AsObject; | ||
static toObject(includeInstance: boolean, msg: PullIpfsPathReply): PullIpfsPathReply.AsObject; | ||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; | ||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; | ||
static serializeBinaryToWriter(message: PullIpfsPathReply, writer: jspb.BinaryWriter): void; | ||
static deserializeBinary(bytes: Uint8Array): PullIpfsPathReply; | ||
static deserializeBinaryFromReader(message: PullIpfsPathReply, reader: jspb.BinaryReader): PullIpfsPathReply; | ||
} | ||
export namespace PullIpfsPathReply { | ||
export type AsObject = { | ||
chunk: Uint8Array | string, | ||
} | ||
} | ||
export class SetPathRequest extends jspb.Message { | ||
getKey(): string; | ||
setKey(value: string): void; | ||
getPath(): string; | ||
setPath(value: string): void; | ||
getCid(): string; | ||
setCid(value: string): void; | ||
serializeBinary(): Uint8Array; | ||
toObject(includeInstance?: boolean): SetPathRequest.AsObject; | ||
static toObject(includeInstance: boolean, msg: SetPathRequest): SetPathRequest.AsObject; | ||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; | ||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; | ||
static serializeBinaryToWriter(message: SetPathRequest, writer: jspb.BinaryWriter): void; | ||
static deserializeBinary(bytes: Uint8Array): SetPathRequest; | ||
static deserializeBinaryFromReader(message: SetPathRequest, reader: jspb.BinaryReader): SetPathRequest; | ||
} | ||
export namespace SetPathRequest { | ||
export type AsObject = { | ||
key: string, | ||
path: string, | ||
cid: string, | ||
} | ||
} | ||
export class SetPathReply extends jspb.Message { | ||
serializeBinary(): Uint8Array; | ||
toObject(includeInstance?: boolean): SetPathReply.AsObject; | ||
static toObject(includeInstance: boolean, msg: SetPathReply): SetPathReply.AsObject; | ||
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>}; | ||
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>}; | ||
static serializeBinaryToWriter(message: SetPathReply, writer: jspb.BinaryWriter): void; | ||
static deserializeBinary(bytes: Uint8Array): SetPathReply; | ||
static deserializeBinaryFromReader(message: SetPathReply, reader: jspb.BinaryReader): SetPathReply; | ||
} | ||
export namespace SetPathReply { | ||
export type AsObject = { | ||
} | ||
} | ||
export class RemoveRequest extends jspb.Message { | ||
@@ -508,0 +640,0 @@ getKey(): string; |
{ | ||
"name": "@textile/buckets-grpc", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "A client for interacting with the Textile Buckets gRPC API.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
281067
7989