@pam-ai/pam-ordo-contracts 3.31.0 → 3.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.
@@ -303,6 +303,46 @@ export interface paths {
303
303
  patch?: never;
304
304
  trace?: never;
305
305
  };
306
+ "/v1/inbox/commands/open-contact-conversation": {
307
+ parameters: {
308
+ query?: never;
309
+ header?: never;
310
+ path?: never;
311
+ cookie?: never;
312
+ };
313
+ get?: never;
314
+ put?: never;
315
+ /**
316
+ * Open or create a Customer's canonical Conversation without opening work
317
+ * @description Resolves the canonical same-rooftop Conversation for a Customer selected from Reach out, creating an empty Conversation only when none exists. This is navigation provisioning, not a lifecycle mutation: it creates no WorkCycle, assignment, Interaction, notification, or unread activity and never changes an existing owner. The optional conversationId is the value observed in contact search and is revalidated against the canonical Customer before use. Requires VIEW_CUSTOMER_DIRECTORY.
318
+ */
319
+ post: operations["openInboxContactConversation"];
320
+ delete?: never;
321
+ options?: never;
322
+ head?: never;
323
+ patch?: never;
324
+ trace?: never;
325
+ };
326
+ "/v1/inbox/commands/record-reach-out-call": {
327
+ parameters: {
328
+ query?: never;
329
+ header?: never;
330
+ path?: never;
331
+ cookie?: never;
332
+ };
333
+ get?: never;
334
+ put?: never;
335
+ /**
336
+ * Open or reuse Ordo work after an accepted Reach Out call
337
+ * @description Records an outbound Reach Out call only after the telephony platform has accepted it and returned a stable callId. The canonical Customer must belong to the selected rooftop; a phone number or asserted actor is not accepted as identity. Ordo resolves or creates the Conversation and opens a WorkCycle assigned to the authenticated User only when no active cycle exists. An existing OPEN or SNOOZED cycle and its owner, including null, remain unchanged; this command never claims someone else's or an unassigned active cycle. This call-specific OPEN-cycle rule is an intentional exception to the outbound-text Reach Out lifecycle. Replays of the same sourceSystem and callId within the rooftop return the same result, even with a different operationId, without creating another cycle. A rejected or unaccepted dial must never call this endpoint. Requires CALL_CUSTOMER.
338
+ */
339
+ post: operations["recordReachOutCall"];
340
+ delete?: never;
341
+ options?: never;
342
+ head?: never;
343
+ patch?: never;
344
+ trace?: never;
345
+ };
306
346
  "/v1/inbox/commands/assign": {
307
347
  parameters: {
308
348
  query?: never;
@@ -1461,11 +1501,18 @@ export interface components {
1461
1501
  nextCursor: string | null;
1462
1502
  };
1463
1503
  };
1504
+ /**
1505
+ * @description Source-verified terminal outcome. Transient ringing and an absent recording do not establish one; missing on an Interaction means unknown, not answered.
1506
+ * @enum {string}
1507
+ */
1508
+ CallTerminalOutcomeV1: "answered" | "voicemail" | "missed" | "busy" | "no_answer";
1464
1509
  InteractionRef: {
1465
1510
  /** Format: uuid */
1466
1511
  id: string;
1467
1512
  /** @description Authenticated User who authored an internal comment; null for non-User senders. */
1468
1513
  senderUserId?: string | null;
1514
+ /** @description Verified recipient of an inbound Customer call or voicemail on a direct staff line. This records the dialed-line recipient, not WorkCycle ownership; an existing owner is never reassigned merely because this User received a call. */
1515
+ recipientUserId?: string | null;
1469
1516
  /**
1470
1517
  * Format: uuid
1471
1518
  * @description Root internal comment referenced by this comment. Replies are flattened to one level.
@@ -1499,6 +1546,8 @@ export interface components {
1499
1546
  repairOrder?: components["schemas"]["InteractionRepairOrderRefV1"] | null;
1500
1547
  sequenceNumber: number;
1501
1548
  kind: string;
1549
+ /** @description Optional terminal outcome for a call or voicemail Interaction, carried from the source record. Older calls and sources without an authoritative outcome omit it. A reader must not infer answered from absence or from the Interaction kind alone. */
1550
+ callOutcome?: components["schemas"]["CallTerminalOutcomeV1"];
1502
1551
  channel?: string | null;
1503
1552
  /** @enum {string} */
1504
1553
  direction: "INBOUND" | "OUTBOUND" | "INTERNAL";
@@ -1702,7 +1751,7 @@ export interface components {
1702
1751
  };
1703
1752
  };
1704
1753
  /** @enum {string} */
1705
- NotificationKind: "reminder_due" | "customer_message" | "mention" | "internal_comment_reply" | "needs_attention" | "overdue" | "ro_opened" | "ro_closed";
1754
+ NotificationKind: "reminder_due" | "customer_message" | "customer_call" | "mention" | "internal_comment_reply" | "needs_attention" | "overdue" | "ro_opened" | "ro_closed";
1706
1755
  /** @description Recipient-specific Ordo alert state. Opening or dismissing it never resolves domain work. */
1707
1756
  InboxNotification: {
1708
1757
  /** Format: uuid */
@@ -1886,8 +1935,10 @@ export interface components {
1886
1935
  senderUserExternalId?: string;
1887
1936
  /** @enum {string} */
1888
1937
  lineType?: "pam" | "rooftop" | "advisor";
1889
- /** @description Verified recipient advisor User for an inbound Customer SMS to an advisor-owned line. This is not the sender and must be resolved within clientOrgId before routing. */
1938
+ /** @description Source-verified recipient advisor User for an inbound Customer SMS, call, or voicemail received on an advisor-owned line. This is not the sender and must be resolved within clientOrgId before direct routing. Producers must omit it when line ownership cannot be verified; a phone number or unverified display name is not authority for this identity. */
1890
1939
  recipientUserExternalId?: string;
1940
+ /** @description Optional terminal telephony outcome for kind call or voicemail. Producers must not infer it from a transient ringing state or from an absent recording. Missing means outcome was not authoritatively established, not that the call was answered. Existing voicemail producers may omit it during the additive rollout. */
1941
+ callOutcome?: components["schemas"]["CallTerminalOutcomeV1"];
1891
1942
  dynamoLocator?: components["schemas"]["ProducerDynamoLocatorV1"];
1892
1943
  };
1893
1944
  ProducerRepairOrderTransitionV1: {
@@ -2438,6 +2489,26 @@ export interface components {
2438
2489
  attachments?: components["schemas"]["OutboundAttachmentV1"][];
2439
2490
  ownershipDisposition: components["schemas"]["OutboundMessageOwnershipDisposition"];
2440
2491
  };
2492
+ OpenInboxContactConversationCommand: {
2493
+ operationId: string;
2494
+ clientOrgId: string;
2495
+ customer: components["schemas"]["InboxCustomerIdentity"];
2496
+ /**
2497
+ * Format: uuid
2498
+ * @description The Conversation observed by contact search, or null when the row reported NONE. Ordo revalidates it against the canonical Customer and safely finds or creates the Conversation under its tenant lock.
2499
+ */
2500
+ conversationId: string | null;
2501
+ };
2502
+ OpenInboxContactConversationResult: {
2503
+ data: {
2504
+ operationId: string;
2505
+ applied: boolean;
2506
+ replayed: boolean;
2507
+ /** Format: uuid */
2508
+ conversationId: string;
2509
+ conversationCreated: boolean;
2510
+ };
2511
+ };
2441
2512
  /** @enum {string} */
2442
2513
  OutboundMessageDeliveryState: "PENDING" | "ACCEPTED" | "FAILED" | "UNKNOWN";
2443
2514
  SendInboxMessageResult: {
@@ -2457,6 +2528,48 @@ export interface components {
2457
2528
  ownershipDisposition: components["schemas"]["OutboundMessageOwnershipDisposition"];
2458
2529
  };
2459
2530
  };
2531
+ ReachOutCallSource: {
2532
+ /**
2533
+ * @description Typed authority for the accepted call identifier.
2534
+ * @constant
2535
+ */
2536
+ sourceSystem: "comms_platform";
2537
+ /** @description Stable telephony call ID, not a freshly generated command ID. */
2538
+ callId: string;
2539
+ /**
2540
+ * Format: date-time
2541
+ * @description Telephony platform's accepted-call timestamp when supplied; otherwise the time its successful initiate response was observed. Never the time of the dial request or a rejected attempt.
2542
+ */
2543
+ acceptedAt: string;
2544
+ };
2545
+ RecordReachOutCallCommand: {
2546
+ operationId: string;
2547
+ clientOrgId: string;
2548
+ customer: components["schemas"]["InboxCustomerIdentity"];
2549
+ /**
2550
+ * Format: uuid
2551
+ * @description The Conversation observed by the caller, or null when contact search reported NONE. Ordo revalidates it against the canonical Customer.
2552
+ */
2553
+ conversationId: string | null;
2554
+ call: components["schemas"]["ReachOutCallSource"];
2555
+ };
2556
+ RecordReachOutCallResult: {
2557
+ data: {
2558
+ operationId: string;
2559
+ applied: boolean;
2560
+ replayed: boolean;
2561
+ callId: string;
2562
+ /** Format: uuid */
2563
+ conversationId: string;
2564
+ conversationCreated: boolean;
2565
+ /** Format: uuid */
2566
+ workCycleId: string;
2567
+ workCycleCreated: boolean;
2568
+ /** @description Authenticated caller for a newly opened cycle, or the preserved owner of an existing active cycle. Null is possible when an existing active cycle was unassigned; the call never claims it. */
2569
+ ownerUserId: string | null;
2570
+ resultingVersion: number;
2571
+ };
2572
+ };
2460
2573
  CommandResult: {
2461
2574
  data: {
2462
2575
  operationId: string;
@@ -2745,6 +2858,26 @@ export interface components {
2745
2858
  "application/json": components["schemas"]["SendInboxMessageResult"];
2746
2859
  };
2747
2860
  };
2861
+ /** @description Resolved, created, or idempotently replayed canonical Conversation result. */
2862
+ InboxContactConversationOpened: {
2863
+ headers: {
2864
+ "x-correlation-id": components["headers"]["CorrelationId"];
2865
+ [name: string]: unknown;
2866
+ };
2867
+ content: {
2868
+ "application/json": components["schemas"]["OpenInboxContactConversationResult"];
2869
+ };
2870
+ };
2871
+ /** @description Applied or idempotently replayed accepted Reach Out call result. */
2872
+ ReachOutCallRecorded: {
2873
+ headers: {
2874
+ "x-correlation-id": components["headers"]["CorrelationId"];
2875
+ [name: string]: unknown;
2876
+ };
2877
+ content: {
2878
+ "application/json": components["schemas"]["RecordReachOutCallResult"];
2879
+ };
2880
+ };
2748
2881
  /** @description Invalid input. */
2749
2882
  BadRequest: {
2750
2883
  headers: {
@@ -2932,6 +3065,16 @@ export interface components {
2932
3065
  "application/json": components["schemas"]["SendInboxMessageCommand"];
2933
3066
  };
2934
3067
  };
3068
+ OpenInboxContactConversationCommand: {
3069
+ content: {
3070
+ "application/json": components["schemas"]["OpenInboxContactConversationCommand"];
3071
+ };
3072
+ };
3073
+ RecordReachOutCallCommand: {
3074
+ content: {
3075
+ "application/json": components["schemas"]["RecordReachOutCallCommand"];
3076
+ };
3077
+ };
2935
3078
  };
2936
3079
  headers: {
2937
3080
  /** @description Stable request correlation identifier. */
@@ -3377,8 +3520,8 @@ export interface operations {
3377
3520
  sort?: "NAME" | "RECENT_REPAIR_ORDER";
3378
3521
  /** @description Opaque keyset cursor. Present because a browse is not bounded the way a search is: a busy rooftop can carry several hundred open repair orders, and a limit alone would silently truncate the answer. */
3379
3522
  cursor?: string;
3380
- /** @description Which side of the directory to read. MINE returns only Customers whose Conversation the reader owns; EVERYONE returns the rest. One set is always in the way of the other, so this is a switch rather than a filter. */
3381
- relationship?: "MINE" | "EVERYONE";
3523
+ /** @description Which side of the directory to read. MINE returns only Customers whose Conversation the reader owns; EVERYONE returns the rest. ALL returns both sides in one page while preserving each row's relationship, so a picker can partition a single consistent result without issuing duplicate upstream directory searches. */
3524
+ relationship?: "MINE" | "EVERYONE" | "ALL";
3382
3525
  limit?: number;
3383
3526
  };
3384
3527
  header: {
@@ -3512,6 +3655,50 @@ export interface operations {
3512
3655
  503: components["responses"]["ServiceUnavailable"];
3513
3656
  };
3514
3657
  };
3658
+ openInboxContactConversation: {
3659
+ parameters: {
3660
+ query?: never;
3661
+ header: {
3662
+ /** @description Authorized rooftop context. For commands this value must match body.clientOrgId; neither value is trusted without DASH-233 resolution. */
3663
+ "x-client-org-id": components["parameters"]["ClientOrgId"];
3664
+ };
3665
+ path?: never;
3666
+ cookie?: never;
3667
+ };
3668
+ requestBody: components["requestBodies"]["OpenInboxContactConversationCommand"];
3669
+ responses: {
3670
+ 200: components["responses"]["InboxContactConversationOpened"];
3671
+ 400: components["responses"]["BadRequest"];
3672
+ 401: components["responses"]["Unauthorized"];
3673
+ 403: components["responses"]["Forbidden"];
3674
+ 404: components["responses"]["NotFound"];
3675
+ 409: components["responses"]["Conflict"];
3676
+ 500: components["responses"]["InternalError"];
3677
+ 503: components["responses"]["ServiceUnavailable"];
3678
+ };
3679
+ };
3680
+ recordReachOutCall: {
3681
+ parameters: {
3682
+ query?: never;
3683
+ header: {
3684
+ /** @description Authorized rooftop context. For commands this value must match body.clientOrgId; neither value is trusted without DASH-233 resolution. */
3685
+ "x-client-org-id": components["parameters"]["ClientOrgId"];
3686
+ };
3687
+ path?: never;
3688
+ cookie?: never;
3689
+ };
3690
+ requestBody: components["requestBodies"]["RecordReachOutCallCommand"];
3691
+ responses: {
3692
+ 200: components["responses"]["ReachOutCallRecorded"];
3693
+ 400: components["responses"]["BadRequest"];
3694
+ 401: components["responses"]["Unauthorized"];
3695
+ 403: components["responses"]["Forbidden"];
3696
+ 404: components["responses"]["NotFound"];
3697
+ 409: components["responses"]["Conflict"];
3698
+ 500: components["responses"]["InternalError"];
3699
+ 503: components["responses"]["ServiceUnavailable"];
3700
+ };
3701
+ };
3515
3702
  assignConversation: {
3516
3703
  parameters: {
3517
3704
  query?: never;