Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/resources/events/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export namespace EventSearchResponse {
/**
* The Orb Customer identifier
*/
customer_id: string;
customer_id: string | null;

/**
* A name to meaningfully identify the action or event type.
Expand Down Expand Up @@ -529,10 +529,23 @@ export namespace EventIngestParams {
export interface EventSearchParams {
/**
* This is an explicit array of IDs to filter by. Note that an event's ID is the
* idempotency_key that was originally used for ingestion. Values in this array
* will be treated case sensitively.
* idempotency_key that was originally used for ingestion, and this only supports
* events that have not been amended. Values in this array will be treated case
* sensitively.
*/
event_ids: Array<string>;

/**
* The end of the timeframe, exclusive, in which to search events. If not
* specified, the current time is used.
*/
timeframe_end?: string | null;

/**
* The start of the timeframe, inclusive, in which to search events. If not
* specified, the one week ago is used.
*/
timeframe_start?: string | null;
}

export namespace Events {
Expand Down
8 changes: 6 additions & 2 deletions tests/api-resources/events/events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('resource events', () => {
});

test('search: only required params', async () => {
const responsePromise = orb.events.search({ event_ids: ['string', 'string', 'string'] });
const responsePromise = orb.events.search({ event_ids: ['string'] });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -129,6 +129,10 @@ describe('resource events', () => {
});

test('search: required and optional params', async () => {
const response = await orb.events.search({ event_ids: ['string', 'string', 'string'] });
const response = await orb.events.search({
event_ids: ['string'],
timeframe_end: '2019-12-27T18:11:19.117Z',
timeframe_start: '2019-12-27T18:11:19.117Z',
});
});
});