@objectstack/spec 0.1.2 → 0.3.0
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/README.md +127 -5
- package/dist/ai/index.d.ts +14 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +29 -0
- package/dist/ai/model-registry.zod.d.ts +1389 -0
- package/dist/ai/model-registry.zod.d.ts.map +1 -0
- package/dist/ai/model-registry.zod.js +164 -0
- package/dist/ai/nlq.zod.d.ts +1126 -0
- package/dist/ai/nlq.zod.d.ts.map +1 -0
- package/dist/ai/nlq.zod.js +246 -0
- package/dist/ai/rag-pipeline.zod.d.ts +1034 -0
- package/dist/ai/rag-pipeline.zod.d.ts.map +1 -0
- package/dist/ai/rag-pipeline.zod.js +244 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +24 -0
- package/dist/data/filter.zod.d.ts +295 -0
- package/dist/data/filter.zod.d.ts.map +1 -0
- package/dist/data/filter.zod.js +226 -0
- package/dist/data/index.d.ts +21 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +36 -0
- package/dist/data/query.zod.d.ts +386 -3
- package/dist/data/query.zod.d.ts.map +1 -1
- package/dist/data/query.zod.js +386 -3
- package/dist/data/validation.zod.d.ts +349 -0
- package/dist/data/validation.zod.d.ts.map +1 -1
- package/dist/data/validation.zod.js +395 -0
- package/dist/index.d.ts +36 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -47
- package/dist/system/auth-protocol.d.ts +175 -0
- package/dist/system/auth-protocol.d.ts.map +1 -0
- package/dist/system/auth-protocol.js +60 -0
- package/dist/system/auth.zod.d.ts +3319 -0
- package/dist/system/auth.zod.d.ts.map +1 -0
- package/dist/system/auth.zod.js +499 -0
- package/dist/system/datasource.zod.d.ts +118 -38
- package/dist/system/datasource.zod.d.ts.map +1 -1
- package/dist/system/datasource.zod.js +25 -6
- package/dist/system/driver.zod.d.ts +106 -0
- package/dist/system/driver.zod.d.ts.map +1 -1
- package/dist/system/driver.zod.js +47 -0
- package/dist/system/identity.zod.d.ts +234 -180
- package/dist/system/identity.zod.d.ts.map +1 -1
- package/dist/system/identity.zod.js +168 -51
- package/dist/system/index.d.ts +28 -0
- package/dist/system/index.d.ts.map +1 -0
- package/dist/system/index.js +43 -0
- package/dist/system/manifest.zod.d.ts +10 -10
- package/dist/system/organization.zod.d.ts +179 -0
- package/dist/system/organization.zod.d.ts.map +1 -0
- package/dist/system/organization.zod.js +129 -0
- package/dist/system/policy.zod.d.ts +10 -10
- package/dist/ui/action.zod.d.ts +2 -2
- package/dist/ui/dashboard.zod.d.ts +10 -10
- package/dist/ui/dashboard.zod.d.ts.map +1 -1
- package/dist/ui/dashboard.zod.js +3 -2
- package/dist/ui/index.d.ts +17 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +32 -0
- package/dist/ui/report.zod.d.ts +4 -32
- package/dist/ui/report.zod.d.ts.map +1 -1
- package/dist/ui/report.zod.js +3 -8
- package/dist/ui/theme.zod.d.ts +6 -6
- package/json-schema/Account.json +87 -0
- package/json-schema/AccountLinkingConfig.json +27 -0
- package/json-schema/AuthConfig.json +841 -0
- package/json-schema/AuthPluginConfig.json +28 -0
- package/json-schema/AuthStrategy.json +17 -0
- package/json-schema/AuthenticationConfig.json +601 -0
- package/json-schema/AuthenticationProvider.json +617 -0
- package/json-schema/CSRFConfig.json +31 -0
- package/json-schema/ChunkingStrategy.json +133 -0
- package/json-schema/ComparisonOperator.json +56 -0
- package/json-schema/Dashboard.json +20 -0
- package/json-schema/DashboardWidget.json +20 -0
- package/json-schema/DatabaseAdapter.json +38 -0
- package/json-schema/DatabaseMapping.json +48 -0
- package/json-schema/Datasource.json +25 -5
- package/json-schema/DatasourceCapabilities.json +25 -5
- package/json-schema/DocumentChunk.json +97 -0
- package/json-schema/DocumentLoaderConfig.json +69 -0
- package/json-schema/DocumentMetadata.json +61 -0
- package/json-schema/DriverCapabilities.json +30 -0
- package/json-schema/DriverDefinition.json +25 -5
- package/json-schema/DriverInterface.json +30 -0
- package/json-schema/EmailPasswordConfig.json +43 -0
- package/json-schema/EmbeddingModel.json +57 -0
- package/json-schema/EnterpriseAuthConfig.json +172 -0
- package/json-schema/Entity.json +55 -0
- package/json-schema/EqualityOperator.json +14 -0
- package/json-schema/FieldOperators.json +108 -0
- package/json-schema/FieldSynonymConfig.json +39 -0
- package/json-schema/FilterCondition.json +28 -0
- package/json-schema/Invitation.json +69 -0
- package/json-schema/InvitationStatus.json +15 -0
- package/json-schema/LDAPConfig.json +22 -5
- package/json-schema/MagicLinkConfig.json +21 -0
- package/json-schema/Member.json +46 -0
- package/json-schema/ModelCapability.json +47 -0
- package/json-schema/ModelConfig.json +181 -0
- package/json-schema/ModelLimits.json +45 -0
- package/json-schema/ModelPricing.json +28 -0
- package/json-schema/ModelProvider.json +19 -0
- package/json-schema/ModelRegistry.json +427 -0
- package/json-schema/ModelRegistryEntry.json +239 -0
- package/json-schema/ModelSelectionCriteria.json +50 -0
- package/json-schema/NLQAnalytics.json +106 -0
- package/json-schema/NLQFieldMapping.json +40 -0
- package/json-schema/NLQModelConfig.json +78 -0
- package/json-schema/NLQParseResult.json +252 -0
- package/json-schema/NLQRequest.json +110 -0
- package/json-schema/NLQResponse.json +288 -0
- package/json-schema/NLQTrainingExample.json +120 -0
- package/json-schema/NormalizedFilter.json +348 -0
- package/json-schema/OAuthProvider.json +66 -0
- package/json-schema/OIDCConfig.json +18 -3
- package/json-schema/Organization.json +52 -0
- package/json-schema/PasskeyConfig.json +54 -0
- package/json-schema/PromptTemplate.json +163 -0
- package/json-schema/PromptVariable.json +56 -0
- package/json-schema/QueryContext.json +72 -0
- package/json-schema/QueryFilter.json +34 -0
- package/json-schema/QueryIntent.json +21 -0
- package/json-schema/QueryTemplate.json +81 -0
- package/json-schema/RAGPipelineConfig.json +552 -0
- package/json-schema/RAGPipelineStatus.json +66 -0
- package/json-schema/RAGQueryRequest.json +64 -0
- package/json-schema/RAGQueryResponse.json +108 -0
- package/json-schema/RangeOperator.json +41 -0
- package/json-schema/RateLimitConfig.json +36 -0
- package/json-schema/Report.json +20 -26
- package/json-schema/RerankingConfig.json +34 -0
- package/json-schema/RetrievalStrategy.json +121 -0
- package/json-schema/SAMLConfig.json +17 -3
- package/json-schema/Session.json +63 -0
- package/json-schema/SessionConfig.json +56 -0
- package/json-schema/SetOperator.json +18 -0
- package/json-schema/SpecialOperator.json +18 -0
- package/json-schema/StandardAuthProvider.json +857 -0
- package/json-schema/StringOperator.json +21 -0
- package/json-schema/Timeframe.json +68 -0
- package/json-schema/TwoFactorConfig.json +40 -0
- package/json-schema/User.json +51 -0
- package/json-schema/UserFieldMapping.json +47 -0
- package/json-schema/VectorStoreConfig.json +82 -0
- package/json-schema/VectorStoreProvider.json +21 -0
- package/json-schema/VerificationToken.json +36 -0
- package/package.json +27 -1
- package/json-schema/AuthProtocol.json +0 -17
- package/json-schema/AuthProvider.json +0 -171
|
@@ -1,204 +1,258 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Identity & User Model Specification
|
|
4
|
+
*
|
|
5
|
+
* Defines the standard user, account, and session data models for ObjectStack.
|
|
6
|
+
* These schemas represent "who is logged in" and their associated data.
|
|
7
|
+
*
|
|
8
|
+
* This is separate from authentication configuration (auth.zod.ts) which
|
|
9
|
+
* defines "how to login".
|
|
5
10
|
*/
|
|
6
|
-
export declare const AuthProtocol: z.ZodEnum<["oidc", "saml", "ldap", "oauth2", "local", "mock"]>;
|
|
7
11
|
/**
|
|
8
|
-
*
|
|
12
|
+
* User Schema
|
|
13
|
+
* Core user identity data model
|
|
9
14
|
*/
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export declare const UserSchema: z.ZodObject<{
|
|
16
|
+
/**
|
|
17
|
+
* Unique user identifier
|
|
18
|
+
*/
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
/**
|
|
21
|
+
* User's email address (primary identifier)
|
|
22
|
+
*/
|
|
23
|
+
email: z.ZodString;
|
|
24
|
+
/**
|
|
25
|
+
* Email verification status
|
|
26
|
+
*/
|
|
27
|
+
emailVerified: z.ZodDefault<z.ZodBoolean>;
|
|
28
|
+
/**
|
|
29
|
+
* User's display name
|
|
30
|
+
*/
|
|
31
|
+
name: z.ZodOptional<z.ZodString>;
|
|
32
|
+
/**
|
|
33
|
+
* User's profile image URL
|
|
34
|
+
*/
|
|
35
|
+
image: z.ZodOptional<z.ZodString>;
|
|
36
|
+
/**
|
|
37
|
+
* Account creation timestamp
|
|
38
|
+
*/
|
|
39
|
+
createdAt: z.ZodDate;
|
|
40
|
+
/**
|
|
41
|
+
* Last update timestamp
|
|
42
|
+
*/
|
|
43
|
+
updatedAt: z.ZodDate;
|
|
16
44
|
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
45
|
+
email: string;
|
|
46
|
+
id: string;
|
|
47
|
+
emailVerified: boolean;
|
|
48
|
+
createdAt: Date;
|
|
49
|
+
updatedAt: Date;
|
|
50
|
+
image?: string | undefined;
|
|
51
|
+
name?: string | undefined;
|
|
22
52
|
}, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
53
|
+
email: string;
|
|
54
|
+
id: string;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
updatedAt: Date;
|
|
57
|
+
image?: string | undefined;
|
|
58
|
+
name?: string | undefined;
|
|
59
|
+
emailVerified?: boolean | undefined;
|
|
28
60
|
}>;
|
|
61
|
+
export type User = z.infer<typeof UserSchema>;
|
|
29
62
|
/**
|
|
30
|
-
*
|
|
63
|
+
* Account Schema
|
|
64
|
+
* Links external OAuth/OIDC/SAML accounts to a user
|
|
31
65
|
*/
|
|
32
|
-
export declare const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
66
|
+
export declare const AccountSchema: z.ZodObject<{
|
|
67
|
+
/**
|
|
68
|
+
* Unique account identifier
|
|
69
|
+
*/
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
/**
|
|
72
|
+
* Associated user ID
|
|
73
|
+
*/
|
|
74
|
+
userId: z.ZodString;
|
|
75
|
+
/**
|
|
76
|
+
* Account type/provider
|
|
77
|
+
*/
|
|
78
|
+
type: z.ZodEnum<["oauth", "oidc", "email", "credentials", "saml", "ldap"]>;
|
|
79
|
+
/**
|
|
80
|
+
* Provider name (e.g., 'google', 'github', 'okta')
|
|
81
|
+
*/
|
|
82
|
+
provider: z.ZodString;
|
|
83
|
+
/**
|
|
84
|
+
* Provider account ID
|
|
85
|
+
*/
|
|
86
|
+
providerAccountId: z.ZodString;
|
|
87
|
+
/**
|
|
88
|
+
* OAuth refresh token
|
|
89
|
+
*/
|
|
90
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
91
|
+
/**
|
|
92
|
+
* OAuth access token
|
|
93
|
+
*/
|
|
94
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
95
|
+
/**
|
|
96
|
+
* Token expiry timestamp
|
|
97
|
+
*/
|
|
98
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
/**
|
|
100
|
+
* OAuth token type
|
|
101
|
+
*/
|
|
102
|
+
tokenType: z.ZodOptional<z.ZodString>;
|
|
103
|
+
/**
|
|
104
|
+
* OAuth scope
|
|
105
|
+
*/
|
|
106
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
107
|
+
/**
|
|
108
|
+
* OAuth ID token
|
|
109
|
+
*/
|
|
110
|
+
idToken: z.ZodOptional<z.ZodString>;
|
|
111
|
+
/**
|
|
112
|
+
* Session state
|
|
113
|
+
*/
|
|
114
|
+
sessionState: z.ZodOptional<z.ZodString>;
|
|
115
|
+
/**
|
|
116
|
+
* Account creation timestamp
|
|
117
|
+
*/
|
|
118
|
+
createdAt: z.ZodDate;
|
|
119
|
+
/**
|
|
120
|
+
* Last update timestamp
|
|
121
|
+
*/
|
|
122
|
+
updatedAt: z.ZodDate;
|
|
38
123
|
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
124
|
+
type: "email" | "oauth" | "oidc" | "credentials" | "saml" | "ldap";
|
|
125
|
+
id: string;
|
|
126
|
+
userId: string;
|
|
127
|
+
createdAt: Date;
|
|
128
|
+
updatedAt: Date;
|
|
129
|
+
provider: string;
|
|
130
|
+
providerAccountId: string;
|
|
131
|
+
scope?: string | undefined;
|
|
132
|
+
refreshToken?: string | undefined;
|
|
133
|
+
accessToken?: string | undefined;
|
|
134
|
+
expiresAt?: number | undefined;
|
|
135
|
+
tokenType?: string | undefined;
|
|
136
|
+
idToken?: string | undefined;
|
|
137
|
+
sessionState?: string | undefined;
|
|
44
138
|
}, {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
139
|
+
type: "email" | "oauth" | "oidc" | "credentials" | "saml" | "ldap";
|
|
140
|
+
id: string;
|
|
141
|
+
userId: string;
|
|
142
|
+
createdAt: Date;
|
|
143
|
+
updatedAt: Date;
|
|
144
|
+
provider: string;
|
|
145
|
+
providerAccountId: string;
|
|
146
|
+
scope?: string | undefined;
|
|
147
|
+
refreshToken?: string | undefined;
|
|
148
|
+
accessToken?: string | undefined;
|
|
149
|
+
expiresAt?: number | undefined;
|
|
150
|
+
tokenType?: string | undefined;
|
|
151
|
+
idToken?: string | undefined;
|
|
152
|
+
sessionState?: string | undefined;
|
|
50
153
|
}>;
|
|
154
|
+
export type Account = z.infer<typeof AccountSchema>;
|
|
51
155
|
/**
|
|
52
|
-
*
|
|
156
|
+
* Session Schema
|
|
157
|
+
* User session data model
|
|
53
158
|
*/
|
|
54
|
-
export declare const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
159
|
+
export declare const SessionSchema: z.ZodObject<{
|
|
160
|
+
/**
|
|
161
|
+
* Unique session identifier
|
|
162
|
+
*/
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
/**
|
|
165
|
+
* Session token
|
|
166
|
+
*/
|
|
167
|
+
sessionToken: z.ZodString;
|
|
168
|
+
/**
|
|
169
|
+
* Associated user ID
|
|
170
|
+
*/
|
|
171
|
+
userId: z.ZodString;
|
|
172
|
+
/**
|
|
173
|
+
* Active organization ID for this session
|
|
174
|
+
* Used for context switching in multi-tenant applications
|
|
175
|
+
*/
|
|
176
|
+
activeOrganizationId: z.ZodOptional<z.ZodString>;
|
|
177
|
+
/**
|
|
178
|
+
* Session expiry timestamp
|
|
179
|
+
*/
|
|
180
|
+
expires: z.ZodDate;
|
|
181
|
+
/**
|
|
182
|
+
* Session creation timestamp
|
|
183
|
+
*/
|
|
184
|
+
createdAt: z.ZodDate;
|
|
185
|
+
/**
|
|
186
|
+
* Last update timestamp
|
|
187
|
+
*/
|
|
188
|
+
updatedAt: z.ZodDate;
|
|
189
|
+
/**
|
|
190
|
+
* IP address of the session
|
|
191
|
+
*/
|
|
192
|
+
ipAddress: z.ZodOptional<z.ZodString>;
|
|
193
|
+
/**
|
|
194
|
+
* User agent string
|
|
195
|
+
*/
|
|
196
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
197
|
+
/**
|
|
198
|
+
* Device fingerprint
|
|
199
|
+
*/
|
|
200
|
+
fingerprint: z.ZodOptional<z.ZodString>;
|
|
61
201
|
}, "strip", z.ZodTypeAny, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
202
|
+
id: string;
|
|
203
|
+
userId: string;
|
|
204
|
+
createdAt: Date;
|
|
205
|
+
updatedAt: Date;
|
|
206
|
+
sessionToken: string;
|
|
207
|
+
expires: Date;
|
|
208
|
+
activeOrganizationId?: string | undefined;
|
|
209
|
+
ipAddress?: string | undefined;
|
|
210
|
+
userAgent?: string | undefined;
|
|
211
|
+
fingerprint?: string | undefined;
|
|
68
212
|
}, {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
213
|
+
id: string;
|
|
214
|
+
userId: string;
|
|
215
|
+
createdAt: Date;
|
|
216
|
+
updatedAt: Date;
|
|
217
|
+
sessionToken: string;
|
|
218
|
+
expires: Date;
|
|
219
|
+
activeOrganizationId?: string | undefined;
|
|
220
|
+
ipAddress?: string | undefined;
|
|
221
|
+
userAgent?: string | undefined;
|
|
222
|
+
fingerprint?: string | undefined;
|
|
75
223
|
}>;
|
|
224
|
+
export type Session = z.infer<typeof SessionSchema>;
|
|
76
225
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
226
|
+
* Verification Token Schema
|
|
227
|
+
* Email verification and password reset tokens
|
|
79
228
|
*/
|
|
80
|
-
export declare const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, {
|
|
98
|
-
issuer: string;
|
|
99
|
-
clientId: string;
|
|
100
|
-
clientSecret: string;
|
|
101
|
-
scopes?: string[] | undefined;
|
|
102
|
-
attributeMapping?: Record<string, string> | undefined;
|
|
103
|
-
}>, z.ZodObject<{
|
|
104
|
-
entryPoint: z.ZodString;
|
|
105
|
-
cert: z.ZodString;
|
|
106
|
-
issuer: z.ZodString;
|
|
107
|
-
signatureAlgorithm: z.ZodDefault<z.ZodEnum<["sha256", "sha512"]>>;
|
|
108
|
-
attributeMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
109
|
-
}, "strip", z.ZodTypeAny, {
|
|
110
|
-
issuer: string;
|
|
111
|
-
entryPoint: string;
|
|
112
|
-
cert: string;
|
|
113
|
-
signatureAlgorithm: "sha256" | "sha512";
|
|
114
|
-
attributeMapping?: Record<string, string> | undefined;
|
|
115
|
-
}, {
|
|
116
|
-
issuer: string;
|
|
117
|
-
entryPoint: string;
|
|
118
|
-
cert: string;
|
|
119
|
-
attributeMapping?: Record<string, string> | undefined;
|
|
120
|
-
signatureAlgorithm?: "sha256" | "sha512" | undefined;
|
|
121
|
-
}>, z.ZodObject<{
|
|
122
|
-
url: z.ZodString;
|
|
123
|
-
bindDn: z.ZodString;
|
|
124
|
-
bindCredentials: z.ZodString;
|
|
125
|
-
searchBase: z.ZodString;
|
|
126
|
-
searchFilter: z.ZodString;
|
|
127
|
-
groupSearchBase: z.ZodOptional<z.ZodString>;
|
|
128
|
-
}, "strip", z.ZodTypeAny, {
|
|
129
|
-
url: string;
|
|
130
|
-
bindDn: string;
|
|
131
|
-
bindCredentials: string;
|
|
132
|
-
searchBase: string;
|
|
133
|
-
searchFilter: string;
|
|
134
|
-
groupSearchBase?: string | undefined;
|
|
135
|
-
}, {
|
|
136
|
-
url: string;
|
|
137
|
-
bindDn: string;
|
|
138
|
-
bindCredentials: string;
|
|
139
|
-
searchBase: string;
|
|
140
|
-
searchFilter: string;
|
|
141
|
-
groupSearchBase?: string | undefined;
|
|
142
|
-
}>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
|
|
143
|
-
/** Visuals */
|
|
144
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
145
|
-
/** Policies */
|
|
146
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
147
|
-
registrationEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
229
|
+
export declare const VerificationTokenSchema: z.ZodObject<{
|
|
230
|
+
/**
|
|
231
|
+
* Token identifier (email or phone)
|
|
232
|
+
*/
|
|
233
|
+
identifier: z.ZodString;
|
|
234
|
+
/**
|
|
235
|
+
* Verification token
|
|
236
|
+
*/
|
|
237
|
+
token: z.ZodString;
|
|
238
|
+
/**
|
|
239
|
+
* Token expiry timestamp
|
|
240
|
+
*/
|
|
241
|
+
expires: z.ZodDate;
|
|
242
|
+
/**
|
|
243
|
+
* Token creation timestamp
|
|
244
|
+
*/
|
|
245
|
+
createdAt: z.ZodDate;
|
|
148
246
|
}, "strip", z.ZodTypeAny, {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
config: Record<string, any> | {
|
|
154
|
-
issuer: string;
|
|
155
|
-
clientId: string;
|
|
156
|
-
clientSecret: string;
|
|
157
|
-
scopes: string[];
|
|
158
|
-
attributeMapping?: Record<string, string> | undefined;
|
|
159
|
-
} | {
|
|
160
|
-
issuer: string;
|
|
161
|
-
entryPoint: string;
|
|
162
|
-
cert: string;
|
|
163
|
-
signatureAlgorithm: "sha256" | "sha512";
|
|
164
|
-
attributeMapping?: Record<string, string> | undefined;
|
|
165
|
-
} | {
|
|
166
|
-
url: string;
|
|
167
|
-
bindDn: string;
|
|
168
|
-
bindCredentials: string;
|
|
169
|
-
searchBase: string;
|
|
170
|
-
searchFilter: string;
|
|
171
|
-
groupSearchBase?: string | undefined;
|
|
172
|
-
};
|
|
173
|
-
registrationEnabled: boolean;
|
|
174
|
-
icon?: string | undefined;
|
|
247
|
+
createdAt: Date;
|
|
248
|
+
expires: Date;
|
|
249
|
+
identifier: string;
|
|
250
|
+
token: string;
|
|
175
251
|
}, {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
issuer: string;
|
|
181
|
-
clientId: string;
|
|
182
|
-
clientSecret: string;
|
|
183
|
-
scopes?: string[] | undefined;
|
|
184
|
-
attributeMapping?: Record<string, string> | undefined;
|
|
185
|
-
} | {
|
|
186
|
-
issuer: string;
|
|
187
|
-
entryPoint: string;
|
|
188
|
-
cert: string;
|
|
189
|
-
attributeMapping?: Record<string, string> | undefined;
|
|
190
|
-
signatureAlgorithm?: "sha256" | "sha512" | undefined;
|
|
191
|
-
} | {
|
|
192
|
-
url: string;
|
|
193
|
-
bindDn: string;
|
|
194
|
-
bindCredentials: string;
|
|
195
|
-
searchBase: string;
|
|
196
|
-
searchFilter: string;
|
|
197
|
-
groupSearchBase?: string | undefined;
|
|
198
|
-
};
|
|
199
|
-
icon?: string | undefined;
|
|
200
|
-
active?: boolean | undefined;
|
|
201
|
-
registrationEnabled?: boolean | undefined;
|
|
252
|
+
createdAt: Date;
|
|
253
|
+
expires: Date;
|
|
254
|
+
identifier: string;
|
|
255
|
+
token: string;
|
|
202
256
|
}>;
|
|
203
|
-
export type
|
|
257
|
+
export type VerificationToken = z.infer<typeof VerificationTokenSchema>;
|
|
204
258
|
//# sourceMappingURL=identity.zod.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.zod.d.ts","sourceRoot":"","sources":["../../src/system/identity.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"identity.zod.d.ts","sourceRoot":"","sources":["../../src/system/identity.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AAEH;;;GAGG;AACH,eAAO,MAAM,UAAU;IACrB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAUH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,uBAAuB;IAClC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -1,68 +1,185 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.VerificationTokenSchema = exports.SessionSchema = exports.AccountSchema = exports.UserSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Identity & User Model Specification
|
|
7
|
+
*
|
|
8
|
+
* Defines the standard user, account, and session data models for ObjectStack.
|
|
9
|
+
* These schemas represent "who is logged in" and their associated data.
|
|
10
|
+
*
|
|
11
|
+
* This is separate from authentication configuration (auth.zod.ts) which
|
|
12
|
+
* defines "how to login".
|
|
8
13
|
*/
|
|
9
|
-
exports.AuthProtocol = zod_1.z.enum([
|
|
10
|
-
'oidc', // OpenID Connect (Modern standard)
|
|
11
|
-
'saml', // SAML 2.0 (Legacy Enterprise)
|
|
12
|
-
'ldap', // LDAP/Active Directory (On-premise)
|
|
13
|
-
'oauth2', // Generic OAuth2
|
|
14
|
-
'local', // Database username/password
|
|
15
|
-
'mock' // Testing
|
|
16
|
-
]);
|
|
17
14
|
/**
|
|
18
|
-
*
|
|
15
|
+
* User Schema
|
|
16
|
+
* Core user identity data model
|
|
19
17
|
*/
|
|
20
|
-
exports.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
exports.UserSchema = zod_1.z.object({
|
|
19
|
+
/**
|
|
20
|
+
* Unique user identifier
|
|
21
|
+
*/
|
|
22
|
+
id: zod_1.z.string().describe('Unique user identifier'),
|
|
23
|
+
/**
|
|
24
|
+
* User's email address (primary identifier)
|
|
25
|
+
*/
|
|
26
|
+
email: zod_1.z.string().email().describe('User email address'),
|
|
27
|
+
/**
|
|
28
|
+
* Email verification status
|
|
29
|
+
*/
|
|
30
|
+
emailVerified: zod_1.z.boolean().default(false).describe('Whether email is verified'),
|
|
31
|
+
/**
|
|
32
|
+
* User's display name
|
|
33
|
+
*/
|
|
34
|
+
name: zod_1.z.string().optional().describe('User display name'),
|
|
35
|
+
/**
|
|
36
|
+
* User's profile image URL
|
|
37
|
+
*/
|
|
38
|
+
image: zod_1.z.string().url().optional().describe('Profile image URL'),
|
|
39
|
+
/**
|
|
40
|
+
* Account creation timestamp
|
|
41
|
+
*/
|
|
42
|
+
createdAt: zod_1.z.date().describe('Account creation timestamp'),
|
|
43
|
+
/**
|
|
44
|
+
* Last update timestamp
|
|
45
|
+
*/
|
|
46
|
+
updatedAt: zod_1.z.date().describe('Last update timestamp'),
|
|
26
47
|
});
|
|
27
48
|
/**
|
|
28
|
-
*
|
|
49
|
+
* Account Schema
|
|
50
|
+
* Links external OAuth/OIDC/SAML accounts to a user
|
|
29
51
|
*/
|
|
30
|
-
exports.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
52
|
+
exports.AccountSchema = zod_1.z.object({
|
|
53
|
+
/**
|
|
54
|
+
* Unique account identifier
|
|
55
|
+
*/
|
|
56
|
+
id: zod_1.z.string().describe('Unique account identifier'),
|
|
57
|
+
/**
|
|
58
|
+
* Associated user ID
|
|
59
|
+
*/
|
|
60
|
+
userId: zod_1.z.string().describe('Associated user ID'),
|
|
61
|
+
/**
|
|
62
|
+
* Account type/provider
|
|
63
|
+
*/
|
|
64
|
+
type: zod_1.z.enum([
|
|
65
|
+
'oauth',
|
|
66
|
+
'oidc',
|
|
67
|
+
'email',
|
|
68
|
+
'credentials',
|
|
69
|
+
'saml',
|
|
70
|
+
'ldap',
|
|
71
|
+
]).describe('Account type'),
|
|
72
|
+
/**
|
|
73
|
+
* Provider name (e.g., 'google', 'github', 'okta')
|
|
74
|
+
*/
|
|
75
|
+
provider: zod_1.z.string().describe('Provider name'),
|
|
76
|
+
/**
|
|
77
|
+
* Provider account ID
|
|
78
|
+
*/
|
|
79
|
+
providerAccountId: zod_1.z.string().describe('Provider account ID'),
|
|
80
|
+
/**
|
|
81
|
+
* OAuth refresh token
|
|
82
|
+
*/
|
|
83
|
+
refreshToken: zod_1.z.string().optional().describe('OAuth refresh token'),
|
|
84
|
+
/**
|
|
85
|
+
* OAuth access token
|
|
86
|
+
*/
|
|
87
|
+
accessToken: zod_1.z.string().optional().describe('OAuth access token'),
|
|
88
|
+
/**
|
|
89
|
+
* Token expiry timestamp
|
|
90
|
+
*/
|
|
91
|
+
expiresAt: zod_1.z.number().optional().describe('Token expiry timestamp (Unix)'),
|
|
92
|
+
/**
|
|
93
|
+
* OAuth token type
|
|
94
|
+
*/
|
|
95
|
+
tokenType: zod_1.z.string().optional().describe('OAuth token type'),
|
|
96
|
+
/**
|
|
97
|
+
* OAuth scope
|
|
98
|
+
*/
|
|
99
|
+
scope: zod_1.z.string().optional().describe('OAuth scope'),
|
|
100
|
+
/**
|
|
101
|
+
* OAuth ID token
|
|
102
|
+
*/
|
|
103
|
+
idToken: zod_1.z.string().optional().describe('OAuth ID token'),
|
|
104
|
+
/**
|
|
105
|
+
* Session state
|
|
106
|
+
*/
|
|
107
|
+
sessionState: zod_1.z.string().optional().describe('Session state'),
|
|
108
|
+
/**
|
|
109
|
+
* Account creation timestamp
|
|
110
|
+
*/
|
|
111
|
+
createdAt: zod_1.z.date().describe('Account creation timestamp'),
|
|
112
|
+
/**
|
|
113
|
+
* Last update timestamp
|
|
114
|
+
*/
|
|
115
|
+
updatedAt: zod_1.z.date().describe('Last update timestamp'),
|
|
36
116
|
});
|
|
37
117
|
/**
|
|
38
|
-
*
|
|
118
|
+
* Session Schema
|
|
119
|
+
* User session data model
|
|
39
120
|
*/
|
|
40
|
-
exports.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
121
|
+
exports.SessionSchema = zod_1.z.object({
|
|
122
|
+
/**
|
|
123
|
+
* Unique session identifier
|
|
124
|
+
*/
|
|
125
|
+
id: zod_1.z.string().describe('Unique session identifier'),
|
|
126
|
+
/**
|
|
127
|
+
* Session token
|
|
128
|
+
*/
|
|
129
|
+
sessionToken: zod_1.z.string().describe('Session token'),
|
|
130
|
+
/**
|
|
131
|
+
* Associated user ID
|
|
132
|
+
*/
|
|
133
|
+
userId: zod_1.z.string().describe('Associated user ID'),
|
|
134
|
+
/**
|
|
135
|
+
* Active organization ID for this session
|
|
136
|
+
* Used for context switching in multi-tenant applications
|
|
137
|
+
*/
|
|
138
|
+
activeOrganizationId: zod_1.z.string().optional().describe('Active organization ID for context switching'),
|
|
139
|
+
/**
|
|
140
|
+
* Session expiry timestamp
|
|
141
|
+
*/
|
|
142
|
+
expires: zod_1.z.date().describe('Session expiry timestamp'),
|
|
143
|
+
/**
|
|
144
|
+
* Session creation timestamp
|
|
145
|
+
*/
|
|
146
|
+
createdAt: zod_1.z.date().describe('Session creation timestamp'),
|
|
147
|
+
/**
|
|
148
|
+
* Last update timestamp
|
|
149
|
+
*/
|
|
150
|
+
updatedAt: zod_1.z.date().describe('Last update timestamp'),
|
|
151
|
+
/**
|
|
152
|
+
* IP address of the session
|
|
153
|
+
*/
|
|
154
|
+
ipAddress: zod_1.z.string().optional().describe('IP address'),
|
|
155
|
+
/**
|
|
156
|
+
* User agent string
|
|
157
|
+
*/
|
|
158
|
+
userAgent: zod_1.z.string().optional().describe('User agent string'),
|
|
159
|
+
/**
|
|
160
|
+
* Device fingerprint
|
|
161
|
+
*/
|
|
162
|
+
fingerprint: zod_1.z.string().optional().describe('Device fingerprint'),
|
|
47
163
|
});
|
|
48
164
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
165
|
+
* Verification Token Schema
|
|
166
|
+
* Email verification and password reset tokens
|
|
51
167
|
*/
|
|
52
|
-
exports.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
168
|
+
exports.VerificationTokenSchema = zod_1.z.object({
|
|
169
|
+
/**
|
|
170
|
+
* Token identifier (email or phone)
|
|
171
|
+
*/
|
|
172
|
+
identifier: zod_1.z.string().describe('Token identifier (email or phone)'),
|
|
173
|
+
/**
|
|
174
|
+
* Verification token
|
|
175
|
+
*/
|
|
176
|
+
token: zod_1.z.string().describe('Verification token'),
|
|
177
|
+
/**
|
|
178
|
+
* Token expiry timestamp
|
|
179
|
+
*/
|
|
180
|
+
expires: zod_1.z.date().describe('Token expiry timestamp'),
|
|
181
|
+
/**
|
|
182
|
+
* Token creation timestamp
|
|
183
|
+
*/
|
|
184
|
+
createdAt: zod_1.z.date().describe('Token creation timestamp'),
|
|
68
185
|
});
|