diff --git a/notNeededPackages.json b/notNeededPackages.json index d9ef67766b..659b87da95 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -2286,6 +2286,12 @@ "sourceRepoURL": "https://github.com/foretagsplatsen/numbro/", "asOfVersion": "1.9.3" }, + { + "libraryName": "o.js", + "typingsPackageName": "o.js", + "sourceRepoURL": "https://github.com/janhommes/o.js", + "asOfVersion": "1.0.3" + }, { "libraryName": "on-change", "typingsPackageName": "on-change", diff --git a/types/o.js/index.d.ts b/types/o.js/index.d.ts deleted file mode 100644 index b0fd413068..0000000000 --- a/types/o.js/index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -// Type definitions for o.js v0.3.4 -// Project: https://github.com/janhommes/o.js -// Definitions by: Matteo Antony Mistretta , Brad Zacher , Jan Hommes , Jean-Christophe Chalte -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -declare module 'o.js' { - import Q = require("q"); - - interface Options { - endpoint : string - format ?: string - autoFormat ?: boolean - version ?: number - strictMode ?: boolean - start ?: () => any - ready ?: () => any - error ?: () => any - headers ?: { name: string, value: string }[] - username ?: string - password ?: string - isAsync ?: boolean - isCors ?: boolean - isHashRoute ?: boolean - appending ?: string - } - - interface OHandler { - inlinecount : number - data : T - - config(options ?: Options) : OHandler - progress(callback : () => any) : OHandler - - get(callback ?: (data : T) => void) : Q.Promise> - save(callback ?: (data : T) => void) : Q.Promise> - - post(params : any) : OHandler - patch(params : any) : OHandler - put(params : any) : OHandler - remove(params ?: any) : OHandler - - routes(path : string, callback ?: (data : T) => void) : OHandler - route(path : string, callback ?: (data : T) => void) : OHandler - triggerRoute(hash : string) : OHandler - beforeRouting(callback : (routeParams : any) => boolean) : OHandler - - isEndpoint() : boolean - loading(startFn : () => any | boolean, endFn : () => any) : OHandler - - find(selector : string|number) : OHandler - - top(quantity : number) : OHandler - take(quantity : number) : OHandler - skip(quantity : number) : OHandler - first() : OHandler - - include(column : string, data : string) : OHandler - exclude(column : string, data : string) : OHandler - filterByList(column : string, data : string) : OHandler - - filter(filter : string) : OHandler - where(filter : string) : OHandler - any(filter : string, resource : string) : OHandler - search(columns : string[], term : string) : OHandler - - orderBy(column : string, direction ?: boolean) : OHandler - orderByDesc(column : string) : OHandler - select(selectStr : string) : OHandler - - count() : OHandler - inlineCount(paramName ?: string) : OHandler - - batch(resource : string) : OHandler - expand(resource : string) : OHandler - ref(resource : string, id : string | number) : OHandler - removeRef(resource : string, id : string | number) : OHandler - deleteRef(resource : string, id : string | number) : OHandler - } - - interface OFn extends OHandler { - (options ?: string | Options) : OHandler - } - - var o : OFn<{}>; - - export = o -} \ No newline at end of file diff --git a/types/o.js/o.js-tests.ts b/types/o.js/o.js-tests.ts deleted file mode 100644 index be3e5c824a..0000000000 --- a/types/o.js/o.js-tests.ts +++ /dev/null @@ -1,151 +0,0 @@ -import o = require('o.js'); -import * as Q from "q"; - -interface Product { - ID : number; - Name : string; - Description : string; - ReleaseDate : string; - DiscontinuedDate : Date; - Rating: number; - Price: number; -} -interface Category { - ID : number; - Name : string; -} - -// copy pasta all the examples from the readme! - -o('http://services.odata.org/V4/OData/OData.svc/Products') - .get(function(data) { - console.log(data); //returns an array of Product data - }); - - - -o('http://services.odata.org/V4/OData/OData.svc/Products') - .take(5) - .skip(2) - .get(function(data) { - console.log(data); //An array of 5 products skiped by 2 - }); - - - -o('http://services.odata.org/V4/OData/OData.svc/Products') - .find(':0') - .route('Product/Detail/:0/:1',function(data) { - console.log('Route Product/Detail/'+this.param[0]+'/'+this.param[1]+' triggered. Result:'); - console.log(data); - }); - - - -var oHandler = o('http://services.odata.org/V4/OData/OData.svc/Products'); -//do somehtting -oHandler.find(1); -// do some more................ -//get the data -oHandler.get(function(data) { - console.log(data); - //or the saved var also contains the data: - console.log(oHandler.data); -}); - - - -Q.all([ - o('http://services.odata.org/V4/OData/OData.svc/Products(4)').get(), - o('http://services.odata.org/V4/OData/OData.svc/Categories').take(2).get() -]).then(function(oHandlerArray) { - //The oHandler array contains the Product oHandler and the Group oHandler: - console.log(oHandlerArray[0].data); // 1 Product with id 4 - console.log(oHandlerArray[1].data.length); // 2 Categories -}); - - - -o('http://services.odata.org/V4/OData/OData.svc/Products(2)') - .get() - .then(function(oHandler) { - console.log(oHandler.data); - }).fail(function(ex) { - console.log(ex); - }); - - - -o('http://services.odata.org/V4/OData/OData.svc/Products') - .post({Name:'Example 1',Description:'a'}) - .post({Name:'Example 2',Description:'b'}) - .save(function(data) { - console.log("Two Products added"); - }); - - - -o('http://services.odata.org/V4/OData/OData.svc/Products(1)') - .patch({Name:'NewName'}) - .save(function(data) { - console.log("Product Name changed"); - }); - - - -o('http://services.odata.org/V4/OData/OData.svc/Products(1)') - .remove() - .save(function(data) { - console.log("Product deleted"); - }); - - - -o('http://services.odata.org/V4/OData/OData.svc/Products(1)') - .ref('Categories', 2) - .save(function(data) { - console.log("Product(1) associated with Categories(2)"); - }); - - - -o('http://services.odata.org/V4/OData/OData.svc/Products') - .find(2) - .get() - .then(function(oHandler) { - oHandler.data.Name="NewName"; - return(o.save()); - }).then(function(oHandler) { - console.log(oHandler.data.Name); //NewName - }).fail(function(ex) { - console.log("error"); - }); - - - -// set an endpoint -o().config({ - endpoint:'http://services.odata.org/V4/OData/OData.svc' -}); -// after you have set an endpoint, you can shorten your queries: -o('Products').get(function(data) { - //same result like the first example on this page -}); - - - -//basic config -o().config({ - endpoint:null, // your odata endpoint for the service - format:'json', // currently only json is supported - autoFormat: false, - version:4, // oData version (currently supported version 4. However most also work with version 3.) - strictMode:true, // strict mode throws exception, non strict mode only logs them - start:null, // a function which is executed on loading - ready:null, // a function which is executed on ready - error:null, // a function which is executed on error - headers:[{name: '', value: ''}], // a array of additional headers e.g.: [{name:'headername',value:'headervalue'}] - username:null, // a basic auth username - password:null, // a basic auth password - isAsync:true //set this to false to make synced (a)jax calls. (dosn't work with basic auth!) -}); \ No newline at end of file diff --git a/types/o.js/tsconfig.json b/types/o.js/tsconfig.json deleted file mode 100644 index a3159265ee..0000000000 --- a/types/o.js/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "paths": { - "q": [ - "q/v0" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "o.js-tests.ts" - ] -} \ No newline at end of file diff --git a/types/o.js/tslint.json b/types/o.js/tslint.json deleted file mode 100644 index 3d59f55fda..0000000000 --- a/types/o.js/tslint.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "npm-naming": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -}