-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import ApiCall from "./ApiCall"; | ||
import AnalyticsRules from "./AnalyticsRules"; | ||
import AnalyticsRule from "./AnalyticsRule"; | ||
import AnalyticsEvents from "./AnalyticsEvents"; | ||
export default class Analytics { | ||
private readonly apiCall; | ||
private readonly _analyticsRules; | ||
private readonly individualAnalyticsRules; | ||
private readonly _analyticsEvents; | ||
constructor(apiCall: ApiCall); | ||
rules(id?: string): AnalyticsRules | AnalyticsRule; | ||
events(): AnalyticsEvents; | ||
static get RESOURCEPATH(): string; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface AnalyticsEventCreateSchema { | ||
type: string; | ||
name: string; | ||
data?: object; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import ApiCall from "./ApiCall"; | ||
import { AnalyticsEventCreateSchema } from "./AnalyticsEvent"; | ||
export default class AnalyticsEvents { | ||
private readonly apiCall; | ||
constructor(apiCall: ApiCall); | ||
create(params: AnalyticsEventCreateSchema): Promise<AnalyticsEventCreateSchema>; | ||
private endpointPath; | ||
static get RESOURCEPATH(): string; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface AnalyticsEventCreateSchema { | ||
type: string; | ||
name: string; | ||
data?: object; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import ApiCall from "./ApiCall"; | ||
import { AnalyticsEventCreateSchema } from "./AnalyticsEvent"; | ||
|
||
const RESOURCEPATH = "/analytics/events"; | ||
|
||
export default class AnalyticsEvents { | ||
constructor(private readonly apiCall: ApiCall) { | ||
this.apiCall = apiCall; | ||
} | ||
|
||
async create( | ||
params: AnalyticsEventCreateSchema, | ||
): Promise<AnalyticsEventCreateSchema> { | ||
return this.apiCall.post<AnalyticsEventCreateSchema>( | ||
this.endpointPath(), | ||
params, | ||
); | ||
} | ||
|
||
private endpointPath(operation?: string): string { | ||
return `${AnalyticsEvents.RESOURCEPATH}${ | ||
operation === undefined ? "" : "/" + operation | ||
}`; | ||
} | ||
|
||
static get RESOURCEPATH() { | ||
return RESOURCEPATH; | ||
} | ||
} |