@webqit/webflo 0.20.26 → 0.20.28
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.
- package/package.json +8 -5
- package/src/build-pi/index.js +6 -4
- package/src/init-pi/index.js +0 -1
- package/src/runtime-pi/{WebfloRuntime.js → AppRuntime.js} +57 -113
- package/src/runtime-pi/webflo-client/DeviceCapabilities.js +1 -1
- package/src/runtime-pi/webflo-client/WebfloClient.js +163 -103
- package/src/runtime-pi/webflo-client/{WebfloRootClient1.js → WebfloRootClientA.js} +39 -56
- package/src/runtime-pi/webflo-client/{WebfloRootClient2.js → WebfloRootClientB.js} +3 -3
- package/src/runtime-pi/webflo-client/WebfloSubClient.js +28 -15
- package/src/runtime-pi/webflo-client/index.js +3 -3
- package/src/runtime-pi/webflo-messaging/ClientPortMixin.js +13 -0
- package/src/runtime-pi/{webflo-server/messaging/ClientRequestRealtime.js → webflo-messaging/ClientRequestPort001.js} +13 -9
- package/src/runtime-pi/webflo-messaging/ClientRequestPort010.js +4 -0
- package/src/runtime-pi/webflo-messaging/ClientRequestPort100.js +17 -0
- package/src/runtime-pi/webflo-messaging/WebfloTenancy001.js +27 -0
- package/src/runtime-pi/webflo-messaging/WebfloTenant001.js +27 -0
- package/src/runtime-pi/webflo-routing/HttpCookies101.js +53 -0
- package/src/runtime-pi/webflo-routing/HttpCookies110.js +3 -0
- package/src/runtime-pi/webflo-routing/{HttpEvent.js → HttpEvent111.js} +95 -73
- package/src/runtime-pi/webflo-routing/HttpKeyvalInterface.js +120 -0
- package/src/runtime-pi/webflo-routing/HttpSession001.js +24 -0
- package/src/runtime-pi/webflo-routing/HttpSession110.js +3 -0
- package/src/runtime-pi/webflo-routing/{HttpThread.js → HttpThread111.js} +54 -13
- package/src/runtime-pi/webflo-routing/{HttpUser.js → HttpUser111.js} +10 -23
- package/src/runtime-pi/webflo-routing/KeyvalsFactory001.js +53 -0
- package/src/runtime-pi/webflo-routing/KeyvalsFactory110.js +48 -0
- package/src/runtime-pi/webflo-routing/KeyvalsFactoryInterface.js +56 -0
- package/src/runtime-pi/webflo-routing/{WebfloRouter.js → WebfloRouter111.js} +5 -6
- package/src/runtime-pi/webflo-server/WebfloServer.js +262 -269
- package/src/runtime-pi/webflo-worker/WebfloWorker.js +97 -44
- package/src/util.js +3 -2
- package/src/runtime-pi/apis.js +0 -9
- package/src/runtime-pi/webflo-client/ClientSideCookies.js +0 -18
- package/src/runtime-pi/webflo-fetch/LiveResponse.js +0 -476
- package/src/runtime-pi/webflo-fetch/index.js +0 -419
- package/src/runtime-pi/webflo-fetch/util.js +0 -28
- package/src/runtime-pi/webflo-messaging/WQBroadcastChannel.js +0 -10
- package/src/runtime-pi/webflo-messaging/WQMessageChannel.js +0 -26
- package/src/runtime-pi/webflo-messaging/WQMessageEvent.js +0 -87
- package/src/runtime-pi/webflo-messaging/WQMessagePort.js +0 -38
- package/src/runtime-pi/webflo-messaging/WQRelayPort.js +0 -47
- package/src/runtime-pi/webflo-messaging/WQSockPort.js +0 -111
- package/src/runtime-pi/webflo-messaging/WQStarPort.js +0 -112
- package/src/runtime-pi/webflo-messaging/wq-message-port.js +0 -413
- package/src/runtime-pi/webflo-routing/HttpCookies.js +0 -43
- package/src/runtime-pi/webflo-routing/HttpSession.js +0 -11
- package/src/runtime-pi/webflo-routing/HttpState.js +0 -182
- package/src/runtime-pi/webflo-server/ServerSideCookies.js +0 -22
- package/src/runtime-pi/webflo-server/ServerSideSession.js +0 -40
- package/src/runtime-pi/webflo-server/messaging/Client.js +0 -27
- package/src/runtime-pi/webflo-server/messaging/Clients.js +0 -25
- package/src/runtime-pi/webflo-url/Url.js +0 -156
- package/src/runtime-pi/webflo-url/index.js +0 -1
- package/src/runtime-pi/webflo-url/urlpattern.js +0 -38
- package/src/runtime-pi/webflo-url/util.js +0 -109
- package/src/runtime-pi/webflo-url/xURL.js +0 -94
- package/src/runtime-pi/webflo-worker/WorkerSideCookies.js +0 -21
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { _isObject } from '@webqit/util/js/index.js';
|
|
2
|
-
import { Observer } from '@webqit/use-live';
|
|
3
|
-
import { DeepURLSearchParams } from './util.js';
|
|
4
|
-
|
|
5
|
-
export class xURL extends URL {
|
|
6
|
-
|
|
7
|
-
// constructor
|
|
8
|
-
constructor(...args) {
|
|
9
|
-
super(...args);
|
|
10
|
-
const query = DeepURLSearchParams.eval({}, this.search);
|
|
11
|
-
const updateSearch = () => {
|
|
12
|
-
// "query" was updated. So we update "search"
|
|
13
|
-
let search = DeepURLSearchParams.stringify(query);
|
|
14
|
-
search = search ? '?' + search : '';
|
|
15
|
-
if (search !== this.search) {
|
|
16
|
-
this.search = search;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const $this = this;
|
|
20
|
-
this._query = new Proxy(query, {
|
|
21
|
-
set(t, k, v) {
|
|
22
|
-
t[k] = v;
|
|
23
|
-
if (!$this._updatingSearch) updateSearch();
|
|
24
|
-
return true;
|
|
25
|
-
},
|
|
26
|
-
deleteProperty(t, k) {
|
|
27
|
-
delete t[k];
|
|
28
|
-
if (!$this._updatingSearch) updateSearch();
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Set search
|
|
35
|
-
set search(value) {
|
|
36
|
-
super.search = value;
|
|
37
|
-
// "search" was updated. So we update "query"
|
|
38
|
-
this._updatingSearch = true;
|
|
39
|
-
const query = DeepURLSearchParams.eval({}, value);
|
|
40
|
-
const keys_a = Object.keys(query);
|
|
41
|
-
const keys_b = Object.keys(this._query);
|
|
42
|
-
for (const k of new Set([...keys_a,...keys_b])) {
|
|
43
|
-
if (!keys_a.includes(k)) delete this.query[k];
|
|
44
|
-
if (!keys_b.includes(k)) this.query[k] = query[k];
|
|
45
|
-
}
|
|
46
|
-
this._updatingSearch = false;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Get search
|
|
50
|
-
get search() {
|
|
51
|
-
return super.search;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Get query
|
|
55
|
-
get query() {
|
|
56
|
-
return this._query;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
xURL.Observable = class extends xURL {
|
|
62
|
-
|
|
63
|
-
constructor() {
|
|
64
|
-
super(...arguments);
|
|
65
|
-
Observer.accessorize(this, [
|
|
66
|
-
'protocol',
|
|
67
|
-
'username',
|
|
68
|
-
'password',
|
|
69
|
-
'host',
|
|
70
|
-
'hostname',
|
|
71
|
-
'port',
|
|
72
|
-
'origin',
|
|
73
|
-
'pathname',
|
|
74
|
-
'search',
|
|
75
|
-
'query',
|
|
76
|
-
'hash',
|
|
77
|
-
'href',
|
|
78
|
-
]);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const _strictEven = (a, b) => {
|
|
84
|
-
if (_isObject(a) && _isObject(b)) {
|
|
85
|
-
return _strictEven(Object.keys(a), Object.keys(b))
|
|
86
|
-
&& _strictEven(Object.values(a), Object.values(b));
|
|
87
|
-
}
|
|
88
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
89
|
-
return a.length === b.length
|
|
90
|
-
&& a.reduce((recieved, item, i) => recieved && item === b[i], true);
|
|
91
|
-
}
|
|
92
|
-
return a === b;
|
|
93
|
-
};
|
|
94
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { HttpCookies } from '../webflo-routing/HttpCookies.js';
|
|
2
|
-
import { headers as headersShim } from '../webflo-fetch/index.js';
|
|
3
|
-
|
|
4
|
-
export class WorkerSideCookies extends HttpCookies {
|
|
5
|
-
static create({ request, thread }) {
|
|
6
|
-
return new this({
|
|
7
|
-
request,
|
|
8
|
-
thread,
|
|
9
|
-
entries: headersShim.get.value.call(request.headers, 'Cookie', true).map((c) => [c.name, c])
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async commit(response = null) {
|
|
14
|
-
if (response) {
|
|
15
|
-
for (const cookieStr of await this.render()) {
|
|
16
|
-
response.headers.append('Set-Cookie', cookieStr);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
await super.commit();
|
|
20
|
-
}
|
|
21
|
-
}
|