feeef 0.12.9 → 0.12.11

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.
@@ -69,6 +69,14 @@ export interface OrderEntity {
69
69
  * JSON / API field name is always **`references`** (never `orderReferences`).
70
70
  */
71
71
  references?: string[];
72
+ /**
73
+ * Optional schedule date. When set, list sort and day/range filters use
74
+ * `effectiveAt` (= COALESCE(scheduledAt, createdAt)) so the order appears
75
+ * as if created on this date. Null clears the schedule.
76
+ */
77
+ scheduledAt?: string | null;
78
+ /** Server-computed COALESCE(scheduledAt, createdAt). Read-only. */
79
+ effectiveAt?: string;
72
80
  createdAt: any;
73
81
  updatedAt: any;
74
82
  }
@@ -154,6 +162,8 @@ export interface OrderCreateInput {
154
162
  storeId: string;
155
163
  tags?: string[];
156
164
  references?: string[];
165
+ /** Optional schedule date (ISO). Null clears. */
166
+ scheduledAt?: string | null;
157
167
  }
158
168
  /**
159
169
  * Input for order items when creating/updating an order
@@ -200,10 +210,9 @@ export interface OrderUpdateInput {
200
210
  metadata?: Record<string, any>;
201
211
  tags?: string[];
202
212
  references?: string[];
213
+ /** Optional schedule date (ISO). Null clears. */
214
+ scheduledAt?: string | null;
203
215
  }
