Skip to content

Commit

Permalink
node: export Param types (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky authored Jan 11, 2023
1 parent ef47e9e commit a1cfb93
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
22 changes: 21 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,28 @@ steps:
- echo "+++ Run tests"
- yarn run -T node lint
- yarn run -T node test
- yarn turbo run --filter=node-integration-tests test
plugins:
- ssh://[email protected]/segmentio/cache-buildkite-plugin#v2.0.0:
key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}"
paths: ['.yarn/cache/']

- label: '[Node] Integration Tests :perfection:'
key: analytics-node-lint-test
agents:
queue: v1
commands:
- npm config set "//registry.npmjs.org/:_authToken" $${NPM_TOKEN}
- echo "--- Install dependencies"
- PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 HUSKY=0 yarn install --immutable
- echo "--- Build bundles"
- yarn turbo run --filter=node-integration-tests build
- echo "+++ Run tests"
- yarn turbo run --filter=node-integration-tests lint
- yarn turbo run --filter=node-integration-tests test
retry:
automatic:
- exit_status: '*'
limit: 2
plugins:
- ssh://[email protected]/segmentio/cache-buildkite-plugin#v2.0.0:
key: "v1.1-cache-dev-{{ checksum 'yarn.lock' }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const execAndKill = async (moduleName: string) => {
cp.stdout?.on('data', (msg) => console.log(msg))
cp.stderr?.on('data', (err) => console.error(err))

await sleep(1000) // wait some amount of time for the server to come online before running autocannon, otherwise we will get connection errors.
await sleep(3000) // wait some amount of time for the server to come online before running autocannon, otherwise we will get connection errors.

const { requests, errors } = await runAutocannon({ amount: TOTAL_REQUESTS })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const execAndKill = async (moduleName: string) => {
cp.stdout?.on('data', (msg) => console.log(msg))
cp.stderr?.on('data', (err) => console.error(err))

await sleep(1000) // wait some amount of time for the server to come online before running autocannon, otherwise we will get connection errors.
await sleep(3000) // wait some amount of time for the server to come online before running autocannon, otherwise we will get connection errors.

const { requests, errors } = await runAutocannon()

Expand Down
10 changes: 10 additions & 0 deletions packages/node/src/app/types/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,23 @@ export type AliasParams = {

export type GroupParams = {
groupId: string
/**
* Traits are pieces of information you know about a group.
* This interface represents reserved traits that Segment has standardized.
* @link https://segment.com/docs/connections/spec/group/#traits
*/
traits?: GroupTraits
context?: ExtraContext
timestamp?: Timestamp
integrations?: Integrations
} & IdentityOptions

export type IdentifyParams = {
/**
* Traits are pieces of information you know about a group.
* This interface represents reserved traits that Segment has standardized.
* @link https://segment.com/docs/connections/spec/group/#traits
*/
traits?: UserTraits
context?: ExtraContext
integrations?: Integrations
Expand Down
11 changes: 10 additions & 1 deletion packages/node/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
export { Analytics } from './app/analytics-node'
export { Context } from './app/context'
export { Plugin, GroupTraits, UserTraits } from './app/types'
export type {
Plugin,
GroupTraits,
UserTraits,
TrackParams,
IdentifyParams,
AliasParams,
GroupParams,
PageParams,
} from './app/types'
export type { AnalyticsSettings } from './app/settings'

// export Analytics as both a named export and a default export (for backwards-compat. reasons)
Expand Down

0 comments on commit a1cfb93

Please sign in to comment.