feeef 0.9.7 → 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
  }
@@ -523,6 +523,24 @@ export interface ZrexpressIntegration {
523
523
  /** Additional metadata for the integration */
524
524
  metadata?: Record<string, any>;
525
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
+ }
526
544
  export declare enum SecurityTreatment {
527
545
  block = "block",
528
546
  warning = "warning",
@@ -713,6 +731,7 @@ export interface StoreIntegrations {
713
731
  noest?: any;
714
732
  zimou?: ZimouIntegration;
715
733
  zrexpress?: ZrexpressIntegration;
734
+ mdmExpress?: MdmExpressIntegration;
716
735
  security?: SecurityIntegration;
717
736
  dispatcher?: DispatcherIntegration;
718
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.7",
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"