ng2-rest 18.0.19 → 18.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +135 -135
  2. package/assets/shared/shared_folder_info.txt +1 -1
  3. package/browser/README.md +24 -24
  4. package/client/README.md +24 -24
  5. package/index.js +15 -2
  6. package/index.js.map +1 -1
  7. package/lib/build-info._auto-generated_.js.map +1 -1
  8. package/lib/content-type.js +1 -1
  9. package/lib/content-type.js.map +1 -1
  10. package/lib/cookie.js +16 -20
  11. package/lib/cookie.js.map +1 -1
  12. package/lib/helpers.js +18 -29
  13. package/lib/helpers.js.map +1 -1
  14. package/lib/index._auto-generated_.d.ts +1 -0
  15. package/lib/index._auto-generated_.js.map +1 -1
  16. package/lib/index.js +22 -9
  17. package/lib/index.js.map +1 -1
  18. package/lib/mapping.js +84 -81
  19. package/lib/mapping.js.map +1 -1
  20. package/lib/models.js +144 -181
  21. package/lib/models.js.map +1 -1
  22. package/lib/other/simple-resource.js +92 -94
  23. package/lib/other/simple-resource.js.map +1 -1
  24. package/lib/params.js +69 -70
  25. package/lib/params.js.map +1 -1
  26. package/lib/request-cache.js +37 -41
  27. package/lib/request-cache.js.map +1 -1
  28. package/lib/resource-service.js +98 -102
  29. package/lib/resource-service.js.map +1 -1
  30. package/lib/rest-headers.js +56 -61
  31. package/lib/rest-headers.js.map +1 -1
  32. package/lib/rest-request.js +232 -250
  33. package/lib/rest-request.js.map +1 -1
  34. package/lib/rest.class.js +101 -116
  35. package/lib/rest.class.js.map +1 -1
  36. package/migrations/index.js +15 -2
  37. package/migrations/index.js.map +1 -1
  38. package/migrations/migrations_index._auto-generated_.d.ts +1 -0
  39. package/migrations/migrations_index._auto-generated_.js.map +1 -1
  40. package/package.json +19 -73
  41. package/src.d.ts +1 -1
  42. package/tmp-environment.json +8 -406
  43. package/websql/README.md +24 -24
  44. package/browser/package.json +0 -25
  45. package/taon.jsonc +0 -52
  46. package/websql/package.json +0 -25
