apps 0.0.1-beta.9 → 0.0.1-beta.91
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/README.md +56 -38
- package/framework-reference.json +1 -1
- package/js/chunk-3LEVTFD4.js +712 -0
- package/js/chunk-5FHWNLCI.js +88 -0
- package/js/{chunk-FL2QR3XW.js → chunk-5MDA7MKL.js} +338 -73
- package/js/chunk-6XQLA5NC.js +5047 -0
- package/js/{chunk-M3B3DE4K.js → chunk-74YVXBKY.js} +463 -218
- package/js/chunk-7PHHWYV4.js +335 -0
- package/js/chunk-DADXWWRZ.js +449 -0
- package/js/{chunk-27F7W2LG.js → chunk-DDHBUKXX.js} +18 -2
- package/js/{chunk-UK573G7W.js → chunk-EOPQ727L.js} +87 -51
- package/js/{chunk-5T57N25Q.js → chunk-GQ33QSNB.js} +583 -69
- package/js/{chunk-JU7VHODU.js → chunk-H72MEDMN.js} +65 -10
- package/js/chunk-I5C7FD5Z.js +171 -0
- package/js/{chunk-CDL5PM2Q.js → chunk-IFJU5SYQ.js} +19082 -18402
- package/js/{chunk-VFZKSM3T.js → chunk-JPEUKEV4.js} +3 -3
- package/js/{chunk-KUMBKVJD.js → chunk-KLYSEHUD.js} +2 -2
- package/js/{chunk-RFVIONFX.js → chunk-KUCCHNVY.js} +123 -44
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/{chunk-57RKNWL2.js → chunk-PD6I2SDG.js} +4 -4
- package/js/{chunk-72JNVHPK.js → chunk-PYQLOLOC.js} +4 -3
- package/js/{chunk-ODEIDRGW.js → chunk-QWQM3CLH.js} +795 -176
- package/js/{chunk-IJX4CYZO.js → chunk-TUMGL2OC.js} +228 -264
- package/js/{chunk-IPI4MFSN.js → chunk-XBG7HHXC.js} +2 -2
- package/js/chunk-XPRZTLHD.js +1915 -0
- package/js/chunk-YNJ5CZMJ.js +93 -0
- package/js/chunk-YRGL4QEF.js +49 -0
- package/js/{chunk-Z5M2LQOZ.js → chunk-YWFUWTUJ.js} +113 -58
- package/js/client.js +142 -78
- package/js/contracts.js +142 -21
- package/js/effect.js +18 -19
- package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
- package/js/graphql.js +49 -40
- package/js/host.js +85 -62
- package/js/index.js +165 -70
- package/js/mcp/effect.js +21 -21
- package/js/mcp.js +76 -56
- package/js/openapi.js +4189 -1411
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -3
- package/js/skills.js +208 -81
- package/js/storage/facet.js +1 -540
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +5 -4
- package/js/ui/serving.js +8605 -225
- package/package.json +3 -8
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +18 -0
- package/types/app-cache/src/index.d.ts +34 -2
- package/types/apps/src/contracts/api-response-error.d.ts +4 -0
- package/types/apps/src/contracts/app.d.ts +60 -11
- package/types/apps/src/contracts/cache.d.ts +20 -0
- package/types/apps/src/contracts/context.d.ts +60 -17
- package/types/apps/src/contracts/elicitation.d.ts +23 -7
- package/types/apps/src/contracts/events.d.ts +94 -0
- package/types/apps/src/contracts/failure.d.ts +30 -1
- package/types/apps/src/contracts/graphql.d.ts +2 -1
- package/types/apps/src/contracts/host.d.ts +1446 -17
- package/types/apps/src/contracts/icons.d.ts +28 -0
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/mcp.d.ts +81 -20
- package/types/apps/src/contracts/network.d.ts +120 -0
- package/types/apps/src/contracts/openapi-compile.d.ts +82 -3
- package/types/apps/src/contracts/openapi.d.ts +41 -9
- package/types/apps/src/contracts/operations.d.ts +14 -7
- package/types/apps/src/contracts/placement.d.ts +102 -0
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/1.d.ts +733 -81
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/11.d.ts +1149 -0
- package/types/apps/src/contracts/protocols/12.d.ts +3310 -0
- package/types/apps/src/contracts/protocols/2.d.ts +69 -26
- package/types/apps/src/contracts/protocols/3.d.ts +133 -33
- package/types/apps/src/contracts/protocols/4.d.ts +122 -45
- package/types/apps/src/contracts/protocols/5.d.ts +157 -47
- package/types/apps/src/contracts/protocols/6.d.ts +1629 -0
- package/types/apps/src/contracts/protocols/7.d.ts +1785 -0
- package/types/apps/src/contracts/protocols/8.d.ts +1182 -0
- package/types/apps/src/contracts/protocols/9.d.ts +1104 -0
- package/types/apps/src/contracts/protocols/current.d.ts +6669 -0
- package/types/apps/src/contracts/protocols/oauth-6.d.ts +74 -0
- package/types/apps/src/contracts/protocols/oauth.d.ts +134 -0
- package/types/apps/src/contracts/provider-error.d.ts +9 -0
- package/types/apps/src/contracts/provider.d.ts +90 -6
- package/types/apps/src/contracts/schedules.d.ts +7 -1
- package/types/apps/src/contracts/schema.d.ts +21 -0
- package/types/apps/src/contracts/skills.d.ts +50 -13
- package/types/apps/src/contracts/sql.d.ts +63 -0
- package/types/apps/src/contracts/ui.d.ts +44 -14
- package/types/apps/src/contracts/webhooks.d.ts +24 -7
- package/types/apps/src/contracts/workflows.d.ts +19 -17
- package/types/apps/src/facet.d.ts +4 -5
- package/types/apps/src/host.d.ts +5 -0
- package/types/apps/src/implementation/account-router.d.ts +4 -3
- package/types/apps/src/implementation/app.d.ts +41 -14
- package/types/apps/src/implementation/authoring.d.ts +25 -5
- package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
- package/types/apps/src/implementation/cache.d.ts +29 -2
- package/types/apps/src/implementation/catalog-cache.d.ts +35 -4
- package/types/apps/src/implementation/elicitation.d.ts +18 -15
- package/types/apps/src/implementation/events.d.ts +64 -0
- package/types/apps/src/implementation/failure-detail.d.ts +28 -5
- package/types/apps/src/implementation/graphql-catalog.d.ts +3 -3
- package/types/apps/src/implementation/graphql.d.ts +4 -3
- package/types/apps/src/implementation/input-problems.d.ts +6 -2
- package/types/apps/src/implementation/invocation-timing.d.ts +18 -0
- package/types/apps/src/implementation/live.d.ts +2 -2
- package/types/apps/src/implementation/mcp-call.d.ts +6 -5
- package/types/apps/src/implementation/mcp-catalog.d.ts +6 -4
- package/types/apps/src/implementation/mcp-client.d.ts +17 -9
- package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
- package/types/apps/src/implementation/mcp.d.ts +20 -9
- package/types/apps/src/implementation/network.d.ts +16 -0
- package/types/apps/src/implementation/openapi-compile.d.ts +28 -7
- package/types/apps/src/implementation/openapi-document.d.ts +46 -19
- package/types/apps/src/implementation/openapi-names.d.ts +9 -4
- package/types/apps/src/implementation/openapi-request.d.ts +10 -2
- package/types/apps/src/implementation/openapi-source.d.ts +23 -1
- package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
- package/types/apps/src/implementation/operations.d.ts +57 -7
- package/types/apps/src/implementation/optimistic.d.ts +1 -1
- package/types/apps/src/implementation/placement.d.ts +60 -0
- package/types/apps/src/implementation/protocol-operations.d.ts +3 -0
- package/types/apps/src/implementation/provider-error.d.ts +28 -1
- package/types/apps/src/implementation/provider.d.ts +19 -4
- package/types/apps/src/implementation/query-commit.d.ts +1 -1
- package/types/apps/src/implementation/router-catalog.d.ts +20 -18
- package/types/apps/src/implementation/router.d.ts +24 -5
- package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
- package/types/apps/src/implementation/schedules.d.ts +39 -8
- package/types/apps/src/implementation/schema.d.ts +98 -11
- package/types/apps/src/implementation/skills.d.ts +18 -24
- package/types/apps/src/implementation/sql.d.ts +71 -0
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-auth.d.ts +1 -1
- package/types/apps/src/implementation/ui-client.d.ts +2 -2
- package/types/apps/src/implementation/ui-document.d.ts +5 -0
- package/types/apps/src/implementation/ui-errors.d.ts +1 -1
- package/types/apps/src/implementation/ui-serving.d.ts +26 -9
- package/types/apps/src/implementation/ui-watch.d.ts +1 -1
- package/types/apps/src/implementation/upstream-error.d.ts +7 -0
- package/types/apps/src/implementation/webhooks.d.ts +15 -6
- package/types/apps/src/implementation/workflow-context.d.ts +6 -2
- package/types/apps/src/implementation/workflows.d.ts +11 -4
- package/types/apps/src/index.d.ts +68 -19
- package/types/apps/src/mcp.d.ts +20 -1
- package/types/apps/src/openapi.d.ts +6 -1
- package/types/apps/src/react.d.ts +1 -1
- package/types/apps/src/skills.d.ts +10 -8
- package/types/apps/src/ui-serving.d.ts +1 -1
- package/types/telemetry/src/app-records.d.ts +42 -0
- package/types/telemetry/src/browser-operations.d.ts +2 -2
- package/types/telemetry/src/browser.d.ts +8 -3
- package/types/telemetry/src/config.d.ts +2 -2
- package/types/telemetry/src/index.d.ts +2 -1
- package/types/telemetry/src/layer.d.ts +10 -4
- package/types/telemetry/src/measurements.d.ts +1 -1
- package/types/telemetry/src/ownership.d.ts +60 -0
- package/types/telemetry/src/recorded-failure.d.ts +29 -0
- package/types/telemetry/src/relay.d.ts +16 -6
- package/types/telemetry/src/span-attributes.d.ts +17 -1
- package/types/telemetry/src/transport.d.ts +8 -1
- package/types/utils/src/api-error.d.ts +55 -0
- package/types/utils/src/connection-failure.d.ts +33 -0
- package/types/utils/src/recorded-message.d.ts +18 -0
- package/types/utils/src/user-facing-error.d.ts +83 -0
- package/js/chunk-7EK2JDX4.js +0 -299
- package/js/chunk-IKS2C5MQ.js +0 -224
- package/js/chunk-MKWZPDR6.js +0 -63
- package/js/chunk-N7YDVXYJ.js +0 -186
- package/js/chunk-NKLWZJLE.js +0 -172
- package/js/chunk-PJJ24GU7.js +0 -877
- package/js/chunk-PZB6T6KU.js +0 -19
- package/js/chunk-R3EV5FTO.js +0 -97
- package/js/chunk-SJFZCGXG.js +0 -1243
- package/js/chunk-WLE7WX2U.js +0 -2645
- package/js/chunk-YXQHV65J.js +0 -242
- package/js/chunk-ZQINWV4W.js +0 -630
- package/js/mcp/stdio.js +0 -128
- package/types/app-data/src/implementation/cursor.d.ts +0 -10
- package/types/app-data/src/implementation/index-key.d.ts +0 -7
- package/types/app-data/src/implementation/promise.d.ts +0 -68
- package/types/app-data/src/implementation/range.d.ts +0 -8
- package/types/app-data/src/implementation/schema.d.ts +0 -18
- package/types/app-data/src/implementation/sqlite.d.ts +0 -11
- package/types/app-data/src/index.d.ts +0 -4
- package/types/apps/src/contracts/storage.d.ts +0 -68
- package/types/apps/src/implementation/mcp-stdio.d.ts +0 -4
- package/types/apps/src/implementation/storage.d.ts +0 -15
- package/types/apps/src/mcp-stdio.d.ts +0 -5
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Ast,
|
|
3
|
+
Parser,
|
|
4
|
+
Stats,
|
|
5
|
+
Trace,
|
|
6
|
+
identifiers,
|
|
7
|
+
substitute_default,
|
|
8
|
+
test_default,
|
|
9
|
+
utilities
|
|
10
|
+
} from "./chunk-OD3KFKZD.js";
|
|
1
11
|
import {
|
|
2
12
|
__commonJS,
|
|
3
13
|
__export,
|
|
@@ -24,9 +34,9 @@ var require_function_bind_native = __commonJS({
|
|
|
24
34
|
"use strict";
|
|
25
35
|
var fails = require_fails();
|
|
26
36
|
module.exports = !fails(function() {
|
|
27
|
-
var
|
|
37
|
+
var test = function() {
|
|
28
38
|
}.bind();
|
|
29
|
-
return typeof
|
|
39
|
+
return typeof test != "function" || test.hasOwnProperty("prototype");
|
|
30
40
|
});
|
|
31
41
|
}
|
|
32
42
|
});
|
|
@@ -1019,9 +1029,9 @@ var require_to_string_tag_support = __commonJS({
|
|
|
1019
1029
|
"use strict";
|
|
1020
1030
|
var wellKnownSymbol = require_well_known_symbol();
|
|
1021
1031
|
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
|
|
1022
|
-
var
|
|
1023
|
-
|
|
1024
|
-
module.exports = String(
|
|
1032
|
+
var test = {};
|
|
1033
|
+
test[TO_STRING_TAG] = "z";
|
|
1034
|
+
module.exports = String(test) === "[object z]";
|
|
1025
1035
|
}
|
|
1026
1036
|
});
|
|
1027
1037
|
|
|
@@ -1359,12 +1369,12 @@ var require_object_set_prototype_of = __commonJS({
|
|
|
1359
1369
|
var aPossiblePrototype = require_a_possible_prototype();
|
|
1360
1370
|
module.exports = Object.setPrototypeOf || ("__proto__" in {} ? (function() {
|
|
1361
1371
|
var CORRECT_SETTER = false;
|
|
1362
|
-
var
|
|
1372
|
+
var test = {};
|
|
1363
1373
|
var setter;
|
|
1364
1374
|
try {
|
|
1365
1375
|
setter = uncurryThisAccessor(Object.prototype, "__proto__", "set");
|
|
1366
|
-
setter(
|
|
1367
|
-
CORRECT_SETTER =
|
|
1376
|
+
setter(test, []);
|
|
1377
|
+
CORRECT_SETTER = test instanceof Array;
|
|
1368
1378
|
} catch (error) {
|
|
1369
1379
|
}
|
|
1370
1380
|
return function setPrototypeOf(O, proto) {
|
|
@@ -2257,8 +2267,8 @@ var require_iterators_core = __commonJS({
|
|
|
2257
2267
|
}
|
|
2258
2268
|
}
|
|
2259
2269
|
var NEW_ITERATOR_PROTOTYPE = !isObject3(IteratorPrototype) || fails(function() {
|
|
2260
|
-
var
|
|
2261
|
-
return IteratorPrototype[ITERATOR].call(
|
|
2270
|
+
var test = {};
|
|
2271
|
+
return IteratorPrototype[ITERATOR].call(test) !== test;
|
|
2262
2272
|
});
|
|
2263
2273
|
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
|
|
2264
2274
|
else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
|
|
@@ -5800,12 +5810,12 @@ var require_Namespace = __commonJS({
|
|
|
5800
5810
|
* class to use when converting existing js instances into
|
|
5801
5811
|
* refract element.
|
|
5802
5812
|
*/
|
|
5803
|
-
detect(
|
|
5813
|
+
detect(test, ElementClass, givenPrepend) {
|
|
5804
5814
|
const prepend = givenPrepend === void 0 ? true : givenPrepend;
|
|
5805
5815
|
if (prepend) {
|
|
5806
|
-
this.elementDetection.unshift([
|
|
5816
|
+
this.elementDetection.unshift([test, ElementClass]);
|
|
5807
5817
|
} else {
|
|
5808
|
-
this.elementDetection.push([
|
|
5818
|
+
this.elementDetection.push([test, ElementClass]);
|
|
5809
5819
|
}
|
|
5810
5820
|
return this;
|
|
5811
5821
|
}
|
|
@@ -5821,9 +5831,9 @@ var require_Namespace = __commonJS({
|
|
|
5821
5831
|
}
|
|
5822
5832
|
let element;
|
|
5823
5833
|
for (let i = 0; i < this.elementDetection.length; i += 1) {
|
|
5824
|
-
const
|
|
5834
|
+
const test = this.elementDetection[i][0];
|
|
5825
5835
|
const ElementClass = this.elementDetection[i][1];
|
|
5826
|
-
if (
|
|
5836
|
+
if (test(value)) {
|
|
5827
5837
|
element = new ElementClass(value);
|
|
5828
5838
|
break;
|
|
5829
5839
|
}
|
|
@@ -17889,7 +17899,7 @@ var dereferenceApiDOM = async (element, options) => {
|
|
|
17889
17899
|
};
|
|
17890
17900
|
|
|
17891
17901
|
// ../../node_modules/.bun/@swagger-api+apidom-reference@1.11.6/node_modules/@swagger-api/apidom-reference/src/parse/parsers/Parser.mjs
|
|
17892
|
-
var
|
|
17902
|
+
var Parser2 = class {
|
|
17893
17903
|
name;
|
|
17894
17904
|
/**
|
|
17895
17905
|
* Whether to allow "empty" files. This includes zero-byte files.
|
|
@@ -17921,7 +17931,7 @@ var Parser = class {
|
|
|
17921
17931
|
this.mediaTypes = mediaTypes3;
|
|
17922
17932
|
}
|
|
17923
17933
|
};
|
|
17924
|
-
var Parser_default =
|
|
17934
|
+
var Parser_default = Parser2;
|
|
17925
17935
|
|
|
17926
17936
|
// ../../node_modules/.bun/@swagger-api+apidom-reference@1.11.6/node_modules/@swagger-api/apidom-reference/src/resolve/resolvers/Resolver.mjs
|
|
17927
17937
|
var Resolver = class {
|
|
@@ -19914,1106 +19924,6 @@ function grammar() {
|
|
|
19914
19924
|
};
|
|
19915
19925
|
}
|
|
19916
19926
|
|
|
19917
|
-
// ../../node_modules/.bun/apg-lite@1.0.5/node_modules/apg-lite/lib/parser.js
|
|
19918
|
-
var Parser2 = function fnparser() {
|
|
19919
|
-
const id = identifiers;
|
|
19920
|
-
const utils = utilities;
|
|
19921
|
-
const p = this;
|
|
19922
|
-
const thisFileName = "parser.js: Parser(): ";
|
|
19923
|
-
const systemData = function systemData2() {
|
|
19924
|
-
this.state = id.ACTIVE;
|
|
19925
|
-
this.phraseLength = 0;
|
|
19926
|
-
this.refresh = () => {
|
|
19927
|
-
this.state = id.ACTIVE;
|
|
19928
|
-
this.phraseLength = 0;
|
|
19929
|
-
};
|
|
19930
|
-
};
|
|
19931
|
-
p.ast = void 0;
|
|
19932
|
-
p.stats = void 0;
|
|
19933
|
-
p.trace = void 0;
|
|
19934
|
-
p.callbacks = [];
|
|
19935
|
-
let lookAhead = 0;
|
|
19936
|
-
let treeDepth = 0;
|
|
19937
|
-
let maxTreeDepth = 0;
|
|
19938
|
-
let nodeHits = 0;
|
|
19939
|
-
let maxMatched = 0;
|
|
19940
|
-
let rules = void 0;
|
|
19941
|
-
let udts = void 0;
|
|
19942
|
-
let opcodes = void 0;
|
|
19943
|
-
let chars = void 0;
|
|
19944
|
-
let sysData = new systemData();
|
|
19945
|
-
let ruleCallbacks = void 0;
|
|
19946
|
-
let udtCallbacks = void 0;
|
|
19947
|
-
let userData = void 0;
|
|
19948
|
-
const clear = () => {
|
|
19949
|
-
lookAhead = 0;
|
|
19950
|
-
treeDepth = 0;
|
|
19951
|
-
maxTreeDepth = 0;
|
|
19952
|
-
nodeHits = 0;
|
|
19953
|
-
maxMatched = 0;
|
|
19954
|
-
rules = void 0;
|
|
19955
|
-
udts = void 0;
|
|
19956
|
-
opcodes = void 0;
|
|
19957
|
-
chars = void 0;
|
|
19958
|
-
sysData.refresh();
|
|
19959
|
-
ruleCallbacks = void 0;
|
|
19960
|
-
udtCallbacks = void 0;
|
|
19961
|
-
userData = void 0;
|
|
19962
|
-
};
|
|
19963
|
-
const initializeCallbacks = () => {
|
|
19964
|
-
const functionName = `${thisFileName}initializeCallbacks(): `;
|
|
19965
|
-
let i;
|
|
19966
|
-
ruleCallbacks = [];
|
|
19967
|
-
udtCallbacks = [];
|
|
19968
|
-
for (i = 0; i < rules.length; i += 1) {
|
|
19969
|
-
ruleCallbacks[i] = void 0;
|
|
19970
|
-
}
|
|
19971
|
-
for (i = 0; i < udts.length; i += 1) {
|
|
19972
|
-
udtCallbacks[i] = void 0;
|
|
19973
|
-
}
|
|
19974
|
-
let func;
|
|
19975
|
-
const list = [];
|
|
19976
|
-
for (i = 0; i < rules.length; i += 1) {
|
|
19977
|
-
list.push(rules[i].lower);
|
|
19978
|
-
}
|
|
19979
|
-
for (i = 0; i < udts.length; i += 1) {
|
|
19980
|
-
list.push(udts[i].lower);
|
|
19981
|
-
}
|
|
19982
|
-
for (const index in p.callbacks) {
|
|
19983
|
-
if (p.callbacks.hasOwnProperty(index)) {
|
|
19984
|
-
i = list.indexOf(index.toLowerCase());
|
|
19985
|
-
if (i < 0) {
|
|
19986
|
-
throw new Error(`${functionName}syntax callback '${index}' not a rule or udt name`);
|
|
19987
|
-
}
|
|
19988
|
-
func = p.callbacks[index] ? p.callbacks[index] : void 0;
|
|
19989
|
-
if (typeof func === "function" || func === void 0) {
|
|
19990
|
-
if (i < rules.length) {
|
|
19991
|
-
ruleCallbacks[i] = func;
|
|
19992
|
-
} else {
|
|
19993
|
-
udtCallbacks[i - rules.length] = func;
|
|
19994
|
-
}
|
|
19995
|
-
} else {
|
|
19996
|
-
throw new Error(`${functionName}syntax callback[${index}] must be function reference or falsy)`);
|
|
19997
|
-
}
|
|
19998
|
-
}
|
|
19999
|
-
}
|
|
20000
|
-
};
|
|
20001
|
-
p.parse = (grammar18, startName, inputString, callbackData) => {
|
|
20002
|
-
const functionName = `${thisFileName}parse(): `;
|
|
20003
|
-
clear();
|
|
20004
|
-
chars = utils.stringToChars(inputString);
|
|
20005
|
-
rules = grammar18.rules;
|
|
20006
|
-
udts = grammar18.udts;
|
|
20007
|
-
const lower = startName.toLowerCase();
|
|
20008
|
-
let startIndex = void 0;
|
|
20009
|
-
for (const i in rules) {
|
|
20010
|
-
if (rules.hasOwnProperty(i)) {
|
|
20011
|
-
if (lower === rules[i].lower) {
|
|
20012
|
-
startIndex = rules[i].index;
|
|
20013
|
-
break;
|
|
20014
|
-
}
|
|
20015
|
-
}
|
|
20016
|
-
}
|
|
20017
|
-
if (startIndex === void 0) {
|
|
20018
|
-
throw new Error(`${functionName}start rule name '${startRule}' not recognized`);
|
|
20019
|
-
}
|
|
20020
|
-
initializeCallbacks();
|
|
20021
|
-
if (p.trace) {
|
|
20022
|
-
p.trace.init(rules, udts, chars);
|
|
20023
|
-
}
|
|
20024
|
-
if (p.stats) {
|
|
20025
|
-
p.stats.init(rules, udts);
|
|
20026
|
-
}
|
|
20027
|
-
if (p.ast) {
|
|
20028
|
-
p.ast.init(rules, udts, chars);
|
|
20029
|
-
}
|
|
20030
|
-
userData = callbackData;
|
|
20031
|
-
opcodes = [
|
|
20032
|
-
{
|
|
20033
|
-
type: id.RNM,
|
|
20034
|
-
index: startIndex
|
|
20035
|
-
}
|
|
20036
|
-
];
|
|
20037
|
-
opExecute(0, 0);
|
|
20038
|
-
opcodes = void 0;
|
|
20039
|
-
let success = false;
|
|
20040
|
-
switch (sysData.state) {
|
|
20041
|
-
case id.ACTIVE:
|
|
20042
|
-
throw new Error(`${functionName}final state should never be 'ACTIVE'`);
|
|
20043
|
-
case id.NOMATCH:
|
|
20044
|
-
success = false;
|
|
20045
|
-
break;
|
|
20046
|
-
case id.EMPTY:
|
|
20047
|
-
case id.MATCH:
|
|
20048
|
-
if (sysData.phraseLength === chars.length) {
|
|
20049
|
-
success = true;
|
|
20050
|
-
} else {
|
|
20051
|
-
success = false;
|
|
20052
|
-
}
|
|
20053
|
-
break;
|
|
20054
|
-
default:
|
|
20055
|
-
throw new Error("unrecognized state");
|
|
20056
|
-
}
|
|
20057
|
-
return {
|
|
20058
|
-
success,
|
|
20059
|
-
state: sysData.state,
|
|
20060
|
-
stateName: id.idName(sysData.state),
|
|
20061
|
-
length: chars.length,
|
|
20062
|
-
matched: sysData.phraseLength,
|
|
20063
|
-
maxMatched,
|
|
20064
|
-
maxTreeDepth,
|
|
20065
|
-
nodeHits
|
|
20066
|
-
};
|
|
20067
|
-
};
|
|
20068
|
-
const opALT = (opIndex, phraseIndex) => {
|
|
20069
|
-
const op = opcodes[opIndex];
|
|
20070
|
-
for (let i = 0; i < op.children.length; i += 1) {
|
|
20071
|
-
opExecute(op.children[i], phraseIndex);
|
|
20072
|
-
if (sysData.state !== id.NOMATCH) {
|
|
20073
|
-
break;
|
|
20074
|
-
}
|
|
20075
|
-
}
|
|
20076
|
-
};
|
|
20077
|
-
const opCAT = (opIndex, phraseIndex) => {
|
|
20078
|
-
let success;
|
|
20079
|
-
let astLength;
|
|
20080
|
-
let catCharIndex;
|
|
20081
|
-
let catPhrase;
|
|
20082
|
-
const op = opcodes[opIndex];
|
|
20083
|
-
if (p.ast) {
|
|
20084
|
-
astLength = p.ast.getLength();
|
|
20085
|
-
}
|
|
20086
|
-
success = true;
|
|
20087
|
-
catCharIndex = phraseIndex;
|
|
20088
|
-
catPhrase = 0;
|
|
20089
|
-
for (let i = 0; i < op.children.length; i += 1) {
|
|
20090
|
-
opExecute(op.children[i], catCharIndex);
|
|
20091
|
-
if (sysData.state === id.NOMATCH) {
|
|
20092
|
-
success = false;
|
|
20093
|
-
break;
|
|
20094
|
-
} else {
|
|
20095
|
-
catCharIndex += sysData.phraseLength;
|
|
20096
|
-
catPhrase += sysData.phraseLength;
|
|
20097
|
-
}
|
|
20098
|
-
}
|
|
20099
|
-
if (success) {
|
|
20100
|
-
sysData.state = catPhrase === 0 ? id.EMPTY : id.MATCH;
|
|
20101
|
-
sysData.phraseLength = catPhrase;
|
|
20102
|
-
} else {
|
|
20103
|
-
sysData.state = id.NOMATCH;
|
|
20104
|
-
sysData.phraseLength = 0;
|
|
20105
|
-
if (p.ast) {
|
|
20106
|
-
p.ast.setLength(astLength);
|
|
20107
|
-
}
|
|
20108
|
-
}
|
|
20109
|
-
};
|
|
20110
|
-
const opREP = (opIndex, phraseIndex) => {
|
|
20111
|
-
let astLength;
|
|
20112
|
-
let repCharIndex;
|
|
20113
|
-
let repPhrase;
|
|
20114
|
-
let repCount;
|
|
20115
|
-
const op = opcodes[opIndex];
|
|
20116
|
-
if (op.max === 0) {
|
|
20117
|
-
sysData.state = id.EMPTY;
|
|
20118
|
-
sysData.phraseLength = 0;
|
|
20119
|
-
return;
|
|
20120
|
-
}
|
|
20121
|
-
repCharIndex = phraseIndex;
|
|
20122
|
-
repPhrase = 0;
|
|
20123
|
-
repCount = 0;
|
|
20124
|
-
if (p.ast) {
|
|
20125
|
-
astLength = p.ast.getLength();
|
|
20126
|
-
}
|
|
20127
|
-
while (1) {
|
|
20128
|
-
if (repCharIndex >= chars.length) {
|
|
20129
|
-
break;
|
|
20130
|
-
}
|
|
20131
|
-
opExecute(opIndex + 1, repCharIndex);
|
|
20132
|
-
if (sysData.state === id.NOMATCH) {
|
|
20133
|
-
break;
|
|
20134
|
-
}
|
|
20135
|
-
if (sysData.state === id.EMPTY) {
|
|
20136
|
-
break;
|
|
20137
|
-
}
|
|
20138
|
-
repCount += 1;
|
|
20139
|
-
repPhrase += sysData.phraseLength;
|
|
20140
|
-
repCharIndex += sysData.phraseLength;
|
|
20141
|
-
if (repCount === op.max) {
|
|
20142
|
-
break;
|
|
20143
|
-
}
|
|
20144
|
-
}
|
|
20145
|
-
if (sysData.state === id.EMPTY) {
|
|
20146
|
-
sysData.state = repPhrase === 0 ? id.EMPTY : id.MATCH;
|
|
20147
|
-
sysData.phraseLength = repPhrase;
|
|
20148
|
-
} else if (repCount >= op.min) {
|
|
20149
|
-
sysData.state = repPhrase === 0 ? id.EMPTY : id.MATCH;
|
|
20150
|
-
sysData.phraseLength = repPhrase;
|
|
20151
|
-
} else {
|
|
20152
|
-
sysData.state = id.NOMATCH;
|
|
20153
|
-
sysData.phraseLength = 0;
|
|
20154
|
-
if (p.ast) {
|
|
20155
|
-
p.ast.setLength(astLength);
|
|
20156
|
-
}
|
|
20157
|
-
}
|
|
20158
|
-
};
|
|
20159
|
-
const validateRnmCallbackResult = (rule, sysData2, charsLeft, down) => {
|
|
20160
|
-
if (sysData2.phraseLength > charsLeft) {
|
|
20161
|
-
let str2 = `${thisFileName}opRNM(${rule.name}): callback function error: `;
|
|
20162
|
-
str2 += `sysData.phraseLength: ${sysData2.phraseLength}`;
|
|
20163
|
-
str2 += ` must be <= remaining chars: ${charsLeft}`;
|
|
20164
|
-
throw new Error(str2);
|
|
20165
|
-
}
|
|
20166
|
-
switch (sysData2.state) {
|
|
20167
|
-
case id.ACTIVE:
|
|
20168
|
-
if (!down) {
|
|
20169
|
-
throw new Error(
|
|
20170
|
-
`${thisFileName}opRNM(${rule.name}): callback function return error. ACTIVE state not allowed.`
|
|
20171
|
-
);
|
|
20172
|
-
}
|
|
20173
|
-
break;
|
|
20174
|
-
case id.EMPTY:
|
|
20175
|
-
sysData2.phraseLength = 0;
|
|
20176
|
-
break;
|
|
20177
|
-
case id.MATCH:
|
|
20178
|
-
if (sysData2.phraseLength === 0) {
|
|
20179
|
-
sysData2.state = id.EMPTY;
|
|
20180
|
-
}
|
|
20181
|
-
break;
|
|
20182
|
-
case id.NOMATCH:
|
|
20183
|
-
sysData2.phraseLength = 0;
|
|
20184
|
-
break;
|
|
20185
|
-
default:
|
|
20186
|
-
throw new Error(
|
|
20187
|
-
`${thisFileName}opRNM(${rule.name}): callback function return error. Unrecognized return state: ${sysData2.state}`
|
|
20188
|
-
);
|
|
20189
|
-
}
|
|
20190
|
-
};
|
|
20191
|
-
const opRNM = (opIndex, phraseIndex) => {
|
|
20192
|
-
let astLength;
|
|
20193
|
-
let astDefined;
|
|
20194
|
-
let savedOpcodes;
|
|
20195
|
-
const op = opcodes[opIndex];
|
|
20196
|
-
const rule = rules[op.index];
|
|
20197
|
-
const callback = ruleCallbacks[rule.index];
|
|
20198
|
-
if (!lookAhead) {
|
|
20199
|
-
astDefined = p.ast && p.ast.ruleDefined(op.index);
|
|
20200
|
-
if (astDefined) {
|
|
20201
|
-
astLength = p.ast.getLength();
|
|
20202
|
-
p.ast.down(op.index, rules[op.index].name);
|
|
20203
|
-
}
|
|
20204
|
-
}
|
|
20205
|
-
if (callback) {
|
|
20206
|
-
const charsLeft = chars.length - phraseIndex;
|
|
20207
|
-
callback(sysData, chars, phraseIndex, userData);
|
|
20208
|
-
validateRnmCallbackResult(rule, sysData, charsLeft, true);
|
|
20209
|
-
if (sysData.state === id.ACTIVE) {
|
|
20210
|
-
savedOpcodes = opcodes;
|
|
20211
|
-
opcodes = rule.opcodes;
|
|
20212
|
-
opExecute(0, phraseIndex);
|
|
20213
|
-
opcodes = savedOpcodes;
|
|
20214
|
-
callback(sysData, chars, phraseIndex, userData);
|
|
20215
|
-
validateRnmCallbackResult(rule, sysData, charsLeft, false);
|
|
20216
|
-
}
|
|
20217
|
-
} else {
|
|
20218
|
-
savedOpcodes = opcodes;
|
|
20219
|
-
opcodes = rule.opcodes;
|
|
20220
|
-
opExecute(0, phraseIndex, sysData);
|
|
20221
|
-
opcodes = savedOpcodes;
|
|
20222
|
-
}
|
|
20223
|
-
if (!lookAhead) {
|
|
20224
|
-
if (astDefined) {
|
|
20225
|
-
if (sysData.state === id.NOMATCH) {
|
|
20226
|
-
p.ast.setLength(astLength);
|
|
20227
|
-
} else {
|
|
20228
|
-
p.ast.up(op.index, rule.name, phraseIndex, sysData.phraseLength);
|
|
20229
|
-
}
|
|
20230
|
-
}
|
|
20231
|
-
}
|
|
20232
|
-
};
|
|
20233
|
-
const opTRG = (opIndex, phraseIndex) => {
|
|
20234
|
-
const op = opcodes[opIndex];
|
|
20235
|
-
sysData.state = id.NOMATCH;
|
|
20236
|
-
if (phraseIndex < chars.length) {
|
|
20237
|
-
if (op.min <= chars[phraseIndex] && chars[phraseIndex] <= op.max) {
|
|
20238
|
-
sysData.state = id.MATCH;
|
|
20239
|
-
sysData.phraseLength = 1;
|
|
20240
|
-
}
|
|
20241
|
-
}
|
|
20242
|
-
};
|
|
20243
|
-
const opTBS = (opIndex, phraseIndex) => {
|
|
20244
|
-
const op = opcodes[opIndex];
|
|
20245
|
-
const len = op.string.length;
|
|
20246
|
-
sysData.state = id.NOMATCH;
|
|
20247
|
-
if (phraseIndex + len <= chars.length) {
|
|
20248
|
-
for (let i = 0; i < len; i += 1) {
|
|
20249
|
-
if (chars[phraseIndex + i] !== op.string[i]) {
|
|
20250
|
-
return;
|
|
20251
|
-
}
|
|
20252
|
-
}
|
|
20253
|
-
sysData.state = id.MATCH;
|
|
20254
|
-
sysData.phraseLength = len;
|
|
20255
|
-
}
|
|
20256
|
-
};
|
|
20257
|
-
const opTLS = (opIndex, phraseIndex) => {
|
|
20258
|
-
let code;
|
|
20259
|
-
const op = opcodes[opIndex];
|
|
20260
|
-
sysData.state = id.NOMATCH;
|
|
20261
|
-
const len = op.string.length;
|
|
20262
|
-
if (len === 0) {
|
|
20263
|
-
sysData.state = id.EMPTY;
|
|
20264
|
-
return;
|
|
20265
|
-
}
|
|
20266
|
-
if (phraseIndex + len <= chars.length) {
|
|
20267
|
-
for (let i = 0; i < len; i += 1) {
|
|
20268
|
-
code = chars[phraseIndex + i];
|
|
20269
|
-
if (code >= 65 && code <= 90) {
|
|
20270
|
-
code += 32;
|
|
20271
|
-
}
|
|
20272
|
-
if (code !== op.string[i]) {
|
|
20273
|
-
return;
|
|
20274
|
-
}
|
|
20275
|
-
}
|
|
20276
|
-
sysData.state = id.MATCH;
|
|
20277
|
-
sysData.phraseLength = len;
|
|
20278
|
-
}
|
|
20279
|
-
};
|
|
20280
|
-
const validateUdtCallbackResult = (udt, sysData2, charsLeft) => {
|
|
20281
|
-
if (sysData2.phraseLength > charsLeft) {
|
|
20282
|
-
let str2 = `${thisFileName}opUDT(${udt.name}): callback function error: `;
|
|
20283
|
-
str2 += `sysData.phraseLength: ${sysData2.phraseLength}`;
|
|
20284
|
-
str2 += ` must be <= remaining chars: ${charsLeft}`;
|
|
20285
|
-
throw new Error(str2);
|
|
20286
|
-
}
|
|
20287
|
-
switch (sysData2.state) {
|
|
20288
|
-
case id.ACTIVE:
|
|
20289
|
-
throw new Error(`${thisFileName}opUDT(${udt.name}) ACTIVE state return not allowed.`);
|
|
20290
|
-
case id.EMPTY:
|
|
20291
|
-
if (udt.empty) {
|
|
20292
|
-
sysData2.phraseLength = 0;
|
|
20293
|
-
} else {
|
|
20294
|
-
throw new Error(`${thisFileName}opUDT(${udt.name}) may not return EMPTY.`);
|
|
20295
|
-
}
|
|
20296
|
-
break;
|
|
20297
|
-
case id.MATCH:
|
|
20298
|
-
if (sysData2.phraseLength === 0) {
|
|
20299
|
-
if (udt.empty) {
|
|
20300
|
-
sysData2.state = id.EMPTY;
|
|
20301
|
-
} else {
|
|
20302
|
-
throw new Error(`${thisFileName}opUDT(${udt.name}) may not return EMPTY.`);
|
|
20303
|
-
}
|
|
20304
|
-
}
|
|
20305
|
-
break;
|
|
20306
|
-
case id.NOMATCH:
|
|
20307
|
-
sysData2.phraseLength = 0;
|
|
20308
|
-
break;
|
|
20309
|
-
default:
|
|
20310
|
-
throw new Error(
|
|
20311
|
-
`${thisFileName}opUDT(${udt.name}): callback function return error. Unrecognized return state: ${sysData2.state}`
|
|
20312
|
-
);
|
|
20313
|
-
}
|
|
20314
|
-
};
|
|
20315
|
-
const opUDT = (opIndex, phraseIndex) => {
|
|
20316
|
-
let astLength;
|
|
20317
|
-
let astIndex;
|
|
20318
|
-
let astDefined;
|
|
20319
|
-
const op = opcodes[opIndex];
|
|
20320
|
-
const udt = udts[op.index];
|
|
20321
|
-
sysData.UdtIndex = udt.index;
|
|
20322
|
-
if (!lookAhead) {
|
|
20323
|
-
astDefined = p.ast && p.ast.udtDefined(op.index);
|
|
20324
|
-
if (astDefined) {
|
|
20325
|
-
astIndex = rules.length + op.index;
|
|
20326
|
-
astLength = p.ast.getLength();
|
|
20327
|
-
p.ast.down(astIndex, udt.name);
|
|
20328
|
-
}
|
|
20329
|
-
}
|
|
20330
|
-
const charsLeft = chars.length - phraseIndex;
|
|
20331
|
-
udtCallbacks[op.index](sysData, chars, phraseIndex, userData);
|
|
20332
|
-
validateUdtCallbackResult(udt, sysData, charsLeft);
|
|
20333
|
-
if (!lookAhead) {
|
|
20334
|
-
if (astDefined) {
|
|
20335
|
-
if (sysData.state === id.NOMATCH) {
|
|
20336
|
-
p.ast.setLength(astLength);
|
|
20337
|
-
} else {
|
|
20338
|
-
p.ast.up(astIndex, udt.name, phraseIndex, sysData.phraseLength);
|
|
20339
|
-
}
|
|
20340
|
-
}
|
|
20341
|
-
}
|
|
20342
|
-
};
|
|
20343
|
-
const opAND = (opIndex, phraseIndex) => {
|
|
20344
|
-
lookAhead += 1;
|
|
20345
|
-
opExecute(opIndex + 1, phraseIndex);
|
|
20346
|
-
lookAhead -= 1;
|
|
20347
|
-
sysData.phraseLength = 0;
|
|
20348
|
-
switch (sysData.state) {
|
|
20349
|
-
case id.EMPTY:
|
|
20350
|
-
sysData.state = id.EMPTY;
|
|
20351
|
-
break;
|
|
20352
|
-
case id.MATCH:
|
|
20353
|
-
sysData.state = id.EMPTY;
|
|
20354
|
-
break;
|
|
20355
|
-
case id.NOMATCH:
|
|
20356
|
-
sysData.state = id.NOMATCH;
|
|
20357
|
-
break;
|
|
20358
|
-
default:
|
|
20359
|
-
throw new Error(`opAND: invalid state ${sysData.state}`);
|
|
20360
|
-
}
|
|
20361
|
-
};
|
|
20362
|
-
const opNOT = (opIndex, phraseIndex) => {
|
|
20363
|
-
lookAhead += 1;
|
|
20364
|
-
opExecute(opIndex + 1, phraseIndex);
|
|
20365
|
-
lookAhead -= 1;
|
|
20366
|
-
sysData.phraseLength = 0;
|
|
20367
|
-
switch (sysData.state) {
|
|
20368
|
-
case id.EMPTY:
|
|
20369
|
-
case id.MATCH:
|
|
20370
|
-
sysData.state = id.NOMATCH;
|
|
20371
|
-
break;
|
|
20372
|
-
case id.NOMATCH:
|
|
20373
|
-
sysData.state = id.EMPTY;
|
|
20374
|
-
break;
|
|
20375
|
-
default:
|
|
20376
|
-
throw new Error(`opNOT: invalid state ${sysData.state}`);
|
|
20377
|
-
}
|
|
20378
|
-
};
|
|
20379
|
-
const opExecute = (opIndex, phraseIndex) => {
|
|
20380
|
-
const functionName = `${thisFileName}opExecute(): `;
|
|
20381
|
-
const op = opcodes[opIndex];
|
|
20382
|
-
nodeHits += 1;
|
|
20383
|
-
if (treeDepth > maxTreeDepth) {
|
|
20384
|
-
maxTreeDepth = treeDepth;
|
|
20385
|
-
}
|
|
20386
|
-
treeDepth += 1;
|
|
20387
|
-
sysData.refresh();
|
|
20388
|
-
if (p.trace) {
|
|
20389
|
-
p.trace.down(op, phraseIndex);
|
|
20390
|
-
}
|
|
20391
|
-
switch (op.type) {
|
|
20392
|
-
case id.ALT:
|
|
20393
|
-
opALT(opIndex, phraseIndex);
|
|
20394
|
-
break;
|
|
20395
|
-
case id.CAT:
|
|
20396
|
-
opCAT(opIndex, phraseIndex);
|
|
20397
|
-
break;
|
|
20398
|
-
case id.REP:
|
|
20399
|
-
opREP(opIndex, phraseIndex);
|
|
20400
|
-
break;
|
|
20401
|
-
case id.RNM:
|
|
20402
|
-
opRNM(opIndex, phraseIndex);
|
|
20403
|
-
break;
|
|
20404
|
-
case id.TRG:
|
|
20405
|
-
opTRG(opIndex, phraseIndex);
|
|
20406
|
-
break;
|
|
20407
|
-
case id.TBS:
|
|
20408
|
-
opTBS(opIndex, phraseIndex);
|
|
20409
|
-
break;
|
|
20410
|
-
case id.TLS:
|
|
20411
|
-
opTLS(opIndex, phraseIndex);
|
|
20412
|
-
break;
|
|
20413
|
-
case id.UDT:
|
|
20414
|
-
opUDT(opIndex, phraseIndex);
|
|
20415
|
-
break;
|
|
20416
|
-
case id.AND:
|
|
20417
|
-
opAND(opIndex, phraseIndex);
|
|
20418
|
-
break;
|
|
20419
|
-
case id.NOT:
|
|
20420
|
-
opNOT(opIndex, phraseIndex);
|
|
20421
|
-
break;
|
|
20422
|
-
default:
|
|
20423
|
-
throw new Error(`${functionName}unrecognized operator`);
|
|
20424
|
-
}
|
|
20425
|
-
if (!lookAhead) {
|
|
20426
|
-
if (phraseIndex + sysData.phraseLength > maxMatched) {
|
|
20427
|
-
maxMatched = phraseIndex + sysData.phraseLength;
|
|
20428
|
-
}
|
|
20429
|
-
}
|
|
20430
|
-
if (p.stats) {
|
|
20431
|
-
p.stats.collect(op, sysData);
|
|
20432
|
-
}
|
|
20433
|
-
if (p.trace) {
|
|
20434
|
-
p.trace.up(op, sysData.state, phraseIndex, sysData.phraseLength);
|
|
20435
|
-
}
|
|
20436
|
-
treeDepth -= 1;
|
|
20437
|
-
};
|
|
20438
|
-
};
|
|
20439
|
-
var Ast = function fnast() {
|
|
20440
|
-
const thisFileName = "parser.js: Ast()): ";
|
|
20441
|
-
const id = identifiers;
|
|
20442
|
-
const utils = utilities;
|
|
20443
|
-
const a = this;
|
|
20444
|
-
let rules = void 0;
|
|
20445
|
-
let udts = void 0;
|
|
20446
|
-
let chars = void 0;
|
|
20447
|
-
let nodeCount = 0;
|
|
20448
|
-
const nodeCallbacks = [];
|
|
20449
|
-
const stack = [];
|
|
20450
|
-
const records = [];
|
|
20451
|
-
a.callbacks = [];
|
|
20452
|
-
a.init = (rulesIn, udtsIn, charsIn) => {
|
|
20453
|
-
stack.length = 0;
|
|
20454
|
-
records.length = 0;
|
|
20455
|
-
nodeCount = 0;
|
|
20456
|
-
rules = rulesIn;
|
|
20457
|
-
udts = udtsIn;
|
|
20458
|
-
chars = charsIn;
|
|
20459
|
-
let i;
|
|
20460
|
-
const list = [];
|
|
20461
|
-
for (i = 0; i < rules.length; i += 1) {
|
|
20462
|
-
list.push(rules[i].lower);
|
|
20463
|
-
}
|
|
20464
|
-
for (i = 0; i < udts.length; i += 1) {
|
|
20465
|
-
list.push(udts[i].lower);
|
|
20466
|
-
}
|
|
20467
|
-
nodeCount = rules.length + udts.length;
|
|
20468
|
-
for (i = 0; i < nodeCount; i += 1) {
|
|
20469
|
-
nodeCallbacks[i] = void 0;
|
|
20470
|
-
}
|
|
20471
|
-
for (const index in a.callbacks) {
|
|
20472
|
-
if (a.callbacks.hasOwnProperty(index)) {
|
|
20473
|
-
const lower = index.toLowerCase();
|
|
20474
|
-
i = list.indexOf(lower);
|
|
20475
|
-
if (i < 0) {
|
|
20476
|
-
throw new Error(`${thisFileName}init: node '${index}' not a rule or udt name`);
|
|
20477
|
-
}
|
|
20478
|
-
nodeCallbacks[i] = a.callbacks[index];
|
|
20479
|
-
}
|
|
20480
|
-
}
|
|
20481
|
-
};
|
|
20482
|
-
a.ruleDefined = (index) => !!nodeCallbacks[index];
|
|
20483
|
-
a.udtDefined = (index) => !!nodeCallbacks[rules.length + index];
|
|
20484
|
-
a.down = (callbackIndex, name) => {
|
|
20485
|
-
const thisIndex = records.length;
|
|
20486
|
-
stack.push(thisIndex);
|
|
20487
|
-
records.push({
|
|
20488
|
-
name,
|
|
20489
|
-
thisIndex,
|
|
20490
|
-
thatIndex: void 0,
|
|
20491
|
-
state: id.SEM_PRE,
|
|
20492
|
-
callbackIndex,
|
|
20493
|
-
phraseIndex: void 0,
|
|
20494
|
-
phraseLength: void 0,
|
|
20495
|
-
stack: stack.length
|
|
20496
|
-
});
|
|
20497
|
-
return thisIndex;
|
|
20498
|
-
};
|
|
20499
|
-
a.up = (callbackIndex, name, phraseIndex, phraseLength) => {
|
|
20500
|
-
const thisIndex = records.length;
|
|
20501
|
-
const thatIndex = stack.pop();
|
|
20502
|
-
records.push({
|
|
20503
|
-
name,
|
|
20504
|
-
thisIndex,
|
|
20505
|
-
thatIndex,
|
|
20506
|
-
state: id.SEM_POST,
|
|
20507
|
-
callbackIndex,
|
|
20508
|
-
phraseIndex,
|
|
20509
|
-
phraseLength,
|
|
20510
|
-
stack: stack.length
|
|
20511
|
-
});
|
|
20512
|
-
records[thatIndex].thatIndex = thisIndex;
|
|
20513
|
-
records[thatIndex].phraseIndex = phraseIndex;
|
|
20514
|
-
records[thatIndex].phraseLength = phraseLength;
|
|
20515
|
-
return thisIndex;
|
|
20516
|
-
};
|
|
20517
|
-
a.translate = (data) => {
|
|
20518
|
-
let ret;
|
|
20519
|
-
let callback;
|
|
20520
|
-
let record;
|
|
20521
|
-
for (let i = 0; i < records.length; i += 1) {
|
|
20522
|
-
record = records[i];
|
|
20523
|
-
callback = nodeCallbacks[record.callbackIndex];
|
|
20524
|
-
if (callback) {
|
|
20525
|
-
if (record.state === id.SEM_PRE) {
|
|
20526
|
-
callback(id.SEM_PRE, chars, record.phraseIndex, record.phraseLength, data);
|
|
20527
|
-
} else if (callback) {
|
|
20528
|
-
callback(id.SEM_POST, chars, record.phraseIndex, record.phraseLength, data);
|
|
20529
|
-
}
|
|
20530
|
-
}
|
|
20531
|
-
}
|
|
20532
|
-
};
|
|
20533
|
-
a.setLength = (length) => {
|
|
20534
|
-
records.length = length;
|
|
20535
|
-
if (length > 0) {
|
|
20536
|
-
stack.length = records[length - 1].stack;
|
|
20537
|
-
} else {
|
|
20538
|
-
stack.length = 0;
|
|
20539
|
-
}
|
|
20540
|
-
};
|
|
20541
|
-
a.getLength = () => records.length;
|
|
20542
|
-
function indent(n) {
|
|
20543
|
-
let ret = "";
|
|
20544
|
-
while (n-- > 0) {
|
|
20545
|
-
ret += " ";
|
|
20546
|
-
}
|
|
20547
|
-
return ret;
|
|
20548
|
-
}
|
|
20549
|
-
a.toXml = () => {
|
|
20550
|
-
let xml = "";
|
|
20551
|
-
let depth = 0;
|
|
20552
|
-
xml += '<?xml version="1.0" encoding="utf-8"?>\n';
|
|
20553
|
-
xml += `<root nodes="${records.length / 2}" characters="${chars.length}">
|
|
20554
|
-
`;
|
|
20555
|
-
xml += `<!-- input string -->
|
|
20556
|
-
`;
|
|
20557
|
-
xml += indent(depth + 2);
|
|
20558
|
-
xml += utils.charsToString(chars);
|
|
20559
|
-
xml += "\n";
|
|
20560
|
-
records.forEach((rec) => {
|
|
20561
|
-
if (rec.state === id.SEM_PRE) {
|
|
20562
|
-
depth += 1;
|
|
20563
|
-
xml += indent(depth);
|
|
20564
|
-
xml += `<node name="${rec.name}" index="${rec.phraseIndex}" length="${rec.phraseLength}">
|
|
20565
|
-
`;
|
|
20566
|
-
xml += indent(depth + 2);
|
|
20567
|
-
xml += utils.charsToString(chars, rec.phraseIndex, rec.phraseLength);
|
|
20568
|
-
xml += "\n";
|
|
20569
|
-
} else {
|
|
20570
|
-
xml += indent(depth);
|
|
20571
|
-
xml += `</node><!-- name="${rec.name}" -->
|
|
20572
|
-
`;
|
|
20573
|
-
depth -= 1;
|
|
20574
|
-
}
|
|
20575
|
-
});
|
|
20576
|
-
xml += "</root>\n";
|
|
20577
|
-
return xml;
|
|
20578
|
-
};
|
|
20579
|
-
};
|
|
20580
|
-
var Trace = function fntrace() {
|
|
20581
|
-
const id = identifiers;
|
|
20582
|
-
const utils = utilities;
|
|
20583
|
-
const thisFile = "parser.js: Trace(): ";
|
|
20584
|
-
let chars = void 0;
|
|
20585
|
-
let rules = void 0;
|
|
20586
|
-
let udts = void 0;
|
|
20587
|
-
let out = "";
|
|
20588
|
-
let treeDepth = 0;
|
|
20589
|
-
const MAX_PHRASE = 100;
|
|
20590
|
-
const t = this;
|
|
20591
|
-
const indent = (n) => {
|
|
20592
|
-
let ret = "";
|
|
20593
|
-
let count = 0;
|
|
20594
|
-
if (n >= 0) {
|
|
20595
|
-
while (n--) {
|
|
20596
|
-
count += 1;
|
|
20597
|
-
if (count === 5) {
|
|
20598
|
-
ret += "|";
|
|
20599
|
-
count = 0;
|
|
20600
|
-
} else {
|
|
20601
|
-
ret += ".";
|
|
20602
|
-
}
|
|
20603
|
-
}
|
|
20604
|
-
}
|
|
20605
|
-
return ret;
|
|
20606
|
-
};
|
|
20607
|
-
t.init = (r, u, c) => {
|
|
20608
|
-
rules = r;
|
|
20609
|
-
udts = u;
|
|
20610
|
-
chars = c;
|
|
20611
|
-
};
|
|
20612
|
-
const opName = (op) => {
|
|
20613
|
-
let name;
|
|
20614
|
-
switch (op.type) {
|
|
20615
|
-
case id.ALT:
|
|
20616
|
-
name = "ALT";
|
|
20617
|
-
break;
|
|
20618
|
-
case id.CAT:
|
|
20619
|
-
name = "CAT";
|
|
20620
|
-
break;
|
|
20621
|
-
case id.REP:
|
|
20622
|
-
if (op.max === Infinity) {
|
|
20623
|
-
name = `REP(${op.min},inf)`;
|
|
20624
|
-
} else {
|
|
20625
|
-
name = `REP(${op.min},${op.max})`;
|
|
20626
|
-
}
|
|
20627
|
-
break;
|
|
20628
|
-
case id.RNM:
|
|
20629
|
-
name = `RNM(${rules[op.index].name})`;
|
|
20630
|
-
break;
|
|
20631
|
-
case id.TRG:
|
|
20632
|
-
name = `TRG(${op.min},${op.max})`;
|
|
20633
|
-
break;
|
|
20634
|
-
case id.TBS:
|
|
20635
|
-
if (op.string.length > 6) {
|
|
20636
|
-
name = `TBS(${utils.charsToString(op.string, 0, 3)}...)`;
|
|
20637
|
-
} else {
|
|
20638
|
-
name = `TBS(${utils.charsToString(op.string, 0, 6)})`;
|
|
20639
|
-
}
|
|
20640
|
-
break;
|
|
20641
|
-
case id.TLS:
|
|
20642
|
-
if (op.string.length > 6) {
|
|
20643
|
-
name = `TLS(${utils.charsToString(op.string, 0, 3)}...)`;
|
|
20644
|
-
} else {
|
|
20645
|
-
name = `TLS(${utils.charsToString(op.string, 0, 6)})`;
|
|
20646
|
-
}
|
|
20647
|
-
break;
|
|
20648
|
-
case id.UDT:
|
|
20649
|
-
name = `UDT(${udts[op.index].name})`;
|
|
20650
|
-
break;
|
|
20651
|
-
case id.AND:
|
|
20652
|
-
name = "AND";
|
|
20653
|
-
break;
|
|
20654
|
-
case id.NOT:
|
|
20655
|
-
name = "NOT";
|
|
20656
|
-
break;
|
|
20657
|
-
default:
|
|
20658
|
-
throw new Error(`${thisFile}Trace: opName: unrecognized opcode`);
|
|
20659
|
-
}
|
|
20660
|
-
return name;
|
|
20661
|
-
};
|
|
20662
|
-
t.down = (op, offset) => {
|
|
20663
|
-
const lead = indent(treeDepth);
|
|
20664
|
-
const len = Math.min(MAX_PHRASE, chars.length - offset);
|
|
20665
|
-
let phrase = utils.charsToString(chars, offset, len);
|
|
20666
|
-
if (len < chars.length - offset) {
|
|
20667
|
-
phrase += "...";
|
|
20668
|
-
}
|
|
20669
|
-
phrase = `${lead}|-|[${opName(op)}]${phrase}
|
|
20670
|
-
`;
|
|
20671
|
-
out += phrase;
|
|
20672
|
-
treeDepth += 1;
|
|
20673
|
-
};
|
|
20674
|
-
t.up = (op, state, offset, phraseLength) => {
|
|
20675
|
-
const thisFunc = `${thisFile}trace.up: `;
|
|
20676
|
-
treeDepth -= 1;
|
|
20677
|
-
const lead = indent(treeDepth);
|
|
20678
|
-
let len;
|
|
20679
|
-
let phrase;
|
|
20680
|
-
let st;
|
|
20681
|
-
switch (state) {
|
|
20682
|
-
case id.EMPTY:
|
|
20683
|
-
st = "|E|";
|
|
20684
|
-
phrase = `''`;
|
|
20685
|
-
break;
|
|
20686
|
-
case id.MATCH:
|
|
20687
|
-
st = "|M|";
|
|
20688
|
-
len = Math.min(MAX_PHRASE, phraseLength);
|
|
20689
|
-
if (len < phraseLength) {
|
|
20690
|
-
phrase = `'${utils.charsToString(chars, offset, len)}...'`;
|
|
20691
|
-
} else {
|
|
20692
|
-
phrase = `'${utils.charsToString(chars, offset, len)}'`;
|
|
20693
|
-
}
|
|
20694
|
-
break;
|
|
20695
|
-
case id.NOMATCH:
|
|
20696
|
-
st = "|N|";
|
|
20697
|
-
phrase = "";
|
|
20698
|
-
break;
|
|
20699
|
-
default:
|
|
20700
|
-
throw new Error(`${thisFunc} unrecognized state`);
|
|
20701
|
-
}
|
|
20702
|
-
phrase = `${lead}${st}[${opName(op)}]${phrase}
|
|
20703
|
-
`;
|
|
20704
|
-
out += phrase;
|
|
20705
|
-
};
|
|
20706
|
-
t.displayTrace = () => out;
|
|
20707
|
-
};
|
|
20708
|
-
var Stats = function fnstats() {
|
|
20709
|
-
const id = identifiers;
|
|
20710
|
-
const thisFileName = "parser.js: Stats(): ";
|
|
20711
|
-
let rules;
|
|
20712
|
-
let udts;
|
|
20713
|
-
let totals;
|
|
20714
|
-
const stats = [];
|
|
20715
|
-
const ruleStats = [];
|
|
20716
|
-
const udtStats = [];
|
|
20717
|
-
this.init = (r, u) => {
|
|
20718
|
-
rules = r;
|
|
20719
|
-
udts = u;
|
|
20720
|
-
clear();
|
|
20721
|
-
};
|
|
20722
|
-
this.collect = (op, sys) => {
|
|
20723
|
-
incStat(totals, sys.state, sys.phraseLength);
|
|
20724
|
-
incStat(stats[op.type], sys.state, sys.phraseLength);
|
|
20725
|
-
if (op.type === id.RNM) {
|
|
20726
|
-
incStat(ruleStats[op.index], sys.state, sys.phraseLength);
|
|
20727
|
-
}
|
|
20728
|
-
if (op.type === id.UDT) {
|
|
20729
|
-
incStat(udtStats[op.index], sys.state, sys.phraseLength);
|
|
20730
|
-
}
|
|
20731
|
-
};
|
|
20732
|
-
this.displayStats = () => {
|
|
20733
|
-
let out = "";
|
|
20734
|
-
const totals2 = {
|
|
20735
|
-
match: 0,
|
|
20736
|
-
empty: 0,
|
|
20737
|
-
nomatch: 0,
|
|
20738
|
-
total: 0
|
|
20739
|
-
};
|
|
20740
|
-
const displayRow = (op, m, e, n, t) => {
|
|
20741
|
-
totals2.match += m;
|
|
20742
|
-
totals2.empty += e;
|
|
20743
|
-
totals2.nomatch += n;
|
|
20744
|
-
totals2.total += t;
|
|
20745
|
-
const mm = normalize4(m);
|
|
20746
|
-
const ee = normalize4(e);
|
|
20747
|
-
const nn = normalize4(n);
|
|
20748
|
-
const tt = normalize4(t);
|
|
20749
|
-
return `${op} | ${mm} | ${ee} | ${nn} | ${tt} |
|
|
20750
|
-
`;
|
|
20751
|
-
};
|
|
20752
|
-
out += " OPERATOR STATS\n";
|
|
20753
|
-
out += " | MATCH | EMPTY | NOMATCH | TOTAL |\n";
|
|
20754
|
-
out += displayRow(" ALT", stats[id.ALT].match, stats[id.ALT].empty, stats[id.ALT].nomatch, stats[id.ALT].total);
|
|
20755
|
-
out += displayRow(" CAT", stats[id.CAT].match, stats[id.CAT].empty, stats[id.CAT].nomatch, stats[id.CAT].total);
|
|
20756
|
-
out += displayRow(" REP", stats[id.REP].match, stats[id.REP].empty, stats[id.REP].nomatch, stats[id.REP].total);
|
|
20757
|
-
out += displayRow(" RNM", stats[id.RNM].match, stats[id.RNM].empty, stats[id.RNM].nomatch, stats[id.RNM].total);
|
|
20758
|
-
out += displayRow(" TRG", stats[id.TRG].match, stats[id.TRG].empty, stats[id.TRG].nomatch, stats[id.TRG].total);
|
|
20759
|
-
out += displayRow(" TBS", stats[id.TBS].match, stats[id.TBS].empty, stats[id.TBS].nomatch, stats[id.TBS].total);
|
|
20760
|
-
out += displayRow(" TLS", stats[id.TLS].match, stats[id.TLS].empty, stats[id.TLS].nomatch, stats[id.TLS].total);
|
|
20761
|
-
out += displayRow(" UDT", stats[id.UDT].match, stats[id.UDT].empty, stats[id.UDT].nomatch, stats[id.UDT].total);
|
|
20762
|
-
out += displayRow(" AND", stats[id.AND].match, stats[id.AND].empty, stats[id.AND].nomatch, stats[id.AND].total);
|
|
20763
|
-
out += displayRow(" NOT", stats[id.NOT].match, stats[id.NOT].empty, stats[id.NOT].nomatch, stats[id.NOT].total);
|
|
20764
|
-
out += displayRow("TOTAL", totals2.match, totals2.empty, totals2.nomatch, totals2.total);
|
|
20765
|
-
return out;
|
|
20766
|
-
};
|
|
20767
|
-
this.displayHits = (type4) => {
|
|
20768
|
-
let out = "";
|
|
20769
|
-
const displayRow = (m, e, n, t, name) => {
|
|
20770
|
-
totals.match += m;
|
|
20771
|
-
totals.empty += e;
|
|
20772
|
-
totals.nomatch += n;
|
|
20773
|
-
totals.total += t;
|
|
20774
|
-
const mm = normalize4(m);
|
|
20775
|
-
const ee = normalize4(e);
|
|
20776
|
-
const nn = normalize4(n);
|
|
20777
|
-
const tt = normalize4(t);
|
|
20778
|
-
return `| ${mm} | ${ee} | ${nn} | ${tt} | ${name}
|
|
20779
|
-
`;
|
|
20780
|
-
};
|
|
20781
|
-
if (typeof type4 === "string" && type4.toLowerCase()[0] === "a") {
|
|
20782
|
-
ruleStats.sort(sortAlpha);
|
|
20783
|
-
udtStats.sort(sortAlpha);
|
|
20784
|
-
out += " RULES/UDTS ALPHABETICALLY\n";
|
|
20785
|
-
} else if (typeof type4 === "string" && type4.toLowerCase()[0] === "i") {
|
|
20786
|
-
ruleStats.sort(sortIndex);
|
|
20787
|
-
udtStats.sort(sortIndex);
|
|
20788
|
-
out += " RULES/UDTS BY INDEX\n";
|
|
20789
|
-
} else {
|
|
20790
|
-
ruleStats.sort(sortHits);
|
|
20791
|
-
udtStats.sort(sortHits);
|
|
20792
|
-
out += " RULES/UDTS BY HIT COUNT\n";
|
|
20793
|
-
}
|
|
20794
|
-
out += "| MATCH | EMPTY | NOMATCH | TOTAL | NAME\n";
|
|
20795
|
-
for (let i = 0; i < ruleStats.length; i += 1) {
|
|
20796
|
-
let r = ruleStats[i];
|
|
20797
|
-
if (r.total) {
|
|
20798
|
-
out += displayRow(r.match, r.empty, r.nomatch, r.total, r.name);
|
|
20799
|
-
}
|
|
20800
|
-
}
|
|
20801
|
-
for (let i = 0; i < udtStats.length; i += 1) {
|
|
20802
|
-
let r = udtStats[i];
|
|
20803
|
-
if (r.total) {
|
|
20804
|
-
out += displayRow(r.match, r.empty, r.nomatch, r.total, r.name);
|
|
20805
|
-
}
|
|
20806
|
-
}
|
|
20807
|
-
return out;
|
|
20808
|
-
};
|
|
20809
|
-
const normalize4 = (n) => {
|
|
20810
|
-
if (n < 10) {
|
|
20811
|
-
return ` ${n}`;
|
|
20812
|
-
}
|
|
20813
|
-
if (n < 100) {
|
|
20814
|
-
return ` ${n}`;
|
|
20815
|
-
}
|
|
20816
|
-
if (n < 1e3) {
|
|
20817
|
-
return ` ${n}`;
|
|
20818
|
-
}
|
|
20819
|
-
if (n < 1e4) {
|
|
20820
|
-
return ` ${n}`;
|
|
20821
|
-
}
|
|
20822
|
-
if (n < 1e5) {
|
|
20823
|
-
return ` ${n}`;
|
|
20824
|
-
}
|
|
20825
|
-
if (n < 1e6) {
|
|
20826
|
-
return ` ${n}`;
|
|
20827
|
-
}
|
|
20828
|
-
return `${n}`;
|
|
20829
|
-
};
|
|
20830
|
-
const sortAlpha = (lhs, rhs) => {
|
|
20831
|
-
if (lhs.lower < rhs.lower) {
|
|
20832
|
-
return -1;
|
|
20833
|
-
}
|
|
20834
|
-
if (lhs.lower > rhs.lower) {
|
|
20835
|
-
return 1;
|
|
20836
|
-
}
|
|
20837
|
-
return 0;
|
|
20838
|
-
};
|
|
20839
|
-
const sortHits = (lhs, rhs) => {
|
|
20840
|
-
if (lhs.total < rhs.total) {
|
|
20841
|
-
return 1;
|
|
20842
|
-
}
|
|
20843
|
-
if (lhs.total > rhs.total) {
|
|
20844
|
-
return -1;
|
|
20845
|
-
}
|
|
20846
|
-
return sortAlpha(lhs, rhs);
|
|
20847
|
-
};
|
|
20848
|
-
const sortIndex = (lhs, rhs) => {
|
|
20849
|
-
if (lhs.index < rhs.index) {
|
|
20850
|
-
return -1;
|
|
20851
|
-
}
|
|
20852
|
-
if (lhs.index > rhs.index) {
|
|
20853
|
-
return 1;
|
|
20854
|
-
}
|
|
20855
|
-
return 0;
|
|
20856
|
-
};
|
|
20857
|
-
const EmptyStat = function fnempty() {
|
|
20858
|
-
this.empty = 0;
|
|
20859
|
-
this.match = 0;
|
|
20860
|
-
this.nomatch = 0;
|
|
20861
|
-
this.total = 0;
|
|
20862
|
-
};
|
|
20863
|
-
const clear = () => {
|
|
20864
|
-
stats.length = 0;
|
|
20865
|
-
totals = new EmptyStat();
|
|
20866
|
-
stats[id.ALT] = new EmptyStat();
|
|
20867
|
-
stats[id.CAT] = new EmptyStat();
|
|
20868
|
-
stats[id.REP] = new EmptyStat();
|
|
20869
|
-
stats[id.RNM] = new EmptyStat();
|
|
20870
|
-
stats[id.TRG] = new EmptyStat();
|
|
20871
|
-
stats[id.TBS] = new EmptyStat();
|
|
20872
|
-
stats[id.TLS] = new EmptyStat();
|
|
20873
|
-
stats[id.UDT] = new EmptyStat();
|
|
20874
|
-
stats[id.AND] = new EmptyStat();
|
|
20875
|
-
stats[id.NOT] = new EmptyStat();
|
|
20876
|
-
ruleStats.length = 0;
|
|
20877
|
-
for (let i = 0; i < rules.length; i += 1) {
|
|
20878
|
-
ruleStats.push({
|
|
20879
|
-
empty: 0,
|
|
20880
|
-
match: 0,
|
|
20881
|
-
nomatch: 0,
|
|
20882
|
-
total: 0,
|
|
20883
|
-
name: rules[i].name,
|
|
20884
|
-
lower: rules[i].lower,
|
|
20885
|
-
index: rules[i].index
|
|
20886
|
-
});
|
|
20887
|
-
}
|
|
20888
|
-
if (udts.length > 0) {
|
|
20889
|
-
udtStats.length = 0;
|
|
20890
|
-
for (let i = 0; i < udts.length; i += 1) {
|
|
20891
|
-
udtStats.push({
|
|
20892
|
-
empty: 0,
|
|
20893
|
-
match: 0,
|
|
20894
|
-
nomatch: 0,
|
|
20895
|
-
total: 0,
|
|
20896
|
-
name: udts[i].name,
|
|
20897
|
-
lower: udts[i].lower,
|
|
20898
|
-
index: udts[i].index
|
|
20899
|
-
});
|
|
20900
|
-
}
|
|
20901
|
-
}
|
|
20902
|
-
};
|
|
20903
|
-
const incStat = (stat, state) => {
|
|
20904
|
-
stat.total += 1;
|
|
20905
|
-
switch (state) {
|
|
20906
|
-
case id.EMPTY:
|
|
20907
|
-
stat.empty += 1;
|
|
20908
|
-
break;
|
|
20909
|
-
case id.MATCH:
|
|
20910
|
-
stat.match += 1;
|
|
20911
|
-
break;
|
|
20912
|
-
case id.NOMATCH:
|
|
20913
|
-
stat.nomatch += 1;
|
|
20914
|
-
break;
|
|
20915
|
-
default:
|
|
20916
|
-
throw new Error(`${thisFileName}collect(): incStat(): unrecognized state: ${state}`);
|
|
20917
|
-
}
|
|
20918
|
-
};
|
|
20919
|
-
};
|
|
20920
|
-
var utilities = {
|
|
20921
|
-
// utility functions
|
|
20922
|
-
stringToChars: (string) => [...string].map((cp) => cp.codePointAt(0)),
|
|
20923
|
-
charsToString: (chars, beg, len) => {
|
|
20924
|
-
let subChars = chars;
|
|
20925
|
-
while (1) {
|
|
20926
|
-
if (beg === void 0 || beg < 0) {
|
|
20927
|
-
break;
|
|
20928
|
-
}
|
|
20929
|
-
if (len === void 0) {
|
|
20930
|
-
subChars = chars.slice(beg);
|
|
20931
|
-
break;
|
|
20932
|
-
}
|
|
20933
|
-
if (len <= 0) {
|
|
20934
|
-
return "";
|
|
20935
|
-
}
|
|
20936
|
-
subChars = chars.slice(beg, beg + len);
|
|
20937
|
-
break;
|
|
20938
|
-
}
|
|
20939
|
-
return String.fromCodePoint(...subChars);
|
|
20940
|
-
}
|
|
20941
|
-
};
|
|
20942
|
-
var identifiers = {
|
|
20943
|
-
// Identifies the operator type.
|
|
20944
|
-
// NB: These must match the values in apg-js 4.3.0, apg-lib/identifiers.
|
|
20945
|
-
/* the original ABNF operators */
|
|
20946
|
-
ALT: 1,
|
|
20947
|
-
CAT: 2,
|
|
20948
|
-
REP: 3,
|
|
20949
|
-
RNM: 4,
|
|
20950
|
-
TRG: 5,
|
|
20951
|
-
TBS: 6,
|
|
20952
|
-
TLS: 7,
|
|
20953
|
-
/* the super set, SABNF operators */
|
|
20954
|
-
UDT: 11,
|
|
20955
|
-
AND: 12,
|
|
20956
|
-
NOT: 13,
|
|
20957
|
-
// Used by the parser and the user's `RNM` and `UDT` callback functions.
|
|
20958
|
-
// Identifies the parser state as it traverses the parse tree nodes.
|
|
20959
|
-
// - *ACTIVE* - indicates the downward direction through the parse tree node.
|
|
20960
|
-
// - *MATCH* - indicates the upward direction and a phrase, of length \> 0, has been successfully matched
|
|
20961
|
-
// - *EMPTY* - indicates the upward direction and a phrase, of length = 0, has been successfully matched
|
|
20962
|
-
// - *NOMATCH* - indicates the upward direction and the parser failed to match any phrase at all
|
|
20963
|
-
ACTIVE: 100,
|
|
20964
|
-
MATCH: 101,
|
|
20965
|
-
EMPTY: 102,
|
|
20966
|
-
NOMATCH: 103,
|
|
20967
|
-
// Used by [`AST` translator](./ast.html) (semantic analysis) and the user's callback functions
|
|
20968
|
-
// to indicate the direction of flow through the `AST` nodes.
|
|
20969
|
-
// - *SEM_PRE* - indicates the downward (pre-branch) direction through the `AST` node.
|
|
20970
|
-
// - *SEM_POST* - indicates the upward (post-branch) direction through the `AST` node.
|
|
20971
|
-
SEM_PRE: 200,
|
|
20972
|
-
SEM_POST: 201,
|
|
20973
|
-
// Ignored. Retained for backwords compatibility.
|
|
20974
|
-
SEM_OK: 300,
|
|
20975
|
-
idName: (s) => {
|
|
20976
|
-
switch (s) {
|
|
20977
|
-
case identifiers.ALT:
|
|
20978
|
-
return "ALT";
|
|
20979
|
-
case identifiers.CAT:
|
|
20980
|
-
return "CAT";
|
|
20981
|
-
case identifiers.REP:
|
|
20982
|
-
return "REP";
|
|
20983
|
-
case identifiers.RNM:
|
|
20984
|
-
return "RNM";
|
|
20985
|
-
case identifiers.TRG:
|
|
20986
|
-
return "TRG";
|
|
20987
|
-
case identifiers.TBS:
|
|
20988
|
-
return "TBS";
|
|
20989
|
-
case identifiers.TLS:
|
|
20990
|
-
return "TLS";
|
|
20991
|
-
case identifiers.UDT:
|
|
20992
|
-
return "UDT";
|
|
20993
|
-
case identifiers.AND:
|
|
20994
|
-
return "AND";
|
|
20995
|
-
case identifiers.NOT:
|
|
20996
|
-
return "NOT";
|
|
20997
|
-
case identifiers.ACTIVE:
|
|
20998
|
-
return "ACTIVE";
|
|
20999
|
-
case identifiers.EMPTY:
|
|
21000
|
-
return "EMPTY";
|
|
21001
|
-
case identifiers.MATCH:
|
|
21002
|
-
return "MATCH";
|
|
21003
|
-
case identifiers.NOMATCH:
|
|
21004
|
-
return "NOMATCH";
|
|
21005
|
-
case identifiers.SEM_PRE:
|
|
21006
|
-
return "SEM_PRE";
|
|
21007
|
-
case identifiers.SEM_POST:
|
|
21008
|
-
return "SEM_POST";
|
|
21009
|
-
case identifiers.SEM_OK:
|
|
21010
|
-
return "SEM_OK";
|
|
21011
|
-
default:
|
|
21012
|
-
return "UNRECOGNIZED STATE";
|
|
21013
|
-
}
|
|
21014
|
-
}
|
|
21015
|
-
};
|
|
21016
|
-
|
|
21017
19927
|
// ../../node_modules/.bun/@swaggerexpert+json-pointer@2.10.2/node_modules/@swaggerexpert/json-pointer/es/errors/JSONPointerError.mjs
|
|
21018
19928
|
var JSONPointerError = class extends Error {
|
|
21019
19929
|
constructor(message, options = void 0) {
|
|
@@ -21172,7 +20082,7 @@ var parse2 = (jsonPointer, {
|
|
|
21172
20082
|
throw new TypeError("JSON Pointer must be a string");
|
|
21173
20083
|
}
|
|
21174
20084
|
try {
|
|
21175
|
-
const parser10 = new
|
|
20085
|
+
const parser10 = new Parser();
|
|
21176
20086
|
if (translator) parser10.ast = translator;
|
|
21177
20087
|
if (stats) parser10.stats = new Stats();
|
|
21178
20088
|
if (trace) parser10.trace = new Trace_default();
|
|
@@ -21194,15 +20104,15 @@ var parse_default2 = parse2;
|
|
|
21194
20104
|
|
|
21195
20105
|
// ../../node_modules/.bun/@swaggerexpert+json-pointer@2.10.2/node_modules/@swaggerexpert/json-pointer/es/test/reference-token.mjs
|
|
21196
20106
|
var grammar3 = new grammar();
|
|
21197
|
-
var parser = new
|
|
20107
|
+
var parser = new Parser();
|
|
21198
20108
|
|
|
21199
20109
|
// ../../node_modules/.bun/@swaggerexpert+json-pointer@2.10.2/node_modules/@swaggerexpert/json-pointer/es/test/array-location.mjs
|
|
21200
20110
|
var grammar4 = new grammar();
|
|
21201
|
-
var parser2 = new
|
|
20111
|
+
var parser2 = new Parser();
|
|
21202
20112
|
|
|
21203
20113
|
// ../../node_modules/.bun/@swaggerexpert+json-pointer@2.10.2/node_modules/@swaggerexpert/json-pointer/es/test/array-index.mjs
|
|
21204
20114
|
var grammar5 = new grammar();
|
|
21205
|
-
var parser3 = new
|
|
20115
|
+
var parser3 = new Parser();
|
|
21206
20116
|
var testArrayIndex = (referenceToken) => {
|
|
21207
20117
|
if (typeof referenceToken !== "string") return false;
|
|
21208
20118
|
try {
|
|
@@ -21215,7 +20125,7 @@ var array_index_default = testArrayIndex;
|
|
|
21215
20125
|
|
|
21216
20126
|
// ../../node_modules/.bun/@swaggerexpert+json-pointer@2.10.2/node_modules/@swaggerexpert/json-pointer/es/test/array-dash.mjs
|
|
21217
20127
|
var grammar6 = new grammar();
|
|
21218
|
-
var parser4 = new
|
|
20128
|
+
var parser4 = new Parser();
|
|
21219
20129
|
var testArrayDash = (referenceToken) => {
|
|
21220
20130
|
if (typeof referenceToken !== "string") return false;
|
|
21221
20131
|
try {
|
|
@@ -37842,515 +36752,8 @@ function mapTagOperations({
|
|
|
37842
36752
|
// ../../node_modules/.bun/swagger-client@3.38.2/node_modules/swagger-client/es/execute/index.js
|
|
37843
36753
|
var import_includes17 = __toESM(require_includes5());
|
|
37844
36754
|
|
|
37845
|
-
// ../../node_modules/.bun/openapi-server-url-templating@1.3.0/node_modules/openapi-server-url-templating/es/server-url-templating.mjs
|
|
37846
|
-
function grammar7() {
|
|
37847
|
-
this.grammarObject = "grammarObject";
|
|
37848
|
-
this.rules = [];
|
|
37849
|
-
this.rules[0] = {
|
|
37850
|
-
name: "server-url-template",
|
|
37851
|
-
lower: "server-url-template",
|
|
37852
|
-
index: 0,
|
|
37853
|
-
isBkr: false
|
|
37854
|
-
};
|
|
37855
|
-
this.rules[1] = {
|
|
37856
|
-
name: "server-variable",
|
|
37857
|
-
lower: "server-variable",
|
|
37858
|
-
index: 1,
|
|
37859
|
-
isBkr: false
|
|
37860
|
-
};
|
|
37861
|
-
this.rules[2] = {
|
|
37862
|
-
name: "server-variable-name",
|
|
37863
|
-
lower: "server-variable-name",
|
|
37864
|
-
index: 2,
|
|
37865
|
-
isBkr: false
|
|
37866
|
-
};
|
|
37867
|
-
this.rules[3] = {
|
|
37868
|
-
name: "literals",
|
|
37869
|
-
lower: "literals",
|
|
37870
|
-
index: 3,
|
|
37871
|
-
isBkr: false
|
|
37872
|
-
};
|
|
37873
|
-
this.rules[4] = {
|
|
37874
|
-
name: "DIGIT",
|
|
37875
|
-
lower: "digit",
|
|
37876
|
-
index: 4,
|
|
37877
|
-
isBkr: false
|
|
37878
|
-
};
|
|
37879
|
-
this.rules[5] = {
|
|
37880
|
-
name: "HEXDIG",
|
|
37881
|
-
lower: "hexdig",
|
|
37882
|
-
index: 5,
|
|
37883
|
-
isBkr: false
|
|
37884
|
-
};
|
|
37885
|
-
this.rules[6] = {
|
|
37886
|
-
name: "pct-encoded",
|
|
37887
|
-
lower: "pct-encoded",
|
|
37888
|
-
index: 6,
|
|
37889
|
-
isBkr: false
|
|
37890
|
-
};
|
|
37891
|
-
this.rules[7] = {
|
|
37892
|
-
name: "ucschar",
|
|
37893
|
-
lower: "ucschar",
|
|
37894
|
-
index: 7,
|
|
37895
|
-
isBkr: false
|
|
37896
|
-
};
|
|
37897
|
-
this.rules[8] = {
|
|
37898
|
-
name: "iprivate",
|
|
37899
|
-
lower: "iprivate",
|
|
37900
|
-
index: 8,
|
|
37901
|
-
isBkr: false
|
|
37902
|
-
};
|
|
37903
|
-
this.udts = [];
|
|
37904
|
-
this.rules[0].opcodes = [];
|
|
37905
|
-
this.rules[0].opcodes[0] = {
|
|
37906
|
-
type: 3,
|
|
37907
|
-
min: 1,
|
|
37908
|
-
max: Infinity
|
|
37909
|
-
};
|
|
37910
|
-
this.rules[0].opcodes[1] = {
|
|
37911
|
-
type: 1,
|
|
37912
|
-
children: [2, 3]
|
|
37913
|
-
};
|
|
37914
|
-
this.rules[0].opcodes[2] = {
|
|
37915
|
-
type: 4,
|
|
37916
|
-
index: 3
|
|
37917
|
-
};
|
|
37918
|
-
this.rules[0].opcodes[3] = {
|
|
37919
|
-
type: 4,
|
|
37920
|
-
index: 1
|
|
37921
|
-
};
|
|
37922
|
-
this.rules[1].opcodes = [];
|
|
37923
|
-
this.rules[1].opcodes[0] = {
|
|
37924
|
-
type: 2,
|
|
37925
|
-
children: [1, 2, 3]
|
|
37926
|
-
};
|
|
37927
|
-
this.rules[1].opcodes[1] = {
|
|
37928
|
-
type: 7,
|
|
37929
|
-
string: [123]
|
|
37930
|
-
};
|
|
37931
|
-
this.rules[1].opcodes[2] = {
|
|
37932
|
-
type: 4,
|
|
37933
|
-
index: 2
|
|
37934
|
-
};
|
|
37935
|
-
this.rules[1].opcodes[3] = {
|
|
37936
|
-
type: 7,
|
|
37937
|
-
string: [125]
|
|
37938
|
-
};
|
|
37939
|
-
this.rules[2].opcodes = [];
|
|
37940
|
-
this.rules[2].opcodes[0] = {
|
|
37941
|
-
type: 3,
|
|
37942
|
-
min: 1,
|
|
37943
|
-
max: Infinity
|
|
37944
|
-
};
|
|
37945
|
-
this.rules[2].opcodes[1] = {
|
|
37946
|
-
type: 1,
|
|
37947
|
-
children: [2, 3, 4]
|
|
37948
|
-
};
|
|
37949
|
-
this.rules[2].opcodes[2] = {
|
|
37950
|
-
type: 5,
|
|
37951
|
-
min: 0,
|
|
37952
|
-
max: 122
|
|
37953
|
-
};
|
|
37954
|
-
this.rules[2].opcodes[3] = {
|
|
37955
|
-
type: 6,
|
|
37956
|
-
string: [124]
|
|
37957
|
-
};
|
|
37958
|
-
this.rules[2].opcodes[4] = {
|
|
37959
|
-
type: 5,
|
|
37960
|
-
min: 126,
|
|
37961
|
-
max: 1114111
|
|
37962
|
-
};
|
|
37963
|
-
this.rules[3].opcodes = [];
|
|
37964
|
-
this.rules[3].opcodes[0] = {
|
|
37965
|
-
type: 3,
|
|
37966
|
-
min: 1,
|
|
37967
|
-
max: Infinity
|
|
37968
|
-
};
|
|
37969
|
-
this.rules[3].opcodes[1] = {
|
|
37970
|
-
type: 1,
|
|
37971
|
-
children: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
|
|
37972
|
-
};
|
|
37973
|
-
this.rules[3].opcodes[2] = {
|
|
37974
|
-
type: 6,
|
|
37975
|
-
string: [33]
|
|
37976
|
-
};
|
|
37977
|
-
this.rules[3].opcodes[3] = {
|
|
37978
|
-
type: 5,
|
|
37979
|
-
min: 35,
|
|
37980
|
-
max: 36
|
|
37981
|
-
};
|
|
37982
|
-
this.rules[3].opcodes[4] = {
|
|
37983
|
-
type: 5,
|
|
37984
|
-
min: 38,
|
|
37985
|
-
max: 59
|
|
37986
|
-
};
|
|
37987
|
-
this.rules[3].opcodes[5] = {
|
|
37988
|
-
type: 6,
|
|
37989
|
-
string: [61]
|
|
37990
|
-
};
|
|
37991
|
-
this.rules[3].opcodes[6] = {
|
|
37992
|
-
type: 5,
|
|
37993
|
-
min: 63,
|
|
37994
|
-
max: 91
|
|
37995
|
-
};
|
|
37996
|
-
this.rules[3].opcodes[7] = {
|
|
37997
|
-
type: 6,
|
|
37998
|
-
string: [93]
|
|
37999
|
-
};
|
|
38000
|
-
this.rules[3].opcodes[8] = {
|
|
38001
|
-
type: 6,
|
|
38002
|
-
string: [95]
|
|
38003
|
-
};
|
|
38004
|
-
this.rules[3].opcodes[9] = {
|
|
38005
|
-
type: 5,
|
|
38006
|
-
min: 97,
|
|
38007
|
-
max: 122
|
|
38008
|
-
};
|
|
38009
|
-
this.rules[3].opcodes[10] = {
|
|
38010
|
-
type: 6,
|
|
38011
|
-
string: [126]
|
|
38012
|
-
};
|
|
38013
|
-
this.rules[3].opcodes[11] = {
|
|
38014
|
-
type: 4,
|
|
38015
|
-
index: 7
|
|
38016
|
-
};
|
|
38017
|
-
this.rules[3].opcodes[12] = {
|
|
38018
|
-
type: 4,
|
|
38019
|
-
index: 8
|
|
38020
|
-
};
|
|
38021
|
-
this.rules[3].opcodes[13] = {
|
|
38022
|
-
type: 4,
|
|
38023
|
-
index: 6
|
|
38024
|
-
};
|
|
38025
|
-
this.rules[4].opcodes = [];
|
|
38026
|
-
this.rules[4].opcodes[0] = {
|
|
38027
|
-
type: 5,
|
|
38028
|
-
min: 48,
|
|
38029
|
-
max: 57
|
|
38030
|
-
};
|
|
38031
|
-
this.rules[5].opcodes = [];
|
|
38032
|
-
this.rules[5].opcodes[0] = {
|
|
38033
|
-
type: 1,
|
|
38034
|
-
children: [1, 2, 3, 4, 5, 6, 7]
|
|
38035
|
-
};
|
|
38036
|
-
this.rules[5].opcodes[1] = {
|
|
38037
|
-
type: 4,
|
|
38038
|
-
index: 4
|
|
38039
|
-
};
|
|
38040
|
-
this.rules[5].opcodes[2] = {
|
|
38041
|
-
type: 7,
|
|
38042
|
-
string: [97]
|
|
38043
|
-
};
|
|
38044
|
-
this.rules[5].opcodes[3] = {
|
|
38045
|
-
type: 7,
|
|
38046
|
-
string: [98]
|
|
38047
|
-
};
|
|
38048
|
-
this.rules[5].opcodes[4] = {
|
|
38049
|
-
type: 7,
|
|
38050
|
-
string: [99]
|
|
38051
|
-
};
|
|
38052
|
-
this.rules[5].opcodes[5] = {
|
|
38053
|
-
type: 7,
|
|
38054
|
-
string: [100]
|
|
38055
|
-
};
|
|
38056
|
-
this.rules[5].opcodes[6] = {
|
|
38057
|
-
type: 7,
|
|
38058
|
-
string: [101]
|
|
38059
|
-
};
|
|
38060
|
-
this.rules[5].opcodes[7] = {
|
|
38061
|
-
type: 7,
|
|
38062
|
-
string: [102]
|
|
38063
|
-
};
|
|
38064
|
-
this.rules[6].opcodes = [];
|
|
38065
|
-
this.rules[6].opcodes[0] = {
|
|
38066
|
-
type: 2,
|
|
38067
|
-
children: [1, 2, 3]
|
|
38068
|
-
};
|
|
38069
|
-
this.rules[6].opcodes[1] = {
|
|
38070
|
-
type: 7,
|
|
38071
|
-
string: [37]
|
|
38072
|
-
};
|
|
38073
|
-
this.rules[6].opcodes[2] = {
|
|
38074
|
-
type: 4,
|
|
38075
|
-
index: 5
|
|
38076
|
-
};
|
|
38077
|
-
this.rules[6].opcodes[3] = {
|
|
38078
|
-
type: 4,
|
|
38079
|
-
index: 5
|
|
38080
|
-
};
|
|
38081
|
-
this.rules[7].opcodes = [];
|
|
38082
|
-
this.rules[7].opcodes[0] = {
|
|
38083
|
-
type: 1,
|
|
38084
|
-
children: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
|
38085
|
-
};
|
|
38086
|
-
this.rules[7].opcodes[1] = {
|
|
38087
|
-
type: 5,
|
|
38088
|
-
min: 160,
|
|
38089
|
-
max: 55295
|
|
38090
|
-
};
|
|
38091
|
-
this.rules[7].opcodes[2] = {
|
|
38092
|
-
type: 5,
|
|
38093
|
-
min: 63744,
|
|
38094
|
-
max: 64975
|
|
38095
|
-
};
|
|
38096
|
-
this.rules[7].opcodes[3] = {
|
|
38097
|
-
type: 5,
|
|
38098
|
-
min: 65008,
|
|
38099
|
-
max: 65519
|
|
38100
|
-
};
|
|
38101
|
-
this.rules[7].opcodes[4] = {
|
|
38102
|
-
type: 5,
|
|
38103
|
-
min: 65536,
|
|
38104
|
-
max: 131069
|
|
38105
|
-
};
|
|
38106
|
-
this.rules[7].opcodes[5] = {
|
|
38107
|
-
type: 5,
|
|
38108
|
-
min: 131072,
|
|
38109
|
-
max: 196605
|
|
38110
|
-
};
|
|
38111
|
-
this.rules[7].opcodes[6] = {
|
|
38112
|
-
type: 5,
|
|
38113
|
-
min: 196608,
|
|
38114
|
-
max: 262141
|
|
38115
|
-
};
|
|
38116
|
-
this.rules[7].opcodes[7] = {
|
|
38117
|
-
type: 5,
|
|
38118
|
-
min: 262144,
|
|
38119
|
-
max: 327677
|
|
38120
|
-
};
|
|
38121
|
-
this.rules[7].opcodes[8] = {
|
|
38122
|
-
type: 5,
|
|
38123
|
-
min: 327680,
|
|
38124
|
-
max: 393213
|
|
38125
|
-
};
|
|
38126
|
-
this.rules[7].opcodes[9] = {
|
|
38127
|
-
type: 5,
|
|
38128
|
-
min: 393216,
|
|
38129
|
-
max: 458749
|
|
38130
|
-
};
|
|
38131
|
-
this.rules[7].opcodes[10] = {
|
|
38132
|
-
type: 5,
|
|
38133
|
-
min: 458752,
|
|
38134
|
-
max: 524285
|
|
38135
|
-
};
|
|
38136
|
-
this.rules[7].opcodes[11] = {
|
|
38137
|
-
type: 5,
|
|
38138
|
-
min: 524288,
|
|
38139
|
-
max: 589821
|
|
38140
|
-
};
|
|
38141
|
-
this.rules[7].opcodes[12] = {
|
|
38142
|
-
type: 5,
|
|
38143
|
-
min: 589824,
|
|
38144
|
-
max: 655357
|
|
38145
|
-
};
|
|
38146
|
-
this.rules[7].opcodes[13] = {
|
|
38147
|
-
type: 5,
|
|
38148
|
-
min: 655360,
|
|
38149
|
-
max: 720893
|
|
38150
|
-
};
|
|
38151
|
-
this.rules[7].opcodes[14] = {
|
|
38152
|
-
type: 5,
|
|
38153
|
-
min: 720896,
|
|
38154
|
-
max: 786429
|
|
38155
|
-
};
|
|
38156
|
-
this.rules[7].opcodes[15] = {
|
|
38157
|
-
type: 5,
|
|
38158
|
-
min: 786432,
|
|
38159
|
-
max: 851965
|
|
38160
|
-
};
|
|
38161
|
-
this.rules[7].opcodes[16] = {
|
|
38162
|
-
type: 5,
|
|
38163
|
-
min: 851968,
|
|
38164
|
-
max: 917501
|
|
38165
|
-
};
|
|
38166
|
-
this.rules[7].opcodes[17] = {
|
|
38167
|
-
type: 5,
|
|
38168
|
-
min: 921600,
|
|
38169
|
-
max: 983037
|
|
38170
|
-
};
|
|
38171
|
-
this.rules[8].opcodes = [];
|
|
38172
|
-
this.rules[8].opcodes[0] = {
|
|
38173
|
-
type: 1,
|
|
38174
|
-
children: [1, 2, 3]
|
|
38175
|
-
};
|
|
38176
|
-
this.rules[8].opcodes[1] = {
|
|
38177
|
-
type: 5,
|
|
38178
|
-
min: 57344,
|
|
38179
|
-
max: 63743
|
|
38180
|
-
};
|
|
38181
|
-
this.rules[8].opcodes[2] = {
|
|
38182
|
-
type: 5,
|
|
38183
|
-
min: 983040,
|
|
38184
|
-
max: 1048573
|
|
38185
|
-
};
|
|
38186
|
-
this.rules[8].opcodes[3] = {
|
|
38187
|
-
type: 5,
|
|
38188
|
-
min: 1048576,
|
|
38189
|
-
max: 1114109
|
|
38190
|
-
};
|
|
38191
|
-
this.toString = function toString4() {
|
|
38192
|
-
let str2 = "";
|
|
38193
|
-
str2 += "; OpenAPI Server URL templating ABNF syntax\n";
|
|
38194
|
-
str2 += "server-url-template = 1*( literals / server-variable ) ; variant of https://www.rfc-editor.org/rfc/rfc6570#section-2\n";
|
|
38195
|
-
str2 += 'server-variable = "{" server-variable-name "}"\n';
|
|
38196
|
-
str2 += "server-variable-name = 1*( %x00-7A / %x7C / %x7E-10FFFF ) ; every UTF8 character except { and } (from OpenAPI)\n";
|
|
38197
|
-
str2 += "\n";
|
|
38198
|
-
str2 += "; https://www.rfc-editor.org/rfc/rfc6570#section-2.1\n";
|
|
38199
|
-
str2 += "; https://www.rfc-editor.org/errata/eid6937\n";
|
|
38200
|
-
str2 += "literals = 1*( %x21 / %x23-24 / %x26-3B / %x3D / %x3F-5B\n";
|
|
38201
|
-
str2 += " / %x5D / %x5F / %x61-7A / %x7E / ucschar / iprivate\n";
|
|
38202
|
-
str2 += " / pct-encoded)\n";
|
|
38203
|
-
str2 += " ; any Unicode character except: CTL, SP,\n";
|
|
38204
|
-
str2 += ' ; DQUOTE, "%" (aside from pct-encoded),\n';
|
|
38205
|
-
str2 += ' ; "<", ">", "\\", "^", "`", "{", "|", "}"\n';
|
|
38206
|
-
str2 += "\n";
|
|
38207
|
-
str2 += "; https://www.rfc-editor.org/rfc/rfc6570#section-1.5\n";
|
|
38208
|
-
str2 += "DIGIT = %x30-39 ; 0-9\n";
|
|
38209
|
-
str2 += 'HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" ; case-insensitive\n';
|
|
38210
|
-
str2 += "\n";
|
|
38211
|
-
str2 += 'pct-encoded = "%" HEXDIG HEXDIG\n';
|
|
38212
|
-
str2 += "\n";
|
|
38213
|
-
str2 += "ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF\n";
|
|
38214
|
-
str2 += " / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD\n";
|
|
38215
|
-
str2 += " / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD\n";
|
|
38216
|
-
str2 += " / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD\n";
|
|
38217
|
-
str2 += " / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD\n";
|
|
38218
|
-
str2 += " / %xD0000-DFFFD / %xE1000-EFFFD\n";
|
|
38219
|
-
str2 += "\n";
|
|
38220
|
-
str2 += "iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD\n";
|
|
38221
|
-
return str2;
|
|
38222
|
-
};
|
|
38223
|
-
}
|
|
38224
|
-
|
|
38225
|
-
// ../../node_modules/.bun/openapi-server-url-templating@1.3.0/node_modules/openapi-server-url-templating/es/parse/callbacks/server-url-template.mjs
|
|
38226
|
-
var serverUrlTemplate = (state, chars, phraseIndex, phraseLength, data) => {
|
|
38227
|
-
if (state === identifiers.SEM_PRE) {
|
|
38228
|
-
if (Array.isArray(data) === false) {
|
|
38229
|
-
throw new Error("parser's user data must be an array");
|
|
38230
|
-
}
|
|
38231
|
-
data.push(["server-url-template", utilities.charsToString(chars, phraseIndex, phraseLength)]);
|
|
38232
|
-
}
|
|
38233
|
-
return identifiers.SEM_OK;
|
|
38234
|
-
};
|
|
38235
|
-
var server_url_template_default = serverUrlTemplate;
|
|
38236
|
-
|
|
38237
|
-
// ../../node_modules/.bun/openapi-server-url-templating@1.3.0/node_modules/openapi-server-url-templating/es/parse/callbacks/server-variable.mjs
|
|
38238
|
-
var serverVariable = (state, chars, phraseIndex, phraseLength, data) => {
|
|
38239
|
-
if (state === identifiers.SEM_PRE) {
|
|
38240
|
-
if (Array.isArray(data) === false) {
|
|
38241
|
-
throw new Error("parser's user data must be an array");
|
|
38242
|
-
}
|
|
38243
|
-
data.push(["server-variable", utilities.charsToString(chars, phraseIndex, phraseLength)]);
|
|
38244
|
-
}
|
|
38245
|
-
return identifiers.SEM_OK;
|
|
38246
|
-
};
|
|
38247
|
-
var server_variable_default4 = serverVariable;
|
|
38248
|
-
|
|
38249
|
-
// ../../node_modules/.bun/openapi-server-url-templating@1.3.0/node_modules/openapi-server-url-templating/es/parse/callbacks/server-variable-name.mjs
|
|
38250
|
-
var serverVariableName = (state, chars, phraseIndex, phraseLength, data) => {
|
|
38251
|
-
if (state === identifiers.SEM_PRE) {
|
|
38252
|
-
if (Array.isArray(data) === false) {
|
|
38253
|
-
throw new Error("parser's user data must be an array");
|
|
38254
|
-
}
|
|
38255
|
-
data.push(["server-variable-name", utilities.charsToString(chars, phraseIndex, phraseLength)]);
|
|
38256
|
-
}
|
|
38257
|
-
return identifiers.SEM_OK;
|
|
38258
|
-
};
|
|
38259
|
-
var server_variable_name_default = serverVariableName;
|
|
38260
|
-
|
|
38261
|
-
// ../../node_modules/.bun/openapi-server-url-templating@1.3.0/node_modules/openapi-server-url-templating/es/parse/callbacks/literals.mjs
|
|
38262
|
-
var literals = (state, chars, phraseIndex, phraseLength, data) => {
|
|
38263
|
-
if (state === identifiers.SEM_PRE) {
|
|
38264
|
-
if (Array.isArray(data) === false) {
|
|
38265
|
-
throw new Error("parser's user data must be an array");
|
|
38266
|
-
}
|
|
38267
|
-
data.push(["literals", utilities.charsToString(chars, phraseIndex, phraseLength)]);
|
|
38268
|
-
}
|
|
38269
|
-
return identifiers.SEM_OK;
|
|
38270
|
-
};
|
|
38271
|
-
var literals_default = literals;
|
|
38272
|
-
|
|
38273
|
-
// ../../node_modules/.bun/openapi-server-url-templating@1.3.0/node_modules/openapi-server-url-templating/es/parse/index.mjs
|
|
38274
|
-
var grammar8 = new grammar7();
|
|
38275
|
-
var parse5 = (serverURLTemplate) => {
|
|
38276
|
-
const parser10 = new Parser2();
|
|
38277
|
-
parser10.ast = new Ast();
|
|
38278
|
-
parser10.ast.callbacks["server-url-template"] = server_url_template_default;
|
|
38279
|
-
parser10.ast.callbacks["server-variable"] = server_variable_default4;
|
|
38280
|
-
parser10.ast.callbacks["server-variable-name"] = server_variable_name_default;
|
|
38281
|
-
parser10.ast.callbacks["literals"] = literals_default;
|
|
38282
|
-
const result = parser10.parse(grammar8, "server-url-template", serverURLTemplate);
|
|
38283
|
-
return {
|
|
38284
|
-
result,
|
|
38285
|
-
ast: parser10.ast
|
|
38286
|
-
};
|
|
38287
|
-
};
|
|
38288
|
-
var parse_default3 = parse5;
|
|
38289
|
-
|
|
38290
|
-
// ../../node_modules/.bun/openapi-server-url-templating@1.3.0/node_modules/openapi-server-url-templating/es/test.mjs
|
|
38291
|
-
var test = (serverURLTemplate, {
|
|
38292
|
-
strict = false
|
|
38293
|
-
} = {}) => {
|
|
38294
|
-
try {
|
|
38295
|
-
const parseResult = parse_default3(serverURLTemplate);
|
|
38296
|
-
if (!parseResult.result.success) return false;
|
|
38297
|
-
const parts = [];
|
|
38298
|
-
parseResult.ast.translate(parts);
|
|
38299
|
-
const hasServerVariable = parts.some(([type4]) => type4 === "server-variable");
|
|
38300
|
-
if (!strict && !hasServerVariable) {
|
|
38301
|
-
try {
|
|
38302
|
-
new URL(serverURLTemplate, "https://vladimirgorej.com");
|
|
38303
|
-
return true;
|
|
38304
|
-
} catch {
|
|
38305
|
-
return false;
|
|
38306
|
-
}
|
|
38307
|
-
}
|
|
38308
|
-
return strict ? hasServerVariable : true;
|
|
38309
|
-
} catch {
|
|
38310
|
-
return false;
|
|
38311
|
-
}
|
|
38312
|
-
};
|
|
38313
|
-
var test_default = test;
|
|
38314
|
-
|
|
38315
|
-
// ../../node_modules/.bun/openapi-server-url-templating@1.3.0/node_modules/openapi-server-url-templating/es/substitute.mjs
|
|
38316
|
-
var isEncoded = (serverVariableValue) => {
|
|
38317
|
-
try {
|
|
38318
|
-
return typeof serverVariableValue === "string" && decodeURIComponent(serverVariableValue) !== serverVariableValue;
|
|
38319
|
-
} catch {
|
|
38320
|
-
return false;
|
|
38321
|
-
}
|
|
38322
|
-
};
|
|
38323
|
-
var encodeServerVariable = (serverVariableValue) => {
|
|
38324
|
-
if (isEncoded(serverVariableValue)) {
|
|
38325
|
-
return serverVariableValue;
|
|
38326
|
-
}
|
|
38327
|
-
return encodeURIComponent(serverVariableValue).replace(/%5B/g, "[").replace(/%5D/g, "]");
|
|
38328
|
-
};
|
|
38329
|
-
var significantTypes = ["literals", "server-variable-name"];
|
|
38330
|
-
var substitute = (serverURLTemplate, serverVariables, options = {}) => {
|
|
38331
|
-
const defaultOptions4 = {
|
|
38332
|
-
encoder: encodeServerVariable
|
|
38333
|
-
};
|
|
38334
|
-
const mergedOptions = {
|
|
38335
|
-
...defaultOptions4,
|
|
38336
|
-
...options
|
|
38337
|
-
};
|
|
38338
|
-
const parseResult = parse_default3(serverURLTemplate);
|
|
38339
|
-
if (!parseResult.result.success) return serverURLTemplate;
|
|
38340
|
-
const parts = [];
|
|
38341
|
-
parseResult.ast.translate(parts);
|
|
38342
|
-
const substitutedParts = parts.filter(([type4]) => significantTypes.includes(type4)).map(([type4, value]) => {
|
|
38343
|
-
if (type4 === "server-variable-name") {
|
|
38344
|
-
return Object.hasOwn(serverVariables, value) ? mergedOptions.encoder(serverVariables[value], value) : `{${value}}`;
|
|
38345
|
-
}
|
|
38346
|
-
return value;
|
|
38347
|
-
});
|
|
38348
|
-
return substitutedParts.join("");
|
|
38349
|
-
};
|
|
38350
|
-
var substitute_default = substitute;
|
|
38351
|
-
|
|
38352
36755
|
// ../../node_modules/.bun/openapi-path-templating@2.2.1/node_modules/openapi-path-templating/es/path-templating.mjs
|
|
38353
|
-
function
|
|
36756
|
+
function grammar7() {
|
|
38354
36757
|
this.grammarObject = "grammarObject";
|
|
38355
36758
|
this.rules = [];
|
|
38356
36759
|
this.rules[0] = {
|
|
@@ -38798,25 +37201,25 @@ var templateExpressionParamName = (state, chars, phraseIndex, phraseLength, data
|
|
|
38798
37201
|
var template_expression_param_name_default = templateExpressionParamName;
|
|
38799
37202
|
|
|
38800
37203
|
// ../../node_modules/.bun/openapi-path-templating@2.2.1/node_modules/openapi-path-templating/es/parse/index.mjs
|
|
38801
|
-
var
|
|
38802
|
-
var
|
|
38803
|
-
const parser10 = new
|
|
37204
|
+
var grammar8 = new grammar7();
|
|
37205
|
+
var parse5 = (pathTemplate2) => {
|
|
37206
|
+
const parser10 = new Parser();
|
|
38804
37207
|
parser10.ast = new Ast();
|
|
38805
37208
|
parser10.ast.callbacks["path-template"] = path_template_default;
|
|
38806
37209
|
parser10.ast.callbacks["slash"] = slash_default;
|
|
38807
37210
|
parser10.ast.callbacks["path-literal"] = path_literal_default;
|
|
38808
37211
|
parser10.ast.callbacks["template-expression"] = template_expression_default;
|
|
38809
37212
|
parser10.ast.callbacks["template-expression-param-name"] = template_expression_param_name_default;
|
|
38810
|
-
const result = parser10.parse(
|
|
37213
|
+
const result = parser10.parse(grammar8, "path-template", pathTemplate2);
|
|
38811
37214
|
return {
|
|
38812
37215
|
result,
|
|
38813
37216
|
ast: parser10.ast
|
|
38814
37217
|
};
|
|
38815
37218
|
};
|
|
38816
|
-
var
|
|
37219
|
+
var parse_default3 = parse5;
|
|
38817
37220
|
|
|
38818
37221
|
// ../../node_modules/.bun/openapi-path-templating@2.2.1/node_modules/openapi-path-templating/es/resolve.mjs
|
|
38819
|
-
var
|
|
37222
|
+
var isEncoded = (parameterValue) => {
|
|
38820
37223
|
try {
|
|
38821
37224
|
return typeof parameterValue === "string" && decodeURIComponent(parameterValue) !== parameterValue;
|
|
38822
37225
|
} catch {
|
|
@@ -38824,12 +37227,12 @@ var isEncoded2 = (parameterValue) => {
|
|
|
38824
37227
|
}
|
|
38825
37228
|
};
|
|
38826
37229
|
var encodePathComponent = (parameterValue) => {
|
|
38827
|
-
if (
|
|
37230
|
+
if (isEncoded(parameterValue)) {
|
|
38828
37231
|
return parameterValue;
|
|
38829
37232
|
}
|
|
38830
37233
|
return encodeURIComponent(parameterValue).replace(/%5B/g, "[").replace(/%5D/g, "]");
|
|
38831
37234
|
};
|
|
38832
|
-
var
|
|
37235
|
+
var significantTypes = ["slash", "path-literal", "template-expression-param-name"];
|
|
38833
37236
|
var resolve3 = (pathTemplate2, parameters, options = {}) => {
|
|
38834
37237
|
const defaultOptions4 = {
|
|
38835
37238
|
encoder: encodePathComponent
|
|
@@ -38838,11 +37241,11 @@ var resolve3 = (pathTemplate2, parameters, options = {}) => {
|
|
|
38838
37241
|
...defaultOptions4,
|
|
38839
37242
|
...options
|
|
38840
37243
|
};
|
|
38841
|
-
const parseResult =
|
|
37244
|
+
const parseResult = parse_default3(pathTemplate2);
|
|
38842
37245
|
if (!parseResult.result.success) return pathTemplate2;
|
|
38843
37246
|
const parts = [];
|
|
38844
37247
|
parseResult.ast.translate(parts);
|
|
38845
|
-
const resolvedParts = parts.filter(([type4]) =>
|
|
37248
|
+
const resolvedParts = parts.filter(([type4]) => significantTypes.includes(type4)).map(([type4, value]) => {
|
|
38846
37249
|
if (type4 === "template-expression-param-name") {
|
|
38847
37250
|
return Object.prototype.hasOwnProperty.call(parameters, value) ? mergedOptions.encoder(parameters[value], value) : `{${value}}`;
|
|
38848
37251
|
}
|
|
@@ -38853,8 +37256,8 @@ var resolve3 = (pathTemplate2, parameters, options = {}) => {
|
|
|
38853
37256
|
var resolve_default3 = resolve3;
|
|
38854
37257
|
|
|
38855
37258
|
// ../../node_modules/.bun/openapi-path-templating@2.2.1/node_modules/openapi-path-templating/es/normalization/percent-encoding.mjs
|
|
38856
|
-
var
|
|
38857
|
-
var parser5 = new
|
|
37259
|
+
var grammar9 = new grammar7();
|
|
37260
|
+
var parser5 = new Parser();
|
|
38858
37261
|
|
|
38859
37262
|
// ../../node_modules/.bun/swagger-client@3.38.2/node_modules/swagger-client/es/execute/swagger2/parameter-builders.js
|
|
38860
37263
|
var parameter_builders_default = {
|
|
@@ -38975,7 +37378,7 @@ function serialize(value, mediaType) {
|
|
|
38975
37378
|
}
|
|
38976
37379
|
|
|
38977
37380
|
// ../../node_modules/.bun/@swaggerexpert+cookie@2.0.2/node_modules/@swaggerexpert/cookie/es/grammar.mjs
|
|
38978
|
-
function
|
|
37381
|
+
function grammar10() {
|
|
38979
37382
|
this.grammarObject = "grammarObject";
|
|
38980
37383
|
this.rules = [];
|
|
38981
37384
|
this.rules[0] = {
|
|
@@ -39834,7 +38237,7 @@ function grammar12() {
|
|
|
39834
38237
|
}
|
|
39835
38238
|
|
|
39836
38239
|
// ../../node_modules/.bun/@swaggerexpert+cookie@2.0.2/node_modules/@swaggerexpert/cookie/es/cookie/parse/index.mjs
|
|
39837
|
-
var
|
|
38240
|
+
var grammar11 = new grammar10();
|
|
39838
38241
|
|
|
39839
38242
|
// ../../node_modules/.bun/@swaggerexpert+cookie@2.0.2/node_modules/@swaggerexpert/cookie/es/utils.mjs
|
|
39840
38243
|
var percentEncodeChar = (char) => {
|
|
@@ -39863,15 +38266,15 @@ var quote = (value) => {
|
|
|
39863
38266
|
var identity2 = (a) => a;
|
|
39864
38267
|
|
|
39865
38268
|
// ../../node_modules/.bun/@swaggerexpert+cookie@2.0.2/node_modules/@swaggerexpert/cookie/es/cookie/test/cookie-value.mjs
|
|
39866
|
-
var parser6 = new
|
|
39867
|
-
var
|
|
38269
|
+
var parser6 = new Parser();
|
|
38270
|
+
var grammar12 = new grammar10();
|
|
39868
38271
|
var testCookieValue = (cookieValue, {
|
|
39869
38272
|
strict = true,
|
|
39870
38273
|
quoted = null
|
|
39871
38274
|
} = {}) => {
|
|
39872
38275
|
try {
|
|
39873
|
-
const
|
|
39874
|
-
const result = parser6.parse(
|
|
38276
|
+
const startRule = strict ? "cookie-value" : "lenient-cookie-value";
|
|
38277
|
+
const result = parser6.parse(grammar12, startRule, cookieValue);
|
|
39875
38278
|
if (typeof quoted === "boolean") {
|
|
39876
38279
|
return result.success && quoted === isQuoted(cookieValue);
|
|
39877
38280
|
}
|
|
@@ -39913,14 +38316,14 @@ var cookieValueStrictBase64urlEncoder = (cookieValue) => {
|
|
|
39913
38316
|
var cookie_value_strict_base64url_default = cookieValueStrictBase64urlEncoder;
|
|
39914
38317
|
|
|
39915
38318
|
// ../../node_modules/.bun/@swaggerexpert+cookie@2.0.2/node_modules/@swaggerexpert/cookie/es/cookie/test/cookie-name.mjs
|
|
39916
|
-
var parser7 = new
|
|
39917
|
-
var
|
|
38319
|
+
var parser7 = new Parser();
|
|
38320
|
+
var grammar13 = new grammar10();
|
|
39918
38321
|
var testCookieName = (cookieName, {
|
|
39919
38322
|
strict = true
|
|
39920
38323
|
} = {}) => {
|
|
39921
38324
|
try {
|
|
39922
|
-
const
|
|
39923
|
-
return parser7.parse(
|
|
38325
|
+
const startRule = strict ? "cookie-name" : "lenient-cookie-name";
|
|
38326
|
+
return parser7.parse(grammar13, startRule, cookieName).success;
|
|
39924
38327
|
} catch {
|
|
39925
38328
|
return false;
|
|
39926
38329
|
}
|
|
@@ -39983,8 +38386,8 @@ var serialize3 = (cookiePairs, options = {}) => {
|
|
|
39983
38386
|
var serialize_default2 = serialize3;
|
|
39984
38387
|
|
|
39985
38388
|
// ../../node_modules/.bun/@swaggerexpert+cookie@2.0.2/node_modules/@swaggerexpert/cookie/es/set-cookie/serialize/encoders/cookie-value-strict-percent.mjs
|
|
39986
|
-
var parser8 = new
|
|
39987
|
-
var
|
|
38389
|
+
var parser8 = new Parser();
|
|
38390
|
+
var grammar14 = new grammar10();
|
|
39988
38391
|
var cookieValueStrictPercentEncoder = (cookieValue) => {
|
|
39989
38392
|
const value = String(cookieValue);
|
|
39990
38393
|
if (cookie_value_default2(value)) return value;
|
|
@@ -39992,15 +38395,15 @@ var cookieValueStrictPercentEncoder = (cookieValue) => {
|
|
|
39992
38395
|
const valueToEncode = isQuoted2 ? unquote(value) : value;
|
|
39993
38396
|
let result = "";
|
|
39994
38397
|
for (const char of valueToEncode) {
|
|
39995
|
-
result += parser8.parse(
|
|
38398
|
+
result += parser8.parse(grammar14, "cookie-octet", char).success ? char : percentEncodeChar(char);
|
|
39996
38399
|
}
|
|
39997
38400
|
return isQuoted2 ? quote(result) : result;
|
|
39998
38401
|
};
|
|
39999
38402
|
var cookie_value_strict_percent_default = cookieValueStrictPercentEncoder;
|
|
40000
38403
|
|
|
40001
38404
|
// ../../node_modules/.bun/@swaggerexpert+cookie@2.0.2/node_modules/@swaggerexpert/cookie/es/set-cookie/serialize/encoders/cookie-value-lenient-percent.mjs
|
|
40002
|
-
var parser9 = new
|
|
40003
|
-
var
|
|
38405
|
+
var parser9 = new Parser();
|
|
38406
|
+
var grammar15 = new grammar10();
|
|
40004
38407
|
|
|
40005
38408
|
// ../../node_modules/.bun/@swaggerexpert+cookie@2.0.2/node_modules/@swaggerexpert/cookie/es/set-cookie/serialize/validators/cookie-name-lenient.mjs
|
|
40006
38409
|
var cookieNameLenientValidator = (cookieName) => {
|
|
@@ -40758,8 +39161,8 @@ function oas3BaseUrl({
|
|
|
40758
39161
|
})) {
|
|
40759
39162
|
const selectedServerVariables = Object.entries({
|
|
40760
39163
|
...selectedServerObj.variables
|
|
40761
|
-
}).reduce((acc, [
|
|
40762
|
-
acc[
|
|
39164
|
+
}).reduce((acc, [serverVariableName, serverVariable]) => {
|
|
39165
|
+
acc[serverVariableName] = serverVariable.default;
|
|
40763
39166
|
return acc;
|
|
40764
39167
|
}, {});
|
|
40765
39168
|
selectedServerUrl = substitute_default(selectedServerUrl, {
|