@trustcomponent/sdk 0.0.0-stage → 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +77 -2
  2. package/dist/captcha.d.ts +18 -0
  3. package/dist/captcha.js +28 -0
  4. package/dist/client.d.ts +46 -0
  5. package/dist/client.js +88 -0
  6. package/dist/errors.d.ts +38 -0
  7. package/dist/errors.js +73 -0
  8. package/dist/generated/apis/AnalyticsServerEventsApi.d.ts +36 -0
  9. package/dist/generated/apis/AnalyticsServerEventsApi.js +64 -0
  10. package/dist/generated/apis/AnalyticsWebsitesApi.d.ts +146 -0
  11. package/dist/generated/apis/AnalyticsWebsitesApi.js +357 -0
  12. package/dist/generated/apis/CaptchaVerificationsApi.d.ts +36 -0
  13. package/dist/generated/apis/CaptchaVerificationsApi.js +65 -0
  14. package/dist/generated/apis/MonitoringHeartbeatsApi.d.ts +35 -0
  15. package/dist/generated/apis/MonitoringHeartbeatsApi.js +64 -0
  16. package/dist/generated/apis/PlatformEventsApi.d.ts +39 -0
  17. package/dist/generated/apis/PlatformEventsApi.js +73 -0
  18. package/dist/generated/apis/TaxValidationSchedulesApi.d.ts +49 -0
  19. package/dist/generated/apis/TaxValidationSchedulesApi.js +101 -0
  20. package/dist/generated/apis/TaxValidationValidationResultsApi.d.ts +33 -0
  21. package/dist/generated/apis/TaxValidationValidationResultsApi.js +60 -0
  22. package/dist/generated/apis/TaxValidationValidationsApi.d.ts +52 -0
  23. package/dist/generated/apis/TaxValidationValidationsApi.js +106 -0
  24. package/dist/generated/apis/index.d.ts +8 -0
  25. package/dist/generated/apis/index.js +10 -0
  26. package/dist/generated/index.d.ts +3 -0
  27. package/dist/generated/index.js +5 -0
  28. package/dist/generated/models/AnalyticsEventCategoryEnum.d.ts +37 -0
  29. package/dist/generated/models/AnalyticsEventCategoryEnum.js +57 -0
  30. package/dist/generated/models/AnalyticsRealtime.d.ts +52 -0
  31. package/dist/generated/models/AnalyticsRealtime.js +57 -0
  32. package/dist/generated/models/AnalyticsRealtimePage.d.ts +38 -0
  33. package/dist/generated/models/AnalyticsRealtimePage.js +47 -0
  34. package/dist/generated/models/AnalyticsRealtimePoint.d.ts +38 -0
  35. package/dist/generated/models/AnalyticsRealtimePoint.js +47 -0
  36. package/dist/generated/models/AnalyticsServerEventBatchCreateParams.d.ts +57 -0
  37. package/dist/generated/models/AnalyticsServerEventBatchCreateParams.js +58 -0
  38. package/dist/generated/models/AnalyticsServerEventBatchEventCommerceCreateParams.d.ts +81 -0
  39. package/dist/generated/models/AnalyticsServerEventBatchEventCommerceCreateParams.js +64 -0
  40. package/dist/generated/models/AnalyticsServerEventBatchEventCommerceProductCreateParams.d.ts +56 -0
  41. package/dist/generated/models/AnalyticsServerEventBatchEventCommerceProductCreateParams.js +53 -0
  42. package/dist/generated/models/AnalyticsServerEventBatchEventCreateParams.d.ts +122 -0
  43. package/dist/generated/models/AnalyticsServerEventBatchEventCreateParams.js +81 -0
  44. package/dist/generated/models/AnalyticsServerEventBatchEventErrorCreateParams.d.ts +50 -0
  45. package/dist/generated/models/AnalyticsServerEventBatchEventErrorCreateParams.js +51 -0
  46. package/dist/generated/models/AnalyticsServerEventBatchEventRefundCreateParams.d.ts +38 -0
  47. package/dist/generated/models/AnalyticsServerEventBatchEventRefundCreateParams.js +47 -0
  48. package/dist/generated/models/AnalyticsServerEventBatchResult.d.ts +39 -0
  49. package/dist/generated/models/AnalyticsServerEventBatchResult.js +48 -0
  50. package/dist/generated/models/AnalyticsServerEventBatchResultDropReasonEnum.d.ts +44 -0
  51. package/dist/generated/models/AnalyticsServerEventBatchResultDropReasonEnum.js +64 -0
  52. package/dist/generated/models/AnalyticsServerEventBatchResultDropped.d.ts +39 -0
  53. package/dist/generated/models/AnalyticsServerEventBatchResultDropped.js +48 -0
  54. package/dist/generated/models/AnalyticsStatsBreakdown.d.ts +70 -0
  55. package/dist/generated/models/AnalyticsStatsBreakdown.js +69 -0
  56. package/dist/generated/models/AnalyticsStatsBreakdownRow.d.ts +46 -0
  57. package/dist/generated/models/AnalyticsStatsBreakdownRow.js +51 -0
  58. package/dist/generated/models/AnalyticsStatsBreakdownRowPage.d.ts +56 -0
  59. package/dist/generated/models/AnalyticsStatsBreakdownRowPage.js +53 -0
  60. package/dist/generated/models/AnalyticsStatsConversions.d.ts +51 -0
  61. package/dist/generated/models/AnalyticsStatsConversions.js +56 -0
  62. package/dist/generated/models/AnalyticsStatsConversionsGoal.d.ts +57 -0
  63. package/dist/generated/models/AnalyticsStatsConversionsGoal.js +58 -0
  64. package/dist/generated/models/AnalyticsStatsConversionsGoalRevenue.d.ts +38 -0
  65. package/dist/generated/models/AnalyticsStatsConversionsGoalRevenue.js +47 -0
  66. package/dist/generated/models/AnalyticsStatsDimensionEnum.d.ts +59 -0
  67. package/dist/generated/models/AnalyticsStatsDimensionEnum.js +79 -0
  68. package/dist/generated/models/AnalyticsStatsFilterMatchModeEnum.d.ts +25 -0
  69. package/dist/generated/models/AnalyticsStatsFilterMatchModeEnum.js +45 -0
  70. package/dist/generated/models/AnalyticsStatsFilterOperatorEnum.d.ts +30 -0
  71. package/dist/generated/models/AnalyticsStatsFilterOperatorEnum.js +50 -0
  72. package/dist/generated/models/AnalyticsStatsGranularityEnum.d.ts +25 -0
  73. package/dist/generated/models/AnalyticsStatsGranularityEnum.js +45 -0
  74. package/dist/generated/models/AnalyticsStatsOverview.d.ts +63 -0
  75. package/dist/generated/models/AnalyticsStatsOverview.js +62 -0
  76. package/dist/generated/models/AnalyticsStatsTimeseries.d.ts +52 -0
  77. package/dist/generated/models/AnalyticsStatsTimeseries.js +57 -0
  78. package/dist/generated/models/AnalyticsStatsTimeseriesPoint.d.ts +39 -0
  79. package/dist/generated/models/AnalyticsStatsTimeseriesPoint.js +48 -0
  80. package/dist/generated/models/AnalyticsStatsTotals.d.ts +74 -0
  81. package/dist/generated/models/AnalyticsStatsTotals.js +65 -0
  82. package/dist/generated/models/AnalyticsWebsite.d.ts +50 -0
  83. package/dist/generated/models/AnalyticsWebsite.js +55 -0
  84. package/dist/generated/models/AnalyticsWebsitesPage.d.ts +51 -0
  85. package/dist/generated/models/AnalyticsWebsitesPage.js +56 -0
  86. package/dist/generated/models/CaptchaVerificationResult.d.ts +146 -0
  87. package/dist/generated/models/CaptchaVerificationResult.js +79 -0
  88. package/dist/generated/models/PlatformEvent.d.ts +98 -0
  89. package/dist/generated/models/PlatformEvent.js +87 -0
  90. package/dist/generated/models/PlatformEventActor.d.ts +52 -0
  91. package/dist/generated/models/PlatformEventActor.js +51 -0
  92. package/dist/generated/models/PlatformEventActorAutomation.d.ts +39 -0
  93. package/dist/generated/models/PlatformEventActorAutomation.js +48 -0
  94. package/dist/generated/models/PlatformEventActorAutomationKindEnum.d.ts +26 -0
  95. package/dist/generated/models/PlatformEventActorAutomationKindEnum.js +46 -0
  96. package/dist/generated/models/PlatformEventActorTypeEnum.d.ts +28 -0
  97. package/dist/generated/models/PlatformEventActorTypeEnum.js +48 -0
  98. package/dist/generated/models/PlatformEventChange.d.ts +57 -0
  99. package/dist/generated/models/PlatformEventChange.js +56 -0
  100. package/dist/generated/models/PlatformEventChangeOperationEnum.d.ts +28 -0
  101. package/dist/generated/models/PlatformEventChangeOperationEnum.js +48 -0
  102. package/dist/generated/models/PlatformEventOrigin.d.ts +57 -0
  103. package/dist/generated/models/PlatformEventOrigin.js +56 -0
  104. package/dist/generated/models/PlatformEventRef.d.ts +44 -0
  105. package/dist/generated/models/PlatformEventRef.js +49 -0
  106. package/dist/generated/models/PlatformEventSourceEnum.d.ts +29 -0
  107. package/dist/generated/models/PlatformEventSourceEnum.js +49 -0
  108. package/dist/generated/models/PlatformEventsPage.d.ts +69 -0
  109. package/dist/generated/models/PlatformEventsPage.js +66 -0
  110. package/dist/generated/models/TaxValidationMatchStatusEnum.d.ts +29 -0
  111. package/dist/generated/models/TaxValidationMatchStatusEnum.js +49 -0
  112. package/dist/generated/models/TaxValidationProviderEnum.d.ts +31 -0
  113. package/dist/generated/models/TaxValidationProviderEnum.js +51 -0
  114. package/dist/generated/models/TaxValidationProviderStatusEnum.d.ts +36 -0
  115. package/dist/generated/models/TaxValidationProviderStatusEnum.js +56 -0
  116. package/dist/generated/models/TaxValidationSchedule.d.ts +101 -0
  117. package/dist/generated/models/TaxValidationSchedule.js +84 -0
  118. package/dist/generated/models/TaxValidationScheduleCreateParams.d.ts +100 -0
  119. package/dist/generated/models/TaxValidationScheduleCreateParams.js +71 -0
  120. package/dist/generated/models/TaxValidationTaxAddress.d.ts +56 -0
  121. package/dist/generated/models/TaxValidationTaxAddress.js +49 -0
  122. package/dist/generated/models/TaxValidationTaxIdentifierSchemeEnum.d.ts +34 -0
  123. package/dist/generated/models/TaxValidationTaxIdentifierSchemeEnum.js +54 -0
  124. package/dist/generated/models/TaxValidationValidation.d.ts +123 -0
  125. package/dist/generated/models/TaxValidationValidation.js +84 -0
  126. package/dist/generated/models/TaxValidationValidationAddressMatch.d.ts +57 -0
  127. package/dist/generated/models/TaxValidationValidationAddressMatch.js +60 -0
  128. package/dist/generated/models/TaxValidationValidationBatchCreateParams.d.ts +33 -0
  129. package/dist/generated/models/TaxValidationValidationBatchCreateParams.js +44 -0
  130. package/dist/generated/models/TaxValidationValidationCreateParams.d.ts +91 -0
  131. package/dist/generated/models/TaxValidationValidationCreateParams.js +66 -0
  132. package/dist/generated/models/TaxValidationValidationFrequencyEnum.d.ts +26 -0
  133. package/dist/generated/models/TaxValidationValidationFrequencyEnum.js +46 -0
  134. package/dist/generated/models/TaxValidationValidationInput.d.ts +78 -0
  135. package/dist/generated/models/TaxValidationValidationInput.js +67 -0
  136. package/dist/generated/models/TaxValidationValidationMatch.d.ts +46 -0
  137. package/dist/generated/models/TaxValidationValidationMatch.js +53 -0
  138. package/dist/generated/models/TaxValidationValidationModeEnum.d.ts +25 -0
  139. package/dist/generated/models/TaxValidationValidationModeEnum.js +45 -0
  140. package/dist/generated/models/TaxValidationValidationOutcomeEnum.d.ts +29 -0
  141. package/dist/generated/models/TaxValidationValidationOutcomeEnum.js +49 -0
  142. package/dist/generated/models/TaxValidationValidationRequestStatusEnum.d.ts +29 -0
  143. package/dist/generated/models/TaxValidationValidationRequestStatusEnum.js +49 -0
  144. package/dist/generated/models/TaxValidationValidationResponseData.d.ts +51 -0
  145. package/dist/generated/models/TaxValidationValidationResponseData.js +48 -0
  146. package/dist/generated/models/TaxValidationValidationResult.d.ts +117 -0
  147. package/dist/generated/models/TaxValidationValidationResult.js +94 -0
  148. package/dist/generated/models/TaxValidationValidationScheduleAttachParams.d.ts +59 -0
  149. package/dist/generated/models/TaxValidationValidationScheduleAttachParams.js +54 -0
  150. package/dist/generated/models/TaxValidationVerificationMethodEnum.d.ts +25 -0
  151. package/dist/generated/models/TaxValidationVerificationMethodEnum.js +45 -0
  152. package/dist/generated/models/index.d.ts +62 -0
  153. package/dist/generated/models/index.js +64 -0
  154. package/dist/generated/module-list.d.ts +1 -0
  155. package/dist/generated/module-list.js +2 -0
  156. package/dist/generated/modules.d.ts +27 -0
  157. package/dist/generated/modules.js +39 -0
  158. package/dist/generated/runtime.d.ts +185 -0
  159. package/dist/generated/runtime.js +352 -0
  160. package/dist/http.d.ts +18 -0
  161. package/dist/http.js +79 -0
  162. package/dist/index.d.ts +4 -0
  163. package/dist/index.js +4 -0
  164. package/package.json +33 -4
