Skip to content

Commit 66a222d

Browse files
authored
adding send action and fields (#3369)
1 parent 14b5d75 commit 66a222d

File tree

3 files changed

+71
-1
lines changed

3 files changed

+71
-1
lines changed

packages/destination-actions/src/destinations/aws-kinesis/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { DestinationDefinition } from '@segment/actions-core'
22
import type { Settings } from './generated-types'
33

4+
import send from './send'
5+
46
const destination: DestinationDefinition<Settings> = {
57
name: 'Aws Kinesis',
68
slug: 'actions-aws-kinesis',
@@ -22,7 +24,9 @@ const destination: DestinationDefinition<Settings> = {
2224
// implement this function and should remove it completely.
2325
},
2426

25-
actions: {}
27+
actions: {
28+
send
29+
}
2630
}
2731

2832
export default destination

packages/destination-actions/src/destinations/aws-kinesis/send/generated-types.ts

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import type { ActionDefinition } from '@segment/actions-core'
2+
import type { Settings } from '../generated-types'
3+
import type { Payload } from './generated-types'
4+
5+
const action: ActionDefinition<Settings, Payload> = {
6+
title: 'Send',
7+
description: 'Send event to AWS Kinesis',
8+
defaultSubscription: 'type = "track" or type = "identify" or type = "page" or type = "screen" or type = "group"',
9+
fields: {
10+
payload: {
11+
label: 'Payload',
12+
description: 'The data to send to AWS Kinesis',
13+
type: 'object',
14+
required: true,
15+
default: { '@path': '$.' }
16+
},
17+
partitionKey: {
18+
label: 'Partition Key',
19+
description: 'The partition key to use for the record',
20+
type: 'string',
21+
required: true,
22+
default: { '@path': '$.messageId' }
23+
},
24+
streamName: {
25+
label: 'Stream Name',
26+
description: 'The name of the Kinesis stream to send records to',
27+
type: 'string',
28+
required: true,
29+
default: { '@path': '$.properties.streamName' }
30+
},
31+
awsRegion: {
32+
label: 'AWS Region',
33+
description: 'The AWS region where the Kinesis stream is located',
34+
type: 'string',
35+
required: true,
36+
default: { '@path': '$.properties.awsRegion' }
37+
}
38+
},
39+
perform: async (_request, _data) => {
40+
// Todo implement functionality
41+
}
42+
}
43+
44+
export default action

0 commit comments

Comments
 (0)