@elevasis/core 0.39.0 → 0.41.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.
Files changed (36) hide show
  1. package/dist/auth/index.d.ts +69 -2
  2. package/dist/index.d.ts +650 -413
  3. package/dist/index.js +92 -3
  4. package/dist/knowledge/index.d.ts +90 -19
  5. package/dist/knowledge/index.js +10 -1
  6. package/dist/organization-model/index.d.ts +650 -413
  7. package/dist/organization-model/index.js +92 -3
  8. package/dist/test-utils/index.d.ts +104 -37
  9. package/dist/test-utils/index.js +81 -2
  10. package/package.json +1 -1
  11. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +54 -0
  12. package/src/business/acquisition/ontology-validation.ts +31 -9
  13. package/src/business/clients/api-schemas.test.ts +63 -29
  14. package/src/business/clients/api-schemas.ts +41 -29
  15. package/src/knowledge/index.ts +14 -1
  16. package/src/knowledge/queries.ts +74 -15
  17. package/src/organization-model/__tests__/clients.test.ts +146 -0
  18. package/src/organization-model/__tests__/snapshot-hash.test.ts +82 -0
  19. package/src/organization-model/cross-ref.ts +4 -0
  20. package/src/organization-model/defaults.ts +2 -2
  21. package/src/organization-model/domains/knowledge.ts +1 -0
  22. package/src/organization-model/graph/build.ts +23 -6
  23. package/src/organization-model/graph/schema.ts +4 -3
  24. package/src/organization-model/graph/types.ts +4 -3
  25. package/src/organization-model/helpers.ts +15 -0
  26. package/src/organization-model/index.ts +1 -0
  27. package/src/organization-model/published.ts +19 -1
  28. package/src/organization-model/schema-refinements.ts +2 -2
  29. package/src/organization-model/schema.ts +109 -0
  30. package/src/organization-model/server/snapshot-hash-server.ts +23 -0
  31. package/src/organization-model/snapshot-hash.ts +62 -0
  32. package/src/organization-model/types.ts +19 -1
  33. package/src/platform/constants/versions.ts +1 -1
  34. package/src/reference/_generated/contracts.md +54 -0
  35. package/src/server.ts +292 -289
  36. package/src/supabase/database.types.ts +3 -0
