sp-dev-fx-webparts/samples/angular-ngofficeuifabric-fi.../lib/webparts/angularFileUpload/app/services/baseSvc.js.map

1 line
12 KiB
Plaintext

{"version":3,"sources":["webparts/angularFileUpload/app/services/BaseSvc.ts"],"names":[],"mappings":";AACA,iCAAmC;AAGnC;IAIE,qBAAoB,KAAsB,EAAU,EAAgB;QAAhD,UAAK,GAAL,KAAK,CAAiB;QAAU,OAAE,GAAF,EAAE,CAAc;QAEhE,IAAI,CAAC,OAAO,GAAS,MAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC;IAEnE,CAAC;IAEM,gCAAU,GAAjB,UAAkB,KAAc,EAAE,QAAiB;QACjD,IAAM,QAAQ,GAAsB,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;QACpD,IAAI,CAAC,KAAK,CAAC;YACT,GAAG,EAAE,QAAQ,IAAI,IAAI,CAAC,OAAO,GAAG,KAAK;YACrC,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,QAAQ,EAAE,gCAAgC;gBAC1C,cAAc,EAAE,gCAAgC;aACjD;SACF,CAAC,CAAC,IAAI,CAAC,UAAC,QAAa;YACpB,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC5B,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAC5C,CAAC;YAAC,IAAI,CAAC,CAAC;gBACN,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACpC,CAAC;QACH,CAAC,EAAE,UAAC,KAAU;YACZ,IAAM,MAAM,GAAW;gBACrB,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI;gBAC3B,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK;gBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;gBAC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IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK;gBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;YACF,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEL,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;IAC1B,CAAC;IACH,kBAAC;AAAD,CAhLA,AAgLC;AA/Ke,mBAAO,GAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AADvC,kCAAW","file":"webparts/angularFileUpload/app/services/BaseSvc.js","sourcesContent":["import { IError } from \"../../interfaces/IError\";\nimport * as angular from 'angular';\n\n\nexport class BaseService {\n public static $inject: string[] = [\"$http\", \"$q\"];\n public baseUrl: string;\n\n constructor(private $http: ng.IHttpService, private $q: ng.IQService) {\n \n this.baseUrl = (<any>window)._spPageContextInfo.webAbsoluteUrl;\n\n }\n\n public getRequest(query?: string, endPoint?: string): ng.IPromise<any> {\n const deferred: ng.IDeferred<any> = this.$q.defer();\n this.$http({\n url: endPoint || this.baseUrl + query,\n method: \"GET\",\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"content-Type\": \"application/json;odata=verbose\"\n }\n }).then((response: any): void => {\n if (response.data.d.results) {\n deferred.resolve(response.data.d.results);\n } else {\n deferred.resolve(response.data.d);\n }\n }, (error: any) => {\n const iError: IError = {\n code: error.data.error.code,\n message: error.data.error.message.value,\n status: error.status,\n statusText: error.statusText\n };\n deferred.reject(iError);\n });\n return deferred.promise;\n }\n\n public postRequest(url: string, requestBody: any, endPoint?: string): ng.IPromise<any> {\n const deferred: ng.IDeferred<any> = this.$q.defer();\n this.getFormDigestValue(this.baseUrl)\n .then((requestDigest: string): ng.IPromise<ng.IHttpPromiseCallbackArg<any>> => {\n return this.$http({\n url: endPoint || this.baseUrl + url,\n method: \"POST\",\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": requestDigest,\n \"content-Type\": \"application/json;odata=verbose\"\n },\n data: JSON.stringify(requestBody)\n });\n }).then((response: ng.IHttpPromiseCallbackArg<any>): void => {\n deferred.resolve(response.data);\n }, (error: any): void => {\n const iError: IError = {\n code: error.data.error.code,\n message: error.data.error.message.value,\n status: error.status,\n statusText: error.statusText\n };\n deferred.reject(iError);\n });\n return deferred.promise;\n }\n\n public updateRequest(url: string, requestBody: any, eTag: string, endPoint?: string): ng.IPromise<{}> {\n const deferred: ng.IDeferred<any> = this.$q.defer();\n this.getFormDigestValue(this.baseUrl)\n .then((requestDigest: string): ng.IPromise<ng.IHttpPromiseCallbackArg<any>> => {\n return this.$http({\n url: endPoint || this.baseUrl + url,\n method: \"POST\",\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": requestDigest,\n \"content-Type\": \"application/json;odata=verbose\",\n 'IF-MATCH': eTag,\n 'X-HTTP-Method': 'MERGE'\n },\n data: JSON.stringify(requestBody)\n });\n }).then((response: {}): void => {\n deferred.resolve();\n }, (error: any): void => {\n const iError: IError = {\n code: error.data.error.code,\n message: error.data.error.message.value,\n status: error.status,\n statusText: error.statusText\n };\n deferred.reject(iError);\n });\n return deferred.promise;\n }\n\n public deleteRequest(url: string, eTag: string, endPoint?: string): ng.IPromise<{}> {\n const deferred: ng.IDeferred<any> = this.$q.defer();\n this.getFormDigestValue(this.baseUrl)\n .then((requestDigest: string): ng.IPromise<ng.IHttpPromiseCallbackArg<any>> => {\n return this.$http({\n url: endPoint || this.baseUrl + url,\n method: \"POST\",\n headers: {\n 'Accept': 'application/json;odata=nometadata',\n 'X-RequestDigest': requestDigest,\n 'IF-MATCH': eTag,\n 'X-HTTP-Method': 'DELETE'\n }\n });\n }).then((response: {}): void => {\n deferred.resolve();\n }, (error: any): void => {\n const iError: IError = {\n code: error.data.error.code,\n message: error.data.error.message.value,\n status: error.status,\n statusText: error.statusText\n };\n deferred.reject(iError);\n });\n return deferred.promise;\n }\n\n public fileUploadRequest(url: string, file: ArrayBuffer, endPoint?: string): ng.IPromise<any> {\n const deferred: ng.IDeferred<any> = this.$q.defer();\n this.getFormDigestValue(this.baseUrl)\n .then((requestDigest: string): ng.IPromise<ng.IHttpPromiseCallbackArg<any>> => {\n return this.$http({\n url: endPoint || this.baseUrl + url,\n method: \"POST\",\n transformRequest: angular.identity,\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n \"X-RequestDigest\": requestDigest,\n \"content-Type\": undefined\n },\n data: ArrayBuffer\n });\n }).then((response: ng.IHttpPromiseCallbackArg<any>): void => {\n deferred.resolve(response.data);\n }, (error: any): void => {\n const iError: IError = {\n code: error.data.error.code,\n message: error.data.error.message.value,\n status: error.status,\n statusText: error.statusText\n };\n deferred.reject(iError);\n });\n return deferred.promise;\n }\n\n private getFormDigestValue(webUrl: string): ng.IPromise<string> {\n const deferred: ng.IDeferred<string> = this.$q.defer();\n\n this.$http({\n url: webUrl + '/_api/contextinfo',\n method: 'POST',\n headers: {\n 'Accept': 'application/json;odata=nometadata'\n }\n })\n .then((digestResult: ng.IHttpPromiseCallbackArg<{ FormDigestValue: string }>): void => {\n deferred.resolve(digestResult.data.FormDigestValue);\n }, (error: any): void => {\n const iError: IError = {\n code: error.data.error.code,\n message: error.data.error.message.value,\n status: error.status,\n statusText: error.statusText\n };\n deferred.reject(iError);\n });\n\n return deferred.promise;\n }\n}"],"sourceRoot":"..\\..\\..\\..\\..\\src"}