datafolder 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +4 -1
  2. package/index.js +1 -1
  3. package/internal.md +5 -3
  4. package/package.json +7 -5
  5. package/scripts/airbnb.js +77 -72
  6. package/scripts/airbnb2.js +78 -73
  7. package/scripts/airbnb2_queries.js +181 -229
  8. package/scripts/airbnb_queries.js +214 -265
  9. package/scripts/convertBinFiles.js +47 -49
  10. package/scripts/downloadFile.js +41 -40
  11. package/scripts/express.js +44 -48
  12. package/scripts/fastify.js +71 -80
  13. package/scripts/flights.js +71 -75
  14. package/scripts/flights2.js +78 -81
  15. package/scripts/flights2_queries.js +417 -455
  16. package/scripts/flights_queries.js +381 -407
  17. package/src/QyAcl.d.ts +17 -0
  18. package/src/QyAcl.js +113 -116
  19. package/src/QyAclSaver.d.ts +4 -0
  20. package/src/QyAclSaver.js +3 -3
  21. package/src/QyAclSaver_Worker.d.ts +9 -0
  22. package/src/QyAclSaver_Worker.js +2 -4
  23. package/src/QyAclWriter.d.ts +5 -0
  24. package/src/QyBatch.d.ts +42 -0
  25. package/src/QyBatch.js +8 -8
  26. package/src/QyBinWriter.d.ts +15 -0
  27. package/src/QyCD.d.ts +37 -0
  28. package/src/QyCD.js +8 -6
  29. package/src/QyCache.d.ts +44 -0
  30. package/src/QyCache.js +65 -59
  31. package/src/QyCompressor.d.ts +9 -0
  32. package/src/QyCompressor.js +29 -29
  33. package/src/QyCompressor_Worker.d.ts +1 -0
  34. package/src/QyDB.d.ts +42 -0
  35. package/src/QyDB.js +13 -11
  36. package/src/QyDefaultOptions.d.ts +1 -0
  37. package/src/QyDefaultOptions.js +3 -0
  38. package/src/QyDir.d.ts +48 -0
  39. package/src/QyDir.js +41 -41
  40. package/src/QyFetch.d.ts +7 -0
  41. package/src/QyFetch.js +2 -3
  42. package/src/QyFile.d.ts +19 -0
  43. package/src/QyFile.js +35 -34
  44. package/src/QyFileContentUtils.d.ts +13 -0
  45. package/src/QyFileContentUtils.js +126 -126
  46. package/src/QyFileLogger.d.ts +11 -0
  47. package/src/QyIndex.d.ts +6 -0
  48. package/src/QyIndex.js +73 -75
  49. package/src/QyIndexPropTree.d.ts +7 -0
  50. package/src/QyIndexPropTree.js +24 -24
  51. package/src/QyIntersectNode.d.ts +7 -0
  52. package/src/QyIntersectNode.js +15 -15
  53. package/src/QyItem.d.ts +30 -0
  54. package/src/QyItem.js +32 -28
  55. package/src/QyJsonSaver.d.ts +6 -0
  56. package/src/QyKVData.d.ts +12 -0
  57. package/src/QyKVData.js +11 -10
  58. package/src/QyKVDataCleaner.d.ts +4 -0
  59. package/src/QyKVDataCleaner.js +1 -1
  60. package/src/QyKVDataCleaner_Worker.d.ts +13 -0
  61. package/src/QyKVDataCleaner_Worker.js +2 -4
  62. package/src/QyKVDataLoader.d.ts +9 -0
  63. package/src/QyKVDataLoader.js +11 -11
  64. package/src/QyKVDataSaver.d.ts +4 -0
  65. package/src/QyKVDataSaver.js +6 -6
  66. package/src/QyKVDataSaver_Worker.d.ts +13 -0
  67. package/src/QyKVDataSaver_Worker.js +7 -9
  68. package/src/QyLogFileSaver.d.ts +4 -0
  69. package/src/QyLogFileSaver.js +1 -1
  70. package/src/QyLogFileSaver_Worker.d.ts +8 -0
  71. package/src/QyLogFileSaver_Worker.js +2 -4
  72. package/src/QyLogger.d.ts +10 -0
  73. package/src/QyLogger.js +40 -40
  74. package/src/QyMessageWorker.d.ts +5 -0
  75. package/src/QyMessageWorker.js +7 -7
  76. package/src/QyMessager.d.ts +7 -0
  77. package/src/QyMessager.js +30 -27
  78. package/src/QyMessager_Run.d.ts +1 -0
  79. package/src/QyMessager_Run.js +11 -6
  80. package/src/QyMod.d.ts +1 -0
  81. package/src/QyMod.js +6 -6
  82. package/src/QyOpRunner.d.ts +10 -0
  83. package/src/QyOpRunner.js +39 -39
  84. package/src/QyQueue.d.ts +11 -0
  85. package/src/QySaver.d.ts +10 -0
  86. package/src/QySnapshotCompactor.d.ts +4 -0
  87. package/src/QySnapshotCompactor.js +1 -1
  88. package/src/QySnapshotCompactor_Worker.d.ts +11 -0
  89. package/src/QySnapshotCompactor_Worker.js +2 -4
  90. package/src/QySnapshotSaver.d.ts +4 -0
  91. package/src/QySnapshotSaver.js +1 -1
  92. package/src/QySnapshotSaver_Worker.d.ts +16 -0
  93. package/src/QySnapshotSaver_Worker.js +17 -16
  94. package/src/QySnapshots.d.ts +27 -0
  95. package/src/QySnapshots.js +3 -3
  96. package/src/QyStructure.d.ts +1 -0
  97. package/src/QyStructure.js +18 -18
  98. package/src/QyTrigger.d.ts +9 -0
  99. package/src/QyTrigger.js +30 -30
  100. package/src/QyUnionNode.d.ts +17 -0
  101. package/src/QyUnionNode.js +2 -2
  102. package/src/QyUtils.d.ts +53 -0
  103. package/src/QyUtils.js +140 -117
  104. package/src/QyWorker.d.ts +5 -0
  105. package/src/QyWorker.js +18 -18
  106. package/src/hackernews.d.ts +1 -0
  107. package/src/hackernews.js +59 -47
  108. package/src/rpc/getRpcFiles.js +1 -0
  109. package/src/simulate.d.ts +1 -0
  110. package/src/simulate2.d.ts +1 -0
  111. package/src/soc_pokec.d.ts +1 -0
  112. package/static/codemirror.bundle/editor.bundle.js +399 -184
  113. package/static/datafolderui/QyStyledElement.js +2 -2
  114. package/static/datafolderui/QyUIFolderViewer.js +97 -77
  115. package/static/datafolderui/QyUIUtils.js +4 -4
  116. package/static/datafolderui/code-mirror.js +7 -7
  117. package/static/datafolderui/display-tree.js +13 -10
  118. package/static/datafolderui/hscrpt.js +26 -7
  119. package/static/datafolderui/json-view.js +27 -0
  120. package/static/datafolderui/main-page.js +65 -37
  121. package/static/datafolderui/query-editor.js +8 -8
  122. package/static/datafolderui/rpc-editor.js +31 -0
  123. package/static/datafolderui/trigger-editor.js +9 -6
  124. package/static/datafolderui/QyUIFolderTree.js +0 -188
