How to use office-addin-manifest - 2 common examples

To help you get started, we’ve selected a few office-addin-manifest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / Office-Add-in-NodeJS-SSO / SSOAutoSetup / src / configure / configure.js View on Github external
async function updateProjectManifest(applicationId) {
    console.log('Updating manifest with application ID');
    try {
        // Update manifest with application guid and unique manifest id
        const manifestContent = await fs.readFileSync(defaults.manifestPath, 'utf8');
        const re = new RegExp('{application GUID here}', 'g');
        const updatedManifestContent = manifestContent.replace(re, applicationId);
        await fs.writeFileSync(defaults.manifestPath, updatedManifestContent);
        await manifest.modifyManifestFile(defaults.manifestPath, 'random');

    } catch (err) {
        throw new Error(`Unable to update ${defaults.manifestPath}. \n${err}`);
    }
}
github OfficeDev / Office-Add-in-NodeJS-SSO / SSOAutoSetup / src / configure / configure.js View on Github external
async function configureSSOApplication() {
    // Check to see if Azure CLI is installed.  If it isn't installed then install it
    const cliInstalled = await azureCliInstalled();
    if(!cliInstalled) {
        console.log("Azure CLI is not installed.  Installing now before proceeding");
        await installAzureCli();
        console.log('Please close your command shell, reopen and run configure-sso again.  This is neccessary to register the path to the Azure CLI');
        return;
    }

    const userJson = await logIntoAzure();
    if (userJson) {
        console.log('Login was successful!');
        const manifestInfo = await manifest.readManifestFile(defaults.manifestPath);
        const applicationJson = await createNewApplication(manifestInfo.displayName);
        ssoAppData.writeApplicationData(applicationJson.appId);
        const secretJson = await setApplicationSecret(applicationJson);
        ssoAppData.addSecretToCredentialStore(manifestInfo.displayName, secretJson.secretText);
        updateProjectManifest(applicationJson.appId);
        await logoutAzure();
        console.log("Outputting Azure application info:\n");
        console.log(applicationJson);
        
    }
    else {
        throw new Error(`Login to Azure did not succeed.`);
    }
}

office-addin-manifest

Read and modify Office Add-in manifest files.

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis