How to use the ms.teams function in ms

To help you get started, we’ve selected a few ms 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 microsoft / opensource-portal / routes / api / createRepo.ts View on Github external
const properties = {};
  const parameters = bodyOverride || req.body;
  ourFields.forEach((fieldName) => {
    if (parameters[fieldName] !== undefined) {
      properties[fieldName] = parameters[fieldName];
      delete parameters[fieldName];
    }
  });
  const msProperties = {
    onBehalfOf: properties['ms.onBehalfOf'] || req.headers['ms-onbehalfof'],
    justification: properties['ms.justification'] || req.headers['ms-justification'],
    license: properties['ms.license'] || req.headers['ms-license'],
    approvalType: properties['ms.approval'] || req.headers['ms-approval'],
    approvalUrl: properties['ms.approval-url'] || req.headers['ms-approval-url'],
    notify: properties['ms.notify'] || req.headers['ms-notify'],
    teams: properties['ms.teams'] || req.headers['ms-teams'],
    template: properties['ms.template'] || req.headers['ms-template'],
    projectType: properties['ms.project-type'] || req.headers['ms-project-type'],
  };
  // Validate licenses
  let msLicense = msProperties.license;
  if (!msLicense) {
    throw jsonError(new Error('Missing Microsoft license information'), 422);
  }
  msLicense = msLicense.toLowerCase();
  if (supportedLicenseExpressions.indexOf(msLicense) < 0) {
    throw jsonError(new Error('The provided license expression is not currently supported'), 422);
  }
  // Validate approval types
  const msApprovalType = msProperties.approvalType;
  if (!msApprovalType) {
    throw jsonError(new Error('Missing Microsoft approval type information'), 422);
github microsoft / opensource-portal / routes / api / client / newOrgRepo.ts View on Github external
function translateTeams(body) {
  let admin = body.selectedAdminTeams;
  let write = body.selectedWriteTeams;
  let read = body.selectedReadTeams;

  // Remove teams with higher privileges already
  _.pullAll(write, admin);
  _.pullAll(read, admin);
  _.pullAll(read, write);

  body['ms.teams'] = {
    admin: admin,
    push: write,
    pull: read,
  };

  delete body.selectedAdminTeams;
  delete body.selectedWriteTeams;
  delete body.selectedReadTeams;
}

ms

Tiny millisecond conversion utility

MIT
Latest version published 4 years ago

Package Health Score

76 / 100
Full package analysis