@cookiemunch/sdk 0.4.0 → 0.4.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.
- package/CHANGELOG.md +44 -0
- package/LICENSE +21 -0
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +14 -6
package/dist/index.d.cts
CHANGED
|
@@ -400,6 +400,11 @@ declare function verifyWebhookSignature(input: VerifyWebhookInput): boolean;
|
|
|
400
400
|
* const sites = await fc.sites.list();
|
|
401
401
|
*/
|
|
402
402
|
|
|
403
|
+
/**
|
|
404
|
+
* This package's version, sent in the default User-Agent. Cloudflare answers a request with
|
|
405
|
+
* no recognisable User-Agent with `403 error code: 1010`; a test pins this to package.json.
|
|
406
|
+
*/
|
|
407
|
+
declare const SDK_VERSION = "0.4.1";
|
|
403
408
|
interface CookieMunchOptions {
|
|
404
409
|
apiKey: string;
|
|
405
410
|
/** "https://api.cookiemunch.net" — the /v1 prefix is appended automatically. */
|
|
@@ -411,6 +416,8 @@ interface CookieMunchOptions {
|
|
|
411
416
|
* declare is refused (`400 unknown_field`, with `field`) instead of ignored. Catches typos.
|
|
412
417
|
*/
|
|
413
418
|
strictUnknownFields?: boolean;
|
|
419
|
+
/** The `User-Agent` sent on every request. Default `cookiemunch-js/<version>`. */
|
|
420
|
+
userAgent?: string;
|
|
414
421
|
}
|
|
415
422
|
/**
|
|
416
423
|
* Thrown for any non-2xx response. `message` is the server's `error` field when present;
|
|
@@ -448,9 +455,12 @@ interface CategorizedCookie {
|
|
|
448
455
|
/**
|
|
449
456
|
* Why a person should look at it. Visitors see unclassified and category ones under
|
|
450
457
|
* "Unclassified"; `retired_but_seen` = retired, but a crawl or a visit saw it since, so the
|
|
451
|
-
* site still sets it and it is listed again.
|
|
458
|
+
* site still sets it and it is listed again. `awaiting_corroboration` / `suspicious_report` =
|
|
459
|
+
* only visitors reported it (not enough of them yet, or in one injection-shaped report), owner
|
|
460
|
+
* views only; `foreign_cmp` = another consent platform's cookie, filed unclassified;
|
|
461
|
+
* `not_seen_recently` = unseen for the site's `staleAfterDays`, owner views only.
|
|
452
462
|
*/
|
|
453
|
-
review?: 'unclassified' | 'category_disabled' | 'category_unknown' | 'retired_but_seen';
|
|
463
|
+
review?: 'unclassified' | 'category_disabled' | 'category_unknown' | 'retired_but_seen' | 'awaiting_corroboration' | 'suspicious_report' | 'foreign_cmp' | 'not_seen_recently';
|
|
454
464
|
/** Epoch-ms a crawl or a real visit last saw it. Absent on older rows. */
|
|
455
465
|
lastSeenAt?: number;
|
|
456
466
|
/** Owner views only: the site owner retired this cookie (see `sites.retireCookie`). */
|
|
@@ -529,7 +539,7 @@ interface DeclaredCookie extends DeclaredCookieInput {
|
|
|
529
539
|
vendor?: string;
|
|
530
540
|
}
|
|
531
541
|
/** A platform whose cookies and storage a preset declares. */
|
|
532
|
-
type CookiePresetVendor = 'atlas' | 'forumulate' | 'chatly' | 'cookiemunch';
|
|
542
|
+
type CookiePresetVendor = 'atlas' | 'forumulate' | 'chatly' | 'cookiemunch' | 'referally';
|
|
533
543
|
/** Where a vendor's live manifest will come from, and whether it exists yet. */
|
|
534
544
|
interface CookiePresetManifest {
|
|
535
545
|
status: 'builtin' | 'waiting_on_vendor';
|
|
@@ -537,13 +547,15 @@ interface CookiePresetManifest {
|
|
|
537
547
|
item?: string;
|
|
538
548
|
contract?: string;
|
|
539
549
|
}
|
|
540
|
-
/** Preset parameters: Atlas `frontendApiHost`/`crossSubdomainCookies`; Chatly `publicId`/`dragging`/`category`. */
|
|
550
|
+
/** Preset parameters: Atlas `frontendApiHost`/`crossSubdomainCookies`; Chatly `publicId`/`dragging`/`category`; Referally `cookieDomain`/`cookieDays`/`category`. */
|
|
541
551
|
interface CookiePresetParams {
|
|
542
552
|
frontendApiHost?: string;
|
|
543
553
|
crossSubdomainCookies?: boolean;
|
|
544
554
|
publicId?: string;
|
|
545
555
|
dragging?: boolean;
|
|
546
556
|
category?: string;
|
|
557
|
+
cookieDomain?: string;
|
|
558
|
+
cookieDays?: number;
|
|
547
559
|
}
|
|
548
560
|
/** One preset in GET /v1/sites/:cbid/cookies/presets. */
|
|
549
561
|
interface CookiePreset {
|
|
@@ -2250,7 +2262,7 @@ interface CookieMunchClient {
|
|
|
2250
2262
|
dryRun: true;
|
|
2251
2263
|
retired: RetiredCookie[];
|
|
2252
2264
|
}>;
|
|
2253
|
-
/** Every declaration preset (atlas, forumulate, chatly, cookiemunch): params, what it declared here, manifest status. */
|
|
2265
|
+
/** Every declaration preset (atlas, forumulate, chatly, cookiemunch, referally): params, what it declared here, manifest status. */
|
|
2254
2266
|
cookiePresets(cbid: string): Promise<{
|
|
2255
2267
|
presets: CookiePreset[];
|
|
2256
2268
|
}>;
|
|
@@ -2910,4 +2922,4 @@ interface CookieMunchClient {
|
|
|
2910
2922
|
}
|
|
2911
2923
|
declare function createCookieMunch(opts: CookieMunchOptions): CookieMunchClient;
|
|
2912
2924
|
|
|
2913
|
-
export { type AbResult, type AccountOrg, type AccountOrgs, type AdPersonalizationInput, type AiInspectInput, type AiInspectResult, type ApiKey, type ApiKeyIssueInput, type ApiKeyIssued, type ApiKeyPrefix, type ApiKeyReport, type ApiKeyUpdate, type AppliedImport, type AssetUpload, type AuditEntry, type BannerRecord, type BannerSummary, type BlockedReport, type BrandExtractionResult, type BrandKit, type BrandKitCreate, type BrandSuggestion, type BulkSiteInput, type BulkSiteResult, type ButtonParityFinding, type ButtonParityLint, type ButtonParityScan, type CategorizedCookie, type ChildKeyInput, type ConfigChange, type ConfigDryRun, type ConfigWarning, type ConsentDay, type ConsentDecisionInput, type ConsentIngestInput, type ConsentLogRow, type CookieDeclaration, CookieMunchApiError, type CookieMunchClient, type CookieMunchOptions, type CookiePreset, type CookiePresetManifest, type CookiePresetParams, type CookiePresetResult, type CookiePresetVendor, type CspSources, type DeclarationDiff, type DeclarationDryRun, type DeclarationWarning, type DeclaredCookie, type DeclaredCookieInput, type DnsRecordInstruction, type DsarCreate, type DsarEraseResult, type DsarExecutor, type DsarExecutorCreated, type DsarExecutorDryRun, type DsarExecutorInput, type DsarExecutorPatch, type DsarExecutorPresetInput, type DsarExportResult, type DsarRequest, type DsarStatus, type DsarTask, type DsarTaskEvent, type DsarTaskExport, type DsarTaskLogEntry, type DsarTaskOutcome, type DsarType, type EnforcementRuleInput, type ExecutorHealth, type ExecutorPresetName, type ExecutorPresetUpgrade, type ExecutorPresets, type ExecutorProfile, type ExecutorTestInput, type ExecutorTestResult, type ExecutorWebhookDelivery, type ExecutorWebhookTestResult, type FlowIssue, type FlowOp, type FlowOpResponse, type FulfillmentOp, type HealthRow, type Identifier, type Identity, type ImportedCookie, type ImportedDeclaration, type InstallSnippet, type IntegrationHealthReport, type LegalBasis, type LogQuery, type MailProvider, type MailProviderInput, type MailProviderKind, type MailProviderTestResult, type Member, type ObservedPurgeResult, type OptInMethod, type Org, type OrgUpdate, type ParityControlSummary, type PartnerCatalogEntry, type PartnerId, type PartnerLink, type PartnerLinkCreate, type PlanSource, type PolicyOptions, type PreferenceItem, type PreferenceRecord, type PreviewToken, type PreviewTokenOptions, type ProfileAttributeInput, type ProvisionRequest, type ProvisionResult, type ProvisionStep, type PublicDsarFiled, type PublicDsarPending, type PublicVerification, type PutConfigOptions, type RangeQuery, type Regulation, type RegulationSummary, type RegulatoryFeedResult, type ResellerChild, type ResellerChildCreate, type ResellerChildList, type ResellerChildPatch, type RetiredCookie, type RightKind, type RightsCaptcha, type RightsCaptchaInput, type RightsCaptchaProvider, type RightsIdentity, type RightsIdentityInput, type RightsIdentityType, type RightsLink, type RightsLinkInput, type RightsPageDocument, type RightsPageDomain, type RightsPageDomainList, type RightsPageDraft, type RightsPageDraftConflict, type RightsPageDryRun, type RightsPageIssue, type RightsPagePublishResult, type RightsPagePublished, type RightsPagePublisher, type RightsPageVersions, type RightsPageWriteOptions, type RiskScore, type RopaEntry, type RopaInput, type ScanResult, type ScanStatus, type ScoredVendor, type ScrollbarTheme, type SessionAnalysisInput, type SignedReceipt, type Site, type SiteConfig, type SiteCookie, type SiteCreate, type SiteFlow, type SiteUpdate, type SiteUpdateResult, type SnippetOptions, type StorageType, type SubscriptionTopicInput, type SuggestedRejectStyle, type SupportedLanguage, type Usage, type VendorInput, type VendorRecord, type VerifyResult, type VerifyWebhookInput, type WebhookCreate, type WebhookDeadLetter, type WebhookKeyForm, type WebhookStage, type WebhookSubscription, type WebhookTestResult, type WebhookUpdate, createCookieMunch, verifyWebhookSignature };
|
|
2925
|
+
export { type AbResult, type AccountOrg, type AccountOrgs, type AdPersonalizationInput, type AiInspectInput, type AiInspectResult, type ApiKey, type ApiKeyIssueInput, type ApiKeyIssued, type ApiKeyPrefix, type ApiKeyReport, type ApiKeyUpdate, type AppliedImport, type AssetUpload, type AuditEntry, type BannerRecord, type BannerSummary, type BlockedReport, type BrandExtractionResult, type BrandKit, type BrandKitCreate, type BrandSuggestion, type BulkSiteInput, type BulkSiteResult, type ButtonParityFinding, type ButtonParityLint, type ButtonParityScan, type CategorizedCookie, type ChildKeyInput, type ConfigChange, type ConfigDryRun, type ConfigWarning, type ConsentDay, type ConsentDecisionInput, type ConsentIngestInput, type ConsentLogRow, type CookieDeclaration, CookieMunchApiError, type CookieMunchClient, type CookieMunchOptions, type CookiePreset, type CookiePresetManifest, type CookiePresetParams, type CookiePresetResult, type CookiePresetVendor, type CspSources, type DeclarationDiff, type DeclarationDryRun, type DeclarationWarning, type DeclaredCookie, type DeclaredCookieInput, type DnsRecordInstruction, type DsarCreate, type DsarEraseResult, type DsarExecutor, type DsarExecutorCreated, type DsarExecutorDryRun, type DsarExecutorInput, type DsarExecutorPatch, type DsarExecutorPresetInput, type DsarExportResult, type DsarRequest, type DsarStatus, type DsarTask, type DsarTaskEvent, type DsarTaskExport, type DsarTaskLogEntry, type DsarTaskOutcome, type DsarType, type EnforcementRuleInput, type ExecutorHealth, type ExecutorPresetName, type ExecutorPresetUpgrade, type ExecutorPresets, type ExecutorProfile, type ExecutorTestInput, type ExecutorTestResult, type ExecutorWebhookDelivery, type ExecutorWebhookTestResult, type FlowIssue, type FlowOp, type FlowOpResponse, type FulfillmentOp, type HealthRow, type Identifier, type Identity, type ImportedCookie, type ImportedDeclaration, type InstallSnippet, type IntegrationHealthReport, type LegalBasis, type LogQuery, type MailProvider, type MailProviderInput, type MailProviderKind, type MailProviderTestResult, type Member, type ObservedPurgeResult, type OptInMethod, type Org, type OrgUpdate, type ParityControlSummary, type PartnerCatalogEntry, type PartnerId, type PartnerLink, type PartnerLinkCreate, type PlanSource, type PolicyOptions, type PreferenceItem, type PreferenceRecord, type PreviewToken, type PreviewTokenOptions, type ProfileAttributeInput, type ProvisionRequest, type ProvisionResult, type ProvisionStep, type PublicDsarFiled, type PublicDsarPending, type PublicVerification, type PutConfigOptions, type RangeQuery, type Regulation, type RegulationSummary, type RegulatoryFeedResult, type ResellerChild, type ResellerChildCreate, type ResellerChildList, type ResellerChildPatch, type RetiredCookie, type RightKind, type RightsCaptcha, type RightsCaptchaInput, type RightsCaptchaProvider, type RightsIdentity, type RightsIdentityInput, type RightsIdentityType, type RightsLink, type RightsLinkInput, type RightsPageDocument, type RightsPageDomain, type RightsPageDomainList, type RightsPageDraft, type RightsPageDraftConflict, type RightsPageDryRun, type RightsPageIssue, type RightsPagePublishResult, type RightsPagePublished, type RightsPagePublisher, type RightsPageVersions, type RightsPageWriteOptions, type RiskScore, type RopaEntry, type RopaInput, SDK_VERSION, type ScanResult, type ScanStatus, type ScoredVendor, type ScrollbarTheme, type SessionAnalysisInput, type SignedReceipt, type Site, type SiteConfig, type SiteCookie, type SiteCreate, type SiteFlow, type SiteUpdate, type SiteUpdateResult, type SnippetOptions, type StorageType, type SubscriptionTopicInput, type SuggestedRejectStyle, type SupportedLanguage, type Usage, type VendorInput, type VendorRecord, type VerifyResult, type VerifyWebhookInput, type WebhookCreate, type WebhookDeadLetter, type WebhookKeyForm, type WebhookStage, type WebhookSubscription, type WebhookTestResult, type WebhookUpdate, createCookieMunch, verifyWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -400,6 +400,11 @@ declare function verifyWebhookSignature(input: VerifyWebhookInput): boolean;
|
|
|
400
400
|
* const sites = await fc.sites.list();
|
|
401
401
|
*/
|
|
402
402
|
|
|
403
|
+
/**
|
|
404
|
+
* This package's version, sent in the default User-Agent. Cloudflare answers a request with
|
|
405
|
+
* no recognisable User-Agent with `403 error code: 1010`; a test pins this to package.json.
|
|
406
|
+
*/
|
|
407
|
+
declare const SDK_VERSION = "0.4.1";
|
|
403
408
|
interface CookieMunchOptions {
|
|
404
409
|
apiKey: string;
|
|
405
410
|
/** "https://api.cookiemunch.net" — the /v1 prefix is appended automatically. */
|
|
@@ -411,6 +416,8 @@ interface CookieMunchOptions {
|
|
|
411
416
|
* declare is refused (`400 unknown_field`, with `field`) instead of ignored. Catches typos.
|
|
412
417
|
*/
|
|
413
418
|
strictUnknownFields?: boolean;
|
|
419
|
+
/** The `User-Agent` sent on every request. Default `cookiemunch-js/<version>`. */
|
|
420
|
+
userAgent?: string;
|
|
414
421
|
}
|
|
415
422
|
/**
|
|
416
423
|
* Thrown for any non-2xx response. `message` is the server's `error` field when present;
|
|
@@ -448,9 +455,12 @@ interface CategorizedCookie {
|
|
|
448
455
|
/**
|
|
449
456
|
* Why a person should look at it. Visitors see unclassified and category ones under
|
|
450
457
|
* "Unclassified"; `retired_but_seen` = retired, but a crawl or a visit saw it since, so the
|
|
451
|
-
* site still sets it and it is listed again.
|
|
458
|
+
* site still sets it and it is listed again. `awaiting_corroboration` / `suspicious_report` =
|
|
459
|
+
* only visitors reported it (not enough of them yet, or in one injection-shaped report), owner
|
|
460
|
+
* views only; `foreign_cmp` = another consent platform's cookie, filed unclassified;
|
|
461
|
+
* `not_seen_recently` = unseen for the site's `staleAfterDays`, owner views only.
|
|
452
462
|
*/
|
|
453
|
-
review?: 'unclassified' | 'category_disabled' | 'category_unknown' | 'retired_but_seen';
|
|
463
|
+
review?: 'unclassified' | 'category_disabled' | 'category_unknown' | 'retired_but_seen' | 'awaiting_corroboration' | 'suspicious_report' | 'foreign_cmp' | 'not_seen_recently';
|
|
454
464
|
/** Epoch-ms a crawl or a real visit last saw it. Absent on older rows. */
|
|
455
465
|
lastSeenAt?: number;
|
|
456
466
|
/** Owner views only: the site owner retired this cookie (see `sites.retireCookie`). */
|
|
@@ -529,7 +539,7 @@ interface DeclaredCookie extends DeclaredCookieInput {
|
|
|
529
539
|
vendor?: string;
|
|
530
540
|
}
|
|
531
541
|
/** A platform whose cookies and storage a preset declares. */
|
|
532
|
-
type CookiePresetVendor = 'atlas' | 'forumulate' | 'chatly' | 'cookiemunch';
|
|
542
|
+
type CookiePresetVendor = 'atlas' | 'forumulate' | 'chatly' | 'cookiemunch' | 'referally';
|
|
533
543
|
/** Where a vendor's live manifest will come from, and whether it exists yet. */
|
|
534
544
|
interface CookiePresetManifest {
|
|
535
545
|
status: 'builtin' | 'waiting_on_vendor';
|
|
@@ -537,13 +547,15 @@ interface CookiePresetManifest {
|
|
|
537
547
|
item?: string;
|
|
538
548
|
contract?: string;
|
|
539
549
|
}
|
|
540
|
-
/** Preset parameters: Atlas `frontendApiHost`/`crossSubdomainCookies`; Chatly `publicId`/`dragging`/`category`. */
|
|
550
|
+
/** Preset parameters: Atlas `frontendApiHost`/`crossSubdomainCookies`; Chatly `publicId`/`dragging`/`category`; Referally `cookieDomain`/`cookieDays`/`category`. */
|
|
541
551
|
interface CookiePresetParams {
|
|
542
552
|
frontendApiHost?: string;
|
|
543
553
|
crossSubdomainCookies?: boolean;
|
|
544
554
|
publicId?: string;
|
|
545
555
|
dragging?: boolean;
|
|
546
556
|
category?: string;
|
|
557
|
+
cookieDomain?: string;
|
|
558
|
+
cookieDays?: number;
|
|
547
559
|
}
|
|
548
560
|
/** One preset in GET /v1/sites/:cbid/cookies/presets. */
|
|
549
561
|
interface CookiePreset {
|
|
@@ -2250,7 +2262,7 @@ interface CookieMunchClient {
|
|
|
2250
2262
|
dryRun: true;
|
|
2251
2263
|
retired: RetiredCookie[];
|
|
2252
2264
|
}>;
|
|
2253
|
-
/** Every declaration preset (atlas, forumulate, chatly, cookiemunch): params, what it declared here, manifest status. */
|
|
2265
|
+
/** Every declaration preset (atlas, forumulate, chatly, cookiemunch, referally): params, what it declared here, manifest status. */
|
|
2254
2266
|
cookiePresets(cbid: string): Promise<{
|
|
2255
2267
|
presets: CookiePreset[];
|
|
2256
2268
|
}>;
|
|
@@ -2910,4 +2922,4 @@ interface CookieMunchClient {
|
|
|
2910
2922
|
}
|
|
2911
2923
|
declare function createCookieMunch(opts: CookieMunchOptions): CookieMunchClient;
|
|
2912
2924
|
|
|
2913
|
-
export { type AbResult, type AccountOrg, type AccountOrgs, type AdPersonalizationInput, type AiInspectInput, type AiInspectResult, type ApiKey, type ApiKeyIssueInput, type ApiKeyIssued, type ApiKeyPrefix, type ApiKeyReport, type ApiKeyUpdate, type AppliedImport, type AssetUpload, type AuditEntry, type BannerRecord, type BannerSummary, type BlockedReport, type BrandExtractionResult, type BrandKit, type BrandKitCreate, type BrandSuggestion, type BulkSiteInput, type BulkSiteResult, type ButtonParityFinding, type ButtonParityLint, type ButtonParityScan, type CategorizedCookie, type ChildKeyInput, type ConfigChange, type ConfigDryRun, type ConfigWarning, type ConsentDay, type ConsentDecisionInput, type ConsentIngestInput, type ConsentLogRow, type CookieDeclaration, CookieMunchApiError, type CookieMunchClient, type CookieMunchOptions, type CookiePreset, type CookiePresetManifest, type CookiePresetParams, type CookiePresetResult, type CookiePresetVendor, type CspSources, type DeclarationDiff, type DeclarationDryRun, type DeclarationWarning, type DeclaredCookie, type DeclaredCookieInput, type DnsRecordInstruction, type DsarCreate, type DsarEraseResult, type DsarExecutor, type DsarExecutorCreated, type DsarExecutorDryRun, type DsarExecutorInput, type DsarExecutorPatch, type DsarExecutorPresetInput, type DsarExportResult, type DsarRequest, type DsarStatus, type DsarTask, type DsarTaskEvent, type DsarTaskExport, type DsarTaskLogEntry, type DsarTaskOutcome, type DsarType, type EnforcementRuleInput, type ExecutorHealth, type ExecutorPresetName, type ExecutorPresetUpgrade, type ExecutorPresets, type ExecutorProfile, type ExecutorTestInput, type ExecutorTestResult, type ExecutorWebhookDelivery, type ExecutorWebhookTestResult, type FlowIssue, type FlowOp, type FlowOpResponse, type FulfillmentOp, type HealthRow, type Identifier, type Identity, type ImportedCookie, type ImportedDeclaration, type InstallSnippet, type IntegrationHealthReport, type LegalBasis, type LogQuery, type MailProvider, type MailProviderInput, type MailProviderKind, type MailProviderTestResult, type Member, type ObservedPurgeResult, type OptInMethod, type Org, type OrgUpdate, type ParityControlSummary, type PartnerCatalogEntry, type PartnerId, type PartnerLink, type PartnerLinkCreate, type PlanSource, type PolicyOptions, type PreferenceItem, type PreferenceRecord, type PreviewToken, type PreviewTokenOptions, type ProfileAttributeInput, type ProvisionRequest, type ProvisionResult, type ProvisionStep, type PublicDsarFiled, type PublicDsarPending, type PublicVerification, type PutConfigOptions, type RangeQuery, type Regulation, type RegulationSummary, type RegulatoryFeedResult, type ResellerChild, type ResellerChildCreate, type ResellerChildList, type ResellerChildPatch, type RetiredCookie, type RightKind, type RightsCaptcha, type RightsCaptchaInput, type RightsCaptchaProvider, type RightsIdentity, type RightsIdentityInput, type RightsIdentityType, type RightsLink, type RightsLinkInput, type RightsPageDocument, type RightsPageDomain, type RightsPageDomainList, type RightsPageDraft, type RightsPageDraftConflict, type RightsPageDryRun, type RightsPageIssue, type RightsPagePublishResult, type RightsPagePublished, type RightsPagePublisher, type RightsPageVersions, type RightsPageWriteOptions, type RiskScore, type RopaEntry, type RopaInput, type ScanResult, type ScanStatus, type ScoredVendor, type ScrollbarTheme, type SessionAnalysisInput, type SignedReceipt, type Site, type SiteConfig, type SiteCookie, type SiteCreate, type SiteFlow, type SiteUpdate, type SiteUpdateResult, type SnippetOptions, type StorageType, type SubscriptionTopicInput, type SuggestedRejectStyle, type SupportedLanguage, type Usage, type VendorInput, type VendorRecord, type VerifyResult, type VerifyWebhookInput, type WebhookCreate, type WebhookDeadLetter, type WebhookKeyForm, type WebhookStage, type WebhookSubscription, type WebhookTestResult, type WebhookUpdate, createCookieMunch, verifyWebhookSignature };
|
|
2925
|
+
export { type AbResult, type AccountOrg, type AccountOrgs, type AdPersonalizationInput, type AiInspectInput, type AiInspectResult, type ApiKey, type ApiKeyIssueInput, type ApiKeyIssued, type ApiKeyPrefix, type ApiKeyReport, type ApiKeyUpdate, type AppliedImport, type AssetUpload, type AuditEntry, type BannerRecord, type BannerSummary, type BlockedReport, type BrandExtractionResult, type BrandKit, type BrandKitCreate, type BrandSuggestion, type BulkSiteInput, type BulkSiteResult, type ButtonParityFinding, type ButtonParityLint, type ButtonParityScan, type CategorizedCookie, type ChildKeyInput, type ConfigChange, type ConfigDryRun, type ConfigWarning, type ConsentDay, type ConsentDecisionInput, type ConsentIngestInput, type ConsentLogRow, type CookieDeclaration, CookieMunchApiError, type CookieMunchClient, type CookieMunchOptions, type CookiePreset, type CookiePresetManifest, type CookiePresetParams, type CookiePresetResult, type CookiePresetVendor, type CspSources, type DeclarationDiff, type DeclarationDryRun, type DeclarationWarning, type DeclaredCookie, type DeclaredCookieInput, type DnsRecordInstruction, type DsarCreate, type DsarEraseResult, type DsarExecutor, type DsarExecutorCreated, type DsarExecutorDryRun, type DsarExecutorInput, type DsarExecutorPatch, type DsarExecutorPresetInput, type DsarExportResult, type DsarRequest, type DsarStatus, type DsarTask, type DsarTaskEvent, type DsarTaskExport, type DsarTaskLogEntry, type DsarTaskOutcome, type DsarType, type EnforcementRuleInput, type ExecutorHealth, type ExecutorPresetName, type ExecutorPresetUpgrade, type ExecutorPresets, type ExecutorProfile, type ExecutorTestInput, type ExecutorTestResult, type ExecutorWebhookDelivery, type ExecutorWebhookTestResult, type FlowIssue, type FlowOp, type FlowOpResponse, type FulfillmentOp, type HealthRow, type Identifier, type Identity, type ImportedCookie, type ImportedDeclaration, type InstallSnippet, type IntegrationHealthReport, type LegalBasis, type LogQuery, type MailProvider, type MailProviderInput, type MailProviderKind, type MailProviderTestResult, type Member, type ObservedPurgeResult, type OptInMethod, type Org, type OrgUpdate, type ParityControlSummary, type PartnerCatalogEntry, type PartnerId, type PartnerLink, type PartnerLinkCreate, type PlanSource, type PolicyOptions, type PreferenceItem, type PreferenceRecord, type PreviewToken, type PreviewTokenOptions, type ProfileAttributeInput, type ProvisionRequest, type ProvisionResult, type ProvisionStep, type PublicDsarFiled, type PublicDsarPending, type PublicVerification, type PutConfigOptions, type RangeQuery, type Regulation, type RegulationSummary, type RegulatoryFeedResult, type ResellerChild, type ResellerChildCreate, type ResellerChildList, type ResellerChildPatch, type RetiredCookie, type RightKind, type RightsCaptcha, type RightsCaptchaInput, type RightsCaptchaProvider, type RightsIdentity, type RightsIdentityInput, type RightsIdentityType, type RightsLink, type RightsLinkInput, type RightsPageDocument, type RightsPageDomain, type RightsPageDomainList, type RightsPageDraft, type RightsPageDraftConflict, type RightsPageDryRun, type RightsPageIssue, type RightsPagePublishResult, type RightsPagePublished, type RightsPagePublisher, type RightsPageVersions, type RightsPageWriteOptions, type RiskScore, type RopaEntry, type RopaInput, SDK_VERSION, type ScanResult, type ScanStatus, type ScoredVendor, type ScrollbarTheme, type SessionAnalysisInput, type SignedReceipt, type Site, type SiteConfig, type SiteCookie, type SiteCreate, type SiteFlow, type SiteUpdate, type SiteUpdateResult, type SnippetOptions, type StorageType, type SubscriptionTopicInput, type SuggestedRejectStyle, type SupportedLanguage, type Usage, type VendorInput, type VendorRecord, type VerifyResult, type VerifyWebhookInput, type WebhookCreate, type WebhookDeadLetter, type WebhookKeyForm, type WebhookStage, type WebhookSubscription, type WebhookTestResult, type WebhookUpdate, createCookieMunch, verifyWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ function verifyWebhookSignature(input) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/index.ts
|
|
30
|
+
var SDK_VERSION = "0.4.1";
|
|
30
31
|
var CookieMunchApiError = class extends Error {
|
|
31
32
|
constructor(status, message, code, body) {
|
|
32
33
|
super(message);
|
|
@@ -53,7 +54,7 @@ function createCookieMunch(opts) {
|
|
|
53
54
|
const doFetch = opts.fetch ?? globalThis.fetch;
|
|
54
55
|
if (!doFetch) throw new Error("No fetch available; pass { fetch } in CookieMunchOptions.");
|
|
55
56
|
async function request(method, path, body, raw = false) {
|
|
56
|
-
const headers = { Authorization: `Bearer ${opts.apiKey}` };
|
|
57
|
+
const headers = { Authorization: `Bearer ${opts.apiKey}`, "User-Agent": opts.userAgent ?? `cookiemunch-js/${SDK_VERSION}` };
|
|
57
58
|
if (opts.strictUnknownFields && method !== "GET") headers["Prefer"] = "strict-unknown-fields";
|
|
58
59
|
const init = { method, headers };
|
|
59
60
|
if (body !== void 0) {
|
|
@@ -436,6 +437,7 @@ function createCookieMunch(opts) {
|
|
|
436
437
|
export {
|
|
437
438
|
CONSENT_COOKIE_NAME,
|
|
438
439
|
CookieMunchApiError,
|
|
440
|
+
SDK_VERSION,
|
|
439
441
|
createCookieMunch,
|
|
440
442
|
getConsent,
|
|
441
443
|
isAllowed,
|