@medalsocial/sdk 1.5.0 → 1.6.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.
@@ -610,6 +610,26 @@ interface paths {
610
610
  patch?: never;
611
611
  trace?: never;
612
612
  };
613
+ "/api/v1/capability-confirmations": {
614
+ parameters: {
615
+ query?: never;
616
+ header?: never;
617
+ path?: never;
618
+ cookie?: never;
619
+ };
620
+ get?: never;
621
+ put?: never;
622
+ /**
623
+ * Issue a capability confirmation token
624
+ * @description Mints a short-lived `X-Capability-Confirmation` token for one pending write. Confirmable write routes require BOTH `Idempotency-Key` and `X-Capability-Confirmation` when the credential holds the capability scope directly; API keys with legacy scopes are exempt. The token is bound to the workspace, auth subject, method, path, required scopes and idempotency key, and expires within 15 minutes. `user_approved: true` asserts that a human on the caller's side approved this exact action.
625
+ */
626
+ post: operations["issueCapabilityConfirmation"];
627
+ delete?: never;
628
+ options?: never;
629
+ head?: never;
630
+ patch?: never;
631
+ trace?: never;
632
+ };
613
633
  "/api/v1/channels/connect-links": {
614
634
  parameters: {
615
635
  query?: never;
@@ -619,7 +639,7 @@ interface paths {
619
639
  };
620
640
  /**
621
641
  * List connect links
622
- * @description Link tokens are never returned.
642
+ * @description Link tokens are never returned. Newest first, cursor-paginated. The `channel_type` / `status` filters are applied within each page, so a page may hold fewer than `limit` items while `pagination.has_more` is still true — page off `has_more`, not the item count.
623
643
  */
624
644
  get: operations["listChannelConnectLinks"];
625
645
  put?: never;
@@ -663,7 +683,10 @@ interface paths {
663
683
  path?: never;
664
684
  cookie?: never;
665
685
  };
666
- /** List channel connections */
686
+ /**
687
+ * List channel connections
688
+ * @description The workspace's channel connections in a generic, channel-agnostic shape. Newest first, cursor-paginated. Rows that are not projectable as connections are dropped within the page, so a page may hold fewer than `limit` items while `pagination.has_more` is still true — page off `has_more`, not the item count.
689
+ */
667
690
  get: operations["listChannelConnections"];
668
691
  put?: never;
669
692
  post?: never;
@@ -695,6 +718,62 @@ interface paths {
695
718
  patch?: never;
696
719
  trace?: never;
697
720
  };
721
+ "/api/v1/scan": {
722
+ parameters: {
723
+ query?: never;
724
+ header?: never;
725
+ path?: never;
726
+ cookie?: never;
727
+ };
728
+ get?: never;
729
+ put?: never;
730
+ /**
731
+ * Queue a company/site scan
732
+ * @description Queues an asynchronous scan. Provide exactly one of `url`, `orgnr`, or `name`; poll the returned id via `GET /api/v1/scan/{id}`.
733
+ */
734
+ post: operations["createScan"];
735
+ delete?: never;
736
+ options?: never;
737
+ head?: never;
738
+ patch?: never;
739
+ trace?: never;
740
+ };
741
+ "/api/v1/scan/companies": {
742
+ parameters: {
743
+ query?: never;
744
+ header?: never;
745
+ path?: never;
746
+ cookie?: never;
747
+ };
748
+ /** Search the Norwegian company registry */
749
+ get: operations["searchScanCompanies"];
750
+ put?: never;
751
+ post?: never;
752
+ delete?: never;
753
+ options?: never;
754
+ head?: never;
755
+ patch?: never;
756
+ trace?: never;
757
+ };
758
+ "/api/v1/scan/{id}": {
759
+ parameters: {
760
+ query?: never;
761
+ header?: never;
762
+ path: {
763
+ id: components["parameters"]["Id"];
764
+ };
765
+ cookie?: never;
766
+ };
767
+ /** Get a scan job */
768
+ get: operations["getScan"];
769
+ put?: never;
770
+ post?: never;
771
+ delete?: never;
772
+ options?: never;
773
+ head?: never;
774
+ patch?: never;
775
+ trace?: never;
776
+ };
698
777
  }
699
778
  type webhooks = Record<string, never>;
700
779
  interface components {
@@ -1212,9 +1291,15 @@ interface components {
1212
1291
  author_user_id: string | null;
1213
1292
  author_name: string | null;
1214
1293
  body: string;
1294
+ /** @description Outbound delivery state, or `null` for inbound messages and internal notes. A `201` from `POST /api/v1/helpdesk/replies` means the reply was accepted, NOT delivered — the channel hand-off is asynchronous, so poll this field (or subscribe to `helpdesk.message_delivery_updated`) to learn the outcome. */
1295
+ delivery_status: components["schemas"]["HelpdeskMessageDeliveryStatus"] | null;
1296
+ /** @description Last send error for a `failed` outbound message, otherwise `null`. */
1297
+ delivery_error: string | null;
1215
1298
  /** @description Unix timestamp in milliseconds. */
1216
1299
  created_at: number;
1217
1300
  };
1301
+ /** @enum {string} */
1302
+ HelpdeskMessageDeliveryStatus: "pending" | "sent" | "delivered" | "failed";
1218
1303
  /** @description At least one field is required. */
1219
1304
  UpdateHelpdeskConversationInput: {
1220
1305
  status?: components["schemas"]["HelpdeskConversationStatus"];
@@ -1306,9 +1391,17 @@ interface components {
1306
1391
  /** @constant */
1307
1392
  status: "deleted";
1308
1393
  };
1394
+ /** @description A delivery attempt record. `id` is the same value sent as the `X-Medal-Delivery-Id` and `Idempotency-Key` headers on the outbound request. Deliveries never carry payload bodies (payloads can contain customer PII). The correlation fields are derived from the stored event and fail closed to `null` when no canonical event exists — e.g. `test.ping` deliveries or events that have aged out of retention. */
1309
1395
  WebhookDelivery: {
1310
1396
  id: string;
1311
1397
  event_type: string;
1398
+ /** @description Primary subject id of the announced event, or `null`. */
1399
+ resource_id: string | null;
1400
+ conversation_id: string | null;
1401
+ message_id: string | null;
1402
+ connection_ref: string | null;
1403
+ channel: string | null;
1404
+ channel_connection_id: string | null;
1312
1405
  /** @enum {string} */
1313
1406
  status: "pending" | "delivered" | "dead_letter";
1314
1407
  attempt_count: number;
@@ -1413,6 +1506,9 @@ interface components {
1413
1506
  ApiResponse_GdprExportRequest: components["schemas"]["Envelope_GdprExportRequest"];
1414
1507
  ApiResponse_GdprExportArray: components["schemas"]["Envelope_GdprExportArray"];
1415
1508
  ApiResponse_GdprExport: components["schemas"]["Envelope_GdprExport"];
1509
+ ApiResponse_ScanCreateResult: components["schemas"]["Envelope_ScanCreateResult"];
1510
+ ApiResponse_ScanCompanyArray: components["schemas"]["Envelope_ScanCompanyArray"];
1511
+ ApiResponse_ScanJob: components["schemas"]["Envelope_ScanJob"];
1416
1512
  ApiResponse_ConsentResult: components["schemas"]["Envelope_ConsentResult"];
1417
1513
  ApiResponse_ConsentRecordArray: components["schemas"]["Envelope_ConsentRecordArray"];
1418
1514
  ApiResponse_WorkspaceArray: components["schemas"]["Envelope_WorkspaceArray"];
@@ -1453,6 +1549,14 @@ interface components {
1453
1549
  data: components["schemas"]["HelpdeskMessage"][];
1454
1550
  pagination: components["schemas"]["Pagination"];
1455
1551
  };
1552
+ PaginatedResponse_ConnectLink: {
1553
+ data: components["schemas"]["ConnectLink"][];
1554
+ pagination: components["schemas"]["Pagination"];
1555
+ };
1556
+ PaginatedResponse_ChannelConnection: {
1557
+ data: components["schemas"]["ChannelConnection"][];
1558
+ pagination: components["schemas"]["Pagination"];
1559
+ };
1456
1560
  Envelope_PostCreateResult: {
1457
1561
  data: components["schemas"]["PostCreateResult"];
1458
1562
  };
@@ -1516,6 +1620,67 @@ interface components {
1516
1620
  Envelope_DealRemoveResult: {
1517
1621
  data: components["schemas"]["DealRemoveResult"];
1518
1622
  };
1623
+ /** @description Provide exactly one of `url`, `orgnr`, or `name`. */
1624
+ ScanCreateInput: {
1625
+ url?: string;
1626
+ orgnr?: string;
1627
+ name?: string;
1628
+ } & (unknown | unknown | unknown);
1629
+ ScanCreateResult: {
1630
+ id: string;
1631
+ status: string;
1632
+ message?: string;
1633
+ };
1634
+ ScanCompany: {
1635
+ orgnr: string;
1636
+ name: string;
1637
+ org_form: string | null;
1638
+ industry: string | null;
1639
+ city: string | null;
1640
+ website: string | null;
1641
+ };
1642
+ ScanJob: {
1643
+ id: string;
1644
+ /** @description pending | running | done | failed */
1645
+ status: string;
1646
+ input: components["schemas"]["ScanCreateInput"];
1647
+ resolved: {
1648
+ orgnr?: string;
1649
+ companyName?: string;
1650
+ websiteUrl?: string;
1651
+ } | null;
1652
+ /** @description Versioned findings payload (see the SDK `ScanResultPayload` type); additive per `version`. The stable core is documented below; further sections (registry, signals, pagespeed, seo, ai, gdpr, mailAuth, httpsOk) evolve additively. */
1653
+ result: ({
1654
+ version: number;
1655
+ /** @description Weighted composite score (0-100); null when unmeasurable. */
1656
+ nettskaar: number | null;
1657
+ /** @description Per-axis 0-100 scores; null axes were unmeasurable. */
1658
+ subScores: {
1659
+ fart: number | null;
1660
+ google: number | null;
1661
+ ai: number | null;
1662
+ trygghet: number | null;
1663
+ omdomme: number | null;
1664
+ };
1665
+ } & {
1666
+ [key: string]: unknown;
1667
+ }) | null;
1668
+ /** @description Public-safe failure code (company_not_found, no_website, …). */
1669
+ error: string | null;
1670
+ /** Format: date-time */
1671
+ created_at: string | null;
1672
+ /** Format: date-time */
1673
+ finished_at: string | null;
1674
+ };
1675
+ Envelope_ScanCreateResult: {
1676
+ data: components["schemas"]["ScanCreateResult"];
1677
+ };
1678
+ Envelope_ScanCompanyArray: {
1679
+ data: components["schemas"]["ScanCompany"][];
1680
+ };
1681
+ Envelope_ScanJob: {
1682
+ data: components["schemas"]["ScanJob"];
1683
+ };
1519
1684
  Envelope_GdprExportRequest: {
1520
1685
  data: components["schemas"]["GdprExportRequest"];
1521
1686
  };
@@ -1552,6 +1717,44 @@ interface components {
1552
1717
  Envelope_WebhookDeleteResult: {
1553
1718
  data: components["schemas"]["WebhookDeleteResult"];
1554
1719
  };
1720
+ IssueCapabilityConfirmationInput: {
1721
+ /** @description Confirmable capability to mint a token for. */
1722
+ capability_id: string;
1723
+ /** @description Concrete `/api/v1/...` path to bind the token to. Optional when the capability has exactly one API target; required when it has several. */
1724
+ api_path?: string;
1725
+ /** @description Values for the capability path template's parameters. */
1726
+ path_params?: {
1727
+ [key: string]: string | number | boolean;
1728
+ };
1729
+ /** @description The exact `Idempotency-Key` the confirmed write will send. The token is bound to it. */
1730
+ idempotency_key?: string;
1731
+ /** @description Human-readable description of the approved action, retained for audit. */
1732
+ preview_summary: string;
1733
+ /**
1734
+ * @description Asserts that a human on the caller's side approved this specific action.
1735
+ * @constant
1736
+ */
1737
+ user_approved: true;
1738
+ };
1739
+ CapabilityConfirmation: {
1740
+ /** @description Send as the `X-Capability-Confirmation` header on the write. */
1741
+ confirmation_token: string;
1742
+ /** @constant */
1743
+ token_type: "medal_capability_confirmation";
1744
+ capability_id: string;
1745
+ method: string;
1746
+ path: string;
1747
+ required_scopes: string[];
1748
+ idempotency_key: string | null;
1749
+ expires_in: number;
1750
+ /** Format: date-time */
1751
+ expires_at: string;
1752
+ preview_summary: string;
1753
+ };
1754
+ ApiResponse_CapabilityConfirmation: components["schemas"]["Envelope_CapabilityConfirmation"];
1755
+ Envelope_CapabilityConfirmation: {
1756
+ data: components["schemas"]["CapabilityConfirmation"];
1757
+ };
1555
1758
  Envelope_WebhookDeliveryArray: {
1556
1759
  data: components["schemas"]["WebhookDelivery"][];
1557
1760
  };
@@ -1561,12 +1764,20 @@ interface components {
1561
1764
  Envelope_ConnectLinkCreateResult: {
1562
1765
  data: components["schemas"]["ConnectLinkCreateResult"];
1563
1766
  };
1767
+ /**
1768
+ * @deprecated
1769
+ * @description Deprecated — `listChannelConnectLinks` responds with `PaginatedResponse_ConnectLink`. Retained for backwards compatibility with consumers of the generated contract types.
1770
+ */
1564
1771
  Envelope_ConnectLinkArray: {
1565
1772
  data: components["schemas"]["ConnectLink"][];
1566
1773
  };
1567
1774
  Envelope_ConnectLinkRevokeResult: {
1568
1775
  data: components["schemas"]["ConnectLinkRevokeResult"];
1569
1776
  };
1777
+ /**
1778
+ * @deprecated
1779
+ * @description Deprecated — `listChannelConnections` responds with `PaginatedResponse_ChannelConnection`. Retained for backwards compatibility with consumers of the generated contract types.
1780
+ */
1570
1781
  Envelope_ChannelConnectionArray: {
1571
1782
  data: components["schemas"]["ChannelConnection"][];
1572
1783
  };
@@ -2712,9 +2923,37 @@ interface operations {
2712
2923
  default: components["responses"]["ApiError"];
2713
2924
  };
2714
2925
  };
2926
+ issueCapabilityConfirmation: {
2927
+ parameters: {
2928
+ query?: never;
2929
+ header?: never;
2930
+ path?: never;
2931
+ cookie?: never;
2932
+ };
2933
+ requestBody: {
2934
+ content: {
2935
+ "application/json": components["schemas"]["IssueCapabilityConfirmationInput"];
2936
+ };
2937
+ };
2938
+ responses: {
2939
+ /** @description Minted confirmation token. */
2940
+ 200: {
2941
+ headers: {
2942
+ [name: string]: unknown;
2943
+ };
2944
+ content: {
2945
+ "application/json": components["schemas"]["ApiResponse_CapabilityConfirmation"];
2946
+ };
2947
+ };
2948
+ default: components["responses"]["ApiError"];
2949
+ };
2950
+ };
2715
2951
  listChannelConnectLinks: {
2716
2952
  parameters: {
2717
2953
  query?: {
2954
+ /** @description Page size (default 50, capped at 100). */
2955
+ limit?: number;
2956
+ cursor?: components["parameters"]["Cursor"];
2718
2957
  channel_type?: string;
2719
2958
  status?: components["schemas"]["ConnectLinkStatus"];
2720
2959
  };
@@ -2724,13 +2963,13 @@ interface operations {
2724
2963
  };
2725
2964
  requestBody?: never;
2726
2965
  responses: {
2727
- /** @description The workspace's connect links. */
2966
+ /** @description Connect links page. */
2728
2967
  200: {
2729
2968
  headers: {
2730
2969
  [name: string]: unknown;
2731
2970
  };
2732
2971
  content: {
2733
- "application/json": components["schemas"]["ApiResponse_ConnectLinkArray"];
2972
+ "application/json": components["schemas"]["PaginatedResponse_ConnectLink"];
2734
2973
  };
2735
2974
  };
2736
2975
  default: components["responses"]["ApiError"];
@@ -2786,20 +3025,24 @@ interface operations {
2786
3025
  };
2787
3026
  listChannelConnections: {
2788
3027
  parameters: {
2789
- query?: never;
3028
+ query?: {
3029
+ /** @description Page size (default 50, capped at 100). */
3030
+ limit?: number;
3031
+ cursor?: components["parameters"]["Cursor"];
3032
+ };
2790
3033
  header?: never;
2791
3034
  path?: never;
2792
3035
  cookie?: never;
2793
3036
  };
2794
3037
  requestBody?: never;
2795
3038
  responses: {
2796
- /** @description The workspace's channel connections (generic shape). */
3039
+ /** @description Channel connections page. */
2797
3040
  200: {
2798
3041
  headers: {
2799
3042
  [name: string]: unknown;
2800
3043
  };
2801
3044
  content: {
2802
- "application/json": components["schemas"]["ApiResponse_ChannelConnectionArray"];
3045
+ "application/json": components["schemas"]["PaginatedResponse_ChannelConnection"];
2803
3046
  };
2804
3047
  };
2805
3048
  default: components["responses"]["ApiError"];
@@ -2828,6 +3071,77 @@ interface operations {
2828
3071
  default: components["responses"]["ApiError"];
2829
3072
  };
2830
3073
  };
3074
+ createScan: {
3075
+ parameters: {
3076
+ query?: never;
3077
+ header?: never;
3078
+ path?: never;
3079
+ cookie?: never;
3080
+ };
3081
+ requestBody: {
3082
+ content: {
3083
+ "application/json": components["schemas"]["ScanCreateInput"];
3084
+ };
3085
+ };
3086
+ responses: {
3087
+ /** @description Scan job queued. */
3088
+ 202: {
3089
+ headers: {
3090
+ [name: string]: unknown;
3091
+ };
3092
+ content: {
3093
+ "application/json": components["schemas"]["ApiResponse_ScanCreateResult"];
3094
+ };
3095
+ };
3096
+ default: components["responses"]["ApiError"];
3097
+ };
3098
+ };
3099
+ searchScanCompanies: {
3100
+ parameters: {
3101
+ query: {
3102
+ q: string;
3103
+ };
3104
+ header?: never;
3105
+ path?: never;
3106
+ cookie?: never;
3107
+ };
3108
+ requestBody?: never;
3109
+ responses: {
3110
+ /** @description Registry matches (top 5, relevance-ranked). */
3111
+ 200: {
3112
+ headers: {
3113
+ [name: string]: unknown;
3114
+ };
3115
+ content: {
3116
+ "application/json": components["schemas"]["ApiResponse_ScanCompanyArray"];
3117
+ };
3118
+ };
3119
+ default: components["responses"]["ApiError"];
3120
+ };
3121
+ };
3122
+ getScan: {
3123
+ parameters: {
3124
+ query?: never;
3125
+ header?: never;
3126
+ path: {
3127
+ id: components["parameters"]["Id"];
3128
+ };
3129
+ cookie?: never;
3130
+ };
3131
+ requestBody?: never;
3132
+ responses: {
3133
+ /** @description Scan job status and, once done, the findings payload. */
3134
+ 200: {
3135
+ headers: {
3136
+ [name: string]: unknown;
3137
+ };
3138
+ content: {
3139
+ "application/json": components["schemas"]["ApiResponse_ScanJob"];
3140
+ };
3141
+ };
3142
+ default: components["responses"]["ApiError"];
3143
+ };
3144
+ };
2831
3145
  }
2832
3146
 
2833
3147
  export type { $defs, components, operations, paths, webhooks };