@objectstack/spec 1.0.6 → 1.0.7
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/ai/index.d.mts +1 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/api/index.d.mts +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1869 -1780
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +1869 -1780
- package/dist/api/index.mjs.map +1 -1
- package/dist/automation/index.d.mts +1 -1
- package/dist/automation/index.d.ts +1 -1
- package/dist/hub/index.d.mts +1 -1
- package/dist/hub/index.d.ts +1 -1
- package/dist/hub/index.js +796 -707
- package/dist/hub/index.js.map +1 -1
- package/dist/hub/index.mjs +796 -707
- package/dist/hub/index.mjs.map +1 -1
- package/dist/{index-CQ2ZwxNr.d.ts → index-CyognKSZ.d.ts} +146 -146
- package/dist/{index-BqQd0BcZ.d.mts → index-DE_lJ11p.d.mts} +146 -146
- package/dist/{index-C34qbBQr.d.mts → index-DLcySG7U.d.mts} +262 -241
- package/dist/{index-C34qbBQr.d.ts → index-DLcySG7U.d.ts} +262 -241
- package/dist/{index-D8XFyX0x.d.mts → index-Os7lItRe.d.mts} +108 -108
- package/dist/{index-D8XFyX0x.d.ts → index-Os7lItRe.d.ts} +108 -108
- package/dist/{index-CsF8m5Wj.d.mts → index-l6WIlmOD.d.mts} +39 -39
- package/dist/{index-CsF8m5Wj.d.ts → index-l6WIlmOD.d.ts} +39 -39
- package/dist/index.d.mts +158 -158
- package/dist/index.d.ts +158 -158
- package/dist/index.js +703 -668
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +703 -668
- package/dist/index.mjs.map +1 -1
- package/dist/kernel/index.d.mts +1 -1
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/index.js +705 -669
- package/dist/kernel/index.js.map +1 -1
- package/dist/kernel/index.mjs +704 -669
- package/dist/kernel/index.mjs.map +1 -1
- package/json-schema/api/CompileManifestResponse.json +6 -2
- package/json-schema/hub/ComposerResponse.json +6 -2
- package/json-schema/kernel/Manifest.json +6 -2
- package/json-schema/kernel/Plugin.json +28 -0
- package/package.json +1 -1
- package/dist/{index-iGrpxfqq.d.mts → index-D12rNohm.d.mts} +1 -1
- package/dist/{index-iGrpxfqq.d.ts → index-D12rNohm.d.ts} +1 -1
package/dist/hub/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/hub/composer.zod.ts
|
|
2
|
-
import { z as
|
|
2
|
+
import { z as z5 } from "zod";
|
|
3
3
|
|
|
4
4
|
// src/kernel/manifest.zod.ts
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z4 } from "zod";
|
|
6
6
|
|
|
7
7
|
// src/kernel/plugin-capability.zod.ts
|
|
8
8
|
import { z } from "zod";
|
|
@@ -817,8 +817,87 @@ var PluginLoadingStateSchema = z2.object({
|
|
|
817
817
|
retryCount: z2.number().int().min(0).default(0)
|
|
818
818
|
}).describe("Plugin loading state");
|
|
819
819
|
|
|
820
|
+
// src/kernel/plugin.zod.ts
|
|
821
|
+
import { z as z3 } from "zod";
|
|
822
|
+
var PluginContextSchema = z3.object({
|
|
823
|
+
ql: z3.object({
|
|
824
|
+
object: z3.function().returns(z3.any()),
|
|
825
|
+
// Return any to allow method chaining
|
|
826
|
+
query: z3.function().returns(z3.any())
|
|
827
|
+
}).passthrough().describe("ObjectQL Engine Interface"),
|
|
828
|
+
os: z3.object({
|
|
829
|
+
getCurrentUser: z3.function().returns(z3.any()),
|
|
830
|
+
getConfig: z3.function().returns(z3.any())
|
|
831
|
+
}).passthrough().describe("ObjectStack Kernel Interface"),
|
|
832
|
+
logger: z3.object({
|
|
833
|
+
debug: z3.function().returns(z3.void()),
|
|
834
|
+
info: z3.function().returns(z3.void()),
|
|
835
|
+
warn: z3.function().returns(z3.void()),
|
|
836
|
+
error: z3.function().returns(z3.void())
|
|
837
|
+
}).passthrough().describe("Logger Interface"),
|
|
838
|
+
storage: z3.object({
|
|
839
|
+
get: z3.function().returns(z3.any()),
|
|
840
|
+
set: z3.function().returns(z3.promise(z3.void())),
|
|
841
|
+
delete: z3.function().returns(z3.promise(z3.void()))
|
|
842
|
+
}).passthrough().describe("Storage Interface"),
|
|
843
|
+
i18n: z3.object({
|
|
844
|
+
t: z3.function().returns(z3.string()),
|
|
845
|
+
getLocale: z3.function().returns(z3.string())
|
|
846
|
+
}).passthrough().describe("Internationalization Interface"),
|
|
847
|
+
metadata: z3.record(z3.string(), z3.any()),
|
|
848
|
+
events: z3.record(z3.string(), z3.any()),
|
|
849
|
+
app: z3.object({
|
|
850
|
+
router: z3.object({
|
|
851
|
+
get: z3.function().returns(z3.any()),
|
|
852
|
+
post: z3.function().returns(z3.any()),
|
|
853
|
+
use: z3.function().returns(z3.any())
|
|
854
|
+
}).passthrough()
|
|
855
|
+
}).passthrough().describe("App Framework Interface"),
|
|
856
|
+
drivers: z3.object({
|
|
857
|
+
register: z3.function().returns(z3.void())
|
|
858
|
+
}).passthrough().describe("Driver Registry")
|
|
859
|
+
});
|
|
860
|
+
var PluginLifecycleSchema = z3.object({
|
|
861
|
+
onInstall: z3.function().args(PluginContextSchema).returns(z3.promise(z3.void())).optional(),
|
|
862
|
+
onEnable: z3.function().args(PluginContextSchema).returns(z3.promise(z3.void())).optional(),
|
|
863
|
+
onDisable: z3.function().args(PluginContextSchema).returns(z3.promise(z3.void())).optional(),
|
|
864
|
+
onUninstall: z3.function().args(PluginContextSchema).returns(z3.promise(z3.void())).optional(),
|
|
865
|
+
onUpgrade: z3.function().args(PluginContextSchema, z3.string(), z3.string()).returns(z3.promise(z3.void())).optional()
|
|
866
|
+
});
|
|
867
|
+
var CORE_PLUGIN_TYPES = [
|
|
868
|
+
"ui",
|
|
869
|
+
// Frontend: Serves static assets/SPA (e.g. Console, Studio)
|
|
870
|
+
"driver",
|
|
871
|
+
// Connectivity: Database or Storage adapters (e.g. SQL, S3)
|
|
872
|
+
"server",
|
|
873
|
+
// Protocol: HTTP/RPC Servers (e.g. Hono, GraphQL)
|
|
874
|
+
"app",
|
|
875
|
+
// Business: Vertical Solution Bundle (Metadata + Logic)
|
|
876
|
+
"theme",
|
|
877
|
+
// Appearance: UI Overrides & CSS Variables
|
|
878
|
+
"agent",
|
|
879
|
+
// AI: Autonomous Agent & Tool Definitions
|
|
880
|
+
"objectql"
|
|
881
|
+
// Core: ObjectQL Engine Data Provider
|
|
882
|
+
];
|
|
883
|
+
var PluginSchema = PluginLifecycleSchema.extend({
|
|
884
|
+
id: z3.string().min(1).optional().describe("Unique Plugin ID (e.g. com.example.crm)"),
|
|
885
|
+
type: z3.enum([
|
|
886
|
+
"standard",
|
|
887
|
+
// Default: General purpose backend logic (Service, Hook, etc.)
|
|
888
|
+
...CORE_PLUGIN_TYPES
|
|
889
|
+
]).default("standard").optional().describe("Plugin Type categorization for runtime behavior"),
|
|
890
|
+
staticPath: z3.string().optional().describe('Absolute path to static assets (Required for type="ui-plugin")'),
|
|
891
|
+
slug: z3.string().regex(/^[a-z0-9-_]+$/).optional().describe('URL path segment (Required for type="ui-plugin")'),
|
|
892
|
+
default: z3.boolean().optional().describe('Serve at root path (Only one "ui-plugin" can be default)'),
|
|
893
|
+
version: z3.string().regex(/^\d+\.\d+\.\d+$/).optional().describe("Semantic Version"),
|
|
894
|
+
description: z3.string().optional(),
|
|
895
|
+
author: z3.string().optional(),
|
|
896
|
+
homepage: z3.string().url().optional()
|
|
897
|
+
});
|
|
898
|
+
|
|
820
899
|
// src/kernel/manifest.zod.ts
|
|
821
|
-
var ManifestSchema =
|
|
900
|
+
var ManifestSchema = z4.object({
|
|
822
901
|
/**
|
|
823
902
|
* Unique package identifier using reverse domain notation.
|
|
824
903
|
* Must be unique across the entire ecosystem.
|
|
@@ -826,65 +905,75 @@ var ManifestSchema = z3.object({
|
|
|
826
905
|
* @example "com.steedos.crm"
|
|
827
906
|
* @example "org.apache.superset"
|
|
828
907
|
*/
|
|
829
|
-
id:
|
|
908
|
+
id: z4.string().describe("Unique package identifier (reverse domain style)"),
|
|
830
909
|
/**
|
|
831
910
|
* Package version following semantic versioning (major.minor.patch).
|
|
832
911
|
*
|
|
833
912
|
* @example "1.0.0"
|
|
834
913
|
* @example "2.1.0-beta.1"
|
|
835
914
|
*/
|
|
836
|
-
version:
|
|
915
|
+
version: z4.string().regex(/^\d+\.\d+\.\d+$/).describe("Package version (semantic versioning)"),
|
|
837
916
|
/**
|
|
838
917
|
* Type of the package in the ObjectStack ecosystem.
|
|
839
|
-
* -
|
|
840
|
-
* -
|
|
841
|
-
* - driver:
|
|
918
|
+
* - plugin: General-purpose functionality extension (Runtime: standard)
|
|
919
|
+
* - app: Business application package
|
|
920
|
+
* - driver: Connectivity adapter
|
|
921
|
+
* - server: Protocol gateway (Hono, GraphQL)
|
|
922
|
+
* - ui: Frontend package (Static/SPA)
|
|
923
|
+
* - theme: UI Theme
|
|
924
|
+
* - agent: AI Agent
|
|
842
925
|
* - module: Reusable code library/shared module
|
|
843
|
-
* - objectql: Core engine
|
|
844
|
-
* -
|
|
845
|
-
* - adapter: Host adapter - Runtime container (Express, Hono, Fastify, Serverless)
|
|
926
|
+
* - objectql: Core engine
|
|
927
|
+
* - adapter: Host adapter (Express, Fastify)
|
|
846
928
|
*/
|
|
847
|
-
type:
|
|
929
|
+
type: z4.enum([
|
|
930
|
+
"plugin",
|
|
931
|
+
...CORE_PLUGIN_TYPES,
|
|
932
|
+
"module",
|
|
933
|
+
"gateway",
|
|
934
|
+
// Deprecated: use 'server'
|
|
935
|
+
"adapter"
|
|
936
|
+
]).describe("Type of package"),
|
|
848
937
|
/**
|
|
849
938
|
* Human-readable name of the package.
|
|
850
939
|
* Displayed in the UI for users.
|
|
851
940
|
*
|
|
852
941
|
* @example "Project Management"
|
|
853
942
|
*/
|
|
854
|
-
name:
|
|
943
|
+
name: z4.string().describe("Human-readable package name"),
|
|
855
944
|
/**
|
|
856
945
|
* Brief description of the package functionality.
|
|
857
946
|
* Displayed in the marketplace and plugin manager.
|
|
858
947
|
*/
|
|
859
|
-
description:
|
|
948
|
+
description: z4.string().optional().describe("Package description"),
|
|
860
949
|
/**
|
|
861
950
|
* Array of permission strings that the package requires.
|
|
862
951
|
* These form the "Scope" requested by the package at installation.
|
|
863
952
|
*
|
|
864
953
|
* @example ["system.user.read", "system.data.write"]
|
|
865
954
|
*/
|
|
866
|
-
permissions:
|
|
955
|
+
permissions: z4.array(z4.string()).optional().describe("Array of required permission strings"),
|
|
867
956
|
/**
|
|
868
957
|
* Glob patterns specifying ObjectQL schemas files.
|
|
869
958
|
* Matches `*.object.yml` or `*.object.ts` files to load business objects.
|
|
870
959
|
*
|
|
871
960
|
* @example ["./src/objects/*.object.yml"]
|
|
872
961
|
*/
|
|
873
|
-
objects:
|
|
962
|
+
objects: z4.array(z4.string()).optional().describe("Glob patterns for ObjectQL schemas files"),
|
|
874
963
|
/**
|
|
875
964
|
* Defines system level DataSources.
|
|
876
965
|
* Matches `*.datasource.yml` files.
|
|
877
966
|
*
|
|
878
967
|
* @example ["./src/datasources/*.datasource.mongo.yml"]
|
|
879
968
|
*/
|
|
880
|
-
datasources:
|
|
969
|
+
datasources: z4.array(z4.string()).optional().describe("Glob patterns for Datasource definitions"),
|
|
881
970
|
/**
|
|
882
971
|
* Package Dependencies.
|
|
883
972
|
* Map of package IDs to version requirements.
|
|
884
973
|
*
|
|
885
974
|
* @example { "@steedos/plugin-auth": "^2.0.0" }
|
|
886
975
|
*/
|
|
887
|
-
dependencies:
|
|
976
|
+
dependencies: z4.record(z4.string(), z4.string()).optional().describe("Package dependencies"),
|
|
888
977
|
/**
|
|
889
978
|
* Plugin Configuration Schema.
|
|
890
979
|
* Defines the settings this plugin exposes to the user via UI/ENV.
|
|
@@ -899,109 +988,109 @@ var ManifestSchema = z3.object({
|
|
|
899
988
|
* }
|
|
900
989
|
* }
|
|
901
990
|
*/
|
|
902
|
-
configuration:
|
|
903
|
-
title:
|
|
904
|
-
properties:
|
|
905
|
-
type:
|
|
906
|
-
default:
|
|
907
|
-
description:
|
|
908
|
-
required:
|
|
909
|
-
secret:
|
|
910
|
-
enum:
|
|
991
|
+
configuration: z4.object({
|
|
992
|
+
title: z4.string().optional(),
|
|
993
|
+
properties: z4.record(z4.string(), z4.object({
|
|
994
|
+
type: z4.enum(["string", "number", "boolean", "array", "object"]).describe("Data type of the setting"),
|
|
995
|
+
default: z4.any().optional().describe("Default value"),
|
|
996
|
+
description: z4.string().optional().describe("Tooltip description"),
|
|
997
|
+
required: z4.boolean().optional().describe("Is this setting required?"),
|
|
998
|
+
secret: z4.boolean().optional().describe("If true, value is encrypted/masked (e.g. API Keys)"),
|
|
999
|
+
enum: z4.array(z4.string()).optional().describe("Allowed values for select inputs")
|
|
911
1000
|
})).describe("Map of configuration keys to their definitions")
|
|
912
1001
|
}).optional().describe("Plugin configuration settings"),
|
|
913
1002
|
/**
|
|
914
1003
|
* Contribution Points (VS Code Style).
|
|
915
1004
|
* formalized way to extend the platform capabilities.
|
|
916
1005
|
*/
|
|
917
|
-
contributes:
|
|
1006
|
+
contributes: z4.object({
|
|
918
1007
|
/**
|
|
919
1008
|
* Register new Metadata Kinds (CRDs).
|
|
920
1009
|
* Enables the system to parse and validate new file types.
|
|
921
1010
|
* Example: Registering a BI plugin to handle *.report.ts
|
|
922
1011
|
*/
|
|
923
|
-
kinds:
|
|
924
|
-
id:
|
|
925
|
-
globs:
|
|
926
|
-
description:
|
|
1012
|
+
kinds: z4.array(z4.object({
|
|
1013
|
+
id: z4.string().describe('The generic identifier of the kind (e.g., "sys.bi.report")'),
|
|
1014
|
+
globs: z4.array(z4.string()).describe('File patterns to watch (e.g., ["**/*.report.ts"])'),
|
|
1015
|
+
description: z4.string().optional().describe("Description of what this kind represents")
|
|
927
1016
|
})).optional().describe("New Metadata Types to recognize"),
|
|
928
1017
|
/**
|
|
929
1018
|
* Register System Hooks.
|
|
930
1019
|
* Declares that this plugin listens to specific system events.
|
|
931
1020
|
*/
|
|
932
|
-
events:
|
|
1021
|
+
events: z4.array(z4.string()).optional().describe("Events this plugin listens to"),
|
|
933
1022
|
/**
|
|
934
1023
|
* Register UI Menus.
|
|
935
1024
|
*/
|
|
936
|
-
menus:
|
|
937
|
-
id:
|
|
938
|
-
label:
|
|
939
|
-
command:
|
|
1025
|
+
menus: z4.record(z4.string(), z4.array(z4.object({
|
|
1026
|
+
id: z4.string(),
|
|
1027
|
+
label: z4.string(),
|
|
1028
|
+
command: z4.string().optional()
|
|
940
1029
|
}))).optional().describe("UI Menu contributions"),
|
|
941
1030
|
/**
|
|
942
1031
|
* Register Custom Themes.
|
|
943
1032
|
*/
|
|
944
|
-
themes:
|
|
945
|
-
id:
|
|
946
|
-
label:
|
|
947
|
-
path:
|
|
1033
|
+
themes: z4.array(z4.object({
|
|
1034
|
+
id: z4.string(),
|
|
1035
|
+
label: z4.string(),
|
|
1036
|
+
path: z4.string()
|
|
948
1037
|
})).optional().describe("Theme contributions"),
|
|
949
1038
|
/**
|
|
950
1039
|
* Register Translations.
|
|
951
1040
|
* Path to translation files (e.g. "locales/en.json").
|
|
952
1041
|
*/
|
|
953
|
-
translations:
|
|
954
|
-
locale:
|
|
955
|
-
path:
|
|
1042
|
+
translations: z4.array(z4.object({
|
|
1043
|
+
locale: z4.string(),
|
|
1044
|
+
path: z4.string()
|
|
956
1045
|
})).optional().describe("Translation resources"),
|
|
957
1046
|
/**
|
|
958
1047
|
* Register Server Actions.
|
|
959
1048
|
* Invocable functions exposed to Flows or API.
|
|
960
1049
|
*/
|
|
961
|
-
actions:
|
|
962
|
-
name:
|
|
963
|
-
label:
|
|
964
|
-
description:
|
|
965
|
-
input:
|
|
966
|
-
output:
|
|
1050
|
+
actions: z4.array(z4.object({
|
|
1051
|
+
name: z4.string().describe("Unique action name"),
|
|
1052
|
+
label: z4.string().optional(),
|
|
1053
|
+
description: z4.string().optional(),
|
|
1054
|
+
input: z4.any().optional().describe("Input validation schema"),
|
|
1055
|
+
output: z4.any().optional().describe("Output schema")
|
|
967
1056
|
})).optional().describe("Exposed server actions"),
|
|
968
1057
|
/**
|
|
969
1058
|
* Register Storage Drivers.
|
|
970
1059
|
* Enables connecting to new types of datasources.
|
|
971
1060
|
*/
|
|
972
|
-
drivers:
|
|
973
|
-
id:
|
|
974
|
-
label:
|
|
975
|
-
description:
|
|
1061
|
+
drivers: z4.array(z4.object({
|
|
1062
|
+
id: z4.string().describe('Driver unique identifier (e.g. "postgres", "mongo")'),
|
|
1063
|
+
label: z4.string().describe("Human readable name"),
|
|
1064
|
+
description: z4.string().optional()
|
|
976
1065
|
})).optional().describe("Driver contributions"),
|
|
977
1066
|
/**
|
|
978
1067
|
* Register Custom Field Types.
|
|
979
1068
|
* Extends the data model with new widget types.
|
|
980
1069
|
*/
|
|
981
|
-
fieldTypes:
|
|
982
|
-
name:
|
|
983
|
-
label:
|
|
984
|
-
description:
|
|
1070
|
+
fieldTypes: z4.array(z4.object({
|
|
1071
|
+
name: z4.string().describe('Unique field type name (e.g. "vector")'),
|
|
1072
|
+
label: z4.string().describe("Display label"),
|
|
1073
|
+
description: z4.string().optional()
|
|
985
1074
|
})).optional().describe("Field Type contributions"),
|
|
986
1075
|
/**
|
|
987
1076
|
* Register Custom Query Operators/Functions.
|
|
988
1077
|
* Extends ObjectQL with new functions (e.g. distance()).
|
|
989
1078
|
*/
|
|
990
|
-
functions:
|
|
991
|
-
name:
|
|
992
|
-
description:
|
|
993
|
-
args:
|
|
994
|
-
returnType:
|
|
1079
|
+
functions: z4.array(z4.object({
|
|
1080
|
+
name: z4.string().describe('Function name (e.g. "distance")'),
|
|
1081
|
+
description: z4.string().optional(),
|
|
1082
|
+
args: z4.array(z4.string()).optional().describe("Argument types"),
|
|
1083
|
+
returnType: z4.string().optional()
|
|
995
1084
|
})).optional().describe("Query Function contributions")
|
|
996
1085
|
}).optional().describe("Platform contributions"),
|
|
997
1086
|
/**
|
|
998
1087
|
* Initial data seeding configuration.
|
|
999
1088
|
* Defines default records to be inserted when the package is installed.
|
|
1000
1089
|
*/
|
|
1001
|
-
data:
|
|
1002
|
-
object:
|
|
1003
|
-
records:
|
|
1004
|
-
mode:
|
|
1090
|
+
data: z4.array(z4.object({
|
|
1091
|
+
object: z4.string().describe("Target Object Name"),
|
|
1092
|
+
records: z4.array(z4.record(z4.string(), z4.any())).describe("List of records to insert"),
|
|
1093
|
+
mode: z4.enum(["upsert", "insert", "ignore"]).default("upsert").describe("Seeding mode")
|
|
1005
1094
|
})).optional().describe("Initial seed data"),
|
|
1006
1095
|
/**
|
|
1007
1096
|
* Plugin Capability Manifest.
|
|
@@ -1013,7 +1102,7 @@ var ManifestSchema = z3.object({
|
|
|
1013
1102
|
* Extension points contributed by this package.
|
|
1014
1103
|
* Allows packages to extend UI components, add functionality, etc.
|
|
1015
1104
|
*/
|
|
1016
|
-
extensions:
|
|
1105
|
+
extensions: z4.record(z4.string(), z4.any()).optional().describe("Extension points and contributions"),
|
|
1017
1106
|
/**
|
|
1018
1107
|
* Plugin Loading Configuration.
|
|
1019
1108
|
* Configures how the plugin is loaded, initialized, and managed at runtime.
|
|
@@ -1023,61 +1112,61 @@ var ManifestSchema = z3.object({
|
|
|
1023
1112
|
});
|
|
1024
1113
|
|
|
1025
1114
|
// src/hub/composer.zod.ts
|
|
1026
|
-
var DependencyRequirementSchema =
|
|
1027
|
-
id:
|
|
1028
|
-
version:
|
|
1115
|
+
var DependencyRequirementSchema = z5.object({
|
|
1116
|
+
id: z5.string().describe('Plugin ID (e.g. "com.example.crm")'),
|
|
1117
|
+
version: z5.string().default("latest").describe('SemVer range or "latest"'),
|
|
1029
1118
|
/**
|
|
1030
1119
|
* Configuration Overrides
|
|
1031
1120
|
* Tenant-specific settings that override plugin defaults.
|
|
1032
1121
|
* Example: { "currency": "USD", "apiKey": "..." }
|
|
1033
1122
|
*/
|
|
1034
|
-
configuration:
|
|
1123
|
+
configuration: z5.record(z5.string(), z5.any()).optional().describe("Configuration overrides"),
|
|
1035
1124
|
/**
|
|
1036
1125
|
* Feature Flags
|
|
1037
1126
|
* Enable/Disable specific features within the plugin.
|
|
1038
1127
|
*/
|
|
1039
|
-
features:
|
|
1128
|
+
features: z5.record(z5.string(), z5.boolean()).optional().describe("Feature toggles")
|
|
1040
1129
|
});
|
|
1041
|
-
var BillOfMaterialsSchema =
|
|
1042
|
-
tenantId:
|
|
1130
|
+
var BillOfMaterialsSchema = z5.object({
|
|
1131
|
+
tenantId: z5.string().describe("Target Tenant ID"),
|
|
1043
1132
|
/**
|
|
1044
1133
|
* List of installed plugins/apps.
|
|
1045
1134
|
* implementation order matters (later plugins override earlier ones by default).
|
|
1046
1135
|
*/
|
|
1047
|
-
dependencies:
|
|
1136
|
+
dependencies: z5.array(DependencyRequirementSchema).describe("Installed packages"),
|
|
1048
1137
|
/**
|
|
1049
1138
|
* Environment Variables injection.
|
|
1050
1139
|
* Maps abstract keys to secure vault references or concrete values.
|
|
1051
1140
|
*/
|
|
1052
|
-
environment:
|
|
1141
|
+
environment: z5.record(z5.string(), z5.string()).optional(),
|
|
1053
1142
|
/**
|
|
1054
1143
|
* Global Resolution Strategy
|
|
1055
1144
|
* How to handle conflicts when multiple plugins define the same resource.
|
|
1056
1145
|
*/
|
|
1057
|
-
resolutionStrategy:
|
|
1146
|
+
resolutionStrategy: z5.enum(["strict", "override", "merge"]).default("override").describe("Conflict resolution strategy (strict=fail, override=last-wins, merge=deep-merge)")
|
|
1058
1147
|
});
|
|
1059
|
-
var ConflictReportSchema =
|
|
1060
|
-
resourceType:
|
|
1061
|
-
resourceId:
|
|
1062
|
-
sources:
|
|
1063
|
-
resolution:
|
|
1064
|
-
severity:
|
|
1148
|
+
var ConflictReportSchema = z5.object({
|
|
1149
|
+
resourceType: z5.enum(["object", "field", "api", "ui"]).describe("Type of colliding resource"),
|
|
1150
|
+
resourceId: z5.string().describe("ID of the resource"),
|
|
1151
|
+
sources: z5.array(z5.string()).describe("List of plugin IDs defining this resource"),
|
|
1152
|
+
resolution: z5.string().describe('How it was resolved (e.g. "com.example.erp won")'),
|
|
1153
|
+
severity: z5.enum(["info", "warning", "error"]).describe("Severity of the conflict")
|
|
1065
1154
|
});
|
|
1066
|
-
var ComposerRequestSchema =
|
|
1155
|
+
var ComposerRequestSchema = z5.object({
|
|
1067
1156
|
bom: BillOfMaterialsSchema,
|
|
1068
1157
|
/**
|
|
1069
1158
|
* Target Runtime Version
|
|
1070
1159
|
* Ensure generated manifest is compatible with the specific runtime version.
|
|
1071
1160
|
*/
|
|
1072
|
-
runtimeVersion:
|
|
1161
|
+
runtimeVersion: z5.string().optional(),
|
|
1073
1162
|
/**
|
|
1074
1163
|
* Dry Run
|
|
1075
1164
|
* If true, generates report but does not persist the manifest.
|
|
1076
1165
|
*/
|
|
1077
|
-
dryRun:
|
|
1166
|
+
dryRun: z5.boolean().default(false)
|
|
1078
1167
|
});
|
|
1079
|
-
var ComposerResponseSchema =
|
|
1080
|
-
success:
|
|
1168
|
+
var ComposerResponseSchema = z5.object({
|
|
1169
|
+
success: z5.boolean(),
|
|
1081
1170
|
/**
|
|
1082
1171
|
* The Holy Grail: The Executable System Manifest.
|
|
1083
1172
|
* This is what the Runtime loads to boot.
|
|
@@ -1087,150 +1176,150 @@ var ComposerResponseSchema = z4.object({
|
|
|
1087
1176
|
* Manifest URL
|
|
1088
1177
|
* Presigned URL to download the manifest if stored externally (e.g. Vercel KV/S3).
|
|
1089
1178
|
*/
|
|
1090
|
-
manifestUrl:
|
|
1179
|
+
manifestUrl: z5.string().url().optional().describe("Presigned download URL"),
|
|
1091
1180
|
/**
|
|
1092
1181
|
* Compilation Metadata
|
|
1093
1182
|
*/
|
|
1094
|
-
buildId:
|
|
1095
|
-
timestamp:
|
|
1096
|
-
duration:
|
|
1183
|
+
buildId: z5.string(),
|
|
1184
|
+
timestamp: z5.string().datetime(),
|
|
1185
|
+
duration: z5.number().describe("Compilation time in ms"),
|
|
1097
1186
|
/**
|
|
1098
1187
|
* Analysis
|
|
1099
1188
|
*/
|
|
1100
|
-
conflicts:
|
|
1101
|
-
errors:
|
|
1189
|
+
conflicts: z5.array(ConflictReportSchema).optional(),
|
|
1190
|
+
errors: z5.array(z5.string()).optional()
|
|
1102
1191
|
});
|
|
1103
1192
|
|
|
1104
1193
|
// src/hub/marketplace.zod.ts
|
|
1105
|
-
import { z as
|
|
1194
|
+
import { z as z7 } from "zod";
|
|
1106
1195
|
|
|
1107
1196
|
// src/hub/plugin-registry.zod.ts
|
|
1108
|
-
import { z as
|
|
1109
|
-
var PluginVendorSchema =
|
|
1197
|
+
import { z as z6 } from "zod";
|
|
1198
|
+
var PluginVendorSchema = z6.object({
|
|
1110
1199
|
/**
|
|
1111
1200
|
* Vendor identifier (reverse domain notation)
|
|
1112
1201
|
* Example: "com.acme", "org.apache", "com.objectstack"
|
|
1113
1202
|
*/
|
|
1114
|
-
id:
|
|
1203
|
+
id: z6.string().regex(/^[a-z][a-z0-9]*(\.[a-z][a-z0-9]*)+$/).describe("Vendor identifier (reverse domain)"),
|
|
1115
1204
|
/**
|
|
1116
1205
|
* Vendor display name
|
|
1117
1206
|
*/
|
|
1118
|
-
name:
|
|
1207
|
+
name: z6.string(),
|
|
1119
1208
|
/**
|
|
1120
1209
|
* Vendor website
|
|
1121
1210
|
*/
|
|
1122
|
-
website:
|
|
1211
|
+
website: z6.string().url().optional(),
|
|
1123
1212
|
/**
|
|
1124
1213
|
* Contact email
|
|
1125
1214
|
*/
|
|
1126
|
-
email:
|
|
1215
|
+
email: z6.string().email().optional(),
|
|
1127
1216
|
/**
|
|
1128
1217
|
* Verification status
|
|
1129
1218
|
*/
|
|
1130
|
-
verified:
|
|
1219
|
+
verified: z6.boolean().default(false).describe("Whether vendor is verified by ObjectStack"),
|
|
1131
1220
|
/**
|
|
1132
1221
|
* Trust level
|
|
1133
1222
|
*/
|
|
1134
|
-
trustLevel:
|
|
1223
|
+
trustLevel: z6.enum(["official", "verified", "community", "unverified"]).default("unverified")
|
|
1135
1224
|
});
|
|
1136
|
-
var PluginQualityMetricsSchema =
|
|
1225
|
+
var PluginQualityMetricsSchema = z6.object({
|
|
1137
1226
|
/**
|
|
1138
1227
|
* Test coverage percentage
|
|
1139
1228
|
*/
|
|
1140
|
-
testCoverage:
|
|
1229
|
+
testCoverage: z6.number().min(0).max(100).optional(),
|
|
1141
1230
|
/**
|
|
1142
1231
|
* Documentation score (0-100)
|
|
1143
1232
|
*/
|
|
1144
|
-
documentationScore:
|
|
1233
|
+
documentationScore: z6.number().min(0).max(100).optional(),
|
|
1145
1234
|
/**
|
|
1146
1235
|
* Code quality score (0-100)
|
|
1147
1236
|
*/
|
|
1148
|
-
codeQuality:
|
|
1237
|
+
codeQuality: z6.number().min(0).max(100).optional(),
|
|
1149
1238
|
/**
|
|
1150
1239
|
* Security scan status
|
|
1151
1240
|
*/
|
|
1152
|
-
securityScan:
|
|
1153
|
-
lastScanDate:
|
|
1154
|
-
vulnerabilities:
|
|
1155
|
-
critical:
|
|
1156
|
-
high:
|
|
1157
|
-
medium:
|
|
1158
|
-
low:
|
|
1241
|
+
securityScan: z6.object({
|
|
1242
|
+
lastScanDate: z6.string().datetime().optional(),
|
|
1243
|
+
vulnerabilities: z6.object({
|
|
1244
|
+
critical: z6.number().int().min(0).default(0),
|
|
1245
|
+
high: z6.number().int().min(0).default(0),
|
|
1246
|
+
medium: z6.number().int().min(0).default(0),
|
|
1247
|
+
low: z6.number().int().min(0).default(0)
|
|
1159
1248
|
}).optional(),
|
|
1160
|
-
passed:
|
|
1249
|
+
passed: z6.boolean().default(false)
|
|
1161
1250
|
}).optional(),
|
|
1162
1251
|
/**
|
|
1163
1252
|
* Conformance test results
|
|
1164
1253
|
*/
|
|
1165
|
-
conformanceTests:
|
|
1166
|
-
protocolId:
|
|
1167
|
-
passed:
|
|
1168
|
-
totalTests:
|
|
1169
|
-
passedTests:
|
|
1170
|
-
lastRunDate:
|
|
1254
|
+
conformanceTests: z6.array(z6.object({
|
|
1255
|
+
protocolId: z6.string().describe("Protocol being tested"),
|
|
1256
|
+
passed: z6.boolean(),
|
|
1257
|
+
totalTests: z6.number().int().min(0),
|
|
1258
|
+
passedTests: z6.number().int().min(0),
|
|
1259
|
+
lastRunDate: z6.string().datetime().optional()
|
|
1171
1260
|
})).optional()
|
|
1172
1261
|
});
|
|
1173
|
-
var PluginStatisticsSchema =
|
|
1262
|
+
var PluginStatisticsSchema = z6.object({
|
|
1174
1263
|
/**
|
|
1175
1264
|
* Total downloads
|
|
1176
1265
|
*/
|
|
1177
|
-
downloads:
|
|
1266
|
+
downloads: z6.number().int().min(0).default(0),
|
|
1178
1267
|
/**
|
|
1179
1268
|
* Downloads in the last 30 days
|
|
1180
1269
|
*/
|
|
1181
|
-
downloadsLastMonth:
|
|
1270
|
+
downloadsLastMonth: z6.number().int().min(0).default(0),
|
|
1182
1271
|
/**
|
|
1183
1272
|
* Number of active installations
|
|
1184
1273
|
*/
|
|
1185
|
-
activeInstallations:
|
|
1274
|
+
activeInstallations: z6.number().int().min(0).default(0),
|
|
1186
1275
|
/**
|
|
1187
1276
|
* User ratings
|
|
1188
1277
|
*/
|
|
1189
|
-
ratings:
|
|
1190
|
-
average:
|
|
1191
|
-
count:
|
|
1192
|
-
distribution:
|
|
1193
|
-
"5":
|
|
1194
|
-
"4":
|
|
1195
|
-
"3":
|
|
1196
|
-
"2":
|
|
1197
|
-
"1":
|
|
1278
|
+
ratings: z6.object({
|
|
1279
|
+
average: z6.number().min(0).max(5).default(0),
|
|
1280
|
+
count: z6.number().int().min(0).default(0),
|
|
1281
|
+
distribution: z6.object({
|
|
1282
|
+
"5": z6.number().int().min(0).default(0),
|
|
1283
|
+
"4": z6.number().int().min(0).default(0),
|
|
1284
|
+
"3": z6.number().int().min(0).default(0),
|
|
1285
|
+
"2": z6.number().int().min(0).default(0),
|
|
1286
|
+
"1": z6.number().int().min(0).default(0)
|
|
1198
1287
|
}).optional()
|
|
1199
1288
|
}).optional(),
|
|
1200
1289
|
/**
|
|
1201
1290
|
* GitHub stars (if open source)
|
|
1202
1291
|
*/
|
|
1203
|
-
stars:
|
|
1292
|
+
stars: z6.number().int().min(0).optional(),
|
|
1204
1293
|
/**
|
|
1205
1294
|
* Number of dependent plugins
|
|
1206
1295
|
*/
|
|
1207
|
-
dependents:
|
|
1296
|
+
dependents: z6.number().int().min(0).default(0)
|
|
1208
1297
|
});
|
|
1209
|
-
var PluginRegistryEntrySchema =
|
|
1298
|
+
var PluginRegistryEntrySchema = z6.object({
|
|
1210
1299
|
/**
|
|
1211
1300
|
* Plugin identifier (must match manifest.id)
|
|
1212
1301
|
*/
|
|
1213
|
-
id:
|
|
1302
|
+
id: z6.string().regex(/^([a-z][a-z0-9]*\.)+[a-z][a-z0-9-]+$/).describe("Plugin identifier (reverse domain notation)"),
|
|
1214
1303
|
/**
|
|
1215
1304
|
* Current version
|
|
1216
1305
|
*/
|
|
1217
|
-
version:
|
|
1306
|
+
version: z6.string().regex(/^\d+\.\d+\.\d+$/),
|
|
1218
1307
|
/**
|
|
1219
1308
|
* Plugin display name
|
|
1220
1309
|
*/
|
|
1221
|
-
name:
|
|
1310
|
+
name: z6.string(),
|
|
1222
1311
|
/**
|
|
1223
1312
|
* Short description
|
|
1224
1313
|
*/
|
|
1225
|
-
description:
|
|
1314
|
+
description: z6.string().optional(),
|
|
1226
1315
|
/**
|
|
1227
1316
|
* Detailed documentation/README
|
|
1228
1317
|
*/
|
|
1229
|
-
readme:
|
|
1318
|
+
readme: z6.string().optional(),
|
|
1230
1319
|
/**
|
|
1231
1320
|
* Plugin type/category
|
|
1232
1321
|
*/
|
|
1233
|
-
category:
|
|
1322
|
+
category: z6.enum([
|
|
1234
1323
|
"data",
|
|
1235
1324
|
// Data management, storage, databases
|
|
1236
1325
|
"integration",
|
|
@@ -1257,7 +1346,7 @@ var PluginRegistryEntrySchema = z5.object({
|
|
|
1257
1346
|
/**
|
|
1258
1347
|
* Tags for categorization
|
|
1259
1348
|
*/
|
|
1260
|
-
tags:
|
|
1349
|
+
tags: z6.array(z6.string()).optional(),
|
|
1261
1350
|
/**
|
|
1262
1351
|
* Vendor information
|
|
1263
1352
|
*/
|
|
@@ -1269,42 +1358,42 @@ var PluginRegistryEntrySchema = z5.object({
|
|
|
1269
1358
|
/**
|
|
1270
1359
|
* Compatibility information
|
|
1271
1360
|
*/
|
|
1272
|
-
compatibility:
|
|
1361
|
+
compatibility: z6.object({
|
|
1273
1362
|
/**
|
|
1274
1363
|
* Minimum ObjectStack version required
|
|
1275
1364
|
*/
|
|
1276
|
-
minObjectStackVersion:
|
|
1365
|
+
minObjectStackVersion: z6.string().optional(),
|
|
1277
1366
|
/**
|
|
1278
1367
|
* Maximum ObjectStack version supported
|
|
1279
1368
|
*/
|
|
1280
|
-
maxObjectStackVersion:
|
|
1369
|
+
maxObjectStackVersion: z6.string().optional(),
|
|
1281
1370
|
/**
|
|
1282
1371
|
* Node.js version requirement
|
|
1283
1372
|
*/
|
|
1284
|
-
nodeVersion:
|
|
1373
|
+
nodeVersion: z6.string().optional(),
|
|
1285
1374
|
/**
|
|
1286
1375
|
* Supported platforms
|
|
1287
1376
|
*/
|
|
1288
|
-
platforms:
|
|
1377
|
+
platforms: z6.array(z6.enum(["linux", "darwin", "win32", "browser"])).optional()
|
|
1289
1378
|
}).optional(),
|
|
1290
1379
|
/**
|
|
1291
1380
|
* Links and resources
|
|
1292
1381
|
*/
|
|
1293
|
-
links:
|
|
1294
|
-
homepage:
|
|
1295
|
-
repository:
|
|
1296
|
-
documentation:
|
|
1297
|
-
bugs:
|
|
1298
|
-
changelog:
|
|
1382
|
+
links: z6.object({
|
|
1383
|
+
homepage: z6.string().url().optional(),
|
|
1384
|
+
repository: z6.string().url().optional(),
|
|
1385
|
+
documentation: z6.string().url().optional(),
|
|
1386
|
+
bugs: z6.string().url().optional(),
|
|
1387
|
+
changelog: z6.string().url().optional()
|
|
1299
1388
|
}).optional(),
|
|
1300
1389
|
/**
|
|
1301
1390
|
* Media assets
|
|
1302
1391
|
*/
|
|
1303
|
-
media:
|
|
1304
|
-
icon:
|
|
1305
|
-
logo:
|
|
1306
|
-
screenshots:
|
|
1307
|
-
video:
|
|
1392
|
+
media: z6.object({
|
|
1393
|
+
icon: z6.string().url().optional(),
|
|
1394
|
+
logo: z6.string().url().optional(),
|
|
1395
|
+
screenshots: z6.array(z6.string().url()).optional(),
|
|
1396
|
+
video: z6.string().url().optional()
|
|
1308
1397
|
}).optional(),
|
|
1309
1398
|
/**
|
|
1310
1399
|
* Quality metrics
|
|
@@ -1317,70 +1406,70 @@ var PluginRegistryEntrySchema = z5.object({
|
|
|
1317
1406
|
/**
|
|
1318
1407
|
* License information
|
|
1319
1408
|
*/
|
|
1320
|
-
license:
|
|
1409
|
+
license: z6.string().optional().describe("SPDX license identifier"),
|
|
1321
1410
|
/**
|
|
1322
1411
|
* Pricing (if commercial)
|
|
1323
1412
|
*/
|
|
1324
|
-
pricing:
|
|
1325
|
-
model:
|
|
1326
|
-
price:
|
|
1327
|
-
currency:
|
|
1328
|
-
billingPeriod:
|
|
1413
|
+
pricing: z6.object({
|
|
1414
|
+
model: z6.enum(["free", "freemium", "paid", "enterprise"]),
|
|
1415
|
+
price: z6.number().min(0).optional(),
|
|
1416
|
+
currency: z6.string().default("USD").optional(),
|
|
1417
|
+
billingPeriod: z6.enum(["one-time", "monthly", "yearly"]).optional()
|
|
1329
1418
|
}).optional(),
|
|
1330
1419
|
/**
|
|
1331
1420
|
* Publication dates
|
|
1332
1421
|
*/
|
|
1333
|
-
publishedAt:
|
|
1334
|
-
updatedAt:
|
|
1422
|
+
publishedAt: z6.string().datetime().optional(),
|
|
1423
|
+
updatedAt: z6.string().datetime().optional(),
|
|
1335
1424
|
/**
|
|
1336
1425
|
* Deprecation status
|
|
1337
1426
|
*/
|
|
1338
|
-
deprecated:
|
|
1339
|
-
deprecationMessage:
|
|
1340
|
-
replacedBy:
|
|
1427
|
+
deprecated: z6.boolean().default(false),
|
|
1428
|
+
deprecationMessage: z6.string().optional(),
|
|
1429
|
+
replacedBy: z6.string().optional().describe("Plugin ID that replaces this one"),
|
|
1341
1430
|
/**
|
|
1342
1431
|
* Feature flags
|
|
1343
1432
|
*/
|
|
1344
|
-
flags:
|
|
1345
|
-
experimental:
|
|
1346
|
-
beta:
|
|
1347
|
-
featured:
|
|
1348
|
-
verified:
|
|
1433
|
+
flags: z6.object({
|
|
1434
|
+
experimental: z6.boolean().default(false),
|
|
1435
|
+
beta: z6.boolean().default(false),
|
|
1436
|
+
featured: z6.boolean().default(false),
|
|
1437
|
+
verified: z6.boolean().default(false)
|
|
1349
1438
|
}).optional()
|
|
1350
1439
|
});
|
|
1351
|
-
var PluginSearchFiltersSchema =
|
|
1440
|
+
var PluginSearchFiltersSchema = z6.object({
|
|
1352
1441
|
/**
|
|
1353
1442
|
* Search query
|
|
1354
1443
|
*/
|
|
1355
|
-
query:
|
|
1444
|
+
query: z6.string().optional(),
|
|
1356
1445
|
/**
|
|
1357
1446
|
* Filter by category
|
|
1358
1447
|
*/
|
|
1359
|
-
category:
|
|
1448
|
+
category: z6.array(z6.string()).optional(),
|
|
1360
1449
|
/**
|
|
1361
1450
|
* Filter by tags
|
|
1362
1451
|
*/
|
|
1363
|
-
tags:
|
|
1452
|
+
tags: z6.array(z6.string()).optional(),
|
|
1364
1453
|
/**
|
|
1365
1454
|
* Filter by vendor trust level
|
|
1366
1455
|
*/
|
|
1367
|
-
trustLevel:
|
|
1456
|
+
trustLevel: z6.array(z6.enum(["official", "verified", "community", "unverified"])).optional(),
|
|
1368
1457
|
/**
|
|
1369
1458
|
* Filter by protocols implemented
|
|
1370
1459
|
*/
|
|
1371
|
-
implementsProtocols:
|
|
1460
|
+
implementsProtocols: z6.array(z6.string()).optional(),
|
|
1372
1461
|
/**
|
|
1373
1462
|
* Filter by pricing model
|
|
1374
1463
|
*/
|
|
1375
|
-
pricingModel:
|
|
1464
|
+
pricingModel: z6.array(z6.enum(["free", "freemium", "paid", "enterprise"])).optional(),
|
|
1376
1465
|
/**
|
|
1377
1466
|
* Minimum rating
|
|
1378
1467
|
*/
|
|
1379
|
-
minRating:
|
|
1468
|
+
minRating: z6.number().min(0).max(5).optional(),
|
|
1380
1469
|
/**
|
|
1381
1470
|
* Sort options
|
|
1382
1471
|
*/
|
|
1383
|
-
sortBy:
|
|
1472
|
+
sortBy: z6.enum([
|
|
1384
1473
|
"relevance",
|
|
1385
1474
|
"downloads",
|
|
1386
1475
|
"rating",
|
|
@@ -1390,97 +1479,97 @@ var PluginSearchFiltersSchema = z5.object({
|
|
|
1390
1479
|
/**
|
|
1391
1480
|
* Sort order
|
|
1392
1481
|
*/
|
|
1393
|
-
sortOrder:
|
|
1482
|
+
sortOrder: z6.enum(["asc", "desc"]).default("desc").optional(),
|
|
1394
1483
|
/**
|
|
1395
1484
|
* Pagination
|
|
1396
1485
|
*/
|
|
1397
|
-
page:
|
|
1398
|
-
limit:
|
|
1486
|
+
page: z6.number().int().min(1).default(1).optional(),
|
|
1487
|
+
limit: z6.number().int().min(1).max(100).default(20).optional()
|
|
1399
1488
|
});
|
|
1400
|
-
var PluginInstallConfigSchema =
|
|
1489
|
+
var PluginInstallConfigSchema = z6.object({
|
|
1401
1490
|
/**
|
|
1402
1491
|
* Plugin identifier to install
|
|
1403
1492
|
*/
|
|
1404
|
-
pluginId:
|
|
1493
|
+
pluginId: z6.string(),
|
|
1405
1494
|
/**
|
|
1406
1495
|
* Version to install (supports semver ranges)
|
|
1407
1496
|
*/
|
|
1408
|
-
version:
|
|
1497
|
+
version: z6.string().optional().describe("Defaults to latest"),
|
|
1409
1498
|
/**
|
|
1410
1499
|
* Plugin-specific configuration values
|
|
1411
1500
|
*/
|
|
1412
|
-
config:
|
|
1501
|
+
config: z6.record(z6.string(), z6.any()).optional(),
|
|
1413
1502
|
/**
|
|
1414
1503
|
* Whether to auto-update
|
|
1415
1504
|
*/
|
|
1416
|
-
autoUpdate:
|
|
1505
|
+
autoUpdate: z6.boolean().default(false).optional(),
|
|
1417
1506
|
/**
|
|
1418
1507
|
* Installation options
|
|
1419
1508
|
*/
|
|
1420
|
-
options:
|
|
1509
|
+
options: z6.object({
|
|
1421
1510
|
/**
|
|
1422
1511
|
* Skip dependency installation
|
|
1423
1512
|
*/
|
|
1424
|
-
skipDependencies:
|
|
1513
|
+
skipDependencies: z6.boolean().default(false).optional(),
|
|
1425
1514
|
/**
|
|
1426
1515
|
* Force reinstall
|
|
1427
1516
|
*/
|
|
1428
|
-
force:
|
|
1517
|
+
force: z6.boolean().default(false).optional(),
|
|
1429
1518
|
/**
|
|
1430
1519
|
* Installation target
|
|
1431
1520
|
*/
|
|
1432
|
-
target:
|
|
1521
|
+
target: z6.enum(["system", "space", "user"]).default("space").optional()
|
|
1433
1522
|
}).optional()
|
|
1434
1523
|
});
|
|
1435
1524
|
|
|
1436
1525
|
// src/hub/marketplace.zod.ts
|
|
1437
1526
|
var PluginAuthorSchema = PluginVendorSchema;
|
|
1438
|
-
var PluginPricingSchema =
|
|
1439
|
-
type:
|
|
1440
|
-
currency:
|
|
1441
|
-
amount:
|
|
1442
|
-
interval:
|
|
1443
|
-
trialDays:
|
|
1527
|
+
var PluginPricingSchema = z7.object({
|
|
1528
|
+
type: z7.enum(["free", "one_time", "recurring"]),
|
|
1529
|
+
currency: z7.string().default("USD"),
|
|
1530
|
+
amount: z7.number().min(0),
|
|
1531
|
+
interval: z7.enum(["month", "year"]).optional().describe("Required if type is recurring"),
|
|
1532
|
+
trialDays: z7.number().int().optional()
|
|
1444
1533
|
});
|
|
1445
|
-
var PluginVersionSchema =
|
|
1446
|
-
version:
|
|
1447
|
-
publishedAt:
|
|
1448
|
-
downloadUrl:
|
|
1449
|
-
checksum:
|
|
1450
|
-
engine:
|
|
1451
|
-
node:
|
|
1452
|
-
objectstack:
|
|
1534
|
+
var PluginVersionSchema = z7.object({
|
|
1535
|
+
version: z7.string().describe("SemVer string (e.g. 1.0.0)"),
|
|
1536
|
+
publishedAt: z7.string().datetime().describe("Publication date"),
|
|
1537
|
+
downloadUrl: z7.string().url().describe("Archive download URL"),
|
|
1538
|
+
checksum: z7.string().optional().describe("Integrity checksum (shasum)"),
|
|
1539
|
+
engine: z7.object({
|
|
1540
|
+
node: z7.string().optional(),
|
|
1541
|
+
objectstack: z7.string().describe("Required ObjectStack kernel version range")
|
|
1453
1542
|
}).optional().describe("Engine compatibility"),
|
|
1454
|
-
dependencies:
|
|
1455
|
-
changeLog:
|
|
1543
|
+
dependencies: z7.record(z7.string(), z7.string()).optional().describe("Runtime plugin dependencies"),
|
|
1544
|
+
changeLog: z7.string().optional().describe("Release notes")
|
|
1456
1545
|
});
|
|
1457
|
-
var MarketplacePluginSchema =
|
|
1546
|
+
var MarketplacePluginSchema = z7.object({
|
|
1458
1547
|
/**
|
|
1459
1548
|
* Package Identifier
|
|
1460
1549
|
* Usually the NPM package name (e.g. "@steedos/plugin-crm")
|
|
1461
1550
|
*/
|
|
1462
|
-
id:
|
|
1551
|
+
id: z7.string(),
|
|
1463
1552
|
/**
|
|
1464
1553
|
* Version History
|
|
1465
1554
|
* Registry of all available versions
|
|
1466
1555
|
*/
|
|
1467
|
-
versions:
|
|
1556
|
+
versions: z7.record(z7.string(), PluginVersionSchema).optional().describe("Map of versions (1.0.0) -> Details"),
|
|
1468
1557
|
/**
|
|
1469
1558
|
* Display Name
|
|
1470
1559
|
*/
|
|
1471
|
-
label:
|
|
1560
|
+
label: z7.string(),
|
|
1472
1561
|
/**
|
|
1473
1562
|
* Short Description
|
|
1474
1563
|
*/
|
|
1475
|
-
description:
|
|
1564
|
+
description: z7.string().optional(),
|
|
1476
1565
|
/**
|
|
1477
1566
|
* Detailed README / Documentation content
|
|
1478
1567
|
*/
|
|
1479
|
-
readme:
|
|
1568
|
+
readme: z7.string().optional(),
|
|
1480
1569
|
/**
|
|
1481
1570
|
* Latest Version
|
|
1482
1571
|
*/
|
|
1483
|
-
version:
|
|
1572
|
+
version: z7.string(),
|
|
1484
1573
|
/**
|
|
1485
1574
|
* Vendor / Publisher
|
|
1486
1575
|
*/
|
|
@@ -1488,8 +1577,8 @@ var MarketplacePluginSchema = z6.object({
|
|
|
1488
1577
|
/**
|
|
1489
1578
|
* Categorization
|
|
1490
1579
|
*/
|
|
1491
|
-
tags:
|
|
1492
|
-
category:
|
|
1580
|
+
tags: z7.array(z7.string()).optional(),
|
|
1581
|
+
category: z7.enum([
|
|
1493
1582
|
"app",
|
|
1494
1583
|
"integration",
|
|
1495
1584
|
"theme",
|
|
@@ -1504,29 +1593,29 @@ var MarketplacePluginSchema = z6.object({
|
|
|
1504
1593
|
/**
|
|
1505
1594
|
* Assets
|
|
1506
1595
|
*/
|
|
1507
|
-
icon:
|
|
1508
|
-
screenshots:
|
|
1596
|
+
icon: z7.string().url().optional(),
|
|
1597
|
+
screenshots: z7.array(z7.string().url()).optional(),
|
|
1509
1598
|
/**
|
|
1510
1599
|
* Links
|
|
1511
1600
|
*/
|
|
1512
|
-
homepage:
|
|
1513
|
-
repository:
|
|
1514
|
-
bugs:
|
|
1601
|
+
homepage: z7.string().url().optional(),
|
|
1602
|
+
repository: z7.string().url().optional(),
|
|
1603
|
+
bugs: z7.string().url().optional(),
|
|
1515
1604
|
/**
|
|
1516
1605
|
* Statistics
|
|
1517
1606
|
*/
|
|
1518
|
-
downloads:
|
|
1519
|
-
rating:
|
|
1607
|
+
downloads: z7.number().int().optional(),
|
|
1608
|
+
rating: z7.number().min(0).max(5).optional(),
|
|
1520
1609
|
/**
|
|
1521
1610
|
* Commercial Information
|
|
1522
1611
|
*/
|
|
1523
1612
|
pricing: PluginPricingSchema.optional(),
|
|
1524
|
-
verified:
|
|
1613
|
+
verified: z7.boolean().default(false).describe("Is verified maintaned by ObjectStack")
|
|
1525
1614
|
});
|
|
1526
1615
|
|
|
1527
1616
|
// src/hub/registry-config.zod.ts
|
|
1528
|
-
import { z as
|
|
1529
|
-
var RegistrySyncPolicySchema =
|
|
1617
|
+
import { z as z8 } from "zod";
|
|
1618
|
+
var RegistrySyncPolicySchema = z8.enum([
|
|
1530
1619
|
"manual",
|
|
1531
1620
|
// Manual synchronization only
|
|
1532
1621
|
"auto",
|
|
@@ -1534,11 +1623,11 @@ var RegistrySyncPolicySchema = z7.enum([
|
|
|
1534
1623
|
"proxy"
|
|
1535
1624
|
// Proxy requests to upstream without caching
|
|
1536
1625
|
]).describe("Registry synchronization strategy");
|
|
1537
|
-
var RegistryUpstreamSchema =
|
|
1626
|
+
var RegistryUpstreamSchema = z8.object({
|
|
1538
1627
|
/**
|
|
1539
1628
|
* Upstream registry URL
|
|
1540
1629
|
*/
|
|
1541
|
-
url:
|
|
1630
|
+
url: z8.string().url().describe("Upstream registry endpoint"),
|
|
1542
1631
|
/**
|
|
1543
1632
|
* Synchronization policy
|
|
1544
1633
|
*/
|
|
@@ -1546,43 +1635,43 @@ var RegistryUpstreamSchema = z7.object({
|
|
|
1546
1635
|
/**
|
|
1547
1636
|
* Sync interval in seconds (for auto sync)
|
|
1548
1637
|
*/
|
|
1549
|
-
syncInterval:
|
|
1638
|
+
syncInterval: z8.number().int().min(60).optional().describe("Auto-sync interval in seconds"),
|
|
1550
1639
|
/**
|
|
1551
1640
|
* Authentication credentials
|
|
1552
1641
|
*/
|
|
1553
|
-
auth:
|
|
1554
|
-
type:
|
|
1555
|
-
username:
|
|
1556
|
-
password:
|
|
1557
|
-
token:
|
|
1558
|
-
apiKey:
|
|
1642
|
+
auth: z8.object({
|
|
1643
|
+
type: z8.enum(["none", "basic", "bearer", "api-key", "oauth2"]).default("none"),
|
|
1644
|
+
username: z8.string().optional(),
|
|
1645
|
+
password: z8.string().optional(),
|
|
1646
|
+
token: z8.string().optional(),
|
|
1647
|
+
apiKey: z8.string().optional()
|
|
1559
1648
|
}).optional(),
|
|
1560
1649
|
/**
|
|
1561
1650
|
* TLS/SSL configuration
|
|
1562
1651
|
*/
|
|
1563
|
-
tls:
|
|
1564
|
-
enabled:
|
|
1565
|
-
verifyCertificate:
|
|
1566
|
-
certificate:
|
|
1567
|
-
privateKey:
|
|
1652
|
+
tls: z8.object({
|
|
1653
|
+
enabled: z8.boolean().default(true),
|
|
1654
|
+
verifyCertificate: z8.boolean().default(true),
|
|
1655
|
+
certificate: z8.string().optional(),
|
|
1656
|
+
privateKey: z8.string().optional()
|
|
1568
1657
|
}).optional(),
|
|
1569
1658
|
/**
|
|
1570
1659
|
* Timeout settings
|
|
1571
1660
|
*/
|
|
1572
|
-
timeout:
|
|
1661
|
+
timeout: z8.number().int().min(1e3).default(3e4).describe("Request timeout in milliseconds"),
|
|
1573
1662
|
/**
|
|
1574
1663
|
* Retry configuration
|
|
1575
1664
|
*/
|
|
1576
|
-
retry:
|
|
1577
|
-
maxAttempts:
|
|
1578
|
-
backoff:
|
|
1665
|
+
retry: z8.object({
|
|
1666
|
+
maxAttempts: z8.number().int().min(0).default(3),
|
|
1667
|
+
backoff: z8.enum(["fixed", "linear", "exponential"]).default("exponential")
|
|
1579
1668
|
}).optional()
|
|
1580
1669
|
});
|
|
1581
|
-
var RegistryConfigSchema =
|
|
1670
|
+
var RegistryConfigSchema = z8.object({
|
|
1582
1671
|
/**
|
|
1583
1672
|
* Registry type
|
|
1584
1673
|
*/
|
|
1585
|
-
type:
|
|
1674
|
+
type: z8.enum([
|
|
1586
1675
|
"public",
|
|
1587
1676
|
// Public marketplace (e.g., plugins.objectstack.com)
|
|
1588
1677
|
"private",
|
|
@@ -1593,76 +1682,76 @@ var RegistryConfigSchema = z7.object({
|
|
|
1593
1682
|
/**
|
|
1594
1683
|
* Upstream registries (for hybrid/private registries)
|
|
1595
1684
|
*/
|
|
1596
|
-
upstream:
|
|
1685
|
+
upstream: z8.array(RegistryUpstreamSchema).optional().describe("Upstream registries to sync from or proxy to"),
|
|
1597
1686
|
/**
|
|
1598
1687
|
* Scopes managed by this registry
|
|
1599
1688
|
*/
|
|
1600
|
-
scope:
|
|
1689
|
+
scope: z8.array(z8.string()).optional().describe("npm-style scopes managed by this registry (e.g., @my-corp, @enterprise)"),
|
|
1601
1690
|
/**
|
|
1602
1691
|
* Default scope for new plugins
|
|
1603
1692
|
*/
|
|
1604
|
-
defaultScope:
|
|
1693
|
+
defaultScope: z8.string().optional().describe("Default scope prefix for new plugins"),
|
|
1605
1694
|
/**
|
|
1606
1695
|
* Registry storage configuration
|
|
1607
1696
|
*/
|
|
1608
|
-
storage:
|
|
1697
|
+
storage: z8.object({
|
|
1609
1698
|
/**
|
|
1610
1699
|
* Storage backend type
|
|
1611
1700
|
*/
|
|
1612
|
-
backend:
|
|
1701
|
+
backend: z8.enum(["local", "s3", "gcs", "azure-blob", "oss"]).default("local"),
|
|
1613
1702
|
/**
|
|
1614
1703
|
* Storage path or bucket name
|
|
1615
1704
|
*/
|
|
1616
|
-
path:
|
|
1705
|
+
path: z8.string().optional(),
|
|
1617
1706
|
/**
|
|
1618
1707
|
* Credentials
|
|
1619
1708
|
*/
|
|
1620
|
-
credentials:
|
|
1709
|
+
credentials: z8.record(z8.string(), z8.any()).optional()
|
|
1621
1710
|
}).optional(),
|
|
1622
1711
|
/**
|
|
1623
1712
|
* Registry visibility
|
|
1624
1713
|
*/
|
|
1625
|
-
visibility:
|
|
1714
|
+
visibility: z8.enum(["public", "private", "internal"]).default("private").describe("Who can access this registry"),
|
|
1626
1715
|
/**
|
|
1627
1716
|
* Access control
|
|
1628
1717
|
*/
|
|
1629
|
-
accessControl:
|
|
1718
|
+
accessControl: z8.object({
|
|
1630
1719
|
/**
|
|
1631
1720
|
* Require authentication for read
|
|
1632
1721
|
*/
|
|
1633
|
-
requireAuthForRead:
|
|
1722
|
+
requireAuthForRead: z8.boolean().default(false),
|
|
1634
1723
|
/**
|
|
1635
1724
|
* Require authentication for write
|
|
1636
1725
|
*/
|
|
1637
|
-
requireAuthForWrite:
|
|
1726
|
+
requireAuthForWrite: z8.boolean().default(true),
|
|
1638
1727
|
/**
|
|
1639
1728
|
* Allowed users/teams
|
|
1640
1729
|
*/
|
|
1641
|
-
allowedPrincipals:
|
|
1730
|
+
allowedPrincipals: z8.array(z8.string()).optional()
|
|
1642
1731
|
}).optional(),
|
|
1643
1732
|
/**
|
|
1644
1733
|
* Caching configuration
|
|
1645
1734
|
*/
|
|
1646
|
-
cache:
|
|
1647
|
-
enabled:
|
|
1648
|
-
ttl:
|
|
1649
|
-
maxSize:
|
|
1735
|
+
cache: z8.object({
|
|
1736
|
+
enabled: z8.boolean().default(true),
|
|
1737
|
+
ttl: z8.number().int().min(0).default(3600).describe("Cache TTL in seconds"),
|
|
1738
|
+
maxSize: z8.number().int().optional().describe("Maximum cache size in bytes")
|
|
1650
1739
|
}).optional(),
|
|
1651
1740
|
/**
|
|
1652
1741
|
* Mirroring configuration (for high availability)
|
|
1653
1742
|
*/
|
|
1654
|
-
mirrors:
|
|
1655
|
-
url:
|
|
1656
|
-
priority:
|
|
1743
|
+
mirrors: z8.array(z8.object({
|
|
1744
|
+
url: z8.string().url(),
|
|
1745
|
+
priority: z8.number().int().min(1).default(1)
|
|
1657
1746
|
})).optional().describe("Mirror registries for redundancy")
|
|
1658
1747
|
});
|
|
1659
1748
|
|
|
1660
1749
|
// src/hub/space.zod.ts
|
|
1661
|
-
import { z as
|
|
1750
|
+
import { z as z10 } from "zod";
|
|
1662
1751
|
|
|
1663
1752
|
// src/hub/tenant.zod.ts
|
|
1664
|
-
import { z as
|
|
1665
|
-
var TenantIsolationLevel =
|
|
1753
|
+
import { z as z9 } from "zod";
|
|
1754
|
+
var TenantIsolationLevel = z9.enum([
|
|
1666
1755
|
"shared_schema",
|
|
1667
1756
|
// Shared DB, shared schema, row-level isolation (most economical)
|
|
1668
1757
|
"isolated_schema",
|
|
@@ -1670,29 +1759,29 @@ var TenantIsolationLevel = z8.enum([
|
|
|
1670
1759
|
"isolated_db"
|
|
1671
1760
|
// Separate database per tenant (maximum isolation)
|
|
1672
1761
|
]);
|
|
1673
|
-
var TenantQuotaSchema =
|
|
1762
|
+
var TenantQuotaSchema = z9.object({
|
|
1674
1763
|
/**
|
|
1675
1764
|
* Maximum number of users allowed for this tenant
|
|
1676
1765
|
*/
|
|
1677
|
-
maxUsers:
|
|
1766
|
+
maxUsers: z9.number().int().positive().optional().describe("Maximum number of users"),
|
|
1678
1767
|
/**
|
|
1679
1768
|
* Maximum storage space in bytes
|
|
1680
1769
|
*/
|
|
1681
|
-
maxStorage:
|
|
1770
|
+
maxStorage: z9.number().int().positive().optional().describe("Maximum storage in bytes"),
|
|
1682
1771
|
/**
|
|
1683
1772
|
* API rate limit (requests per minute)
|
|
1684
1773
|
*/
|
|
1685
|
-
apiRateLimit:
|
|
1774
|
+
apiRateLimit: z9.number().int().positive().optional().describe("API requests per minute")
|
|
1686
1775
|
});
|
|
1687
|
-
var TenantSchema =
|
|
1776
|
+
var TenantSchema = z9.object({
|
|
1688
1777
|
/**
|
|
1689
1778
|
* Unique tenant identifier
|
|
1690
1779
|
*/
|
|
1691
|
-
id:
|
|
1780
|
+
id: z9.string().describe("Unique tenant identifier"),
|
|
1692
1781
|
/**
|
|
1693
1782
|
* Tenant display name
|
|
1694
1783
|
*/
|
|
1695
|
-
name:
|
|
1784
|
+
name: z9.string().describe("Tenant display name"),
|
|
1696
1785
|
/**
|
|
1697
1786
|
* Data isolation level
|
|
1698
1787
|
*/
|
|
@@ -1700,26 +1789,26 @@ var TenantSchema = z8.object({
|
|
|
1700
1789
|
/**
|
|
1701
1790
|
* Custom configuration values
|
|
1702
1791
|
*/
|
|
1703
|
-
customizations:
|
|
1792
|
+
customizations: z9.record(z9.string(), z9.any()).optional().describe("Custom configuration values"),
|
|
1704
1793
|
/**
|
|
1705
1794
|
* Resource quotas
|
|
1706
1795
|
*/
|
|
1707
1796
|
quotas: TenantQuotaSchema.optional()
|
|
1708
1797
|
});
|
|
1709
|
-
var RowLevelIsolationStrategySchema =
|
|
1710
|
-
strategy:
|
|
1798
|
+
var RowLevelIsolationStrategySchema = z9.object({
|
|
1799
|
+
strategy: z9.literal("shared_schema").describe("Row-level isolation strategy"),
|
|
1711
1800
|
/**
|
|
1712
1801
|
* Database configuration for row-level isolation
|
|
1713
1802
|
*/
|
|
1714
|
-
database:
|
|
1803
|
+
database: z9.object({
|
|
1715
1804
|
/**
|
|
1716
1805
|
* Whether to enable Row-Level Security (RLS)
|
|
1717
1806
|
*/
|
|
1718
|
-
enableRLS:
|
|
1807
|
+
enableRLS: z9.boolean().default(true).describe("Enable PostgreSQL Row-Level Security"),
|
|
1719
1808
|
/**
|
|
1720
1809
|
* Tenant context setting method
|
|
1721
1810
|
*/
|
|
1722
|
-
contextMethod:
|
|
1811
|
+
contextMethod: z9.enum([
|
|
1723
1812
|
"session_variable",
|
|
1724
1813
|
// SET app.current_tenant = 'tenant_123'
|
|
1725
1814
|
"search_path",
|
|
@@ -1730,63 +1819,63 @@ var RowLevelIsolationStrategySchema = z8.object({
|
|
|
1730
1819
|
/**
|
|
1731
1820
|
* Session variable name for tenant context
|
|
1732
1821
|
*/
|
|
1733
|
-
contextVariable:
|
|
1822
|
+
contextVariable: z9.string().default("app.current_tenant").describe("Session variable name"),
|
|
1734
1823
|
/**
|
|
1735
1824
|
* Whether to validate tenant_id at application level
|
|
1736
1825
|
*/
|
|
1737
|
-
applicationValidation:
|
|
1826
|
+
applicationValidation: z9.boolean().default(true).describe("Application-level tenant validation")
|
|
1738
1827
|
}).optional().describe("Database configuration"),
|
|
1739
1828
|
/**
|
|
1740
1829
|
* Performance optimization settings
|
|
1741
1830
|
*/
|
|
1742
|
-
performance:
|
|
1831
|
+
performance: z9.object({
|
|
1743
1832
|
/**
|
|
1744
1833
|
* Whether to use partial indexes for tenant_id
|
|
1745
1834
|
*/
|
|
1746
|
-
usePartialIndexes:
|
|
1835
|
+
usePartialIndexes: z9.boolean().default(true).describe("Use partial indexes per tenant"),
|
|
1747
1836
|
/**
|
|
1748
1837
|
* Whether to use table partitioning
|
|
1749
1838
|
*/
|
|
1750
|
-
usePartitioning:
|
|
1839
|
+
usePartitioning: z9.boolean().default(false).describe("Use table partitioning by tenant_id"),
|
|
1751
1840
|
/**
|
|
1752
1841
|
* Connection pool size per tenant
|
|
1753
1842
|
*/
|
|
1754
|
-
poolSizePerTenant:
|
|
1843
|
+
poolSizePerTenant: z9.number().int().positive().optional().describe("Connection pool size per tenant")
|
|
1755
1844
|
}).optional().describe("Performance settings")
|
|
1756
1845
|
});
|
|
1757
|
-
var SchemaLevelIsolationStrategySchema =
|
|
1758
|
-
strategy:
|
|
1846
|
+
var SchemaLevelIsolationStrategySchema = z9.object({
|
|
1847
|
+
strategy: z9.literal("isolated_schema").describe("Schema-level isolation strategy"),
|
|
1759
1848
|
/**
|
|
1760
1849
|
* Schema configuration
|
|
1761
1850
|
*/
|
|
1762
|
-
schema:
|
|
1851
|
+
schema: z9.object({
|
|
1763
1852
|
/**
|
|
1764
1853
|
* Schema naming pattern
|
|
1765
1854
|
* Use {tenant_id} as placeholder (must contain only alphanumeric and underscores)
|
|
1766
1855
|
* The tenant_id will be sanitized before substitution to prevent SQL injection
|
|
1767
1856
|
*/
|
|
1768
|
-
namingPattern:
|
|
1857
|
+
namingPattern: z9.string().default("tenant_{tenant_id}").describe("Schema naming pattern"),
|
|
1769
1858
|
/**
|
|
1770
1859
|
* Whether to include public schema in search_path
|
|
1771
1860
|
*/
|
|
1772
|
-
includePublicSchema:
|
|
1861
|
+
includePublicSchema: z9.boolean().default(true).describe("Include public schema"),
|
|
1773
1862
|
/**
|
|
1774
1863
|
* Default schema for shared resources
|
|
1775
1864
|
*/
|
|
1776
|
-
sharedSchema:
|
|
1865
|
+
sharedSchema: z9.string().default("public").describe("Schema for shared resources"),
|
|
1777
1866
|
/**
|
|
1778
1867
|
* Whether to automatically create schema on tenant creation
|
|
1779
1868
|
*/
|
|
1780
|
-
autoCreateSchema:
|
|
1869
|
+
autoCreateSchema: z9.boolean().default(true).describe("Auto-create schema")
|
|
1781
1870
|
}).optional().describe("Schema configuration"),
|
|
1782
1871
|
/**
|
|
1783
1872
|
* Migration configuration
|
|
1784
1873
|
*/
|
|
1785
|
-
migrations:
|
|
1874
|
+
migrations: z9.object({
|
|
1786
1875
|
/**
|
|
1787
1876
|
* Migration strategy
|
|
1788
1877
|
*/
|
|
1789
|
-
strategy:
|
|
1878
|
+
strategy: z9.enum([
|
|
1790
1879
|
"parallel",
|
|
1791
1880
|
// Run migrations on all schemas in parallel
|
|
1792
1881
|
"sequential",
|
|
@@ -1797,42 +1886,42 @@ var SchemaLevelIsolationStrategySchema = z8.object({
|
|
|
1797
1886
|
/**
|
|
1798
1887
|
* Maximum concurrent migrations
|
|
1799
1888
|
*/
|
|
1800
|
-
maxConcurrent:
|
|
1889
|
+
maxConcurrent: z9.number().int().positive().default(10).describe("Max concurrent migrations"),
|
|
1801
1890
|
/**
|
|
1802
1891
|
* Whether to rollback on first failure
|
|
1803
1892
|
*/
|
|
1804
|
-
rollbackOnError:
|
|
1893
|
+
rollbackOnError: z9.boolean().default(true).describe("Rollback on error")
|
|
1805
1894
|
}).optional().describe("Migration configuration"),
|
|
1806
1895
|
/**
|
|
1807
1896
|
* Performance optimization settings
|
|
1808
1897
|
*/
|
|
1809
|
-
performance:
|
|
1898
|
+
performance: z9.object({
|
|
1810
1899
|
/**
|
|
1811
1900
|
* Whether to use connection pooling per schema
|
|
1812
1901
|
*/
|
|
1813
|
-
poolPerSchema:
|
|
1902
|
+
poolPerSchema: z9.boolean().default(false).describe("Separate pool per schema"),
|
|
1814
1903
|
/**
|
|
1815
1904
|
* Schema cache TTL in seconds
|
|
1816
1905
|
*/
|
|
1817
|
-
schemaCacheTTL:
|
|
1906
|
+
schemaCacheTTL: z9.number().int().positive().default(3600).describe("Schema cache TTL")
|
|
1818
1907
|
}).optional().describe("Performance settings")
|
|
1819
1908
|
});
|
|
1820
|
-
var DatabaseLevelIsolationStrategySchema =
|
|
1821
|
-
strategy:
|
|
1909
|
+
var DatabaseLevelIsolationStrategySchema = z9.object({
|
|
1910
|
+
strategy: z9.literal("isolated_db").describe("Database-level isolation strategy"),
|
|
1822
1911
|
/**
|
|
1823
1912
|
* Database configuration
|
|
1824
1913
|
*/
|
|
1825
|
-
database:
|
|
1914
|
+
database: z9.object({
|
|
1826
1915
|
/**
|
|
1827
1916
|
* Database naming pattern
|
|
1828
1917
|
* Use {tenant_id} as placeholder (must contain only alphanumeric and underscores)
|
|
1829
1918
|
* The tenant_id will be sanitized before substitution to prevent SQL injection
|
|
1830
1919
|
*/
|
|
1831
|
-
namingPattern:
|
|
1920
|
+
namingPattern: z9.string().default("tenant_{tenant_id}").describe("Database naming pattern"),
|
|
1832
1921
|
/**
|
|
1833
1922
|
* Database server/cluster assignment strategy
|
|
1834
1923
|
*/
|
|
1835
|
-
serverStrategy:
|
|
1924
|
+
serverStrategy: z9.enum([
|
|
1836
1925
|
"shared",
|
|
1837
1926
|
// All tenant databases on same server
|
|
1838
1927
|
"sharded",
|
|
@@ -1843,41 +1932,41 @@ var DatabaseLevelIsolationStrategySchema = z8.object({
|
|
|
1843
1932
|
/**
|
|
1844
1933
|
* Whether to use separate credentials per tenant
|
|
1845
1934
|
*/
|
|
1846
|
-
separateCredentials:
|
|
1935
|
+
separateCredentials: z9.boolean().default(true).describe("Separate credentials per tenant"),
|
|
1847
1936
|
/**
|
|
1848
1937
|
* Whether to automatically create database on tenant creation
|
|
1849
1938
|
*/
|
|
1850
|
-
autoCreateDatabase:
|
|
1939
|
+
autoCreateDatabase: z9.boolean().default(true).describe("Auto-create database")
|
|
1851
1940
|
}).optional().describe("Database configuration"),
|
|
1852
1941
|
/**
|
|
1853
1942
|
* Connection pooling configuration
|
|
1854
1943
|
*/
|
|
1855
|
-
connectionPool:
|
|
1944
|
+
connectionPool: z9.object({
|
|
1856
1945
|
/**
|
|
1857
1946
|
* Pool size per tenant database
|
|
1858
1947
|
*/
|
|
1859
|
-
poolSize:
|
|
1948
|
+
poolSize: z9.number().int().positive().default(10).describe("Connection pool size"),
|
|
1860
1949
|
/**
|
|
1861
1950
|
* Maximum number of tenant pools to keep active
|
|
1862
1951
|
*/
|
|
1863
|
-
maxActivePools:
|
|
1952
|
+
maxActivePools: z9.number().int().positive().default(100).describe("Max active pools"),
|
|
1864
1953
|
/**
|
|
1865
1954
|
* Idle pool timeout in seconds
|
|
1866
1955
|
*/
|
|
1867
|
-
idleTimeout:
|
|
1956
|
+
idleTimeout: z9.number().int().positive().default(300).describe("Idle pool timeout"),
|
|
1868
1957
|
/**
|
|
1869
1958
|
* Whether to use connection pooler (PgBouncer, etc.)
|
|
1870
1959
|
*/
|
|
1871
|
-
usePooler:
|
|
1960
|
+
usePooler: z9.boolean().default(true).describe("Use connection pooler")
|
|
1872
1961
|
}).optional().describe("Connection pool configuration"),
|
|
1873
1962
|
/**
|
|
1874
1963
|
* Backup and restore configuration
|
|
1875
1964
|
*/
|
|
1876
|
-
backup:
|
|
1965
|
+
backup: z9.object({
|
|
1877
1966
|
/**
|
|
1878
1967
|
* Backup strategy per tenant
|
|
1879
1968
|
*/
|
|
1880
|
-
strategy:
|
|
1969
|
+
strategy: z9.enum([
|
|
1881
1970
|
"individual",
|
|
1882
1971
|
// Separate backup per tenant
|
|
1883
1972
|
"consolidated",
|
|
@@ -1888,82 +1977,82 @@ var DatabaseLevelIsolationStrategySchema = z8.object({
|
|
|
1888
1977
|
/**
|
|
1889
1978
|
* Backup frequency in hours
|
|
1890
1979
|
*/
|
|
1891
|
-
frequencyHours:
|
|
1980
|
+
frequencyHours: z9.number().int().positive().default(24).describe("Backup frequency"),
|
|
1892
1981
|
/**
|
|
1893
1982
|
* Retention period in days
|
|
1894
1983
|
*/
|
|
1895
|
-
retentionDays:
|
|
1984
|
+
retentionDays: z9.number().int().positive().default(30).describe("Backup retention days")
|
|
1896
1985
|
}).optional().describe("Backup configuration"),
|
|
1897
1986
|
/**
|
|
1898
1987
|
* Encryption configuration
|
|
1899
1988
|
*/
|
|
1900
|
-
encryption:
|
|
1989
|
+
encryption: z9.object({
|
|
1901
1990
|
/**
|
|
1902
1991
|
* Whether to use per-tenant encryption keys
|
|
1903
1992
|
*/
|
|
1904
|
-
perTenantKeys:
|
|
1993
|
+
perTenantKeys: z9.boolean().default(false).describe("Per-tenant encryption keys"),
|
|
1905
1994
|
/**
|
|
1906
1995
|
* Encryption algorithm
|
|
1907
1996
|
*/
|
|
1908
|
-
algorithm:
|
|
1997
|
+
algorithm: z9.string().default("AES-256-GCM").describe("Encryption algorithm"),
|
|
1909
1998
|
/**
|
|
1910
1999
|
* Key management service
|
|
1911
2000
|
*/
|
|
1912
|
-
keyManagement:
|
|
2001
|
+
keyManagement: z9.enum(["aws_kms", "azure_key_vault", "gcp_kms", "hashicorp_vault", "custom"]).optional().describe("Key management service")
|
|
1913
2002
|
}).optional().describe("Encryption configuration")
|
|
1914
2003
|
});
|
|
1915
|
-
var TenantIsolationConfigSchema =
|
|
2004
|
+
var TenantIsolationConfigSchema = z9.discriminatedUnion("strategy", [
|
|
1916
2005
|
RowLevelIsolationStrategySchema,
|
|
1917
2006
|
SchemaLevelIsolationStrategySchema,
|
|
1918
2007
|
DatabaseLevelIsolationStrategySchema
|
|
1919
2008
|
]);
|
|
1920
|
-
var TenantSecurityPolicySchema =
|
|
2009
|
+
var TenantSecurityPolicySchema = z9.object({
|
|
1921
2010
|
/**
|
|
1922
2011
|
* Encryption requirements
|
|
1923
2012
|
*/
|
|
1924
|
-
encryption:
|
|
2013
|
+
encryption: z9.object({
|
|
1925
2014
|
/**
|
|
1926
2015
|
* Require encryption at rest
|
|
1927
2016
|
*/
|
|
1928
|
-
atRest:
|
|
2017
|
+
atRest: z9.boolean().default(true).describe("Require encryption at rest"),
|
|
1929
2018
|
/**
|
|
1930
2019
|
* Require encryption in transit
|
|
1931
2020
|
*/
|
|
1932
|
-
inTransit:
|
|
2021
|
+
inTransit: z9.boolean().default(true).describe("Require encryption in transit"),
|
|
1933
2022
|
/**
|
|
1934
2023
|
* Require field-level encryption for sensitive data
|
|
1935
2024
|
*/
|
|
1936
|
-
fieldLevel:
|
|
2025
|
+
fieldLevel: z9.boolean().default(false).describe("Require field-level encryption")
|
|
1937
2026
|
}).optional().describe("Encryption requirements"),
|
|
1938
2027
|
/**
|
|
1939
2028
|
* Access control requirements
|
|
1940
2029
|
*/
|
|
1941
|
-
accessControl:
|
|
2030
|
+
accessControl: z9.object({
|
|
1942
2031
|
/**
|
|
1943
2032
|
* Require multi-factor authentication
|
|
1944
2033
|
*/
|
|
1945
|
-
requireMFA:
|
|
2034
|
+
requireMFA: z9.boolean().default(false).describe("Require MFA"),
|
|
1946
2035
|
/**
|
|
1947
2036
|
* Require SSO/SAML authentication
|
|
1948
2037
|
*/
|
|
1949
|
-
requireSSO:
|
|
2038
|
+
requireSSO: z9.boolean().default(false).describe("Require SSO"),
|
|
1950
2039
|
/**
|
|
1951
2040
|
* IP whitelist
|
|
1952
2041
|
*/
|
|
1953
|
-
ipWhitelist:
|
|
2042
|
+
ipWhitelist: z9.array(z9.string()).optional().describe("Allowed IP addresses"),
|
|
1954
2043
|
/**
|
|
1955
2044
|
* Session timeout in seconds
|
|
1956
2045
|
*/
|
|
1957
|
-
sessionTimeout:
|
|
2046
|
+
sessionTimeout: z9.number().int().positive().default(3600).describe("Session timeout")
|
|
1958
2047
|
}).optional().describe("Access control requirements"),
|
|
1959
2048
|
/**
|
|
1960
2049
|
* Audit and compliance requirements
|
|
1961
2050
|
*/
|
|
1962
|
-
compliance:
|
|
2051
|
+
compliance: z9.object({
|
|
1963
2052
|
/**
|
|
1964
2053
|
* Compliance standards to enforce
|
|
1965
2054
|
*/
|
|
1966
|
-
standards:
|
|
2055
|
+
standards: z9.array(z9.enum([
|
|
1967
2056
|
"sox",
|
|
1968
2057
|
"hipaa",
|
|
1969
2058
|
"gdpr",
|
|
@@ -1974,77 +2063,77 @@ var TenantSecurityPolicySchema = z8.object({
|
|
|
1974
2063
|
/**
|
|
1975
2064
|
* Require audit logging for all operations
|
|
1976
2065
|
*/
|
|
1977
|
-
requireAuditLog:
|
|
2066
|
+
requireAuditLog: z9.boolean().default(true).describe("Require audit logging"),
|
|
1978
2067
|
/**
|
|
1979
2068
|
* Audit log retention period in days
|
|
1980
2069
|
*/
|
|
1981
|
-
auditRetentionDays:
|
|
2070
|
+
auditRetentionDays: z9.number().int().positive().default(365).describe("Audit retention days"),
|
|
1982
2071
|
/**
|
|
1983
2072
|
* Data residency requirements
|
|
1984
2073
|
*/
|
|
1985
|
-
dataResidency:
|
|
2074
|
+
dataResidency: z9.object({
|
|
1986
2075
|
/**
|
|
1987
2076
|
* Required geographic region
|
|
1988
2077
|
*/
|
|
1989
|
-
region:
|
|
2078
|
+
region: z9.string().optional().describe("Required region (e.g., US, EU, APAC)"),
|
|
1990
2079
|
/**
|
|
1991
2080
|
* Prohibited regions
|
|
1992
2081
|
*/
|
|
1993
|
-
excludeRegions:
|
|
2082
|
+
excludeRegions: z9.array(z9.string()).optional().describe("Prohibited regions")
|
|
1994
2083
|
}).optional().describe("Data residency requirements")
|
|
1995
2084
|
}).optional().describe("Compliance requirements")
|
|
1996
2085
|
});
|
|
1997
2086
|
|
|
1998
2087
|
// src/hub/space.zod.ts
|
|
1999
|
-
var SubscriptionStatus =
|
|
2088
|
+
var SubscriptionStatus = z10.enum([
|
|
2000
2089
|
"active",
|
|
2001
2090
|
"past_due",
|
|
2002
2091
|
"canceled",
|
|
2003
2092
|
"trialing",
|
|
2004
2093
|
"incomplete"
|
|
2005
2094
|
]);
|
|
2006
|
-
var SpaceSubscriptionSchema =
|
|
2007
|
-
planId:
|
|
2095
|
+
var SpaceSubscriptionSchema = z10.object({
|
|
2096
|
+
planId: z10.string().describe("Reference to Plan Code"),
|
|
2008
2097
|
status: SubscriptionStatus,
|
|
2009
|
-
currentPeriodEnd:
|
|
2010
|
-
stripeCustomerId:
|
|
2011
|
-
stripeSubscriptionId:
|
|
2098
|
+
currentPeriodEnd: z10.string().datetime().optional(),
|
|
2099
|
+
stripeCustomerId: z10.string().optional(),
|
|
2100
|
+
stripeSubscriptionId: z10.string().optional(),
|
|
2012
2101
|
/**
|
|
2013
2102
|
* Purchased Add-ons from Marketplace
|
|
2014
2103
|
*/
|
|
2015
|
-
addons:
|
|
2016
|
-
pluginId:
|
|
2017
|
-
quantity:
|
|
2104
|
+
addons: z10.array(z10.object({
|
|
2105
|
+
pluginId: z10.string().describe("Marketplace Plugin ID (NPM package name)"),
|
|
2106
|
+
quantity: z10.number().default(1),
|
|
2018
2107
|
status: SubscriptionStatus.default("active")
|
|
2019
2108
|
})).optional(),
|
|
2020
2109
|
/**
|
|
2021
2110
|
* Quota Usage Snapshot
|
|
2022
2111
|
* Cached usage metrics for quick display/validation.
|
|
2023
2112
|
*/
|
|
2024
|
-
usage:
|
|
2113
|
+
usage: z10.record(z10.string(), z10.number()).optional()
|
|
2025
2114
|
});
|
|
2026
|
-
var DeploymentTargetSchema =
|
|
2027
|
-
provider:
|
|
2028
|
-
region:
|
|
2029
|
-
url:
|
|
2030
|
-
env:
|
|
2115
|
+
var DeploymentTargetSchema = z10.object({
|
|
2116
|
+
provider: z10.enum(["vercel", "docker", "kubernetes"]),
|
|
2117
|
+
region: z10.string().optional(),
|
|
2118
|
+
url: z10.string().url().optional().describe("Public Access URL"),
|
|
2119
|
+
env: z10.record(z10.string(), z10.string()).optional().describe("Runtime Environment Variables")
|
|
2031
2120
|
});
|
|
2032
|
-
var HubSpaceSchema =
|
|
2033
|
-
id:
|
|
2121
|
+
var HubSpaceSchema = z10.object({
|
|
2122
|
+
id: z10.string().uuid(),
|
|
2034
2123
|
/**
|
|
2035
2124
|
* Display Name
|
|
2036
2125
|
*/
|
|
2037
|
-
name:
|
|
2038
|
-
slug:
|
|
2126
|
+
name: z10.string(),
|
|
2127
|
+
slug: z10.string().describe("URL friendly identifier"),
|
|
2039
2128
|
/**
|
|
2040
2129
|
* Owner (User or Org ID in Hub)
|
|
2041
2130
|
*/
|
|
2042
|
-
ownerId:
|
|
2131
|
+
ownerId: z10.string(),
|
|
2043
2132
|
/**
|
|
2044
2133
|
* The Runtime Instance Definition
|
|
2045
2134
|
* Defines the technical execution environment.
|
|
2046
2135
|
*/
|
|
2047
|
-
runtime:
|
|
2136
|
+
runtime: z10.object({
|
|
2048
2137
|
isolation: TenantIsolationLevel.describe("Data isolation strategy"),
|
|
2049
2138
|
quotas: TenantQuotaSchema.optional().describe("Resource quotas")
|
|
2050
2139
|
}).optional().describe("Runtime instance configuration"),
|
|
@@ -2056,11 +2145,11 @@ var HubSpaceSchema = z9.object({
|
|
|
2056
2145
|
/**
|
|
2057
2146
|
* The Current Actual State (Last Successful Build)
|
|
2058
2147
|
*/
|
|
2059
|
-
lastBuild:
|
|
2060
|
-
id:
|
|
2061
|
-
timestamp:
|
|
2062
|
-
manifestUrl:
|
|
2063
|
-
status:
|
|
2148
|
+
lastBuild: z10.object({
|
|
2149
|
+
id: z10.string(),
|
|
2150
|
+
timestamp: z10.string().datetime(),
|
|
2151
|
+
manifestUrl: z10.string().url().optional(),
|
|
2152
|
+
status: z10.enum(["pending", "success", "failed"])
|
|
2064
2153
|
}).optional(),
|
|
2065
2154
|
/**
|
|
2066
2155
|
* Commercial / Billing Info
|
|
@@ -2070,13 +2159,13 @@ var HubSpaceSchema = z9.object({
|
|
|
2070
2159
|
* Infrastructure Settings
|
|
2071
2160
|
*/
|
|
2072
2161
|
deployment: DeploymentTargetSchema.optional(),
|
|
2073
|
-
createdAt:
|
|
2074
|
-
updatedAt:
|
|
2162
|
+
createdAt: z10.string(),
|
|
2163
|
+
updatedAt: z10.string()
|
|
2075
2164
|
});
|
|
2076
2165
|
|
|
2077
2166
|
// src/hub/license.zod.ts
|
|
2078
|
-
import { z as
|
|
2079
|
-
var MetricType =
|
|
2167
|
+
import { z as z11 } from "zod";
|
|
2168
|
+
var MetricType = z11.enum([
|
|
2080
2169
|
"boolean",
|
|
2081
2170
|
// Feature Flag (Enabled/Disabled)
|
|
2082
2171
|
"counter",
|
|
@@ -2084,115 +2173,115 @@ var MetricType = z10.enum([
|
|
|
2084
2173
|
"gauge"
|
|
2085
2174
|
// Current Level (e.g. Storage Used, Users Active) - Point in time
|
|
2086
2175
|
]);
|
|
2087
|
-
var FeatureSchema =
|
|
2088
|
-
code:
|
|
2089
|
-
label:
|
|
2090
|
-
description:
|
|
2176
|
+
var FeatureSchema = z11.object({
|
|
2177
|
+
code: z11.string().regex(/^[a-z_][a-z0-9_.]*$/).describe("Feature code (e.g. core.api_access)"),
|
|
2178
|
+
label: z11.string(),
|
|
2179
|
+
description: z11.string().optional(),
|
|
2091
2180
|
type: MetricType.default("boolean"),
|
|
2092
2181
|
/** For counters/gauges */
|
|
2093
|
-
unit:
|
|
2182
|
+
unit: z11.enum(["count", "bytes", "seconds", "percent"]).optional(),
|
|
2094
2183
|
/** Dependencies (e.g. 'audit_log' requires 'enterprise_tier') */
|
|
2095
|
-
requires:
|
|
2184
|
+
requires: z11.array(z11.string()).optional()
|
|
2096
2185
|
});
|
|
2097
|
-
var PlanSchema =
|
|
2098
|
-
code:
|
|
2099
|
-
label:
|
|
2100
|
-
active:
|
|
2186
|
+
var PlanSchema = z11.object({
|
|
2187
|
+
code: z11.string().describe("Plan code (e.g. pro_v1)"),
|
|
2188
|
+
label: z11.string(),
|
|
2189
|
+
active: z11.boolean().default(true),
|
|
2101
2190
|
/** Feature Entitlements */
|
|
2102
|
-
features:
|
|
2191
|
+
features: z11.array(z11.string()).describe("List of enabled boolean features"),
|
|
2103
2192
|
/** Limit Quotas */
|
|
2104
|
-
limits:
|
|
2193
|
+
limits: z11.record(z11.string(), z11.number()).describe("Map of metric codes to limit values (e.g. { storage_gb: 10 })"),
|
|
2105
2194
|
/** Pricing (Optional Metadata) */
|
|
2106
|
-
currency:
|
|
2107
|
-
priceMonthly:
|
|
2108
|
-
priceYearly:
|
|
2195
|
+
currency: z11.string().default("USD").optional(),
|
|
2196
|
+
priceMonthly: z11.number().optional(),
|
|
2197
|
+
priceYearly: z11.number().optional()
|
|
2109
2198
|
});
|
|
2110
|
-
var LicenseSchema =
|
|
2199
|
+
var LicenseSchema = z11.object({
|
|
2111
2200
|
/** Identity */
|
|
2112
|
-
spaceId:
|
|
2113
|
-
planCode:
|
|
2201
|
+
spaceId: z11.string().describe("Target Space ID"),
|
|
2202
|
+
planCode: z11.string(),
|
|
2114
2203
|
/** Validity */
|
|
2115
|
-
issuedAt:
|
|
2116
|
-
expiresAt:
|
|
2204
|
+
issuedAt: z11.string().datetime(),
|
|
2205
|
+
expiresAt: z11.string().datetime().optional(),
|
|
2117
2206
|
// Null = Perpetual
|
|
2118
2207
|
/** Status */
|
|
2119
|
-
status:
|
|
2208
|
+
status: z11.enum(["active", "expired", "suspended", "trial"]),
|
|
2120
2209
|
/** Overrides (Specific to this space, exceeding the plan) */
|
|
2121
|
-
customFeatures:
|
|
2122
|
-
customLimits:
|
|
2210
|
+
customFeatures: z11.array(z11.string()).optional(),
|
|
2211
|
+
customLimits: z11.record(z11.string(), z11.number()).optional(),
|
|
2123
2212
|
/** Authorized Add-ons */
|
|
2124
|
-
plugins:
|
|
2213
|
+
plugins: z11.array(z11.string()).optional().describe("List of enabled plugin package IDs"),
|
|
2125
2214
|
/** Signature */
|
|
2126
|
-
signature:
|
|
2215
|
+
signature: z11.string().optional().describe("Cryptographic signature of the license")
|
|
2127
2216
|
});
|
|
2128
2217
|
|
|
2129
2218
|
// src/hub/hub-federation.zod.ts
|
|
2130
|
-
import { z as
|
|
2131
|
-
var RegionSchema =
|
|
2219
|
+
import { z as z12 } from "zod";
|
|
2220
|
+
var RegionSchema = z12.object({
|
|
2132
2221
|
/**
|
|
2133
2222
|
* Region identifier (e.g., us-east-1, eu-west-1, ap-southeast-1)
|
|
2134
2223
|
*/
|
|
2135
|
-
id:
|
|
2224
|
+
id: z12.string().regex(/^[a-z]{2}-[a-z]+-\d+$/).describe("Region identifier"),
|
|
2136
2225
|
/**
|
|
2137
2226
|
* Display name
|
|
2138
2227
|
*/
|
|
2139
|
-
name:
|
|
2228
|
+
name: z12.string().describe("Human-readable region name"),
|
|
2140
2229
|
/**
|
|
2141
2230
|
* Geographic location
|
|
2142
2231
|
*/
|
|
2143
|
-
location:
|
|
2144
|
-
continent:
|
|
2145
|
-
country:
|
|
2146
|
-
city:
|
|
2147
|
-
latitude:
|
|
2148
|
-
longitude:
|
|
2232
|
+
location: z12.object({
|
|
2233
|
+
continent: z12.enum(["NA", "SA", "EU", "AF", "AS", "OC", "AN"]),
|
|
2234
|
+
country: z12.string().regex(/^[A-Z]{2}$/).describe("ISO 3166-1 alpha-2 country code"),
|
|
2235
|
+
city: z12.string().optional(),
|
|
2236
|
+
latitude: z12.number().min(-90).max(90).optional(),
|
|
2237
|
+
longitude: z12.number().min(-180).max(180).optional()
|
|
2149
2238
|
}),
|
|
2150
2239
|
/**
|
|
2151
2240
|
* Cloud provider and region mapping
|
|
2152
2241
|
*/
|
|
2153
|
-
provider:
|
|
2154
|
-
name:
|
|
2155
|
-
region:
|
|
2242
|
+
provider: z12.object({
|
|
2243
|
+
name: z12.enum(["aws", "azure", "gcp", "cloudflare", "vercel", "self-hosted"]),
|
|
2244
|
+
region: z12.string().describe("Provider-specific region identifier")
|
|
2156
2245
|
}).optional(),
|
|
2157
2246
|
/**
|
|
2158
2247
|
* Region capabilities
|
|
2159
2248
|
*/
|
|
2160
|
-
capabilities:
|
|
2161
|
-
databases:
|
|
2162
|
-
storage:
|
|
2163
|
-
compute:
|
|
2164
|
-
cdn:
|
|
2249
|
+
capabilities: z12.object({
|
|
2250
|
+
databases: z12.array(z12.enum(["postgres", "mysql", "mongodb", "redis"])).default([]),
|
|
2251
|
+
storage: z12.array(z12.enum(["s3", "azure-blob", "gcs"])).default([]),
|
|
2252
|
+
compute: z12.array(z12.enum(["containers", "serverless", "vm"])).default([]),
|
|
2253
|
+
cdn: z12.boolean().default(false)
|
|
2165
2254
|
}).optional(),
|
|
2166
2255
|
/**
|
|
2167
2256
|
* Compliance and certifications
|
|
2168
2257
|
*/
|
|
2169
|
-
compliance:
|
|
2258
|
+
compliance: z12.array(z12.enum(["gdpr", "hipaa", "soc2", "iso27001", "pci-dss"])).default([]),
|
|
2170
2259
|
/**
|
|
2171
2260
|
* Region status
|
|
2172
2261
|
*/
|
|
2173
|
-
status:
|
|
2262
|
+
status: z12.enum(["active", "read-only", "maintenance", "deprecated"]).default("active"),
|
|
2174
2263
|
/**
|
|
2175
2264
|
* Resource limits for this region
|
|
2176
2265
|
*/
|
|
2177
|
-
limits:
|
|
2178
|
-
maxSpaces:
|
|
2179
|
-
maxTenants:
|
|
2180
|
-
maxStorage:
|
|
2266
|
+
limits: z12.object({
|
|
2267
|
+
maxSpaces: z12.number().int().positive().optional(),
|
|
2268
|
+
maxTenants: z12.number().int().positive().optional(),
|
|
2269
|
+
maxStorage: z12.number().int().positive().optional().describe("Bytes")
|
|
2181
2270
|
}).optional()
|
|
2182
2271
|
});
|
|
2183
|
-
var HubInstanceSchema =
|
|
2272
|
+
var HubInstanceSchema = z12.object({
|
|
2184
2273
|
/**
|
|
2185
2274
|
* Instance identifier
|
|
2186
2275
|
*/
|
|
2187
|
-
id:
|
|
2276
|
+
id: z12.string().uuid(),
|
|
2188
2277
|
/**
|
|
2189
2278
|
* Region where this hub is deployed
|
|
2190
2279
|
*/
|
|
2191
|
-
regionId:
|
|
2280
|
+
regionId: z12.string(),
|
|
2192
2281
|
/**
|
|
2193
2282
|
* Hub role in federation
|
|
2194
2283
|
*/
|
|
2195
|
-
role:
|
|
2284
|
+
role: z12.enum([
|
|
2196
2285
|
"primary",
|
|
2197
2286
|
// Primary/master hub
|
|
2198
2287
|
"secondary",
|
|
@@ -2203,71 +2292,71 @@ var HubInstanceSchema = z11.object({
|
|
|
2203
2292
|
/**
|
|
2204
2293
|
* Endpoint URLs
|
|
2205
2294
|
*/
|
|
2206
|
-
endpoints:
|
|
2207
|
-
api:
|
|
2208
|
-
admin:
|
|
2209
|
-
grpc:
|
|
2295
|
+
endpoints: z12.object({
|
|
2296
|
+
api: z12.string().url().describe("Public API endpoint"),
|
|
2297
|
+
admin: z12.string().url().optional().describe("Admin console"),
|
|
2298
|
+
grpc: z12.string().optional().describe("gRPC endpoint for inter-hub communication")
|
|
2210
2299
|
}),
|
|
2211
2300
|
/**
|
|
2212
2301
|
* Replication configuration
|
|
2213
2302
|
*/
|
|
2214
|
-
replication:
|
|
2303
|
+
replication: z12.object({
|
|
2215
2304
|
/**
|
|
2216
2305
|
* Source hub for replication (if this is a secondary)
|
|
2217
2306
|
*/
|
|
2218
|
-
primaryHubId:
|
|
2307
|
+
primaryHubId: z12.string().uuid().optional(),
|
|
2219
2308
|
/**
|
|
2220
2309
|
* Replication lag tolerance in seconds
|
|
2221
2310
|
*/
|
|
2222
|
-
lagTolerance:
|
|
2311
|
+
lagTolerance: z12.number().int().positive().default(5),
|
|
2223
2312
|
/**
|
|
2224
2313
|
* Replication mode
|
|
2225
2314
|
*/
|
|
2226
|
-
mode:
|
|
2315
|
+
mode: z12.enum(["sync", "async", "semi-sync"]).default("async")
|
|
2227
2316
|
}).optional(),
|
|
2228
2317
|
/**
|
|
2229
2318
|
* Health status
|
|
2230
2319
|
*/
|
|
2231
|
-
health:
|
|
2232
|
-
status:
|
|
2233
|
-
lastCheck:
|
|
2234
|
-
uptime:
|
|
2320
|
+
health: z12.object({
|
|
2321
|
+
status: z12.enum(["healthy", "degraded", "unhealthy"]),
|
|
2322
|
+
lastCheck: z12.string().datetime(),
|
|
2323
|
+
uptime: z12.number().describe("Seconds")
|
|
2235
2324
|
}).optional(),
|
|
2236
2325
|
/**
|
|
2237
2326
|
* Version
|
|
2238
2327
|
*/
|
|
2239
|
-
version:
|
|
2328
|
+
version: z12.string(),
|
|
2240
2329
|
/**
|
|
2241
2330
|
* Metadata
|
|
2242
2331
|
*/
|
|
2243
|
-
createdAt:
|
|
2244
|
-
updatedAt:
|
|
2332
|
+
createdAt: z12.string().datetime(),
|
|
2333
|
+
updatedAt: z12.string().datetime()
|
|
2245
2334
|
});
|
|
2246
|
-
var FederationTopologySchema =
|
|
2335
|
+
var FederationTopologySchema = z12.object({
|
|
2247
2336
|
/**
|
|
2248
2337
|
* Federation identifier
|
|
2249
2338
|
*/
|
|
2250
|
-
id:
|
|
2339
|
+
id: z12.string().uuid(),
|
|
2251
2340
|
/**
|
|
2252
2341
|
* Federation name
|
|
2253
2342
|
*/
|
|
2254
|
-
name:
|
|
2343
|
+
name: z12.string(),
|
|
2255
2344
|
/**
|
|
2256
2345
|
* Regions in this federation
|
|
2257
2346
|
*/
|
|
2258
|
-
regions:
|
|
2347
|
+
regions: z12.array(RegionSchema),
|
|
2259
2348
|
/**
|
|
2260
2349
|
* Hub instances
|
|
2261
2350
|
*/
|
|
2262
|
-
hubs:
|
|
2351
|
+
hubs: z12.array(HubInstanceSchema),
|
|
2263
2352
|
/**
|
|
2264
2353
|
* Routing strategy
|
|
2265
2354
|
*/
|
|
2266
|
-
routing:
|
|
2355
|
+
routing: z12.object({
|
|
2267
2356
|
/**
|
|
2268
2357
|
* How to route tenant requests
|
|
2269
2358
|
*/
|
|
2270
|
-
strategy:
|
|
2359
|
+
strategy: z12.enum([
|
|
2271
2360
|
"geo-proximity",
|
|
2272
2361
|
// Route to nearest region
|
|
2273
2362
|
"data-residency",
|
|
@@ -2280,117 +2369,117 @@ var FederationTopologySchema = z11.object({
|
|
|
2280
2369
|
/**
|
|
2281
2370
|
* Failover behavior
|
|
2282
2371
|
*/
|
|
2283
|
-
failover:
|
|
2284
|
-
enabled:
|
|
2285
|
-
maxRetries:
|
|
2286
|
-
timeout:
|
|
2372
|
+
failover: z12.object({
|
|
2373
|
+
enabled: z12.boolean().default(true),
|
|
2374
|
+
maxRetries: z12.number().int().min(0).default(3),
|
|
2375
|
+
timeout: z12.number().int().positive().default(5e3).describe("Milliseconds")
|
|
2287
2376
|
})
|
|
2288
2377
|
}),
|
|
2289
2378
|
/**
|
|
2290
2379
|
* Data synchronization settings
|
|
2291
2380
|
*/
|
|
2292
|
-
synchronization:
|
|
2381
|
+
synchronization: z12.object({
|
|
2293
2382
|
/**
|
|
2294
2383
|
* What data to sync across regions
|
|
2295
2384
|
*/
|
|
2296
|
-
scope:
|
|
2385
|
+
scope: z12.object({
|
|
2297
2386
|
/**
|
|
2298
2387
|
* Sync plugin registry
|
|
2299
2388
|
*/
|
|
2300
|
-
plugins:
|
|
2389
|
+
plugins: z12.boolean().default(true),
|
|
2301
2390
|
/**
|
|
2302
2391
|
* Sync tenant metadata (not data)
|
|
2303
2392
|
*/
|
|
2304
|
-
tenants:
|
|
2393
|
+
tenants: z12.boolean().default(true),
|
|
2305
2394
|
/**
|
|
2306
2395
|
* Sync spaces metadata
|
|
2307
2396
|
*/
|
|
2308
|
-
spaces:
|
|
2397
|
+
spaces: z12.boolean().default(false),
|
|
2309
2398
|
/**
|
|
2310
2399
|
* Sync licenses
|
|
2311
2400
|
*/
|
|
2312
|
-
licenses:
|
|
2401
|
+
licenses: z12.boolean().default(true)
|
|
2313
2402
|
}),
|
|
2314
2403
|
/**
|
|
2315
2404
|
* Sync frequency
|
|
2316
2405
|
*/
|
|
2317
|
-
frequency:
|
|
2406
|
+
frequency: z12.enum(["realtime", "hourly", "daily"]).default("realtime"),
|
|
2318
2407
|
/**
|
|
2319
2408
|
* Conflict resolution
|
|
2320
2409
|
*/
|
|
2321
|
-
conflictResolution:
|
|
2410
|
+
conflictResolution: z12.enum(["last-write-wins", "primary-wins", "manual"]).default("last-write-wins")
|
|
2322
2411
|
})
|
|
2323
2412
|
});
|
|
2324
|
-
var TenantPlacementPolicySchema =
|
|
2413
|
+
var TenantPlacementPolicySchema = z12.object({
|
|
2325
2414
|
/**
|
|
2326
2415
|
* Tenant identifier
|
|
2327
2416
|
*/
|
|
2328
|
-
tenantId:
|
|
2417
|
+
tenantId: z12.string(),
|
|
2329
2418
|
/**
|
|
2330
2419
|
* Primary region (where tenant data lives)
|
|
2331
2420
|
*/
|
|
2332
|
-
primaryRegion:
|
|
2421
|
+
primaryRegion: z12.string(),
|
|
2333
2422
|
/**
|
|
2334
2423
|
* Replica regions (for disaster recovery)
|
|
2335
2424
|
*/
|
|
2336
|
-
replicaRegions:
|
|
2425
|
+
replicaRegions: z12.array(z12.string()).default([]),
|
|
2337
2426
|
/**
|
|
2338
2427
|
* Data residency constraints
|
|
2339
2428
|
*/
|
|
2340
|
-
dataResidency:
|
|
2429
|
+
dataResidency: z12.object({
|
|
2341
2430
|
/**
|
|
2342
2431
|
* Allowed regions for data storage
|
|
2343
2432
|
*/
|
|
2344
|
-
allowedRegions:
|
|
2433
|
+
allowedRegions: z12.array(z12.string()).optional(),
|
|
2345
2434
|
/**
|
|
2346
2435
|
* Prohibited regions
|
|
2347
2436
|
*/
|
|
2348
|
-
prohibitedRegions:
|
|
2437
|
+
prohibitedRegions: z12.array(z12.string()).default([]),
|
|
2349
2438
|
/**
|
|
2350
2439
|
* Continent restriction
|
|
2351
2440
|
*/
|
|
2352
|
-
continent:
|
|
2441
|
+
continent: z12.enum(["NA", "SA", "EU", "AF", "AS", "OC", "AN"]).optional()
|
|
2353
2442
|
}).optional(),
|
|
2354
2443
|
/**
|
|
2355
2444
|
* Failover policy
|
|
2356
2445
|
*/
|
|
2357
|
-
failover:
|
|
2446
|
+
failover: z12.object({
|
|
2358
2447
|
/**
|
|
2359
2448
|
* Enable automatic failover
|
|
2360
2449
|
*/
|
|
2361
|
-
enabled:
|
|
2450
|
+
enabled: z12.boolean().default(true),
|
|
2362
2451
|
/**
|
|
2363
2452
|
* Preferred failover order (region IDs)
|
|
2364
2453
|
*/
|
|
2365
|
-
preferredOrder:
|
|
2454
|
+
preferredOrder: z12.array(z12.string()).default([]),
|
|
2366
2455
|
/**
|
|
2367
2456
|
* Maximum acceptable latency for failover target (ms)
|
|
2368
2457
|
*/
|
|
2369
|
-
maxLatency:
|
|
2458
|
+
maxLatency: z12.number().int().positive().default(100)
|
|
2370
2459
|
}).optional(),
|
|
2371
2460
|
/**
|
|
2372
2461
|
* Latency requirements
|
|
2373
2462
|
*/
|
|
2374
|
-
latency:
|
|
2463
|
+
latency: z12.object({
|
|
2375
2464
|
/**
|
|
2376
2465
|
* Maximum acceptable latency for primary region (ms)
|
|
2377
2466
|
*/
|
|
2378
|
-
maxPrimaryLatency:
|
|
2467
|
+
maxPrimaryLatency: z12.number().int().positive().default(50),
|
|
2379
2468
|
/**
|
|
2380
2469
|
* Maximum acceptable latency for replicas (ms)
|
|
2381
2470
|
*/
|
|
2382
|
-
maxReplicaLatency:
|
|
2471
|
+
maxReplicaLatency: z12.number().int().positive().default(200)
|
|
2383
2472
|
}).optional()
|
|
2384
2473
|
});
|
|
2385
|
-
var ReplicationJobSchema =
|
|
2474
|
+
var ReplicationJobSchema = z12.object({
|
|
2386
2475
|
/**
|
|
2387
2476
|
* Job identifier
|
|
2388
2477
|
*/
|
|
2389
|
-
id:
|
|
2478
|
+
id: z12.string().uuid(),
|
|
2390
2479
|
/**
|
|
2391
2480
|
* Job type
|
|
2392
2481
|
*/
|
|
2393
|
-
type:
|
|
2482
|
+
type: z12.enum([
|
|
2394
2483
|
"initial-sync",
|
|
2395
2484
|
// First-time full sync
|
|
2396
2485
|
"incremental",
|
|
@@ -2401,84 +2490,84 @@ var ReplicationJobSchema = z11.object({
|
|
|
2401
2490
|
/**
|
|
2402
2491
|
* Source hub
|
|
2403
2492
|
*/
|
|
2404
|
-
sourceHubId:
|
|
2493
|
+
sourceHubId: z12.string().uuid(),
|
|
2405
2494
|
/**
|
|
2406
2495
|
* Target hub(s)
|
|
2407
2496
|
*/
|
|
2408
|
-
targetHubIds:
|
|
2497
|
+
targetHubIds: z12.array(z12.string().uuid()),
|
|
2409
2498
|
/**
|
|
2410
2499
|
* Resource scope
|
|
2411
2500
|
*/
|
|
2412
|
-
scope:
|
|
2501
|
+
scope: z12.object({
|
|
2413
2502
|
/**
|
|
2414
2503
|
* Resource type
|
|
2415
2504
|
*/
|
|
2416
|
-
resourceType:
|
|
2505
|
+
resourceType: z12.enum(["plugin", "tenant", "space", "license", "all"]),
|
|
2417
2506
|
/**
|
|
2418
2507
|
* Specific resource IDs (empty = all)
|
|
2419
2508
|
*/
|
|
2420
|
-
resourceIds:
|
|
2509
|
+
resourceIds: z12.array(z12.string()).default([])
|
|
2421
2510
|
}),
|
|
2422
2511
|
/**
|
|
2423
2512
|
* Job status
|
|
2424
2513
|
*/
|
|
2425
|
-
status:
|
|
2514
|
+
status: z12.enum(["pending", "running", "completed", "failed", "cancelled"]),
|
|
2426
2515
|
/**
|
|
2427
2516
|
* Progress
|
|
2428
2517
|
*/
|
|
2429
|
-
progress:
|
|
2430
|
-
total:
|
|
2431
|
-
completed:
|
|
2432
|
-
failed:
|
|
2518
|
+
progress: z12.object({
|
|
2519
|
+
total: z12.number().int().min(0),
|
|
2520
|
+
completed: z12.number().int().min(0),
|
|
2521
|
+
failed: z12.number().int().min(0)
|
|
2433
2522
|
}).optional(),
|
|
2434
2523
|
/**
|
|
2435
2524
|
* Timestamps
|
|
2436
2525
|
*/
|
|
2437
|
-
createdAt:
|
|
2438
|
-
startedAt:
|
|
2439
|
-
completedAt:
|
|
2526
|
+
createdAt: z12.string().datetime(),
|
|
2527
|
+
startedAt: z12.string().datetime().optional(),
|
|
2528
|
+
completedAt: z12.string().datetime().optional(),
|
|
2440
2529
|
/**
|
|
2441
2530
|
* Errors
|
|
2442
2531
|
*/
|
|
2443
|
-
errors:
|
|
2444
|
-
timestamp:
|
|
2445
|
-
resourceId:
|
|
2446
|
-
error:
|
|
2532
|
+
errors: z12.array(z12.object({
|
|
2533
|
+
timestamp: z12.string().datetime(),
|
|
2534
|
+
resourceId: z12.string(),
|
|
2535
|
+
error: z12.string()
|
|
2447
2536
|
})).default([])
|
|
2448
2537
|
});
|
|
2449
|
-
var GlobalRegistryEntrySchema =
|
|
2538
|
+
var GlobalRegistryEntrySchema = z12.object({
|
|
2450
2539
|
/**
|
|
2451
2540
|
* Resource identifier
|
|
2452
2541
|
*/
|
|
2453
|
-
resourceId:
|
|
2542
|
+
resourceId: z12.string(),
|
|
2454
2543
|
/**
|
|
2455
2544
|
* Resource type
|
|
2456
2545
|
*/
|
|
2457
|
-
resourceType:
|
|
2546
|
+
resourceType: z12.enum(["plugin", "tenant", "space", "license"]),
|
|
2458
2547
|
/**
|
|
2459
2548
|
* Regions where this resource exists
|
|
2460
2549
|
*/
|
|
2461
|
-
locations:
|
|
2462
|
-
regionId:
|
|
2463
|
-
hubId:
|
|
2464
|
-
isPrimary:
|
|
2465
|
-
lastSyncedAt:
|
|
2466
|
-
version:
|
|
2550
|
+
locations: z12.array(z12.object({
|
|
2551
|
+
regionId: z12.string(),
|
|
2552
|
+
hubId: z12.string().uuid(),
|
|
2553
|
+
isPrimary: z12.boolean().default(false),
|
|
2554
|
+
lastSyncedAt: z12.string().datetime().optional(),
|
|
2555
|
+
version: z12.string().optional()
|
|
2467
2556
|
})),
|
|
2468
2557
|
/**
|
|
2469
2558
|
* Global version vector clock (for conflict detection)
|
|
2470
2559
|
*/
|
|
2471
|
-
versionVector:
|
|
2560
|
+
versionVector: z12.record(z12.string(), z12.number().int()).optional()
|
|
2472
2561
|
});
|
|
2473
|
-
var EdgeLocationSchema =
|
|
2562
|
+
var EdgeLocationSchema = z12.object({
|
|
2474
2563
|
/**
|
|
2475
2564
|
* Location identifier
|
|
2476
2565
|
*/
|
|
2477
|
-
id:
|
|
2566
|
+
id: z12.string(),
|
|
2478
2567
|
/**
|
|
2479
2568
|
* Parent region
|
|
2480
2569
|
*/
|
|
2481
|
-
regionId:
|
|
2570
|
+
regionId: z12.string(),
|
|
2482
2571
|
/**
|
|
2483
2572
|
* Location details
|
|
2484
2573
|
*/
|
|
@@ -2486,24 +2575,24 @@ var EdgeLocationSchema = z11.object({
|
|
|
2486
2575
|
/**
|
|
2487
2576
|
* Caching configuration
|
|
2488
2577
|
*/
|
|
2489
|
-
cache:
|
|
2578
|
+
cache: z12.object({
|
|
2490
2579
|
/**
|
|
2491
2580
|
* What to cache at edge
|
|
2492
2581
|
*/
|
|
2493
|
-
resources:
|
|
2582
|
+
resources: z12.array(z12.enum(["plugins", "static-assets", "api-responses"])).default([]),
|
|
2494
2583
|
/**
|
|
2495
2584
|
* TTL in seconds
|
|
2496
2585
|
*/
|
|
2497
|
-
ttl:
|
|
2586
|
+
ttl: z12.number().int().positive().default(3600),
|
|
2498
2587
|
/**
|
|
2499
2588
|
* Cache size limit (bytes)
|
|
2500
2589
|
*/
|
|
2501
|
-
maxSize:
|
|
2590
|
+
maxSize: z12.number().int().positive().optional()
|
|
2502
2591
|
}),
|
|
2503
2592
|
/**
|
|
2504
2593
|
* Status
|
|
2505
2594
|
*/
|
|
2506
|
-
status:
|
|
2595
|
+
status: z12.enum(["active", "inactive"]).default("active")
|
|
2507
2596
|
});
|
|
2508
2597
|
var HubFederationProtocol = {
|
|
2509
2598
|
Region: RegionSchema,
|
|
@@ -2516,31 +2605,31 @@ var HubFederationProtocol = {
|
|
|
2516
2605
|
};
|
|
2517
2606
|
|
|
2518
2607
|
// src/hub/plugin-security.zod.ts
|
|
2519
|
-
import { z as
|
|
2520
|
-
var VulnerabilitySeverity =
|
|
2608
|
+
import { z as z13 } from "zod";
|
|
2609
|
+
var VulnerabilitySeverity = z13.enum([
|
|
2521
2610
|
"critical",
|
|
2522
2611
|
"high",
|
|
2523
2612
|
"medium",
|
|
2524
2613
|
"low",
|
|
2525
2614
|
"info"
|
|
2526
2615
|
]);
|
|
2527
|
-
var SecurityVulnerabilitySchema =
|
|
2616
|
+
var SecurityVulnerabilitySchema = z13.object({
|
|
2528
2617
|
/**
|
|
2529
2618
|
* CVE identifier (if applicable)
|
|
2530
2619
|
*/
|
|
2531
|
-
cve:
|
|
2620
|
+
cve: z13.string().regex(/^CVE-\d{4}-\d+$/).optional().describe("CVE identifier"),
|
|
2532
2621
|
/**
|
|
2533
2622
|
* Vulnerability identifier (GHSA, SNYK, etc.)
|
|
2534
2623
|
*/
|
|
2535
|
-
id:
|
|
2624
|
+
id: z13.string().describe("Vulnerability ID"),
|
|
2536
2625
|
/**
|
|
2537
2626
|
* Title
|
|
2538
2627
|
*/
|
|
2539
|
-
title:
|
|
2628
|
+
title: z13.string(),
|
|
2540
2629
|
/**
|
|
2541
2630
|
* Description
|
|
2542
2631
|
*/
|
|
2543
|
-
description:
|
|
2632
|
+
description: z13.string(),
|
|
2544
2633
|
/**
|
|
2545
2634
|
* Severity
|
|
2546
2635
|
*/
|
|
@@ -2548,149 +2637,149 @@ var SecurityVulnerabilitySchema = z12.object({
|
|
|
2548
2637
|
/**
|
|
2549
2638
|
* CVSS score (0-10)
|
|
2550
2639
|
*/
|
|
2551
|
-
cvss:
|
|
2640
|
+
cvss: z13.number().min(0).max(10).optional(),
|
|
2552
2641
|
/**
|
|
2553
2642
|
* Affected package
|
|
2554
2643
|
*/
|
|
2555
|
-
package:
|
|
2556
|
-
name:
|
|
2557
|
-
version:
|
|
2558
|
-
ecosystem:
|
|
2644
|
+
package: z13.object({
|
|
2645
|
+
name: z13.string(),
|
|
2646
|
+
version: z13.string(),
|
|
2647
|
+
ecosystem: z13.string().optional()
|
|
2559
2648
|
}),
|
|
2560
2649
|
/**
|
|
2561
2650
|
* Vulnerable version range
|
|
2562
2651
|
*/
|
|
2563
|
-
vulnerableVersions:
|
|
2652
|
+
vulnerableVersions: z13.string().describe("Semver range of vulnerable versions"),
|
|
2564
2653
|
/**
|
|
2565
2654
|
* Patched versions
|
|
2566
2655
|
*/
|
|
2567
|
-
patchedVersions:
|
|
2656
|
+
patchedVersions: z13.string().optional().describe("Semver range of patched versions"),
|
|
2568
2657
|
/**
|
|
2569
2658
|
* References
|
|
2570
2659
|
*/
|
|
2571
|
-
references:
|
|
2572
|
-
type:
|
|
2573
|
-
url:
|
|
2660
|
+
references: z13.array(z13.object({
|
|
2661
|
+
type: z13.enum(["advisory", "article", "report", "web"]),
|
|
2662
|
+
url: z13.string().url()
|
|
2574
2663
|
})).default([]),
|
|
2575
2664
|
/**
|
|
2576
2665
|
* CWE (Common Weakness Enumeration)
|
|
2577
2666
|
*/
|
|
2578
|
-
cwe:
|
|
2667
|
+
cwe: z13.array(z13.string()).default([]),
|
|
2579
2668
|
/**
|
|
2580
2669
|
* Published date
|
|
2581
2670
|
*/
|
|
2582
|
-
publishedAt:
|
|
2671
|
+
publishedAt: z13.string().datetime().optional(),
|
|
2583
2672
|
/**
|
|
2584
2673
|
* Mitigation advice
|
|
2585
2674
|
*/
|
|
2586
|
-
mitigation:
|
|
2675
|
+
mitigation: z13.string().optional()
|
|
2587
2676
|
});
|
|
2588
|
-
var SecurityScanResultSchema =
|
|
2677
|
+
var SecurityScanResultSchema = z13.object({
|
|
2589
2678
|
/**
|
|
2590
2679
|
* Scan identifier
|
|
2591
2680
|
*/
|
|
2592
|
-
scanId:
|
|
2681
|
+
scanId: z13.string().uuid(),
|
|
2593
2682
|
/**
|
|
2594
2683
|
* Plugin being scanned
|
|
2595
2684
|
*/
|
|
2596
|
-
plugin:
|
|
2597
|
-
id:
|
|
2598
|
-
version:
|
|
2685
|
+
plugin: z13.object({
|
|
2686
|
+
id: z13.string(),
|
|
2687
|
+
version: z13.string()
|
|
2599
2688
|
}),
|
|
2600
2689
|
/**
|
|
2601
2690
|
* Scan timestamp
|
|
2602
2691
|
*/
|
|
2603
|
-
scannedAt:
|
|
2692
|
+
scannedAt: z13.string().datetime(),
|
|
2604
2693
|
/**
|
|
2605
2694
|
* Scanner information
|
|
2606
2695
|
*/
|
|
2607
|
-
scanner:
|
|
2608
|
-
name:
|
|
2609
|
-
version:
|
|
2696
|
+
scanner: z13.object({
|
|
2697
|
+
name: z13.string().describe("Scanner name (e.g., snyk, osv, trivy)"),
|
|
2698
|
+
version: z13.string()
|
|
2610
2699
|
}),
|
|
2611
2700
|
/**
|
|
2612
2701
|
* Scan status
|
|
2613
2702
|
*/
|
|
2614
|
-
status:
|
|
2703
|
+
status: z13.enum(["passed", "failed", "warning"]),
|
|
2615
2704
|
/**
|
|
2616
2705
|
* Vulnerabilities found
|
|
2617
2706
|
*/
|
|
2618
|
-
vulnerabilities:
|
|
2707
|
+
vulnerabilities: z13.array(SecurityVulnerabilitySchema),
|
|
2619
2708
|
/**
|
|
2620
2709
|
* Vulnerability summary
|
|
2621
2710
|
*/
|
|
2622
|
-
summary:
|
|
2623
|
-
critical:
|
|
2624
|
-
high:
|
|
2625
|
-
medium:
|
|
2626
|
-
low:
|
|
2627
|
-
info:
|
|
2628
|
-
total:
|
|
2711
|
+
summary: z13.object({
|
|
2712
|
+
critical: z13.number().int().min(0).default(0),
|
|
2713
|
+
high: z13.number().int().min(0).default(0),
|
|
2714
|
+
medium: z13.number().int().min(0).default(0),
|
|
2715
|
+
low: z13.number().int().min(0).default(0),
|
|
2716
|
+
info: z13.number().int().min(0).default(0),
|
|
2717
|
+
total: z13.number().int().min(0).default(0)
|
|
2629
2718
|
}),
|
|
2630
2719
|
/**
|
|
2631
2720
|
* License compliance issues
|
|
2632
2721
|
*/
|
|
2633
|
-
licenseIssues:
|
|
2634
|
-
package:
|
|
2635
|
-
license:
|
|
2636
|
-
reason:
|
|
2637
|
-
severity:
|
|
2722
|
+
licenseIssues: z13.array(z13.object({
|
|
2723
|
+
package: z13.string(),
|
|
2724
|
+
license: z13.string(),
|
|
2725
|
+
reason: z13.string(),
|
|
2726
|
+
severity: z13.enum(["error", "warning", "info"])
|
|
2638
2727
|
})).default([]),
|
|
2639
2728
|
/**
|
|
2640
2729
|
* Code quality issues
|
|
2641
2730
|
*/
|
|
2642
|
-
codeQuality:
|
|
2643
|
-
score:
|
|
2644
|
-
issues:
|
|
2645
|
-
type:
|
|
2646
|
-
severity:
|
|
2647
|
-
message:
|
|
2648
|
-
file:
|
|
2649
|
-
line:
|
|
2731
|
+
codeQuality: z13.object({
|
|
2732
|
+
score: z13.number().min(0).max(100).optional(),
|
|
2733
|
+
issues: z13.array(z13.object({
|
|
2734
|
+
type: z13.enum(["security", "quality", "style"]),
|
|
2735
|
+
severity: z13.enum(["error", "warning", "info"]),
|
|
2736
|
+
message: z13.string(),
|
|
2737
|
+
file: z13.string().optional(),
|
|
2738
|
+
line: z13.number().int().optional()
|
|
2650
2739
|
})).default([])
|
|
2651
2740
|
}).optional(),
|
|
2652
2741
|
/**
|
|
2653
2742
|
* Next scan scheduled
|
|
2654
2743
|
*/
|
|
2655
|
-
nextScanAt:
|
|
2744
|
+
nextScanAt: z13.string().datetime().optional()
|
|
2656
2745
|
});
|
|
2657
|
-
var SecurityPolicySchema =
|
|
2746
|
+
var SecurityPolicySchema = z13.object({
|
|
2658
2747
|
/**
|
|
2659
2748
|
* Policy identifier
|
|
2660
2749
|
*/
|
|
2661
|
-
id:
|
|
2750
|
+
id: z13.string(),
|
|
2662
2751
|
/**
|
|
2663
2752
|
* Policy name
|
|
2664
2753
|
*/
|
|
2665
|
-
name:
|
|
2754
|
+
name: z13.string(),
|
|
2666
2755
|
/**
|
|
2667
2756
|
* Automatic scanning
|
|
2668
2757
|
*/
|
|
2669
|
-
autoScan:
|
|
2670
|
-
enabled:
|
|
2671
|
-
frequency:
|
|
2758
|
+
autoScan: z13.object({
|
|
2759
|
+
enabled: z13.boolean().default(true),
|
|
2760
|
+
frequency: z13.enum(["on-publish", "daily", "weekly", "monthly"]).default("daily")
|
|
2672
2761
|
}),
|
|
2673
2762
|
/**
|
|
2674
2763
|
* Vulnerability thresholds
|
|
2675
2764
|
*/
|
|
2676
|
-
thresholds:
|
|
2765
|
+
thresholds: z13.object({
|
|
2677
2766
|
/**
|
|
2678
2767
|
* Block plugin if critical vulnerabilities exceed this
|
|
2679
2768
|
*/
|
|
2680
|
-
maxCritical:
|
|
2769
|
+
maxCritical: z13.number().int().min(0).default(0),
|
|
2681
2770
|
/**
|
|
2682
2771
|
* Block plugin if high vulnerabilities exceed this
|
|
2683
2772
|
*/
|
|
2684
|
-
maxHigh:
|
|
2773
|
+
maxHigh: z13.number().int().min(0).default(0),
|
|
2685
2774
|
/**
|
|
2686
2775
|
* Warn if medium vulnerabilities exceed this
|
|
2687
2776
|
*/
|
|
2688
|
-
maxMedium:
|
|
2777
|
+
maxMedium: z13.number().int().min(0).default(5)
|
|
2689
2778
|
}),
|
|
2690
2779
|
/**
|
|
2691
2780
|
* Allowed licenses
|
|
2692
2781
|
*/
|
|
2693
|
-
allowedLicenses:
|
|
2782
|
+
allowedLicenses: z13.array(z13.string()).default([
|
|
2694
2783
|
"MIT",
|
|
2695
2784
|
"Apache-2.0",
|
|
2696
2785
|
"BSD-3-Clause",
|
|
@@ -2700,152 +2789,152 @@ var SecurityPolicySchema = z12.object({
|
|
|
2700
2789
|
/**
|
|
2701
2790
|
* Prohibited licenses
|
|
2702
2791
|
*/
|
|
2703
|
-
prohibitedLicenses:
|
|
2792
|
+
prohibitedLicenses: z13.array(z13.string()).default([
|
|
2704
2793
|
"GPL-3.0",
|
|
2705
2794
|
"AGPL-3.0"
|
|
2706
2795
|
]),
|
|
2707
2796
|
/**
|
|
2708
2797
|
* Code signing requirements
|
|
2709
2798
|
*/
|
|
2710
|
-
codeSigning:
|
|
2711
|
-
required:
|
|
2712
|
-
allowedSigners:
|
|
2799
|
+
codeSigning: z13.object({
|
|
2800
|
+
required: z13.boolean().default(false),
|
|
2801
|
+
allowedSigners: z13.array(z13.string()).default([])
|
|
2713
2802
|
}).optional(),
|
|
2714
2803
|
/**
|
|
2715
2804
|
* Sandbox restrictions
|
|
2716
2805
|
*/
|
|
2717
|
-
sandbox:
|
|
2806
|
+
sandbox: z13.object({
|
|
2718
2807
|
/**
|
|
2719
2808
|
* Restrict network access
|
|
2720
2809
|
*/
|
|
2721
|
-
networkAccess:
|
|
2810
|
+
networkAccess: z13.enum(["none", "localhost", "allowlist", "all"]).default("all"),
|
|
2722
2811
|
/**
|
|
2723
2812
|
* Allowed network destinations (if allowlist)
|
|
2724
2813
|
*/
|
|
2725
|
-
allowedDestinations:
|
|
2814
|
+
allowedDestinations: z13.array(z13.string()).default([]),
|
|
2726
2815
|
/**
|
|
2727
2816
|
* File system access
|
|
2728
2817
|
*/
|
|
2729
|
-
filesystemAccess:
|
|
2818
|
+
filesystemAccess: z13.enum(["none", "read-only", "temp-only", "full"]).default("full"),
|
|
2730
2819
|
/**
|
|
2731
2820
|
* Maximum memory (MB)
|
|
2732
2821
|
*/
|
|
2733
|
-
maxMemoryMB:
|
|
2822
|
+
maxMemoryMB: z13.number().int().positive().optional(),
|
|
2734
2823
|
/**
|
|
2735
2824
|
* Maximum CPU time (seconds)
|
|
2736
2825
|
*/
|
|
2737
|
-
maxCPUSeconds:
|
|
2826
|
+
maxCPUSeconds: z13.number().int().positive().optional()
|
|
2738
2827
|
}).optional()
|
|
2739
2828
|
});
|
|
2740
|
-
var PackageDependencySchema =
|
|
2829
|
+
var PackageDependencySchema = z13.object({
|
|
2741
2830
|
/**
|
|
2742
2831
|
* Package name/ID
|
|
2743
2832
|
*/
|
|
2744
|
-
name:
|
|
2833
|
+
name: z13.string(),
|
|
2745
2834
|
/**
|
|
2746
2835
|
* Version constraint (semver range)
|
|
2747
2836
|
*/
|
|
2748
|
-
versionConstraint:
|
|
2837
|
+
versionConstraint: z13.string().describe("Semver range (e.g., `^1.0.0`, `>=2.0.0 <3.0.0`)"),
|
|
2749
2838
|
/**
|
|
2750
2839
|
* Dependency type
|
|
2751
2840
|
*/
|
|
2752
|
-
type:
|
|
2841
|
+
type: z13.enum(["required", "optional", "peer", "dev"]).default("required"),
|
|
2753
2842
|
/**
|
|
2754
2843
|
* Resolved version (filled during resolution)
|
|
2755
2844
|
*/
|
|
2756
|
-
resolvedVersion:
|
|
2845
|
+
resolvedVersion: z13.string().optional()
|
|
2757
2846
|
});
|
|
2758
|
-
var DependencyGraphNodeSchema =
|
|
2847
|
+
var DependencyGraphNodeSchema = z13.object({
|
|
2759
2848
|
/**
|
|
2760
2849
|
* Package identifier
|
|
2761
2850
|
*/
|
|
2762
|
-
id:
|
|
2851
|
+
id: z13.string(),
|
|
2763
2852
|
/**
|
|
2764
2853
|
* Package version
|
|
2765
2854
|
*/
|
|
2766
|
-
version:
|
|
2855
|
+
version: z13.string(),
|
|
2767
2856
|
/**
|
|
2768
2857
|
* Dependencies of this package
|
|
2769
2858
|
*/
|
|
2770
|
-
dependencies:
|
|
2859
|
+
dependencies: z13.array(PackageDependencySchema).default([]),
|
|
2771
2860
|
/**
|
|
2772
2861
|
* Depth in dependency tree
|
|
2773
2862
|
*/
|
|
2774
|
-
depth:
|
|
2863
|
+
depth: z13.number().int().min(0),
|
|
2775
2864
|
/**
|
|
2776
2865
|
* Whether this is a direct dependency
|
|
2777
2866
|
*/
|
|
2778
|
-
isDirect:
|
|
2867
|
+
isDirect: z13.boolean(),
|
|
2779
2868
|
/**
|
|
2780
2869
|
* Package metadata
|
|
2781
2870
|
*/
|
|
2782
|
-
metadata:
|
|
2783
|
-
name:
|
|
2784
|
-
description:
|
|
2785
|
-
license:
|
|
2786
|
-
homepage:
|
|
2871
|
+
metadata: z13.object({
|
|
2872
|
+
name: z13.string(),
|
|
2873
|
+
description: z13.string().optional(),
|
|
2874
|
+
license: z13.string().optional(),
|
|
2875
|
+
homepage: z13.string().url().optional()
|
|
2787
2876
|
}).optional()
|
|
2788
2877
|
});
|
|
2789
|
-
var DependencyGraphSchema =
|
|
2878
|
+
var DependencyGraphSchema = z13.object({
|
|
2790
2879
|
/**
|
|
2791
2880
|
* Root package
|
|
2792
2881
|
*/
|
|
2793
|
-
root:
|
|
2794
|
-
id:
|
|
2795
|
-
version:
|
|
2882
|
+
root: z13.object({
|
|
2883
|
+
id: z13.string(),
|
|
2884
|
+
version: z13.string()
|
|
2796
2885
|
}),
|
|
2797
2886
|
/**
|
|
2798
2887
|
* All nodes in the graph
|
|
2799
2888
|
*/
|
|
2800
|
-
nodes:
|
|
2889
|
+
nodes: z13.array(DependencyGraphNodeSchema),
|
|
2801
2890
|
/**
|
|
2802
2891
|
* Edges (dependency relationships)
|
|
2803
2892
|
*/
|
|
2804
|
-
edges:
|
|
2805
|
-
from:
|
|
2806
|
-
to:
|
|
2807
|
-
constraint:
|
|
2893
|
+
edges: z13.array(z13.object({
|
|
2894
|
+
from: z13.string().describe("Package ID"),
|
|
2895
|
+
to: z13.string().describe("Package ID"),
|
|
2896
|
+
constraint: z13.string().describe("Version constraint")
|
|
2808
2897
|
})),
|
|
2809
2898
|
/**
|
|
2810
2899
|
* Resolution statistics
|
|
2811
2900
|
*/
|
|
2812
|
-
stats:
|
|
2813
|
-
totalDependencies:
|
|
2814
|
-
directDependencies:
|
|
2815
|
-
maxDepth:
|
|
2901
|
+
stats: z13.object({
|
|
2902
|
+
totalDependencies: z13.number().int().min(0),
|
|
2903
|
+
directDependencies: z13.number().int().min(0),
|
|
2904
|
+
maxDepth: z13.number().int().min(0)
|
|
2816
2905
|
})
|
|
2817
2906
|
});
|
|
2818
|
-
var DependencyConflictSchema =
|
|
2907
|
+
var DependencyConflictSchema = z13.object({
|
|
2819
2908
|
/**
|
|
2820
2909
|
* Package with conflict
|
|
2821
2910
|
*/
|
|
2822
|
-
package:
|
|
2911
|
+
package: z13.string(),
|
|
2823
2912
|
/**
|
|
2824
2913
|
* Conflicting versions
|
|
2825
2914
|
*/
|
|
2826
|
-
conflicts:
|
|
2827
|
-
version:
|
|
2828
|
-
requestedBy:
|
|
2829
|
-
constraint:
|
|
2915
|
+
conflicts: z13.array(z13.object({
|
|
2916
|
+
version: z13.string(),
|
|
2917
|
+
requestedBy: z13.array(z13.string()).describe("Packages that require this version"),
|
|
2918
|
+
constraint: z13.string()
|
|
2830
2919
|
})),
|
|
2831
2920
|
/**
|
|
2832
2921
|
* Suggested resolution
|
|
2833
2922
|
*/
|
|
2834
|
-
resolution:
|
|
2835
|
-
strategy:
|
|
2836
|
-
version:
|
|
2837
|
-
reason:
|
|
2923
|
+
resolution: z13.object({
|
|
2924
|
+
strategy: z13.enum(["pick-highest", "pick-lowest", "manual"]),
|
|
2925
|
+
version: z13.string().optional(),
|
|
2926
|
+
reason: z13.string().optional()
|
|
2838
2927
|
}).optional(),
|
|
2839
2928
|
/**
|
|
2840
2929
|
* Severity
|
|
2841
2930
|
*/
|
|
2842
|
-
severity:
|
|
2931
|
+
severity: z13.enum(["error", "warning", "info"])
|
|
2843
2932
|
});
|
|
2844
|
-
var DependencyResolutionResultSchema =
|
|
2933
|
+
var DependencyResolutionResultSchema = z13.object({
|
|
2845
2934
|
/**
|
|
2846
2935
|
* Resolution status
|
|
2847
2936
|
*/
|
|
2848
|
-
status:
|
|
2937
|
+
status: z13.enum(["success", "conflict", "error"]),
|
|
2849
2938
|
/**
|
|
2850
2939
|
* Resolved dependency graph
|
|
2851
2940
|
*/
|
|
@@ -2853,207 +2942,207 @@ var DependencyResolutionResultSchema = z12.object({
|
|
|
2853
2942
|
/**
|
|
2854
2943
|
* Conflicts detected
|
|
2855
2944
|
*/
|
|
2856
|
-
conflicts:
|
|
2945
|
+
conflicts: z13.array(DependencyConflictSchema).default([]),
|
|
2857
2946
|
/**
|
|
2858
2947
|
* Errors encountered
|
|
2859
2948
|
*/
|
|
2860
|
-
errors:
|
|
2861
|
-
package:
|
|
2862
|
-
error:
|
|
2949
|
+
errors: z13.array(z13.object({
|
|
2950
|
+
package: z13.string(),
|
|
2951
|
+
error: z13.string()
|
|
2863
2952
|
})).default([]),
|
|
2864
2953
|
/**
|
|
2865
2954
|
* Installation order (topological sort)
|
|
2866
2955
|
*/
|
|
2867
|
-
installOrder:
|
|
2956
|
+
installOrder: z13.array(z13.string()).default([]),
|
|
2868
2957
|
/**
|
|
2869
2958
|
* Resolution time (ms)
|
|
2870
2959
|
*/
|
|
2871
|
-
resolvedIn:
|
|
2960
|
+
resolvedIn: z13.number().int().min(0).optional()
|
|
2872
2961
|
});
|
|
2873
|
-
var SBOMEntrySchema =
|
|
2962
|
+
var SBOMEntrySchema = z13.object({
|
|
2874
2963
|
/**
|
|
2875
2964
|
* Component name
|
|
2876
2965
|
*/
|
|
2877
|
-
name:
|
|
2966
|
+
name: z13.string(),
|
|
2878
2967
|
/**
|
|
2879
2968
|
* Component version
|
|
2880
2969
|
*/
|
|
2881
|
-
version:
|
|
2970
|
+
version: z13.string(),
|
|
2882
2971
|
/**
|
|
2883
2972
|
* Package URL (purl)
|
|
2884
2973
|
*/
|
|
2885
|
-
purl:
|
|
2974
|
+
purl: z13.string().optional().describe("Package URL identifier"),
|
|
2886
2975
|
/**
|
|
2887
2976
|
* License
|
|
2888
2977
|
*/
|
|
2889
|
-
license:
|
|
2978
|
+
license: z13.string().optional(),
|
|
2890
2979
|
/**
|
|
2891
2980
|
* Hashes
|
|
2892
2981
|
*/
|
|
2893
|
-
hashes:
|
|
2894
|
-
sha256:
|
|
2895
|
-
sha512:
|
|
2982
|
+
hashes: z13.object({
|
|
2983
|
+
sha256: z13.string().optional(),
|
|
2984
|
+
sha512: z13.string().optional()
|
|
2896
2985
|
}).optional(),
|
|
2897
2986
|
/**
|
|
2898
2987
|
* Supplier
|
|
2899
2988
|
*/
|
|
2900
|
-
supplier:
|
|
2901
|
-
name:
|
|
2902
|
-
url:
|
|
2989
|
+
supplier: z13.object({
|
|
2990
|
+
name: z13.string(),
|
|
2991
|
+
url: z13.string().url().optional()
|
|
2903
2992
|
}).optional(),
|
|
2904
2993
|
/**
|
|
2905
2994
|
* External references
|
|
2906
2995
|
*/
|
|
2907
|
-
externalRefs:
|
|
2908
|
-
type:
|
|
2909
|
-
url:
|
|
2996
|
+
externalRefs: z13.array(z13.object({
|
|
2997
|
+
type: z13.enum(["website", "repository", "documentation", "issue-tracker"]),
|
|
2998
|
+
url: z13.string().url()
|
|
2910
2999
|
})).default([])
|
|
2911
3000
|
});
|
|
2912
|
-
var SBOMSchema =
|
|
3001
|
+
var SBOMSchema = z13.object({
|
|
2913
3002
|
/**
|
|
2914
3003
|
* SBOM format
|
|
2915
3004
|
*/
|
|
2916
|
-
format:
|
|
3005
|
+
format: z13.enum(["spdx", "cyclonedx"]).default("cyclonedx"),
|
|
2917
3006
|
/**
|
|
2918
3007
|
* SBOM version
|
|
2919
3008
|
*/
|
|
2920
|
-
version:
|
|
3009
|
+
version: z13.string(),
|
|
2921
3010
|
/**
|
|
2922
3011
|
* Plugin metadata
|
|
2923
3012
|
*/
|
|
2924
|
-
plugin:
|
|
2925
|
-
id:
|
|
2926
|
-
version:
|
|
2927
|
-
name:
|
|
3013
|
+
plugin: z13.object({
|
|
3014
|
+
id: z13.string(),
|
|
3015
|
+
version: z13.string(),
|
|
3016
|
+
name: z13.string()
|
|
2928
3017
|
}),
|
|
2929
3018
|
/**
|
|
2930
3019
|
* Components (dependencies)
|
|
2931
3020
|
*/
|
|
2932
|
-
components:
|
|
3021
|
+
components: z13.array(SBOMEntrySchema),
|
|
2933
3022
|
/**
|
|
2934
3023
|
* Generation timestamp
|
|
2935
3024
|
*/
|
|
2936
|
-
generatedAt:
|
|
3025
|
+
generatedAt: z13.string().datetime(),
|
|
2937
3026
|
/**
|
|
2938
3027
|
* Generator tool
|
|
2939
3028
|
*/
|
|
2940
|
-
generator:
|
|
2941
|
-
name:
|
|
2942
|
-
version:
|
|
3029
|
+
generator: z13.object({
|
|
3030
|
+
name: z13.string(),
|
|
3031
|
+
version: z13.string()
|
|
2943
3032
|
}).optional()
|
|
2944
3033
|
});
|
|
2945
|
-
var PluginProvenanceSchema =
|
|
3034
|
+
var PluginProvenanceSchema = z13.object({
|
|
2946
3035
|
/**
|
|
2947
3036
|
* Plugin identifier
|
|
2948
3037
|
*/
|
|
2949
|
-
pluginId:
|
|
3038
|
+
pluginId: z13.string(),
|
|
2950
3039
|
/**
|
|
2951
3040
|
* Plugin version
|
|
2952
3041
|
*/
|
|
2953
|
-
version:
|
|
3042
|
+
version: z13.string(),
|
|
2954
3043
|
/**
|
|
2955
3044
|
* Build information
|
|
2956
3045
|
*/
|
|
2957
|
-
build:
|
|
3046
|
+
build: z13.object({
|
|
2958
3047
|
/**
|
|
2959
3048
|
* Build timestamp
|
|
2960
3049
|
*/
|
|
2961
|
-
timestamp:
|
|
3050
|
+
timestamp: z13.string().datetime(),
|
|
2962
3051
|
/**
|
|
2963
3052
|
* Build environment
|
|
2964
3053
|
*/
|
|
2965
|
-
environment:
|
|
2966
|
-
os:
|
|
2967
|
-
arch:
|
|
2968
|
-
nodeVersion:
|
|
3054
|
+
environment: z13.object({
|
|
3055
|
+
os: z13.string(),
|
|
3056
|
+
arch: z13.string(),
|
|
3057
|
+
nodeVersion: z13.string()
|
|
2969
3058
|
}).optional(),
|
|
2970
3059
|
/**
|
|
2971
3060
|
* Source repository
|
|
2972
3061
|
*/
|
|
2973
|
-
source:
|
|
2974
|
-
repository:
|
|
2975
|
-
commit:
|
|
2976
|
-
branch:
|
|
2977
|
-
tag:
|
|
3062
|
+
source: z13.object({
|
|
3063
|
+
repository: z13.string().url(),
|
|
3064
|
+
commit: z13.string().regex(/^[a-f0-9]{40}$/),
|
|
3065
|
+
branch: z13.string().optional(),
|
|
3066
|
+
tag: z13.string().optional()
|
|
2978
3067
|
}).optional(),
|
|
2979
3068
|
/**
|
|
2980
3069
|
* Builder identity
|
|
2981
3070
|
*/
|
|
2982
|
-
builder:
|
|
2983
|
-
name:
|
|
2984
|
-
email:
|
|
3071
|
+
builder: z13.object({
|
|
3072
|
+
name: z13.string(),
|
|
3073
|
+
email: z13.string().email().optional()
|
|
2985
3074
|
}).optional()
|
|
2986
3075
|
}),
|
|
2987
3076
|
/**
|
|
2988
3077
|
* Artifact hashes
|
|
2989
3078
|
*/
|
|
2990
|
-
artifacts:
|
|
2991
|
-
filename:
|
|
2992
|
-
sha256:
|
|
2993
|
-
size:
|
|
3079
|
+
artifacts: z13.array(z13.object({
|
|
3080
|
+
filename: z13.string(),
|
|
3081
|
+
sha256: z13.string(),
|
|
3082
|
+
size: z13.number().int().positive()
|
|
2994
3083
|
})),
|
|
2995
3084
|
/**
|
|
2996
3085
|
* Signatures
|
|
2997
3086
|
*/
|
|
2998
|
-
signatures:
|
|
2999
|
-
algorithm:
|
|
3000
|
-
publicKey:
|
|
3001
|
-
signature:
|
|
3002
|
-
signedBy:
|
|
3003
|
-
timestamp:
|
|
3087
|
+
signatures: z13.array(z13.object({
|
|
3088
|
+
algorithm: z13.enum(["rsa", "ecdsa", "ed25519"]),
|
|
3089
|
+
publicKey: z13.string(),
|
|
3090
|
+
signature: z13.string(),
|
|
3091
|
+
signedBy: z13.string(),
|
|
3092
|
+
timestamp: z13.string().datetime()
|
|
3004
3093
|
})).default([]),
|
|
3005
3094
|
/**
|
|
3006
3095
|
* Attestations
|
|
3007
3096
|
*/
|
|
3008
|
-
attestations:
|
|
3009
|
-
type:
|
|
3010
|
-
status:
|
|
3011
|
-
url:
|
|
3012
|
-
timestamp:
|
|
3097
|
+
attestations: z13.array(z13.object({
|
|
3098
|
+
type: z13.enum(["code-review", "security-scan", "test-results", "ci-build"]),
|
|
3099
|
+
status: z13.enum(["passed", "failed"]),
|
|
3100
|
+
url: z13.string().url().optional(),
|
|
3101
|
+
timestamp: z13.string().datetime()
|
|
3013
3102
|
})).default([])
|
|
3014
3103
|
});
|
|
3015
|
-
var PluginTrustScoreSchema =
|
|
3104
|
+
var PluginTrustScoreSchema = z13.object({
|
|
3016
3105
|
/**
|
|
3017
3106
|
* Plugin identifier
|
|
3018
3107
|
*/
|
|
3019
|
-
pluginId:
|
|
3108
|
+
pluginId: z13.string(),
|
|
3020
3109
|
/**
|
|
3021
3110
|
* Overall trust score (0-100)
|
|
3022
3111
|
*/
|
|
3023
|
-
score:
|
|
3112
|
+
score: z13.number().min(0).max(100),
|
|
3024
3113
|
/**
|
|
3025
3114
|
* Score components
|
|
3026
3115
|
*/
|
|
3027
|
-
components:
|
|
3116
|
+
components: z13.object({
|
|
3028
3117
|
/**
|
|
3029
3118
|
* Vendor reputation (0-100)
|
|
3030
3119
|
*/
|
|
3031
|
-
vendorReputation:
|
|
3120
|
+
vendorReputation: z13.number().min(0).max(100),
|
|
3032
3121
|
/**
|
|
3033
3122
|
* Security scan results (0-100)
|
|
3034
3123
|
*/
|
|
3035
|
-
securityScore:
|
|
3124
|
+
securityScore: z13.number().min(0).max(100),
|
|
3036
3125
|
/**
|
|
3037
3126
|
* Code quality (0-100)
|
|
3038
3127
|
*/
|
|
3039
|
-
codeQuality:
|
|
3128
|
+
codeQuality: z13.number().min(0).max(100),
|
|
3040
3129
|
/**
|
|
3041
3130
|
* Community engagement (0-100)
|
|
3042
3131
|
*/
|
|
3043
|
-
communityScore:
|
|
3132
|
+
communityScore: z13.number().min(0).max(100),
|
|
3044
3133
|
/**
|
|
3045
3134
|
* Update frequency (0-100)
|
|
3046
3135
|
*/
|
|
3047
|
-
maintenanceScore:
|
|
3136
|
+
maintenanceScore: z13.number().min(0).max(100)
|
|
3048
3137
|
}),
|
|
3049
3138
|
/**
|
|
3050
3139
|
* Trust level
|
|
3051
3140
|
*/
|
|
3052
|
-
level:
|
|
3141
|
+
level: z13.enum(["verified", "trusted", "neutral", "untrusted", "blocked"]),
|
|
3053
3142
|
/**
|
|
3054
3143
|
* Verification badges
|
|
3055
3144
|
*/
|
|
3056
|
-
badges:
|
|
3145
|
+
badges: z13.array(z13.enum([
|
|
3057
3146
|
"official",
|
|
3058
3147
|
// Official ObjectStack plugin
|
|
3059
3148
|
"verified-vendor",
|
|
@@ -3070,7 +3159,7 @@ var PluginTrustScoreSchema = z12.object({
|
|
|
3070
3159
|
/**
|
|
3071
3160
|
* Last updated
|
|
3072
3161
|
*/
|
|
3073
|
-
updatedAt:
|
|
3162
|
+
updatedAt: z13.string().datetime()
|
|
3074
3163
|
});
|
|
3075
3164
|
var PluginSecurityProtocol = {
|
|
3076
3165
|
VulnerabilitySeverity,
|