ame-super-app-web
Advanced tools
Comparing version 4.1.1-alpha.0 to 4.1.1
@@ -72,2 +72,8 @@ "use strict"; | ||
} | ||
else if (err.message === "Network Error") { | ||
responseError.response = { | ||
data: "check.network.connectivity.or.cors.errors", | ||
status: -1, | ||
}; | ||
} | ||
responseError.message = err.message; | ||
@@ -74,0 +80,0 @@ throw responseError; |
@@ -23,3 +23,3 @@ import OpenMiniAppFromClient from "../model/input/OpenMiniAppFromClient"; | ||
backIsInFramework(): boolean; | ||
cameFromBack(): boolean; | ||
lastMiniAppWasStacked(): boolean; | ||
clearAll(): void; | ||
@@ -26,0 +26,0 @@ setCurrentContextParams(contextParams: any): void; |
@@ -62,3 +62,3 @@ "use strict"; | ||
} | ||
cameFromBack() { | ||
lastMiniAppWasStacked() { | ||
// Se o objeto é o mesmo, a última operação feita na pilha foi um push, não um pop | ||
@@ -89,4 +89,4 @@ return this.miniAppStacks === this.lastMiniAppStacks; | ||
const stack = this.miniAppStacks[id]; | ||
const wrappedMiniApp = stack.pop(); | ||
this.lastMiniAppStacks = JSON.parse(JSON.stringify(this.miniAppStacks)); // deep clone | ||
const wrappedMiniApp = stack.pop(); | ||
if (stack.length === 0) { | ||
@@ -104,2 +104,4 @@ delete this.miniAppStacks[id]; | ||
const browserStack = this.browserHistoryService.getBrowserHistoryStack(); | ||
// Remove contexParams porque esse dado é relativo ao miniapp corrente e não ao que está sendo empilhado | ||
miniapp.contextParams = undefined; | ||
stack.push(this.wrapMiniApp(miniapp, browserStack.length)); // Não é length - 1 mesmo | ||
@@ -106,0 +108,0 @@ this.lastMiniAppStacks = this.miniAppStacks; |
@@ -23,3 +23,2 @@ "use strict"; | ||
//TODO - Documentar o método logout | ||
//TODO - validar a necessidade de limpar a stack de mini-apps | ||
}); | ||
@@ -26,0 +25,0 @@ this.superApp = superApp; |
@@ -269,7 +269,8 @@ "use strict"; | ||
const miniApp = this.miniAppStackService.getLastMiniApp(this.miniAppStackService.getLastMiniAppStackKey()); | ||
if (this.miniAppStackService.cameFromBack()) { | ||
if (miniApp.contextParams) { | ||
const lastMiniAppWasStacked = this.miniAppStackService.lastMiniAppWasStacked(); | ||
if (lastMiniAppWasStacked) { | ||
if (miniApp.initializationParams) { | ||
returnArray.push({ | ||
type: "NAVIGATION", | ||
data: miniApp.contextParams, | ||
data: miniApp.initializationParams, | ||
}); | ||
@@ -279,5 +280,11 @@ } | ||
else { | ||
if (miniApp.initializationParams) { | ||
if (miniApp.contextParams) { | ||
returnArray.push({ | ||
type: "NAVIGATION", | ||
data: miniApp.contextParams, | ||
}); | ||
} | ||
else if (miniApp.initializationParams) { | ||
returnArray.push({ | ||
type: "NAVIGATION", | ||
data: miniApp.initializationParams, | ||
@@ -284,0 +291,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
declare const _default: "4.1.1-alpha.0"; | ||
declare const _default: "4.1.1"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "4.1.1-alpha.0"; | ||
exports.default = "4.1.1"; | ||
//# sourceMappingURL=version.js.map |
@@ -50,3 +50,13 @@ "use strict"; | ||
})); | ||
test("httpService.put() error cors blocking", () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
(0, nock_1.default)("https://baconipsum.com").get(/.*/).reply(404, "cors will block"); | ||
const resGet = yield httpService.get("https://baconipsum.com").catch((e) => e); | ||
expect(resGet).toBeDefined(); | ||
const response = resGet.response; | ||
expect(response).toBeDefined(); | ||
expect(response.data).toBe("check.network.connectivity.or.cors.errors"); | ||
expect(response.status).toBe(-1); | ||
expect(resGet.message).toBe("Network Error"); | ||
})); | ||
}); | ||
//# sourceMappingURL=HttpService.test.js.map |
{ | ||
"name": "ame-super-app-web", | ||
"version": "4.1.1-alpha.0", | ||
"version": "4.1.1", | ||
"_versionBetaExample": "1.0.2-beta.0", | ||
@@ -35,3 +35,4 @@ "__versionBetaExample": "1.0.2-alpha.0", | ||
"playground": "./scripts/playground.sh", | ||
"dev": "concurrently --kill-others \"npm run watch-build\" \"npm run playground\"" | ||
"dev": "concurrently --kill-others \"npm run watch-build\" \"npm run playground\"", | ||
"example": "cd ../example/; ./run.sh" | ||
}, | ||
@@ -88,2 +89,2 @@ "devDependencies": { | ||
} | ||
} | ||
} |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1049180
4537
1
1