diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000..020a41fb --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,34 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "development" ] + pull_request: + branches: [ "development" ] + +jobs: + build: + + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./venue-reservation + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: ./venue-reservation/package-lock.json + - run: npm ci + - run: npm run build --if-present + - run: npm test --if-present diff --git a/database/.env b/database/.env new file mode 100644 index 00000000..e545cfc2 --- /dev/null +++ b/database/.env @@ -0,0 +1,15 @@ +# Environment variables declared in this file are automatically made available to Prisma. +# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema + +# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. +# See the documentation for all the connection string options: https://pris.ly/d/connection-strings + +DATABASE_URL="postgresql://postgres:1234@localhost:5432/postgres?schema=public" + +EMAIL_SERVER_HOST=smtp.gmail.com +EMAIL_SERVER_PORT=587 +EMAIL_SERVER_USER=tnethmini5445@gmail.com +EMAIL_SERVER_PASSWORD=pwbf mntd ebgv jxql +EMAIL_FROM="tnethmini5445@gmail.com" + +AUTH_SECRET="3ZtPGZl+VhD8X+3GDW8TebiwHkKZ4yjYdf9To7O90fE=" # Added by `npx auth`. Read more: https://cli.authjs.dev \ No newline at end of file diff --git a/database/doc/doc-filelist.js b/database/doc/doc-filelist.js new file mode 100644 index 00000000..c2a398ff --- /dev/null +++ b/database/doc/doc-filelist.js @@ -0,0 +1 @@ +var tree={}; \ No newline at end of file diff --git a/database/doc/doc-script.js b/database/doc/doc-script.js new file mode 100644 index 00000000..7fa12260 --- /dev/null +++ b/database/doc/doc-script.js @@ -0,0 +1,228 @@ +// # res/script.js +// +// This is the script file that gets copied into the output. It mainly manages the display +// of the folder tree. The idea of this script file is to be minimal and standalone. So +// that means no jQuery. + +// Use localStorage to store data about the tree's state: whether or not +// the tree is visible and which directories are expanded. Unless the state +var sidebarVisible = (window.localStorage && window.localStorage.docker_showSidebar) ? + window.localStorage.docker_showSidebar == 'yes' : + defaultSidebar; + +/** + * ## makeTree + * + * Consructs the folder tree view + * + * @param {object} treeData Folder structure as in [queueFile](../src/docker.js.html#docker.prototype.queuefile) + * @param {string} root Path from current file to root (ie `'../../'` etc.) + * @param {string} filename The current file name + */ +function makeTree(treeData, root, filename) { + var treeNode = document.getElementById('tree'); + var treeHandle = document.getElementById('sidebar-toggle'); + treeHandle.addEventListener('click', toggleTree, false); + + // Build the html and add it to the container. + treeNode.innerHTML = nodeHtml('', treeData, '', root); + + // Root folder (whole tree) should always be open + treeNode.childNodes[0].className += ' open'; + + // Attach click event handler + treeNode.addEventListener('click', nodeClicked, false); + + if (sidebarVisible) document.body.className += ' sidebar'; + + // Restore scroll position from localStorage if set. And attach scroll handler + if (window.localStorage && window.localStorage.docker_treeScroll) treeNode.scrollTop = window.localStorage.docker_treeScroll; + treeNode.onscroll = treeScrolled; + + // Only set a class to allow CSS transitions after the tree state has been painted + setTimeout(function() { document.body.className += ' slidey'; }, 100); +} + +/** + * ## treeScrolled + * + * Called when the tree is scrolled. Stores the scroll position in localStorage + * so it can be restored on the next pageview. + */ +function treeScrolled() { + var tree = document.getElementById('tree'); + if (window.localStorage) window.localStorage.docker_treeScroll = tree.scrollTop; +} + +/** + * ## nodeClicked + * + * Called when a directory is clicked. Toggles open state of the directory + * + * @param {Event} e The click event + */ +function nodeClicked(e) { + // Find the target + var t = e.target; + + // If the click target is actually a file (rather than a directory), ignore it + if (t.tagName.toLowerCase() !== 'div' || t.className === 'children') return; + + // Recurse upwards until we find the actual directory node + while (t && t.className.substring(0, 3) != 'dir') t = t.parentNode; + + // If we're at the root node, then do nothing (we don't allow collapsing of the whole tree) + if (!t || t.parentNode.id == 'tree') return; + + // Find the path and toggle the state, saving the state in the localStorage variable + var path = t.getAttribute('rel'); + if (t.className.indexOf('open') !== -1) { + t.className = t.className.replace(/\s*open/g, ''); + if (window.localStorage) window.localStorage.removeItem('docker_openPath:' + path); + } else { + t.className += ' open'; + if (window.localStorage) window.localStorage['docker_openPath:' + path] = 'yes'; + } +} + + +/** + * ## nodeHtml + * + * Constructs the markup for a directory in the tree + * + * @param {string} nodename The node name. + * @param {object} node Node object of same format as whole tree. + * @param {string} path The path form the base to this node + * @param {string} root Relative path from current page to root + */ +function nodeHtml(nodename, node, path, root) { + // Firstly, figure out whether or not the directory is expanded from localStorage + var isOpen = window.localStorage && window.localStorage['docker_openPath:' + path] == 'yes'; + var out = '
[]>(
+ arg: [...P],
+ options?: { isolationLevel?: string },
+ ): Promise []>(
+ arg: [...P],
+ options?: { isolationLevel?: string },
+ ): Promise []>(
+ arg: [...P],
+ options?: { isolationLevel?: string },
+ ): Promise []>(
+ arg: [...P],
+ options?: { isolationLevel?: string },
+ ): Promise = $Result.GetResult<${getPayloadName(model.name)}, S>
+
+${isComposite ? "" : new ModelDelegate(this.type, this.context).toTS()}
+
+${new ModelFieldRefs(this.type).toTS()}
+
+// Custom InputTypes
+${this.argsTypes.map((type) => stringify(type)).join("\n\n")}
+`;
+ }
+};
+var ModelDelegate = class {
+ constructor(outputType, context) {
+ this.outputType = outputType;
+ this.context = context;
+ }
+ /**
+ * Returns all available non-aggregate or group actions
+ * Includes both dmmf and client-only actions
+ *
+ * @param availableActions
+ * @returns
+ */
+ getNonAggregateActions(availableActions) {
+ const actions = availableActions.filter(
+ (key) => key !== DMMF.ModelAction.aggregate && key !== DMMF.ModelAction.groupBy && key !== DMMF.ModelAction.count
+ );
+ return actions;
+ }
+ toTS() {
+ const { name } = this.outputType;
+ const { dmmf } = this.context;
+ const mapping = dmmf.mappingsMap[name] ?? { model: name, plural: `${name}s` };
+ const modelOrType = dmmf.typeAndModelMap[name];
+ const availableActions = getModelActions(dmmf, name);
+ const nonAggregateActions = this.getNonAggregateActions(availableActions);
+ const groupByArgsName = getGroupByArgsName(name);
+ const countArgsName = getModelArgName(name, DMMF.ModelAction.count);
+ this.context.defaultArgsAliases.registerArgName(countArgsName);
+ const genericDelegateParams = [extArgsParam];
+ const excludedArgsForCount = ["select", "include", "distinct"];
+ if (this.context.isPreviewFeatureOn("omitApi")) {
+ excludedArgsForCount.push("omit");
+ genericDelegateParams.push(genericParameter("ClientOptions").default(objectType()));
+ }
+ if (this.context.isPreviewFeatureOn("relationJoins")) {
+ excludedArgsForCount.push("relationLoadStrategy");
+ }
+ const excludedArgsForCountType = excludedArgsForCount.map((name2) => `'${name2}'`).join(" | ");
+ return `${availableActions.includes(DMMF.ModelAction.aggregate) ? `type ${countArgsName}