@budibase/types 2.10.15 → 2.10.16-alpha.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.
Files changed (39) hide show
  1. package/dist/api/account/accounts.d.ts +1 -1
  2. package/dist/api/web/app/row.d.ts +7 -1
  3. package/dist/api/web/app/rows.d.ts +9 -1
  4. package/dist/api/web/app/table.d.ts +3 -3
  5. package/dist/api/web/global/auditLogs.d.ts +1 -1
  6. package/dist/api/web/global/configs.d.ts +1 -1
  7. package/dist/api/web/global/scim/users.d.ts +2 -2
  8. package/dist/api/web/searchFilter.d.ts +3 -3
  9. package/dist/api/web/user.d.ts +1 -1
  10. package/dist/documents/account/account.d.ts +1 -1
  11. package/dist/documents/app/app.d.ts +1 -1
  12. package/dist/documents/app/automation.d.ts +1 -1
  13. package/dist/documents/app/backup.d.ts +1 -1
  14. package/dist/documents/app/row.d.ts +10 -1
  15. package/dist/documents/app/view.d.ts +1 -1
  16. package/dist/documents/document.d.ts +1 -0
  17. package/dist/documents/global/auditLogs.d.ts +1 -1
  18. package/dist/documents/global/config.d.ts +2 -2
  19. package/dist/documents/global/environmentVariables.d.ts +2 -2
  20. package/dist/documents/global/quotas.d.ts +3 -3
  21. package/dist/documents/global/schedule.d.ts +1 -1
  22. package/dist/documents/global/user.d.ts +1 -1
  23. package/dist/documents/platform/users.d.ts +1 -1
  24. package/dist/documents/pouch.d.ts +1 -1
  25. package/dist/index.js +32 -1
  26. package/dist/index.js.map +3 -3
  27. package/dist/index.js.meta.json +1 -1
  28. package/dist/sdk/auditLogs.d.ts +3 -3
  29. package/dist/sdk/automations/index.d.ts +1 -1
  30. package/dist/sdk/context.d.ts +1 -1
  31. package/dist/sdk/datasources.d.ts +2 -2
  32. package/dist/sdk/db.d.ts +7 -7
  33. package/dist/sdk/events/auth.d.ts +2 -2
  34. package/dist/sdk/events/event.d.ts +2 -2
  35. package/dist/sdk/licensing/feature.d.ts +2 -2
  36. package/dist/sdk/licensing/quota.d.ts +7 -7
  37. package/dist/sdk/sso.d.ts +1 -1
  38. package/dist/shared/typeUtils.d.ts +3 -3
  39. package/package.json +3 -6
@@ -16,4 +16,4 @@ export interface SearchAccountsRequest {
16
16
  email?: string;
17
17
  tenantId?: string;
18
18
  }
19
- export declare type SearchAccountsResponse = Account[];
19
+ export type SearchAccountsResponse = Account[];
@@ -1,8 +1,14 @@
1
1
  import { Row } from "../../../documents/app/row";
2
+ export interface GetRowResponse extends Row {
3
+ }
2
4
  export interface DeleteRows {
3
5
  rows: (Row | string)[];
4
6
  }
5
7
  export interface DeleteRow {
6
8
  _id: string;
7
9
  }
8
- export declare type DeleteRowRequest = DeleteRows | DeleteRow;
10
+ export type DeleteRowRequest = DeleteRows | DeleteRow;
11
+ export interface ValidateResponse {
12
+ valid: boolean;
13
+ errors: Record<string, any>;
14
+ }
@@ -1,5 +1,7 @@
1
- import { SearchParams } from "../../../sdk";
1
+ /// <reference types="node" />
2
+ import { SearchFilters, SearchParams } from "../../../sdk";
2
3
  import { Row } from "../../../documents";
4
+ import { ReadStream } from "fs";
3
5
  export interface SaveRowRequest extends Row {
4
6
  }
