@vorionsys/shared-constants 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-versions.cjs +183 -0
- package/dist/api-versions.d.cts +91 -0
- package/dist/api-versions.js +46 -0
- package/dist/capabilities.cjs +246 -0
- package/dist/capabilities.d.cts +55 -0
- package/dist/capabilities.js +21 -0
- package/dist/chunk-F2R6HBF5.js +253 -0
- package/dist/chunk-IKLCEYZT.js +142 -0
- package/dist/chunk-JZJPDGG7.js +215 -0
- package/dist/chunk-P3VPMVF3.js +223 -0
- package/dist/chunk-PHL3CB53.js +159 -0
- package/dist/chunk-RZQZEF6Q.js +176 -0
- package/dist/chunk-TYCMBQGU.js +353 -0
- package/dist/chunk-UDCZKJSQ.js +139 -0
- package/dist/domains.cjs +175 -0
- package/dist/domains.d.cts +250 -0
- package/dist/domains.js +24 -0
- package/dist/error-codes.cjs +390 -0
- package/dist/error-codes.d.cts +633 -0
- package/dist/error-codes.js +32 -0
- package/dist/index.cjs +1762 -0
- package/dist/index.d.cts +54 -0
- package/dist/index.js +198 -0
- package/dist/products.cjs +208 -0
- package/dist/products.d.cts +80 -0
- package/dist/products.js +22 -0
- package/dist/rate-limits.cjs +295 -0
- package/dist/rate-limits.d.cts +80 -0
- package/dist/rate-limits.js +21 -0
- package/dist/themes.cjs +251 -0
- package/dist/themes.d.cts +85 -0
- package/dist/themes.js +14 -0
- package/dist/tiers.cjs +194 -0
- package/dist/tiers.d.cts +75 -0
- package/dist/tiers.js +28 -0
- package/package.json +71 -0
- package/src/api-versions.ts +250 -0
- package/src/capabilities.ts +272 -0
- package/src/domains.ts +216 -0
- package/src/error-codes.ts +494 -0
- package/src/index.ts +206 -0
- package/src/products.ts +285 -0
- package/src/rate-limits.ts +334 -0
- package/src/themes.ts +380 -0
- package/src/tiers.ts +239 -0
- package/tsconfig.json +25 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vorionsys/shared-constants
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for the Vorion ecosystem
|
|
5
|
+
*
|
|
6
|
+
* This package provides shared constants, types, and helper functions
|
|
7
|
+
* that ensure consistency across all Vorion products and sites:
|
|
8
|
+
*
|
|
9
|
+
* - Trust tiers and thresholds (T0-T7)
|
|
10
|
+
* - Domain and URL configuration
|
|
11
|
+
* - Capability definitions
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import {
|
|
16
|
+
* TrustTier,
|
|
17
|
+
* TIER_THRESHOLDS,
|
|
18
|
+
* scoreToTier,
|
|
19
|
+
* API_ENDPOINTS,
|
|
20
|
+
* CAPABILITIES,
|
|
21
|
+
* } from '@vorionsys/shared-constants';
|
|
22
|
+
*
|
|
23
|
+
* // Get tier from score
|
|
24
|
+
* const tier = scoreToTier(750); // TrustTier.T4_STANDARD
|
|
25
|
+
*
|
|
26
|
+
* // Get tier info
|
|
27
|
+
* const info = TIER_THRESHOLDS[TrustTier.T4_STANDARD];
|
|
28
|
+
* console.log(info.name); // "Standard"
|
|
29
|
+
* console.log(info.min, info.max); // 650, 799
|
|
30
|
+
*
|
|
31
|
+
* // Get API endpoint
|
|
32
|
+
* const apiUrl = API_ENDPOINTS.cognigate.production;
|
|
33
|
+
* // "https://cognigate.dev/v1"
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see https://basis.vorion.org
|
|
37
|
+
* @see https://vorion.org
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// TRUST TIERS
|
|
42
|
+
// =============================================================================
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
TrustTier,
|
|
46
|
+
TIER_THRESHOLDS,
|
|
47
|
+
scoreToTier,
|
|
48
|
+
getTierThreshold,
|
|
49
|
+
getTierName,
|
|
50
|
+
getTierColor,
|
|
51
|
+
getTierMinScore,
|
|
52
|
+
getTierMaxScore,
|
|
53
|
+
getTierCode,
|
|
54
|
+
meetsTierRequirement,
|
|
55
|
+
parseTier,
|
|
56
|
+
ALL_TIERS,
|
|
57
|
+
type TierThreshold,
|
|
58
|
+
type TrustTierName,
|
|
59
|
+
type TrustTierCode,
|
|
60
|
+
} from './tiers';
|
|
61
|
+
|
|
62
|
+
// =============================================================================
|
|
63
|
+
// DOMAINS & URLS
|
|
64
|
+
// =============================================================================
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
VORION_DOMAINS,
|
|
68
|
+
AGENTANCHOR_DOMAINS,
|
|
69
|
+
COGNIGATE_DOMAINS,
|
|
70
|
+
API_ENDPOINTS,
|
|
71
|
+
VORION_EMAILS,
|
|
72
|
+
AGENTANCHOR_EMAILS,
|
|
73
|
+
GITHUB,
|
|
74
|
+
NPM_PACKAGES,
|
|
75
|
+
ALL_DOMAINS,
|
|
76
|
+
DOMAIN_ALIASES,
|
|
77
|
+
type VorionDomain,
|
|
78
|
+
type AgentAnchorDomain,
|
|
79
|
+
type CognigateDomain,
|
|
80
|
+
} from './domains';
|
|
81
|
+
|
|
82
|
+
// =============================================================================
|
|
83
|
+
// CAPABILITIES
|
|
84
|
+
// =============================================================================
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
CapabilityCategory,
|
|
88
|
+
CAPABILITIES,
|
|
89
|
+
getCapabilitiesForTier,
|
|
90
|
+
getCapability,
|
|
91
|
+
isCapabilityAvailable,
|
|
92
|
+
getCapabilityMinTier,
|
|
93
|
+
getCapabilitiesByCategory,
|
|
94
|
+
getAllCapabilityCodes,
|
|
95
|
+
type CapabilityDefinition,
|
|
96
|
+
} from './capabilities';
|
|
97
|
+
|
|
98
|
+
// =============================================================================
|
|
99
|
+
// PRODUCTS
|
|
100
|
+
// =============================================================================
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
ProductCategory,
|
|
104
|
+
ProductStatus,
|
|
105
|
+
VORION_PRODUCTS,
|
|
106
|
+
AGENTANCHOR_PRODUCTS,
|
|
107
|
+
ALL_PRODUCTS,
|
|
108
|
+
getProduct,
|
|
109
|
+
getProductsByCategory,
|
|
110
|
+
getProductsByStatus,
|
|
111
|
+
getProductsByOrganization,
|
|
112
|
+
type ProductDefinition,
|
|
113
|
+
} from './products';
|
|
114
|
+
|
|
115
|
+
// =============================================================================
|
|
116
|
+
// RATE LIMITS & QUOTAS
|
|
117
|
+
// =============================================================================
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
RATE_LIMITS,
|
|
121
|
+
TIER_QUOTAS,
|
|
122
|
+
getRateLimits,
|
|
123
|
+
getMinTierForLimits,
|
|
124
|
+
wouldExceedLimit,
|
|
125
|
+
formatRateLimit,
|
|
126
|
+
getQuota,
|
|
127
|
+
isUnlimited,
|
|
128
|
+
type RateLimitConfig,
|
|
129
|
+
type QuotaConfig,
|
|
130
|
+
} from './rate-limits';
|
|
131
|
+
|
|
132
|
+
// =============================================================================
|
|
133
|
+
// ERROR CODES
|
|
134
|
+
// =============================================================================
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
ErrorCategory,
|
|
138
|
+
AUTH_ERRORS,
|
|
139
|
+
VALIDATION_ERRORS,
|
|
140
|
+
RATE_LIMIT_ERRORS,
|
|
141
|
+
NOT_FOUND_ERRORS,
|
|
142
|
+
TRUST_ERRORS,
|
|
143
|
+
SERVER_ERRORS,
|
|
144
|
+
EXTERNAL_ERRORS,
|
|
145
|
+
ERROR_CODES,
|
|
146
|
+
getErrorByCode,
|
|
147
|
+
getErrorsByCategory,
|
|
148
|
+
getRetryableErrors,
|
|
149
|
+
formatErrorMessage,
|
|
150
|
+
createErrorResponse,
|
|
151
|
+
type ErrorDefinition,
|
|
152
|
+
type ErrorCode,
|
|
153
|
+
} from './error-codes';
|
|
154
|
+
|
|
155
|
+
// =============================================================================
|
|
156
|
+
// API VERSIONS
|
|
157
|
+
// =============================================================================
|
|
158
|
+
|
|
159
|
+
export {
|
|
160
|
+
VersionStatus,
|
|
161
|
+
COGNIGATE_VERSIONS,
|
|
162
|
+
COGNIGATE_CURRENT_VERSION,
|
|
163
|
+
COGNIGATE_DEFAULT_VERSION,
|
|
164
|
+
TRUST_API_VERSIONS,
|
|
165
|
+
TRUST_CURRENT_VERSION,
|
|
166
|
+
LOGIC_API_VERSIONS,
|
|
167
|
+
LOGIC_CURRENT_VERSION,
|
|
168
|
+
BASIS_VERSIONS,
|
|
169
|
+
BASIS_CURRENT_VERSION,
|
|
170
|
+
BASIS_SPEC_VERSION,
|
|
171
|
+
CAR_SPEC_VERSIONS,
|
|
172
|
+
CAR_SPEC_CURRENT_VERSION,
|
|
173
|
+
API_VERSIONS,
|
|
174
|
+
getCurrentVersion,
|
|
175
|
+
getVersionDefinition,
|
|
176
|
+
isVersionSupported,
|
|
177
|
+
isVersionDeprecated,
|
|
178
|
+
getStableVersions,
|
|
179
|
+
buildApiUrl,
|
|
180
|
+
VERSION_HEADERS,
|
|
181
|
+
type ApiVersionDefinition,
|
|
182
|
+
} from './api-versions';
|
|
183
|
+
|
|
184
|
+
// =============================================================================
|
|
185
|
+
// THEMES
|
|
186
|
+
// =============================================================================
|
|
187
|
+
|
|
188
|
+
export {
|
|
189
|
+
ACTIVE_THEME,
|
|
190
|
+
THEMES,
|
|
191
|
+
getActiveTheme,
|
|
192
|
+
getAllThemeIds,
|
|
193
|
+
themeToCssVars,
|
|
194
|
+
type ThemeId,
|
|
195
|
+
type ThemeTokens,
|
|
196
|
+
} from './themes';
|
|
197
|
+
|
|
198
|
+
// =============================================================================
|
|
199
|
+
// PACKAGE VERSION
|
|
200
|
+
// =============================================================================
|
|
201
|
+
|
|
202
|
+
/** Package version */
|
|
203
|
+
export const VERSION = '1.0.0';
|
|
204
|
+
|
|
205
|
+
/** Last updated date */
|
|
206
|
+
export const LAST_UPDATED = '2026-02-04';
|
package/src/products.ts
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vorionsys/shared-constants - Product Definitions
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for all Vorion ecosystem products
|
|
5
|
+
* Used for consistent product references across all sites
|
|
6
|
+
*
|
|
7
|
+
* @see https://vorion.org
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// PRODUCT CATEGORIES
|
|
12
|
+
// =============================================================================
|
|
13
|
+
|
|
14
|
+
export enum ProductCategory {
|
|
15
|
+
/** Open source standards and specifications */
|
|
16
|
+
OPEN_SOURCE = 'open_source',
|
|
17
|
+
|
|
18
|
+
/** Commercial SaaS products */
|
|
19
|
+
COMMERCIAL = 'commercial',
|
|
20
|
+
|
|
21
|
+
/** Developer tools and SDKs */
|
|
22
|
+
DEVELOPER_TOOLS = 'developer_tools',
|
|
23
|
+
|
|
24
|
+
/** Educational platforms */
|
|
25
|
+
EDUCATION = 'education',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// =============================================================================
|
|
29
|
+
// PRODUCT STATUS
|
|
30
|
+
// =============================================================================
|
|
31
|
+
|
|
32
|
+
export enum ProductStatus {
|
|
33
|
+
/** In active development, not yet released */
|
|
34
|
+
DEVELOPMENT = 'development',
|
|
35
|
+
|
|
36
|
+
/** Released as alpha/preview */
|
|
37
|
+
ALPHA = 'alpha',
|
|
38
|
+
|
|
39
|
+
/** Released as beta */
|
|
40
|
+
BETA = 'beta',
|
|
41
|
+
|
|
42
|
+
/** Generally available */
|
|
43
|
+
GA = 'ga',
|
|
44
|
+
|
|
45
|
+
/** Deprecated, still supported */
|
|
46
|
+
DEPRECATED = 'deprecated',
|
|
47
|
+
|
|
48
|
+
/** End of life, no longer supported */
|
|
49
|
+
EOL = 'eol',
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// =============================================================================
|
|
53
|
+
// PRODUCT DEFINITIONS
|
|
54
|
+
// =============================================================================
|
|
55
|
+
|
|
56
|
+
export interface ProductDefinition {
|
|
57
|
+
/** Unique product identifier */
|
|
58
|
+
id: string;
|
|
59
|
+
|
|
60
|
+
/** Human-readable name */
|
|
61
|
+
name: string;
|
|
62
|
+
|
|
63
|
+
/** Short description */
|
|
64
|
+
description: string;
|
|
65
|
+
|
|
66
|
+
/** Product category */
|
|
67
|
+
category: ProductCategory;
|
|
68
|
+
|
|
69
|
+
/** Current status */
|
|
70
|
+
status: ProductStatus;
|
|
71
|
+
|
|
72
|
+
/** Primary website URL */
|
|
73
|
+
url: string;
|
|
74
|
+
|
|
75
|
+
/** Documentation URL */
|
|
76
|
+
docsUrl?: string;
|
|
77
|
+
|
|
78
|
+
/** GitHub repository URL */
|
|
79
|
+
repoUrl?: string;
|
|
80
|
+
|
|
81
|
+
/** NPM package name */
|
|
82
|
+
npmPackage?: string;
|
|
83
|
+
|
|
84
|
+
/** Parent organization */
|
|
85
|
+
organization: 'vorion' | 'agentanchor';
|
|
86
|
+
|
|
87
|
+
/** Version (semver) */
|
|
88
|
+
version?: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// =============================================================================
|
|
92
|
+
// VORION OPEN SOURCE PRODUCTS
|
|
93
|
+
// =============================================================================
|
|
94
|
+
|
|
95
|
+
export const VORION_PRODUCTS: Record<string, ProductDefinition> = {
|
|
96
|
+
basis: {
|
|
97
|
+
id: 'basis',
|
|
98
|
+
name: 'BASIS',
|
|
99
|
+
description: 'Blockchain Agent Safety & Identity Standard - Open framework for AI agent governance',
|
|
100
|
+
category: ProductCategory.OPEN_SOURCE,
|
|
101
|
+
status: ProductStatus.GA,
|
|
102
|
+
url: 'https://basis.vorion.org',
|
|
103
|
+
docsUrl: 'https://basis.vorion.org/docs',
|
|
104
|
+
repoUrl: 'https://github.com/voriongit/vorion/tree/master/packages/basis',
|
|
105
|
+
npmPackage: '@vorionsys/basis',
|
|
106
|
+
organization: 'vorion',
|
|
107
|
+
version: '1.0.0',
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
carId: {
|
|
111
|
+
id: 'car-id',
|
|
112
|
+
name: 'CAR ID',
|
|
113
|
+
description: 'Categorical Agent Registry - Universal agent identification system',
|
|
114
|
+
category: ProductCategory.OPEN_SOURCE,
|
|
115
|
+
status: ProductStatus.GA,
|
|
116
|
+
url: 'https://carid.vorion.org',
|
|
117
|
+
docsUrl: 'https://carid.vorion.org/docs',
|
|
118
|
+
repoUrl: 'https://github.com/voriongit/vorion/tree/master/packages/car-spec',
|
|
119
|
+
npmPackage: '@vorionsys/car-spec',
|
|
120
|
+
organization: 'vorion',
|
|
121
|
+
version: '1.0.0',
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
atsf: {
|
|
125
|
+
id: 'atsf',
|
|
126
|
+
name: 'ATSF',
|
|
127
|
+
description: 'Agent Trust & Safety Framework - Comprehensive safety evaluation system',
|
|
128
|
+
category: ProductCategory.OPEN_SOURCE,
|
|
129
|
+
status: ProductStatus.BETA,
|
|
130
|
+
url: 'https://atsf.vorion.org',
|
|
131
|
+
docsUrl: 'https://atsf.vorion.org/docs',
|
|
132
|
+
repoUrl: 'https://github.com/voriongit/vorion/tree/master/packages/atsf-core',
|
|
133
|
+
npmPackage: '@vorionsys/atsf-core',
|
|
134
|
+
organization: 'vorion',
|
|
135
|
+
version: '0.9.0',
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
kaizen: {
|
|
139
|
+
id: 'kaizen',
|
|
140
|
+
name: 'Kaizen',
|
|
141
|
+
description: 'Interactive AI Learning Experience - Educational platform for agentic AI',
|
|
142
|
+
category: ProductCategory.EDUCATION,
|
|
143
|
+
status: ProductStatus.BETA,
|
|
144
|
+
url: 'https://learn.vorion.org',
|
|
145
|
+
docsUrl: 'https://learn.vorion.org/docs',
|
|
146
|
+
repoUrl: 'https://github.com/voriongit/vorion/tree/master/kaizen',
|
|
147
|
+
organization: 'vorion',
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
kaizenStudio: {
|
|
151
|
+
id: 'kaizen-studio',
|
|
152
|
+
name: 'Kaizen Studio',
|
|
153
|
+
description: 'Interactive AI learning studio - hands-on agentic AI experiments',
|
|
154
|
+
category: ProductCategory.EDUCATION,
|
|
155
|
+
status: ProductStatus.BETA,
|
|
156
|
+
url: 'https://kaizen.vorion.org',
|
|
157
|
+
repoUrl: 'https://github.com/voriongit/vorion/tree/master/kaizen',
|
|
158
|
+
organization: 'vorion',
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
proofPlane: {
|
|
162
|
+
id: 'proof-plane',
|
|
163
|
+
name: 'Proof Plane',
|
|
164
|
+
description: 'Cryptographic proof layer for agent attestations and verifiable execution',
|
|
165
|
+
category: ProductCategory.OPEN_SOURCE,
|
|
166
|
+
status: ProductStatus.BETA,
|
|
167
|
+
url: 'https://vorion.org/proof-plane',
|
|
168
|
+
repoUrl: 'https://github.com/voriongit/vorion/tree/master/packages/proof-plane',
|
|
169
|
+
npmPackage: '@vorionsys/proof-plane',
|
|
170
|
+
organization: 'vorion',
|
|
171
|
+
version: '0.5.0',
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
contracts: {
|
|
175
|
+
id: 'contracts',
|
|
176
|
+
name: 'Vorion Contracts',
|
|
177
|
+
description: 'Smart contracts for on-chain agent governance and attestations',
|
|
178
|
+
category: ProductCategory.OPEN_SOURCE,
|
|
179
|
+
status: ProductStatus.BETA,
|
|
180
|
+
url: 'https://vorion.org/contracts',
|
|
181
|
+
repoUrl: 'https://github.com/voriongit/vorion/tree/master/packages/contracts',
|
|
182
|
+
npmPackage: '@vorionsys/contracts',
|
|
183
|
+
organization: 'vorion',
|
|
184
|
+
},
|
|
185
|
+
} as const;
|
|
186
|
+
|
|
187
|
+
// =============================================================================
|
|
188
|
+
// AGENT ANCHOR COMMERCIAL PRODUCTS
|
|
189
|
+
// =============================================================================
|
|
190
|
+
|
|
191
|
+
export const AGENTANCHOR_PRODUCTS: Record<string, ProductDefinition> = {
|
|
192
|
+
cognigate: {
|
|
193
|
+
id: 'cognigate',
|
|
194
|
+
name: 'Cognigate',
|
|
195
|
+
description: 'AI Governance API - Reference implementation of BASIS runtime',
|
|
196
|
+
category: ProductCategory.COMMERCIAL,
|
|
197
|
+
status: ProductStatus.GA,
|
|
198
|
+
url: 'https://cognigate.dev',
|
|
199
|
+
docsUrl: 'https://cognigate.dev/docs',
|
|
200
|
+
npmPackage: '@vorionsys/cognigate',
|
|
201
|
+
organization: 'agentanchor',
|
|
202
|
+
version: '1.0.0',
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
trust: {
|
|
206
|
+
id: 'trust',
|
|
207
|
+
name: 'Agent Anchor Trust',
|
|
208
|
+
description: 'Trust verification and certification platform for AI agents',
|
|
209
|
+
category: ProductCategory.COMMERCIAL,
|
|
210
|
+
status: ProductStatus.GA,
|
|
211
|
+
url: 'https://trust.agentanchorai.com',
|
|
212
|
+
docsUrl: 'https://trust.agentanchorai.com/docs',
|
|
213
|
+
organization: 'agentanchor',
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
logic: {
|
|
217
|
+
id: 'logic',
|
|
218
|
+
name: 'Agent Anchor Logic',
|
|
219
|
+
description: 'Policy engine and governance logic for enterprise AI',
|
|
220
|
+
category: ProductCategory.COMMERCIAL,
|
|
221
|
+
status: ProductStatus.BETA,
|
|
222
|
+
url: 'https://logic.agentanchorai.com',
|
|
223
|
+
docsUrl: 'https://logic.agentanchorai.com/docs',
|
|
224
|
+
organization: 'agentanchor',
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
platform: {
|
|
228
|
+
id: 'platform',
|
|
229
|
+
name: 'Agent Anchor Platform',
|
|
230
|
+
description: 'Enterprise AI governance dashboard and management console',
|
|
231
|
+
category: ProductCategory.COMMERCIAL,
|
|
232
|
+
status: ProductStatus.GA,
|
|
233
|
+
url: 'https://agentanchorai.com',
|
|
234
|
+
docsUrl: 'https://agentanchorai.com/docs',
|
|
235
|
+
organization: 'agentanchor',
|
|
236
|
+
},
|
|
237
|
+
} as const;
|
|
238
|
+
|
|
239
|
+
// =============================================================================
|
|
240
|
+
// ALL PRODUCTS
|
|
241
|
+
// =============================================================================
|
|
242
|
+
|
|
243
|
+
export const ALL_PRODUCTS = {
|
|
244
|
+
vorion: VORION_PRODUCTS,
|
|
245
|
+
agentAnchor: AGENTANCHOR_PRODUCTS,
|
|
246
|
+
} as const;
|
|
247
|
+
|
|
248
|
+
// =============================================================================
|
|
249
|
+
// HELPER FUNCTIONS
|
|
250
|
+
// =============================================================================
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Get a product by its ID
|
|
254
|
+
*/
|
|
255
|
+
export function getProduct(productId: string): ProductDefinition | undefined {
|
|
256
|
+
return (
|
|
257
|
+
VORION_PRODUCTS[productId] ||
|
|
258
|
+
AGENTANCHOR_PRODUCTS[productId]
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Get all products by category
|
|
264
|
+
*/
|
|
265
|
+
export function getProductsByCategory(category: ProductCategory): ProductDefinition[] {
|
|
266
|
+
const allProducts = [...Object.values(VORION_PRODUCTS), ...Object.values(AGENTANCHOR_PRODUCTS)];
|
|
267
|
+
return allProducts.filter(p => p.category === category);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Get all products by status
|
|
272
|
+
*/
|
|
273
|
+
export function getProductsByStatus(status: ProductStatus): ProductDefinition[] {
|
|
274
|
+
const allProducts = [...Object.values(VORION_PRODUCTS), ...Object.values(AGENTANCHOR_PRODUCTS)];
|
|
275
|
+
return allProducts.filter(p => p.status === status);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Get all products by organization
|
|
280
|
+
*/
|
|
281
|
+
export function getProductsByOrganization(org: 'vorion' | 'agentanchor'): ProductDefinition[] {
|
|
282
|
+
return org === 'vorion'
|
|
283
|
+
? Object.values(VORION_PRODUCTS)
|
|
284
|
+
: Object.values(AGENTANCHOR_PRODUCTS);
|
|
285
|
+
}
|