feeef 0.9.4 → 0.9.7

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.
@@ -220,4 +220,22 @@ export interface CalculateOrderPricingOptions {
220
220
  shippingType?: ShippingType;
221
221
  shippingAddress?: string;
222
222
  }
223
+ /**
224
+ * Check if an order ID indicates a fake/honeypot order
225
+ * Fake orders use the "FuHe3nf" prefix
226
+ */
227
+ export declare function isFakeOrderId(orderId: string | undefined | null): boolean;
228
+ /**
229
+ * Check if an order is a fake order (by ID or metadata flag)
230
+ */
231
+ export declare function isFakeOrder(order: OrderEntity): boolean;
232
+ /**
233
+ * Check if an order has warning treatment (created but flagged)
234
+ */
235
+ export declare function isWarningOrder(order: OrderEntity): boolean;
236
+ /**
237
+ * Check if pixel events should be suppressed for this order
238
+ * Suppress for: fake orders, warning treatment, fake treatment
239
+ */
240
+ export declare function shouldSuppressPixelEvents(order: OrderEntity): boolean;
223
241
  export {};
@@ -80,7 +80,8 @@ export declare const generatePublicStoreIntegrationOrderdz: (orderdz: OrderdzInt
80
80
  export declare const generatePublicStoreIntegrationWebhooks: (webhooks: WebhooksIntegration | null | undefined) => PublicWebhooksIntegration | null | undefined;
81
81
  /**
82
82
  * Generates public security integration data from private integration data.
83
- * Only exposes non-sensitive information, keeping backend protection details private for security.
83
+ * Exposes storefront-safe rules: frontend, doubleSend, minTimeInPage, countries, sources.
84
+ * Fingerprint, ip, phone, and ads stay server-only.
84
85
  */
85
86
  export declare const generatePublicStoreIntegrationSecurity: (security: SecurityIntegration | null | undefined) => PublicSecurityIntegration | null | undefined;
86
87
  /**
@@ -339,6 +340,27 @@ export declare enum PixelReportMode {
339
340
  client = "client",
340
341
  both = "both"
341
342
  }
343
+ /** Which order field to compare for [PixelStatusRule] (server-side CAPI on transition). */
344
+ export declare enum PixelStatusDimension {
345
+ orderStatus = "orderStatus",
346
+ deliveryStatus = "deliveryStatus",
347
+ paymentStatus = "paymentStatus",
348
+ customStatus = "customStatus"
349
+ }
350
+ /**
351
+ * When the order transitions so `dimension` becomes `equals`, send configured Meta/TikTok server events.
352
+ * `id` must be stable (UUID) — used for idempotency in `order.claims.pixelStatusEvents`.
353
+ */
354
+ export interface PixelStatusRule {
355
+ id: string;
356
+ dimension: PixelStatusDimension;
357
+ equals: string;
358
+ metaEvent?: MetaPixelEvent | null;
359
+ tiktokEvent?: TiktokPixelEvent | null;
360
+ /** When set, overrides `metaEvent` (Meta CAPI custom event name). */
361
+ metaCustomEvent?: string | null;
362
+ tiktokCustomEvent?: string | null;
363
+ }
342
364
  export interface MetaPixel {
343
365
  name?: string;
344
366
  id: string;
@@ -365,6 +387,8 @@ export interface MetaPixelIntegration {
365
387
  pixels: MetaPixel[];
366
388
  objective?: MetaPixelEvent | null;
367
389
  draftObjective?: MetaPixelEvent | null;
390
+ /** Server-only lifecycle rules; never exposed on public storefront JSON. */
391
+ statusRules?: PixelStatusRule[];
368
392
  active: boolean;
369
393
  metadata: Record<string, any>;
370
394
  /** Facebook Marketing OAuth data - for accessing pixels via API */
@@ -377,6 +401,8 @@ export interface TiktokPixelIntegration {
377
401
  pixels: TiktokPixel[];
378
402
  objective?: TiktokPixelEvent | null;
379
403
  draftObjective?: TiktokPixelEvent | null;
404
+ /** Server-only lifecycle rules; never exposed on public storefront JSON. */
405
+ statusRules?: PixelStatusRule[];
380
406
  active: boolean;
381
407
  metadata: Record<string, any>;
382
408
  /** Where to send events: server, client, or both. Omit for auto (prefer server if accessToken set). */
@@ -497,40 +523,70 @@ export interface ZrexpressIntegration {
497
523
  /** Additional metadata for the integration */
498
524
  metadata?: Record<string, any>;
499
525
  }
500
- export interface SecurityIntegrationOrdersProtection {
501
- frontend: {
502
- active: boolean;
503
- };
504
- backend: {
505
- active: boolean;
506
- phoneTtl: number;
507
- ipTtl: number;
508
- blockDirectOrders: boolean;
509
- adsOnlyMode: boolean;
510
- fingerprintTtl?: number | null;
511
- minFormLoadTime?: number | null;
512
- requireFingerprint?: boolean | null;
513
- };
526
+ export declare enum SecurityTreatment {
527
+ block = "block",
528
+ warning = "warning",
529
+ fake = "fake"
514
530
  }
515
- export interface PublicSecurityIntegrationOrdersProtection {
516
- frontend: {
517
- active: boolean;
518
- };
531
+ export interface SecurityOption {
532
+ active: boolean;
533
+ ttl?: number | null;
534
+ treatment: SecurityTreatment;
535
+ }
536
+ export interface SecurityMinTimeOption {
537
+ active: boolean;
538
+ duration: number;
539
+ treatment: SecurityTreatment;
540
+ }
541
+ export interface SecurityCountriesOption {
542
+ active: boolean;
543
+ treatment: SecurityTreatment;
544
+ allowed: string[] | null;
545
+ blocked: string[];
546
+ }
547
+ export interface SecuritySourcesOption {
548
+ active: boolean;
549
+ treatment: SecurityTreatment;
550
+ allowed: string[] | null;
551
+ blocked: string[];
552
+ }
553
+ /** Storefront-safe min-time rule (same shape as private; no secrets). */
554
+ export type PublicSecurityMinTimeOption = SecurityMinTimeOption;
555
+ /** Storefront-safe country allow/block lists (policy only). */
556
+ export type PublicSecurityCountriesOption = SecurityCountriesOption;
557
+ /** Storefront-safe traffic-source allow/block lists (policy only). */
558
+ export type PublicSecuritySourcesOption = SecuritySourcesOption;
559
+ export interface SecurityOptions {
560
+ fingerprint?: SecurityOption | null;
561
+ ip?: SecurityOption | null;
562
+ phone?: SecurityOption | null;
563
+ ads?: SecurityOption | null;
564
+ frontend?: SecurityOption | null;
565
+ doubleSend?: SecurityOption | null;
566
+ minTimeInPage?: SecurityMinTimeOption | null;
567
+ countries?: SecurityCountriesOption | null;
568
+ sources?: SecuritySourcesOption | null;
519
569
  }
520
570
  export interface SecurityIntegration {
521
- orders?: SecurityIntegrationOrdersProtection;
522
- /** Whether this integration is currently active */
523
571
  active: boolean;
524
- /** Additional metadata for the integration */
572
+ options?: SecurityOptions | null;
525
573
  metadata?: Record<string, any>;
526
574
  }
575
+ export interface PublicSecurityOption {
576
+ active: boolean;
577
+ ttl: number;
578
+ treatment: SecurityTreatment;
579
+ }
580
+ export interface PublicSecurityOptions {
581
+ frontend?: PublicSecurityOption;
582
+ doubleSend?: PublicSecurityOption;
583
+ minTimeInPage?: PublicSecurityMinTimeOption;
584
+ countries?: PublicSecurityCountriesOption;
585
+ sources?: PublicSecuritySourcesOption;
586
+ }
527
587
  export interface PublicSecurityIntegration {
528
- key?: string | null;
529
- orders?: PublicSecurityIntegrationOrdersProtection;
530
- /** Whether this integration is currently active */
531
588
  active: boolean;
532
- /** Additional metadata for the integration */
533
- metadata?: Record<string, any>;
589
+ options: PublicSecurityOptions;
534
590
  }
535
591
  /**
536
592
  * Webhook event types for order lifecycle
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "feeef",
3
3
  "description": "feeef sdk for javascript",
4
- "version": "0.9.4",
4
+ "version": "0.9.7",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
7
7
  "files": [