5
7
  export interface PatchRowRequest extends Row {
@@ -16,3 +18,9 @@ export interface SearchViewRowRequest extends Pick<SearchRowRequest, "sort" | "s
16
18
  export interface SearchRowResponse {
17
19
  rows: any[];
18
20
  }
21
+ export interface ExportRowsRequest {
22
+ rows: string[];
23
+ columns?: string[];
24
+ query?: SearchFilters;
25
+ }
26
+ export type ExportRowsResponse = ReadStream;
@@ -2,14 +2,14 @@ import { Table, TableRequest, TableSchema, View, ViewV2 } from "../../../documen
2
2
  interface ViewV2Response extends ViewV2 {
3
3
  schema: TableSchema;
4
4
  }
5
- export declare type TableViewsResponse = {
5
+ export type TableViewsResponse = {
6
6
  [key: string]: View | ViewV2Response;
7
7
  };
8
8
  export interface TableResponse extends Table {
9
9
  views?: TableViewsResponse;
10
10
  }
11
- export declare type FetchTablesResponse = TableResponse[];
11
+ export type FetchTablesResponse = TableResponse[];
12
12
  export interface SaveTableRequest extends TableRequest {
13
13
  }
14
- export declare type SaveTableResponse = Table;
14
+ export type SaveTableResponse = Table;
15
15
  export {};
@@ -17,7 +17,7 @@ export interface SearchAuditLogsRequest extends BasicPaginationRequest, AuditLog
17
17
  export declare enum AuditLogResourceStatus {
18
18
  DELETED = "deleted"
19
19
  }
20
- export declare type DeletedResourceInfo = {
20
+ export type DeletedResourceInfo = {
21
21
  _id: string;
22
22
  status: AuditLogResourceStatus;
23
23
  email?: string;
@@ -17,4 +17,4 @@ export interface PublicOIDCConfig {
17
17
  name?: string;
18
18
  uuid?: string;
19
19
  }
20
- export declare type GetPublicOIDCConfigResponse = PublicOIDCConfig[];
20
+ export type GetPublicOIDCConfigResponse = PublicOIDCConfig[];
@@ -1,7 +1,7 @@
1
1
  import { ScimResource, ScimMeta } from "scim-patch";
2
2
  import { ScimListResponse } from "./shared";
3
- declare type BooleanString = boolean | "True" | "true" | "False" | "false";
4
- declare type Emails = {
3
+ type BooleanString = boolean | "True" | "true" | "False" | "false";
4
+ type Emails = {
5
5
  value: string;
6
6
  type: "work";
7
7
  primary: boolean;
@@ -1,6 +1,6 @@
1
1
  import { FieldType } from "../../documents";
2
2
  import { EmptyFilterOption } from "../../sdk";
3
- export declare type SearchFilter = {
3
+ export type SearchFilter = {
4
4
  operator: keyof SearchQuery;
5
5
  onEmptyFilter?: EmptyFilterOption;
6
6
  field: string;
@@ -8,7 +8,7 @@ export declare type SearchFilter = {
8
8
  value: any;
9
9
  externalType?: string;
10
10
  };
11
- export declare type SearchQuery = {
11
+ export type SearchQuery = {
12
12
  allOr?: boolean;
13
13
  onEmptyFilter?: EmptyFilterOption;
14
14
  string?: {
@@ -48,4 +48,4 @@ export declare type SearchQuery = {
48
48
  [key: string]: any[];
49
49
  };
50
50
  };
51
- export declare type SearchQueryFields = Omit<SearchQuery, "allOr" | "onEmptyFilter">;
51
+ export type SearchQueryFields = Omit<SearchQuery, "allOr" | "onEmptyFilter">;
@@ -42,7 +42,7 @@ export interface InviteUserRequest {
42
42
  email: string;
43
43
  userInfo: any;
44
44
  }
45
- export declare type InviteUsersRequest = InviteUserRequest[];
45
+ export type InviteUsersRequest = InviteUserRequest[];
46
46
  export interface InviteUsersResponse {
47
47
  successful: {
48
48
  email: string;
@@ -74,7 +74,7 @@ export interface AccountSSO {
74
74
  pictureUrl?: string;
75
75
  thirdPartyProfile: any;
76
76
  }
77
- export declare type SSOAccount = (Account | CloudAccount) & AccountSSO;
77
+ export type SSOAccount = (Account | CloudAccount) & AccountSSO;
78
78
  export declare enum AuthType {
79
79
  SSO = "sso",
80
80
  PASSWORD = "password"
@@ -1,6 +1,6 @@
1
1
  import { User, Document } from "../";
2
2
  import { SocketSession } from "../../sdk";
3
- export declare type AppMetadataErrors = {
3
+ export type AppMetadataErrors = {
4
4
  [key: string]: string[];
5
5
  };
6
6
  export interface App extends Document {
@@ -180,7 +180,7 @@ export interface AutomationLogPage {
180
180
  hasNextPage: boolean;
181
181
  nextPage?: string;
182
182
  }
183
- export declare type AutomationStepInput = {
183
+ export type AutomationStepInput = {
184
184
  inputs: Record<string, any>;
185
185
  context: Record<string, any>;
186
186
  emitter: EventEmitter;
@@ -37,7 +37,7 @@ export interface AppBackup extends Document, AppBackupMetadata {
37
37
  _id: string;
38
38
  filename?: string;
39
39
  }
40
- export declare type AppBackupFetchOpts = {
40
+ export type AppBackupFetchOpts = {
41
41
  trigger?: AppBackupTrigger;
42
42
  type?: AppBackupType;
43
43
  limit?: number;
@@ -14,7 +14,8 @@ export declare enum FieldType {
14
14
  JSON = "json",
15
15
  INTERNAL = "internal",
16
16
  BARCODEQR = "barcodeqr",
17
- BIGINT = "bigint"
17
+ BIGINT = "bigint",
18
+ BB_REFERENCE = "bb_reference"
18
19
  }
19
20
  export interface RowAttachment {
20
21
  size: number;
@@ -29,3 +30,11 @@ export interface Row extends Document {
29
30
  _viewId?: string;
30
31
  [key: string]: any;
31
32
  }
33
+ export declare enum FieldSubtype {
34
+ USER = "user"
35
+ }
36
+ export declare const FieldTypeSubtypes: {
37
+ BB_REFERENCE: {
38
+ USER: FieldSubtype;
39
+ };
40
+ };
@@ -25,7 +25,7 @@ export interface ViewV2 {
25
25
  };
26
26
  schema?: Record<string, UIFieldMetadata>;
27
27
  }
28
- export declare type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema;
28
+ export type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema;
29
29
  export interface ViewCountOrSumSchema {
30
30
  field: string;
31
31
  value: string;
@@ -36,6 +36,7 @@ export declare enum DocumentType {
36
36
  AUTOMATION_METADATA = "meta_au",
37
37
  AUDIT_LOG = "al"
38
38
  }
39
+ export declare const DocumentTypesToImport: DocumentType[];
39
40
  export declare enum VirtualDocumentType {
40
41
  VIEW = "view"
41
42
  }
@@ -1,7 +1,7 @@
1
1
  import { Document } from "../document";
2
2
  import { Event } from "../../sdk";
3
3
  export declare const AuditLogSystemUser = "SYSTEM";
4
- export declare type FallbackInfo = {
4
+ export type FallbackInfo = {
5
5
  appName?: string;
6
6
  email?: string;
7
7
  };
@@ -43,8 +43,8 @@ export interface SettingsInnerConfig {
43
43
  }
44
44
  export interface SettingsConfig extends Config<SettingsInnerConfig> {
45
45
  }
46
- export declare type SSOConfigType = ConfigType.GOOGLE | ConfigType.OIDC;
47
- export declare type SSOConfig = GoogleInnerConfig | OIDCInnerConfig;
46
+ export type SSOConfigType = ConfigType.GOOGLE | ConfigType.OIDC;
47
+ export type SSOConfig = GoogleInnerConfig | OIDCInnerConfig;
48
48
  export interface GoogleInnerConfig {
49
49
  clientID: string;
50
50
  clientSecret: string;
@@ -2,11 +2,11 @@ import { Document } from "../document";
2
2
  export interface EnvironmentVariablesDoc extends Document {
3
3
  variables: string;
4
4
  }
5
- export declare type EnvironmentVariableValue = {
5
+ export type EnvironmentVariableValue = {
6
6
  production: string;
7
7
  development: string;
8
8
  };
9
- export declare type EnvironmentVariablesDecrypted = Record<string, EnvironmentVariableValue>;
9
+ export type EnvironmentVariablesDecrypted = Record<string, EnvironmentVariableValue>;
10
10
  export interface EnvironmentVariablesDocDecrypted extends Document {
11
11
  variables: EnvironmentVariablesDecrypted;
12
12
  }
@@ -12,7 +12,7 @@ export interface UsageBreakdown {
12
12
  [key: string]: number;
13
13
  };
14
14
  }
15
- export declare type QuotaTriggers = {
15
+ export type QuotaTriggers = {
16
16
  [key: string]: string | undefined;
17
17
  };
18
18
  export interface StaticUsage {
@@ -50,13 +50,13 @@ export interface QuotaUsage extends BaseQuotaUsage {
50
50
  [key: string]: BaseQuotaUsage;
51
51
  };
52
52
  }
53
- export declare type SetUsageValues = {
53
+ export type SetUsageValues = {
54
54
  total: number;
55
55
  app?: number;
56
56
  breakdown?: number;
57
57
  triggers?: QuotaTriggers;
58
58
  };
59
- export declare type UsageValues = {
59
+ export type UsageValues = {
60
60
  total: number;
61
61
  app?: number;
62
62
  breakdown?: number;
@@ -14,7 +14,7 @@ export interface Schedule extends Document {
14
14
  repeat: ScheduleRepeatPeriod;
15
15
  metadata: ScheduleMetadata;
16
16
  }
17
- export declare type ScheduleMetadata = AppBackupScheduleMetadata;
17
+ export type ScheduleMetadata = AppBackupScheduleMetadata;
18
18
  export declare const isAppBackupMetadata: (type: ScheduleType, metadata: ScheduleMetadata) => metadata is AppBackupScheduleMetadata;
19
19
  export interface AppBackupScheduleMetadata {
20
20
  apps: string[];
@@ -17,7 +17,7 @@ export interface UserSSO {
17
17
  oauth2?: OAuth2;
18
18
  thirdPartyProfile?: SSOProfileJson;
19
19
  }
20
- export declare type SSOUser = User & UserSSO;
20
+ export type SSOUser = User & UserSSO;
21
21
  export declare function isSSOUser(user: User): user is SSOUser;
22
22
  export interface User extends Document {
23
23
  tenantId: string;
@@ -20,4 +20,4 @@ export interface PlatformUserBySsoId extends Document {
20
20
  userId: string;
21
21
  email: string;
22
22
  }
23
- export declare type PlatformUser = PlatformUserByEmail | PlatformUserById | PlatformUserBySsoId;
23
+ export type PlatformUser = PlatformUserByEmail | PlatformUserById | PlatformUserBySsoId;
@@ -14,7 +14,7 @@ export interface AllDocsResponse<T> {
14
14
  total_rows: number;
15
15
  rows: RowResponse<T>[];
16
16
  }
17
- export declare type BulkDocsResponse = BulkDocResponse[];
17
+ export type BulkDocsResponse = BulkDocResponse[];
18
18
  interface BulkDocResponse {
19
19
  ok: boolean;
20
20
  id: string;
package/dist/index.js CHANGED
@@ -51,12 +51,15 @@ __export(src_exports, {
51
51
  DatasourceFeature: () => DatasourceFeature,
52
52
  DatasourceFieldType: () => DatasourceFieldType,
53
53
  DocumentType: () => DocumentType,
54
+ DocumentTypesToImport: () => DocumentTypesToImport,
54
55
  EmptyFilterOption: () => EmptyFilterOption,
55
56
  Event: () => Event,
56
57
  EventPublishType: () => EventPublishType,
57
58
  Feature: () => Feature,
58
59
  FeatureFlag: () => FeatureFlag,
60
+ FieldSubtype: () => FieldSubtype,
59
61
  FieldType: () => FieldType,
62
+ FieldTypeSubtypes: () => FieldTypeSubtypes,
60
63
  FilterType: () => FilterType,
61
64
  GroupType: () => GroupType,
62
65
  Hosting: () => Hosting,
@@ -514,7 +517,7 @@ var Feature = /* @__PURE__ */ ((Feature3) => {
514
517
  Feature3["SYNC_AUTOMATIONS"] = "syncAutomations";
515
518
  Feature3["APP_BUILDERS"] = "appBuilders";
516
519
  Feature3["OFFLINE"] = "offline";
517
- Feature3["USER_ROLE_PUBLIC_API"] = "userRolePublicApi";
520
+ Feature3["EXPANDED_PUBLIC_API"] = "expandedPublicApi";
518
521
  Feature3["VIEW_PERMISSIONS"] = "viewPermissions";
519
522
  return Feature3;
520
523
  })(Feature || {});
@@ -914,6 +917,21 @@ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
914
917
  DocumentType2["AUDIT_LOG"] = "al";
915
918
  return DocumentType2;
916
919
  })(DocumentType || {});
920
+ var DocumentTypesToImport = [
921
+ "role" /* ROLE */,
922
+ "datasource" /* DATASOURCE */,
923
+ "datasource_plus" /* DATASOURCE_PLUS */,
924
+ "ta" /* TABLE */,
925
+ "au" /* AUTOMATION */,
926
+ "wh" /* WEBHOOK */,
927
+ "screen" /* SCREEN */,
928
+ "query" /* QUERY */,
929
+ "metadata" /* METADATA */,
930
+ "view" /* MEM_VIEW */,
931
+ // Deprecated but still copied
932
+ "inst" /* INSTANCE */,
933
+ "layout" /* LAYOUT */
934
+ ];
917
935
  var VirtualDocumentType = /* @__PURE__ */ ((VirtualDocumentType2) => {
918
936
  VirtualDocumentType2["VIEW"] = "view";
919
937
  return VirtualDocumentType2;
@@ -936,8 +954,18 @@ var FieldType = /* @__PURE__ */ ((FieldType2) => {
936
954
  FieldType2["INTERNAL"] = "internal";
937
955
  FieldType2["BARCODEQR"] = "barcodeqr";
938
956
  FieldType2["BIGINT"] = "bigint";
957
+ FieldType2["BB_REFERENCE"] = "bb_reference";
939
958
  return FieldType2;
940
959
  })(FieldType || {});
960
+ var FieldSubtype = /* @__PURE__ */ ((FieldSubtype2) => {
961
+ FieldSubtype2["USER"] = "user";
962
+ return FieldSubtype2;
963
+ })(FieldSubtype || {});
964
+ var FieldTypeSubtypes = {
965
+ BB_REFERENCE: {
966
+ USER: "user" /* USER */
967
+ }
968
+ };
941
969
 
942
970
  // src/documents/app/backup.ts
943
971
  var AppBackupType = /* @__PURE__ */ ((AppBackupType2) => {
@@ -1122,12 +1150,15 @@ var ServiceType = /* @__PURE__ */ ((ServiceType2) => {
1122
1150
  DatasourceFeature,
1123
1151
  DatasourceFieldType,
1124
1152
  DocumentType,
1153
+ DocumentTypesToImport,
1125
1154
  EmptyFilterOption,
1126
1155
  Event,
1127
1156
  EventPublishType,
1128
1157
  Feature,
1129
1158
  FeatureFlag,
1159
+ FieldSubtype,
1130
1160
  FieldType,
1161
+ FieldTypeSubtypes,
1131
1162
  FilterType,
1132
1163
  GroupType,
1133
1164
  Hosting,