@haakco/custd-sdk 0.0.0-stage → 3.71.1

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 (196) hide show
  1. package/README.md +958 -2
  2. package/dist/admin-accounting-evidence.d.ts +48 -0
  3. package/dist/admin-accounting-evidence.js +24 -0
  4. package/dist/admin-app-releases.d.ts +116 -0
  5. package/dist/admin-app-releases.js +8 -0
  6. package/dist/admin-apps.d.ts +120 -0
  7. package/dist/admin-apps.js +47 -0
  8. package/dist/admin-auth-project-domain.d.ts +125 -0
  9. package/dist/admin-auth-project-domain.js +37 -0
  10. package/dist/admin-auth-projects.d.ts +989 -0
  11. package/dist/admin-auth-projects.js +527 -0
  12. package/dist/admin-campaign-email.d.ts +120 -0
  13. package/dist/admin-campaign-email.js +64 -0
  14. package/dist/admin-client-setup.d.ts +122 -0
  15. package/dist/admin-client-setup.js +408 -0
  16. package/dist/admin-data-labels.d.ts +124 -0
  17. package/dist/admin-data-labels.js +51 -0
  18. package/dist/admin-data-scopes.d.ts +93 -0
  19. package/dist/admin-data-scopes.js +154 -0
  20. package/dist/admin-email-relay.d.ts +66 -0
  21. package/dist/admin-email-relay.js +25 -0
  22. package/dist/admin-environment-policy.d.ts +32 -0
  23. package/dist/admin-environment-policy.js +26 -0
  24. package/dist/admin-error-issues.d.ts +91 -0
  25. package/dist/admin-error-issues.js +52 -0
  26. package/dist/admin-event-types.d.ts +57 -0
  27. package/dist/admin-event-types.js +28 -0
  28. package/dist/admin-impersonation.d.ts +48 -0
  29. package/dist/admin-impersonation.js +27 -0
  30. package/dist/admin-ingest-claims.d.ts +35 -0
  31. package/dist/admin-ingest-claims.js +26 -0
  32. package/dist/admin-managed-audit.d.ts +13 -0
  33. package/dist/admin-managed-audit.js +13 -0
  34. package/dist/admin-measurement-projects.d.ts +166 -0
  35. package/dist/admin-measurement-projects.js +120 -0
  36. package/dist/admin-notification-destinations.d.ts +31 -0
  37. package/dist/admin-notification-destinations.js +19 -0
  38. package/dist/admin-notification-webhooks.d.ts +64 -0
  39. package/dist/admin-notification-webhooks.js +42 -0
  40. package/dist/admin-oauth-client-admissions.d.ts +65 -0
  41. package/dist/admin-oauth-client-admissions.js +46 -0
  42. package/dist/admin-offboarding.d.ts +123 -0
  43. package/dist/admin-offboarding.js +129 -0
  44. package/dist/admin-predictions.d.ts +266 -0
  45. package/dist/admin-predictions.js +93 -0
  46. package/dist/admin-privacy-erasures.d.ts +74 -0
  47. package/dist/admin-privacy-erasures.js +73 -0
  48. package/dist/admin-retention.d.ts +99 -0
  49. package/dist/admin-retention.js +60 -0
  50. package/dist/admin-rls.d.ts +94 -0
  51. package/dist/admin-rls.js +33 -0
  52. package/dist/admin-sdk-usage.d.ts +41 -0
  53. package/dist/admin-sdk-usage.js +23 -0
  54. package/dist/admin-site-ai.d.ts +72 -0
  55. package/dist/admin-site-ai.js +1 -0
  56. package/dist/admin-site-analytics.d.ts +52 -0
  57. package/dist/admin-site-analytics.js +14 -0
  58. package/dist/admin-site-audit-pages.d.ts +76 -0
  59. package/dist/admin-site-audit-pages.js +27 -0
  60. package/dist/admin-site-campaign-links.d.ts +40 -0
  61. package/dist/admin-site-campaign-links.js +9 -0
  62. package/dist/admin-site-domains.d.ts +733 -0
  63. package/dist/admin-site-domains.js +768 -0
  64. package/dist/admin-site-export.d.ts +76 -0
  65. package/dist/admin-site-export.js +15 -0
  66. package/dist/admin-site-insights-tasks.d.ts +44 -0
  67. package/dist/admin-site-insights-tasks.js +28 -0
  68. package/dist/admin-site-insights.d.ts +527 -0
  69. package/dist/admin-site-insights.js +61 -0
  70. package/dist/admin-site-links.d.ts +87 -0
  71. package/dist/admin-site-links.js +16 -0
  72. package/dist/admin-site-monitors.d.ts +110 -0
  73. package/dist/admin-site-monitors.js +25 -0
  74. package/dist/admin-site-next-actions.d.ts +93 -0
  75. package/dist/admin-site-next-actions.js +36 -0
  76. package/dist/admin-site-page-queries.d.ts +63 -0
  77. package/dist/admin-site-page-queries.js +20 -0
  78. package/dist/admin-site-rankings.d.ts +98 -0
  79. package/dist/admin-site-rankings.js +46 -0
  80. package/dist/admin-site-regional-trends.d.ts +30 -0
  81. package/dist/admin-site-regional-trends.js +1 -0
  82. package/dist/admin-site-saved-reports.d.ts +45 -0
  83. package/dist/admin-site-saved-reports.js +13 -0
  84. package/dist/admin-site-search-pool.d.ts +77 -0
  85. package/dist/admin-site-search-pool.js +41 -0
  86. package/dist/admin-site-search-value.d.ts +97 -0
  87. package/dist/admin-site-search-value.js +29 -0
  88. package/dist/admin-site-status-page.d.ts +57 -0
  89. package/dist/admin-site-status-page.js +10 -0
  90. package/dist/admin-site-traffic.d.ts +145 -0
  91. package/dist/admin-site-traffic.js +32 -0
  92. package/dist/admin-site-web-data.d.ts +258 -0
  93. package/dist/admin-site-web-data.js +60 -0
  94. package/dist/admin-subject-exports.d.ts +79 -0
  95. package/dist/admin-subject-exports.js +44 -0
  96. package/dist/admin-support-access.d.ts +32 -0
  97. package/dist/admin-support-access.js +21 -0
  98. package/dist/admin-system.d.ts +283 -0
  99. package/dist/admin-system.js +65 -0
  100. package/dist/admin-tenant-storage.d.ts +35 -0
  101. package/dist/admin-tenant-storage.js +24 -0
  102. package/dist/admin-timeplans.d.ts +512 -0
  103. package/dist/admin-timeplans.js +200 -0
  104. package/dist/admin-uncertainty-models.d.ts +42 -0
  105. package/dist/admin-uncertainty-models.js +53 -0
  106. package/dist/admin-usage.d.ts +124 -0
  107. package/dist/admin-usage.js +169 -0
  108. package/dist/admin-users.d.ts +124 -0
  109. package/dist/admin-users.js +82 -0
  110. package/dist/admin-workflow-timings.d.ts +367 -0
  111. package/dist/admin-workflow-timings.js +117 -0
  112. package/dist/analytics-events.d.ts +167 -0
  113. package/dist/analytics-events.js +197 -0
  114. package/dist/analytics-reads.d.ts +81 -0
  115. package/dist/analytics-reads.js +5 -0
  116. package/dist/app-account.d.ts +84 -0
  117. package/dist/app-account.js +177 -0
  118. package/dist/app-alerts.d.ts +120 -0
  119. package/dist/app-alerts.js +44 -0
  120. package/dist/app-items.d.ts +786 -0
  121. package/dist/app-items.js +524 -0
  122. package/dist/app-live.d.ts +84 -0
  123. package/dist/app-live.js +228 -0
  124. package/dist/app-meetings.d.ts +95 -0
  125. package/dist/app-meetings.js +26 -0
  126. package/dist/app-models.d.ts +271 -0
  127. package/dist/app-models.js +83 -0
  128. package/dist/app-push.d.ts +64 -0
  129. package/dist/app-push.js +178 -0
  130. package/dist/backend-lifecycle.d.ts +85 -0
  131. package/dist/backend-lifecycle.js +212 -0
  132. package/dist/browser-manifest.json +7 -0
  133. package/dist/browser-script-BWnwDjAC.js +711 -0
  134. package/dist/browser-script.d.ts +1 -0
  135. package/dist/browser-script.js +5 -0
  136. package/dist/browser-sign-in.d.ts +153 -0
  137. package/dist/browser-sign-in.js +410 -0
  138. package/dist/browser-tracker.d.ts +142 -0
  139. package/dist/browser-tracker.js +775 -0
  140. package/dist/browser-web-vitals.d.ts +22 -0
  141. package/dist/browser-web-vitals.js +116 -0
  142. package/dist/browser.d.ts +10 -0
  143. package/dist/browser.js +10 -0
  144. package/dist/download-stream.d.ts +16 -0
  145. package/dist/download-stream.js +55 -0
  146. package/dist/error-capture.d.ts +62 -0
  147. package/dist/error-capture.js +168 -0
  148. package/dist/hosted-app.d.ts +115 -0
  149. package/dist/hosted-app.js +275 -0
  150. package/dist/index.d.ts +2324 -0
  151. package/dist/index.js +2226 -0
  152. package/dist/ingest-operations.d.ts +483 -0
  153. package/dist/ingest-operations.js +154 -0
  154. package/dist/measurement.d.ts +164 -0
  155. package/dist/measurement.js +104 -0
  156. package/dist/mobile-adapter.d.ts +25 -0
  157. package/dist/mobile-adapter.js +57 -0
  158. package/dist/mobile-context.d.ts +32 -0
  159. package/dist/mobile-context.js +156 -0
  160. package/dist/mobile-queue.d.ts +22 -0
  161. package/dist/mobile-queue.js +73 -0
  162. package/dist/oauth.d.ts +1 -0
  163. package/dist/oauth.js +8 -0
  164. package/dist/parsers.d.ts +149 -0
  165. package/dist/parsers.js +115 -0
  166. package/dist/public-reads.d.ts +79 -0
  167. package/dist/public-reads.js +57 -0
  168. package/dist/reporting-catalogue.d.ts +264 -0
  169. package/dist/reporting-catalogue.js +5 -0
  170. package/dist/reporting-state.d.ts +46 -0
  171. package/dist/reporting-state.js +76 -0
  172. package/dist/response-lists.d.ts +16 -0
  173. package/dist/response-lists.generated.d.ts +7 -0
  174. package/dist/response-lists.generated.js +1927 -0
  175. package/dist/response-lists.js +70 -0
  176. package/dist/response-validation.d.ts +30 -0
  177. package/dist/response-validation.js +94 -0
  178. package/dist/runtime-readiness.d.ts +30 -0
  179. package/dist/runtime-readiness.js +150 -0
  180. package/dist/schema-registry.d.ts +45 -0
  181. package/dist/schema-registry.js +9 -0
  182. package/dist/secure-url.d.ts +4 -0
  183. package/dist/secure-url.js +23 -0
  184. package/dist/site-ai-owner.d.ts +34 -0
  185. package/dist/site-ai-owner.js +99 -0
  186. package/dist/site-monitor-reports.d.ts +15 -0
  187. package/dist/site-monitor-reports.js +87 -0
  188. package/dist/testing/fake-custd.d.ts +150 -0
  189. package/dist/testing/fake-custd.js +842 -0
  190. package/dist/testing/fake-results.d.ts +30 -0
  191. package/dist/testing/fake-results.js +293 -0
  192. package/dist/testing.d.ts +2 -0
  193. package/dist/testing.js +3 -0
  194. package/dist/version.d.ts +10 -0
  195. package/dist/version.js +10 -0
  196. package/package.json +57 -4
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Row-level security status and reconciliation plans. A plan records the policy state the catalogue
3
+ * expects; executing it converges the live database and returns a diff plus the SQL that undoes it.
4
+ * Creating and executing a plan both require an idempotency key.
5
+ */
6
+ import type { RequestOptions } from "./index.js";
7
+ /** One table's row-level security policy. */
8
+ export type RlsPolicySpec = {
9
+ enabled: boolean;
10
+ force: boolean;
11
+ policy_name: string;
12
+ };
13
+ /** One table's live policy compared with the catalogue. */
14
+ export type RlsTableDiff = {
15
+ table: string;
16
+ classification: string;
17
+ drift: boolean;
18
+ desired?: RlsPolicySpec;
19
+ live?: RlsPolicySpec;
20
+ reason?: string;
21
+ };
22
+ export type RlsStatus = {
23
+ catalog_version: string;
24
+ catalog_digest: string;
25
+ tables: RlsTableDiff[];
26
+ };
27
+ /** A table's policy before and after reconciliation. */
28
+ export type RlsPolicyDiff = {
29
+ table: string;
30
+ converged: boolean;
31
+ desired: RlsPolicySpec;
32
+ live: RlsPolicySpec;
33
+ drift: string[];
34
+ };
35
+ export type RlsPlanRequest = {
36
+ label: string;
37
+ git_commit: string;
38
+ expires_in_seconds?: number;
39
+ };
40
+ /** One catalogue decision the plan expects to hold. */
41
+ export type RlsExpectedTable = {
42
+ table: string;
43
+ classification: string;
44
+ reason?: string;
45
+ };
46
+ export type RlsPlan = {
47
+ plan_uuid: string;
48
+ label: string;
49
+ git_commit: string;
50
+ catalog_version: string;
51
+ catalog_digest: string;
52
+ target_tables: string[];
53
+ expected_state: RlsExpectedTable[];
54
+ reversible_sql_digest: string;
55
+ created_at: string;
56
+ expires_at: string;
57
+ idempotency_key: string;
58
+ actor_id: string;
59
+ };
60
+ export type RlsExecuteRequest = {
61
+ force?: boolean;
62
+ };
63
+ export type RlsExecuteOutcome = "attempted" | "success" | "failure";
64
+ export type RlsExecuteResponse = {
65
+ plan_uuid: string;
66
+ outcome: RlsExecuteOutcome;
67
+ diff: RlsPolicyDiff[];
68
+ rollback_sql: string;
69
+ started_at: string;
70
+ finished_at: string;
71
+ };
72
+ export type RlsProof = {
73
+ plan_uuid: string;
74
+ diff: RlsPolicyDiff[];
75
+ before: Record<string, RlsPolicySpec>;
76
+ after: Record<string, RlsPolicySpec>;
77
+ rollback_sql: string;
78
+ attempted_at: string;
79
+ completed_at: string;
80
+ };
81
+ /** Plan creation and execution are rejected without an idempotency key. */
82
+ export type RlsIdempotentOptions = RequestOptions & {
83
+ idempotencyKey: string;
84
+ };
85
+ type AdminRequester = <T>(method: string, path: string, body?: unknown, options?: RequestOptions) => Promise<T>;
86
+ export declare class RlsAdminClient {
87
+ private readonly request;
88
+ constructor(request: AdminRequester);
89
+ status(options?: RequestOptions): Promise<RlsStatus>;
90
+ createPlan(body: RlsPlanRequest, options: RlsIdempotentOptions): Promise<RlsPlan>;
91
+ executePlan(planUuid: string, body: RlsExecuteRequest, options: RlsIdempotentOptions): Promise<RlsExecuteResponse>;
92
+ getPlanProof(planUuid: string, options?: RequestOptions): Promise<RlsProof>;
93
+ }
94
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Row-level security status and reconciliation plans. A plan records the policy state the catalogue
3
+ * expects; executing it converges the live database and returns a diff plus the SQL that undoes it.
4
+ * Creating and executing a plan both require an idempotency key.
5
+ */
6
+ const plansPath = "/rls/reconciliation-plans";
7
+ export class RlsAdminClient {
8
+ constructor(request) {
9
+ this.request = request;
10
+ }
11
+ async status(options) {
12
+ const status = await this.request("GET", "/rls/status", undefined, options);
13
+ return { ...status, tables: status.tables ?? [] };
14
+ }
15
+ async createPlan(body, options) {
16
+ const plan = await this.request("POST", plansPath, body, options);
17
+ return { ...plan, target_tables: plan.target_tables ?? [] };
18
+ }
19
+ async executePlan(planUuid, body, options) {
20
+ const result = await this.request("POST", `${planPath(planUuid)}/execute`, body, options);
21
+ return { ...result, diff: normalizeDiffs(result.diff) };
22
+ }
23
+ async getPlanProof(planUuid, options) {
24
+ const proof = await this.request("GET", `${planPath(planUuid)}/proof`, undefined, options);
25
+ return { ...proof, diff: normalizeDiffs(proof.diff) };
26
+ }
27
+ }
28
+ function planPath(planUuid) {
29
+ return `${plansPath}/${encodeURIComponent(planUuid)}`;
30
+ }
31
+ function normalizeDiffs(diffs) {
32
+ return (diffs ?? []).map((diff) => ({ ...diff, drift: diff.drift ?? [] }));
33
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * SDK usage by release, as Custd observes it from the `X-Custd-Sdk` header, and the deprecations
3
+ * Custd announces for a release range.
4
+ */
5
+ import type { RequestOptions } from "./index.js";
6
+ /** A deprecation recorded for every release of one SDK within `versionScope`. */
7
+ export type SdkVersionDeprecation = {
8
+ sdk: string;
9
+ versionScope: string;
10
+ recommendedVersion: string;
11
+ note: string;
12
+ markedBy: string;
13
+ deprecatedAt: string;
14
+ };
15
+ /** One SDK release seen in requests. */
16
+ export type SdkUsageItem = {
17
+ sdk: string;
18
+ version: string;
19
+ state: string;
20
+ requests: number;
21
+ firstSeenAt: string;
22
+ lastSeenAt: string;
23
+ deprecation?: SdkVersionDeprecation;
24
+ };
25
+ export type SdkUsageListResponse = {
26
+ items: SdkUsageItem[];
27
+ };
28
+ export type SdkVersionDeprecationRequest = {
29
+ recommendedVersion: string;
30
+ note: string;
31
+ };
32
+ type AdminRequester = <T>(method: string, path: string, body?: unknown, options?: RequestOptions) => Promise<T>;
33
+ export declare class SdkUsageAdminClient {
34
+ private readonly request;
35
+ constructor(request: AdminRequester);
36
+ list(options?: RequestOptions): Promise<SdkUsageListResponse>;
37
+ /** Marks every release of `sdk` within `versionScope` deprecated. */
38
+ putDeprecation(sdk: string, versionScope: string, body: SdkVersionDeprecationRequest, options?: RequestOptions): Promise<SdkVersionDeprecation>;
39
+ deleteDeprecation(sdk: string, versionScope: string, options?: RequestOptions): Promise<void>;
40
+ }
41
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * SDK usage by release, as Custd observes it from the `X-Custd-Sdk` header, and the deprecations
3
+ * Custd announces for a release range.
4
+ */
5
+ export class SdkUsageAdminClient {
6
+ constructor(request) {
7
+ this.request = request;
8
+ }
9
+ async list(options) {
10
+ const list = await this.request("GET", "/sdk-usage", undefined, options);
11
+ return { items: list.items ?? [] };
12
+ }
13
+ /** Marks every release of `sdk` within `versionScope` deprecated. */
14
+ putDeprecation(sdk, versionScope, body, options) {
15
+ return this.request("PUT", deprecationPath(sdk, versionScope), body, options);
16
+ }
17
+ deleteDeprecation(sdk, versionScope, options) {
18
+ return this.request("DELETE", deprecationPath(sdk, versionScope), undefined, options);
19
+ }
20
+ }
21
+ function deprecationPath(sdk, versionScope) {
22
+ return `/sdk-usage/deprecations/${encodeURIComponent(sdk)}/${encodeURIComponent(versionScope)}`;
23
+ }
@@ -0,0 +1,72 @@
1
+ export type SiteAIMode = "off" | "platform" | "own-key";
2
+ export type SiteAIUsagePeriod = "day" | "month" | "previous-month";
3
+ export type SiteAIProduct = "hosting" | "custd" | "cb" | "awthy";
4
+ /** Grant requires the version the tenant explicitly accepted. */
5
+ export type SiteAIConsentRequest = {
6
+ action: "grant";
7
+ termsVersion: string;
8
+ } | {
9
+ action: "revoke";
10
+ };
11
+ export type SiteAIOwnerHandoffRequest = {
12
+ tenantSlug: string;
13
+ ownerSubject: string;
14
+ };
15
+ export type SiteAIOwnerHandoff = {
16
+ code: string;
17
+ redeemUrl: string;
18
+ };
19
+ export type SiteAISettings = {
20
+ aiMode: SiteAIMode;
21
+ monthlyCapUsdMicros: number;
22
+ keyConfigured: boolean;
23
+ ownKeyAvailable?: boolean;
24
+ keyRefused?: boolean;
25
+ currentTermsVersion?: string;
26
+ acceptedTermsVersion?: string;
27
+ consentAcceptedAt?: string;
28
+ };
29
+ export type SiteAISettingsRequest = {
30
+ aiMode: SiteAIMode;
31
+ monthlyCapUsdMicros: number;
32
+ apiKey?: string;
33
+ };
34
+ export type SiteAIUsageRow = {
35
+ tenantSlug?: string;
36
+ feature: string;
37
+ samplingProduct?: SiteAIProduct;
38
+ provider: string;
39
+ method: string;
40
+ model: string;
41
+ payer: string;
42
+ priceRevision: string;
43
+ attempts: number;
44
+ unsettledAttempts: number;
45
+ unknownCostAttempts: number;
46
+ failedAttempts: number;
47
+ notSentAttempts: number;
48
+ inputTokens: number;
49
+ cachedInputTokens: number;
50
+ outputTokens: number;
51
+ searches: number;
52
+ pages: number;
53
+ audioMilliseconds: number;
54
+ confirmedCostUsdMicros: number;
55
+ estimatedCostUsdMicros: number;
56
+ capAccountedUsdMicros: number;
57
+ };
58
+ export type SiteAIUsage = {
59
+ period: SiteAIUsagePeriod;
60
+ from: string;
61
+ until: string;
62
+ rows: SiteAIUsageRow[];
63
+ };
64
+ export type SiteAITenantUsage = SiteAIUsage & {
65
+ period: "month";
66
+ aiMode: SiteAIMode;
67
+ monthlyCapUsdMicros: number;
68
+ monthlyCapUsedUsdMicros?: number;
69
+ };
70
+ export type SiteAIPlatformUsage = SiteAIUsage & {
71
+ samplingMonthlyCapUsdMicros: number;
72
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,52 @@
1
+ import type { SiteSearchConnectionStatus } from "./admin-site-domains.js";
2
+ /** A 400 on connectAnalytics: propertyId is not a GA4 property's numeric ID. */
3
+ export declare const SITE_ANALYTICS_PROPERTY_INVALID_CODE = "site_analytics_property_invalid";
4
+ /** A 404 on disconnectAnalytics: the domain is not connected to GA4. */
5
+ export declare const SITE_ANALYTICS_CONNECTION_NOT_FOUND_CODE = "site_analytics_connection_not_found";
6
+ /** The analytics provider a connection reads. */
7
+ export declare const SITE_ANALYTICS_PROVIDER_GA4 = "ga4";
8
+ /** A GA4 report Custd does not import, as SiteAnalyticsReport.unavailable names it. */
9
+ export declare const SiteAnalyticsUnavailableReport: {
10
+ readonly Ecommerce: "ecommerce";
11
+ readonly Audience: "audience";
12
+ };
13
+ export type SiteAnalyticsUnavailableReport = (typeof SiteAnalyticsUnavailableReport)[keyof typeof SiteAnalyticsUnavailableReport];
14
+ /** The GA4 property: 123456789 or properties/123456789. */
15
+ export type SiteAnalyticsConnectionRequest = {
16
+ propertyId: string;
17
+ };
18
+ export type SiteAnalyticsConnection = {
19
+ /** SITE_ANALYTICS_PROVIDER_GA4. */
20
+ provider: "ga4";
21
+ propertyId: string;
22
+ status: SiteSearchConnectionStatus;
23
+ lastImportedAt?: string;
24
+ lastFailure?: string;
25
+ };
26
+ /** One landing page, key event or channel. */
27
+ export type SiteAnalyticsRow = {
28
+ key: string;
29
+ sessions?: number;
30
+ engagedSessions?: number;
31
+ keyEvents?: number;
32
+ };
33
+ export type SiteAnalyticsUnavailable = {
34
+ /** A SiteAnalyticsUnavailableReport value. */
35
+ report: SiteAnalyticsUnavailableReport;
36
+ reason: string;
37
+ };
38
+ /** connection, windowFrom and windowTo are absent until the domain is connected and imported. */
39
+ export type SiteAnalyticsReport = {
40
+ domainUuid: string;
41
+ connection?: SiteAnalyticsConnection;
42
+ /** YYYY-MM-DD. */
43
+ windowFrom?: string;
44
+ /** YYYY-MM-DD. */
45
+ windowTo?: string;
46
+ /** false while the property records no key events, so rows carry no keyEvents. */
47
+ keyEventsRecorded: boolean;
48
+ landingPages: SiteAnalyticsRow[];
49
+ keyEvents: SiteAnalyticsRow[];
50
+ channels: SiteAnalyticsRow[];
51
+ unavailable: SiteAnalyticsUnavailable[];
52
+ };
@@ -0,0 +1,14 @@
1
+ // A domain's GA4 reports: landing pages, key events and channels imported from
2
+ // the domain's GA4 property. SiteDomainAdminClient sends the calls. A number
3
+ // GA4 did not report is absent, never 0.
4
+ /** A 400 on connectAnalytics: propertyId is not a GA4 property's numeric ID. */
5
+ export const SITE_ANALYTICS_PROPERTY_INVALID_CODE = "site_analytics_property_invalid";
6
+ /** A 404 on disconnectAnalytics: the domain is not connected to GA4. */
7
+ export const SITE_ANALYTICS_CONNECTION_NOT_FOUND_CODE = "site_analytics_connection_not_found";
8
+ /** The analytics provider a connection reads. */
9
+ export const SITE_ANALYTICS_PROVIDER_GA4 = "ga4";
10
+ /** A GA4 report Custd does not import, as SiteAnalyticsReport.unavailable names it. */
11
+ export const SiteAnalyticsUnavailableReport = {
12
+ Ecommerce: "ecommerce",
13
+ Audience: "audience",
14
+ };
@@ -0,0 +1,76 @@
1
+ import type { SiteDomainRequestOptions, SiteFinding } from "./admin-site-domains.js";
2
+ /** A 400 on setLighthousePages: each URL must be on the domain's host and not its home page. */
3
+ export declare const SITE_LIGHTHOUSE_PAGE_NOT_EXTRA_CODE = "site_lighthouse_page_not_extra";
4
+ /** listAuditPages returns this many pages when no limit is given. */
5
+ export declare const SITE_AUDIT_PAGES_DEFAULT_LIMIT = 50;
6
+ /** The most pages one listAuditPages call returns. */
7
+ export declare const SITE_AUDIT_PAGES_MAX_LIMIT = 200;
8
+ /** How many extra pages beside the home page Lighthouse may measure. */
9
+ export declare const SITE_LIGHTHOUSE_MAX_EXTRA_PAGES = 5;
10
+ /** Whether a crawled page can be indexed. */
11
+ export declare const SiteAuditPageIndexability: {
12
+ readonly Indexable: "indexable";
13
+ readonly Noindex: "noindex";
14
+ readonly Canonicalized: "canonicalized";
15
+ readonly Redirected: "redirected";
16
+ readonly Error: "error";
17
+ readonly NotHTML: "not_html";
18
+ };
19
+ export type SiteAuditPageIndexability = (typeof SiteAuditPageIndexability)[keyof typeof SiteAuditPageIndexability];
20
+ /** How the latest audit run ended. */
21
+ export declare const SiteAuditRun: {
22
+ readonly NotAudited: "not_audited";
23
+ readonly Failed: "failed";
24
+ readonly Truncated: "truncated";
25
+ readonly Complete: "complete";
26
+ };
27
+ export type SiteAuditRun = (typeof SiteAuditRun)[keyof typeof SiteAuditRun];
28
+ /** One crawled URL. depth and inboundLinks are absent when unknown; a present 0 is a real 0. */
29
+ export type SiteAuditPage = {
30
+ url: string;
31
+ /** Where the URL redirected to; absent when it did not redirect. */
32
+ finalUrl?: string;
33
+ /** HTTP status of the first response; 0 when the request failed. */
34
+ status: number;
35
+ /** A SiteAuditPageIndexability value. */
36
+ indexability: SiteAuditPageIndexability;
37
+ /** Clicks from the home page. */
38
+ depth?: number;
39
+ /** Crawled pages that link here; absent on a truncated crawl. */
40
+ inboundLinks?: number;
41
+ openFindings: number;
42
+ };
43
+ /** One page of the latest crawl's URLs; auditedAt is absent before the first audit. */
44
+ export type SiteAuditPageList = {
45
+ domainUuid: string;
46
+ auditedAt?: string;
47
+ /** The crawl stopped at its bound; depth and inbound links are left out. */
48
+ truncated: boolean;
49
+ offset: number;
50
+ limit: number;
51
+ total: number;
52
+ pages: SiteAuditPage[];
53
+ };
54
+ /** Findings the latest audit opened, reopened and fixed against the audit before it. */
55
+ export type SiteAuditDelta = {
56
+ domainUuid: string;
57
+ /** A SiteAuditRun value. */
58
+ run: SiteAuditRun;
59
+ auditedAt?: string;
60
+ failure?: string;
61
+ new: SiteFinding[];
62
+ reopened: SiteFinding[];
63
+ fixed: SiteFinding[];
64
+ };
65
+ /** The extra pages Lighthouse measures; the home page is always measured. */
66
+ export type SiteLighthousePages = {
67
+ domainUuid: string;
68
+ homePage: string;
69
+ /** The extra pages, in the order they were set. */
70
+ urls: string[];
71
+ maxPages: number;
72
+ };
73
+ /** getLighthouseHistory's options: `url` names an extra page to read instead of the home page. */
74
+ export type SiteLighthouseRequestOptions = SiteDomainRequestOptions & {
75
+ url?: string;
76
+ };
@@ -0,0 +1,27 @@
1
+ // The pages a domain's latest audit crawled, what changed since the audit
2
+ // before it, and the extra pages Lighthouse measures beside the home page.
3
+ // SiteDomainAdminClient sends them. A measurement Custd did not take is absent, never 0.
4
+ /** A 400 on setLighthousePages: each URL must be on the domain's host and not its home page. */
5
+ export const SITE_LIGHTHOUSE_PAGE_NOT_EXTRA_CODE = "site_lighthouse_page_not_extra";
6
+ /** listAuditPages returns this many pages when no limit is given. */
7
+ export const SITE_AUDIT_PAGES_DEFAULT_LIMIT = 50;
8
+ /** The most pages one listAuditPages call returns. */
9
+ export const SITE_AUDIT_PAGES_MAX_LIMIT = 200;
10
+ /** How many extra pages beside the home page Lighthouse may measure. */
11
+ export const SITE_LIGHTHOUSE_MAX_EXTRA_PAGES = 5;
12
+ /** Whether a crawled page can be indexed. */
13
+ export const SiteAuditPageIndexability = {
14
+ Indexable: "indexable",
15
+ Noindex: "noindex",
16
+ Canonicalized: "canonicalized",
17
+ Redirected: "redirected",
18
+ Error: "error",
19
+ NotHTML: "not_html",
20
+ };
21
+ /** How the latest audit run ended. */
22
+ export const SiteAuditRun = {
23
+ NotAudited: "not_audited",
24
+ Failed: "failed",
25
+ Truncated: "truncated",
26
+ Complete: "complete",
27
+ };
@@ -0,0 +1,40 @@
1
+ /** A 409 on createCampaignLink: the domain already has an active link with this tagged URL. */
2
+ export declare const SITE_CAMPAIGN_LINK_TAKEN_CODE = "site_campaign_link_taken";
3
+ /** A 409 on createCampaignLink: the domain keeps the most active links; archive one first. */
4
+ export declare const SITE_CAMPAIGN_LINK_LIMIT_CODE = "site_campaign_link_limit";
5
+ /** How many active campaign links one domain keeps. */
6
+ export declare const SITE_CAMPAIGN_LINKS_MAX = 500;
7
+ /**
8
+ * source, medium and campaign are required; term (the paid keyword) and content are optional.
9
+ * Every value is at most 100 characters; the server trims, lower-cases and joins spaces with "_".
10
+ */
11
+ export type SiteCampaignLinkRequest = {
12
+ /** The page the link opens, on the domain's own host. */
13
+ url: string;
14
+ source: string;
15
+ medium: string;
16
+ campaign: string;
17
+ term?: string;
18
+ content?: string;
19
+ };
20
+ /** One saved link; term and content are empty when unset, archivedAt absent while active. */
21
+ export type SiteCampaignLink = {
22
+ linkUuid: string;
23
+ url: string;
24
+ source: string;
25
+ medium: string;
26
+ campaign: string;
27
+ term: string;
28
+ content: string;
29
+ /** The link to share: url with its utm_* parameters. */
30
+ taggedUrl: string;
31
+ createdAt: string;
32
+ archivedAt?: string;
33
+ };
34
+ /** A domain's links, newest first, and the utm_source and utm_medium names to suggest. */
35
+ export type SiteCampaignLinkList = {
36
+ links: SiteCampaignLink[];
37
+ maxLinks: number;
38
+ suggestedSources: string[];
39
+ suggestedMediums: string[];
40
+ };
@@ -0,0 +1,9 @@
1
+ // A domain's saved UTM campaign links: a page on the domain's own host tagged
2
+ // with utm_* values, kept so staff share the same spelling every time.
3
+ // SiteDomainAdminClient sends the calls.
4
+ /** A 409 on createCampaignLink: the domain already has an active link with this tagged URL. */
5
+ export const SITE_CAMPAIGN_LINK_TAKEN_CODE = "site_campaign_link_taken";
6
+ /** A 409 on createCampaignLink: the domain keeps the most active links; archive one first. */
7
+ export const SITE_CAMPAIGN_LINK_LIMIT_CODE = "site_campaign_link_limit";
8
+ /** How many active campaign links one domain keeps. */
9
+ export const SITE_CAMPAIGN_LINKS_MAX = 500;