@enterprisestandard/react 0.0.5-beta.20251125.1 → 0.0.5-beta.20260114.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/dist/group-store.d.ts +164 -0
- package/dist/group-store.d.ts.map +1 -0
- package/dist/iam.d.ts +205 -5
- package/dist/iam.d.ts.map +1 -1
- package/dist/index.d.ts +41 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2837 -555
- package/dist/index.js.map +17 -9
- package/dist/server.d.ts +6 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/session-store.d.ts +3 -3
- package/dist/session-store.d.ts.map +1 -1
- package/dist/sso.d.ts +58 -10
- package/dist/sso.d.ts.map +1 -1
- package/dist/tenant-server.d.ts +8 -0
- package/dist/tenant-server.d.ts.map +1 -0
- package/dist/tenant.d.ts +280 -0
- package/dist/tenant.d.ts.map +1 -0
- package/dist/types/base-user.d.ts +27 -0
- package/dist/types/base-user.d.ts.map +1 -0
- package/dist/types/enterprise-user.d.ts +158 -0
- package/dist/types/enterprise-user.d.ts.map +1 -0
- package/dist/types/oidc-schema.d.ts.map +1 -0
- package/dist/{scim-schema.d.ts → types/scim-schema.d.ts} +66 -3
- package/dist/types/scim-schema.d.ts.map +1 -0
- package/dist/types/standard-schema.d.ts.map +1 -0
- package/dist/types/user.d.ts +41 -0
- package/dist/types/user.d.ts.map +1 -0
- package/dist/types/workload-schema.d.ts +106 -0
- package/dist/types/workload-schema.d.ts.map +1 -0
- package/dist/ui/sso-provider.d.ts +3 -3
- package/dist/ui/sso-provider.d.ts.map +1 -1
- package/dist/user-store.d.ts +161 -0
- package/dist/user-store.d.ts.map +1 -0
- package/dist/workload-server.d.ts +126 -0
- package/dist/workload-server.d.ts.map +1 -0
- package/dist/workload-token-store.d.ts +187 -0
- package/dist/workload-token-store.d.ts.map +1 -0
- package/dist/workload.d.ts +227 -0
- package/dist/workload.d.ts.map +1 -0
- package/package.json +1 -2
- package/dist/enterprise-user.d.ts +0 -126
- package/dist/enterprise-user.d.ts.map +0 -1
- package/dist/oidc-schema.d.ts.map +0 -1
- package/dist/scim-schema.d.ts.map +0 -1
- package/dist/standard-schema.d.ts.map +0 -1
- /package/dist/{oidc-schema.d.ts → types/oidc-schema.d.ts} +0 -0
- /package/dist/{standard-schema.d.ts → types/standard-schema.d.ts} +0 -0
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { ESConfig, LoginConfig
|
|
2
|
-
export declare function getUser(request: Request, config?: ESConfig): Promise<import("
|
|
3
|
-
export declare function getRequiredUser(request: Request, config?: ESConfig): Promise<import("
|
|
1
|
+
import type { ESConfig, LoginConfig } from './sso';
|
|
2
|
+
export declare function getUser(request: Request, config?: ESConfig): Promise<import(".").User | undefined>;
|
|
3
|
+
export declare function getRequiredUser(request: Request, config?: ESConfig): Promise<import(".").User>;
|
|
4
4
|
export declare function initiateLogin(config: LoginConfig): Promise<Response>;
|
|
5
5
|
export declare function callback(request: Request, config?: ESConfig): Promise<Response>;
|
|
6
|
-
export declare function handler(request: Request, config?:
|
|
6
|
+
export declare function handler(request: Request, config?: ESConfig): Promise<Response>;
|
|
7
|
+
export * from './tenant-server';
|
|
8
|
+
export * from './workload-server';
|
|
7
9
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAoB,MAAM,OAAO,CAAC;AAoBrE,wBAAsB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,yCAEhE;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,6BAIxE;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,WAAW,qBAItD;AAED,wBAAsB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,qBAIjE;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,qBAIhE;AAGD,cAAc,iBAAiB,CAAC;AAEhC,cAAc,mBAAmB,CAAC"}
|
package/dist/session-store.d.ts
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
*
|
|
66
66
|
* @template TExtended - Type-safe custom data that consumers can add to sessions
|
|
67
67
|
*/
|
|
68
|
-
export type Session<TExtended =
|
|
68
|
+
export type Session<TExtended = {}> = {
|
|
69
69
|
/**
|
|
70
70
|
* Session ID from the Identity Provider (from `sid` claim in ID token).
|
|
71
71
|
* This is the unique identifier for the session.
|
|
@@ -118,7 +118,7 @@ export type Session<TExtended = Record<string, never>> = {
|
|
|
118
118
|
* }
|
|
119
119
|
* ```
|
|
120
120
|
*/
|
|
121
|
-
export interface SessionStore<TExtended =
|
|
121
|
+
export interface SessionStore<TExtended = {}> {
|
|
122
122
|
/**
|
|
123
123
|
* Create a new session in the store.
|
|
124
124
|
*
|
|
@@ -169,7 +169,7 @@ export interface SessionStore<TExtended = Record<string, never>> {
|
|
|
169
169
|
*
|
|
170
170
|
* @template TExtended - Type-safe custom data that consumers can add to sessions
|
|
171
171
|
*/
|
|
172
|
-
export declare class InMemorySessionStore<TExtended =
|
|
172
|
+
export declare class InMemorySessionStore<TExtended = {}> implements SessionStore<TExtended> {
|
|
173
173
|
private sessions;
|
|
174
174
|
create(session: Session<TExtended>): Promise<void>;
|
|
175
175
|
get(sid: string): Promise<Session<TExtended> | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../src/session-store.ts"],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;;;GAgBG;AACH,qBAAa,oBAAoB,CAAC,SAAS,GAAG,EAAE,CAAE,YAAW,YAAY,CAAC,SAAS,CAAC;IAClF,OAAO,CAAC,QAAQ,CAAyC;IAEnD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQlD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAIpD,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAWrE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzC"}
|
package/dist/sso.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import type { EnterpriseStandard
|
|
2
|
-
import type { IdTokenClaims, OidcCallbackParams, TokenResponse } from './oidc-schema';
|
|
3
|
-
import type { StandardSchemaV1 } from './standard-schema';
|
|
1
|
+
import type { EnterpriseStandard } from '.';
|
|
4
2
|
import type { SessionStore } from './session-store';
|
|
5
|
-
|
|
3
|
+
import type { IdTokenClaims, OidcCallbackParams, TokenResponse } from './types/oidc-schema';
|
|
4
|
+
import type { StandardSchemaV1 } from './types/standard-schema';
|
|
5
|
+
import type { User } from './types/user';
|
|
6
|
+
import type { UserStore } from './user-store';
|
|
7
|
+
export type SSOConfig<TSessionData = {}, TUserData = {}> = {
|
|
6
8
|
authority?: string;
|
|
7
9
|
token_url?: string;
|
|
8
10
|
authorization_url?: string;
|
|
9
11
|
client_id?: string;
|
|
12
|
+
client_secret?: string;
|
|
10
13
|
redirect_uri?: string;
|
|
11
14
|
response_type?: 'code';
|
|
12
15
|
scope?: string;
|
|
@@ -19,6 +22,50 @@ export type SSOConfig<TSessionData = Record<string, never>> = {
|
|
|
19
22
|
end_session_endpoint?: string;
|
|
20
23
|
revocation_endpoint?: string;
|
|
21
24
|
session_store?: SessionStore<TSessionData>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional handler defaults. These are merged with per-call overrides in
|
|
27
|
+
* `sso.handler`, with per-call values taking precedence.
|
|
28
|
+
*/
|
|
29
|
+
loginUrl?: string;
|
|
30
|
+
userUrl?: string;
|
|
31
|
+
errorUrl?: string;
|
|
32
|
+
landingUrl?: string;
|
|
33
|
+
tokenUrl?: string;
|
|
34
|
+
refreshUrl?: string;
|
|
35
|
+
jwksUrl?: string;
|
|
36
|
+
logoutUrl?: string;
|
|
37
|
+
logoutBackChannelUrl?: string;
|
|
38
|
+
validation?: {
|
|
39
|
+
callbackParams?: StandardSchemaV1<unknown, OidcCallbackParams>;
|
|
40
|
+
idTokenClaims?: StandardSchemaV1<unknown, IdTokenClaims>;
|
|
41
|
+
tokenResponse?: StandardSchemaV1<unknown, TokenResponse>;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Optional user store for persisting user profiles from SSO authentication.
|
|
45
|
+
* When configured, users are automatically stored/updated on each login.
|
|
46
|
+
*/
|
|
47
|
+
user_store?: UserStore<TUserData>;
|
|
48
|
+
/**
|
|
49
|
+
* Enable Just-In-Time (JIT) user provisioning.
|
|
50
|
+
* When enabled, new users are automatically created in the user_store on their first login.
|
|
51
|
+
* When disabled (default), only existing users in the user_store are updated on login.
|
|
52
|
+
* Requires user_store to be configured.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
enable_jit_user_provisioning?: boolean;
|
|
56
|
+
};
|
|
57
|
+
type SSOConfigWithDefaults<TSessionData = {}, TUserData = {}> = SSOConfig<TSessionData, TUserData> & {
|
|
58
|
+
authority: string;
|
|
59
|
+
token_url: string;
|
|
60
|
+
authorization_url: string;
|
|
61
|
+
client_id: string;
|
|
62
|
+
redirect_uri: string;
|
|
63
|
+
response_type: 'code';
|
|
64
|
+
scope: string;
|
|
65
|
+
cookies_secure: boolean;
|
|
66
|
+
cookies_same_site: string;
|
|
67
|
+
cookies_prefix: string;
|
|
68
|
+
cookies_path: string;
|
|
22
69
|
};
|
|
23
70
|
export type ESConfig = {
|
|
24
71
|
es?: EnterpriseStandard;
|
|
@@ -43,14 +90,15 @@ export type SSOHandlerConfig = {
|
|
|
43
90
|
tokenResponse?: StandardSchemaV1<unknown, TokenResponse>;
|
|
44
91
|
};
|
|
45
92
|
} & ESConfig;
|
|
46
|
-
export type SSO<
|
|
47
|
-
getUser: (request: Request) => Promise<
|
|
48
|
-
getRequiredUser: (request: Request) => Promise<
|
|
93
|
+
export type SSO<TSessionData = {}, TUserData = {}> = SSOConfigWithDefaults<TSessionData, TUserData> & {
|
|
94
|
+
getUser: (request: Request) => Promise<User | undefined>;
|
|
95
|
+
getRequiredUser: (request: Request) => Promise<User>;
|
|
49
96
|
getJwt: (request: Request) => Promise<string | undefined>;
|
|
50
|
-
initiateLogin: (config: LoginConfig) => Promise<Response>;
|
|
97
|
+
initiateLogin: (config: LoginConfig, requestUrl?: string) => Promise<Response>;
|
|
51
98
|
logout: (request: Request, config?: LoginConfig) => Promise<Response>;
|
|
52
99
|
callbackHandler: (request: Request) => Promise<Response>;
|
|
53
|
-
handler: (request: Request
|
|
100
|
+
handler: (request: Request) => Promise<Response>;
|
|
54
101
|
};
|
|
55
|
-
export declare function sso<TSessionData =
|
|
102
|
+
export declare function sso<TSessionData = {}, TUserData = {}>(config?: SSOConfig<TSessionData, TUserData>): SSO<TSessionData, TUserData>;
|
|
103
|
+
export {};
|
|
56
104
|
//# sourceMappingURL=sso.d.ts.map
|
package/dist/sso.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../src/sso.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../src/sso.ts"],"names":[],"mappings":"AAAA,OAAO,KA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,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtE,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzD,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAClD,CAAC;AAIJ,wBAAgB,GAAG,CAAC,YAAY,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EACnD,MAAM,CAAC,EAAE,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,GAC1C,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CA27B9B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side helper functions for tenant management.
|
|
3
|
+
* These functions provide a convenient way to parse tenant requests
|
|
4
|
+
* and send webhook updates.
|
|
5
|
+
*/
|
|
6
|
+
export type { CreateTenantRequest, CreateTenantResponse, EnvironmentType, TenantStatus, TenantWebhookPayload, } from './tenant';
|
|
7
|
+
export { parseTenantRequest, sendTenantWebhook, TenantRequestError } from './tenant';
|
|
8
|
+
//# sourceMappingURL=tenant-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-server.d.ts","sourceRoot":"","sources":["../src/tenant-server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/tenant.d.ts
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tenant Management SDK
|
|
3
|
+
*
|
|
4
|
+
* Provides helper functions for applications to implement tenant creation endpoints
|
|
5
|
+
* that ESVS can test. Supports both synchronous (201) and asynchronous (202)
|
|
6
|
+
* tenant creation with webhook-based status updates.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Environment type for tenant creation
|
|
10
|
+
*/
|
|
11
|
+
export type EnvironmentType = 'POC' | 'DEV' | 'QA' | 'PROD';
|
|
12
|
+
/**
|
|
13
|
+
* Status of tenant creation process
|
|
14
|
+
*/
|
|
15
|
+
export type TenantStatus = 'pending' | 'processing' | 'completed' | 'failed';
|
|
16
|
+
/**
|
|
17
|
+
* Request payload from ESVS for creating a tenant
|
|
18
|
+
*/
|
|
19
|
+
export interface CreateTenantRequest {
|
|
20
|
+
/**
|
|
21
|
+
* Required app identifier to use when initializing EnterpriseStandard for this tenant.
|
|
22
|
+
* This is the primary identifier for tenant management. A company can have multiple
|
|
23
|
+
* applications (e.g., one instance on the east coast, one on the west coast).
|
|
24
|
+
*/
|
|
25
|
+
appId: string;
|
|
26
|
+
/**
|
|
27
|
+
* Company ID (used for reporting purposes only, not for tenant identification)
|
|
28
|
+
*/
|
|
29
|
+
companyId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Company Name
|
|
32
|
+
*/
|
|
33
|
+
companyName: string;
|
|
34
|
+
/**
|
|
35
|
+
* Environment Type (POC, DEV, QA, PROD)
|
|
36
|
+
*/
|
|
37
|
+
environmentType: EnvironmentType;
|
|
38
|
+
/**
|
|
39
|
+
* Email (The email or distribution list used to communicate to the team)
|
|
40
|
+
*/
|
|
41
|
+
email: string;
|
|
42
|
+
/**
|
|
43
|
+
* Webhook URL where the application can send updates around the creation of the tenant
|
|
44
|
+
*/
|
|
45
|
+
webhookUrl: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Response payload for tenant creation
|
|
49
|
+
*/
|
|
50
|
+
export interface CreateTenantResponse {
|
|
51
|
+
/**
|
|
52
|
+
* URL that the tenant will be available at
|
|
53
|
+
*/
|
|
54
|
+
tenantUrl: string;
|
|
55
|
+
/**
|
|
56
|
+
* Current status of tenant creation
|
|
57
|
+
*/
|
|
58
|
+
status: TenantStatus;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Payload sent to webhook URL for status updates
|
|
62
|
+
*/
|
|
63
|
+
export interface TenantWebhookPayload {
|
|
64
|
+
/**
|
|
65
|
+
* Company ID
|
|
66
|
+
*/
|
|
67
|
+
companyId: string;
|
|
68
|
+
/**
|
|
69
|
+
* Current status of tenant creation
|
|
70
|
+
*/
|
|
71
|
+
status: TenantStatus;
|
|
72
|
+
/**
|
|
73
|
+
* URL that the tenant will be available at (provided once creation completes)
|
|
74
|
+
*/
|
|
75
|
+
tenantUrl?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Error message (only present if status is "failed")
|
|
78
|
+
*/
|
|
79
|
+
error?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Error thrown when tenant request validation fails
|
|
83
|
+
*/
|
|
84
|
+
export declare class TenantRequestError extends Error {
|
|
85
|
+
constructor(message: string);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Serializes an ESConfig or EnterpriseStandard instance to a JSON-serializable format
|
|
89
|
+
* by removing non-serializable properties like stores, validators, and functions.
|
|
90
|
+
*
|
|
91
|
+
* Since EnterpriseStandard now extends ESConfig, the config (including handler URLs)
|
|
92
|
+
* is accessible directly from the instance.
|
|
93
|
+
*
|
|
94
|
+
* @param configOrES - The ESConfig object or EnterpriseStandard instance to serialize
|
|
95
|
+
* @returns A JSON-serializable version of the config
|
|
96
|
+
*/
|
|
97
|
+
export declare function serializeESConfig(configOrES: any): any;
|
|
98
|
+
/**
|
|
99
|
+
* Parse and validate a tenant creation request from an HTTP request.
|
|
100
|
+
*
|
|
101
|
+
* @param request - The HTTP request containing the tenant creation data
|
|
102
|
+
* @returns The validated tenant creation request
|
|
103
|
+
* @throws {TenantRequestError} If the request is invalid or missing required fields
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* app.post('/api/tenant', async (c) => {
|
|
108
|
+
* try {
|
|
109
|
+
* const tenantRequest = await parseTenantRequest(c.req.raw);
|
|
110
|
+
* // Create tenant...
|
|
111
|
+
* } catch (error) {
|
|
112
|
+
* if (error instanceof TenantRequestError) {
|
|
113
|
+
* return c.json({ error: error.message }, 400);
|
|
114
|
+
* }
|
|
115
|
+
* throw error;
|
|
116
|
+
* }
|
|
117
|
+
* });
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare function parseTenantRequest(request: Request): Promise<CreateTenantRequest>;
|
|
121
|
+
/**
|
|
122
|
+
* Send a webhook update to ESVS with tenant creation status.
|
|
123
|
+
*
|
|
124
|
+
* @param webhookUrl - The webhook URL provided in the tenant creation request
|
|
125
|
+
* @param payload - The webhook payload with status and tenant information
|
|
126
|
+
* @throws Never throws - errors are logged but not propagated to avoid breaking tenant creation
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* // Send initial status
|
|
131
|
+
* await sendTenantWebhook(tenantRequest.webhookUrl, {
|
|
132
|
+
* companyId: tenantRequest.companyId,
|
|
133
|
+
* status: 'processing',
|
|
134
|
+
* });
|
|
135
|
+
*
|
|
136
|
+
* // Send completion status
|
|
137
|
+
* await sendTenantWebhook(tenantRequest.webhookUrl, {
|
|
138
|
+
* companyId: tenantRequest.companyId,
|
|
139
|
+
* status: 'completed',
|
|
140
|
+
* tenantUrl: 'https://app.example.com/tenants/tenant-123',
|
|
141
|
+
* });
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare function sendTenantWebhook(webhookUrl: string, payload: TenantWebhookPayload): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Stored tenant data with required appId and tracking metadata.
|
|
147
|
+
*
|
|
148
|
+
* @template TExtended - Type-safe custom data that consumers can add to tenants
|
|
149
|
+
*/
|
|
150
|
+
export type StoredTenant<TExtended = {}> = {
|
|
151
|
+
/**
|
|
152
|
+
* Required app identifier used to initialize EnterpriseStandard for this tenant.
|
|
153
|
+
* This is the primary key for tenant storage. A company can have multiple
|
|
154
|
+
* applications (e.g., one instance on the east coast, one on the west coast).
|
|
155
|
+
*/
|
|
156
|
+
appId: string;
|
|
157
|
+
/**
|
|
158
|
+
* Company ID (used for reporting purposes only, not for tenant identification)
|
|
159
|
+
*/
|
|
160
|
+
companyId: string;
|
|
161
|
+
/**
|
|
162
|
+
* Company Name
|
|
163
|
+
*/
|
|
164
|
+
companyName: string;
|
|
165
|
+
/**
|
|
166
|
+
* Environment Type (POC, DEV, QA, PROD)
|
|
167
|
+
*/
|
|
168
|
+
environmentType: EnvironmentType;
|
|
169
|
+
/**
|
|
170
|
+
* Email (The email or distribution list used to communicate to the team)
|
|
171
|
+
*/
|
|
172
|
+
email: string;
|
|
173
|
+
/**
|
|
174
|
+
* Webhook URL where the application can send updates around the creation of the tenant
|
|
175
|
+
*/
|
|
176
|
+
webhookUrl: string;
|
|
177
|
+
/**
|
|
178
|
+
* URL that the tenant will be available at
|
|
179
|
+
*/
|
|
180
|
+
tenantUrl?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Current status of tenant creation
|
|
183
|
+
*/
|
|
184
|
+
status: TenantStatus;
|
|
185
|
+
/**
|
|
186
|
+
* Error message (only present if status is "failed")
|
|
187
|
+
*/
|
|
188
|
+
error?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Timestamp when the tenant was first stored.
|
|
191
|
+
*/
|
|
192
|
+
createdAt: Date;
|
|
193
|
+
/**
|
|
194
|
+
* Timestamp when the tenant was last updated.
|
|
195
|
+
*/
|
|
196
|
+
updatedAt: Date;
|
|
197
|
+
/**
|
|
198
|
+
* Serialized Enterprise Standard configuration.
|
|
199
|
+
* This is a JSON-serializable version of the ESConfig with non-serializable items excluded.
|
|
200
|
+
*/
|
|
201
|
+
config?: any;
|
|
202
|
+
} & TExtended;
|
|
203
|
+
/**
|
|
204
|
+
* Abstract interface for tenant storage backends.
|
|
205
|
+
*
|
|
206
|
+
* Consumers can implement this interface to use different storage backends:
|
|
207
|
+
* - In-memory (for development/testing)
|
|
208
|
+
* - Redis (for production with fast lookups)
|
|
209
|
+
* - Database (PostgreSQL, MySQL, etc.)
|
|
210
|
+
*
|
|
211
|
+
* @template TExtended - Type-safe custom data that consumers can add to tenants
|
|
212
|
+
*/
|
|
213
|
+
export interface TenantStore<TExtended = {}> {
|
|
214
|
+
/**
|
|
215
|
+
* Retrieve a tenant by its app identifier.
|
|
216
|
+
*
|
|
217
|
+
* @param appId - The tenant's app identifier (primary key)
|
|
218
|
+
* @returns The tenant if found, null otherwise
|
|
219
|
+
*/
|
|
220
|
+
get(appId: string): Promise<StoredTenant<TExtended> | null>;
|
|
221
|
+
/**
|
|
222
|
+
* Retrieve all tenants for a company ID.
|
|
223
|
+
* Since a company can have multiple applications, this returns an array.
|
|
224
|
+
*
|
|
225
|
+
* @param companyId - The company ID (used for reporting, not primary identification)
|
|
226
|
+
* @returns Array of tenants for the company, empty array if none found
|
|
227
|
+
*/
|
|
228
|
+
getByCompanyId(companyId: string): Promise<StoredTenant<TExtended>[]>;
|
|
229
|
+
/**
|
|
230
|
+
* List all tenants in the store.
|
|
231
|
+
*
|
|
232
|
+
* @returns Array of all stored tenants
|
|
233
|
+
*/
|
|
234
|
+
list(): Promise<StoredTenant<TExtended>[]>;
|
|
235
|
+
/**
|
|
236
|
+
* Create or update a tenant in the store.
|
|
237
|
+
*
|
|
238
|
+
* If a tenant with the same `appId` exists, it will be updated.
|
|
239
|
+
* Otherwise, a new tenant will be created.
|
|
240
|
+
*
|
|
241
|
+
* @param tenant - The tenant data to store
|
|
242
|
+
* @returns The stored tenant
|
|
243
|
+
*/
|
|
244
|
+
upsert(tenant: StoredTenant<TExtended>): Promise<StoredTenant<TExtended>>;
|
|
245
|
+
/**
|
|
246
|
+
* Delete a tenant by its app identifier.
|
|
247
|
+
*
|
|
248
|
+
* @param appId - The tenant's app identifier to delete
|
|
249
|
+
*/
|
|
250
|
+
delete(appId: string): Promise<void>;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* In-memory tenant store implementation using Maps.
|
|
254
|
+
*
|
|
255
|
+
* Suitable for:
|
|
256
|
+
* - Development and testing
|
|
257
|
+
* - Single-server deployments
|
|
258
|
+
* - Applications without high availability requirements
|
|
259
|
+
*
|
|
260
|
+
* NOT suitable for:
|
|
261
|
+
* - Multi-server deployments (tenants not shared)
|
|
262
|
+
* - High availability scenarios (tenants lost on restart)
|
|
263
|
+
* - Production applications with distributed architecture
|
|
264
|
+
*
|
|
265
|
+
* For production, implement TenantStore with Redis or a database.
|
|
266
|
+
*
|
|
267
|
+
* @template TExtended - Type-safe custom data that consumers can add to tenants
|
|
268
|
+
*/
|
|
269
|
+
export declare class InMemoryTenantStore<TExtended = {}> implements TenantStore<TExtended> {
|
|
270
|
+
/** Primary storage: appId -> tenant */
|
|
271
|
+
private tenants;
|
|
272
|
+
/** Secondary index: companyId -> Set of appIds (since one company can have multiple apps) */
|
|
273
|
+
private companyIdIndex;
|
|
274
|
+
get(appId: string): Promise<StoredTenant<TExtended> | null>;
|
|
275
|
+
getByCompanyId(companyId: string): Promise<StoredTenant<TExtended>[]>;
|
|
276
|
+
list(): Promise<StoredTenant<TExtended>[]>;
|
|
277
|
+
upsert(tenant: StoredTenant<TExtended>): Promise<StoredTenant<TExtended>>;
|
|
278
|
+
delete(appId: string): Promise<void>;
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=tenant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../src/tenant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,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AkC;IAElD,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAI3D,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;IAcrE,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;IAI1C,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IA4BzE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAc3C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base user with simple, developer-friendly attributes.
|
|
3
|
+
* Extended by User (SSO) and EnterpriseUser (SCIM).
|
|
4
|
+
*/
|
|
5
|
+
export interface BaseUser {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for the user
|
|
8
|
+
*/
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* REQUIRED. Unique identifier for login
|
|
12
|
+
*/
|
|
13
|
+
userName: string;
|
|
14
|
+
/**
|
|
15
|
+
* REQUIRED. Simple display name
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* REQUIRED. Primary email address
|
|
20
|
+
*/
|
|
21
|
+
email: string;
|
|
22
|
+
/**
|
|
23
|
+
* URL to user's avatar/profile picture
|
|
24
|
+
*/
|
|
25
|
+
avatarUrl?: string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=base-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-user.d.ts","sourceRoot":"","sources":["../../src/types/base-user.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { BaseUser } from './base-user';
|
|
2
|
+
import type { Address, Email, Group, Name, PhoneNumber, Role } from './scim-schema';
|
|
3
|
+
/**
|
|
4
|
+
* Enterprise user with SCIM attributes.
|
|
5
|
+
* Extends BaseUser (simple fields) with optional complex SCIM fields.
|
|
6
|
+
* For IAM/provisioning and enterprise directory integration.
|
|
7
|
+
*/
|
|
8
|
+
export interface EnterpriseUser extends BaseUser {
|
|
9
|
+
/**
|
|
10
|
+
* External identifier from the provisioning system
|
|
11
|
+
*/
|
|
12
|
+
externalId?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Resource metadata
|
|
15
|
+
*/
|
|
16
|
+
meta?: {
|
|
17
|
+
resourceType?: string;
|
|
18
|
+
created?: string;
|
|
19
|
+
lastModified?: string;
|
|
20
|
+
version?: string;
|
|
21
|
+
location?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* SCIM schemas supported by this user
|
|
25
|
+
*/
|
|
26
|
+
schemas?: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Structured name with family/given names, prefixes, suffixes.
|
|
29
|
+
* Use alongside the simple `name` string from BaseUser.
|
|
30
|
+
*/
|
|
31
|
+
fullName?: Name;
|
|
32
|
+
/**
|
|
33
|
+
* Multiple email addresses with types (work, home, etc.).
|
|
34
|
+
* Use alongside the simple `email` string from BaseUser.
|
|
35
|
+
*/
|
|
36
|
+
emails?: Email[];
|
|
37
|
+
/**
|
|
38
|
+
* Name for display purposes
|
|
39
|
+
*/
|
|
40
|
+
displayName?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Casual name to address the user
|
|
43
|
+
*/
|
|
44
|
+
nickName?: string;
|
|
45
|
+
/**
|
|
46
|
+
* URL to user's online profile
|
|
47
|
+
*/
|
|
48
|
+
profileUrl?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Job title
|
|
51
|
+
*/
|
|
52
|
+
title?: string;
|
|
53
|
+
/**
|
|
54
|
+
* User type (e.g., "Employee", "Contractor")
|
|
55
|
+
*/
|
|
56
|
+
userType?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Preferred language (e.g., "en-US")
|
|
59
|
+
*/
|
|
60
|
+
preferredLanguage?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Locale for localization (e.g., "en-US")
|
|
63
|
+
*/
|
|
64
|
+
locale?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Timezone (e.g., "America/New_York")
|
|
67
|
+
*/
|
|
68
|
+
timezone?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the user account is active
|
|
71
|
+
*/
|
|
72
|
+
active?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Password (for provisioning only, should not be returned)
|
|
75
|
+
*/
|
|
76
|
+
password?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Phone numbers
|
|
79
|
+
*/
|
|
80
|
+
phoneNumbers?: PhoneNumber[];
|
|
81
|
+
/**
|
|
82
|
+
* Instant messaging addresses
|
|
83
|
+
*/
|
|
84
|
+
ims?: Array<{
|
|
85
|
+
value: string;
|
|
86
|
+
display?: string;
|
|
87
|
+
type?: string;
|
|
88
|
+
primary?: boolean;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Photo URLs
|
|
92
|
+
*/
|
|
93
|
+
photos?: Array<{
|
|
94
|
+
value: string;
|
|
95
|
+
display?: string;
|
|
96
|
+
type?: string;
|
|
97
|
+
primary?: boolean;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Physical mailing addresses
|
|
101
|
+
*/
|
|
102
|
+
addresses?: Address[];
|
|
103
|
+
/**
|
|
104
|
+
* Groups the user belongs to
|
|
105
|
+
*/
|
|
106
|
+
groups?: Group[];
|
|
107
|
+
/**
|
|
108
|
+
* Entitlements
|
|
109
|
+
*/
|
|
110
|
+
entitlements?: Array<{
|
|
111
|
+
value: string;
|
|
112
|
+
display?: string;
|
|
113
|
+
type?: string;
|
|
114
|
+
primary?: boolean;
|
|
115
|
+
}>;
|
|
116
|
+
/**
|
|
117
|
+
* Roles assigned to the user
|
|
118
|
+
*/
|
|
119
|
+
roles?: Role[];
|
|
120
|
+
/**
|
|
121
|
+
* X.509 certificates
|
|
122
|
+
*/
|
|
123
|
+
x509Certificates?: Array<{
|
|
124
|
+
value: string;
|
|
125
|
+
display?: string;
|
|
126
|
+
type?: string;
|
|
127
|
+
primary?: boolean;
|
|
128
|
+
}>;
|
|
129
|
+
/**
|
|
130
|
+
* Employee number
|
|
131
|
+
*/
|
|
132
|
+
employeeNumber?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Cost center
|
|
135
|
+
*/
|
|
136
|
+
costCenter?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Organization name
|
|
139
|
+
*/
|
|
140
|
+
organization?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Division name
|
|
143
|
+
*/
|
|
144
|
+
division?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Department name
|
|
147
|
+
*/
|
|
148
|
+
department?: string;
|
|
149
|
+
/**
|
|
150
|
+
* User's manager
|
|
151
|
+
*/
|
|
152
|
+
manager?: {
|
|
153
|
+
value: string;
|
|
154
|
+
$ref?: string;
|
|
155
|
+
displayName?: string;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=enterprise-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enterprise-user.d.ts","sourceRoot":"","sources":["../../src/types/enterprise-user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,E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