@objectstack/spec 0.2.0 → 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/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 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -49
- 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 +1097 -65
- package/dist/system/auth.zod.d.ts.map +1 -1
- package/dist/system/auth.zod.js +135 -1
- 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/ui/action.zod.d.ts +2 -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/theme.zod.d.ts +6 -6
- package/json-schema/Account.json +87 -0
- package/json-schema/AuthConfig.json +235 -0
- package/json-schema/ChunkingStrategy.json +133 -0
- package/json-schema/DatabaseMapping.json +48 -0
- package/json-schema/DocumentChunk.json +97 -0
- package/json-schema/DocumentLoaderConfig.json +69 -0
- package/json-schema/DocumentMetadata.json +61 -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/FieldSynonymConfig.json +39 -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/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/OIDCConfig.json +18 -3
- package/json-schema/Organization.json +52 -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/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/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/StandardAuthProvider.json +235 -0
- package/json-schema/Timeframe.json +68 -0
- package/json-schema/User.json +51 -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,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
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System Protocol Exports
|
|
3
|
+
*
|
|
4
|
+
* Runtime Configuration & Security
|
|
5
|
+
* - Manifest (Config), Datasource
|
|
6
|
+
* - Role (Hierarchy), Identity (Auth)
|
|
7
|
+
* - Webhook (Integration), Policy (Compliance)
|
|
8
|
+
* - Plugin Architecture
|
|
9
|
+
*/
|
|
10
|
+
export * from './manifest.zod';
|
|
11
|
+
export * from './datasource.zod';
|
|
12
|
+
export * from './api.zod';
|
|
13
|
+
export * from './identity.zod';
|
|
14
|
+
export * from './auth.zod';
|
|
15
|
+
export * from './auth-protocol';
|
|
16
|
+
export * from './organization.zod';
|
|
17
|
+
export * from './policy.zod';
|
|
18
|
+
export * from './role.zod';
|
|
19
|
+
export * from './territory.zod';
|
|
20
|
+
export * from './license.zod';
|
|
21
|
+
export * from './webhook.zod';
|
|
22
|
+
export * from './translation.zod';
|
|
23
|
+
export * from './driver.zod';
|
|
24
|
+
export * from './discovery.zod';
|
|
25
|
+
export * from './plugin.zod';
|
|
26
|
+
export * from './constants';
|
|
27
|
+
export * from './types';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* System Protocol Exports
|
|
4
|
+
*
|
|
5
|
+
* Runtime Configuration & Security
|
|
6
|
+
* - Manifest (Config), Datasource
|
|
7
|
+
* - Role (Hierarchy), Identity (Auth)
|
|
8
|
+
* - Webhook (Integration), Policy (Compliance)
|
|
9
|
+
* - Plugin Architecture
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
__exportStar(require("./manifest.zod"), exports);
|
|
27
|
+
__exportStar(require("./datasource.zod"), exports);
|
|
28
|
+
__exportStar(require("./api.zod"), exports);
|
|
29
|
+
__exportStar(require("./identity.zod"), exports);
|
|
30
|
+
__exportStar(require("./auth.zod"), exports);
|
|
31
|
+
__exportStar(require("./auth-protocol"), exports);
|
|
32
|
+
__exportStar(require("./organization.zod"), exports);
|
|
33
|
+
__exportStar(require("./policy.zod"), exports);
|
|
34
|
+
__exportStar(require("./role.zod"), exports);
|
|
35
|
+
__exportStar(require("./territory.zod"), exports);
|
|
36
|
+
__exportStar(require("./license.zod"), exports);
|
|
37
|
+
__exportStar(require("./webhook.zod"), exports);
|
|
38
|
+
__exportStar(require("./translation.zod"), exports);
|
|
39
|
+
__exportStar(require("./driver.zod"), exports);
|
|
40
|
+
__exportStar(require("./discovery.zod"), exports);
|
|
41
|
+
__exportStar(require("./plugin.zod"), exports);
|
|
42
|
+
__exportStar(require("./constants"), exports);
|
|
43
|
+
__exportStar(require("./types"), exports);
|
|
@@ -283,11 +283,6 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
283
283
|
version: string;
|
|
284
284
|
description?: string | undefined;
|
|
285
285
|
objects?: string[] | undefined;
|
|
286
|
-
data?: {
|
|
287
|
-
object: string;
|
|
288
|
-
mode: "upsert" | "insert" | "ignore";
|
|
289
|
-
records: Record<string, any>[];
|
|
290
|
-
}[] | undefined;
|
|
291
286
|
permissions?: string[] | undefined;
|
|
292
287
|
datasources?: string[] | undefined;
|
|
293
288
|
dependencies?: Record<string, string> | undefined;
|
|
@@ -331,6 +326,11 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
331
326
|
locale: string;
|
|
332
327
|
}[] | undefined;
|
|
333
328
|
} | undefined;
|
|
329
|
+
data?: {
|
|
330
|
+
object: string;
|
|
331
|
+
mode: "upsert" | "insert" | "ignore";
|
|
332
|
+
records: Record<string, any>[];
|
|
333
|
+
}[] | undefined;
|
|
334
334
|
extensions?: Record<string, any> | undefined;
|
|
335
335
|
}, {
|
|
336
336
|
type: "app" | "plugin" | "driver" | "module";
|
|
@@ -339,11 +339,6 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
339
339
|
version: string;
|
|
340
340
|
description?: string | undefined;
|
|
341
341
|
objects?: string[] | undefined;
|
|
342
|
-
data?: {
|
|
343
|
-
object: string;
|
|
344
|
-
records: Record<string, any>[];
|
|
345
|
-
mode?: "upsert" | "insert" | "ignore" | undefined;
|
|
346
|
-
}[] | undefined;
|
|
347
342
|
permissions?: string[] | undefined;
|
|
348
343
|
datasources?: string[] | undefined;
|
|
349
344
|
dependencies?: Record<string, string> | undefined;
|
|
@@ -387,6 +382,11 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
387
382
|
locale: string;
|
|
388
383
|
}[] | undefined;
|
|
389
384
|
} | undefined;
|
|
385
|
+
data?: {
|
|
386
|
+
object: string;
|
|
387
|
+
records: Record<string, any>[];
|
|
388
|
+
mode?: "upsert" | "insert" | "ignore" | undefined;
|
|
389
|
+
}[] | undefined;
|
|
390
390
|
extensions?: Record<string, any> | undefined;
|
|
391
391
|
}>;
|
|
392
392
|
/**
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Organization Schema (Multi-Tenant Architecture)
|
|
4
|
+
*
|
|
5
|
+
* Defines the standard organization/workspace model for ObjectStack.
|
|
6
|
+
* Supports B2B SaaS scenarios where users belong to multiple teams/workspaces.
|
|
7
|
+
*
|
|
8
|
+
* This aligns with better-auth's organization plugin capabilities.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Organization Schema
|
|
12
|
+
* Represents a team, workspace, or tenant in a multi-tenant application
|
|
13
|
+
*/
|
|
14
|
+
export declare const OrganizationSchema: z.ZodObject<{
|
|
15
|
+
/**
|
|
16
|
+
* Unique organization identifier
|
|
17
|
+
*/
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
/**
|
|
20
|
+
* Organization name (display name)
|
|
21
|
+
*/
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
/**
|
|
24
|
+
* Organization slug (URL-friendly identifier)
|
|
25
|
+
* Must be unique across all organizations
|
|
26
|
+
*/
|
|
27
|
+
slug: z.ZodString;
|
|
28
|
+
/**
|
|
29
|
+
* Organization logo URL
|
|
30
|
+
*/
|
|
31
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
32
|
+
/**
|
|
33
|
+
* Custom metadata for the organization
|
|
34
|
+
* Can store additional configuration, settings, or custom fields
|
|
35
|
+
*/
|
|
36
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
37
|
+
/**
|
|
38
|
+
* Organization creation timestamp
|
|
39
|
+
*/
|
|
40
|
+
createdAt: z.ZodDate;
|
|
41
|
+
/**
|
|
42
|
+
* Last update timestamp
|
|
43
|
+
*/
|
|
44
|
+
updatedAt: z.ZodDate;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
name: string;
|
|
47
|
+
id: string;
|
|
48
|
+
createdAt: Date;
|
|
49
|
+
updatedAt: Date;
|
|
50
|
+
slug: string;
|
|
51
|
+
logo?: string | undefined;
|
|
52
|
+
metadata?: Record<string, any> | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
name: string;
|
|
55
|
+
id: string;
|
|
56
|
+
createdAt: Date;
|
|
57
|
+
updatedAt: Date;
|
|
58
|
+
slug: string;
|
|
59
|
+
logo?: string | undefined;
|
|
60
|
+
metadata?: Record<string, any> | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
export type Organization = z.infer<typeof OrganizationSchema>;
|
|
63
|
+
/**
|
|
64
|
+
* Organization Member Schema
|
|
65
|
+
* Links users to organizations with specific roles
|
|
66
|
+
*/
|
|
67
|
+
export declare const MemberSchema: z.ZodObject<{
|
|
68
|
+
/**
|
|
69
|
+
* Unique member identifier
|
|
70
|
+
*/
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
/**
|
|
73
|
+
* Organization ID this membership belongs to
|
|
74
|
+
*/
|
|
75
|
+
organizationId: z.ZodString;
|
|
76
|
+
/**
|
|
77
|
+
* User ID of the member
|
|
78
|
+
*/
|
|
79
|
+
userId: z.ZodString;
|
|
80
|
+
/**
|
|
81
|
+
* Member's role within the organization
|
|
82
|
+
* Common roles: 'owner', 'admin', 'member', 'guest'
|
|
83
|
+
* Can be customized per application
|
|
84
|
+
*/
|
|
85
|
+
role: z.ZodString;
|
|
86
|
+
/**
|
|
87
|
+
* Member creation timestamp
|
|
88
|
+
*/
|
|
89
|
+
createdAt: z.ZodDate;
|
|
90
|
+
/**
|
|
91
|
+
* Last update timestamp
|
|
92
|
+
*/
|
|
93
|
+
updatedAt: z.ZodDate;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
id: string;
|
|
96
|
+
userId: string;
|
|
97
|
+
createdAt: Date;
|
|
98
|
+
updatedAt: Date;
|
|
99
|
+
organizationId: string;
|
|
100
|
+
role: string;
|
|
101
|
+
}, {
|
|
102
|
+
id: string;
|
|
103
|
+
userId: string;
|
|
104
|
+
createdAt: Date;
|
|
105
|
+
updatedAt: Date;
|
|
106
|
+
organizationId: string;
|
|
107
|
+
role: string;
|
|
108
|
+
}>;
|
|
109
|
+
export type Member = z.infer<typeof MemberSchema>;
|
|
110
|
+
/**
|
|
111
|
+
* Invitation Status Enum
|
|
112
|
+
*/
|
|
113
|
+
export declare const InvitationStatus: z.ZodEnum<["pending", "accepted", "rejected", "expired"]>;
|
|
114
|
+
export type InvitationStatus = z.infer<typeof InvitationStatus>;
|
|
115
|
+
/**
|
|
116
|
+
* Organization Invitation Schema
|
|
117
|
+
* Represents an invitation to join an organization
|
|
118
|
+
*/
|
|
119
|
+
export declare const InvitationSchema: z.ZodObject<{
|
|
120
|
+
/**
|
|
121
|
+
* Unique invitation identifier
|
|
122
|
+
*/
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
/**
|
|
125
|
+
* Organization ID the invitation is for
|
|
126
|
+
*/
|
|
127
|
+
organizationId: z.ZodString;
|
|
128
|
+
/**
|
|
129
|
+
* Email address of the invitee
|
|
130
|
+
*/
|
|
131
|
+
email: z.ZodString;
|
|
132
|
+
/**
|
|
133
|
+
* Role the invitee will receive upon accepting
|
|
134
|
+
* Common roles: 'admin', 'member', 'guest'
|
|
135
|
+
*/
|
|
136
|
+
role: z.ZodString;
|
|
137
|
+
/**
|
|
138
|
+
* Invitation status
|
|
139
|
+
*/
|
|
140
|
+
status: z.ZodDefault<z.ZodEnum<["pending", "accepted", "rejected", "expired"]>>;
|
|
141
|
+
/**
|
|
142
|
+
* Invitation expiration timestamp
|
|
143
|
+
*/
|
|
144
|
+
expiresAt: z.ZodDate;
|
|
145
|
+
/**
|
|
146
|
+
* User ID of the person who sent the invitation
|
|
147
|
+
*/
|
|
148
|
+
inviterId: z.ZodString;
|
|
149
|
+
/**
|
|
150
|
+
* Invitation creation timestamp
|
|
151
|
+
*/
|
|
152
|
+
createdAt: z.ZodDate;
|
|
153
|
+
/**
|
|
154
|
+
* Last update timestamp
|
|
155
|
+
*/
|
|
156
|
+
updatedAt: z.ZodDate;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
email: string;
|
|
159
|
+
status: "pending" | "accepted" | "rejected" | "expired";
|
|
160
|
+
id: string;
|
|
161
|
+
createdAt: Date;
|
|
162
|
+
updatedAt: Date;
|
|
163
|
+
expiresAt: Date;
|
|
164
|
+
organizationId: string;
|
|
165
|
+
role: string;
|
|
166
|
+
inviterId: string;
|
|
167
|
+
}, {
|
|
168
|
+
email: string;
|
|
169
|
+
id: string;
|
|
170
|
+
createdAt: Date;
|
|
171
|
+
updatedAt: Date;
|
|
172
|
+
expiresAt: Date;
|
|
173
|
+
organizationId: string;
|
|
174
|
+
role: string;
|
|
175
|
+
inviterId: string;
|
|
176
|
+
status?: "pending" | "accepted" | "rejected" | "expired" | undefined;
|
|
177
|
+
}>;
|
|
178
|
+
export type Invitation = z.infer<typeof InvitationSchema>;
|
|
179
|
+
//# sourceMappingURL=organization.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization.zod.d.ts","sourceRoot":"","sources":["../../src/system/organization.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB;IAC7B;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAKH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,2DAAyD,CAAC;AAEvF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvitationSchema = exports.InvitationStatus = exports.MemberSchema = exports.OrganizationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Organization Schema (Multi-Tenant Architecture)
|
|
7
|
+
*
|
|
8
|
+
* Defines the standard organization/workspace model for ObjectStack.
|
|
9
|
+
* Supports B2B SaaS scenarios where users belong to multiple teams/workspaces.
|
|
10
|
+
*
|
|
11
|
+
* This aligns with better-auth's organization plugin capabilities.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Organization Schema
|
|
15
|
+
* Represents a team, workspace, or tenant in a multi-tenant application
|
|
16
|
+
*/
|
|
17
|
+
exports.OrganizationSchema = zod_1.z.object({
|
|
18
|
+
/**
|
|
19
|
+
* Unique organization identifier
|
|
20
|
+
*/
|
|
21
|
+
id: zod_1.z.string().describe('Unique organization identifier'),
|
|
22
|
+
/**
|
|
23
|
+
* Organization name (display name)
|
|
24
|
+
*/
|
|
25
|
+
name: zod_1.z.string().describe('Organization display name'),
|
|
26
|
+
/**
|
|
27
|
+
* Organization slug (URL-friendly identifier)
|
|
28
|
+
* Must be unique across all organizations
|
|
29
|
+
*/
|
|
30
|
+
slug: zod_1.z.string()
|
|
31
|
+
.regex(/^[a-z0-9_-]+$/)
|
|
32
|
+
.describe('Unique URL-friendly slug (lowercase alphanumeric, hyphens, underscores)'),
|
|
33
|
+
/**
|
|
34
|
+
* Organization logo URL
|
|
35
|
+
*/
|
|
36
|
+
logo: zod_1.z.string().url().optional().describe('Organization logo URL'),
|
|
37
|
+
/**
|
|
38
|
+
* Custom metadata for the organization
|
|
39
|
+
* Can store additional configuration, settings, or custom fields
|
|
40
|
+
*/
|
|
41
|
+
metadata: zod_1.z.record(zod_1.z.any()).optional().describe('Custom metadata'),
|
|
42
|
+
/**
|
|
43
|
+
* Organization creation timestamp
|
|
44
|
+
*/
|
|
45
|
+
createdAt: zod_1.z.date().describe('Organization creation timestamp'),
|
|
46
|
+
/**
|
|
47
|
+
* Last update timestamp
|
|
48
|
+
*/
|
|
49
|
+
updatedAt: zod_1.z.date().describe('Last update timestamp'),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Organization Member Schema
|
|
53
|
+
* Links users to organizations with specific roles
|
|
54
|
+
*/
|
|
55
|
+
exports.MemberSchema = zod_1.z.object({
|
|
56
|
+
/**
|
|
57
|
+
* Unique member identifier
|
|
58
|
+
*/
|
|
59
|
+
id: zod_1.z.string().describe('Unique member identifier'),
|
|
60
|
+
/**
|
|
61
|
+
* Organization ID this membership belongs to
|
|
62
|
+
*/
|
|
63
|
+
organizationId: zod_1.z.string().describe('Organization ID'),
|
|
64
|
+
/**
|
|
65
|
+
* User ID of the member
|
|
66
|
+
*/
|
|
67
|
+
userId: zod_1.z.string().describe('User ID'),
|
|
68
|
+
/**
|
|
69
|
+
* Member's role within the organization
|
|
70
|
+
* Common roles: 'owner', 'admin', 'member', 'guest'
|
|
71
|
+
* Can be customized per application
|
|
72
|
+
*/
|
|
73
|
+
role: zod_1.z.string().describe('Member role (e.g., owner, admin, member, guest)'),
|
|
74
|
+
/**
|
|
75
|
+
* Member creation timestamp
|
|
76
|
+
*/
|
|
77
|
+
createdAt: zod_1.z.date().describe('Member creation timestamp'),
|
|
78
|
+
/**
|
|
79
|
+
* Last update timestamp
|
|
80
|
+
*/
|
|
81
|
+
updatedAt: zod_1.z.date().describe('Last update timestamp'),
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* Invitation Status Enum
|
|
85
|
+
*/
|
|
86
|
+
exports.InvitationStatus = zod_1.z.enum(['pending', 'accepted', 'rejected', 'expired']);
|
|
87
|
+
/**
|
|
88
|
+
* Organization Invitation Schema
|
|
89
|
+
* Represents an invitation to join an organization
|
|
90
|
+
*/
|
|
91
|
+
exports.InvitationSchema = zod_1.z.object({
|
|
92
|
+
/**
|
|
93
|
+
* Unique invitation identifier
|
|
94
|
+
*/
|
|
95
|
+
id: zod_1.z.string().describe('Unique invitation identifier'),
|
|
96
|
+
/**
|
|
97
|
+
* Organization ID the invitation is for
|
|
98
|
+
*/
|
|
99
|
+
organizationId: zod_1.z.string().describe('Organization ID'),
|
|
100
|
+
/**
|
|
101
|
+
* Email address of the invitee
|
|
102
|
+
*/
|
|
103
|
+
email: zod_1.z.string().email().describe('Invitee email address'),
|
|
104
|
+
/**
|
|
105
|
+
* Role the invitee will receive upon accepting
|
|
106
|
+
* Common roles: 'admin', 'member', 'guest'
|
|
107
|
+
*/
|
|
108
|
+
role: zod_1.z.string().describe('Role to assign upon acceptance'),
|
|
109
|
+
/**
|
|
110
|
+
* Invitation status
|
|
111
|
+
*/
|
|
112
|
+
status: exports.InvitationStatus.default('pending').describe('Invitation status'),
|
|
113
|
+
/**
|
|
114
|
+
* Invitation expiration timestamp
|
|
115
|
+
*/
|
|
116
|
+
expiresAt: zod_1.z.date().describe('Invitation expiry timestamp'),
|
|
117
|
+
/**
|
|
118
|
+
* User ID of the person who sent the invitation
|
|
119
|
+
*/
|
|
120
|
+
inviterId: zod_1.z.string().describe('User ID of the inviter'),
|
|
121
|
+
/**
|
|
122
|
+
* Invitation creation timestamp
|
|
123
|
+
*/
|
|
124
|
+
createdAt: zod_1.z.date().describe('Invitation creation timestamp'),
|
|
125
|
+
/**
|
|
126
|
+
* Last update timestamp
|
|
127
|
+
*/
|
|
128
|
+
updatedAt: zod_1.z.date().describe('Last update timestamp'),
|
|
129
|
+
});
|