From d6f4265b368a2e02fc822965165c11a4f7183689 Mon Sep 17 00:00:00 2001 From: xialeistudio <1065890063@qq.com> Date: Thu, 29 Jun 2017 15:50:08 +0800 Subject: [PATCH] remove qiniu --- notNeededPackages.json | 6 + types/qiniu/index.d.ts | 262 ------------------------------------- types/qiniu/qiniu-tests.ts | 156 ---------------------- types/qiniu/tsconfig.json | 22 ---- types/qiniu/tslint.json | 1 - 5 files changed, 6 insertions(+), 441 deletions(-) delete mode 100644 types/qiniu/index.d.ts delete mode 100644 types/qiniu/qiniu-tests.ts delete mode 100644 types/qiniu/tsconfig.json delete mode 100644 types/qiniu/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index d6e99fbf9b..d44f9a3061 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -420,6 +420,12 @@ "sourceRepoURL": "https://github.com/angular/protractor", "asOfVersion": "4.0.0" }, + { + "libraryName": "qiniu", + "typingsPackageName": "qiniu", + "sourceRepoURL": "git@github.com:qiniu/nodejs-sdk.git", + "asOfVersion": "6.1.0" + }, { "libraryName": "Raven JS", "typingsPackageName": "raven-js", diff --git a/types/qiniu/index.d.ts b/types/qiniu/index.d.ts deleted file mode 100644 index 03eedd4914..0000000000 --- a/types/qiniu/index.d.ts +++ /dev/null @@ -1,262 +0,0 @@ -// Type definitions for qiniu 6.1 -// Project: https://github.com/qiniu/nodejs-sdk -// Definitions by: xialeistudio -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace qiniu { - type onret = (e?: any, result?: any, res?: any) => void; - class conf { - static ACCESS_KEY: string; - static SECRET_KEY: string; - static USER_AGENT: string; - static UP_HOST: string; - static RS_HOST: string; - static RSF_HOST: string; - static API_HOST: string; - static RPC_TIMEOUT: number; - static UC_HOST: string; - static UP_HTTPS_HOST: string; - static SCHEME: string; - static AUTOZONE: boolean; - static BUCKET: string | null; - static EXPIRE: number; - } - namespace auth { - class Mac { - accessKey: string; - secretKey: string; - - constructor(accessKey: string, secretKey: string); - } - } - namespace io { - const UNDEFINED_KEY: string; - class PutExtra { - params: any; - mimeType?: string; - crc32?: string; - checkCrc?: number; - - constructor(params?: any, mimeType?: string, crc32?: string, checkCrc?: number); - } - class PutRet { - hash?: string; - key?: string; - - constructor(hash?: string, key?: string); - } - - function putReadable(uptoken: string, key?: string, rs?: any, extra?: any, onret?: onret): any; - - function put(uptoken: string, key?: string, body?: any, extra?: any, onret?: onret): any; - - function putWithoutKey(uptoken: string, body?: any, extra?: any, onret?: onret): any; - - function putFile(uptoken: string, key?: string, localFile?: string, extra?: any, onret?: onret): any; - - function putFileWithoutKey(uptoken: string, localFile?: string, extra?: any, onret?: onret): any; - } - namespace util { - function urlsafeBase64Encode(jsonFlags: any): string; - - function base64ToUrlSafe(v: string): string; - - function hmacSha1(encodedFlags: any, secretKey: string): string; - - function generateAccessToken(uri: string, body?: any): string; - - function isQiniuCallback(path: string, body: any, callbackAuth: any): boolean; - } - namespace zone { - function up_host(uptoken: string, conf: conf): void; - } - namespace rsf { - function listPrefix(bucket: string, prefix?: string, marker?: any, limit?: any, delimiter?: any, onret?: onret): void; - } - namespace rpc { - function postMultipart(uri: string, form: any, onret?: onret): any; - - function postWithForm(uri: string, form: any, token?: string, onret?: onret): any; - - function postWithoutForm(uri: string, token?: string, onret?: onret): any; - } - namespace fop { - class ImageView { - mode: number; - width: number; - height: number; - quality: number; - format: any; - - constructor(mode?: number, width?: number, height?: number, quality?: number, format?: any); - - makeRequest(url: string): string; - } - - class ImageInfo { - makeRequest(url: string): string; - } - class Exif { - makeRequest(url: string): string; - } - - function pfop(bucket: string, key: string, fops: any, opts?: any, onret?: onret): void; - } - namespace rs { - import Mac = qiniu.auth.Mac; - class Client { - client?: Client; - - constructor(client?: Client); - - stat(bucket: string, key: string, onret?: onret): void; - - remove(bucket: string, key: string, onret?: onret): void; - - move(bucketSrc: string, keySrc: string, bucketDest: string, keyDest: string, onret?: onret): void; - - forceMove(bucketSrc: string, keySrc: string, bucketDest: string, keyDest: string, force: boolean, onret?: onret): void; - - copy(bucketSrc: string, keySrc: string, bucketDest: string, keyDest: string, onret?: onret): void; - - forceCopy(bucketSrc: string, keySrc: string, bucketDest: string, keyDest: string, force: boolean, onret?: onret): void; - - fetch(url: string, bucket: string, key: string, onret?: onret): void; - - batchStat(entries: any[], onret?: onret): void; - - batchDelete(entries: any[], onret?: onret): void; - - batchMove(entries: any[], onret?: onret): void; - - forceBatchMove(entries: any[], force: boolean, onret?: onret): void; - - batchCopy(entries: any[], onret?: onret): void; - - forceBatchCopy(entries: any[], force: boolean, onret?: onret): void; - } - class Entry { - hash?: string; - fsize?: number; - putTime?: number; - mimeType?: string; - endUser?: any; - - constructor(hash?: string, fsize?: number, putTime?: number, mimeType?: string, endUser?: any); - } - class EntryPath { - bucket?: string; - key?: string; - - constructor(bucket?: string, key?: string); - - encode(): string; - - toStr(op: string): string; - } - class EntryPathPair { - src?: string; - dest?: string; - - constructor(src?: string, desc?: string); - - toStr(op: string, force?: boolean): string; - } - class BatchItemRet { - error?: any; - code?: number; - - constructor(error?: any, code?: number); - } - class BatchStatItemRet { - data: any; - error: any; - code: number; - - constructor(data: any, error: any, code: number); - } - class PutPolicy { - scope?: string; - callbackUrl?: string; - callbackBody?: any; - returnUrl?: string; - returnBody?: any; - endUser?: any; - expires: number; - persistentOps?: any; - persistentNotifyUrl?: string; - - constructor(score?: string, - callbackUrl?: string, - callbackBody?: any, - returnUrl?: string, - returnBody?: any, - endUser?: any, - expires?: number, - persistentOps?: any, - persistentNotifyUrl?: string); - - token(mac?: Mac): string; - - getFlags(): any; - } - interface putPolicyObj { - scope?: string; - expires?: number; - insertOnly?: boolean; - saveKey?: string; - endUser?: any; - returnUrl?: string; - returnBody?: any; - callbackUrl?: string; - callbackHost?: string; - callbackBody?: any; - callbackBodyType?: string; - callbackFetchKey?: string; - persistentOps?: any; - persistentNotifyUrl?: string; - persistentPipeline?: string; - fsizeLimit?: number; - fsizeMin?: any; - detectMime?: any; - mimeLimit?: any; - deleteAfterDays?: number; - } - class PutPolicy2 { - scope?: string; - expires: number; - insertOnly?: boolean; - saveKey?: string; - endUser?: any; - returnUrl?: string; - returnBody?: any; - callbackUrl?: string; - callbackHost?: string; - callbackBody?: any; - callbackBodyType?: string; - callbackFetchKey?: string; - persistentOps?: any; - persistentNotifyUrl?: string; - persistentPipeline?: string; - fsizeLimit?: number; - fsizeMin?: any; - detectMime?: any; - mimeLimit?: any; - deleteAfterDays?: number; - - constructor(putPolicyObj: putPolicyObj); - - token(mac?: Mac): string; - - getFlags(): any; - } - class GetPolicy { - expires: number; - - constructor(expires?: number); - - makeRequest(baseUrl: string, mac?: Mac): string; - } - function makeBaseUrl(domain: string, key: string, query?: string): string; - } -} diff --git a/types/qiniu/qiniu-tests.ts b/types/qiniu/qiniu-tests.ts deleted file mode 100644 index ea4c3fe202..0000000000 --- a/types/qiniu/qiniu-tests.ts +++ /dev/null @@ -1,156 +0,0 @@ -// test for qiniu.conf -function testConf() { - qiniu.conf.ACCESS_KEY = 'Access_Key'; - qiniu.conf.SECRET_KEY = 'Secret_Key'; -} - -// test for qiniu.auth -function testAuth() { - // test for auth.Mac - const mac = new qiniu.auth.Mac(qiniu.conf.ACCESS_KEY, qiniu.conf.SECRET_KEY); -} - -// test for qiniu.io -function testIo() { - // test for PutExtra - const putExtra = new qiniu.io.PutExtra(); - // test for PutRet - const putRet = new qiniu.io.PutRet(); - // test for putReadable - qiniu.io.putReadable('xxx', undefined, undefined, undefined, (e?: any, result?: any, res?: any) => { - }); - // test for put - qiniu.io.put('xxx', undefined, 'test-data', undefined, (e?: any, result?: any, res?: any) => { - }); - // test for putWithoutKey - qiniu.io.putWithoutKey('xxx', 'test-data', undefined, (e?: any, result?: any, res?: any) => { - }); - // test for putFile - qiniu.io.putFile('xxx', undefined, 'tslint.json', undefined, (e?: any, result?: any, res?: any) => { - }); - // test for putFileWithoutKey - qiniu.io.putFileWithoutKey('xxx', 'tslint.json', undefined, (e?: any, result?: any, res?: any) => { - }); -} - -// test for qiniu.util -function testUtil() { - // test for urlsafeBase64Encode - qiniu.util.urlsafeBase64Encode(null); - // test for base64ToUrlSafe - qiniu.util.base64ToUrlSafe('https://example.com'); - // test for hmacSha1 - qiniu.util.hmacSha1(null, 'test'); - // test for generateAccessToken - qiniu.util.generateAccessToken('https://example.com'); - // test for isQiniuCallback - qiniu.util.isQiniuCallback('/key', 'test-data', 'test-auth'); -} - -// test for qiniu.zone -function testZone() { - qiniu.zone.up_host('test', {ACCESS_KEY: 'xx', SECRET_KEY: 'ss'}); -} - -// test for qiniu.rsf -function testRsf() { - qiniu.rsf.listPrefix('test'); -} - -// test for qiniu.rpc -function testRpc() { - // test for postMultipart - qiniu.rpc.postMultipart('https://up.qbox.me', 'test'); - // test for postWithForm - qiniu.rpc.postWithForm('https://up.qbox.me', 'test'); - // test for postWithoutForm - qiniu.rpc.postWithoutForm('https://up.qbox.me'); -} - -// test for qiniu.fop -function testFop() { - // test for ImageView - const imageView = new qiniu.fop.ImageView(1, 1, 1, 1); - imageView.makeRequest('https://up.qbox.me'); - // test for ImageInfo - const imageInfo = new qiniu.fop.ImageInfo(); - imageInfo.makeRequest('https://up.qbox.me'); - // test for Exif - const exif = new qiniu.fop.Exif(); - exif.makeRequest('https://up.qbox.me'); - // test for fop - qiniu.fop.pfop('test', 'test', 'test'); -} - -// test for qiniu.rs -function testRs() { - // test for Client - const client = new qiniu.rs.Client(); - // test for Client.stat - client.stat('test', 'test', (e?: any, result?: any, res?: any) => { - }); - // test for Client.remove - client.remove('test', 'test', (e?: any, result?: any, res?: any) => { - }); - // test for Client.move - client.move('test-src', 'test-src', 'test-dest', 'test-dest', (e?: any, result?: any, res?: any) => { - }); - // test for Client.forceMove - client.forceMove('test-src', 'test-src', 'test-dest', 'test-dest', true, (e?: any, result?: any, res?: any) => { - }); - // test for Client.copy - client.copy('test-src', 'test-src', 'test-dest', 'test-dest', (e?: any, result?: any, res?: any) => { - }); - // test for Client.forceCopy - client.forceCopy('test-src', 'test-src', 'test-dest', 'test-dest', true, (e?: any, result?: any, res?: any) => { - }); - // test for Client.fetch - client.fetch('https://up.qbox.me', 'test', 'test', (e?: any, result?: any, res?: any) => { - }); - // test for Client.batchStat - client.batchStat(['data'], (e?: any, result?: any, res?: any) => { - }); - // test for Client.batchDelete - client.batchDelete(['data'], (e?: any, result?: any, res?: any) => { - }); - // test for Client.batchMove - client.batchMove(['data'], (e?: any, result?: any, res?: any) => { - }); - // test for Client.forceBatchMove - client.forceBatchMove(['data'], true, (e?: any, result?: any, res?: any) => { - }); - // test for Client.batchCopy - client.batchCopy(['data'], (e?: any, result?: any, res?: any) => { - }); - // test for Client.forceBatchMove - client.forceBatchCopy(['data'], true, (e?: any, result?: any, res?: any) => { - }); - // test for Entry - const entry = new qiniu.rs.Entry('xx', 1, 1); - // test for EntryPath - const entryPath = new qiniu.rs.EntryPath('test', 'test'); - entryPath.encode(); - entryPath.toStr('x'); - // test for EntryPathPair - const entryPathPair = new qiniu.rs.EntryPathPair('xxx', 'xxx'); - entryPathPair.toStr('x', false); - // test for BatchItemRet - const batchItemRet = new qiniu.rs.BatchItemRet('xx', 0); - // test for BatchStatItemRet - const batchStatItemRet = new qiniu.rs.BatchStatItemRet('xx', 'xxx', 0); - // test for PutPolicy - const putPolicy = new qiniu.rs.PutPolicy(); - putPolicy.token(); - putPolicy.getFlags(); - // test for PutPolicy2 - const putPolicy2 = new qiniu.rs.PutPolicy2({ - scope: 'xxx' - }); - putPolicy2.token(); - putPolicy2.getFlags(); - // test for GetPolicy - const getPolicy = new qiniu.rs.GetPolicy(10); - getPolicy.makeRequest('https://up.qbox.me'); - // test for makeBaseUrl - qiniu.rs.makeBaseUrl('up.qbox.me', 'test'); -} diff --git a/types/qiniu/tsconfig.json b/types/qiniu/tsconfig.json deleted file mode 100644 index d862b59b98..0000000000 --- a/types/qiniu/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "qiniu-tests.ts" - ] -} diff --git a/types/qiniu/tslint.json b/types/qiniu/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/qiniu/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" }