quidproquo-actionprocessor-awslambda 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/getActionProcessor/core/ai/getAiPromptActionProcessor.js +11 -4
- package/lib/commonjs/getActionProcessor/core/ai/getAiPromptStreamActionProcessor.js +11 -4
- package/lib/commonjs/getActionProcessor/core/ai/logic/aiStreamPartMappers.js +8 -8
- package/lib/commonjs/getActionProcessor/core/ai/logic/createDriveFileResolver.d.ts +3 -0
- package/lib/commonjs/getActionProcessor/core/ai/logic/createDriveFileResolver.js +27 -0
- package/lib/commonjs/getActionProcessor/core/ai/logic/index.d.ts +1 -0
- package/lib/commonjs/getActionProcessor/core/ai/logic/index.js +1 -0
- package/lib/commonjs/getActionProcessor/core/ai/logic/toSdkMessages.d.ts +3 -2
- package/lib/commonjs/getActionProcessor/core/ai/logic/toSdkMessages.js +41 -24
- package/lib/commonjs/getActionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js +1 -1
- package/lib/commonjs/getActionProcessor/core/file/getFileStreamOpenActionProcessor.js +1 -3
- package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreUpsertActionProcessor.js +2 -0
- package/lib/commonjs/getActionProcessor/webserver/index.d.ts +0 -1
- package/lib/commonjs/getActionProcessor/webserver/index.js +1 -3
- package/lib/commonjs/lambdaHandlers/helpers/logger.js +1 -3
- package/lib/commonjs/logic/cognito/utils/transformCognitoResponse.js +1 -1
- package/lib/commonjs/logic/dynamo/putItem.d.ts +1 -0
- package/lib/commonjs/logic/dynamo/putItem.js +6 -4
- package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoUpdate.js +1 -5
- package/lib/commonjs/logic/s3/generatePresignedUploadUrl.js +4 -4
- package/lib/esm/getActionProcessor/core/ai/getAiPromptActionProcessor.js +11 -4
- package/lib/esm/getActionProcessor/core/ai/getAiPromptStreamActionProcessor.js +11 -4
- package/lib/esm/getActionProcessor/core/ai/logic/aiStreamPartMappers.js +8 -8
- package/lib/esm/getActionProcessor/core/ai/logic/createDriveFileResolver.d.ts +3 -0
- package/lib/esm/getActionProcessor/core/ai/logic/createDriveFileResolver.js +14 -0
- package/lib/esm/getActionProcessor/core/ai/logic/index.d.ts +1 -0
- package/lib/esm/getActionProcessor/core/ai/logic/index.js +1 -0
- package/lib/esm/getActionProcessor/core/ai/logic/toSdkMessages.d.ts +3 -2
- package/lib/esm/getActionProcessor/core/ai/logic/toSdkMessages.js +27 -20
- package/lib/esm/getActionProcessor/core/apiKeyValidation/getApiKeyValidationValidateActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/file/getFileDeleteActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/file/getFileGenerateTemporarySecureUrlActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/file/getFileStreamOpenActionProcessor.js +1 -3
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreDeleteActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreGetActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreGetAllActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreQueryActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreScanActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreUpdateActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreUpsertActionProcessor.js +2 -0
- package/lib/esm/getActionProcessor/core/queue/getQueueSendMessageActionProcessor.js +1 -1
- package/lib/esm/getActionProcessor/webserver/index.d.ts +0 -1
- package/lib/esm/getActionProcessor/webserver/index.js +0 -3
- package/lib/esm/lambdaHandlers/helpers/logger.js +1 -3
- package/lib/esm/logic/cognito/utils/transformCognitoResponse.js +2 -2
- package/lib/esm/logic/dynamo/putItem.d.ts +1 -0
- package/lib/esm/logic/dynamo/putItem.js +6 -0
- package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoUpdate.js +1 -5
- package/lib/esm/logic/s3/generatePresignedUploadUrl.js +5 -5
- package/lib/extension-layer/qpq-log-extension/index.js +29 -29
- package/package.json +7 -8
- package/lib/commonjs/getActionProcessor/webserver/extract/getExtractExpenseActionProcessor.d.ts +0 -2
- package/lib/commonjs/getActionProcessor/webserver/extract/getExtractExpenseActionProcessor.js +0 -56
- package/lib/commonjs/getActionProcessor/webserver/extract/index.d.ts +0 -2
- package/lib/commonjs/getActionProcessor/webserver/extract/index.js +0 -17
- package/lib/commonjs/logic/textract/analyzeExpense.d.ts +0 -51
- package/lib/commonjs/logic/textract/analyzeExpense.js +0 -31
- package/lib/commonjs/logic/textract/index.d.ts +0 -2
- package/lib/commonjs/logic/textract/index.js +0 -18
- package/lib/commonjs/logic/textract/transformExpenseResponse.d.ts +0 -29
- package/lib/commonjs/logic/textract/transformExpenseResponse.js +0 -180
- package/lib/esm/getActionProcessor/webserver/extract/getExtractExpenseActionProcessor.d.ts +0 -2
- package/lib/esm/getActionProcessor/webserver/extract/getExtractExpenseActionProcessor.js +0 -40
- package/lib/esm/getActionProcessor/webserver/extract/index.d.ts +0 -2
- package/lib/esm/getActionProcessor/webserver/extract/index.js +0 -4
- package/lib/esm/logic/textract/analyzeExpense.d.ts +0 -51
- package/lib/esm/logic/textract/analyzeExpense.js +0 -18
- package/lib/esm/logic/textract/index.d.ts +0 -2
- package/lib/esm/logic/textract/index.js +0 -2
- package/lib/esm/logic/textract/transformExpenseResponse.d.ts +0 -29
- package/lib/esm/logic/textract/transformExpenseResponse.js +0 -173
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
-
import { actionResult, qpqCoreUtils
|
|
2
|
+
import { actionResult, qpqCoreUtils } from 'quidproquo-core';
|
|
3
3
|
import { ApiKeyValidationActionType } from 'quidproquo-webserver';
|
|
4
4
|
import { timingSafeEqual } from 'crypto';
|
|
5
5
|
import { getConfigRuntimeResourceName } from '../../../awsNamingUtils';
|
|
@@ -3,7 +3,7 @@ import { actionResult, actionResultError, actionResultErrorFromCaughtError, Erro
|
|
|
3
3
|
import { getEventBusSnsTopicArn } from '../../../awsNamingUtils';
|
|
4
4
|
import { publishMessage } from '../../../logic/sns/publishMessage';
|
|
5
5
|
const getProcessEventBusSendMessage = (qpqConfig) => {
|
|
6
|
-
return async ({ eventBusName, eventBusMessages
|
|
6
|
+
return async ({ eventBusName, eventBusMessages }, session) => {
|
|
7
7
|
const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
8
8
|
const eventBusConfig = qpqCoreUtils.getEventBusConfigByName(eventBusName, qpqConfig);
|
|
9
9
|
if (!eventBusConfig) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
-
import { actionResult, actionResultError, actionResultErrorFromCaughtError, FileActionType, FileDeleteErrorTypeEnum } from 'quidproquo-core';
|
|
2
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, FileActionType, FileDeleteErrorTypeEnum, } from 'quidproquo-core';
|
|
3
3
|
import { deleteFiles } from '../../../logic/s3/s3Utils';
|
|
4
4
|
import { resolveStorageDriveBucketName } from './utils';
|
|
5
5
|
const getProcessFileDelete = (qpqConfig) => {
|
package/lib/esm/getActionProcessor/core/file/getFileGenerateTemporarySecureUrlActionProcessor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
2
|
import { actionResultError, ErrorTypeEnum } from 'quidproquo-core';
|
|
3
|
-
import { actionResult, FileActionType, FileGenerateTemporarySecureUrlErrorTypeEnum } from 'quidproquo-core';
|
|
3
|
+
import { actionResult, FileActionType, FileGenerateTemporarySecureUrlErrorTypeEnum, } from 'quidproquo-core';
|
|
4
4
|
import { generatePresignedUrl } from '../../../logic/s3/generatePresignedUrl';
|
|
5
5
|
import { resolveStorageDriveBucketName } from './utils';
|
|
6
6
|
// SigV4 presigned URLs cannot expire more than 7 days in the future
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
2
|
import { actionResultError, ErrorTypeEnum } from 'quidproquo-core';
|
|
3
|
-
import { actionResult, FileActionType, FileGenerateTemporaryUploadSecureUrlErrorTypeEnum } from 'quidproquo-core';
|
|
3
|
+
import { actionResult, FileActionType, FileGenerateTemporaryUploadSecureUrlErrorTypeEnum, } from 'quidproquo-core';
|
|
4
4
|
import { generatePresignedUploadUrl } from '../../../logic/s3/generatePresignedUploadUrl';
|
|
5
5
|
import { resolveStorageDriveBucketName } from './utils';
|
|
6
6
|
// SigV4 presigned URLs cannot expire more than 7 days in the future
|
|
@@ -34,9 +34,7 @@ const getProcessFileStreamOpen = (qpqConfig) => {
|
|
|
34
34
|
const streamId = `s3-${randomGuid()}`;
|
|
35
35
|
const isText = encoding === 'text';
|
|
36
36
|
const size = chunkSize ?? 65536;
|
|
37
|
-
const transform = isText
|
|
38
|
-
? (buf) => buf.toString('utf8')
|
|
39
|
-
: (buf) => buf.toString('base64');
|
|
37
|
+
const transform = isText ? (buf) => buf.toString('utf8') : (buf) => buf.toString('base64');
|
|
40
38
|
const iterator = chunkedReadableIterator(response.Body, size, transform);
|
|
41
39
|
streamRegistry.register(streamId, iterator);
|
|
42
40
|
return actionResult({ id: streamId, encoding });
|
package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreDeleteActionProcessor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
2
|
import { qpqCoreUtils } from 'quidproquo-core';
|
|
3
|
-
import { actionResult, actionResultError, actionResultErrorFromCaughtError, KeyValueStoreActionType, KeyValueStoreDeleteErrorTypeEnum } from 'quidproquo-core';
|
|
3
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, KeyValueStoreActionType, KeyValueStoreDeleteErrorTypeEnum, } from 'quidproquo-core';
|
|
4
4
|
import { getKvsDynamoTableNameFromConfig } from '../../../awsNamingUtils';
|
|
5
5
|
import { deleteItem } from '../../../logic/dynamo';
|
|
6
6
|
const getProcessKeyValueStoreDelete = (qpqConfig) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
-
import { actionResult, actionResultError, actionResultErrorFromCaughtError, KeyValueStoreActionType, KeyValueStoreGetErrorTypeEnum } from 'quidproquo-core';
|
|
2
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, KeyValueStoreActionType, KeyValueStoreGetErrorTypeEnum, } from 'quidproquo-core';
|
|
3
3
|
import { getKvsDynamoTableNameFromConfig } from '../../../awsNamingUtils';
|
|
4
4
|
import { getItem } from '../../../logic/dynamo';
|
|
5
5
|
const getProcessKeyValueStoreGet = (qpqConfig) => {
|
package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreGetAllActionProcessor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
-
import { actionResult, actionResultError, actionResultErrorFromCaughtError, KeyValueStoreActionType, KeyValueStoreGetAllErrorTypeEnum } from 'quidproquo-core';
|
|
2
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, KeyValueStoreActionType, KeyValueStoreGetAllErrorTypeEnum, } from 'quidproquo-core';
|
|
3
3
|
import { getKvsDynamoTableNameFromConfig } from '../../../awsNamingUtils';
|
|
4
4
|
import { getAllItems } from '../../../logic/dynamo';
|
|
5
5
|
const getProcessKeyValueStoreGetAll = (qpqConfig) => {
|
package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreQueryActionProcessor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
-
import { actionResultError, actionResultErrorFromCaughtError, ErrorTypeEnum, qpqCoreUtils } from 'quidproquo-core';
|
|
2
|
+
import { actionResultError, actionResultErrorFromCaughtError, ErrorTypeEnum, qpqCoreUtils, } from 'quidproquo-core';
|
|
3
3
|
import { actionResult, KeyValueStoreActionType, KeyValueStoreQueryErrorTypeEnum } from 'quidproquo-core';
|
|
4
4
|
import { getKvsDynamoTableNameFromConfig } from '../../../awsNamingUtils';
|
|
5
5
|
import { query } from '../../../logic/dynamo';
|
package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreScanActionProcessor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
-
import { actionResultError, actionResultErrorFromCaughtError } from 'quidproquo-core';
|
|
2
|
+
import { actionResultError, actionResultErrorFromCaughtError, } from 'quidproquo-core';
|
|
3
3
|
import { actionResult, KeyValueStoreActionType, KeyValueStoreScanErrorTypeEnum } from 'quidproquo-core';
|
|
4
4
|
import { getKvsDynamoTableNameFromConfig } from '../../../awsNamingUtils';
|
|
5
5
|
import { scan } from '../../../logic/dynamo/scan';
|
package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreUpdateActionProcessor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
2
|
import { qpqCoreUtils } from 'quidproquo-core';
|
|
3
|
-
import { actionResult, actionResultError, actionResultErrorFromCaughtError, KeyValueStoreActionType, KeyValueStoreUpdateErrorTypeEnum } from 'quidproquo-core';
|
|
3
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, KeyValueStoreActionType, KeyValueStoreUpdateErrorTypeEnum, } from 'quidproquo-core';
|
|
4
4
|
import { getKvsDynamoTableNameFromConfig } from '../../../awsNamingUtils';
|
|
5
5
|
import { updateItem } from '../../../logic/dynamo';
|
|
6
6
|
const getProcessKeyValueStoreUpdate = (qpqConfig) => {
|
package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreUpsertActionProcessor.js
CHANGED
|
@@ -20,6 +20,7 @@ const getProcessKeyValueStoreUpsert = (qpqConfig) => {
|
|
|
20
20
|
try {
|
|
21
21
|
await putItem(dynamoTableName, item, keys, {
|
|
22
22
|
expires: options?.ttlInSeconds,
|
|
23
|
+
ifNotExistsAttribute: options?.ifNotExists ? storeConfig.partitionKey.key : undefined,
|
|
23
24
|
}, region);
|
|
24
25
|
return actionResult(void 0);
|
|
25
26
|
}
|
|
@@ -27,6 +28,7 @@ const getProcessKeyValueStoreUpsert = (qpqConfig) => {
|
|
|
27
28
|
return actionResultErrorFromCaughtError(error, {
|
|
28
29
|
InternalServerError: () => actionResultError(KeyValueStoreUpsertErrorTypeEnum.ServiceUnavailable, 'KVS Service Unavailable'),
|
|
29
30
|
ResourceNotFoundException: () => actionResultError(KeyValueStoreUpsertErrorTypeEnum.ResourceNotFound, 'KVS Resource Not Found'),
|
|
31
|
+
ConditionalCheckFailedException: () => actionResultError(KeyValueStoreUpsertErrorTypeEnum.Conflict, 'KVS item already exists'),
|
|
30
32
|
});
|
|
31
33
|
}
|
|
32
34
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
-
import { actionResult, actionResultError, actionResultErrorFromCaughtError, QueueActionType, QueueSendMessagesErrorTypeEnum, toCrossServiceSession } from 'quidproquo-core';
|
|
2
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, QueueActionType, QueueSendMessagesErrorTypeEnum, toCrossServiceSession, } from 'quidproquo-core';
|
|
3
3
|
import { sendMessages } from '../../../logic/sqs/sendMessages';
|
|
4
4
|
import { resolveResourceName } from '../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils';
|
|
5
5
|
const getProcessQueueSendMessage = (qpqConfig) => {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { getExtractActionProcessor } from './extract';
|
|
2
1
|
import { getServiceFunctionActionProcessor } from './serviceFunction';
|
|
3
2
|
import { getWebEntryActionProcessor } from './webEntry';
|
|
4
3
|
import { getWebsocketActionProcessor } from './websocket';
|
|
5
|
-
export * from './extract';
|
|
6
4
|
export * from './serviceFunction';
|
|
7
5
|
export * from './webEntry';
|
|
8
6
|
export * from './websocket';
|
|
9
7
|
export const getWebserverActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
|
|
10
|
-
...(await getExtractActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
11
8
|
...(await getWebEntryActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
12
9
|
...(await getServiceFunctionActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
13
10
|
...(await getWebsocketActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
@@ -76,9 +76,7 @@ const createBufferedLogger = (bucketName, regionForBucket, ship) => {
|
|
|
76
76
|
let disabledLogCorrelations = [];
|
|
77
77
|
return {
|
|
78
78
|
enableLogs: async (enable, reason, correlation) => {
|
|
79
|
-
disabledLogCorrelations = enable
|
|
80
|
-
? disabledLogCorrelations.filter((dlc) => dlc !== correlation)
|
|
81
|
-
: [...disabledLogCorrelations, correlation];
|
|
79
|
+
disabledLogCorrelations = enable ? disabledLogCorrelations.filter((dlc) => dlc !== correlation) : [...disabledLogCorrelations, correlation];
|
|
82
80
|
},
|
|
83
81
|
log: (result) => {
|
|
84
82
|
// Defer all work (including JSON.stringify) to a microtask so the caller is not blocked.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AuthenticateUserChallenge } from 'quidproquo-core';
|
|
1
|
+
import { AuthenticateUserChallenge, getQpqIsoDateTimeFromDate } from 'quidproquo-core';
|
|
2
2
|
import { ChallengeNameType } from '@aws-sdk/client-cognito-identity-provider';
|
|
3
3
|
export const cognitoAuthenticationResultTypeToQpqAuthenticationInfo = (authResult, issueDateTime) => {
|
|
4
4
|
// Parse the issueDateTime and add the expiresIn to get the expiration date
|
|
5
5
|
let issueDate = new Date(issueDateTime);
|
|
6
6
|
issueDate.setSeconds(issueDate.getSeconds() + (authResult.ExpiresIn || 0));
|
|
7
|
-
const expiresAt = issueDate
|
|
7
|
+
const expiresAt = getQpqIsoDateTimeFromDate(issueDate);
|
|
8
8
|
return {
|
|
9
9
|
accessToken: authResult.AccessToken,
|
|
10
10
|
idToken: authResult.IdToken,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { KvsKey } from 'quidproquo-core';
|
|
2
2
|
export interface PutItemOptions {
|
|
3
3
|
expires?: number;
|
|
4
|
+
ifNotExistsAttribute?: string;
|
|
4
5
|
}
|
|
5
6
|
export declare function putItem<Item, T extends object = any>(tableName: string, item: Item, attributes: KvsKey[], options: PutItemOptions, region: string): Promise<void>;
|
|
@@ -29,5 +29,11 @@ export async function putItem(tableName, item, attributes, options, region) {
|
|
|
29
29
|
await dynamoDBClient.send(new PutItemCommand({
|
|
30
30
|
TableName: tableName,
|
|
31
31
|
Item: convertObjectToDynamoItem(item),
|
|
32
|
+
...(options.ifNotExistsAttribute
|
|
33
|
+
? {
|
|
34
|
+
ConditionExpression: 'attribute_not_exists(#ineAttr)',
|
|
35
|
+
ExpressionAttributeNames: { '#ineAttr': options.ifNotExistsAttribute },
|
|
36
|
+
}
|
|
37
|
+
: {}),
|
|
32
38
|
}));
|
|
33
39
|
}
|
|
@@ -115,11 +115,7 @@ const buildDynamoUpdateExpressionPart = (update, updateIndex) => {
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
// Types that generate SET expressions
|
|
118
|
-
const SET_ACTION_TYPES = [
|
|
119
|
-
KvsUpdateActionType.Set,
|
|
120
|
-
KvsUpdateActionType.SetIfNotExists,
|
|
121
|
-
KvsUpdateActionType.Increment
|
|
122
|
-
];
|
|
118
|
+
const SET_ACTION_TYPES = [KvsUpdateActionType.Set, KvsUpdateActionType.SetIfNotExists, KvsUpdateActionType.Increment];
|
|
123
119
|
const buildDynamoUpdateExpressionForClause = (clause, actionTypes, kvsUpdate) => {
|
|
124
120
|
const actions = kvsUpdate.filter((update) => actionTypes.includes(update.action));
|
|
125
121
|
if (actions.length === 0) {
|
|
@@ -3,9 +3,9 @@ import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
|
|
3
3
|
// import { createPresignedPost } from '@aws-sdk/s3-presigned-post';
|
|
4
4
|
import { createAwsClient } from '../createAwsClient';
|
|
5
5
|
// export const generatePresignedUploadFormUrl = async (
|
|
6
|
-
// bucketName: string,
|
|
7
|
-
// objectKey: string,
|
|
8
|
-
// region: string,
|
|
6
|
+
// bucketName: string,
|
|
7
|
+
// objectKey: string,
|
|
8
|
+
// region: string,
|
|
9
9
|
// expirationMs: number,
|
|
10
10
|
// contentType: string | undefined,
|
|
11
11
|
// maxSizeBytes?: number | undefined
|
|
@@ -46,8 +46,8 @@ export const generatePresignedUploadUrl = async (bucketName, objectKey, region,
|
|
|
46
46
|
ContentType: contentType,
|
|
47
47
|
Metadata: {
|
|
48
48
|
...(correlationId && { 'correlation-id': correlationId }),
|
|
49
|
-
'upload-timestamp': Date.now().toString()
|
|
50
|
-
}
|
|
49
|
+
'upload-timestamp': Date.now().toString(),
|
|
50
|
+
},
|
|
51
51
|
});
|
|
52
52
|
const url = await getSignedUrl(s3Client, putObjectCommand, {
|
|
53
53
|
expiresIn: expirationMs / 1000,
|