@stackable-labs/cli-app-extension 1.11.0 → 1.12.0
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/dist/index.js +7 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1297,9 +1297,12 @@ var rewritePreviewApp = async (rootDir, targets, permissions) => {
|
|
|
1297
1297
|
"Permission",
|
|
1298
1298
|
includeInvoke ? "ActionInvokePayload" : "",
|
|
1299
1299
|
includeDataQuery ? "ApiRequest" : "",
|
|
1300
|
+
"FetchRequest",
|
|
1301
|
+
"FetchResponse",
|
|
1300
1302
|
includeToast ? "ToastPayload" : ""
|
|
1301
1303
|
].filter(Boolean);
|
|
1302
1304
|
const handlers = [];
|
|
1305
|
+
handlers.push(" 'data.fetch': async (_extensionId: string, payload: FetchRequest): Promise<FetchResponse> => {\n const response = await fetch(payload.url, {\n method: payload.method ?? 'GET',\n headers: payload.headers,\n ...(payload.body !== undefined ? { body: JSON.stringify(payload.body) } : {}),\n })\n const text = await response.text()\n let data: unknown = null\n try {\n data = text ? JSON.parse(text) : null\n } catch {\n data = text\n }\n\n return {\n status: response.status,\n ok: response.ok,\n data,\n }\n },");
|
|
1303
1306
|
if (includeDataQuery) {
|
|
1304
1307
|
handlers.push(" 'data.query': async (_payload: ApiRequest) => {\n return mockData\n },");
|
|
1305
1308
|
}
|
|
@@ -1628,7 +1631,8 @@ var App = ({ command, initialName, initialExtensionId, options }) => {
|
|
|
1628
1631
|
name,
|
|
1629
1632
|
version: resolvedVersion,
|
|
1630
1633
|
targets,
|
|
1631
|
-
permissions: derivePermissions2(targets)
|
|
1634
|
+
permissions: derivePermissions2(targets),
|
|
1635
|
+
allowedDomains: []
|
|
1632
1636
|
},
|
|
1633
1637
|
bundleUrl: bundleUrl || void 0,
|
|
1634
1638
|
enabled
|
|
@@ -1656,7 +1660,8 @@ var App = ({ command, initialName, initialExtensionId, options }) => {
|
|
|
1656
1660
|
name,
|
|
1657
1661
|
version: "0.0.0",
|
|
1658
1662
|
targets,
|
|
1659
|
-
permissions: derivePermissions2(targets)
|
|
1663
|
+
permissions: derivePermissions2(targets),
|
|
1664
|
+
allowedDomains: []
|
|
1660
1665
|
},
|
|
1661
1666
|
bundleUrl: `http://localhost:${extensionPort}`
|
|
1662
1667
|
});
|