@budibase/types 3.2.23 → 3.2.25

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.
Files changed (38) hide show
  1. package/dist/api/web/{application.d.ts → app/application.d.ts} +2 -2
  2. package/dist/api/web/app/automation.d.ts +49 -1
  3. package/dist/api/web/{deployment.d.ts → app/deployment.d.ts} +1 -1
  4. package/dist/api/web/app/index.d.ts +10 -1
  5. package/dist/api/web/app/integration.d.ts +3 -0
  6. package/dist/api/web/{layout.d.ts → app/layout.d.ts} +4 -1
  7. package/dist/api/web/app/metadata.d.ts +13 -0
  8. package/dist/api/web/app/permission.d.ts +3 -1
  9. package/dist/api/web/app/query.d.ts +44 -0
  10. package/dist/api/web/{role.d.ts → app/role.d.ts} +3 -3
  11. package/dist/api/web/app/rows/index.d.ts +23 -1
  12. package/dist/api/web/app/screen.d.ts +14 -0
  13. package/dist/api/web/app/static.d.ts +20 -0
  14. package/dist/api/web/app/table.d.ts +7 -4
  15. package/dist/api/web/app/user.d.ts +19 -2
  16. package/dist/api/web/app/view.d.ts +4 -0
  17. package/dist/api/web/app/webhook.d.ts +20 -0
  18. package/dist/api/web/global/index.d.ts +1 -0
  19. package/dist/api/web/global/oldMigration.d.ts +7 -0
  20. package/dist/api/web/index.d.ts +1 -6
  21. package/dist/api/web/plugins.d.ts +11 -1
  22. package/dist/api/web/system/index.d.ts +1 -0
  23. package/dist/api/web/system/ops.d.ts +7 -0
  24. package/dist/api/web/template.d.ts +18 -0
  25. package/dist/documents/app/index.d.ts +1 -0
  26. package/dist/documents/app/metadata.d.ts +4 -0
  27. package/dist/documents/app/screen.d.ts +9 -0
  28. package/dist/documents/global/plugin.d.ts +3 -3
  29. package/dist/index.js +17 -0
  30. package/dist/index.js.map +4 -4
  31. package/dist/index.js.meta.json +1 -1
  32. package/dist/sdk/auth.d.ts +2 -2
  33. package/dist/sdk/permissions.d.ts +16 -0
  34. package/dist/tsconfig.tsbuildinfo +1 -1
  35. package/package.json +3 -3
  36. package/dist/api/web/app/row.d.ts +0 -14
  37. package/dist/api/web/automation.d.ts +0 -49
  38. package/dist/api/web/query.d.ts +0 -23
@@ -1,5 +1,5 @@
1
- import type { PlanType } from "../../sdk";
2
- import type { Layout, App, Screen } from "../../documents";
1
+ import type { PlanType } from "../../../sdk";
2
+ import type { Layout, App, Screen } from "../../../documents";
3
3
  import { ReadStream } from "fs";
4
4
  export interface SyncAppResponse {
5
5
  message: string;
@@ -1,7 +1,55 @@
1
- import { AutomationActionStepId, AutomationStepDefinition, AutomationTriggerDefinition, AutomationTriggerStepId } from "../../../documents";
1
+ import { Automation, AutomationActionStepId, AutomationLogPage, AutomationStatus, AutomationStepDefinition, AutomationTriggerDefinition, AutomationTriggerStepId, Row } from "../../../documents";
2
+ import { DocumentDestroyResponse } from "@budibase/nano";
2
3
  export type GetAutomationTriggerDefinitionsResponse = Record<keyof typeof AutomationTriggerStepId, AutomationTriggerDefinition>;
3
4
  export type GetAutomationActionDefinitionsResponse = Record<keyof typeof AutomationActionStepId, AutomationStepDefinition>;
4
5
  export interface GetAutomationStepDefinitionsResponse {
5
6
  trigger: GetAutomationTriggerDefinitionsResponse;
6
7
  action: GetAutomationActionDefinitionsResponse;
7
8
  }
9
+ export interface DeleteAutomationResponse extends DocumentDestroyResponse {
10
+ }
11
+ export interface FetchAutomationResponse {
12
+ automations: Automation[];
13
+ }
14
+ export interface FindAutomationResponse extends Automation {
15
+ }
16
+ export interface UpdateAutomationRequest extends Automation {
17
+ }
18
+ export interface UpdateAutomationResponse {
19
+ message: string;
20
+ automation: Automation;
21
+ }
22
+ export interface CreateAutomationRequest extends Automation {
23
+ }
24
+ export interface CreateAutomationResponse {
25
+ message: string;
26
+ automation: Automation;
27
+ }
28
+ export interface SearchAutomationLogsRequest {
29
+ startDate?: string;
30
+ status?: AutomationStatus;
31
+ automationId?: string;
32
+ page?: string;
33
+ }
34
+ export interface SearchAutomationLogsResponse extends AutomationLogPage {
35
+ }
36
+ export interface ClearAutomationLogRequest {
37
+ automationId: string;
38
+ appId: string;
39
+ }
40
+ export interface ClearAutomationLogResponse {
41
+ message: string;
42
+ }
43
+ export interface TriggerAutomationRequest {
44
+ fields: Record<string, any>;
45
+ timeout: number;
46
+ }
47
+ export type TriggerAutomationResponse = Record<string, any> | undefined;
48
+ export interface TestAutomationRequest {
49
+ id?: string;
50
+ revision?: string;
51
+ fields: Record<string, any>;
52
+ row?: Row;
53
+ }
54
+ export interface TestAutomationResponse {
55
+ }
@@ -1,4 +1,4 @@
1
- import { DeploymentDoc, DeploymentStatus } from "../../documents";
1
+ import { DeploymentDoc, DeploymentStatus } from "../../../documents";
2
2
  export interface PublishAppResponse extends DeploymentDoc {
3
3
  }
4
4
  export interface DeploymentProgressResponse {
@@ -1,6 +1,5 @@
1
1
  export * from "./backup";
2
2
  export * from "./datasource";
3
- export * from "./row";
4
3
  export * from "./view";
5
4
  export * from "./rows";
6
5
  export * from "./table";
@@ -10,3 +9,13 @@ export * from "./user";
10
9
  export * from "./rowAction";
11
10
  export * from "./automation";
12
11
  export * from "./component";
12
+ export * from "./integration";
13
+ export * from "./metadata";
14
+ export * from "./query";
15
+ export * from "./screen";
16
+ export * from "./application";
17
+ export * from "./layout";
18
+ export * from "./deployment";
19
+ export * from "./role";
20
+ export * from "./webhook";
21
+ export * from "./static";
@@ -0,0 +1,3 @@
1
+ import { Integration, SourceName } from "../../../sdk";
2
+ export type FetchIntegrationsResponse = Record<SourceName, Integration | undefined>;
3
+ export type FindIntegrationResponse = Integration;
@@ -1,5 +1,8 @@
1
- import { Layout } from "../../documents";
1
+ import { Layout } from "../../../documents";
2
2
  export interface SaveLayoutRequest extends Layout {
3
3
  }
4
4
  export interface SaveLayoutResponse extends Layout {
5
5
  }
6
+ export interface DeleteLayoutResponse {
7
+ message: string;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { MetadataType, Document } from "../../../documents";
2
+ export interface GetMetadataTypesResponse {
3
+ types: typeof MetadataType;
4
+ }
5
+ export interface SaveMetadataRequest extends Document {
6
+ }
7
+ export interface SaveMetadataResponse extends Document {
8
+ }
9
+ export interface DeleteMetadataResponse {
10
+ message: string;
11
+ }
12
+ export interface FindMetadataResponse extends Document {
13
+ }
@@ -1,4 +1,6 @@
1
- import { PermissionLevel } from "../../../sdk";
1
+ import { BuiltinPermission, PermissionLevel } from "../../../sdk";
2
+ export type FetchBuiltinPermissionsRequest = BuiltinPermission[];
3
+ export type FetchPermissionLevelsRequest = string[];
2
4
  export interface FetchResourcePermissionInfoResponse {
3
5
  [key: string]: Record<string, string>;
4
6
  }
@@ -0,0 +1,44 @@
1
+ import { Datasource, Query, QueryPreview, QuerySchema } from "../../../documents";
2
+ export type FetchQueriesResponse = Query[];
3
+ export interface SaveQueryRequest extends Query {
4
+ }
5
+ export interface SaveQueryResponse extends Query {
6
+ }
7
+ export interface ImportRestQueryRequest {
8
+ datasourceId: string;
9
+ data: string;
10
+ datasource: Datasource;
11
+ }
12
+ export interface ImportRestQueryResponse {
13
+ errorQueries: Query[];
14
+ queries: Query[];
15
+ datasourceId: string;
16
+ }
17
+ export interface FindQueryResponse extends Query {
18
+ }
19
+ export interface PreviewQueryRequest extends QueryPreview {
20
+ }
21
+ export interface PreviewQueryResponse {
22
+ rows: any[];
23
+ nestedSchemaFields: {
24
+ [key: string]: {
25
+ [key: string]: string | QuerySchema;
26
+ };
27
+ };
28
+ schema: {
29
+ [key: string]: string | QuerySchema;
30
+ };
31
+ info: any;
32
+ extra: any;
33
+ }
34
+ export interface ExecuteQueryRequest {
35
+ parameters?: Record<string, string>;
36
+ pagination?: any;
37
+ }
38
+ export type ExecuteV1QueryResponse = Record<string, any>[];
39
+ export interface ExecuteV2QueryResponse {
40
+ data: Record<string, any>[];
41
+ }
42
+ export interface DeleteQueryResponse {
43
+ message: string;
44
+ }
@@ -1,5 +1,5 @@
1
- import { Role, RoleUIMetadata } from "../../documents";
2
- import { PermissionLevel, BuiltinPermissionID } from "../../sdk";
1
+ import { Role, RoleUIMetadata } from "../../../documents";
2
+ import { PermissionLevel, BuiltinPermissionID } from "../../../sdk";
3
3
  export interface SaveRoleRequest {
4
4
  _id?: string;
5
5
  _rev?: string;
@@ -15,7 +15,7 @@ export interface SaveRoleResponse extends Role {
15
15
  export interface FindRoleResponse extends Role {
16
16
  }
17
17
  export type FetchRolesResponse = Role[];
18
- export interface DestroyRoleResponse {
18
+ export interface DeleteRoleResponse {
19
19
  message: string;
20
20
  }
21
21
  export type AccessibleRolesResponse = string[];
@@ -1,10 +1,16 @@
1
1
  import { SearchFilters } from "../../../../sdk";
2
2
  import { Row } from "../../../../documents";
3
- import { SortOrder } from "../../../../api/web/pagination";
3
+ import { SortOrder } from "../../pagination";
4
4
  import { ReadStream } from "fs";
5
+ import stream from "node:stream";
5
6
  export * from "./search";
7
+ export interface FetchEnrichedRowResponse extends Row {
8
+ }
9
+ export type FetchRowsResponse = Row[];
6
10
  export interface SaveRowRequest extends Row {
7
11
  }
12
+ export interface SaveRowResponse extends Row {
13
+ }
8
14
  export interface PatchRowRequest extends Row {
9
15
  _id: string;
10
16
  _rev: string;
@@ -24,3 +30,19 @@ export interface ExportRowsRequest {
24
30
  };
25
31
  }
26
32
  export type ExportRowsResponse = ReadStream;
33
+ export type DownloadAttachmentResponse = stream.PassThrough | stream.Readable;
34
+ export interface FindRowResponse extends Row {
35
+ }
36
+ export interface DeleteRows {
37
+ rows: (Row | string)[];
38
+ }
39
+ export interface DeleteRow {
40
+ _id: string;
41
+ }
42
+ export type DeleteRowRequest = DeleteRows | DeleteRow;
43
+ export interface ValidateRowRequest extends Row {
44
+ }
45
+ export interface ValidateRowResponse {
46
+ valid: boolean;
47
+ errors: Record<string, any>;
48
+ }
@@ -0,0 +1,14 @@
1
+ import { ScreenRoutingJson, Screen } from "../../../documents";
2
+ export interface FetchScreenRoutingResponse {
3
+ routes: ScreenRoutingJson;
4
+ }
5
+ export interface FetchClientScreenRoutingResponse extends FetchScreenRoutingResponse {
6
+ }
7
+ export type FetchScreenResponse = Screen[];
8
+ export interface SaveScreenRequest extends Screen {
9
+ }
10
+ export interface SaveScreenResponse extends Screen {
11
+ }
12
+ export interface DeleteScreenResponse {
13
+ message: string;
14
+ }
@@ -0,0 +1,20 @@
1
+ import { App } from "../../../documents";
2
+ import stream from "node:stream";
3
+ export interface ToggleBetaFeatureResponse {
4
+ message: string;
5
+ }
6
+ export type ServeAppResponse = string;
7
+ interface BuilderPreview extends App {
8
+ builderPreview: boolean;
9
+ }
10
+ export type ServeBuilderPreviewResponse = BuilderPreview | string;
11
+ export type ServeClientLibraryResponse = stream.Readable;
12
+ export interface GetSignedUploadUrlRequest {
13
+ bucket: string;
14
+ key: string;
15
+ }
16
+ export interface GetSignedUploadUrlResponse {
17
+ signedUrl?: string;
18
+ publicUrl?: string;
19
+ }
20
+ export {};
@@ -3,10 +3,10 @@ import { ViewV2Enriched } from "../../../sdk";
3
3
  export type TableViewsResponse = {
4
4
  [key: string]: View | ViewV2Enriched;
5
5
  };
6
- export interface TableResponse extends Table {
6
+ export interface FindTableResponse extends Table {
7
7
  views?: TableViewsResponse;
8
8
  }
9
- export type FetchTablesResponse = TableResponse[];
9
+ export type FetchTablesResponse = FindTableResponse[];
10
10
  export interface SaveTableRequest extends TableRequest {
11
11
  rows?: Row[];
12
12
  }
@@ -18,11 +18,11 @@ export interface BulkImportRequest {
18
18
  export interface BulkImportResponse {
19
19
  message: string;
20
20
  }
21
- export interface MigrateRequest {
21
+ export interface MigrateTableRequest {
22
22
  oldColumn: string;
23
23
  newColumn: string;
24
24
  }
25
- export interface MigrateResponse {
25
+ export interface MigrateTableResponse {
26
26
  message: string;
27
27
  }
28
28
  export interface ValidateNewTableImportRequest {
@@ -45,3 +45,6 @@ export interface CsvToJsonRequest {
45
45
  csvString: string;
46
46
  }
47
47
  export type CsvToJsonResponse = any[];
48
+ export interface DeleteTableResponse {
49
+ message: string;
50
+ }
@@ -1,8 +1,25 @@
1
- import { ContextUserMetadata } from "../../../";
1
+ import { ContextUserMetadata, Flags, UserMetadata } from "../../../";
2
+ import { DocumentInsertResponse } from "@budibase/nano";
2
3
  export type FetchUserMetadataResponse = ContextUserMetadata[];
3
4
  export type FindUserMetadataResponse = ContextUserMetadata;
4
- export interface SetFlagRequest {
5
+ export interface SetUserFlagRequest {
5
6
  flag: string;
6
7
  value: any;
7
8
  }
9
+ export interface SetUserFlagResponse {
10
+ message: string;
11
+ }
12
+ export interface GetUserFlagsResponse extends Flags {
13
+ }
8
14
  export type AppSelfResponse = ContextUserMetadata | {};
15
+ export interface UpdateSelfMetadataRequest extends UserMetadata {
16
+ }
17
+ export interface UpdateSelfMetadataResponse extends DocumentInsertResponse {
18
+ }
19
+ export interface UpdateUserMetadataRequest extends UserMetadata {
20
+ }
21
+ export interface UpdateUserMetadataResponse extends DocumentInsertResponse {
22
+ }
23
+ export interface DeleteUserMetadataResponse {
24
+ message: string;
25
+ }
@@ -11,5 +11,9 @@ export interface ViewFetchResponseEnriched {
11
11
  }
12
12
  export interface CreateViewRequest extends Omit<ViewV2, "version" | "id"> {
13
13
  }
14
+ export interface CreateViewResponse extends ViewResponse {
15
+ }
14
16
  export interface UpdateViewRequest extends ViewV2 {
15
17
  }
18
+ export interface UpdateViewResponse extends ViewResponse {
19
+ }
@@ -0,0 +1,20 @@
1
+ import { Webhook } from "../../../documents";
2
+ import { DocumentDestroyResponse, DocumentInsertResponse } from "@budibase/nano";
3
+ export type FetchWebhooksResponse = Webhook[];
4
+ export interface SaveWebhookRequest extends Webhook {
5
+ }
6
+ export interface SaveWebhookResponse {
7
+ message: string;
8
+ webhook: Webhook;
9
+ }
10
+ export interface DeleteWebhookResponse extends DocumentDestroyResponse {
11
+ }
12
+ export interface BuildWebhookSchemaRequest extends Record<string, any> {
13
+ }
14
+ export interface BuildWebhookSchemaResponse extends DocumentInsertResponse {
15
+ }
16
+ export interface TriggerWebhookRequest {
17
+ }
18
+ export type TriggerWebhookResponse = Record<string, any> | {
19
+ message: string;
20
+ } | undefined;
@@ -4,3 +4,4 @@ export * from "./events";
4
4
  export * from "./configs";
5
5
  export * from "./scim";
6
6
  export * from "./license";
7
+ export * from "./oldMigration";
@@ -0,0 +1,7 @@
1
+ import { Migration, MigrationOptions } from "../../../sdk";
2
+ export interface RunOldMigrationRequest extends MigrationOptions {
3
+ }
4
+ export type FetchOldMigrationResponse = Migration[];
5
+ export interface GetOldMigrationStatus {
6
+ migrated: boolean;
7
+ }
@@ -1,4 +1,3 @@
1
- export * from "./application";
2
1
  export * from "./analytics";
3
2
  export * from "./auth";
4
3
  export * from "./user";
@@ -11,11 +10,7 @@ export * from "./global";
11
10
  export * from "./pagination";
12
11
  export * from "./searchFilter";
13
12
  export * from "./cookies";
14
- export * from "./automation";
15
- export * from "./layout";
16
- export * from "./query";
17
- export * from "./role";
18
13
  export * from "./plugins";
19
14
  export * from "./apikeys";
20
- export * from "./deployment";
21
15
  export * from "./dev";
16
+ export * from "./template";
@@ -1,4 +1,10 @@
1
- import { PluginSource } from "../../documents";
1
+ import { PluginSource, Plugin } from "../../documents";
2
+ export interface UploadPluginRequest {
3
+ }
4
+ export interface UploadPluginResponse {
5
+ message: string;
6
+ plugins: Plugin[];
7
+ }
2
8
  export interface CreatePluginRequest {
3
9
  source: PluginSource;
4
10
  url: string;
@@ -10,3 +16,7 @@ export interface CreatePluginRequest {
10
16
  export interface CreatePluginResponse {
11
17
  plugin: any;
12
18
  }
19
+ export type FetchPluginResponse = Plugin[];
20
+ export interface DeletePluginResponse {
21
+ message: string;
22
+ }
@@ -1,2 +1,3 @@
1
1
  export * from "./environment";
2
2
  export * from "./status";
3
+ export * from "./ops";
@@ -0,0 +1,7 @@
1
+ export interface LogOpsRequest {
2
+ message: string;
3
+ data?: any;
4
+ }
5
+ export interface ErrorOpsRequest {
6
+ message: string;
7
+ }
@@ -0,0 +1,18 @@
1
+ export declare enum TemplateType {
2
+ APP = "app"
3
+ }
4
+ export interface TemplateMetadata {
5
+ background: string;
6
+ icon: string;
7
+ category: string;
8
+ description: string;
9
+ name: string;
10
+ url: string;
11
+ type: TemplateType;
12
+ key: string;
13
+ image: string;
14
+ }
15
+ export type FetchTemplateResponse = TemplateMetadata[];
16
+ export interface DownloadTemplateResponse {
17
+ message: string;
18
+ }
@@ -19,3 +19,4 @@ export * from "./snippet";
19
19
  export * from "./rowAction";
20
20
  export * from "./theme";
21
21
  export * from "./deployment";
22
+ export * from "./metadata";
@@ -0,0 +1,4 @@
1
+ export declare enum MetadataType {
2
+ AUTOMATION_TEST_INPUT = "automationTestInput",
3
+ AUTOMATION_TEST_HISTORY = "automationTestHistory"
4
+ }
@@ -21,3 +21,12 @@ export interface Screen extends Document {
21
21
  name?: string;
22
22
  pluginAdded?: boolean;
23
23
  }
24
+ export interface ScreenRoutesViewOutput extends Document {
25
+ id: string;
26
+ routing: ScreenRouting;
27
+ }
28
+ export type ScreenRoutingJson = Record<string, {
29
+ subpaths: Record<string, {
30
+ screens: Record<string, string>;
31
+ }>;
32
+ }>;
@@ -10,9 +10,9 @@ export declare enum PluginSource {
10
10
  URL = "URL",
11
11
  FILE = "File Upload"
12
12
  }
13
- export interface FileType {
14
- path: string;
15
- name: string;
13
+ export interface KoaFile {
14
+ path: string | null;
15
+ name: string | null;
16
16
  }
17
17
  export interface Plugin extends Document {
18
18
  description: string;
package/dist/index.js CHANGED
@@ -92,6 +92,7 @@ __export(src_exports, {
92
92
  LoginMethod: () => LoginMethod,
93
93
  LoopStepType: () => LoopStepType,
94
94
  MaintenanceType: () => MaintenanceType,
95
+ MetadataType: () => MetadataType,
95
96
  MigrationName: () => MigrationName,
96
97
  MigrationType: () => MigrationType,
97
98
  Model: () => Model,
@@ -132,6 +133,7 @@ __export(src_exports, {
132
133
  SqlClient: () => SqlClient,
133
134
  StaticQuotaName: () => StaticQuotaName,
134
135
  TableSourceType: () => TableSourceType,
136
+ TemplateType: () => TemplateType,
135
137
  TenantResolutionStrategy: () => TenantResolutionStrategy,
136
138
  Theme: () => Theme,
137
139
  UILogicalOperator: () => UILogicalOperator,
@@ -1366,6 +1368,13 @@ var DeploymentStatus = /* @__PURE__ */ ((DeploymentStatus2) => {
1366
1368
  return DeploymentStatus2;
1367
1369
  })(DeploymentStatus || {});
1368
1370
 
1371
+ // src/documents/app/metadata.ts
1372
+ var MetadataType = /* @__PURE__ */ ((MetadataType2) => {
1373
+ MetadataType2["AUTOMATION_TEST_INPUT"] = "automationTestInput";
1374
+ MetadataType2["AUTOMATION_TEST_HISTORY"] = "automationTestHistory";
1375
+ return MetadataType2;
1376
+ })(MetadataType || {});
1377
+
1369
1378
  // src/documents/global/config.ts
1370
1379
  var isSettingsConfig = (config) => config.type === "settings" /* SETTINGS */;
1371
1380
  var isSMTPConfig = (config) => config.type === "smtp" /* SMTP */;
@@ -1540,6 +1549,12 @@ var EventPublishType = /* @__PURE__ */ ((EventPublishType2) => {
1540
1549
  return EventPublishType2;
1541
1550
  })(EventPublishType || {});
1542
1551
 
1552
+ // src/api/web/template.ts
1553
+ var TemplateType = /* @__PURE__ */ ((TemplateType2) => {
1554
+ TemplateType2["APP"] = "app";
1555
+ return TemplateType2;
1556
+ })(TemplateType || {});
1557
+
1543
1558
  // src/core/installation.ts
1544
1559
  var ServiceType = /* @__PURE__ */ ((ServiceType2) => {
1545
1560
  ServiceType2["WORKER"] = "worker";
@@ -1635,6 +1650,7 @@ var EventType = /* @__PURE__ */ ((EventType2) => {
1635
1650
  LoginMethod,
1636
1651
  LoopStepType,
1637
1652
  MaintenanceType,
1653
+ MetadataType,
1638
1654
  MigrationName,
1639
1655
  MigrationType,
1640
1656
  Model,
@@ -1675,6 +1691,7 @@ var EventType = /* @__PURE__ */ ((EventType2) => {
1675
1691
  SqlClient,
1676
1692
  StaticQuotaName,
1677
1693
  TableSourceType,
1694
+ TemplateType,
1678
1695
  TenantResolutionStrategy,
1679
1696
  Theme,
1680
1697
  UILogicalOperator,