@naanlang/naan 1.0.9 → 1.0.10
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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/bin/index.js +2 -2
- package/dist/naan.min.js +1 -1
- package/frameworks/browser/sworker.js +17 -17
- package/frameworks/common/common.nlg +1 -1
- package/frameworks/project/projects.nlg +1 -1
- package/lib/browser/env_web.js +6 -6
- package/lib/core/naanlib.js +1 -1
- package/package.json +1 -1
- package/plugins/serviceAws/dbt_aws.nlg +15 -15
package/LICENSE.md
CHANGED
package/README.md
CHANGED
package/bin/index.js
CHANGED
|
@@ -58,11 +58,11 @@ process.argv.every((val, index) => {
|
|
|
58
58
|
return (true);
|
|
59
59
|
}
|
|
60
60
|
if (val == "--version") {
|
|
61
|
-
console.log("1.0.
|
|
61
|
+
console.log("1.0.10");
|
|
62
62
|
process.exit(0);
|
|
63
63
|
}
|
|
64
64
|
if (val == "--buildno") {
|
|
65
|
-
console.log("1.0.
|
|
65
|
+
console.log("1.0.10+1");
|
|
66
66
|
process.exit(0);
|
|
67
67
|
}
|
|
68
68
|
if (val.substring(0,1) == "-") {
|
package/dist/naan.min.js
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
var CurrentCacheName = "Naanlang-1.0.
|
|
39
|
+
var CurrentCacheName = "Naanlang-1.0.10+1";
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
//
|
|
@@ -89,11 +89,11 @@ var waitingForInit = []; // initialization functions, or
|
|
|
89
89
|
var pubVersion = event.data.hereIsMyVersion;
|
|
90
90
|
var sourceId = event.source.id; // client id of sender of message
|
|
91
91
|
msgPorts[sourceId] = msgport;
|
|
92
|
-
console.log("[1.0.
|
|
93
|
-
if (pubVersion != "1.0.
|
|
92
|
+
console.log("[1.0.10+1] received new msgport for", sourceId, pubID, "-", pubVersion);
|
|
93
|
+
if (pubVersion != "1.0.10+1")
|
|
94
94
|
msgport.postMessage({ // notify new version available
|
|
95
95
|
id: "upgrade",
|
|
96
|
-
version: "1.0.
|
|
96
|
+
version: "1.0.10+1"
|
|
97
97
|
});
|
|
98
98
|
Reaper(); // clean up obsolete info
|
|
99
99
|
|
|
@@ -107,7 +107,7 @@ var waitingForInit = []; // initialization functions, or
|
|
|
107
107
|
if (msg.id == "response")
|
|
108
108
|
processResponse(msg);
|
|
109
109
|
else if (msg.id == "text")
|
|
110
|
-
console.log("[1.0.
|
|
110
|
+
console.log("[1.0.10+1] msg received:", msg.text);
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
// send text to IDE log
|
|
@@ -118,7 +118,7 @@ var waitingForInit = []; // initialization functions, or
|
|
|
118
118
|
// don't clutter the log
|
|
119
119
|
msgport.postMessage({
|
|
120
120
|
id: "text",
|
|
121
|
-
text: "port received by 1.0.
|
|
121
|
+
text: "port received by 1.0.10+1",
|
|
122
122
|
});
|
|
123
123
|
*/
|
|
124
124
|
if (--pending === 0)
|
|
@@ -135,7 +135,7 @@ var waitingForInit = []; // initialization functions, or
|
|
|
135
135
|
includeUncontrolled: true
|
|
136
136
|
}).then(function(clientList) {
|
|
137
137
|
clientList.every(function(client) {
|
|
138
|
-
console.log("[1.0.
|
|
138
|
+
console.log("[1.0.10+1] requesting new msgport for", client.id);
|
|
139
139
|
++pending;
|
|
140
140
|
client.postMessage({ // tell client(s) we need this fetch source
|
|
141
141
|
msg: "Naan_need_fetch_port",
|
|
@@ -181,12 +181,12 @@ function Reaper() {
|
|
|
181
181
|
clients[clientList[clidex].id] = clientList[clidex];
|
|
182
182
|
for (var sourceId in msgPorts)
|
|
183
183
|
if (!clients[sourceId]) {
|
|
184
|
-
console.log("[1.0.
|
|
184
|
+
console.log("[1.0.10+1] source gone:", sourceId);
|
|
185
185
|
delete msgPorts[sourceId]; // no longer a source
|
|
186
186
|
}
|
|
187
187
|
for (var clientId in fetchPorts)
|
|
188
188
|
if (!clients[clientId]) {
|
|
189
|
-
console.log("[1.0.
|
|
189
|
+
console.log("[1.0.10+1] client gone:", clientId);
|
|
190
190
|
delete fetchPorts[clientId]; // no longer a client
|
|
191
191
|
}
|
|
192
192
|
for (var fqdex = 0; fqdex < fetchQueue.length; ++fqdex) {
|
|
@@ -220,13 +220,13 @@ function ClearCaches() {
|
|
|
220
220
|
return (Promise.all(
|
|
221
221
|
cacheNames.map(function(cacheName) {
|
|
222
222
|
if (cacheName != CurrentCacheName) {
|
|
223
|
-
console.log('[1.0.
|
|
223
|
+
console.log('[1.0.10+1] deleting old cache:', cacheName);
|
|
224
224
|
return (caches.delete(cacheName));
|
|
225
225
|
}
|
|
226
226
|
})
|
|
227
227
|
));
|
|
228
228
|
}).then(function() { // claim all clients
|
|
229
|
-
console.log('[1.0.
|
|
229
|
+
console.log('[1.0.10+1] claiming clients');
|
|
230
230
|
return (self.clients.claim());
|
|
231
231
|
});
|
|
232
232
|
return (promise);
|
|
@@ -269,7 +269,7 @@ function GetClientResponse(event, urlpath) {
|
|
|
269
269
|
msgport.postMessage({
|
|
270
270
|
id: "fetch",
|
|
271
271
|
seq: seqno,
|
|
272
|
-
version: "1.0.
|
|
272
|
+
version: "1.0.10+1",
|
|
273
273
|
request: {
|
|
274
274
|
method: event.request.method,
|
|
275
275
|
url: event.request.url
|
|
@@ -317,7 +317,7 @@ function GetClientResponse(event, urlpath) {
|
|
|
317
317
|
*/
|
|
318
318
|
|
|
319
319
|
self.addEventListener('install', function(event) {
|
|
320
|
-
console.log("[1.0.
|
|
320
|
+
console.log("[1.0.10+1] install");
|
|
321
321
|
self.skipWaiting();
|
|
322
322
|
});
|
|
323
323
|
|
|
@@ -339,7 +339,7 @@ self.addEventListener('fetch', function(event) {
|
|
|
339
339
|
var promise;
|
|
340
340
|
var url = new URL(event.request.url);
|
|
341
341
|
var nocache = event.request.method != "GET"
|
|
342
|
-
|| url.search.length !== 0 && url.searchParams.get("naanver") !== "
|
|
342
|
+
|| url.search.length !== 0 && url.searchParams.get("naanver") !== "580c5d8d85e0f1e49012dd76522f8a8b"
|
|
343
343
|
|| event.request.headers.get('range');
|
|
344
344
|
if (url.pathname.startsWith("/run/")) {
|
|
345
345
|
nocache = true;
|
|
@@ -356,7 +356,7 @@ self.addEventListener('fetch', function(event) {
|
|
|
356
356
|
}
|
|
357
357
|
else
|
|
358
358
|
promise = fetch(event.request).catch(function (e) {
|
|
359
|
-
console.log("[1.0.
|
|
359
|
+
console.log("[1.0.10+1] fetch failed", e);
|
|
360
360
|
return (new Response(undefined, {
|
|
361
361
|
status: 404,
|
|
362
362
|
statusText: "Fetch Failed"
|
|
@@ -385,14 +385,14 @@ self.addEventListener('fetch', function(event) {
|
|
|
385
385
|
*/
|
|
386
386
|
|
|
387
387
|
self.addEventListener('activate', function(event) {
|
|
388
|
-
console.log("[1.0.
|
|
388
|
+
console.log("[1.0.10+1] activate");
|
|
389
389
|
self.clients.matchAll({ // for debugging, list controlled clients
|
|
390
390
|
includeUncontrolled: true
|
|
391
391
|
}).then(function(clientList) {
|
|
392
392
|
var urls = clientList.map(function(client) {
|
|
393
393
|
return (client.url);
|
|
394
394
|
});
|
|
395
|
-
console.log('[1.0.
|
|
395
|
+
console.log('[1.0.10+1] matching clients:', urls.join(', '));
|
|
396
396
|
});
|
|
397
397
|
var promise = ClearCaches();
|
|
398
398
|
if (event.waitUntil)
|
|
@@ -176,7 +176,7 @@ function JsLoadScript(libpath, globalID, local scriptTag, fpath) {
|
|
|
176
176
|
} else if js.w { // load in browser context
|
|
177
177
|
pending = new(nonce)
|
|
178
178
|
scriptTag = js.w.document.createElement("script")
|
|
179
|
-
scriptTag.src = js.w.location.
|
|
179
|
+
scriptTag.src = JSpath.dirname(js.w.location.href).concat(fpath, requireQuery())
|
|
180
180
|
scriptTag.onload = function (event) {
|
|
181
181
|
jsScripts[libpath] = js.w[globalID]
|
|
182
182
|
pending.signal(js.w[globalID])
|
|
@@ -296,7 +296,7 @@ closure projConnector(projman, projtype, local connector, watch) {
|
|
|
296
296
|
*
|
|
297
297
|
* Nide.proj/
|
|
298
298
|
* nide_cliser.cfg - JSON definition of the project (see below)
|
|
299
|
-
* NaanIDE_version.txt - [default] substitution file defining 1.0.
|
|
299
|
+
* NaanIDE_version.txt - [default] substitution file defining 1.0.10+1 etc.
|
|
300
300
|
* NaanIDE_version_builds.txt - [default] contains current build number as decimal string
|
|
301
301
|
* build/ - [optional] default build output location
|
|
302
302
|
* NaanIDE.lic - [optional] defines Zulch Laboratories, Inc. and other license info
|
package/lib/browser/env_web.js
CHANGED
|
@@ -520,7 +520,7 @@ exports.NaanControllerWeb = function() {
|
|
|
520
520
|
statedoc.curversion = kStateCurrentVersion;
|
|
521
521
|
statedoc.firstver = kStateFirstVersion;
|
|
522
522
|
statedoc.licensee = "MIT-License";
|
|
523
|
-
statedoc.verstring = "1.0.
|
|
523
|
+
statedoc.verstring = "1.0.10+1";
|
|
524
524
|
statedoc.date = new Date().toISOString();
|
|
525
525
|
statedoc.prefs = prefs;
|
|
526
526
|
statedoc.naan = naanlib.saveState(false); // true to optimize, which is a bit slower
|
|
@@ -538,7 +538,7 @@ exports.NaanControllerWeb = function() {
|
|
|
538
538
|
|| statedoc.firstver > kStateCurrentVersion
|
|
539
539
|
|| statedoc.curversion < kStateFirstVersion
|
|
540
540
|
|| statedoc.licensee != "MIT-License"
|
|
541
|
-
|| statedoc.verstring != "1.0.
|
|
541
|
+
|| statedoc.verstring != "1.0.10+1")
|
|
542
542
|
{
|
|
543
543
|
localStorage.removeItem("NaanState_Hosted");
|
|
544
544
|
return (false);
|
|
@@ -597,7 +597,7 @@ exports.NaanControllerWeb = function() {
|
|
|
597
597
|
op: "VsiteOpen",
|
|
598
598
|
name: vsiteName,
|
|
599
599
|
naancont: contSelf,
|
|
600
|
-
title: vsiteName + " 1.0.
|
|
600
|
+
title: vsiteName + " 1.0.10+1"
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
603
|
} catch (e) {
|
|
@@ -611,7 +611,7 @@ exports.NaanControllerWeb = function() {
|
|
|
611
611
|
op: "VsiteClose",
|
|
612
612
|
name: vsiteName,
|
|
613
613
|
naancont: contSelf,
|
|
614
|
-
title: vsiteName + " 1.0.
|
|
614
|
+
title: vsiteName + " 1.0.10+1"
|
|
615
615
|
});
|
|
616
616
|
termTextOut("\x1b[90m\x1b[3m".concat("\nwindow closed", "\x1b[0m\n"));
|
|
617
617
|
}
|
|
@@ -626,8 +626,8 @@ exports.NaanControllerWeb = function() {
|
|
|
626
626
|
naanlib.banner();
|
|
627
627
|
var hostpath = naanlib.js.r("path").dirname(window.location.href);
|
|
628
628
|
naanlib.start({
|
|
629
|
-
cmd: 'App.version = "1.0.
|
|
630
|
-
+ 'App.cache = "
|
|
629
|
+
cmd: 'App.version = "1.0.10+1";;\r\n'
|
|
630
|
+
+ 'App.cache = "604febd141ddeb5891867e0c18fea956";;\r\n'
|
|
631
631
|
+ 'Naan.module.requireQuery({ naanver: App.cache });;\r\n'
|
|
632
632
|
+ 'Naan.module.webparse("naan_init.nlg", "' + hostpath + '", { naanver: App.cache });;\r\n'
|
|
633
633
|
});
|
package/lib/core/naanlib.js
CHANGED
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* column positioning: // // !
|
|
8
8
|
*
|
|
9
|
-
* Copyright (c) 2020-
|
|
9
|
+
* Copyright (c) 2020-2023 by Richard C. Zulch
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -77,7 +77,7 @@ closure dawsBucket(s3b, local bucket, s3) {
|
|
|
77
77
|
|
|
78
78
|
function s3GetCB(error, resp) {
|
|
79
79
|
if error
|
|
80
|
-
error = Error("can't get object", error, key)
|
|
80
|
+
error = Error("can't get object", { status: error.$metadata.httpStatusCode }, error, key)
|
|
81
81
|
else
|
|
82
82
|
resp.md5 = hashFromETag(resp.ETag)
|
|
83
83
|
callback(error, resp)
|
|
@@ -162,7 +162,7 @@ closure dawsBucket(s3b, local bucket, s3) {
|
|
|
162
162
|
md5 = HashMD5(data) // hex character string
|
|
163
163
|
s3.putObject(params, function(error, resp) {
|
|
164
164
|
if error
|
|
165
|
-
error = Error("can't put object", error, key)
|
|
165
|
+
error = Error("can't put object", { status: error.$metadata.httpStatusCode }, error, key)
|
|
166
166
|
else {
|
|
167
167
|
resp.length = length(data)
|
|
168
168
|
resp.md5 = hashFromETag(resp.ETag)
|
|
@@ -188,7 +188,7 @@ closure dawsBucket(s3b, local bucket, s3) {
|
|
|
188
188
|
}
|
|
189
189
|
s3.deleteObject(params, function(error, resp) {
|
|
190
190
|
if error
|
|
191
|
-
error = Error("can't delete object", error, key)
|
|
191
|
+
error = Error("can't delete object", { status: error.$metadata.httpStatusCode }, error, key)
|
|
192
192
|
callback(error, resp)
|
|
193
193
|
})
|
|
194
194
|
}
|
|
@@ -209,7 +209,7 @@ closure dawsBucket(s3b, local bucket, s3) {
|
|
|
209
209
|
}
|
|
210
210
|
s3.copyObject(params, function(error, resp) {
|
|
211
211
|
if error
|
|
212
|
-
error = Error("can't copy object", error)
|
|
212
|
+
error = Error("can't copy object", { status: error.$metadata.httpStatusCode }, error)
|
|
213
213
|
callback(error, resp)
|
|
214
214
|
})
|
|
215
215
|
}
|
|
@@ -245,7 +245,7 @@ closure dawsBucket(s3b, local bucket, s3) {
|
|
|
245
245
|
function listOne() { // list one chunk of objects
|
|
246
246
|
s3.listObjectsV2(params, function(error, resp) {
|
|
247
247
|
if error
|
|
248
|
-
callback(Error("list objects failed", error))
|
|
248
|
+
callback(Error("list objects failed", { status: error.$metadata.httpStatusCode }, error))
|
|
249
249
|
else {
|
|
250
250
|
if output {
|
|
251
251
|
output.Contents = output.Contents.concat(resp.Contents)
|
|
@@ -440,7 +440,7 @@ closure dawsTable(database, path, tableOptions, local table) {
|
|
|
440
440
|
cacheControl: tableOptions.cacheControl
|
|
441
441
|
}, function(error, resp) {
|
|
442
442
|
if error
|
|
443
|
-
error = Error("add failed", error, id, { status: error
|
|
443
|
+
error = Error("add failed", error, id, { status: error.status })
|
|
444
444
|
else {
|
|
445
445
|
doc._md5 = resp.md5 // update the original doc
|
|
446
446
|
doc.length = resp.length }
|
|
@@ -463,7 +463,7 @@ closure dawsTable(database, path, tableOptions, local table) {
|
|
|
463
463
|
cacheControl: tableOptions.cacheControl
|
|
464
464
|
}, function(error, resp) {
|
|
465
465
|
if error
|
|
466
|
-
error = Error("update failed", error, doc._id, { status: error
|
|
466
|
+
error = Error("update failed", error, doc._id, { status: error.status })
|
|
467
467
|
else {
|
|
468
468
|
doc._md5 = resp.md5 // update the original doc
|
|
469
469
|
doc.modified = undefined // we don't know exact modify date
|
|
@@ -484,7 +484,7 @@ closure dawsTable(database, path, tableOptions, local table) {
|
|
|
484
484
|
return (asyncResult(callback, Error("invalid argument")))
|
|
485
485
|
database.bucket.delete(doc._id, function(error, resp) {
|
|
486
486
|
if error
|
|
487
|
-
error = Error("delete failed", error, doc._id, { status: error
|
|
487
|
+
error = Error("delete failed", error, doc._id, { status: error.status })
|
|
488
488
|
callback(error, resp)
|
|
489
489
|
})
|
|
490
490
|
}
|
|
@@ -501,7 +501,7 @@ closure dawsTable(database, path, tableOptions, local table) {
|
|
|
501
501
|
return (asyncResult(callback, id)) // error from makeID
|
|
502
502
|
database.bucket.get(id, false, function(error, resp) {
|
|
503
503
|
if error
|
|
504
|
-
error = Error("get failed", error, id, { status: error
|
|
504
|
+
error = Error("get failed", error, id, { status: error.status })
|
|
505
505
|
else {
|
|
506
506
|
resp.key = key
|
|
507
507
|
resp = s3resp2doc(resp)
|
|
@@ -536,7 +536,7 @@ closure dawsTable(database, path, tableOptions, local table) {
|
|
|
536
536
|
return (asyncResult(callback, id)) // error from makeID
|
|
537
537
|
database.bucket.get(id, true, function(error, resp) {
|
|
538
538
|
if error
|
|
539
|
-
error = Error("md5 failed", error, id, { status: error
|
|
539
|
+
error = Error("md5 failed", error, id, { status: error.status })
|
|
540
540
|
else if resp._md5
|
|
541
541
|
resp = resp._md5
|
|
542
542
|
else
|
|
@@ -561,7 +561,7 @@ closure dawsTable(database, path, tableOptions, local table) {
|
|
|
561
561
|
if id.slice(-1) == "/"
|
|
562
562
|
database.bucket.list(id.slice(0,-1), true, function blcb(error, resp) {
|
|
563
563
|
if error
|
|
564
|
-
error = Error("head failed", error, id, { status: error
|
|
564
|
+
error = Error("head failed", error, id, { status: error.status })
|
|
565
565
|
else if id != resp.CommonPrefixes.0.Prefix {
|
|
566
566
|
error = Error("head not found", id, resp.CommonPrefixes.0.Prefix, { status: 404 })
|
|
567
567
|
resp = false
|
|
@@ -575,7 +575,7 @@ closure dawsTable(database, path, tableOptions, local table) {
|
|
|
575
575
|
else
|
|
576
576
|
database.bucket.get(id, true, function bgcb(error, resp) {
|
|
577
577
|
if error
|
|
578
|
-
error = Error("head failed", error, id, { status: error
|
|
578
|
+
error = Error("head failed", error, id, { status: error.status })
|
|
579
579
|
else {
|
|
580
580
|
resp.key = key
|
|
581
581
|
resp = s3resp2doc(resp)
|
|
@@ -602,7 +602,7 @@ closure dawsTable(database, path, tableOptions, local table) {
|
|
|
602
602
|
error = Error("copy failed", {
|
|
603
603
|
source: srckey
|
|
604
604
|
destination: destkey
|
|
605
|
-
status: error
|
|
605
|
+
status: error.status
|
|
606
606
|
}, error)
|
|
607
607
|
callback(error, resp)
|
|
608
608
|
})
|
|
@@ -694,7 +694,7 @@ closure dawsTable(database, path, tableOptions, local table) {
|
|
|
694
694
|
s3prefix = table.s3prefix
|
|
695
695
|
database.bucket.list(s3prefix, !options.deep, function(error, objects, local obj, key) {
|
|
696
696
|
if error
|
|
697
|
-
error = Error("records list failed", error, options.prefix, { status: error
|
|
697
|
+
error = Error("records list failed", error, options.prefix, { status: error.status })
|
|
698
698
|
else {
|
|
699
699
|
for obj in objects.Contents {
|
|
700
700
|
if obj.Key.startsWith(table.s3prefix)
|