@@ -2018,6 +2018,7 @@ type Database = {
2018
2018
  organization_id: string;
2019
2019
  primary_company_id: string | null;
2020
2020
  primary_contact_id: string | null;
2021
+ source: string;
2021
2022
  source_deal_id: string | null;
2022
2023
  status: string;
2023
2024
  updated_at: string;
@@ -2031,6 +2032,7 @@ type Database = {
2031
2032
  organization_id: string;
2032
2033
  primary_company_id?: string | null;
2033
2034
  primary_contact_id?: string | null;
2035
+ source?: string;
2034
2036
  source_deal_id?: string | null;
2035
2037
  status?: string;
2036
2038
  updated_at?: string;
@@ -2044,6 +2046,7 @@ type Database = {
2044
2046
  organization_id?: string;
2045
2047
  primary_company_id?: string | null;
2046
2048
  primary_contact_id?: string | null;
2049
+ source?: string;
2047
2050
  source_deal_id?: string | null;
2048
2051
  status?: string;
2049
2052
  updated_at?: string;
@@ -4383,6 +4386,7 @@ type SidebarNode = SidebarSurfaceNode | SidebarGroupNode;
4383
4386
 
4384
4387
  declare const OrganizationModelSchema: z.ZodObject<{
4385
4388
  version: z.ZodDefault<z.ZodLiteral<1>>;
4389
+ snapshotHash: z.ZodOptional<z.ZodString>;
4386
4390
  domainMetadata: z.ZodPipe<z.ZodDefault<z.ZodObject<{
4387
4391
  branding: z.ZodOptional<z.ZodObject<{
4388
4392
  version: z.ZodDefault<z.ZodLiteral<1>>;
@@ -4392,6 +4396,10 @@ declare const OrganizationModelSchema: z.ZodObject<{
4392
4396
  version: z.ZodDefault<z.ZodLiteral<1>>;
4393
4397
  lastModified: z.ZodString;
4394
4398
  }, z.core.$strip>>;
4399
+ clients: z.ZodOptional<z.ZodObject<{
4400
+ version: z.ZodDefault<z.ZodLiteral<1>>;
4401
+ lastModified: z.ZodString;
4402
+ }, z.core.$strip>>;
4395
4403
  customers: z.ZodOptional<z.ZodObject<{
4396
4404
  version: z.ZodDefault<z.ZodLiteral<1>>;
4397
4405
  lastModified: z.ZodString;
@@ -4449,6 +4457,10 @@ declare const OrganizationModelSchema: z.ZodObject<{
4449
4457
  version: 1;
4450
4458
  lastModified: string;
4451
4459
  };
4460
+ clients: {
4461
+ version: 1;
4462
+ lastModified: string;
4463
+ };
4452
4464
  customers: {
4453
4465
  version: 1;
4454
4466
  lastModified: string;
@@ -4506,6 +4518,10 @@ declare const OrganizationModelSchema: z.ZodObject<{
4506
4518
  version: 1;
4507
4519
  lastModified: string;
4508
4520
  } | undefined;
4521
+ clients?: {
4522
+ version: 1;
4523
+ lastModified: string;
4524
+ } | undefined;
4509
4525
  customers?: {
4510
4526
  version: 1;
4511
4527
  lastModified: string;
@@ -4698,6 +4714,56 @@ declare const OrganizationModelSchema: z.ZodObject<{
4698
4714
  shortName: z.ZodOptional<z.ZodString>;
4699
4715
  description: z.ZodOptional<z.ZodString>;
4700
4716
  }, z.core.$loose>>;
4717
+ clients: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
4718
+ id: z.ZodString;
4719
+ slug: z.ZodString;
4720
+ name: z.ZodString;
4721
+ status: z.ZodDefault<z.ZodEnum<{
4722
+ active: "active";
4723
+ onboarding: "onboarding";
4724
+ paused: "paused";
4725
+ completed: "completed";
4726
+ churned: "churned";
4727
+ }>>;
4728
+ source: z.ZodOptional<z.ZodString>;
4729
+ identity: z.ZodDefault<z.ZodObject<{
4730
+ organizationName: z.ZodOptional<z.ZodString>;
4731
+ shortName: z.ZodOptional<z.ZodString>;
4732
+ clientBrief: z.ZodDefault<z.ZodString>;
4733
+ geographicFocus: z.ZodDefault<z.ZodArray<z.ZodString>>;
4734
+ timeZone: z.ZodDefault<z.ZodString>;
4735
+ }, z.core.$loose>>;
4736
+ branding: z.ZodDefault<z.ZodObject<{
4737
+ voice: z.ZodOptional<z.ZodString>;
4738
+ tagline: z.ZodOptional<z.ZodString>;
4739
+ values: z.ZodDefault<z.ZodArray<z.ZodString>>;
4740
+ }, z.core.$loose>>;
4741
+ workspace: z.ZodDefault<z.ZodObject<{
4742
+ kind: z.ZodOptional<z.ZodEnum<{
4743
+ "external-project": "external-project";
4744
+ "internal-project": "internal-project";
4745
+ none: "none";
4746
+ }>>;
4747
+ owner: z.ZodOptional<z.ZodEnum<{
4748
+ platform: "platform";
4749
+ client: "client";
4750
+ developer: "developer";
4751
+ }>>;
4752
+ projectId: z.ZodOptional<z.ZodString>;
4753
+ workspacePath: z.ZodOptional<z.ZodString>;
4754
+ }, z.core.$loose>>;
4755
+ links: z.ZodDefault<z.ZodObject<{
4756
+ projectIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
4757
+ primaryCompanyId: z.ZodOptional<z.ZodString>;
4758
+ primaryContactId: z.ZodOptional<z.ZodString>;
4759
+ sourceDealId: z.ZodOptional<z.ZodString>;
4760
+ }, z.core.$strip>>;
4761
+ prompts: z.ZodDefault<z.ZodObject<{
4762
+ defaultContext: z.ZodDefault<z.ZodString>;
4763
+ }, z.core.$loose>>;
4764
+ config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
4765
+ customValues: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
4766
+ }, z.core.$strict>>>>;
4701
4767
  customers: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
4702
4768
  id: z.ZodString;
4703
4769
  order: z.ZodNumber;
@@ -5351,6 +5417,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
5351
5417
  action: "action";
5352
5418
  ontology: "ontology";
5353
5419
  role: "role";
5420
+ client: "client";
5354
5421
  stage: "stage";
5355
5422
  goal: "goal";
5356
5423
  "customer-segment": "customer-segment";
@@ -5362,7 +5429,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
5362
5429
  nodeId: z.ZodUnion<readonly [z.ZodString, z.ZodTemplateLiteral<`ontology:${string}`>]>;
5363
5430
  }, z.core.$strip>]>, z.ZodTransform<{
5364
5431
  target: {
5365
- kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "stage" | "goal" | "customer-segment" | "offering";
5432
+ kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "client" | "stage" | "goal" | "customer-segment" | "offering";
5366
5433
  id: string;
5367
5434
  };
5368
5435
  nodeId: string;
@@ -5370,7 +5437,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
5370
5437
  nodeId: string;
5371
5438
  } | {
5372
5439
  target: {
5373
- kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "stage" | "goal" | "customer-segment" | "offering";
5440
+ kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "client" | "stage" | "goal" | "customer-segment" | "offering";
5374
5441
  id: string;
5375
5442
  };
5376
5443
  }>>>>;