@elevasis/core 0.31.0 → 0.33.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/auth/index.d.ts +60 -2
- package/dist/auth/index.js +7 -0
- package/dist/index.d.ts +15 -3
- package/dist/index.js +69 -4
- package/dist/knowledge/index.d.ts +10 -2
- package/dist/organization-model/index.d.ts +15 -3
- package/dist/organization-model/index.js +69 -4
- package/dist/test-utils/index.d.ts +55 -2
- package/dist/test-utils/index.js +69 -4
- package/package.json +1 -1
- package/src/auth/__tests__/access-keys.test.ts +16 -0
- package/src/auth/__tests__/access-model.test.ts +31 -0
- package/src/auth/access-keys.ts +1 -0
- package/src/auth/multi-tenancy/permissions.ts +19 -13
- package/src/organization-model/__tests__/define-domain-record.test.ts +31 -34
- package/src/organization-model/__tests__/domains/passthrough-extensibility.test.ts +199 -0
- package/src/organization-model/domains/branding.ts +58 -16
- package/src/organization-model/domains/identity.ts +122 -94
- package/src/supabase/database.types.ts +45 -0
package/dist/auth/index.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ declare const PERMISSIONS: {
|
|
|
123
123
|
readonly SECRETS_MANAGE: "secrets.manage";
|
|
124
124
|
readonly OPERATIONS_READ: "operations.read";
|
|
125
125
|
readonly OPERATIONS_MANAGE: "operations.manage";
|
|
126
|
+
readonly SALES_LEAD_GEN_MANAGE: "sales.lead-gen.manage";
|
|
126
127
|
readonly ACQUISITION_MANAGE: "acquisition.manage";
|
|
127
128
|
readonly PROJECTS_MANAGE: "projects.manage";
|
|
128
129
|
readonly CLIENTS_MANAGE: "clients.manage";
|
|
@@ -2153,6 +2154,51 @@ type Database = {
|
|
|
2153
2154
|
}
|
|
2154
2155
|
];
|
|
2155
2156
|
};
|
|
2157
|
+
deployment_organization_models: {
|
|
2158
|
+
Row: {
|
|
2159
|
+
created_at: string;
|
|
2160
|
+
deployment_id: string;
|
|
2161
|
+
model_hash: string | null;
|
|
2162
|
+
organization_id: string;
|
|
2163
|
+
organization_model: Json;
|
|
2164
|
+
schema_version: string;
|
|
2165
|
+
updated_at: string;
|
|
2166
|
+
};
|
|
2167
|
+
Insert: {
|
|
2168
|
+
created_at?: string;
|
|
2169
|
+
deployment_id: string;
|
|
2170
|
+
model_hash?: string | null;
|
|
2171
|
+
organization_id: string;
|
|
2172
|
+
organization_model: Json;
|
|
2173
|
+
schema_version?: string;
|
|
2174
|
+
updated_at?: string;
|
|
2175
|
+
};
|
|
2176
|
+
Update: {
|
|
2177
|
+
created_at?: string;
|
|
2178
|
+
deployment_id?: string;
|
|
2179
|
+
model_hash?: string | null;
|
|
2180
|
+
organization_id?: string;
|
|
2181
|
+
organization_model?: Json;
|
|
2182
|
+
schema_version?: string;
|
|
2183
|
+
updated_at?: string;
|
|
2184
|
+
};
|
|
2185
|
+
Relationships: [
|
|
2186
|
+
{
|
|
2187
|
+
foreignKeyName: "deployment_organization_models_deployment_id_fkey";
|
|
2188
|
+
columns: ["deployment_id"];
|
|
2189
|
+
isOneToOne: true;
|
|
2190
|
+
referencedRelation: "deployments";
|
|
2191
|
+
referencedColumns: ["id"];
|
|
2192
|
+
},
|
|
2193
|
+
{
|
|
2194
|
+
foreignKeyName: "deployment_organization_models_organization_id_fkey";
|
|
2195
|
+
columns: ["organization_id"];
|
|
2196
|
+
isOneToOne: false;
|
|
2197
|
+
referencedRelation: "organizations";
|
|
2198
|
+
referencedColumns: ["id"];
|
|
2199
|
+
}
|
|
2200
|
+
];
|
|
2201
|
+
};
|
|
2156
2202
|
deployments: {
|
|
2157
2203
|
Row: {
|
|
2158
2204
|
created_at: string;
|
|
@@ -4399,7 +4445,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4399
4445
|
light: z.ZodOptional<z.ZodString>;
|
|
4400
4446
|
dark: z.ZodOptional<z.ZodString>;
|
|
4401
4447
|
}, z.core.$strip>>;
|
|
4402
|
-
|
|
4448
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
4449
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
4450
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4451
|
+
themePresetId: z.ZodOptional<z.ZodString>;
|
|
4452
|
+
}, z.core.$loose>>;
|
|
4403
4453
|
navigation: z.ZodDefault<z.ZodObject<{
|
|
4404
4454
|
sidebar: z.ZodDefault<z.ZodObject<{
|
|
4405
4455
|
primary: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SidebarNode, unknown, z.core.$ZodTypeInternals<SidebarNode, unknown>>>>;
|
|
@@ -4446,7 +4496,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4446
4496
|
}, z.core.$strip>>;
|
|
4447
4497
|
}, z.core.$strip>>;
|
|
4448
4498
|
clientBrief: z.ZodDefault<z.ZodString>;
|
|
4449
|
-
|
|
4499
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
4500
|
+
productName: z.ZodOptional<z.ZodString>;
|
|
4501
|
+
shortName: z.ZodOptional<z.ZodString>;
|
|
4502
|
+
description: z.ZodOptional<z.ZodString>;
|
|
4503
|
+
}, z.core.$loose>>;
|
|
4450
4504
|
customers: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4451
4505
|
id: z.ZodString;
|
|
4452
4506
|
order: z.ZodNumber;
|
|
@@ -5209,6 +5263,10 @@ declare const AccessKeys: {
|
|
|
5209
5263
|
readonly systemPath: "permission.operations";
|
|
5210
5264
|
readonly action: "manage";
|
|
5211
5265
|
};
|
|
5266
|
+
readonly leadGenManage: {
|
|
5267
|
+
readonly systemPath: "sales.lead-gen";
|
|
5268
|
+
readonly action: "manage";
|
|
5269
|
+
};
|
|
5212
5270
|
readonly acquisitionManage: {
|
|
5213
5271
|
readonly systemPath: "permission.acquisition";
|
|
5214
5272
|
readonly action: "manage";
|
package/dist/auth/index.js
CHANGED
|
@@ -35,6 +35,7 @@ var PERMISSIONS = {
|
|
|
35
35
|
SECRETS_MANAGE: "secrets.manage",
|
|
36
36
|
OPERATIONS_READ: "operations.read",
|
|
37
37
|
OPERATIONS_MANAGE: "operations.manage",
|
|
38
|
+
SALES_LEAD_GEN_MANAGE: "sales.lead-gen.manage",
|
|
38
39
|
ACQUISITION_MANAGE: "acquisition.manage",
|
|
39
40
|
PROJECTS_MANAGE: "projects.manage",
|
|
40
41
|
CLIENTS_MANAGE: "clients.manage"
|
|
@@ -80,6 +81,11 @@ var PERMISSION_CATALOG = [
|
|
|
80
81
|
description: "Run and modify executions, sessions, schedules, queue",
|
|
81
82
|
isOrgGrantable: true
|
|
82
83
|
},
|
|
84
|
+
{
|
|
85
|
+
key: "sales.lead-gen.manage",
|
|
86
|
+
description: "Operate Lead Gen lists and list-builder workflows",
|
|
87
|
+
isOrgGrantable: true
|
|
88
|
+
},
|
|
83
89
|
{
|
|
84
90
|
key: "acquisition.manage",
|
|
85
91
|
description: "Create, update, and delete acquisition records (acq_companies, acq_contacts, acq_deals, acq_lists*, acq_content*, acquisition storage files)",
|
|
@@ -421,6 +427,7 @@ var AccessKeys = {
|
|
|
421
427
|
secretsManage: { systemPath: "permission.secrets", action: "manage" },
|
|
422
428
|
operationsRead: { systemPath: "permission.operations", action: DEFAULT_ACCESS_ACTION },
|
|
423
429
|
operationsManage: { systemPath: "permission.operations", action: "manage" },
|
|
430
|
+
leadGenManage: { systemPath: "sales.lead-gen", action: "manage" },
|
|
424
431
|
acquisitionManage: { systemPath: "permission.acquisition", action: "manage" },
|
|
425
432
|
projectsManage: { systemPath: "permission.projects", action: "manage" },
|
|
426
433
|
clientsManage: { systemPath: "permission.clients", action: "manage" },
|
package/dist/index.d.ts
CHANGED
|
@@ -321,7 +321,11 @@ declare const OrganizationModelBrandingSchema: z.ZodObject<{
|
|
|
321
321
|
light: z.ZodOptional<z.ZodString>;
|
|
322
322
|
dark: z.ZodOptional<z.ZodString>;
|
|
323
323
|
}, z.core.$strip>>;
|
|
324
|
-
|
|
324
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
325
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
326
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
327
|
+
themePresetId: z.ZodOptional<z.ZodString>;
|
|
328
|
+
}, z.core.$loose>;
|
|
325
329
|
|
|
326
330
|
/** One entry in the lead-gen stage catalog. */
|
|
327
331
|
interface LeadGenStageCatalogEntry {
|
|
@@ -4067,7 +4071,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4067
4071
|
light: z.ZodOptional<z.ZodString>;
|
|
4068
4072
|
dark: z.ZodOptional<z.ZodString>;
|
|
4069
4073
|
}, z.core.$strip>>;
|
|
4070
|
-
|
|
4074
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
4075
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
4076
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4077
|
+
themePresetId: z.ZodOptional<z.ZodString>;
|
|
4078
|
+
}, z.core.$loose>>;
|
|
4071
4079
|
navigation: z.ZodDefault<z.ZodObject<{
|
|
4072
4080
|
sidebar: z.ZodDefault<z.ZodObject<{
|
|
4073
4081
|
primary: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SidebarNode, unknown, z.core.$ZodTypeInternals<SidebarNode, unknown>>>>;
|
|
@@ -4114,7 +4122,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4114
4122
|
}, z.core.$strip>>;
|
|
4115
4123
|
}, z.core.$strip>>;
|
|
4116
4124
|
clientBrief: z.ZodDefault<z.ZodString>;
|
|
4117
|
-
|
|
4125
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
4126
|
+
productName: z.ZodOptional<z.ZodString>;
|
|
4127
|
+
shortName: z.ZodOptional<z.ZodString>;
|
|
4128
|
+
description: z.ZodOptional<z.ZodString>;
|
|
4129
|
+
}, z.core.$loose>>;
|
|
4118
4130
|
customers: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4119
4131
|
id: z.ZodString;
|
|
4120
4132
|
order: z.ZodNumber;
|
package/dist/index.js
CHANGED
|
@@ -494,15 +494,55 @@ DisplayMetadataSchema.extend({
|
|
|
494
494
|
|
|
495
495
|
// src/organization-model/domains/branding.ts
|
|
496
496
|
var OrganizationModelBrandingSchema = z.object({
|
|
497
|
+
/**
|
|
498
|
+
* @deprecated Prefer `identity.organizationName`; branding retains it for back-compat.
|
|
499
|
+
* Legacy tenants that have not set `identity.organizationName` fall back to this field.
|
|
500
|
+
*/
|
|
497
501
|
organizationName: LabelSchema,
|
|
502
|
+
/**
|
|
503
|
+
* @deprecated Prefer `identity.productName`; branding retains it for back-compat.
|
|
504
|
+
* Legacy tenants that have not set `identity.productName` fall back to this field.
|
|
505
|
+
*/
|
|
498
506
|
productName: LabelSchema,
|
|
507
|
+
/**
|
|
508
|
+
* @deprecated Prefer `identity.shortName`; branding retains it for back-compat.
|
|
509
|
+
* Legacy tenants that have not set `identity.shortName` fall back to this field.
|
|
510
|
+
*/
|
|
499
511
|
shortName: z.string().trim().min(1).max(40),
|
|
512
|
+
/**
|
|
513
|
+
* @deprecated Prefer `identity.description`; branding retains it for back-compat.
|
|
514
|
+
* Legacy tenants that have not set `identity.description` fall back to this field.
|
|
515
|
+
*/
|
|
500
516
|
description: DescriptionSchema.optional(),
|
|
501
517
|
logos: z.object({
|
|
502
518
|
light: z.string().trim().min(1).max(2048).optional(),
|
|
503
519
|
dark: z.string().trim().min(1).max(2048).optional()
|
|
504
|
-
}).default({})
|
|
505
|
-
|
|
520
|
+
}).default({}),
|
|
521
|
+
/**
|
|
522
|
+
* Brand voice — how the organization communicates. Plain-language description
|
|
523
|
+
* of tone, register, and personality (e.g. "Direct and human — no jargon").
|
|
524
|
+
* Max 280 characters.
|
|
525
|
+
*/
|
|
526
|
+
voice: z.string().trim().max(280).optional(),
|
|
527
|
+
/**
|
|
528
|
+
* Brand tagline or positioning statement — the memorable one-liner that
|
|
529
|
+
* captures the brand's promise or differentiator. Max 200 characters.
|
|
530
|
+
*/
|
|
531
|
+
tagline: z.string().trim().max(200).optional(),
|
|
532
|
+
/**
|
|
533
|
+
* Core brand values — an ordered list of principles the organization stands
|
|
534
|
+
* for (e.g. ["Transparency", "Craftsmanship", "Velocity"]). Each entry must
|
|
535
|
+
* be a non-empty trimmed string.
|
|
536
|
+
*/
|
|
537
|
+
values: z.array(z.string().trim().min(1)).optional(),
|
|
538
|
+
/**
|
|
539
|
+
* ID of the active UI theme preset from the UI theme-presets registry.
|
|
540
|
+
* The UI layer resolves this to colors and typography via `usePresetsContext()`.
|
|
541
|
+
* Free-form string — validation and fallback state are handled at the UI layer.
|
|
542
|
+
* Min 1, max 64 characters.
|
|
543
|
+
*/
|
|
544
|
+
themePresetId: z.string().trim().min(1).max(64).optional()
|
|
545
|
+
}).passthrough();
|
|
506
546
|
var DEFAULT_ORGANIZATION_MODEL_BRANDING = {
|
|
507
547
|
organizationName: "Default Organization",
|
|
508
548
|
productName: "Organization OS",
|
|
@@ -633,8 +673,33 @@ var IdentityDomainSchema = z.object({
|
|
|
633
673
|
* background. Populated by /setup; surfaced to agents as organizational context.
|
|
634
674
|
* Optional — many projects have no external client.
|
|
635
675
|
*/
|
|
636
|
-
clientBrief: z.string().trim().default("")
|
|
637
|
-
|
|
676
|
+
clientBrief: z.string().trim().default(""),
|
|
677
|
+
/**
|
|
678
|
+
* Display name of the organization as shown to end users.
|
|
679
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
680
|
+
* `branding.organizationName`. Falls back to `branding.organizationName` for
|
|
681
|
+
* legacy tenants that have not yet migrated.
|
|
682
|
+
*/
|
|
683
|
+
organizationName: LabelSchema.optional(),
|
|
684
|
+
/**
|
|
685
|
+
* Display name of the primary product or platform.
|
|
686
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
687
|
+
* `branding.productName`. Falls back to `branding.productName` for legacy tenants.
|
|
688
|
+
*/
|
|
689
|
+
productName: LabelSchema.optional(),
|
|
690
|
+
/**
|
|
691
|
+
* Short abbreviated name used in space-constrained UI surfaces (max 40 chars).
|
|
692
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
693
|
+
* `branding.shortName`. Falls back to `branding.shortName` for legacy tenants.
|
|
694
|
+
*/
|
|
695
|
+
shortName: z.string().trim().min(1).max(40).optional(),
|
|
696
|
+
/**
|
|
697
|
+
* Plain-language description of the organization for display and discovery.
|
|
698
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
699
|
+
* `branding.description`. Falls back to `branding.description` for legacy tenants.
|
|
700
|
+
*/
|
|
701
|
+
description: DescriptionSchema.optional()
|
|
702
|
+
}).passthrough();
|
|
638
703
|
var DEFAULT_ORGANIZATION_MODEL_IDENTITY = {
|
|
639
704
|
mission: "",
|
|
640
705
|
vision: "",
|
|
@@ -537,7 +537,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
537
537
|
light: z.ZodOptional<z.ZodString>;
|
|
538
538
|
dark: z.ZodOptional<z.ZodString>;
|
|
539
539
|
}, z.core.$strip>>;
|
|
540
|
-
|
|
540
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
541
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
542
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
543
|
+
themePresetId: z.ZodOptional<z.ZodString>;
|
|
544
|
+
}, z.core.$loose>>;
|
|
541
545
|
navigation: z.ZodDefault<z.ZodObject<{
|
|
542
546
|
sidebar: z.ZodDefault<z.ZodObject<{
|
|
543
547
|
primary: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SidebarNode, unknown, z.core.$ZodTypeInternals<SidebarNode, unknown>>>>;
|
|
@@ -584,7 +588,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
584
588
|
}, z.core.$strip>>;
|
|
585
589
|
}, z.core.$strip>>;
|
|
586
590
|
clientBrief: z.ZodDefault<z.ZodString>;
|
|
587
|
-
|
|
591
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
592
|
+
productName: z.ZodOptional<z.ZodString>;
|
|
593
|
+
shortName: z.ZodOptional<z.ZodString>;
|
|
594
|
+
description: z.ZodOptional<z.ZodString>;
|
|
595
|
+
}, z.core.$loose>>;
|
|
588
596
|
customers: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
589
597
|
id: z.ZodString;
|
|
590
598
|
order: z.ZodNumber;
|
|
@@ -321,7 +321,11 @@ declare const OrganizationModelBrandingSchema: z.ZodObject<{
|
|
|
321
321
|
light: z.ZodOptional<z.ZodString>;
|
|
322
322
|
dark: z.ZodOptional<z.ZodString>;
|
|
323
323
|
}, z.core.$strip>>;
|
|
324
|
-
|
|
324
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
325
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
326
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
327
|
+
themePresetId: z.ZodOptional<z.ZodString>;
|
|
328
|
+
}, z.core.$loose>;
|
|
325
329
|
|
|
326
330
|
/** One entry in the lead-gen stage catalog. */
|
|
327
331
|
interface LeadGenStageCatalogEntry {
|
|
@@ -4067,7 +4071,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4067
4071
|
light: z.ZodOptional<z.ZodString>;
|
|
4068
4072
|
dark: z.ZodOptional<z.ZodString>;
|
|
4069
4073
|
}, z.core.$strip>>;
|
|
4070
|
-
|
|
4074
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
4075
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
4076
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4077
|
+
themePresetId: z.ZodOptional<z.ZodString>;
|
|
4078
|
+
}, z.core.$loose>>;
|
|
4071
4079
|
navigation: z.ZodDefault<z.ZodObject<{
|
|
4072
4080
|
sidebar: z.ZodDefault<z.ZodObject<{
|
|
4073
4081
|
primary: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SidebarNode, unknown, z.core.$ZodTypeInternals<SidebarNode, unknown>>>>;
|
|
@@ -4114,7 +4122,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4114
4122
|
}, z.core.$strip>>;
|
|
4115
4123
|
}, z.core.$strip>>;
|
|
4116
4124
|
clientBrief: z.ZodDefault<z.ZodString>;
|
|
4117
|
-
|
|
4125
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
4126
|
+
productName: z.ZodOptional<z.ZodString>;
|
|
4127
|
+
shortName: z.ZodOptional<z.ZodString>;
|
|
4128
|
+
description: z.ZodOptional<z.ZodString>;
|
|
4129
|
+
}, z.core.$loose>>;
|
|
4118
4130
|
customers: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4119
4131
|
id: z.ZodString;
|
|
4120
4132
|
order: z.ZodNumber;
|
|
@@ -494,15 +494,55 @@ DisplayMetadataSchema.extend({
|
|
|
494
494
|
|
|
495
495
|
// src/organization-model/domains/branding.ts
|
|
496
496
|
var OrganizationModelBrandingSchema = z.object({
|
|
497
|
+
/**
|
|
498
|
+
* @deprecated Prefer `identity.organizationName`; branding retains it for back-compat.
|
|
499
|
+
* Legacy tenants that have not set `identity.organizationName` fall back to this field.
|
|
500
|
+
*/
|
|
497
501
|
organizationName: LabelSchema,
|
|
502
|
+
/**
|
|
503
|
+
* @deprecated Prefer `identity.productName`; branding retains it for back-compat.
|
|
504
|
+
* Legacy tenants that have not set `identity.productName` fall back to this field.
|
|
505
|
+
*/
|
|
498
506
|
productName: LabelSchema,
|
|
507
|
+
/**
|
|
508
|
+
* @deprecated Prefer `identity.shortName`; branding retains it for back-compat.
|
|
509
|
+
* Legacy tenants that have not set `identity.shortName` fall back to this field.
|
|
510
|
+
*/
|
|
499
511
|
shortName: z.string().trim().min(1).max(40),
|
|
512
|
+
/**
|
|
513
|
+
* @deprecated Prefer `identity.description`; branding retains it for back-compat.
|
|
514
|
+
* Legacy tenants that have not set `identity.description` fall back to this field.
|
|
515
|
+
*/
|
|
500
516
|
description: DescriptionSchema.optional(),
|
|
501
517
|
logos: z.object({
|
|
502
518
|
light: z.string().trim().min(1).max(2048).optional(),
|
|
503
519
|
dark: z.string().trim().min(1).max(2048).optional()
|
|
504
|
-
}).default({})
|
|
505
|
-
|
|
520
|
+
}).default({}),
|
|
521
|
+
/**
|
|
522
|
+
* Brand voice — how the organization communicates. Plain-language description
|
|
523
|
+
* of tone, register, and personality (e.g. "Direct and human — no jargon").
|
|
524
|
+
* Max 280 characters.
|
|
525
|
+
*/
|
|
526
|
+
voice: z.string().trim().max(280).optional(),
|
|
527
|
+
/**
|
|
528
|
+
* Brand tagline or positioning statement — the memorable one-liner that
|
|
529
|
+
* captures the brand's promise or differentiator. Max 200 characters.
|
|
530
|
+
*/
|
|
531
|
+
tagline: z.string().trim().max(200).optional(),
|
|
532
|
+
/**
|
|
533
|
+
* Core brand values — an ordered list of principles the organization stands
|
|
534
|
+
* for (e.g. ["Transparency", "Craftsmanship", "Velocity"]). Each entry must
|
|
535
|
+
* be a non-empty trimmed string.
|
|
536
|
+
*/
|
|
537
|
+
values: z.array(z.string().trim().min(1)).optional(),
|
|
538
|
+
/**
|
|
539
|
+
* ID of the active UI theme preset from the UI theme-presets registry.
|
|
540
|
+
* The UI layer resolves this to colors and typography via `usePresetsContext()`.
|
|
541
|
+
* Free-form string — validation and fallback state are handled at the UI layer.
|
|
542
|
+
* Min 1, max 64 characters.
|
|
543
|
+
*/
|
|
544
|
+
themePresetId: z.string().trim().min(1).max(64).optional()
|
|
545
|
+
}).passthrough();
|
|
506
546
|
var DEFAULT_ORGANIZATION_MODEL_BRANDING = {
|
|
507
547
|
organizationName: "Default Organization",
|
|
508
548
|
productName: "Organization OS",
|
|
@@ -633,8 +673,33 @@ var IdentityDomainSchema = z.object({
|
|
|
633
673
|
* background. Populated by /setup; surfaced to agents as organizational context.
|
|
634
674
|
* Optional — many projects have no external client.
|
|
635
675
|
*/
|
|
636
|
-
clientBrief: z.string().trim().default("")
|
|
637
|
-
|
|
676
|
+
clientBrief: z.string().trim().default(""),
|
|
677
|
+
/**
|
|
678
|
+
* Display name of the organization as shown to end users.
|
|
679
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
680
|
+
* `branding.organizationName`. Falls back to `branding.organizationName` for
|
|
681
|
+
* legacy tenants that have not yet migrated.
|
|
682
|
+
*/
|
|
683
|
+
organizationName: LabelSchema.optional(),
|
|
684
|
+
/**
|
|
685
|
+
* Display name of the primary product or platform.
|
|
686
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
687
|
+
* `branding.productName`. Falls back to `branding.productName` for legacy tenants.
|
|
688
|
+
*/
|
|
689
|
+
productName: LabelSchema.optional(),
|
|
690
|
+
/**
|
|
691
|
+
* Short abbreviated name used in space-constrained UI surfaces (max 40 chars).
|
|
692
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
693
|
+
* `branding.shortName`. Falls back to `branding.shortName` for legacy tenants.
|
|
694
|
+
*/
|
|
695
|
+
shortName: z.string().trim().min(1).max(40).optional(),
|
|
696
|
+
/**
|
|
697
|
+
* Plain-language description of the organization for display and discovery.
|
|
698
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
699
|
+
* `branding.description`. Falls back to `branding.description` for legacy tenants.
|
|
700
|
+
*/
|
|
701
|
+
description: DescriptionSchema.optional()
|
|
702
|
+
}).passthrough();
|
|
638
703
|
var DEFAULT_ORGANIZATION_MODEL_IDENTITY = {
|
|
639
704
|
mission: "",
|
|
640
705
|
vision: "",
|
|
@@ -1464,6 +1464,51 @@ type Database = {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
];
|
|
1466
1466
|
};
|
|
1467
|
+
deployment_organization_models: {
|
|
1468
|
+
Row: {
|
|
1469
|
+
created_at: string;
|
|
1470
|
+
deployment_id: string;
|
|
1471
|
+
model_hash: string | null;
|
|
1472
|
+
organization_id: string;
|
|
1473
|
+
organization_model: Json;
|
|
1474
|
+
schema_version: string;
|
|
1475
|
+
updated_at: string;
|
|
1476
|
+
};
|
|
1477
|
+
Insert: {
|
|
1478
|
+
created_at?: string;
|
|
1479
|
+
deployment_id: string;
|
|
1480
|
+
model_hash?: string | null;
|
|
1481
|
+
organization_id: string;
|
|
1482
|
+
organization_model: Json;
|
|
1483
|
+
schema_version?: string;
|
|
1484
|
+
updated_at?: string;
|
|
1485
|
+
};
|
|
1486
|
+
Update: {
|
|
1487
|
+
created_at?: string;
|
|
1488
|
+
deployment_id?: string;
|
|
1489
|
+
model_hash?: string | null;
|
|
1490
|
+
organization_id?: string;
|
|
1491
|
+
organization_model?: Json;
|
|
1492
|
+
schema_version?: string;
|
|
1493
|
+
updated_at?: string;
|
|
1494
|
+
};
|
|
1495
|
+
Relationships: [
|
|
1496
|
+
{
|
|
1497
|
+
foreignKeyName: "deployment_organization_models_deployment_id_fkey";
|
|
1498
|
+
columns: ["deployment_id"];
|
|
1499
|
+
isOneToOne: true;
|
|
1500
|
+
referencedRelation: "deployments";
|
|
1501
|
+
referencedColumns: ["id"];
|
|
1502
|
+
},
|
|
1503
|
+
{
|
|
1504
|
+
foreignKeyName: "deployment_organization_models_organization_id_fkey";
|
|
1505
|
+
columns: ["organization_id"];
|
|
1506
|
+
isOneToOne: false;
|
|
1507
|
+
referencedRelation: "organizations";
|
|
1508
|
+
referencedColumns: ["id"];
|
|
1509
|
+
}
|
|
1510
|
+
];
|
|
1511
|
+
};
|
|
1467
1512
|
deployments: {
|
|
1468
1513
|
Row: {
|
|
1469
1514
|
created_at: string;
|
|
@@ -3961,7 +4006,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
3961
4006
|
light: z.ZodOptional<z.ZodString>;
|
|
3962
4007
|
dark: z.ZodOptional<z.ZodString>;
|
|
3963
4008
|
}, z.core.$strip>>;
|
|
3964
|
-
|
|
4009
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
4010
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
4011
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4012
|
+
themePresetId: z.ZodOptional<z.ZodString>;
|
|
4013
|
+
}, z.core.$loose>>;
|
|
3965
4014
|
navigation: z.ZodDefault<z.ZodObject<{
|
|
3966
4015
|
sidebar: z.ZodDefault<z.ZodObject<{
|
|
3967
4016
|
primary: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SidebarNode, unknown, z.core.$ZodTypeInternals<SidebarNode, unknown>>>>;
|
|
@@ -4008,7 +4057,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4008
4057
|
}, z.core.$strip>>;
|
|
4009
4058
|
}, z.core.$strip>>;
|
|
4010
4059
|
clientBrief: z.ZodDefault<z.ZodString>;
|
|
4011
|
-
|
|
4060
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
4061
|
+
productName: z.ZodOptional<z.ZodString>;
|
|
4062
|
+
shortName: z.ZodOptional<z.ZodString>;
|
|
4063
|
+
description: z.ZodOptional<z.ZodString>;
|
|
4064
|
+
}, z.core.$loose>>;
|
|
4012
4065
|
customers: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4013
4066
|
id: z.ZodString;
|
|
4014
4067
|
order: z.ZodNumber;
|
package/dist/test-utils/index.js
CHANGED
|
@@ -19895,15 +19895,55 @@ DisplayMetadataSchema.extend({
|
|
|
19895
19895
|
|
|
19896
19896
|
// src/organization-model/domains/branding.ts
|
|
19897
19897
|
var OrganizationModelBrandingSchema = z.object({
|
|
19898
|
+
/**
|
|
19899
|
+
* @deprecated Prefer `identity.organizationName`; branding retains it for back-compat.
|
|
19900
|
+
* Legacy tenants that have not set `identity.organizationName` fall back to this field.
|
|
19901
|
+
*/
|
|
19898
19902
|
organizationName: LabelSchema,
|
|
19903
|
+
/**
|
|
19904
|
+
* @deprecated Prefer `identity.productName`; branding retains it for back-compat.
|
|
19905
|
+
* Legacy tenants that have not set `identity.productName` fall back to this field.
|
|
19906
|
+
*/
|
|
19899
19907
|
productName: LabelSchema,
|
|
19908
|
+
/**
|
|
19909
|
+
* @deprecated Prefer `identity.shortName`; branding retains it for back-compat.
|
|
19910
|
+
* Legacy tenants that have not set `identity.shortName` fall back to this field.
|
|
19911
|
+
*/
|
|
19900
19912
|
shortName: z.string().trim().min(1).max(40),
|
|
19913
|
+
/**
|
|
19914
|
+
* @deprecated Prefer `identity.description`; branding retains it for back-compat.
|
|
19915
|
+
* Legacy tenants that have not set `identity.description` fall back to this field.
|
|
19916
|
+
*/
|
|
19901
19917
|
description: DescriptionSchema.optional(),
|
|
19902
19918
|
logos: z.object({
|
|
19903
19919
|
light: z.string().trim().min(1).max(2048).optional(),
|
|
19904
19920
|
dark: z.string().trim().min(1).max(2048).optional()
|
|
19905
|
-
}).default({})
|
|
19906
|
-
|
|
19921
|
+
}).default({}),
|
|
19922
|
+
/**
|
|
19923
|
+
* Brand voice — how the organization communicates. Plain-language description
|
|
19924
|
+
* of tone, register, and personality (e.g. "Direct and human — no jargon").
|
|
19925
|
+
* Max 280 characters.
|
|
19926
|
+
*/
|
|
19927
|
+
voice: z.string().trim().max(280).optional(),
|
|
19928
|
+
/**
|
|
19929
|
+
* Brand tagline or positioning statement — the memorable one-liner that
|
|
19930
|
+
* captures the brand's promise or differentiator. Max 200 characters.
|
|
19931
|
+
*/
|
|
19932
|
+
tagline: z.string().trim().max(200).optional(),
|
|
19933
|
+
/**
|
|
19934
|
+
* Core brand values — an ordered list of principles the organization stands
|
|
19935
|
+
* for (e.g. ["Transparency", "Craftsmanship", "Velocity"]). Each entry must
|
|
19936
|
+
* be a non-empty trimmed string.
|
|
19937
|
+
*/
|
|
19938
|
+
values: z.array(z.string().trim().min(1)).optional(),
|
|
19939
|
+
/**
|
|
19940
|
+
* ID of the active UI theme preset from the UI theme-presets registry.
|
|
19941
|
+
* The UI layer resolves this to colors and typography via `usePresetsContext()`.
|
|
19942
|
+
* Free-form string — validation and fallback state are handled at the UI layer.
|
|
19943
|
+
* Min 1, max 64 characters.
|
|
19944
|
+
*/
|
|
19945
|
+
themePresetId: z.string().trim().min(1).max(64).optional()
|
|
19946
|
+
}).passthrough();
|
|
19907
19947
|
var DEFAULT_ORGANIZATION_MODEL_BRANDING = {
|
|
19908
19948
|
organizationName: "Default Organization",
|
|
19909
19949
|
productName: "Organization OS",
|
|
@@ -20022,8 +20062,33 @@ var IdentityDomainSchema = z.object({
|
|
|
20022
20062
|
* background. Populated by /setup; surfaced to agents as organizational context.
|
|
20023
20063
|
* Optional — many projects have no external client.
|
|
20024
20064
|
*/
|
|
20025
|
-
clientBrief: z.string().trim().default("")
|
|
20026
|
-
|
|
20065
|
+
clientBrief: z.string().trim().default(""),
|
|
20066
|
+
/**
|
|
20067
|
+
* Display name of the organization as shown to end users.
|
|
20068
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
20069
|
+
* `branding.organizationName`. Falls back to `branding.organizationName` for
|
|
20070
|
+
* legacy tenants that have not yet migrated.
|
|
20071
|
+
*/
|
|
20072
|
+
organizationName: LabelSchema.optional(),
|
|
20073
|
+
/**
|
|
20074
|
+
* Display name of the primary product or platform.
|
|
20075
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
20076
|
+
* `branding.productName`. Falls back to `branding.productName` for legacy tenants.
|
|
20077
|
+
*/
|
|
20078
|
+
productName: LabelSchema.optional(),
|
|
20079
|
+
/**
|
|
20080
|
+
* Short abbreviated name used in space-constrained UI surfaces (max 40 chars).
|
|
20081
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
20082
|
+
* `branding.shortName`. Falls back to `branding.shortName` for legacy tenants.
|
|
20083
|
+
*/
|
|
20084
|
+
shortName: z.string().trim().min(1).max(40).optional(),
|
|
20085
|
+
/**
|
|
20086
|
+
* Plain-language description of the organization for display and discovery.
|
|
20087
|
+
* Recommended placement for display naming — prefer this over the deprecated
|
|
20088
|
+
* `branding.description`. Falls back to `branding.description` for legacy tenants.
|
|
20089
|
+
*/
|
|
20090
|
+
description: DescriptionSchema.optional()
|
|
20091
|
+
}).passthrough();
|
|
20027
20092
|
var DEFAULT_ORGANIZATION_MODEL_IDENTITY = {
|
|
20028
20093
|
mission: "",
|
|
20029
20094
|
vision: "",
|
package/package.json
CHANGED
|
@@ -23,6 +23,12 @@ const model = {
|
|
|
23
23
|
label: 'CRM',
|
|
24
24
|
lifecycle: 'active',
|
|
25
25
|
order: 10
|
|
26
|
+
},
|
|
27
|
+
'lead-gen': {
|
|
28
|
+
id: 'lead-gen',
|
|
29
|
+
label: 'Lead Gen',
|
|
30
|
+
lifecycle: 'active',
|
|
31
|
+
order: 20
|
|
26
32
|
}
|
|
27
33
|
}
|
|
28
34
|
},
|
|
@@ -53,6 +59,7 @@ describe('access keys', () => {
|
|
|
53
59
|
expect(keys).toContainEqual({ systemPath: 'sales', action: 'view' })
|
|
54
60
|
expect(keys).toContainEqual({ systemPath: 'sales.crm', action: 'view' })
|
|
55
61
|
expect(keys).toContainEqual({ systemPath: 'sales.crm', action: 'manage' })
|
|
62
|
+
expect(keys).toContainEqual(AccessKeys.leadGenManage)
|
|
56
63
|
expect(keys).toContainEqual({ systemPath: 'operations', action: 'manage' })
|
|
57
64
|
})
|
|
58
65
|
|
|
@@ -78,4 +85,13 @@ describe('access keys', () => {
|
|
|
78
85
|
rolePermission: 'members.manage'
|
|
79
86
|
})
|
|
80
87
|
})
|
|
88
|
+
|
|
89
|
+
it('maps the Lead Gen manage AccessKey to the OM System permission', () => {
|
|
90
|
+
const catalog = deriveAccessKeyCatalog(model)
|
|
91
|
+
|
|
92
|
+
expect(findAccessCatalogEntry(catalog, AccessKeys.leadGenManage)).toMatchObject({
|
|
93
|
+
source: 'om-system',
|
|
94
|
+
rolePermission: 'sales.lead-gen.manage'
|
|
95
|
+
})
|
|
96
|
+
})
|
|
81
97
|
})
|