cordova-plugin-unvired-universal-sdk 1.0.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.
- package/README.md +59 -0
- package/aar/README.md +3 -0
- package/aar/Unvired_Kernel_Android.aar +0 -0
- package/aar/Unvired_Kernel_HTML5_Android.aar +0 -0
- package/package.json +69 -0
- package/plugin.xml +23 -0
- package/src/android/build.gradle +35 -0
- package/src/android/xml/provider_paths.xml +21 -0
- package/src/browser/UnviredPluginProxy.js +2430 -0
- package/src/browser/bootstrap.min.js +17 -0
- package/src/browser/codemirror.js +9755 -0
- package/src/browser/jquery-3.2.1.js +10253 -0
- package/src/browser/sql-wasm.wasm +0 -0
- package/src/browser/sql.js +203 -0
- package/src/browser/src_index_worker_js.unvired-db-worker.js +231 -0
- package/src/browser/unvired-db-worker.js +166 -0
- package/src/browser/vendors-node_modules_comlink_dist_esm_comlink_mjs.unvired-db-worker.js +22 -0
- package/src/ios/AttachmentPlugin.h +21 -0
- package/src/ios/AttachmentPlugin.m +180 -0
- package/src/ios/DataStructureHelper.h +28 -0
- package/src/ios/DataStructureHelper.m +188 -0
- package/src/ios/IOSAuthPlugin.h +14 -0
- package/src/ios/IOSAuthPlugin.m +13 -0
- package/src/ios/IOSDatabasePlugin.h +28 -0
- package/src/ios/IOSDatabasePlugin.m +253 -0
- package/src/ios/IOSFWSettingsPlugin.h +65 -0
- package/src/ios/IOSFWSettingsPlugin.m +363 -0
- package/src/ios/IOSLoggerPlugin.h +34 -0
- package/src/ios/IOSLoggerPlugin.m +198 -0
- package/src/ios/IOSLoginPlugin.h +29 -0
- package/src/ios/IOSLoginPlugin.m +480 -0
- package/src/ios/IOSProxyPlugin.h +21 -0
- package/src/ios/IOSProxyPlugin.m +172 -0
- package/src/ios/IOSSyncEnginePlugin.h +54 -0
- package/src/ios/IOSSyncEnginePlugin.m +847 -0
- package/src/ios/PluginConstants.h +195 -0
- package/src/ios/PluginHelper.h +29 -0
- package/src/ios/PluginHelper.m +74 -0
- package/src/ios/SyncHTML5Response.h +50 -0
- package/src/ios/SyncHTML5Response.m +68 -0
- package/www/applicationMeta/applicationMetadataParser.ts +285 -0
- package/www/applicationMeta/fieldConstants.ts +92 -0
- package/www/attachment/attachmentHelper.ts +326 -0
- package/www/attachment/attachmentQHelper.ts +158 -0
- package/www/attachment/attachmentService.ts +259 -0
- package/www/authenticationService.ts +746 -0
- package/www/bootstrap.min.js +17 -0
- package/www/codemirror.js +9755 -0
- package/www/database/appDatabaseManager.ts +54 -0
- package/www/database/databaseManager.ts +616 -0
- package/www/helper/dbCreateTablesManager.ts +354 -0
- package/www/helper/frameworkHelper.ts +127 -0
- package/www/helper/frameworkSettingsManager.ts +287 -0
- package/www/helper/getMessageTimerManager.ts +81 -0
- package/www/helper/httpConnection.ts +1051 -0
- package/www/helper/logger.ts +312 -0
- package/www/helper/notificationListnerHelper.ts +56 -0
- package/www/helper/passcodeGenerator.ts +61 -0
- package/www/helper/reconciler.ts +1062 -0
- package/www/helper/serverResponseHandler.ts +677 -0
- package/www/helper/serviceConstants.ts +254 -0
- package/www/helper/settingsHelper.ts +386 -0
- package/www/helper/status.ts +83 -0
- package/www/helper/syncInputDataManager.ts +205 -0
- package/www/helper/unviredAccount.ts +104 -0
- package/www/helper/unviredAccountManager.ts +120 -0
- package/www/helper/urlService.ts +43 -0
- package/www/helper/userSettingsManager.ts +172 -0
- package/www/helper/utils.ts +110 -0
- package/www/inbox/downloadMessageService.ts +270 -0
- package/www/inbox/inboxHelper.ts +132 -0
- package/www/inbox/inboxService.ts +223 -0
- package/www/jquery-3.2.1.js +10253 -0
- package/www/kernel.js +1380 -0
- package/www/outbox/outboxAttachmentManager.ts +152 -0
- package/www/outbox/outboxHelper.ts +67 -0
- package/www/outbox/outboxService.ts +519 -0
- package/www/sql-wasm.wasm +0 -0
- package/www/sql.js +209 -0
- package/www/subtract.ts +5 -0
- package/www/sum.ts +4 -0
- package/www/syncEngine.ts +687 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PluginConstants.h
|
|
3
|
+
// iOS HTML5 Kernel
|
|
4
|
+
//
|
|
5
|
+
// Created by Srinidhi on 09/09/14.
|
|
6
|
+
// Copyright (c) 2014 Unvired Software India Pvt. Ltd. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import "SystemCredential.h"
|
|
11
|
+
#import "AuthenticationService.h"
|
|
12
|
+
|
|
13
|
+
// VERSIONS
|
|
14
|
+
static NSString *const VERSION_APPLICATION = @"appVersion";
|
|
15
|
+
static NSString *const VERSION_APP_BUILD_NO = @"appBuildNumber";
|
|
16
|
+
static NSString *const VERSION_APP_REVISION_NO = @"appRevisionNumber";
|
|
17
|
+
|
|
18
|
+
static NSString *const VERSION_FRAMEWORK = @"SDKVersion";
|
|
19
|
+
static NSString *const VERSION_FRAMEWORK_BUILD_NO = @"SDKBuildNumber";
|
|
20
|
+
static NSString *const VERSION_FRAMEWORK_REVISION_NO = @"SDKRevisionNumber";
|
|
21
|
+
|
|
22
|
+
//JSON data object constants...
|
|
23
|
+
static NSString *const LOGIN_MODULE_UNVIRED = @"UNVIRED_ID";
|
|
24
|
+
static NSString *const LOGIN_MODULE_ADS = @"ADS";
|
|
25
|
+
static NSString *const LOGIN_MODULE_EMAIL = @"EMAIL";
|
|
26
|
+
static NSString *const LOGIN_MODULE_SAP = @"SAP";
|
|
27
|
+
static NSString *const LOGIN_MODULE_CUSTOM = @"CUSTOM";
|
|
28
|
+
static NSString *const LOGIN_MODULE_SAML2 = @"SAML2";
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
static NSString *const LOGIN_MODULE_UNVIRED_ENUM = @"0";
|
|
32
|
+
static NSString *const LOGIN_MODULE_ADS_ENUM = @"1";
|
|
33
|
+
static NSString *const LOGIN_MODULE_EMAIL_ENUM = @"2";
|
|
34
|
+
static NSString *const LOGIN_MODULE_SAP_ENUM = @"3";
|
|
35
|
+
static NSString *const LOGIN_MODULE_CUSTOM_ENUM = @"4";
|
|
36
|
+
|
|
37
|
+
static NSString *const LOGIN_TYPE = @"loginType";
|
|
38
|
+
static NSString *const LOGIN_DOMAIN = @"domain";
|
|
39
|
+
static NSString *const CUSTOM_FIELD_LID = @"Lid";
|
|
40
|
+
static NSString *const CUSTOM_FIELD_FID = @"Fid";
|
|
41
|
+
static NSString *const TABLE = @"table";
|
|
42
|
+
static NSString *const FIELD = @"field";
|
|
43
|
+
static NSString *const NAME = @"name";
|
|
44
|
+
static NSString *const VALUE = @"value";
|
|
45
|
+
static NSString *const IS_HEADER = @"isHeader";
|
|
46
|
+
static NSString *const TABLES = @"tables";
|
|
47
|
+
static NSString *const TABLE_NAME = @"tableName";
|
|
48
|
+
static NSString *const FIELDS = @"fields";
|
|
49
|
+
static NSString *const APP_NAME = @"APP_NAME";
|
|
50
|
+
static NSString *const METADATA = @"METADATA";
|
|
51
|
+
static NSString *const WHERE_CLAUSE = @"whereClause";
|
|
52
|
+
static NSString *const INPUT_DATA = @"data";
|
|
53
|
+
static NSString *const CUSTOM_DATA = @"customData";
|
|
54
|
+
static NSString *const BYPASS_ATTACHMENT = @"bypassAttachment";
|
|
55
|
+
static NSString *const BE_NAME = @"beName";
|
|
56
|
+
static NSString *const REQUEST_TYPE = @"requestType";
|
|
57
|
+
static NSString *const UNIQUE_ID = @"uniqueId";
|
|
58
|
+
static NSString *const AUTO_SAVE = @"autoSave";
|
|
59
|
+
static NSString *const BE_ID = @"beId";
|
|
60
|
+
static NSString *const PC_COMPANY_NAMESPACE = @"companyNamespace";
|
|
61
|
+
static NSString *const PROCESS_AGENT_FUNCTION_NAME = @"paFunction";
|
|
62
|
+
static NSString *const HEADER = @"header";
|
|
63
|
+
static NSString *const ITEMS = @"ITEMS";
|
|
64
|
+
static NSString *const HEADER_TABLE_NAME = @"HEADER_TABLE_NAME";
|
|
65
|
+
static NSString *const ITEM_TABLE_NAME = @"ITEM_TABLE_NAME";
|
|
66
|
+
static NSString *const ITEM = @"ITEM";
|
|
67
|
+
static NSString *const BE = @"BE";
|
|
68
|
+
static NSString *const BE_NODE = @"BusinessEntity";
|
|
69
|
+
static NSString *const DATA_SENT = @"DATA_SENT";
|
|
70
|
+
static NSString *const BE_LID = @"belid";
|
|
71
|
+
static NSString *const OBJ_STAT = @"objectStatus";
|
|
72
|
+
|
|
73
|
+
//Action constants...
|
|
74
|
+
static NSString *const INITIALIZE_APP = @"initializeApp";
|
|
75
|
+
static NSString *const SHUTDOWN_APP = @"shutdownApp";
|
|
76
|
+
static NSString *const USER_SETTINGS = @"userSettings";
|
|
77
|
+
static NSString *const LOG = @"log";
|
|
78
|
+
static NSString *const AUTHENTICATE = @"authenticate";
|
|
79
|
+
static NSString *const APP_IS_ACTIVE = @"appIsActive";
|
|
80
|
+
static NSString *const SELECT = @"select";
|
|
81
|
+
static NSString *const INSERT = @"insert";
|
|
82
|
+
static NSString *const LOGIN_ACTION = @"login";
|
|
83
|
+
static NSString *const AUTH_ACTION = @"authenticate";
|
|
84
|
+
static NSString *const INSERT_BE = @"insertBE";
|
|
85
|
+
static NSString *const INSERT_OR_UPDATE = @"insertOrUpdate";
|
|
86
|
+
static NSString *const DELETE = @"delete";
|
|
87
|
+
static NSString *const UPDATE = @"update";
|
|
88
|
+
static NSString *const REGISTER_NOTIFICATION_LISTENER = @"registerNotificationListener";
|
|
89
|
+
static NSString *const REGISTER_LOGIN_LISTENER = @"registerLoginListener";
|
|
90
|
+
static NSString *const UNREGISTER_NOTIFICATION_LISTENER = @"unRegisterNotificationListener";
|
|
91
|
+
static NSString *const REGISTER_SENDER_LISTENER = @"registerSenderListener";
|
|
92
|
+
static NSString *const REGISTER_RECEIVER_LISTENER = @"registerReceiverListener";
|
|
93
|
+
static NSString *const GENERATE_IBXML = @"generateIbxml";
|
|
94
|
+
|
|
95
|
+
static NSString *const SUBMIT__DATA_IN_ASYNC_MODE = @"submitDataInAsyncMode";
|
|
96
|
+
static NSString *const SUBMIT_DATA_IN_SYNC_MODE = @"submitDataInSyncMode";
|
|
97
|
+
|
|
98
|
+
static NSString *const SEND_CUSTOM_DATA_IN_ASYNC_MODE = @"sendCustomDataInAsyncMode";
|
|
99
|
+
static NSString *const SEND_CUSTOM_DATA_QUERY_IN_ASYNC_MODE = @"sendCustomDataQueryInAsyncMode";
|
|
100
|
+
static NSString *const SEND_BE_DATA_IN_ASYNC_MODE = @"sendBEDataInAsyncMode";
|
|
101
|
+
static NSString *const SEND_BE_DATA_QUERY_IN_ASYNC_MODE = @"sendBEDataQueryInAsyncMode";
|
|
102
|
+
|
|
103
|
+
static NSString *const SEND_CUSTOM_DATA_IN_SYNC_MODE = @"sendCustomDataInSyncMode";
|
|
104
|
+
static NSString *const SEND_CUSTOM_DATA_QUERY_IN_SYNC_MODE = @"sendCustomDataQueryInSyncMode";
|
|
105
|
+
static NSString *const SEND_BE_DATA_IN_SYNC_MODE = @"sendBEDataInSyncMode";
|
|
106
|
+
static NSString *const SEND_BE_DATA_QUERY_IN_SYNC_MODE = @"sendBEDataQueryInSyncMode";
|
|
107
|
+
|
|
108
|
+
static NSString *const GET_MESSAGES_IN_BACKGROUND = @"getMessagesInBackground";
|
|
109
|
+
static NSString *const REST_API_CALL = @"restApiCall";
|
|
110
|
+
|
|
111
|
+
//Authentication parameters constants...
|
|
112
|
+
static NSString *const SYSTEM_CREDENTIAL_PORT = @"port";
|
|
113
|
+
static NSString *const SYSTEM_CREDENTIAL_USERNAME = @"username";
|
|
114
|
+
static NSString *const SYSTEM_CREDENTIAL_PASSWORD = @"password";
|
|
115
|
+
static NSString *const URL = @"url";
|
|
116
|
+
static NSString *const USER_NAME = @"username";
|
|
117
|
+
static NSString *const PLUGIN_PASSWORD = @"password";
|
|
118
|
+
static NSString *const COMPANY = @"company";
|
|
119
|
+
static NSString *const APPL_NAME = @"appName";
|
|
120
|
+
static NSString *const SAML_REDIRECT_URL = @"redirectURL";
|
|
121
|
+
|
|
122
|
+
static NSString *const METADATA_JSON = @"metadataJSON";
|
|
123
|
+
static NSString *const JWT_OPTIONS = @"jwtOptions";
|
|
124
|
+
static NSString *const PC_COMPANY_ALIAS = @"companyAlias";
|
|
125
|
+
static NSString *const NAMESPACE = @"namespace";
|
|
126
|
+
static NSString *const FEUSRID = @"feUserId";
|
|
127
|
+
static NSString *const PC_DEVICE_TYPE = @"DEVICE_TYPE";
|
|
128
|
+
static NSString *const DEVICE_TYPE_ANDROID_PHONE = @"ANDROID_PHONE;";
|
|
129
|
+
static NSString *const DEVICE_TYPE_ANDROID_TABLET = @"ANDROID_TABLET";
|
|
130
|
+
static NSString *const LOGIN_LANGUAGE = @"loginLanguage";
|
|
131
|
+
|
|
132
|
+
static NSString *const DEMO_DATA = @"demoData";
|
|
133
|
+
static NSString *const DEMO_MODE_REQUIRED = @"demoModeRequired";
|
|
134
|
+
|
|
135
|
+
static NSString *const TYPE = @"type";
|
|
136
|
+
static NSString *const MESSAGE = @"message";
|
|
137
|
+
static NSString *const DATA = @"data";
|
|
138
|
+
static NSString *const ERROR = @"error";
|
|
139
|
+
static NSString *const ERROR_DETAIL = @"errorDetail";
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
//PluginResult message constants...
|
|
143
|
+
static NSString *const PASSWORD_MATCH = @"PASSWORD_MATCH";
|
|
144
|
+
static NSString *const PASSWORD_MISS_MATCH = @"PASSWORD_MISS_MATCH";
|
|
145
|
+
static NSString *const AUTHENTICATION_SUCCESSFULL = @"AUTHENTICATION_SUCCESSFULL";
|
|
146
|
+
//static NSString *const TYPE = @"TYPE";
|
|
147
|
+
//static NSString *const MESSAGE = @"MESSAGE";
|
|
148
|
+
static NSString *const DB_EXISTS = @"DB_EXISTS";
|
|
149
|
+
//static NSString *const DATA = @"DATA";
|
|
150
|
+
static NSString *const PC_SUCCESS = @"S";
|
|
151
|
+
//static NSString *const ERROR = @"E";
|
|
152
|
+
static NSString *const SYNC_MODE_DOWNLOAD_COMPLETE = @"SYNC_MODE_DOWNLOAD_COMPLETE";
|
|
153
|
+
static NSString *const SYNC_DOWNLOAD_ERROR = @"SYNC_DOWNLOAD_ERROR";
|
|
154
|
+
static NSString *const DATA_RECEIVE_COMPLETED = @"DATA_RECEIVE_COMPLETED";
|
|
155
|
+
|
|
156
|
+
//Notification constants
|
|
157
|
+
static NSString *const DATA_SEND = @"DATA_SEND";
|
|
158
|
+
static NSString *const DATA_RECEIVE = @"DATA_RECEIVE";
|
|
159
|
+
static NSString *const APP_RESET = @"APP_RESET";
|
|
160
|
+
|
|
161
|
+
// TODO: Check the constants in Windows Framework and implement.
|
|
162
|
+
static NSString *const ATTACHMENT_DOWNLOAD_SUCCESS = @"ATTACHMENT_DOWNLOAD_SUCCESS";
|
|
163
|
+
static NSString *const ATTACHMENT_DOWNLOAD_FAILURE = @"ATTACHMENT_DOWNLOAD_FAILURE";
|
|
164
|
+
|
|
165
|
+
//Rest Api
|
|
166
|
+
static NSString *const API = @"api";
|
|
167
|
+
static NSString *const PARAM = @"param";
|
|
168
|
+
static const int LOGIN = 201;
|
|
169
|
+
|
|
170
|
+
// Log
|
|
171
|
+
static NSString *const LOG_LEVEL = @"level";
|
|
172
|
+
static NSString *const LOG_SOURCE_CLASS = @"srcClass";
|
|
173
|
+
static NSString *const LOG_SOURCE_METHOD = @"srcMethod";
|
|
174
|
+
static NSString *const LOG_MSG = @"message";
|
|
175
|
+
static NSString *const LOG_LEVEL_PARAM = @"logLevel";
|
|
176
|
+
|
|
177
|
+
//Account Constants
|
|
178
|
+
static NSString *const ACC_COMPANY = @"company";
|
|
179
|
+
static NSString *const ACC_USERNAME = @"userName";
|
|
180
|
+
static NSString *const ACC_SERVER_URL= @"serverUrl";
|
|
181
|
+
static NSString *const ACC_ACCOUNT_ID = @"accountId";
|
|
182
|
+
static NSString *const ACC_FRIENDLY_NAME= @"friendlyName";
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
//Settings Plugin Constant
|
|
186
|
+
|
|
187
|
+
static NSString *const FULL_NAME = @"FULL_NAME";
|
|
188
|
+
static NSString *const CORDOVA_SERVER_URL = @"SERVER_URL";
|
|
189
|
+
static NSString *const EMAIL = @"EMAIL";
|
|
190
|
+
static NSString *const PLUGIN_SERVER_URL = @"SERVER_URL";
|
|
191
|
+
static NSString *const SAP_USER_ID = @"SAP_USER_ID";
|
|
192
|
+
static NSString *const SAP_PORT_NAME = @"SAP_PORT_NAME";
|
|
193
|
+
static NSString *const PLUGIN_LOGIN_TYPE = @"LOGIN_TYPE";
|
|
194
|
+
static NSString *const ADS_USER_ID = @"ADS_USER_ID";
|
|
195
|
+
static NSString *const ADS_DOMAIN = @"ADS_DOMAIN";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// IOSPluginHelper.h
|
|
3
|
+
// Unvired_Framework
|
|
4
|
+
//
|
|
5
|
+
// Created by Venkadesh P on 25/05/16.
|
|
6
|
+
// Copyright © 2016 Unvired Software India Pvt. Ltd. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import <Cordova/CDV.h>
|
|
11
|
+
|
|
12
|
+
@interface PluginHelper : NSObject
|
|
13
|
+
+ (void)sendListenerCallback:(id <CDVCommandDelegate>)commandDelegate
|
|
14
|
+
callbackId:(NSString *)callbackId
|
|
15
|
+
type:(int)errorType
|
|
16
|
+
data:(id)data
|
|
17
|
+
message:(NSString *)message
|
|
18
|
+
error:(NSString *)error
|
|
19
|
+
errorDetail:(NSString *)errorDetail;
|
|
20
|
+
|
|
21
|
+
+ (void)sendSuccessCallback:(id <CDVCommandDelegate>)commandDelegate
|
|
22
|
+
callbackId:(NSString *)callbackId
|
|
23
|
+
data:(id)data;
|
|
24
|
+
|
|
25
|
+
+ (void)sendErrorCallback:(id <CDVCommandDelegate>)commandDelegate
|
|
26
|
+
callbackId:(NSString *)callbackId
|
|
27
|
+
error:(NSString *)error;
|
|
28
|
+
|
|
29
|
+
@end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//
|
|
2
|
+
// IOSPluginHelper.m
|
|
3
|
+
// Unvired_Framework
|
|
4
|
+
//
|
|
5
|
+
// Created by Venkadesh P on 25/05/16.
|
|
6
|
+
// Copyright © 2016 Unvired Software India Pvt. Ltd. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "PluginHelper.h"
|
|
10
|
+
#import "PluginConstants.h"
|
|
11
|
+
#import "Logger.h"
|
|
12
|
+
|
|
13
|
+
@implementation PluginHelper
|
|
14
|
+
|
|
15
|
+
+ (void)sendSuccessCallback:(id <CDVCommandDelegate>)commandDelegate
|
|
16
|
+
callbackId:(NSString *)callbackId
|
|
17
|
+
data:(id)data {
|
|
18
|
+
[self sendListenerCallback:commandDelegate
|
|
19
|
+
callbackId:callbackId
|
|
20
|
+
type:success_result
|
|
21
|
+
data:data
|
|
22
|
+
message:@""
|
|
23
|
+
error:@""
|
|
24
|
+
errorDetail:@""];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
+ (void)sendErrorCallback:(id <CDVCommandDelegate>)commandDelegate
|
|
28
|
+
callbackId:(NSString *)callbackId
|
|
29
|
+
error:(NSString *)error {
|
|
30
|
+
[self sendListenerCallback:commandDelegate
|
|
31
|
+
callbackId:callbackId
|
|
32
|
+
type:error_result
|
|
33
|
+
data:@""
|
|
34
|
+
message:@""
|
|
35
|
+
error:error
|
|
36
|
+
errorDetail:@""];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
+ (void)sendListenerCallback:(id <CDVCommandDelegate>)commandDelegate
|
|
41
|
+
callbackId:(NSString *)callbackId
|
|
42
|
+
type:(int)errorType
|
|
43
|
+
data:(id)data
|
|
44
|
+
message:(NSString *)message
|
|
45
|
+
error:(NSString *)error
|
|
46
|
+
errorDetail:(NSString *)errorDetail {
|
|
47
|
+
|
|
48
|
+
// Log all errors
|
|
49
|
+
if (error.length > 0) {
|
|
50
|
+
[Logger loggerWithlog:LEVEL_ERROR
|
|
51
|
+
ClassName:[self class]
|
|
52
|
+
MethodName:NSStringFromSelector(_cmd)
|
|
53
|
+
msg:[NSString stringWithFormat:@"Error: %@, More Info: %@%@", message, error, errorDetail]];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
NSDictionary *notifyObject = @{
|
|
57
|
+
TYPE : @(errorType),
|
|
58
|
+
DATA : (data == nil ? @"" : data),
|
|
59
|
+
MESSAGE : (message == nil ? @"" : message),
|
|
60
|
+
ERROR : (error == nil ? @"" : error),
|
|
61
|
+
ERROR_DETAIL : (errorDetail == nil ? @"" : errorDetail)
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
[Logger loggerWithlog:LEVEL_DEBUG
|
|
65
|
+
ClassName:[self class]
|
|
66
|
+
MethodName:callbackId
|
|
67
|
+
msg:[NSString stringWithFormat:@"Type: %@, Message: %@", @(errorType), message]];
|
|
68
|
+
|
|
69
|
+
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:notifyObject];
|
|
70
|
+
[pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
|
|
71
|
+
[commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SyncHTML5Response.h
|
|
3
|
+
// Unvired_Framework
|
|
4
|
+
//
|
|
5
|
+
// Created by Geetika Gupta on 14/05/13.
|
|
6
|
+
//
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import "ISyncResponse.h"
|
|
11
|
+
#import "HTTPResponse.h"
|
|
12
|
+
#import "InfoMessage.h"
|
|
13
|
+
|
|
14
|
+
@interface SyncHTML5Response : HTTPResponse <ISyncResponse>
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Get the request type {@link MessageRequestType} in the message
|
|
18
|
+
*/
|
|
19
|
+
@property (nonatomic, strong) InfoMessage *infoMessage;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get the message sub type {@link MessageType}.
|
|
23
|
+
*/
|
|
24
|
+
@property (nonatomic) BOOL autoSave;
|
|
25
|
+
|
|
26
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
27
|
+
serverfields:(NSDictionary *)serverFields
|
|
28
|
+
bytes:(NSData *)responseBytes;
|
|
29
|
+
|
|
30
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
31
|
+
andError:(NSError *)error;
|
|
32
|
+
|
|
33
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
34
|
+
message:(InfoMessage *)infoMessage;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
38
|
+
andResponseBytes:(NSData *)responseBytes;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
42
|
+
responseBytes:(NSData *)responseBytes
|
|
43
|
+
autoSave:(BOOL)autosave;
|
|
44
|
+
|
|
45
|
+
- (InfoMessage *)getInfoMessage;
|
|
46
|
+
|
|
47
|
+
- (BOOL)isAutoSave;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SyncHTML5Response.m
|
|
3
|
+
// Unvired_Framework
|
|
4
|
+
//
|
|
5
|
+
// Created by Geetika Gupta on 14/05/13.
|
|
6
|
+
//
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "SyncHTML5Response.h"
|
|
10
|
+
#import "UnviredError.h"
|
|
11
|
+
|
|
12
|
+
@implementation SyncHTML5Response
|
|
13
|
+
|
|
14
|
+
- (RESPONSE_STATUS)getResponseCode {
|
|
15
|
+
switch (self.responseCode) {
|
|
16
|
+
case -1:
|
|
17
|
+
return RESPONSE_STATUS_CANCEL;
|
|
18
|
+
|
|
19
|
+
case 200:
|
|
20
|
+
return RESPONSE_STATUS_SUCCESS;
|
|
21
|
+
|
|
22
|
+
default:
|
|
23
|
+
return RESPONSE_STATUS_FAILURE;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
28
|
+
serverfields:(NSDictionary *)serverFields
|
|
29
|
+
bytes:(NSData *)responseBytes;
|
|
30
|
+
{
|
|
31
|
+
return [super initWithData:responseCode serverFields:serverFields data:responseBytes];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
35
|
+
andError:(NSError *)error {
|
|
36
|
+
return [super initWithResponseCode:responseCode andError:error];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
40
|
+
message:(InfoMessage *)infoMessage {
|
|
41
|
+
self.infoMessage = infoMessage;
|
|
42
|
+
NSError *error = [UnviredError applicationErrorInClass:[self class] inSelector:_cmd withDescription:[self.infoMessage getMessage] andErrorCode:UnviredSQLError];
|
|
43
|
+
|
|
44
|
+
return [super initWithResponseCode:responseCode andError:error];
|
|
45
|
+
return NULL;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
49
|
+
andResponseBytes:(NSData *)responseBytes {
|
|
50
|
+
return [super initWithResponseCode:responseCode andResponseBytes:responseBytes];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
- (id)initWithResponseCode:(int)responseCode
|
|
54
|
+
responseBytes:(NSData *)responseBytes
|
|
55
|
+
autoSave:(BOOL)autosave {
|
|
56
|
+
self.autoSave = autosave;
|
|
57
|
+
return [super initWithResponseCode:responseCode andResponseBytes:responseBytes];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
- (InfoMessage *)getInfoMessage {
|
|
61
|
+
return self.infoMessage;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
- (BOOL)isAutoSave {
|
|
65
|
+
return self.autoSave;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@end
|