sinfactura-types 1.6.69 → 1.6.71

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.
package/dist/ai.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ declare global {
2
+ interface AiUsageReport {
3
+ from: string;
4
+ to: string;
5
+ totalUsd: number;
6
+ budget: {
7
+ globalDailyCeilingUsd: number;
8
+ tenantDailyCeilingUsd: number;
9
+ };
10
+ peakDailyUtilizationPct: number;
11
+ byFeature: Array<{
12
+ featureKey: string;
13
+ costUsd: number;
14
+ }>;
15
+ byModel: Array<{
16
+ model: string;
17
+ costUsd: number;
18
+ }>;
19
+ byTenant: Array<{
20
+ storeId: string;
21
+ costUsd: number;
22
+ }>;
23
+ byFeatureModel: Array<{
24
+ featureKey: string;
25
+ model: string;
26
+ costUsd: number;
27
+ }>;
28
+ byDay: Array<{
29
+ dated: string;
30
+ costUsd: number;
31
+ utilizationPct: number;
32
+ }>;
33
+ }
34
+ }
35
+ export {};
package/dist/ai.js ADDED
@@ -0,0 +1,2 @@
1
+ // AI platform-spend contracts (api#1788; MANAGER dashboard app#1044).
2
+ export {};
package/dist/auth.d.ts CHANGED
@@ -2,9 +2,19 @@ declare global {
2
2
  interface Login {
3
3
  email: string;
4
4
  password: string;
5
+ /** TOTP step-up code (6-32 chars) — required by the BE only when the
6
+ * account has 2FA enrolled; otherwise omit. */
7
+ totpCode?: string;
8
+ /** reCAPTCHA v3 token — required by the BE only after a
9
+ * `CAPTCHA_REQUIRED` login rejection (api#1505); otherwise omit. */
10
+ captchaToken?: string;
5
11
  }
6
12
  interface Social {
7
- accessToken?: string;
13
+ /** REQUIRED on the wire (the BE rejects an empty/missing token) —
14
+ * was wrongly optional before 1.6.70. */
15
+ accessToken: string;
16
+ /** TOTP step-up code (6-32 chars) — same semantics as `Login.totpCode`. */
17
+ totpCode?: string;
8
18
  }
9
19
  interface Register {
10
20
  email: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./account";
2
2
  export * from "./afip";
3
+ export * from "./ai";
3
4
  export * from "./api";
4
5
  export * from "./audit";
5
6
  export * from "./auth";
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./account";
2
2
  export * from "./afip";
3
+ export * from "./ai";
3
4
  export * from "./api";
4
5
  export * from "./audit";
5
6
  export * from "./auth";
@@ -17,6 +17,10 @@ declare global {
17
17
  expiresAt: number;
18
18
  connectedAt: number;
19
19
  }
20
+ interface MlOauthDisconnectResponse {
21
+ disconnected: true;
22
+ storeId: string;
23
+ }
20
24
  type MlOauthErrorCode = "OAUTH_USER_DENIED" | "OAUTH_STATE_MISMATCH" | "OAUTH_EXCHANGE_FAILED" | "ML_OAUTH_NOT_CONFIGURED" | "ML_REDIRECT_URI_MISMATCH" | "ML_OFFLINE_ACCESS_NOT_GRANTED" | "ML_OPERATOR_SUB_ACCOUNT" | "ML_SELLER_ALREADY_LINKED";
21
25
  interface MercadolibreStatus {
22
26
  connected: boolean;
@@ -7,7 +7,10 @@ export declare enum NotificationTypeEnum {
7
7
  DOLARBNA = "DOLARBNA",
8
8
  ERROR = "ERROR",
9
9
  AFIP_CERT_EXPIRY = "AFIP_CERT_EXPIRY",
10
- MERCADOLIBRE = "MERCADOLIBRE"
10
+ MERCADOLIBRE = "MERCADOLIBRE",
11
+ LOW_STOCK = "LOW_STOCK",
12
+ OUT_OF_STOCK = "OUT_OF_STOCK",
13
+ SUPPORT = "SUPPORT"
11
14
  }
12
15
  declare global {
13
16
  interface NotificationInterface {
@@ -17,6 +20,8 @@ declare global {
17
20
  type: NotificationTypeEnum;
18
21
  title: string;
19
22
  orderId?: string;
23
+ productId?: string;
24
+ supportId?: string;
20
25
  userId?: string;
21
26
  customerId?: string;
22
27
  read?: boolean;
@@ -20,4 +20,12 @@ export var NotificationTypeEnum;
20
20
  // ML order-ingestion fanout (app#797 / api#1574) — User-row read path
21
21
  // added by the orders_v2 worker.
22
22
  NotificationTypeEnum["MERCADOLIBRE"] = "MERCADOLIBRE";
23
+ // Stock alerts (api#1806) — fired when a sale crosses a product's stock
24
+ // threshold. LOW_STOCK at stock <= `Product.minStock`; OUT_OF_STOCK at
25
+ // stock <= 0. Both have User-row opt-in read paths.
26
+ NotificationTypeEnum["LOW_STOCK"] = "LOW_STOCK";
27
+ NotificationTypeEnum["OUT_OF_STOCK"] = "OUT_OF_STOCK";
28
+ // Support ticket bell (api#1806) — fired on ticket create / status change.
29
+ // User-row opt-in read path.
30
+ NotificationTypeEnum["SUPPORT"] = "SUPPORT";
23
31
  })(NotificationTypeEnum || (NotificationTypeEnum = {}));
package/dist/order.d.ts CHANGED
@@ -68,6 +68,14 @@ declare global {
68
68
  mercadolibre?: OrderMercadolibre;
69
69
  }
70
70
  type OrderChannel = 'meli';
71
+ interface MercadolibreCreditNoteStamp {
72
+ creditNoteNumber?: number;
73
+ emittedAt?: number;
74
+ status?: 'emitted' | 'skipped' | 'failed';
75
+ reason?: string;
76
+ claimId?: string;
77
+ source: 'manual' | 'auto';
78
+ }
71
79
  interface OrderMercadolibre {
72
80
  mlOrderId: string;
73
81
  packId?: string;
@@ -21,3 +21,17 @@ export interface PlatformGlobalsPostBody {
21
21
  scope: 'app' | 'web' | 'landing' | 'storefront';
22
22
  }>;
23
23
  }
24
+ export interface PlatformProviderHealth {
25
+ tenantsConnected: number;
26
+ /** 24h success ratio in [0, 1] (a fraction, NOT a percentage). */
27
+ syncSuccessRate24h?: number;
28
+ /** Integer milliseconds. */
29
+ p95LatencyMs?: number;
30
+ /** Shared platform DLQ depth — the same value is repeated on every provider row. */
31
+ dlqDepth: number;
32
+ /** Epoch ms of the most recent error datapoint in the 24h window. */
33
+ lastIncidentAt?: number;
34
+ refreshFailures24h: number;
35
+ killSwitchEnabled?: boolean;
36
+ }
37
+ export type PlatformIntegrationsAggregate = Record<string, PlatformProviderHealth>;
package/dist/product.d.ts CHANGED
@@ -15,6 +15,7 @@ declare global {
15
15
  primary?: boolean;
16
16
  }[];
17
17
  stock: number;
18
+ minStock?: number;
18
19
  limit?: number;
19
20
  incomes?: {
20
21
  stockId: string;
package/dist/store.d.ts CHANGED
@@ -102,6 +102,7 @@ declare global {
102
102
  storeId: string;
103
103
  createdAt: number;
104
104
  type?: 'production' | 'demo';
105
+ seededAt?: number;
105
106
  name: string;
106
107
  address: {
107
108
  street: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.6.69",
3
+ "version": "1.6.71",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",