@igaworks/adbrix-react-native-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/CHANGELOG.md +31 -0
- package/LICENSE +20 -0
- package/README.md +16 -0
- package/adbrix-react-native-sdk.podspec +20 -0
- package/android/build.gradle +78 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/igaworks/adbrixreactnativesdk/AdbrixReactNativeParser.java +220 -0
- package/android/src/main/java/com/igaworks/adbrixreactnativesdk/AdbrixReactNativeSdkModule.java +166 -0
- package/android/src/main/java/com/igaworks/adbrixreactnativesdk/AdbrixReactNativeSdkPackage.java +29 -0
- package/babel.config.js +3 -0
- package/example/.bundle/config +2 -0
- package/example/.watchmanconfig +1 -0
- package/example/Gemfile +10 -0
- package/example/README.md +106 -0
- package/example/android/README.md +24 -0
- package/example/android/app/build.gradle +128 -0
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +10 -0
- package/example/android/app/src/debug/AndroidManifest.xml +9 -0
- package/example/android/app/src/main/AndroidManifest.xml +34 -0
- package/example/android/app/src/main/ic_launcher-playstore.png +0 -0
- package/example/android/app/src/main/java/igaworks/adbrixreactnativesdk/example/MainActivity.kt +28 -0
- package/example/android/app/src/main/java/igaworks/adbrixreactnativesdk/example/MainApplication.kt +44 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/example/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
- package/example/android/app/src/main/res/values/strings.xml +3 -0
- package/example/android/app/src/main/res/values/styles.xml +9 -0
- package/example/android/build.gradle +21 -0
- package/example/android/gradle.properties +39 -0
- package/example/android/settings.gradle +6 -0
- package/example/app.json +4 -0
- package/example/babel.config.js +4 -0
- package/example/index.js +5 -0
- package/example/ios/.xcode.env +11 -0
- package/example/ios/AdbrixReactNativeSdkExample/AppDelegate.swift +53 -0
- package/example/ios/AdbrixReactNativeSdkExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/example/ios/AdbrixReactNativeSdkExample/Images.xcassets/Contents.json +6 -0
- package/example/ios/AdbrixReactNativeSdkExample/Info.plist +62 -0
- package/example/ios/AdbrixReactNativeSdkExample/LaunchScreen.storyboard +47 -0
- package/example/ios/AdbrixReactNativeSdkExample/PrivacyInfo.xcprivacy +37 -0
- package/example/ios/AdbrixReactNativeSdkExample.xcodeproj/project.pbxproj +488 -0
- package/example/ios/AdbrixReactNativeSdkExample.xcodeproj/xcshareddata/xcschemes/AdbrixReactNativeSdkExample.xcscheme +88 -0
- package/example/ios/AdbrixReactNativeSdkExample.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/ios/Podfile +35 -0
- package/example/ios/Podfile.lock +1821 -0
- package/example/jest.config.js +3 -0
- package/example/metro.config.js +27 -0
- package/example/package.json +33 -0
- package/example/react-native.config.js +21 -0
- package/example/src/App.tsx +755 -0
- package/ios/AdbrixPropertiesParser.h +16 -0
- package/ios/AdbrixPropertiesParser.m +97 -0
- package/ios/AdbrixReactNative.swift +170 -0
- package/ios/AdbrixReactNativeSdk.h +11 -0
- package/ios/AdbrixReactNativeSdk.m +79 -0
- package/ios/AdbrixReactNativeSdk.xcodeproj/project.pbxproj +324 -0
- package/lib/commonjs/constants.js +174 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/index.d.js +6 -0
- package/lib/commonjs/index.d.js.map +1 -0
- package/lib/commonjs/index.js +155 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/properties.js +347 -0
- package/lib/commonjs/properties.js.map +1 -0
- package/lib/index.d.ts +312 -0
- package/lib/module/constants.js +170 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/index.d.js +4 -0
- package/lib/module/index.d.js.map +1 -0
- package/lib/module/index.js +121 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/properties.js +342 -0
- package/lib/module/properties.js.map +1 -0
- package/package.json +57 -0
- package/src/constants.js +175 -0
- package/src/index.d.ts +312 -0
- package/src/index.js +124 -0
- package/src/properties.js +275 -0
- package/tsconfig.json +29 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
|
|
2
|
+
class ItemBuilder {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.item = {};
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
productId(value) {
|
|
8
|
+
this.item['abx:product_id'] = { value, type: 'string' };
|
|
9
|
+
return this;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
productName(value) {
|
|
13
|
+
this.item['abx:product_name'] = { value, type: 'string' };
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
price(value) {
|
|
18
|
+
this.item['abx:price'] = { value, type: 'double' };
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
discount(value) {
|
|
23
|
+
this.item['abx:discount'] = { value, type: 'double' };
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
quantity(value) {
|
|
28
|
+
this.item['abx:quantity'] = { value, type: 'long' };
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
category1(value) {
|
|
33
|
+
this.item['abx:category1'] = { value, type: 'string' };
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
category2(value) {
|
|
38
|
+
this.item['abx:category2'] = { value, type: 'string' };
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
category3(value) {
|
|
43
|
+
this.item['abx:category3'] = { value, type: 'string' };
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
category4(value) {
|
|
48
|
+
this.item['abx:category4'] = { value, type: 'string' };
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
category5(value) {
|
|
53
|
+
this.item['abx:category5'] = { value, type: 'string' };
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
currency(value) {
|
|
58
|
+
this.item['abx:currency'] = { value, type: 'string' };
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
customString(key, value) {
|
|
63
|
+
this.item[key] = { value, type: 'string' };
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
customLong(key, value) {
|
|
68
|
+
this.item[key] = { value, type: 'long' };
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
customDouble(key, value) {
|
|
73
|
+
this.item[key] = { value, type: 'double' };
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
customBool(key, value) {
|
|
78
|
+
this.item[key] = { value, type: 'boolean' };
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
build() {
|
|
83
|
+
return this.item;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
class PropertiesBuilder {
|
|
88
|
+
constructor(initialProperties = {}) {
|
|
89
|
+
this.properties = { ...initialProperties };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
items(itemsInput) {
|
|
93
|
+
let itemsArray;
|
|
94
|
+
if (Array.isArray(itemsInput)) {
|
|
95
|
+
itemsArray = itemsInput;
|
|
96
|
+
} else if (itemsInput && typeof itemsInput === 'object') {
|
|
97
|
+
itemsArray = [itemsInput];
|
|
98
|
+
} else {
|
|
99
|
+
console.warn('[Properties] items() expects an array or single item object');
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
this.properties['abx:items'] = itemsArray;
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
orderId(value) {
|
|
108
|
+
this.properties['abx:order_id'] = { value, type: 'string' };
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
orderSales(value) {
|
|
113
|
+
this.properties['abx:order_sales'] = { value, type: 'double' };
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
deliveryCharge(value) {
|
|
118
|
+
this.properties['abx:delivery_charge'] = { value, type: 'double' };
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
penaltyCharge(value) {
|
|
123
|
+
this.properties['abx:penalty_charge'] = { value, type: 'double' };
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
paymentMethod(value) {
|
|
128
|
+
this.properties['abx:payment_method'] = { value, type: 'string' };
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
discount(value) {
|
|
133
|
+
this.properties['abx:discount'] = { value, type: 'double' };
|
|
134
|
+
return this;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
signChannel(value) {
|
|
138
|
+
this.properties['abx:sign_channel'] = { value, type: 'string' };
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
inviteChannel(value) {
|
|
143
|
+
this.properties['abx:invite_channel'] = { value, type: 'string' };
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
sharingChannel(value) {
|
|
148
|
+
this.properties['abx:sharing_channel'] = { value, type: 'string' };
|
|
149
|
+
return this;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
category1(value) {
|
|
153
|
+
this.properties['abx:category1'] = { value, type: 'string' };
|
|
154
|
+
return this;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
category2(value) {
|
|
158
|
+
this.properties['abx:category2'] = { value, type: 'string' };
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
category3(value) {
|
|
163
|
+
this.properties['abx:category3'] = { value, type: 'string' };
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
category4(value) {
|
|
168
|
+
this.properties['abx:category4'] = { value, type: 'string' };
|
|
169
|
+
return this;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
category5(value) {
|
|
173
|
+
this.properties['abx:category5'] = { value, type: 'string' };
|
|
174
|
+
return this;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
keyword(value) {
|
|
178
|
+
this.properties['abx:keyword'] = { value, type: 'string' };
|
|
179
|
+
return this;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
prevVer(value) {
|
|
183
|
+
this.properties['abx:prev_ver'] = { value, type: 'string' };
|
|
184
|
+
return this;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
currVer(value) {
|
|
188
|
+
this.properties['abx:curr_ver'] = { value, type: 'string' };
|
|
189
|
+
return this;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
level(value) {
|
|
193
|
+
this.properties['abx:level'] = { value, type: 'long' };
|
|
194
|
+
return this;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
stage(value) {
|
|
198
|
+
this.properties['abx:stage'] = { value, type: 'string' };
|
|
199
|
+
return this;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
isSkip(value) {
|
|
203
|
+
this.properties['abx:is_skip'] = { value, type: 'boolean' };
|
|
204
|
+
return this;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
customDouble(key, value) {
|
|
208
|
+
this.properties[key] = { value, type: 'double' };
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
customLong(key, value) {
|
|
213
|
+
this.properties[key] = { value, type: 'long' };
|
|
214
|
+
return this;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
customString(key, value) {
|
|
218
|
+
this.properties[key] = { value, type: 'string' };
|
|
219
|
+
return this;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
customBool(key, value) {
|
|
223
|
+
this.properties[key] = { value, type: 'boolean' };
|
|
224
|
+
return this;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
build() {
|
|
229
|
+
return this.properties;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const createBuilderMethod = (methodName) => {
|
|
234
|
+
return function(...args) {
|
|
235
|
+
const builder = new PropertiesBuilder();
|
|
236
|
+
return builder[methodName](...args);
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export const ABProperty = {
|
|
241
|
+
items: createBuilderMethod('items'),
|
|
242
|
+
orderId: createBuilderMethod('orderId'),
|
|
243
|
+
orderSales: createBuilderMethod('orderSales'),
|
|
244
|
+
deliveryCharge: createBuilderMethod('deliveryCharge'),
|
|
245
|
+
penaltyCharge: createBuilderMethod('penaltyCharge'),
|
|
246
|
+
paymentMethod: createBuilderMethod('paymentMethod'),
|
|
247
|
+
discount: createBuilderMethod('discount'),
|
|
248
|
+
|
|
249
|
+
signChannel: createBuilderMethod('signChannel'),
|
|
250
|
+
inviteChannel: createBuilderMethod('inviteChannel'),
|
|
251
|
+
sharingChannel: createBuilderMethod('sharingChannel'),
|
|
252
|
+
|
|
253
|
+
category1: createBuilderMethod('category1'),
|
|
254
|
+
category2: createBuilderMethod('category2'),
|
|
255
|
+
category3: createBuilderMethod('category3'),
|
|
256
|
+
category4: createBuilderMethod('category4'),
|
|
257
|
+
category5: createBuilderMethod('category5'),
|
|
258
|
+
keyword: createBuilderMethod('keyword'),
|
|
259
|
+
|
|
260
|
+
prevVer: createBuilderMethod('prevVer'),
|
|
261
|
+
currVer: createBuilderMethod('currVer'),
|
|
262
|
+
|
|
263
|
+
level: createBuilderMethod('level'),
|
|
264
|
+
stage: createBuilderMethod('stage'),
|
|
265
|
+
isSkip: createBuilderMethod('isSkip'),
|
|
266
|
+
|
|
267
|
+
customDouble: createBuilderMethod('customDouble'),
|
|
268
|
+
customLong: createBuilderMethod('customLong'),
|
|
269
|
+
customString: createBuilderMethod('customString'),
|
|
270
|
+
customBool: createBuilderMethod('customBool'),
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export const ABItem = () => new ItemBuilder();
|
|
274
|
+
|
|
275
|
+
export default ABProperty;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"rootDir": ".",
|
|
4
|
+
"paths": {
|
|
5
|
+
"@igaworks/adbrix-react-native-sdk": ["./src/index"]
|
|
6
|
+
},
|
|
7
|
+
"allowUnreachableCode": false,
|
|
8
|
+
"allowUnusedLabels": false,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"jsx": "react-jsx",
|
|
12
|
+
"lib": ["ESNext"],
|
|
13
|
+
"module": "ESNext",
|
|
14
|
+
"moduleResolution": "bundler",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noImplicitReturns": true,
|
|
18
|
+
"noImplicitUseStrict": false,
|
|
19
|
+
"noStrictGenericChecks": false,
|
|
20
|
+
"noUncheckedIndexedAccess": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"resolveJsonModule": true,
|
|
24
|
+
"skipLibCheck": true,
|
|
25
|
+
"strict": true,
|
|
26
|
+
"target": "ESNext",
|
|
27
|
+
"verbatimModuleSyntax": true
|
|
28
|
+
}
|
|
29
|
+
}
|