@redonvn/redai-backend-api-sdk 0.1.13 → 0.1.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redonvn/redai-backend-api-sdk",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Axios SDK for RedAI Dynamic Table APIs",
5
5
  "license": "UNLICENSED",
6
6
  "main": "src/index.ts",
@@ -20,6 +20,7 @@ import type {
20
20
  TableRecord,
21
21
  UnlinkRecordsBulkParams,
22
22
  UnlinkRecordsParams,
23
+ UpdateRecordFieldParams,
23
24
  UpdateRecordsParams,
24
25
  } from '../types';
25
26
 
@@ -166,6 +167,16 @@ export class DataTableService {
166
167
  });
167
168
  }
168
169
 
170
+ async updateRecordField(params: UpdateRecordFieldParams): Promise<ApiResponseDto<TableRecord>> {
171
+ return this.client.request<ApiResponseDto<TableRecord>>({
172
+ method: 'PATCH',
173
+ url: `/v1/dynamic-table/tables/${encodeURIComponent(String(params.tableId))}/records/${encodeURIComponent(String(params.recordId))}/fields/${encodeURIComponent(String(params.fieldId))}`,
174
+ params: undefined,
175
+ data: params?.body,
176
+ headers: undefined,
177
+ });
178
+ }
179
+
169
180
  async moveRecord(params: MoveRecordParams): Promise<ApiResponseDto<TableRecord>> {
170
181
  return this.client.request<ApiResponseDto<TableRecord>>({
171
182
  method: 'POST',
@@ -319,24 +319,6 @@ export interface CommandPaletteSearchQueryDto {
319
319
  limit?: number;
320
320
  workspaceId?: string;
321
321
  }
322
- export interface ComponentConfig {
323
- id: string;
324
- label: string;
325
- type?: string;
326
- required?: boolean;
327
- validation?: ValidationConfig;
328
- options?: string[];
329
- min?: number;
330
- max?: number;
331
- step?: number;
332
- defaultValue?: any;
333
- placeholder?: string;
334
- variant?: string;
335
- size?: string;
336
- disabled?: boolean;
337
- readOnly?: boolean;
338
- helperText?: string;
339
- }
340
322
  export interface CreateApiTokenDto {
341
323
  fkWorkspaceId?: string | null;
342
324
  fkBaseId?: string | null;
@@ -606,17 +588,88 @@ export interface ExternalSyncConfig {
606
588
  lastSyncAt?: Date;
607
589
  }
608
590
  export interface FieldConfig {
609
- component: string;
610
- config: ComponentConfig;
611
- grid: GridConfig;
591
+ options?: { id: string; label: string; color?: string }[];
592
+ precision?: number;
593
+ currencySymbol?: string;
594
+ currencyCode?: string;
595
+ percentFormat?: 'decimal' | 'whole';
596
+ maxRating?: number;
597
+ ratingIcon?: 'star' | 'heart' | 'thumb';
598
+ prefix?: string;
599
+ startNumber?: number;
600
+ digitCount?: number;
601
+ dateFormat?: string;
602
+ timeFormat?: '12h' | '24h';
603
+ includeTime?: boolean;
604
+ timezone?: string;
605
+ durationFormat?: 'h:mm' | 'h:mm:ss' | 'days';
606
+ targetTableId?: string;
607
+ allowMultiple?: boolean;
608
+ symmetricFieldId?: string;
609
+ relationFieldId?: string;
610
+ lookupFieldId?: string;
611
+ rollupRelationFieldId?: string;
612
+ rollupFieldId?: string;
613
+ rollupFunction?: 'sum' | 'avg' | 'min' | 'max' | 'count' | 'counta' | 'countall';
614
+ formulaExpression?: string;
615
+ outputType?: 'number' | 'text' | 'date' | 'boolean';
616
+ enableRichText?: boolean;
617
+ maxLength?: number;
618
+ defaultCountryCode?: string;
619
+ urlType?: 'any' | 'image' | 'video';
620
+ allowMultipleUsers?: boolean;
621
+ notifyOnAssign?: boolean;
622
+ allowedFileTypes?: string[];
623
+ maxFileSize?: number;
624
+ maxFiles?: number;
625
+ qrValueFieldId?: string;
626
+ barcodeValueFieldId?: string;
627
+ barcodeFormat?: string;
628
+ buttonLabel?: string;
629
+ buttonType?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
630
+ buttonActionType?: 'url' | 'api' | 'script' | 'email' | 'page';
631
+ buttonActionConfig?: Record<string, any>;
632
+ buttonIcon?: string;
633
+ buttonTooltip?: string;
634
+ buttonWidth?: number;
635
+ buttonConfirmation?: string;
636
+ aiPrompt?: string;
637
+ aiModel?: string;
638
+ aiConfig?: Record<string, any>;
612
639
  }
613
640
  export enum FieldType {
614
- STRING = 'string',
641
+ TEXT = 'text',
642
+ LONG_TEXT = 'long_text',
643
+ EMAIL = 'email',
644
+ PHONE = 'phone',
645
+ URL = 'url',
615
646
  NUMBER = 'number',
647
+ CURRENCY = 'currency',
648
+ PERCENT = 'percent',
649
+ RATING = 'rating',
650
+ AUTONUMBER = 'autonumber',
651
+ SELECT = 'select',
652
+ MULTI_SELECT = 'multi_select',
616
653
  BOOLEAN = 'boolean',
617
654
  DATE = 'date',
618
- OBJECT = 'object',
619
- ARRAY = 'array',
655
+ DATETIME = 'datetime',
656
+ DURATION = 'duration',
657
+ RELATION = 'relation',
658
+ LINK_TO_ANOTHER_RECORD = 'link_to_another_record',
659
+ LINKS = 'links',
660
+ LOOKUP = 'lookup',
661
+ ROLLUP = 'rollup',
662
+ FORMULA = 'formula',
663
+ CREATED_TIME = 'created_time',
664
+ MODIFIED_TIME = 'modified_time',
665
+ CREATED_BY = 'created_by',
666
+ MODIFIED_BY = 'modified_by',
667
+ ATTACHMENT = 'attachment',
668
+ QR_CODE = 'qrcode',
669
+ BARCODE = 'barcode',
670
+ BUTTON = 'button',
671
+ USER = 'user',
672
+ AI = 'ai',
620
673
  }
621
674
  export enum FilterComparisonOp {
622
675
  EQ = 'eq',
@@ -777,18 +830,6 @@ export interface GetUserUiPreferencesResponseDto {
777
830
  raw: UserUiPreferencesRawDto;
778
831
  resolved: UserUiPreferencesResolvedDto;
779
832
  }
780
- export interface GridConfig {
781
- i: string;
782
- x: number;
783
- y: number;
784
- w: number;
785
- h: number;
786
- minW?: number;
787
- minH?: number;
788
- maxW?: number;
789
- maxH?: number;
790
- static?: boolean;
791
- }
792
833
  export enum GridRowHeight {
793
834
  SHORT = 'short',
794
835
  MEDIUM = 'medium',
@@ -1283,6 +1324,7 @@ export interface TableResponseDto {
1283
1324
  createdAt: number;
1284
1325
  updatedAt: number | null;
1285
1326
  fields?: ColumnResponseDto[];
1327
+ views?: ViewResponseDto[];
1286
1328
  }
1287
1329
  export interface TableSettings {
1288
1330
  icon?: string;
@@ -1337,6 +1379,9 @@ export type UpdateGridViewDto = Partial<GridViewConfigDto>;
1337
1379
  export type UpdateHookDto = Partial<CreateHookDto>;
1338
1380
  export type UpdateKanbanViewDto = Partial<KanbanViewConfigDto>;
1339
1381
  export type UpdateMapViewDto = Partial<MapViewConfigDto>;
1382
+ export interface UpdateRecordFieldDto {
1383
+ value: JsonValue;
1384
+ }
1340
1385
  export type UpdateRowColorConditionDto = Partial<CreateRowColorConditionDto>;
1341
1386
  export interface UpdateRowColorModeDto {
1342
1387
  rowColoringMode: RowColoringMode;
@@ -1401,19 +1446,6 @@ export interface UserUiPreferencesResolvedDto {
1401
1446
  isValid: boolean;
1402
1447
  reason?: string;
1403
1448
  }
1404
- export interface ValidationConfig {
1405
- minLength?: number;
1406
- maxLength?: number;
1407
- pattern?: string;
1408
- minDate?: string;
1409
- maxDate?: string;
1410
- min?: number;
1411
- max?: number;
1412
- minItems?: number;
1413
- maxItems?: number;
1414
- itemType?: 'string' | 'number' | 'boolean';
1415
- requiredProperties?: string[];
1416
- }
1417
1449
  export interface ViewColumnResponseDto {
1418
1450
  id: string;
1419
1451
  viewId: string;
@@ -2191,6 +2223,12 @@ export interface UpdateMemberParams {
2191
2223
  export interface UpdateMeUiPreferencesParams {
2192
2224
  body: UpdateUserUiPreferencesDto;
2193
2225
  }
2226
+ export interface UpdateRecordFieldParams {
2227
+ tableId: string;
2228
+ recordId: string;
2229
+ fieldId: string;
2230
+ body: UpdateRecordFieldDto;
2231
+ }
2194
2232
  export interface UpdateRecordsParams {
2195
2233
  tableId: string;
2196
2234
  body: TableRecordInput | TableRecordInput[];
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "moduleName": "dynamic-table",
3
3
  "mode": "ts",
4
- "totalOperations": 161,
4
+ "totalOperations": 162,
5
5
  "resolvedByOpenapi": 0,
6
- "resolvedByTs": 161,
6
+ "resolvedByTs": 162,
7
7
  "unresolved": [],
8
8
  "conflicts": []
9
9
  }