@textile/buckets
Advanced tools
Comparing version 6.0.5 to 6.1.0
@@ -411,2 +411,44 @@ import { Identity } from '@textile/crypto'; | ||
pushPath(key: string, path: string, input: any, options?: PushOptions): Promise<PushPathResult>; | ||
/** | ||
* Pushes an iterable of files to a bucket. | ||
* @param key Unique (IPNS compatible) identifier key for a bucket. | ||
* @param input The input array of file/stream/objects. | ||
* @param options PushOptions to control response stream. | ||
* @example | ||
* Push all files in a directory to the root of a bucket | ||
* ```typescript | ||
* import fs from 'fs' | ||
* import path from 'path' | ||
* import util from 'util' | ||
* import glob from 'glob' | ||
* import { Buckets } from '@textile/hub' | ||
* | ||
* const globDir = util.promisify(glob) | ||
* | ||
* const pushMultipleFiles = async (buckets: Buckets, bucketKey: string, directory: string, globPattern: string) => { | ||
* const options = { | ||
* directory, | ||
* nodir: true, | ||
* } | ||
* const files = await globDir(globPattern, options) | ||
* if (files.length === 0) { | ||
* throw Error(`No files found: ${directory}`) | ||
* } | ||
* | ||
* let streams = [] | ||
* for (const file of files) { | ||
* const stream = fs.createReadStream( | ||
* path.join(directory, file), { | ||
* highWaterMark: 1024, | ||
* } | ||
* ) | ||
* streams.push({ | ||
* path: file, | ||
* content: stream, | ||
* }) | ||
* } | ||
* return await buckets.pushPaths(bucketKey, streams) | ||
* } | ||
* ``` | ||
*/ | ||
pushPaths(key: string, input: any, options?: PushOptions): AsyncIterableIterator<PushPathsResult>; | ||
@@ -413,0 +455,0 @@ /** |
@@ -575,2 +575,44 @@ "use strict"; | ||
} | ||
/** | ||
* Pushes an iterable of files to a bucket. | ||
* @param key Unique (IPNS compatible) identifier key for a bucket. | ||
* @param input The input array of file/stream/objects. | ||
* @param options PushOptions to control response stream. | ||
* @example | ||
* Push all files in a directory to the root of a bucket | ||
* ```typescript | ||
* import fs from 'fs' | ||
* import path from 'path' | ||
* import util from 'util' | ||
* import glob from 'glob' | ||
* import { Buckets } from '@textile/hub' | ||
* | ||
* const globDir = util.promisify(glob) | ||
* | ||
* const pushMultipleFiles = async (buckets: Buckets, bucketKey: string, directory: string, globPattern: string) => { | ||
* const options = { | ||
* directory, | ||
* nodir: true, | ||
* } | ||
* const files = await globDir(globPattern, options) | ||
* if (files.length === 0) { | ||
* throw Error(`No files found: ${directory}`) | ||
* } | ||
* | ||
* let streams = [] | ||
* for (const file of files) { | ||
* const stream = fs.createReadStream( | ||
* path.join(directory, file), { | ||
* highWaterMark: 1024, | ||
* } | ||
* ) | ||
* streams.push({ | ||
* path: file, | ||
* content: stream, | ||
* }) | ||
* } | ||
* return await buckets.pushPaths(bucketKey, streams) | ||
* } | ||
* ``` | ||
*/ | ||
pushPaths(key, input, options) { | ||
@@ -577,0 +619,0 @@ return api_1.bucketsPushPaths(this, key, input, options); |
@@ -811,2 +811,44 @@ import { Identity } from "@textile/crypto"; | ||
pushPath(key: string, path: string, input: any, options?: PushOptions): Promise<PushPathResult>; | ||
/** | ||
* Pushes an iterable of files to a bucket. | ||
* @param key Unique (IPNS compatible) identifier key for a bucket. | ||
* @param input The input array of file/stream/objects. | ||
* @param options PushOptions to control response stream. | ||
* @example | ||
* Push all files in a directory to the root of a bucket | ||
* ```typescript | ||
* import fs from 'fs' | ||
* import path from 'path' | ||
* import util from 'util' | ||
* import glob from 'glob' | ||
* import { Buckets } from '@textile/hub' | ||
* | ||
* const globDir = util.promisify(glob) | ||
* | ||
* const pushMultipleFiles = async (buckets: Buckets, bucketKey: string, directory: string, globPattern: string) => { | ||
* const options = { | ||
* directory, | ||
* nodir: true, | ||
* } | ||
* const files = await globDir(globPattern, options) | ||
* if (files.length === 0) { | ||
* throw Error(`No files found: ${directory}`) | ||
* } | ||
* | ||
* let streams = [] | ||
* for (const file of files) { | ||
* const stream = fs.createReadStream( | ||
* path.join(directory, file), { | ||
* highWaterMark: 1024, | ||
* } | ||
* ) | ||
* streams.push({ | ||
* path: file, | ||
* content: stream, | ||
* }) | ||
* } | ||
* return await buckets.pushPaths(bucketKey, streams) | ||
* } | ||
* ``` | ||
*/ | ||
pushPaths(key: string, input: any, options?: PushOptions): AsyncIterableIterator<PushPathsResult>; | ||
@@ -813,0 +855,0 @@ /** |
{ | ||
"name": "@textile/buckets", | ||
"version": "6.0.5", | ||
"version": "6.1.0", | ||
"description": "Web-gRPC wrapper client for managing Textile Buckets.", | ||
@@ -25,12 +25,12 @@ "main": "dist/cjs/index.js", | ||
"@repeaterjs/repeater": "^3.0.4", | ||
"@textile/buckets-grpc": "2.6.5", | ||
"@textile/context": "^0.11.1", | ||
"@textile/crypto": "^4.1.1", | ||
"@textile/grpc-authentication": "^3.3.4", | ||
"@textile/grpc-connection": "^2.4.1", | ||
"@textile/grpc-transport": "^0.4.0", | ||
"@textile/hub-grpc": "2.6.5", | ||
"@textile/hub-threads-client": "^5.3.4", | ||
"@textile/security": "^0.8.1", | ||
"@textile/threads-id": "^0.5.1", | ||
"@textile/buckets-grpc": "2.6.6", | ||
"@textile/context": "^0.12.0", | ||
"@textile/crypto": "^4.2.0", | ||
"@textile/grpc-authentication": "^3.4.0", | ||
"@textile/grpc-connection": "^2.5.0", | ||
"@textile/grpc-transport": "^0.5.0", | ||
"@textile/hub-grpc": "2.6.6", | ||
"@textile/hub-threads-client": "^5.4.0", | ||
"@textile/security": "^0.9.0", | ||
"@textile/threads-id": "^0.6.0", | ||
"abort-controller": "^3.0.0", | ||
@@ -43,7 +43,7 @@ "cids": "^1.1.4", | ||
"devDependencies": { | ||
"@textile/testing": "^0.0.5", | ||
"@textile/testing": "^0.0.6", | ||
"browser-or-node": "1.3.0", | ||
"it-last": "^1.0.4" | ||
}, | ||
"gitHead": "2887b1076b5554f8d76dda33ae07b20da05da926" | ||
"gitHead": "712cfc0b34bf97b8465f7baa7cd359fc38434518" | ||
} |
Sorry, the diff of this file is not supported yet
828764
6793
+ Added@textile/buckets-grpc@2.6.6(transitive)
+ Added@textile/hub-grpc@2.6.6(transitive)
- Removed@textile/buckets-grpc@2.6.5(transitive)
- Removed@textile/context@0.11.1(transitive)
- Removed@textile/grpc-transport@0.4.0(transitive)
- Removed@textile/hub-grpc@2.6.5(transitive)
- Removed@textile/security@0.8.1(transitive)
- Removed@textile/threads-id@0.5.1(transitive)
Updated@textile/buckets-grpc@2.6.6
Updated@textile/context@^0.12.0
Updated@textile/crypto@^4.2.0
Updated@textile/hub-grpc@2.6.6
Updated@textile/security@^0.9.0
Updated@textile/threads-id@^0.6.0