@quenk/frontend 0.20.3 → 0.21.0

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.
@@ -0,0 +1,23 @@
1
+ import { Object } from '@quenk/noni/lib/data/jsonx';
2
+ import { Response } from '@quenk/jhr/lib/response';
3
+ export declare const ERR_REQUEST_FAILED = "ERR_REQUEST_FAILED";
4
+ /**
5
+ * HttpCallback is a set of optional callbacks that can be used to
6
+ * hook into and handle undesired responses.
7
+ */
8
+ export interface HttpCallback {
9
+ onNotFound(res: Response<Object>): void;
10
+ onConflict(res: Response<Object>): void;
11
+ onBadRequest(res: Response<Object>): void;
12
+ onUnauthorized(res: Response<Object>): void;
13
+ onForbidden(res: Response<Object>): void;
14
+ onError(err: Error): void;
15
+ }
16
+ export declare class DefaultHttpCallback {
17
+ onNotFound(_: Response<Object>): void;
18
+ onConflict(_: Response<Object>): void;
19
+ onBadRequest(_: Response<Object>): void;
20
+ onUnauthorized(_: Response<Object>): void;
21
+ onForbidden(_: Response<Object>): void;
22
+ onError(_: Error): void;
23
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultHttpCallback = exports.ERR_REQUEST_FAILED = void 0;
4
+ exports.ERR_REQUEST_FAILED = 'ERR_REQUEST_FAILED';
5
+ class DefaultHttpCallback {
6
+ onNotFound(_) { }
7
+ onConflict(_) { }
8
+ onBadRequest(_) { }
9
+ onUnauthorized(_) { }
10
+ onForbidden(_) { }
11
+ onError(_) { }
12
+ }
13
+ exports.DefaultHttpCallback = DefaultHttpCallback;
14
+ //# sourceMappingURL=callback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callback.js","sourceRoot":"","sources":["../../../../src/app/model/http/callback.ts"],"names":[],"mappings":";;;AAIa,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAoBvD,MAAa,mBAAmB;IAC5B,UAAU,CAAC,CAAmB,IAAG,CAAC;IAElC,UAAU,CAAC,CAAmB,IAAG,CAAC;IAElC,YAAY,CAAC,CAAmB,IAAG,CAAC;IAEpC,cAAc,CAAC,CAAmB,IAAG,CAAC;IAEtC,WAAW,CAAC,CAAmB,IAAG,CAAC;IAEnC,OAAO,CAAC,CAAQ,IAAG,CAAC;CACvB;AAZD,kDAYC"}
@@ -2,12 +2,14 @@ import { Maybe } from '@quenk/noni/lib/data/maybe';
2
2
  import { Object } from '@quenk/noni/lib/data/jsonx';
3
3
  import { Record } from '@quenk/noni/lib/data/record';
4
4
  import { Type } from '@quenk/noni/lib/data/type';
5
- import { Except } from '@quenk/noni/lib/control/except';
5
+ import { Path } from '@quenk/noni/lib/io/file';
6
6
  import { Agent } from '@quenk/jhr/lib/agent';
7
7
  import { Response } from '@quenk/jhr/lib/response';
8
8
  import { Request } from '@quenk/jhr/lib/request';
9
- import { Id, Model } from './';
9
+ import { HttpCallback } from './callback';
10
+ import { Id, Model } from '../';
10
11
  export { Id, Model };
12
+ export declare const ERR_REQUEST_ABORTED = "ERR_REQUEST_ABORTED";
11
13
  export declare const ERR_REQUEST_FAILED = "ERR_REQUEST_FAILED";
12
14
  /**
13
15
  * Result is the structure of the response body expected after a successful
@@ -84,8 +86,8 @@ export declare const NO_PATH = "?invalid?";
84
86
  * the "search" path for "create" etc.
85
87
  */
86
88
  export declare class RequestFactory {
87
- paths: Paths;
88
- constructor(paths?: Paths);
89
+ path: Path;
90
+ constructor(path: Path);
89
91
  /**
90
92
  * create generates a request for the model "create" method.
91
93
  */
@@ -107,24 +109,6 @@ export declare class RequestFactory {
107
109
  */
108
110
  remove(id: Id): Request<Object>;
109
111
  }
110
- /**
111
- * HttpCallback is a set of optional callbacks that can be used to
112
- * hook into and handle undesired responses.
113
- */
114
- export interface HttpCallback {
115
- onConflict(res: Response<Object>): void;
116
- onBadRequest(res: Response<Object>): void;
117
- onUnauthorized(res: Response<Object>): void;
118
- onForbidden(res: Response<Object>): void;
119
- onError(res: Response<Object>): void;
120
- }
121
- export declare class DefaultHttpCallback {
122
- onConflict(_: Response<Object>): void;
123
- onBadRequest(_: Response<Object>): void;
124
- onUnauthorized(_: Response<Object>): void;
125
- onForbidden(_: Response<Object>): void;
126
- onError(_: Response<Object>): void;
127
- }
128
112
  /**
129
113
  * HttpModel is an abstract implementation of a Model class that uses http
130
114
  * for CSUGR operations.
@@ -133,22 +117,23 @@ export declare class DefaultHttpCallback {
133
117
  * to utilize a Remote actor, see the RemoteModel implementation elsewhere.
134
118
  */
135
119
  export declare abstract class HttpModel<T extends Object> implements Model<T> {
120
+ path: Path;
136
121
  callback: HttpCallback;
137
- constructor(callback?: HttpCallback);
122
+ constructor(path: Path, callback?: HttpCallback);
138
123
  /**
139
124
  * requests factory used to create Request objects.
140
125
  */
141
- abstract requests: RequestFactory;
126
+ requests: RequestFactory;
142
127
  /**
143
128
  * send is left abstract for child classes to implement.
144
129
  */
145
- abstract send(req: Request<Object>): Promise<Response<Result<T>>>;
146
- handleResponse<A>(res: Response<Type>): Except<A>;
147
- create(data: T): Promise<Except<Id>>;
148
- search(qry: Object): Promise<Except<T[]>>;
149
- update(id: Id, changes: Partial<T>): Promise<Except<boolean>>;
150
- get(id: Id): Promise<Except<Maybe<T>>>;
151
- remove(id: Id): Promise<Except<boolean>>;
130
+ abstract send(req: Request<Object>): Promise<Response<Object>>;
131
+ handleResponse(res: Response<Type>): void;
132
+ create(data: T): Promise<Id>;
133
+ search(qry: Object): Promise<T[]>;
134
+ update(id: Id, changes: Partial<T>): Promise<boolean>;
135
+ get(id: Id): Promise<Maybe<T>>;
136
+ remove(id: Id): Promise<boolean>;
152
137
  }
153
138
  /**
154
139
  * SimpleHttpModel is an HttpModel that uses the JHR lib directly.
@@ -159,13 +144,9 @@ export declare abstract class HttpModel<T extends Object> implements Model<T> {
159
144
  * need something more complicated.
160
145
  */
161
146
  export declare class SimpleHttpModel<T extends Object> extends HttpModel<T> {
147
+ path: Path;
162
148
  agent: Agent<Object, Object>;
163
- requests: RequestFactory;
164
149
  callbacks?: HttpCallback | undefined;
165
- constructor(agent: Agent<Object, Object>, requests: RequestFactory, callbacks?: HttpCallback | undefined);
166
- /**
167
- * fromPaths generates a new HttpModel using Paths object.
168
- */
169
- static fromPaths(agent: Agent<Object, Object>, paths: Paths): SimpleHttpModel<Object>;
170
- send(req: Request<Object>): Promise<Response<Result<T>>>;
150
+ constructor(path: Path, agent: Agent<Object, Object>, callbacks?: HttpCallback | undefined);
151
+ send(req: Request<Object>): Promise<Response<Object>>;
171
152
  }
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimpleHttpModel = exports.HttpModel = exports.DefaultHttpCallback = exports.RequestFactory = exports.NO_PATH = exports.ERR_REQUEST_FAILED = void 0;
3
+ exports.SimpleHttpModel = exports.HttpModel = exports.RequestFactory = exports.NO_PATH = exports.ERR_REQUEST_FAILED = exports.ERR_REQUEST_ABORTED = void 0;
4
4
  const status = require("@quenk/jhr/lib/status");
5
5
  const maybe_1 = require("@quenk/noni/lib/data/maybe");
6
- const string_1 = require("@quenk/noni/lib/data/string");
7
6
  const record_1 = require("@quenk/noni/lib/data/record");
8
7
  const type_1 = require("@quenk/noni/lib/data/type");
9
- const either_1 = require("@quenk/noni/lib/data/either");
10
8
  const request_1 = require("@quenk/jhr/lib/request");
9
+ const callback_1 = require("./callback");
10
+ exports.ERR_REQUEST_ABORTED = 'ERR_REQUEST_ABORTED';
11
11
  exports.ERR_REQUEST_FAILED = 'ERR_REQUEST_FAILED';
12
12
  exports.NO_PATH = '?invalid?';
13
13
  /**
@@ -19,16 +19,16 @@ exports.NO_PATH = '?invalid?';
19
19
  * the "search" path for "create" etc.
20
20
  */
21
21
  class RequestFactory {
22
- constructor(paths = {}) {
23
- this.paths = paths;
22
+ constructor(path) {
23
+ this.path = path;
24
24
  }
25
25
  /**
26
26
  * create generates a request for the model "create" method.
27
27
  */
28
28
  create(data) {
29
- return new request_1.Post(this.paths.create || this.paths.search || exports.NO_PATH, data, {
29
+ return new request_1.Post(this.path, data, {
30
30
  tags: {
31
- path: this.paths.create || this.paths.get || exports.NO_PATH,
31
+ path: this.path,
32
32
  verb: 'post',
33
33
  method: 'create'
34
34
  }
@@ -38,9 +38,9 @@ class RequestFactory {
38
38
  * search generates a request for the model "search" method.
39
39
  */
40
40
  search(qry) {
41
- return new request_1.Get(this.paths.search || exports.NO_PATH, qry, {
41
+ return new request_1.Get(this.path, qry, {
42
42
  tags: (0, record_1.merge)((0, type_1.isObject)(qry.$tags) ? qry.$tags : {}, {
43
- path: this.paths.search,
43
+ path: this.path,
44
44
  verb: 'get',
45
45
  method: 'search'
46
46
  })
@@ -50,9 +50,9 @@ class RequestFactory {
50
50
  * update generates a request for the model "update" method.
51
51
  */
52
52
  update(id, changes) {
53
- return new request_1.Patch((0, string_1.interpolate)(this.paths.update || this.paths.get || exports.NO_PATH, { id }), changes, {
53
+ return new request_1.Patch(`${this.path}/${id}`, changes, {
54
54
  tags: {
55
- path: this.paths.update,
55
+ path: `${this.path}/id`,
56
56
  verb: 'patch',
57
57
  method: 'update'
58
58
  }
@@ -62,9 +62,9 @@ class RequestFactory {
62
62
  * get generates a request for the model "get" method.
63
63
  */
64
64
  get(id) {
65
- return new request_1.Get((0, string_1.interpolate)(this.paths.get || exports.NO_PATH, { id }), {}, {
65
+ return new request_1.Get(`${this.path}/${id}`, {}, {
66
66
  tags: {
67
- path: this.paths.get,
67
+ path: `${this.path}/id`,
68
68
  verb: 'get',
69
69
  method: 'get'
70
70
  }
@@ -74,9 +74,9 @@ class RequestFactory {
74
74
  * remove generates a request for the model "remove" method.
75
75
  */
76
76
  remove(id) {
77
- return new request_1.Delete((0, string_1.interpolate)(this.paths.remove || this.paths.get || exports.NO_PATH, { id }), {}, {
77
+ return new request_1.Delete(`${this.path}/${id}`, {}, {
78
78
  tags: {
79
- path: this.paths.remove,
79
+ path: `${this.path}/id`,
80
80
  verb: 'delete',
81
81
  method: 'remove'
82
82
  }
@@ -84,14 +84,6 @@ class RequestFactory {
84
84
  }
85
85
  }
86
86
  exports.RequestFactory = RequestFactory;
87
- class DefaultHttpCallback {
88
- onConflict(_) { }
89
- onBadRequest(_) { }
90
- onUnauthorized(_) { }
91
- onForbidden(_) { }
92
- onError(_) { }
93
- }
94
- exports.DefaultHttpCallback = DefaultHttpCallback;
95
87
  /**
96
88
  * HttpModel is an abstract implementation of a Model class that uses http
97
89
  * for CSUGR operations.
@@ -100,8 +92,13 @@ exports.DefaultHttpCallback = DefaultHttpCallback;
100
92
  * to utilize a Remote actor, see the RemoteModel implementation elsewhere.
101
93
  */
102
94
  class HttpModel {
103
- constructor(callback = new DefaultHttpCallback()) {
95
+ constructor(path, callback = new callback_1.DefaultHttpCallback()) {
96
+ this.path = path;
104
97
  this.callback = callback;
98
+ /**
99
+ * requests factory used to create Request objects.
100
+ */
101
+ this.requests = new RequestFactory(this.path);
105
102
  }
106
103
  handleResponse(res) {
107
104
  switch (res.code) {
@@ -117,46 +114,49 @@ class HttpModel {
117
114
  case status.CONFLICT:
118
115
  this.callback.onConflict(res);
119
116
  break;
117
+ case status.NOT_FOUND:
118
+ this.callback.onNotFound(res);
119
+ break;
120
120
  default:
121
- this.callback.onError(res);
121
+ this.callback.onError(new Error(`Invalid Status: ${res.code}`));
122
122
  }
123
- return either_1.Either.left(new Error(exports.ERR_REQUEST_FAILED));
123
+ throw new Error(exports.ERR_REQUEST_FAILED);
124
124
  }
125
125
  async create(data) {
126
126
  let res = await this.send(this.requests.create(data));
127
- return res.code !== status.CREATED
128
- ? this.handleResponse(res)
129
- : either_1.Either.right(res.body.data.id);
127
+ if (res.code !== status.CREATED)
128
+ this.handleResponse(res);
129
+ return res.body.data.id;
130
130
  }
131
131
  async search(qry) {
132
132
  let res = await this.send(this.requests.search(qry));
133
133
  if (res.code !== status.OK && res.code !== status.NO_CONTENT)
134
- return this.handleResponse(res);
135
- return either_1.Either.right(res.code === status.NO_CONTENT
134
+ this.handleResponse(res);
135
+ return res.code === status.NO_CONTENT
136
136
  ? []
137
- : res.body.data);
137
+ : res.body.data;
138
138
  }
139
139
  async update(id, changes) {
140
140
  let res = await this.send(this.requests.update(id, changes));
141
141
  if (res.code === status.NOT_FOUND)
142
- return either_1.Either.right(false);
142
+ false;
143
143
  if (res.code !== status.OK)
144
- return this.handleResponse(res);
145
- return either_1.Either.right(true);
144
+ this.handleResponse(res);
145
+ return true;
146
146
  }
147
147
  async get(id) {
148
148
  let res = await this.send(this.requests.get(id));
149
149
  if (res.code === status.NOT_FOUND)
150
- return either_1.Either.right((0, maybe_1.nothing)());
150
+ return (0, maybe_1.nothing)();
151
151
  if (res.code !== status.OK)
152
- return this.handleResponse(res);
153
- return either_1.Either.right((0, maybe_1.fromNullable)(res.body));
152
+ this.handleResponse(res);
153
+ return (0, maybe_1.fromNullable)(res.body);
154
154
  }
155
155
  async remove(id) {
156
156
  let res = await this.send(this.requests.remove(id));
157
157
  if (res.code !== status.OK)
158
- return this.handleResponse(res);
159
- return either_1.Either.right(true);
158
+ this.handleResponse(res);
159
+ return true;
160
160
  }
161
161
  }
162
162
  exports.HttpModel = HttpModel;
@@ -169,21 +169,15 @@ exports.HttpModel = HttpModel;
169
169
  * need something more complicated.
170
170
  */
171
171
  class SimpleHttpModel extends HttpModel {
172
- constructor(agent, requests, callbacks) {
173
- super(callbacks);
172
+ constructor(path, agent, callbacks) {
173
+ super(path, callbacks);
174
+ this.path = path;
174
175
  this.agent = agent;
175
- this.requests = requests;
176
176
  this.callbacks = callbacks;
177
177
  }
178
- /**
179
- * fromPaths generates a new HttpModel using Paths object.
180
- */
181
- static fromPaths(agent, paths) {
182
- return new SimpleHttpModel(agent, new RequestFactory(paths));
183
- }
184
- send(req) {
178
+ async send(req) {
185
179
  return this.agent.send(req);
186
180
  }
187
181
  }
188
182
  exports.SimpleHttpModel = SimpleHttpModel;
189
- //# sourceMappingURL=http.js.map
183
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sour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SAAI,GAAJ,IAAI,CAAM;QACV,UAAK,GAAL,KAAK,CAAuB;QAC5B,cAAS,GAAT,SAAS,CAAe;IAGnC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,GAAoB;QAC3B,OAAkC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAE,CAAC;IAC5D,CAAC;CACJ;AAZD,0CAYC"}
@@ -0,0 +1,30 @@
1
+ import { Request } from '@quenk/jhr/lib/request';
2
+ import { Response } from '@quenk/jhr/lib/response';
3
+ import { Path } from '@quenk/noni/lib/io/file';
4
+ import { Object } from '@quenk/noni/lib/data/jsonx';
5
+ import { Address } from '@quenk/potoo/lib/actor/address';
6
+ import { Parent } from '@quenk/potoo/lib/actor/api';
7
+ import { HttpCallback } from './callback';
8
+ import { HttpModel } from '.';
9
+ export declare const ERR_REQUEST_ABORTED = "ERR_REQUEST_ABORTED";
10
+ /**
11
+ * RemoteModel is an HttpModel implementation that relies on the remote actor
12
+ * API.
13
+ *
14
+ * Use this class when requests become complicated requiring UI widgets to be
15
+ * updated, authentication errors to be intercepted etc. at scale.
16
+ */
17
+ export declare class RemoteModel<T extends Object> extends HttpModel<T> {
18
+ parent: Parent;
19
+ server: Address;
20
+ path: Path;
21
+ callback: HttpCallback;
22
+ constructor(parent: Parent, server: Address, path: Path, callback?: HttpCallback);
23
+ /**
24
+ * send a request to the remote back-end.
25
+ *
26
+ * Use this method to submit the request to the remote actor using
27
+ * the optional installed handler(s) to handle the request before completion.
28
+ */
29
+ send(req: Request<Object>): Promise<Response<Object>>;
30
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RemoteModel = exports.ERR_REQUEST_ABORTED = void 0;
4
+ const future_1 = require("@quenk/noni/lib/control/monad/future");
5
+ const framework_1 = require("@quenk/potoo/lib/actor/framework");
6
+ const callback_1 = require("./callback");
7
+ const remote_1 = require("../../remote");
8
+ const _1 = require(".");
9
+ exports.ERR_REQUEST_ABORTED = 'ERR_REQUEST_ABORTED';
10
+ /**
11
+ * RemoteModel is an HttpModel implementation that relies on the remote actor
12
+ * API.
13
+ *
14
+ * Use this class when requests become complicated requiring UI widgets to be
15
+ * updated, authentication errors to be intercepted etc. at scale.
16
+ */
17
+ class RemoteModel extends _1.HttpModel {
18
+ constructor(parent, server, path, callback = new callback_1.DefaultHttpCallback()) {
19
+ super(path);
20
+ this.parent = parent;
21
+ this.server = server;
22
+ this.path = path;
23
+ this.callback = callback;
24
+ }
25
+ /**
26
+ * send a request to the remote back-end.
27
+ *
28
+ * Use this method to submit the request to the remote actor using
29
+ * the optional installed handler(s) to handle the request before completion.
30
+ */
31
+ send(req) {
32
+ return future_1.Future.fromCallback(cb => {
33
+ this.parent.spawn(async (ref) => {
34
+ await ref.tell(this.server, new remote_1.Send(ref.self, req));
35
+ while (ref.isValid()) {
36
+ await ref.receive([
37
+ new framework_1.TypeCase(remote_1.SendOk, ({ response }) => cb(null, response)),
38
+ new framework_1.TypeCase(remote_1.SendFailed, ({ error }) => cb(error))
39
+ ]);
40
+ }
41
+ return ref.raise(new Error(exports.ERR_REQUEST_ABORTED));
42
+ });
43
+ });
44
+ }
45
+ }
46
+ exports.RemoteModel = RemoteModel;
47
+ //# sourceMappingURL=remote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../../src/app/model/http/remote.ts"],"names":[],"mappings":";;;AAGA,iEAA8D;AAK9D,gEAA4D;AAG5D,yCAA+D;AAC/D,yCAAwD;AACxD,wBAA8B;AAEjB,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAa,WAA8B,SAAQ,YAAY;IAC3D,YACW,MAAc,EACd,MAAe,EACf,IAAU,EACV,WAAyB,IAAI,8BAAmB,EAAE;QAEzD,KAAK,CAAC,IAAI,CAAC,CAAC;QALL,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAS;QACf,SAAI,GAAJ,IAAI,CAAM;QACV,aAAQ,GAAR,QAAQ,CAA0C;IAG7D,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,GAAoB;QACrB,OAAO,eAAM,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE;YAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAC,GAAG,EAAC,EAAE;gBAC1B,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,aAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;gBAErD,OAAO,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;oBACnB,MAAM,GAAG,CAAC,OAAO,CAAC;wBACd,IAAI,oBAAQ,CAAC,eAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAClC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CACrB;wBACD,IAAI,oBAAQ,CAAC,mBAAU,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;qBACrD,CAAC,CAAC;gBACP,CAAC;gBAED,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,2BAAmB,CAAC,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAlCD,kCAkCC"}
@@ -1,4 +1,3 @@
1
- import { Except } from '@quenk/noni/lib/control/except';
2
1
  import { Object } from '@quenk/noni/lib/data/jsonx';
3
2
  import { Maybe } from '@quenk/noni/lib/data/maybe';
4
3
  /**
@@ -16,21 +15,21 @@ export interface Model<T extends Object> {
16
15
  /**
17
16
  * create a new entry for the data type.
18
17
  */
19
- create(data: T): Promise<Except<Id>>;
18
+ create(data: T): Promise<Id>;
20
19
  /**
21
20
  * search for entries that match the specified query criteria.
22
21
  */
23
- search(qry: Object): Promise<Except<T[]>>;
22
+ search(qry: Object): Promise<T[]>;
24
23
  /**
25
24
  * update a single entry with the data provided.
26
25
  */
27
- update(id: Id, changes: Partial<T>): Promise<Except<boolean>>;
26
+ update(id: Id, changes: Partial<T>): Promise<boolean>;
28
27
  /**
29
28
  * get a single entry using its id.
30
29
  */
31
- get(id: Id): Promise<Except<Maybe<T>>>;
30
+ get(id: Id): Promise<Maybe<T>>;
32
31
  /**
33
32
  * remove a single entry using its id
34
33
  */
35
- remove(id: Id): Promise<Except<boolean>>;
34
+ remove(id: Id): Promise<boolean>;
36
35
  }
@@ -0,0 +1,56 @@
1
+ import { TypeCase } from '@quenk/noni/lib/control/match/case';
2
+ import { Object } from '@quenk/noni/lib/data/jsonx';
3
+ import { HTTPAgent } from '@quenk/jhr/lib/agent';
4
+ import { Request as HTTPRequest } from '@quenk/jhr/lib/request';
5
+ import { Response } from '@quenk/jhr/lib/response';
6
+ import { Address } from '@quenk/potoo/lib/actor/address';
7
+ import { Immutable } from '@quenk/potoo/lib/actor/framework/resident';
8
+ import { Runtime } from '@quenk/potoo/lib/actor/system/vm/runtime';
9
+ import { HttpCallback } from './model/http/callback';
10
+ /**
11
+ * Send a single request to the remote host, forwarding the response to the
12
+ * specified address.
13
+ */
14
+ export declare class Send {
15
+ client: Address;
16
+ request: HTTPRequest<Object>;
17
+ constructor(client: Address, request: HTTPRequest<Object>);
18
+ }
19
+ export type SendResult = SendFailed | SendOk;
20
+ /**
21
+ * SendOk is used when the request has been sent to the server successfully.
22
+ */
23
+ export declare class SendOk {
24
+ response: Response<Object>;
25
+ constructor(response: Response<Object>);
26
+ }
27
+ /**
28
+ * SendFailed is used when sending the request fails to reach the server for
29
+ * some reason (offline etc).
30
+ */
31
+ export declare class SendFailed {
32
+ error: Error;
33
+ constructor(error: Error);
34
+ }
35
+ /**
36
+ * Remote represents an HTTP server the app has access to.
37
+ *
38
+ * This actor is an abstraction over the `@quenk/jhr` so that requests
39
+ * can be sent via message passing. However, this abstraction is more
40
+ * concerned with application level logic than the details of the HTTP
41
+ * protocols.
42
+ */
43
+ export declare class Remote extends Immutable {
44
+ runtime: Runtime;
45
+ agent: HTTPAgent<Object, Object>;
46
+ callback: HttpCallback;
47
+ constructor(runtime: Runtime, agent: HTTPAgent<Object, Object>, callback?: HttpCallback);
48
+ onSend: ({ client, request }: Send) => Promise<void>;
49
+ /**
50
+ * handleResponse allows for the Remote's global hooks to be invoked.
51
+ *
52
+ * These are meant to handle client errors not the main flow of requests.
53
+ */
54
+ handleResponse(res: Response<Object>): Promise<void>;
55
+ selectors(): TypeCase<typeof Send, Promise<void>>[];
56
+ }
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Remote = exports.SendFailed = exports.SendOk = exports.Send = void 0;
4
+ const status = require("@quenk/jhr/lib/status");
5
+ const case_1 = require("@quenk/noni/lib/control/match/case");
6
+ const resident_1 = require("@quenk/potoo/lib/actor/framework/resident");
7
+ const callback_1 = require("./model/http/callback");
8
+ /**
9
+ * Send a single request to the remote host, forwarding the response to the
10
+ * specified address.
11
+ */
12
+ class Send {
13
+ constructor(client, request) {
14
+ this.client = client;
15
+ this.request = request;
16
+ }
17
+ }
18
+ exports.Send = Send;
19
+ /**
20
+ * SendOk is used when the request has been sent to the server successfully.
21
+ */
22
+ class SendOk {
23
+ constructor(response) {
24
+ this.response = response;
25
+ }
26
+ }
27
+ exports.SendOk = SendOk;
28
+ /**
29
+ * SendFailed is used when sending the request fails to reach the server for
30
+ * some reason (offline etc).
31
+ */
32
+ class SendFailed {
33
+ constructor(error) {
34
+ this.error = error;
35
+ }
36
+ }
37
+ exports.SendFailed = SendFailed;
38
+ /**
39
+ * Remote represents an HTTP server the app has access to.
40
+ *
41
+ * This actor is an abstraction over the `@quenk/jhr` so that requests
42
+ * can be sent via message passing. However, this abstraction is more
43
+ * concerned with application level logic than the details of the HTTP
44
+ * protocols.
45
+ */
46
+ class Remote extends resident_1.Immutable {
47
+ constructor(runtime, agent, callback = new callback_1.DefaultHttpCallback()) {
48
+ super(runtime);
49
+ this.runtime = runtime;
50
+ this.agent = agent;
51
+ this.callback = callback;
52
+ this.onSend = async ({ client, request }) => {
53
+ let res;
54
+ try {
55
+ res = await this.agent.send(request);
56
+ }
57
+ catch (e) {
58
+ await this.callback.onError(e);
59
+ await this.tell(client, new SendFailed(e));
60
+ return;
61
+ }
62
+ this.handleResponse(res);
63
+ await this.tell(client, new SendOk(res));
64
+ };
65
+ }
66
+ /**
67
+ * handleResponse allows for the Remote's global hooks to be invoked.
68
+ *
69
+ * These are meant to handle client errors not the main flow of requests.
70
+ */
71
+ async handleResponse(res) {
72
+ switch (res.code) {
73
+ case status.BAD_REQUEST:
74
+ await this.callback.onBadRequest(res);
75
+ break;
76
+ case status.UNAUTHORIZED:
77
+ await this.callback.onUnauthorized(res);
78
+ break;
79
+ case status.FORBIDDEN:
80
+ await this.callback.onForbidden(res);
81
+ break;
82
+ case status.CONFLICT:
83
+ await this.callback.onConflict(res);
84
+ break;
85
+ case status.NOT_FOUND:
86
+ await this.callback.onNotFound(res);
87
+ break;
88
+ default:
89
+ break;
90
+ }
91
+ }
92
+ selectors() {
93
+ return [new case_1.TypeCase(Send, this.onSend)];
94
+ }
95
+ }
96
+ exports.Remote = Remote;
97
+ //# sourceMappingURL=remote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/app/remote.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAEhD,6DAA8D;AAQ9D,wEAAsE;AAGtE,oDAA0E;AAE1E;;;GAGG;AACH,MAAa,IAAI;IACb,YACW,MAAe,EACf,OAA4B;QAD5B,WAAM,GAAN,MAAM,CAAS;QACf,YAAO,GAAP,OAAO,CAAqB;IACpC,CAAC;CACP;AALD,oBAKC;AAID;;GAEG;AACH,MAAa,MAAM;IACf,YAAmB,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;IAAG,CAAC;CACpD;AAFD,wBAEC;AAED;;;GAGG;AACH,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,CAAC;gBACxC,MAAM;YACV,KAAK,MAAM,CAAC,SAAS;gBACjB,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;gBACrC,MAAM;YACV,KAAK,MAAM,CAAC,QAAQ;gBAChB,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBACpC,MAAM;YACV,KAAK,MAAM,CAAC,SAAS;gBACjB,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBACpC,MAAM;YAEV;gBACI,MAAM;QACd,CAAC;IACL,CAAC;IAED,SAAS;QACL,OAAO,CAAC,IAAI,eAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,CAAC;CACJ;AAzDD,wBAyDC"}
@@ -1,7 +1,6 @@
1
1
  import { Object, Value } from '@quenk/noni/lib/data/jsonx';
2
2
  import { Any } from '@quenk/noni/lib/data/type';
3
3
  import { TypeCase } from '@quenk/noni/lib/control/match/case';
4
- import { Except } from '@quenk/noni/lib/control/except';
5
4
  import { Address } from '@quenk/potoo/lib/actor/address';
6
5
  import { Runtime } from '@quenk/potoo/lib/actor/system/vm/runtime';
7
6
  import { AppScene } from '../';
@@ -169,7 +168,7 @@ export declare abstract class AppFormScene<T extends Object> extends AppScene im
169
168
  /**
170
169
  * doSave executes the form saving logic.
171
170
  */
172
- doSave(): Promise<Except<FormSaveResult>>;
171
+ doSave(): Promise<FormSaveResult>;
173
172
  /**
174
173
  * save executes the form saving operation and takes care of invoking the
175
174
  * callback.
@@ -5,7 +5,6 @@ const record_1 = require("@quenk/noni/lib/data/record");
5
5
  const array_1 = require("@quenk/noni/lib/data/array");
6
6
  const type_1 = require("@quenk/noni/lib/data/type");
7
7
  const case_1 = require("@quenk/noni/lib/control/match/case");
8
- const either_1 = require("@quenk/noni/lib/data/either");
9
8
  const __1 = require("../");
10
9
  /**
11
10
  * Abort causes a FormScene to cease operations and return control to the
@@ -116,7 +115,7 @@ class AppFormScene extends __1.AppScene {
116
115
  * doSave executes the form saving logic.
117
116
  */
118
117
  async doSave() {
119
- return either_1.Either.right('');
118
+ return '';
120
119
  }
121
120
  /**
122
121
  * save executes the form saving operation and takes care of invoking the
@@ -129,13 +128,9 @@ class AppFormScene extends __1.AppScene {
129
128
  */
130
129
  async save() {
131
130
  this.errors = {};
132
- let eresult = await this.doSave();
133
- if (eresult.isRight()) {
134
- // Leave it to the child class to handle error cases.
135
- let result = eresult.takeRight();
136
- await this.tell(this.owner, new FormState(this.self, true, this.getValues(), result));
137
- await this.exit();
138
- }
131
+ let result = await this.doSave();
132
+ await this.tell(this.owner, new FormState(this.self, true, this.getValues(), result));
133
+ await this.exit();
139
134
  }
140
135
  }
141
136
  exports.AppFormScene = AppFormScene;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app/scene/form/index.ts"],"names":[],"mappings":";;;AAAA,wDAAmE;AACnE,sDAAsD;AAEtD,oDAAgD;AAChD,6DAA8D;AAG9D,wDAAqD;AAKrD,2BAA+B;AAuD/B;;;GAGG;AACH,MAAa,KAAK;CAAG;AAArB,sBAAqB;AAErB;;GAEG;AACH,MAAa,IAAI;CAAG;AAApB,oBAAoB;AAEpB;;;;;GAKG;AACH,MAAa,SAAS;IAClB;;;;;;OAMG;IACH,YACW,IAAa,EACb,EAAW,EACX,OAAe,EAAE,EACjB,MAAoB;QAHpB,SAAI,GAAJ,IAAI,CAAS;QACb,OAAE,GAAF,EAAE,CAAS;QACX,SAAI,GAAJ,IAAI,CAAa;QACjB,WAAM,GAAN,MAAM,CAAc;IAC5B,CAAC;CACP;AAdD,8BAcC;AAgDD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAsB,YAClB,SAAQ,YAAQ;IAGhB,YACW,OAAgB,EAChB,KAAc,EACd,OAAgB,EAChB,QAAoB,EAAE;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QALR,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2
  import { Object } from '@quenk/noni/lib/data/jsonx';
3
- import { Except } from '@quenk/noni/lib/control/except';
4
3
  import { Address } from '@quenk/potoo/lib/actor/address';
5
4
  import { Runtime } from '@quenk/potoo/lib/actor/system/vm/runtime';
6
5
  import { Event } from '@quenk/wml-widgets/lib/control';
@@ -40,5 +39,5 @@ export declare abstract class ModelFormScene<T extends Object> extends AppFormSc
40
39
  * doSave either a create or update depending on the specified write
41
40
  * mode.
42
41
  */
43
- doSave(): Promise<Except<Value>>;
42
+ doSave(): Promise<Value>;
44
43
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModelFormScene = exports.WRITE_MODE_UPDATE = exports.WRITE_MODE_CREATE = void 0;
4
- const either_1 = require("@quenk/noni/lib/data/either");
5
4
  const _1 = require(".");
6
5
  exports.WRITE_MODE_CREATE = 'create';
7
6
  exports.WRITE_MODE_UPDATE = 'update';
@@ -37,7 +36,7 @@ class ModelFormScene extends _1.AppFormScene {
37
36
  }
38
37
  else {
39
38
  await this.model.update(this.id, this.getModifiedValues());
40
- return either_1.Either.right(this.id);
39
+ return this.id;
41
40
  }
42
41
  }
43
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../src/app/scene/form/model.ts"],"names":[],"mappings":";;;AAGA,wDAAqD;AAQrD,wBAAiC;AAOpB,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAC7B,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE1C;;GAEG;AACH,MAAsB,cAAiC,SAAQ,eAAe;IAC1E,YACW,OAAgB,EAChB,KAAc,EACd,OAAgB,EAChB,QAAoB,EAAE,EACtB,OAAkB,cAAc,CAAC,iBAAiB;QAEzD,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAN/B,YAAO,GAAP,OAAO,CAAS;QAChB,UAAK,GAAL,KAAK,CAAS;QACd,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AC;QAN/B,YAAO,GAAP,OAAO,CAAS;QAChB,UAAK,GAAL,KAAK,CAAS;QACd,YAAO,GAAP,OAAO,CAAS;QAChB,UAAK,GAAL,KAAK,CAAiB;QACtB,SAAI,GAAJ,IAAI,CAA8C;QAqB7D;;WAEG;QACH,aAAQ,GAAG,KAAK,EAAE,CAAe,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IArB9D,CAAC;IAWD;;OAEG;IACH,IAAI,EAAE;QACF,OAAW,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IAC7B,CAAC;IAOD;;;OAGG;IACH,KAAK,CAAC,MAAM;QACR,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,iBAAiB,EAAE,CAAC;YACjD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACJ,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;YAC3D,OAAO,IAAI,CAAC,EAAE,CAAC;QACnB,CAAC;IACL,CAAC;;AA3CL,wCA4CC;AAjCU,gCAAiB,GAAG,yBAAiB,AAApB,CAAqB;AAEtC,gCAAiB,GAAG,yBAAiB,AAApB,CAAqB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenk/frontend",
3
- "version": "0.20.3",
3
+ "version": "0.21.0",
4
4
  "description": "Actor oriented client side toolkit for Quenk Technologies.",
5
5
  "author": [
6
6
  "Quenk Technologies Limited <info@quenk.com> (https://quenk.com)"
@@ -1 +0,0 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/app/model/http.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAEhD,sDAA0E;AAE1E,wDAA0D;AAC1D,wDAA4D;A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