feat: define submit build info interface and parameters. (#231)
This commit is contained in:
parent
787e4d6fef
commit
8f1263e43d
|
|
@ -31,12 +31,22 @@ custom:
|
||||||
|
|
||||||
functions:
|
functions:
|
||||||
submitBuildInfo:
|
submitBuildInfo:
|
||||||
handler: dist/functions/builds/handler.submitBuildInfo
|
handler: src/functions/builds/handler.submitBuildInfo
|
||||||
events:
|
events:
|
||||||
- http:
|
- http:
|
||||||
path: build
|
path: build
|
||||||
method: post
|
method: post
|
||||||
cors: true
|
cors: true
|
||||||
|
request:
|
||||||
|
parameters:
|
||||||
|
querystrings:
|
||||||
|
githubOrg: true
|
||||||
|
githubRepo: true
|
||||||
|
commitHash: true
|
||||||
|
author: true
|
||||||
|
timestamp: true
|
||||||
|
ipfsHash: true
|
||||||
|
tokenId: true
|
||||||
|
|
||||||
submitMintInfo:
|
submitMintInfo:
|
||||||
handler: dist/functions/mints/handler.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';
|
import { formatJSONResponse } from '@libs/api-gateway';
|
||||||
|
const querystring = require('querystring');
|
||||||
|
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
import { nfaContract } from '@libs/nfa-contract';
|
import { nfaContract } from '@libs/nfa-contract';
|
||||||
|
|
||||||
export const submitBuildInfo = async (): Promise<APIGatewayProxyResult> => {
|
export const submitBuildInfo = async (event: APIGatewayEvent): Promise<APIGatewayProxyResult> => {
|
||||||
try {
|
try {
|
||||||
|
const eventData = querystring.parse(event.body);
|
||||||
const id = v4();
|
const id = v4();
|
||||||
const buildInfo = {
|
const buildInfo = {
|
||||||
buildId: id,
|
buildId: id,
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
|
submittedData: eventData
|
||||||
};
|
};
|
||||||
|
|
||||||
// place holder call
|
// place holder call
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue