feat: define submit build info interface and parameters. (#231)
This commit is contained in:
parent
787e4d6fef
commit
8f1263e43d
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue