@elevasis/core 0.11.2 → 0.13.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 (50) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.js +8 -1
  3. package/dist/organization-model/index.d.ts +2 -1
  4. package/dist/organization-model/index.js +8 -1
  5. package/dist/test-utils/index.d.ts +27 -15
  6. package/dist/test-utils/index.js +25 -0
  7. package/package.json +1 -1
  8. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +27 -270
  9. package/src/auth/multi-tenancy/credentials/__tests__/encryption.test.ts +217 -216
  10. package/src/auth/multi-tenancy/credentials/server/encryption.ts +69 -39
  11. package/src/auth/multi-tenancy/credentials/server/kek-loader.ts +37 -0
  12. package/src/auth/multi-tenancy/index.ts +3 -0
  13. package/src/auth/multi-tenancy/invitations/api-schemas.ts +104 -107
  14. package/src/auth/multi-tenancy/memberships/api-schemas.ts +6 -5
  15. package/src/auth/multi-tenancy/memberships/membership.ts +130 -138
  16. package/src/auth/multi-tenancy/permissions.ts +12 -5
  17. package/src/auth/multi-tenancy/role-management/api-schemas.ts +78 -0
  18. package/src/auth/multi-tenancy/role-management/index.ts +16 -0
  19. package/src/business/acquisition/activity-events.ts +142 -0
  20. package/src/business/acquisition/api-schemas.ts +694 -689
  21. package/src/business/acquisition/derive-actions.ts +90 -0
  22. package/src/business/acquisition/index.ts +111 -109
  23. package/src/execution/engine/index.ts +434 -434
  24. package/src/execution/engine/tools/integration/server/adapters/apify/__tests__/apify-run-actor.integration.test.ts +298 -293
  25. package/src/execution/engine/tools/integration/server/adapters/attio/__tests__/attio-crud.integration.test.ts +0 -1
  26. package/src/execution/engine/tools/integration/service.test.ts +214 -0
  27. package/src/execution/engine/tools/integration/service.ts +169 -161
  28. package/src/execution/engine/tools/lead-service-types.ts +882 -879
  29. package/src/execution/engine/tools/registry.ts +699 -700
  30. package/src/execution/engine/tools/tool-maps.ts +777 -780
  31. package/src/integrations/credentials/__tests__/api-schemas.test.ts +420 -496
  32. package/src/integrations/credentials/api-schemas.ts +127 -143
  33. package/src/integrations/webhook-endpoints/__tests__/api-schemas.test.ts +327 -318
  34. package/src/integrations/webhook-endpoints/api-schemas.ts +103 -102
  35. package/src/integrations/webhook-endpoints/types.ts +58 -51
  36. package/src/operations/activities/api-schemas.ts +80 -79
  37. package/src/operations/activities/types.ts +64 -63
  38. package/src/organization-model/contracts.ts +1 -0
  39. package/src/organization-model/defaults.ts +6 -0
  40. package/src/organization-model/domains/navigation.ts +37 -23
  41. package/src/organization-model/organization-graph.mdx +2 -2
  42. package/src/organization-model/published.ts +2 -1
  43. package/src/platform/constants/versions.ts +1 -1
  44. package/src/reference/_generated/contracts.md +27 -270
  45. package/src/scaffold-registry/__tests__/index.test.ts +72 -7
  46. package/src/scaffold-registry/index.ts +163 -29
  47. package/src/scaffold-registry/schema.ts +68 -62
  48. package/src/server.ts +281 -272
  49. package/src/supabase/database.types.ts +16 -10
  50. package/src/test-utils/rls/RLSTestContext.ts +585 -553
