How to use the azure-devops-node-api/interfaces/common/VSSInterfaces.ConnectOptions function in azure-devops-node-api

To help you get started, we’ve selected a few azure-devops-node-api 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 geeklearningio / gl-vsts-tasks-yarn / Tasks / Yarn / packaging / locationUtilities.ts View on Github external
const areaId = getAreaIdForProtocol(protocolType);

  const serviceUri = await getServiceUriFromAreaId(
    collectionUrl,
    accessToken,
    areaId
  );

  const webApi = getWebApiWithProxy(serviceUri);

  const locationApi = await webApi.getLocationsApi();

  tl.debug("Acquiring Packaging endpoints from " + serviceUri);

  const connectionData = await locationApi.getConnectionData(
    interfaces.ConnectOptions.IncludeServices
  );

  tl.debug("Successfully acquired the connection data");
  const defaultAccessPoint: string = connectionData.locationServiceData.accessMappings.find(
    mapping =>
      mapping.moniker ===
      connectionData.locationServiceData.defaultAccessMappingMoniker
  ).accessPoint;

  pkgLocation.DefaultPackagingUri = defaultAccessPoint;
  pkgLocation.PackagingUris.push(defaultAccessPoint);
  pkgLocation.PackagingUris = pkgLocation.PackagingUris.concat(
    connectionData.locationServiceData.accessMappings.map(mapping => {
      return mapping.accessPoint;
    })
  );
github microsoft / azure-pipelines-tasks / Tasks / Common / packaging-common / locationUtilities.ts View on Github external
if (!serverType || serverType.toLowerCase() !== 'hosted') {
        return pkgLocation;
    }

    const accessToken = getSystemAccessToken();
    const areaId = getAreaIdForProtocol(protocolType);

    const serviceUri = await getServiceUriFromAreaId(collectionUrl, accessToken, areaId);

    const webApi = getWebApiWithProxy(serviceUri);

    const locationApi = await webApi.getLocationsApi();

    tl.debug('Acquiring Packaging endpoints from ' + serviceUri);

    const connectionData = await locationApi.getConnectionData(interfaces.ConnectOptions.IncludeServices);

    tl.debug('Successfully acquired the connection data');
    const defaultAccessPoint: string = connectionData.locationServiceData.accessMappings.find((mapping) =>
        mapping.moniker === connectionData.locationServiceData.defaultAccessMappingMoniker
    ).accessPoint;

    pkgLocation.DefaultPackagingUri = defaultAccessPoint;
    pkgLocation.PackagingUris.push(defaultAccessPoint);
    pkgLocation.PackagingUris = pkgLocation.PackagingUris.concat(
        connectionData.locationServiceData.accessMappings.map((mapping) => {
            return mapping.accessPoint;
        }));

    tl.debug('Acquired location');
    tl.debug(JSON.stringify(pkgLocation));
    return pkgLocation;
github microsoft / azure-pipelines-artifact-caching-tasks / Tasks / Common / packaging-common / locationUtilities.ts View on Github external
const accessToken = getSystemAccessToken();
  const areaId = getAreaIdForProtocol(protocolType);

  const serviceUri = await getServiceUriFromAreaId(
    collectionUrl,
    accessToken,
    areaId
  );

  const webApi = getWebApiWithProxy(serviceUri);

  const locationApi = await webApi.getLocationsApi();

  tl.debug("Acquiring Packaging endpoints from " + serviceUri);
  return locationApi
    .getConnectionData(interfaces.ConnectOptions.IncludeServices)
    .then(connectionData => {
      tl.debug("Successfully acquired the connection data");
      const defaultAccessPoint: string = connectionData.locationServiceData.accessMappings.find(
        mapping =>
          mapping.moniker ===
          connectionData.locationServiceData.defaultAccessMappingMoniker
      ).accessPoint;

      pkgLocation.DefaultPackagingUri = defaultAccessPoint;
      pkgLocation.PackagingUris.push(defaultAccessPoint);
      pkgLocation.PackagingUris = pkgLocation.PackagingUris.concat(
        connectionData.locationServiceData.accessMappings.map(mapping => {
          return mapping.accessPoint;
        })
      );