@pensasystems/pensa-react-native 0.1.0-beta-4 → 0.1.0-beta-6
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.
|
@@ -143,8 +143,8 @@ class PensaSdkReactNative: NSObject {
|
|
|
143
143
|
// metadata
|
|
144
144
|
if let metadata = status.metadata {
|
|
145
145
|
dict["metadata"] = [
|
|
146
|
-
"guid": metadata.guid ?? NSNull(),
|
|
147
|
-
"serverUploadStarted": metadata.serverUploadStarted ?? NSNull()
|
|
146
|
+
"guid": (metadata.guid as Any?) ?? NSNull(),
|
|
147
|
+
"serverUploadStarted": (metadata.serverUploadStarted as Any?) ?? NSNull()
|
|
148
148
|
]
|
|
149
149
|
} else {
|
|
150
150
|
dict["metadata"] = NSNull()
|
|
@@ -161,59 +161,60 @@ class PensaSdkReactNative: NSObject {
|
|
|
161
161
|
)
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
164
|
+
@objc(fetchOnDemandReports:projectId:withResolver:withRejecter:)
|
|
165
|
+
func fetchOnDemandReports(
|
|
166
|
+
scanId: NSNumber,
|
|
167
|
+
projectId: NSNumber?,
|
|
168
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
169
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
170
|
+
) {
|
|
171
|
+
|
|
172
|
+
Pensa.shared.fetchOnDemandReports(
|
|
173
|
+
scanId: scanId.intValue,
|
|
174
|
+
projectId: projectId?.intValue,
|
|
175
|
+
onSuccess: { report in
|
|
176
|
+
|
|
177
|
+
func rn(_ value: Any?) -> Any { value ?? NSNull() }
|
|
178
|
+
|
|
179
|
+
var result: [String: Any] = [
|
|
180
|
+
"shelfId": rn(report.shelfId),
|
|
181
|
+
"shelfName": rn(report.shelfName),
|
|
182
|
+
"projectId": rn(report.projectId),
|
|
183
|
+
"projectName": rn(report.projectName),
|
|
184
|
+
"projectReportId": rn(report.projectReportId),
|
|
185
|
+
"projectReportName": rn(report.projectReportName)
|
|
186
|
+
]
|
|
187
|
+
|
|
188
|
+
if let bucket = report.facingsSeen?.report {
|
|
189
|
+
let products: [[String: Any]] = bucket.productList.map { product in
|
|
190
|
+
return [
|
|
191
|
+
"brand": rn(product.brand),
|
|
192
|
+
"brandId": rn(product.brandId),
|
|
193
|
+
"category": rn(product.category),
|
|
194
|
+
"categoryId": rn(product.categoryId),
|
|
195
|
+
"facings": rn(product.facings),
|
|
196
|
+
"manufacturer": rn(product.manufacturer),
|
|
197
|
+
"manufacturerId": rn(product.manufacturerId),
|
|
198
|
+
"product": rn(product.product),
|
|
199
|
+
"productId": rn(product.productId),
|
|
200
|
+
"upc": rn(product.upc)
|
|
201
|
+
]
|
|
202
|
+
}
|
|
201
203
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
result["shelfName"] = report.shelfName ?? NSNull()
|
|
204
|
+
result["facingsSeen"] = [
|
|
205
|
+
"productList": products
|
|
206
|
+
]
|
|
207
|
+
} else {
|
|
208
|
+
result["facingsSeen"] = NSNull()
|
|
209
|
+
}
|
|
209
210
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
)
|
|
211
|
+
resolve(result)
|
|
212
|
+
},
|
|
213
|
+
onError: { error in
|
|
214
|
+
reject("FETCH_ON_DEMAND_REPORTS_FAILED", error.localizedDescription, error)
|
|
216
215
|
}
|
|
216
|
+
)
|
|
217
|
+
}
|
|
217
218
|
|
|
218
219
|
@objc(fetchProductImageBase64:withResolver:withRejecter:)
|
|
219
220
|
func fetchProductImageBase64(productId: NSNumber,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pensasystems/pensa-react-native",
|
|
3
|
-
"version": "0.1.0-beta-
|
|
3
|
+
"version": "0.1.0-beta-6",
|
|
4
4
|
"description": "The Pensa Mobile App SDK is a developer toolkit designed to simplify adding Pensa’s capabilities to your mobile applications. It provides pre-built libraries, tools, and APIs to accelerate development and integration, offering streamlined SDK integration, easy initialization, and comprehensive functionality. With the Pensa SDK, you can enhance your app’s features or seamlessly integrate with other services for a cohesive user experience.",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/module/index.js",
|