mobilyflow-react-native-sdk 0.1.0-alpha.2 → 0.1.0-alpha.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/lib/commonjs/MobilyPurchaseSDK.js +158 -0
- package/lib/commonjs/MobilyPurchaseSDK.js.map +1 -0
- package/lib/commonjs/NativeMobilyflowReactNativeSdk.js +9 -0
- package/lib/commonjs/NativeMobilyflowReactNativeSdk.js.map +1 -0
- package/lib/commonjs/entities/mobily-customer-entitlement.js +30 -0
- package/lib/commonjs/entities/mobily-customer-entitlement.js.map +1 -0
- package/lib/commonjs/entities/mobily-one-time-product.js +9 -0
- package/lib/commonjs/entities/mobily-one-time-product.js.map +1 -0
- package/lib/commonjs/entities/mobily-product.js +16 -0
- package/lib/commonjs/entities/mobily-product.js.map +1 -0
- package/lib/commonjs/entities/mobily-subscription-group.js +19 -0
- package/lib/commonjs/entities/mobily-subscription-group.js.map +1 -0
- package/lib/commonjs/entities/mobily-subscription-offer.js +9 -0
- package/lib/commonjs/entities/mobily-subscription-offer.js.map +1 -0
- package/lib/commonjs/entities/mobily-subscription-product.js +9 -0
- package/lib/commonjs/entities/mobily-subscription-product.js.map +1 -0
- package/lib/commonjs/enums/mobily-environment.js +13 -0
- package/lib/commonjs/enums/mobily-environment.js.map +1 -0
- package/lib/commonjs/enums/period-unit.js +13 -0
- package/lib/commonjs/enums/period-unit.js.map +1 -0
- package/lib/commonjs/enums/platform.js +12 -0
- package/lib/commonjs/enums/platform.js.map +1 -0
- package/lib/commonjs/enums/product-status.js +13 -0
- package/lib/commonjs/enums/product-status.js.map +1 -0
- package/lib/commonjs/enums/product-type.js +12 -0
- package/lib/commonjs/enums/product-type.js.map +1 -0
- package/lib/commonjs/enums/webhook-status.js +13 -0
- package/lib/commonjs/enums/webhook-status.js.map +1 -0
- package/lib/commonjs/errors/mobily-error.js +26 -0
- package/lib/commonjs/errors/mobily-error.js.map +1 -0
- package/lib/commonjs/errors/mobily-purchase-error.js +34 -0
- package/lib/commonjs/errors/mobily-purchase-error.js.map +1 -0
- package/lib/commonjs/errors/mobily-transfer-ownership-error.js +27 -0
- package/lib/commonjs/errors/mobily-transfer-ownership-error.js.map +1 -0
- package/lib/commonjs/index.js +130 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/utils/object-transformer.js +59 -0
- package/lib/commonjs/utils/object-transformer.js.map +1 -0
- package/lib/module/MobilyPurchaseSDK.js +152 -0
- package/lib/module/MobilyPurchaseSDK.js.map +1 -0
- package/lib/module/NativeMobilyflowReactNativeSdk.js +5 -0
- package/lib/module/NativeMobilyflowReactNativeSdk.js.map +1 -0
- package/lib/module/entities/mobily-customer-entitlement.js +23 -0
- package/lib/module/entities/mobily-customer-entitlement.js.map +1 -0
- package/lib/module/entities/mobily-one-time-product.js +4 -0
- package/lib/module/entities/mobily-one-time-product.js.map +1 -0
- package/lib/module/entities/mobily-product.js +11 -0
- package/lib/module/entities/mobily-product.js.map +1 -0
- package/lib/module/entities/mobily-subscription-group.js +14 -0
- package/lib/module/entities/mobily-subscription-group.js.map +1 -0
- package/lib/module/entities/mobily-subscription-offer.js +4 -0
- package/lib/module/entities/mobily-subscription-offer.js.map +1 -0
- package/lib/module/entities/mobily-subscription-product.js +4 -0
- package/lib/module/entities/mobily-subscription-product.js.map +1 -0
- package/lib/module/enums/mobily-environment.js +9 -0
- package/lib/module/enums/mobily-environment.js.map +1 -0
- package/lib/module/enums/period-unit.js +9 -0
- package/lib/module/enums/period-unit.js.map +1 -0
- package/lib/module/enums/platform.js +8 -0
- package/lib/module/enums/platform.js.map +1 -0
- package/lib/module/enums/product-status.js +9 -0
- package/lib/module/enums/product-status.js.map +1 -0
- package/lib/module/enums/product-type.js +8 -0
- package/lib/module/enums/product-type.js.map +1 -0
- package/lib/module/enums/webhook-status.js +9 -0
- package/lib/module/enums/webhook-status.js.map +1 -0
- package/lib/module/errors/mobily-error.js +21 -0
- package/lib/module/errors/mobily-error.js.map +1 -0
- package/lib/module/errors/mobily-purchase-error.js +29 -0
- package/lib/module/errors/mobily-purchase-error.js.map +1 -0
- package/lib/module/errors/mobily-transfer-ownership-error.js +22 -0
- package/lib/module/errors/mobily-transfer-ownership-error.js.map +1 -0
- package/lib/module/index.js +19 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/utils/object-transformer.js +54 -0
- package/lib/module/utils/object-transformer.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/MobilyPurchaseSDK.d.ts +30 -0
- package/lib/typescript/commonjs/src/MobilyPurchaseSDK.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NativeMobilyflowReactNativeSdk.d.ts +34 -0
- package/lib/typescript/commonjs/src/NativeMobilyflowReactNativeSdk.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/entities/mobily-customer-entitlement.d.ts +23 -0
- package/lib/typescript/commonjs/src/entities/mobily-customer-entitlement.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/entities/mobily-one-time-product.d.ts +11 -0
- package/lib/typescript/commonjs/src/entities/mobily-one-time-product.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/entities/mobily-product.d.ts +23 -0
- package/lib/typescript/commonjs/src/entities/mobily-product.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/entities/mobily-subscription-group.d.ts +12 -0
- package/lib/typescript/commonjs/src/entities/mobily-subscription-group.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/entities/mobily-subscription-offer.d.ts +16 -0
- package/lib/typescript/commonjs/src/entities/mobily-subscription-offer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/entities/mobily-subscription-product.d.ts +13 -0
- package/lib/typescript/commonjs/src/entities/mobily-subscription-product.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/mobily-environment.d.ts +6 -0
- package/lib/typescript/commonjs/src/enums/mobily-environment.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/period-unit.d.ts +6 -0
- package/lib/typescript/commonjs/src/enums/period-unit.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/platform.d.ts +5 -0
- package/lib/typescript/commonjs/src/enums/platform.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/product-status.d.ts +6 -0
- package/lib/typescript/commonjs/src/enums/product-status.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/product-type.d.ts +5 -0
- package/lib/typescript/commonjs/src/enums/product-type.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/enums/webhook-status.d.ts +6 -0
- package/lib/typescript/commonjs/src/enums/webhook-status.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/errors/mobily-error.d.ts +15 -0
- package/lib/typescript/commonjs/src/errors/mobily-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/errors/mobily-purchase-error.d.ts +23 -0
- package/lib/typescript/commonjs/src/errors/mobily-purchase-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/errors/mobily-transfer-ownership-error.d.ts +16 -0
- package/lib/typescript/commonjs/src/errors/mobily-transfer-ownership-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +18 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/object-transformer.d.ts +37 -0
- package/lib/typescript/commonjs/src/utils/object-transformer.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/MobilyPurchaseSDK.d.ts +30 -0
- package/lib/typescript/module/src/MobilyPurchaseSDK.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeMobilyflowReactNativeSdk.d.ts +34 -0
- package/lib/typescript/module/src/NativeMobilyflowReactNativeSdk.d.ts.map +1 -0
- package/lib/typescript/module/src/entities/mobily-customer-entitlement.d.ts +23 -0
- package/lib/typescript/module/src/entities/mobily-customer-entitlement.d.ts.map +1 -0
- package/lib/typescript/module/src/entities/mobily-one-time-product.d.ts +11 -0
- package/lib/typescript/module/src/entities/mobily-one-time-product.d.ts.map +1 -0
- package/lib/typescript/module/src/entities/mobily-product.d.ts +23 -0
- package/lib/typescript/module/src/entities/mobily-product.d.ts.map +1 -0
- package/lib/typescript/module/src/entities/mobily-subscription-group.d.ts +12 -0
- package/lib/typescript/module/src/entities/mobily-subscription-group.d.ts.map +1 -0
- package/lib/typescript/module/src/entities/mobily-subscription-offer.d.ts +16 -0
- package/lib/typescript/module/src/entities/mobily-subscription-offer.d.ts.map +1 -0
- package/lib/typescript/module/src/entities/mobily-subscription-product.d.ts +13 -0
- package/lib/typescript/module/src/entities/mobily-subscription-product.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/mobily-environment.d.ts +6 -0
- package/lib/typescript/module/src/enums/mobily-environment.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/period-unit.d.ts +6 -0
- package/lib/typescript/module/src/enums/period-unit.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/platform.d.ts +5 -0
- package/lib/typescript/module/src/enums/platform.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/product-status.d.ts +6 -0
- package/lib/typescript/module/src/enums/product-status.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/product-type.d.ts +5 -0
- package/lib/typescript/module/src/enums/product-type.d.ts.map +1 -0
- package/lib/typescript/module/src/enums/webhook-status.d.ts +6 -0
- package/lib/typescript/module/src/enums/webhook-status.d.ts.map +1 -0
- package/lib/typescript/module/src/errors/mobily-error.d.ts +15 -0
- package/lib/typescript/module/src/errors/mobily-error.d.ts.map +1 -0
- package/lib/typescript/module/src/errors/mobily-purchase-error.d.ts +23 -0
- package/lib/typescript/module/src/errors/mobily-purchase-error.d.ts.map +1 -0
- package/lib/typescript/module/src/errors/mobily-transfer-ownership-error.d.ts +16 -0
- package/lib/typescript/module/src/errors/mobily-transfer-ownership-error.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +18 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/object-transformer.d.ts +37 -0
- package/lib/typescript/module/src/utils/object-transformer.d.ts.map +1 -0
- package/package.json +2 -2
@@ -0,0 +1,130 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "ItemEntitlement", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _mobilyCustomerEntitlement.ItemEntitlement;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "MobilyCustomerEntitlement", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function () {
|
15
|
+
return _mobilyCustomerEntitlement.MobilyCustomerEntitlement;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
Object.defineProperty(exports, "MobilyEnvironment", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function () {
|
21
|
+
return _mobilyEnvironment.MobilyEnvironment;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
Object.defineProperty(exports, "MobilyError", {
|
25
|
+
enumerable: true,
|
26
|
+
get: function () {
|
27
|
+
return _mobilyError.MobilyError;
|
28
|
+
}
|
29
|
+
});
|
30
|
+
Object.defineProperty(exports, "MobilyOneTimeProduct", {
|
31
|
+
enumerable: true,
|
32
|
+
get: function () {
|
33
|
+
return _mobilyOneTimeProduct.MobilyOneTimeProduct;
|
34
|
+
}
|
35
|
+
});
|
36
|
+
Object.defineProperty(exports, "MobilyProduct", {
|
37
|
+
enumerable: true,
|
38
|
+
get: function () {
|
39
|
+
return _mobilyProduct.MobilyProduct;
|
40
|
+
}
|
41
|
+
});
|
42
|
+
Object.defineProperty(exports, "MobilyPurchaseError", {
|
43
|
+
enumerable: true,
|
44
|
+
get: function () {
|
45
|
+
return _mobilyPurchaseError.MobilyPurchaseError;
|
46
|
+
}
|
47
|
+
});
|
48
|
+
Object.defineProperty(exports, "MobilyPurchaseSDK", {
|
49
|
+
enumerable: true,
|
50
|
+
get: function () {
|
51
|
+
return _MobilyPurchaseSDK.MobilyPurchaseSDK;
|
52
|
+
}
|
53
|
+
});
|
54
|
+
Object.defineProperty(exports, "MobilySubscriptionGroup", {
|
55
|
+
enumerable: true,
|
56
|
+
get: function () {
|
57
|
+
return _mobilySubscriptionGroup.MobilySubscriptionGroup;
|
58
|
+
}
|
59
|
+
});
|
60
|
+
Object.defineProperty(exports, "MobilySubscriptionOffer", {
|
61
|
+
enumerable: true,
|
62
|
+
get: function () {
|
63
|
+
return _mobilySubscriptionOffer.MobilySubscriptionOffer;
|
64
|
+
}
|
65
|
+
});
|
66
|
+
Object.defineProperty(exports, "MobilySubscriptionProduct", {
|
67
|
+
enumerable: true,
|
68
|
+
get: function () {
|
69
|
+
return _mobilySubscriptionProduct.MobilySubscriptionProduct;
|
70
|
+
}
|
71
|
+
});
|
72
|
+
Object.defineProperty(exports, "MobilyTransferOwnershipError", {
|
73
|
+
enumerable: true,
|
74
|
+
get: function () {
|
75
|
+
return _mobilyTransferOwnershipError.MobilyTransferOwnershipError;
|
76
|
+
}
|
77
|
+
});
|
78
|
+
Object.defineProperty(exports, "PeriodUnit", {
|
79
|
+
enumerable: true,
|
80
|
+
get: function () {
|
81
|
+
return _periodUnit.PeriodUnit;
|
82
|
+
}
|
83
|
+
});
|
84
|
+
Object.defineProperty(exports, "Platform", {
|
85
|
+
enumerable: true,
|
86
|
+
get: function () {
|
87
|
+
return _platform.Platform;
|
88
|
+
}
|
89
|
+
});
|
90
|
+
Object.defineProperty(exports, "ProductStatus", {
|
91
|
+
enumerable: true,
|
92
|
+
get: function () {
|
93
|
+
return _productStatus.ProductStatus;
|
94
|
+
}
|
95
|
+
});
|
96
|
+
Object.defineProperty(exports, "ProductType", {
|
97
|
+
enumerable: true,
|
98
|
+
get: function () {
|
99
|
+
return _productType.ProductType;
|
100
|
+
}
|
101
|
+
});
|
102
|
+
Object.defineProperty(exports, "SubscriptionEntitlement", {
|
103
|
+
enumerable: true,
|
104
|
+
get: function () {
|
105
|
+
return _mobilyCustomerEntitlement.SubscriptionEntitlement;
|
106
|
+
}
|
107
|
+
});
|
108
|
+
Object.defineProperty(exports, "WebhookStatus", {
|
109
|
+
enumerable: true,
|
110
|
+
get: function () {
|
111
|
+
return _webhookStatus.WebhookStatus;
|
112
|
+
}
|
113
|
+
});
|
114
|
+
var _MobilyPurchaseSDK = require("./MobilyPurchaseSDK.js");
|
115
|
+
var _mobilyProduct = require("./entities/mobily-product.js");
|
116
|
+
var _mobilyCustomerEntitlement = require("./entities/mobily-customer-entitlement.js");
|
117
|
+
var _mobilyOneTimeProduct = require("./entities/mobily-one-time-product.js");
|
118
|
+
var _mobilySubscriptionProduct = require("./entities/mobily-subscription-product.js");
|
119
|
+
var _mobilySubscriptionGroup = require("./entities/mobily-subscription-group.js");
|
120
|
+
var _mobilySubscriptionOffer = require("./entities/mobily-subscription-offer.js");
|
121
|
+
var _mobilyEnvironment = require("./enums/mobily-environment.js");
|
122
|
+
var _periodUnit = require("./enums/period-unit.js");
|
123
|
+
var _platform = require("./enums/platform.js");
|
124
|
+
var _productStatus = require("./enums/product-status.js");
|
125
|
+
var _productType = require("./enums/product-type.js");
|
126
|
+
var _webhookStatus = require("./enums/webhook-status.js");
|
127
|
+
var _mobilyError = require("./errors/mobily-error.js");
|
128
|
+
var _mobilyPurchaseError = require("./errors/mobily-purchase-error.js");
|
129
|
+
var _mobilyTransferOwnershipError = require("./errors/mobily-transfer-ownership-error.js");
|
130
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_MobilyPurchaseSDK","require","_mobilyProduct","_mobilyCustomerEntitlement","_mobilyOneTimeProduct","_mobilySubscriptionProduct","_mobilySubscriptionGroup","_mobilySubscriptionOffer","_mobilyEnvironment","_periodUnit","_platform","_productStatus","_productType","_webhookStatus","_mobilyError","_mobilyPurchaseError","_mobilyTransferOwnershipError"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAKA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,wBAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AAEA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AAEA,IAAAa,YAAA,GAAAb,OAAA;AACA,IAAAc,oBAAA,GAAAd,OAAA;AACA,IAAAe,6BAAA,GAAAf,OAAA","ignoreList":[]}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.objectTransformer = void 0;
|
7
|
+
/**
|
8
|
+
* Transform object following the transformer.
|
9
|
+
* Note: The function is safe, take care of the real type of each field and perform null checks.
|
10
|
+
*
|
11
|
+
* ```
|
12
|
+
* // Example:
|
13
|
+
* objectTransformer(
|
14
|
+
* {
|
15
|
+
* date_start: '2023-04-12',
|
16
|
+
* date_end: '2023-04-13',
|
17
|
+
* user_array: [
|
18
|
+
* { name: 'Greg', created_date: '2023-05-12' },
|
19
|
+
* { name: 'Antoine', created_date: '2023-06-12' },
|
20
|
+
* ],
|
21
|
+
* single_user: { name: 'Greg', created_date: '2023-05-12' },
|
22
|
+
* },
|
23
|
+
* {
|
24
|
+
* dates: ['date_start', 'date_end'],
|
25
|
+
* mapping: {
|
26
|
+
* user_array: parseUser,
|
27
|
+
* single_user: parseUser,
|
28
|
+
* },
|
29
|
+
* },
|
30
|
+
* );
|
31
|
+
* // Return an object with parsed dates & mapped user.
|
32
|
+
* ```
|
33
|
+
* @param obj
|
34
|
+
* @param tranformer
|
35
|
+
*/
|
36
|
+
const objectTransformer = (obj, tranformer) => {
|
37
|
+
const anyObj = obj;
|
38
|
+
if (tranformer.dates) {
|
39
|
+
for (const date of tranformer.dates) {
|
40
|
+
if (anyObj[date] && (typeof anyObj[date] === 'string' || typeof anyObj[date] === 'number')) {
|
41
|
+
anyObj[date] = new Date(anyObj[date]);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
if (tranformer.mapping) {
|
46
|
+
for (const mapKey of Object.keys(tranformer.mapping)) {
|
47
|
+
if (anyObj[mapKey]) {
|
48
|
+
if (Array.isArray(anyObj[mapKey])) {
|
49
|
+
anyObj[mapKey] = anyObj[mapKey].map(tranformer.mapping[mapKey]);
|
50
|
+
} else {
|
51
|
+
anyObj[mapKey] = tranformer.mapping[mapKey](anyObj[mapKey]);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
return anyObj;
|
57
|
+
};
|
58
|
+
exports.objectTransformer = objectTransformer;
|
59
|
+
//# sourceMappingURL=object-transformer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["objectTransformer","obj","tranformer","anyObj","dates","date","Date","mapping","mapKey","Object","keys","Array","isArray","map","exports"],"sourceRoot":"../../../src","sources":["utils/object-transformer.ts"],"mappings":";;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAiB,GAAGA,CAAgBC,GAAM,EAAEC,UAA6B,KAAK;EACzF,MAAMC,MAAM,GAAGF,GAAU;EAEzB,IAAIC,UAAU,CAACE,KAAK,EAAE;IACpB,KAAK,MAAMC,IAAI,IAAIH,UAAU,CAACE,KAAK,EAAE;MACnC,IAAID,MAAM,CAACE,IAAI,CAAC,KAAK,OAAOF,MAAM,CAACE,IAAI,CAAC,KAAK,QAAQ,IAAI,OAAOF,MAAM,CAACE,IAAI,CAAC,KAAK,QAAQ,CAAC,EAAE;QAC1FF,MAAM,CAACE,IAAI,CAAC,GAAG,IAAIC,IAAI,CAACH,MAAM,CAACE,IAAI,CAAC,CAAC;MACvC;IACF;EACF;EAEA,IAAIH,UAAU,CAACK,OAAO,EAAE;IACtB,KAAK,MAAMC,MAAM,IAAIC,MAAM,CAACC,IAAI,CAACR,UAAU,CAACK,OAAO,CAAC,EAAE;MACpD,IAAIJ,MAAM,CAACK,MAAM,CAAC,EAAE;QAClB,IAAIG,KAAK,CAACC,OAAO,CAACT,MAAM,CAACK,MAAM,CAAC,CAAC,EAAE;UACjCL,MAAM,CAACK,MAAM,CAAC,GAAGL,MAAM,CAACK,MAAM,CAAC,CAACK,GAAG,CAACX,UAAU,CAACK,OAAO,CAACC,MAAM,CAAC,CAAC;QACjE,CAAC,MAAM;UACLL,MAAM,CAACK,MAAM,CAAC,GAAGN,UAAU,CAACK,OAAO,CAACC,MAAM,CAAC,CAACL,MAAM,CAACK,MAAM,CAAC,CAAC;QAC7D;MACF;IACF;EACF;EACA,OAAOL,MAAM;AACf,CAAC;AAACW,OAAA,CAAAd,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
@@ -0,0 +1,152 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import MobilyflowReactNativeSdk from "./NativeMobilyflowReactNativeSdk.js";
|
4
|
+
import { MobilyProduct } from "./entities/mobily-product.js";
|
5
|
+
import { MobilySubscriptionGroup } from "./entities/mobily-subscription-group.js";
|
6
|
+
import { MobilyCustomerEntitlement } from "./entities/mobily-customer-entitlement.js";
|
7
|
+
import { Platform as RNPlatform } from 'react-native';
|
8
|
+
import { MobilyError } from "./errors/mobily-error.js";
|
9
|
+
import { MobilyPurchaseError } from "./errors/mobily-purchase-error.js";
|
10
|
+
import { MobilyTransferOwnershipError } from "./errors/mobily-transfer-ownership-error.js";
|
11
|
+
export class MobilyPurchaseSDK {
|
12
|
+
constructor(appId, apiKey, environment, options) {
|
13
|
+
this._uuid = MobilyflowReactNativeSdk.instantiate(appId, apiKey, environment, options ?? {});
|
14
|
+
}
|
15
|
+
throwError(error) {
|
16
|
+
if (RNPlatform.OS === 'android') {
|
17
|
+
switch (error.name) {
|
18
|
+
case 'com.mobilyflow.mobilypurchasesdk.Exceptions.MobilyException':
|
19
|
+
return new MobilyError(parseInt(error.code, 10), error.message, error.nativeStackAndroid);
|
20
|
+
case 'com.mobilyflow.mobilypurchasesdk.Exceptions.MobilyPurchaseException':
|
21
|
+
return new MobilyPurchaseError(parseInt(error.code, 10), error.message, error.nativeStackAndroid);
|
22
|
+
case 'com.mobilyflow.mobilypurchasesdk.Exceptions.MobilyTransferOwnershipException':
|
23
|
+
return new MobilyTransferOwnershipError(parseInt(error.code, 10), error.message, error.nativeStackAndroid);
|
24
|
+
}
|
25
|
+
} else {
|
26
|
+
switch (error.domain) {
|
27
|
+
case 'MobilyflowSDK.MobilyError':
|
28
|
+
return new MobilyError(parseInt(error.code, 10), error.message, error.nativeStackIOS);
|
29
|
+
case 'MobilyflowSDK.MobilyPurchaseError':
|
30
|
+
return new MobilyPurchaseError(parseInt(error.code, 10), error.message, error.nativeStackIOS);
|
31
|
+
case 'MobilyflowSDK.MobilyTransferOwnershipError':
|
32
|
+
return new MobilyTransferOwnershipError(parseInt(error.code, 10), error.message, error.nativeStackIOS);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
return error;
|
36
|
+
}
|
37
|
+
close() {
|
38
|
+
try {
|
39
|
+
MobilyflowReactNativeSdk.close(this._uuid);
|
40
|
+
} catch (error) {
|
41
|
+
throw this.throwError(error);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
async login(externalId) {
|
45
|
+
try {
|
46
|
+
await MobilyflowReactNativeSdk.login(this._uuid, externalId);
|
47
|
+
} catch (error) {
|
48
|
+
throw this.throwError(error);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
async getProducts(identifiers, onlyAvailable = false) {
|
52
|
+
try {
|
53
|
+
const products = await MobilyflowReactNativeSdk.getProducts(this._uuid, identifiers, onlyAvailable);
|
54
|
+
return products.map(MobilyProduct.parseFromAPI);
|
55
|
+
} catch (error) {
|
56
|
+
throw this.throwError(error);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
async getSubscriptionGroups(identifiers, onlyAvailable = false) {
|
60
|
+
try {
|
61
|
+
const groups = await MobilyflowReactNativeSdk.getSubscriptionGroups(this._uuid, identifiers, onlyAvailable);
|
62
|
+
return groups.map(MobilySubscriptionGroup.parseFromAPI);
|
63
|
+
} catch (error) {
|
64
|
+
throw this.throwError(error);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
async getEntitlementForSubscription(subscriptionGroupId) {
|
68
|
+
try {
|
69
|
+
const entitlement = await MobilyflowReactNativeSdk.getEntitlementForSubscription(this._uuid, subscriptionGroupId);
|
70
|
+
return MobilyCustomerEntitlement.parseFromAPI(entitlement);
|
71
|
+
} catch (error) {
|
72
|
+
throw this.throwError(error);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
async getEntitlement(productId) {
|
76
|
+
try {
|
77
|
+
const entitlement = await MobilyflowReactNativeSdk.getEntitlement(this._uuid, productId);
|
78
|
+
return MobilyCustomerEntitlement.parseFromAPI(entitlement);
|
79
|
+
} catch (error) {
|
80
|
+
throw this.throwError(error);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
async getEntitlements(productIds) {
|
84
|
+
try {
|
85
|
+
const entitlements = await MobilyflowReactNativeSdk.getEntitlements(this._uuid, productIds);
|
86
|
+
return entitlements.map(MobilyCustomerEntitlement.parseFromAPI);
|
87
|
+
} catch (error) {
|
88
|
+
throw this.throwError(error);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
async requestTransferOwnership() {
|
92
|
+
try {
|
93
|
+
return await MobilyflowReactNativeSdk.requestTransferOwnership(this._uuid);
|
94
|
+
} catch (error) {
|
95
|
+
throw this.throwError(error);
|
96
|
+
}
|
97
|
+
}
|
98
|
+
async openManageSubscription() {
|
99
|
+
try {
|
100
|
+
return await MobilyflowReactNativeSdk.openManageSubscription(this._uuid);
|
101
|
+
} catch (error) {
|
102
|
+
throw this.throwError(error);
|
103
|
+
}
|
104
|
+
}
|
105
|
+
async openRefundDialog(transactionId) {
|
106
|
+
if (RNPlatform.OS === 'android') {
|
107
|
+
throw new Error('openRefundDialog not implemented on Android');
|
108
|
+
} else {
|
109
|
+
try {
|
110
|
+
return await MobilyflowReactNativeSdk.openRefundDialog(this._uuid, transactionId);
|
111
|
+
} catch (error) {
|
112
|
+
throw this.throwError(error);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
async purchaseProduct(product, options) {
|
117
|
+
try {
|
118
|
+
return await MobilyflowReactNativeSdk.purchaseProduct(this._uuid, product.id, {
|
119
|
+
offerId: options?.offer?.id || null,
|
120
|
+
quantity: options?.quantity || null
|
121
|
+
});
|
122
|
+
} catch (error) {
|
123
|
+
throw this.throwError(error);
|
124
|
+
}
|
125
|
+
}
|
126
|
+
sendDiagnotic() {
|
127
|
+
try {
|
128
|
+
return MobilyflowReactNativeSdk.sendDiagnotic(this._uuid);
|
129
|
+
} catch (error) {
|
130
|
+
throw this.throwError(error);
|
131
|
+
}
|
132
|
+
}
|
133
|
+
async getStoreCountry() {
|
134
|
+
if (RNPlatform.OS === 'android') {
|
135
|
+
throw new Error('getStoreCountry not implemented on Android');
|
136
|
+
} else {
|
137
|
+
try {
|
138
|
+
return await MobilyflowReactNativeSdk.getStoreCountry(this._uuid);
|
139
|
+
} catch (error) {
|
140
|
+
throw this.throwError(error);
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
async isForwardingEnable() {
|
145
|
+
try {
|
146
|
+
return await MobilyflowReactNativeSdk.isForwardingEnable(this._uuid);
|
147
|
+
} catch (error) {
|
148
|
+
throw this.throwError(error);
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
//# sourceMappingURL=MobilyPurchaseSDK.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilyflowReactNativeSdk","MobilyProduct","MobilySubscriptionGroup","MobilyCustomerEntitlement","Platform","RNPlatform","MobilyError","MobilyPurchaseError","MobilyTransferOwnershipError","MobilyPurchaseSDK","constructor","appId","apiKey","environment","options","_uuid","instantiate","throwError","error","OS","name","parseInt","code","message","nativeStackAndroid","domain","nativeStackIOS","close","login","externalId","getProducts","identifiers","onlyAvailable","products","map","parseFromAPI","getSubscriptionGroups","groups","getEntitlementForSubscription","subscriptionGroupId","entitlement","getEntitlement","productId","getEntitlements","productIds","entitlements","requestTransferOwnership","openManageSubscription","openRefundDialog","transactionId","Error","purchaseProduct","product","id","offerId","offer","quantity","sendDiagnotic","getStoreCountry","isForwardingEnable"],"sourceRoot":"../../src","sources":["MobilyPurchaseSDK.tsx"],"mappings":";;AAAA,OAAOA,wBAAwB,MAAyC,qCAAkC;AAC1G,SAASC,aAAa,QAAQ,8BAA2B;AAGzD,SAASC,uBAAuB,QAAQ,yCAAsC;AAC9E,SAASC,yBAAyB,QAAQ,2CAAwC;AAClF,SAASC,QAAQ,IAAIC,UAAU,QAAQ,cAAc;AACrD,SAASC,WAAW,QAAQ,0BAAuB;AACnD,SAASC,mBAAmB,QAAQ,mCAAgC;AACpE,SAASC,4BAA4B,QAAQ,6CAA0C;AAOvF,OAAO,MAAMC,iBAAiB,CAAC;EAG7BC,WAAWA,CAACC,KAAa,EAAEC,MAAc,EAAEC,WAAmB,EAAEC,OAAkC,EAAE;IAClG,IAAI,CAACC,KAAK,GAAGf,wBAAwB,CAACgB,WAAW,CAACL,KAAK,EAAEC,MAAM,EAAEC,WAAW,EAAEC,OAAO,IAAI,CAAC,CAAC,CAAC;EAC9F;EAEQG,UAAUA,CAACC,KAAU,EAAE;IAC7B,IAAIb,UAAU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nB,MAAM,IAAI,CAACD,UAAU,CAACC,KAAK,CAAC;MAC9B;IACF;EACF;EAEA,MAAMyC,kBAAkBA,CAAA,EAAG;IACzB,IAAI;MACF,OAAO,MAAM3D,wBAAwB,CAAC2D,kBAAkB,CAAC,IAAI,CAAC5C,KAAK,CAAC;IACtE,CAAC,CAAC,OAAOG,KAAU,EAAE;MACnB,MAAM,IAAI,CAACD,UAAU,CAACC,KAAK,CAAC;IAC9B;EACF;AACF","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeMobilyflowReactNativeSdk.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA4ClD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,0BAA0B,CAAC","ignoreList":[]}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { MobilyProduct } from "./mobily-product.js";
|
4
|
+
import { objectTransformer } from "../utils/object-transformer.js";
|
5
|
+
export class ItemEntitlement {}
|
6
|
+
export class SubscriptionEntitlement {
|
7
|
+
static parseFromAPI(obj) {
|
8
|
+
return objectTransformer(obj, {
|
9
|
+
dates: ['startDate', 'expirationDate']
|
10
|
+
});
|
11
|
+
}
|
12
|
+
}
|
13
|
+
export class MobilyCustomerEntitlement {
|
14
|
+
static parseFromAPI(obj) {
|
15
|
+
return objectTransformer(obj, {
|
16
|
+
mapping: {
|
17
|
+
product: MobilyProduct.parseFromAPI,
|
18
|
+
subscription: SubscriptionEntitlement.parseFromAPI
|
19
|
+
}
|
20
|
+
});
|
21
|
+
}
|
22
|
+
}
|
23
|
+
//# sourceMappingURL=mobily-customer-entitlement.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilyProduct","objectTransformer","ItemEntitlement","SubscriptionEntitlement","parseFromAPI","obj","dates","MobilyCustomerEntitlement","mapping","product","subscription"],"sourceRoot":"../../../src","sources":["entities/mobily-customer-entitlement.ts"],"mappings":";;AACA,SAASA,aAAa,QAAQ,qBAAkB;AAEhD,SAASC,iBAAiB,QAAQ,gCAA6B;AAE/D,OAAO,MAAMC,eAAe,CAAC;AAI7B,OAAO,MAAMC,uBAAuB,CAAC;EAOnC,OAAOC,YAAYA,CAACC,GAA4B,EAAE;IAChD,OAAOJ,iBAAiB,CAACI,GAAG,EAAE;MAAEC,KAAK,EAAE,CAAC,WAAW,EAAE,gBAAgB;IAAE,CAAC,CAAC;EAC3E;AACF;AAEA,OAAO,MAAMC,yBAAyB,CAAC;EAOrC,OAAOH,YAAYA,CAACC,GAA8B,EAAE;IAClD,OAAOJ,iBAAiB,CAACI,GAAG,EAAE;MAC5BG,OAAO,EAAE;QACPC,OAAO,EAAET,aAAa,CAACI,YAAY;QACnCM,YAAY,EAAEP,uBAAuB,CAACC;MACxC;IACF,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilyOneTimeProduct"],"sourceRoot":"../../../src","sources":["entities/mobily-one-time-product.ts"],"mappings":";;AAEA,OAAO,MAAMA,oBAAoB,CAAC","ignoreList":[]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { objectTransformer } from "../utils/object-transformer.js";
|
4
|
+
export class MobilyProduct {
|
5
|
+
static parseFromAPI(obj) {
|
6
|
+
return objectTransformer(obj, {
|
7
|
+
dates: ['createdAt', 'updatedAt', 'deletedAt']
|
8
|
+
});
|
9
|
+
}
|
10
|
+
}
|
11
|
+
//# sourceMappingURL=mobily-product.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["objectTransformer","MobilyProduct","parseFromAPI","obj","dates"],"sourceRoot":"../../../src","sources":["entities/mobily-product.ts"],"mappings":";;AAIA,SAASA,iBAAiB,QAAQ,gCAA6B;AAE/D,OAAO,MAAMC,aAAa,CAAC;EAsBzB,OAAOC,YAAYA,CAACC,GAAkB,EAAE;IACtC,OAAOH,iBAAiB,CAACG,GAAG,EAAE;MAC5BC,KAAK,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW;IAC/C,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { MobilyProduct } from "./mobily-product.js";
|
4
|
+
import { objectTransformer } from "../utils/object-transformer.js";
|
5
|
+
export class MobilySubscriptionGroup {
|
6
|
+
static parseFromAPI(obj) {
|
7
|
+
return objectTransformer(obj, {
|
8
|
+
mapping: {
|
9
|
+
products: MobilyProduct.parseFromAPI
|
10
|
+
}
|
11
|
+
});
|
12
|
+
}
|
13
|
+
}
|
14
|
+
//# sourceMappingURL=mobily-subscription-group.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilyProduct","objectTransformer","MobilySubscriptionGroup","parseFromAPI","obj","mapping","products"],"sourceRoot":"../../../src","sources":["entities/mobily-subscription-group.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,qBAAkB;AAChD,SAASC,iBAAiB,QAAQ,gCAA6B;AAE/D,OAAO,MAAMC,uBAAuB,CAAC;EASnC,OAAOC,YAAYA,CAACC,GAA4B,EAAE;IAChD,OAAOH,iBAAiB,CAACG,GAAG,EAAE;MAC5BC,OAAO,EAAE;QACPC,QAAQ,EAAEN,aAAa,CAACG;MAC1B;IACF,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilySubscriptionOffer"],"sourceRoot":"../../../src","sources":["entities/mobily-subscription-offer.ts"],"mappings":";;AAGA,OAAO,MAAMA,uBAAuB,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilySubscriptionProduct"],"sourceRoot":"../../../src","sources":["entities/mobily-subscription-product.ts"],"mappings":";;AAIA,OAAO,MAAMA,yBAAyB,CAAC","ignoreList":[]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export let MobilyEnvironment = /*#__PURE__*/function (MobilyEnvironment) {
|
4
|
+
MobilyEnvironment[MobilyEnvironment["DEVELOPMENT"] = 0] = "DEVELOPMENT";
|
5
|
+
MobilyEnvironment[MobilyEnvironment["STAGING"] = 1] = "STAGING";
|
6
|
+
MobilyEnvironment[MobilyEnvironment["PRODUCTION"] = 2] = "PRODUCTION";
|
7
|
+
return MobilyEnvironment;
|
8
|
+
}({});
|
9
|
+
//# sourceMappingURL=mobily-environment.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilyEnvironment"],"sourceRoot":"../../../src","sources":["enums/mobily-environment.ts"],"mappings":";;AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export let PeriodUnit = /*#__PURE__*/function (PeriodUnit) {
|
4
|
+
PeriodUnit[PeriodUnit["WEEK"] = 0] = "WEEK";
|
5
|
+
PeriodUnit[PeriodUnit["MONTH"] = 1] = "MONTH";
|
6
|
+
PeriodUnit[PeriodUnit["YEAR"] = 2] = "YEAR";
|
7
|
+
return PeriodUnit;
|
8
|
+
}({});
|
9
|
+
//# sourceMappingURL=period-unit.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["PeriodUnit"],"sourceRoot":"../../../src","sources":["enums/period-unit.ts"],"mappings":";;AAAA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["Platform"],"sourceRoot":"../../../src","sources":["enums/platform.ts"],"mappings":";;AAAA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export let ProductStatus = /*#__PURE__*/function (ProductStatus) {
|
4
|
+
ProductStatus[ProductStatus["INVALID"] = 0] = "INVALID";
|
5
|
+
ProductStatus[ProductStatus["UNAVAILABLE"] = 1] = "UNAVAILABLE";
|
6
|
+
ProductStatus[ProductStatus["AVAILABLE"] = 2] = "AVAILABLE";
|
7
|
+
return ProductStatus;
|
8
|
+
}({});
|
9
|
+
//# sourceMappingURL=product-status.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["ProductStatus"],"sourceRoot":"../../../src","sources":["enums/product-status.ts"],"mappings":";;AAAA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["ProductType"],"sourceRoot":"../../../src","sources":["enums/product-type.ts"],"mappings":";;AAAA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export let WebhookStatus = /*#__PURE__*/function (WebhookStatus) {
|
4
|
+
WebhookStatus[WebhookStatus["PENDING"] = 0] = "PENDING";
|
5
|
+
WebhookStatus[WebhookStatus["ERROR"] = 1] = "ERROR";
|
6
|
+
WebhookStatus[WebhookStatus["SUCCESS"] = 2] = "SUCCESS";
|
7
|
+
return WebhookStatus;
|
8
|
+
}({});
|
9
|
+
//# sourceMappingURL=webhook-status.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["WebhookStatus"],"sourceRoot":"../../../src","sources":["enums/webhook-status.ts"],"mappings":";;AAAA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA","ignoreList":[]}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export class MobilyError extends Error {
|
4
|
+
constructor(type, message, nativeStack) {
|
5
|
+
super(message);
|
6
|
+
this.type = type;
|
7
|
+
this.message = message;
|
8
|
+
this.nativeStack = nativeStack;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
(function (_MobilyError) {
|
12
|
+
let Type = /*#__PURE__*/function (Type) {
|
13
|
+
Type[Type["STORE_UNAVAILABLE"] = 0] = "STORE_UNAVAILABLE";
|
14
|
+
Type[Type["SERVER_UNAVAILABLE"] = 1] = "SERVER_UNAVAILABLE";
|
15
|
+
Type[Type["NO_CUSTOMER_LOGGED"] = 2] = "NO_CUSTOMER_LOGGED";
|
16
|
+
Type[Type["UNKNOWN_ERROR"] = 3] = "UNKNOWN_ERROR";
|
17
|
+
return Type;
|
18
|
+
}({});
|
19
|
+
_MobilyError.Type = Type;
|
20
|
+
})(MobilyError || (MobilyError = {}));
|
21
|
+
//# sourceMappingURL=mobily-error.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilyError","Error","constructor","type","message","nativeStack","_MobilyError","Type"],"sourceRoot":"../../../src","sources":["errors/mobily-error.ts"],"mappings":";;AAAA,OAAO,MAAMA,WAAW,SAASC,KAAK,CAAC;EACrCC,WAAWA,CACOC,IAAsB,EACtBC,OAAe,EACfC,WAAiB,EACjC;IACA,KAAK,CAACD,OAAO,CAAC;IAAC,KAJCD,IAAsB,GAAtBA,IAAsB;IAAA,KACtBC,OAAe,GAAfA,OAAe;IAAA,KACfC,WAAiB,GAAjBA,WAAiB;EAGnC;AACF;AAAC,WAAAC,YAAA;EAAA,IAGaC,IAAI,0BAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAA,OAAJA,IAAI;EAAA;EAAAD,YAAA,CAAAC,IAAA,GAAAA,IAAA;AAAA,GADDP,WAAW,KAAXA,WAAW","ignoreList":[]}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export class MobilyPurchaseError extends Error {
|
4
|
+
constructor(type, message, nativeStack) {
|
5
|
+
super(message);
|
6
|
+
this.type = type;
|
7
|
+
this.message = message;
|
8
|
+
this.nativeStack = nativeStack;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
(function (_MobilyPurchaseError) {
|
12
|
+
let Type = /*#__PURE__*/function (Type) {
|
13
|
+
Type[Type["PURCHASE_ALREADY_PENDING"] = 0] = "PURCHASE_ALREADY_PENDING";
|
14
|
+
Type[Type["PRODUCT_UNAVAILABLE"] = 1] = "PRODUCT_UNAVAILABLE";
|
15
|
+
Type[Type["NETWORK_UNAVAILABLE"] = 2] = "NETWORK_UNAVAILABLE";
|
16
|
+
Type[Type["WEBHOOK_NOT_PRECESSED"] = 3] = "WEBHOOK_NOT_PRECESSED";
|
17
|
+
Type[Type["WEBHOOK_FAILED"] = 4] = "WEBHOOK_FAILED";
|
18
|
+
Type[Type["ALREADY_PURCHASED"] = 5] = "ALREADY_PURCHASED";
|
19
|
+
Type[Type["NOT_MANAGED_BY_THIS_STORE_ACCOUNT"] = 6] = "NOT_MANAGED_BY_THIS_STORE_ACCOUNT";
|
20
|
+
Type[Type["STORE_ACCOUNT_ALREADY_HAVE_PURCHASE"] = 7] = "STORE_ACCOUNT_ALREADY_HAVE_PURCHASE";
|
21
|
+
Type[Type["RENEW_ALREADY_ON_THIS_PLAN"] = 8] = "RENEW_ALREADY_ON_THIS_PLAN";
|
22
|
+
Type[Type["USER_CANCELED"] = 9] = "USER_CANCELED";
|
23
|
+
Type[Type["FAILED"] = 10] = "FAILED";
|
24
|
+
Type[Type["PENDING"] = 11] = "PENDING";
|
25
|
+
return Type;
|
26
|
+
}({});
|
27
|
+
_MobilyPurchaseError.Type = Type;
|
28
|
+
})(MobilyPurchaseError || (MobilyPurchaseError = {}));
|
29
|
+
//# sourceMappingURL=mobily-purchase-error.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilyPurchaseError","Error","constructor","type","message","nativeStack","_MobilyPurchaseError","Type"],"sourceRoot":"../../../src","sources":["errors/mobily-purchase-error.ts"],"mappings":";;AAAA,OAAO,MAAMA,mBAAmB,SAASC,KAAK,CAAC;EAC7CC,WAAWA,CACOC,IAA8B,EAC9BC,OAAe,EACfC,WAAiB,EACjC;IACA,KAAK,CAACD,OAAO,CAAC;IAAC,KAJCD,IAA8B,GAA9BA,IAA8B;IAAA,KAC9BC,OAAe,GAAfA,OAAe;IAAA,KACfC,WAAiB,GAAjBA,WAAiB;EAGnC;AACF;AAAC,WAAAC,oBAAA;EAAA,IAGaC,IAAI,0BAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAA,OAAJA,IAAI;EAAA;EAAAD,oBAAA,CAAAC,IAAA,GAAAA,IAAA;AAAA,GADDP,mBAAmB,KAAnBA,mBAAmB","ignoreList":[]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export class MobilyTransferOwnershipError extends Error {
|
4
|
+
constructor(type, message, nativeStack) {
|
5
|
+
super(message);
|
6
|
+
this.type = type;
|
7
|
+
this.message = message;
|
8
|
+
this.nativeStack = nativeStack;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
(function (_MobilyTransferOwnershipError) {
|
12
|
+
let Type = /*#__PURE__*/function (Type) {
|
13
|
+
Type[Type["NOTHING_TO_TRANSFER"] = 0] = "NOTHING_TO_TRANSFER";
|
14
|
+
Type[Type["TRANSFER_TO_SAME_CUSTOMER"] = 1] = "TRANSFER_TO_SAME_CUSTOMER";
|
15
|
+
Type[Type["ALREADY_PENDING"] = 2] = "ALREADY_PENDING";
|
16
|
+
Type[Type["WEBHOOK_NOT_PROCESSED"] = 3] = "WEBHOOK_NOT_PROCESSED";
|
17
|
+
Type[Type["WEBHOOK_FAILED"] = 4] = "WEBHOOK_FAILED";
|
18
|
+
return Type;
|
19
|
+
}({});
|
20
|
+
_MobilyTransferOwnershipError.Type = Type;
|
21
|
+
})(MobilyTransferOwnershipError || (MobilyTransferOwnershipError = {}));
|
22
|
+
//# sourceMappingURL=mobily-transfer-ownership-error.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["MobilyTransferOwnershipError","Error","constructor","type","message","nativeStack","_MobilyTransferOwnershipError","Type"],"sourceRoot":"../../../src","sources":["errors/mobily-transfer-ownership-error.ts"],"mappings":";;AAAA,OAAO,MAAMA,4BAA4B,SAASC,KAAK,CAAC;EACtDC,WAAWA,CACOC,IAAuC,EACvCC,OAAe,EACfC,WAAiB,EACjC;IACA,KAAK,CAACD,OAAO,CAAC;IAAC,KAJCD,IAAuC,GAAvCA,IAAuC;IAAA,KACvCC,OAAe,GAAfA,OAAe;IAAA,KACfC,WAAiB,GAAjBA,WAAiB;EAGnC;AACF;AAAC,WAAAC,6BAAA;EAAA,IAGaC,IAAI,0BAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAJA,IAAI,CAAJA,IAAI;IAAA,OAAJA,IAAI;EAAA;EAAAD,6BAAA,CAAAC,IAAA,GAAAA,IAAA;AAAA,GADDP,4BAA4B,KAA5BA,4BAA4B","ignoreList":[]}
|