ame-super-app-web
Advanced tools
Comparing version 3.6.0-alpha.0 to 3.6.0-alpha.1
@@ -18,3 +18,3 @@ import InitInput from "./model/input/InitInput"; | ||
} | ||
declare enum ConstValues { | ||
export declare enum SuperAppConst { | ||
UNDEFINED_METHOD_MESSAGE = "undefined.method", | ||
@@ -26,6 +26,2 @@ CUSTOM_METHODS_ONLY_ASYNC = "customMethods.only.accept.async.functions", | ||
export default class SuperApp { | ||
static readonly UNDEFINED_METHOD_MESSAGE = ConstValues.UNDEFINED_METHOD_MESSAGE; | ||
static readonly CUSTOM_METHODS_ONLY_ASYNC = ConstValues.CUSTOM_METHODS_ONLY_ASYNC; | ||
static readonly METHOD_PROMISE_ACTION_RESOLVE = ConstValues.METHOD_PROMISE_ACTION_RESOLVE; | ||
static readonly METHOD_PROMISE_ACTION_REJECT = ConstValues.METHOD_PROMISE_ACTION_RESOLVE; | ||
superAppService: SuperAppService; | ||
@@ -72,2 +68,1 @@ storageKeyService: StorageKeyService; | ||
} | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SuperAppConst = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -19,10 +20,9 @@ const SuperAppContext_1 = tslib_1.__importDefault(require("./model/SuperAppContext")); | ||
const DEFAULT_URL_PATTERN_FOR_OPEN_MINI_APP = "/app/:slug"; | ||
// retrocompatibilidade com TS antigo | ||
var ConstValues; | ||
(function (ConstValues) { | ||
ConstValues["UNDEFINED_METHOD_MESSAGE"] = "undefined.method"; | ||
ConstValues["CUSTOM_METHODS_ONLY_ASYNC"] = "customMethods.only.accept.async.functions"; | ||
ConstValues["METHOD_PROMISE_ACTION_RESOLVE"] = "resolvePromise"; | ||
ConstValues["METHOD_PROMISE_ACTION_REJECT"] = "rejectPromise"; | ||
})(ConstValues || (ConstValues = {})); | ||
var SuperAppConst; | ||
(function (SuperAppConst) { | ||
SuperAppConst["UNDEFINED_METHOD_MESSAGE"] = "undefined.method"; | ||
SuperAppConst["CUSTOM_METHODS_ONLY_ASYNC"] = "customMethods.only.accept.async.functions"; | ||
SuperAppConst["METHOD_PROMISE_ACTION_RESOLVE"] = "resolvePromise"; | ||
SuperAppConst["METHOD_PROMISE_ACTION_REJECT"] = "rejectPromise"; | ||
})(SuperAppConst = exports.SuperAppConst || (exports.SuperAppConst = {})); | ||
class SuperApp { | ||
@@ -136,7 +136,7 @@ constructor() { | ||
this.rejectPromiseOnWindow = (window, message) => { | ||
message.methodName = SuperApp.METHOD_PROMISE_ACTION_REJECT; | ||
message.methodName = SuperAppConst.METHOD_PROMISE_ACTION_REJECT; | ||
this.postMessageToWindow(window, message); | ||
}; | ||
this.resolvePromiseOnWindow = (window, message) => { | ||
message.methodName = SuperApp.METHOD_PROMISE_ACTION_RESOLVE; | ||
message.methodName = SuperAppConst.METHOD_PROMISE_ACTION_RESOLVE; | ||
this.postMessageToWindow(window, message); | ||
@@ -167,3 +167,3 @@ }; | ||
if (!methodName) { | ||
this.rejectPromiseOnWindow(originWindow, { promiseId: data.promiseId, res: SuperApp.UNDEFINED_METHOD_MESSAGE }); | ||
this.rejectPromiseOnWindow(originWindow, { promiseId: data.promiseId, res: SuperAppConst.UNDEFINED_METHOD_MESSAGE }); | ||
return; | ||
@@ -183,3 +183,3 @@ } | ||
console.log("método não encontrado", methodName); | ||
this.rejectPromiseOnWindow(originWindow, { promiseId: data.promiseId, res: SuperApp.UNDEFINED_METHOD_MESSAGE }); | ||
this.rejectPromiseOnWindow(originWindow, { promiseId: data.promiseId, res: SuperAppConst.UNDEFINED_METHOD_MESSAGE }); | ||
return; | ||
@@ -191,3 +191,3 @@ } | ||
promiseId: data.promiseId, | ||
res: SuperApp.CUSTOM_METHODS_ONLY_ASYNC, | ||
res: SuperAppConst.CUSTOM_METHODS_ONLY_ASYNC, | ||
}); | ||
@@ -418,6 +418,2 @@ return; | ||
exports.default = SuperApp; | ||
SuperApp.UNDEFINED_METHOD_MESSAGE = ConstValues.UNDEFINED_METHOD_MESSAGE; | ||
SuperApp.CUSTOM_METHODS_ONLY_ASYNC = ConstValues.CUSTOM_METHODS_ONLY_ASYNC; | ||
SuperApp.METHOD_PROMISE_ACTION_RESOLVE = ConstValues.METHOD_PROMISE_ACTION_RESOLVE; | ||
SuperApp.METHOD_PROMISE_ACTION_REJECT = ConstValues.METHOD_PROMISE_ACTION_RESOLVE; | ||
//# sourceMappingURL=SuperApp.js.map |
@@ -1,2 +0,2 @@ | ||
declare const _default: "3.6.0-alpha.0"; | ||
declare const _default: "3.6.0-alpha.1"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "3.6.0-alpha.0"; | ||
exports.default = "3.6.0-alpha.1"; | ||
//# sourceMappingURL=version.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
const EnvironmentManager_1 = tslib_1.__importDefault(require("../src/helper/EnvironmentManager")); | ||
const SuperApp_1 = tslib_1.__importDefault(require("../src/SuperApp")); | ||
const SuperApp_1 = tslib_1.__importStar(require("../src/SuperApp")); | ||
const BridgeHelper_1 = tslib_1.__importDefault(require("./helper/BridgeHelper")); | ||
@@ -68,3 +68,3 @@ const SuperAppFactory_1 = tslib_1.__importDefault(require("./helper/SuperAppFactory")); | ||
superApp.receiveMessage(BridgeHelper_1.default.mockMethodMessage("askUserData", [], (message) => { | ||
expect(message.methodName).toBe(SuperApp_1.default.METHOD_PROMISE_ACTION_RESOLVE); | ||
expect(message.methodName).toBe(SuperApp_1.SuperAppConst.METHOD_PROMISE_ACTION_RESOLVE); | ||
expect(message.promiseId).toBeDefined(); | ||
@@ -71,0 +71,0 @@ expect(message.res).toBeDefined(); |
@@ -5,3 +5,3 @@ "use strict"; | ||
const SuperAppEnvironment_1 = require("../../src/model/SuperAppEnvironment"); | ||
const SuperApp_1 = tslib_1.__importDefault(require("../../src/SuperApp")); | ||
const SuperApp_1 = require("../../src/SuperApp"); | ||
const BridgeHelper_1 = tslib_1.__importDefault(require("../helper/BridgeHelper")); | ||
@@ -135,3 +135,3 @@ const NockHelper_1 = tslib_1.__importDefault(require("../helper/NockHelper")); | ||
expect(message.promiseId).toBeDefined(); | ||
expect(message.methodName).toBe(SuperApp_1.default.METHOD_PROMISE_ACTION_RESOLVE); | ||
expect(message.methodName).toBe(SuperApp_1.SuperAppConst.METHOD_PROMISE_ACTION_RESOLVE); | ||
done(); | ||
@@ -150,4 +150,4 @@ })); | ||
expect(message.promiseId).toBeDefined(); | ||
expect(message.methodName).toBe(SuperApp_1.default.METHOD_PROMISE_ACTION_REJECT); | ||
expect(message.res).toBe(SuperApp_1.default.UNDEFINED_METHOD_MESSAGE); | ||
expect(message.methodName).toBe(SuperApp_1.SuperAppConst.METHOD_PROMISE_ACTION_REJECT); | ||
expect(message.res).toBe(SuperApp_1.SuperAppConst.UNDEFINED_METHOD_MESSAGE); | ||
done(); | ||
@@ -167,4 +167,4 @@ })); | ||
expect(message.promiseId).toBeDefined(); | ||
expect(message.methodName).toBe(SuperApp_1.default.METHOD_PROMISE_ACTION_REJECT); | ||
expect(message.res).toBe(SuperApp_1.default.CUSTOM_METHODS_ONLY_ASYNC); | ||
expect(message.methodName).toBe(SuperApp_1.SuperAppConst.METHOD_PROMISE_ACTION_REJECT); | ||
expect(message.res).toBe(SuperApp_1.SuperAppConst.CUSTOM_METHODS_ONLY_ASYNC); | ||
done(); | ||
@@ -194,3 +194,3 @@ })); | ||
expect(message.promiseId).toBeDefined(); | ||
expect(message.methodName).toBe(SuperApp_1.default.METHOD_PROMISE_ACTION_RESOLVE); | ||
expect(message.methodName).toBe(SuperApp_1.SuperAppConst.METHOD_PROMISE_ACTION_RESOLVE); | ||
expect(message.res).toBe(returnValToTest); | ||
@@ -220,3 +220,3 @@ done(); | ||
expect(message.promiseId).toBeDefined(); | ||
expect(message.methodName).toBe(SuperApp_1.default.METHOD_PROMISE_ACTION_RESOLVE); | ||
expect(message.methodName).toBe(SuperApp_1.SuperAppConst.METHOD_PROMISE_ACTION_RESOLVE); | ||
const dataFromRes = message.res; | ||
@@ -223,0 +223,0 @@ expect(dataFromRes).toBeDefined(); |
{ | ||
"name": "ame-super-app-web", | ||
"version": "3.6.0-alpha.0", | ||
"version": "3.6.0-alpha.1", | ||
"_versionBetaExample": "1.0.2-beta.0", | ||
@@ -5,0 +5,0 @@ "__versionBetaExample": "1.0.2-alpha.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
952821
3659