package/README.md CHANGED
@@ -1,3 +1,78 @@
1
- # Temporary Holding Version
1
+ # TrustComponent SDK for Node.js / TypeScript
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The official SDK for the TrustComponent API: TrustCaptcha, TrustAnalytics, TrustMonitoring, Trust VAT Checker and the
4
+ platform API, in one package. Developed and hosted in the EU.
5
+
6
+ Requires Node.js 18 or newer (ESM, types included).
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ npm install @trustcomponent/sdk
12
+ ```
13
+
14
+ ## Check a TrustCaptcha result
15
+
16
+ The widget writes a verification token into your form. One call turns it into the result:
17
+
18
+ ```ts
19
+ import { TrustComponent } from '@trustcomponent/sdk';
20
+
21
+ const tc = new TrustComponent('ak_…');
22
+ const result = await tc.captcha.getVerificationResult(request.body['tc-verification-token']);
23
+ if (result.verificationPassed) { /* … */ }
24
+ ```
25
+
26
+ Create the API key (`ak_…`) in the dashboard under the project's API keys. The key decides which modules the client can use.
27
+
28
+ ## Every module
29
+
30
+ The client is `module → resource → operation`, with the same names in every language:
31
+
32
+ ```ts
33
+ await tc.analytics.websites.getWebsites();
34
+ await tc.taxValidation.validations.createValidation({ taxValidationValidationCreateParams: { countryCode: 'DE', rawValue: 'DE811569869' } });
35
+ await tc.monitoring.heartbeats.pingHeartbeat({ serviceId, monitorId });
36
+ await tc.platform.events.getEvents();
37
+ ```
38
+
39
+ The full reference of every operation is at https://docs.trustcomponent.com.
40
+
41
+ ## Configuration
42
+
43
+ ```ts
44
+ const tc = TrustComponent.builder('ak_…').timeoutMs(5000).maxRetries(1).integration('my-plugin/1.0').build();
45
+ ```
46
+
47
+ Options: `host`, `timeoutMs`, `maxRetries`, `deprecationWarnings`, `integration`, `logger`, `fetch` (an own `fetch`, e.g. with a proxy agent).
48
+
49
+ The SDK retries only what the API reserves for retries: `429` with `Retry-After`, `502`, `503`, `504` and a lost
50
+ connection (2 retries by default). When the API marks an operation as deprecated, it logs one warning per operation.
51
+ Every request names the SDK in `User-Agent` and `TrustComponent-Sdk`, together with the integration you set.
52
+
53
+ ## Errors
54
+
55
+ Every error is a `TrustComponentError` carrying the HTTP status and the stable `code` of the API:
56
+ `InvalidRequestError`, `AuthenticationError`, `PermissionError`, `PlanLimitError`, `NotFoundError`, `ConflictError`, `GoneError`, `RateLimitError`, `ServerError`, `ConnectionError`, `OperationRetiredError`, `VerificationTokenInvalidError`.
57
+
58
+ ```ts
59
+ import { NotFoundError } from '@trustcomponent/sdk';
60
+
61
+ try {
62
+ await tc.captcha.getVerificationResult(token);
63
+ } catch (e) {
64
+ if (e instanceof NotFoundError) { /* e.status, e.code */ }
65
+ }
66
+ ```
67
+
68
+ `OperationRetired` means the operation was switched off after its sunset: update the SDK.
69
+
70
+ ## Support
71
+
72
+ The GitHub repository of this SDK is a read-only mirror, generated from the TrustComponent API, so pull requests and
73
+ issues are not processed there. For questions and bug reports, write to mail@trustcomponent.com or contact support
74
+ through https://www.trustcomponent.com.
75
+
76
+ ## License
77
+
78
+ MIT
@@ -0,0 +1,18 @@
1
+ import { CaptchaModuleBase } from './generated/modules.js';
2
+ import type { CaptchaVerificationResult } from './generated/models/index.js';
3
+ import { TrustComponentError } from './errors.js';
4
+ /** The token the TrustCaptcha widget writes into the form: base64 of `{"verificationId": "…", "clientFailover": false, …}`. */
5
+ export declare class VerificationTokenInvalidError extends TrustComponentError {
6
+ }
7
+ export declare class CaptchaModule extends CaptchaModuleBase {
8
+ /**
9
+ * Returns the result of the verification behind a widget token, the one call a form handler needs.
10
+ * When the widget could not reach TrustCaptcha (`clientFailover` in the token), the public gateway decides
11
+ * whether the visitor may pass.
12
+ */
13
+ getVerificationResult(verificationToken: string): Promise<CaptchaVerificationResult>;
14
+ }
15
+ export declare function parseVerificationToken(verificationToken: string): {
16
+ verificationId: string;
17
+ clientFailover: boolean;
18
+ };
@@ -0,0 +1,28 @@
1
+ import { CaptchaModuleBase } from './generated/modules.js';
2
+ import { TrustComponentError } from './errors.js';
3
+ /** The token the TrustCaptcha widget writes into the form: base64 of `{"verificationId": "…", "clientFailover": false, …}`. */
4
+ export class VerificationTokenInvalidError extends TrustComponentError {
5
+ }
6
+ export class CaptchaModule extends CaptchaModuleBase {
7
+ /**
8
+ * Returns the result of the verification behind a widget token, the one call a form handler needs.
9
+ * When the widget could not reach TrustCaptcha (`clientFailover` in the token), the public gateway decides
10
+ * whether the visitor may pass.
11
+ */
12
+ async getVerificationResult(verificationToken) {
13
+ const token = parseVerificationToken(verificationToken);
14
+ return this.verifications.getResult({ verificationId: token.verificationId, clientFailover: token.clientFailover || undefined });
15
+ }
16
+ }
17
+ export function parseVerificationToken(verificationToken) {
18
+ try {
19
+ const token = JSON.parse(Buffer.from(verificationToken.trim(), 'base64').toString('utf8'));
20
+ if (typeof token?.verificationId === 'string' && token.verificationId.length > 0) {
21
+ return { verificationId: token.verificationId, clientFailover: token.clientFailover === true };
22
+ }
23
+ }
24
+ catch {
25
+ // falls through to the error below
26
+ }
27
+ throw new VerificationTokenInvalidError('The verification token is not a TrustCaptcha token', 0, 'verification_token_invalid', undefined);
28
+ }
@@ -0,0 +1,46 @@
1
+ import { AnalyticsModule, MonitoringModule, PlatformModule, TaxValidationModule } from './generated/modules.js';
2
+ import { CaptchaModule } from './captcha.js';
3
+ interface Settings {
4
+ host: string;
5
+ timeoutMs: number;
6
+ maxRetries: number;
7
+ deprecationWarnings: boolean;
8
+ integration?: string;
9
+ fetch: typeof fetch;
10
+ logger: Pick<Console, 'warn'>;
11
+ }
12
+ /**
13
+ * Entry point of the SDK. `new TrustComponent('ak_…')` is all most integrations need;
14
+ * `TrustComponent.builder('ak_…')` changes host, timeouts, retries and the rest.
15
+ */
16
+ export declare class TrustComponent {
17
+ readonly captcha: CaptchaModule;
18
+ readonly analytics: AnalyticsModule;
19
+ readonly monitoring: MonitoringModule;
20
+ readonly taxValidation: TaxValidationModule;
21
+ readonly platform: PlatformModule;
22
+ constructor(apiKey: string, settings?: Settings);
23
+ static builder(apiKey: string): TrustComponentBuilder;
24
+ static readonly version = "0.0.1-beta.0";
25
+ }
26
+ export declare class TrustComponentBuilder {
27
+ private readonly apiKey;
28
+ private readonly s;
29
+ constructor(apiKey: string);
30
+ /** Another API host, e.g. a local stack for tests. */
31
+ host(host: string): this;
32
+ /** Time for one attempt, from sending until the whole answer arrived. */
33
+ timeoutMs(timeoutMs: number): this;
34
+ /** Retries after 429 with Retry-After, 502/503/504 and lost connections. 0 switches retries off. */
35
+ maxRetries(maxRetries: number): this;
36
+ /** Logs a warning once per deprecated operation; off for quiet logs. */
37
+ deprecationWarnings(enabled: boolean): this;
38
+ /** Name and version of the plugin or product built on the SDK, e.g. `wordpress-plugin/1.2.0`. */
39
+ integration(integration: string): this;
40
+ /** Own fetch implementation, e.g. one going through a proxy (`undici` ProxyAgent). */
41
+ fetch(fetchImplementation: typeof fetch): this;
42
+ logger(logger: Pick<Console, 'warn'>): this;
43
+ settings(): Settings;
44
+ build(): TrustComponent;
45
+ }
46
+ export {};
package/dist/client.js ADDED
@@ -0,0 +1,88 @@
1
+ import os from 'node:os';
2
+ import { Configuration } from './generated/runtime.js';
3
+ import { AnalyticsModule, MonitoringModule, PlatformModule, TaxValidationModule, SDK_VERSION, API_VERSION } from './generated/modules.js';
4
+ import { CaptchaModule } from './captcha.js';
5
+ import { createFetch } from './http.js';
6
+ import { TrustComponentError } from './errors.js';
7
+ const DEFAULT_HOST = 'https://api.trustcomponent.com';
8
+ /**
9
+ * Entry point of the SDK. `new TrustComponent('ak_…')` is all most integrations need;
10
+ * `TrustComponent.builder('ak_…')` changes host, timeouts, retries and the rest.
11
+ */
12
+ export class TrustComponent {
13
+ captcha;
14
+ analytics;
15
+ monitoring;
16
+ taxValidation;
17
+ platform;
18
+ constructor(apiKey, settings) {
19
+ if (!apiKey?.trim())
20
+ throw new Error('apiKey must not be empty');
21
+ const s = settings ?? TrustComponent.builder(apiKey).settings();
22
+ const configuration = new Configuration({
23
+ basePath: s.host.replace(/\/+$/, ''),
24
+ fetchApi: createFetch({
25
+ apiKey: apiKey.trim(),
26
+ timeoutMs: s.timeoutMs,
27
+ maxRetries: s.maxRetries,
28
+ deprecationWarnings: s.deprecationWarnings,
29
+ sdkHeader: sdkHeaderOf(s.integration),
30
+ userAgent: `trustcomponent-typescript/${SDK_VERSION}`,
31
+ fetch: s.fetch,
32
+ logger: s.logger,
33
+ }),
34
+ // The generated runtime wraps whatever fetch throws into its own FetchError; ours pass through unchanged.
35
+ middleware: [{ onError: async ({ error }) => { if (error instanceof TrustComponentError)
36
+ throw error; return undefined; } }],
37
+ });
38
+ this.captcha = new CaptchaModule(configuration);
39
+ this.analytics = new AnalyticsModule(configuration);
40
+ this.monitoring = new MonitoringModule(configuration);
41
+ this.taxValidation = new TaxValidationModule(configuration);
42
+ this.platform = new PlatformModule(configuration);
43
+ }
44
+ static builder(apiKey) {
45
+ return new TrustComponentBuilder(apiKey);
46
+ }
47
+ static version = SDK_VERSION;
48
+ }
49
+ export class TrustComponentBuilder {
50
+ apiKey;
51
+ s = {
52
+ host: DEFAULT_HOST,
53
+ timeoutMs: 10_000,
54
+ maxRetries: 2,
55
+ deprecationWarnings: true,
56
+ fetch: globalThis.fetch,
57
+ logger: console,
58
+ };
59
+ constructor(apiKey) {
60
+ this.apiKey = apiKey;
61
+ }
62
+ /** Another API host, e.g. a local stack for tests. */
63
+ host(host) { this.s.host = host; return this; }
64
+ /** Time for one attempt, from sending until the whole answer arrived. */
65
+ timeoutMs(timeoutMs) { this.s.timeoutMs = timeoutMs; return this; }
66
+ /** Retries after 429 with Retry-After, 502/503/504 and lost connections. 0 switches retries off. */
67
+ maxRetries(maxRetries) { this.s.maxRetries = Math.max(0, maxRetries); return this; }
68
+ /** Logs a warning once per deprecated operation; off for quiet logs. */
69
+ deprecationWarnings(enabled) { this.s.deprecationWarnings = enabled; return this; }
70
+ /** Name and version of the plugin or product built on the SDK, e.g. `wordpress-plugin/1.2.0`. */
71
+ integration(integration) { this.s.integration = integration; return this; }
72
+ /** Own fetch implementation, e.g. one going through a proxy (`undici` ProxyAgent). */
73
+ fetch(fetchImplementation) { this.s.fetch = fetchImplementation; return this; }
74
+ logger(logger) { this.s.logger = logger; return this; }
75
+ settings() { return { ...this.s }; }
76
+ build() { return new TrustComponent(this.apiKey, this.settings()); }
77
+ }
78
+ function sdkHeaderOf(integration) {
79
+ const metadata = {
80
+ sdk: 'typescript',
81
+ version: SDK_VERSION,
82
+ api: API_VERSION,
83
+ runtime: `node/${process.versions.node}`,
84
+ os: os.platform(),
85
+ ...(integration ? { integration } : {}),
86
+ };
87
+ return Buffer.from(JSON.stringify(metadata), 'utf8').toString('base64');
88
+ }
@@ -0,0 +1,38 @@
1
+ /** Every error the SDK raises. `status` is the HTTP status (0 when no response arrived), `code` the stable reason of the API. */
2
+ export declare class TrustComponentError extends Error {
3
+ readonly status: number;
4
+ readonly code: string | undefined;
5
+ readonly detail: string | undefined;
6
+ constructor(message: string, status: number, code: string | undefined, detail: string | undefined);
7
+ }
8
+ export declare class InvalidRequestError extends TrustComponentError {
9
+ }
10
+ export declare class AuthenticationError extends TrustComponentError {
11
+ }
12
+ export declare class PermissionError extends TrustComponentError {
13
+ }
14
+ export declare class PlanLimitError extends TrustComponentError {
15
+ }
16
+ export declare class NotFoundError extends TrustComponentError {
17
+ }
18
+ export declare class ConflictError extends TrustComponentError {
19
+ }
20
+ export declare class GoneError extends TrustComponentError {
21
+ }
22
+ export declare class RateLimitError extends TrustComponentError {
23
+ readonly retryAfterSeconds: number | undefined;
24
+ constructor(message: string, status: number, code: string | undefined, detail: string | undefined, retryAfterSeconds: number | undefined);
25
+ }
26
+ /** The operation was switched off after its sunset. A newer SDK calls its successor. */
27
+ export declare class OperationRetiredError extends TrustComponentError {
28
+ }
29
+ export declare class ServerError extends TrustComponentError {
30
+ }
31
+ /** No response arrived: timeout, DNS, connection refused. */
32
+ export declare class ConnectionError extends TrustComponentError {
33
+ }
34
+ export declare function errorOf(status: number, body: {
35
+ code?: string;
36
+ detail?: string;
37
+ title?: string;
38
+ } | undefined, retryAfterSeconds: number | undefined): TrustComponentError;
package/dist/errors.js ADDED
@@ -0,0 +1,73 @@
1
+ /** Every error the SDK raises. `status` is the HTTP status (0 when no response arrived), `code` the stable reason of the API. */
2
+ export class TrustComponentError extends Error {
3
+ status;
4
+ code;
5
+ detail;
6
+ constructor(message, status, code, detail) {
7
+ super(message);
8
+ this.status = status;
9
+ this.code = code;
10
+ this.detail = detail;
11
+ this.name = new.target.name;
12
+ }
13
+ }
14
+ export class InvalidRequestError extends TrustComponentError {
15
+ }
16
+ export class AuthenticationError extends TrustComponentError {
17
+ }
18
+ export class PermissionError extends TrustComponentError {
19
+ }
20
+ export class PlanLimitError extends TrustComponentError {
21
+ }
22
+ export class NotFoundError extends TrustComponentError {
23
+ }
24
+ export class ConflictError extends TrustComponentError {
25
+ }
26
+ export class GoneError extends TrustComponentError {
27
+ }
28
+ export class RateLimitError extends TrustComponentError {
29
+ retryAfterSeconds;
30
+ constructor(message, status, code, detail, retryAfterSeconds) {
31
+ super(message, status, code, detail);
32
+ this.retryAfterSeconds = retryAfterSeconds;
33
+ }
34
+ }
35
+ /** The operation was switched off after its sunset. A newer SDK calls its successor. */
36
+ export class OperationRetiredError extends TrustComponentError {
37
+ }
38
+ export class ServerError extends TrustComponentError {
39
+ }
40
+ /** No response arrived: timeout, DNS, connection refused. */
41
+ export class ConnectionError extends TrustComponentError {
42
+ }
43
+ export function errorOf(status, body, retryAfterSeconds) {
44
+ const code = body?.code;
45
+ const detail = body?.detail;
46
+ const message = `TrustComponent API answered ${status}${code ? ` (${code})` : ''}${detail ? `: ${detail}` : ''}`;
47
+ if (status === 410 && code === 'operation_retired') {
48
+ return new OperationRetiredError(`${message}. Update the TrustComponent SDK.`, status, code, detail);
49
+ }
50
+ switch (status) {
51
+ case 400:
52
+ case 422:
53
+ return new InvalidRequestError(message, status, code, detail);
54
+ case 401:
55
+ return new AuthenticationError(message, status, code, detail);
56
+ case 402:
57
+ return new PlanLimitError(message, status, code, detail);
58
+ case 403:
59
+ return new PermissionError(message, status, code, detail);
60
+ case 404:
61
+ return new NotFoundError(message, status, code, detail);
62
+ case 409:
63
+ case 412:
64
+ case 423:
65
+ return new ConflictError(message, status, code, detail);
66
+ case 410:
67
+ return new GoneError(message, status, code, detail);
68
+ case 429:
69
+ return new RateLimitError(message, status, code, detail, retryAfterSeconds);
70
+ default:
71
+ return status >= 500 ? new ServerError(message, status, code, detail) : new TrustComponentError(message, status, code, detail);
72
+ }
73
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * TrustComponent API
3
+ * The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
4
+ *
5
+ * The version of the OpenAPI document: 0.0.1-beta.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime.js';
13
+ import { type AnalyticsServerEventBatchCreateParams } from '../models/AnalyticsServerEventBatchCreateParams.js';
14
+ import { type AnalyticsServerEventBatchResult } from '../models/AnalyticsServerEventBatchResult.js';
15
+ export interface CreateServerEventBatchRequest {
16
+ analyticsServerEventBatchCreateParams: AnalyticsServerEventBatchCreateParams;
17
+ }
18
+ /**
19
+ *
20
+ */
21
+ export declare class AnalyticsServerEventsApi extends runtime.BaseAPI {
22
+ /**
23
+ * Creates request options for createServerEventBatch without sending the request
24
+ */
25
+ createServerEventBatchRequestOpts(requestParameters: CreateServerEventBatchRequest): Promise<runtime.RequestOpts>;
26
+ /**
27
+ * Verified business events that do not depend on a browser: a completed order, a refund, a signup confirmed by e-mail, a backend error. Authenticated with a project API key; the batch names the website, which must belong to the subscription of the key. Every event carries a stable id, so a retried batch never creates a second copy. The address and user agent of the request belong to the sending server and are never used for geo, device or bot detection; the end user\'s address and user agent are taken from the event only when the backend sends them explicitly, and neither is stored. A purchase sent from the server replaces the browser purchase of the same order id, a browser purchase never replaces a server one. A session that holds only server events counts for goals and revenue, but is no visit: sessions, visitors and bounce rate count sessions with at least one browser event. The server answers 202 as soon as the accepted events are written and lists per reason how many events it dropped.
28
+ * Accepts a batch of events from a customer backend
29
+ */
30
+ createServerEventBatchRaw(requestParameters: CreateServerEventBatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AnalyticsServerEventBatchResult>>;
31
+ /**
32
+ * Verified business events that do not depend on a browser: a completed order, a refund, a signup confirmed by e-mail, a backend error. Authenticated with a project API key; the batch names the website, which must belong to the subscription of the key. Every event carries a stable id, so a retried batch never creates a second copy. The address and user agent of the request belong to the sending server and are never used for geo, device or bot detection; the end user\'s address and user agent are taken from the event only when the backend sends them explicitly, and neither is stored. A purchase sent from the server replaces the browser purchase of the same order id, a browser purchase never replaces a server one. A session that holds only server events counts for goals and revenue, but is no visit: sessions, visitors and bounce rate count sessions with at least one browser event. The server answers 202 as soon as the accepted events are written and lists per reason how many events it dropped.
33
+ * Accepts a batch of events from a customer backend
34
+ */
35
+ createServerEventBatch(requestParameters: CreateServerEventBatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AnalyticsServerEventBatchResult>;
36
+ }
@@ -0,0 +1,64 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * TrustComponent API
5
+ * The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1-beta.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ import * as runtime from '../runtime.js';
15
+ import { AnalyticsServerEventBatchCreateParamsToJSON, } from '../models/AnalyticsServerEventBatchCreateParams.js';
16
+ import { AnalyticsServerEventBatchResultFromJSON, } from '../models/AnalyticsServerEventBatchResult.js';
17
+ /**
18
+ *
19
+ */
20
+ export class AnalyticsServerEventsApi extends runtime.BaseAPI {
21
+ /**
22
+ * Creates request options for createServerEventBatch without sending the request
23
+ */
24
+ async createServerEventBatchRequestOpts(requestParameters) {
25
+ if (requestParameters['analyticsServerEventBatchCreateParams'] == null) {
26
+ throw new runtime.RequiredError('analyticsServerEventBatchCreateParams', 'Required parameter "analyticsServerEventBatchCreateParams" was null or undefined when calling createServerEventBatch().');
27
+ }
28
+ const queryParameters = {};
29
+ const headerParameters = {};
30
+ headerParameters['Content-Type'] = 'application/json';
31
+ if (this.configuration && this.configuration.accessToken) {
32
+ const token = this.configuration.accessToken;
33
+ const tokenString = await token("bearerApiKey", []);
34
+ if (tokenString) {
35
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
36
+ }
37
+ }
38
+ let urlPath = `/analytics/v1/server-events/batches`;
39
+ return {
40
+ path: urlPath,
41
+ method: 'POST',
42
+ headers: headerParameters,
43
+ query: queryParameters,
44
+ body: AnalyticsServerEventBatchCreateParamsToJSON(requestParameters['analyticsServerEventBatchCreateParams']),
45
+ };
46
+ }
47
+ /**
48
+ * Verified business events that do not depend on a browser: a completed order, a refund, a signup confirmed by e-mail, a backend error. Authenticated with a project API key; the batch names the website, which must belong to the subscription of the key. Every event carries a stable id, so a retried batch never creates a second copy. The address and user agent of the request belong to the sending server and are never used for geo, device or bot detection; the end user\'s address and user agent are taken from the event only when the backend sends them explicitly, and neither is stored. A purchase sent from the server replaces the browser purchase of the same order id, a browser purchase never replaces a server one. A session that holds only server events counts for goals and revenue, but is no visit: sessions, visitors and bounce rate count sessions with at least one browser event. The server answers 202 as soon as the accepted events are written and lists per reason how many events it dropped.
49
+ * Accepts a batch of events from a customer backend
50
+ */
51
+ async createServerEventBatchRaw(requestParameters, initOverrides) {
52
+ const requestOptions = await this.createServerEventBatchRequestOpts(requestParameters);
53
+ const response = await this.request(requestOptions, initOverrides);
54
+ return new runtime.JSONApiResponse(response, (jsonValue) => AnalyticsServerEventBatchResultFromJSON(jsonValue));
55
+ }
56
+ /**
57
+ * Verified business events that do not depend on a browser: a completed order, a refund, a signup confirmed by e-mail, a backend error. Authenticated with a project API key; the batch names the website, which must belong to the subscription of the key. Every event carries a stable id, so a retried batch never creates a second copy. The address and user agent of the request belong to the sending server and are never used for geo, device or bot detection; the end user\'s address and user agent are taken from the event only when the backend sends them explicitly, and neither is stored. A purchase sent from the server replaces the browser purchase of the same order id, a browser purchase never replaces a server one. A session that holds only server events counts for goals and revenue, but is no visit: sessions, visitors and bounce rate count sessions with at least one browser event. The server answers 202 as soon as the accepted events are written and lists per reason how many events it dropped.
58
+ * Accepts a batch of events from a customer backend
59
+ */
60
+ async createServerEventBatch(requestParameters, initOverrides) {
61
+ const response = await this.createServerEventBatchRaw(requestParameters, initOverrides);
62
+ return await response.value();
63
+ }
64
+ }
@@ -0,0 +1,146 @@
1
+ /**
2
+ * TrustComponent API
3
+ * The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
4
+ *
5
+ * The version of the OpenAPI document: 0.0.1-beta.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime.js';
13
+ import { type AnalyticsRealtime } from '../models/AnalyticsRealtime.js';
14
+ import { type AnalyticsStatsBreakdown } from '../models/AnalyticsStatsBreakdown.js';
15
+ import { type AnalyticsStatsConversions } from '../models/AnalyticsStatsConversions.js';
16
+ import { type AnalyticsStatsDimensionEnum } from '../models/AnalyticsStatsDimensionEnum.js';
17
+ import { type AnalyticsStatsFilterMatchModeEnum } from '../models/AnalyticsStatsFilterMatchModeEnum.js';
18
+ import { type AnalyticsStatsGranularityEnum } from '../models/AnalyticsStatsGranularityEnum.js';
19
+ import { type AnalyticsStatsOverview } from '../models/AnalyticsStatsOverview.js';
20
+ import { type AnalyticsStatsTimeseries } from '../models/AnalyticsStatsTimeseries.js';
21
+ import { type AnalyticsWebsitesPage } from '../models/AnalyticsWebsitesPage.js';
22
+ export interface GetWebsiteRealtimeRequest {
23
+ websiteId: string;
24
+ }
25
+ export interface GetWebsiteStatsBreakdownsRequest {
26
+ websiteId: string;
27
+ dimension: AnalyticsStatsDimensionEnum;
28
+ from: string;
29
+ to: string;
30
+ filter?: Array<string>;
31
+ page?: number;
32
+ pageSize?: number;
33
+ }
34
+ export interface GetWebsiteStatsConversionsRequest {
35
+ websiteId: string;
36
+ from: string;
37
+ to: string;
38
+ filter?: Array<string>;
39
+ filterMatchMode?: AnalyticsStatsFilterMatchModeEnum;
40
+ }
41
+ export interface GetWebsiteStatsOverviewRequest {
42
+ websiteId: string;
43
+ from: string;
44
+ to: string;
45
+ filter?: Array<string>;
46
+ }
47
+ export interface GetWebsiteStatsTimeseriesRequest {
48
+ websiteId: string;
49
+ from: string;
50
+ to: string;
51
+ granularity?: AnalyticsStatsGranularityEnum;
52
+ filter?: Array<string>;
53
+ }
54
+ export interface GetWebsitesRequest {
55
+ page?: number;
56
+ pageSize?: number;
57
+ }
58
+ /**
59
+ *
60
+ */
61
+ export declare class AnalyticsWebsitesApi extends runtime.BaseAPI {
62
+ /**
63
+ * Creates request options for getWebsiteRealtime without sending the request
64
+ */
65
+ getWebsiteRealtimeRequestOpts(requestParameters: GetWebsiteRealtimeRequest): Promise<runtime.RequestOpts>;
66
+ /**
67
+ * Sessions active in the last five minutes, the pages they are on, and the pageviews of each of the last thirty minutes.
68
+ * Returns the visitors active right now
69
+ */
70
+ getWebsiteRealtimeRaw(requestParameters: GetWebsiteRealtimeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AnalyticsRealtime>>;
71
+ /**
72
+ * Sessions active in the last five minutes, the pages they are on, and the pageviews of each of the last thirty minutes.
73
+ * Returns the visitors active right now
74
+ */
75
+ getWebsiteRealtime(requestParameters: GetWebsiteRealtimeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AnalyticsRealtime>;
76
+ /**
77
+ * Creates request options for getWebsiteStatsBreakdowns without sending the request
78
+ */
79
+ getWebsiteStatsBreakdownsRequestOpts(requestParameters: GetWebsiteStatsBreakdownsRequest): Promise<runtime.RequestOpts>;
80
+ /**
81
+ * The values of one dimension — pages, sources, campaigns, countries, browsers, … — largest first, each with its key figures. Rows of the PATH dimension also carry entrances, exits and time on the page.
82
+ * Returns the key figures of a website split by one dimension
83
+ */
84
+ getWebsiteStatsBreakdownsRaw(requestParameters: GetWebsiteStatsBreakdownsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AnalyticsStatsBreakdown>>;
85
+ /**
86
+ * The values of one dimension — pages, sources, campaigns, countries, browsers, … — largest first, each with its key figures. Rows of the PATH dimension also carry entrances, exits and time on the page.
87
+ * Returns the key figures of a website split by one dimension
88
+ */
89
+ getWebsiteStatsBreakdowns(requestParameters: GetWebsiteStatsBreakdownsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AnalyticsStatsBreakdown>;
90
+ /**
91
+ * Creates request options for getWebsiteStatsConversions without sending the request
92
+ */
93
+ getWebsiteStatsConversionsRequestOpts(requestParameters: GetWebsiteStatsConversionsRequest): Promise<runtime.RequestOpts>;
94
+ /**
95
+ * For each goal of the website the sessions that reached it, the conversion rate and the revenue of those sessions per currency. Revenue is left out when a filter is set.
96
+ * Returns the conversions of every goal of a website
97
+ */
98
+ getWebsiteStatsConversionsRaw(requestParameters: GetWebsiteStatsConversionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AnalyticsStatsConversions>>;
99
+ /**
100
+ * For each goal of the website the sessions that reached it, the conversion rate and the revenue of those sessions per currency. Revenue is left out when a filter is set.
101
+ * Returns the conversions of every goal of a website
102
+ */
103
+ getWebsiteStatsConversions(requestParameters: GetWebsiteStatsConversionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AnalyticsStatsConversions>;
104
+ /**
105
+ * Creates request options for getWebsiteStatsOverview without sending the request
106
+ */
107
+ getWebsiteStatsOverviewRequestOpts(requestParameters: GetWebsiteStatsOverviewRequest): Promise<runtime.RequestOpts>;
108
+ /**
109
+ * Pageviews, sessions, visitors, events, bounces and engaged time of the range, and the same figures for the comparison period: a range that starts at midnight in the website\'s time zone moves back by as many calendar days as it covers and keeps its local times (today until now is compared with yesterday until the same time), any other range moves back by its own length. Without a filter the figures come from the aggregates and reach back as far as aggregates are kept; with a filter they are counted from the stored sessions and events and reach back as far as those are kept.
110
+ * Returns the key figures of a website for a time range and the period before it
111
+ */
112
+ getWebsiteStatsOverviewRaw(requestParameters: GetWebsiteStatsOverviewRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AnalyticsStatsOverview>>;
113
+ /**
114
+ * Pageviews, sessions, visitors, events, bounces and engaged time of the range, and the same figures for the comparison period: a range that starts at midnight in the website\'s time zone moves back by as many calendar days as it covers and keeps its local times (today until now is compared with yesterday until the same time), any other range moves back by its own length. Without a filter the figures come from the aggregates and reach back as far as aggregates are kept; with a filter they are counted from the stored sessions and events and reach back as far as those are kept.
115
+ * Returns the key figures of a website for a time range and the period before it
116
+ */
117
+ getWebsiteStatsOverview(requestParameters: GetWebsiteStatsOverviewRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AnalyticsStatsOverview>;
118
+ /**
119
+ * Creates request options for getWebsiteStatsTimeseries without sending the request
120
+ */
121
+ getWebsiteStatsTimeseriesRequestOpts(requestParameters: GetWebsiteStatsTimeseriesRequest): Promise<runtime.RequestOpts>;
122
+ /**
123
+ * One point per hour or per day of the range, empty buckets included as zero. Days start at midnight in the time zone of the website. Without a granularity, ranges up to three days come per hour and longer ones per day; a series has at most 1,000 points.
124
+ * Returns the key figures of a website per hour or per day
125
+ */
126
+ getWebsiteStatsTimeseriesRaw(requestParameters: GetWebsiteStatsTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AnalyticsStatsTimeseries>>;
127
+ /**
128
+ * One point per hour or per day of the range, empty buckets included as zero. Days start at midnight in the time zone of the website. Without a granularity, ranges up to three days come per hour and longer ones per day; a series has at most 1,000 points.
129
+ * Returns the key figures of a website per hour or per day
130
+ */
131
+ getWebsiteStatsTimeseries(requestParameters: GetWebsiteStatsTimeseriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AnalyticsStatsTimeseries>;
132
+ /**
133
+ * Creates request options for getWebsites without sending the request
134
+ */
135
+ getWebsitesRequestOpts(requestParameters: GetWebsitesRequest): Promise<runtime.RequestOpts>;
136
+ /**
137
+ * Every website of the project the API key belongs to, oldest first, with the id the statistics endpoints take.
138
+ * Lists the websites of the subscription of the API key
139
+ */
140
+ getWebsitesRaw(requestParameters: GetWebsitesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AnalyticsWebsitesPage>>;
141
+ /**
142
+ * Every website of the project the API key belongs to, oldest first, with the id the statistics endpoints take.
143
+ * Lists the websites of the subscription of the API key
144
+ */
145
+ getWebsites(requestParameters?: GetWebsitesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AnalyticsWebsitesPage>;
146
+ }