Skip to content

Commit 902356c

Browse files
committed
Generate remove queries typed files
1 parent c4e34aa commit 902356c

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

copy-handlebars.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ mkdir -p "$dest_dir"
1010
# Copy the files from the source to the destination directory
1111
cp "$src_dir/model-template.handlebars" "$dest_dir"
1212
cp "$src_dir/index-template.handlebars" "$dest_dir"
13+
cp "$src_dir/query-template.handlebars" "$dest_dir"
1314

1415
echo "Files copied successfully."

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "dist/index.js",
66
"module": "dist/index.js",
77
"bin": {
8-
"sync-database-models": "./dist/generators/generate-models.js"
8+
"sync-database-models": "./dist/generators/generate-models.js",
9+
"sync-remote-queries": "./dist/generators/generate-queries.js"
910
},
1011
"files": [
1112
"dist/*"

src/connections/outerbase.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { QueryType } from '../query-params'
22
import { Query, constructRawQuery } from '../query'
33
import { Connection } from './index'
4-
export const API_URL = 'https://app.outerbase.com'
4+
export const API_URL = 'https://app.outerbase.com/api/v1'
55

66
export class OuterbaseConnection implements Connection {
77
// The API key used for Outerbase authentication
@@ -63,7 +63,7 @@ export class OuterbaseConnection implements Connection {
6363
if (!this.api_key) throw new Error('Outerbase API key is not set')
6464
if (!query) throw new Error('Query was not provided')
6565

66-
const response = await fetch(`${API_URL}/api/v1/ezql/raw`, {
66+
const response = await fetch(`${API_URL}/ezql/raw`, {
6767
method: 'POST',
6868
headers: {
6969
'Content-Type': 'application/json',
@@ -107,7 +107,7 @@ export class OuterbaseConnection implements Connection {
107107
if (!queryId) throw new Error('Query ID is not set')
108108

109109
const response = await fetch(
110-
`${API_URL}/api/v1/ezql/query/${queryId}`,
110+
`${API_URL}/ezql/query/${queryId}`,
111111
{
112112
method: 'POST',
113113
headers: {

src/generators/generate-models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async function main() {
4949
const modelTemplate = compile(modelTemplateSource)
5050
const indexTemplate = compile(indexTemplateSource)
5151

52-
const response = await fetch(`${API_URL}/api/v1/ezql/schema`, {
52+
const response = await fetch(`${API_URL}/ezql/schema`, {
5353
method: 'GET',
5454
headers: {
5555
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)