@@ -414,7 +414,6 @@ export type Database = {
414
414
  acq_deals: {
415
415
  Row: {
416
416
  activity_log: Json
417
- cached_stage: string | null
418
417
  closed_lost_at: string | null
419
418
  closed_lost_reason: string | null
420
419
  contact_email: string
@@ -429,6 +428,7 @@ export type Database = {
429
428
  organization_id: string
430
429
  payment_link_sent_at: string | null
431
430
  payment_received_at: string | null
431
+ pipeline_key: string
432
432
  proposal_data: Json | null
433
433
  proposal_generated_at: string | null
434
434
  proposal_pdf_url: string | null
@@ -436,10 +436,11 @@ export type Database = {
436
436
  proposal_reviewed_by: string | null
437
437
  proposal_sent_at: string | null
438
438
  proposal_signed_at: string | null
439
- proposal_status: string | null
440
439
  signature_envelope_id: string | null
441
440
  source_list_id: string | null
442
441
  source_type: string | null
442
+ stage_key: string | null
443
+ state_key: string | null
443
444
  stripe_payment_id: string | null
444
445
  stripe_payment_link: string | null
445
446
  stripe_payment_link_id: string | null
@@ -448,7 +449,6 @@ export type Database = {
448
449
  }
449
450
  Insert: {
450
451
  activity_log?: Json
451
- cached_stage?: string | null
452
452
  closed_lost_at?: string | null
453
453
  closed_lost_reason?: string | null
454
454
  contact_email: string
@@ -463,6 +463,7 @@ export type Database = {
463
463
  organization_id: string
464
464
  payment_link_sent_at?: string | null
465
465
  payment_received_at?: string | null
466
+ pipeline_key?: string
466
467
  proposal_data?: Json | null
467
468
  proposal_generated_at?: string | null
468
469
  proposal_pdf_url?: string | null
@@ -470,10 +471,11 @@ export type Database = {
470
471
  proposal_reviewed_by?: string | null
471
472
  proposal_sent_at?: string | null
472
473
  proposal_signed_at?: string | null
473
- proposal_status?: string | null
474
474
  signature_envelope_id?: string | null
475
475
  source_list_id?: string | null
476
476
  source_type?: string | null
477
+ stage_key?: string | null
478
+ state_key?: string | null
477
479
  stripe_payment_id?: string | null
478
480
  stripe_payment_link?: string | null
479
481
  stripe_payment_link_id?: string | null
@@ -482,7 +484,6 @@ export type Database = {
482
484
  }
483
485
  Update: {
484
486
  activity_log?: Json
485
- cached_stage?: string | null
486
487
  closed_lost_at?: string | null
487
488
  closed_lost_reason?: string | null
488
489
  contact_email?: string
@@ -497,6 +498,7 @@ export type Database = {
497
498
  organization_id?: string
498
499
  payment_link_sent_at?: string | null
499
500
  payment_received_at?: string | null
501
+ pipeline_key?: string
500
502
  proposal_data?: Json | null
501
503
  proposal_generated_at?: string | null
502
504
  proposal_pdf_url?: string | null
@@ -504,10 +506,11 @@ export type Database = {
504
506
  proposal_reviewed_by?: string | null
505
507
  proposal_sent_at?: string | null
506
508
  proposal_signed_at?: string | null
507
- proposal_status?: string | null
508
509
  signature_envelope_id?: string | null
509
510
  source_list_id?: string | null
510
511
  source_type?: string | null
512
+ stage_key?: string | null
513
+ state_key?: string | null
511
514
  stripe_payment_id?: string | null
512
515
  stripe_payment_link?: string | null
513
516
  stripe_payment_link_id?: string | null
@@ -2624,7 +2627,8 @@ export type Database = {
2624
2627
  created_at: string
2625
2628
  description: string | null
2626
2629
  id: string
2627
- key: string
2630
+ key_hash: string
2631
+ key_prefix: string | null
2628
2632
  last_triggered_at: string | null
2629
2633
  name: string
2630
2634
  organization_id: string
@@ -2637,7 +2641,8 @@ export type Database = {
2637
2641
  created_at?: string
2638
2642
  description?: string | null
2639
2643
  id?: string
2640
- key: string
2644
+ key_hash: string
2645
+ key_prefix?: string | null
2641
2646
  last_triggered_at?: string | null
2642
2647
  name: string
2643
2648
  organization_id: string
@@ -2650,7 +2655,8 @@ export type Database = {
2650
2655
  created_at?: string
2651
2656
  description?: string | null
2652
2657
  id?: string
2653
- key?: string
2658
+ key_hash?: string
2659
+ key_prefix?: string | null
2654
2660
  last_triggered_at?: string | null
2655
2661
  name?: string
2656
2662
  organization_id?: string
@@ -2703,13 +2709,13 @@ export type Database = {
2703
2709
  user_id: string
2704
2710
  }[]
2705
2711
  }
2712
+ get_platform_credential_kek: { Args: never; Returns: string }
2706
2713
  get_storage_org_id: { Args: { file_path: string }; Returns: string }
2707
2714
  get_workos_user_id: { Args: never; Returns: string }
2708
2715
  has_org_permission: {
2709
2716
  Args: { org_id: string; perm_key: string }
2710
2717
  Returns: boolean
2711
2718
  }
2712
- is_org_admin: { Args: { org_id: string }; Returns: boolean }
2713
2719
  is_org_member: { Args: { org_id: string }; Returns: boolean }
2714
2720
  link_workos_membership_on_accept: {
2715
2721
  Args: {