• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * @file Describe the file
3 * Copyright (c) 2023 Huawei Device Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17import { Constants } from '../Constants';
18
19interface serviceType {
20  SERVICE_VERIFIED: string;
21  SERVICE_TYPE: string;
22  SERVICE_CP_BZ_URI: string;
23  SERVICE_CP_MNG_URI: string;
24  SERVICE_DESCRIPTION: string;
25  SERVICE_MIN_VERSION: string;
26}
27
28interface eventColumnsType {
29  TABLE_NAME: string,
30  ID: string,
31  SYNC_ID: string,
32  DIRTY: string,
33  MUTATORS: string,
34  EVENT_CALENDAR_TYPE: string,
35  EVENT_IMAGE_TYPE: string,
36  LAST_SYNCED: string,
37  CALENDAR_ID: string,
38  TITLE: string,
39  EVENT_LOCATION: string,
40  LOCATION_LONGITUDE: string,
41  LOCATION_LATITUDE: string,
42  DESCRIPTION: string,
43  EVENT_COLOR: string,
44  EVENT_COLOR_INDEX: string,
45  EVENT_STATUS: string,
46  SELF_ATTENDEE_STATUS: string,
47  DTSTART: string,
48  DTEND: string,
49  EVENT_TIMEZONE: string,
50  DURATION: string,
51  ALLDAY: string,
52  ACCESS_LEVEL: string,
53  AVAILABILITY: string,
54  HAS_ALARM: string,
55  HAS_EXTENDED_PROPERTIES: string,
56  RRULE: string,
57  RDATE: string,
58  EXRULE: string,
59  EXDATE: string,
60  ORIGINAL_ID: string,
61  ORIGINAL_SYNC_ID: string,
62  ORIGINAL_INSTANCE_TIME: string,
63  ORIGINAL_ALL_DAY: string,
64  LAST_DATE: string,
65  EVENT_TIME_STAMP: string,
66  HAS_ATTENDEE_DATE: string,
67  GUESTS_CAN_MODIFY: string,
68  GUESTS_CAN_INVITE_OTHERS: string,
69  GUESTS_CAN_SEE_GUESTS: string,
70  ORGANIZER: string,
71  IS_ORGANIZER: string,
72  DELETED: string,
73  EVENT_END_TIMEZONE: string,
74  CUSTOM_APP_PACKAGE: string,
75  CUSTOM_APP_URI: string,
76  UID2445: string,
77  VERSION: string,
78  EVENT_UUID: string,
79  HWEXT_ALERT_TYPE: string,
80  IMPORTANT_EVENT_TYPE: string,
81  SYNC_DATA1: string,
82  SYNC_DATA2: string,
83  SYNC_DATA3: string,
84  SYNC_DATA4: string,
85  SYNC_DATA5: string,
86  SYNC_DATA6: string,
87  SYNC_DATA7: string,
88  SYNC_DATA8: string,
89  SYNC_DATA9: string,
90  SYNC_DATA10: string,
91  KV_SYNC: string,
92  KV_SYNC_TIME: string,
93  CREATOR: string,
94  SERVICE: serviceType
95}
96
97/**
98 * the const of table Events
99 *
100 * @since 2022-05-28
101 */
102export const EventColumns: eventColumnsType = {
103  TABLE_NAME: 'Events',
104  ID: '_id',
105  SYNC_ID: '_sync_id',
106  DIRTY: 'dirty',
107  MUTATORS: 'mutators',
108  EVENT_CALENDAR_TYPE: 'event_calendar_type',
109  EVENT_IMAGE_TYPE: 'event_image_type',
110  LAST_SYNCED: 'lastSynced',
111  CALENDAR_ID: 'calendar_id',
112  TITLE: 'title',
113  EVENT_LOCATION: 'eventLocation',
114  LOCATION_LONGITUDE: 'location_longitude',
115  LOCATION_LATITUDE: 'location_latitude',
116  DESCRIPTION: 'description',
117  EVENT_COLOR: 'eventColor',
118  EVENT_COLOR_INDEX: 'eventColor_index',
119  EVENT_STATUS: 'eventStatus',
120  SELF_ATTENDEE_STATUS: 'selfAttendeeStatus',
121  DTSTART: 'dtstart',
122  DTEND: 'dtend',
123  EVENT_TIMEZONE: 'eventTimezone',
124  DURATION: 'duration',
125  ALLDAY: 'allDay',
126  ACCESS_LEVEL: 'accessLevel',
127  AVAILABILITY: 'availability',
128  HAS_ALARM: 'hasAlarm',
129  HAS_EXTENDED_PROPERTIES: 'hasExtendedProperties',
130  RRULE: 'rrule',
131  RDATE: 'rdate',
132  EXRULE: 'exrule',
133  EXDATE: 'exdate',
134  ORIGINAL_ID: 'original_id',
135  ORIGINAL_SYNC_ID: 'original_sync_id',
136  ORIGINAL_INSTANCE_TIME: 'originalInstanceTime',
137  ORIGINAL_ALL_DAY: 'originalAllDay',
138  LAST_DATE: 'lastDate',
139  EVENT_TIME_STAMP: 'event_time_stamp',
140  HAS_ATTENDEE_DATE: 'hasAttendeeData',
141  GUESTS_CAN_MODIFY: 'guestsCanModify',
142  GUESTS_CAN_INVITE_OTHERS: 'guestsCanInviteOthers',
143  GUESTS_CAN_SEE_GUESTS: 'guestsCanSeeGuests',
144  ORGANIZER: 'organizer',
145  IS_ORGANIZER: 'isOrganizer',
146  DELETED: 'deleted',
147  EVENT_END_TIMEZONE: 'eventEndTimezone',
148  CUSTOM_APP_PACKAGE: 'customAppPackage',
149  CUSTOM_APP_URI: 'customAppUri',
150  UID2445: 'uid2445',
151  VERSION: 'version',
152  EVENT_UUID: 'event_uuid',
153  HWEXT_ALERT_TYPE: 'hwext_alert_type',
154  IMPORTANT_EVENT_TYPE: 'important_event_type',
155  SYNC_DATA1: 'sync_data1',
156  SYNC_DATA2: 'sync_data2',
157  SYNC_DATA3: 'sync_data3',
158  SYNC_DATA4: 'sync_data4',
159  SYNC_DATA5: 'sync_data5',
160  SYNC_DATA6: 'sync_data6',
161  SYNC_DATA7: 'sync_data7',
162  SYNC_DATA8: 'sync_data8',
163  SYNC_DATA9: 'sync_data9',
164  SYNC_DATA10: 'sync_data10',
165  KV_SYNC: 'kv_synced',
166  KV_SYNC_TIME: 'kv_sync_time',
167  CREATOR: Constants.CREATOR,
168  SERVICE: {
169    SERVICE_VERIFIED: 'service_verified',              // whether service uri legal, INTEGER
170    SERVICE_TYPE: 'service_type',                      // service type of event, TEXT
171    SERVICE_CP_BZ_URI: 'service_cp_bz_uri',            // one click service uri passed in by application, TEXT
172    SERVICE_CP_MNG_URI: 'service_cp_mng_uri',          // one click service uri for management passed in by application, TEXT
173    SERVICE_DESCRIPTION: 'service_description',        // service description of event, TEXT
174    SERVICE_MIN_VERSION: 'service_support_min_version' // Minimum version of one click service, INTEGER
175  }
176}
177
178/**
179 * searchable Columns in Events table
180 */
181export const SEARCH_COLUMNS = [EventColumns.TITLE, EventColumns.DESCRIPTION, EventColumns.EVENT_LOCATION];
182
183export const UPDATE_INSTANCES_COLUMNS = [EventColumns.DTSTART, EventColumns.DTEND, EventColumns.DURATION,
184EventColumns.EVENT_TIMEZONE, EventColumns.RRULE, EventColumns.RDATE, EventColumns.EXRULE, EventColumns.EXDATE];