From 071860ee2b287f7ff16e962190eeea928acaea02 Mon Sep 17 00:00:00 2001 From: Andrea Agili Date: Mon, 19 Feb 2018 08:45:10 +0100 Subject: [PATCH] :bookmark: v1.0.0 release --- index.d.ts | 1 + index.js | 4 ++++ package.json | 2 +- src/cmis.ts | 16 +++++++++++++++- 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 index.d.ts create mode 100644 index.js diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..e69203b --- /dev/null +++ b/index.d.ts @@ -0,0 +1 @@ +export * from './src/cmis'; \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..4cf4c78 --- /dev/null +++ b/index.js @@ -0,0 +1,4 @@ +var cmis = require('./dist/cmis').cmis; +for (var ex in cmis){ + exports[ex] = cmis[ex]; +} \ No newline at end of file diff --git a/package.json b/package.json index 20273b8..6b32446 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "CmisJS", "name": "cmis", - "version": "1.0.0-beta1", + "version": "1.0.0", "homepage": "http://github.com/agea/CmisJS", "description": "a CMIS client library written in Typescript for node and the browser", "author": { diff --git a/src/cmis.ts b/src/cmis.ts index a02fa20..7ff96ba 100644 --- a/src/cmis.ts +++ b/src/cmis.ts @@ -154,6 +154,7 @@ export namespace cmis { private options: Options = { succinct: true }; public defaultRepository: any; public repositories: Array; + private charset: string; @@ -276,6 +277,10 @@ export namespace cmis { formData.append(k, '' + body[k]); } + if (this.charset){ + formData.append('_charset_',this.charset); + } + cfg.body = formData; } else { let usp = new URLSearchParams(); @@ -341,7 +346,7 @@ export namespace cmis { * sets token for authentication */ public setToken(token: string): CmisSession { - this.options.token = token; + this.token = token; return this; } @@ -355,6 +360,15 @@ export namespace cmis { return this; } + /** + * IN HTML5, the character set to use for non-file fields can + * be specified in a multipart by using a _charset_ field. + * https://dev.w3.org/html5/spec-preview/attributes-common-to-form-controls.html#attr-fe-name-charset + */ + public setCharset(charset:string):CmisSession { + this.charset = charset; + return this; + } /** * sets global error handler