Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
}
}
}
function getUUID1(mark) {
if (!mark) {
mark = '';
}
return uuid.v1().replace(/-/g, mark);
}
function generateGUID(){
return uuid.v1();
}
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,
},
});
}
/**
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 () {}
_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}`);
}
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));
}
private gitItem(repo: GitRepo): AbapGitItem {
return {
repo,
id: v1(),
label: repo.sapPackage,
contextValue: "repository",
description: repo.url,
collapsibleState: TreeItemCollapsibleState.None
}
}
public async getGitEnabledServers() {
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);
}