sinfactura-types 1.6.25 → 1.6.27

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.
@@ -0,0 +1,45 @@
1
+ declare global {
2
+ /**
3
+ * Wire contract returned by `POST /tenants/{storeId}/impersonate` — the
4
+ * MANAGER tenant-impersonation mint endpoint (app#1756 · spine #1187).
5
+ *
6
+ * BE produces, FE consumes. This is the ONLY impersonation type that crosses
7
+ * the api↔app boundary: the JWT claims (`act`/`aud`/`scope`/`store`/`sid`),
8
+ * the request body (`{ targetUserId, reason }`) and the server-side
9
+ * session-registry DDB item all stay service-local.
10
+ *
11
+ * The minted token is an RFC 8693 *delegation* token (`sub` = the tenant
12
+ * user, `act.sub` = the operator), short-lived (30 min) and
13
+ * **non-refreshable**, signed with a separate key so a leak is revocable
14
+ * without rotating the normal auth key. The FE reads the impersonated
15
+ * identity's roles/permissions from `impersonatedUser` (NOT from the JWT —
16
+ * `jose.decodeJwt` is used only to read `exp` for the countdown); the
17
+ * `act`/`scope`/`aud` claims exist purely for BE verification + audit.
18
+ */
19
+ interface ImpersonationMintResponse {
20
+ /**
21
+ * The minted delegation JWT (`aud: "impersonation"`). In-memory only on the
22
+ * FE — never persisted to localStorage / URL / the refresh cookie.
23
+ */
24
+ impersonationToken: string;
25
+ /**
26
+ * The impersonated tenant user, AuthUser-shaped: the target's
27
+ * roles/permissions/storeId plus the impersonation `accessToken`. The FE
28
+ * repoints its session identity to this inside the new impersonation tab.
29
+ */
30
+ impersonatedUser: AuthUser;
31
+ /**
32
+ * Hard expiry of the session, unix milliseconds. Mirrors the JWT `exp`;
33
+ * because the token is non-refreshable this is absolute. Drives the banner
34
+ * countdown and the auto-exit.
35
+ */
36
+ expiresAt: number;
37
+ /**
38
+ * Server-side impersonation-session id (also the JWT `sid`). Identifies the
39
+ * registry row the FE later passes to
40
+ * `POST /tenants/{storeId}/impersonation/{sessionId}/end`.
41
+ */
42
+ sessionId: string;
43
+ }
44
+ }
45
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from "./categories";
10
10
  export * from "./currency";
11
11
  export * from "./customer";
12
12
  export * from "./demo";
13
+ export * from "./impersonation";
13
14
  export * from "./imports";
14
15
  export * from "./invoice";
15
16
  export * from "./log";
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export * from "./categories";
10
10
  export * from "./currency";
11
11
  export * from "./customer";
12
12
  export * from "./demo";
13
+ export * from "./impersonation";
13
14
  export * from "./imports";
14
15
  export * from "./invoice";
15
16
  export * from "./log";
@@ -5,7 +5,8 @@ export declare enum NotificationTypeEnum {
5
5
  DOLAROFICIAL = "DOLAROFICIAL",
6
6
  DOLARINFORMAL = "DOLARINFORMAL",
7
7
  DOLARBNA = "DOLARBNA",
8
- ERROR = "ERROR"
8
+ ERROR = "ERROR",
9
+ AFIP_CERT_EXPIRY = "AFIP_CERT_EXPIRY"
9
10
  }
10
11
  declare global {
11
12
  interface NotificationInterface {
@@ -19,6 +20,7 @@ declare global {
19
20
  customerId?: string;
20
21
  read?: boolean;
21
22
  description?: string;
23
+ severity?: 'info' | 'warning' | 'critical';
22
24
  details?: string;
23
25
  total?: number;
24
26
  TableName?: string;
@@ -4,8 +4,9 @@
4
4
  // Stripe hook, propagate-fx). Exported as a real enum so `api`
5
5
  // (stacks/helpers/notificationType.ts) and `app`
6
6
  // (src/domain/notificationType.ts) can drop their hand-mirrored copies
7
- // in follow-ups. DOLARBNA / ERROR have no read path today — enum members
8
- // only.
7
+ // in follow-ups. DOLARBNA / ERROR / AFIP_CERT_EXPIRY have no User-row
8
+ // read path — enum members only (AFIP_CERT_EXPIRY = the cert-expiry
9
+ // alert type, api#1382).
9
10
  export var NotificationTypeEnum;
10
11
  (function (NotificationTypeEnum) {
11
12
  NotificationTypeEnum["ORDER"] = "ORDER";
@@ -15,4 +16,5 @@ export var NotificationTypeEnum;
15
16
  NotificationTypeEnum["DOLARINFORMAL"] = "DOLARINFORMAL";
16
17
  NotificationTypeEnum["DOLARBNA"] = "DOLARBNA";
17
18
  NotificationTypeEnum["ERROR"] = "ERROR";
19
+ NotificationTypeEnum["AFIP_CERT_EXPIRY"] = "AFIP_CERT_EXPIRY";
18
20
  })(NotificationTypeEnum || (NotificationTypeEnum = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.6.25",
3
+ "version": "1.6.27",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",