diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b953088f..5533e515 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,11 +21,15 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - - name: Lint + - name: Lint core uses: golangci/golangci-lint-action@v6 with: version: latest working-directory: core + + - name: Lint dashboard + run: task dashboard:lint:ci + test: runs-on: ubuntu-latest steps: diff --git a/bun.lockb b/bun.lockb index b6a95215..cad1ceb1 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/dashboard/Taskfile.yaml b/dashboard/Taskfile.yaml index d6c102dc..bc02e7a9 100644 --- a/dashboard/Taskfile.yaml +++ b/dashboard/Taskfile.yaml @@ -41,3 +41,8 @@ tasks: lint: cmds: - bun run lint + + "lint:ci": + cmds: + - bun run typecheck + - bun run lint:ci diff --git a/dashboard/app/api/auth.ts b/dashboard/app/api/auth.ts index be8bc6e1..e3a5c933 100644 --- a/dashboard/app/api/auth.ts +++ b/dashboard/app/api/auth.ts @@ -1,4 +1,4 @@ -import { client, type ClientOptions, type DataResponse } from './client'; +import { type ClientOptions, type DataResponse, client } from './client'; const authLogin = async ( opts: ClientOptions<'AuthLogin'>, diff --git a/dashboard/app/api/settings.ts b/dashboard/app/api/settings.ts index 40f6ad33..02136081 100644 --- a/dashboard/app/api/settings.ts +++ b/dashboard/app/api/settings.ts @@ -1,4 +1,4 @@ -import { type ClientOptions, client, type DataResponse } from './client'; +import { type ClientOptions, type DataResponse, client } from './client'; const usageGet = async (): Promise> => { const res = await client('/settings/usage', {}); diff --git a/dashboard/app/api/stats.ts b/dashboard/app/api/stats.ts index f91bb209..1100d6c3 100644 --- a/dashboard/app/api/stats.ts +++ b/dashboard/app/api/stats.ts @@ -1,4 +1,4 @@ -import { client, type ClientOptions, type DataResponse } from './client'; +import { type ClientOptions, type DataResponse, client } from './client'; const statsSummary = async ( opts: ClientOptions<'StatsSummary'>, diff --git a/dashboard/app/api/types.d.ts b/dashboard/app/api/types.d.ts index 4e4e59cf..14550951 100644 --- a/dashboard/app/api/types.d.ts +++ b/dashboard/app/api/types.d.ts @@ -3,1625 +3,2157 @@ * Do not make direct changes to the file. */ - export interface paths { - "/auth/login": { - /** - * Login - * @description Login to the service and retrieve a session token for authentication. - */ - post: operations["post-auth-login"]; - }; - "/auth/logout": { - /** - * Logout - * @description Logout of the service and destroy the session token. - */ - post: operations["post-auth-logout"]; - }; - "/event/hit": { - /** - * Send Hit Event - * @description Send a hit event to register a user view or interaction. - */ - post: operations["post-event-hit"]; - }; - "/event/ping": { - /** - * Ping - * @description Ping endpoint to determine if the user is unique or not. - */ - get: operations["get-event-ping"]; - }; - "/settings/usage": { - /** - * Get Resource Usage - * @description Get the current CPU, memory and disk usage of the server. - */ - get: operations["get-settings-usage"]; - /** - * Update Resource Usage - * @description Update the resource usage settings of the server. - */ - patch: operations["patch-settings-usage"]; - }; - "/user": { - /** - * Get User Info - * @description Retrieve the information of the user with the matching user ID. - */ - get: operations["get-user"]; - /** - * Delete User - * @description Delete a user account. - */ - delete: operations["delete-user"]; - /** - * Update User Info - * @description Update a user account's details. - */ - patch: operations["patch-user"]; - }; - "/websites": { - /** - * List Websites - * @description Get a list of all websites from the user. - */ - get: operations["get-websites"]; - /** - * Add Website - * @description Add a new website. - */ - post: operations["post-websites"]; - }; - "/websites/{hostname}": { - /** - * Get Website - * @description Get website details for an individual website. - */ - get: operations["get-websites-id"]; - /** - * Delete Website - * @description Delete a website. - */ - delete: operations["delete-websites-id"]; - /** - * Update Website - * @description Update a website's information. - */ - patch: operations["patch-websites-id"]; - }; - "/website/{hostname}/summary": { - /** - * Get Stat Summary - * @description Get a summary of the website's stats. - */ - get: operations["get-website-id-summary"]; - }; - "/website/{hostname}/pages": { - /** - * Get Page Stats - * @description Get a list of pages and their stats. - */ - get: operations["get-website-id-pages"]; - }; - "/website/{hostname}/time": { - /** - * Get Time Stats - * @description Get a list of pages and their time stats. - */ - get: operations["get-website-id-time"]; - }; - "/website/{hostname}/referrers": { - /** - * Get Referrer Stats - * @description Get a list of referrers and their stats. - */ - get: operations["get-website-id-referrers"]; - }; - "/website/{hostname}/sources": { - /** - * Get UTM Source Stats - * @description Get a list of UTM sources and their stats. - */ - get: operations["get-website-id-sources"]; - }; - "/website/{hostname}/mediums": { - /** - * Get UTM Medium Stats - * @description Get a list of UTM mediums and their stats. - */ - get: operations["get-website-id-mediums"]; - }; - "/website/{hostname}/campaigns": { - /** - * Get UTM Campaign Stats - * @description Get a list of UTM campaigns and their stats. - */ - get: operations["get-website-id-campaigns"]; - }; - "/website/{hostname}/browsers": { - /** - * Get Browser Stats - * @description Get a list of browsers and their stats. - */ - get: operations["get-website-id-browsers"]; - }; - "/website/{hostname}/os": { - /** - * Get OS Stats - * @description Get a list of OS and their stats. - */ - get: operations["get-website-id-os"]; - }; - "/website/{hostname}/devices": { - /** - * Get Device Stats - * @description Get a list of devices and their stats. - */ - get: operations["get-website-id-device"]; - }; - "/website/{hostname}/countries": { - /** - * Get Country Stats - * @description Get a list of countries and their stats. - */ - get: operations["get-website-id-country"]; - }; - "/website/{hostname}/languages": { - /** - * Get Language Stats - * @description Get a list of languages and their stats. - */ - get: operations["get-website-id-language"]; - }; -} - -export type webhooks = Record; - -export interface components { - schemas: { - /** - * AuthLogin - * @description Request body for logging in. - */ - AuthLogin: { - username: string; - /** Format: password */ - password: string; - }; - /** - * EventLoad - * @description Page view load event. - */ - EventLoad: { - /** @description Beacon ID generated for each user to link multiple events on the same page together. */ - b: string; - /** - * Format: uri - * @description Page URL including query parameters. - */ - u: string; - /** @description Referrer URL. */ - r?: string; - /** @description If the user is a unique user or not. */ - p: boolean; - /** @description If the user has visited this page before or not. */ - q: boolean; - /** @description Timezone of the user. */ - t?: string; - }; - /** - * EventUnload - * @description Page view unload event. - */ - EventUnload: { - /** @description Beacon ID generated for each user to link multiple events on the same page together. */ - b: string; - /** @description Time spent on page in milliseconds. */ - m: number; - }; - /** - * EventHit - * @description Website hit event. - */ - EventHit: components["schemas"]["EventLoad"] | components["schemas"]["EventUnload"]; - FilterString: { - /** @description Equal to. */ - eq?: string; - /** @description Not equal to. */ - neq?: string; - /** @description Contains. */ - contains?: string; - /** @description Does not contain. */ - not_contains?: string; - /** @description Starts with. */ - starts_with?: string; - /** @description Does not start with. */ - not_starts_with?: string; - /** @description Ends with. */ - ends_with?: string; - /** @description Does not end with. */ - not_ends_with?: string; - /** @description In. */ - in?: string; - /** @description Not in. */ - not_in?: string; - }; - /** - * UserGet - * @description Response body for getting a user. - */ - UserGet: { - username: string; - /** - * @default en - * @enum {string} - */ - language: "en"; - /** Format: int64 */ - dateCreated: number; - /** Format: int64 */ - dateUpdated: number; - }; - /** - * UserPatch - * @description Request body for updating a user. - */ - UserPatch: { - username?: string; - /** Format: password */ - password?: string; - /** - * @default en - * @enum {string} - */ - language?: "en"; - }; - /** - * WebsiteGet - * @description Response body for getting a website. - */ - WebsiteGet: { - /** Format: hostname */ - hostname: string; - summary?: { - visitors: number; - }; - }; - /** - * WebsiteCreate - * @description Request body for creating a website. - */ - WebsiteCreate: { - /** Format: hostname */ - hostname: string; - }; - /** - * WebsitePatch - * @description Request body for updating a website. - */ - WebsitePatch: { - /** Format: hostname */ - hostname?: string; - }; - /** - * SettingsUsageGet - * @description Response body for getting CPU, memory and disk usage of the server. - */ - SettingsUsageGet: { - cpu: { - /** Format: float */ - usage: number; - cores: number; - threads: number; - }; - memory: { - /** Format: int64 */ - used: number; - /** Format: int64 */ - total: number; - }; - disk: { - /** Format: int64 */ - used: number; - /** Format: int64 */ - total: number; - }; - metadata: { - threads?: number; - memory_limit?: string; - }; - }; - /** - * SettingsUsagePatch - * @description Request body for updating the resource limits of the application. - */ - SettingsUsagePatch: { - threads?: number; - memory_limit?: string; - }; - /** StatsSummary */ - StatsSummary: { - current: { - visitors: number; - pageviews: number; - /** Format: float */ - bounce_percentage: number; - duration: number; - }; - previous?: { - visitors: number; - pageviews: number; - /** Format: float */ - bounce_percentage: number; - duration: number; - }; - interval?: { - date: string; - visitors?: number; - pageviews?: number; - /** Format: float */ - bounce_percentage?: number; - duration?: number; - }[]; - }; - /** StatsPages */ - StatsPages: { - /** @description Pathname of the page. */ - path: string; - /** @description Number of unique visitors for given page. */ - visitors: number; + "/auth/login": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; /** - * Format: float - * @description Percentage of unique visitors for given page. + * Login + * @description Login to the service and retrieve a session token for authentication. */ - visitors_percentage: number; - /** @description Number of page views. */ - pageviews?: number; + post: operations["post-auth-login"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/auth/logout": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; /** - * Format: float - * @description Percentage of page views. + * Logout + * @description Logout of the service and destroy the session token. */ - pageviews_percentage?: number; + post: operations["post-auth-logout"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/event/hit": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; /** - * Format: float - * @description Bounce rate percentage. + * Send Hit Event + * @description Send a hit event to register a user view or interaction. */ - bounce_percentage?: number; - /** @description Total time spent on page in milliseconds. */ - duration?: number; - }[]; - /** StatsTime */ - StatsTime: { - /** @description Pathname of the page. */ - path: string; - /** @description Number of unique visitors for given page. */ - visitors?: number; - /** @description Median time spent on page in milliseconds. */ - duration: number; - /** @description Total time spent on page in milliseconds for the upper quartile (75%). */ - duration_upper_quartile?: number; - /** @description Total time spent on page in milliseconds for the lower quartile (25%). */ - duration_lower_quartile?: number; + post: operations["post-event-hit"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/event/ping": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Percentage of time contributing to the total time spent on the website. + * Ping + * @description Ping endpoint to determine if the user is unique or not. */ - duration_percentage: number; - }[]; - /** StatsReferrers */ - StatsReferrers: { - /** @description Referrer URL. */ - referrer: string; - /** @description Number of unique visitors from referrer. */ - visitors: number; + get: operations["get-event-ping"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/settings/usage": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Percentage of unique visitors from referrer. + * Get Resource Usage + * @description Get the current CPU, memory and disk usage of the server. */ - visitors_percentage: number; + get: operations["get-settings-usage"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; /** - * Format: float - * @description Bounce rate percentage from referrer. + * Update Resource Usage + * @description Update the resource usage settings of the server. */ - bounce_percentage?: number; - /** @description Total time spent on page from referrer in milliseconds. */ - duration?: number; - }[]; - /** StatsUTMSources */ - StatsUTMSources: { - /** @description UTM source. */ - source: string; - /** @description Number of unique visitors from UTM source. */ - visitors: number; + patch: operations["patch-settings-usage"]; + trace?: never; + }; + "/user": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Percentage of unique visitors from UTM source. + * Get User Info + * @description Retrieve the information of the user with the matching user ID. */ - visitors_percentage: number; + get: operations["get-user"]; + put?: never; + post?: never; /** - * Format: float - * @description Bounce rate percentage from UTM source. + * Delete User + * @description Delete a user account. */ - bounce_percentage?: number; - /** @description Total time spent on page from UTM source in milliseconds. */ - duration?: number; - }[]; - /** StatsUTMMediums */ - StatsUTMMediums: { - /** @description UTM medium. */ - medium: string; - /** @description Number of unique visitors from UTM medium. */ - visitors: number; + delete: operations["delete-user"]; + options?: never; + head?: never; /** - * Format: float - * @description Percentage of unique visitors from UTM medium. + * Update User Info + * @description Update a user account's details. */ - visitors_percentage: number; + patch: operations["patch-user"]; + trace?: never; + }; + "/websites": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Bounce rate percentage from UTM medium. + * List Websites + * @description Get a list of all websites from the user. */ - bounce_percentage?: number; - /** @description Total time spent on page from UTM medium in milliseconds. */ - duration?: number; - }[]; - /** StatsUTMCampaigns */ - StatsUTMCampaigns: { - /** @description UTM campaign. */ - campaign: string; - /** @description Number of unique visitors from UTM campaign. */ - visitors: number; + get: operations["get-websites"]; + put?: never; /** - * Format: float - * @description Percentage of unique visitors from UTM campaign. + * Add Website + * @description Add a new website. */ - visitors_percentage: number; + post: operations["post-websites"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/websites/{hostname}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Bounce rate percentage from UTM campaign. + * Get Website + * @description Get website details for an individual website. */ - bounce_percentage?: number; - /** @description Total time spent on page from UTM campaign in milliseconds. */ - duration?: number; - }[]; - /** StatsBrowsers */ - StatsBrowsers: { - /** @description Browser name. */ - browser: string; - /** @description Number of unique visitors from browser. */ - visitors: number; + get: operations["get-websites-id"]; + put?: never; + post?: never; /** - * Format: float - * @description Percentage of unique visitors from browser. + * Delete Website + * @description Delete a website. */ - visitors_percentage: number; + delete: operations["delete-websites-id"]; + options?: never; + head?: never; /** - * Format: float - * @description Bounce rate percentage from browser. + * Update Website + * @description Update a website's information. */ - bounce_percentage?: number; - /** @description Total time spent on page from browser in milliseconds. */ - duration?: number; - }[]; - /** StatsOS */ - StatsOS: { - /** @description OS name. */ - os: string; - /** @description Number of unique visitors from OS. */ - visitors: number; + patch: operations["patch-websites-id"]; + trace?: never; + }; + "/website/{hostname}/summary": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Percentage of unique visitors from OS. + * Get Stat Summary + * @description Get a summary of the website's stats. */ - visitors_percentage: number; + get: operations["get-website-id-summary"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/pages": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Bounce rate percentage from OS. + * Get Page Stats + * @description Get a list of pages and their stats. */ - bounce_percentage?: number; - /** @description Total time spent on page from OS in milliseconds. */ - duration?: number; - }[]; - /** StatsDevices */ - StatsDevices: { - /** @description Device name. */ - device: string; - /** @description Number of unique visitors from device. */ - visitors: number; + get: operations["get-website-id-pages"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/time": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Percentage of unique visitors from device. + * Get Time Stats + * @description Get a list of pages and their time stats. */ - visitors_percentage: number; + get: operations["get-website-id-time"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/referrers": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Bounce rate percentage from device. + * Get Referrer Stats + * @description Get a list of referrers and their stats. */ - bounce_percentage?: number; - /** @description Total time spent on page from device in milliseconds. */ - duration?: number; - }[]; - /** StatsCountries */ - StatsCountries: { - /** @description Country name. */ - country: string; - /** @description Number of unique visitors from country. */ - visitors: number; + get: operations["get-website-id-referrers"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/sources": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get UTM Source Stats + * @description Get a list of UTM sources and their stats. + */ + get: operations["get-website-id-sources"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/mediums": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Percentage of unique visitors from country. + * Get UTM Medium Stats + * @description Get a list of UTM mediums and their stats. */ - visitors_percentage: number; + get: operations["get-website-id-mediums"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/campaigns": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Bounce rate percentage from country. + * Get UTM Campaign Stats + * @description Get a list of UTM campaigns and their stats. */ - bounce_percentage?: number; - /** @description Total time spent on page from country in milliseconds. */ - duration?: number; - }[]; - /** - * StatsLanguages - * @description List of languages and their stats. - */ - StatsLanguages: { + get: operations["get-website-id-campaigns"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/browsers": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * @description Language name. - * @example English + * Get Browser Stats + * @description Get a list of browsers and their stats. */ - language: string; - /** @description Number of unique visitors for language. */ - visitors: number; + get: operations["get-website-id-browsers"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/os": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Percentage of unique visitors for language. + * Get OS Stats + * @description Get a list of OS and their stats. */ - visitors_percentage: number; + get: operations["get-website-id-os"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/devices": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; /** - * Format: float - * @description Bounce rate percentage for language. + * Get Device Stats + * @description Get a list of devices and their stats. */ - bounce_percentage?: number; - /** @description Total time spent on page from language in milliseconds. */ - duration?: number; - }[]; - }; - responses: { - /** @description 400 Bad Request. */ - BadRequestError: { - content: { - "application/json": { - error: { - /** - * Format: int32 - * @default 400 - */ - code: number; - message: string; - }; + get: operations["get-website-id-device"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/countries": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - }; + /** + * Get Country Stats + * @description Get a list of countries and their stats. + */ + get: operations["get-website-id-country"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/website/{hostname}/languages": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get Language Stats + * @description Get a list of languages and their stats. + */ + get: operations["get-website-id-language"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - /** @description 401 Unauthorised. */ - UnauthorisedError: { - content: { - "application/json": { - error: { +} +export type webhooks = Record; +export interface components { + schemas: { + /** + * AuthLogin + * @description Request body for logging in. + */ + AuthLogin: { + username: string; + /** Format: password */ + password: string; + }; + /** + * EventLoad + * @description Page view load event. + */ + EventLoad: { + /** @description Beacon ID generated for each user to link multiple events on the same page together. */ + b: string; /** - * Format: int32 - * @default 401 + * Format: uri + * @description Page URL including query parameters. */ - code: number; - message: string; - }; + u: string; + /** @description Referrer URL. */ + r?: string; + /** @description If the user is a unique user or not. */ + p: boolean; + /** @description If the user has visited this page before or not. */ + q: boolean; + /** @description Timezone of the user. */ + t?: string; + /** + * @description discriminator enum property added by openapi-typescript + * @enum {string} + */ + e: "load"; }; - }; - }; - /** @description 403 Forbidden. */ - ForbiddenError: { - content: { - "application/json": { - error: { + /** + * EventUnload + * @description Page view unload event. + */ + EventUnload: { + /** @description Beacon ID generated for each user to link multiple events on the same page together. */ + b: string; + /** @description Time spent on page in milliseconds. */ + m: number; /** - * Format: int32 - * @default 403 + * @description discriminator enum property added by openapi-typescript + * @enum {string} */ - code: number; - message: string; - }; + e: "unload"; }; - }; - }; - /** @description 404 Not Found. */ - NotFoundError: { - content: { - "application/json": { - error: { + /** + * EventHit + * @description Website hit event. + */ + EventHit: components["schemas"]["EventLoad"] | components["schemas"]["EventUnload"]; + FilterString: { + /** @description Equal to. */ + eq?: string; + /** @description Not equal to. */ + neq?: string; + /** @description Contains. */ + contains?: string; + /** @description Does not contain. */ + not_contains?: string; + /** @description Starts with. */ + starts_with?: string; + /** @description Does not start with. */ + not_starts_with?: string; + /** @description Ends with. */ + ends_with?: string; + /** @description Does not end with. */ + not_ends_with?: string; + /** @description In. */ + in?: string; + /** @description Not in. */ + not_in?: string; + }; + /** + * UserGet + * @description Response body for getting a user. + */ + UserGet: { + username: string; /** - * Format: int32 - * @default 404 + * @default en + * @enum {string} */ - code: number; - message: string; - }; + language: "en"; + /** Format: int64 */ + dateCreated: number; + /** Format: int64 */ + dateUpdated: number; }; - }; - }; - /** @description 409 Conflict Found. */ - ConflictError: { - content: { - "application/json": { - error: { + /** + * UserPatch + * @description Request body for updating a user. + */ + UserPatch: { + username?: string; + /** Format: password */ + password?: string; /** - * Format: int32 - * @default 409 + * @default en + * @enum {string} */ - code: number; - message: string; - }; + language: "en"; }; - }; - }; - /** @description 500 Unexpected Internal Server Error. */ - InternalServerError: { - content: { - "application/json": { - error: { + /** + * WebsiteGet + * @description Response body for getting a website. + */ + WebsiteGet: { + /** Format: hostname */ + hostname: string; + summary?: { + visitors: number; + }; + }; + /** + * WebsiteCreate + * @description Request body for creating a website. + */ + WebsiteCreate: { + /** Format: hostname */ + hostname: string; + }; + /** + * WebsitePatch + * @description Request body for updating a website. + */ + WebsitePatch: { + /** Format: hostname */ + hostname?: string; + }; + /** + * SettingsUsageGet + * @description Response body for getting CPU, memory and disk usage of the server. + */ + SettingsUsageGet: { + cpu: { + /** Format: float */ + usage: number; + cores: number; + threads: number; + }; + memory: { + /** Format: int64 */ + used: number; + /** Format: int64 */ + total: number; + }; + disk: { + /** Format: int64 */ + used: number; + /** Format: int64 */ + total: number; + }; + metadata: { + threads?: number; + memory_limit?: string; + }; + }; + /** + * SettingsUsagePatch + * @description Request body for updating the resource limits of the application. + */ + SettingsUsagePatch: { + threads?: number; + memory_limit?: string; + }; + /** StatsSummary */ + StatsSummary: { + current: { + visitors: number; + pageviews: number; + /** Format: float */ + bounce_percentage: number; + duration: number; + }; + previous?: { + visitors: number; + pageviews: number; + /** Format: float */ + bounce_percentage: number; + duration: number; + }; + interval?: { + date: string; + visitors?: number; + pageviews?: number; + /** Format: float */ + bounce_percentage?: number; + duration?: number; + }[]; + }; + /** StatsPages */ + StatsPages: { + /** @description Pathname of the page. */ + path: string; + /** @description Number of unique visitors for given page. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors for given page. + */ + visitors_percentage: number; + /** @description Number of page views. */ + pageviews?: number; + /** + * Format: float + * @description Percentage of page views. + */ + pageviews_percentage?: number; + /** + * Format: float + * @description Bounce rate percentage. + */ + bounce_percentage?: number; + /** @description Total time spent on page in milliseconds. */ + duration?: number; + }[]; + /** StatsTime */ + StatsTime: { + /** @description Pathname of the page. */ + path: string; + /** @description Number of unique visitors for given page. */ + visitors?: number; + /** @description Median time spent on page in milliseconds. */ + duration: number; + /** @description Total time spent on page in milliseconds for the upper quartile (75%). */ + duration_upper_quartile?: number; + /** @description Total time spent on page in milliseconds for the lower quartile (25%). */ + duration_lower_quartile?: number; + /** + * Format: float + * @description Percentage of time contributing to the total time spent on the website. + */ + duration_percentage: number; + }[]; + /** StatsReferrers */ + StatsReferrers: { + /** @description Referrer URL. */ + referrer: string; + /** @description Number of unique visitors from referrer. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors from referrer. + */ + visitors_percentage: number; + /** + * Format: float + * @description Bounce rate percentage from referrer. + */ + bounce_percentage?: number; + /** @description Total time spent on page from referrer in milliseconds. */ + duration?: number; + }[]; + /** StatsUTMSources */ + StatsUTMSources: { + /** @description UTM source. */ + source: string; + /** @description Number of unique visitors from UTM source. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors from UTM source. + */ + visitors_percentage: number; + /** + * Format: float + * @description Bounce rate percentage from UTM source. + */ + bounce_percentage?: number; + /** @description Total time spent on page from UTM source in milliseconds. */ + duration?: number; + }[]; + /** StatsUTMMediums */ + StatsUTMMediums: { + /** @description UTM medium. */ + medium: string; + /** @description Number of unique visitors from UTM medium. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors from UTM medium. + */ + visitors_percentage: number; + /** + * Format: float + * @description Bounce rate percentage from UTM medium. + */ + bounce_percentage?: number; + /** @description Total time spent on page from UTM medium in milliseconds. */ + duration?: number; + }[]; + /** StatsUTMCampaigns */ + StatsUTMCampaigns: { + /** @description UTM campaign. */ + campaign: string; + /** @description Number of unique visitors from UTM campaign. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors from UTM campaign. + */ + visitors_percentage: number; + /** + * Format: float + * @description Bounce rate percentage from UTM campaign. + */ + bounce_percentage?: number; + /** @description Total time spent on page from UTM campaign in milliseconds. */ + duration?: number; + }[]; + /** StatsBrowsers */ + StatsBrowsers: { + /** @description Browser name. */ + browser: string; + /** @description Number of unique visitors from browser. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors from browser. + */ + visitors_percentage: number; /** - * Format: int32 - * @default 500 + * Format: float + * @description Bounce rate percentage from browser. */ - code: number; - message: string; - }; + bounce_percentage?: number; + /** @description Total time spent on page from browser in milliseconds. */ + duration?: number; + }[]; + /** StatsOS */ + StatsOS: { + /** @description OS name. */ + os: string; + /** @description Number of unique visitors from OS. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors from OS. + */ + visitors_percentage: number; + /** + * Format: float + * @description Bounce rate percentage from OS. + */ + bounce_percentage?: number; + /** @description Total time spent on page from OS in milliseconds. */ + duration?: number; + }[]; + /** StatsDevices */ + StatsDevices: { + /** @description Device name. */ + device: string; + /** @description Number of unique visitors from device. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors from device. + */ + visitors_percentage: number; + /** + * Format: float + * @description Bounce rate percentage from device. + */ + bounce_percentage?: number; + /** @description Total time spent on page from device in milliseconds. */ + duration?: number; + }[]; + /** StatsCountries */ + StatsCountries: { + /** @description Country name. */ + country: string; + /** @description Number of unique visitors from country. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors from country. + */ + visitors_percentage: number; + /** + * Format: float + * @description Bounce rate percentage from country. + */ + bounce_percentage?: number; + /** @description Total time spent on page from country in milliseconds. */ + duration?: number; + }[]; + /** + * StatsLanguages + * @description List of languages and their stats. + */ + StatsLanguages: { + /** + * @description Language name. + * @example English + */ + language: string; + /** @description Number of unique visitors for language. */ + visitors: number; + /** + * Format: float + * @description Percentage of unique visitors for language. + */ + visitors_percentage: number; + /** + * Format: float + * @description Bounce rate percentage for language. + */ + bounce_percentage?: number; + /** @description Total time spent on page from language in milliseconds. */ + duration?: number; + }[]; + }; + responses: { + /** @description 400 Bad Request. */ + BadRequestError: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: { + /** + * Format: int32 + * @default 400 + */ + code: number; + message: string; + }; + }; + }; + }; + /** @description 401 Unauthorised. */ + UnauthorisedError: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: { + /** + * Format: int32 + * @default 401 + */ + code: number; + message: string; + }; + }; + }; + }; + /** @description 403 Forbidden. */ + ForbiddenError: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: { + /** + * Format: int32 + * @default 403 + */ + code: number; + message: string; + }; + }; + }; + }; + /** @description 404 Not Found. */ + NotFoundError: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: { + /** + * Format: int32 + * @default 404 + */ + code: number; + message: string; + }; + }; + }; + }; + /** @description 409 Conflict Found. */ + ConflictError: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: { + /** + * Format: int32 + * @default 409 + */ + code: number; + message: string; + }; + }; + }; + }; + /** @description 500 Unexpected Internal Server Error. */ + InternalServerError: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + error: { + /** + * Format: int32 + * @default 500 + */ + code: number; + message: string; + }; + }; + }; }; - }; }; - }; - parameters: { - /** @description Session token for authentication. */ - SessionAuth: string; - /** @description Hostname for the website. */ - Hostname: string; - /** @description Return a summary of the stats. */ - Summary?: boolean; - /** @description Path of the page. */ - Path?: components["schemas"]["FilterString"]; - /** @description Referrer URL of the page hit. */ - Referrer?: components["schemas"]["FilterString"]; - /** @description UTM source of the page hit. */ - UTMSource?: components["schemas"]["FilterString"]; - /** @description UTM medium of the page hit. */ - UTMMedium?: components["schemas"]["FilterString"]; - /** @description UTM campaign of the page hit. */ - UTMCampaign?: components["schemas"]["FilterString"]; - /** @description Browser name. */ - Browser?: components["schemas"]["FilterString"]; - /** @description Operating system name. */ - OS?: components["schemas"]["FilterString"]; - /** @description Device type. */ - Device?: components["schemas"]["FilterString"]; - /** @description Country name. */ - Country?: components["schemas"]["FilterString"]; - /** @description Language code. */ - Language?: components["schemas"]["FilterString"]; - /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ - PeriodStart?: string; - /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ - PeriodEnd?: string; - /** @description Limit the number of results. */ - Limit?: number; - /** @description Offset the results paired with the limit parameter. */ - Offset?: number; - }; - requestBodies: never; - headers: never; - pathItems: never; + parameters: { + /** @description Session token for authentication. */ + SessionAuth: string; + /** @description Hostname for the website. */ + Hostname: string; + /** @description Return a summary of the stats. */ + Summary: boolean; + /** @description Path of the page. */ + Path: components["schemas"]["FilterString"]; + /** @description Referrer URL of the page hit. */ + Referrer: components["schemas"]["FilterString"]; + /** @description UTM source of the page hit. */ + UTMSource: components["schemas"]["FilterString"]; + /** @description UTM medium of the page hit. */ + UTMMedium: components["schemas"]["FilterString"]; + /** @description UTM campaign of the page hit. */ + UTMCampaign: components["schemas"]["FilterString"]; + /** @description Browser name. */ + Browser: components["schemas"]["FilterString"]; + /** @description Operating system name. */ + OS: components["schemas"]["FilterString"]; + /** @description Device type. */ + Device: components["schemas"]["FilterString"]; + /** @description Country name. */ + Country: components["schemas"]["FilterString"]; + /** @description Language code. */ + Language: components["schemas"]["FilterString"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + PeriodStart: string; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + PeriodEnd: string; + /** @description Limit the number of results. */ + Limit: number; + /** @description Offset the results paired with the limit parameter. */ + Offset: number; + }; + requestBodies: never; + headers: never; + pathItems: never; } - export type $defs = Record; - -export type external = Record; - export interface operations { - - /** - * Login - * @description Login to the service and retrieve a session token for authentication. - */ - "post-auth-login": { - /** @description Login details. */ - requestBody: { - content: { - "application/json": components["schemas"]["AuthLogin"]; - }; - }; - responses: { - /** @description Success */ - 200: { - headers: { - /** @description Set the cookie for the session. */ - "Set-Cookie": string; - }; - content: never; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Logout - * @description Logout of the service and destroy the session token. - */ - "post-auth-logout": { - parameters: { - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - responses: { - /** @description Success */ - 204: { - headers: { - /** @description Destroy the cookie for the session. */ - "Set-Cookie": string; - }; - content: never; - }; - 401: components["responses"]["UnauthorisedError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Send Hit Event - * @description Send a hit event to register a user view or interaction. - */ - "post-event-hit": { - parameters: { - header?: { - /** @description Used to infer user browser, OS and device. */ - "User-Agent"?: string; - /** @description Used to infer user language. */ - "Accept-Language"?: string; - }; - }; - /** @description Hit event metadata. */ - requestBody: { - content: { - "application/json": components["schemas"]["EventHit"]; - }; - }; - responses: { - /** @description OK. */ - 204: { - content: never; - }; - 400: components["responses"]["BadRequestError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Ping - * @description Ping endpoint to determine if the user is unique or not. - */ - "get-event-ping": { - parameters: { - query?: { - /** @description Optional query parameter that is the current host and pathname of the page. */ - u?: string; - }; - header?: { - /** @description If this exists, then user exists in cache and is not a unique user. */ - "If-Modified-Since"?: string; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - /** @description This is date of the current day from midnight, incremented by each page view by unique user. */ - "Last-Modified": string; - /** @description This is set to 1 day to prevent the user from being counted as a unique user again. */ - "Cache-Control": string; - }; - content: { - "text/plain": string; - }; - }; - 400: components["responses"]["BadRequestError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Get Resource Usage - * @description Get the current CPU, memory and disk usage of the server. - */ - "get-settings-usage": { - parameters: { - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["SettingsUsageGet"]; - }; - }; - 401: components["responses"]["UnauthorisedError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Update Resource Usage - * @description Update the resource usage settings of the server. - */ - "patch-settings-usage": { - parameters: { - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - /** @description Resource usage settings to update. */ - requestBody: { - content: { - "application/json": components["schemas"]["SettingsUsagePatch"]; - }; - }; - responses: { - /** @description Success */ - 201: { - content: never; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Get User Info - * @description Retrieve the information of the user with the matching user ID. - */ - "get-user": { - parameters: { - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - responses: { - /** @description User Found */ - 200: { - content: { - "application/json": components["schemas"]["UserGet"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Delete User - * @description Delete a user account. - */ - "delete-user": { - parameters: { - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - responses: { - /** @description Success No Content */ - 204: { - content: never; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Update User Info - * @description Update a user account's details. - */ - "patch-user": { - parameters: { - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - /** @description User details to update. */ - requestBody: { - content: { - "application/json": components["schemas"]["UserPatch"]; - }; - }; - responses: { - /** @description Success */ - 200: { - content: { - "application/json": components["schemas"]["UserGet"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 409: components["responses"]["ConflictError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * List Websites - * @description Get a list of all websites from the user. - */ - "get-websites": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - responses: { - /** @description Returns a list of websites. */ - 200: { - content: { - "application/json": components["schemas"]["WebsiteGet"][]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Add Website - * @description Add a new website. - */ - "post-websites": { - requestBody: { - content: { - "application/json": components["schemas"]["WebsiteCreate"]; - }; - }; - responses: { - /** @description Created */ - 201: { - content: { - "application/json": components["schemas"]["WebsiteGet"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 409: components["responses"]["ConflictError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Get Website - * @description Get website details for an individual website. - */ - "get-websites-id": { - parameters: { - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["WebsiteGet"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Delete Website - * @description Delete a website. - */ - "delete-websites-id": { - parameters: { - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - responses: { - /** @description Success No Content */ - 204: { - content: never; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; - }; - }; - /** - * Update Website - * @description Update a website's information. - */ - "patch-websites-id": { - parameters: { - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; - }; - /** @description Website details to update. */ - requestBody: { - content: { - "application/json": components["schemas"]["WebsitePatch"]; - }; + "post-auth-login": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Login details. */ + requestBody: { + content: { + "application/json": components["schemas"]["AuthLogin"]; + }; + }; + responses: { + /** @description Success */ + 200: { + headers: { + /** @description Set the cookie for the session. */ + "Set-Cookie": string; + [name: string]: unknown; + }; + content?: never; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description Success */ - 200: { - content: { - "application/json": components["schemas"]["WebsiteGet"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "post-auth-logout": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description Success */ + 204: { + headers: { + /** @description Destroy the cookie for the session. */ + "Set-Cookie": string; + [name: string]: unknown; + }; + content?: never; + }; + 401: components["responses"]["UnauthorisedError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get Stat Summary - * @description Get a summary of the website's stats. - */ - "get-website-id-summary": { - parameters: { - query?: { - /** @description Retrieve the data from the previous period as well. This is useful when comparing data from the previous period to the current period. Requires the start and end period parameters to be set. */ - previous?: boolean; - /** @description The interval to group the data by. This can be set to minute, hour, day, week or month. This will return an interval property if set. */ - interval?: "minute" | "hour" | "day" | "week" | "month"; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "post-event-hit": { + parameters: { + query?: never; + header?: { + /** @description Used to infer user browser, OS and device. */ + "User-Agent"?: string; + /** @description Used to infer user language. */ + "Accept-Language"?: string; + }; + path?: never; + cookie?: never; + }; + /** @description Hit event metadata. */ + requestBody: { + content: { + "application/json": components["schemas"]["EventHit"]; + }; + }; + responses: { + /** @description OK. */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: components["responses"]["BadRequestError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsSummary"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "get-event-ping": { + parameters: { + query?: { + /** @description Optional query parameter that is the current host and pathname of the page. */ + u?: string; + }; + header?: { + /** @description If this exists, then user exists in cache and is not a unique user. */ + "If-Modified-Since"?: string; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + /** @description This is date of the current day from midnight, incremented by each page view by unique user. */ + "Last-Modified": string; + /** @description This is set to 1 day to prevent the user from being counted as a unique user again. */ + "Cache-Control": string; + [name: string]: unknown; + }; + content: { + "text/plain": string; + }; + }; + 400: components["responses"]["BadRequestError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get Page Stats - * @description Get a list of pages and their stats. - */ - "get-website-id-pages": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "get-settings-usage": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["SettingsUsageGet"]; + }; + }; + 401: components["responses"]["UnauthorisedError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsPages"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "patch-settings-usage": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + /** @description Resource usage settings to update. */ + requestBody: { + content: { + "application/json": components["schemas"]["SettingsUsagePatch"]; + }; + }; + responses: { + /** @description Success */ + 201: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get Time Stats - * @description Get a list of pages and their time stats. - */ - "get-website-id-time": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "get-user": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description User Found */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["UserGet"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsTime"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "delete-user": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description Success No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get Referrer Stats - * @description Get a list of referrers and their stats. - */ - "get-website-id-referrers": { - parameters: { - query?: { - /** @description Whether to return the grouped aggregation name or only URLs. */ - grouped?: boolean; - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "patch-user": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + /** @description User details to update. */ + requestBody: { + content: { + "application/json": components["schemas"]["UserPatch"]; + }; + }; + responses: { + /** @description Success */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["UserGet"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 409: components["responses"]["ConflictError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsReferrers"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "get-websites": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + }; + header?: never; + path?: never; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description Returns a list of websites. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["WebsiteGet"][]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get UTM Source Stats - * @description Get a list of UTM sources and their stats. - */ - "get-website-id-sources": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "post-websites": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["WebsiteCreate"]; + }; + }; + responses: { + /** @description Created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["WebsiteGet"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 409: components["responses"]["ConflictError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsUTMSources"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "get-websites-id": { + parameters: { + query?: never; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["WebsiteGet"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get UTM Medium Stats - * @description Get a list of UTM mediums and their stats. - */ - "get-website-id-mediums": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "delete-websites-id": { + parameters: { + query?: never; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description Success No Content */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsUTMMediums"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "patch-websites-id": { + parameters: { + query?: never; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + /** @description Website details to update. */ + requestBody: { + content: { + "application/json": components["schemas"]["WebsitePatch"]; + }; + }; + responses: { + /** @description Success */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["WebsiteGet"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get UTM Campaign Stats - * @description Get a list of UTM campaigns and their stats. - */ - "get-website-id-campaigns": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "get-website-id-summary": { + parameters: { + query?: { + /** @description Retrieve the data from the previous period as well. This is useful when comparing data from the previous period to the current period. Requires the start and end period parameters to be set. */ + previous?: boolean; + /** @description The interval to group the data by. This can be set to minute, hour, day, week or month. This will return an interval property if set. */ + interval?: "minute" | "hour" | "day" | "week" | "month"; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsSummary"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsUTMCampaigns"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "get-website-id-pages": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsPages"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get Browser Stats - * @description Get a list of browsers and their stats. - */ - "get-website-id-browsers": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "get-website-id-time": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsTime"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsBrowsers"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "get-website-id-referrers": { + parameters: { + query?: { + /** @description Whether to return the grouped aggregation name or only URLs. */ + grouped?: boolean; + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsReferrers"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get OS Stats - * @description Get a list of OS and their stats. - */ - "get-website-id-os": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "get-website-id-sources": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsUTMSources"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsOS"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "get-website-id-mediums": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsUTMMediums"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get Device Stats - * @description Get a list of devices and their stats. - */ - "get-website-id-device": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "get-website-id-campaigns": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsUTMCampaigns"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsDevices"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "get-website-id-browsers": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsBrowsers"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get Country Stats - * @description Get a list of countries and their stats. - */ - "get-website-id-country": { - parameters: { - query?: { - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "get-website-id-os": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsOS"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsCountries"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "get-website-id-device": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsDevices"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; - /** - * Get Language Stats - * @description Get a list of languages and their stats. - */ - "get-website-id-language": { - parameters: { - query?: { - /** @description Whether to return the language name or the language dialect/locale. */ - locale?: boolean; - summary?: components["parameters"]["Summary"]; - start?: components["parameters"]["PeriodStart"]; - end?: components["parameters"]["PeriodEnd"]; - path?: components["parameters"]["Path"]; - referrer?: components["parameters"]["Referrer"]; - utm_source?: components["parameters"]["UTMSource"]; - utm_medium?: components["parameters"]["UTMMedium"]; - utm_campaign?: components["parameters"]["UTMCampaign"]; - browser?: components["parameters"]["Browser"]; - os?: components["parameters"]["OS"]; - device?: components["parameters"]["Device"]; - country?: components["parameters"]["Country"]; - language?: components["parameters"]["Language"]; - limit?: components["parameters"]["Limit"]; - offset?: components["parameters"]["Offset"]; - }; - path: { - hostname: components["parameters"]["Hostname"]; - }; - cookie: { - _me_sess: components["parameters"]["SessionAuth"]; - }; + "get-website-id-country": { + parameters: { + query?: { + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsCountries"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["StatsLanguages"]; - }; - }; - 400: components["responses"]["BadRequestError"]; - 401: components["responses"]["UnauthorisedError"]; - 403: components["responses"]["ForbiddenError"]; - 404: components["responses"]["NotFoundError"]; - 500: components["responses"]["InternalServerError"]; + "get-website-id-language": { + parameters: { + query?: { + /** @description Whether to return the language name or the language dialect/locale. */ + locale?: boolean; + /** @description Return a summary of the stats. */ + summary?: components["parameters"]["Summary"]; + /** @description Period start date using date-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + start?: components["parameters"]["PeriodStart"]; + /** @description Period end date using fdate-time notation in RFC3339 format, for example, (2017-07-21T17:32:28Z). */ + end?: components["parameters"]["PeriodEnd"]; + /** @description Path of the page. */ + path?: components["parameters"]["Path"]; + /** @description Referrer URL of the page hit. */ + referrer?: components["parameters"]["Referrer"]; + /** @description UTM source of the page hit. */ + utm_source?: components["parameters"]["UTMSource"]; + /** @description UTM medium of the page hit. */ + utm_medium?: components["parameters"]["UTMMedium"]; + /** @description UTM campaign of the page hit. */ + utm_campaign?: components["parameters"]["UTMCampaign"]; + /** @description Browser name. */ + browser?: components["parameters"]["Browser"]; + /** @description Operating system name. */ + os?: components["parameters"]["OS"]; + /** @description Device type. */ + device?: components["parameters"]["Device"]; + /** @description Country name. */ + country?: components["parameters"]["Country"]; + /** @description Language code. */ + language?: components["parameters"]["Language"]; + /** @description Limit the number of results. */ + limit?: components["parameters"]["Limit"]; + /** @description Offset the results paired with the limit parameter. */ + offset?: components["parameters"]["Offset"]; + }; + header?: never; + path: { + /** @description Hostname for the website. */ + hostname: components["parameters"]["Hostname"]; + }; + cookie: { + /** @description Session token for authentication. */ + _me_sess: components["parameters"]["SessionAuth"]; + }; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["StatsLanguages"]; + }; + }; + 400: components["responses"]["BadRequestError"]; + 401: components["responses"]["UnauthorisedError"]; + 403: components["responses"]["ForbiddenError"]; + 404: components["responses"]["NotFoundError"]; + 500: components["responses"]["InternalServerError"]; + }; }; - }; } diff --git a/dashboard/app/api/user.ts b/dashboard/app/api/user.ts index b04d4ca5..da892ffd 100644 --- a/dashboard/app/api/user.ts +++ b/dashboard/app/api/user.ts @@ -1,6 +1,6 @@ import { hasSession } from '@/utils/cookies'; import { redirect } from '@remix-run/react'; -import { client, type ClientOptions, type DataResponse } from './client'; +import { type ClientOptions, type DataResponse, client } from './client'; const userGet = async ( opts?: ClientOptions, diff --git a/dashboard/app/api/websites.ts b/dashboard/app/api/websites.ts index 4899add2..cb3bac97 100644 --- a/dashboard/app/api/websites.ts +++ b/dashboard/app/api/websites.ts @@ -1,8 +1,8 @@ import { - client, type ClientOptions, type DataResponse, type DataResponseArray, + client, } from './client'; const websiteList = async ( diff --git a/dashboard/app/components/DatePicker.module.css b/dashboard/app/components/DatePicker.module.css index 764cb636..6d44575b 100644 --- a/dashboard/app/components/DatePicker.module.css +++ b/dashboard/app/components/DatePicker.module.css @@ -44,7 +44,100 @@ } /* DatePicker Custom Classes */ + +.root { + margin-top: 8px; + + --rdp-accent-color: var(--me-color-border-violet); + --rdp-accent-background-color: var(--me-color-selected-snow); + --rdp-font-family: var(--default-font-family); + + --rdp-day-font: 400 16px var(--rdp-font-family); + --rdp-day-height: 2.75rem; /* The height of the day cells. */ + --rdp-day-width: 2.75rem; /* The width of the day cells. */ + + --rdp-day_button-border-radius: 12px; + --rdp-day_button-border: 2px solid transparent; /* The border of the day cells. */ + --rdp-day_button-height: var( + --rdp-day-width + ); /* The height of the day cells. */ + --rdp-day_button-width: var( + --rdp-day-height + ); /* The width of the day cells. */ + + --rdp-selected-border: 2px solid var(--rdp-accent-color); /* The border of the selected days. */ + --rdp-selected-font: 500 16px var(--rdp-font-family); + + --rdp-disabled-opacity: 0.5; /* The opacity of the disabled days. */ + --rdp-outside-opacity: 0.75; /* The opacity of the days outside the current month. */ + --rdp-today-color: var( + --rdp-accent-color + ); /* The color of the today's date. */ + + --rdp-dropdown-gap: 0.5rem; /* The gap between the dropdowns used in the month captons. */ + + --rdp-month_caption-font: bold larger var(--rdp-font-family); /* The font of the month caption. */ + --rdp-months-gap: 2rem; /* The gap between the months in the multi-month view. */ + + --rdp-nav_button-disabled-opacity: 0.5; /* The opacity of the disabled navigation buttons. */ + --rdp-nav_button-height: 2.25rem; /* The height of the navigation buttons. */ + --rdp-nav_button-width: 2.25rem; /* The width of the navigation buttons. */ + --rdp-nav-height: 2.75rem; /* The height of the navigation bar. */ + + --rdp-range_middle-background-color: var( + --rdp-accent-background-color + ); /* The color of the background for days in the middle of a range. */ + --rdp-range_middle-font: normal medium var(--rdp-font-family); /* The font for days in the middle of a range. */ + --rdp-range_middle-foreground-color: white; /* The font for days in the middle of a range. */ + --rdp-range_middle-color: inherit; /* The color of the range text. */ + + --rdp-range_start-color: white; /* The color of the range text. */ + --rdp-range_start-background: linear-gradient( + var(--rdp-gradient-direction), + transparent 50%, + var(--rdp-range_middle-background-color) 50% + ); /* Used for the background of the start of the selected range. */ + --rdp-range_start-date-background-color: var( + --rdp-accent-color + ); /* The background color of the date when at the start of the selected range. */ + + --rdp-range_end-background: linear-gradient( + var(--rdp-gradient-direction), + var(--rdp-range_middle-background-color) 50%, + transparent 50% + ); /* Used for the background of the end of the selected range. */ + --rdp-range_end-color: white; /* The color of the range text. */ + --rdp-range_end-date-background-color: var( + --rdp-accent-color + ); /* The background color of the date when at the end of the selected range. */ + + --rdp-week_number-border-radius: 100%; /* The border radius of the week number. */ + --rdp-week_number-border: 2px solid transparent; /* The border of the week number. */ + --rdp-week_number-font: 400 small var(--rdp-font-family); /* The font of the week number cells. */ + --rdp-week_number-height: var( + --rdp-day-height + ); /* The height of the week number cells. */ + --rdp-week_number-opacity: 0.75; /* The opacity of the week number. */ + --rdp-week_number-width: var( + --rdp-day-width + ); /* The width of the week number cells. */ + + --rdp-weekday-font: 500 smaller var(--rdp-font-family); /* The font of the weekday. */ + --rdp-weekday-opacity: 0.75; /* The opacity of the weekday. */ + --rdp-weekday-padding: 0.5rem 0rem; /* The padding of the weekday. */ + --rdp-weekday-text-align: center; /* The text alignment of the weekday cells. */ + + --rdp-gradient-direction: 90deg; + + position: relative; /* Required to position the navigation toolbar. */ + box-sizing: border-box; +} + .months { + position: relative; + gap: var(--rdp-months-gap); + max-width: fit-content; + height: 400px; display: inline-flex; flex-direction: row; @@ -60,20 +153,7 @@ } } -.root { - composes: root from "react-day-picker/style.module.css"; - margin-top: 8px; - - --rdp-accent-color: var(--me-color-border-violet); - --rdp-accent-background-color: var(--me-color-selected-snow); - --rdp-font-family: var(--default-font-family); - --rdp-day_button-border-radius: 12px; - --rdp-day-font: 400 16px var(--rdp-font-family); - --rdp-selected-font: 500 16px var(--rdp-font-family); -} - .month_grid { - composes: month_grid from "react-day-picker/style.module.css"; border-collapse: separate; border-spacing: 0 8px; @@ -88,6 +168,216 @@ } } +.root * { + box-sizing: border-box; +} + +/* Reset buttons */ +.root button { + border: none; + background: none; + padding: 0; + margin: 0; + cursor: pointer; + font: inherit; + color: inherit; +} + +.day { + width: var(--rdp-day-width); + height: var(--rdp-day-height); + font: var(--rdp-day-font); + text-align: center; +} + +.day_button { + justify-content: center; + align-items: center; + display: flex; + + width: var(--rdp-day_button-width); + height: var(--rdp-day_button-height); + border: var(--rdp-day_button-border); + border-radius: var(--rdp-day_button-border-radius); +} + +.day_button:disabled { + cursor: revert; +} + +.caption_label { + z-index: 1; + + position: relative; + display: inline-flex; + align-items: center; + + white-space: nowrap; + border: 0; +} + +.button_next, +.button_previous { + -moz-appearance: none; + -webkit-appearance: none; + display: inline-flex; + align-items: center; + justify-content: center; + margin: 0; + padding: 0; + position: relative; + font: inherit; + appearance: none; + background: none; + border: 0; + color: inherit; + cursor: pointer; + + width: var(--rdp-nav_button-width); + height: var(--rdp-nav_button-height); +} + +.button_next:disabled, +.button_previous:disabled { + cursor: revert; + + opacity: var(--rdp-nav_button-disabled-opacity); +} + +.dropdowns { + position: relative; + display: inline-flex; + align-items: center; + gap: var(--rdp-dropdown-gap); +} +.dropdown { + z-index: 2; + + /* Reset */ + opacity: 0; + appearance: none; + position: absolute; + inset-block-start: 0; + inset-block-end: 0; + inset-inline-start: 0; + width: 100%; + margin: 0; + padding: 0; + cursor: inherit; + border: none; + line-height: inherit; +} + +.dropdown_root { + position: relative; + display: inline-flex; + align-items: center; +} + +.dropdown_root[data-disabled="true"] .chevron { + opacity: var(--rdp-disabled-opacity); +} + +.month_caption { + display: flex; + align-content: center; + height: var(--rdp-nav-height); + font: var(--rdp-month_caption-font); +} + +.nav { + position: absolute; + inset-block-start: 0; + inset-inline-end: 0; + + display: flex; + align-items: center; + + height: var(--rdp-nav-height); +} + +.weekday { + opacity: var(--rdp-weekday-opacity); + padding: var(--rdp-weekday-padding); + font: var(--rdp-weekday-font); + text-align: var(--rdp-weekday-text-align); + text-transform: var(--rdp-weekday-text-transform); +} + +.week_number { + opacity: var(--rdp-week_number-opacity); + font: var(--rdp-week_number-font); + height: var(--rdp-week_number-height); + width: var(--rdp-week_number-width); + border: var(--rdp-week_number-border); + border-radius: var(--rdp-week_number-border-radius); +} + +.week_number_interactive { + cursor: pointer; +} + +/* DAY MODIFIERS */ +.today:not(.outside) { + color: var(--rdp-today-color); +} + +.selected { + font: var(--rdp-selected-font); +} + +.selected .day_button { + border: var(--rdp-selected-border); +} + +.outside { + opacity: var(--rdp-outside-opacity); +} + +.disabled { + opacity: var(--rdp-disabled-opacity); +} + +.hidden { + visibility: hidden; + color: var(--rdp-range_start-color); +} + +.range_start { + background: var(--rdp-range_start-background); +} + +.range_start .day_button { + background-color: var(--rdp-range_start-date-background-color); + color: var(--rdp-range_start-color); +} + +.range_middle { + background-color: var(--rdp-range_middle-background-color); + font: var(--rdp-range_middle-font); +} + +.range_middle .day_button { + border-color: transparent; + border: unset; + border-radius: unset; + color: var(--rdp-range_middle-color); +} + +.range_end { + background: var(--rdp-range_end-background); + color: var(--rdp-range_end-color); +} + +.range_end .day_button { + color: var(--rdp-range_start-color); + background-color: var(--rdp-range_end-date-background-color); +} + +.focusable { + cursor: pointer; +} + @keyframes overlayShow { from { opacity: 0; diff --git a/dashboard/app/components/DatePicker.tsx b/dashboard/app/components/DatePicker.tsx index ac22860e..f87be744 100644 --- a/dashboard/app/components/DatePicker.tsx +++ b/dashboard/app/components/DatePicker.tsx @@ -4,14 +4,13 @@ import { useSearchParams } from '@remix-run/react'; import { formatISO, parseISO, sub } from 'date-fns'; import { ChevronLeft, ChevronRight } from 'lucide-react'; import { useState } from 'react'; -import { DayPicker, type DateRange } from 'react-day-picker'; +import { type DateRange, DayPicker } from 'react-day-picker'; import { Button, CloseButton } from '@/components/Button'; import { Group } from '@/components/layout/Flex'; -import dayPickerClasses from 'react-day-picker/style.module.css'; -import classes from './DatePicker.module.css'; import { useMediaQuery } from '@mantine/hooks'; +import classes from './DatePicker.module.css'; interface DatePickerProps { open: boolean; @@ -69,13 +68,7 @@ const DatePickerRange = ({ open, setOpen }: DatePickerProps) => { { return [{ title: 'Dashboard | Medama' }]; diff --git a/dashboard/app/routes/$hostname._index.tsx b/dashboard/app/routes/$hostname._index.tsx index e31f98d2..a9e08d4e 100644 --- a/dashboard/app/routes/$hostname._index.tsx +++ b/dashboard/app/routes/$hostname._index.tsx @@ -1,17 +1,17 @@ import { SimpleGrid } from '@mantine/core'; import { - json, - useLoaderData, type ClientLoaderFunctionArgs, type MetaFunction, + json, + useLoaderData, } from '@remix-run/react'; import { StatsDisplay } from '@/components/stats/StatsDisplay'; import { DATASETS, - type StatsGroups, type DataRow, type Dataset, + type StatsGroups, type StatsValue, } from '@/components/stats/types'; import { fetchStats } from '@/utils/stats'; diff --git a/dashboard/app/routes/$hostname.tsx b/dashboard/app/routes/$hostname.tsx index 786017ab..1e6dec94 100644 --- a/dashboard/app/routes/$hostname.tsx +++ b/dashboard/app/routes/$hostname.tsx @@ -1,10 +1,10 @@ import { - Outlet, - json, - useLoaderData, type ClientLoaderFunctionArgs, type MetaFunction, + Outlet, type ShouldRevalidateFunctionArgs, + json, + useLoaderData, } from '@remix-run/react'; import { useMemo } from 'react'; diff --git a/dashboard/app/routes/_index.tsx b/dashboard/app/routes/_index.tsx index cae19b65..f2f668df 100644 --- a/dashboard/app/routes/_index.tsx +++ b/dashboard/app/routes/_index.tsx @@ -2,12 +2,12 @@ import { ModalChild, ModalInput, ModalWrapper } from '@/components/Modal'; import { Flex, Group, Paper, SimpleGrid, Text } from '@mantine/core'; import { useForm } from '@mantine/form'; import { + type ClientActionFunctionArgs, + type MetaFunction, json, redirect, useLoaderData, useSubmit, - type ClientActionFunctionArgs, - type MetaFunction, } from '@remix-run/react'; import { zodResolver } from 'mantine-form-zod-resolver'; import isFQDN from 'validator/lib/isFQDN'; diff --git a/dashboard/app/routes/login._index.tsx b/dashboard/app/routes/login._index.tsx index b580b329..9b522ef2 100644 --- a/dashboard/app/routes/login._index.tsx +++ b/dashboard/app/routes/login._index.tsx @@ -5,11 +5,10 @@ import { Login } from '@/components/login/Login'; import { LOGGED_IN_COOKIE, hasSession } from '@/utils/cookies'; import { notifications } from '@mantine/notifications'; import { - json, - redirect, - useActionData, type ClientActionFunctionArgs, type MetaFunction, + json, + redirect, } from '@remix-run/react'; export const meta: MetaFunction = () => { diff --git a/dashboard/app/routes/logout._index.tsx b/dashboard/app/routes/logout._index.tsx index 99fca595..b2c53cd7 100644 --- a/dashboard/app/routes/logout._index.tsx +++ b/dashboard/app/routes/logout._index.tsx @@ -1,10 +1,10 @@ import { Text } from '@mantine/core'; import { + type MetaFunction, json, redirect, useLoaderData, useRevalidator, - type MetaFunction, } from '@remix-run/react'; import { useEffect } from 'react'; diff --git a/dashboard/app/routes/settings.account.tsx b/dashboard/app/routes/settings.account.tsx index 53fecc01..7798d4e2 100644 --- a/dashboard/app/routes/settings.account.tsx +++ b/dashboard/app/routes/settings.account.tsx @@ -1,11 +1,11 @@ import { useForm, zodResolver } from '@mantine/form'; import { notifications } from '@mantine/notifications'; import { + type ClientActionFunctionArgs, + type MetaFunction, json, useLoaderData, useSubmit, - type ClientActionFunctionArgs, - type MetaFunction, } from '@remix-run/react'; import { z } from 'zod'; @@ -72,6 +72,7 @@ export const clientAction = async ({ request }: ClientActionFunctionArgs) => { body: { username: getString(body, 'username'), password: getString(body, 'password'), + language: 'en', }, noThrow: true, }); diff --git a/dashboard/app/routes/settings.usage.tsx b/dashboard/app/routes/settings.usage.tsx index 6dd6243e..349192e1 100644 --- a/dashboard/app/routes/settings.usage.tsx +++ b/dashboard/app/routes/settings.usage.tsx @@ -3,12 +3,12 @@ import { useForm, zodResolver } from '@mantine/form'; import { useInterval } from '@mantine/hooks'; import { notifications } from '@mantine/notifications'; import { + type ClientActionFunctionArgs, + type MetaFunction, json, useLoaderData, useRevalidator, useSubmit, - type ClientActionFunctionArgs, - type MetaFunction, } from '@remix-run/react'; import { useEffect, useMemo } from 'react'; import { z } from 'zod'; diff --git a/dashboard/app/routes/settings.websites.tsx b/dashboard/app/routes/settings.websites.tsx index 689c6be2..9d92b10c 100644 --- a/dashboard/app/routes/settings.websites.tsx +++ b/dashboard/app/routes/settings.websites.tsx @@ -2,12 +2,12 @@ import { Group, Text, Title } from '@mantine/core'; import { useForm, zodResolver } from '@mantine/form'; import { notifications } from '@mantine/notifications'; import { + type ClientActionFunctionArgs, + type MetaFunction, json, useLoaderData, useSearchParams, useSubmit, - type ClientActionFunctionArgs, - type MetaFunction, } from '@remix-run/react'; import { useState } from 'react'; import { z } from 'zod'; diff --git a/dashboard/package.json b/dashboard/package.json index 6df27126..3720ea47 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -8,35 +8,35 @@ "build": "remix vite:build", "preview": "vite preview", "generate": "openapi-typescript ../core/openapi.yaml -o ./app/api/types.d.ts", - "format": "biome format --write .", - "lint": "biome lint --write .", + "lint": "biome check --write .", + "lint:ci": "biome check .", "typecheck": "tsc" }, "dependencies": { - "@fontsource-variable/inter": "^5.0.18", + "@fontsource-variable/inter": "^5.0.19", "@fontsource-variable/reddit-mono": "^5.0.3", - "@mantine/charts": "^7.11.1", - "@mantine/core": "^7.11.1", - "@mantine/form": "^7.11.1", - "@mantine/hooks": "^7.11.1", - "@mantine/notifications": "^7.11.1", + "@mantine/charts": "^7.11.2", + "@mantine/core": "^7.11.2", + "@mantine/form": "^7.11.2", + "@mantine/hooks": "^7.11.2", + "@mantine/notifications": "^7.11.2", "@radix-ui/react-accessible-icon": "^1.1.0", "@radix-ui/react-dialog": "^1.1.1", "@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-popover": "^1.1.1", "@radix-ui/react-portal": "^1.1.1", "@radix-ui/react-visually-hidden": "^1.1.0", - "@remix-run/react": "^2.10.0", - "@remix-run/serve": "^2.10.0", - "byte-size": "^8.1.1", + "@remix-run/react": "^2.10.3", + "@remix-run/serve": "^2.10.3", + "byte-size": "^9.0.0", "clsx": "^2.1.1", "date-fns": "^3.6.0", - "isbot": "^5.1.11", + "isbot": "^5.1.13", "lucide-react": "^0.414.0", - "mantine-datatable": "^7.11.1", + "mantine-datatable": "^7.11.2", "mantine-form-zod-resolver": "^1.1.0", "react": "18.3.0-canary-8039e6d0b-20231026", - "react-day-picker": "^9.0.3", + "react-day-picker": "^9.0.4", "react-dom": "18.3.0-canary-8039e6d0b-20231026", "react-indiana-drag-scroll": "^3.0.3-alpha", "recharts": "^2.13.0-alpha.4", @@ -45,19 +45,19 @@ }, "devDependencies": { "@csstools/postcss-global-data": "^2.1.1", - "@remix-run/dev": "^2.10.0", + "@remix-run/dev": "^2.10.3", "@types/byte-size": "^8.1.2", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@types/validator": "^13.12.0", - "openapi-typescript": "^6.7.6", - "postcss": "^8.4.39", + "openapi-typescript": "^7.1.0", + "postcss": "^8.4.40", "postcss-custom-media": "^10.0.8", "postcss-lightningcss": "^1.0.0", - "postcss-preset-mantine": "^1.15.0", + "postcss-preset-mantine": "^1.17.0", "postcss-simple-vars": "^7.0.1", - "typescript": "^5.5.3", - "vite": "^5.3.2", + "typescript": "^5.5.4", + "vite": "^5.3.4", "vite-tsconfig-paths": "^4.3.2" }, "engines": { diff --git a/package.json b/package.json index 3fc45b04..f9f9d159 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,5 @@ "@changesets/cli": "^2.27.5" }, "workspaces": ["dashboard", "tracker"], - "trustedDependencies": ["@biomejs/biome", "esbuild"], - "patchedDependencies": { - "react-day-picker@9.0.3": "patches/react-day-picker@9.0.3.patch" - } + "trustedDependencies": ["@biomejs/biome", "esbuild"] } diff --git a/patches/react-day-picker@9.0.3.patch b/patches/react-day-picker@9.0.3.patch deleted file mode 100644 index e1f8281d..00000000 --- a/patches/react-day-picker@9.0.3.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/style.module.css b/src/style.module.css -index 5b8d894138d88213989486ff2037eeeffdcf380f..b341406c91bf333ef28ca28c289f9bf9f7e82312 100644 ---- a/src/style.module.css -+++ b/src/style.module.css -@@ -262,7 +262,7 @@ - - .hidden { - visibility: hidden; -- color: var(end-range_start-color); -+ color: var(--rdp-range_start-color); - } - - .range_start {