@squadbase/vite-server 0.1.7-dev.0 → 0.1.7-dev.1
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/dist/cli/index.js +5 -22
- package/dist/connectors/google-sheets.js +10 -77
- package/dist/index.js +5 -22
- package/dist/main.js +5 -22
- package/dist/vite-plugin.js +5 -22
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -72736,21 +72736,6 @@ await drive.updateFile("fileId123", {}, "newFolderId", "oldFolderId");
|
|
|
72736
72736
|
|
|
72737
72737
|
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
72738
72738
|
import { z as z27 } from "zod";
|
|
72739
|
-
|
|
72740
|
-
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72741
|
-
var parameters18 = {
|
|
72742
|
-
spreadsheetId: new ParameterDefinition({
|
|
72743
|
-
slug: "spreadsheet-id",
|
|
72744
|
-
name: "Google Sheets Spreadsheet ID",
|
|
72745
|
-
description: "The spreadsheet ID from the Google Sheets URL (the segment between /d/ and /edit in https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit).",
|
|
72746
|
-
envVarBaseKey: "GOOGLE_SHEETS_SPREADSHEET_ID",
|
|
72747
|
-
type: "text",
|
|
72748
|
-
secret: false,
|
|
72749
|
-
required: true
|
|
72750
|
-
})
|
|
72751
|
-
};
|
|
72752
|
-
|
|
72753
|
-
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
72754
72739
|
var SHEETS_BASE_URL = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
72755
72740
|
var REQUEST_TIMEOUT_MS17 = 6e4;
|
|
72756
72741
|
var cachedToken13 = null;
|
|
@@ -72821,16 +72806,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
72821
72806
|
error: `Connection ${connectionId} not found`
|
|
72822
72807
|
};
|
|
72823
72808
|
}
|
|
72824
|
-
const spreadsheetIdParam = connection.parameters.find(
|
|
72825
|
-
(p6) => p6.parameterSlug === parameters18.spreadsheetId.slug
|
|
72826
|
-
);
|
|
72827
|
-
const spreadsheetId = spreadsheetIdParam?.value ?? void 0;
|
|
72828
|
-
const resolvedPath = spreadsheetId ? path5.replace(/\{spreadsheetId\}/g, spreadsheetId) : path5;
|
|
72829
72809
|
console.log(
|
|
72830
|
-
`[connector-request] google-sheets/${connection.name}: ${method} ${
|
|
72810
|
+
`[connector-request] google-sheets/${connection.name}: ${method} ${path5}`
|
|
72831
72811
|
);
|
|
72832
72812
|
try {
|
|
72833
|
-
let url = `${SHEETS_BASE_URL}${
|
|
72813
|
+
let url = `${SHEETS_BASE_URL}${path5 === "" || path5.startsWith("/") ? "" : "/"}${path5}`;
|
|
72834
72814
|
if (queryParams) {
|
|
72835
72815
|
const searchParams = new URLSearchParams(queryParams);
|
|
72836
72816
|
url += `?${searchParams.toString()}`;
|
|
@@ -72921,6 +72901,9 @@ var googleSheetsOnboarding = new ConnectorOnboarding({
|
|
|
72921
72901
|
}
|
|
72922
72902
|
});
|
|
72923
72903
|
|
|
72904
|
+
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72905
|
+
var parameters18 = {};
|
|
72906
|
+
|
|
72924
72907
|
// ../connectors/src/connectors/google-sheets/index.ts
|
|
72925
72908
|
var tools18 = { request: requestTool9 };
|
|
72926
72909
|
var googleSheetsConnector = new ConnectorPlugin({
|
|
@@ -1,75 +1,11 @@
|
|
|
1
|
-
// ../connectors/src/parameter-definition.ts
|
|
2
|
-
var ParameterDefinition = class {
|
|
3
|
-
slug;
|
|
4
|
-
name;
|
|
5
|
-
description;
|
|
6
|
-
envVarBaseKey;
|
|
7
|
-
type;
|
|
8
|
-
secret;
|
|
9
|
-
required;
|
|
10
|
-
constructor(config) {
|
|
11
|
-
this.slug = config.slug;
|
|
12
|
-
this.name = config.name;
|
|
13
|
-
this.description = config.description;
|
|
14
|
-
this.envVarBaseKey = config.envVarBaseKey;
|
|
15
|
-
this.type = config.type;
|
|
16
|
-
this.secret = config.secret;
|
|
17
|
-
this.required = config.required;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the parameter value from a ConnectorConnectionObject.
|
|
21
|
-
*/
|
|
22
|
-
getValue(connection2) {
|
|
23
|
-
const param = connection2.parameters.find(
|
|
24
|
-
(p) => p.parameterSlug === this.slug
|
|
25
|
-
);
|
|
26
|
-
if (!param || param.value == null) {
|
|
27
|
-
throw new Error(
|
|
28
|
-
`Parameter "${this.slug}" not found or has no value in connection "${connection2.id}"`
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
return param.value;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Try to get the parameter value. Returns undefined if not found (for optional params).
|
|
35
|
-
*/
|
|
36
|
-
tryGetValue(connection2) {
|
|
37
|
-
const param = connection2.parameters.find(
|
|
38
|
-
(p) => p.parameterSlug === this.slug
|
|
39
|
-
);
|
|
40
|
-
if (!param || param.value == null) return void 0;
|
|
41
|
-
return param.value;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
46
|
-
var parameters = {
|
|
47
|
-
spreadsheetId: new ParameterDefinition({
|
|
48
|
-
slug: "spreadsheet-id",
|
|
49
|
-
name: "Google Sheets Spreadsheet ID",
|
|
50
|
-
description: "The spreadsheet ID from the Google Sheets URL (the segment between /d/ and /edit in https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit).",
|
|
51
|
-
envVarBaseKey: "GOOGLE_SHEETS_SPREADSHEET_ID",
|
|
52
|
-
type: "text",
|
|
53
|
-
secret: false,
|
|
54
|
-
required: true
|
|
55
|
-
})
|
|
56
|
-
};
|
|
57
|
-
|
|
58
1
|
// ../connectors/src/connectors/google-sheets/sdk/index.ts
|
|
59
2
|
var SHEETS_BASE_URL = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
60
|
-
function createClient(
|
|
61
|
-
const spreadsheetId = params[parameters.spreadsheetId.slug];
|
|
62
|
-
if (!spreadsheetId) {
|
|
63
|
-
throw new Error(
|
|
64
|
-
`google-sheets: missing required parameter: ${parameters.spreadsheetId.slug}`
|
|
65
|
-
);
|
|
66
|
-
}
|
|
3
|
+
function createClient(_params, fetchFn = fetch) {
|
|
67
4
|
function request(path2, init) {
|
|
68
|
-
const
|
|
69
|
-
const url = `${SHEETS_BASE_URL}${resolvedPath === "" || resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
|
|
5
|
+
const url = `${SHEETS_BASE_URL}${path2 === "" || path2.startsWith("/") ? "" : "/"}${path2}`;
|
|
70
6
|
return fetchFn(url, init);
|
|
71
7
|
}
|
|
72
|
-
async function getSpreadsheet() {
|
|
8
|
+
async function getSpreadsheet(spreadsheetId) {
|
|
73
9
|
const url = `${SHEETS_BASE_URL}/${spreadsheetId}?fields=spreadsheetId,properties,sheets.properties`;
|
|
74
10
|
const response = await fetchFn(url);
|
|
75
11
|
if (!response.ok) {
|
|
@@ -80,7 +16,7 @@ function createClient(params, fetchFn = fetch) {
|
|
|
80
16
|
}
|
|
81
17
|
return await response.json();
|
|
82
18
|
}
|
|
83
|
-
async function getValues(range) {
|
|
19
|
+
async function getValues(spreadsheetId, range) {
|
|
84
20
|
const url = `${SHEETS_BASE_URL}/${spreadsheetId}/values/${encodeURIComponent(range)}`;
|
|
85
21
|
const response = await fetchFn(url);
|
|
86
22
|
if (!response.ok) {
|
|
@@ -91,7 +27,7 @@ function createClient(params, fetchFn = fetch) {
|
|
|
91
27
|
}
|
|
92
28
|
return await response.json();
|
|
93
29
|
}
|
|
94
|
-
async function batchGetValues(ranges) {
|
|
30
|
+
async function batchGetValues(spreadsheetId, ranges) {
|
|
95
31
|
const searchParams = new URLSearchParams();
|
|
96
32
|
for (const range of ranges) {
|
|
97
33
|
searchParams.append("ranges", range);
|
|
@@ -107,7 +43,6 @@ function createClient(params, fetchFn = fetch) {
|
|
|
107
43
|
return await response.json();
|
|
108
44
|
}
|
|
109
45
|
return {
|
|
110
|
-
spreadsheetId,
|
|
111
46
|
request,
|
|
112
47
|
getSpreadsheet,
|
|
113
48
|
getValues,
|
|
@@ -334,16 +269,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
334
269
|
error: `Connection ${connectionId} not found`
|
|
335
270
|
};
|
|
336
271
|
}
|
|
337
|
-
const spreadsheetIdParam = connection2.parameters.find(
|
|
338
|
-
(p) => p.parameterSlug === parameters.spreadsheetId.slug
|
|
339
|
-
);
|
|
340
|
-
const spreadsheetId = spreadsheetIdParam?.value ?? void 0;
|
|
341
|
-
const resolvedPath = spreadsheetId ? path2.replace(/\{spreadsheetId\}/g, spreadsheetId) : path2;
|
|
342
272
|
console.log(
|
|
343
|
-
`[connector-request] google-sheets/${connection2.name}: ${method} ${
|
|
273
|
+
`[connector-request] google-sheets/${connection2.name}: ${method} ${path2}`
|
|
344
274
|
);
|
|
345
275
|
try {
|
|
346
|
-
let url = `${SHEETS_BASE_URL2}${
|
|
276
|
+
let url = `${SHEETS_BASE_URL2}${path2 === "" || path2.startsWith("/") ? "" : "/"}${path2}`;
|
|
347
277
|
if (queryParams) {
|
|
348
278
|
const searchParams = new URLSearchParams(queryParams);
|
|
349
279
|
url += `?${searchParams.toString()}`;
|
|
@@ -434,6 +364,9 @@ var googleSheetsOnboarding = new ConnectorOnboarding({
|
|
|
434
364
|
}
|
|
435
365
|
});
|
|
436
366
|
|
|
367
|
+
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
368
|
+
var parameters = {};
|
|
369
|
+
|
|
437
370
|
// ../connectors/src/connectors/google-sheets/index.ts
|
|
438
371
|
var tools = { request: requestTool };
|
|
439
372
|
var googleSheetsConnector = new ConnectorPlugin({
|
package/dist/index.js
CHANGED
|
@@ -72671,21 +72671,6 @@ await drive.updateFile("fileId123", {}, "newFolderId", "oldFolderId");
|
|
|
72671
72671
|
|
|
72672
72672
|
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
72673
72673
|
import { z as z27 } from "zod";
|
|
72674
|
-
|
|
72675
|
-
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72676
|
-
var parameters18 = {
|
|
72677
|
-
spreadsheetId: new ParameterDefinition({
|
|
72678
|
-
slug: "spreadsheet-id",
|
|
72679
|
-
name: "Google Sheets Spreadsheet ID",
|
|
72680
|
-
description: "The spreadsheet ID from the Google Sheets URL (the segment between /d/ and /edit in https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit).",
|
|
72681
|
-
envVarBaseKey: "GOOGLE_SHEETS_SPREADSHEET_ID",
|
|
72682
|
-
type: "text",
|
|
72683
|
-
secret: false,
|
|
72684
|
-
required: true
|
|
72685
|
-
})
|
|
72686
|
-
};
|
|
72687
|
-
|
|
72688
|
-
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
72689
72674
|
var SHEETS_BASE_URL = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
72690
72675
|
var REQUEST_TIMEOUT_MS17 = 6e4;
|
|
72691
72676
|
var cachedToken13 = null;
|
|
@@ -72756,16 +72741,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
72756
72741
|
error: `Connection ${connectionId} not found`
|
|
72757
72742
|
};
|
|
72758
72743
|
}
|
|
72759
|
-
const spreadsheetIdParam = connection2.parameters.find(
|
|
72760
|
-
(p6) => p6.parameterSlug === parameters18.spreadsheetId.slug
|
|
72761
|
-
);
|
|
72762
|
-
const spreadsheetId = spreadsheetIdParam?.value ?? void 0;
|
|
72763
|
-
const resolvedPath = spreadsheetId ? path5.replace(/\{spreadsheetId\}/g, spreadsheetId) : path5;
|
|
72764
72744
|
console.log(
|
|
72765
|
-
`[connector-request] google-sheets/${connection2.name}: ${method} ${
|
|
72745
|
+
`[connector-request] google-sheets/${connection2.name}: ${method} ${path5}`
|
|
72766
72746
|
);
|
|
72767
72747
|
try {
|
|
72768
|
-
let url = `${SHEETS_BASE_URL}${
|
|
72748
|
+
let url = `${SHEETS_BASE_URL}${path5 === "" || path5.startsWith("/") ? "" : "/"}${path5}`;
|
|
72769
72749
|
if (queryParams) {
|
|
72770
72750
|
const searchParams = new URLSearchParams(queryParams);
|
|
72771
72751
|
url += `?${searchParams.toString()}`;
|
|
@@ -72856,6 +72836,9 @@ var googleSheetsOnboarding = new ConnectorOnboarding({
|
|
|
72856
72836
|
}
|
|
72857
72837
|
});
|
|
72858
72838
|
|
|
72839
|
+
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72840
|
+
var parameters18 = {};
|
|
72841
|
+
|
|
72859
72842
|
// ../connectors/src/connectors/google-sheets/index.ts
|
|
72860
72843
|
var tools18 = { request: requestTool9 };
|
|
72861
72844
|
var googleSheetsConnector = new ConnectorPlugin({
|
package/dist/main.js
CHANGED
|
@@ -72671,21 +72671,6 @@ await drive.updateFile("fileId123", {}, "newFolderId", "oldFolderId");
|
|
|
72671
72671
|
|
|
72672
72672
|
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
72673
72673
|
import { z as z27 } from "zod";
|
|
72674
|
-
|
|
72675
|
-
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72676
|
-
var parameters18 = {
|
|
72677
|
-
spreadsheetId: new ParameterDefinition({
|
|
72678
|
-
slug: "spreadsheet-id",
|
|
72679
|
-
name: "Google Sheets Spreadsheet ID",
|
|
72680
|
-
description: "The spreadsheet ID from the Google Sheets URL (the segment between /d/ and /edit in https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit).",
|
|
72681
|
-
envVarBaseKey: "GOOGLE_SHEETS_SPREADSHEET_ID",
|
|
72682
|
-
type: "text",
|
|
72683
|
-
secret: false,
|
|
72684
|
-
required: true
|
|
72685
|
-
})
|
|
72686
|
-
};
|
|
72687
|
-
|
|
72688
|
-
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
72689
72674
|
var SHEETS_BASE_URL = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
72690
72675
|
var REQUEST_TIMEOUT_MS17 = 6e4;
|
|
72691
72676
|
var cachedToken13 = null;
|
|
@@ -72756,16 +72741,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
72756
72741
|
error: `Connection ${connectionId} not found`
|
|
72757
72742
|
};
|
|
72758
72743
|
}
|
|
72759
|
-
const spreadsheetIdParam = connection2.parameters.find(
|
|
72760
|
-
(p6) => p6.parameterSlug === parameters18.spreadsheetId.slug
|
|
72761
|
-
);
|
|
72762
|
-
const spreadsheetId = spreadsheetIdParam?.value ?? void 0;
|
|
72763
|
-
const resolvedPath = spreadsheetId ? path6.replace(/\{spreadsheetId\}/g, spreadsheetId) : path6;
|
|
72764
72744
|
console.log(
|
|
72765
|
-
`[connector-request] google-sheets/${connection2.name}: ${method} ${
|
|
72745
|
+
`[connector-request] google-sheets/${connection2.name}: ${method} ${path6}`
|
|
72766
72746
|
);
|
|
72767
72747
|
try {
|
|
72768
|
-
let url = `${SHEETS_BASE_URL}${
|
|
72748
|
+
let url = `${SHEETS_BASE_URL}${path6 === "" || path6.startsWith("/") ? "" : "/"}${path6}`;
|
|
72769
72749
|
if (queryParams) {
|
|
72770
72750
|
const searchParams = new URLSearchParams(queryParams);
|
|
72771
72751
|
url += `?${searchParams.toString()}`;
|
|
@@ -72856,6 +72836,9 @@ var googleSheetsOnboarding = new ConnectorOnboarding({
|
|
|
72856
72836
|
}
|
|
72857
72837
|
});
|
|
72858
72838
|
|
|
72839
|
+
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72840
|
+
var parameters18 = {};
|
|
72841
|
+
|
|
72859
72842
|
// ../connectors/src/connectors/google-sheets/index.ts
|
|
72860
72843
|
var tools18 = { request: requestTool9 };
|
|
72861
72844
|
var googleSheetsConnector = new ConnectorPlugin({
|
package/dist/vite-plugin.js
CHANGED
|
@@ -72672,21 +72672,6 @@ await drive.updateFile("fileId123", {}, "newFolderId", "oldFolderId");
|
|
|
72672
72672
|
|
|
72673
72673
|
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
72674
72674
|
import { z as z27 } from "zod";
|
|
72675
|
-
|
|
72676
|
-
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72677
|
-
var parameters18 = {
|
|
72678
|
-
spreadsheetId: new ParameterDefinition({
|
|
72679
|
-
slug: "spreadsheet-id",
|
|
72680
|
-
name: "Google Sheets Spreadsheet ID",
|
|
72681
|
-
description: "The spreadsheet ID from the Google Sheets URL (the segment between /d/ and /edit in https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit).",
|
|
72682
|
-
envVarBaseKey: "GOOGLE_SHEETS_SPREADSHEET_ID",
|
|
72683
|
-
type: "text",
|
|
72684
|
-
secret: false,
|
|
72685
|
-
required: true
|
|
72686
|
-
})
|
|
72687
|
-
};
|
|
72688
|
-
|
|
72689
|
-
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
72690
72675
|
var SHEETS_BASE_URL = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
72691
72676
|
var REQUEST_TIMEOUT_MS17 = 6e4;
|
|
72692
72677
|
var cachedToken13 = null;
|
|
@@ -72757,16 +72742,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
72757
72742
|
error: `Connection ${connectionId} not found`
|
|
72758
72743
|
};
|
|
72759
72744
|
}
|
|
72760
|
-
const spreadsheetIdParam = connection.parameters.find(
|
|
72761
|
-
(p6) => p6.parameterSlug === parameters18.spreadsheetId.slug
|
|
72762
|
-
);
|
|
72763
|
-
const spreadsheetId = spreadsheetIdParam?.value ?? void 0;
|
|
72764
|
-
const resolvedPath = spreadsheetId ? path4.replace(/\{spreadsheetId\}/g, spreadsheetId) : path4;
|
|
72765
72745
|
console.log(
|
|
72766
|
-
`[connector-request] google-sheets/${connection.name}: ${method} ${
|
|
72746
|
+
`[connector-request] google-sheets/${connection.name}: ${method} ${path4}`
|
|
72767
72747
|
);
|
|
72768
72748
|
try {
|
|
72769
|
-
let url = `${SHEETS_BASE_URL}${
|
|
72749
|
+
let url = `${SHEETS_BASE_URL}${path4 === "" || path4.startsWith("/") ? "" : "/"}${path4}`;
|
|
72770
72750
|
if (queryParams) {
|
|
72771
72751
|
const searchParams = new URLSearchParams(queryParams);
|
|
72772
72752
|
url += `?${searchParams.toString()}`;
|
|
@@ -72857,6 +72837,9 @@ var googleSheetsOnboarding = new ConnectorOnboarding({
|
|
|
72857
72837
|
}
|
|
72858
72838
|
});
|
|
72859
72839
|
|
|
72840
|
+
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72841
|
+
var parameters18 = {};
|
|
72842
|
+
|
|
72860
72843
|
// ../connectors/src/connectors/google-sheets/index.ts
|
|
72861
72844
|
var tools18 = { request: requestTool9 };
|
|
72862
72845
|
var googleSheetsConnector = new ConnectorPlugin({
|