Skip to content

Commit 0c2f869

Browse files
committed
feat(api): updates (#55)
1 parent dcfb6c3 commit 0c2f869

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

src/resources/events/events.ts

+16-3
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export namespace EventSearchResponse {
408408
/**
409409
* The Orb Customer identifier
410410
*/
411-
customer_id: string;
411+
customer_id: string | null;
412412

413413
/**
414414
* A name to meaningfully identify the action or event type.
@@ -529,10 +529,23 @@ export namespace EventIngestParams {
529529
export interface EventSearchParams {
530530
/**
531531
* This is an explicit array of IDs to filter by. Note that an event's ID is the
532-
* idempotency_key that was originally used for ingestion. Values in this array
533-
* will be treated case sensitively.
532+
* idempotency_key that was originally used for ingestion, and this only supports
533+
* events that have not been amended. Values in this array will be treated case
534+
* sensitively.
534535
*/
535536
event_ids: Array<string>;
537+
538+
/**
539+
* The end of the timeframe, exclusive, in which to search events. If not
540+
* specified, the current time is used.
541+
*/
542+
timeframe_end?: string | null;
543+
544+
/**
545+
* The start of the timeframe, inclusive, in which to search events. If not
546+
* specified, the one week ago is used.
547+
*/
548+
timeframe_start?: string | null;
536549
}
537550

538551
export namespace Events {

tests/api-resources/events/events.test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe('resource events', () => {
118118
});
119119

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

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

0 commit comments

Comments
 (0)