How to use the uuid.v1 function in uuid

To help you get started, we’ve selected a few uuid 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 chnirt / nestjs-graphql-best-practice / src / models / store.entity.ts View on Github external
constructor(store: Partial) {
		if (store) {
			Object.assign(
				this,
				plainToClass(Store, store, {
					excludeExtraneousValues: true
				})
			)
			this._id = this._id || uuid.v1()
			this.isActive = this.isActive !== undefined ? this.isActive : true
			this.createdAt = this.createdAt || +new Date()
			this.updatedAt = +new Date()
		}
	}
}
github soomtong / blititor / core / lib / common.js View on Github external
function getUUID1(mark) {
    if (!mark) {
        mark = '';
    }

    return uuid.v1().replace(/-/g, mark);
}
github liberty-x / lxriddle / helpers.js View on Github external
function generateGUID(){
  return uuid.v1();
}
github bombayjs / bombayjs-server / app / service / web / report.ts View on Github external
public async saveDataToEs(payload) {
    return await this.app.curl(this.app.config.kafkaSubmit, {
        dataType: 'json',
        method: 'POST',
        contentType: 'json',
        data: {
          event: 'web-report-collect',
          id: UUid.v1(),
          timestamp: new Date().getTime(),
          eventLog: payload,
        },
      });
  }
  /**
github HBM / node-jet / lib / jet / daemon.js View on Github external
var get = function (peer, message) {
    var params = checked(message, 'params', 'object')
    params.id = uuid.v1()
    var queueNotification
    var result

    if (params.sort) {
      queueNotification = function (nparams) {
        result = nparams.changes
      }
    } else {
      result = []
      queueNotification = function (nparams) {
        result.push(nparams)
      }
    }

    var queueSuccess = function () {}
github bcvsolutions / CzechIdMng / Realization / frontend / czechidm-core / src / content / automaticrolerequest / AutomaticRoleRequests.js View on Github external
_createNewRequest(event) {
    if (event) {
      event.preventDefault();
    }
    if (!this.refs.modalForm.isFormValid()) {
      return;
    }
    const roleId = this.refs.role.getValue();
    const uuidId = uuid.v1();
    this.context.router.push(`/automatic-role-requests/${uuidId}/new?new=1&roleId=${roleId}`);
  }
github mbudm / fotopia-serverless / fotos / get.ts View on Github external
export async function getItem(event: APIGatewayProxyEvent, context: Context, callback: Callback): Promise {
  const startTime: number = Date.now();
  const traceMeta: ITraceMeta | null = event.body ? JSON.parse(event.body) : null;
  const loggerBaseParams: ILoggerBaseParams = {
    id: uuid.v1(),
    name: "getItem",
    parentId: traceMeta && traceMeta!.parentId || "",
    startTime,
    traceId: traceMeta && traceMeta!.traceId || uuid.v1(),
  };
  try {
    const request: IPathParameters = validatePathParameters(event.pathParameters);
    const ddbParams: DocClient.GetItemInput = getDynamoDbParams(request);
    const ddbResponse: DocClient.GetItemOutput = await getImageRecord(ddbParams);
    const responseBody: IImage = getResponseBody(ddbResponse);
    logger(context, loggerBaseParams, getLogFields(request, responseBody));
    return callback(null, success(responseBody));
  } catch (err) {
    const logFields = event.pathParameters ? getLogFields({
      id: event.pathParameters.id,
      username: event.pathParameters.username,
    }) : getLogFields();
    logger(context, loggerBaseParams, { err, ...logFields });
    return callback(null, failure(err));
  }
github marcellourbani / vscode_abap_remote_fs / client / src / views / abapgit.ts View on Github external
private gitItem(repo: GitRepo): AbapGitItem {
    return {
      repo,
      id: v1(),
      label: repo.sapPackage,
      contextValue: "repository",
      description: repo.url,
      collapsibleState: TreeItemCollapsibleState.None
    }
  }
  public async getGitEnabledServers() {
github ezpaarse-project / ezpaarse / routes / ws.js View on Github external
function startJob(req, res, next) {
  const jobID = req.params[0] || uuid.v1();
  const job = new Job(req, res, jobID, { resIsDeferred: !!req.params[0] });
  job._run()
    .then(() => res.end())
    .catch(next);
}