@idp.global/interfaces 1.0.1
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/changelog.md +16 -0
- package/dist_ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/data/abusewindow.d.ts +13 -0
- package/dist_ts/data/abusewindow.js +2 -0
- package/dist_ts/data/activity.d.ts +16 -0
- package/dist_ts/data/activity.js +2 -0
- package/dist_ts/data/alert.d.ts +31 -0
- package/dist_ts/data/alert.js +2 -0
- package/dist_ts/data/alertrule.d.ts +19 -0
- package/dist_ts/data/alertrule.js +2 -0
- package/dist_ts/data/app.d.ts +86 -0
- package/dist_ts/data/app.js +2 -0
- package/dist_ts/data/appconnection.d.ts +16 -0
- package/dist_ts/data/appconnection.js +2 -0
- package/dist_ts/data/billingplan.d.ts +43 -0
- package/dist_ts/data/billingplan.js +2 -0
- package/dist_ts/data/device.d.ts +3 -0
- package/dist_ts/data/device.js +2 -0
- package/dist_ts/data/emailactiontoken.d.ts +11 -0
- package/dist_ts/data/emailactiontoken.js +2 -0
- package/dist_ts/data/index.d.ts +21 -0
- package/dist_ts/data/index.js +22 -0
- package/dist_ts/data/jwt.d.ts +38 -0
- package/dist_ts/data/jwt.js +2 -0
- package/dist_ts/data/loginsession.d.ts +38 -0
- package/dist_ts/data/loginsession.js +2 -0
- package/dist_ts/data/oidc.d.ts +248 -0
- package/dist_ts/data/oidc.js +5 -0
- package/dist_ts/data/organization.d.ts +11 -0
- package/dist_ts/data/organization.js +4 -0
- package/dist_ts/data/paddlecheckoutdata.d.ts +316 -0
- package/dist_ts/data/paddlecheckoutdata.js +2 -0
- package/dist_ts/data/passportchallenge.d.ts +68 -0
- package/dist_ts/data/passportchallenge.js +2 -0
- package/dist_ts/data/passportdevice.d.ts +34 -0
- package/dist_ts/data/passportdevice.js +2 -0
- package/dist_ts/data/passportnonce.d.ts +9 -0
- package/dist_ts/data/passportnonce.js +2 -0
- package/dist_ts/data/property.d.ts +10 -0
- package/dist_ts/data/property.js +3 -0
- package/dist_ts/data/registrationsession.d.ts +25 -0
- package/dist_ts/data/registrationsession.js +2 -0
- package/dist_ts/data/role.d.ts +28 -0
- package/dist_ts/data/role.js +2 -0
- package/dist_ts/data/user.d.ts +32 -0
- package/dist_ts/data/user.js +3 -0
- package/dist_ts/data/userinvitation.d.ts +45 -0
- package/dist_ts/data/userinvitation.js +2 -0
- package/dist_ts/index.d.ts +4 -0
- package/dist_ts/index.js +6 -0
- package/dist_ts/plugins.d.ts +4 -0
- package/dist_ts/plugins.js +7 -0
- package/dist_ts/request/admin.d.ts +100 -0
- package/dist_ts/request/admin.js +3 -0
- package/dist_ts/request/alert.d.ts +78 -0
- package/dist_ts/request/alert.js +3 -0
- package/dist_ts/request/apitoken.d.ts +1 -0
- package/dist_ts/request/apitoken.js +2 -0
- package/dist_ts/request/app.d.ts +48 -0
- package/dist_ts/request/app.js +3 -0
- package/dist_ts/request/authorization.d.ts +57 -0
- package/dist_ts/request/authorization.js +4 -0
- package/dist_ts/request/billingplan.d.ts +40 -0
- package/dist_ts/request/billingplan.js +3 -0
- package/dist_ts/request/index.d.ts +14 -0
- package/dist_ts/request/index.js +15 -0
- package/dist_ts/request/jwt.d.ts +63 -0
- package/dist_ts/request/jwt.js +3 -0
- package/dist_ts/request/login.d.ts +126 -0
- package/dist_ts/request/login.js +3 -0
- package/dist_ts/request/organization.d.ts +96 -0
- package/dist_ts/request/organization.js +3 -0
- package/dist_ts/request/passport.d.ts +169 -0
- package/dist_ts/request/passport.js +3 -0
- package/dist_ts/request/plan.d.ts +12 -0
- package/dist_ts/request/plan.js +3 -0
- package/dist_ts/request/registration.d.ts +65 -0
- package/dist_ts/request/registration.js +3 -0
- package/dist_ts/request/user.d.ts +101 -0
- package/dist_ts/request/user.js +3 -0
- package/dist_ts/request/userinvitation.d.ts +193 -0
- package/dist_ts/request/userinvitation.js +3 -0
- package/dist_ts/tags/index.d.ts +7 -0
- package/dist_ts/tags/index.js +2 -0
- package/license +21 -0
- package/package.json +57 -0
- package/readme.md +101 -0
- package/ts/00_commitinfo_data.ts +8 -0
- package/ts/data/abusewindow.ts +13 -0
- package/ts/data/activity.ts +36 -0
- package/ts/data/alert.ts +35 -0
- package/ts/data/alertrule.ts +22 -0
- package/ts/data/app.ts +99 -0
- package/ts/data/appconnection.ts +18 -0
- package/ts/data/billingplan.ts +47 -0
- package/ts/data/device.ts +3 -0
- package/ts/data/emailactiontoken.ts +12 -0
- package/ts/data/index.ts +21 -0
- package/ts/data/jwt.ts +43 -0
- package/ts/data/loginsession.ts +38 -0
- package/ts/data/oidc.ts +281 -0
- package/ts/data/organization.ts +14 -0
- package/ts/data/paddlecheckoutdata.ts +316 -0
- package/ts/data/passportchallenge.ts +80 -0
- package/ts/data/passportdevice.ts +46 -0
- package/ts/data/passportnonce.ts +9 -0
- package/ts/data/property.ts +12 -0
- package/ts/data/registrationsession.ts +31 -0
- package/ts/data/role.ts +33 -0
- package/ts/data/user.ts +36 -0
- package/ts/data/userinvitation.ts +58 -0
- package/ts/index.ts +6 -0
- package/ts/plugins.ts +9 -0
- package/ts/readme.md +133 -0
- package/ts/request/admin.ts +130 -0
- package/ts/request/alert.ts +113 -0
- package/ts/request/apitoken.ts +1 -0
- package/ts/request/app.ts +71 -0
- package/ts/request/authorization.ts +72 -0
- package/ts/request/billingplan.ts +55 -0
- package/ts/request/index.ts +14 -0
- package/ts/request/jwt.ts +79 -0
- package/ts/request/login.ts +181 -0
- package/ts/request/organization.ts +131 -0
- package/ts/request/passport.ts +227 -0
- package/ts/request/plan.ts +17 -0
- package/ts/request/registration.ts +90 -0
- package/ts/request/user.ts +142 -0
- package/ts/request/userinvitation.ts +248 -0
- package/ts/tags/index.ts +12 -0
package/changelog.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Pending
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## 2026-05-18 - 1.0.1
|
|
7
|
+
|
|
8
|
+
### Fixes
|
|
9
|
+
|
|
10
|
+
- add SmartConfig project metadata and update development tooling versions (build)
|
|
11
|
+
- adds .smartconfig.json with npm package, repository, and release target configuration
|
|
12
|
+
- bumps @git.zone build/test/documentation tooling and @types/node devDependency versions
|
|
13
|
+
|
|
14
|
+
## 1.0.0
|
|
15
|
+
|
|
16
|
+
- Initial standalone extraction of idp.global shared interfaces.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* autocreated commitinfo by @push.rocks/commitinfo
|
|
3
|
+
*/
|
|
4
|
+
export const commitinfo = {
|
|
5
|
+
name: '@idp.global/interfaces',
|
|
6
|
+
version: '1.0.1',
|
|
7
|
+
description: 'Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.'
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type TActivityAction = 'login' | 'logout' | 'session_created' | 'session_revoked' | 'passport_device_enrolled' | 'passport_device_revoked' | 'passport_challenge_approved' | 'passport_challenge_rejected' | 'org_created' | 'org_updated' | 'org_deleted' | 'org_ownership_transferred' | 'org_joined' | 'org_left' | 'role_changed' | 'org_app_role_mappings_updated' | 'profile_updated' | 'app_connected' | 'app_disconnected';
|
|
2
|
+
export interface IActivityLog {
|
|
3
|
+
id: string;
|
|
4
|
+
data: {
|
|
5
|
+
userId: string;
|
|
6
|
+
action: TActivityAction;
|
|
7
|
+
timestamp: number;
|
|
8
|
+
metadata: {
|
|
9
|
+
ip?: string;
|
|
10
|
+
userAgent?: string;
|
|
11
|
+
targetId?: string;
|
|
12
|
+
targetType?: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type TAlertSeverity = 'low' | 'medium' | 'high' | 'critical';
|
|
2
|
+
export type TAlertStatus = 'pending' | 'seen' | 'dismissed';
|
|
3
|
+
export type TAlertCategory = 'security' | 'admin' | 'system';
|
|
4
|
+
export type TAlertNotificationStatus = 'pending' | 'sent' | 'failed' | 'seen';
|
|
5
|
+
export interface IAlert {
|
|
6
|
+
id: string;
|
|
7
|
+
data: {
|
|
8
|
+
recipientUserId: string;
|
|
9
|
+
organizationId?: string;
|
|
10
|
+
category: TAlertCategory;
|
|
11
|
+
eventType: string;
|
|
12
|
+
severity: TAlertSeverity;
|
|
13
|
+
title: string;
|
|
14
|
+
body: string;
|
|
15
|
+
actorUserId?: string;
|
|
16
|
+
relatedEntityId?: string;
|
|
17
|
+
relatedEntityType?: string;
|
|
18
|
+
notification: {
|
|
19
|
+
hintId: string;
|
|
20
|
+
status: TAlertNotificationStatus;
|
|
21
|
+
attemptCount: number;
|
|
22
|
+
createdAt: number;
|
|
23
|
+
deliveredAt?: number | null;
|
|
24
|
+
seenAt?: number | null;
|
|
25
|
+
lastError?: string | null;
|
|
26
|
+
};
|
|
27
|
+
createdAt: number;
|
|
28
|
+
seenAt?: number | null;
|
|
29
|
+
dismissedAt?: number | null;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TAlertSeverity } from './alert.js';
|
|
2
|
+
export type TAlertRuleScope = 'global' | 'organization';
|
|
3
|
+
export type TAlertRuleRecipientMode = 'global_admins' | 'org_admins' | 'specific_users';
|
|
4
|
+
export interface IAlertRule {
|
|
5
|
+
id: string;
|
|
6
|
+
data: {
|
|
7
|
+
scope: TAlertRuleScope;
|
|
8
|
+
organizationId?: string;
|
|
9
|
+
eventType: string;
|
|
10
|
+
minimumSeverity: TAlertSeverity;
|
|
11
|
+
recipientMode: TAlertRuleRecipientMode;
|
|
12
|
+
recipientUserIds?: string[];
|
|
13
|
+
push: boolean;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
createdByUserId: string;
|
|
16
|
+
createdAt: number;
|
|
17
|
+
updatedAt: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export type TAppType = 'global' | 'partner' | 'custom_oidc';
|
|
2
|
+
export type TAppApprovalStatus = 'draft' | 'pending_review' | 'approved' | 'rejected' | 'suspended';
|
|
3
|
+
export interface IOAuthCredentials {
|
|
4
|
+
clientId: string;
|
|
5
|
+
clientSecretHash: string;
|
|
6
|
+
redirectUris: string[];
|
|
7
|
+
allowedScopes: string[];
|
|
8
|
+
grantTypes: ('authorization_code' | 'client_credentials' | 'refresh_token')[];
|
|
9
|
+
}
|
|
10
|
+
export interface IAppBaseData {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
logoUrl: string;
|
|
14
|
+
appUrl: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IGlobalApp {
|
|
17
|
+
id: string;
|
|
18
|
+
type: 'global';
|
|
19
|
+
data: IAppBaseData & {
|
|
20
|
+
oauthCredentials: IOAuthCredentials;
|
|
21
|
+
isActive: boolean;
|
|
22
|
+
category: string;
|
|
23
|
+
createdAt: number;
|
|
24
|
+
createdByUserId: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface IPartnerApp {
|
|
28
|
+
id: string;
|
|
29
|
+
type: 'partner';
|
|
30
|
+
data: IAppBaseData & {
|
|
31
|
+
ownerOrganizationId: string;
|
|
32
|
+
oauthCredentials: IOAuthCredentials;
|
|
33
|
+
appStoreMetadata: {
|
|
34
|
+
shortDescription: string;
|
|
35
|
+
longDescription: string;
|
|
36
|
+
screenshots: string[];
|
|
37
|
+
category: string;
|
|
38
|
+
tags: string[];
|
|
39
|
+
pricing: {
|
|
40
|
+
model: 'free' | 'paid' | 'freemium';
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
approvalStatus: TAppApprovalStatus;
|
|
44
|
+
isPublished: boolean;
|
|
45
|
+
installCount: number;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface ICustomOidcApp {
|
|
49
|
+
id: string;
|
|
50
|
+
type: 'custom_oidc';
|
|
51
|
+
data: IAppBaseData & {
|
|
52
|
+
ownerOrganizationId: string;
|
|
53
|
+
oauthCredentials: IOAuthCredentials;
|
|
54
|
+
oidcSettings: {
|
|
55
|
+
accessTokenLifetime: number;
|
|
56
|
+
refreshTokenLifetime: number;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export type IApp = IGlobalApp | IPartnerApp | ICustomOidcApp;
|
|
61
|
+
/**
|
|
62
|
+
* Legacy interface for backwards compatibility with existing code
|
|
63
|
+
* that expects a flat app structure (e.g., idpclient, transfermanager)
|
|
64
|
+
*/
|
|
65
|
+
export interface IAppLegacy {
|
|
66
|
+
/**
|
|
67
|
+
* must be unique
|
|
68
|
+
*/
|
|
69
|
+
id: string;
|
|
70
|
+
/**
|
|
71
|
+
* should be unique
|
|
72
|
+
*/
|
|
73
|
+
name: string;
|
|
74
|
+
description: string;
|
|
75
|
+
logoUrl: string;
|
|
76
|
+
appUrl: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Storage interface for SmartData documents
|
|
80
|
+
* Uses the discriminated union approach with a 'type' field
|
|
81
|
+
*/
|
|
82
|
+
export interface IAppDocument {
|
|
83
|
+
id: string;
|
|
84
|
+
type: TAppType;
|
|
85
|
+
data: IGlobalApp['data'] | IPartnerApp['data'] | ICustomOidcApp['data'];
|
|
86
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TAppType } from './app.js';
|
|
2
|
+
import type { IAppRoleMapping } from './role.js';
|
|
3
|
+
export type TAppConnectionStatus = 'active' | 'disconnected';
|
|
4
|
+
export interface IAppConnection {
|
|
5
|
+
id: string;
|
|
6
|
+
data: {
|
|
7
|
+
organizationId: string;
|
|
8
|
+
appId: string;
|
|
9
|
+
appType: TAppType;
|
|
10
|
+
status: TAppConnectionStatus;
|
|
11
|
+
connectedAt: number;
|
|
12
|
+
connectedByUserId: string;
|
|
13
|
+
grantedScopes: string[];
|
|
14
|
+
roleMappings?: IAppRoleMapping[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type TSupportedCurrency = 'EUR';
|
|
2
|
+
export interface IBillableItem {
|
|
3
|
+
name: string;
|
|
4
|
+
monthlyPrice: number;
|
|
5
|
+
currency: TSupportedCurrency;
|
|
6
|
+
from: number;
|
|
7
|
+
to: number;
|
|
8
|
+
factoredOn30DayMonth: number;
|
|
9
|
+
quantity: number;
|
|
10
|
+
}
|
|
11
|
+
export interface IBillingPlan {
|
|
12
|
+
id: string;
|
|
13
|
+
data: {
|
|
14
|
+
type: 'Paddle' | 'AppSumo' | 'FairUsageFree' | 'Enterprise' | 'Internal' | 'Testing';
|
|
15
|
+
proEnabled: boolean;
|
|
16
|
+
organizationId: string;
|
|
17
|
+
lastProcessed: number;
|
|
18
|
+
seats: number;
|
|
19
|
+
status: 'active' | 'activeOverdue' | 'pausedOverdue' | 'inactive' | 'suspended';
|
|
20
|
+
paddleData?: {
|
|
21
|
+
checkoutId: string;
|
|
22
|
+
};
|
|
23
|
+
alternativePaymentData?: {
|
|
24
|
+
enterprise: boolean;
|
|
25
|
+
appSumoCode: string;
|
|
26
|
+
};
|
|
27
|
+
nextBilling: {
|
|
28
|
+
items: Array<IBillableItem>;
|
|
29
|
+
method: 'paddle';
|
|
30
|
+
ontrack: boolean;
|
|
31
|
+
errorText?: string;
|
|
32
|
+
selectedBillingDate: number;
|
|
33
|
+
};
|
|
34
|
+
billingEvents: Array<{
|
|
35
|
+
timestamp: number;
|
|
36
|
+
amount: number;
|
|
37
|
+
currency: TSupportedCurrency;
|
|
38
|
+
billedItems: Array<IBillableItem>;
|
|
39
|
+
checkoutLink?: string;
|
|
40
|
+
}>;
|
|
41
|
+
communications: Array<any>;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmlsbGluZ3BsYW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9kYXRhL2JpbGxpbmdwbGFuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sZUFBZSxDQUFDIn0=
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGV2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvZGF0YS9kZXZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUMifQ==
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type TEmailActionTokenAction = 'emailLogin' | 'passwordReset';
|
|
2
|
+
export interface IEmailActionToken {
|
|
3
|
+
id: string;
|
|
4
|
+
data: {
|
|
5
|
+
email: string;
|
|
6
|
+
action: TEmailActionTokenAction;
|
|
7
|
+
tokenHash: string;
|
|
8
|
+
validUntil: number;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './abusewindow.js';
|
|
2
|
+
export * from './activity.js';
|
|
3
|
+
export * from './alert.js';
|
|
4
|
+
export * from './alertrule.js';
|
|
5
|
+
export * from './app.js';
|
|
6
|
+
export * from './emailactiontoken.js';
|
|
7
|
+
export * from './oidc.js';
|
|
8
|
+
export * from './appconnection.js';
|
|
9
|
+
export * from './billingplan.js';
|
|
10
|
+
export * from './device.js';
|
|
11
|
+
export * from './jwt.js';
|
|
12
|
+
export * from './loginsession.js';
|
|
13
|
+
export * from './organization.js';
|
|
14
|
+
export * from './paddlecheckoutdata.js';
|
|
15
|
+
export * from './passportchallenge.js';
|
|
16
|
+
export * from './passportdevice.js';
|
|
17
|
+
export * from './passportnonce.js';
|
|
18
|
+
export * from './registrationsession.js';
|
|
19
|
+
export * from './role.js';
|
|
20
|
+
export * from './user.js';
|
|
21
|
+
export * from './userinvitation.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './abusewindow.js';
|
|
2
|
+
export * from './activity.js';
|
|
3
|
+
export * from './alert.js';
|
|
4
|
+
export * from './alertrule.js';
|
|
5
|
+
export * from './app.js';
|
|
6
|
+
export * from './emailactiontoken.js';
|
|
7
|
+
export * from './oidc.js';
|
|
8
|
+
export * from './appconnection.js';
|
|
9
|
+
export * from './billingplan.js';
|
|
10
|
+
export * from './device.js';
|
|
11
|
+
export * from './jwt.js';
|
|
12
|
+
export * from './loginsession.js';
|
|
13
|
+
export * from './organization.js';
|
|
14
|
+
export * from './paddlecheckoutdata.js';
|
|
15
|
+
export * from './passportchallenge.js';
|
|
16
|
+
export * from './passportdevice.js';
|
|
17
|
+
export * from './passportnonce.js';
|
|
18
|
+
export * from './registrationsession.js';
|
|
19
|
+
export * from './role.js';
|
|
20
|
+
export * from './user.js';
|
|
21
|
+
export * from './userinvitation.js';
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9kYXRhL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMscUJBQXFCLENBQUMifQ==
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type TLoginStatus = 'loggedIn' | 'loggedOut' | 'invalidated' | 'not found' | 'transfer';
|
|
2
|
+
export type TLoginAction = 'login' | 'logout' | 'manage';
|
|
3
|
+
export interface IJwt {
|
|
4
|
+
id: string;
|
|
5
|
+
blocked: boolean;
|
|
6
|
+
data: {
|
|
7
|
+
/**
|
|
8
|
+
* the user id of the jwt
|
|
9
|
+
*/
|
|
10
|
+
userId: string;
|
|
11
|
+
/**
|
|
12
|
+
* the login session backing this jwt
|
|
13
|
+
*/
|
|
14
|
+
sessionId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* the latest point of
|
|
17
|
+
*/
|
|
18
|
+
validUntil: number;
|
|
19
|
+
/**
|
|
20
|
+
* hold off from refreshing before
|
|
21
|
+
*/
|
|
22
|
+
refreshFrom: number;
|
|
23
|
+
/**
|
|
24
|
+
* an interval in millis to recheck token invalidation
|
|
25
|
+
*/
|
|
26
|
+
refreshEvery: number;
|
|
27
|
+
/**
|
|
28
|
+
* legacy field kept for compatibility with already-issued jwt documents
|
|
29
|
+
*/
|
|
30
|
+
refreshToken?: string;
|
|
31
|
+
/**
|
|
32
|
+
* just for looks/debugging
|
|
33
|
+
*/
|
|
34
|
+
justForLooks: {
|
|
35
|
+
validUntilIsoString: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface ILoginSession {
|
|
2
|
+
id: string;
|
|
3
|
+
data: {
|
|
4
|
+
userId: string | null;
|
|
5
|
+
validUntil: number;
|
|
6
|
+
invalidated: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* legacy plaintext refresh token field kept so existing sessions can migrate on first use
|
|
9
|
+
*/
|
|
10
|
+
refreshToken?: string | null;
|
|
11
|
+
refreshTokenHash?: string | null;
|
|
12
|
+
rotatedRefreshTokenHashes?: string[];
|
|
13
|
+
transferTokenHash?: string | null;
|
|
14
|
+
transferTokenExpiresAt?: number | null;
|
|
15
|
+
/**
|
|
16
|
+
* a device id that can be used to share the login session
|
|
17
|
+
* in different contexts on the same device
|
|
18
|
+
*/
|
|
19
|
+
deviceId?: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Device metadata for session display
|
|
22
|
+
*/
|
|
23
|
+
deviceInfo?: {
|
|
24
|
+
deviceName: string;
|
|
25
|
+
browser: string;
|
|
26
|
+
os: string;
|
|
27
|
+
ip: string;
|
|
28
|
+
} | null;
|
|
29
|
+
/**
|
|
30
|
+
* When this session was created
|
|
31
|
+
*/
|
|
32
|
+
createdAt?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Last time this session was active (e.g., refreshed)
|
|
35
|
+
*/
|
|
36
|
+
lastActive?: number;
|
|
37
|
+
};
|
|
38
|
+
}
|