当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript UUID.v1函数代码示例

本文整理汇总了TypeScript中UUID.v1函数的典型用法代码示例。如果您正苦于以下问题:TypeScript v1函数的具体用法?TypeScript v1怎么用?TypeScript v1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了v1函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: installVsTestPlatformToolFromCustomFeed

    // Installs the test platform from a custom feed provided by the user along with credentials for authentication against said feed
    public async installVsTestPlatformToolFromCustomFeed(packageSource: string, versionSelectorInput: string, testPlatformVersion: string, username: string, password: string) {
        let tempConfigFilePath = null;
        try {
            try {
                if (!helpers.isNullEmptyOrUndefined(password)) {
                    tl.debug('Attempting to write feed details along with provided credentials to temporary config file.');
                    tempConfigFilePath = helpers.GenerateTempFile(`${uuid.v1()}.config`);
                    const feedId = uuid.v1();
                    this.prepareNugetConfigFile(packageSource, tempConfigFilePath, username, password, feedId);
                    packageSource = feedId;
                    ci.addToConsolidatedCi('passwordProvided', 'true');
                    ci.addToConsolidatedCi('usernameProvided', `${!helpers.isNullEmptyOrUndefined(username)}`);
                } else {
                    packageSource = tl.getInput(constants.customFeed);
                    tl.debug(`Credentials were not provided. Skipping writing to config file. Will use custom package feed provided by user ${packageSource}`);
                }
            } catch (error) {
                tl.error(error);
                console.log(tl.loc('LatestStableCached'));
                // Look for the latest stable version available in the cache as a fallback.
                testPlatformVersion = 'x';
                tempConfigFilePath = null;
            }

            await this.installVsTestPlatformToolFromSpecifiedFeed(packageSource, testPlatformVersion, versionSelectorInput, tempConfigFilePath);

        } finally {
            helpers.cleanUpTempConfigFile(tempConfigFilePath);
        }
    }
开发者ID:shubham90,项目名称:vsts-tasks,代码行数:31,代码来源:nugetfeedinstaller.ts

示例2:

export const metricsExplorerMetricToTSVBMetric = (metric: MetricsExplorerOptionsMetric) => {
  if (metric.aggregation === MetricsExplorerAggregation.rate) {
    const metricId = uuid.v1();
    const positiveOnlyId = uuid.v1();
    const derivativeId = uuid.v1();
    return [
      {
        id: metricId,
        type: 'max',
        field: metric.field || void 0,
      },
      {
        id: derivativeId,
        type: 'derivative',
        field: metricId,
        unit: '1s',
      },
      {
        id: positiveOnlyId,
        type: 'positive_only',
        field: derivativeId,
      },
    ];
  } else {
    return [
      {
        id: uuid.v1(),
        type: metric.aggregation,
        field: metric.field || void 0,
      },
    ];
  }
};
开发者ID:elastic,项目名称:kibana,代码行数:33,代码来源:create_tsvb_link.ts

示例3: getvsTestConfigurations

export function getvsTestConfigurations() {
    const vsTestConfiguration = {} as models.VsTestConfigurations;
    initTestConfigurations(vsTestConfiguration);
    vsTestConfiguration.isResponseFileRun = false;
    vsTestConfiguration.publishTestResultsInTiaMode = false;
    vsTestConfiguration.publishRunAttachments = tl.getInput('publishRunAttachments');
    vsTestConfiguration.vstestDiagFile = utils.Helper.GenerateTempFile(uuid.v1() + '.txt');
    vsTestConfiguration.responseFile = utils.Helper.GenerateTempFile(uuid.v1() + '.txt');
    vsTestConfiguration.vstestArgsFile = utils.Helper.GenerateTempFile(uuid.v1() + '.txt');
    vsTestConfiguration.responseSupplementryFile = utils.Helper.GenerateTempFile(uuid.v1() + '.txt');
    vsTestConfiguration.responseFileSupported = vsTestConfiguration.vsTestVersionDetails.isResponseFileSupported() || utils.Helper.isToolsInstallerFlow(vsTestConfiguration);
    return vsTestConfiguration;
}
开发者ID:shubham90,项目名称:vsts-tasks,代码行数:13,代码来源:taskinputparser.ts

示例4: getTiaConfiguration

function getTiaConfiguration(): models.TiaConfiguration {
    const tiaConfiguration = {} as models.TiaConfiguration;
    tiaConfiguration.tiaEnabled = tl.getBoolInput('runOnlyImpactedTests');
    tiaConfiguration.tiaRebaseLimit = tl.getInput('runAllTestsAfterXBuilds');
    tiaConfiguration.fileLevel = tl.getVariable('tia.filelevel');
    tiaConfiguration.sourcesDir = tl.getVariable('build.sourcesdirectory');
    tiaConfiguration.tiaFilterPaths = tl.getVariable('TIA_IncludePathFilters');
    tiaConfiguration.runIdFile = utils.Helper.GenerateTempFile(uuid.v1() + '.txt');
    tiaConfiguration.baseLineBuildIdFile = utils.Helper.GenerateTempFile(uuid.v1() + '.txt');
    tiaConfiguration.responseFile = utils.Helper.GenerateTempFile(uuid.v1() + '.txt');

    tiaConfiguration.useNewCollector = false;

    const useNewCollector = tl.getVariable('tia.useNewCollector');
    if (useNewCollector && useNewCollector.toUpperCase() === 'TRUE') {
        tiaConfiguration.useNewCollector = true;
    }

    const buildReason = tl.getVariable('Build.Reason');

    // https://www.visualstudio.com/en-us/docs/build/define/variables
    // PullRequest -> This is the case for TfsGit PR flow
    // CheckInShelveset -> This is the case for TFVC Gated Checkin
    if (buildReason && (buildReason === 'PullRequest' || buildReason === 'CheckInShelveset')) {
        tiaConfiguration.isPrFlow = 'true';
    } else {
        tiaConfiguration.isPrFlow = tl.getVariable('tia.isPrFlow');
    }
    tiaConfiguration.useTestCaseFilterInResponseFile = tl.getVariable('tia.useTestCaseFilterInResponseFile');

    const releaseuri = tl.getVariable('release.releaseUri');
    tiaConfiguration.context = 'CI';
    if (releaseuri) {
        tiaConfiguration.context = 'CD';
    }

    // User map file
    tiaConfiguration.userMapFile = tl.getVariable('tia.usermapfile');

    // disable editing settings file to switch on data collector
    if (tl.getVariable('tia.disabletiadatacollector') && tl.getVariable('tia.disabletiadatacollector').toUpperCase() === 'TRUE') {
        tiaConfiguration.disableEnablingDataCollector = true;
    } else {
        tiaConfiguration.disableEnablingDataCollector = false;
    }

    return tiaConfiguration;
}
开发者ID:shubham90,项目名称:vsts-tasks,代码行数:48,代码来源:taskinputparser.ts