@@ -1,229 +1,181 @@
1
- import { deepEqual } from "node:assert/strict";
2
-
3
- function query1(qyDB) {
4
- console.time("query1");
5
- deepEqual(
6
- qyDB
7
- .queryFiles(["airbnb", "Loft", "Entire home/apt", "Real Bed"], {
8
- address: { street: "Porto, Porto, Portugal" },
9
- })
10
- .map((x) => x.prop("name")),
11
- [
12
- "Porto city centre apartment H",
13
- "Romantic loft near historic center",
14
- "Lovely sun light in a stylish loft, Downtown Spot",
15
- "Charming & Sunny Mezzanine Loft",
16
- "Be Happy in Porto",
17
- "Quarry Apartment",
18
- "Loft with balcony and view of Casa da Música PORTO",
19
- "For 4 or 6 - Wonderful Apartment downtown",
20
- "Clérigos Apartments - Apt. 4E for 2/3 Pax",
21
- "Bright Top Floor Two Rooms Apartment w/ Terrace",
22
- "ReUrban Flats - Santa Catarina #3",
23
- "The Blue and White Porto House - Vintage",
24
- "4twoLoft at Great Location",
25
- "Step In Porto - Loft w/Mezzanine",
26
- "Your OWM Invicta",
27
- "Pury Apartments",
28
- "Live Porto & Douro - Breiner III",
29
- ],
30
- );
31
- console.timeEnd("query1");
32
- }
33
- function query2(qyDB) {
34
- console.time("query2");
35
- deepEqual(
36
- qyDB
37
- .queryFiles(
38
- ["airbnb", "Loft", "Entire home/apt", "Real Bed"],
39
- {
40
- address: { street: "Porto, Porto, Portugal" },
41
- },
42
- 9,
43
- )
44
- .map((x) => x.prop("name")),
45
- [
46
- "Porto city centre apartment H",
47
- "Romantic loft near historic center",
48
- "Lovely sun light in a stylish loft, Downtown Spot",
49
- "Charming & Sunny Mezzanine Loft",
50
- "Be Happy in Porto",
51
- "Quarry Apartment",
52
- "Loft with balcony and view of Casa da Música PORTO",
53
- "For 4 or 6 - Wonderful Apartment downtown",
54
- "Clérigos Apartments - Apt. 4E for 2/3 Pax",
55
- ],
56
- );
57
- console.timeEnd("query2");
58
- }
59
- function query3(qyDB) {
60
- console.time("query3");
61
- deepEqual(
62
- qyDB
63
- .queryFiles(
64
- ["airbnb", "Loft", "Entire home/apt", "Real Bed"],
65
- { address: { street: "Porto, Porto, Portugal" } },
66
- 9,
67
- 9,
68
- )
69
- .map((x) => x.prop("name")),
70
- [
71
- "Bright Top Floor Two Rooms Apartment w/ Terrace",
72
- "ReUrban Flats - Santa Catarina #3",
73
- "The Blue and White Porto House - Vintage",
74
- "4twoLoft at Great Location",
75
- "Step In Porto - Loft w/Mezzanine",
76
- "Your OWM Invicta",
77
- "Pury Apartments",
78
- "Live Porto & Douro - Breiner III",
79
- ],
80
- );
81
- console.timeEnd("query3");
82
- }
83
- function query4(qyDB) {
84
- console.time("query4");
85
- deepEqual(
86
- qyDB.fetch
87
- .queryFilesMulti([
88
- [["airbnb", "Loft", "Entire home/apt", "Real Bed"], { address: { street: "Porto, Porto, Portugal" } }],
89
- ["airbnb/Loft/**", { minimum_nights: (x) => x >= 60 }],
90
- ])
91
- .run()[0]
92
- .map((x) => x.prop("name"))
93
- .sort(),
94
- [
95
- "Porto city centre apartment H",
96
- "Romantic loft near historic center",
97
- "Lovely sun light in a stylish loft, Downtown Spot",
98
- "Charming & Sunny Mezzanine Loft",
99
- "Brand New Luxury Downtown Studio",
100
- "Be Happy in Porto",
101
- "Quarry Apartment",
102
- "Loft with balcony and view of Casa da Música PORTO",
103
- "For 4 or 6 - Wonderful Apartment downtown",
104
- "Clérigos Apartments - Apt. 4E for 2/3 Pax",
105
- "Bright Top Floor Two Rooms Apartment w/ Terrace",
106
- "ReUrban Flats - Santa Catarina #3",
107
- "The Blue and White Porto House - Vintage",
108
- "4twoLoft at Great Location",
109
- "Step In Porto - Loft w/Mezzanine",
110
- "Your OWM Invicta",
111
- "Pury Apartments",
112
- "Live Porto & Douro - Breiner III",
113
- ].sort(),
114
- );
115
- console.timeEnd("query4");
116
- }
117
- function query5(qyDB) {
118
- console.time("query5");
119
- deepEqual(
120
- qyDB
121
- .queryFilesMulti(
122
- [
123
- [
124
- ["airbnb", "Loft", "Entire home/apt", "Real Bed"],
125
- { address: { street: "Porto, Porto, Portugal" } },
126
- ],
127
- ["airbnb/Loft/**", { minimum_nights: (x) => x >= 60 }],
128
- ],
129
- 3,
130
- )
131
- .map((x) => x.prop("name")),
132
- [
133
- "Porto city centre apartment H",
134
- "Romantic loft near historic center",
135
- "Lovely sun light in a stylish loft, Downtown Spot",
136
- ],
137
- );
138
- console.timeEnd("query5");
139
- }
140
- function query6(qyDB) {
141
- console.time("query6");
142
- deepEqual(
143
- qyDB
144
- .queryFilesMulti(
145
- [
146
- [
147
- ["airbnb", "Loft", "Entire home/apt", "Real Bed"],
148
- { address: { street: "Porto, Porto, Portugal" } },
149
- ],
150
- ["airbnb/Loft/**", { minimum_nights: (x) => x >= 60 }],
151
- ],
152
- 20,
153
- 10,
154
- )
155
- .map((x) => x.prop("name")),
156
- [
157
- "ReUrban Flats - Santa Catarina #3",
158
- "The Blue and White Porto House - Vintage",
159
- "4twoLoft at Great Location",
160
- "Step In Porto - Loft w/Mezzanine",
161
- "Your OWM Invicta",
162
- "Pury Apartments",
163
- "Live Porto & Douro - Breiner III",
164
- "Brand New Luxury Downtown Studio",
165
- ],
166
- );
167
- console.timeEnd("query6");
168
- }
169
- function query7(qyDB) {
170
- console.time("query7");
171
- deepEqual(
172
- qyDB.queryFiles(["airbnb", "Loft", "**"], { minimum_nights: (x) => x >= 60 }).map((x) => x.prop("name")),
173
- ["Romantic loft near historic center", "Brand New Luxury Downtown Studio"],
174
- );
175
- console.timeEnd("query7");
176
- }
177
- function query8(qyDB) {
178
- console.time("query8");
179
- deepEqual(
180
- qyDB.queryFiles(["airbnb", "Loft", ""], { minimum_nights: (x) => x >= 60 }, 10, 10).map((x) => x.prop("name")),
181
- [],
182
- );
183
- console.timeEnd("query8");
184
- }
185
- function query9(qyDB) {
186
- console.time("query9");
187
- deepEqual(
188
- qyDB
189
- .queryFilesMulti(
190
- [
191
- [
192
- ["airbnb", "Loft", "Entire home/apt", "Real Bed"],
193
- { address: { street: "Porto, Porto, Portugal" } },
194
- ],
195
- ["airbnb/Loft/**", { minimum_nights: (x) => x >= 60 }],
196
- ],
197
- 3,
198
- )
199
- .map((x) => x.prop("name")),
200
- [
201
- "Porto city centre apartment H",
202
- "Romantic loft near historic center",
203
- "Lovely sun light in a stylish loft, Downtown Spot",
204
- ],
205
- );
206
- console.timeEnd("query9");
207
- }
208
- function runQueries(qyDB) {
209
- query1(qyDB);
210
- query1(qyDB);
211
- query2(qyDB);
212
- query2(qyDB);
213
- query3(qyDB);
214
- query3(qyDB);
215
- query4(qyDB);
216
- query4(qyDB);
217
- query5(qyDB);
218
- query5(qyDB);
219
- query6(qyDB);
220
- query6(qyDB);
221
- query7(qyDB);
222
- query7(qyDB);
223
- query8(qyDB);
224
- query8(qyDB);
225
- query9(qyDB);
226
- query9(qyDB);
227
- }
228
-
229
- export { runQueries };
1
+ import { deepEqual } from "node:assert/strict";
2
+ function query1(qyDB) {
3
+ console.time("query1");
4
+ deepEqual(qyDB
5
+ .queryFiles(["airbnb", "Loft", "Entire home/apt", "Real Bed"], {
6
+ address: { street: "Porto, Porto, Portugal" },
7
+ })
8
+ .map((x) => x.prop("name")), [
9
+ "Porto city centre apartment H",
10
+ "Romantic loft near historic center",
11
+ "Lovely sun light in a stylish loft, Downtown Spot",
12
+ "Charming & Sunny Mezzanine Loft",
13
+ "Be Happy in Porto",
14
+ "Quarry Apartment",
15
+ "Loft with balcony and view of Casa da Música PORTO",
16
+ "For 4 or 6 - Wonderful Apartment downtown",
17
+ "Clérigos Apartments - Apt. 4E for 2/3 Pax",
18
+ "Bright Top Floor Two Rooms Apartment w/ Terrace",
19
+ "ReUrban Flats - Santa Catarina #3",
20
+ "The Blue and White Porto House - Vintage",
21
+ "4twoLoft at Great Location",
22
+ "Step In Porto - Loft w/Mezzanine",
23
+ "Your OWM Invicta",
24
+ "Pury Apartments",
25
+ "Live Porto & Douro - Breiner III",
26
+ ]);
27
+ console.timeEnd("query1");
28
+ }
29
+ function query2(qyDB) {
30
+ console.time("query2");
31
+ deepEqual(qyDB
32
+ .queryFiles(["airbnb", "Loft", "Entire home/apt", "Real Bed"], {
33
+ address: { street: "Porto, Porto, Portugal" },
34
+ }, 9)
35
+ .map((x) => x.prop("name")), [
36
+ "Porto city centre apartment H",
37
+ "Romantic loft near historic center",
38
+ "Lovely sun light in a stylish loft, Downtown Spot",
39
+ "Charming & Sunny Mezzanine Loft",
40
+ "Be Happy in Porto",
41
+ "Quarry Apartment",
42
+ "Loft with balcony and view of Casa da Música PORTO",
43
+ "For 4 or 6 - Wonderful Apartment downtown",
44
+ "Clérigos Apartments - Apt. 4E for 2/3 Pax",
45
+ ]);
46
+ console.timeEnd("query2");
47
+ }
48
+ function query3(qyDB) {
49
+ console.time("query3");
50
+ deepEqual(qyDB
51
+ .queryFiles(["airbnb", "Loft", "Entire home/apt", "Real Bed"], { address: { street: "Porto, Porto, Portugal" } }, 9, 9)
52
+ .map((x) => x.prop("name")), [
53
+ "Bright Top Floor Two Rooms Apartment w/ Terrace",
54
+ "ReUrban Flats - Santa Catarina #3",
55
+ "The Blue and White Porto House - Vintage",
56
+ "4twoLoft at Great Location",
57
+ "Step In Porto - Loft w/Mezzanine",
58
+ "Your OWM Invicta",
59
+ "Pury Apartments",
60
+ "Live Porto & Douro - Breiner III",
61
+ ]);
62
+ console.timeEnd("query3");
63
+ }
64
+ function query4(qyDB) {
65
+ console.time("query4");
66
+ deepEqual(qyDB.fetch
67
+ .queryFilesMulti([
68
+ [["airbnb", "Loft", "Entire home/apt", "Real Bed"], { address: { street: "Porto, Porto, Portugal" } }],
69
+ ["airbnb/Loft/**", { minimum_nights: (x) => x >= 60 }],
70
+ ])
71
+ .run()[0]
72
+ .map((x) => x.prop("name"))
73
+ .sort(), [
74
+ "Porto city centre apartment H",
75
+ "Romantic loft near historic center",
76
+ "Lovely sun light in a stylish loft, Downtown Spot",
77
+ "Charming & Sunny Mezzanine Loft",
78
+ "Brand New Luxury Downtown Studio",
79
+ "Be Happy in Porto",
80
+ "Quarry Apartment",
81
+ "Loft with balcony and view of Casa da Música PORTO",
82
+ "For 4 or 6 - Wonderful Apartment downtown",
83
+ "Clérigos Apartments - Apt. 4E for 2/3 Pax",
84
+ "Bright Top Floor Two Rooms Apartment w/ Terrace",
85
+ "ReUrban Flats - Santa Catarina #3",
86
+ "The Blue and White Porto House - Vintage",
87
+ "4twoLoft at Great Location",
88
+ "Step In Porto - Loft w/Mezzanine",
89
+ "Your OWM Invicta",
90
+ "Pury Apartments",
91
+ "Live Porto & Douro - Breiner III",
92
+ ].sort());
93
+ console.timeEnd("query4");
94
+ }
95
+ function query5(qyDB) {
96
+ console.time("query5");
97
+ deepEqual(qyDB
98
+ .queryFilesMulti([
99
+ [
100
+ ["airbnb", "Loft", "Entire home/apt", "Real Bed"],
101
+ { address: { street: "Porto, Porto, Portugal" } },
102
+ ],
103
+ ["airbnb/Loft/**", { minimum_nights: (x) => x >= 60 }],
104
+ ], 3)
105
+ .map((x) => x.prop("name")), [
106
+ "Porto city centre apartment H",
107
+ "Romantic loft near historic center",
108
+ "Lovely sun light in a stylish loft, Downtown Spot",
109
+ ]);
110
+ console.timeEnd("query5");
111
+ }
112
+ function query6(qyDB) {
113
+ console.time("query6");
114
+ deepEqual(qyDB
115
+ .queryFilesMulti([
116
+ [
117
+ ["airbnb", "Loft", "Entire home/apt", "Real Bed"],
118
+ { address: { street: "Porto, Porto, Portugal" } },
119
+ ],
120
+ ["airbnb/Loft/**", { minimum_nights: (x) => x >= 60 }],
121
+ ], 20, 10)
122
+ .map((x) => x.prop("name")), [
123
+ "ReUrban Flats - Santa Catarina #3",
124
+ "The Blue and White Porto House - Vintage",
125
+ "4twoLoft at Great Location",
126
+ "Step In Porto - Loft w/Mezzanine",
127
+ "Your OWM Invicta",
128
+ "Pury Apartments",
129
+ "Live Porto & Douro - Breiner III",
130
+ "Brand New Luxury Downtown Studio",
131
+ ]);
132
+ console.timeEnd("query6");
133
+ }
134
+ function query7(qyDB) {
135
+ console.time("query7");
136
+ deepEqual(qyDB.queryFiles(["airbnb", "Loft", "**"], { minimum_nights: (x) => x >= 60 }).map((x) => x.prop("name")), ["Romantic loft near historic center", "Brand New Luxury Downtown Studio"]);
137
+ console.timeEnd("query7");
138
+ }
139
+ function query8(qyDB) {
140
+ console.time("query8");
141
+ deepEqual(qyDB.queryFiles(["airbnb", "Loft", ""], { minimum_nights: (x) => x >= 60 }, 10, 10).map((x) => x.prop("name")), []);
142
+ console.timeEnd("query8");
143
+ }
144
+ function query9(qyDB) {
145
+ console.time("query9");
146
+ deepEqual(qyDB
147
+ .queryFilesMulti([
148
+ [
149
+ ["airbnb", "Loft", "Entire home/apt", "Real Bed"],
150
+ { address: { street: "Porto, Porto, Portugal" } },
151
+ ],
152
+ ["airbnb/Loft/**", { minimum_nights: (x) => x >= 60 }],
153
+ ], 3)
154
+ .map((x) => x.prop("name")), [
155
+ "Porto city centre apartment H",
156
+ "Romantic loft near historic center",
157
+ "Lovely sun light in a stylish loft, Downtown Spot",
158
+ ]);
159
+ console.timeEnd("query9");
160
+ }
161
+ function runQueries(qyDB) {
162
+ query1(qyDB);
163
+ query1(qyDB);
164
+ query2(qyDB);
165
+ query2(qyDB);
166
+ query3(qyDB);
167
+ query3(qyDB);
168
+ query4(qyDB);
169
+ query4(qyDB);
170
+ query5(qyDB);
171
+ query5(qyDB);
172
+ query6(qyDB);
173
+ query6(qyDB);
174
+ query7(qyDB);
175
+ query7(qyDB);
176
+ query8(qyDB);
177
+ query8(qyDB);
178
+ query9(qyDB);
179
+ query9(qyDB);
180
+ }
181
+ export { runQueries };