feat: define submit build info interface and parameters. (#231)

This commit is contained in:
Shredder 2023-04-27 13:48:31 +03:30 committed by GitHub
parent 787e4d6fef
commit 8f1263e43d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View File

@ -31,12 +31,22 @@ custom:
functions:
submitBuildInfo:
handler: dist/functions/builds/handler.submitBuildInfo
handler: src/functions/builds/handler.submitBuildInfo
events:
- http:
path: build
method: post
cors: true
request:
parameters:
querystrings:
githubOrg: true
githubRepo: true
commitHash: true
author: true
timestamp: true
ipfsHash: true
tokenId: true
submitMintInfo:
handler: dist/functions/mints/handler.submitMintInfo

View File

@ -1,15 +1,18 @@
import { APIGatewayProxyResult } from 'aws-lambda';
import { APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda';
import { formatJSONResponse } from '@libs/api-gateway';
const querystring = require('querystring');
import { v4 } from 'uuid';
import { nfaContract } from '@libs/nfa-contract';
export const submitBuildInfo = async (): Promise<APIGatewayProxyResult> => {
export const submitBuildInfo = async (event: APIGatewayEvent): Promise<APIGatewayProxyResult> => {
try {
const eventData = querystring.parse(event.body);
const id = v4();
const buildInfo = {
buildId: id,
createdAt: new Date().toISOString(),
submittedData: eventData
};
// place holder call