feeef 0.9.3 → 0.9.5

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
  /**
@@ -497,40 +498,70 @@ export interface ZrexpressIntegration {
497
498
  /** Additional metadata for the integration */
498
499
  metadata?: Record<string, any>;
499
500
  }
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
- };
501
+ export declare enum SecurityTreatment {
502
+ block = "block",
503
+ warning = "warning",
504
+ fake = "fake"
514
505
  }
515
- export interface PublicSecurityIntegrationOrdersProtection {
516
- frontend: {
517
- active: boolean;
518
- };
506
+ export interface SecurityOption {
507
+ active: boolean;
508
+ ttl?: number | null;
509
+ treatment: SecurityTreatment;
510
+ }
511
+ export interface SecurityMinTimeOption {
512
+ active: boolean;
513
+ duration: number;
514
+ treatment: SecurityTreatment;
515
+ }
516
+ export interface SecurityCountriesOption {
517
+ active: boolean;
518
+ treatment: SecurityTreatment;
519
+ allowed: string[] | null;
520
+ blocked: string[];
521
+ }
522
+ export interface SecuritySourcesOption {
523
+ active: boolean;
524
+ treatment: SecurityTreatment;
525
+ allowed: string[] | null;
526
+ blocked: string[];
527
+ }
528
+ /** Storefront-safe min-time rule (same shape as private; no secrets). */
529
+ export type PublicSecurityMinTimeOption = SecurityMinTimeOption;
530
+ /** Storefront-safe country allow/block lists (policy only). */
531
+ export type PublicSecurityCountriesOption = SecurityCountriesOption;
532
+ /** Storefront-safe traffic-source allow/block lists (policy only). */
533
+ export type PublicSecuritySourcesOption = SecuritySourcesOption;
534
+ export interface SecurityOptions {
535
+ fingerprint?: SecurityOption | null;
536
+ ip?: SecurityOption | null;
537
+ phone?: SecurityOption | null;
538
+ ads?: SecurityOption | null;
539
+ frontend?: SecurityOption | null;
540
+ doubleSend?: SecurityOption | null;
541
+ minTimeInPage?: SecurityMinTimeOption | null;
542
+ countries?: SecurityCountriesOption | null;
543
+ sources?: SecuritySourcesOption | null;
519
544
  }
520
545
  export interface SecurityIntegration {
521
- orders?: SecurityIntegrationOrdersProtection;
522
- /** Whether this integration is currently active */
523
546
  active: boolean;
524
- /** Additional metadata for the integration */
547
+ options?: SecurityOptions | null;
525
548
  metadata?: Record<string, any>;
526
549
  }
550
+ export interface PublicSecurityOption {
551
+ active: boolean;
552
+ ttl: number;
553
+ treatment: SecurityTreatment;
554
+ }
555
+ export interface PublicSecurityOptions {
556
+ frontend?: PublicSecurityOption;
557
+ doubleSend?: PublicSecurityOption;
558
+ minTimeInPage?: PublicSecurityMinTimeOption;
559
+ countries?: PublicSecurityCountriesOption;
560
+ sources?: PublicSecuritySourcesOption;
561
+ }
527
562
  export interface PublicSecurityIntegration {
528
- key?: string | null;
529
- orders?: PublicSecurityIntegrationOrdersProtection;
530
- /** Whether this integration is currently active */
531
563
  active: boolean;
532
- /** Additional metadata for the integration */
533
- metadata?: Record<string, any>;
564
+ options: PublicSecurityOptions;
534
565
  }
535
566
  /**
536
567
  * Webhook event types for order lifecycle
@@ -151,6 +151,27 @@ export interface SigninWithSocialOptions {
151
151
  code: string;
152
152
  fcmToken?: string | null;
153
153
  }
154
+ /**
155
+ * Options for creating a short-lived, single-use Feeef auth code (QR / device login).
156
+ */
157
+ export interface CreateAuthCodeOptions {
158
+ /** Optional deep-link destination to return alongside the code. */
159
+ redirect?: string;
160
+ }
161
+ /**
162
+ * Response from creating an auth code.
163
+ */
164
+ export interface CreateAuthCodeResponse {
165
+ authCode: string;
166
+ expiresInSeconds: number;
167
+ redirect: string | null;
168
+ }
169
+ /**
170
+ * Options for signing in with a one-time Feeef auth code (OAuth-like semantics).
171
+ */
172
+ export interface SigninWithCodeOptions {
173
+ authCode: string;
174
+ }
154
175
  /**
155
176
  * Options for passkey registration start.
156
177
  */
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import { ModelRepository } from './repository.js';
3
- import { AccessToken, AuthToken, CreateUserOptions, FinishPasskeyAuthenticationOptions, FinishPasskeyRegistrationOptions, LinkSocialAccountOptions, Passkey, SigninCredentials, SigninWithSocialOptions, SignupCredentials, TransferMoneyOptions, TransferMoneyResponse, UpdateUserOptions, UserEntity, UserUpdate, StartPasskeyAuthenticationOptions, StartPasskeyRegistrationOptions } from '../../core/entities/user.js';
3
+ import { AccessToken, AuthToken, CreateUserOptions, FinishPasskeyAuthenticationOptions, FinishPasskeyRegistrationOptions, LinkSocialAccountOptions, Passkey, CreateAuthCodeOptions, CreateAuthCodeResponse, SigninCredentials, SigninWithCodeOptions, SigninWithSocialOptions, SignupCredentials, TransferMoneyOptions, TransferMoneyResponse, UpdateUserOptions, UserEntity, UserUpdate, StartPasskeyAuthenticationOptions, StartPasskeyRegistrationOptions } from '../../core/entities/user.js';
4
4
  /**
5
5
  * Represents the response returned by the authentication process.
6
6
  */
@@ -51,6 +51,18 @@ export declare class UserRepository extends ModelRepository<UserEntity, CreateUs
51
51
  * @returns A promise that resolves to the authentication response.
52
52
  */
53
53
  signinWithToken(token: string, fcmToken?: string | null): Promise<AuthResponse>;
54
+ /**
55
+ * Generates a short-lived, single-use Feeef auth code for cross-device / QR login.
56
+ *
57
+ * POST `/users/auth/code` (auth required).
58
+ */
59
+ createAuthCode(options?: CreateAuthCodeOptions): Promise<CreateAuthCodeResponse>;
60
+ /**
61
+ * Signs in using a one-time Feeef auth code (OAuth-like semantics).
62
+ *
63
+ * POST `/users/auth/code/consume` (public). On success it returns a bearer token and user.
64
+ */
65
+ signinWithCode(options: SigninWithCodeOptions): Promise<AuthResponse>;
54
66
  /**
55
67
  * Signs out the currently authenticated user.
56
68
  * Deletes the token on the server and clears local auth state.
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.3",
4
+ "version": "0.9.5",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
7
7
  "files": [