diff --git a/README.md b/README.md index 5c91169..fb400ea 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,11 @@ -# create-svelte +# RestRover -Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). +RestRover is a REST client written in JavaScript (of course with HTML and CSS). -## Creating a project +# Devices it should support in (more or less) near future -If you're seeing this, you've probably already done this step. Congrats! - -```bash -# create a new project in the current directory -npm create svelte@latest - -# create a new project in my-app -npm create svelte@latest my-app -``` - -## Developing - -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: - -```bash -npm run dev - -# or start the server and open the app in a new browser tab -npm run dev -- --open -``` - -## Building - -To create a production version of your app: - -```bash -npm run build -``` - -You can preview the production build with `npm run preview`. - -> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. +- Web Browser +- iPad +- Mac OS +- Windows +- Linux diff --git a/package.json b/package.json index 8f04afe..09b318b 100644 --- a/package.json +++ b/package.json @@ -32,5 +32,8 @@ "vite": "^4.4.2", "vitest": "^0.32.2" }, - "type": "module" + "type": "module", + "dependencies": { + "pg": "^8.11.3" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 216a4e8..ec8ad1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,11 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +dependencies: + pg: + specifier: ^8.11.3 + version: 8.11.3 + devDependencies: '@playwright/test': specifier: ^1.28.1 @@ -784,6 +789,11 @@ packages: resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} dev: true + /buffer-writer@2.0.0: + resolution: {integrity: sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==} + engines: {node: '>=4'} + dev: false + /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -1573,6 +1583,10 @@ packages: p-limit: 3.1.0 dev: true + /packet-reader@1.0.0: + resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==} + dev: false + /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -1616,6 +1630,70 @@ packages: is-reference: 3.0.2 dev: true + /pg-cloudflare@1.1.1: + resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==} + requiresBuild: true + dev: false + optional: true + + /pg-connection-string@2.6.2: + resolution: {integrity: sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==} + dev: false + + /pg-int8@1.0.1: + resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} + engines: {node: '>=4.0.0'} + dev: false + + /pg-pool@3.6.1(pg@8.11.3): + resolution: {integrity: sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==} + peerDependencies: + pg: '>=8.0' + dependencies: + pg: 8.11.3 + dev: false + + /pg-protocol@1.6.0: + resolution: {integrity: sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==} + dev: false + + /pg-types@2.2.0: + resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} + engines: {node: '>=4'} + dependencies: + pg-int8: 1.0.1 + postgres-array: 2.0.0 + postgres-bytea: 1.0.0 + postgres-date: 1.0.7 + postgres-interval: 1.2.0 + dev: false + + /pg@8.11.3: + resolution: {integrity: sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==} + engines: {node: '>= 8.0.0'} + peerDependencies: + pg-native: '>=3.0.1' + peerDependenciesMeta: + pg-native: + optional: true + dependencies: + buffer-writer: 2.0.0 + packet-reader: 1.0.0 + pg-connection-string: 2.6.2 + pg-pool: 3.6.1(pg@8.11.3) + pg-protocol: 1.6.0 + pg-types: 2.2.0 + pgpass: 1.0.5 + optionalDependencies: + pg-cloudflare: 1.1.1 + dev: false + + /pgpass@1.0.5: + resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} + dependencies: + split2: 4.2.0 + dev: false + /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: true @@ -1701,6 +1779,28 @@ packages: source-map-js: 1.0.2 dev: true + /postgres-array@2.0.0: + resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} + engines: {node: '>=4'} + dev: false + + /postgres-bytea@1.0.0: + resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} + engines: {node: '>=0.10.0'} + dev: false + + /postgres-date@1.0.7: + resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} + engines: {node: '>=0.10.0'} + dev: false + + /postgres-interval@1.2.0: + resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} + engines: {node: '>=0.10.0'} + dependencies: + xtend: 4.0.2 + dev: false + /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -1862,6 +1962,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + dev: false + /stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true @@ -2271,6 +2376,11 @@ packages: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true + /xtend@4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + dev: false + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true diff --git a/src/app.html b/src/app.html index effe0d0..0cffc1d 100644 --- a/src/app.html +++ b/src/app.html @@ -4,6 +4,9 @@ + + + %sveltekit.head% diff --git a/src/lib/Element.svelte b/src/lib/Element.svelte deleted file mode 100644 index bb05cad..0000000 --- a/src/lib/Element.svelte +++ /dev/null @@ -1,23 +0,0 @@ - - -
-

{name}

- - {stage} - {date} - From {begin_time} to {end_time} -
- - \ No newline at end of file diff --git a/src/lib/RequestElement.svelte b/src/lib/RequestElement.svelte new file mode 100644 index 0000000..3593d24 --- /dev/null +++ b/src/lib/RequestElement.svelte @@ -0,0 +1,30 @@ + + + + {verb} + + + + diff --git a/src/lib/requests.ts b/src/lib/requests.ts new file mode 100644 index 0000000..80525d2 --- /dev/null +++ b/src/lib/requests.ts @@ -0,0 +1,24 @@ +export function getAllRequests() { + const request = []; + request.push({ + id: '1', + method: 'GET', + name: 'Request 1', + url: 'https://syfdxgchvjbknl.free.beeceptor.com/todos' + }); + request.push({ + id: '2', + method: 'POST', + name: 'Request 2', + url: 'https://www.google.com' + }); + request.push({ id: '3', method: 'PUT', name: 'Request 3' }); + request.push({ id: '4', method: 'DELETE', name: 'Request 4' }); + request.push({ id: '5', method: 'OPTIONS', name: 'Request 5' }); + request.push({ id: '6', method: 'HEAD', name: 'Request 6' }); + request.push({ id: '7', method: 'PATCH', name: 'Request 7' }); + request.push({ id: '8', method: 'TRACE', name: 'Request 8' }); + request.push({ id: '9', method: 'CONNECT', name: 'Request 9' }); + + return request; +} \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte new file mode 100644 index 0000000..4e307a2 --- /dev/null +++ b/src/routes/+layout.svelte @@ -0,0 +1,75 @@ + + + +
+ +
+ + diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8ea2480..e8b5482 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,15 +1 @@ - -

Welcome to SvelteKit

-

Visit kit.svelte.dev to read the documentation

- -Lorem ipsum dolor sit amet consectetur, adipisicing elit. Unde iure, esse sequi deleniti veniam quos! Exercitationem, cumque fugit eaque, veniam optio labore distinctio tempore impedit libero ad numquam delectus non! - +TEXT diff --git a/src/routes/request/[id]/+page.svelte b/src/routes/request/[id]/+page.svelte new file mode 100644 index 0000000..f5769f0 --- /dev/null +++ b/src/routes/request/[id]/+page.svelte @@ -0,0 +1,59 @@ + + +

{$page.params.id} - {name}

+
+ + + +
+

Request

+ + +

Response

+ + +

cURL

+
+curl{#if method != 'GET'} -X {method}{/if} {requestUrl}
+{#each headers as header}
+		-H "{header.key}: {header.value}"
+	{/each}
+{#if body}
+		-d '{body}'
+	{/if}
+
diff --git a/src/routes/request/[id]/Request.svelte b/src/routes/request/[id]/Request.svelte new file mode 100644 index 0000000..a21baf4 --- /dev/null +++ b/src/routes/request/[id]/Request.svelte @@ -0,0 +1,117 @@ + + +
+ + + + + + +
+
+