retold-data-service 1.0.1 → 1.0.3
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/.config/configstore/update-notifier-npm-check-updates.json +1 -1
- package/.config/configstore/update-notifier-npm.json +1 -1
- package/.config/vscode-sqltools/runningInfo.json +13 -0
- package/.vscode/launch.json +24 -0
- package/.vscode/settings.json +17 -0
- package/Dockerfile_LUXURYCode +94 -0
- package/debug/Harness.js +34 -2
- package/debug/bookstore-configuration.json +29 -0
- package/debug/bookstore-serve-meadow-endpoint-apis.js +41 -0
- package/debug/data/books.csv +10001 -0
- package/debug/model/bookstore-api-endpoint-exercises.paw +0 -0
- package/debug/model/generated_documentation/Dictionary.md +1 -1
- package/debug/model/generated_documentation/Model-Author.md +1 -1
- package/debug/model/generated_documentation/Model-Book.md +1 -1
- package/debug/model/generated_documentation/Model-BookAuthorJoin.md +1 -1
- package/debug/model/generated_documentation/Model-BookPrice.md +1 -1
- package/debug/model/generated_documentation/Model-Review.md +1 -1
- package/debug/model/generated_documentation/ModelChangeTracking.md +1 -1
- package/debug/model/manual_scripts/MySQL-Laden-Entry.sh +17 -0
- package/debug/model/manual_scripts/MySQL-Security.sql +5 -0
- package/debug/model/manual_scripts/my.cnf +4 -0
- package/debug/model/sql_create/BookStore-CreateAndPopulateTables.sql +194 -0
- package/debug/package-lock.json +3999 -0
- package/debug/package.json +13 -0
- package/package.json +47 -17
- package/source/Retold-Data-Service.js +94 -296
- package/test/RetoldDataService_tests.js +16 -36
- package/test/model/fable-configuration.json +16 -0
- package/test/model/meadow/README.md +1 -0
- package/debug/Harness-Configuration.json +0 -51
- package/debug/model/Build-Database.sh +0 -22
- package/debug/model/generated_documentation/diagrams/Stricture_Output.dot +0 -13
- package/debug/model/generated_documentation/diagrams/full/Stricture_Output.dot +0 -13
- package/debug/model/generated_documentation/diagrams/full/Stricture_Output.png +0 -0
- package/debug/model/mysql/Model-CreateDatabase.mysql.sql +0 -116
- package/source/Cumulation-Settings-Default.js +0 -19
- package/source/Cumulation.js +0 -90
- package/source/GraphGet.js +0 -607
- package/source/ProviderHelpers/Meadow-Provider-Helper-ALASQL.js +0 -48
- package/source/ProviderHelpers/Meadow-Provider-Helper-Base.js +0 -46
- package/source/ProviderHelpers/Meadow-Provider-Helper-MySQL.js +0 -62
- package/test/basic_test_configurations/fable-config-load_model.json +0 -45
- package/test/model/generated_diagram/Stricture_Output.png +0 -0
- package/test/model/generated_documentation/Dictionary.md +0 -18
- package/test/model/generated_documentation/Model-Author.md +0 -20
- package/test/model/generated_documentation/Model-Book.md +0 -26
- package/test/model/generated_documentation/Model-BookAuthorJoin.md +0 -14
- package/test/model/generated_documentation/Model-BookPrice.md +0 -25
- package/test/model/generated_documentation/Model-Review.md +0 -22
- package/test/model/generated_documentation/ModelChangeTracking.md +0 -17
- package/test/model/meadow_model/BookStore-PICT.json +0 -1
- package/test/model/meadow_model/README.md +0 -1
- /package/debug/model/ddl/{Model.ddl → BookStore.ddl} +0 -0
- /package/{test → debug}/model/generated_diagram/README.md +0 -0
- /package/{test → debug}/model/generated_diagram/Stricture_Output.dot +0 -0
- /package/debug/model/{generated_documentation/diagrams → generated_diagram}/Stricture_Output.png +0 -0
- /package/{test → debug}/model/generated_documentation/README.md +0 -0
- /package/{test → debug}/model/manual_scripts/DropTables.sql +0 -0
- /package/{test → debug}/model/manual_scripts/README.md +0 -0
- /package/{test/model/meadow_schema → debug/model/meadow}/README.md +0 -0
- /package/{test → debug}/model/sql_create/BookStore-CreateDatabase.mysql.sql +0 -0
- /package/{test → debug}/model/sql_create/README.md +0 -0
- /package/test/model/{meadow_model/BookStore-Extended.json → Model-Extended.json} +0 -0
- /package/test/model/{meadow_model/BookStore.json → Model.json} +0 -0
- /package/test/model/{meadow_schema/BookStore-MeadowSchema-Author.json → meadow/Model-MeadowSchema-Author.json} +0 -0
- /package/test/model/{meadow_schema/BookStore-MeadowSchema-Book.json → meadow/Model-MeadowSchema-Book.json} +0 -0
- /package/test/model/{meadow_schema/BookStore-MeadowSchema-BookAuthorJoin.json → meadow/Model-MeadowSchema-BookAuthorJoin.json} +0 -0
- /package/test/model/{meadow_schema/BookStore-MeadowSchema-BookPrice.json → meadow/Model-MeadowSchema-BookPrice.json} +0 -0
- /package/test/model/{meadow_schema/BookStore-MeadowSchema-Review.json → meadow/Model-MeadowSchema-Review.json} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"numericVersion": 10000,
|
|
3
|
+
"releaseNotes": "https://vscode-sqltools.mteixeira.dev/changelog#v-1-0-0",
|
|
4
|
+
"run": 1684959097875,
|
|
5
|
+
"updated": false,
|
|
6
|
+
"version": "1.0.0",
|
|
7
|
+
"lastNotificationDate": 0,
|
|
8
|
+
"installedExtPlugins": {
|
|
9
|
+
"driver": [
|
|
10
|
+
"mtxr.sqltools-driver-mysql"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Launch Debug Harness",
|
|
9
|
+
"type": "node",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"outputCapture": "std",
|
|
12
|
+
"cwd": "/home/coder/retold-data-service/debug/",
|
|
13
|
+
"skipFiles": [
|
|
14
|
+
"<node_internals>/**"
|
|
15
|
+
],
|
|
16
|
+
"program": "${workspaceFolder}/debug/Harness.js",
|
|
17
|
+
"presentation": {
|
|
18
|
+
"hidden": false,
|
|
19
|
+
"group": "",
|
|
20
|
+
"order": 1
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sqltools.connections": [
|
|
3
|
+
{
|
|
4
|
+
"mysqlOptions": {
|
|
5
|
+
"authProtocol": "default"
|
|
6
|
+
},
|
|
7
|
+
"previewLimit": 50,
|
|
8
|
+
"server": "localhost",
|
|
9
|
+
"port": 3306,
|
|
10
|
+
"driver": "MariaDB",
|
|
11
|
+
"name": "Local",
|
|
12
|
+
"database": "bookstore",
|
|
13
|
+
"username": "root",
|
|
14
|
+
"password": "123456789"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Use the codercom/code-server image
|
|
2
|
+
FROM codercom/code-server:latest
|
|
3
|
+
MAINTAINER steven velozo
|
|
4
|
+
|
|
5
|
+
VOLUME /home/coder/.config
|
|
6
|
+
VOLUME /home/coder/.vscode
|
|
7
|
+
|
|
8
|
+
RUN echo "...installing debian dependencies..."
|
|
9
|
+
RUN sudo apt update
|
|
10
|
+
RUN sudo apt install vim curl tmux -y
|
|
11
|
+
|
|
12
|
+
RUN echo "Building development image..."
|
|
13
|
+
|
|
14
|
+
RUN echo "...installing vscode extensions..."
|
|
15
|
+
|
|
16
|
+
# Mocha unit testing in the sidebar
|
|
17
|
+
RUN code-server --install-extension hbenl.vscode-mocha-test-adapter
|
|
18
|
+
RUN code-server --install-extension hbenl.test-adapter-converter
|
|
19
|
+
RUN code-server --install-extension hbenl.vscode-test-explorer
|
|
20
|
+
|
|
21
|
+
# Magic indentation rainbow
|
|
22
|
+
RUN code-server --install-extension oderwat.indent-rainbow
|
|
23
|
+
RUN code-server --install-extension dbaeumer.vscode-eslint
|
|
24
|
+
|
|
25
|
+
# Contextual git
|
|
26
|
+
RUN code-server --install-extension eamodio.gitlens
|
|
27
|
+
|
|
28
|
+
# Other extensions (uncomment them to have them automagic, or run this from a terminal to install in the container):
|
|
29
|
+
|
|
30
|
+
# SQL Tools
|
|
31
|
+
RUN code-server --install-extension mtxr.sqltools
|
|
32
|
+
RUN code-server --install-extension mtxr.sqltools-driver-mysql
|
|
33
|
+
|
|
34
|
+
# Microsoft's AI code completion
|
|
35
|
+
# RUN code-server --install-extension VisualStudioExptTeam.vscodeintellicode
|
|
36
|
+
|
|
37
|
+
# Live server -- make sure to open up the port on the docker image
|
|
38
|
+
# RUN code-server --install-extension ritwickdey.LiveServer
|
|
39
|
+
|
|
40
|
+
# Quick link to required modules' documentation
|
|
41
|
+
# RUN code-server --install-extension bengreenier.vscode-node-readme
|
|
42
|
+
|
|
43
|
+
# Switch up fonts
|
|
44
|
+
# RUN code-server --install-extension evan-buss.font-switcher
|
|
45
|
+
|
|
46
|
+
# Icons
|
|
47
|
+
# RUN code-server --install-extension vscode-icons-team.vscode-icons
|
|
48
|
+
# RUN code-server --install-extension PKief.material-icon-theme
|
|
49
|
+
|
|
50
|
+
# Hover over CSS colors to see them previewed
|
|
51
|
+
# RUN code-server --install-extension bierner.color-info
|
|
52
|
+
|
|
53
|
+
# An easy on the eyes color theme
|
|
54
|
+
# RUN code-server --install-extension daylerees.rainglow
|
|
55
|
+
|
|
56
|
+
RUN echo "...configuring mariadb (mysql) server..."
|
|
57
|
+
RUN sudo apt install default-mysql-server default-mysql-client -y
|
|
58
|
+
RUN sudo sed -i "s|bind-address|#bind-address|g" /etc/mysql/mariadb.conf.d/50-server.cnf
|
|
59
|
+
ADD ./debug/MySQL-Security.sql /home/coder/MySQL-Configure-Security.sql
|
|
60
|
+
ADD ./debug/MySQL-Laden-Entry.sh /usr/bin/MySQL-Laden-Entry.sh
|
|
61
|
+
RUN ( sudo mysqld_safe --skip-grant-tables --skip-networking & ) && sleep 5 && mysql -u root < /home/coder/MySQL-Configure-Security.sql
|
|
62
|
+
|
|
63
|
+
# Import the initial database
|
|
64
|
+
COPY ./debug/model/sql_create/BookStore-CreateDatabase.mysql.sql /home/coder/MySQL-Create-Databases.sql
|
|
65
|
+
COPY ./debug/model/sql_create/BookStore-CreateAndPopulateTables.sql /home/coder/BookStore-CreateAndPopulateTables.sql
|
|
66
|
+
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" -e "CREATE DATABASE bookstore;"
|
|
67
|
+
RUN echo "...creating and populating database..."
|
|
68
|
+
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" bookstore < /home/coder/MySQL-Create-Databases.sql
|
|
69
|
+
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" bookstore < /home/coder/BookStore-CreateAndPopulateTables.sql
|
|
70
|
+
RUN echo "...database creation and population complmete."
|
|
71
|
+
|
|
72
|
+
RUN echo "...mapping library specific volumes..."
|
|
73
|
+
|
|
74
|
+
# Volume mapping for code
|
|
75
|
+
VOLUME /home/coder/retold-data-service
|
|
76
|
+
|
|
77
|
+
SHELL ["/bin/bash", "-c"]
|
|
78
|
+
USER coder
|
|
79
|
+
|
|
80
|
+
RUN echo "...installing node version manager..."
|
|
81
|
+
# Because there is a .bashrc chicken/egg problem, we will create one here to simulate logging in. This is not great.
|
|
82
|
+
RUN touch ~/.bashrc && chmod +x ~/.bashrc
|
|
83
|
+
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
|
|
84
|
+
|
|
85
|
+
RUN echo "...installing node version 14 as the default..."
|
|
86
|
+
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm install 14
|
|
87
|
+
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm alias default 14
|
|
88
|
+
|
|
89
|
+
WORKDIR /home/coder/retold-data-service
|
|
90
|
+
|
|
91
|
+
# RUN . ~/.nvm/nvm.sh && source ~/.bashrc && npm install
|
|
92
|
+
# RUN . /home/coder/retold-data-service/debug/Bookstore-Import-Books.sh
|
|
93
|
+
|
|
94
|
+
ENTRYPOINT ["/usr/bin/MySQL-Laden-Entry.sh"]
|
package/debug/Harness.js
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _Settings = require('./bookstore-configuration.json');
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const libFable = require('fable');
|
|
4
|
+
|
|
5
|
+
_Fable = new libFable(_Settings);
|
|
6
|
+
_Fable.serviceManager.addAndInstantiateServiceType('RetoldDataService', require('../source/Retold-Data-Service.js'));
|
|
7
|
+
|
|
8
|
+
_Fable.MeadowEndpoints.Book.controller.BehaviorInjection.setBehavior('Read-PostOperation',
|
|
9
|
+
(pRequest, pRequestState, fComplete) =>
|
|
10
|
+
{
|
|
11
|
+
// Get the join records
|
|
12
|
+
_Fable.DAL.BookAuthorJoin.doReads(_Fable.DAL.BookAuthorJoin.query.addFilter('IDBook', pRequestState.Record.IDBook),
|
|
13
|
+
(pJoinReadError, pJoinReadQuery, pJoinRecords)=>
|
|
14
|
+
{
|
|
15
|
+
let tmpAuthorList = [];
|
|
16
|
+
for (let j = 0; j < pJoinRecords.length; j++)
|
|
17
|
+
{
|
|
18
|
+
tmpAuthorList.push(pJoinRecords[j].IDAuthor);
|
|
19
|
+
}
|
|
20
|
+
if (tmpAuthorList.length < 1)
|
|
21
|
+
{
|
|
22
|
+
pRequestState.Record.Authors = [];
|
|
23
|
+
return fComplete();
|
|
24
|
+
}
|
|
25
|
+
else
|
|
26
|
+
{
|
|
27
|
+
_Fable.DAL.Author.doReads(_Fable.DAL.Author.query.addFilter('IDAuthor', tmpAuthorList, 'IN'),
|
|
28
|
+
(pReadsError, pReadsQuery, pAuthors)=>
|
|
29
|
+
{
|
|
30
|
+
pRequestState.Record.Authors = pAuthors;
|
|
31
|
+
return fComplete();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Product": "MeadowEndpointsTestBookStore",
|
|
3
|
+
"ProductVersion": "1.0.0",
|
|
4
|
+
|
|
5
|
+
"UUID":
|
|
6
|
+
{
|
|
7
|
+
"DataCenter": 0,
|
|
8
|
+
"Worker": 0
|
|
9
|
+
},
|
|
10
|
+
"LogStreams":
|
|
11
|
+
[
|
|
12
|
+
{
|
|
13
|
+
"streamtype": "console"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
"APIServerPort": 8086,
|
|
18
|
+
|
|
19
|
+
"MySQL":
|
|
20
|
+
{
|
|
21
|
+
"Server": "127.0.0.1",
|
|
22
|
+
"Port": 3306,
|
|
23
|
+
"User": "root",
|
|
24
|
+
"Password": "123456789",
|
|
25
|
+
"Database": "bookstore",
|
|
26
|
+
"ConnectionPoolLimit": 20
|
|
27
|
+
},
|
|
28
|
+
"MeadowConnectionMySQLAutoConnect": true
|
|
29
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
An example of Meadow Endpoints, Fable and Orator
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @license MIT
|
|
7
|
+
* @author <steven@velozo.com>
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Server Settings
|
|
11
|
+
let fStartServiceServer = (fInitializeCallback) =>
|
|
12
|
+
{
|
|
13
|
+
_Orator.initializeServiceServer(() =>
|
|
14
|
+
{
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// 100. Add a post processing hook to the Book DAL on single reads
|
|
18
|
+
/*
|
|
19
|
+
This post processing step will look for all book author joins then
|
|
20
|
+
load all appropriate authors and stuff them in the book record before
|
|
21
|
+
returning it.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// Static site mapping
|
|
26
|
+
_Orator.log.info("...Mapping static route for web site...");
|
|
27
|
+
|
|
28
|
+
//_Orator.addStaticRoute(__dirname+'/../web/');
|
|
29
|
+
|
|
30
|
+
// Start the web server (ctrl+c to end it)
|
|
31
|
+
_Orator.startWebServer(
|
|
32
|
+
(pError) =>
|
|
33
|
+
{
|
|
34
|
+
fInitializeCallback(pError);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
return _Orator;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = fStartServiceServer;
|