@hablala/schema 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +53 -2
- package/dist/chunk-NPRLVZEM.js +424 -0
- package/dist/chunk-NPRLVZEM.js.map +1 -0
- package/dist/index.d.ts +181 -0
- package/dist/index.js +87 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest-CGY_48sA.d.ts +838 -0
- package/dist/synth/index.d.ts +170 -0
- package/dist/synth/index.js +359 -0
- package/dist/synth/index.js.map +1 -0
- package/generated/data-type.schema.json +17 -0
- package/generated/manifest.schema.json +2121 -0
- package/package.json +64 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { M as Manifest } from './manifest-CGY_48sA.js';
|
|
2
|
+
export { A as AccountKind, a as AuthoritySource, C as Cardinality, D as DataType, b as DerivedDataType, E as EgressAuthType, c as EgressStatus, d as Manageability, e as ManifestAgent, f as ManifestEgressConnection, g as ManifestPolicy, h as ManifestPrivacy, i as ManifestProfile, j as ManifestRelationship, k as ManifestRole, l as ManifestSettings, m as ManifestTransaction, n as ManifestWebhookEndpoint, o as ManifestWorkflow, P as PolicyAction, p as PolicyEffect, S as SectionMode, W as WebhookStatus, q as accountKindEnum, r as agentSchema, s as authoritySourceEnum, t as cardinalityEnum, u as dataTypeEnum, v as derivedDataTypes, w as egressAuthTypeEnum, x as egressConnectionSchema, y as egressStatusEnum, z as formulaResultTypes, B as inputDataTypes, F as isDerivedDataType, G as manageabilityEnum, H as manifestSchema, I as optionsDataTypes, J as policyActionEnum, K as policyEffectEnum, L as policySchema, N as privacySchema, O as profileSchema, Q as relationshipSchema, R as roleSchema, T as rollupAggregates, U as sectionModeEnum, V as settingsSchema, X as transactionSchema, Y as transactionStepSchema, Z as uniqueIncompatibleDataTypes, _ as webhookEndpointSchema, $ as webhookStatusEnum, a0 as workflowSchema } from './manifest-CGY_48sA.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* El esquema de un campo del manifiesto. Valida, además de la forma base:
|
|
7
|
+
* - la FORMA del `config` según `dataType` (reglas de `FieldRules.config_errors`),
|
|
8
|
+
* - la compatibilidad de flags con el tipo (reglas de `FieldRules.flag_errors`):
|
|
9
|
+
* `isUnique` no va en multiselect/boolean/file/derivados; un `file` no se indexa ni se embebe;
|
|
10
|
+
* un tipo derivado (formula/rollup) no acepta flags de entrada/almacenamiento.
|
|
11
|
+
*/
|
|
12
|
+
declare const fieldSchema: z.ZodObject<{
|
|
13
|
+
apiName: z.ZodString;
|
|
14
|
+
title: z.ZodOptional<z.ZodString>;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
synonyms: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
dataType: z.ZodEnum<{
|
|
18
|
+
number: "number";
|
|
19
|
+
boolean: "boolean";
|
|
20
|
+
text: "text";
|
|
21
|
+
date: "date";
|
|
22
|
+
timestamp: "timestamp";
|
|
23
|
+
select: "select";
|
|
24
|
+
multiselect: "multiselect";
|
|
25
|
+
reference: "reference";
|
|
26
|
+
file: "file";
|
|
27
|
+
formula: "formula";
|
|
28
|
+
rollup: "rollup";
|
|
29
|
+
}>;
|
|
30
|
+
isRequired: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
isUnique: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
isIndexed: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
embedInVector: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
35
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
type Field = z.infer<typeof fieldSchema>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Un record de **reference data** de un object: su mapa de `properties` (valores por slug de field).
|
|
41
|
+
* La clave de negocio (el field `isUnique`) debe venir en `properties` — es lo que identifica el
|
|
42
|
+
* record entre `apply`s (la reconciliación managed casa por esa clave).
|
|
43
|
+
*/
|
|
44
|
+
declare const referenceRecordSchema: z.ZodObject<{
|
|
45
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
type ReferenceRecord = z.infer<typeof referenceRecordSchema>;
|
|
48
|
+
/**
|
|
49
|
+
* Un object del diccionario. Declarar `fields` es autoritativo (los no declarados se archivan);
|
|
50
|
+
* omitirlo deja los campos sin gestionar. `reference` reconcilia los records de configuración/
|
|
51
|
+
* clasificación del object (managed/desired-state por la clave de negocio).
|
|
52
|
+
*
|
|
53
|
+
* `manageability` es READ-ONLY (lo emite `pull`); el planner lo ignora al aplicar.
|
|
54
|
+
*/
|
|
55
|
+
declare const objectSchema: z.ZodObject<{
|
|
56
|
+
apiName: z.ZodString;
|
|
57
|
+
title: z.ZodOptional<z.ZodString>;
|
|
58
|
+
titleSingular: z.ZodOptional<z.ZodString>;
|
|
59
|
+
description: z.ZodOptional<z.ZodString>;
|
|
60
|
+
synonyms: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
62
|
+
titleFieldApiName: z.ZodOptional<z.ZodString>;
|
|
63
|
+
manageability: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
tenant: "tenant";
|
|
65
|
+
seeded: "seeded";
|
|
66
|
+
system: "system";
|
|
67
|
+
}>>;
|
|
68
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
69
|
+
apiName: z.ZodString;
|
|
70
|
+
title: z.ZodOptional<z.ZodString>;
|
|
71
|
+
description: z.ZodOptional<z.ZodString>;
|
|
72
|
+
synonyms: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
|
+
dataType: z.ZodEnum<{
|
|
74
|
+
number: "number";
|
|
75
|
+
boolean: "boolean";
|
|
76
|
+
text: "text";
|
|
77
|
+
date: "date";
|
|
78
|
+
timestamp: "timestamp";
|
|
79
|
+
select: "select";
|
|
80
|
+
multiselect: "multiselect";
|
|
81
|
+
reference: "reference";
|
|
82
|
+
file: "file";
|
|
83
|
+
formula: "formula";
|
|
84
|
+
rollup: "rollup";
|
|
85
|
+
}>;
|
|
86
|
+
isRequired: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
isUnique: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
isIndexed: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
embedInVector: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
defaultValue: z.ZodOptional<z.ZodUnknown>;
|
|
91
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
92
|
+
}, z.core.$strict>>>;
|
|
93
|
+
reference: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
94
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
95
|
+
}, z.core.$strict>>>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
type ManifestObject = z.infer<typeof objectSchema>;
|
|
98
|
+
|
|
99
|
+
/** Una conexión SSO (SAML/OIDC) con el IdP corporativo. Match por `protocol` (una por org). */
|
|
100
|
+
declare const ssoConnectionSchema: z.ZodObject<{
|
|
101
|
+
protocol: z.ZodEnum<{
|
|
102
|
+
saml: "saml";
|
|
103
|
+
oidc: "oidc";
|
|
104
|
+
}>;
|
|
105
|
+
emailDomain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
idpMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
type ManifestSsoConnection = z.infer<typeof ssoConnectionSchema>;
|
|
110
|
+
/** Un dominio propio de la organización (lifecycle aditivo pending → verifying → active/error). */
|
|
111
|
+
declare const customDomainSchema: z.ZodObject<{
|
|
112
|
+
domain: z.ZodString;
|
|
113
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
114
|
+
error: "error";
|
|
115
|
+
pending: "pending";
|
|
116
|
+
verifying: "verifying";
|
|
117
|
+
active: "active";
|
|
118
|
+
}>>>;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
type ManifestCustomDomain = z.infer<typeof customDomainSchema>;
|
|
121
|
+
/** Una invitación por email a la organización (lifecycle aditivo). */
|
|
122
|
+
declare const invitationSchema: z.ZodObject<{
|
|
123
|
+
email: z.ZodString;
|
|
124
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
type ManifestInvitation = z.infer<typeof invitationSchema>;
|
|
127
|
+
/** Un space de mensajería (agrupa canales). */
|
|
128
|
+
declare const spaceSchema: z.ZodObject<{
|
|
129
|
+
slug: z.ZodString;
|
|
130
|
+
title: z.ZodString;
|
|
131
|
+
topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
type ManifestSpace = z.infer<typeof spaceSchema>;
|
|
135
|
+
/** Un canal de mensajería. */
|
|
136
|
+
declare const channelSchema: z.ZodObject<{
|
|
137
|
+
slug: z.ZodString;
|
|
138
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
|
+
topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
140
|
+
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
141
|
+
isPrivate: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
isBroadcast: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
space: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
initialMembers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
145
|
+
user: z.ZodString;
|
|
146
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
147
|
+
owner: "owner";
|
|
148
|
+
admin: "admin";
|
|
149
|
+
member: "member";
|
|
150
|
+
}>>;
|
|
151
|
+
}, z.core.$strict>>>;
|
|
152
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
153
|
+
handle: z.ZodString;
|
|
154
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
155
|
+
admin: "admin";
|
|
156
|
+
member: "member";
|
|
157
|
+
}>>>;
|
|
158
|
+
}, z.core.$strict>>>;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
type ManifestChannel = z.infer<typeof channelSchema>;
|
|
161
|
+
|
|
162
|
+
/** Un problema de validación legible: `ruta: mensaje` (para el reporte estilo `problems[]` del CLI). */
|
|
163
|
+
interface ValidationProblem {
|
|
164
|
+
path: string;
|
|
165
|
+
message: string;
|
|
166
|
+
}
|
|
167
|
+
type ValidateResult = {
|
|
168
|
+
ok: true;
|
|
169
|
+
manifest: Manifest;
|
|
170
|
+
} | {
|
|
171
|
+
ok: false;
|
|
172
|
+
problems: ValidationProblem[];
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Valida un manifiesto (JSON plano) contra el schema canónico. Devuelve el manifiesto tipado si pasa, o
|
|
176
|
+
* la lista de problemas legibles si no — una UX fail-fast desde una sola definición (Zod).
|
|
177
|
+
*/
|
|
178
|
+
declare function validateManifest(input: unknown): ValidateResult;
|
|
179
|
+
declare function toProblems(error: z.ZodError): ValidationProblem[];
|
|
180
|
+
|
|
181
|
+
export { type Field, Manifest, type ManifestChannel, type ManifestCustomDomain, type ManifestInvitation, type ManifestObject, type ManifestSpace, type ManifestSsoConnection, type ReferenceRecord, type ValidateResult, type ValidationProblem, channelSchema, customDomainSchema, fieldSchema, invitationSchema, objectSchema, referenceRecordSchema, spaceSchema, ssoConnectionSchema, toProblems, validateManifest };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
accountKindEnum,
|
|
3
|
+
agentSchema,
|
|
4
|
+
authoritySourceEnum,
|
|
5
|
+
cardinalityEnum,
|
|
6
|
+
channelSchema,
|
|
7
|
+
customDomainSchema,
|
|
8
|
+
dataTypeEnum,
|
|
9
|
+
derivedDataTypes,
|
|
10
|
+
egressAuthTypeEnum,
|
|
11
|
+
egressConnectionSchema,
|
|
12
|
+
egressStatusEnum,
|
|
13
|
+
fieldSchema,
|
|
14
|
+
formulaResultTypes,
|
|
15
|
+
inputDataTypes,
|
|
16
|
+
invitationSchema,
|
|
17
|
+
isDerivedDataType,
|
|
18
|
+
manageabilityEnum,
|
|
19
|
+
manifestSchema,
|
|
20
|
+
objectSchema,
|
|
21
|
+
optionsDataTypes,
|
|
22
|
+
policyActionEnum,
|
|
23
|
+
policyEffectEnum,
|
|
24
|
+
policySchema,
|
|
25
|
+
privacySchema,
|
|
26
|
+
profileSchema,
|
|
27
|
+
referenceRecordSchema,
|
|
28
|
+
relationshipSchema,
|
|
29
|
+
roleSchema,
|
|
30
|
+
rollupAggregates,
|
|
31
|
+
sectionModeEnum,
|
|
32
|
+
settingsSchema,
|
|
33
|
+
spaceSchema,
|
|
34
|
+
ssoConnectionSchema,
|
|
35
|
+
toProblems,
|
|
36
|
+
transactionSchema,
|
|
37
|
+
transactionStepSchema,
|
|
38
|
+
uniqueIncompatibleDataTypes,
|
|
39
|
+
validateManifest,
|
|
40
|
+
webhookEndpointSchema,
|
|
41
|
+
webhookStatusEnum,
|
|
42
|
+
workflowSchema
|
|
43
|
+
} from "./chunk-NPRLVZEM.js";
|
|
44
|
+
export {
|
|
45
|
+
accountKindEnum,
|
|
46
|
+
agentSchema,
|
|
47
|
+
authoritySourceEnum,
|
|
48
|
+
cardinalityEnum,
|
|
49
|
+
channelSchema,
|
|
50
|
+
customDomainSchema,
|
|
51
|
+
dataTypeEnum,
|
|
52
|
+
derivedDataTypes,
|
|
53
|
+
egressAuthTypeEnum,
|
|
54
|
+
egressConnectionSchema,
|
|
55
|
+
egressStatusEnum,
|
|
56
|
+
fieldSchema,
|
|
57
|
+
formulaResultTypes,
|
|
58
|
+
inputDataTypes,
|
|
59
|
+
invitationSchema,
|
|
60
|
+
isDerivedDataType,
|
|
61
|
+
manageabilityEnum,
|
|
62
|
+
manifestSchema,
|
|
63
|
+
objectSchema,
|
|
64
|
+
optionsDataTypes,
|
|
65
|
+
policyActionEnum,
|
|
66
|
+
policyEffectEnum,
|
|
67
|
+
policySchema,
|
|
68
|
+
privacySchema,
|
|
69
|
+
profileSchema,
|
|
70
|
+
referenceRecordSchema,
|
|
71
|
+
relationshipSchema,
|
|
72
|
+
roleSchema,
|
|
73
|
+
rollupAggregates,
|
|
74
|
+
sectionModeEnum,
|
|
75
|
+
settingsSchema,
|
|
76
|
+
spaceSchema,
|
|
77
|
+
ssoConnectionSchema,
|
|
78
|
+
toProblems,
|
|
79
|
+
transactionSchema,
|
|
80
|
+
transactionStepSchema,
|
|
81
|
+
uniqueIncompatibleDataTypes,
|
|
82
|
+
validateManifest,
|
|
83
|
+
webhookEndpointSchema,
|
|
84
|
+
webhookStatusEnum,
|
|
85
|
+
workflowSchema
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|