Showing
20 changed files
with
107 additions
and
104 deletions
dist/api/device-info.d.ts
deleted
100644 → 0
dist/api/device-info.js.map
0 → 100644
| 1 | +{"version":3,"file":"device-info.js","sourceRoot":"","sources":["../../src/api/device-info.ts"],"names":[],"mappings":""} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
dist/api/node.d.ts
deleted
100644 → 0
dist/api/node.js.map
0 → 100644
| 1 | +{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/api/node.ts"],"names":[],"mappings":""} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
dist/index.d.ts
deleted
100644 → 0
| 1 | -"use strict"; | 1 | +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
| 2 | -function __export(m) { | 2 | + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
| 3 | - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | 3 | + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
| 4 | -} | 4 | + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
| 5 | -__export(require("./services/rest")); | 5 | + return c > 3 && r && Object.defineProperty(target, key, r), r; |
| 6 | -__export(require("./services/repository")); | 6 | +}; |
| 7 | -__export(require("./services/device")); | 7 | +import { HttpModule } from '@angular/http'; |
| 8 | +import { NgModule } from '@angular/core'; | ||
| 9 | +import { Rest } from './services/rest'; | ||
| 10 | +import { Repository } from './services/repository'; | ||
| 11 | +import { Device } from './services/device'; | ||
| 12 | +export * from './services/rest'; | ||
| 13 | +export * from './services/repository'; | ||
| 14 | +export * from './services/device'; | ||
| 15 | +var DigsigServicesModule = DigsigServicesModule_1 = (function () { | ||
| 16 | + function DigsigServicesModule() { | ||
| 17 | + } | ||
| 18 | + DigsigServicesModule.forRoot = function () { | ||
| 19 | + return { | ||
| 20 | + ngModule: DigsigServicesModule_1, | ||
| 21 | + providers: [ | ||
| 22 | + Rest, | ||
| 23 | + Repository, | ||
| 24 | + Device | ||
| 25 | + ] | ||
| 26 | + }; | ||
| 27 | + }; | ||
| 28 | + return DigsigServicesModule; | ||
| 29 | +}()); | ||
| 30 | +DigsigServicesModule = DigsigServicesModule_1 = __decorate([ | ||
| 31 | + NgModule({ | ||
| 32 | + imports: [ | ||
| 33 | + HttpModule | ||
| 34 | + ] | ||
| 35 | + }) | ||
| 36 | +], DigsigServicesModule); | ||
| 37 | +export { DigsigServicesModule }; | ||
| 38 | +var DigsigServicesModule_1; | ||
| 39 | +//# sourceMappingURL=index.js.map | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
dist/index.js.map
0 → 100644
| 1 | +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAuB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AASlC,IAAa,oBAAoB;IAAjC;IAWA,CAAC;IAVQ,4BAAO,GAAd;QACE,MAAM,CAAC;YACL,QAAQ,EAAE,sBAAoB;YAC9B,SAAS,EAAE;gBACT,IAAI;gBACJ,UAAU;gBACV,MAAM;aACP;SACF,CAAA;IACH,CAAC;IACH,2BAAC;AAAD,CAAC,AAXD,IAWC;AAXY,oBAAoB;IALhC,QAAQ,CAAC;QACN,OAAO,EAAG;YACN,UAAU;SACb;KACJ,CAAC;GACW,oBAAoB,CAWhC;SAXY,oBAAoB"} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
dist/services/device.d.ts
deleted
100644 → 0
| 1 | -"use strict"; | ||
| 2 | var Device = (function () { | 1 | var Device = (function () { |
| 3 | function Device() { | 2 | function Device() { |
| 4 | } | 3 | } |
| ... | @@ -17,4 +16,5 @@ var Device = (function () { | ... | @@ -17,4 +16,5 @@ var Device = (function () { |
| 17 | }; | 16 | }; |
| 18 | return Device; | 17 | return Device; |
| 19 | }()); | 18 | }()); |
| 20 | -exports.Device = Device; | 19 | +export { Device }; |
| 20 | +//# sourceMappingURL=device.js.map | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
dist/services/device.js.map
0 → 100644
| 1 | +{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/services/device.ts"],"names":[],"mappings":"AAAA;IAAA;IAiBA,CAAC;IAfG,uBAAM,GAAN;QACI,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC5B,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC7B,CAAC;IACL,CAAC;IAED,qBAAI,GAAJ;QACI,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;YAC7C,EAAE,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;gBACnC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtC,CAAC;QACL,CAAC;IACL,CAAC;IAEL,aAAC;AAAD,CAAC,AAjBD,IAiBC"} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
dist/services/repository.d.ts
deleted
100644 → 0
| 1 | -import { Rest } from './rest'; | ||
| 2 | -import { Device } from './device'; | ||
| 3 | -import { DeviceInfo } from '../api/device-info'; | ||
| 4 | -import { Node } from '../api/node'; | ||
| 5 | -export declare class Repository { | ||
| 6 | - protected rest: Rest; | ||
| 7 | - protected device: Device; | ||
| 8 | - protected _db: any; | ||
| 9 | - protected _params: any; | ||
| 10 | - protected _node: Node; | ||
| 11 | - db: any; | ||
| 12 | - params: any; | ||
| 13 | - readonly localNode: Node; | ||
| 14 | - constructor(rest: Rest, device: Device); | ||
| 15 | - findById(id: string): Promise<any>; | ||
| 16 | - findByIds(ids: Array<string>): Promise<Array<any>>; | ||
| 17 | - findByType(type: string): Promise<Array<any>>; | ||
| 18 | - replicate(deviceInfo: DeviceInfo): Promise<boolean>; | ||
| 19 | - tryLocalEnvironment(response: any): Promise<void>; | ||
| 20 | - prepare(url: string): Promise<any>; | ||
| 21 | - init(db_name: string): Promise<any>; | ||
| 22 | - parseUrl(url: string): any; | ||
| 23 | - prepareDocs(res: any): Array<any>; | ||
| 24 | -} |
| 1 | -"use strict"; | ||
| 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
| 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
| 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
| ... | @@ -8,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, | ... | @@ -8,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, |
| 8 | var __metadata = (this && this.__metadata) || function (k, v) { | 7 | var __metadata = (this && this.__metadata) || function (k, v) { |
| 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
| 10 | }; | 9 | }; |
| 11 | -var core_1 = require("@angular/core"); | 10 | +import { Injectable } from '@angular/core'; |
| 12 | -var rest_1 = require("./rest"); | 11 | +import { Rest } from './rest'; |
| 13 | -var device_1 = require("./device"); | 12 | +import { Device } from './device'; |
| 14 | var Repository = (function () { | 13 | var Repository = (function () { |
| 15 | function Repository(rest, device) { | 14 | function Repository(rest, device) { |
| 16 | this.rest = rest; | 15 | this.rest = rest; |
| ... | @@ -203,8 +202,9 @@ var Repository = (function () { | ... | @@ -203,8 +202,9 @@ var Repository = (function () { |
| 203 | return Repository; | 202 | return Repository; |
| 204 | }()); | 203 | }()); |
| 205 | Repository = __decorate([ | 204 | Repository = __decorate([ |
| 206 | - core_1.Injectable(), | 205 | + Injectable(), |
| 207 | - __metadata("design:paramtypes", [rest_1.Rest, | 206 | + __metadata("design:paramtypes", [Rest, |
| 208 | - device_1.Device]) | 207 | + Device]) |
| 209 | ], Repository); | 208 | ], Repository); |
| 210 | -exports.Repository = Repository; | 209 | +export { Repository }; |
| 210 | +//# sourceMappingURL=repository.js.map | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
dist/services/repository.js.map
0 → 100644
| 1 | +{"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/services/repository.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAOhC,IAAa,UAAU;IA0BnB,oBACc,IAAS,EACT,MAAa;QADb,SAAI,GAAJ,IAAI,CAAK;QACT,WAAM,GAAN,MAAM,CAAO;QAxBjB,UAAK,GAAQ,IAAI,CAAC;IAyBzB,CAAC;IAvBJ,sBAAI,0BAAE;aAAN;YACI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QACpB,CAAC;aAED,UAAO,EAAE;YACL,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;IAED,gCAAW,GAAX,UAAY,GAAG;QACX,IAAI,IAAI,GAAG,EAAE,CAAC;QAEd,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;YACrB,GAAG,CAAA,CAAY,UAAQ,EAAR,KAAA,GAAG,CAAC,IAAI,EAAR,cAAQ,EAAR,IAAQ;gBAAnB,IAAI,GAAG,SAAA;gBACP,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACtB;QACL,CAAC;QAED,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC;IAEL,iBAAC;AAAD,CAAC,AAhMD,IAgMC;AAhMY,UAAU;IADtB,UAAU,EAAE;qCA4BU,IAAI;QACF,MAAM;GA5BlB,UAAU,CAgMtB;SAhMY,UAAU"} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
dist/services/rest.d.ts
deleted
100644 → 0
| 1 | -import { Http } from '@angular/http'; | ||
| 2 | -import { DeviceInfo } from './../api/device-info'; | ||
| 3 | -import { Node } from './../api/node'; | ||
| 4 | -import 'rxjs/add/operator/timeout'; | ||
| 5 | -export declare const ERROR_CODE_UNAUTHORIZED: string; | ||
| 6 | -export declare const ERROR_CODE_NOT_FOUND: string; | ||
| 7 | -export declare const ERROR_CODE_SERVER_ERROR: string; | ||
| 8 | -export declare class Rest { | ||
| 9 | - private http; | ||
| 10 | - static localWebPort: number; | ||
| 11 | - static serviceUrl: string; | ||
| 12 | - constructor(http: Http); | ||
| 13 | - prepareDeviceInfo(deviceInfo: DeviceInfo, prefixed?: boolean): string; | ||
| 14 | - register(registerCode: string, deviceInfo: DeviceInfo): Promise<any>; | ||
| 15 | - heartbeat(deviceInfo: DeviceInfo): Promise<any>; | ||
| 16 | - scanNode(node: any): Promise<Node>; | ||
| 17 | - scanEnvironment(nodes: any[]): Promise<Node>; | ||
| 18 | -} |
| 1 | -"use strict"; | ||
| 2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | 1 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
| 3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | 2 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
| 4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | 3 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
| ... | @@ -8,12 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, | ... | @@ -8,12 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, |
| 8 | var __metadata = (this && this.__metadata) || function (k, v) { | 7 | var __metadata = (this && this.__metadata) || function (k, v) { |
| 9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | 8 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
| 10 | }; | 9 | }; |
| 11 | -var core_1 = require("@angular/core"); | 10 | +import { Injectable } from '@angular/core'; |
| 12 | -var http_1 = require("@angular/http"); | 11 | +import { Http, Headers } from '@angular/http'; |
| 13 | -require("rxjs/add/operator/timeout"); | 12 | +import 'rxjs/add/operator/timeout'; |
| 14 | -exports.ERROR_CODE_UNAUTHORIZED = "unauthorized"; | 13 | +export var ERROR_CODE_UNAUTHORIZED = "unauthorized"; |
| 15 | -exports.ERROR_CODE_NOT_FOUND = "not-found"; | 14 | +export var ERROR_CODE_NOT_FOUND = "not-found"; |
| 16 | -exports.ERROR_CODE_SERVER_ERROR = "server-error"; | 15 | +export var ERROR_CODE_SERVER_ERROR = "server-error"; |
| 17 | var Rest = Rest_1 = (function () { | 16 | var Rest = Rest_1 = (function () { |
| 18 | function Rest(http) { | 17 | function Rest(http) { |
| 19 | this.http = http; | 18 | this.http = http; |
| ... | @@ -51,17 +50,17 @@ var Rest = Rest_1 = (function () { | ... | @@ -51,17 +50,17 @@ var Rest = Rest_1 = (function () { |
| 51 | Rest.prototype.register = function (registerCode, deviceInfo) { | 50 | Rest.prototype.register = function (registerCode, deviceInfo) { |
| 52 | var _this = this; | 51 | var _this = this; |
| 53 | return new Promise(function (resolve, reject) { | 52 | return new Promise(function (resolve, reject) { |
| 54 | - var headers = new http_1.Headers(); | 53 | + var headers = new Headers(); |
| 55 | headers.append('Content-Type', 'application/x-www-form-urlencoded'); | 54 | headers.append('Content-Type', 'application/x-www-form-urlencoded'); |
| 56 | deviceInfo.code = registerCode; | 55 | deviceInfo.code = registerCode; |
| 57 | _this.http.post(Rest_1.serviceUrl + "/config/register", _this.prepareDeviceInfo(deviceInfo), { headers: headers }).subscribe(function (response) { | 56 | _this.http.post(Rest_1.serviceUrl + "/config/register", _this.prepareDeviceInfo(deviceInfo), { headers: headers }).subscribe(function (response) { |
| 58 | resolve(); | 57 | resolve(); |
| 59 | }, function (error) { | 58 | }, function (error) { |
| 60 | if (error.status == 401) { | 59 | if (error.status == 401) { |
| 61 | - reject(exports.ERROR_CODE_UNAUTHORIZED); | 60 | + reject(ERROR_CODE_UNAUTHORIZED); |
| 62 | } | 61 | } |
| 63 | else { | 62 | else { |
| 64 | - reject(exports.ERROR_CODE_SERVER_ERROR); | 63 | + reject(ERROR_CODE_SERVER_ERROR); |
| 65 | } | 64 | } |
| 66 | }); | 65 | }); |
| 67 | }); | 66 | }); |
| ... | @@ -69,7 +68,7 @@ var Rest = Rest_1 = (function () { | ... | @@ -69,7 +68,7 @@ var Rest = Rest_1 = (function () { |
| 69 | Rest.prototype.heartbeat = function (deviceInfo) { | 68 | Rest.prototype.heartbeat = function (deviceInfo) { |
| 70 | var _this = this; | 69 | var _this = this; |
| 71 | return new Promise(function (resolve, reject) { | 70 | return new Promise(function (resolve, reject) { |
| 72 | - var headers = new http_1.Headers(); | 71 | + var headers = new Headers(); |
| 73 | headers.append('Content-Type', 'application/x-www-form-urlencoded'); | 72 | headers.append('Content-Type', 'application/x-www-form-urlencoded'); |
| 74 | _this.http.post(Rest_1.serviceUrl + "/config/heartbeat", _this.prepareDeviceInfo(deviceInfo, false), { headers: headers }) | 73 | _this.http.post(Rest_1.serviceUrl + "/config/heartbeat", _this.prepareDeviceInfo(deviceInfo, false), { headers: headers }) |
| 75 | .subscribe(function (response) { | 74 | .subscribe(function (response) { |
| ... | @@ -77,13 +76,13 @@ var Rest = Rest_1 = (function () { | ... | @@ -77,13 +76,13 @@ var Rest = Rest_1 = (function () { |
| 77 | }, function (error) { | 76 | }, function (error) { |
| 78 | switch (error.status) { | 77 | switch (error.status) { |
| 79 | case 401: | 78 | case 401: |
| 80 | - reject(exports.ERROR_CODE_UNAUTHORIZED); | 79 | + reject(ERROR_CODE_UNAUTHORIZED); |
| 81 | break; | 80 | break; |
| 82 | case 404: | 81 | case 404: |
| 83 | - reject(exports.ERROR_CODE_NOT_FOUND); | 82 | + reject(ERROR_CODE_NOT_FOUND); |
| 84 | break; | 83 | break; |
| 85 | default: | 84 | default: |
| 86 | - reject(exports.ERROR_CODE_SERVER_ERROR); | 85 | + reject(ERROR_CODE_SERVER_ERROR); |
| 87 | break; | 86 | break; |
| 88 | } | 87 | } |
| 89 | }); | 88 | }); |
| ... | @@ -145,8 +144,9 @@ var Rest = Rest_1 = (function () { | ... | @@ -145,8 +144,9 @@ var Rest = Rest_1 = (function () { |
| 145 | Rest.localWebPort = 8320; | 144 | Rest.localWebPort = 8320; |
| 146 | Rest.serviceUrl = "http://someurl.com"; | 145 | Rest.serviceUrl = "http://someurl.com"; |
| 147 | Rest = Rest_1 = __decorate([ | 146 | Rest = Rest_1 = __decorate([ |
| 148 | - core_1.Injectable(), | 147 | + Injectable(), |
| 149 | - __metadata("design:paramtypes", [http_1.Http]) | 148 | + __metadata("design:paramtypes", [Http]) |
| 150 | ], Rest); | 149 | ], Rest); |
| 151 | -exports.Rest = Rest; | 150 | +export { Rest }; |
| 152 | var Rest_1; | 151 | var Rest_1; |
| 152 | +//# sourceMappingURL=rest.js.map | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
dist/services/rest.js.map
0 → 100644
| 1 | +{"version":3,"file":"rest.js","sourceRoot":"","sources":["../../src/services/rest.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,IAAI,EAAU,OAAO,EAAC,MAAM,eAAe,CAAC;AAGpD,OAAO,2BAA2B,CAAA;AAElC,MAAM,CAAC,IAAM,uBAAuB,GAAU,cAAc,CAAC;AAC7D,MAAM,CAAC,IAAM,oBAAoB,GAAU,WAAW,CAAC;AACvD,MAAM,CAAC,IAAM,uBAAuB,GAAU,cAAc,CAAC;AAG7D,IAAa,IAAI;IAKb,cAAoB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAEjC,gCAAiB,GAAjB,UAAkB,UAAqB,EAAE,QAAuB;QAAvB,yBAAA,EAAA,eAAuB;QAC5D,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,EAAE,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;YAChB,MAAM,IAAI,aAAa,GAAC,UAAU,CAAC,EAAE,CAAC;QAC1C,CAAC;QACD,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;YACtB,MAAM,IAAI,mBAAmB,GAAC,UAAU,CAAC,QAAQ,CAAC;QACtD,CAAC;QACD,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;YACtB,MAAM,IAAI,mBAAmB,GAAC,UAAU,CAAC,QAAQ,CAAC;QACtD,CAAC;QACD,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAClB,MAAM,IAAI,eAAe,GAAC,UAAU,CAAC,IAAI,CAAC;QAC9C,CAAC;QACD,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;YACr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AC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;oBACnB,OAAO,CAAC,KAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;gBACzC,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,MAAM,EAAE,CAAC;gBACb,CAAC;YACL,CAAC,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;IACP,CAAC;IAEL,WAAC;AAAD,CAAC,AAvID,IAuIC;AArIiB,iBAAY,GAAU,IAAI,CAAC;AAC3B,eAAU,GAAW,oBAAoB,CAAC;AAH/C,IAAI;IADhB,UAAU,EAAE;qCAMgB,IAAI;GALpB,IAAI,CAuIhB;SAvIY,IAAI"} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +import { HttpModule } from '@angular/http'; | ||
| 2 | +import { NgModule, ModuleWithProviders } from '@angular/core'; | ||
| 3 | +import { Rest } from './services/rest'; | ||
| 4 | +import { Repository } from './services/repository'; | ||
| 5 | +import { Device } from './services/device'; | ||
| 6 | + | ||
| 1 | export * from './services/rest'; | 7 | export * from './services/rest'; |
| 2 | export * from './services/repository'; | 8 | export * from './services/repository'; |
| 3 | export * from './services/device'; | 9 | export * from './services/device'; |
| 4 | -export * from './api/device-info'; | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 10 | +export * from './api/device-info'; | ||
| 11 | +export * from './api/node'; | ||
| 12 | + | ||
| 13 | +@NgModule({ | ||
| 14 | + imports : [ | ||
| 15 | + HttpModule | ||
| 16 | + ] | ||
| 17 | +}) | ||
| 18 | +export class DigsigServicesModule { | ||
| 19 | + static forRoot(): ModuleWithProviders { | ||
| 20 | + return { | ||
| 21 | + ngModule: DigsigServicesModule, | ||
| 22 | + providers: [ | ||
| 23 | + Rest, | ||
| 24 | + Repository, | ||
| 25 | + Device | ||
| 26 | + ] | ||
| 27 | + } | ||
| 28 | + } | ||
| 29 | +} | ||
| 30 | + | ... | ... |
| 1 | { | 1 | { |
| 2 | "compilerOptions": { | 2 | "compilerOptions": { |
| 3 | "allowSyntheticDefaultImports": true, | 3 | "allowSyntheticDefaultImports": true, |
| 4 | - "declaration": true, | 4 | + "declaration": false, |
| 5 | "experimentalDecorators": true, | 5 | "experimentalDecorators": true, |
| 6 | "emitDecoratorMetadata": true, | 6 | "emitDecoratorMetadata": true, |
| 7 | "lib": ["dom", "es2015"], | 7 | "lib": ["dom", "es2015"], |
| 8 | "noImplicitAny": false, | 8 | "noImplicitAny": false, |
| 9 | "outDir": "./dist/", | 9 | "outDir": "./dist/", |
| 10 | - "target": "es5" | 10 | + "target": "es5", |
| 11 | + "module": "es2015", | ||
| 12 | + "moduleResolution": "node", | ||
| 13 | + "sourceMap": true, | ||
| 14 | + "compileOnSave": false | ||
| 11 | }, | 15 | }, |
| 12 | "exclude": [ | 16 | "exclude": [ |
| 13 | "node_modules", | 17 | "node_modules", | ... | ... |
-
Please register or login to post a comment