@fusebase/fusebase-gate-sdk 1.0.2-sdk.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 +52 -0
- package/dist/apis/CustomDashboardRowsApi.d.ts +113 -0
- package/dist/apis/CustomDashboardRowsApi.js +122 -0
- package/dist/apis/DashboardDataApi.d.ts +98 -0
- package/dist/apis/DashboardDataApi.js +91 -0
- package/dist/apis/DashboardRelationsApi.d.ts +92 -0
- package/dist/apis/DashboardRelationsApi.js +117 -0
- package/dist/apis/DashboardsApi.d.ts +405 -0
- package/dist/apis/DashboardsApi.js +507 -0
- package/dist/apis/DatabasesApi.d.ts +134 -0
- package/dist/apis/DatabasesApi.js +162 -0
- package/dist/apis/HealthApi.d.ts +19 -0
- package/dist/apis/HealthApi.js +28 -0
- package/dist/apis/OrgUsersApi.d.ts +22 -0
- package/dist/apis/OrgUsersApi.js +29 -0
- package/dist/apis/ResolveApi.d.ts +20 -0
- package/dist/apis/ResolveApi.js +29 -0
- package/dist/apis/TemplatesApi.d.ts +100 -0
- package/dist/apis/TemplatesApi.js +124 -0
- package/dist/apis/TokensApi.d.ts +71 -0
- package/dist/apis/TokensApi.js +95 -0
- package/dist/extras/fetchWithRetry.d.ts +30 -0
- package/dist/extras/fetchWithRetry.js +53 -0
- package/dist/extras/messaging.d.ts +81 -0
- package/dist/extras/messaging.js +16 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +31 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.js +21 -0
- package/dist/runtime/transport.d.ts +28 -0
- package/dist/runtime/transport.js +237 -0
- package/dist/runtime/types.d.ts +52 -0
- package/dist/runtime/types.js +23 -0
- package/dist/types/common/portal-form.d.ts +14 -0
- package/dist/types/common/portal-form.js +8 -0
- package/dist/types/dashboard/custom-item.d.ts +53 -0
- package/dist/types/dashboard/custom-item.js +22 -0
- package/dist/types/dashboard/dashboard.d.ts +421 -0
- package/dist/types/dashboard/dashboard.js +8 -0
- package/dist/types/dashboard/dashboards.d.ts +19 -0
- package/dist/types/dashboard/dashboards.js +8 -0
- package/dist/types/dashboard/data.d.ts +10 -0
- package/dist/types/dashboard/data.js +8 -0
- package/dist/types/dashboard/export.d.ts +11 -0
- package/dist/types/dashboard/export.js +8 -0
- package/dist/types/dashboard/index.d.ts +215 -0
- package/dist/types/dashboard/index.js +34 -0
- package/dist/types/dashboard/intent.d.ts +243 -0
- package/dist/types/dashboard/intent.js +8 -0
- package/dist/types/dashboard/items.d.ts +14 -0
- package/dist/types/dashboard/items.js +8 -0
- package/dist/types/dashboard/metadata.d.ts +12 -0
- package/dist/types/dashboard/metadata.js +8 -0
- package/dist/types/dashboard/render.d.ts +188 -0
- package/dist/types/dashboard/render.js +51 -0
- package/dist/types/dashboard/rows.d.ts +77 -0
- package/dist/types/dashboard/rows.js +14 -0
- package/dist/types/dashboard/schema.d.ts +172 -0
- package/dist/types/dashboard/schema.js +17 -0
- package/dist/types/dashboard/values.d.ts +187 -0
- package/dist/types/dashboard/values.js +8 -0
- package/dist/types/dashboard/view.d.ts +249 -0
- package/dist/types/dashboard/view.js +8 -0
- package/dist/types/database/database.d.ts +203 -0
- package/dist/types/database/database.js +8 -0
- package/dist/types/database/export.d.ts +11 -0
- package/dist/types/database/export.js +8 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/index.js +30 -0
- package/dist/types/org-user/org-user.d.ts +19 -0
- package/dist/types/org-user/org-user.js +6 -0
- package/dist/types/relations/relations.d.ts +138 -0
- package/dist/types/relations/relations.js +14 -0
- package/dist/types/resolve/resolve.d.ts +86 -0
- package/dist/types/resolve/resolve.js +20 -0
- package/dist/types/shared/common.d.ts +122 -0
- package/dist/types/shared/common.js +24 -0
- package/dist/types/shared/enums.d.ts +64 -0
- package/dist/types/shared/enums.js +52 -0
- package/dist/types/shared/health.d.ts +12 -0
- package/dist/types/shared/health.js +8 -0
- package/dist/types/shared/parameters.d.ts +95 -0
- package/dist/types/shared/parameters.js +2 -0
- package/dist/types/template/template.d.ts +74 -0
- package/dist/types/template/template.js +8 -0
- package/dist/types/token/token.d.ts +184 -0
- package/dist/types/token/token.js +8 -0
- package/package.json +16 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Databases API
|
|
4
|
+
*
|
|
5
|
+
* Generated from contract introspection
|
|
6
|
+
* Domain: databases
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DatabasesApi = void 0;
|
|
10
|
+
class DatabasesApi {
|
|
11
|
+
constructor(client) {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Copy database from another database
|
|
16
|
+
* Create a new database by copying an existing database with all its dashboards, relations, and optionally data
|
|
17
|
+
*/
|
|
18
|
+
async copyDatabaseFromDatabase(params) {
|
|
19
|
+
return this.client.request({
|
|
20
|
+
method: "POST",
|
|
21
|
+
path: "/databases/copy-from/database",
|
|
22
|
+
query: params.query,
|
|
23
|
+
headers: params.headers,
|
|
24
|
+
body: params.body,
|
|
25
|
+
opId: "copyDatabaseFromDatabase",
|
|
26
|
+
expectedContentType: "application/json",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create a new database
|
|
31
|
+
* Create a new database with the provided information
|
|
32
|
+
*/
|
|
33
|
+
async createDatabase(params) {
|
|
34
|
+
return this.client.request({
|
|
35
|
+
method: "POST",
|
|
36
|
+
path: "/databases",
|
|
37
|
+
query: params.query,
|
|
38
|
+
headers: params.headers,
|
|
39
|
+
body: params.body,
|
|
40
|
+
opId: "createDatabase",
|
|
41
|
+
expectedContentType: "application/json",
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Delete database
|
|
46
|
+
* Soft delete a database
|
|
47
|
+
*/
|
|
48
|
+
async deleteDatabase(params) {
|
|
49
|
+
return this.client.request({
|
|
50
|
+
method: "DELETE",
|
|
51
|
+
path: "/databases/:id",
|
|
52
|
+
pathParams: params.path,
|
|
53
|
+
headers: params.headers,
|
|
54
|
+
opId: "deleteDatabase",
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Export database data as CSV
|
|
59
|
+
* Export database data as CSV format
|
|
60
|
+
*/
|
|
61
|
+
async exportDatabaseAsCsv(params) {
|
|
62
|
+
return this.client.request({
|
|
63
|
+
method: "GET",
|
|
64
|
+
path: "/databases/:id/export/csv",
|
|
65
|
+
pathParams: params.path,
|
|
66
|
+
headers: params.headers,
|
|
67
|
+
opId: "exportDatabaseAsCsv",
|
|
68
|
+
expectedContentType: "text/csv",
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Export database as JSON
|
|
73
|
+
* Export database structure and optionally data as JSON
|
|
74
|
+
*/
|
|
75
|
+
async exportDatabaseAsJson(params) {
|
|
76
|
+
return this.client.request({
|
|
77
|
+
method: "GET",
|
|
78
|
+
path: "/databases/:id/export/json",
|
|
79
|
+
pathParams: params.path,
|
|
80
|
+
query: params.query,
|
|
81
|
+
headers: params.headers,
|
|
82
|
+
opId: "exportDatabaseAsJson",
|
|
83
|
+
expectedContentType: "application/json",
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get all databases
|
|
88
|
+
* Retrieve a list of all databases
|
|
89
|
+
*/
|
|
90
|
+
async getAllDatabases(params) {
|
|
91
|
+
return this.client.request({
|
|
92
|
+
method: "GET",
|
|
93
|
+
path: "/databases",
|
|
94
|
+
query: params.query,
|
|
95
|
+
headers: params.headers,
|
|
96
|
+
opId: "getAllDatabases",
|
|
97
|
+
expectedContentType: "application/json",
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get database by ID
|
|
102
|
+
* Retrieve a specific database by its global ID
|
|
103
|
+
*/
|
|
104
|
+
async getDatabaseById(params) {
|
|
105
|
+
return this.client.request({
|
|
106
|
+
method: "GET",
|
|
107
|
+
path: "/databases/:id",
|
|
108
|
+
pathParams: params.path,
|
|
109
|
+
headers: params.headers,
|
|
110
|
+
opId: "getDatabaseById",
|
|
111
|
+
expectedContentType: "application/json",
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get or create database
|
|
116
|
+
* Find database by alias and scope, or create new one if not found.
|
|
117
|
+
* If creating from template, searches for template in template_scope first,
|
|
118
|
+
* then org scope from scopes array, then system org (from SYSTEM_ORG_SCOPE_ID env var).
|
|
119
|
+
*
|
|
120
|
+
*/
|
|
121
|
+
async getOrCreateDatabase(params) {
|
|
122
|
+
return this.client.request({
|
|
123
|
+
method: "POST",
|
|
124
|
+
path: "/databases/get-or-create",
|
|
125
|
+
query: params.query,
|
|
126
|
+
headers: params.headers,
|
|
127
|
+
body: params.body,
|
|
128
|
+
opId: "getOrCreateDatabase",
|
|
129
|
+
expectedContentType: "application/json",
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Import database from JSON
|
|
134
|
+
* Import a database from exported JSON structure
|
|
135
|
+
*/
|
|
136
|
+
async importDatabase(params) {
|
|
137
|
+
return this.client.request({
|
|
138
|
+
method: "POST",
|
|
139
|
+
path: "/databases/import",
|
|
140
|
+
headers: params.headers,
|
|
141
|
+
body: params.body,
|
|
142
|
+
opId: "importDatabase",
|
|
143
|
+
expectedContentType: "application/json",
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Update database
|
|
148
|
+
* Update an existing database
|
|
149
|
+
*/
|
|
150
|
+
async updateDatabase(params) {
|
|
151
|
+
return this.client.request({
|
|
152
|
+
method: "PUT",
|
|
153
|
+
path: "/databases/:id",
|
|
154
|
+
pathParams: params.path,
|
|
155
|
+
headers: params.headers,
|
|
156
|
+
body: params.body,
|
|
157
|
+
opId: "updateDatabase",
|
|
158
|
+
expectedContentType: "application/json",
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.DatabasesApi = DatabasesApi;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Health API
|
|
3
|
+
*
|
|
4
|
+
* Generated from contract introspection
|
|
5
|
+
* Domain: health
|
|
6
|
+
*/
|
|
7
|
+
import type { Client } from "../runtime/transport";
|
|
8
|
+
import type { GetHealth200ResponseContract } from "../types";
|
|
9
|
+
export declare class HealthApi {
|
|
10
|
+
private client;
|
|
11
|
+
constructor(client: Client);
|
|
12
|
+
/**
|
|
13
|
+
* Basic health check
|
|
14
|
+
* Returns a simple health status
|
|
15
|
+
*/
|
|
16
|
+
getHealth(params: {
|
|
17
|
+
headers?: Record<string, string>;
|
|
18
|
+
}): Promise<GetHealth200ResponseContract>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Health API
|
|
4
|
+
*
|
|
5
|
+
* Generated from contract introspection
|
|
6
|
+
* Domain: health
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.HealthApi = void 0;
|
|
10
|
+
class HealthApi {
|
|
11
|
+
constructor(client) {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Basic health check
|
|
16
|
+
* Returns a simple health status
|
|
17
|
+
*/
|
|
18
|
+
async getHealth(params) {
|
|
19
|
+
return this.client.request({
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: "/health",
|
|
22
|
+
headers: params.headers,
|
|
23
|
+
opId: "getHealth",
|
|
24
|
+
expectedContentType: "application/json",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.HealthApi = HealthApi;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OrgUsers API
|
|
3
|
+
*
|
|
4
|
+
* Generated from contract introspection
|
|
5
|
+
* Domain: org-users
|
|
6
|
+
*/
|
|
7
|
+
import type { Client } from "../runtime/transport";
|
|
8
|
+
import type { orgIdInPathRequired, OrgUserListResponseContract } from "../types";
|
|
9
|
+
export declare class OrgUsersApi {
|
|
10
|
+
private client;
|
|
11
|
+
constructor(client: Client);
|
|
12
|
+
/**
|
|
13
|
+
* List organization users
|
|
14
|
+
* Returns the list of users (members) of the organization. Requires org.members.read and org access.
|
|
15
|
+
*/
|
|
16
|
+
listOrgUsers(params: {
|
|
17
|
+
path: {
|
|
18
|
+
orgId: orgIdInPathRequired;
|
|
19
|
+
};
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
}): Promise<OrgUserListResponseContract>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* OrgUsers API
|
|
4
|
+
*
|
|
5
|
+
* Generated from contract introspection
|
|
6
|
+
* Domain: org-users
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.OrgUsersApi = void 0;
|
|
10
|
+
class OrgUsersApi {
|
|
11
|
+
constructor(client) {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* List organization users
|
|
16
|
+
* Returns the list of users (members) of the organization. Requires org.members.read and org access.
|
|
17
|
+
*/
|
|
18
|
+
async listOrgUsers(params) {
|
|
19
|
+
return this.client.request({
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: "/:orgId/users",
|
|
22
|
+
pathParams: params.path,
|
|
23
|
+
headers: params.headers,
|
|
24
|
+
opId: "listOrgUsers",
|
|
25
|
+
expectedContentType: "application/json",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.OrgUsersApi = OrgUsersApi;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve API
|
|
3
|
+
*
|
|
4
|
+
* Generated from contract introspection
|
|
5
|
+
* Domain: resolve
|
|
6
|
+
*/
|
|
7
|
+
import type { Client } from "../runtime/transport";
|
|
8
|
+
import type { ResolveAliasesRequestContract, ResolveAliasesResponseContract } from "../types";
|
|
9
|
+
export declare class ResolveApi {
|
|
10
|
+
private client;
|
|
11
|
+
constructor(client: Client);
|
|
12
|
+
/**
|
|
13
|
+
* Resolve aliases
|
|
14
|
+
* Resolve database, dashboard, and view by alias or id within the given organization scope. Returns for each item the resolved id and alias, or resolved: false with error_code. Dashboard requires database; view requires dashboard and database. Request-level cache avoids duplicate DB lookups for repeated parent refs.
|
|
15
|
+
*/
|
|
16
|
+
resolveAliases(params: {
|
|
17
|
+
headers?: Record<string, string>;
|
|
18
|
+
body: ResolveAliasesRequestContract;
|
|
19
|
+
}): Promise<ResolveAliasesResponseContract>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve API
|
|
4
|
+
*
|
|
5
|
+
* Generated from contract introspection
|
|
6
|
+
* Domain: resolve
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ResolveApi = void 0;
|
|
10
|
+
class ResolveApi {
|
|
11
|
+
constructor(client) {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve aliases
|
|
16
|
+
* Resolve database, dashboard, and view by alias or id within the given organization scope. Returns for each item the resolved id and alias, or resolved: false with error_code. Dashboard requires database; view requires dashboard and database. Request-level cache avoids duplicate DB lookups for repeated parent refs.
|
|
17
|
+
*/
|
|
18
|
+
async resolveAliases(params) {
|
|
19
|
+
return this.client.request({
|
|
20
|
+
method: "POST",
|
|
21
|
+
path: "/resolve/aliases",
|
|
22
|
+
headers: params.headers,
|
|
23
|
+
body: params.body,
|
|
24
|
+
opId: "resolveAliases",
|
|
25
|
+
expectedContentType: "application/json",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ResolveApi = ResolveApi;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Templates API
|
|
3
|
+
*
|
|
4
|
+
* Generated from contract introspection
|
|
5
|
+
* Domain: templates
|
|
6
|
+
*/
|
|
7
|
+
import type { Client } from "../runtime/transport";
|
|
8
|
+
import type { AliasContract, aliasInQueryOptional, CreateTemplateRequestContract, DashboardListResponseContract, DatabaseListResponseContract, limitInQueryOptional, nameInQueryOptional, pageInQueryOptional, rootEntityInQueryOptional, StandardApiResponseContract, templateIdInPathRequired, TemplateListResponseContract, TemplateResponseContract, UpdateTemplateRequestContract } from "../types";
|
|
9
|
+
export declare class TemplatesApi {
|
|
10
|
+
private client;
|
|
11
|
+
constructor(client: Client);
|
|
12
|
+
/**
|
|
13
|
+
* Create template
|
|
14
|
+
* Create a new dashboard template
|
|
15
|
+
*/
|
|
16
|
+
createTemplate(params: {
|
|
17
|
+
query?: {
|
|
18
|
+
replace_existing?: boolean;
|
|
19
|
+
};
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
body: CreateTemplateRequestContract;
|
|
22
|
+
}): Promise<TemplateResponseContract>;
|
|
23
|
+
/**
|
|
24
|
+
* Delete template
|
|
25
|
+
* Delete a template (soft delete)
|
|
26
|
+
*/
|
|
27
|
+
deleteTemplate(params: {
|
|
28
|
+
path: {
|
|
29
|
+
template_id: templateIdInPathRequired;
|
|
30
|
+
};
|
|
31
|
+
headers?: Record<string, string>;
|
|
32
|
+
}): Promise<StandardApiResponseContract>;
|
|
33
|
+
/**
|
|
34
|
+
* Get template
|
|
35
|
+
* Get a specific template by ID
|
|
36
|
+
*/
|
|
37
|
+
getTemplate(params: {
|
|
38
|
+
path: {
|
|
39
|
+
template_id: templateIdInPathRequired;
|
|
40
|
+
};
|
|
41
|
+
headers?: Record<string, string>;
|
|
42
|
+
}): Promise<TemplateResponseContract>;
|
|
43
|
+
/**
|
|
44
|
+
* List templates
|
|
45
|
+
* Get a list of dashboard templates with optional filtering
|
|
46
|
+
*/
|
|
47
|
+
getTemplates(params: {
|
|
48
|
+
query?: {
|
|
49
|
+
root_entity?: rootEntityInQueryOptional;
|
|
50
|
+
name?: nameInQueryOptional;
|
|
51
|
+
page?: pageInQueryOptional;
|
|
52
|
+
limit?: limitInQueryOptional;
|
|
53
|
+
};
|
|
54
|
+
headers?: Record<string, string>;
|
|
55
|
+
}): Promise<TemplateListResponseContract>;
|
|
56
|
+
/**
|
|
57
|
+
* Search template dashboards
|
|
58
|
+
* Search for dashboards in the template org scope (TEMPLATE_ORG_SCOPE_ID).
|
|
59
|
+
* Template dashboards are dashboards that are stored in the template org scope
|
|
60
|
+
* and can be used as templates for creating new dashboards.
|
|
61
|
+
*
|
|
62
|
+
* If database_id or database_alias are not provided, only dashboards with database_id = null
|
|
63
|
+
* (standalone template dashboards) are returned.
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
searchTemplateDashboards(params: {
|
|
67
|
+
query?: {
|
|
68
|
+
dashboard_id?: string;
|
|
69
|
+
database_id?: string;
|
|
70
|
+
database_alias?: AliasContract;
|
|
71
|
+
alias?: aliasInQueryOptional;
|
|
72
|
+
};
|
|
73
|
+
headers?: Record<string, string>;
|
|
74
|
+
}): Promise<DashboardListResponseContract>;
|
|
75
|
+
/**
|
|
76
|
+
* Search template databases
|
|
77
|
+
* Search for databases in the template org scope (TEMPLATE_ORG_SCOPE_ID).
|
|
78
|
+
* Template databases are databases that are stored in the template org scope
|
|
79
|
+
* and can be used as templates for creating new databases.
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
searchTemplateDatabases(params: {
|
|
83
|
+
query?: {
|
|
84
|
+
database_id?: string;
|
|
85
|
+
alias?: aliasInQueryOptional;
|
|
86
|
+
};
|
|
87
|
+
headers?: Record<string, string>;
|
|
88
|
+
}): Promise<DatabaseListResponseContract>;
|
|
89
|
+
/**
|
|
90
|
+
* Update template
|
|
91
|
+
* Update an existing template
|
|
92
|
+
*/
|
|
93
|
+
updateTemplate(params: {
|
|
94
|
+
path: {
|
|
95
|
+
template_id: templateIdInPathRequired;
|
|
96
|
+
};
|
|
97
|
+
headers?: Record<string, string>;
|
|
98
|
+
body: UpdateTemplateRequestContract;
|
|
99
|
+
}): Promise<TemplateResponseContract>;
|
|
100
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Templates API
|
|
4
|
+
*
|
|
5
|
+
* Generated from contract introspection
|
|
6
|
+
* Domain: templates
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.TemplatesApi = void 0;
|
|
10
|
+
class TemplatesApi {
|
|
11
|
+
constructor(client) {
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create template
|
|
16
|
+
* Create a new dashboard template
|
|
17
|
+
*/
|
|
18
|
+
async createTemplate(params) {
|
|
19
|
+
return this.client.request({
|
|
20
|
+
method: "POST",
|
|
21
|
+
path: "/templates",
|
|
22
|
+
query: params.query,
|
|
23
|
+
headers: params.headers,
|
|
24
|
+
body: params.body,
|
|
25
|
+
opId: "createTemplate",
|
|
26
|
+
expectedContentType: "application/json",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Delete template
|
|
31
|
+
* Delete a template (soft delete)
|
|
32
|
+
*/
|
|
33
|
+
async deleteTemplate(params) {
|
|
34
|
+
return this.client.request({
|
|
35
|
+
method: "DELETE",
|
|
36
|
+
path: "/templates/:template_id",
|
|
37
|
+
pathParams: params.path,
|
|
38
|
+
headers: params.headers,
|
|
39
|
+
opId: "deleteTemplate",
|
|
40
|
+
expectedContentType: "application/json",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get template
|
|
45
|
+
* Get a specific template by ID
|
|
46
|
+
*/
|
|
47
|
+
async getTemplate(params) {
|
|
48
|
+
return this.client.request({
|
|
49
|
+
method: "GET",
|
|
50
|
+
path: "/templates/:template_id",
|
|
51
|
+
pathParams: params.path,
|
|
52
|
+
headers: params.headers,
|
|
53
|
+
opId: "getTemplate",
|
|
54
|
+
expectedContentType: "application/json",
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* List templates
|
|
59
|
+
* Get a list of dashboard templates with optional filtering
|
|
60
|
+
*/
|
|
61
|
+
async getTemplates(params) {
|
|
62
|
+
return this.client.request({
|
|
63
|
+
method: "GET",
|
|
64
|
+
path: "/templates",
|
|
65
|
+
query: params.query,
|
|
66
|
+
headers: params.headers,
|
|
67
|
+
opId: "getTemplates",
|
|
68
|
+
expectedContentType: "application/json",
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Search template dashboards
|
|
73
|
+
* Search for dashboards in the template org scope (TEMPLATE_ORG_SCOPE_ID).
|
|
74
|
+
* Template dashboards are dashboards that are stored in the template org scope
|
|
75
|
+
* and can be used as templates for creating new dashboards.
|
|
76
|
+
*
|
|
77
|
+
* If database_id or database_alias are not provided, only dashboards with database_id = null
|
|
78
|
+
* (standalone template dashboards) are returned.
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
async searchTemplateDashboards(params) {
|
|
82
|
+
return this.client.request({
|
|
83
|
+
method: "GET",
|
|
84
|
+
path: "/templates/dashboards",
|
|
85
|
+
query: params.query,
|
|
86
|
+
headers: params.headers,
|
|
87
|
+
opId: "searchTemplateDashboards",
|
|
88
|
+
expectedContentType: "application/json",
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Search template databases
|
|
93
|
+
* Search for databases in the template org scope (TEMPLATE_ORG_SCOPE_ID).
|
|
94
|
+
* Template databases are databases that are stored in the template org scope
|
|
95
|
+
* and can be used as templates for creating new databases.
|
|
96
|
+
*
|
|
97
|
+
*/
|
|
98
|
+
async searchTemplateDatabases(params) {
|
|
99
|
+
return this.client.request({
|
|
100
|
+
method: "GET",
|
|
101
|
+
path: "/templates/databases",
|
|
102
|
+
query: params.query,
|
|
103
|
+
headers: params.headers,
|
|
104
|
+
opId: "searchTemplateDatabases",
|
|
105
|
+
expectedContentType: "application/json",
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Update template
|
|
110
|
+
* Update an existing template
|
|
111
|
+
*/
|
|
112
|
+
async updateTemplate(params) {
|
|
113
|
+
return this.client.request({
|
|
114
|
+
method: "PUT",
|
|
115
|
+
path: "/templates/:template_id",
|
|
116
|
+
pathParams: params.path,
|
|
117
|
+
headers: params.headers,
|
|
118
|
+
body: params.body,
|
|
119
|
+
opId: "updateTemplate",
|
|
120
|
+
expectedContentType: "application/json",
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.TemplatesApi = TemplatesApi;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokens API
|
|
3
|
+
*
|
|
4
|
+
* Generated from contract introspection
|
|
5
|
+
* Domain: tokens
|
|
6
|
+
*/
|
|
7
|
+
import type { Client } from "../runtime/transport";
|
|
8
|
+
import type { CreateTokenRequestContract, CreateTokenResponseContract, RevokeTokenResponseContract, scopeIdInQueryRequired, scopeTypeOrgInQueryRequired, TokenListResponseContract, TokenResponseContract, UpdateTokenRequestContract } from "../types";
|
|
9
|
+
export declare class TokensApi {
|
|
10
|
+
private client;
|
|
11
|
+
constructor(client: Client);
|
|
12
|
+
/**
|
|
13
|
+
* Create a new API token
|
|
14
|
+
* Create a new API token with specified scopes and permissions.
|
|
15
|
+
* The token value is only returned once on creation - store it securely.
|
|
16
|
+
* At least one org scope is required in the scopes array.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
createToken(params: {
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
body: CreateTokenRequestContract;
|
|
22
|
+
}): Promise<CreateTokenResponseContract>;
|
|
23
|
+
/**
|
|
24
|
+
* Get token by ID
|
|
25
|
+
* Retrieve details of a specific API token by its global ID
|
|
26
|
+
*/
|
|
27
|
+
getToken(params: {
|
|
28
|
+
path: {
|
|
29
|
+
tokenId: string;
|
|
30
|
+
};
|
|
31
|
+
headers?: Record<string, string>;
|
|
32
|
+
}): Promise<TokenResponseContract>;
|
|
33
|
+
/**
|
|
34
|
+
* List user's API tokens
|
|
35
|
+
* Retrieve a list of all API tokens for the authenticated user.
|
|
36
|
+
* Optionally filter by scope type and scope ID (both must be provided together).
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
listTokens(params: {
|
|
40
|
+
query?: {
|
|
41
|
+
scope_type: scopeTypeOrgInQueryRequired;
|
|
42
|
+
scope_id: scopeIdInQueryRequired;
|
|
43
|
+
};
|
|
44
|
+
headers?: Record<string, string>;
|
|
45
|
+
}): Promise<TokenListResponseContract>;
|
|
46
|
+
/**
|
|
47
|
+
* Revoke token
|
|
48
|
+
* Permanently revoke (soft delete) an API token.
|
|
49
|
+
* Once revoked, the token can no longer be used for authentication.
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
revokeToken(params: {
|
|
53
|
+
path: {
|
|
54
|
+
tokenId: string;
|
|
55
|
+
};
|
|
56
|
+
headers?: Record<string, string>;
|
|
57
|
+
}): Promise<RevokeTokenResponseContract>;
|
|
58
|
+
/**
|
|
59
|
+
* Update token
|
|
60
|
+
* Update token properties (name, permissions, expiration).
|
|
61
|
+
* Note: The token value itself cannot be changed.
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
64
|
+
updateToken(params: {
|
|
65
|
+
path: {
|
|
66
|
+
tokenId: string;
|
|
67
|
+
};
|
|
68
|
+
headers?: Record<string, string>;
|
|
69
|
+
body: UpdateTokenRequestContract;
|
|
70
|
+
}): Promise<TokenResponseContract>;
|
|
71
|
+
}
|