@naanlang/naan 1.0.0
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 +21 -0
- package/README.md +46 -0
- package/dist/env_web.js +431 -0
- package/dist/naan.min.js +73 -0
- package/frameworks/browser/browser.nlg +30 -0
- package/frameworks/browser/pouchdb/pouchdb.min.js +7 -0
- package/frameworks/browser/spark-md5/spark-md5.min.js +1 -0
- package/frameworks/browser/sworker.js +192 -0
- package/frameworks/browser/terminals.nlg +787 -0
- package/frameworks/browser/workers.nlg +386 -0
- package/frameworks/client/apiclient.nlg +183 -0
- package/frameworks/client/client.nlg +29 -0
- package/frameworks/client/psm_client.nlg +572 -0
- package/frameworks/common/common.nlg +464 -0
- package/frameworks/common/preferences.nlg +131 -0
- package/frameworks/common/repltools.nlg +100 -0
- package/frameworks/common/watching.nlg +97 -0
- package/frameworks/node/apiserver.nlg +399 -0
- package/frameworks/node/filesystem.nlg +1012 -0
- package/frameworks/node/gitter.nlg +234 -0
- package/frameworks/node/node.nlg +81 -0
- package/frameworks/node/psm_server.nlg +465 -0
- package/frameworks/node/worker.nlg +560 -0
- package/frameworks/project/build.nlg +1229 -0
- package/frameworks/project/jszip.js +30 -0
- package/frameworks/project/jszip.nlg +87 -0
- package/frameworks/project/proj_cliser.nlg +139 -0
- package/frameworks/project/proj_console.nlg +137 -0
- package/frameworks/project/proj_folder.nlg +143 -0
- package/frameworks/project/proj_lambda.nlg +137 -0
- package/frameworks/project/proj_static.nlg +138 -0
- package/frameworks/project/project.nlg +29 -0
- package/frameworks/project/projects.nlg +587 -0
- package/frameworks/project/uglifyjs.js +1 -0
- package/frameworks/project/uglifyjs.nlg +79 -0
- package/frameworks/running/debugcom.nlg +163 -0
- package/frameworks/running/debugnub.nlg +565 -0
- package/frameworks/running/debugutil.nlg +510 -0
- package/frameworks/running/executors.nlg +767 -0
- package/frameworks/running/running.nlg +151 -0
- package/frameworks/running/sourcecode.nlg +346 -0
- package/frameworks/running/taskexec.nlg +196 -0
- package/frameworks/storage/dbt_pouch.nlg +773 -0
- package/frameworks/storage/file_manager.nlg +772 -0
- package/frameworks/storage/psm.nlg +326 -0
- package/frameworks/storage/psm_dbtables.nlg +814 -0
- package/frameworks/storage/resources.nlg +445 -0
- package/frameworks/storage/storage.nlg +52 -0
- package/lib/browser/env_web.js +431 -0
- package/lib/browser/env_webworker.js +146 -0
- package/lib/browser/require.js +1653 -0
- package/lib/core/naanlib.js +73 -0
- package/lib/env_node.js +282 -0
- package/lib/env_nodeworker.js +165 -0
- package/lib/node_repl.js +25 -0
- package/lib/node_repl_init.nlg +52 -0
- package/package.json +13 -0
- package/plugins/gitClient/clientops.nlg +317 -0
- package/plugins/gitClient/gitClient.nlg +63 -0
- package/plugins/gitClient/gitutils.nlg +1331 -0
- package/plugins/gitClient/minimatch.js +945 -0
- package/plugins/gitClient/minimatch_license.txt +15 -0
- package/plugins/gitClient/minimatch_readme.md +208 -0
- package/plugins/nodeLib/nodeLib.nlg +26 -0
- package/plugins/nodeLib/node_cp.nlg +65 -0
- package/plugins/nodeLib/node_fs.nlg +137 -0
- package/plugins/nodeLib/node_https.nlg +172 -0
- package/plugins/nodeLib/node_util.nlg +180 -0
- package/plugins/serviceAws/aws/aws-sdk.min.js +88 -0
- package/plugins/serviceAws/aws/lambda_rest_index.js +122 -0
- package/plugins/serviceAws/aws/lambda_rest_init.nlg +58 -0
- package/plugins/serviceAws/aws/lambda_ws_index.js +498 -0
- package/plugins/serviceAws/aws/lambda_ws_init.nlg +49 -0
- package/plugins/serviceAws/aws_cloudwatchlogs.nlg +122 -0
- package/plugins/serviceAws/aws_cognito.nlg +76 -0
- package/plugins/serviceAws/aws_dynamo.nlg +509 -0
- package/plugins/serviceAws/aws_lambda.nlg +95 -0
- package/plugins/serviceAws/aws_s3.nlg +134 -0
- package/plugins/serviceAws/aws_utils.nlg +86 -0
- package/plugins/serviceAws/dbt_aws.nlg +769 -0
- package/plugins/serviceAws/lambda_naan_control.nlg +175 -0
- package/plugins/serviceAws/psm_aws.nlg +258 -0
- package/plugins/serviceAws/serviceAws.nlg +38 -0
- package/plugins/serviceGitHub/gitops.nlg +522 -0
- package/plugins/serviceGitHub/psm_github.nlg +205 -0
- package/plugins/serviceGitHub/serviceGitHub.nlg +65 -0
- package/plugins/serviceGitLab/gitops.nlg +528 -0
- package/plugins/serviceGitLab/psm_gitlab.nlg +205 -0
- package/plugins/serviceGitLab/serviceGitLab.nlg +65 -0
- package/test/harness.nlg +312 -0
- package/test/node_test.js +33 -0
- package/test/test_01_core.nlg +768 -0
- package/test/test_02_context.nlg +269 -0
- package/test/test_03_jsinterop.nlg +137 -0
- package/test/test_04_numerics.nlg +450 -0
- package/test/test_05_strings.nlg +63 -0
- package/test/test_06_lingoparse.nlg +500 -0
- package/test/test_07_lingo.nlg +623 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* lambda_naan_control.nlg
|
|
3
|
+
* serviceAws
|
|
4
|
+
*
|
|
5
|
+
* Access remote AWS lambda from local Naan.
|
|
6
|
+
*
|
|
7
|
+
* column positioning: // // !
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2019-2021 by Richard C. Zulch
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* lancoRest
|
|
16
|
+
*
|
|
17
|
+
* REST interface to the remote lambda.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
closure lancoRest(local url, client) {
|
|
22
|
+
client = new(object, this)
|
|
23
|
+
client.url = "https://s3cn49ir43.execute-api.us-east-1.amazonaws.com"
|
|
24
|
+
|
|
25
|
+
// clientRequest() - general request routine
|
|
26
|
+
|
|
27
|
+
closure clientRequest(method, path, options, cbReq, local request) {
|
|
28
|
+
request = xnew(js.w.XMLHttpRequest)
|
|
29
|
+
request.addEventListener("load", function (event) {
|
|
30
|
+
cbReq(false, request, event)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
request.addEventListener("error", function reqFailed(event, local errtext) {
|
|
34
|
+
if request.status == 0
|
|
35
|
+
errtext = "connectivity"
|
|
36
|
+
ellse
|
|
37
|
+
errtext = "request failed"
|
|
38
|
+
error = Error(errtext, {
|
|
39
|
+
status: request.status
|
|
40
|
+
method: method
|
|
41
|
+
path: path
|
|
42
|
+
})
|
|
43
|
+
cbReq(error, request, event)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
request.open(method, path, true)
|
|
47
|
+
if options.responseType
|
|
48
|
+
request.responseType = options.responseType
|
|
49
|
+
request.send(options.putdata)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//
|
|
53
|
+
// test()
|
|
54
|
+
//
|
|
55
|
+
|
|
56
|
+
client.test = closure test() {
|
|
57
|
+
clientRequest("GET", client.url.concat("/"), false, function (error, req, event) {
|
|
58
|
+
printline(req.responseText)
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// finis
|
|
63
|
+
|
|
64
|
+
client
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* lancoWs
|
|
70
|
+
*
|
|
71
|
+
* WebSockets interface to the remote lambda.
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
closure lancoWs(local url, laws) {
|
|
76
|
+
laws = new(object, this)
|
|
77
|
+
laws.url = "wss://8h5htw8bfj.execute-api.us-east-1.amazonaws.com/dev"
|
|
78
|
+
laws.name = name
|
|
79
|
+
|
|
80
|
+
// connect
|
|
81
|
+
// Connect with the host if not already connected.
|
|
82
|
+
function connect() {
|
|
83
|
+
if !laws.ws
|
|
84
|
+
laws.ws = xnew(js.w.WebSocket, laws.url)
|
|
85
|
+
|
|
86
|
+
// onopen
|
|
87
|
+
// The WebSocket connection is now open.
|
|
88
|
+
laws.ws.onopen = function onopen(e) {
|
|
89
|
+
debuglog("ws open")
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// onmessage
|
|
93
|
+
// A message was received from the worker via WebSockets.
|
|
94
|
+
|
|
95
|
+
laws.ws.onmessage = function onmessage(e, local message, msg) {
|
|
96
|
+
laws.doMessage(e.data)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// onerror
|
|
100
|
+
// An error occurred on the WebSocket connection.
|
|
101
|
+
laws.ws.onerror = function onerror(e) {
|
|
102
|
+
debuglog("ws error:", totuple(e))
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// onclose
|
|
106
|
+
// The WebSocket connection was closed.
|
|
107
|
+
laws.ws.onclose = function onclose(e) {
|
|
108
|
+
debuglog("ws close:", e.code, e.reason)
|
|
109
|
+
laws.ws = false
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//
|
|
114
|
+
// doMessage
|
|
115
|
+
//
|
|
116
|
+
// Process the specified undecoded message.
|
|
117
|
+
laws.doMessage = function doMessage(text, local message, msg) {
|
|
118
|
+
try {
|
|
119
|
+
message = new(JSONparse(text))
|
|
120
|
+
} catch {
|
|
121
|
+
if true
|
|
122
|
+
return (debuglog("can't decode incoming ws message:", exception))
|
|
123
|
+
}
|
|
124
|
+
if message.respOp == "msgout"
|
|
125
|
+
{ }
|
|
126
|
+
else
|
|
127
|
+
debuglog("unknown host response message:", message.respOp)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//
|
|
131
|
+
// sendControl
|
|
132
|
+
//
|
|
133
|
+
// Send a message to the worker controller.
|
|
134
|
+
|
|
135
|
+
laws.sendControl = function sendControl(action, payload) {
|
|
136
|
+
laws.ws.send(JSONstringify({
|
|
137
|
+
action: action
|
|
138
|
+
payload: payload
|
|
139
|
+
}))
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
//
|
|
143
|
+
// test()
|
|
144
|
+
//
|
|
145
|
+
|
|
146
|
+
laws.test = closure test() {
|
|
147
|
+
sendControl("test", "my load is large")
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// finis
|
|
151
|
+
|
|
152
|
+
connect() // connect right away to start receiving messages
|
|
153
|
+
laws
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
/*
|
|
158
|
+
* lancoInit
|
|
159
|
+
*
|
|
160
|
+
* Initialize the lambda control module.
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
function lancoInit(local manifest) {
|
|
165
|
+
|
|
166
|
+
manifest = `(lancoRest, lancoWs, lancoInit)
|
|
167
|
+
|
|
168
|
+
Naan.module.build(module.id, "lambda_naan_control", function(modobj, compobj) {
|
|
169
|
+
require("serviceAws/serviceAws.nlg")
|
|
170
|
+
compobj.manifest = manifest
|
|
171
|
+
modobj.exports.LambdaRest = lancoRest
|
|
172
|
+
modobj.exports.LambdaWs = lancoWs
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
} ();
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* psm_aws.nlg
|
|
3
|
+
* serviceAws
|
|
4
|
+
*
|
|
5
|
+
* PSM connector for AWS storage for browser and NodeJS.
|
|
6
|
+
*
|
|
7
|
+
* column positioning: // // !
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2020-2021 by Richard C. Zulch
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* psmaConnector
|
|
16
|
+
*
|
|
17
|
+
* Make a PSM connector for AWS bucket-based tables.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
closure psmaConnector(psm, local connClassID, connector, watch) {
|
|
22
|
+
connClassID = "S3DB"
|
|
23
|
+
require("./dbt_aws.nlg")
|
|
24
|
+
connector = new(object, this)
|
|
25
|
+
connector.psm = psm
|
|
26
|
+
connector.vault = psm.vault(connClassID, connector)
|
|
27
|
+
connector.label = "AWS S3"
|
|
28
|
+
watch = psm.watchable(connector)
|
|
29
|
+
|
|
30
|
+
// uifields
|
|
31
|
+
//
|
|
32
|
+
// Report the UI fields we need to add a resource
|
|
33
|
+
connector.uifields = function uifields() {
|
|
34
|
+
[{
|
|
35
|
+
label: "Key ID"
|
|
36
|
+
placeholder: "IAM keyID"
|
|
37
|
+
key: "keyID" },
|
|
38
|
+
{
|
|
39
|
+
label: "Key Secret"
|
|
40
|
+
placeholder: "IAM keySecret"
|
|
41
|
+
key: "keySecret"
|
|
42
|
+
type: "password" },
|
|
43
|
+
{
|
|
44
|
+
label: "AWS region"
|
|
45
|
+
placeholder: "e.g. us-east-1"
|
|
46
|
+
key: "region" },
|
|
47
|
+
{
|
|
48
|
+
label: "Bucket"
|
|
49
|
+
placeholder: "e.g. myBucketName"
|
|
50
|
+
key: "bucketName" }
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// hashResourceID
|
|
55
|
+
//
|
|
56
|
+
// Make a stable hash based on the resource credentials that we can persist or share between
|
|
57
|
+
// different domains accessing the same resource.
|
|
58
|
+
connector.hashResourceID = function hashResourceID(resource, local ident) {
|
|
59
|
+
ident = resource.region.concat(resource.region, resource.bucketName)
|
|
60
|
+
if resource.label
|
|
61
|
+
ident = ident.concat(resource.label)
|
|
62
|
+
HashSHA256(ident)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// findResource
|
|
66
|
+
//
|
|
67
|
+
// Find a resource with the specified contents, returning the resID or false. The loose criteria
|
|
68
|
+
// is: if added, would the specified contents be redundant to an existing resource?
|
|
69
|
+
connector.findResource = function findResource(resource, local resID, creds) {
|
|
70
|
+
for resID in listResources().1 {
|
|
71
|
+
creds = access(resID).1
|
|
72
|
+
if resource.region == creds.region && resource.bucketName == creds.bucketName
|
|
73
|
+
&& (!resource.label || resource.label == creds.name)
|
|
74
|
+
return (resID)
|
|
75
|
+
}
|
|
76
|
+
false
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// addResource
|
|
80
|
+
//
|
|
81
|
+
// Add credentials for a named resource. The label is a string. The resource is a dictionary
|
|
82
|
+
// comprising these keys:
|
|
83
|
+
// label - [optional] label we use for this resource
|
|
84
|
+
// keyID - AWS IAM keyID
|
|
85
|
+
// keySecret - AWS IAM keySecret
|
|
86
|
+
// region - AWS region
|
|
87
|
+
// bucketName - AWS bucketName
|
|
88
|
+
// hidden - [optional] don't enumerate to user
|
|
89
|
+
// locked - [optional] don't allow user delete
|
|
90
|
+
// The return value is (error, result) tuple. Error, if non-false, is a dictionary of field
|
|
91
|
+
// keys and error diagnostic strings. The special key "label" refers to the label string.
|
|
92
|
+
connector.addResource = function addResource(resource, local label, errors, creds, error, resID, data) {
|
|
93
|
+
function badField(str) { !string(str) || str.trim().length == 0 }
|
|
94
|
+
creds = {
|
|
95
|
+
keyID: resource.keyID,
|
|
96
|
+
keySecret: resource.keySecret,
|
|
97
|
+
region: resource.region,
|
|
98
|
+
bucketName: resource.bucketName
|
|
99
|
+
}
|
|
100
|
+
errors = { }
|
|
101
|
+
if resource.label
|
|
102
|
+
creds.label = resource.label
|
|
103
|
+
else
|
|
104
|
+
creds.label = resource.region.concat("-", resource.bucketName)
|
|
105
|
+
if badField(creds.label)
|
|
106
|
+
errors.label = "invalid label"
|
|
107
|
+
if badField(resource.keyID)
|
|
108
|
+
errors.keyID = "required field"
|
|
109
|
+
if badField(resource.keySecret)
|
|
110
|
+
errors.keySecret = "required field"
|
|
111
|
+
if badField(resource.region)
|
|
112
|
+
errors.region = "required field"
|
|
113
|
+
if badField(resource.bucketName)
|
|
114
|
+
errors.bucketName = "required field"
|
|
115
|
+
if length(errors) > 0
|
|
116
|
+
error = errors
|
|
117
|
+
else {
|
|
118
|
+
if resource.hidden
|
|
119
|
+
creds.hidden = resource.hidden
|
|
120
|
+
if resource.locked
|
|
121
|
+
creds.locked = resource.locked
|
|
122
|
+
resID = hashResourceID(resource)
|
|
123
|
+
`(error, data) = connector.vault.addResource(resID, creds)
|
|
124
|
+
if data {
|
|
125
|
+
watch.notify(connClassID, { added: [resID] })
|
|
126
|
+
data = resID }
|
|
127
|
+
}
|
|
128
|
+
list(error, data)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// getResource
|
|
132
|
+
//
|
|
133
|
+
// Get credentials for a named resource, matching the dictionary semantics of addResource. The
|
|
134
|
+
// result is a standard result tuple.
|
|
135
|
+
connector.getResource = function getResource(resID, local error, creds, resource) {
|
|
136
|
+
`(error, creds) = connector.vault.accessResource(resID)
|
|
137
|
+
if error
|
|
138
|
+
return (list(error))
|
|
139
|
+
resource = {
|
|
140
|
+
classID: connClassID
|
|
141
|
+
label: creds.label
|
|
142
|
+
}
|
|
143
|
+
if string(creds.keyID)
|
|
144
|
+
resource.keyID = creds.keyID
|
|
145
|
+
if string(creds.keySecret)
|
|
146
|
+
resource.keySecret = creds.keySecret
|
|
147
|
+
if string(creds.region)
|
|
148
|
+
resource.region = creds.region
|
|
149
|
+
if string(creds.bucketName)
|
|
150
|
+
resource.bucketName = creds.bucketName
|
|
151
|
+
list(false, resource)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// deleteResource
|
|
155
|
+
//
|
|
156
|
+
// Delete credentials for a resource
|
|
157
|
+
connector.deleteResource = function deleteResource(resID) {
|
|
158
|
+
connector.vault.deleteResource(resID)
|
|
159
|
+
watch.notify(connClassID, { deleted: [resID] })
|
|
160
|
+
list(false, { ok: true})
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// listResources
|
|
164
|
+
//
|
|
165
|
+
// List saved resources in our database
|
|
166
|
+
connector.listResources = function listResources() {
|
|
167
|
+
connector.vault.listResources()
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// info
|
|
171
|
+
//
|
|
172
|
+
// Return info for a resource.
|
|
173
|
+
connector.info = function info(resID, local error, creds, info) {
|
|
174
|
+
info = {
|
|
175
|
+
classID: "AWS S3"
|
|
176
|
+
type: "AWS S3 bucket"
|
|
177
|
+
services: ["DBT", "FS"]
|
|
178
|
+
}
|
|
179
|
+
`(error, creds) = connector.vault.accessResource(resID)
|
|
180
|
+
if creds {
|
|
181
|
+
if creds.label
|
|
182
|
+
info.name = creds.label
|
|
183
|
+
if creds.locked
|
|
184
|
+
info.locked = true
|
|
185
|
+
if creds.hidden
|
|
186
|
+
info.hidden = true
|
|
187
|
+
info.where = creds.bucketName.concat(" (", creds.region, ")")
|
|
188
|
+
}
|
|
189
|
+
list(false, info)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// access
|
|
193
|
+
//
|
|
194
|
+
// Return an S3 access object, which is the credentials to access an AWS S3 bucket.
|
|
195
|
+
|
|
196
|
+
connector.access = function access(resID, local error, creds, s3) {
|
|
197
|
+
`(error, creds) = connector.vault.accessResource(resID)
|
|
198
|
+
if error
|
|
199
|
+
return (list(error)) // can't access that resource
|
|
200
|
+
s3 = xnew(awsSDK.S3, {
|
|
201
|
+
apiVersion: "2006-03-01",
|
|
202
|
+
accessKeyId: creds.keyID,
|
|
203
|
+
secretAccessKey: creds.keySecret,
|
|
204
|
+
region: creds.region
|
|
205
|
+
params: {
|
|
206
|
+
Bucket: creds.bucketName }})
|
|
207
|
+
list(false, s3)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// connect
|
|
211
|
+
//
|
|
212
|
+
// Connect to an AWS bucket filesystem, returning a view.
|
|
213
|
+
|
|
214
|
+
connector.connect = function connect(resID, service, args, local error, s3, db, table) {
|
|
215
|
+
`(error, s3) = connector.access(resID)
|
|
216
|
+
if !error
|
|
217
|
+
`(error, db) = S3DB(s3) // get S3 as a database
|
|
218
|
+
if error
|
|
219
|
+
list(error)
|
|
220
|
+
else if service == "NideDB"
|
|
221
|
+
list(false, db)
|
|
222
|
+
else if service == "NideFS" {
|
|
223
|
+
rootpath = args.0 // connect to a NideFS filesystem
|
|
224
|
+
if !rootpath
|
|
225
|
+
return (Error("mandatory rootpath missing"))
|
|
226
|
+
`(error, table) = db.table(rootpath)
|
|
227
|
+
if error
|
|
228
|
+
list(error)
|
|
229
|
+
else
|
|
230
|
+
require("frameworks/storage/psm_dbtables.nlg").FSview(table, rootpath)
|
|
231
|
+
} else
|
|
232
|
+
list(Error("unsupported service", service))
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// finis
|
|
236
|
+
|
|
237
|
+
psm.register(connClassID, connector)
|
|
238
|
+
connector
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
/*
|
|
243
|
+
* psmaInit
|
|
244
|
+
*
|
|
245
|
+
* Initialize the AWS module.
|
|
246
|
+
*
|
|
247
|
+
*/
|
|
248
|
+
|
|
249
|
+
function psmaInit(local manifest) {
|
|
250
|
+
|
|
251
|
+
manifest = `(psmaConnector, psmaInit)
|
|
252
|
+
|
|
253
|
+
Naan.module.build(module.id, "psm_aws", function(modobj, compobj) {
|
|
254
|
+
compobj.manifest = manifest
|
|
255
|
+
modobj.exports.AwsConnector = psmaConnector
|
|
256
|
+
require("./serviceAws.nlg")
|
|
257
|
+
})
|
|
258
|
+
} ();
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* serviceAws.nlg
|
|
3
|
+
* serviceAws
|
|
4
|
+
*
|
|
5
|
+
* ServiceAWS module configuration and management for browser and NodeJS.
|
|
6
|
+
*
|
|
7
|
+
* column positioning: // // !
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2020-2022 by Richard C. Zulch
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* sawsInit
|
|
16
|
+
*
|
|
17
|
+
* Initialize the AWS module.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
function sawsInit(local manifest) {
|
|
22
|
+
manifest = `(sawsInit)
|
|
23
|
+
|
|
24
|
+
Naan.module.build(module.id, "serviceAws", function(modobj, compobj) {
|
|
25
|
+
compobj.manifest = manifest
|
|
26
|
+
require("frameworks/common").LiveImport()
|
|
27
|
+
function sawsPostload() {
|
|
28
|
+
if js.g
|
|
29
|
+
awsSDK = js.r("aws-sdk")
|
|
30
|
+
else
|
|
31
|
+
awsSDK = JsLoadScript(JSpath.join(module.locpath, "./aws/aws-sdk.min.js"), "AWS")
|
|
32
|
+
module.exports.awsSDK = awsSDK
|
|
33
|
+
if App.psm
|
|
34
|
+
require("./psm_aws.nlg").AwsConnector(App.psm)
|
|
35
|
+
}()
|
|
36
|
+
module.postload = sawsPostload
|
|
37
|
+
})
|
|
38
|
+
} ();
|