• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15export default {
16    DB: {
17        MMSSMS: {
18            config: {
19                name: "mmssms.db"
20            },
21            version: 1
22        }
23    },
24    table: {
25        // Session table
26        session:
27        "CREATE TABLE IF NOT EXISTS session (" +
28        "id INTEGER PRIMARY KEY AUTOINCREMENT, " +
29        "time INTEGER DEFAULT 0, " +
30        "telephone TEXT, " +
31        "content TEXT, " +
32        "contacts_num INTEGER DEFAULT 0, " +
33        "sms_type INTEGER DEFAULT 0, " +
34        "unread_count INTEGER DEFAULT 0, " +
35        "sending_status INTEGER DEFAULT 0, " +
36        "has_draft INTEGER DEFAULT 0," +
37        "has_lock INTEGER DEFAULT 0," +
38        "message_count INTEGER DEFAULT 0," +
39        "has_mms INTEGER DEFAULT 0," +
40        "has_attachment INTEGER DEFAULT 0" +
41        ");",
42    },
43    // Name of the field corresponding to the session list
44    sessionField: {
45        id: "id", //session Table id   integer
46        time: "time", // Last SMS message time  integer
47        telephone: "telephone", //Phone number  TEXT
48        content: "content", // SMS message content     TEXT
49        contactsNum: "contacts_num", // Number of Contacts    integer
50        smsType: "sms_type", //Sms Type    0-Common,1-Notice    integer
51        unreadCount: "unread_count", // Number of unread SMs   integer
52        sendStatus: "sending_status", // Sending success status   0:Success ,1 :Fail , 2 : Sending...   integer
53        hasDraft: "has_draft", //Whether there is a draft   0: no, 1:have  integer
54        hasLock: "has_lock", // Whether there is a lock   0: no, 1:have  integer
55        messageCount: "message_count", //Total number of messages  integer
56        hasMms: "has_mms", //Whether there is a new message  0: no, 1:have  integer
57        hasAttachment: "has_attachment" //Whether there are attachments  0: no, 1:have  integer
58    },
59    // Name of the field corresponding to the SMS message details.
60    messageInfo: {
61        msgId: "msg_id", //sms_mms_info Table id   integer
62        slotId: "slot_id", //slot_id integer
63        receiverNumber: "receiver_number", //Recipient number  TEXT
64        senderNumber: "sender_number", //Sender number  TEXT
65        startTime: "start_time", //Start Time  TEXT
66        endTime: "end_time", //End Time  TEXT
67        msgType: "msg_type", //Message Type  0 Subject、1 Pictures、2 Video、3 Audio、4 Text、5 business card    integer
68        smsType: "sms_type", //SM Type  0-Common,1-Notice  integer
69        msgTitle: "msg_title", //Message Title  TEXT
70        msgContent: "msg_content", //Message content  TEXT
71        msgState: "msg_state", //Message Status   0:Success ,1 :fail , 2 : Sending... integer
72        operatorServiceNumber: "operator_service_number", //Operator service number  TEXT
73        msgCode: "msg_code", //Message Code  integer
74        isLock: "is_lock", //Locked  0-No,1-Yes  integer
75        isRead: "is_read", // Read or Not  0-Read,1-Unread  integer
76        isCollect: "is_collect", //Favorites  0-Not favorited,1-Favorites  integer
77        sessionType: "session_type", //Session Type  0 - Common  1 - broadcast  2 - Group Sending  integer
78        retryNumber: "retry_number", //Retry Times  integer
79        isSubsection: "is_subsection", //Branch  0 - NO  1 - Yes  integer
80        sessionId: "session_id", //Session ID  integer
81        groupId: "group_id", //Group ID  integer
82        isSender: "is_sender", //Sender or Not  0 - Recipient  1 - Sender  integer
83        isSendReport: "is_send_report" //Whether to send a report  0 - No  1 - Yes  integer
84    },
85    contactColumns: {
86        id: "id", // raw_contact_table id
87        displayName: "display_name", // Display Name
88        contactedCount: "contacted_count", // Number of Contacts
89        lastestContactedTime: "lastest_contacted_time", // Last Contact Time
90    },
91    contactDataColumns: {
92        id: "id", // raw_contact_table id
93        contactId: "contact_id", // raw_contact_table id
94        detailInfo: "detail_info",
95        typeId: "type_id", // raw_contact_table id
96        contentType: "content_type", // raw_contact_table id
97        displayName: "display_name", // Display Name
98        hasDelete: "is_deleted" // hasDelete
99    },
100    searchContactView: {
101        searchName: "search_name",
102        contactId: "contact_id",
103        detailInfo: "detail_info",
104        contentType: "content_type",
105        displayName: "display_name", // Display Name
106        hasDelete: "is_deleted" // hasDelete
107    },
108    // Saving MMS data
109    mmsPart: {
110        msgId: "msg_id", //mms_part table id   integer
111        groupId: "group_id", // Group ID   integer
112        type: "type", // 0: theme; 1: picture; 2: video; 3: audio; 4: text; 5: business card    integer
113        locationPath: "location_path", //Local storage path   TEXT
114        content: "content", //MMS text content    TEXT
115        partSize: "part_size", //MMS Size    TEXT
116        partIndex: "part_index", //MMS data subscript   integer
117        recordingTime: "recording_time", //Audio/Video Recording Time    TEXT
118        encode: "encode", //Encoding or not  0: no encoding/encryption; 1: encoding/encryption   integer
119        state: "state" //Sending success status 0: success; 1: failure; 2: sending...    integer
120    },
121    // Saving SMS data in partitions
122    smsSubsection: {
123        smsSubsectionId: "sms_subsection_id", //sms_subsection table id   integer
124        receiverNumber: "receiver_number", //Recipient number  TEXT
125        senderNumber: "sender_number", //Sender number  TEXT
126        isSender: "is_sender", //Sender number  0 - Sender  1 - Recipient  integer
127        startTime: "start_time", //Start Time  TEXT
128        endTime: "end_time", //End Time  TEXT
129        rawPdu: "raw_pdu", //PDU string of the SMS message   TEXT
130        format: "format", //Formatted data    integer
131        destPort: "dest_port", //Destination Port    integer
132        subsectionIndex: "subsection_index", //Section Index    integer
133        size: "size" //size   integer
134    },
135    // mms Protocol data saving
136    mmsProtocol: {
137        msgId: "msg_id", //mms_Protocol table id   integer
138        bcc: "bcc", //bcc  TEXT
139        cc: "cc", //cc  TEXT
140        content_location: "content_location", //content_location  TEXT
141        date: "date", //date  TEXT
142        deliveryReport: "delivery_report", //deliveryReport  integer
143        deliveryTime: "delivery_time", //deliveryTime   TEXT
144        expiry: "expiry", //expiry    integer
145        type: "type", //type    integer
146        serialNumber: "serial_number", //serialNumber    TEXT
147        category: "category", //category    TEXT
148        version: "version", //version   integer
149        size: "size", //size   integer
150        priority: "priority", //priority   integer
151        readReply: "read_reply", //readReply   integer
152        reportAllowed: "report_allowed", //reportAllowed   integer
153        responseStatus: "response_status", //responseStatus   integer
154        responseText: "response_text", //responseText   TEXT
155        senderVisibility: "sender_visibility" //senderVisibility  integer
156    }
157}