@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
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as data from '../data/index.js';
|
|
2
|
+
import * as plugins from '../plugins.js';
|
|
3
|
+
/**
|
|
4
|
+
* Create an invitation to join an organization
|
|
5
|
+
*/
|
|
6
|
+
export interface IReq_CreateInvitation extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_CreateInvitation> {
|
|
7
|
+
method: 'createInvitation';
|
|
8
|
+
request: {
|
|
9
|
+
jwt: string;
|
|
10
|
+
organizationId: string;
|
|
11
|
+
email: string;
|
|
12
|
+
roles: string[];
|
|
13
|
+
};
|
|
14
|
+
response: {
|
|
15
|
+
success: boolean;
|
|
16
|
+
invitation?: data.IUserInvitation;
|
|
17
|
+
message?: string;
|
|
18
|
+
/** True if a new invitation was created, false if email was added to existing */
|
|
19
|
+
isNew: boolean;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get pending invitations for an organization
|
|
24
|
+
*/
|
|
25
|
+
export interface IReq_GetOrgInvitations extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetOrgInvitations> {
|
|
26
|
+
method: 'getOrgInvitations';
|
|
27
|
+
request: {
|
|
28
|
+
jwt: string;
|
|
29
|
+
organizationId: string;
|
|
30
|
+
};
|
|
31
|
+
response: {
|
|
32
|
+
invitations: data.IUserInvitation[];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get members of an organization (users with roles)
|
|
37
|
+
*/
|
|
38
|
+
export interface IReq_GetOrgMembers extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetOrgMembers> {
|
|
39
|
+
method: 'getOrgMembers';
|
|
40
|
+
request: {
|
|
41
|
+
jwt: string;
|
|
42
|
+
organizationId: string;
|
|
43
|
+
};
|
|
44
|
+
response: {
|
|
45
|
+
members: Array<{
|
|
46
|
+
user: data.IUser;
|
|
47
|
+
role: data.IRole;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Cancel a pending invitation
|
|
53
|
+
*/
|
|
54
|
+
export interface IReq_CancelInvitation extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_CancelInvitation> {
|
|
55
|
+
method: 'cancelInvitation';
|
|
56
|
+
request: {
|
|
57
|
+
jwt: string;
|
|
58
|
+
organizationId: string;
|
|
59
|
+
invitationId: string;
|
|
60
|
+
};
|
|
61
|
+
response: {
|
|
62
|
+
success: boolean;
|
|
63
|
+
message?: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Resend invitation email
|
|
68
|
+
*/
|
|
69
|
+
export interface IReq_ResendInvitation extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_ResendInvitation> {
|
|
70
|
+
method: 'resendInvitation';
|
|
71
|
+
request: {
|
|
72
|
+
jwt: string;
|
|
73
|
+
organizationId: string;
|
|
74
|
+
invitationId: string;
|
|
75
|
+
};
|
|
76
|
+
response: {
|
|
77
|
+
success: boolean;
|
|
78
|
+
message?: string;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Remove a member from an organization
|
|
83
|
+
*/
|
|
84
|
+
export interface IReq_RemoveMember extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_RemoveMember> {
|
|
85
|
+
method: 'removeMember';
|
|
86
|
+
request: {
|
|
87
|
+
jwt: string;
|
|
88
|
+
organizationId: string;
|
|
89
|
+
userId: string;
|
|
90
|
+
};
|
|
91
|
+
response: {
|
|
92
|
+
success: boolean;
|
|
93
|
+
message?: string;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Update a member's roles
|
|
98
|
+
*/
|
|
99
|
+
export interface IReq_UpdateMemberRoles extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_UpdateMemberRoles> {
|
|
100
|
+
method: 'updateMemberRoles';
|
|
101
|
+
request: {
|
|
102
|
+
jwt: string;
|
|
103
|
+
organizationId: string;
|
|
104
|
+
userId: string;
|
|
105
|
+
roles: string[];
|
|
106
|
+
};
|
|
107
|
+
response: {
|
|
108
|
+
success: boolean;
|
|
109
|
+
role?: data.IRole;
|
|
110
|
+
message?: string;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Transfer organization ownership to another member
|
|
115
|
+
*/
|
|
116
|
+
export interface IReq_TransferOwnership extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_TransferOwnership> {
|
|
117
|
+
method: 'transferOwnership';
|
|
118
|
+
request: {
|
|
119
|
+
jwt: string;
|
|
120
|
+
organizationId: string;
|
|
121
|
+
newOwnerId: string;
|
|
122
|
+
confirmationText: string;
|
|
123
|
+
};
|
|
124
|
+
response: {
|
|
125
|
+
success: boolean;
|
|
126
|
+
message?: string;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Accept an invitation (called during registration or email verification)
|
|
131
|
+
*/
|
|
132
|
+
export interface IReq_AcceptInvitation extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_AcceptInvitation> {
|
|
133
|
+
method: 'acceptInvitation';
|
|
134
|
+
request: {
|
|
135
|
+
token: string;
|
|
136
|
+
userId: string;
|
|
137
|
+
};
|
|
138
|
+
response: {
|
|
139
|
+
success: boolean;
|
|
140
|
+
organizations?: data.IOrganization[];
|
|
141
|
+
roles?: data.IRole[];
|
|
142
|
+
message?: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get invitation by token (for invitation landing page)
|
|
147
|
+
*/
|
|
148
|
+
export interface IReq_GetInvitationByToken extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetInvitationByToken> {
|
|
149
|
+
method: 'getInvitationByToken';
|
|
150
|
+
request: {
|
|
151
|
+
token: string;
|
|
152
|
+
};
|
|
153
|
+
response: {
|
|
154
|
+
invitation?: data.IUserInvitation;
|
|
155
|
+
organizations?: Array<{
|
|
156
|
+
id: string;
|
|
157
|
+
name: string;
|
|
158
|
+
}>;
|
|
159
|
+
isExpired: boolean;
|
|
160
|
+
requiresRegistration: boolean;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Bulk create invitations from a list (typically from CSV import)
|
|
165
|
+
*/
|
|
166
|
+
export interface IReq_BulkCreateInvitations extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_BulkCreateInvitations> {
|
|
167
|
+
method: 'bulkCreateInvitations';
|
|
168
|
+
request: {
|
|
169
|
+
jwt: string;
|
|
170
|
+
organizationId: string;
|
|
171
|
+
invitations: Array<{
|
|
172
|
+
email: string;
|
|
173
|
+
roles?: string[];
|
|
174
|
+
}>;
|
|
175
|
+
defaultRoles: string[];
|
|
176
|
+
};
|
|
177
|
+
response: {
|
|
178
|
+
success: boolean;
|
|
179
|
+
results: Array<{
|
|
180
|
+
email: string;
|
|
181
|
+
success: boolean;
|
|
182
|
+
status: 'invited' | 'already_member' | 'invalid_email' | 'error';
|
|
183
|
+
message?: string;
|
|
184
|
+
}>;
|
|
185
|
+
summary: {
|
|
186
|
+
total: number;
|
|
187
|
+
invited: number;
|
|
188
|
+
alreadyMembers: number;
|
|
189
|
+
invalid: number;
|
|
190
|
+
errors: number;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as data from '../data/index.js';
|
|
2
|
+
import * as plugins from '../plugins.js';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlcmludml0YXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0L3VzZXJpbnZpdGF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxJQUFJLE1BQU0sa0JBQWtCLENBQUM7QUFDekMsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUMifQ==
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy90YWdzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sZUFBZSxDQUFDIn0=
|
package/license
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Task Venture Capital GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@idp.global/interfaces",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist_ts/index.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"author": "Task Venture Capital GmbH",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@api.global/typedrequest-interfaces": "^3.0.19",
|
|
14
|
+
"@tsclass/tsclass": "^9.5.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@git.zone/tsbuild": "^4.4.1",
|
|
18
|
+
"@git.zone/tsdoc": "^2.0.5",
|
|
19
|
+
"@git.zone/tsrun": "^2.0.4",
|
|
20
|
+
"@git.zone/tstest": "^3.6.6",
|
|
21
|
+
"@types/node": "^25.9.0"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"ts/**/*",
|
|
25
|
+
"dist/**/*",
|
|
26
|
+
"dist_*/**/*",
|
|
27
|
+
"dist_ts/**/*",
|
|
28
|
+
"readme.md",
|
|
29
|
+
"changelog.md",
|
|
30
|
+
"license"
|
|
31
|
+
],
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+ssh://git@code.foss.global:29419/idp.global/interfaces.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://code.foss.global/idp.global/interfaces/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://code.foss.global/idp.global/interfaces#readme",
|
|
40
|
+
"keywords": [
|
|
41
|
+
"idp.global",
|
|
42
|
+
"interfaces",
|
|
43
|
+
"typedrequest",
|
|
44
|
+
"contracts",
|
|
45
|
+
"identity",
|
|
46
|
+
"oidc",
|
|
47
|
+
"typescript"
|
|
48
|
+
],
|
|
49
|
+
"browserslist": [
|
|
50
|
+
"last 1 chrome versions"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"test": "tstest test/ --verbose --logfile --timeout 60",
|
|
54
|
+
"build": "tsbuild tsfolders --allowimplicitany",
|
|
55
|
+
"buildDocs": "tsdoc"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# @idp.global/interfaces
|
|
2
|
+
|
|
3
|
+
Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.
|
|
4
|
+
|
|
5
|
+
This package contains only public data shapes, typed RPC request definitions, and shared tags used by the idp.global backend, browser client, CLI, web UI, and external integrations.
|
|
6
|
+
|
|
7
|
+
## Issue Reporting and Security
|
|
8
|
+
|
|
9
|
+
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @idp.global/interfaces
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Public API
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { data, request, tags } from '@idp.global/interfaces';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The root export exposes three namespaces:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
export {
|
|
27
|
+
data,
|
|
28
|
+
request,
|
|
29
|
+
tags,
|
|
30
|
+
};
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Data Contracts
|
|
34
|
+
|
|
35
|
+
Use `data` for durable and transportable idp.global object shapes.
|
|
36
|
+
|
|
37
|
+
Common data contracts include users, JWTs, login sessions, registration sessions, organizations, roles, invitations, billing plans, apps, app connections, activity logs, alerts, alert rules, abuse windows, passport devices, passport challenges, passport nonces, and OIDC payloads.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { data } from '@idp.global/interfaces';
|
|
41
|
+
|
|
42
|
+
const organization: data.IOrganization = {
|
|
43
|
+
id: 'org_1',
|
|
44
|
+
data: {
|
|
45
|
+
name: 'Acme',
|
|
46
|
+
slug: 'acme',
|
|
47
|
+
billingPlanId: 'plan_free',
|
|
48
|
+
roleIds: [],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## TypedRequest Contracts
|
|
54
|
+
|
|
55
|
+
Use `request` when registering handlers or creating typed clients with `@api.global/typedrequest` or `@api.global/typedsocket`.
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { request } from '@idp.global/interfaces';
|
|
59
|
+
|
|
60
|
+
type LoginRequest = request.IReq_LoginWithEmailOrUsernameAndPassword;
|
|
61
|
+
|
|
62
|
+
const payload: LoginRequest['request'] = {
|
|
63
|
+
username: 'user@example.com',
|
|
64
|
+
password: 'secret',
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Request groups cover login, registration, JWT refresh, user/session queries, organization membership, invitations, apps, billing, admin actions, alerts, passport device flows, password reset, device IDs, and OIDC authorization.
|
|
69
|
+
|
|
70
|
+
## Scope
|
|
71
|
+
|
|
72
|
+
This package is intentionally contract-only. It does not open sockets, store auth state, talk to MongoDB, send email, or implement authentication logic.
|
|
73
|
+
|
|
74
|
+
## Development
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pnpm install
|
|
78
|
+
pnpm run build
|
|
79
|
+
pnpm test
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## License and Legal Information
|
|
83
|
+
|
|
84
|
+
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](./license) file.
|
|
85
|
+
|
|
86
|
+
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
87
|
+
|
|
88
|
+
### Trademarks
|
|
89
|
+
|
|
90
|
+
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
|
91
|
+
|
|
92
|
+
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
|
93
|
+
|
|
94
|
+
### Company Information
|
|
95
|
+
|
|
96
|
+
Task Venture Capital GmbH
|
|
97
|
+
Registered at District Court Bremen HRB 35230 HB, Germany
|
|
98
|
+
|
|
99
|
+
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
|
100
|
+
|
|
101
|
+
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type TActivityAction =
|
|
2
|
+
| 'login'
|
|
3
|
+
| 'logout'
|
|
4
|
+
| 'session_created'
|
|
5
|
+
| 'session_revoked'
|
|
6
|
+
| 'passport_device_enrolled'
|
|
7
|
+
| 'passport_device_revoked'
|
|
8
|
+
| 'passport_challenge_approved'
|
|
9
|
+
| 'passport_challenge_rejected'
|
|
10
|
+
| 'org_created'
|
|
11
|
+
| 'org_updated'
|
|
12
|
+
| 'org_deleted'
|
|
13
|
+
| 'org_ownership_transferred'
|
|
14
|
+
| 'org_joined'
|
|
15
|
+
| 'org_left'
|
|
16
|
+
| 'role_changed'
|
|
17
|
+
| 'org_app_role_mappings_updated'
|
|
18
|
+
| 'profile_updated'
|
|
19
|
+
| 'app_connected'
|
|
20
|
+
| 'app_disconnected';
|
|
21
|
+
|
|
22
|
+
export interface IActivityLog {
|
|
23
|
+
id: string;
|
|
24
|
+
data: {
|
|
25
|
+
userId: string;
|
|
26
|
+
action: TActivityAction;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
metadata: {
|
|
29
|
+
ip?: string;
|
|
30
|
+
userAgent?: string;
|
|
31
|
+
targetId?: string;
|
|
32
|
+
targetType?: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}
|
package/ts/data/alert.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type TAlertSeverity = 'low' | 'medium' | 'high' | 'critical';
|
|
2
|
+
|
|
3
|
+
export type TAlertStatus = 'pending' | 'seen' | 'dismissed';
|
|
4
|
+
|
|
5
|
+
export type TAlertCategory = 'security' | 'admin' | 'system';
|
|
6
|
+
|
|
7
|
+
export type TAlertNotificationStatus = 'pending' | 'sent' | 'failed' | 'seen';
|
|
8
|
+
|
|
9
|
+
export interface IAlert {
|
|
10
|
+
id: string;
|
|
11
|
+
data: {
|
|
12
|
+
recipientUserId: string;
|
|
13
|
+
organizationId?: string;
|
|
14
|
+
category: TAlertCategory;
|
|
15
|
+
eventType: string;
|
|
16
|
+
severity: TAlertSeverity;
|
|
17
|
+
title: string;
|
|
18
|
+
body: string;
|
|
19
|
+
actorUserId?: string;
|
|
20
|
+
relatedEntityId?: string;
|
|
21
|
+
relatedEntityType?: string;
|
|
22
|
+
notification: {
|
|
23
|
+
hintId: string;
|
|
24
|
+
status: TAlertNotificationStatus;
|
|
25
|
+
attemptCount: number;
|
|
26
|
+
createdAt: number;
|
|
27
|
+
deliveredAt?: number | null;
|
|
28
|
+
seenAt?: number | null;
|
|
29
|
+
lastError?: string | null;
|
|
30
|
+
};
|
|
31
|
+
createdAt: number;
|
|
32
|
+
seenAt?: number | null;
|
|
33
|
+
dismissedAt?: number | null;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TAlertSeverity } from './alert.js';
|
|
2
|
+
|
|
3
|
+
export type TAlertRuleScope = 'global' | 'organization';
|
|
4
|
+
|
|
5
|
+
export type TAlertRuleRecipientMode = 'global_admins' | 'org_admins' | 'specific_users';
|
|
6
|
+
|
|
7
|
+
export interface IAlertRule {
|
|
8
|
+
id: string;
|
|
9
|
+
data: {
|
|
10
|
+
scope: TAlertRuleScope;
|
|
11
|
+
organizationId?: string;
|
|
12
|
+
eventType: string;
|
|
13
|
+
minimumSeverity: TAlertSeverity;
|
|
14
|
+
recipientMode: TAlertRuleRecipientMode;
|
|
15
|
+
recipientUserIds?: string[];
|
|
16
|
+
push: boolean;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
createdByUserId: string;
|
|
19
|
+
createdAt: number;
|
|
20
|
+
updatedAt: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
package/ts/data/app.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// App Types
|
|
2
|
+
export type TAppType = 'global' | 'partner' | 'custom_oidc';
|
|
3
|
+
export type TAppApprovalStatus = 'draft' | 'pending_review' | 'approved' | 'rejected' | 'suspended';
|
|
4
|
+
|
|
5
|
+
// OAuth Credentials
|
|
6
|
+
export interface IOAuthCredentials {
|
|
7
|
+
clientId: string;
|
|
8
|
+
clientSecretHash: string;
|
|
9
|
+
redirectUris: string[];
|
|
10
|
+
allowedScopes: string[];
|
|
11
|
+
grantTypes: ('authorization_code' | 'client_credentials' | 'refresh_token')[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Base app data shared by all app types
|
|
15
|
+
export interface IAppBaseData {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
logoUrl: string;
|
|
19
|
+
appUrl: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Global App - First-party apps managed by platform (foss.global, task.vc, etc.)
|
|
23
|
+
export interface IGlobalApp {
|
|
24
|
+
id: string;
|
|
25
|
+
type: 'global';
|
|
26
|
+
data: IAppBaseData & {
|
|
27
|
+
oauthCredentials: IOAuthCredentials;
|
|
28
|
+
isActive: boolean;
|
|
29
|
+
category: string;
|
|
30
|
+
createdAt: number;
|
|
31
|
+
createdByUserId: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Partner App - Third-party apps submitted to AppStore
|
|
36
|
+
export interface IPartnerApp {
|
|
37
|
+
id: string;
|
|
38
|
+
type: 'partner';
|
|
39
|
+
data: IAppBaseData & {
|
|
40
|
+
ownerOrganizationId: string;
|
|
41
|
+
oauthCredentials: IOAuthCredentials;
|
|
42
|
+
appStoreMetadata: {
|
|
43
|
+
shortDescription: string;
|
|
44
|
+
longDescription: string;
|
|
45
|
+
screenshots: string[];
|
|
46
|
+
category: string;
|
|
47
|
+
tags: string[];
|
|
48
|
+
pricing: { model: 'free' | 'paid' | 'freemium' };
|
|
49
|
+
};
|
|
50
|
+
approvalStatus: TAppApprovalStatus;
|
|
51
|
+
isPublished: boolean;
|
|
52
|
+
installCount: number;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Custom OIDC App - Organization-created OAuth clients
|
|
57
|
+
export interface ICustomOidcApp {
|
|
58
|
+
id: string;
|
|
59
|
+
type: 'custom_oidc';
|
|
60
|
+
data: IAppBaseData & {
|
|
61
|
+
ownerOrganizationId: string;
|
|
62
|
+
oauthCredentials: IOAuthCredentials;
|
|
63
|
+
oidcSettings: {
|
|
64
|
+
accessTokenLifetime: number; // seconds
|
|
65
|
+
refreshTokenLifetime: number; // seconds
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Union type for all app types
|
|
71
|
+
export type IApp = IGlobalApp | IPartnerApp | ICustomOidcApp;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Legacy interface for backwards compatibility with existing code
|
|
75
|
+
* that expects a flat app structure (e.g., idpclient, transfermanager)
|
|
76
|
+
*/
|
|
77
|
+
export interface IAppLegacy {
|
|
78
|
+
/**
|
|
79
|
+
* must be unique
|
|
80
|
+
*/
|
|
81
|
+
id: string;
|
|
82
|
+
/**
|
|
83
|
+
* should be unique
|
|
84
|
+
*/
|
|
85
|
+
name: string;
|
|
86
|
+
description: string;
|
|
87
|
+
logoUrl: string;
|
|
88
|
+
appUrl: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Storage interface for SmartData documents
|
|
93
|
+
* Uses the discriminated union approach with a 'type' field
|
|
94
|
+
*/
|
|
95
|
+
export interface IAppDocument {
|
|
96
|
+
id: string;
|
|
97
|
+
type: TAppType;
|
|
98
|
+
data: IGlobalApp['data'] | IPartnerApp['data'] | ICustomOidcApp['data'];
|
|
99
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TAppType } from './app.js';
|
|
2
|
+
import type { IAppRoleMapping } from './role.js';
|
|
3
|
+
|
|
4
|
+
export type TAppConnectionStatus = 'active' | 'disconnected';
|
|
5
|
+
|
|
6
|
+
export interface IAppConnection {
|
|
7
|
+
id: string;
|
|
8
|
+
data: {
|
|
9
|
+
organizationId: string;
|
|
10
|
+
appId: string;
|
|
11
|
+
appType: TAppType;
|
|
12
|
+
status: TAppConnectionStatus;
|
|
13
|
+
connectedAt: number;
|
|
14
|
+
connectedByUserId: string;
|
|
15
|
+
grantedScopes: string[];
|
|
16
|
+
roleMappings?: IAppRoleMapping[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
export type TSupportedCurrency = 'EUR';
|
|
4
|
+
|
|
5
|
+
export interface IBillableItem {
|
|
6
|
+
name: string;
|
|
7
|
+
monthlyPrice: number;
|
|
8
|
+
currency: TSupportedCurrency;
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
factoredOn30DayMonth: number;
|
|
12
|
+
quantity: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IBillingPlan {
|
|
16
|
+
id: string;
|
|
17
|
+
data: {
|
|
18
|
+
type: 'Paddle' | 'AppSumo' | 'FairUsageFree' | 'Enterprise' | 'Internal' | 'Testing';
|
|
19
|
+
proEnabled: boolean;
|
|
20
|
+
organizationId: string;
|
|
21
|
+
lastProcessed: number;
|
|
22
|
+
seats: number;
|
|
23
|
+
status: 'active' | 'activeOverdue' | 'pausedOverdue' | 'inactive' | 'suspended';
|
|
24
|
+
paddleData?: {
|
|
25
|
+
checkoutId: string;
|
|
26
|
+
};
|
|
27
|
+
alternativePaymentData?: {
|
|
28
|
+
enterprise: boolean;
|
|
29
|
+
appSumoCode: string;
|
|
30
|
+
};
|
|
31
|
+
nextBilling: {
|
|
32
|
+
items: Array<IBillableItem>;
|
|
33
|
+
method: 'paddle';
|
|
34
|
+
ontrack: boolean;
|
|
35
|
+
errorText?: string;
|
|
36
|
+
selectedBillingDate: number;
|
|
37
|
+
};
|
|
38
|
+
billingEvents: Array<{
|
|
39
|
+
timestamp: number;
|
|
40
|
+
amount: number;
|
|
41
|
+
currency: TSupportedCurrency;
|
|
42
|
+
billedItems: Array<IBillableItem>;
|
|
43
|
+
checkoutLink?: string;
|
|
44
|
+
}>;
|
|
45
|
+
communications: Array<any>;
|
|
46
|
+
};
|
|
47
|
+
}
|