ame-super-app-web
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -8,2 +8,5 @@ export default interface OpenMiniAppInput { | ||
context?: string; | ||
initializationParams?: { | ||
[s: string]: any; | ||
}; | ||
} |
@@ -24,3 +24,2 @@ import MiniappPermissionEnum from "./MiniappPermissionEnum"; | ||
miniAppPermissions?: Array<MiniAppPermission>; | ||
initializationInfos: InitializationInfos; | ||
/** | ||
@@ -27,0 +26,0 @@ * storage key do miniapp, usado para criptografia de dados de um miniapp usando Ame.storage |
@@ -22,6 +22,2 @@ "use strict"; | ||
metadata: {}, | ||
initializationInfos: { | ||
shareContext: { valuesPromise: Promise.resolve(), id: "" }, | ||
navigationParams: {}, | ||
}, | ||
organization: { | ||
@@ -28,0 +24,0 @@ owner: { |
@@ -1,2 +0,2 @@ | ||
declare const _default: "4.2.0"; | ||
declare const _default: "4.3.0"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "4.2.0"; | ||
exports.default = "4.3.0"; | ||
//# sourceMappingURL=version.js.map |
@@ -161,2 +161,26 @@ "use strict"; | ||
})); | ||
test("SuperApp.openMiniApp with InitializationParams", () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
var _g; | ||
const slug = "mySlug"; | ||
const superApp = SuperAppFactory_1.default.withConfigs(); | ||
(0, nock_1.default)(`${Config_1.default.profile.share.endpoint}`).get(/.*/).reply(200, ShareMiniAppDataFixture_1.default, NockHelper_1.default.DEFAULT_HEADERS); | ||
(0, nock_1.default)(`${Config_1.default.profile.miniAppManager.endpoint}/o/mini-apps/${slug}`) | ||
.get(/.*/) | ||
.reply(200, FindMiniAppBySlugFixture_1.default, NockHelper_1.default.DEFAULT_HEADERS); | ||
const initializationInfos = { a: "a_value", b: "b_value" }; | ||
yield superApp.openMiniApp({ | ||
container: SuperAppFactory_1.default.containerMock, | ||
slug: slug, | ||
context: generateShareIdContext(), | ||
initializationParams: initializationInfos, | ||
}); | ||
const miniAppData = (_g = superApp.context) === null || _g === void 0 ? void 0 : _g.miniAppData; | ||
expect(miniAppData).toBeDefined(); | ||
expect(miniAppData.slug).toBe(slug); | ||
expect(miniAppData.url).toBe(ShareMiniAppDataFixture_1.default.state.miniAppBootstrapUrl); | ||
expect(miniAppData.permissions).toBeDefined(); | ||
expect(miniAppData.permissions).toContain(MiniappPermissionEnum_1.default.USER_BIRTHDATE); | ||
const initializationInfosData = yield superApp.getInitializationInfos(); | ||
expect(initializationInfosData).toEqual([{ data: initializationInfos, type: "NAVIGATION" }]); | ||
})); | ||
test("SuperApp.openMiniApp with wrong target", () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
@@ -163,0 +187,0 @@ const slug = "mySlug"; |
{ | ||
"name": "ame-super-app-web", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"_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
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
1082379
4852