示例5: signToken

    public signToken(user: api.models.UserModel): JwtTokenServiceData {
        if (!user || !user.id) {
            throw new Error('user is not defined to sign the jwt token');
        }

        let userInPayload = {
            id: user.id,
            firstName: user.firstName,
            lastName: user.lastName,
            displayName: user.displayName,
            userName: user.username,
            created: user.created,
            updated: user.updated,
        };
        let xsrfToken = uuid.v1();

        let payload = {
            xsrfToken: xsrfToken,
            user: userInPayload,
        };
        let options: jwt.SignOptions = {
            expiresIn: api.helpers.Config.settings.expiration_jwt_minutes * 60,
            issuer: 'tforex-gateway',
            jwtid: 'uniqueId',
            subject: user.id.toString(),
        };
        let token = jwt.sign(payload, api.helpers.Config.settings.jwt_secret, options);

        let result: JwtTokenServiceData = {
            jwt: token,
            xsrf: xsrfToken,
        };

        return result;
    }
开发者ID:arandehkharghani,项目名称:tforex-gateway,代码行数:35,代码来源:jwt-token.service.ts

示例6: postMessage

export const postErrorResponse = (requestID: string, err: Error) => {
  const id = uuid.v1()

  const response: ResponseMessage = {
    id,
    requestID,
    result: 'error',
    error: err.toString(),
  }

  postMessage(response)
}
开发者ID:influxdata,项目名称:influxdb,代码行数:12,代码来源:utils.ts

示例7: createUser

 public createUser(username:string, email:string, password:string):Q.IPromise<model.db.User> {
     var id = uuid.v1();
     var userDto = {
         id: id,
         username: username,
         email: email,
         password: HashPassword(this._hashType, id, password),
         timestamp: Date.now()
     };
     return this._database.insert("Users", userDto).then((rowId:any) => {
         return userDto;
     });
 }
开发者ID:MorleyDev,项目名称:zander.server,代码行数:13,代码来源:UserRepositoryImpl.ts

示例8: async

export const postSuccessResponse = async (requestID: string, payload: any) => {
  const id = uuid.v1()

  await DB.put(id, payload)

  const response: ResponseMessage = {
    id,
    requestID,
    result: 'success',
  }

  postMessage(response)
}
开发者ID:influxdata,项目名称:influxdb,代码行数:13,代码来源:utils.ts

示例9: createProject

 public createProject(userId:string, project:string, git:string):Q.IPromise<model.db.Project> {
     var projectDto = {
         id: uuid.v1(),
         userId: userId,
         name: project,
         git: git,
         timestamp: Date.now()
     };
     
     return this._database.insert("Projects", projectDto).then((rowId:any) => {
         return projectDto;
     });
 }
开发者ID:MorleyDev,项目名称:zander.server,代码行数:13,代码来源:ProjectRepositoryImpl.ts

示例10: createFilterFromOptions

export const createTSVBLink = (
  source: SourceQuery.Query['source']['configuration'] | undefined,
  options: MetricsExplorerOptions,
  series: MetricsExplorerSeries,
  timeRange: MetricsExplorerTimeOptions
) => {
  const appState = {
    filters: [],
    linked: false,
    query: { language: 'kuery', query: '' },
    uiState: {},
    vis: {
      aggs: [],
      params: {
        axis_formatter: 'number',
        axis_position: 'left',
        axis_scale: 'normal',
        id: uuid.v1(),
        default_index_pattern: (source && source.metricAlias) || 'metricbeat-*',
        index_pattern: (source && source.metricAlias) || 'metricbeat-*',
        interval: 'auto',
        series: options.metrics.map(mapMetricToSeries),
        show_grid: 1,
        show_legend: 1,
        time_field: (source && source.fields.timestamp) || '@timestamp',
        type: 'timeseries',
        filter: createFilterFromOptions(options, series),
      },
      title: series.id,
      type: 'metrics',
    },
  };

  const globalState = {
    refreshInterval: { pause: true, value: 0 },
    time: { from: timeRange.from, to: timeRange.to },
  };

  return `../app/kibana#/visualize/create?type=metrics&_g=${encode(globalState)}&_a=${encode(
    appState as any
  )}`;
};
开发者ID:elastic,项目名称:kibana,代码行数:42,代码来源:create_tsvb_link.ts


注:本文中的UUID.v1函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。