@budibase/types 2.22.17 → 2.22.19

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.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { SearchFilters, SearchParams } from "../../../sdk";
2
+ import { SearchFilters, RowSearchParams } from "../../../sdk";
3
3
  import { Row } from "../../../documents";
4
4
  import { PaginationResponse, SortOrder } from "../../../api";
5
5
  import { ReadStream } from "fs";
@@ -12,7 +12,7 @@ export interface PatchRowRequest extends Row {
12
12
  }
13
13
  export interface PatchRowResponse extends Row {
14
14
  }
15
- export interface SearchRowRequest extends Omit<SearchParams, "tableId"> {
15
+ export interface SearchRowRequest extends Omit<RowSearchParams, "tableId"> {
16
16
  }
17
17
  export interface SearchViewRowRequest extends Pick<SearchRowRequest, "sort" | "sortOrder" | "sortType" | "limit" | "bookmark" | "paginate" | "query"> {
18
18
  }
@@ -1,9 +1,6 @@
1
- import { FieldSchema, Row, Table, TableRequest, TableSchema, View, ViewV2 } from "../../../documents";
2
- interface ViewV2Response extends ViewV2 {
3
- schema: TableSchema;
4
- }
1
+ import { FieldSchema, Row, Table, TableRequest, View, ViewV2Enriched } from "../../../documents";
5
2
  export type TableViewsResponse = {
6
- [key: string]: View | ViewV2Response;
3
+ [key: string]: View | ViewV2Enriched;
7
4
  };
8
5
  export interface TableResponse extends Table {
9
6
  views?: TableViewsResponse;
@@ -27,4 +24,3 @@ export interface MigrateRequest {
27
24
  export interface MigrateResponse {
28
25
  message: string;
29
26
  }
30
- export {};
@@ -1,10 +1,11 @@
1
- import { ViewV2, UIFieldMetadata } from "../../../documents";
1
+ import { ViewV2, ViewV2Enriched } from "../../../documents";
2
2
  export interface ViewResponse {
3
3
  data: ViewV2;
4
4
  }
5
- export interface CreateViewRequest extends Omit<ViewV2, "version" | "id" | "schema"> {
6
- schema?: Record<string, UIFieldMetadata>;
5
+ export interface ViewResponseEnriched {
6
+ data: ViewV2Enriched;
7
7
  }
8
- export interface UpdateViewRequest extends Omit<ViewV2, "schema"> {
9
- schema?: Record<string, UIFieldMetadata>;
8
+ export interface CreateViewRequest extends Omit<ViewV2, "version" | "id"> {
9
+ }
10
+ export interface UpdateViewRequest extends ViewV2 {
10
11
  }
@@ -4,7 +4,7 @@ export declare enum SortOrder {
4
4
  }
5
5
  export declare enum SortType {
6
6
  STRING = "string",
7
- number = "number"
7
+ NUMBER = "number"
8
8
  }
9
9
  export interface BasicPaginationRequest {
10
10
  bookmark?: string;
@@ -18,6 +18,6 @@ export interface PaginationRequest extends BasicPaginationRequest {
18
18
  };
19
19
  }
20
20
  export interface PaginationResponse {
21
- bookmark: string | undefined;
22
- hasNextPage: boolean;
21
+ bookmark: string | number | undefined;
22
+ hasNextPage?: boolean;
23
23
  }
@@ -14,4 +14,5 @@ export * from "./backup";
14
14
  export * from "./webhook";
15
15
  export * from "./links";
16
16
  export * from "./component";
17
+ export * from "./sqlite";
17
18
  export * from "./snippet";
@@ -6,6 +6,7 @@ export interface LinkInfo {
6
6
  }
7
7
  export interface LinkDocument extends Document {
8
8
  type: string;
9
+ tableId: string;
9
10
  doc1: LinkInfo;
10
11
  doc2: LinkInfo;
11
12
  }
@@ -0,0 +1,26 @@
1
+ export declare enum SQLiteType {
2
+ REAL = "REAL",
3
+ TEXT = "VARCHAR",
4
+ INT = "INTEGER",
5
+ BLOB = "BLOB",
6
+ NUMERIC = "NUMERIC"
7
+ }
8
+ export interface SQLiteDefinition {
9
+ _id: string;
10
+ language: string;
11
+ sql: {
12
+ tables: {
13
+ [tableName: string]: {
14
+ fields: {
15
+ [key: string]: SQLiteType | {
16
+ field: string;
17
+ type: SQLiteType;
18
+ };
19
+ };
20
+ };
21
+ };
22
+ options: {
23
+ table_name: string;
24
+ };
25
+ };
26
+ }
@@ -14,6 +14,7 @@ export interface Table extends Document {
14
14
  [key: string]: View | ViewV2;
15
15
  };
16
16
  name: string;
17
+ originalName?: string;
17
18
  sourceId: string;
18
19
  primary?: string[];
19
20
  schema: TableSchema;
@@ -1,5 +1,5 @@
1
1
  import { SearchFilter, SortOrder, SortType } from "../../api";
2
- import { UIFieldMetadata } from "./table";
2
+ import { TableSchema, UIFieldMetadata } from "./table";
3
3
  import { Document } from "../document";
4
4
  import { DBView } from "../../sdk";
5
5
  export type ViewTemplateOpts = {
@@ -43,6 +43,9 @@ export interface ViewV2 {
43
43
  };
44
44
  schema?: Record<string, UIFieldMetadata>;
45
45
  }
46
+ export interface ViewV2Enriched extends ViewV2 {
47
+ schema?: TableSchema;
48
+ }
46
49
  export type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema;
47
50
  export interface ViewCountOrSumSchema {
48
51
  field: string;
package/dist/index.js CHANGED
@@ -96,6 +96,7 @@ __export(src_exports, {
96
96
  RelationshipType: () => RelationshipType,
97
97
  RestAuthType: () => RestAuthType,
98
98
  SEPARATOR: () => SEPARATOR,
99
+ SQLiteType: () => SQLiteType,
99
100
  SSOProviderType: () => SSOProviderType,
100
101
  ScheduleRepeatPeriod: () => ScheduleRepeatPeriod,
101
102
  ScheduleType: () => ScheduleType,
@@ -1096,6 +1097,16 @@ var WebhookActionType = /* @__PURE__ */ ((WebhookActionType2) => {
1096
1097
  return WebhookActionType2;
1097
1098
  })(WebhookActionType || {});
1098
1099
 
1100
+ // src/documents/app/sqlite.ts
1101
+ var SQLiteType = /* @__PURE__ */ ((SQLiteType2) => {
1102
+ SQLiteType2["REAL"] = "REAL";
1103
+ SQLiteType2["TEXT"] = "VARCHAR";
1104
+ SQLiteType2["INT"] = "INTEGER";
1105
+ SQLiteType2["BLOB"] = "BLOB";
1106
+ SQLiteType2["NUMERIC"] = "NUMERIC";
1107
+ return SQLiteType2;
1108
+ })(SQLiteType || {});
1109
+
1099
1110
  // src/documents/global/config.ts
1100
1111
  var isSettingsConfig = (config) => config.type === "settings" /* SETTINGS */;
1101
1112
  var isSMTPConfig = (config) => config.type === "smtp" /* SMTP */;
@@ -1209,7 +1220,7 @@ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
1209
1220
  })(SortOrder || {});
1210
1221
  var SortType = /* @__PURE__ */ ((SortType2) => {
1211
1222
  SortType2["STRING"] = "string";
1212
- SortType2["number"] = "number";
1223
+ SortType2["NUMBER"] = "number";
1213
1224
  return SortType2;
1214
1225
  })(SortType || {});
1215
1226
 
@@ -1317,6 +1328,7 @@ var MaintenanceType = /* @__PURE__ */ ((MaintenanceType2) => {
1317
1328
  RelationshipType,
1318
1329
  RestAuthType,
1319
1330
  SEPARATOR,
1331
+ SQLiteType,
1320
1332
  SSOProviderType,
1321
1333
  ScheduleRepeatPeriod,
1322
1334
  ScheduleType,