@doorstepai/dropoff-sdk 2.0.2 → 2.0.3
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/android/build.gradle +1 -1
- package/android/src/main/java/com/doorstepai/dropoffsdk/DoorstepAIModule.kt +16 -3
- package/ios/DoorstepAI.mm +2 -0
- package/ios/DoorstepAI.swift +15 -1
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Info.plist +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.abi.json +931 -416
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +17 -19
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.swiftinterface +17 -19
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/PrivacyInfo.xcprivacy +39 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/_CodeSignature/CodeResources +22 -11
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/DWARF/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/DoorstepDropoffSDK.yml +1583 -1462
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Info.plist +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +931 -416
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +17 -19
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +17 -19
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +931 -416
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +17 -19
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +17 -19
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/PrivacyInfo.xcprivacy +39 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/_CodeSignature/CodeResources +32 -21
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/DWARF/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/DoorstepDropoffSDK.yml +1583 -1462
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/DoorstepDropoffSDK.yml +1578 -1457
- package/lib/module/DoorstepAI.js +5 -12
- package/lib/module/DoorstepAI.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/DoorstepAI.d.ts +7 -2
- package/lib/typescript/src/DoorstepAI.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/DoorstepAI.tsx +13 -9
- package/src/index.tsx +1 -0
package/lib/module/DoorstepAI.js
CHANGED
|
@@ -48,11 +48,9 @@ class DoorstepAIModule {
|
|
|
48
48
|
throw error;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
// Add deliveryId parameter and handle platform difference
|
|
53
|
-
static async startDeliveryByAddress(address, deliveryId, timeoutSeconds) {
|
|
51
|
+
static async startDeliveryByAddress(address, deliveryId, timeoutSeconds, coordinates) {
|
|
54
52
|
try {
|
|
55
|
-
let result = await DoorstepAI.startDeliveryByAddress(address, deliveryId, timeoutSeconds ?? 7200);
|
|
53
|
+
let result = await DoorstepAI.startDeliveryByAddress(address, deliveryId, coordinates ?? null, timeoutSeconds ?? 7200);
|
|
56
54
|
console.log('DOORSTEPAI - Delivery started successfully by Address:', address, deliveryId);
|
|
57
55
|
return result;
|
|
58
56
|
} catch (error) {
|
|
@@ -60,9 +58,9 @@ class DoorstepAIModule {
|
|
|
60
58
|
throw error;
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
|
-
static async startDeliveryByAddressString(address, deliveryId, timeoutSeconds) {
|
|
61
|
+
static async startDeliveryByAddressString(address, deliveryId, timeoutSeconds, coordinates) {
|
|
64
62
|
try {
|
|
65
|
-
const result = await DoorstepAI.startDeliveryByAddressString(address, deliveryId, timeoutSeconds ?? 7200);
|
|
63
|
+
const result = await DoorstepAI.startDeliveryByAddressString(address, deliveryId, coordinates ?? null, timeoutSeconds ?? 7200);
|
|
66
64
|
console.log('DOORSTEPAI - Delivery started successfully by Address String:', address, deliveryId);
|
|
67
65
|
return result;
|
|
68
66
|
} catch (error) {
|
|
@@ -82,12 +80,7 @@ class DoorstepAIModule {
|
|
|
82
80
|
}
|
|
83
81
|
static async markDropoff(deliveryId, dropoffType) {
|
|
84
82
|
try {
|
|
85
|
-
|
|
86
|
-
const androidDropoffType = dropoffType === 'pod' ? 'POD' : 'NON_POD';
|
|
87
|
-
await DoorstepAI.markDropoff(deliveryId, androidDropoffType);
|
|
88
|
-
} else {
|
|
89
|
-
await DoorstepAI.markDropoff(deliveryId, dropoffType);
|
|
90
|
-
}
|
|
83
|
+
await DoorstepAI.markDropoff(deliveryId, dropoffType);
|
|
91
84
|
console.log('DOORSTEPAI - Dropoff marked successfully:', deliveryId, dropoffType);
|
|
92
85
|
} catch (error) {
|
|
93
86
|
console.error('DOORSTEPAI - Failed to mark dropoff:', deliveryId, dropoffType, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","DoorstepAI","DoorstepAIModule","isInitialized","init","notificationTitle","notificationText","OS","console","log","error","setApiKey","apiKey","startDeliveryByPlaceID","placeID","deliveryId","timeoutSeconds","result","startDeliveryByPlusCode","plusCode","startDeliveryByAddress","address","startDeliveryByAddressString","startDeliveryByLatLng","latitude","longitude","subUnit","markDropoff","dropoffType","
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","DoorstepAI","DoorstepAIModule","isInitialized","init","notificationTitle","notificationText","OS","console","log","error","setApiKey","apiKey","startDeliveryByPlaceID","placeID","deliveryId","timeoutSeconds","result","startDeliveryByPlusCode","plusCode","startDeliveryByAddress","address","coordinates","startDeliveryByAddressString","startDeliveryByLatLng","latitude","longitude","subUnit","markDropoff","dropoffType","stopDelivery","newEvent","eventName"],"sourceRoot":"../../src","sources":["DoorstepAI.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,MAAM;EAAEC;AAAW,CAAC,GAAGF,aAAa;AAgBpC,MAAMG,gBAAgB,CAAC;EACrB,OAAOC,aAAa,GAAG,KAAK;EAG5B,aAAaC,IAAIA,CACfC,iBAA0B,EAC1BC,gBAAyB,EACV;IACf,IAAIN,QAAQ,CAACO,EAAE,KAAK,SAAS,EAAE;MAC7B,IAAI,IAAI,CAACJ,aAAa,EAAE;QACtB;MACF;MACA,IAAI;QACF,MAAMF,UAAU,CAACG,IAAI,CAACC,iBAAiB,EAAEC,gBAAgB,CAAC;QAC1DE,OAAO,CAACC,GAAG,CAAC,qCAAqC,CAAC;QAClD,IAAI,CAACN,aAAa,GAAG,IAAI,CAAC,CAAC;MAC7B,CAAC,CAAC,OAAOO,KAAK,EAAE;QACdF,OAAO,CAACE,KAAK,CAAC,+CAA+C,EAAEA,KAAK,CAAC;QACrE,MAAMA,KAAK;MACb;IACF,CAAC,CAAC;EACJ;EAEA,OAAOC,SAASA,CAACC,MAAc,EAAE;IAC/BX,UAAU,CAACU,SAAS,CAACC,MAAM,CAAC;EAC9B;;EAEA;EACA,aAAaC,sBAAsBA,CACjCC,OAAe,EACfC,UAAkB,EAClBC,cAAuB,EACvB;IACA,IAAI;MACF,MAAMC,MAAM,GAAG,MAAMhB,UAAU,CAACY,sBA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EA;EACA,aAAaoB,YAAYA,CAACf,UAAkB,EAAE;IAC5C,IAAI;MACF,MAAMd,UAAU,CAAC6B,YAAY,CAACf,UAAU,CAAC;MACzCP,OAAO,CAACC,GAAG,CAAC,4CAA4C,CAAC;IAC3D,CAAC,CAAC,OAAOC,KAAU,EAAE;MACnBF,OAAO,CAACE,KAAK,CAAC,uCAAuC,EAAEA,KAAK,CAAC;MAC7D,MAAMA,KAAK;IACb;EACF;;EAEA;EACA,aAAaqB,QAAQA,CAACC,SAAiB,EAAEjB,UAAkB,EAAE;IAC3D,IAAI;MACF,MAAME,MAAM,GAAG,MAAMhB,UAAU,CAAC8B,QAAQ,CAACC,SAAS,EAAEjB,UAAU,CAAC;MAC/DP,OAAO,CAACC,GAAG,CAAC,uCAAuC,EAAEQ,MAAM,CAAC;MAC5D,OAAOA,MAAM;IACf,CAAC,CAAC,OAAOP,KAAU,EAAE;MACnBF,OAAO,CAACE,KAAK,CAAC,oCAAoC,EAAEsB,SAAS,EAAEjB,UAAU,EAAEL,KAAK,CAAC;MACjF,MAAMA,KAAK;IACb;EACF;AAEF;AAEA,SAASR,gBAAgB,IAAID,UAAU","ignoreList":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RootDoorstepAI","DoorstepAI"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,qBAAkB;AACjD,SAASC,UAAU,QAAQ,iBAAc;
|
|
1
|
+
{"version":3,"names":["RootDoorstepAI","DoorstepAI"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,qBAAkB;AACjD,SAASC,UAAU,QAAQ,iBAAc;AAGzC,SAASA,UAAU,EAAED,cAAc","ignoreList":[]}
|
|
@@ -6,18 +6,23 @@ type AddressType = {
|
|
|
6
6
|
administrativeAreaLevel1: string;
|
|
7
7
|
postalCode: string;
|
|
8
8
|
};
|
|
9
|
+
type LatLngObject = {
|
|
10
|
+
lat: number;
|
|
11
|
+
lng: number;
|
|
12
|
+
};
|
|
9
13
|
declare class DoorstepAIModule {
|
|
10
14
|
static isInitialized: boolean;
|
|
11
15
|
static init(notificationTitle?: string, notificationText?: string): Promise<void>;
|
|
12
16
|
static setApiKey(apiKey: string): void;
|
|
13
17
|
static startDeliveryByPlaceID(placeID: string, deliveryId: string, timeoutSeconds?: number): Promise<any>;
|
|
14
18
|
static startDeliveryByPlusCode(plusCode: string, deliveryId: string, timeoutSeconds?: number): Promise<any>;
|
|
15
|
-
static startDeliveryByAddress(address: AddressType, deliveryId: string, timeoutSeconds?: number): Promise<any>;
|
|
16
|
-
static startDeliveryByAddressString(address: string, deliveryId: string, timeoutSeconds?: number): Promise<any>;
|
|
19
|
+
static startDeliveryByAddress(address: AddressType, deliveryId: string, timeoutSeconds?: number, coordinates?: LatLngObject): Promise<any>;
|
|
20
|
+
static startDeliveryByAddressString(address: string, deliveryId: string, timeoutSeconds?: number, coordinates?: LatLngObject): Promise<any>;
|
|
17
21
|
static startDeliveryByLatLng(latitude: number, longitude: number, subUnit: string, deliveryId: string, timeoutSeconds?: number): Promise<any>;
|
|
18
22
|
static markDropoff(deliveryId: string, dropoffType: 'pod' | 'non_pod'): Promise<void>;
|
|
19
23
|
static stopDelivery(deliveryId: string): Promise<void>;
|
|
20
24
|
static newEvent(eventName: string, deliveryId: string): Promise<any>;
|
|
21
25
|
}
|
|
22
26
|
export { DoorstepAIModule as DoorstepAI };
|
|
27
|
+
export type { AddressType, LatLngObject };
|
|
23
28
|
//# sourceMappingURL=DoorstepAI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoorstepAI.d.ts","sourceRoot":"","sources":["../../../src/DoorstepAI.tsx"],"names":[],"mappings":"AAGA,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,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Q,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM;WAgBZ,sBAAsB,CACjC,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,YAAY;WAiBf,4BAA4B,CACvC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,YAAY;WAkBf,qBAAqB,CAChC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM;WAwBZ,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,GAAG,SAAS;WAW9D,YAAY,CAAC,UAAU,EAAE,MAAM;WAW/B,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAW5D;AAED,OAAO,EAAE,gBAAgB,IAAI,UAAU,EAAE,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/DoorstepAI.tsx
CHANGED
|
@@ -10,6 +10,11 @@ type AddressType = {
|
|
|
10
10
|
postalCode: string;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
type LatLngObject = {
|
|
14
|
+
lat: number;
|
|
15
|
+
lng: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
13
18
|
class DoorstepAIModule {
|
|
14
19
|
static isInitialized = false;
|
|
15
20
|
|
|
@@ -77,16 +82,17 @@ class DoorstepAIModule {
|
|
|
77
82
|
}
|
|
78
83
|
}
|
|
79
84
|
|
|
80
|
-
// Add deliveryId parameter and handle platform difference
|
|
81
85
|
static async startDeliveryByAddress(
|
|
82
86
|
address: AddressType,
|
|
83
87
|
deliveryId: string,
|
|
84
|
-
timeoutSeconds?: number
|
|
88
|
+
timeoutSeconds?: number,
|
|
89
|
+
coordinates?: LatLngObject
|
|
85
90
|
) {
|
|
86
91
|
try {
|
|
87
92
|
let result = await DoorstepAI.startDeliveryByAddress(
|
|
88
93
|
address,
|
|
89
94
|
deliveryId,
|
|
95
|
+
coordinates ?? null,
|
|
90
96
|
timeoutSeconds ?? 7200
|
|
91
97
|
);
|
|
92
98
|
console.log('DOORSTEPAI - Delivery started successfully by Address:', address, deliveryId);
|
|
@@ -100,12 +106,14 @@ class DoorstepAIModule {
|
|
|
100
106
|
static async startDeliveryByAddressString(
|
|
101
107
|
address: string,
|
|
102
108
|
deliveryId: string,
|
|
103
|
-
timeoutSeconds?: number
|
|
109
|
+
timeoutSeconds?: number,
|
|
110
|
+
coordinates?: LatLngObject
|
|
104
111
|
) {
|
|
105
112
|
try {
|
|
106
113
|
const result = await DoorstepAI.startDeliveryByAddressString(
|
|
107
114
|
address,
|
|
108
115
|
deliveryId,
|
|
116
|
+
coordinates ?? null,
|
|
109
117
|
timeoutSeconds ?? 7200
|
|
110
118
|
);
|
|
111
119
|
console.log('DOORSTEPAI - Delivery started successfully by Address String:', address, deliveryId);
|
|
@@ -148,12 +156,7 @@ class DoorstepAIModule {
|
|
|
148
156
|
|
|
149
157
|
static async markDropoff(deliveryId: string, dropoffType: 'pod' | 'non_pod') {
|
|
150
158
|
try {
|
|
151
|
-
|
|
152
|
-
const androidDropoffType = dropoffType === 'pod' ? 'POD' : 'NON_POD';
|
|
153
|
-
await DoorstepAI.markDropoff(deliveryId, androidDropoffType);
|
|
154
|
-
} else {
|
|
155
|
-
await DoorstepAI.markDropoff(deliveryId, dropoffType);
|
|
156
|
-
}
|
|
159
|
+
await DoorstepAI.markDropoff(deliveryId, dropoffType);
|
|
157
160
|
console.log('DOORSTEPAI - Dropoff marked successfully:', deliveryId, dropoffType);
|
|
158
161
|
} catch (error: any) {
|
|
159
162
|
console.error('DOORSTEPAI - Failed to mark dropoff:', deliveryId, dropoffType, error);
|
|
@@ -187,3 +190,4 @@ class DoorstepAIModule {
|
|
|
187
190
|
}
|
|
188
191
|
|
|
189
192
|
export { DoorstepAIModule as DoorstepAI };
|
|
193
|
+
export type { AddressType, LatLngObject };
|