204
- /**
205
- * Order pricing calculation result
206
- */
207
216
  export interface OrderPricing {
208
217
  subtotal: number;
209
218
  shippingPrice: number | null;
@@ -48,7 +48,19 @@ export interface StoreEntity {
48
48
  /** Linked inventory project ID for stock management. */
49
49
  projectId?: string | null;
50
50
  }
51
- export declare const generatePublicStoreIntegrations: (integrations: StoreIntegrations | null | undefined) => PublicStoreIntegrations | null;
51
+ export declare const generatePublicStoreIntegrations: (integrations: StoreIntegrations | null | undefined,
52
+ /**
53
+ * Optional store configs — used to expose inventory storefront flags
54
+ * (`show_unavailable_on_frontend`) on {@link PublicInventoryIntegration}.
55
+ */
56
+ configs?: Pick<StoreConfigs, "inventory_integration"> | StoreConfigs | null) => PublicStoreIntegrations | null;
57
+ /**
58
+ * Public inventory module (no project credentials).
59
+ * Storefront OOS UI runs only when `active` and `showUnavailableOnFrontend`.
60
+ */
61
+ export declare const generatePublicStoreIntegrationInventory: (inventory: StoreInventoryIntegration | null | undefined, options?: {
62
+ showUnavailableOnFrontend?: boolean;
63
+ }) => PublicInventoryIntegration | null | undefined;
52
64
  /** Strips connector auth secrets from public store JSON. */
53
65
  export declare const generatePublicStoreIntegrationConnectors: (connectors: ConnectorsIntegration | null | undefined) => PublicConnectorsIntegration | null | undefined;
54
66
  export declare const generatePublicStoreIntegrationCustomFields: (customFields: any | null | undefined) => PublicCustomFieldsIntegration | null | undefined;
@@ -191,6 +203,21 @@ export interface PublicPaymentIntegration {
191
203
  methods: PublicPaymentMethod[];
192
204
  defaultMethod?: string;
193
205
  }
206
+ /**
207
+ * Public inventory module — no project / warehouse secrets.
208
+ * Combined with effective-active (entitlement) on store serialization.
209
+ *
210
+ * Storefront must only fetch/apply OOS when `active && showUnavailableOnFrontend`.
211
+ */
212
+ export interface PublicInventoryIntegration {
213
+ active: boolean;
214
+ /**
215
+ * When true, storefront shows unavailable variants (live qty / legacy stock).
216
+ * Opt-in via `configs.inventory_integration.show_unavailable_on_frontend`.
217
+ * @default false
218
+ */
219
+ showUnavailableOnFrontend: boolean;
220
+ }
194
221
  export interface PublicStoreIntegrations {
195
222
  metaPixel: PublicMetaPixelIntegration | null;
196
223
  tiktokPixel: PublicTiktokPixelIntegration | null;
@@ -206,6 +233,11 @@ export interface PublicStoreIntegrations {
206
233
  customFields: PublicCustomFieldsIntegration | null;
207
234
  payment: PublicPaymentIntegration | null;
208
235
  connectors: PublicConnectorsIntegration | null;
236
+ /**
237
+ * Inventory module. Storefront OOS checks require `active` and
238
+ * `showUnavailableOnFrontend` (merchant opt-in).
239
+ */
240
+ inventory: PublicInventoryIntegration | null;
209
241
  }
210
242
  export declare enum StoreMemberRole {
211
243
  editor = "editor",
@@ -278,6 +310,12 @@ export interface InventoryIntegration {
278
310
  * @default true
279
311
  */
280
312
  allow_backorder?: boolean;
313
+ /**
314
+ * When true (and inventory public integration is active), the storefront
315
+ * fetches live availability and marks out-of-stock variants.
316
+ * @default false
317
+ */
318
+ show_unavailable_on_frontend?: boolean;
281
319
  }
282
320
  export type FinancePdfPaperSize = 'a4' | 'letter' | 'a5' | 'legal';
283
321
  /** Layout and content options for finance PDF documents. */
@@ -312,6 +350,7 @@ export interface StoreConfigs {
312
350
  customStatusMappings?: CustomStatusMapping[];
313
351
  /** Feature flag to enable custom statuses across the app */
314
352
  customStatusEnabled?: boolean;
353
+ confirmationQueue?: ConfirmationQueueConfig;
315
354
  inventory_integration?: InventoryIntegration;
316
355
  finance_integration?: FinanceIntegration;
317
356
  }
@@ -332,6 +371,42 @@ export interface CustomStatusMapping {
332
371
  paymentStatus?: PaymentStatus | null;
333
372
  /** Codes (or names) of other mappings suggested as the next workflow step */
334
373
  next?: string[];
374
+ /**
375
+ * Minutes to postpone the order when this status is set. The order's
376
+ * `scheduledAt` becomes `now + snoozeMinutes`, so it leaves the confirmation
377
+ * queue and re-enters it once the delay elapses (e.g. "not_respond_1" -> 180).
378
+ */
379
+ snoozeMinutes?: number | null;
380
+ /** Plain-text reason presets offered to the confirmer when this status is set. */
381
+ reasons?: string[];
382
+ /** Whether the confirmer may type a reason that is not in `reasons`. */
383
+ allowOtherReason?: boolean;
384
+ /**
385
+ * Whether a reason is mandatory. Always treated as `true` when `status` is
386
+ * `cancelled`, regardless of the stored value.
387
+ */
388
+ requiresReason?: boolean;
389
+ /** Whether orders carrying this status may be served by the confirmation queue. */
390
+ queueEligible?: boolean;
391
+ }
392
+ /** Store-level confirmation queue settings. */
393
+ export interface ConfirmationQueueConfig {
394
+ enabled?: boolean;
395
+ /**
396
+ * How long a `draft` order must age before it becomes eligible for
397
+ * confirmation. Gives the customer time to finish submitting.
398
+ */
399
+ draftDelayMinutes?: number;
400
+ /**
401
+ * After a confirmer skips, how long before the order is due again
402
+ * (`scheduled_at` soft-snooze). Default 15.
403
+ */
404
+ skipDeferMinutes?: number;
405
+ /**
406
+ * How long after `updated_at` a recent history order stays correctable
407
+ * in the confirmation feed. Default 5.
408
+ */
409
+ historyActionMinutes?: number;
335
410
  }
336
411
  export interface StoreCurrencyConfig {
337
412
  code: string;
@@ -580,6 +655,30 @@ export interface ZrexpressIntegration {
580
655
  /** Additional metadata for the integration */
581
656
  metadata?: Record<string, any>;
582
657
  }
658
+ /**
659
+ * Codpilot mini-ERP — push Feeef orders for confirmation / COD ops.
660
+ *
661
+ * Auth: subdomain + apiId + Bearer apiToken.
662
+ * Docs: https://codpilot.gitbook.io/codpilot-api
663
+ * Sync state: `order.metadata.codpilot` (not a delivery carrier).
664
+ */
665
+ export interface CodpilotIntegration {
666
+ /** Business subdomain (`mystore` → mystore.codpilot.net) */
667
+ subdomain: string;
668
+ apiId: string;
669
+ apiToken: string;
670
+ active: boolean;
671
+ /**
672
+ * Auto-send when a status dimension transitions into `equals`.
673
+ * Default (client-seeded): `[{ id: 'default-pending', dimension: 'orderStatus', equals: 'pending' }]`.
674
+ */
675
+ statusRules?: Array<{
676
+ id: string;
677
+ dimension: 'orderStatus' | 'deliveryStatus' | 'paymentStatus' | 'customStatus';
678
+ equals: string;
679
+ }>;
680
+ metadata?: Record<string, any>;
681
+ }
583
682
  /**
584
683
  * MDM Express (api.mdm.express) — `x-api-key` and/or Bearer JWT, MDM store `trackingId` (`mdmStoreId` on orders),
585
684
  * and MDM seller id (`mdmSellerId`) for service-fees.
@@ -598,6 +697,29 @@ export interface MdmExpressIntegration {
598
697
  webhookSecret?: string | null;
599
698
  metadata?: Record<string, any>;
600
699
  }
700
+ /**
701
+ * Feeef Delivery (Near Delivery white-label). Merchants never hold Near API keys —
702
+ * enable via `POST .../integrations/feeefDelivery/enable`.
703
+ */
704
+ export interface FeeefDeliveryIntegration {
705
+ id: string;
706
+ active: boolean;
707
+ autoSend?: boolean;
708
+ /** Near sender user id — required when active. */
709
+ nearSenderUserId: number;
710
+ nearSenderUsername?: string | null;
711
+ nearSenderEmail?: string | null;
712
+ nearAccountType?: 'platform' | 'api' | 'both' | null;
713
+ /** 0 = address pickup, 1 = center pickup. */
714
+ pickupLocationType?: 0 | 1 | null;
715
+ pickupAddress?: string | null;
716
+ senderCenterId?: number | null;
717
+ defaultBuralistId?: number | null;
718
+ /** Prefer Feeef-branded PDF labels (default true). */
719
+ useFeeefLabel?: boolean | null;
720
+ webhookSecret?: string | null;
721
+ metadata?: Record<string, any>;
722
+ }
601
723
  export declare enum SecurityTreatment {
602
724
  block = "block",
603
725
  warning = "warning",
@@ -852,6 +974,9 @@ export interface StoreIntegrations {
852
974
  zimou?: ZimouIntegration;
853
975
  zrexpress?: ZrexpressIntegration;
854
976
  mdmExpress?: MdmExpressIntegration;
977
+ /** Feeef Delivery (Near white-label) — no merchant API keys. */
978
+ feeefDelivery?: FeeefDeliveryIntegration;
979
+ codpilot?: CodpilotIntegration;
855
980
  security?: SecurityIntegration;
856
981
  dispatcher?: DispatcherIntegration;
857
982
  inventory?: StoreInventoryIntegration;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "feeef",
3
3
  "description": "feeef sdk for javascript",
4
- "version": "0.12.9",
4
+ "version": "0.12.11",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
7
7
  "files": [
@@ -18,7 +18,7 @@
18
18
  "clean": "del-cli build",
19
19
  "typecheck": "tsc --noEmit",
20
20
  "precompile": "npm run lint && npm run clean",
21
- "compile": "tsup-node && tsc --emitDeclarationOnly --declaration",
21
+ "compile": "tsup-node && tsc --emitDeclarationOnly --declaration -p tsconfig.build.json",
22
22
  "build": "npm run compile",
23
23
  "release": "npx release-it",
24
24
  "publish:npm": "bash ./scripts/publish.sh",
@@ -1,7 +0,0 @@
1
- import '@japa/assert';
2
- declare module '@japa/assert' {
3
- interface Assert {
4
- validationErrors(promiseLike: Promise<any>, messages: any): Promise<void>;
5
- validationOutput(promiseLike: Promise<any>, output: any): Promise<void>;
6
- }
7
- }
@@ -1 +0,0 @@
1
- export {};