custom-element-flow
Advanced tools
Comparing version 1.0.48 to 1.0.49
@@ -28,2 +28,4 @@ #!/usr/bin/env node | ||
; | ||
case 'add:component': { | ||
} | ||
default: | ||
@@ -30,0 +32,0 @@ { |
@@ -45,5 +45,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
console.info(`🎉 Your machine is authenticated.`); | ||
return authData; | ||
}); | ||
} |
@@ -38,11 +38,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
; | ||
export function addCustomElementComponent(appId) { | ||
export function addCustomElementComponent(appId, compName) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const authData = yield getAuthData(); | ||
const displayCompName = compName.replace('-', ' '); | ||
if (authData) { | ||
const { data } = yield axios.post(`${appServiceBaseUrl}/${appId}/components`, { | ||
appId, | ||
compName: 'first-widget', | ||
compName: compName, | ||
compType: 'WEB', | ||
compData: defaultWebComponentData, | ||
compData: Object.assign(Object.assign({}, defaultWebComponentData), { webComponentData: Object.assign(Object.assign({}, defaultWebComponentData.webComponentData), { scriptTag: `http://localhost:3300/${compName}/${compName}.bundle.js`, tagName: compName, modalTitle: displayCompName, widget: { | ||
name: displayCompName, | ||
description: "" | ||
} }) }), | ||
}, { | ||
@@ -55,4 +59,10 @@ headers: { | ||
}); | ||
console.log("COMP DATA", data); | ||
return { | ||
compId: data.compId, | ||
}; | ||
} | ||
else { | ||
throw 'failed to create component'; | ||
} | ||
; | ||
}); | ||
@@ -59,0 +69,0 @@ } |
@@ -19,2 +19,6 @@ #!/usr/bin/env node | ||
case 'add:component': { | ||
} | ||
default: { | ||
@@ -21,0 +25,0 @@ console.log('Command not found'); |
{ | ||
"name": "custom-element-flow", | ||
"version": "1.0.48", | ||
"version": "1.0.49", | ||
"description": "My New Project description.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -46,4 +46,2 @@ import { createCallbackServer } from './callback-server.js'; | ||
console.info(`🎉 Your machine is authenticated.`); | ||
return authData; | ||
@@ -50,0 +48,0 @@ } |
@@ -30,4 +30,5 @@ import axios from 'axios'; | ||
export async function addCustomElementComponent(appId: string) { | ||
export async function addCustomElementComponent(appId: string, compName: string): Promise<{ compId: string }> { | ||
const authData = await getAuthData(); | ||
const displayCompName = compName.replace('-', ' '); | ||
@@ -38,5 +39,17 @@ if (authData) { | ||
appId, | ||
compName: 'first-widget', | ||
compName: compName, | ||
compType: 'WEB', | ||
compData: defaultWebComponentData, | ||
compData: { | ||
...defaultWebComponentData, | ||
webComponentData: { | ||
...defaultWebComponentData.webComponentData, | ||
scriptTag: `http://localhost:3300/${compName}/${compName}.bundle.js`, | ||
tagName: compName, | ||
modalTitle: displayCompName, | ||
widget: { | ||
name: displayCompName, | ||
description: "" | ||
} | ||
} | ||
}, | ||
}, | ||
@@ -51,4 +64,8 @@ { | ||
console.log("COMP DATA", data); | ||
} | ||
return { | ||
compId: data.compId, | ||
}; | ||
} else { | ||
throw 'failed to create component'; | ||
}; | ||
} | ||
@@ -55,0 +72,0 @@ |
53531
28
1367
9
4