UNPKG

dynamodb-toolbox

Version:

Lightweight and type-safe query builder for DynamoDB and TypeScript.

17 lines (16 loc) 648 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.putAWSAccount = void 0; const putAWSAccount = async (awsAccount, { apiUrl, fetch: _fetch = fetch, apiKey }) => { const response = await _fetch([apiUrl, 'aws-account'].join('/'), { method: 'PUT', headers: { Authorization: apiKey }, body: JSON.stringify(awsAccount), signal: AbortSignal.timeout(30000) }); if (!response.ok) { const { message, Message } = (await response.json()); throw new Error(message !== null && message !== void 0 ? message : Message); } }; exports.putAWSAccount = putAWSAccount;