@objectstack/spec 0.1.1 → 0.2.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 +73 -1
- package/dist/api/contract.zod.d.ts +1733 -0
- package/dist/api/contract.zod.d.ts.map +1 -0
- package/dist/api/contract.zod.js +138 -0
- package/dist/data/dataset.zod.d.ts +2 -2
- package/dist/data/field.zod.d.ts +1648 -10
- package/dist/data/field.zod.d.ts.map +1 -1
- package/dist/data/field.zod.js +149 -8
- 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/mapping.zod.d.ts +215 -2
- package/dist/data/mapping.zod.d.ts.map +1 -1
- package/dist/data/object.zod.d.ts +505 -25
- package/dist/data/object.zod.d.ts.map +1 -1
- package/dist/data/object.zod.js +32 -5
- package/dist/data/query.zod.d.ts +349 -0
- package/dist/data/query.zod.d.ts.map +1 -1
- package/dist/data/query.zod.js +77 -1
- package/dist/data/trigger.zod.d.ts +354 -0
- package/dist/data/trigger.zod.d.ts.map +1 -0
- package/dist/data/trigger.zod.js +195 -0
- package/dist/data/validation.zod.d.ts +83 -43
- package/dist/data/validation.zod.d.ts.map +1 -1
- package/dist/data/validation.zod.js +51 -5
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/system/api.zod.d.ts +130 -4
- package/dist/system/api.zod.d.ts.map +1 -1
- package/dist/system/api.zod.js +4 -1
- package/dist/system/auth.zod.d.ts +2287 -0
- package/dist/system/auth.zod.d.ts.map +1 -0
- package/dist/system/auth.zod.js +365 -0
- package/dist/system/datasource.zod.d.ts +193 -30
- package/dist/system/datasource.zod.d.ts.map +1 -1
- package/dist/system/datasource.zod.js +58 -11
- package/dist/system/discovery.zod.d.ts +174 -0
- package/dist/system/discovery.zod.d.ts.map +1 -0
- package/dist/system/discovery.zod.js +53 -0
- package/dist/system/driver.zod.d.ts +1631 -0
- package/dist/system/driver.zod.d.ts.map +1 -0
- package/dist/system/driver.zod.js +337 -0
- package/dist/system/license.zod.d.ts +2 -2
- package/dist/system/manifest.zod.d.ts +323 -52
- package/dist/system/manifest.zod.d.ts.map +1 -1
- package/dist/system/manifest.zod.js +91 -17
- package/dist/system/plugin.zod.d.ts +3516 -0
- package/dist/system/plugin.zod.d.ts.map +1 -0
- package/dist/system/plugin.zod.js +226 -0
- package/dist/system/policy.zod.d.ts +10 -10
- package/dist/system/territory.zod.d.ts +1 -1
- package/dist/system/webhook.zod.d.ts +3 -3
- package/dist/ui/action.zod.d.ts +19 -12
- package/dist/ui/action.zod.d.ts.map +1 -1
- package/dist/ui/action.zod.js +7 -1
- package/dist/ui/app.zod.d.ts +109 -3
- package/dist/ui/app.zod.d.ts.map +1 -1
- package/dist/ui/app.zod.js +13 -2
- package/dist/ui/dashboard.zod.d.ts +19 -13
- package/dist/ui/dashboard.zod.d.ts.map +1 -1
- package/dist/ui/dashboard.zod.js +10 -3
- package/dist/ui/page.zod.d.ts +6 -6
- package/dist/ui/report.zod.d.ts +13 -32
- package/dist/ui/report.zod.d.ts.map +1 -1
- package/dist/ui/report.zod.js +10 -9
- package/dist/ui/theme.zod.d.ts +1221 -0
- package/dist/ui/theme.zod.d.ts.map +1 -0
- package/dist/ui/theme.zod.js +202 -0
- package/dist/ui/widget.zod.d.ts +350 -0
- package/dist/ui/widget.zod.d.ts.map +1 -0
- package/dist/ui/widget.zod.js +66 -0
- package/json-schema/AccountLinkingConfig.json +27 -0
- package/json-schema/Action.json +8 -2
- package/json-schema/ActionParam.json +8 -2
- package/json-schema/Address.json +40 -0
- package/json-schema/AggregationFunction.json +19 -0
- package/json-schema/AggregationNode.json +42 -0
- package/json-schema/Animation.json +56 -0
- package/json-schema/ApiCapabilities.json +28 -0
- package/json-schema/ApiError.json +27 -0
- package/json-schema/ApiRoutes.json +41 -0
- package/json-schema/App.json +13 -2
- package/json-schema/AsyncValidation.json +70 -0
- package/json-schema/AuthConfig.json +606 -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/BaseResponse.json +63 -0
- package/json-schema/BorderRadius.json +44 -0
- package/json-schema/Breakpoints.json +36 -0
- package/json-schema/BulkRequest.json +29 -0
- package/json-schema/BulkResponse.json +108 -0
- package/json-schema/CSRFConfig.json +31 -0
- package/json-schema/ColorPalette.json +83 -0
- package/json-schema/ComparisonOperator.json +56 -0
- package/json-schema/ConditionalValidation.json +793 -0
- package/json-schema/CreateRequest.json +20 -0
- package/json-schema/CrossFieldValidation.json +56 -0
- package/json-schema/CustomValidator.json +57 -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/Datasource.json +25 -23
- package/json-schema/DatasourceCapabilities.json +25 -5
- package/json-schema/DeleteResponse.json +68 -0
- package/json-schema/Discovery.json +114 -0
- package/json-schema/DriverCapabilities.json +69 -0
- package/json-schema/DriverDefinition.json +86 -0
- package/json-schema/DriverInterface.json +88 -0
- package/json-schema/DriverOptions.json +23 -0
- package/json-schema/DriverType.json +1 -18
- package/json-schema/EmailPasswordConfig.json +43 -0
- package/json-schema/EqualityOperator.json +14 -0
- package/json-schema/ExportRequest.json +786 -0
- package/json-schema/Field.json +75 -4
- package/json-schema/FieldOperators.json +108 -0
- package/json-schema/FieldType.json +8 -2
- package/json-schema/FieldWidgetProps.json +327 -0
- package/json-schema/FilterCondition.json +28 -0
- package/json-schema/I18nContext.json +12 -0
- package/json-schema/JoinNode.json +455 -0
- package/json-schema/JoinType.json +15 -0
- package/json-schema/ListRecordResponse.json +103 -0
- package/json-schema/LocationCoordinates.json +36 -0
- package/json-schema/Logger.json +25 -0
- package/json-schema/MagicLinkConfig.json +21 -0
- package/json-schema/Manifest.json +243 -18
- package/json-schema/Mapping.json +328 -0
- package/json-schema/ModificationResult.json +46 -0
- package/json-schema/NormalizedFilter.json +348 -0
- package/json-schema/OAuthProvider.json +66 -0
- package/json-schema/Object.json +103 -6
- package/json-schema/ObjectCapabilities.json +26 -0
- package/json-schema/ObjectQLClient.json +12 -0
- package/json-schema/PasskeyConfig.json +54 -0
- package/json-schema/Plugin.json +20 -0
- package/json-schema/PluginContext.json +91 -0
- package/json-schema/PluginLifecycle.json +11 -0
- package/json-schema/Query.json +328 -0
- package/json-schema/QueryFilter.json +34 -0
- package/json-schema/RangeOperator.json +41 -0
- package/json-schema/RateLimitConfig.json +36 -0
- package/json-schema/RecordData.json +11 -0
- package/json-schema/Report.json +20 -26
- package/json-schema/Router.json +12 -0
- package/json-schema/Scheduler.json +12 -0
- package/json-schema/ScopedStorage.json +12 -0
- package/json-schema/SessionConfig.json +56 -0
- package/json-schema/SetOperator.json +18 -0
- package/json-schema/Shadow.json +44 -0
- package/json-schema/SingleRecordResponse.json +69 -0
- package/json-schema/Spacing.json +64 -0
- package/json-schema/SpecialOperator.json +18 -0
- package/json-schema/StandardAuthProvider.json +622 -0
- package/json-schema/StringOperator.json +21 -0
- package/json-schema/SystemAPI.json +12 -0
- package/json-schema/Theme.json +543 -0
- package/json-schema/ThemeMode.json +14 -0
- package/json-schema/Trigger.json +73 -0
- package/json-schema/TriggerAction.json +14 -0
- package/json-schema/TriggerContext.json +61 -0
- package/json-schema/TriggerTiming.json +13 -0
- package/json-schema/TwoFactorConfig.json +40 -0
- package/json-schema/Typography.json +142 -0
- package/json-schema/UpdateRequest.json +20 -0
- package/json-schema/UserFieldMapping.json +47 -0
- package/json-schema/ValidationRule.json +583 -0
- package/json-schema/WindowFunction.json +24 -0
- package/json-schema/WindowFunctionNode.json +104 -0
- package/json-schema/WindowSpec.json +65 -0
- package/json-schema/ZIndex.json +44 -0
- package/package.json +8 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource.zod.d.ts","sourceRoot":"","sources":["../../src/system/datasource.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"datasource.zod.d.ts","sourceRoot":"","sources":["../../src/system/datasource.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,cAAc,+KAMjB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,UAAU,aAAsD,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;IAMjC;;;;OAIG;;IAGH;;;OAGG;;QAeH,oCAAoC;;QAOpC,iDAAiD;;QAGjD,oDAAoD;;QAGpD,oCAAoC;;QAGpC,2CAA2C;;QAG3C,oCAAoC;;QAGpC,8BAA8B;;QAG9B,2CAA2C;;QAO3C,oCAAoC;;QAGpC,oBAAoB;;QAGpB,+CAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAnD/C,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;IAKjC,oCAAoC;;IAOpC,iDAAiD;;IAGjD,oDAAoD;;IAGpD,oCAAoC;;IAGpC,2CAA2C;;IAG3C,oCAAoC;;IAGpC,8BAA8B;;IAG9B,2CAA2C;;IAO3C,oCAAoC;;IAGpC,oBAAoB;;IAGpB,+CAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;EAE/C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAC3B,mBAAmB;;IAGnB,kBAAkB;;IAGlB,aAAa;;IAGb;;;;OAIG;;IAGH;;;OAGG;;QAlEH,oCAAoC;;QAOpC,iDAAiD;;QAGjD,oDAAoD;;QAGpD,oCAAoC;;QAGpC,2CAA2C;;QAG3C,oCAAoC;;QAGpC,8BAA8B;;QAG9B,2CAA2C;;QAO3C,oCAAoC;;QAGpC,oBAAoB;;QAGpB,+CAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+B/C,kBAAkB;;IAGlB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DatasourceSchema = exports.DatasourceCapabilities = exports.DriverType = void 0;
|
|
3
|
+
exports.DatasourceSchema = exports.DatasourceCapabilities = exports.DriverDefinitionSchema = exports.DriverType = exports.BuiltInDrivers = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
/**
|
|
6
|
-
* Driver Type Enum
|
|
7
|
-
*
|
|
6
|
+
* Driver Type Enum (Built-in)
|
|
7
|
+
* Standard drivers supported by the core platform.
|
|
8
|
+
* Plugins can register additional drivers using different identifiers.
|
|
8
9
|
*/
|
|
9
|
-
exports.
|
|
10
|
+
exports.BuiltInDrivers = [
|
|
10
11
|
'postgres', 'mysql', 'sqlserver', 'oracle', 'sqlite', // SQL
|
|
11
12
|
'mongo', 'redis', // NoSQL
|
|
12
13
|
'excel', 'csv', 'airtable', // Spreadsheet / Low-code
|
|
13
14
|
'rest_api', 'graphql', 'odata', // Web Services
|
|
14
15
|
'salesforce', 'sap', 'workday' // Enterprise SaaS
|
|
15
|
-
]
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* Driver Identifier
|
|
19
|
+
* Can be a built-in driver or a plugin-contributed driver (e.g., "com.vendor.snowflake").
|
|
20
|
+
*/
|
|
21
|
+
exports.DriverType = zod_1.z.string().describe('Underlying driver identifier');
|
|
22
|
+
/**
|
|
23
|
+
* Driver Definition Schema
|
|
24
|
+
* Metadata describing a Database Driver.
|
|
25
|
+
* Plugins use this to register new connectivity options.
|
|
26
|
+
*/
|
|
27
|
+
exports.DriverDefinitionSchema = zod_1.z.object({
|
|
28
|
+
id: zod_1.z.string().describe('Unique driver identifier (e.g. "postgres")'),
|
|
29
|
+
label: zod_1.z.string().describe('Display label (e.g. "PostgreSQL")'),
|
|
30
|
+
description: zod_1.z.string().optional(),
|
|
31
|
+
icon: zod_1.z.string().optional(),
|
|
32
|
+
/**
|
|
33
|
+
* Configuration Schema (JSON Schema)
|
|
34
|
+
* Describes the structure of the `config` object needed for this driver.
|
|
35
|
+
* Used by the UI to generate the connection form.
|
|
36
|
+
*/
|
|
37
|
+
configSchema: zod_1.z.record(zod_1.z.any()).describe('JSON Schema for connection configuration'),
|
|
38
|
+
/**
|
|
39
|
+
* Default Capabilities
|
|
40
|
+
* What this driver supports out-of-the-box.
|
|
41
|
+
*/
|
|
42
|
+
capabilities: zod_1.z.lazy(() => exports.DatasourceCapabilities).optional(),
|
|
43
|
+
});
|
|
16
44
|
/**
|
|
17
45
|
* Datasource Capabilities Schema
|
|
18
46
|
* Declares what this datasource naturally supports.
|
|
@@ -20,18 +48,37 @@ exports.DriverType = zod_1.z.enum([
|
|
|
20
48
|
* and what to compute in memory.
|
|
21
49
|
*/
|
|
22
50
|
exports.DatasourceCapabilities = zod_1.z.object({
|
|
23
|
-
|
|
24
|
-
|
|
51
|
+
// ============================================================================
|
|
52
|
+
// Transaction & Connection Management
|
|
53
|
+
// ============================================================================
|
|
25
54
|
/** Can handle ACID transactions? */
|
|
26
55
|
transactions: zod_1.z.boolean().default(false),
|
|
56
|
+
// ============================================================================
|
|
57
|
+
// Query Operations
|
|
58
|
+
// ============================================================================
|
|
59
|
+
/** Can execute WHERE clause filters natively? */
|
|
60
|
+
queryFilters: zod_1.z.boolean().default(false),
|
|
61
|
+
/** Can perform aggregation (group by, sum, avg)? */
|
|
62
|
+
queryAggregations: zod_1.z.boolean().default(false),
|
|
63
|
+
/** Can perform ORDER BY sorting? */
|
|
64
|
+
querySorting: zod_1.z.boolean().default(false),
|
|
65
|
+
/** Can perform LIMIT/OFFSET pagination? */
|
|
66
|
+
queryPagination: zod_1.z.boolean().default(false),
|
|
67
|
+
/** Can perform window functions? */
|
|
68
|
+
queryWindowFunctions: zod_1.z.boolean().default(false),
|
|
69
|
+
/** Can perform subqueries? */
|
|
70
|
+
querySubqueries: zod_1.z.boolean().default(false),
|
|
71
|
+
/** Can execute SQL-like joins natively? */
|
|
72
|
+
joins: zod_1.z.boolean().default(false),
|
|
73
|
+
// ============================================================================
|
|
74
|
+
// Advanced Features
|
|
75
|
+
// ============================================================================
|
|
27
76
|
/** Can perform full-text search? */
|
|
28
77
|
fullTextSearch: zod_1.z.boolean().default(false),
|
|
29
|
-
/** Can perform aggregation (group by, sum, avg)? */
|
|
30
|
-
aggregation: zod_1.z.boolean().default(false),
|
|
31
|
-
/** Is scheme-less (needs schema inference)? */
|
|
32
|
-
dynamicSchema: zod_1.z.boolean().default(false),
|
|
33
78
|
/** Is read-only? */
|
|
34
79
|
readOnly: zod_1.z.boolean().default(false),
|
|
80
|
+
/** Is scheme-less (needs schema inference)? */
|
|
81
|
+
dynamicSchema: zod_1.z.boolean().default(false),
|
|
35
82
|
});
|
|
36
83
|
/**
|
|
37
84
|
* Datasource Schema
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* API Capabilities Schema
|
|
4
|
+
* Defines what features are enabled on this ObjectOS instance.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ApiCapabilitiesSchema: z.ZodObject<{
|
|
7
|
+
graphql: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
search: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
websockets: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
files: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
search: boolean;
|
|
13
|
+
files: boolean;
|
|
14
|
+
graphql: boolean;
|
|
15
|
+
websockets: boolean;
|
|
16
|
+
}, {
|
|
17
|
+
search?: boolean | undefined;
|
|
18
|
+
files?: boolean | undefined;
|
|
19
|
+
graphql?: boolean | undefined;
|
|
20
|
+
websockets?: boolean | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* API Routes Schema
|
|
24
|
+
* The "Map" for the frontend to know where to send requests.
|
|
25
|
+
* This decouples the frontend from hardcoded URL paths.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ApiRoutesSchema: z.ZodObject<{
|
|
28
|
+
/** Base URL for Object CRUD (Standard Data API) */
|
|
29
|
+
data: z.ZodString;
|
|
30
|
+
/** Base URL for Schema Definitions (Metadata API) */
|
|
31
|
+
metadata: z.ZodString;
|
|
32
|
+
/** Base URL for Authentication */
|
|
33
|
+
auth: z.ZodString;
|
|
34
|
+
/** Base URL for Server Actions/Flows */
|
|
35
|
+
actions: z.ZodOptional<z.ZodString>;
|
|
36
|
+
/** Base URL for File/Storage operations */
|
|
37
|
+
storage: z.ZodOptional<z.ZodString>;
|
|
38
|
+
/** GraphQL Endpoint (if enabled) */
|
|
39
|
+
graphql: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
data: string;
|
|
42
|
+
metadata: string;
|
|
43
|
+
auth: string;
|
|
44
|
+
actions?: string | undefined;
|
|
45
|
+
graphql?: string | undefined;
|
|
46
|
+
storage?: string | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
data: string;
|
|
49
|
+
metadata: string;
|
|
50
|
+
auth: string;
|
|
51
|
+
actions?: string | undefined;
|
|
52
|
+
graphql?: string | undefined;
|
|
53
|
+
storage?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Discovery Response Schema
|
|
57
|
+
* The root object returned by the Metadata Discovery Endpoint.
|
|
58
|
+
*/
|
|
59
|
+
export declare const DiscoverySchema: z.ZodObject<{
|
|
60
|
+
/** System Identity */
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
version: z.ZodString;
|
|
63
|
+
environment: z.ZodEnum<["production", "sandbox", "development"]>;
|
|
64
|
+
/** Dynamic Routing */
|
|
65
|
+
routes: z.ZodObject<{
|
|
66
|
+
/** Base URL for Object CRUD (Standard Data API) */
|
|
67
|
+
data: z.ZodString;
|
|
68
|
+
/** Base URL for Schema Definitions (Metadata API) */
|
|
69
|
+
metadata: z.ZodString;
|
|
70
|
+
/** Base URL for Authentication */
|
|
71
|
+
auth: z.ZodString;
|
|
72
|
+
/** Base URL for Server Actions/Flows */
|
|
73
|
+
actions: z.ZodOptional<z.ZodString>;
|
|
74
|
+
/** Base URL for File/Storage operations */
|
|
75
|
+
storage: z.ZodOptional<z.ZodString>;
|
|
76
|
+
/** GraphQL Endpoint (if enabled) */
|
|
77
|
+
graphql: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
data: string;
|
|
80
|
+
metadata: string;
|
|
81
|
+
auth: string;
|
|
82
|
+
actions?: string | undefined;
|
|
83
|
+
graphql?: string | undefined;
|
|
84
|
+
storage?: string | undefined;
|
|
85
|
+
}, {
|
|
86
|
+
data: string;
|
|
87
|
+
metadata: string;
|
|
88
|
+
auth: string;
|
|
89
|
+
actions?: string | undefined;
|
|
90
|
+
graphql?: string | undefined;
|
|
91
|
+
storage?: string | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
/** Feature Flags */
|
|
94
|
+
features: z.ZodObject<{
|
|
95
|
+
graphql: z.ZodDefault<z.ZodBoolean>;
|
|
96
|
+
search: z.ZodDefault<z.ZodBoolean>;
|
|
97
|
+
websockets: z.ZodDefault<z.ZodBoolean>;
|
|
98
|
+
files: z.ZodDefault<z.ZodBoolean>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
search: boolean;
|
|
101
|
+
files: boolean;
|
|
102
|
+
graphql: boolean;
|
|
103
|
+
websockets: boolean;
|
|
104
|
+
}, {
|
|
105
|
+
search?: boolean | undefined;
|
|
106
|
+
files?: boolean | undefined;
|
|
107
|
+
graphql?: boolean | undefined;
|
|
108
|
+
websockets?: boolean | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
/** Localization Info (helping frontend init i18n) */
|
|
111
|
+
locale: z.ZodObject<{
|
|
112
|
+
default: z.ZodString;
|
|
113
|
+
supported: z.ZodArray<z.ZodString, "many">;
|
|
114
|
+
timezone: z.ZodString;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
default: string;
|
|
117
|
+
supported: string[];
|
|
118
|
+
timezone: string;
|
|
119
|
+
}, {
|
|
120
|
+
default: string;
|
|
121
|
+
supported: string[];
|
|
122
|
+
timezone: string;
|
|
123
|
+
}>;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
name: string;
|
|
126
|
+
version: string;
|
|
127
|
+
locale: {
|
|
128
|
+
default: string;
|
|
129
|
+
supported: string[];
|
|
130
|
+
timezone: string;
|
|
131
|
+
};
|
|
132
|
+
features: {
|
|
133
|
+
search: boolean;
|
|
134
|
+
files: boolean;
|
|
135
|
+
graphql: boolean;
|
|
136
|
+
websockets: boolean;
|
|
137
|
+
};
|
|
138
|
+
environment: "production" | "sandbox" | "development";
|
|
139
|
+
routes: {
|
|
140
|
+
data: string;
|
|
141
|
+
metadata: string;
|
|
142
|
+
auth: string;
|
|
143
|
+
actions?: string | undefined;
|
|
144
|
+
graphql?: string | undefined;
|
|
145
|
+
storage?: string | undefined;
|
|
146
|
+
};
|
|
147
|
+
}, {
|
|
148
|
+
name: string;
|
|
149
|
+
version: string;
|
|
150
|
+
locale: {
|
|
151
|
+
default: string;
|
|
152
|
+
supported: string[];
|
|
153
|
+
timezone: string;
|
|
154
|
+
};
|
|
155
|
+
features: {
|
|
156
|
+
search?: boolean | undefined;
|
|
157
|
+
files?: boolean | undefined;
|
|
158
|
+
graphql?: boolean | undefined;
|
|
159
|
+
websockets?: boolean | undefined;
|
|
160
|
+
};
|
|
161
|
+
environment: "production" | "sandbox" | "development";
|
|
162
|
+
routes: {
|
|
163
|
+
data: string;
|
|
164
|
+
metadata: string;
|
|
165
|
+
auth: string;
|
|
166
|
+
actions?: string | undefined;
|
|
167
|
+
graphql?: string | undefined;
|
|
168
|
+
storage?: string | undefined;
|
|
169
|
+
};
|
|
170
|
+
}>;
|
|
171
|
+
export type DiscoveryResponse = z.infer<typeof DiscoverySchema>;
|
|
172
|
+
export type ApiRoutes = z.infer<typeof ApiRoutesSchema>;
|
|
173
|
+
export type ApiCapabilities = z.infer<typeof ApiCapabilitiesSchema>;
|
|
174
|
+
//# sourceMappingURL=discovery.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.zod.d.ts","sourceRoot":"","sources":["../../src/system/discovery.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAKhC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe;IAC1B,mDAAmD;;IAGnD,qDAAqD;;IAGrD,kCAAkC;;IAGlC,wCAAwC;;IAGxC,2CAA2C;;IAG3C,oCAAoC;;;;;;;;;;;;;;;;EAEpC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,sBAAsB;;;;IAKtB,sBAAsB;;QA7BtB,mDAAmD;;QAGnD,qDAAqD;;QAGrD,kCAAkC;;QAGlC,wCAAwC;;QAGxC,2CAA2C;;QAG3C,oCAAoC;;;;;;;;;;;;;;;;;IAiBpC,oBAAoB;;;;;;;;;;;;;;;;;IAGpB,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMrD,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAChE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscoverySchema = exports.ApiRoutesSchema = exports.ApiCapabilitiesSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* API Capabilities Schema
|
|
7
|
+
* Defines what features are enabled on this ObjectOS instance.
|
|
8
|
+
*/
|
|
9
|
+
exports.ApiCapabilitiesSchema = zod_1.z.object({
|
|
10
|
+
graphql: zod_1.z.boolean().default(false),
|
|
11
|
+
search: zod_1.z.boolean().default(false),
|
|
12
|
+
websockets: zod_1.z.boolean().default(false),
|
|
13
|
+
files: zod_1.z.boolean().default(true),
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* API Routes Schema
|
|
17
|
+
* The "Map" for the frontend to know where to send requests.
|
|
18
|
+
* This decouples the frontend from hardcoded URL paths.
|
|
19
|
+
*/
|
|
20
|
+
exports.ApiRoutesSchema = zod_1.z.object({
|
|
21
|
+
/** Base URL for Object CRUD (Standard Data API) */
|
|
22
|
+
data: zod_1.z.string().describe('e.g. /api/v1/data'),
|
|
23
|
+
/** Base URL for Schema Definitions (Metadata API) */
|
|
24
|
+
metadata: zod_1.z.string().describe('e.g. /api/v1/meta'),
|
|
25
|
+
/** Base URL for Authentication */
|
|
26
|
+
auth: zod_1.z.string().describe('e.g. /api/v1/auth'),
|
|
27
|
+
/** Base URL for Server Actions/Flows */
|
|
28
|
+
actions: zod_1.z.string().optional().describe('e.g. /api/v1/p'),
|
|
29
|
+
/** Base URL for File/Storage operations */
|
|
30
|
+
storage: zod_1.z.string().optional().describe('e.g. /api/v1/storage'),
|
|
31
|
+
/** GraphQL Endpoint (if enabled) */
|
|
32
|
+
graphql: zod_1.z.string().optional().describe('e.g. /api/v1/graphql'),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Discovery Response Schema
|
|
36
|
+
* The root object returned by the Metadata Discovery Endpoint.
|
|
37
|
+
*/
|
|
38
|
+
exports.DiscoverySchema = zod_1.z.object({
|
|
39
|
+
/** System Identity */
|
|
40
|
+
name: zod_1.z.string(),
|
|
41
|
+
version: zod_1.z.string(),
|
|
42
|
+
environment: zod_1.z.enum(['production', 'sandbox', 'development']),
|
|
43
|
+
/** Dynamic Routing */
|
|
44
|
+
routes: exports.ApiRoutesSchema,
|
|
45
|
+
/** Feature Flags */
|
|
46
|
+
features: exports.ApiCapabilitiesSchema,
|
|
47
|
+
/** Localization Info (helping frontend init i18n) */
|
|
48
|
+
locale: zod_1.z.object({
|
|
49
|
+
default: zod_1.z.string(),
|
|
50
|
+
supported: zod_1.z.array(zod_1.z.string()),
|
|
51
|
+
timezone: zod_1.z.string(),
|
|
52
|
+
}),
|
|
53
|
+
});
|