sinfactura-types 1.10.74 → 1.10.76
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/auth.d.ts +63 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/invitation.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/invitation.d.ts +61 -0
- package/dist/invitation.js +1 -0
- package/dist/store.d.ts +11 -0
- package/package.json +1 -1
package/dist/auth.d.ts
CHANGED
|
@@ -8,12 +8,30 @@ declare global {
|
|
|
8
8
|
captchaToken?: string;
|
|
9
9
|
/** Firebase App Check token — the mobile step-up, required only after an `ATTESTATION_REQUIRED` rejection; the native equivalent of `captchaToken`. */
|
|
10
10
|
appCheckToken?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Opt in to a long-lived session. Absent or `false` issues the SHORT
|
|
13
|
+
* default lifetime, so a client that never learns about this field gets
|
|
14
|
+
* the safer one; only an explicit `true` extends it.
|
|
15
|
+
*/
|
|
16
|
+
rememberMe?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Opt in to remembering THIS device, so subsequent logins from it skip
|
|
19
|
+
* the TOTP step-up until the trust expires.
|
|
20
|
+
*
|
|
21
|
+
* ⚠️ Honoured only on a login that actually PERFORMED the step-up — it
|
|
22
|
+
* cannot bootstrap itself on a login that never presented a second
|
|
23
|
+
* factor. The trust is carried by a BE-managed HttpOnly cookie, never by
|
|
24
|
+
* a value the client stores or echoes back.
|
|
25
|
+
*/
|
|
26
|
+
trustDevice?: boolean;
|
|
11
27
|
}
|
|
12
28
|
interface Social {
|
|
13
29
|
/** REQUIRED on the wire (BE rejects an empty/missing token) — was wrongly optional before 1.6.70. */
|
|
14
30
|
accessToken: string;
|
|
15
31
|
/** TOTP step-up code (6-32 chars) — same semantics as `Login.totpCode`. */
|
|
16
32
|
totpCode?: string;
|
|
33
|
+
/** Remember this device — same semantics as `Login.trustDevice`. */
|
|
34
|
+
trustDevice?: boolean;
|
|
17
35
|
}
|
|
18
36
|
interface Register {
|
|
19
37
|
email: string;
|
|
@@ -35,5 +53,50 @@ declare global {
|
|
|
35
53
|
waitlistId: string;
|
|
36
54
|
submittedAt: number;
|
|
37
55
|
}
|
|
56
|
+
/** `POST /auth?mode=verifyInvite` request body — the token from the invite email. */
|
|
57
|
+
interface VerifyInviteInput {
|
|
58
|
+
token: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Why an invite token will not accept. Deliberately COARSE: `invalid`
|
|
62
|
+
* covers "no such token" and "signature mismatch" alike, so a caller
|
|
63
|
+
* cannot probe which store an unknown token belongs to.
|
|
64
|
+
*/
|
|
65
|
+
type InviteInvalidReason = 'invalid' | 'expired' | 'revoked' | 'accepted';
|
|
66
|
+
/** Unauthenticated pre-check — returns only what the accept form needs to render. */
|
|
67
|
+
interface VerifyInviteResponse {
|
|
68
|
+
valid: true;
|
|
69
|
+
email: string;
|
|
70
|
+
role: string;
|
|
71
|
+
storeName: string;
|
|
72
|
+
invitedByName: string;
|
|
73
|
+
expiresAt: number;
|
|
74
|
+
message?: string;
|
|
75
|
+
}
|
|
76
|
+
/** ⚠️ Carries NO tenant detail — an invalid token must not disclose which store it named. */
|
|
77
|
+
interface VerifyInviteInvalidResponse {
|
|
78
|
+
valid: false;
|
|
79
|
+
reason: InviteInvalidReason;
|
|
80
|
+
}
|
|
81
|
+
/** `POST /auth?mode=acceptInvite` request body. */
|
|
82
|
+
interface AcceptInviteInput {
|
|
83
|
+
token: string;
|
|
84
|
+
fullName: string;
|
|
85
|
+
password: string;
|
|
86
|
+
phone?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* `INVITE_INVALID` collapses the four `InviteInvalidReason` cases on the
|
|
90
|
+
* accept path on purpose — by then the client has already seen the precise
|
|
91
|
+
* reason from `verifyInvite`, and a second, more specific answer here would
|
|
92
|
+
* turn accept into the probe `verifyInvite` was shaped to avoid.
|
|
93
|
+
*/
|
|
94
|
+
type AcceptInviteErrorCode = 'INVITE_INVALID' | 'EMAIL_ALREADY_REGISTERED' | 'SEAT_LIMIT_REACHED' | 'WEAK_PASSWORD';
|
|
95
|
+
/** Success shape — acceptance logs the new user straight in. */
|
|
96
|
+
interface AcceptInviteResponse {
|
|
97
|
+
userId: string;
|
|
98
|
+
storeId: string;
|
|
99
|
+
accessToken: string;
|
|
100
|
+
}
|
|
38
101
|
}
|
|
39
102
|
export {};
|
package/dist/cjs/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./customer.js"), exports);
|
|
|
34
34
|
__exportStar(require("./demo.js"), exports);
|
|
35
35
|
__exportStar(require("./impersonation.js"), exports);
|
|
36
36
|
__exportStar(require("./imports.js"), exports);
|
|
37
|
+
__exportStar(require("./invitation.js"), exports);
|
|
37
38
|
__exportStar(require("./invoice.js"), exports);
|
|
38
39
|
__exportStar(require("./log.js"), exports);
|
|
39
40
|
__exportStar(require("./maintenance.js"), exports);
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./customer.js";
|
|
|
13
13
|
export * from "./demo.js";
|
|
14
14
|
export * from "./impersonation.js";
|
|
15
15
|
export * from "./imports.js";
|
|
16
|
+
export * from "./invitation.js";
|
|
16
17
|
export * from "./invoice.js";
|
|
17
18
|
export * from "./log.js";
|
|
18
19
|
export * from "./maintenance.js";
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./customer.js";
|
|
|
18
18
|
export * from "./demo.js";
|
|
19
19
|
export * from "./impersonation.js";
|
|
20
20
|
export * from "./imports.js";
|
|
21
|
+
export * from "./invitation.js";
|
|
21
22
|
export * from "./invoice.js";
|
|
22
23
|
export * from "./log.js";
|
|
23
24
|
export * from "./maintenance.js";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
/**
|
|
3
|
+
* A pending invitation for a new user to join an existing store's team.
|
|
4
|
+
*
|
|
5
|
+
* Stored under `PK: INVITATION#${storeId}`. The row is the ONLY record of
|
|
6
|
+
* the invite; there is no shadow `User` row until acceptance, so an
|
|
7
|
+
* unaccepted invite consumes no seat against `maxUsers`.
|
|
8
|
+
*/
|
|
9
|
+
interface Invitation {
|
|
10
|
+
storeId: string;
|
|
11
|
+
invitationId: string;
|
|
12
|
+
/** Invitee's address. Lowercased on write — the uniqueness check is case-insensitive. */
|
|
13
|
+
email: string;
|
|
14
|
+
/** Role the invitee receives on acceptance. Never escalates past the inviter's own. */
|
|
15
|
+
role: string;
|
|
16
|
+
/** `userId` of the team member who issued the invite. */
|
|
17
|
+
invitedBy: string;
|
|
18
|
+
/**
|
|
19
|
+
* ⚠️ `'expired'` is NEVER persisted — it is derived at read time from
|
|
20
|
+
* `expiresAt` against now. A stored row only ever carries `'pending'`,
|
|
21
|
+
* `'accepted'` or `'revoked'`, so a reader that switches on the stored
|
|
22
|
+
* value must treat an elapsed `'pending'` as expired itself.
|
|
23
|
+
*/
|
|
24
|
+
status: InvitationStatus;
|
|
25
|
+
createdAt: number;
|
|
26
|
+
/** Unix ms after which the invite no longer accepts. Read-time expiry authority. */
|
|
27
|
+
expiresAt: number;
|
|
28
|
+
/**
|
|
29
|
+
* DynamoDB TTL — Unix **SECONDS**, unlike every other timestamp on this
|
|
30
|
+
* row. Set beyond `expiresAt` so an expired-but-unreaped invite still
|
|
31
|
+
* answers `verify` with a truthful reason rather than 404-ing as absent.
|
|
32
|
+
*/
|
|
33
|
+
ttl: number;
|
|
34
|
+
/** Unix ms of acceptance. Absent while `status` is `'pending'` or `'revoked'`. */
|
|
35
|
+
acceptedAt?: number;
|
|
36
|
+
/** `userId` created by acceptance. Set together with `acceptedAt`. */
|
|
37
|
+
acceptedUserId?: string;
|
|
38
|
+
/** Optional free-text note from the inviter, surfaced in the invite email. */
|
|
39
|
+
message?: string;
|
|
40
|
+
/**
|
|
41
|
+
* SHA-256 of the invite token. The plaintext token is emailed once and
|
|
42
|
+
* never stored. Named to match `response()`'s auto-strip list, so it
|
|
43
|
+
* cannot reach the wire through an unprojected read.
|
|
44
|
+
*/
|
|
45
|
+
hashedToken?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Lowercase WRITE-SIDE index for backend filtering. Internal — not part
|
|
48
|
+
* of the read contract; never consume it.
|
|
49
|
+
*/
|
|
50
|
+
search?: string;
|
|
51
|
+
}
|
|
52
|
+
/** `'expired'` is derived at read time and never persisted — see `Invitation.status`. */
|
|
53
|
+
type InvitationStatus = 'pending' | 'accepted' | 'revoked' | 'expired';
|
|
54
|
+
/** `POST /invitations` request body. */
|
|
55
|
+
interface CreateInvitationInput {
|
|
56
|
+
email: string;
|
|
57
|
+
role: string;
|
|
58
|
+
message?: string;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/store.d.ts
CHANGED
|
@@ -111,6 +111,16 @@ declare global {
|
|
|
111
111
|
priceDecimals: 0 | 1 | 2 | 3;
|
|
112
112
|
stock: boolean;
|
|
113
113
|
changePrice: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Ceiling on concurrent refresh-token sessions per user. When a new login
|
|
116
|
+
* would exceed it the OLDEST family is revoked, so the cap never blocks a
|
|
117
|
+
* login — it evicts.
|
|
118
|
+
*
|
|
119
|
+
* Absent falls back to the BE default (5). Counts SESSIONS (families),
|
|
120
|
+
* not stored rows: refresh rotation replaces a row without adding a
|
|
121
|
+
* device, so counting rows would evict an active user for refreshing.
|
|
122
|
+
*/
|
|
123
|
+
maxSessions?: number;
|
|
114
124
|
/**
|
|
115
125
|
* Back-office display currency (catalogId) the operator's screens are
|
|
116
126
|
* framed in — distinct from any individual money entity's own `currency`
|
|
@@ -468,6 +478,7 @@ declare global {
|
|
|
468
478
|
certExpiry?: number;
|
|
469
479
|
fceEnabled?: boolean;
|
|
470
480
|
wscdcEnabled?: boolean;
|
|
481
|
+
fceReceivedCheckpoint?: number;
|
|
471
482
|
}
|
|
472
483
|
/**
|
|
473
484
|
* Write shape for the `afip` key of `PATCH /store`'s body. The wire accepts an
|