create-dovite 2.0.0 → 2.2.0
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/README.md +20 -16
- package/index.js +10 -4
- package/package.json +7 -3
- package/src/files.js +111 -0
- package/src/prompts.js +52 -0
- package/src/setup.js +129 -0
- package/templates/react-js/jsconfig.json +7 -0
- package/templates/react-js/public/manifest.json +12 -0
- package/templates/react-js/public/thumbnail.png +0 -0
- package/templates/react-js/src/API/currentUserContext.jsx +56 -0
- package/templates/react-js/src/API/dataApi.js +235 -0
- package/templates/react-js/src/API/domoAPI.js +311 -0
- package/templates/react-js/src/App.jsx +7 -0
- package/templates/react-js/src/index.css +1 -0
- package/templates/react-js/src/pages/index.css +96 -0
- package/templates/react-js/src/pages/index.jsx +340 -0
- package/templates/react-js/vite.config.js +40 -0
- package/templates/react-ts/public/manifest.json +12 -0
- package/templates/react-ts/public/thumbnail.png +0 -0
- package/templates/react-ts/src/API/currentUserContext.tsx +66 -0
- package/templates/react-ts/src/API/dataApi.ts +338 -0
- package/templates/react-ts/src/API/domoAPI.ts +355 -0
- package/templates/react-ts/src/App.tsx +7 -0
- package/templates/react-ts/src/index.css +1 -0
- package/templates/react-ts/src/pages/index.css +96 -0
- package/templates/react-ts/src/pages/index.tsx +347 -0
- package/templates/react-ts/tsconfig.app.json +31 -0
- package/templates/react-ts/tsconfig.json +17 -0
- package/templates/react-ts/vite.config.ts +47 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import domo from "ryuu.js";
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
|
|
4
|
+
export async function fetchAIData(prompt, template, maxWords) {
|
|
5
|
+
try {
|
|
6
|
+
// Validate the required "prompt" parameter
|
|
7
|
+
if (!prompt || typeof prompt !== "string") {
|
|
8
|
+
throw new Error("The 'prompt' parameter is required and must be a string.");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Construct the body dynamically, including properties only if they are valid
|
|
12
|
+
const body = {
|
|
13
|
+
input: prompt,
|
|
14
|
+
...(template && typeof template === "string" && {
|
|
15
|
+
promptTemplate: {
|
|
16
|
+
template,
|
|
17
|
+
},
|
|
18
|
+
}),
|
|
19
|
+
...(maxWords && !isNaN(maxWords) && {
|
|
20
|
+
parameters: {
|
|
21
|
+
max_words: maxWords.toString(),
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Send the POST request
|
|
27
|
+
const response = await domo.post(`/domo/ai/v1/text/generation`, body);
|
|
28
|
+
console.log("AI Response:", response.output);
|
|
29
|
+
|
|
30
|
+
return response?.output;
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error("Error fetching data:", error);
|
|
33
|
+
throw error; // Re-throw the error for better upstream handling
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export async function fetchData(dataset) {
|
|
39
|
+
try {
|
|
40
|
+
const response = await domo.get(`/data/v1/${dataset}`).then((data) => {
|
|
41
|
+
return data;
|
|
42
|
+
});
|
|
43
|
+
// console.log(response);
|
|
44
|
+
return response;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error("Error fetching data:", error);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export async function fetchSqlData(dataset, query) {
|
|
51
|
+
// console.log("Query",query);
|
|
52
|
+
|
|
53
|
+
// Ensure the query is a string
|
|
54
|
+
if (typeof query !== "string") {
|
|
55
|
+
throw new Error("Query must be a string");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
// Fetch data from the API
|
|
60
|
+
const apiData = await domo
|
|
61
|
+
.post(`/sql/v1/${dataset}`, query, { contentType: "text/plain" })
|
|
62
|
+
.then((data) => {
|
|
63
|
+
// console.log('Fetched Data:', data);
|
|
64
|
+
return data;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Validate the fetched data
|
|
68
|
+
if (!apiData || !apiData.columns || !apiData.rows) {
|
|
69
|
+
throw new Error("Invalid data received from the API");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Extract and clean column names
|
|
73
|
+
const cleanedColumns = apiData.columns.map((column) => {
|
|
74
|
+
return column
|
|
75
|
+
.replace(/`/g, "")
|
|
76
|
+
.replace(/T1\./g, "")
|
|
77
|
+
.replace(/avg\((.*?)\)/i, "$1")
|
|
78
|
+
.trim();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Map rows to cleaned column names
|
|
82
|
+
const jsonResult = apiData.rows.map((row) => {
|
|
83
|
+
const jsonObject = {};
|
|
84
|
+
cleanedColumns.forEach((cleanedColumn, index) => {
|
|
85
|
+
jsonObject[cleanedColumn] = row[index];
|
|
86
|
+
});
|
|
87
|
+
return jsonObject;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// console.log("Mapped SQL DATA",jsonResult);
|
|
91
|
+
|
|
92
|
+
// Return the dynamically created JSON
|
|
93
|
+
return jsonResult;
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.error("Error fetching or processing data:", error);
|
|
96
|
+
throw error; // Rethrow the error for the caller to handle
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export async function sendEmail(to, subject, body, attachment) {
|
|
101
|
+
const data = {
|
|
102
|
+
to,
|
|
103
|
+
subject,
|
|
104
|
+
body,
|
|
105
|
+
...(attachment && { attachment: [attachment] }),
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
if (data) {
|
|
109
|
+
try {
|
|
110
|
+
const response = await domo.post(
|
|
111
|
+
`/domo/workflow/v1/models/email/start`,
|
|
112
|
+
data
|
|
113
|
+
);
|
|
114
|
+
if (response) {
|
|
115
|
+
console.log("response", response);
|
|
116
|
+
}
|
|
117
|
+
} catch (err) {
|
|
118
|
+
console.error("Error sending email:", err);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//Dataflow
|
|
124
|
+
export const DataflowsActions = async (action, dataflowId) => {
|
|
125
|
+
const data = {
|
|
126
|
+
action,
|
|
127
|
+
dataflowId,
|
|
128
|
+
result: true,
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
if (data) {
|
|
132
|
+
try {
|
|
133
|
+
const response = await domo.post(
|
|
134
|
+
`/domo/workflow/v1/models/dataflow/start`,
|
|
135
|
+
data
|
|
136
|
+
);
|
|
137
|
+
if (response) {
|
|
138
|
+
console.log("response", response);
|
|
139
|
+
}
|
|
140
|
+
} catch (err) {
|
|
141
|
+
console.error("Error sending email:", err);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
export const generateAccessToken = async (clientId, clientSecret) => {
|
|
146
|
+
const tokenUrl = "https://api.domo.com/oauth/token";
|
|
147
|
+
try {
|
|
148
|
+
const response = await axios.post(
|
|
149
|
+
tokenUrl,
|
|
150
|
+
new URLSearchParams({
|
|
151
|
+
grant_type: "client_credentials",
|
|
152
|
+
scope: "user",
|
|
153
|
+
}).toString(),
|
|
154
|
+
{
|
|
155
|
+
headers: {
|
|
156
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
157
|
+
},
|
|
158
|
+
auth: {
|
|
159
|
+
username: clientId,
|
|
160
|
+
password: clientSecret,
|
|
161
|
+
},
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
console.log("Response:", response);
|
|
165
|
+
|
|
166
|
+
console.log("Access Token:", response.data.access_token);
|
|
167
|
+
|
|
168
|
+
return response.data.access_token;
|
|
169
|
+
} catch (err) {
|
|
170
|
+
console.error("Error:", err);
|
|
171
|
+
throw err;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
//List Of Users
|
|
176
|
+
export const fetchUsers = async (accessToken) => {
|
|
177
|
+
const userUrl = `https://api.domo.com/v1/users?limit=500`;
|
|
178
|
+
console.log("accessToken", accessToken);
|
|
179
|
+
try {
|
|
180
|
+
if (!accessToken) {
|
|
181
|
+
console.log("Access token not found");
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const response = await axios.get(userUrl, {
|
|
185
|
+
headers: {
|
|
186
|
+
Authorization: `Bearer ${accessToken}`,
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
console.log("List of users with access token", response.data);
|
|
190
|
+
return response.data;
|
|
191
|
+
} catch (err) {
|
|
192
|
+
console.error("Error fetching User details:", err);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
//List Of Dataset
|
|
197
|
+
export const fetchDatasets = async (accessToken) => {
|
|
198
|
+
const datasetUrl = `https://api.domo.com/v1/datasets`;
|
|
199
|
+
|
|
200
|
+
try {
|
|
201
|
+
if (!accessToken) {
|
|
202
|
+
await generateAccessToken();
|
|
203
|
+
}
|
|
204
|
+
const response = await axios.get(datasetUrl, {
|
|
205
|
+
headers: {
|
|
206
|
+
Authorization: `Bearer ${accessToken}`,
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
// console.log("List of dataset", response.data);
|
|
210
|
+
return response.data;
|
|
211
|
+
} catch (err) {
|
|
212
|
+
console.error("Error fetching dataset details:", err);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
//Perticaular Dataset Details
|
|
217
|
+
export const fetchDatasetDetails = async (accessToken, datasetId) => {
|
|
218
|
+
const datasetUrl = `https://api.domo.com/v1/datasets/${datasetId}`;
|
|
219
|
+
|
|
220
|
+
try {
|
|
221
|
+
if (!accessToken) {
|
|
222
|
+
await generateAccessToken();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const response = await axios.get(datasetUrl, {
|
|
226
|
+
headers: {
|
|
227
|
+
Authorization: `Bearer ${accessToken}`,
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
// console.log("data", response.data)
|
|
231
|
+
return response.data;
|
|
232
|
+
} catch (err) {
|
|
233
|
+
console.error("Error fetching dataset details:", err);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import domo from "ryuu.js";
|
|
2
|
+
// import Download from "downloadjs";
|
|
3
|
+
|
|
4
|
+
const BASE_URL = "/domo/datastores/v1";
|
|
5
|
+
|
|
6
|
+
const GetCurrentUser = () => {
|
|
7
|
+
return domo
|
|
8
|
+
.get("/domo/environment/v1")
|
|
9
|
+
.then((user) => ({
|
|
10
|
+
...user,
|
|
11
|
+
displayName: user.userName,
|
|
12
|
+
avatarKey: `/domo/avatars/v2/USER/${user.userId}`,
|
|
13
|
+
}))
|
|
14
|
+
.catch((error) => {
|
|
15
|
+
console.error("Error getting current user:", error);
|
|
16
|
+
throw error;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const GetAllUser = () => {
|
|
21
|
+
return domo
|
|
22
|
+
.get(`/domo/users/v1?limit={500}`)
|
|
23
|
+
.then((response) => response)
|
|
24
|
+
.catch((error) => {
|
|
25
|
+
console.error("Error getting All users:", error);
|
|
26
|
+
throw error;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const GetUser = (userId) => {
|
|
31
|
+
return domo
|
|
32
|
+
.get(`/domo/users/v1/${userId}?includeDetails=true`)
|
|
33
|
+
.then((user) => ({ ...user, userName: user.displayName }))
|
|
34
|
+
.catch((error) => {
|
|
35
|
+
console.error("Error getting user:", error);
|
|
36
|
+
throw error;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const CreateDocument = (collectionName, document) => {
|
|
41
|
+
console.log(document);
|
|
42
|
+
console.log(collectionName);
|
|
43
|
+
|
|
44
|
+
return domo
|
|
45
|
+
.post(`${BASE_URL}/collections/${collectionName}/documents/`, {
|
|
46
|
+
content: document,
|
|
47
|
+
})
|
|
48
|
+
.then((response) => response)
|
|
49
|
+
.catch((error) => {
|
|
50
|
+
console.error("Error creating document:", error);
|
|
51
|
+
throw error;
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const ListDocuments = (collectionName) => {
|
|
56
|
+
return domo
|
|
57
|
+
.get(`${BASE_URL}/collections/${collectionName}/documents/`)
|
|
58
|
+
.then((response) => response)
|
|
59
|
+
.catch((error) => {
|
|
60
|
+
console.error("Error listing documents:", error);
|
|
61
|
+
throw error;
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const GetDocument = (collectionName, documentId) => {
|
|
66
|
+
return domo
|
|
67
|
+
.get(`${BASE_URL}/collections/${collectionName}/documents/${documentId}`)
|
|
68
|
+
.then((response) => response)
|
|
69
|
+
.catch((error) => {
|
|
70
|
+
console.error("Error getting document:", error);
|
|
71
|
+
throw error;
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const UpdateDocument = (collectionName, documentId, document) => {
|
|
76
|
+
return domo
|
|
77
|
+
.put(`${BASE_URL}/collections/${collectionName}/documents/${documentId}`, {
|
|
78
|
+
content: document,
|
|
79
|
+
})
|
|
80
|
+
.then((response) => response)
|
|
81
|
+
.catch((error) => {
|
|
82
|
+
console.error("Error updating document:", error);
|
|
83
|
+
throw error;
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const queryDocumentsWithAggregations = (
|
|
87
|
+
collectionName,
|
|
88
|
+
query = {},
|
|
89
|
+
aggregations = {},
|
|
90
|
+
options = {}
|
|
91
|
+
) => {
|
|
92
|
+
// Base URL for the query
|
|
93
|
+
let url = `${BASE_URL}/collections/${collectionName}/documents/query?`;
|
|
94
|
+
|
|
95
|
+
// Helper function to format aggregation parameters
|
|
96
|
+
const formatAggregationParams = (params) => {
|
|
97
|
+
return Object.entries(params)
|
|
98
|
+
.map(([property, alias]) => `${property} ${alias}`)
|
|
99
|
+
.join(", ");
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Append aggregation parameters to URL
|
|
103
|
+
if (aggregations.groupby) url += `groupby=${aggregations.groupby.join(",")}&`;
|
|
104
|
+
if (aggregations.count) url += `count=${aggregations.count}&`;
|
|
105
|
+
if (aggregations.avg)
|
|
106
|
+
url += `avg=${formatAggregationParams(aggregations.avg)}&`;
|
|
107
|
+
if (aggregations.min)
|
|
108
|
+
url += `min=${formatAggregationParams(aggregations.min)}&`;
|
|
109
|
+
if (aggregations.max)
|
|
110
|
+
url += `max=${formatAggregationParams(aggregations.max)}&`;
|
|
111
|
+
if (aggregations.sum)
|
|
112
|
+
url += `sum=${formatAggregationParams(aggregations.sum)}&`;
|
|
113
|
+
if (aggregations.unwind) url += `unwind=${aggregations.unwind.join(",")}&`;
|
|
114
|
+
|
|
115
|
+
// Append options to the URL
|
|
116
|
+
if (options.orderby) url += `orderby=${options.orderby}&`;
|
|
117
|
+
if (options.limit !== undefined) url += `limit=${options.limit}&`;
|
|
118
|
+
if (options.offset !== undefined) url += `offset=${options.offset}&`;
|
|
119
|
+
|
|
120
|
+
// Remove trailing "&" or "?" from the URL
|
|
121
|
+
url = url.replace(/[&?]$/, "");
|
|
122
|
+
|
|
123
|
+
return domo
|
|
124
|
+
.post(url, query)
|
|
125
|
+
.then((response) => {
|
|
126
|
+
console.log("Query successful:", response);
|
|
127
|
+
return response;
|
|
128
|
+
})
|
|
129
|
+
.catch((error) => {
|
|
130
|
+
console.error("Error querying documents with aggregations:", error);
|
|
131
|
+
throw error;
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const DeleteDocument = (collectionName, documentId) => {
|
|
136
|
+
return domo
|
|
137
|
+
.delete(`${BASE_URL}/collections/${collectionName}/documents/${documentId}`)
|
|
138
|
+
.then((response) => response.data)
|
|
139
|
+
.catch((error) => {
|
|
140
|
+
console.error("Error deleting document:", error);
|
|
141
|
+
throw error;
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const QueryDocument = (collectionName, query = {}, options = {}) => {
|
|
146
|
+
// Base URL for querying documents
|
|
147
|
+
let url = `${BASE_URL}/collections/${collectionName}/documents/query?`;
|
|
148
|
+
|
|
149
|
+
// Append optional parameters to the URL
|
|
150
|
+
if (options.limit !== undefined) url += `limit=${options.limit}&`;
|
|
151
|
+
if (options.offset !== undefined) url += `offset=${options.offset}&`;
|
|
152
|
+
if (options.orderby) url += `orderby=${options.orderby}&`;
|
|
153
|
+
|
|
154
|
+
// Remove trailing "&" or "?" from the URL
|
|
155
|
+
url = url.replace(/[&?]$/, "");
|
|
156
|
+
|
|
157
|
+
return domo
|
|
158
|
+
.post(url, query)
|
|
159
|
+
.then((response) => {
|
|
160
|
+
// console.log("Query successful:", response);
|
|
161
|
+
return response;
|
|
162
|
+
})
|
|
163
|
+
.catch((error) => {
|
|
164
|
+
console.error("Error querying documents:", error);
|
|
165
|
+
throw error;
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
// Query documents based on a specific date range
|
|
170
|
+
const queryDocumentsByDate = (collectionName, dateString, options = {}) => {
|
|
171
|
+
const query = {
|
|
172
|
+
"createdOn": {
|
|
173
|
+
"$lte": { "$date": dateString }
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
return QueryDocument(collectionName, query, options);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const BulkDeleteDocuments = (collectionName, ids) => {
|
|
180
|
+
return domo
|
|
181
|
+
.delete(
|
|
182
|
+
`${BASE_URL}/collections/${collectionName}/documents/bulk?ids=${ids}`
|
|
183
|
+
)
|
|
184
|
+
.then((response) => response)
|
|
185
|
+
.catch((error) => {
|
|
186
|
+
console.error("Error bulk deleting documents:", error);
|
|
187
|
+
throw error;
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
const UploadFile = (file, name, description = "", isPublic = false) => {
|
|
192
|
+
const formData = new FormData();
|
|
193
|
+
formData.append("file", file);
|
|
194
|
+
const url = `/domo/data-files/v1?name=
|
|
195
|
+
${name}&description=${description}&public=${isPublic}`;
|
|
196
|
+
const options = { contentType: "multipart" };
|
|
197
|
+
return domo
|
|
198
|
+
.post(url, formData, options)
|
|
199
|
+
.then((response) => response)
|
|
200
|
+
.catch((err) => {
|
|
201
|
+
console.log(err);
|
|
202
|
+
throw err;
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const UploadRevision = (file, fileId) => {
|
|
207
|
+
const formData = new FormData();
|
|
208
|
+
formData.append("file", file);
|
|
209
|
+
const url = `/domo/data-files/v1/${fileId}`;
|
|
210
|
+
const options = { contentType: "multipart" };
|
|
211
|
+
return domo
|
|
212
|
+
.put(url, formData, options)
|
|
213
|
+
.then((response) => response)
|
|
214
|
+
.catch((err) => {
|
|
215
|
+
console.log(err);
|
|
216
|
+
throw err;
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// const DownloadFile = (fileId, filename, revisionId) => {
|
|
221
|
+
// const options = { responseType: "blob" };
|
|
222
|
+
// const url = `/domo/data-files/v1/${fileId}${
|
|
223
|
+
// revisionId ? `/revisions/${revisionId}` : ""
|
|
224
|
+
// }`;
|
|
225
|
+
// return domo
|
|
226
|
+
// .get(url, options)
|
|
227
|
+
// .then((data) => {
|
|
228
|
+
// Download(data, filename);
|
|
229
|
+
// })
|
|
230
|
+
// .then((response) => response)
|
|
231
|
+
// .catch((err) => {
|
|
232
|
+
// console.log(err);
|
|
233
|
+
// throw err;
|
|
234
|
+
// });
|
|
235
|
+
// };
|
|
236
|
+
|
|
237
|
+
const GetFile = (fileId, revisionId) => {
|
|
238
|
+
const options = { responseType: "blob" };
|
|
239
|
+
const url = `/domo/data-files/v1/${fileId}${
|
|
240
|
+
revisionId ? `/revisions/${revisionId}` : ""
|
|
241
|
+
}`;
|
|
242
|
+
return domo
|
|
243
|
+
.get(url, options)
|
|
244
|
+
.then((data) => data)
|
|
245
|
+
.catch((err) => {
|
|
246
|
+
console.log(err);
|
|
247
|
+
throw err;
|
|
248
|
+
});
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const ListAllUsers = async (
|
|
252
|
+
includeDetails = false,
|
|
253
|
+
limit = 100,
|
|
254
|
+
offset = 0
|
|
255
|
+
) => {
|
|
256
|
+
try {
|
|
257
|
+
const response = await domo.get(
|
|
258
|
+
`/domo/users/v1?includeDetails=${includeDetails}&limit=${limit}&offset=${offset}`
|
|
259
|
+
);
|
|
260
|
+
return response;
|
|
261
|
+
} catch (error) {
|
|
262
|
+
console.error("Error listing users:", error);
|
|
263
|
+
throw error;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
const partialupdateDocument = (collectionName, query, operation) => {
|
|
268
|
+
const requestBody = {
|
|
269
|
+
query: query,
|
|
270
|
+
operation: operation,
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
console.log("Request body:", requestBody);
|
|
274
|
+
|
|
275
|
+
return domo
|
|
276
|
+
.put(
|
|
277
|
+
`${BASE_URL}/collections/${collectionName}/documents/update`,
|
|
278
|
+
requestBody
|
|
279
|
+
)
|
|
280
|
+
.then((response) => {
|
|
281
|
+
console.log("Document updated successfully:", response);
|
|
282
|
+
return response;
|
|
283
|
+
})
|
|
284
|
+
.catch((error) => {
|
|
285
|
+
console.error("Error updating document:", error);
|
|
286
|
+
throw error;
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
const DomoApi = {
|
|
291
|
+
GetCurrentUser,
|
|
292
|
+
GetAllUser,
|
|
293
|
+
GetUser,
|
|
294
|
+
CreateDocument,
|
|
295
|
+
ListDocuments,
|
|
296
|
+
DeleteDocument,
|
|
297
|
+
BulkDeleteDocuments,
|
|
298
|
+
GetDocument,
|
|
299
|
+
UpdateDocument,
|
|
300
|
+
QueryDocument,
|
|
301
|
+
queryDocumentsByDate,
|
|
302
|
+
UploadFile,
|
|
303
|
+
UploadRevision,
|
|
304
|
+
// DownloadFile,
|
|
305
|
+
GetFile,
|
|
306
|
+
queryDocumentsWithAggregations,
|
|
307
|
+
ListAllUsers,
|
|
308
|
+
partialupdateDocument,
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export default DomoApi;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* Landing Page Background */
|
|
2
|
+
.landing-page {
|
|
3
|
+
background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* Logo Icon Base Styles */
|
|
7
|
+
.logo-icon {
|
|
8
|
+
height: 4rem;
|
|
9
|
+
width: 4rem;
|
|
10
|
+
padding: 0.5rem;
|
|
11
|
+
will-change: filter, transform;
|
|
12
|
+
transition: filter 300ms, transform 300ms;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Logo Hover Effects with Glow */
|
|
16
|
+
.logo-vite:hover {
|
|
17
|
+
filter: drop-shadow(0 0 2em rgba(189, 52, 254, 0.667));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.logo-react:hover {
|
|
21
|
+
filter: drop-shadow(0 0 2em rgba(97, 218, 251, 0.667));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.logo-domo:hover {
|
|
25
|
+
filter: drop-shadow(0 0 2em rgba(0, 181, 226, 0.667));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.logo-tailwind:hover {
|
|
29
|
+
filter: drop-shadow(0 0 2em rgba(6, 182, 212, 0.667));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.logo-shadcn {
|
|
33
|
+
color: #27272a;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.logo-shadcn:hover {
|
|
37
|
+
filter: drop-shadow(0 0 2em rgba(161, 161, 170, 0.667));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* React Logo Spin Animation */
|
|
41
|
+
@keyframes logo-spin {
|
|
42
|
+
from {
|
|
43
|
+
transform: rotate(0deg);
|
|
44
|
+
}
|
|
45
|
+
to {
|
|
46
|
+
transform: rotate(360deg);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
51
|
+
.logo-react {
|
|
52
|
+
animation: logo-spin infinite 20s linear;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Gradient Text Animation */
|
|
57
|
+
.gradient-text {
|
|
58
|
+
background: linear-gradient(
|
|
59
|
+
135deg,
|
|
60
|
+
#bd34fe 0%,
|
|
61
|
+
#41d1ff 25%,
|
|
62
|
+
#0072bc 50%,
|
|
63
|
+
#06b6d4 75%,
|
|
64
|
+
#a1a1aa 100%
|
|
65
|
+
);
|
|
66
|
+
background-size: 200% auto;
|
|
67
|
+
background-clip: text;
|
|
68
|
+
-webkit-background-clip: text;
|
|
69
|
+
-webkit-text-fill-color: transparent;
|
|
70
|
+
animation: gradient-shift 5s ease infinite;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@keyframes gradient-shift {
|
|
74
|
+
0%,
|
|
75
|
+
100% {
|
|
76
|
+
background-position: 0% 50%;
|
|
77
|
+
}
|
|
78
|
+
50% {
|
|
79
|
+
background-position: 100% 50%;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Responsive Logo Sizes */
|
|
84
|
+
@media (max-width: 768px) {
|
|
85
|
+
.logo-icon {
|
|
86
|
+
height: 3rem;
|
|
87
|
+
width: 3rem;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (max-width: 480px) {
|
|
92
|
+
.logo-icon {
|
|
93
|
+
height: 2.5rem;
|
|
94
|
+
width: 2.5rem;
|
|
95
|
+
}
|
|
96
|
+
}
|