oak-domain 4.0.0 → 4.0.2
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/lib/actions/action.d.ts +16 -16
- package/lib/actions/action.js +17 -17
- package/lib/actions/relation.d.ts +5 -5
- package/lib/actions/relation.js +25 -25
- package/lib/base-app-domain/ActionAuth/Schema.d.ts +186 -186
- package/lib/base-app-domain/ActionAuth/Storage.js +39 -39
- package/lib/base-app-domain/ActionDefDict.d.ts +8 -8
- package/lib/base-app-domain/ActionDefDict.js +9 -9
- package/lib/base-app-domain/EntityDict.d.ts +28 -28
- package/lib/base-app-domain/I18n/Schema.d.ts +129 -129
- package/lib/base-app-domain/I18n/Schema.js +2 -2
- package/lib/base-app-domain/I18n/Storage.d.ts +3 -3
- package/lib/base-app-domain/I18n/Storage.js +59 -59
- package/lib/base-app-domain/Modi/Action.d.ts +10 -10
- package/lib/base-app-domain/Modi/Action.js +14 -14
- package/lib/base-app-domain/Modi/Schema.d.ts +136 -136
- package/lib/base-app-domain/Modi/Storage.js +63 -63
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +384 -384
- package/lib/base-app-domain/ModiEntity/Storage.js +30 -30
- package/lib/base-app-domain/Oper/Schema.d.ts +153 -153
- package/lib/base-app-domain/Oper/Storage.js +38 -38
- package/lib/base-app-domain/OperEntity/Schema.d.ts +373 -373
- package/lib/base-app-domain/OperEntity/Storage.js +30 -30
- package/lib/base-app-domain/Path/Schema.d.ts +149 -149
- package/lib/base-app-domain/Path/Schema.js +2 -2
- package/lib/base-app-domain/Path/Storage.d.ts +3 -3
- package/lib/base-app-domain/Path/Storage.js +54 -54
- package/lib/base-app-domain/Relation/Schema.d.ts +188 -188
- package/lib/base-app-domain/Relation/Storage.js +54 -54
- package/lib/base-app-domain/Relation.d.ts +2 -2
- package/lib/base-app-domain/Relation.js +4 -4
- package/lib/base-app-domain/RelationAuth/Schema.d.ts +214 -214
- package/lib/base-app-domain/RelationAuth/Storage.js +44 -44
- package/lib/base-app-domain/Storage.js +31 -31
- package/lib/base-app-domain/User/Action.d.ts +10 -10
- package/lib/base-app-domain/User/Action.js +12 -12
- package/lib/base-app-domain/User/Schema.d.ts +210 -210
- package/lib/base-app-domain/User/Storage.js +33 -33
- package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +264 -264
- package/lib/base-app-domain/UserEntityClaim/Schema.js +2 -2
- package/lib/base-app-domain/UserEntityClaim/Storage.d.ts +3 -3
- package/lib/base-app-domain/UserEntityClaim/Storage.js +37 -37
- package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +131 -131
- package/lib/base-app-domain/UserEntityGrant/Storage.js +25 -25
- package/lib/base-app-domain/UserRelation/Schema.d.ts +208 -208
- package/lib/base-app-domain/UserRelation/Storage.js +56 -56
- package/lib/base-app-domain/_SubQuery.d.ts +142 -142
- package/lib/base-app-domain/index.d.ts +4 -4
- package/lib/base-app-domain/index.js +7 -7
- package/lib/checkers/index.d.ts +5 -5
- package/lib/checkers/index.js +13 -13
- package/lib/compiler/entities.d.ts +2 -2
- package/lib/compiler/entities.js +7 -7
- package/lib/compiler/env.d.ts +13 -13
- package/lib/compiler/env.js +45 -45
- package/lib/compiler/localeBuilder.d.ts +27 -27
- package/lib/compiler/localeBuilder.js +37 -8
- package/lib/compiler/routerBuilder.d.ts +1 -0
- package/lib/compiler/routerBuilder.js +257 -0
- package/lib/compiler/schemalBuilder.d.ts +27 -27
- package/lib/compiler/schemalBuilder.js +3565 -3565
- package/lib/entities/ActionAuth.d.ts +10 -10
- package/lib/entities/ActionAuth.js +31 -31
- package/lib/entities/I18n.d.ts +9 -9
- package/lib/entities/I18n.js +36 -36
- package/lib/entities/Modi.js +49 -49
- package/lib/entities/ModiEntity.js +18 -18
- package/lib/entities/Oper.js +21 -21
- package/lib/entities/OperEntity.js +18 -18
- package/lib/entities/Path.d.ts +8 -8
- package/lib/entities/Path.js +35 -35
- package/lib/entities/Relation.d.ts +8 -8
- package/lib/entities/Relation.js +35 -35
- package/lib/entities/RelationAuth.d.ts +8 -8
- package/lib/entities/RelationAuth.js +34 -34
- package/lib/entities/User.js +31 -31
- package/lib/entities/UserEntityClaim.d.ts +13 -13
- package/lib/entities/UserEntityClaim.js +17 -17
- package/lib/entities/UserEntityGrant.d.ts +9 -9
- package/lib/entities/UserEntityGrant.js +15 -15
- package/lib/entities/UserRelation.d.ts +10 -10
- package/lib/entities/UserRelation.js +38 -38
- package/lib/index.d.ts +23 -23
- package/lib/index.js +37 -37
- package/lib/store/AsyncRowStore.d.ts +65 -60
- package/lib/store/AsyncRowStore.js +176 -118
- package/lib/store/CascadeStore.d.ts +10 -5
- package/lib/store/CascadeStore.js +102 -42
- package/lib/store/RelationAuth.d.ts +96 -96
- package/lib/store/RelationAuth.js +1336 -1336
- package/lib/store/SyncRowStore.d.ts +29 -29
- package/lib/store/SyncRowStore.js +50 -50
- package/lib/store/TriggerExecutor.d.ts +41 -38
- package/lib/store/TriggerExecutor.js +133 -124
- package/lib/store/actionAuth.d.ts +4 -4
- package/lib/store/actionAuth.js +25 -25
- package/lib/store/actionDef.d.ts +10 -10
- package/lib/store/actionDef.js +4 -4
- package/lib/store/checker.d.ts +26 -26
- package/lib/store/checker.js +487 -487
- package/lib/store/filter.d.ts +85 -85
- package/lib/store/filter.js +1652 -1651
- package/lib/store/modi.d.ts +13 -13
- package/lib/store/modi.js +254 -254
- package/lib/store/relation.d.ts +12 -12
- package/lib/store/relation.js +67 -67
- package/lib/timers/oper.d.ts +18 -18
- package/lib/timers/oper.js +57 -57
- package/lib/timers/vaccum.d.ts +20 -20
- package/lib/timers/vaccum.js +111 -111
- package/lib/triggers/index.d.ts +5 -5
- package/lib/triggers/index.js +8 -8
- package/lib/types/Action.d.ts +20 -20
- package/lib/types/AppLoader.d.ts +17 -17
- package/lib/types/AppLoader.js +10 -10
- package/lib/types/Auth.d.ts +70 -70
- package/lib/types/Cluster.d.ts +5 -5
- package/lib/types/Cluster.js +2 -2
- package/lib/types/Connector.d.ts +38 -38
- package/lib/types/Connector.js +2 -2
- package/lib/types/DataType.d.ts +25 -25
- package/lib/types/DataType.js +6 -6
- package/lib/types/Demand.d.ts +89 -88
- package/lib/types/Demand.js +10 -10
- package/lib/types/Endpoint.d.ts +11 -11
- package/lib/types/Entity.d.ts +209 -203
- package/lib/types/Entity.js +15 -15
- package/lib/types/EntityDesc.d.ts +9 -9
- package/lib/types/EntityDesc.js +2 -2
- package/lib/types/Environment.d.ts +90 -88
- package/lib/types/Environment.js +2 -2
- package/lib/types/Exception.d.ts +147 -147
- package/lib/types/Exception.js +406 -406
- package/lib/types/Expression.d.ts +163 -163
- package/lib/types/Expression.js +397 -397
- package/lib/types/Geo.d.ts +18 -18
- package/lib/types/Locale.d.ts +25 -25
- package/lib/types/Logger.d.ts +6 -6
- package/lib/types/Polyfill.d.ts +24 -24
- package/lib/types/Port.d.ts +18 -18
- package/lib/types/RowStore.d.ts +19 -18
- package/lib/types/RowStore.js +33 -33
- package/lib/types/Storage.d.ts +58 -58
- package/lib/types/Style.d.ts +11 -11
- package/lib/types/Timer.d.ts +20 -14
- package/lib/types/Trigger.d.ts +118 -124
- package/lib/types/Trigger.js +35 -58
- package/lib/types/Watcher.d.ts +19 -19
- package/lib/types/index.d.ts +26 -26
- package/lib/types/index.js +29 -29
- package/lib/types/schema/DataTypes.d.ts +34 -34
- package/lib/utils/SimpleConnector.d.ts +64 -64
- package/lib/utils/SimpleConnector.js +2 -2
- package/lib/utils/assert.d.ts +1 -0
- package/lib/utils/assert.js +9 -9
- package/lib/utils/concurrent.d.ts +15 -15
- package/lib/utils/concurrent.js +63 -63
- package/lib/utils/date.js +18 -18
- package/lib/utils/domain.d.ts +1 -1
- package/lib/utils/domain.js +11 -11
- package/lib/utils/geo.js +24 -24
- package/lib/utils/lodash.d.ts +24 -24
- package/lib/utils/lodash.js +46 -46
- package/lib/utils/mask.js +34 -34
- package/lib/utils/money.d.ts +6 -6
- package/lib/utils/money.js +51 -51
- package/lib/utils/projection.d.ts +4 -4
- package/lib/utils/projection.js +15 -15
- package/lib/utils/random/random.js +19 -19
- package/lib/utils/random/random.mp.js +14 -14
- package/lib/utils/random/random.native.d.ts +1 -1
- package/lib/utils/random/random.native.js +14 -14
- package/lib/utils/random/random.web.js +11 -11
- package/lib/utils/string.d.ts +28 -28
- package/lib/utils/string.js +69 -69
- package/lib/utils/url/index.d.ts +7 -7
- package/lib/utils/url/index.js +8 -8
- package/lib/utils/url/index.mp.d.ts +3 -4
- package/lib/utils/url/index.mp.js +8 -8
- package/lib/utils/url/index.native.d.ts +12 -12
- package/lib/utils/url/index.native.js +7 -7
- package/lib/utils/url/index.web.d.ts +12 -12
- package/lib/utils/url/index.web.js +7 -7
- package/lib/utils/url/whatwg-url/index.d.ts +3 -0
- package/lib/utils/url/whatwg-url/index.js +16 -0
- package/lib/utils/url/whatwg-url/lib/URL-impl.d.ts +20 -0
- package/lib/utils/url/whatwg-url/lib/URL-impl.js +175 -0
- package/lib/utils/url/whatwg-url/lib/URL.d.ts +1 -0
- package/lib/utils/url/whatwg-url/lib/URL.js +298 -0
- package/lib/utils/url/whatwg-url/lib/URLSearchParams-impl.d.ts +19 -0
- package/lib/utils/url/whatwg-url/lib/URLSearchParams-impl.js +126 -0
- package/lib/utils/url/whatwg-url/lib/URLSearchParams.d.ts +1 -0
- package/lib/utils/url/whatwg-url/lib/URLSearchParams.js +426 -0
- package/lib/utils/url/whatwg-url/lib/infra.d.ts +12 -0
- package/lib/utils/url/whatwg-url/lib/infra.js +25 -0
- package/lib/utils/url/whatwg-url/lib/url-state-machine.d.ts +24 -0
- package/lib/utils/url/whatwg-url/lib/url-state-machine.js +1238 -0
- package/lib/utils/url/whatwg-url/lib/urlencoded.d.ts +15 -0
- package/lib/utils/url/whatwg-url/lib/urlencoded.js +162 -0
- package/lib/utils/url/whatwg-url/lib/utils.d.ts +37 -0
- package/lib/utils/url/whatwg-url/lib/utils.js +101 -0
- package/lib/utils/uuid.d.ts +17 -17
- package/lib/utils/uuid.js +218 -218
- package/lib/utils/validator.d.ts +26 -26
- package/lib/utils/validator.js +131 -131
- package/lib/utils/version.js +21 -21
- package/package.json +3 -3
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
const urlencoded_1 = tslib_1.__importDefault(require("./urlencoded"));
|
|
6
|
+
function stableSortBy(arr, compare) {
|
|
7
|
+
return arr
|
|
8
|
+
.map((item, index) => ({ item, index }))
|
|
9
|
+
.sort((a, b) => compare(a.item, b.item) || a.index - b.index)
|
|
10
|
+
.map(({ item }) => item);
|
|
11
|
+
}
|
|
12
|
+
const implementation = class URLSearchParamsImpl {
|
|
13
|
+
constructor(globalObject, constructorArgs, { doNotStripQMark = false }) {
|
|
14
|
+
let init = constructorArgs[0];
|
|
15
|
+
this._list = [];
|
|
16
|
+
this._url = null;
|
|
17
|
+
if (!doNotStripQMark && typeof init === 'string' && init[0] === '?') {
|
|
18
|
+
init = init.slice(1);
|
|
19
|
+
}
|
|
20
|
+
if (Array.isArray(init)) {
|
|
21
|
+
for (const pair of init) {
|
|
22
|
+
if (pair.length !== 2) {
|
|
23
|
+
throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not " +
|
|
24
|
+
'contain exactly two elements.');
|
|
25
|
+
}
|
|
26
|
+
this._list.push([pair[0], pair[1]]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else if (typeof init === 'object' &&
|
|
30
|
+
Object.getPrototypeOf(init) === null) {
|
|
31
|
+
for (const name of Object.keys(init)) {
|
|
32
|
+
const value = init[name];
|
|
33
|
+
this._list.push([name, value]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this._list = urlencoded_1.default.parseUrlencoded(init);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
_updateSteps() {
|
|
41
|
+
if (this._url !== null) {
|
|
42
|
+
let query = urlencoded_1.default.serializeUrlencoded(this._list);
|
|
43
|
+
if (query === '') {
|
|
44
|
+
query = null;
|
|
45
|
+
}
|
|
46
|
+
this._url._url.query = query;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
append(name, value) {
|
|
50
|
+
this._list.push([name, value]);
|
|
51
|
+
this._updateSteps();
|
|
52
|
+
}
|
|
53
|
+
delete(name) {
|
|
54
|
+
let i = 0;
|
|
55
|
+
while (i < this._list.length) {
|
|
56
|
+
if (this._list[i][0] === name) {
|
|
57
|
+
this._list.splice(i, 1);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
i++;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
this._updateSteps();
|
|
64
|
+
}
|
|
65
|
+
get(name) {
|
|
66
|
+
for (const tuple of this._list) {
|
|
67
|
+
if (tuple[0] === name) {
|
|
68
|
+
return tuple[1];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
getAll(name) {
|
|
74
|
+
const output = [];
|
|
75
|
+
for (const tuple of this._list) {
|
|
76
|
+
if (tuple[0] === name) {
|
|
77
|
+
output.push(tuple[1]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return output;
|
|
81
|
+
}
|
|
82
|
+
has(name) {
|
|
83
|
+
for (const tuple of this._list) {
|
|
84
|
+
if (tuple[0] === name) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
set(name, value) {
|
|
91
|
+
let found = false;
|
|
92
|
+
let i = 0;
|
|
93
|
+
while (i < this._list.length) {
|
|
94
|
+
if (this._list[i][0] === name) {
|
|
95
|
+
if (found) {
|
|
96
|
+
this._list.splice(i, 1);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
found = true;
|
|
100
|
+
this._list[i][1] = value;
|
|
101
|
+
i++;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
i++;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (!found) {
|
|
109
|
+
this._list.push([name, value]);
|
|
110
|
+
}
|
|
111
|
+
this._updateSteps();
|
|
112
|
+
}
|
|
113
|
+
sort() {
|
|
114
|
+
this._list = stableSortBy(this._list, (a, b) => a[0] > b[0]);
|
|
115
|
+
this._updateSteps();
|
|
116
|
+
}
|
|
117
|
+
[Symbol.iterator]() {
|
|
118
|
+
return this._list[Symbol.iterator]();
|
|
119
|
+
}
|
|
120
|
+
toString() {
|
|
121
|
+
return urlencoded_1.default.serializeUrlencoded(this._list);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
exports.default = {
|
|
125
|
+
implementation
|
|
126
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
const webidl_conversions_1 = tslib_1.__importDefault(require("webidl-conversions"));
|
|
6
|
+
const utils_1 = tslib_1.__importDefault(require("./utils"));
|
|
7
|
+
const impl = utils_1.default.implSymbol;
|
|
8
|
+
const ctorRegistry = utils_1.default.ctorRegistrySymbol;
|
|
9
|
+
const IteratorPrototype = Object.create(utils_1.default.IteratorPrototype, {
|
|
10
|
+
next: {
|
|
11
|
+
value: function next() {
|
|
12
|
+
const internal = this[utils_1.default.iterInternalSymbol];
|
|
13
|
+
const { target, kind, index } = internal;
|
|
14
|
+
const values = Array.from(target[impl]);
|
|
15
|
+
const len = values.length;
|
|
16
|
+
if (index >= len) {
|
|
17
|
+
return { value: undefined, done: true };
|
|
18
|
+
}
|
|
19
|
+
const pair = values[index];
|
|
20
|
+
internal.index = index + 1;
|
|
21
|
+
const [key, value] = pair.map(utils_1.default.tryWrapperForImpl);
|
|
22
|
+
let result;
|
|
23
|
+
switch (kind) {
|
|
24
|
+
case 'key':
|
|
25
|
+
result = key;
|
|
26
|
+
break;
|
|
27
|
+
case 'value':
|
|
28
|
+
result = value;
|
|
29
|
+
break;
|
|
30
|
+
case 'key+value':
|
|
31
|
+
result = [key, value];
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
return { value: result, done: false };
|
|
35
|
+
},
|
|
36
|
+
writable: true,
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
},
|
|
40
|
+
[Symbol.toStringTag]: {
|
|
41
|
+
value: 'URLSearchParams Iterator',
|
|
42
|
+
configurable: true,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
const iface = {
|
|
46
|
+
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
|
|
47
|
+
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
|
|
48
|
+
// implementing this mixin interface.
|
|
49
|
+
_mixedIntoPredicates: [],
|
|
50
|
+
is(obj) {
|
|
51
|
+
if (obj) {
|
|
52
|
+
if (utils_1.default.hasOwn(obj, impl) &&
|
|
53
|
+
obj[impl] instanceof URLSearchParams_impl_1.default.implementation) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
for (const isMixedInto of module.exports._mixedIntoPredicates) {
|
|
57
|
+
if (isMixedInto(obj)) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
},
|
|
64
|
+
isImpl(obj) {
|
|
65
|
+
if (obj) {
|
|
66
|
+
if (obj instanceof URLSearchParams_impl_1.default.implementation) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
const wrapper = utils_1.default.wrapperForImpl(obj);
|
|
70
|
+
for (const isMixedInto of module.exports._mixedIntoPredicates) {
|
|
71
|
+
if (isMixedInto(wrapper)) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
},
|
|
78
|
+
convert(obj, { context = 'The provided value' } = {}) {
|
|
79
|
+
if (module.exports.is(obj)) {
|
|
80
|
+
return utils_1.default.implForWrapper(obj);
|
|
81
|
+
}
|
|
82
|
+
throw new TypeError(`${context} is not of type 'URLSearchParams'.`);
|
|
83
|
+
},
|
|
84
|
+
createDefaultIterator(target, kind) {
|
|
85
|
+
const iterator = Object.create(IteratorPrototype);
|
|
86
|
+
Object.defineProperty(iterator, utils_1.default.iterInternalSymbol, {
|
|
87
|
+
value: { target, kind, index: 0 },
|
|
88
|
+
configurable: true,
|
|
89
|
+
});
|
|
90
|
+
return iterator;
|
|
91
|
+
},
|
|
92
|
+
create(globalObject, constructorArgs, privateData) {
|
|
93
|
+
if (globalObject[ctorRegistry] === undefined) {
|
|
94
|
+
throw new Error('Internal error: invalid global object');
|
|
95
|
+
}
|
|
96
|
+
const ctor = globalObject[ctorRegistry]['URLSearchParams'];
|
|
97
|
+
if (ctor === undefined) {
|
|
98
|
+
throw new Error('Internal error: constructor URLSearchParams is not installed on the passed global object');
|
|
99
|
+
}
|
|
100
|
+
let obj = Object.create(ctor.prototype);
|
|
101
|
+
obj = iface.setup(obj, globalObject, constructorArgs, privateData);
|
|
102
|
+
return obj;
|
|
103
|
+
},
|
|
104
|
+
createImpl(globalObject, constructorArgs, privateData) {
|
|
105
|
+
const obj = iface.create(globalObject, constructorArgs, privateData);
|
|
106
|
+
return utils_1.default.implForWrapper(obj);
|
|
107
|
+
},
|
|
108
|
+
_internalSetup(obj) { },
|
|
109
|
+
setup(obj, globalObject, constructorArgs = [], privateData = {}) {
|
|
110
|
+
privateData.wrapper = obj;
|
|
111
|
+
iface._internalSetup(obj);
|
|
112
|
+
Object.defineProperty(obj, impl, {
|
|
113
|
+
value: new URLSearchParams_impl_1.default.implementation(globalObject, constructorArgs, privateData),
|
|
114
|
+
configurable: true,
|
|
115
|
+
});
|
|
116
|
+
obj[impl][utils_1.default.wrapperSymbol] = obj;
|
|
117
|
+
if (URLSearchParams_impl_1.default.init) {
|
|
118
|
+
URLSearchParams_impl_1.default.init(obj[impl], privateData);
|
|
119
|
+
}
|
|
120
|
+
return obj;
|
|
121
|
+
},
|
|
122
|
+
install(globalObject) {
|
|
123
|
+
class URLSearchParams {
|
|
124
|
+
constructor() {
|
|
125
|
+
const args = [];
|
|
126
|
+
{
|
|
127
|
+
let curArg = arguments[0];
|
|
128
|
+
if (curArg !== undefined) {
|
|
129
|
+
if (utils_1.default.isObject(curArg)) {
|
|
130
|
+
if (curArg[Symbol.iterator] !== undefined) {
|
|
131
|
+
if (!utils_1.default.isObject(curArg)) {
|
|
132
|
+
throw new TypeError("Failed to construct 'URLSearchParams': parameter 1" +
|
|
133
|
+
' sequence' +
|
|
134
|
+
' is not an iterable object.');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
const V = [];
|
|
138
|
+
const tmp = curArg;
|
|
139
|
+
for (let nextItem of tmp) {
|
|
140
|
+
if (!utils_1.default.isObject(nextItem)) {
|
|
141
|
+
throw new TypeError("Failed to construct 'URLSearchParams': parameter 1" +
|
|
142
|
+
' sequence' +
|
|
143
|
+
"'s element" +
|
|
144
|
+
' is not an iterable object.');
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
const V = [];
|
|
148
|
+
const tmp = nextItem;
|
|
149
|
+
for (let nextItem of tmp) {
|
|
150
|
+
nextItem = webidl_conversions_1.default['USVString'](nextItem, {
|
|
151
|
+
context: "Failed to construct 'URLSearchParams': parameter 1" +
|
|
152
|
+
' sequence' +
|
|
153
|
+
"'s element" +
|
|
154
|
+
"'s element",
|
|
155
|
+
});
|
|
156
|
+
V.push(nextItem);
|
|
157
|
+
}
|
|
158
|
+
nextItem = V;
|
|
159
|
+
}
|
|
160
|
+
V.push(nextItem);
|
|
161
|
+
}
|
|
162
|
+
curArg = V;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
if (!utils_1.default.isObject(curArg)) {
|
|
167
|
+
throw new TypeError("Failed to construct 'URLSearchParams': parameter 1" +
|
|
168
|
+
' record' +
|
|
169
|
+
' is not an object.');
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
const result = Object.create(null);
|
|
173
|
+
for (const key of Reflect.ownKeys(curArg)) {
|
|
174
|
+
const desc = Object.getOwnPropertyDescriptor(curArg, key);
|
|
175
|
+
if (desc && desc.enumerable) {
|
|
176
|
+
let typedKey = key;
|
|
177
|
+
typedKey = webidl_conversions_1.default['USVString'](typedKey, {
|
|
178
|
+
context: "Failed to construct 'URLSearchParams': parameter 1" +
|
|
179
|
+
' record' +
|
|
180
|
+
"'s key",
|
|
181
|
+
});
|
|
182
|
+
let typedValue = curArg[key];
|
|
183
|
+
typedValue = webidl_conversions_1.default['USVString'](typedValue, {
|
|
184
|
+
context: "Failed to construct 'URLSearchParams': parameter 1" +
|
|
185
|
+
' record' +
|
|
186
|
+
"'s value",
|
|
187
|
+
});
|
|
188
|
+
result[typedKey] = typedValue;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
curArg = result;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
curArg = webidl_conversions_1.default['USVString'](curArg, {
|
|
197
|
+
context: "Failed to construct 'URLSearchParams': parameter 1",
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
curArg = '';
|
|
203
|
+
}
|
|
204
|
+
args.push(curArg);
|
|
205
|
+
}
|
|
206
|
+
return iface.setup(Object.create(this.constructor.prototype), globalObject, args);
|
|
207
|
+
}
|
|
208
|
+
append(name, value) {
|
|
209
|
+
if (!this || !module.exports.is(this)) {
|
|
210
|
+
throw new TypeError('Illegal invocation');
|
|
211
|
+
}
|
|
212
|
+
if (arguments.length < 2) {
|
|
213
|
+
throw new TypeError("Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only " +
|
|
214
|
+
arguments.length +
|
|
215
|
+
' present.');
|
|
216
|
+
}
|
|
217
|
+
const args = [];
|
|
218
|
+
{
|
|
219
|
+
let curArg = arguments[0];
|
|
220
|
+
curArg = webidl_conversions_1.default['USVString'](curArg, {
|
|
221
|
+
context: "Failed to execute 'append' on 'URLSearchParams': parameter 1",
|
|
222
|
+
});
|
|
223
|
+
args.push(curArg);
|
|
224
|
+
}
|
|
225
|
+
{
|
|
226
|
+
let curArg = arguments[1];
|
|
227
|
+
curArg = webidl_conversions_1.default['USVString'](curArg, {
|
|
228
|
+
context: "Failed to execute 'append' on 'URLSearchParams': parameter 2",
|
|
229
|
+
});
|
|
230
|
+
args.push(curArg);
|
|
231
|
+
}
|
|
232
|
+
return this[impl].append(...args);
|
|
233
|
+
}
|
|
234
|
+
delete(name) {
|
|
235
|
+
if (!this || !module.exports.is(this)) {
|
|
236
|
+
throw new TypeError('Illegal invocation');
|
|
237
|
+
}
|
|
238
|
+
if (arguments.length < 1) {
|
|
239
|
+
throw new TypeError("Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only " +
|
|
240
|
+
arguments.length +
|
|
241
|
+
' present.');
|
|
242
|
+
}
|
|
243
|
+
const args = [];
|
|
244
|
+
{
|
|
245
|
+
let curArg = arguments[0];
|
|
246
|
+
curArg = webidl_conversions_1.default['USVString'](curArg, {
|
|
247
|
+
context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1",
|
|
248
|
+
});
|
|
249
|
+
args.push(curArg);
|
|
250
|
+
}
|
|
251
|
+
return this[impl].delete(...args);
|
|
252
|
+
}
|
|
253
|
+
get(name) {
|
|
254
|
+
if (!this || !module.exports.is(this)) {
|
|
255
|
+
throw new TypeError('Illegal invocation');
|
|
256
|
+
}
|
|
257
|
+
if (arguments.length < 1) {
|
|
258
|
+
throw new TypeError("Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only " +
|
|
259
|
+
arguments.length +
|
|
260
|
+
' present.');
|
|
261
|
+
}
|
|
262
|
+
const args = [];
|
|
263
|
+
{
|
|
264
|
+
let curArg = arguments[0];
|
|
265
|
+
curArg = webidl_conversions_1.default['USVString'](curArg, {
|
|
266
|
+
context: "Failed to execute 'get' on 'URLSearchParams': parameter 1",
|
|
267
|
+
});
|
|
268
|
+
args.push(curArg);
|
|
269
|
+
}
|
|
270
|
+
return this[impl].get(...args);
|
|
271
|
+
}
|
|
272
|
+
getAll(name) {
|
|
273
|
+
if (!this || !module.exports.is(this)) {
|
|
274
|
+
throw new TypeError('Illegal invocation');
|
|
275
|
+
}
|
|
276
|
+
if (arguments.length < 1) {
|
|
277
|
+
throw new TypeError("Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only " +
|
|
278
|
+
arguments.length +
|
|
279
|
+
' present.');
|
|
280
|
+
}
|
|
281
|
+
const args = [];
|
|
282
|
+
{
|
|
283
|
+
let curArg = arguments[0];
|
|
284
|
+
curArg = webidl_conversions_1.default['USVString'](curArg, {
|
|
285
|
+
context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1",
|
|
286
|
+
});
|
|
287
|
+
args.push(curArg);
|
|
288
|
+
}
|
|
289
|
+
return utils_1.default.tryWrapperForImpl(this[impl].getAll(...args));
|
|
290
|
+
}
|
|
291
|
+
has(name) {
|
|
292
|
+
if (!this || !module.exports.is(this)) {
|
|
293
|
+
throw new TypeError('Illegal invocation');
|
|
294
|
+
}
|
|
295
|
+
if (arguments.length < 1) {
|
|
296
|
+
throw new TypeError("Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only " +
|
|
297
|
+
arguments.length +
|
|
298
|
+
' present.');
|
|
299
|
+
}
|
|
300
|
+
const args = [];
|
|
301
|
+
{
|
|
302
|
+
let curArg = arguments[0];
|
|
303
|
+
curArg = webidl_conversions_1.default['USVString'](curArg, {
|
|
304
|
+
context: "Failed to execute 'has' on 'URLSearchParams': parameter 1",
|
|
305
|
+
});
|
|
306
|
+
args.push(curArg);
|
|
307
|
+
}
|
|
308
|
+
return this[impl].has(...args);
|
|
309
|
+
}
|
|
310
|
+
set(name, value) {
|
|
311
|
+
if (!this || !module.exports.is(this)) {
|
|
312
|
+
throw new TypeError('Illegal invocation');
|
|
313
|
+
}
|
|
314
|
+
if (arguments.length < 2) {
|
|
315
|
+
throw new TypeError("Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only " +
|
|
316
|
+
arguments.length +
|
|
317
|
+
' present.');
|
|
318
|
+
}
|
|
319
|
+
const args = [];
|
|
320
|
+
{
|
|
321
|
+
let curArg = arguments[0];
|
|
322
|
+
curArg = webidl_conversions_1.default['USVString'](curArg, {
|
|
323
|
+
context: "Failed to execute 'set' on 'URLSearchParams': parameter 1",
|
|
324
|
+
});
|
|
325
|
+
args.push(curArg);
|
|
326
|
+
}
|
|
327
|
+
{
|
|
328
|
+
let curArg = arguments[1];
|
|
329
|
+
curArg = webidl_conversions_1.default['USVString'](curArg, {
|
|
330
|
+
context: "Failed to execute 'set' on 'URLSearchParams': parameter 2",
|
|
331
|
+
});
|
|
332
|
+
args.push(curArg);
|
|
333
|
+
}
|
|
334
|
+
return this[impl].set(...args);
|
|
335
|
+
}
|
|
336
|
+
sort() {
|
|
337
|
+
if (!this || !module.exports.is(this)) {
|
|
338
|
+
throw new TypeError('Illegal invocation');
|
|
339
|
+
}
|
|
340
|
+
return this[impl].sort();
|
|
341
|
+
}
|
|
342
|
+
toString() {
|
|
343
|
+
if (!this || !module.exports.is(this)) {
|
|
344
|
+
throw new TypeError('Illegal invocation');
|
|
345
|
+
}
|
|
346
|
+
return this[impl].toString();
|
|
347
|
+
}
|
|
348
|
+
keys() {
|
|
349
|
+
if (!this || !module.exports.is(this)) {
|
|
350
|
+
throw new TypeError('Illegal invocation');
|
|
351
|
+
}
|
|
352
|
+
return module.exports.createDefaultIterator(this, 'key');
|
|
353
|
+
}
|
|
354
|
+
values() {
|
|
355
|
+
if (!this || !module.exports.is(this)) {
|
|
356
|
+
throw new TypeError('Illegal invocation');
|
|
357
|
+
}
|
|
358
|
+
return module.exports.createDefaultIterator(this, 'value');
|
|
359
|
+
}
|
|
360
|
+
entries() {
|
|
361
|
+
if (!this || !module.exports.is(this)) {
|
|
362
|
+
throw new TypeError('Illegal invocation');
|
|
363
|
+
}
|
|
364
|
+
return module.exports.createDefaultIterator(this, 'key+value');
|
|
365
|
+
}
|
|
366
|
+
forEach(callback) {
|
|
367
|
+
if (!this || !module.exports.is(this)) {
|
|
368
|
+
throw new TypeError('Illegal invocation');
|
|
369
|
+
}
|
|
370
|
+
if (arguments.length < 1) {
|
|
371
|
+
throw new TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, " +
|
|
372
|
+
'but only 0 present.');
|
|
373
|
+
}
|
|
374
|
+
if (typeof callback !== 'function') {
|
|
375
|
+
throw new TypeError("Failed to execute 'forEach' on 'iterable': The callback provided " +
|
|
376
|
+
'as parameter 1 is not a function.');
|
|
377
|
+
}
|
|
378
|
+
const thisArg = arguments[1];
|
|
379
|
+
let pairs = Array.from(this[impl]);
|
|
380
|
+
let i = 0;
|
|
381
|
+
while (i < pairs.length) {
|
|
382
|
+
const [key, value] = pairs[i].map(utils_1.default.tryWrapperForImpl);
|
|
383
|
+
callback.call(thisArg, value, key, this);
|
|
384
|
+
pairs = Array.from(this[impl]);
|
|
385
|
+
i++;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
Object.defineProperties(URLSearchParams.prototype, {
|
|
390
|
+
append: { enumerable: true },
|
|
391
|
+
delete: { enumerable: true },
|
|
392
|
+
get: { enumerable: true },
|
|
393
|
+
getAll: { enumerable: true },
|
|
394
|
+
has: { enumerable: true },
|
|
395
|
+
set: { enumerable: true },
|
|
396
|
+
sort: { enumerable: true },
|
|
397
|
+
toString: { enumerable: true },
|
|
398
|
+
keys: { enumerable: true },
|
|
399
|
+
values: { enumerable: true },
|
|
400
|
+
entries: { enumerable: true },
|
|
401
|
+
forEach: { enumerable: true },
|
|
402
|
+
[Symbol.toStringTag]: {
|
|
403
|
+
value: 'URLSearchParams',
|
|
404
|
+
configurable: true,
|
|
405
|
+
},
|
|
406
|
+
[Symbol.iterator]: {
|
|
407
|
+
value: URLSearchParams.prototype.entries,
|
|
408
|
+
configurable: true,
|
|
409
|
+
writable: true,
|
|
410
|
+
},
|
|
411
|
+
});
|
|
412
|
+
if (globalObject[ctorRegistry] === undefined) {
|
|
413
|
+
globalObject[ctorRegistry] = Object.create(null);
|
|
414
|
+
}
|
|
415
|
+
globalObject[ctorRegistry]['URLSearchParams'] = URLSearchParams;
|
|
416
|
+
Object.defineProperty(globalObject, 'URLSearchParams', {
|
|
417
|
+
configurable: true,
|
|
418
|
+
writable: true,
|
|
419
|
+
value: URLSearchParams,
|
|
420
|
+
});
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
// iface
|
|
424
|
+
module.exports = iface;
|
|
425
|
+
// const Impl = require('./URLSearchParams-impl')
|
|
426
|
+
const URLSearchParams_impl_1 = tslib_1.__importDefault(require("./URLSearchParams-impl"));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare function isASCIIDigit(c: number): boolean;
|
|
2
|
+
declare function isASCIIAlpha(c: number): boolean;
|
|
3
|
+
declare function isASCIIAlphanumeric(c: number): boolean;
|
|
4
|
+
declare function isASCIIHex(c: number): boolean;
|
|
5
|
+
export { isASCIIDigit, isASCIIAlpha, isASCIIAlphanumeric, isASCIIHex, };
|
|
6
|
+
declare const _default: {
|
|
7
|
+
isASCIIDigit: typeof isASCIIDigit;
|
|
8
|
+
isASCIIAlpha: typeof isASCIIAlpha;
|
|
9
|
+
isASCIIAlphanumeric: typeof isASCIIAlphanumeric;
|
|
10
|
+
isASCIIHex: typeof isASCIIHex;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isASCIIHex = exports.isASCIIAlphanumeric = exports.isASCIIAlpha = exports.isASCIIDigit = void 0;
|
|
4
|
+
function isASCIIDigit(c) {
|
|
5
|
+
return c >= 0x30 && c <= 0x39;
|
|
6
|
+
}
|
|
7
|
+
exports.isASCIIDigit = isASCIIDigit;
|
|
8
|
+
function isASCIIAlpha(c) {
|
|
9
|
+
return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);
|
|
10
|
+
}
|
|
11
|
+
exports.isASCIIAlpha = isASCIIAlpha;
|
|
12
|
+
function isASCIIAlphanumeric(c) {
|
|
13
|
+
return isASCIIAlpha(c) || isASCIIDigit(c);
|
|
14
|
+
}
|
|
15
|
+
exports.isASCIIAlphanumeric = isASCIIAlphanumeric;
|
|
16
|
+
function isASCIIHex(c) {
|
|
17
|
+
return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);
|
|
18
|
+
}
|
|
19
|
+
exports.isASCIIHex = isASCIIHex;
|
|
20
|
+
exports.default = {
|
|
21
|
+
isASCIIDigit,
|
|
22
|
+
isASCIIAlpha,
|
|
23
|
+
isASCIIAlphanumeric,
|
|
24
|
+
isASCIIHex
|
|
25
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare function serializeHost(host: any): any;
|
|
2
|
+
declare function cannotHaveAUsernamePasswordPort(url: any): any;
|
|
3
|
+
declare function serializeURL(url: any, excludeFragment: any): string;
|
|
4
|
+
export declare const serializeURL: typeof serializeURL;
|
|
5
|
+
export declare const serializeURLOrigin: (url: any) => any;
|
|
6
|
+
export declare const basicURLParse: (input: any, options: any) => any;
|
|
7
|
+
export declare const setTheUsername: (url: any, username: any) => void;
|
|
8
|
+
export declare const setThePassword: (url: any, password: any) => void;
|
|
9
|
+
export declare const serializeHost: typeof serializeHost;
|
|
10
|
+
export declare const cannotHaveAUsernamePasswordPort: typeof cannotHaveAUsernamePasswordPort;
|
|
11
|
+
export declare const serializeInteger: (integer: any) => string;
|
|
12
|
+
export declare const parseURL: (input: any, options: any) => any;
|
|
13
|
+
declare const _default: {
|
|
14
|
+
parseURL: (input: any, options: any) => any;
|
|
15
|
+
serializeInteger: (integer: any) => string;
|
|
16
|
+
serializeHost: typeof serializeHost;
|
|
17
|
+
cannotHaveAUsernamePasswordPort: typeof cannotHaveAUsernamePasswordPort;
|
|
18
|
+
setThePassword: (url: any, password: any) => void;
|
|
19
|
+
setTheUsername: (url: any, username: any) => void;
|
|
20
|
+
basicURLParse: (input: any, options: any) => any;
|
|
21
|
+
serializeURLOrigin: (url: any) => any;
|
|
22
|
+
serializeURL: typeof serializeURL;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|