@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/ts/readme.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# @idp.global/interfaces
|
|
2
|
+
|
|
3
|
+
Shared TypeScript contracts for the `idp.global` backend, browser client, CLI, and frontend.
|
|
4
|
+
|
|
5
|
+
Use this package when you want typed request/response payloads and shared data models for users, sessions, organizations, apps, billing, passport devices, alerts, and OIDC.
|
|
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
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { data, request, tags } from '@idp.global/interfaces';
|
|
21
|
+
|
|
22
|
+
const loginRequest: request.IReq_LoginWithEmailOrUsernameAndPassword['request'] = {
|
|
23
|
+
username: 'user@example.com',
|
|
24
|
+
password: 'secret',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const organization: data.IOrganization = {
|
|
28
|
+
id: 'org_1',
|
|
29
|
+
data: {
|
|
30
|
+
name: 'Acme',
|
|
31
|
+
slug: 'acme',
|
|
32
|
+
billingPlanId: 'plan_free',
|
|
33
|
+
roleIds: [],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Exports
|
|
39
|
+
|
|
40
|
+
### `data`
|
|
41
|
+
|
|
42
|
+
The `data` export includes types for:
|
|
43
|
+
|
|
44
|
+
- users
|
|
45
|
+
- organizations
|
|
46
|
+
- roles
|
|
47
|
+
- JWT payloads
|
|
48
|
+
- login sessions
|
|
49
|
+
- devices
|
|
50
|
+
- activity logs
|
|
51
|
+
- alerts and alert rules
|
|
52
|
+
- apps and app connections
|
|
53
|
+
- billing plans and Paddle checkout data
|
|
54
|
+
- passport devices, challenges, and nonces
|
|
55
|
+
- abuse windows
|
|
56
|
+
- OIDC data structures
|
|
57
|
+
- invitations
|
|
58
|
+
|
|
59
|
+
### `request`
|
|
60
|
+
|
|
61
|
+
The `request` export includes typed request contracts for:
|
|
62
|
+
|
|
63
|
+
- login, logout, refresh, password reset, and device attachment
|
|
64
|
+
- registration flow requests
|
|
65
|
+
- user and session queries
|
|
66
|
+
- organization CRUD-style requests
|
|
67
|
+
- invitations and membership changes
|
|
68
|
+
- app and admin actions
|
|
69
|
+
- billing and JWT validation support
|
|
70
|
+
- alert and passport approval flows
|
|
71
|
+
- OIDC authorization preparation and completion
|
|
72
|
+
|
|
73
|
+
### `tags`
|
|
74
|
+
|
|
75
|
+
Shared tag exports live under `tags/`.
|
|
76
|
+
|
|
77
|
+
## Layout
|
|
78
|
+
|
|
79
|
+
| Path | Purpose |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `data/index.ts` | Re-exports all shared data interfaces |
|
|
82
|
+
| `request/index.ts` | Re-exports all typed request contracts |
|
|
83
|
+
| `tags/index.ts` | Re-exports shared tags |
|
|
84
|
+
|
|
85
|
+
## Examples
|
|
86
|
+
|
|
87
|
+
### Login Contract
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
type TLogin = request.IReq_LoginWithEmailOrUsernameAndPassword;
|
|
91
|
+
|
|
92
|
+
const payload: TLogin['request'] = {
|
|
93
|
+
username: 'user@example.com',
|
|
94
|
+
password: 'secret',
|
|
95
|
+
};
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Session Contract
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
type TSessions = request.IReq_GetUserSessions['response']['sessions'];
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### OIDC Contract
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
type TUserInfo = data.IUserInfoResponse;
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Scope
|
|
111
|
+
|
|
112
|
+
This package is intentionally contract-only. It does not open sockets, store auth state, or perform HTTP/websocket communication by itself.
|
|
113
|
+
|
|
114
|
+
## License and Legal Information
|
|
115
|
+
|
|
116
|
+
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](../license) file.
|
|
117
|
+
|
|
118
|
+
**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.
|
|
119
|
+
|
|
120
|
+
### Trademarks
|
|
121
|
+
|
|
122
|
+
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.
|
|
123
|
+
|
|
124
|
+
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.
|
|
125
|
+
|
|
126
|
+
### Company Information
|
|
127
|
+
|
|
128
|
+
Task Venture Capital GmbH
|
|
129
|
+
Registered at District Court Bremen HRB 35230 HB, Germany
|
|
130
|
+
|
|
131
|
+
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
|
132
|
+
|
|
133
|
+
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,130 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import * as data from '../data/index.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Check if the current user is a global admin
|
|
6
|
+
*/
|
|
7
|
+
export interface IReq_CheckGlobalAdmin
|
|
8
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
9
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
10
|
+
IReq_CheckGlobalAdmin
|
|
11
|
+
> {
|
|
12
|
+
method: 'checkGlobalAdmin';
|
|
13
|
+
request: {
|
|
14
|
+
jwt: string;
|
|
15
|
+
};
|
|
16
|
+
response: {
|
|
17
|
+
isGlobalAdmin: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get all global apps with statistics (admin only)
|
|
23
|
+
*/
|
|
24
|
+
export interface IReq_GetGlobalAppStats
|
|
25
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
26
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
27
|
+
IReq_GetGlobalAppStats
|
|
28
|
+
> {
|
|
29
|
+
method: 'getGlobalAppStats';
|
|
30
|
+
request: {
|
|
31
|
+
jwt: string;
|
|
32
|
+
};
|
|
33
|
+
response: {
|
|
34
|
+
apps: Array<{
|
|
35
|
+
app: data.IGlobalApp;
|
|
36
|
+
connectionCount: number;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Create a new global app (admin only)
|
|
43
|
+
*/
|
|
44
|
+
export interface IReq_CreateGlobalApp
|
|
45
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
46
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
47
|
+
IReq_CreateGlobalApp
|
|
48
|
+
> {
|
|
49
|
+
method: 'createGlobalApp';
|
|
50
|
+
request: {
|
|
51
|
+
jwt: string;
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
logoUrl: string;
|
|
55
|
+
appUrl: string;
|
|
56
|
+
category: string;
|
|
57
|
+
redirectUris: string[];
|
|
58
|
+
allowedScopes: string[];
|
|
59
|
+
};
|
|
60
|
+
response: {
|
|
61
|
+
app: data.IGlobalApp;
|
|
62
|
+
clientSecret: string; // Only shown once on creation
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Update an existing global app (admin only)
|
|
68
|
+
*/
|
|
69
|
+
export interface IReq_UpdateGlobalApp
|
|
70
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
71
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
72
|
+
IReq_UpdateGlobalApp
|
|
73
|
+
> {
|
|
74
|
+
method: 'updateGlobalApp';
|
|
75
|
+
request: {
|
|
76
|
+
jwt: string;
|
|
77
|
+
appId: string;
|
|
78
|
+
updates: {
|
|
79
|
+
name?: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
logoUrl?: string;
|
|
82
|
+
appUrl?: string;
|
|
83
|
+
category?: string;
|
|
84
|
+
isActive?: boolean;
|
|
85
|
+
redirectUris?: string[];
|
|
86
|
+
allowedScopes?: string[];
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
response: {
|
|
90
|
+
app: data.IGlobalApp;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Delete a global app (admin only)
|
|
96
|
+
*/
|
|
97
|
+
export interface IReq_DeleteGlobalApp
|
|
98
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
99
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
100
|
+
IReq_DeleteGlobalApp
|
|
101
|
+
> {
|
|
102
|
+
method: 'deleteGlobalApp';
|
|
103
|
+
request: {
|
|
104
|
+
jwt: string;
|
|
105
|
+
appId: string;
|
|
106
|
+
};
|
|
107
|
+
response: {
|
|
108
|
+
success: boolean;
|
|
109
|
+
disconnectedOrganizations: number;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Regenerate OAuth credentials for a global app (admin only)
|
|
115
|
+
*/
|
|
116
|
+
export interface IReq_RegenerateAppCredentials
|
|
117
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
118
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
119
|
+
IReq_RegenerateAppCredentials
|
|
120
|
+
> {
|
|
121
|
+
method: 'regenerateAppCredentials';
|
|
122
|
+
request: {
|
|
123
|
+
jwt: string;
|
|
124
|
+
appId: string;
|
|
125
|
+
};
|
|
126
|
+
response: {
|
|
127
|
+
clientId: string;
|
|
128
|
+
clientSecret: string; // Only shown once
|
|
129
|
+
};
|
|
130
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import * as data from '../data/index.js';
|
|
3
|
+
import type { IPassportDeviceSignedRequest } from './passport.js';
|
|
4
|
+
|
|
5
|
+
export interface IReq_ListPassportAlerts
|
|
6
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
7
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
8
|
+
IReq_ListPassportAlerts
|
|
9
|
+
> {
|
|
10
|
+
method: 'listPassportAlerts';
|
|
11
|
+
request: IPassportDeviceSignedRequest & {
|
|
12
|
+
includeDismissed?: boolean;
|
|
13
|
+
};
|
|
14
|
+
response: {
|
|
15
|
+
alerts: data.IAlert[];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface IReq_GetPassportAlertByHint
|
|
20
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
21
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
22
|
+
IReq_GetPassportAlertByHint
|
|
23
|
+
> {
|
|
24
|
+
method: 'getPassportAlertByHint';
|
|
25
|
+
request: IPassportDeviceSignedRequest & {
|
|
26
|
+
hintId: string;
|
|
27
|
+
};
|
|
28
|
+
response: {
|
|
29
|
+
alert?: data.IAlert;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface IReq_MarkPassportAlertSeen
|
|
34
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
35
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
36
|
+
IReq_MarkPassportAlertSeen
|
|
37
|
+
> {
|
|
38
|
+
method: 'markPassportAlertSeen';
|
|
39
|
+
request: IPassportDeviceSignedRequest & {
|
|
40
|
+
hintId: string;
|
|
41
|
+
};
|
|
42
|
+
response: {
|
|
43
|
+
success: boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface IReq_DismissPassportAlert
|
|
48
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
49
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
50
|
+
IReq_DismissPassportAlert
|
|
51
|
+
> {
|
|
52
|
+
method: 'dismissPassportAlert';
|
|
53
|
+
request: IPassportDeviceSignedRequest & {
|
|
54
|
+
hintId: string;
|
|
55
|
+
};
|
|
56
|
+
response: {
|
|
57
|
+
success: boolean;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface IReq_UpsertAlertRule
|
|
62
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
63
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
64
|
+
IReq_UpsertAlertRule
|
|
65
|
+
> {
|
|
66
|
+
method: 'upsertAlertRule';
|
|
67
|
+
request: {
|
|
68
|
+
jwt: string;
|
|
69
|
+
ruleId?: string;
|
|
70
|
+
scope: data.TAlertRuleScope;
|
|
71
|
+
organizationId?: string;
|
|
72
|
+
eventType: string;
|
|
73
|
+
minimumSeverity: data.TAlertSeverity;
|
|
74
|
+
recipientMode: data.TAlertRuleRecipientMode;
|
|
75
|
+
recipientUserIds?: string[];
|
|
76
|
+
push: boolean;
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
};
|
|
79
|
+
response: {
|
|
80
|
+
rule: data.IAlertRule;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface IReq_GetAlertRules
|
|
85
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
86
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
87
|
+
IReq_GetAlertRules
|
|
88
|
+
> {
|
|
89
|
+
method: 'getAlertRules';
|
|
90
|
+
request: {
|
|
91
|
+
jwt: string;
|
|
92
|
+
scope?: data.TAlertRuleScope;
|
|
93
|
+
organizationId?: string;
|
|
94
|
+
};
|
|
95
|
+
response: {
|
|
96
|
+
rules: data.IAlertRule[];
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface IReq_DeleteAlertRule
|
|
101
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
102
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
103
|
+
IReq_DeleteAlertRule
|
|
104
|
+
> {
|
|
105
|
+
method: 'deleteAlertRule';
|
|
106
|
+
request: {
|
|
107
|
+
jwt: string;
|
|
108
|
+
ruleId: string;
|
|
109
|
+
};
|
|
110
|
+
response: {
|
|
111
|
+
success: boolean;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as data from '../data/index.js';
|
|
2
|
+
import * as plugins from '../plugins.js';
|
|
3
|
+
|
|
4
|
+
// Get all global apps
|
|
5
|
+
export interface IReq_GetGlobalApps
|
|
6
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
7
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
8
|
+
IReq_GetGlobalApps
|
|
9
|
+
> {
|
|
10
|
+
method: 'getGlobalApps';
|
|
11
|
+
request: {
|
|
12
|
+
jwt: string;
|
|
13
|
+
};
|
|
14
|
+
response: {
|
|
15
|
+
apps: data.IGlobalApp[];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Get app connections for an organization
|
|
20
|
+
export interface IReq_GetAppConnections
|
|
21
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
22
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
23
|
+
IReq_GetAppConnections
|
|
24
|
+
> {
|
|
25
|
+
method: 'getAppConnections';
|
|
26
|
+
request: {
|
|
27
|
+
jwt: string;
|
|
28
|
+
organizationId: string;
|
|
29
|
+
};
|
|
30
|
+
response: {
|
|
31
|
+
connections: data.IAppConnection[];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Connect/disconnect an app for an organization
|
|
36
|
+
export interface IReq_ToggleAppConnection
|
|
37
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
38
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
39
|
+
IReq_ToggleAppConnection
|
|
40
|
+
> {
|
|
41
|
+
method: 'toggleAppConnection';
|
|
42
|
+
request: {
|
|
43
|
+
jwt: string;
|
|
44
|
+
organizationId: string;
|
|
45
|
+
appId: string;
|
|
46
|
+
action: 'connect' | 'disconnect';
|
|
47
|
+
};
|
|
48
|
+
response: {
|
|
49
|
+
success: boolean;
|
|
50
|
+
connection?: data.IAppConnection;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface IReq_UpdateAppRoleMappings
|
|
55
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
56
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
57
|
+
IReq_UpdateAppRoleMappings
|
|
58
|
+
> {
|
|
59
|
+
method: 'updateAppRoleMappings';
|
|
60
|
+
request: {
|
|
61
|
+
jwt: string;
|
|
62
|
+
organizationId: string;
|
|
63
|
+
appId: string;
|
|
64
|
+
roleMappings: data.IAppRoleMapping[];
|
|
65
|
+
};
|
|
66
|
+
response: {
|
|
67
|
+
success: boolean;
|
|
68
|
+
connection: data.IAppConnection;
|
|
69
|
+
message?: string;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import { type IUser, type IRole } from '../data/index.js';
|
|
3
|
+
import { type TOidcScope } from '../data/index.js';
|
|
4
|
+
|
|
5
|
+
export interface IReq_InternalAuthorization
|
|
6
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
7
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
8
|
+
IReq_InternalAuthorization
|
|
9
|
+
> {
|
|
10
|
+
method: '';
|
|
11
|
+
request: {
|
|
12
|
+
accountData: IUser;
|
|
13
|
+
jwt: string;
|
|
14
|
+
};
|
|
15
|
+
response: {
|
|
16
|
+
accountData: IUser;
|
|
17
|
+
jwt: string;
|
|
18
|
+
relevantRoles: IRole[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IReq_CompleteOidcAuthorization
|
|
23
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
24
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
25
|
+
IReq_CompleteOidcAuthorization
|
|
26
|
+
> {
|
|
27
|
+
method: 'completeOidcAuthorization';
|
|
28
|
+
request: {
|
|
29
|
+
jwt: string;
|
|
30
|
+
clientId: string;
|
|
31
|
+
redirectUri: string;
|
|
32
|
+
scope: string;
|
|
33
|
+
state: string;
|
|
34
|
+
prompt?: 'none' | 'login' | 'consent';
|
|
35
|
+
codeChallenge?: string;
|
|
36
|
+
codeChallengeMethod?: 'S256';
|
|
37
|
+
nonce?: string;
|
|
38
|
+
consentApproved?: boolean;
|
|
39
|
+
};
|
|
40
|
+
response: {
|
|
41
|
+
code: string;
|
|
42
|
+
redirectUrl: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface IReq_PrepareOidcAuthorization
|
|
47
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
48
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
49
|
+
IReq_PrepareOidcAuthorization
|
|
50
|
+
> {
|
|
51
|
+
method: 'prepareOidcAuthorization';
|
|
52
|
+
request: {
|
|
53
|
+
jwt: string;
|
|
54
|
+
clientId: string;
|
|
55
|
+
redirectUri: string;
|
|
56
|
+
scope: string;
|
|
57
|
+
state: string;
|
|
58
|
+
prompt?: 'none' | 'login' | 'consent';
|
|
59
|
+
codeChallenge?: string;
|
|
60
|
+
codeChallengeMethod?: 'S256';
|
|
61
|
+
nonce?: string;
|
|
62
|
+
};
|
|
63
|
+
response: {
|
|
64
|
+
status: 'ready' | 'consent_required';
|
|
65
|
+
clientId: string;
|
|
66
|
+
appName: string;
|
|
67
|
+
appUrl: string;
|
|
68
|
+
logoUrl?: string;
|
|
69
|
+
requestedScopes: TOidcScope[];
|
|
70
|
+
grantedScopes: TOidcScope[];
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import * as data from '../data/index.js';
|
|
3
|
+
|
|
4
|
+
export interface IReq_UpdatePaymentMethod
|
|
5
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
6
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
7
|
+
IReq_UpdatePaymentMethod
|
|
8
|
+
> {
|
|
9
|
+
method: 'updatePaymentMethod';
|
|
10
|
+
request: {
|
|
11
|
+
jwtString: string;
|
|
12
|
+
orgId: string;
|
|
13
|
+
paddle?: {
|
|
14
|
+
checkoutId: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
response: {
|
|
18
|
+
billingPlan: plugins.tsclass.typeFest.PartialDeep<data.IBillingPlan>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* allows getting the billing plan for a user
|
|
24
|
+
*/
|
|
25
|
+
export interface IReq_GetBillingPlan
|
|
26
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
27
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
28
|
+
IReq_GetBillingPlan
|
|
29
|
+
> {
|
|
30
|
+
method: 'getBillingPlan';
|
|
31
|
+
request: {
|
|
32
|
+
jwtString: string;
|
|
33
|
+
orgId: string;
|
|
34
|
+
billingPlanId: string;
|
|
35
|
+
};
|
|
36
|
+
response: {
|
|
37
|
+
billingPlan: data.IBillingPlan;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Returns Paddle configuration from environment variables
|
|
43
|
+
*/
|
|
44
|
+
export interface IReq_GetPaddleConfig
|
|
45
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
46
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
47
|
+
IReq_GetPaddleConfig
|
|
48
|
+
> {
|
|
49
|
+
method: 'getPaddleConfig';
|
|
50
|
+
request: {};
|
|
51
|
+
response: {
|
|
52
|
+
paddleToken: string;
|
|
53
|
+
paddlePriceId: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './admin.js';
|
|
2
|
+
export * from './apitoken.js';
|
|
3
|
+
export * from './alert.js';
|
|
4
|
+
export * from './app.js';
|
|
5
|
+
export * from './authorization.js';
|
|
6
|
+
export * from './billingplan.js';
|
|
7
|
+
export * from './jwt.js';
|
|
8
|
+
export * from './login.js';
|
|
9
|
+
export * from './organization.js';
|
|
10
|
+
export * from './passport.js';
|
|
11
|
+
export * from './plan.js';
|
|
12
|
+
export * from './registration.js';
|
|
13
|
+
export * from './user.js';
|
|
14
|
+
export * from './userinvitation.js';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as data from '../data/index.js';
|
|
2
|
+
import * as plugins from '../plugins.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Request to get the public key for JWT validation.
|
|
6
|
+
*
|
|
7
|
+
* **Direction:** Client → idp.global
|
|
8
|
+
* **Requester:** Backend services that need to verify JWTs
|
|
9
|
+
* **Handler:** idp.global
|
|
10
|
+
*
|
|
11
|
+
* Use this to fetch the current public key for verifying JWT signatures.
|
|
12
|
+
* The backend token authenticates the requesting service.
|
|
13
|
+
*/
|
|
14
|
+
export interface IReq_GetPublicKeyForValidation
|
|
15
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
16
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
17
|
+
IReq_GetPublicKeyForValidation
|
|
18
|
+
> {
|
|
19
|
+
method: 'getPublicKeyForValidation';
|
|
20
|
+
request: {
|
|
21
|
+
backendToken: string;
|
|
22
|
+
};
|
|
23
|
+
response: {
|
|
24
|
+
publicKeyPem: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Push public key to connected backend services for JWT validation.
|
|
30
|
+
*
|
|
31
|
+
* **Direction:** idp.global → Client
|
|
32
|
+
* **Requester:** idp.global (pushes when the JWT signing key rotates)
|
|
33
|
+
* **Handler:** Backend services - must register a TypedHandler for this method
|
|
34
|
+
*
|
|
35
|
+
* Backend services should register a handler using `IdpClient.onPublicKeyPush()`
|
|
36
|
+
* to receive key rotation updates and update their local key cache.
|
|
37
|
+
*/
|
|
38
|
+
export interface IReq_PushPublicKeyForValidation
|
|
39
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
40
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
41
|
+
IReq_PushPublicKeyForValidation
|
|
42
|
+
> {
|
|
43
|
+
method: 'pushPublicKeyForValidation';
|
|
44
|
+
request: {
|
|
45
|
+
publicKeyPem: string;
|
|
46
|
+
};
|
|
47
|
+
response: {};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Push or get JWT ID blocklist for revoked tokens.
|
|
52
|
+
*
|
|
53
|
+
* **Bidirectional:**
|
|
54
|
+
* - **GET direction:** Client → idp.global - Client requests current blocklist
|
|
55
|
+
* - **PUSH direction:** idp.global → Client - Server pushes new blocklisted IDs
|
|
56
|
+
*
|
|
57
|
+
* **For GET (client fires):**
|
|
58
|
+
* - Fire with empty/undefined `blockedJwtIds` to request the full blocklist
|
|
59
|
+
* - Response contains the complete list of blocked JWT IDs
|
|
60
|
+
* - Use `IdpClient.requests.getJwtIdBlocklist` for this direction
|
|
61
|
+
*
|
|
62
|
+
* **For PUSH (idp.global fires):**
|
|
63
|
+
* - idp.global sends newly blocklisted JWT IDs to connected clients
|
|
64
|
+
* - Clients must register a handler using `IdpClient.onBlocklistPush()`
|
|
65
|
+
* - Store received IDs locally to reject revoked tokens
|
|
66
|
+
*/
|
|
67
|
+
export interface IReq_PushOrGetJwtIdBlocklist
|
|
68
|
+
extends plugins.typedRequestInterfaces.implementsTR<
|
|
69
|
+
plugins.typedRequestInterfaces.ITypedRequest,
|
|
70
|
+
IReq_PushOrGetJwtIdBlocklist
|
|
71
|
+
> {
|
|
72
|
+
method: 'pushOrGetJwtIdBlocklist';
|
|
73
|
+
request: {
|
|
74
|
+
blockedJwtIds?: string[];
|
|
75
|
+
};
|
|
76
|
+
response: {
|
|
77
|
+
blockedJwtIds?: string[];
|
|
78
|
+
};
|
|
79
|
+
}
|