Skip to content

Commit e1483da

Browse files
committed
api: change timestamp key to sentAt
1 parent 4bb5a0b commit e1483da

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

integration/fixtures/streamsql.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration/index.umd.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('integration', () => {
2020
expect(isResponseOK).toBe(true)
2121
})
2222

23-
it('sends streamname, timestamp, and apiVersion', async () => {
23+
it('sends streamname, timestamp (sentAt), and apiVersion', async () => {
2424
let postData
2525
await page.goto(home)
2626
page.on('request', req => {
@@ -31,7 +31,7 @@ describe('integration', () => {
3131
postData = JSON.parse(postData)
3232
}
3333
expect(postData.stream).toMatch('clickstream')
34-
expect(postData.data.timestamp).toBeGreaterThan(15e9)
34+
expect(postData.data.sentAt).toBeGreaterThan(15e9)
3535
expect(postData.data.apiVersion).toMatch(/v[0-9]+/)
3636
}, 10000)
3737

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"check-format": "npm run prettier --list-different"
3030
},
3131
"config": {
32-
"apiVersion": "v1-beta"
32+
"apiVersion": "v1"
3333
},
3434
"devDependencies": {
3535
"@babel/core": "^7.8.4",

src/StreamSQL.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default class StreamSQLClient implements CoreAPI {
6060
this.throwNoInitError()
6161
}
6262
const streamsqlData = {
63-
timestamp: new Date().getTime(),
63+
sentAt: new Date().getTime(),
6464
apiVersion: this.version(),
6565
context: {
6666
language: this.pageCtx.language(),

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export const apiEndpoint = `__APIHOST__` + `/api/send/pixel`
2-
export const apiVersion = `v1-beta` // FIXME: hardcoded
2+
export const apiVersion = `v1` // FIXME: hardcoded

src/test/streamsql.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('StreamSQL Core', () => {
3737
expect(streamsql.init(apiKey)).toBeInstanceOf(StreamSQL)
3838
})
3939

40-
it('sends normalized stream, numeric timestamp, and apiVersion', () => {
40+
it('sends normalized stream, numeric timestamp (sentAt), and apiVersion', () => {
4141
const streamName = 'MyStream'
4242
streamsql.init(apiKey)
4343
// @ts-ignore
@@ -46,7 +46,7 @@ describe('StreamSQL Core', () => {
4646
expect(dataBuilder).toHaveReturnedWith(expect.objectContaining({
4747
stream: expect.stringMatching(streamName.toLowerCase()),
4848
data: expect.objectContaining({
49-
timestamp: expect.any(Number),
49+
sentAt: expect.any(Number),
5050
apiVersion: expect.stringMatching(process.env.npm_package_config_apiVersion!)
5151
})
5252
}))

0 commit comments

Comments
 (0)