package/README.md CHANGED
@@ -1,135 +1,135 @@
1
-
2
- ## ng2-rest ##
3
-
4
- Robust isomorphic REST framework for browser (Angular, React etc.) and backend (NodeJS) JavaScript/TypeScript apps.
5
-
6
- Features:
7
- - Compatible with Angular (2+) (newest 13,14 also...) , React, Vue , NodeJS (works everywhere)
8
- - Compatible with RxJS operators (exhaustMap, switchMap, request cancelation etc.)
9
- - Based on [axios](https://axios-http.com/) => excellent alternative to Angular's [HttpClient](https://angular.io/api/common/http/HttpClient)
10
- - JSONP api request handling
11
- - Transfer class instance from server to client and back
12
- - Elegant way of dealing with REST api ( *similar to ExpressJS routes definitions* )
13
-
14
- (more documentation soon... )
15
-
16
- To install this package run:
17
-
18
- npm install ng2-rest --save
19
-
20
- Import Resource class:
21
- ```ts
22
- import { Resource } from 'ng2-rest/browser';
23
- ```
24
-
25
- Resource
26
- ========
27
-
28
- Fit you existing API (not only REST) into new fluent objects with **Resource**
29
- class observables. Use power of **async** in new angular templates;
30
-
31
- **template.html**
32
- ```html
33
- Users:
34
- <ul *ngIf="model.allUsers() | async; else loader; let users" >
35
-
36
- <li *ngFor="let user of users">
37
- {{user.id}} {{user.fullName()}}
38
- <br>
39
- <input type="name" [(NgModel)]="user.name" >
40
- <button (click)="model.update(user)" > Update </button>
41
- </li>
42
-
43
- </ul>
44
-
45
- <ng-template #loader> loading users... </ng-template>
46
-
47
- ```
48
- **component.ts**
49
- ```ts
50
- class User {
51
- name: string;
52
- surname: string;
53
- id: number;
54
-
55
- fullName() {
56
- return `Surname: ${this.surname}, Name: ${this.name}`;
57
- }
58
- }
59
-
60
- // Express.js style url endpoint model
61
- // you can ommit "<User>" part is you don't wanna see response interface
62
- // also you can ommit third argument ",User" is you don't wanna
63
- // map response object to User class objects
64
- const rest = Resource.create<User>("http://yourbackend.com/api","users/:id",{'':User} )
65
-
66
- class UserComponent {
67
-
68
- // Prepare your beautiful interface
69
- model = {
70
- allUsers: () => rest.model()
71
- .array
72
- .get()
73
- .observable // Observable resposne (useful for Angular 2+ html templates)
74
- .pipe( map({ body } => body.json) ) // get all users, body.json => User[]
75
-
76
- userBy: (id) => rest.model({id})
77
- .get() // Promise response by default
78
- .then({ body } => console.log(body.json)) // get user by id, body.json => User
79
-
80
- update: async (user:User) =>{
81
- try {
82
- await rest.model({id:user.id}).put(user) // Promise response by default
83
-
84
- alert('Update sucess')
85
- } catch(e) {
86
- alert(e)
87
- }
88
- }
89
- }
90
-
91
- constructor() { }
92
-
93
- }
94
- ```
95
-
96
- Specification
97
- ============
98
- Example **UrlParams[]** :
99
- `[ { sort: true },{ filter: 'id,5' }, { filter: 'name,test' } ]`
100
-
101
-
102
- | Name | Parameters | Description |
103
- | :---: | --- | ---: |
104
- | **.array.** | get,post,put,head,delete,jsonp | for everything, but with arrays |
105
- | **get** | `UrlParams[] ` | get model by parameters |
106
- | **post** | `model, UrlParams[] ` | post object model |
107
- | **put** | `model, UrlParams[]` | put object model |
108
- | **head** | `model, UrlParams[]` | get head for model |
109
- | **delete** | `UrlParams[]` | remove object by params |
110
- | **jsonp** | `UrlParams[]` | get jsonp data |
111
-
112
-
113
-
114
- # Production mode
115
- ===
116
- Nice things to do in production mode:
117
-
118
- **1. Disable warnings.**
119
-
120
- If you don't wanna see warning, disable it like this:
121
- ```ts
122
- if (environment.production) {
123
- Resource.enableWarnings = false;
124
- }
125
- ```
126
-
127
- # Angular 2+ ngZone
128
- If you are using Angular 2+ you need to do this in your root **app.component**:
129
- ```ts
130
- constructor(zone:NgZone) {
131
- Resource.initAngularNgZone(zone)
132
- }
133
- ```
134
-
135
-
1
+
2
+ ## ng2-rest ##
3
+
4
+ Robust isomorphic REST framework for browser (Angular, React etc.) and backend (NodeJS) JavaScript/TypeScript apps.
5
+
6
+ Features:
7
+ - Compatible with Angular (2+) (newest 13,14 also...) , React, Vue , NodeJS (works everywhere)
8
+ - Compatible with RxJS operators (exhaustMap, switchMap, request cancelation etc.)
9
+ - Based on [axios](https://axios-http.com/) => excellent alternative to Angular's [HttpClient](https://angular.io/api/common/http/HttpClient)
10
+ - JSONP api request handling
11
+ - Transfer class instance from server to client and back
12
+ - Elegant way of dealing with REST api ( *similar to ExpressJS routes definitions* )
13
+
14
+ (more documentation soon... )
15
+
16
+ To install this package run:
17
+
18
+ npm install ng2-rest --save
19
+
20
+ Import Resource class:
21
+ ```ts
22
+ import { Resource } from 'ng2-rest/browser';
23
+ ```
24
+
25
+ Resource
26
+ ========
27
+
28
+ Fit you existing API (not only REST) into new fluent objects with **Resource**
29
+ class observables. Use power of **async** in new angular templates;
30
+
31
+ **template.html**
32
+ ```html
33
+ Users:
34
+ <ul *ngIf="model.allUsers() | async; else loader; let users" >
35
+
36
+ <li *ngFor="let user of users">
37
+ {{user.id}} {{user.fullName()}}
38
+ <br>
39
+ <input type="name" [(NgModel)]="user.name" >
40
+ <button (click)="model.update(user)" > Update </button>
41
+ </li>
42
+
43
+ </ul>
44
+
45
+ <ng-template #loader> loading users... </ng-template>
46
+
47
+ ```
48
+ **component.ts**
49
+ ```ts
50
+ class User {
51
+ name: string;
52
+ surname: string;
53
+ id: number;
54
+
55
+ fullName() {
56
+ return `Surname: ${this.surname}, Name: ${this.name}`;
57
+ }
58
+ }
59
+
60
+ // Express.js style url endpoint model
61
+ // you can ommit "<User>" part is you don't wanna see response interface
62
+ // also you can ommit third argument ",User" is you don't wanna
63
+ // map response object to User class objects
64
+ const rest = Resource.create<User>("http://yourbackend.com/api","users/:id",{'':User} )
65
+
66
+ class UserComponent {
67
+
68
+ // Prepare your beautiful interface
69
+ model = {
70
+ allUsers: () => rest.model()
71
+ .array
72
+ .get()
73
+ .observable // Observable resposne (useful for Angular 2+ html templates)
74
+ .pipe( map({ body } => body.json) ) // get all users, body.json => User[]
75
+
76
+ userBy: (id) => rest.model({id})
77
+ .get() // Promise response by default
78
+ .then({ body } => console.log(body.json)) // get user by id, body.json => User
79
+
80
+ update: async (user:User) =>{
81
+ try {
82
+ await rest.model({id:user.id}).put(user) // Promise response by default
83
+
84
+ alert('Update sucess')
85
+ } catch(e) {
86
+ alert(e)
87
+ }
88
+ }
89
+ }
90
+
91
+ constructor() { }
92
+
93
+ }
94
+ ```
95
+
96
+ Specification
97
+ ============
98
+ Example **UrlParams[]** :
99
+ `[ { sort: true },{ filter: 'id,5' }, { filter: 'name,test' } ]`
100
+
101
+
102
+ | Name | Parameters | Description |
103
+ | :---: | --- | ---: |
104
+ | **.array.** | get,post,put,head,delete,jsonp | for everything, but with arrays |
105
+ | **get** | `UrlParams[] ` | get model by parameters |
106
+ | **post** | `model, UrlParams[] ` | post object model |
107
+ | **put** | `model, UrlParams[]` | put object model |
108
+ | **head** | `model, UrlParams[]` | get head for model |
109
+ | **delete** | `UrlParams[]` | remove object by params |
110
+ | **jsonp** | `UrlParams[]` | get jsonp data |
111
+
112
+
113
+
114
+ # Production mode
115
+ ===
116
+ Nice things to do in production mode:
117
+
118
+ **1. Disable warnings.**
119
+
120
+ If you don't wanna see warning, disable it like this:
121
+ ```ts
122
+ if (environment.production) {
123
+ Resource.enableWarnings = false;
124
+ }
125
+ ```
126
+
127
+ # Angular 2+ ngZone
128
+ If you are using Angular 2+ you need to do this in your root **app.component**:
129
+ ```ts
130
+ constructor(zone:NgZone) {
131
+ Resource.initAngularNgZone(zone)
132
+ }
133
+ ```
134
+
135
+
@@ -1,6 +1,6 @@
1
1
  THIS FILE IS GENERATED. THIS FILE IS GENERATED. THIS FILE IS GENERATED.
2
2
 
3
- Assets from this folder are being shipped with this npm package (ng2-rest@18.0.19)
3
+ Assets from this folder are being shipped with this npm package (ng2-rest@18.0.20)
4
4
  created from this project.
5
5
 
6
6
  THIS FILE IS GENERATED.THIS FILE IS GENERATED. THIS FILE IS GENERATED.
package/browser/README.md CHANGED
@@ -1,24 +1,24 @@
1
- # MyLib
2
-
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
-
5
- ## Code scaffolding
6
-
7
- Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
8
- > Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
9
-
10
- ## Build
11
-
12
- Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
13
-
14
- ## Publishing
15
-
16
- After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
17
-
18
- ## Running unit tests
19
-
20
- Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
-
22
- ## Further help
23
-
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
1
+ # MyLib
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
8
+ > Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
9
+
10
+ ## Build
11
+
12
+ Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+
14
+ ## Publishing
15
+
16
+ After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
17
+
18
+ ## Running unit tests
19
+
20
+ Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
+
22
+ ## Further help
23
+
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
package/client/README.md CHANGED
@@ -1,24 +1,24 @@
1
- # MyLib
2
-
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
-
5
- ## Code scaffolding
6
-
7
- Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
8
- > Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
9
-
10
- ## Build
11
-
12
- Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
13
-
14
- ## Publishing
15
-
16
- After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
17
-
18
- ## Running unit tests
19
-
20
- Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
-
22
- ## Further help
23
-
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
1
+ # MyLib
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
8
+ > Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
9
+
10
+ ## Build
11
+
12
+ Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+
14
+ ## Publishing
15
+
16
+ After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
17
+
18
+ ## Running unit tests
19
+
20
+ Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
+
22
+ ## Further help
23
+
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
package/index.js CHANGED
@@ -1,5 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./lib"), exports);
17
+ __exportStar(require("./lib"), exports);
5
18
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,gDAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/ng2-rest/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB"}
@@ -1 +1 @@
1
- {"version":3,"file":"build-info._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AACa,QAAA,wBAAwB,GAAG,KAAK,CAAC"}
1
+ {"version":3,"file":"build-info._auto-generated_.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/ng2-rest/src/lib/build-info._auto-generated_.ts"],"names":[],"mappings":";;;AACa,QAAA,wBAAwB,GAAG,KAAK,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CONTENT_TYPE = void 0;
4
- var rest_headers_1 = require("./rest-headers");
4
+ const rest_headers_1 = require("./rest-headers");
5
5
  exports.CONTENT_TYPE = {
6
6
  APPLICATION_JSON: rest_headers_1.RestHeaders.from({
7
7
  'Content-Type': 'application/json',
@@ -1 +1 @@
1
- {"version":3,"file":"content-type.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,+CAA6C;AAGhC,QAAA,YAAY,GAAG;IAC1B,gBAAgB,EAAE,0BAAW,CAAC,IAAI,CAAC;QACjC,cAAc,EAAE,kBAAkB;QAClC,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;IACF,wBAAwB,EAAE,0BAAW,CAAC,IAAI,CAAC;QACzC,cAAc,EAAE,0BAA0B;QAC1C,QAAQ,EAAE,0BAA0B;KACrC,CAAC;CACH,CAAA"}
1
+ {"version":3,"file":"content-type.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/ng2-rest/src/lib/content-type.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAGhC,QAAA,YAAY,GAAG;IAC1B,gBAAgB,EAAE,0BAAW,CAAC,IAAI,CAAC;QACjC,cAAc,EAAE,kBAAkB;QAClC,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;IACF,wBAAwB,EAAE,0BAAW,CAAC,IAAI,CAAC;QACzC,cAAc,EAAE,0BAA0B;QAC1C,QAAQ,EAAE,0BAA0B;KACrC,CAAC;CACH,CAAA"}
package/lib/cookie.js CHANGED
@@ -1,24 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Cookie = void 0;
4
- var Cookie = /** @class */ (function () {
5
- function Cookie() {
4
+ class Cookie {
5
+ static get Instance() {
6
+ if (!Cookie.__instance) {
7
+ Cookie.__instance = new Cookie();
8
+ }
9
+ return Cookie.__instance;
10
+ }
11
+ static __instance;
12
+ constructor() {
6
13
  }
7
- Object.defineProperty(Cookie, "Instance", {
8
- get: function () {
9
- if (!Cookie.__instance) {
10
- Cookie.__instance = new Cookie();
11
- }
12
- return Cookie.__instance;
13
- },
14
- enumerable: false,
15
- configurable: true
16
- });
17
- Cookie.prototype.read = function (name) {
14
+ read(name) {
18
15
  var result = new RegExp('(?:^|; )' + encodeURIComponent(name) + '=([^;]*)').exec(document.cookie);
19
16
  return result ? result[1] : null;
20
- };
21
- Cookie.prototype.write = function (name, value, days) {
17
+ }
18
+ write(name, value, days) {
22
19
  if (!days) {
23
20
  days = 365 * 20;
24
21
  }
@@ -26,11 +23,10 @@ var Cookie = /** @class */ (function () {
26
23
  date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
27
24
  var expires = "; expires=" + date.toUTCString();
28
25
  document.cookie = name + "=" + value + expires + "; path=/";
29
- };
30
- Cookie.prototype.remove = function (name) {
26
+ }
27
+ remove(name) {
31
28
  this.write(name, "", -1);
32
- };
33
- return Cookie;
34
- }());
29
+ }
30
+ }
35
31
  exports.Cookie = Cookie;
36
32
  //# sourceMappingURL=cookie.js.map
package/lib/cookie.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cookie.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA;IAUI;IACA,CAAC;IATD,sBAAkB,kBAAQ;aAA1B;YACI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;gBACrB,MAAM,CAAC,UAAU,GAAG,IAAI,MAAM,EAAE,CAAC;YACrC,CAAC;YACD,OAAO,MAAM,CAAC,UAAiB,CAAC;QACpC,CAAC;;;OAAA;IAMD,qBAAI,GAAJ,UAAK,IAAY;QACb,IAAI,MAAM,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAClG,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrC,CAAC;IAED,sBAAK,GAAL,UAAM,IAAY,EAAE,KAAa,EAAE,IAAa;QAC5C,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;QACpB,CAAC;QAED,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QAE5D,IAAI,OAAO,GAAG,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAEhD,QAAQ,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,CAAC;IAChE,CAAC;IAED,uBAAM,GAAN,UAAO,IAAY;QACf,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IAEL,aAAC;AAAD,CAAC,AAnCD,IAmCC;AAnCY,wBAAM"}
1
+ {"version":3,"file":"cookie.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/ng2-rest/src/lib/cookie.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IAER,MAAM,KAAK,QAAQ;QACtB,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,CAAC,UAAU,GAAG,IAAI,MAAM,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,MAAM,CAAC,UAAiB,CAAC;IACpC,CAAC;IACO,MAAM,CAAC,UAAU,CAAC;IAE1B;IACA,CAAC;IAED,IAAI,CAAC,IAAY;QACb,IAAI,MAAM,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAClG,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,IAAY,EAAE,KAAa,EAAE,IAAa;QAC5C,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;QACpB,CAAC;QAED,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QAE5D,IAAI,OAAO,GAAG,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAEhD,QAAQ,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,IAAY;QACf,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CAEJ;AAnCD,wBAmCC"}
package/lib/helpers.js CHANGED
@@ -1,37 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Helpers = void 0;
4
- var tslib_1 = require("tslib");
5
- var tnp_core_1 = require("tnp-core");
6
- var mapping_1 = require("./mapping");
7
- var json10_1 = require("json10");
4
+ const tnp_core_1 = require("tnp-core");
5
+ const mapping_1 = require("./mapping");
6
+ const json10_1 = require("json10");
8
7
  // @ts-ignore
9
- var Helpers = /** @class */ (function (_super) {
10
- tslib_1.__extends(Helpers, _super);
11
- function Helpers() {
12
- return _super !== null && _super.apply(this, arguments) || this;
8
+ class Helpers extends tnp_core_1.CoreHelpers {
9
+ static JSON = json10_1.JSON10;
10
+ static get Mapping() {
11
+ return {
12
+ encode(json, mapping) {
13
+ return mapping_1.Mapping.encode(json, mapping);
14
+ },
15
+ decode(json, autodetect = false) {
16
+ return mapping_1.Mapping.decode(json, autodetect);
17
+ }
18
+ };
13
19
  }
14
- Object.defineProperty(Helpers, "Mapping", {
15
- get: function () {
16
- return {
17
- encode: function (json, mapping) {
18
- return mapping_1.Mapping.encode(json, mapping);
19
- },
20
- decode: function (json, autodetect) {
21
- if (autodetect === void 0) { autodetect = false; }
22
- return mapping_1.Mapping.decode(json, autodetect);
23
- }
24
- };
25
- },
26
- enumerable: false,
27
- configurable: true
28
- });
29
- Helpers.checkValidUrl = function (url) {
30
- var regex = /(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/;
20
+ static checkValidUrl(url) {
21
+ let regex = /(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/;
31
22
  return regex.test(url);
32
- };
33
- Helpers.JSON = json10_1.JSON10;
34
- return Helpers;
35
- }(tnp_core_1.CoreHelpers));
23
+ }
24
+ }
36
25
  exports.Helpers = Helpers;
37
26
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;;AACA,qCAAuC;AACvC,qCAAoC;AACpC,iCAAgC;AAEhC,aAAa;AACb;IAA6B,mCAAW;IAAxC;;IAsBA,CAAC;IAlBC,sBAAW,kBAAO;aAAlB;YACE,OAAO;gBACL,MAAM,YAAe,IAAY,EAAE,OAAwB;oBACzD,OAAO,iBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACvC,CAAC;gBACD,MAAM,YAAC,IAAY,EAAE,UAAkB;oBAAlB,2BAAA,EAAA,kBAAkB;oBACrC,OAAO,iBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;gBACzC,CAAC;aACF,CAAA;QACH,CAAC;;;OAAA;IAEM,qBAAa,GAApB,UAAqB,GAAW;QAC9B,IAAI,KAAK,GAAG,6EAA6E,CAAC;QAC1F,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAhBM,YAAI,GAAG,eAAM,CAAC;IAoBvB,cAAC;CAAA,AAtBD,CAA6B,sBAAW,GAsBvC;AAtBY,0BAAO"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/ng2-rest/src/lib/helpers.ts"],"names":[],"mappings":";;;AACA,uCAAuC;AACvC,uCAAoC;AACpC,mCAAgC;AAEhC,aAAa;AACb,MAAa,OAAQ,SAAQ,sBAAW;IAEtC,MAAM,CAAC,IAAI,GAAG,eAAM,CAAC;IAErB,MAAM,KAAK,OAAO;QAChB,OAAO;YACL,MAAM,CAAe,IAAY,EAAE,OAAwB;gBACzD,OAAO,iBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACvC,CAAC;YACD,MAAM,CAAC,IAAY,EAAE,UAAU,GAAG,KAAK;gBACrC,OAAO,iBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;YACzC,CAAC;SACF,CAAA;IACH,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,GAAW;QAC9B,IAAI,KAAK,GAAG,6EAA6E,CAAC;QAC1F,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;;AAlBH,0BAsBC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"index._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,cAAc;AACd,8CAA8C;AAC9C,2BAA2B;AAC3B,uDAAuD;AACvD,2CAA2C"}
1
+ {"version":3,"file":"index._auto-generated_.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/ng2-rest/src/lib/index._auto-generated_.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,8CAA8C;AAC9C,2BAA2B;AAC3B,uDAAuD;AACvD,2CAA2C"}
package/lib/index.js CHANGED
@@ -1,15 +1,28 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.interpolateParamsToUrl = exports.SimpleResource = void 0;
4
- var tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./resource-service"), exports);
6
- tslib_1.__exportStar(require("./models"), exports);
7
- tslib_1.__exportStar(require("./mapping"), exports);
8
- tslib_1.__exportStar(require("./rest.class"), exports);
9
- tslib_1.__exportStar(require("./rest-headers"), exports);
10
- tslib_1.__exportStar(require("./helpers"), exports);
11
- tslib_1.__exportStar(require("./request-cache"), exports);
12
- tslib_1.__exportStar(require("./content-type"), exports);
18
+ __exportStar(require("./resource-service"), exports);
19
+ __exportStar(require("./models"), exports);
20
+ __exportStar(require("./mapping"), exports);
21
+ __exportStar(require("./rest.class"), exports);
22
+ __exportStar(require("./rest-headers"), exports);
23
+ __exportStar(require("./helpers"), exports);
24
+ __exportStar(require("./request-cache"), exports);
25
+ __exportStar(require("./content-type"), exports);
13
26
  var simple_resource_1 = require("./other/simple-resource");
14
27
  Object.defineProperty(exports, "SimpleResource", { enumerable: true, get: function () { return simple_resource_1.SimpleResource; } });
15
28
  var params_1 = require("./params");
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;;AAAA,6DAAmC;AACnC,mDAAyB;AACzB,oDAA0B;AAC1B,uDAA6B;AAC7B,yDAA+B;AAC/B,oDAA0B;AAC1B,0DAAgC;AAChC,yDAA+B;AAC/B,2DAAyD;AAAhD,iHAAA,cAAc,OAAA;AACvB,mCAAkD;AAAzC,gHAAA,sBAAsB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/ng2-rest/src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,2CAAyB;AACzB,4CAA0B;AAC1B,+CAA6B;AAC7B,iDAA+B;AAC/B,4CAA0B;AAC1B,kDAAgC;AAChC,iDAA+B;AAC/B,2DAAyD;AAAhD,iHAAA,cAAc,OAAA;AACvB,mCAAkD;AAAzC,gHAAA,sBAAsB,OAAA"}