feeef 0.9.5 → 0.10.0

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.
@@ -9,6 +9,7 @@
9
9
  * Canonical `aiModels.billing` keys — keep in sync: backend `configs_controller.ts`,
10
10
  * feeef `lib/core/app_config.dart`, admins_dashboard `src/lib/hooks/useOptions.ts`.
11
11
  */
12
+ import { ModelsCatalogConfig } from '../core/models_catalog.js';
12
13
  /** Fallback DZD per USD when `aiModels.exchangeRate` is missing (mirror backend). */
13
14
  export declare const FALLBACK_AI_EXCHANGE_RATE = 260;
14
15
  export interface RetailMarkupBilling {
@@ -141,6 +142,8 @@ export interface AiCalculatorConfig {
141
142
  referenceImageCost?: number;
142
143
  resolutionCosts?: Record<string, number>;
143
144
  models?: AiModelConfig[];
145
+ /** Optional model catalog (`models` option): allows pricing.prompt/completion to price text models without aiModels rows. */
146
+ modelsCatalog?: ModelsCatalogConfig;
144
147
  /** Optional `aiModels.billing` overrides (merged over [mergeAiModelsBilling] defaults). */
145
148
  billing?: AIModelsBilling | null;
146
149
  }
@@ -340,6 +340,27 @@ export declare enum PixelReportMode {
340
340
  client = "client",
341
341
  both = "both"
342
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
+ }
343
364
  export interface MetaPixel {
344
365
  name?: string;
345
366
  id: string;
@@ -366,6 +387,8 @@ export interface MetaPixelIntegration {
366
387
  pixels: MetaPixel[];
367
388
  objective?: MetaPixelEvent | null;
368
389
  draftObjective?: MetaPixelEvent | null;
390
+ /** Server-only lifecycle rules; never exposed on public storefront JSON. */
391
+ statusRules?: PixelStatusRule[];
369
392
  active: boolean;
370
393
  metadata: Record<string, any>;
371
394
  /** Facebook Marketing OAuth data - for accessing pixels via API */
@@ -378,6 +401,8 @@ export interface TiktokPixelIntegration {
378
401
  pixels: TiktokPixel[];
379
402
  objective?: TiktokPixelEvent | null;
380
403
  draftObjective?: TiktokPixelEvent | null;
404
+ /** Server-only lifecycle rules; never exposed on public storefront JSON. */
405
+ statusRules?: PixelStatusRule[];
381
406
  active: boolean;
382
407
  metadata: Record<string, any>;
383
408
  /** Where to send events: server, client, or both. Omit for auto (prefer server if accessToken set). */
@@ -498,6 +523,24 @@ export interface ZrexpressIntegration {
498
523
  /** Additional metadata for the integration */
499
524
  metadata?: Record<string, any>;
500
525
  }
526
+ /**
527
+ * MDM Express (api.mdm.express) — `x-api-key` and/or Bearer JWT, MDM store `trackingId` (`mdmStoreId` on orders),
528
+ * and MDM seller id (`mdmSellerId`) for service-fees.
529
+ */
530
+ export interface MdmExpressIntegration {
531
+ id: string;
532
+ apiKey?: string;
533
+ bearerToken?: string;
534
+ /** Store tracking id (e.g. STR-…) — `storeId` on `POST /api/v2/orders`. */
535
+ mdmStoreId: string;
536
+ /** Seller id (e.g. SLR-…) — `GET /api/sellers/{id}/service-fees`. */
537
+ mdmSellerId?: string;
538
+ active: boolean;
539
+ silentMode?: boolean;
540
+ autoSend?: boolean;
541
+ webhookSecret?: string | null;
542
+ metadata?: Record<string, any>;
543
+ }
501
544
  export declare enum SecurityTreatment {
502
545
  block = "block",
503
546
  warning = "warning",
@@ -688,6 +731,7 @@ export interface StoreIntegrations {
688
731
  noest?: any;
689
732
  zimou?: ZimouIntegration;
690
733
  zrexpress?: ZrexpressIntegration;
734
+ mdmExpress?: MdmExpressIntegration;
691
735
  security?: SecurityIntegration;
692
736
  dispatcher?: DispatcherIntegration;
693
737
  }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Multi-provider model catalog (options key `models`).
3
+ * Re-uses OpenRouter **Models API** types (`Model`, `ModelsListResponse`) for parity with
4
+ * `curl https://openrouter.ai/api/v1/models` and `@openrouter/sdk`.
5
+ *
6
+ * @see https://openrouter.ai/docs/guides/overview/models
7
+ * @see https://openrouter.ai/docs/api-reference/models/get-models
8
+ */
9
+ export type { DefaultParameters, InputModality, Model, ModelArchitecture, ModelLinks, ModelsListResponse, OutputModality, Parameter, PerRequestLimits, PublicPricing, TopProviderInfo, } from '@openrouter/sdk/models';
10
+ /** Feeef routing — not part of OpenRouter's schema. */
11
+ export type AiProviderKind = 'google' | 'openai' | 'azure' | 'openrouter';
12
+ export interface ProviderRegistryRow {
13
+ slug: string;
14
+ kind: AiProviderKind;
15
+ baseUrl: string;
16
+ displayName?: string;
17
+ name?: string;
18
+ }
19
+ /**
20
+ * Feeef catalog extensions (not from OpenRouter Models API).
21
+ * Optional `capabilities.image_generation` drives aspect/output tiers and pricing add-ons.
22
+ */
23
+ export interface ImageGenerationCapabilitiesWire {
24
+ allowed_aspect_ratios?: string[];
25
+ output_size_tiers?: string[];
26
+ input_resolution_tiers?: string[];
27
+ params?: {
28
+ background?: string[];
29
+ quality?: string[];
30
+ output_format?: string[];
31
+ };
32
+ toggles?: {
33
+ google_search?: boolean;
34
+ image_search?: boolean;
35
+ };
36
+ pricing_addons_dzd?: {
37
+ transparent_background?: number;
38
+ };
39
+ }
40
+ export interface FeeefModelCapabilities {
41
+ image_generation?: ImageGenerationCapabilitiesWire;
42
+ }
43
+ /** `GET /v1/models` row + `provider_slug` for Feeef's registry lookup. */
44
+ export type ModelCatalogRow = import('@openrouter/sdk/models').Model & {
45
+ provider_slug: string;
46
+ capabilities?: FeeefModelCapabilities;
47
+ /** Azure OpenAI deployment name when it differs from catalog `id`. */
48
+ azure_deployment?: string;
49
+ };
50
+ export interface ModelsCatalogConfig {
51
+ providers: ProviderRegistryRow[];
52
+ data: ModelCatalogRow[];
53
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './feeef/feeef.js';
2
+ export * from './core/models_catalog.js';
2
3
  export * from './delivery/parcel.js';
3
4
  export * from './delivery/delivery_carrier_client.js';
4
5
  export * from './core/entities/order.js';
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.5",
4
+ "version": "0.10.0",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
7
7
  "files": [
@@ -38,6 +38,7 @@
38
38
  "@japa/snapshot": "^2.0.5",
39
39
  "@swc/core": "^1.5.3",
40
40
  "@types/dlv": "^1.1.4",
41
+ "@types/luxon": "^3.4.2",
41
42
  "@types/node": "^20.12.10",
42
43
  "ajv": "^8.13.0",
43
44
  "benchmark": "^2.1.4",
@@ -51,11 +52,11 @@
51
52
  "release-it": "^17.2.1",
52
53
  "ts-node": "^10.9.2",
53
54
  "tsup": "^8.0.2",
54
- "typescript": "^5.4.5",
55
- "@types/luxon": "^3.4.2"
55
+ "typescript": "^5.4.5"
56
56
  },
57
57
  "dependencies": {
58
58
  "@adonisjs/transmit-client": "^1.0.0",
59
+ "@openrouter/sdk": "^0.12.26",
59
60
  "axios": "^1.6.8",
60
61
  "axios-cache-interceptor": "^1.5.1",
61
62
  "luxon": "^3.5.0"