// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { bodyScan: "body_scan", bodyTag: "body_tag", contentType: "content_type", firstSeen: "first_seen", imageData: "image_data", matchDetails: "match_details", matchId: "match_id", matchedAt: "matched_at", maxEditDistance: "max_edit_distance", maxTime: "max_time", minTime: "min_time", publicScans: "public_scans", queryId: "query_id", queryTag: "query_tag", r2Path: "r2_path", scanStatus: "scan_status", scanSubmissionId: "scan_submission_id", searchLookback: "search_lookback", similarityScore: "similarity_score", similarityThreshold: "similarity_threshold", skippedUrls: "skipped_urls", stringMatches: "string_matches", submissionId: "submission_id", submittedUrls: "submitted_urls", uploadPath: "upload_path", uploadedAt: "uploaded_at", urlScanId: "url_scan_id", }; export type QueriesBulkRequestQueriesItemMap = { [key: string]: unknown | undefined; }; export const QueriesBulkRequestQueriesItemMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type QueriesBulkRequestQueriesList = Array; export const QueriesBulkRequestQueriesList = /*@__PURE__*/ S.Array( QueriesBulkRequestQueriesItemMap, ) as any as S.Schema; export interface BulkQueryRequest { accountId: string; queries?: QueriesBulkRequestQueriesList; } export const BulkQueryRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), queries: S.optional(QueriesBulkRequestQueriesList), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/brand-protection/queries/bulk", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkQueryRequest", }) as any as S.Schema; export interface BulkQueryResponse {} export const BulkQueryResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "BulkQueryResponse", }) as any as S.Schema; export interface CreateLogoRequest { accountId: string; matchType?: string; tag?: string; threshold?: number; } export const CreateLogoRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), matchType: S.optional(S.String.pipe(T.Query("match_type"))), tag: S.optional(S.String.pipe(T.Query())), threshold: S.optional(S.Number.pipe(T.Query())), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/brand-protection/logos", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateLogoRequest", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface CreateLogoResponse { id?: number | null; tag?: string | null; uploadPath?: string | null; } export const CreateLogoResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.Number)), tag: S.optional(S.NullOr(S.String)), uploadPath: S.optional(S.NullOr(S.String).pipe(T.Body("upload_path"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateLogoResponse", }) as any as S.Schema; export interface CreateQueryRequest { accountId: string; id?: string; scan?: boolean; tag?: string; maxTime?: string; minTime?: string; stringMatches?: unknown; bodyScan?: boolean; bodyTag?: string; } export const CreateQueryRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), id: S.optional(S.String.pipe(T.Query())), scan: S.optional(S.Boolean.pipe(T.Query())), tag: S.optional(S.String.pipe(T.Query())), maxTime: S.optional(S.String.pipe(T.Body("max_time"))), minTime: S.optional(S.String.pipe(T.Body("min_time"))), stringMatches: S.optional(S.Unknown.pipe(T.Body("string_matches"))), bodyScan: S.optional(S.Boolean.pipe(T.Body("scan"))), bodyTag: S.optional(S.String.pipe(T.Body("tag"))), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/brand-protection/queries", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateQueryRequest", }) as any as S.Schema; export interface CreateQueryResponse {} export const CreateQueryResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateQueryResponse", }) as any as S.Schema; export interface CreateV2LogoRequest { accountId: string; /** Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string. */ imageData: string; /** Minimum similarity score (0-1) required for visual matches */ similarityThreshold: number; /** Unique identifier for the logo query */ tag: string; /** If true, search historic scanned images for matches above the similarity threshold */ searchLookback?: boolean; } export const CreateV2LogoRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), imageData: S.String.pipe(T.Body("image_data")), similarityThreshold: S.Number.pipe(T.Body("similarity_threshold")), tag: S.String, searchLookback: S.optional(S.Boolean.pipe(T.Body("search_lookback"))), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateV2LogoRequest", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface CreateV2LogoResponse { message: string; queryId?: number | null; } export const CreateV2LogoResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ message: S.String, queryId: S.optional(S.NullOr(S.Number).pipe(T.Body("query_id"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateV2LogoResponse", }) as any as S.Schema; export interface DeleteLogoRequest { accountId: string; logoId: string; } export const DeleteLogoRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), logoId: S.String.pipe(T.Label("logo_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/brand-protection/logos/{logo_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteLogoRequest", }) as any as S.Schema; export interface DeleteLogoResponse {} export const DeleteLogoResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteLogoResponse", }) as any as S.Schema; export interface DeleteQueryRequest { accountId: string; id?: string; scan?: boolean; tag?: string; } export const DeleteQueryRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), id: S.optional(S.String.pipe(T.Query())), scan: S.optional(S.Boolean.pipe(T.Query())), tag: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/brand-protection/queries", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteQueryRequest", }) as any as S.Schema; export interface DeleteQueryResponse {} export const DeleteQueryResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteQueryResponse", }) as any as S.Schema; export interface DeleteV2LogoRequest { accountId: string; queryId: string; } export const DeleteV2LogoRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), queryId: S.String.pipe(T.Label("query_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries/{query_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteV2LogoRequest", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface DeleteV2LogoResponse { message: string; } export const DeleteV2LogoResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ message: S.String, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteV2LogoResponse", }) as any as S.Schema; export type LogoMatchesDownloadRequestLogoIdList = Array; export const LogoMatchesDownloadRequestLogoIdList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface DownloadLogoMatchRequest { accountId: string; limit?: string; logoId?: LogoMatchesDownloadRequestLogoIdList; offset?: string; } export const DownloadLogoMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), limit: S.optional(S.String.pipe(T.Query())), logoId: S.optional( LogoMatchesDownloadRequestLogoIdList.pipe(T.Query("logo_id")), ), offset: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/brand-protection/logo-matches/download", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DownloadLogoMatchRequest", }) as any as S.Schema; export type LogoMatchesDownloadResponseMatchesItemMap = { [key: string]: unknown | undefined; }; export const LogoMatchesDownloadResponseMatchesItemMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type LogoMatchesDownloadResponseMatchesList = Array; export const LogoMatchesDownloadResponseMatchesList = /*@__PURE__*/ S.Array( LogoMatchesDownloadResponseMatchesItemMap, ) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface DownloadLogoMatchResponse { matches?: LogoMatchesDownloadResponseMatchesList | null; total?: number | null; } export const DownloadLogoMatchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ matches: S.optional(S.NullOr(LogoMatchesDownloadResponseMatchesList)), total: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DownloadLogoMatchResponse", }) as any as S.Schema; export interface DownloadMatchRequest { accountId: string; id?: string; includeDomainId?: boolean; limit?: number; offset?: number; } export const DownloadMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), id: S.optional(S.String.pipe(T.Query())), includeDomainId: S.optional(S.Boolean.pipe(T.Query("include_domain_id"))), limit: S.optional(S.Number.pipe(T.Query())), offset: S.optional(S.Number.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/brand-protection/matches/download", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DownloadMatchRequest", }) as any as S.Schema; export type MatchesDownloadResponseMatchesItemMap = { [key: string]: unknown | undefined; }; export const MatchesDownloadResponseMatchesItemMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MatchesDownloadResponseMatchesList = Array; export const MatchesDownloadResponseMatchesList = /*@__PURE__*/ S.Array( MatchesDownloadResponseMatchesItemMap, ) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface DownloadMatchResponse { matches?: MatchesDownloadResponseMatchesList | null; total?: number | null; } export const DownloadMatchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ matches: S.optional(S.NullOr(MatchesDownloadResponseMatchesList)), total: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DownloadMatchResponse", }) as any as S.Schema; export type LogoMatchesGetRequestLogoIdList = Array; export const LogoMatchesGetRequestLogoIdList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface GetLogoMatchRequest { accountId: string; limit?: string; logoId?: LogoMatchesGetRequestLogoIdList; offset?: string; } export const GetLogoMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), limit: S.optional(S.String.pipe(T.Query())), logoId: S.optional( LogoMatchesGetRequestLogoIdList.pipe(T.Query("logo_id")), ), offset: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/brand-protection/logo-matches", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetLogoMatchRequest", }) as any as S.Schema; export type LogoMatchesGetResponseMatchesItemMap = { [key: string]: unknown | undefined; }; export const LogoMatchesGetResponseMatchesItemMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type LogoMatchesGetResponseMatchesList = Array; export const LogoMatchesGetResponseMatchesList = /*@__PURE__*/ S.Array( LogoMatchesGetResponseMatchesItemMap, ) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetLogoMatchResponse { matches?: LogoMatchesGetResponseMatchesList | null; total?: number | null; } export const GetLogoMatchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ matches: S.optional(S.NullOr(LogoMatchesGetResponseMatchesList)), total: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetLogoMatchResponse", }) as any as S.Schema; export interface GetMatchRequest { accountId: string; id?: string; includeDomainId?: boolean; limit?: number; offset?: number; } export const GetMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), id: S.optional(S.String.pipe(T.Query())), includeDomainId: S.optional(S.Boolean.pipe(T.Query("include_domain_id"))), limit: S.optional(S.Number.pipe(T.Query())), offset: S.optional(S.Number.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/brand-protection/matches", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMatchRequest", }) as any as S.Schema; export type MatchesGetResponseMatchesItemMap = { [key: string]: unknown | undefined; }; export const MatchesGetResponseMatchesItemMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type MatchesGetResponseMatchesList = Array; export const MatchesGetResponseMatchesList = /*@__PURE__*/ S.Array( MatchesGetResponseMatchesItemMap, ) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetMatchResponse { matches?: MatchesGetResponseMatchesList | null; total?: number | null; } export const GetMatchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ matches: S.optional(S.NullOr(MatchesGetResponseMatchesList)), total: S.optional(S.NullOr(S.Number)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMatchResponse", }) as any as S.Schema; export interface GetV2LogoRequest { accountId: string; /** Optional query ID to retrieve a specific logo query */ id?: string; /** If true, include base64-encoded image data in the response */ download?: string; } export const GetV2LogoRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), id: S.optional(S.String.pipe(T.Query())), download: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV2LogoRequest", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetV2LogoResponse { id: number; r2Path: string; similarityThreshold: number; tag: string; uploadedAt: string; /** MIME type of the image (only present when download=true) */ contentType?: string | null; /** Base64-encoded image data (only present when download=true) */ imageData?: string | null; } export const GetV2LogoResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, r2Path: S.String.pipe(T.Body("r2_path")), similarityThreshold: S.Number.pipe(T.Body("similarity_threshold")), tag: S.String, uploadedAt: S.String.pipe(T.Body("uploaded_at")), contentType: S.optional(S.NullOr(S.String).pipe(T.Body("content_type"))), imageData: S.optional(S.NullOr(S.String).pipe(T.Body("image_data"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV2LogoResponse", }) as any as S.Schema; export type V2LogoMatchesGetRequestOrder = "asc" | "desc"; export const V2LogoMatchesGetRequestOrder = /*@__PURE__*/ S.String; export type V2LogoMatchesGetRequestOrderBy = | "matchedAt" | "domain" | "similarityScore" | "registrar"; export const V2LogoMatchesGetRequestOrderBy = /*@__PURE__*/ S.String; export interface GetV2LogoMatchRequest { accountId: string; queryId: string; download?: string; limit?: string; offset?: string; /** Sort order. Options: 'asc' (ascending) or 'desc' (descending) */ order?: V2LogoMatchesGetRequestOrder | (string & {}); /** Column to sort by. Options: 'matchedAt', 'domain', 'similarityScore', or 'registrar' */ orderBy?: V2LogoMatchesGetRequestOrderBy | (string & {}); } export const GetV2LogoMatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), queryId: S.String.pipe(T.Query("query_id")), download: S.optional(S.String.pipe(T.Query())), limit: S.optional(S.String.pipe(T.Query())), offset: S.optional(S.String.pipe(T.Query())), order: S.optional(V2LogoMatchesGetRequestOrder.pipe(T.Query())), orderBy: S.optional(V2LogoMatchesGetRequestOrderBy.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/matches", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV2LogoMatchRequest", }) as any as S.Schema; export interface V2LogoMatchesGetResponseMatchesItem { id: number; domain: string; matchedAt: string; queryId: number; registrar: string; similarityScore: number; urlScanId: string; contentType?: string | null; imageData?: string | null; } export const V2LogoMatchesGetResponseMatchesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.Number, domain: S.String, matchedAt: S.String.pipe(T.Body("matched_at")), queryId: S.Number.pipe(T.Body("query_id")), registrar: S.String, similarityScore: S.Number.pipe(T.Body("similarity_score")), urlScanId: S.String.pipe(T.Body("url_scan_id")), contentType: S.optional(S.NullOr(S.String).pipe(T.Body("content_type"))), imageData: S.optional(S.NullOr(S.String).pipe(T.Body("image_data"))), }), ).annotate({ identifier: "V2LogoMatchesGetResponseMatchesItem", }) as any as S.Schema; export type V2LogoMatchesGetResponseMatchesList = Array; export const V2LogoMatchesGetResponseMatchesList = /*@__PURE__*/ S.Array( V2LogoMatchesGetResponseMatchesItem, ) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetV2LogoMatchResponse { matches: V2LogoMatchesGetResponseMatchesList; total: number; } export const GetV2LogoMatchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ matches: V2LogoMatchesGetResponseMatchesList, total: S.Number, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV2LogoMatchResponse", }) as any as S.Schema; export type V2MatchesGetRequestQueryIdList = Array; export const V2MatchesGetRequestQueryIdList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type V2MatchesGetRequestOrder = "asc" | "desc"; export const V2MatchesGetRequestOrder = /*@__PURE__*/ S.String; export type V2MatchesGetRequestOrderBy = "domain" | "first_seen" | "registrar"; export const V2MatchesGetRequestOrderBy = /*@__PURE__*/ S.String; export interface GetV2MatchRequest { accountId: string; /** Query ID or comma-separated list of Query IDs. When multiple IDs are provided, matches are deduplicated across queries and each match includes a match_details array with per-match query metadata and dismissed state. */ queryId: V2MatchesGetRequestQueryIdList; /** Filter matches by domain name (substring match) */ domainSearch?: string; includeDismissed?: string; includeDomainId?: string; limit?: string; offset?: string; /** Sort order. Options: 'asc' (ascending) or 'desc' (descending) */ order?: V2MatchesGetRequestOrder | (string & {}); /** Column to sort by. Options: 'domain', 'first_seen', or 'registrar' */ orderBy?: V2MatchesGetRequestOrderBy | (string & {}); } export const GetV2MatchRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), queryId: V2MatchesGetRequestQueryIdList.pipe(T.Query("query_id")), domainSearch: S.optional(S.String.pipe(T.Query("domain_search"))), includeDismissed: S.optional(S.String.pipe(T.Query("include_dismissed"))), includeDomainId: S.optional(S.String.pipe(T.Query("include_domain_id"))), limit: S.optional(S.String.pipe(T.Query())), offset: S.optional(S.String.pipe(T.Query())), order: S.optional(V2MatchesGetRequestOrder.pipe(T.Query())), orderBy: S.optional(V2MatchesGetRequestOrderBy.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/domain/matches", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV2MatchRequest", }) as any as S.Schema; export interface V2MatchesGetResponseMatchesItemPublicScans { submissionId: string; } export const V2MatchesGetResponseMatchesItemPublicScans = /*@__PURE__*/ S.suspend(() => S.Struct({ submissionId: S.String.pipe(T.Body("submission_id")), }), ).annotate({ identifier: "V2MatchesGetResponseMatchesItemPublicScans", }) as any as S.Schema; export interface V2MatchesGetResponseMatchesItemMatchDetailsItem { /** Individual dismissed state for this specific match. */ dismissed: boolean; matchId: number; queryId: number; /** Tag associated with the query, if one exists. */ queryTag: string; } export const V2MatchesGetResponseMatchesItemMatchDetailsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ dismissed: S.Boolean, matchId: S.Number.pipe(T.Body("match_id")), queryId: S.Number.pipe(T.Body("query_id")), queryTag: S.String.pipe(T.Body("query_tag")), }), ).annotate({ identifier: "V2MatchesGetResponseMatchesItemMatchDetailsItem", }) as any as S.Schema; export type V2MatchesGetResponseMatchesItemMatchDetailsList = Array; export const V2MatchesGetResponseMatchesItemMatchDetailsList = /*@__PURE__*/ S.Array( V2MatchesGetResponseMatchesItemMatchDetailsItem, ) as any as S.Schema; export interface V2MatchesGetResponseMatchesItem { domain: string; firstSeen: string; publicScans: V2MatchesGetResponseMatchesItemPublicScans; registrar: string; scanStatus: string; scanSubmissionId: number; source: string; /** Whether the match is dismissed. Only present for single-query requests. For multi-query requests, use the dismissed field in each match_details entry. */ dismissed?: boolean | null; /** Per-match detail objects with query metadata and individual dismissed state. Only present when multiple query_ids are requested. */ matchDetails?: V2MatchesGetResponseMatchesItemMatchDetailsList | null; } export const V2MatchesGetResponseMatchesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ domain: S.String, firstSeen: S.String.pipe(T.Body("first_seen")), publicScans: V2MatchesGetResponseMatchesItemPublicScans.pipe( T.Body("public_scans"), ), registrar: S.String, scanStatus: S.String.pipe(T.Body("scan_status")), scanSubmissionId: S.Number.pipe(T.Body("scan_submission_id")), source: S.String, dismissed: S.optional(S.NullOr(S.Boolean)), matchDetails: S.optional( S.NullOr(V2MatchesGetResponseMatchesItemMatchDetailsList).pipe( T.Body("match_details"), ), ), }), ).annotate({ identifier: "V2MatchesGetResponseMatchesItem", }) as any as S.Schema; export type V2MatchesGetResponseMatchesList = Array; export const V2MatchesGetResponseMatchesList = /*@__PURE__*/ S.Array( V2MatchesGetResponseMatchesItem, ) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetV2MatchResponse { matches: V2MatchesGetResponseMatchesList; total: number; } export const GetV2MatchResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ matches: V2MatchesGetResponseMatchesList, total: S.Number, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV2MatchResponse", }) as any as S.Schema; export interface GetV2QueryRequest { accountId: string; id?: string; } export const GetV2QueryRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), id: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/domain/queries", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV2QueryRequest", }) as any as S.Schema; export interface V2QueriesGetResponseParametersStringMatchesItem { pattern: string; } export const V2QueriesGetResponseParametersStringMatchesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ pattern: S.String, }), ).annotate({ identifier: "V2QueriesGetResponseParametersStringMatchesItem", }) as any as S.Schema; export type V2QueriesGetResponseParametersStringMatchesList = Array; export const V2QueriesGetResponseParametersStringMatchesList = /*@__PURE__*/ S.Array( V2QueriesGetResponseParametersStringMatchesItem, ) as any as S.Schema; export interface V2QueriesGetResponseParameters { stringMatches: V2QueriesGetResponseParametersStringMatchesList; maxTime?: string | null; minTime?: string | null; } export const V2QueriesGetResponseParameters = /*@__PURE__*/ S.suspend(() => S.Struct({ stringMatches: V2QueriesGetResponseParametersStringMatchesList.pipe( T.Body("string_matches"), ), maxTime: S.optional(S.NullOr(S.String).pipe(T.Body("max_time"))), minTime: S.optional(S.NullOr(S.String).pipe(T.Body("min_time"))), }), ).annotate({ identifier: "V2QueriesGetResponseParameters", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetV2QueryResponse { created: string; parameters: V2QueriesGetResponseParameters; queryId: number; queryTag: string; scan: boolean; updated: string; } export const GetV2QueryResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ created: S.String, parameters: V2QueriesGetResponseParameters, queryId: S.Number.pipe(T.Body("query_id")), queryTag: S.String.pipe(T.Body("query_tag")), scan: S.Boolean, updated: S.String, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV2QueryResponse", }) as any as S.Schema; export interface SubmitBrandProtectionRequest { accountId: string; } export const SubmitBrandProtectionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/brand-protection/submit", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "SubmitBrandProtectionRequest", }) as any as S.Schema; export type SubmitResponseSkippedUrlsItemMap = { [key: string]: unknown | undefined; }; export const SubmitResponseSkippedUrlsItemMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type SubmitResponseSkippedUrlsList = Array; export const SubmitResponseSkippedUrlsList = /*@__PURE__*/ S.Array( SubmitResponseSkippedUrlsItemMap, ) as any as S.Schema; export type SubmitResponseSubmittedUrlsItemMap = { [key: string]: unknown | undefined; }; export const SubmitResponseSubmittedUrlsItemMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type SubmitResponseSubmittedUrlsList = Array; export const SubmitResponseSubmittedUrlsList = /*@__PURE__*/ S.Array( SubmitResponseSubmittedUrlsItemMap, ) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface SubmitBrandProtectionResponse { skippedUrls?: SubmitResponseSkippedUrlsList | null; submittedUrls?: SubmitResponseSubmittedUrlsList | null; } export const SubmitBrandProtectionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ skippedUrls: S.optional( S.NullOr(SubmitResponseSkippedUrlsList).pipe(T.Body("skipped_urls")), ), submittedUrls: S.optional( S.NullOr(SubmitResponseSubmittedUrlsList).pipe(T.Body("submitted_urls")), ), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "SubmitBrandProtectionResponse", }) as any as S.Schema; export interface UrlInfoBrandProtectionRequest { accountId: string; } export const UrlInfoBrandProtectionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/brand-protection/url-info", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UrlInfoBrandProtectionRequest", }) as any as S.Schema; export type UrlInfoResultItemMap = { [key: string]: unknown | undefined }; export const UrlInfoResultItemMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type UrlInfoResultList = Array; export const UrlInfoResultList = /*@__PURE__*/ S.Array( UrlInfoResultItemMap, ) as any as S.Schema; export interface UrlInfoBrandProtectionResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: UrlInfoResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const UrlInfoBrandProtectionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: UrlInfoResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UrlInfoBrandProtectionResponse", }) as any as S.Schema; export type BulkQueryError = CloudflareOpError; /** Return a success message after creating new saved string queries in bulk */ export const bulkQuery: API.OperationMethod< BulkQueryRequest, BulkQueryResponse, BulkQueryError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: BulkQueryRequest, output: BulkQueryResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateLogoError = CloudflareOpError; /** Return new saved logo queries created from image files */ export const createLogo: API.OperationMethod< CreateLogoRequest, CreateLogoResponse, CreateLogoError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateLogoRequest, output: CreateLogoResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateQueryError = CloudflareOpError; /** Return a success message after creating new saved string queries */ export const createQuery: API.OperationMethod< CreateQueryRequest, CreateQueryResponse, CreateQueryError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateQueryRequest, output: CreateQueryResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateV2LogoError = CloudflareOpError; /** Create a new saved brand protection logo query for visual similarity matching */ export const createV2Logo: API.OperationMethod< CreateV2LogoRequest, CreateV2LogoResponse, CreateV2LogoError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateV2LogoRequest, output: CreateV2LogoResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteLogoError = CloudflareOpError; /** Return a success message after deleting saved logo queries by ID */ export const deleteLogo: API.OperationMethod< DeleteLogoRequest, DeleteLogoResponse, DeleteLogoError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteLogoRequest, output: DeleteLogoResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteQueryError = CloudflareOpError; /** Return a success message after deleting saved string queries by ID */ export const deleteQuery: API.OperationMethod< DeleteQueryRequest, DeleteQueryResponse, DeleteQueryError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteQueryRequest, output: DeleteQueryResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteV2LogoError = CloudflareOpError; /** Delete a saved brand protection logo query. Returns 404 if the query ID doesn't exist. */ export const deleteV2Logo: API.OperationMethod< DeleteV2LogoRequest, DeleteV2LogoResponse, DeleteV2LogoError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteV2LogoRequest, output: DeleteV2LogoResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DownloadLogoMatchError = CloudflareOpError; /** Return matches as CSV for logo queries based on ID */ export const downloadLogoMatch: API.OperationMethod< DownloadLogoMatchRequest, DownloadLogoMatchResponse, DownloadLogoMatchError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DownloadLogoMatchRequest, output: DownloadLogoMatchResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DownloadMatchError = CloudflareOpError; /** Return matches as CSV for string queries based on ID */ export const downloadMatch: API.OperationMethod< DownloadMatchRequest, DownloadMatchResponse, DownloadMatchError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DownloadMatchRequest, output: DownloadMatchResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetLogoMatchError = CloudflareOpError; /** Return matches for logo queries based on ID */ export const getLogoMatch: API.OperationMethod< GetLogoMatchRequest, GetLogoMatchResponse, GetLogoMatchError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetLogoMatchRequest, output: GetLogoMatchResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetMatchError = CloudflareOpError; /** Return matches for string queries based on ID */ export const getMatch: API.OperationMethod< GetMatchRequest, GetMatchResponse, GetMatchError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetMatchRequest, output: GetMatchResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetV2LogoError = CloudflareOpError; /** Get all saved brand protection logo queries for an account. Optionally specify id to get a single query. Set download=true to include base64-encoded image data. */ export const getV2Logo: API.OperationMethod< GetV2LogoRequest, GetV2LogoResponse, GetV2LogoError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetV2LogoRequest, output: GetV2LogoResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetV2LogoMatchError = CloudflareOpError; /** Get paginated list of logo matches for a specific brand protection logo query */ export const getV2LogoMatch: API.OperationMethod< GetV2LogoMatchRequest, GetV2LogoMatchResponse, GetV2LogoMatchError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetV2LogoMatchRequest, output: GetV2LogoMatchResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetV2MatchError = CloudflareOpError; /** Get paginated list of domain matches for one or more brand protection queries. When multiple query_ids are provided (comma-separated), matches are deduplicated across queries and each match includes a match_details array with per-match query metadata and individual dismissed state. */ export const getV2Match: API.OperationMethod< GetV2MatchRequest, GetV2MatchResponse, GetV2MatchError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetV2MatchRequest, output: GetV2MatchResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetV2QueryError = CloudflareOpError; /** Get all saved brand protection queries for an account */ export const getV2Query: API.OperationMethod< GetV2QueryRequest, GetV2QueryResponse, GetV2QueryError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetV2QueryRequest, output: GetV2QueryResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type SubmitBrandProtectionError = CloudflareOpError; /** Return new URL submissions */ export const submitBrandProtection: API.OperationMethod< SubmitBrandProtectionRequest, SubmitBrandProtectionResponse, SubmitBrandProtectionError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: SubmitBrandProtectionRequest, output: SubmitBrandProtectionResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UrlInfoBrandProtectionError = CloudflareOpError; /** Return submitted URLs based on ID */ export const urlInfoBrandProtection: API.PaginatedOperationMethod< UrlInfoBrandProtectionRequest, UrlInfoBrandProtectionResponse, UrlInfoBrandProtectionError, CloudflareOpContext, UrlInfoResultItemMap > = /*@__PURE__*/ API.makePaginated( () => ({ input: UrlInfoBrandProtectionRequest, output: UrlInfoBrandProtectionResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any;