This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { S3Client, GetObjectCommand } from '@aws-sdk/client-s3'; | |
import { resolve } from 'path'; | |
const s3 = new S3Client({ region: 'S3_REGION' }); | |
const s3Params = { | |
Bucket: 'S3_BUCKET_NAME', | |
Key: 'router-paths.txt' | |
}; | |
const TTL = 10000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function script1({baseId, webhookId, secret}: { | |
baseId: string; | |
webhookId: string; | |
secret: string; | |
}): Promise<{ | |
payloads: { | |
timestamp?: string; | |
baseTransactionNumber?: number; | |
actionMetadata?: { | |
source: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Payload = { | |
timestamp?: string; | |
baseTransactionNumber?: number; | |
actionMetadata?: { | |
source: string; | |
sourceMetadata: { | |
user: { | |
id: string; | |
email: string; | |
permissionLevel: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | reward | difficulty | duration | web | mobile | social | usage | turnover | first_offer | ||
---|---|---|---|---|---|---|---|---|---|---|---|
discount | 5 | 20 | 10 | 1 | 1 | 0 | 0 | 5 | 1 | 7 | |
bogo | 10 | 10 | 7 | 0 | 1 | 1 | 1 | 9 | 2 | 1 | |
discount | 2 | 10 | 10 | 1 | 1 | 1 | 1 | 3 | 3 | 3 | |
discount | 2 | 10 | 7 | 1 | 1 | 1 | 0 | 6 | 4 | 5 | |
bogo | 5 | 5 | 7 | 1 | 1 | 1 | 0 | 7 | 5 | 8 | |
bogo | 10 | 10 | 5 | 1 | 1 | 1 | 1 | 10 | 6 | 2 | |
bogo | 5 | 5 | 5 | 1 | 1 | 1 | 1 | 8 | 7 | 4 | |
discount | 3 | 7 | 7 | 1 | 1 | 1 | 1 | 4 | 8 | 6 | |
informational | 0 | 0 | 4 | 1 | 1 | 1 | 0 | 1 | 9 | 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
channels | offer_type | reward | difficulty | duration | ||
---|---|---|---|---|---|---|
0 | ['email', 'mobile', 'social'] | bogo | 10 | 10 | 7 | |
1 | ['web', 'email', 'mobile', 'social'] | bogo | 10 | 10 | 5 | |
2 | ['web', 'email', 'mobile'] | informational | 0 | 0 | 4 | |
3 | ['web', 'email', 'mobile'] | bogo | 5 | 5 | 7 | |
4 | ['web', 'email'] | discount | 5 | 20 | 10 | |
5 | ['web', 'email', 'mobile', 'social'] | discount | 3 | 7 | 7 | |
6 | ['web', 'email', 'mobile', 'social'] | discount | 2 | 10 | 10 | |
7 | ['email', 'mobile', 'social'] | informational | 0 | 0 | 3 | |
8 | ['web', 'email', 'mobile', 'social'] | bogo | 5 | 5 | 5 |