diff --git a/js-mysql/docker-compose.yaml b/js-mysql/docker-compose.yaml new file mode 100644 index 0000000..801fa77 --- /dev/null +++ b/js-mysql/docker-compose.yaml @@ -0,0 +1,14 @@ +version: '3.1' + +services: + db: + image: mysql:latest + command: --default-authentication-plugin=mysql_native_password + restart: always + environment: + MYSQL_ROOT_PASSWORD: rootpassword + MYSQL_DATABASE: mydb + MYSQL_USER: user + MYSQL_PASSWORD: password + ports: + - "3306:3306" diff --git a/js-mysql/keploy/test-set-0/mocks.yaml b/js-mysql/keploy/test-set-0/mocks.yaml new file mode 100755 index 0000000..1a44caf --- /dev/null +++ b/js-mysql/keploy/test-set-0/mocks.yaml @@ -0,0 +1,378 @@ +version: api.keploy.io/v1beta1 +kind: SQL +name: mocks +spec: + metadata: + operation: HANDSHAKE_RESPONSE + responseOperation: MySQLOK + type: config + requests: + - header: + packet_length: 134 + packet_number: 1 + packet_type: HANDSHAKE_RESPONSE + message: + capability_flags: 280687567 + max_packet_size: 0 + character_set: 224 + reserved: + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + username: user + auth_data: + - 206 + - 145 + - 78 + - 100 + - 171 + - 47 + - 27 + - 11 + - 200 + - 55 + - 192 + - 40 + - 5 + - 118 + - 199 + - 231 + - 86 + - 34 + - 154 + - 20 + database: mydb + auth_plugin_name: mysql_native_password + connect_attributes: + _client_name: Node-MySQL-2 + _client_version: 3.7.0 + zstdcompressionlevel: 0 + responses: + - header: + packet_length: 73 + packet_number: 0 + packet_type: MySQLHandshakeV10 + message: + protocol_version: 10 + server_version: 8.2.0 + connection_id: 9 + auth_plugin_data: + - 110 + - 20 + - 39 + - 8 + - 24 + - 115 + - 95 + - 39 + - 44 + - 19 + - 30 + - 30 + - 50 + - 59 + - 18 + - 4 + - 47 + - 113 + - 120 + - 68 + - 0 + capability_flags: 3758096383 + character_set: 255 + status_flags: 2 + auth_plugin_name: mysql_native_password + - header: + packet_length: 16 + packet_number: 2 + packet_type: MySQLOK + message: + affected_rows: 0 + last_insert_id: 0 + status_flags: 16386 + warnings: 0 + info: "\0\a\x01\x05\x04mydb" + created: 1704863677 +--- +version: api.keploy.io/v1beta1 +kind: SQL +name: mocks +spec: + metadata: + operation: MySQLQuery + responseOperation: MySQLOK + type: mocks + requests: + - header: + packet_length: 235 + packet_number: 0 + packet_type: MySQLQuery + message: + command: 3 + query: "\n CREATE TABLE IF NOT EXISTS items (\n id INT AUTO_INCREMENT PRIMARY KEY,\n name VARCHAR(255) NOT NULL,\n description TEXT,\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n )\n " + responses: + - header: + packet_length: 7 + packet_number: 1 + packet_type: MySQLOK + message: + affected_rows: 0 + last_insert_id: 0 + status_flags: 2 + warnings: 1 + info: "" + created: 1704863677 +--- +version: api.keploy.io/v1beta1 +kind: SQL +name: mocks +spec: + metadata: + operation: MySQLQuery + responseOperation: MySQLOK + type: mocks + requests: + - header: + packet_length: 71 + packet_number: 0 + packet_type: MySQLQuery + message: + command: 3 + query: INSERT INTO items SET `name` = 'Item1', `description` = 'Description1' + responses: + - header: + packet_length: 7 + packet_number: 1 + packet_type: MySQLOK + message: + affected_rows: 1 + last_insert_id: 2 + status_flags: 2 + warnings: 0 + info: "" + created: 1704863681 +--- +version: api.keploy.io/v1beta1 +kind: SQL +name: mocks +spec: + metadata: + operation: MySQLQuery + responseOperation: RESULT_SET_PACKET + type: mocks + requests: + - header: + packet_length: 20 + packet_number: 0 + packet_type: MySQLQuery + message: + command: 3 + query: SELECT * FROM items + responses: + - header: + packet_length: 1 + packet_number: 1 + packet_type: RESULT_SET_PACKET + message: + columns: + - packet_header: + packet_length: 40 + packet_sequence_id: 2 + catalog: def + schema: mydb + table: items + org_table: items + name: id + org_name: id + next_length: 0 + character_set: 63 + column_length: 11 + column_type: 3 + flags: 16899 + decimals: 0 + string: "" + - packet_header: + packet_length: 44 + packet_sequence_id: 3 + catalog: def + schema: mydb + table: items + org_table: items + name: name + org_name: name + next_length: 0 + character_set: 224 + column_length: 1020 + column_type: 253 + flags: 4097 + decimals: 0 + string: "" + - packet_header: + packet_length: 58 + packet_sequence_id: 4 + catalog: def + schema: mydb + table: items + org_table: items + name: description + org_name: description + next_length: 0 + character_set: 224 + column_length: 262140 + column_type: 252 + flags: 16 + decimals: 0 + string: "" + - packet_header: + packet_length: 56 + packet_sequence_id: 5 + catalog: def + schema: mydb + table: items + org_table: items + name: created_at + org_name: created_at + next_length: 0 + character_set: 63 + column_length: 19 + column_type: 7 + flags: 1152 + decimals: 0 + string: "" + rows: + - header: + packet_length: 41 + sequence_id: 7 + row_column_definition: + - type: 3 + name: id + value: "1" + - type: 253 + name: name + value: Item1 + - type: 252 + name: description + value: Description1 + - type: 7 + name: created_at + value: 12338-50-52 45:48:49 + - header: + packet_length: 41 + sequence_id: 8 + row_column_definition: + - type: 3 + name: id + value: "2" + - type: 253 + name: name + value: Item1 + - type: 252 + name: description + value: Description1 + - type: 7 + name: created_at + value: 12338-50-52 45:48:49 + eofPresent: true + paddingPresent: false + eofPresentFinal: true + paddingPresentFinal: false + optionalPadding: false + optionalEOFBytes: + - 5 + - 0 + - 0 + - 9 + - 254 + - 0 + - 0 + - 34 + - 0 + eofAfterColumns: + - 5 + - 0 + - 0 + - 6 + - 254 + - 0 + - 0 + - 34 + - 0 + created: 1704863692 +--- +version: api.keploy.io/v1beta1 +kind: SQL +name: mocks +spec: + metadata: + operation: MySQLQuery + responseOperation: MySQLOK + type: mocks + requests: + - header: + packet_length: 93 + packet_number: 0 + packet_type: MySQLQuery + message: + command: 3 + query: UPDATE items SET `name` = 'UpdatedItem', `description` = 'UpdatedDescription' WHERE id = '1' + responses: + - header: + packet_length: 48 + packet_number: 1 + packet_type: MySQLOK + message: + affected_rows: 1 + last_insert_id: 0 + status_flags: 2 + warnings: 0 + info: '(Rows matched: 1 Changed: 1 Warnings: 0' + created: 1704863702 +--- +version: api.keploy.io/v1beta1 +kind: SQL +name: mocks +spec: + metadata: + operation: MySQLQuery + responseOperation: MySQLOK + type: mocks + requests: + - header: + packet_length: 33 + packet_number: 0 + packet_type: MySQLQuery + message: + command: 3 + query: DELETE FROM items WHERE id = '1' + responses: + - header: + packet_length: 7 + packet_number: 1 + packet_type: MySQLOK + message: + affected_rows: 1 + last_insert_id: 0 + status_flags: 2 + warnings: 0 + info: "" + created: 1704863719 diff --git a/js-mysql/keploy/test-set-0/tests/test-1.yaml b/js-mysql/keploy/test-set-0/tests/test-1.yaml new file mode 100755 index 0000000..41c2b52 --- /dev/null +++ b/js-mysql/keploy/test-set-0/tests/test-1.yaml @@ -0,0 +1,49 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://localhost:3000/items + header: + Accept: '*/*' + Content-Length: "45" + Content-Type: application/json + Host: localhost:3000 + User-Agent: curl/8.2.1 + body: '{"name":"Item1","description":"Description1"}' + body_type: "" + timestamp: 2024-01-10T10:44:41.323262307+05:30 + host: "" + resp: + status_code: 201 + header: + Connection: keep-alive + Content-Length: "21" + Content-Type: text/html; charset=utf-8 + Date: Wed, 10 Jan 2024 05:14:41 GMT + Etag: W/"15-C5IeyXgQaytvF7bNZ6kmG1WBkqQ" + Keep-Alive: timeout=5 + X-Powered-By: Express + body: 'Item added with ID: 2' + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 2024-01-10T10:44:43.351869495+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1704863683 +curl: |- + curl --request POST \ + --url http://localhost:3000/items \ + --header 'Host: localhost:3000' \ + --header 'User-Agent: curl/8.2.1' \ + --header 'Accept: */*' \ + --header 'Content-Type: application/json' \ + --data '{"name":"Item1","description":"Description1"}' diff --git a/js-mysql/keploy/test-set-0/tests/test-2.yaml b/js-mysql/keploy/test-set-0/tests/test-2.yaml new file mode 100755 index 0000000..b34c88e --- /dev/null +++ b/js-mysql/keploy/test-set-0/tests/test-2.yaml @@ -0,0 +1,48 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-2 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://localhost:3000/items + header: + Accept: '*/*' + Host: localhost:3000 + User-Agent: curl/8.2.1 + body: "" + body_type: "" + timestamp: 2024-01-10T10:44:52.830167776+05:30 + host: "" + resp: + status_code: 200 + header: + Connection: keep-alive + Content-Length: "187" + Content-Type: application/json; charset=utf-8 + Date: Wed, 10 Jan 2024 05:14:52 GMT + Etag: W/"bb-mIFi3PmJLRJbUU+xJVT8SDs9634" + Keep-Alive: timeout=5 + X-Powered-By: Express + body: '[{"id":1,"name":"Item1","description":"Description1","created_at":"2024-01-09T23:43:55.000Z"},{"id":2,"name":"Item1","description":"Description1","created_at":"2024-01-09T23:44:41.000Z"}]' + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 2024-01-10T10:44:54.836272766+05:30 + objects: [] + assertions: + noise: + body.created_at: [] + body.description: [] + body.name: [] + header.Date: [] + created: 1704863694 +curl: | + curl --request GET \ + --url http://localhost:3000/items \ + --header 'Host: localhost:3000' \ + --header 'User-Agent: curl/8.2.1' \ + --header 'Accept: */*' \ diff --git a/js-mysql/keploy/test-set-0/tests/test-3.yaml b/js-mysql/keploy/test-set-0/tests/test-3.yaml new file mode 100755 index 0000000..9d573b1 --- /dev/null +++ b/js-mysql/keploy/test-set-0/tests/test-3.yaml @@ -0,0 +1,49 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-3 +spec: + metadata: {} + req: + method: PUT + proto_major: 1 + proto_minor: 1 + url: http://localhost:3000/items/1 + header: + Accept: '*/*' + Content-Length: "57" + Content-Type: application/json + Host: localhost:3000 + User-Agent: curl/8.2.1 + body: '{"name":"UpdatedItem","description":"UpdatedDescription"}' + body_type: "" + timestamp: 2024-01-10T10:45:02.719142696+05:30 + host: "" + resp: + status_code: 200 + header: + Connection: keep-alive + Content-Length: "26" + Content-Type: text/html; charset=utf-8 + Date: Wed, 10 Jan 2024 05:15:02 GMT + Etag: W/"1a-5qIcUrGG1wjgWopMh4WbViRF6Tc" + Keep-Alive: timeout=5 + X-Powered-By: Express + body: Item updated successfully. + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 2024-01-10T10:45:04.733262075+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1704863704 +curl: |- + curl --request PUT \ + --url http://localhost:3000/items/1 \ + --header 'Content-Type: application/json' \ + --header 'Host: localhost:3000' \ + --header 'User-Agent: curl/8.2.1' \ + --header 'Accept: */*' \ + --data '{"name":"UpdatedItem","description":"UpdatedDescription"}' diff --git a/js-mysql/keploy/test-set-0/tests/test-4.yaml b/js-mysql/keploy/test-set-0/tests/test-4.yaml new file mode 100755 index 0000000..3cddea3 --- /dev/null +++ b/js-mysql/keploy/test-set-0/tests/test-4.yaml @@ -0,0 +1,45 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-4 +spec: + metadata: {} + req: + method: DELETE + proto_major: 1 + proto_minor: 1 + url: http://localhost:3000/items/1 + header: + Accept: '*/*' + Host: localhost:3000 + User-Agent: curl/8.2.1 + body: "" + body_type: "" + timestamp: 2024-01-10T10:45:19.886998684+05:30 + host: "" + resp: + status_code: 200 + header: + Connection: keep-alive + Content-Length: "26" + Content-Type: text/html; charset=utf-8 + Date: Wed, 10 Jan 2024 05:15:19 GMT + Etag: W/"1a-bRsOe/KN9f5IwEBjtdgcdJQrXPE" + Keep-Alive: timeout=5 + X-Powered-By: Express + body: Item deleted successfully. + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 2024-01-10T10:45:21.900326998+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1704863721 +curl: | + curl --request DELETE \ + --url http://localhost:3000/items/1 \ + --header 'User-Agent: curl/8.2.1' \ + --header 'Accept: */*' \ + --header 'Host: localhost:3000' \ diff --git a/js-mysql/keploy/testReports/report-1.yaml b/js-mysql/keploy/testReports/report-1.yaml new file mode 100755 index 0000000..5f921d9 --- /dev/null +++ b/js-mysql/keploy/testReports/report-1.yaml @@ -0,0 +1,343 @@ +version: api.keploy.io/v1beta1 +name: report-1 +status: APP_FAULT +success: 1 +failure: 2 +total: 3 +tests: + - kind: Http + name: report-1 + status: PASSED + started: 1704863770 + completed: 1704863770 + test_case_path: /home/erakin/Desktop/samples-typescript/js-mysql/keploy/test-set-0 + mock_path: "" + test_case_id: test-1 + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://localhost:3000/items + header: + Accept: '*/*' + Content-Length: "45" + Content-Type: application/json + Host: localhost:3000 + User-Agent: curl/8.2.1 + body: '{"name":"Item1","description":"Description1"}' + body_type: "" + timestamp: 0001-01-01T00:00:00Z + host: "" + resp: + status_code: 201 + header: + Connection: keep-alive + Content-Length: "21" + Content-Type: text/html; charset=utf-8 + Date: Wed, 10 Jan 2024 05:14:41 GMT + Etag: W/"15-C5IeyXgQaytvF7bNZ6kmG1WBkqQ" + Keep-Alive: timeout=5 + X-Powered-By: Express + body: 'Item added with ID: 2' + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 0001-01-01T00:00:00Z + noise: + header.Date: [] + result: + status_code: + normal: true + expected: 201 + actual: 201 + headers_result: + - normal: true + expected: + key: Content-Length + value: + - "21" + actual: + key: Content-Length + value: + - "21" + - normal: true + expected: + key: Content-Type + value: + - text/html; charset=utf-8 + actual: + key: Content-Type + value: + - text/html; charset=utf-8 + - normal: true + expected: + key: Date + value: + - Wed, 10 Jan 2024 05:14:41 GMT + actual: + key: Date + value: + - Wed, 10 Jan 2024 05:16:10 GMT + - normal: true + expected: + key: Etag + value: + - W/"15-C5IeyXgQaytvF7bNZ6kmG1WBkqQ" + actual: + key: Etag + value: + - W/"15-C5IeyXgQaytvF7bNZ6kmG1WBkqQ" + - normal: true + expected: + key: Keep-Alive + value: + - timeout=5 + actual: + key: Keep-Alive + value: + - timeout=5 + - normal: true + expected: + key: X-Powered-By + value: + - Express + actual: + key: X-Powered-By + value: + - Express + - normal: true + expected: + key: Connection + value: + - keep-alive + actual: + key: Connection + value: + - keep-alive + body_result: + - normal: true + type: PLAIN + expected: 'Item added with ID: 2' + actual: 'Item added with ID: 2' + dep_result: [] + - kind: Http + name: report-1 + status: FAILED + started: 1704863770 + completed: 1704863775 + test_case_path: /home/erakin/Desktop/samples-typescript/js-mysql/keploy/test-set-0 + mock_path: "" + test_case_id: test-2 + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://localhost:3000/items + header: + Accept: '*/*' + Host: localhost:3000 + User-Agent: curl/8.2.1 + body: "" + body_type: "" + timestamp: 0001-01-01T00:00:00Z + host: "" + resp: + status_code: 200 + header: + Connection: keep-alive + Content-Length: "187" + Content-Type: application/json; charset=utf-8 + Date: Wed, 10 Jan 2024 05:14:52 GMT + Etag: W/"bb-mIFi3PmJLRJbUU+xJVT8SDs9634" + Keep-Alive: timeout=5 + X-Powered-By: Express + body: '[{"id":1,"name":"Item1","description":"Description1","created_at":"2024-01-09T23:43:55.000Z"},{"id":2,"name":"Item1","description":"Description1","created_at":"2024-01-09T23:44:41.000Z"}]' + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 0001-01-01T00:00:00Z + noise: + body.created_at: [] + body.description: [] + body.name: [] + header.Date: [] + result: + status_code: + normal: false + expected: 200 + actual: 0 + headers_result: + - normal: false + expected: + key: Connection + value: + - keep-alive + actual: + key: Connection + value: [] + - normal: false + expected: + key: Content-Length + value: + - "187" + actual: + key: Content-Length + value: [] + - normal: false + expected: + key: Content-Type + value: + - application/json; charset=utf-8 + actual: + key: Content-Type + value: [] + - normal: true + expected: + key: Date + value: + - Wed, 10 Jan 2024 05:14:52 GMT + actual: + key: Date + value: [] + - normal: false + expected: + key: Etag + value: + - W/"bb-mIFi3PmJLRJbUU+xJVT8SDs9634" + actual: + key: Etag + value: [] + - normal: false + expected: + key: Keep-Alive + value: + - timeout=5 + actual: + key: Keep-Alive + value: [] + - normal: false + expected: + key: X-Powered-By + value: + - Express + actual: + key: X-Powered-By + value: [] + body_result: + - normal: false + type: PLAIN + expected: '[{"id":1,"name":"Item1","description":"Description1","created_at":"2024-01-09T23:43:55.000Z"},{"id":2,"name":"Item1","description":"Description1","created_at":"2024-01-09T23:44:41.000Z"}]' + actual: 'Get "http://localhost:3000/items": context deadline exceeded (Client.Timeout exceeded while awaiting headers)' + dep_result: [] + - kind: Http + name: report-1 + status: FAILED + started: 1704863775 + completed: 1704863780 + test_case_path: /home/erakin/Desktop/samples-typescript/js-mysql/keploy/test-set-0 + mock_path: "" + test_case_id: test-3 + req: + method: PUT + proto_major: 1 + proto_minor: 1 + url: http://localhost:3000/items/1 + header: + Accept: '*/*' + Content-Length: "57" + Content-Type: application/json + Host: localhost:3000 + User-Agent: curl/8.2.1 + body: '{"name":"UpdatedItem","description":"UpdatedDescription"}' + body_type: "" + timestamp: 0001-01-01T00:00:00Z + host: "" + resp: + status_code: 200 + header: + Connection: keep-alive + Content-Length: "26" + Content-Type: text/html; charset=utf-8 + Date: Wed, 10 Jan 2024 05:15:02 GMT + Etag: W/"1a-5qIcUrGG1wjgWopMh4WbViRF6Tc" + Keep-Alive: timeout=5 + X-Powered-By: Express + body: Item updated successfully. + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 0001-01-01T00:00:00Z + noise: + header.Date: [] + result: + status_code: + normal: false + expected: 200 + actual: 0 + headers_result: + - normal: false + expected: + key: Content-Length + value: + - "26" + actual: + key: Content-Length + value: [] + - normal: false + expected: + key: Content-Type + value: + - text/html; charset=utf-8 + actual: + key: Content-Type + value: [] + - normal: true + expected: + key: Date + value: + - Wed, 10 Jan 2024 05:15:02 GMT + actual: + key: Date + value: [] + - normal: false + expected: + key: Etag + value: + - W/"1a-5qIcUrGG1wjgWopMh4WbViRF6Tc" + actual: + key: Etag + value: [] + - normal: false + expected: + key: Keep-Alive + value: + - timeout=5 + actual: + key: Keep-Alive + value: [] + - normal: false + expected: + key: X-Powered-By + value: + - Express + actual: + key: X-Powered-By + value: [] + - normal: false + expected: + key: Connection + value: + - keep-alive + actual: + key: Connection + value: [] + body_result: + - normal: false + type: PLAIN + expected: Item updated successfully. + actual: 'Put "http://localhost:3000/items/1": context deadline exceeded (Client.Timeout exceeded while awaiting headers)' + dep_result: [] +test_set: test-set-0 diff --git a/js-mysql/package-lock.json b/js-mysql/package-lock.json new file mode 100644 index 0000000..2a5a3b9 --- /dev/null +++ b/js-mysql/package-lock.json @@ -0,0 +1,791 @@ +{ + "name": "js-mysql", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "js-mysql", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "body-parser": "^1.20.2", + "express": "^4.18.2", + "mysql2": "^3.7.0" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "dependencies": { + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/express/node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "dependencies": { + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/lru-cache": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", + "engines": { + "node": ">=16.14" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/mysql2": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.7.0.tgz", + "integrity": "sha512-c45jA3Jc1X8yJKzrWu1GpplBKGwv/wIV6ITZTlCSY7npF2YfJR+6nMP5e+NTQhUeJPSyOQAbGDCGEHbAl8HN9w==", + "dependencies": { + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru-cache": "^8.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/js-mysql/package.json b/js-mysql/package.json new file mode 100644 index 0000000..fbea646 --- /dev/null +++ b/js-mysql/package.json @@ -0,0 +1,18 @@ +{ + "name": "js-mysql", + "version": "1.0.0", + "description": "", + "main": "server.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node server.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "body-parser": "^1.20.2", + "express": "^4.18.2", + "mysql2": "^3.7.0" + } +} diff --git a/js-mysql/server.js b/js-mysql/server.js new file mode 100644 index 0000000..cf1f044 --- /dev/null +++ b/js-mysql/server.js @@ -0,0 +1,63 @@ +const express = require('express'); +const bodyParser = require('body-parser'); +const mysql = require('mysql2'); + +const app = express(); +app.use(bodyParser.json()); + +const connection = mysql.createConnection({ + host: 'localhost', + user: 'user', + password: 'password', + database: 'mydb' +}); +const initializeDatabase = () => { + connection.query(` + CREATE TABLE IF NOT EXISTS items ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + description TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) + `, (err) => { + if (err) throw err; + console.log('Table created or already exists'); + }); +}; +initializeDatabase() +app.get('/items', (req, res) => { + connection.query('SELECT * FROM items', (err, results) => { + if (err) throw err; + res.json(results); + }); +}); + +app.post('/items', (req, res) => { + const item = req.body; + connection.query('INSERT INTO items SET ?', item, (err, results) => { + if (err) throw err; + res.status(201).send(`Item added with ID: ${results.insertId}`); + }); +}); + +app.put('/items/:id', (req, res) => { + const id = req.params.id; + const item = req.body; + connection.query('UPDATE items SET ? WHERE id = ?', [item, id], (err, results) => { + if (err) throw err; + res.send('Item updated successfully.'); + }); +}); + +app.delete('/items/:id', (req, res) => { + const id = req.params.id; + connection.query('DELETE FROM items WHERE id = ?', id, (err, results) => { + if (err) throw err; + res.send('Item deleted successfully.'); + }); +}); + +const port = 3000; +app.listen(port, () => { + console.log(`Server running on port ${port}`); +}); \ No newline at end of file