@medalsocial/sdk 1.3.0 → 1.5.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/README.md +33 -1
- package/dist/openapi/medal-social.openapi.json +553 -40
- package/dist/pilot/index.d.mts +64 -324
- package/dist/pilot/index.d.ts +64 -324
- package/dist/pilot/index.js +5 -5
- package/dist/pilot/index.js.map +1 -1
- package/dist/pilot/index.mjs +5 -5
- package/dist/pilot/index.mjs.map +1 -1
- package/dist/src/index.d.mts +184 -5
- package/dist/src/index.d.ts +184 -5
- package/dist/src/index.js +71 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +70 -2
- package/dist/src/index.mjs.map +1 -1
- package/dist/src/openapi.generated.d.mts +305 -1
- package/dist/src/openapi.generated.d.ts +305 -1
- package/dist/src/openapi.generated.js.map +1 -1
- package/openapi/medal-social.openapi.yaml +315 -3
- package/package.json +14 -14
|
@@ -610,6 +610,91 @@ interface paths {
|
|
|
610
610
|
patch?: never;
|
|
611
611
|
trace?: never;
|
|
612
612
|
};
|
|
613
|
+
"/api/v1/channels/connect-links": {
|
|
614
|
+
parameters: {
|
|
615
|
+
query?: never;
|
|
616
|
+
header?: never;
|
|
617
|
+
path?: never;
|
|
618
|
+
cookie?: never;
|
|
619
|
+
};
|
|
620
|
+
/**
|
|
621
|
+
* List connect links
|
|
622
|
+
* @description Link tokens are never returned.
|
|
623
|
+
*/
|
|
624
|
+
get: operations["listChannelConnectLinks"];
|
|
625
|
+
put?: never;
|
|
626
|
+
/**
|
|
627
|
+
* Mint a hosted connect link
|
|
628
|
+
* @description Mints a single-use hosted connect link that lets an external person (no Medal account required) attach a channel account (e.g. `telegram_inbox`) to the workspace's helpdesk. The response's `data.url` contains the one-time link token EXACTLY ONCE — an idempotent replay (same `Idempotency-Key`) returns the link WITHOUT `url`. Requires the `channel.connect.manage` scope; OAuth callers additionally need the workspace `admin` role.
|
|
629
|
+
*/
|
|
630
|
+
post: operations["createChannelConnectLink"];
|
|
631
|
+
delete?: never;
|
|
632
|
+
options?: never;
|
|
633
|
+
head?: never;
|
|
634
|
+
patch?: never;
|
|
635
|
+
trace?: never;
|
|
636
|
+
};
|
|
637
|
+
"/api/v1/channels/connect-links/{id}": {
|
|
638
|
+
parameters: {
|
|
639
|
+
query?: never;
|
|
640
|
+
header?: never;
|
|
641
|
+
path: {
|
|
642
|
+
id: components["parameters"]["Id"];
|
|
643
|
+
};
|
|
644
|
+
cookie?: never;
|
|
645
|
+
};
|
|
646
|
+
get?: never;
|
|
647
|
+
put?: never;
|
|
648
|
+
post?: never;
|
|
649
|
+
/**
|
|
650
|
+
* Revoke a connect link
|
|
651
|
+
* @description Revokes a pending connect link so it can no longer be consumed. OAuth callers need the workspace `admin` role.
|
|
652
|
+
*/
|
|
653
|
+
delete: operations["revokeChannelConnectLink"];
|
|
654
|
+
options?: never;
|
|
655
|
+
head?: never;
|
|
656
|
+
patch?: never;
|
|
657
|
+
trace?: never;
|
|
658
|
+
};
|
|
659
|
+
"/api/v1/channels/connections": {
|
|
660
|
+
parameters: {
|
|
661
|
+
query?: never;
|
|
662
|
+
header?: never;
|
|
663
|
+
path?: never;
|
|
664
|
+
cookie?: never;
|
|
665
|
+
};
|
|
666
|
+
/** List channel connections */
|
|
667
|
+
get: operations["listChannelConnections"];
|
|
668
|
+
put?: never;
|
|
669
|
+
post?: never;
|
|
670
|
+
delete?: never;
|
|
671
|
+
options?: never;
|
|
672
|
+
head?: never;
|
|
673
|
+
patch?: never;
|
|
674
|
+
trace?: never;
|
|
675
|
+
};
|
|
676
|
+
"/api/v1/channels/connections/{id}": {
|
|
677
|
+
parameters: {
|
|
678
|
+
query?: never;
|
|
679
|
+
header?: never;
|
|
680
|
+
path: {
|
|
681
|
+
id: components["parameters"]["Id"];
|
|
682
|
+
};
|
|
683
|
+
cookie?: never;
|
|
684
|
+
};
|
|
685
|
+
get?: never;
|
|
686
|
+
put?: never;
|
|
687
|
+
post?: never;
|
|
688
|
+
/**
|
|
689
|
+
* Disconnect a channel connection
|
|
690
|
+
* @description Disconnects a connected channel account (best-effort platform logout, then local revoke). Emits a `helpdesk.channel_disconnected` webhook event with `reason: "api_disconnect"` if the account was previously connected. OAuth callers need the workspace `admin` role.
|
|
691
|
+
*/
|
|
692
|
+
delete: operations["disconnectChannelConnection"];
|
|
693
|
+
options?: never;
|
|
694
|
+
head?: never;
|
|
695
|
+
patch?: never;
|
|
696
|
+
trace?: never;
|
|
697
|
+
};
|
|
613
698
|
}
|
|
614
699
|
type webhooks = Record<string, never>;
|
|
615
700
|
interface components {
|
|
@@ -712,9 +797,18 @@ interface components {
|
|
|
712
797
|
[key: string]: string;
|
|
713
798
|
};
|
|
714
799
|
contact_id?: string;
|
|
800
|
+
idempotency_key?: string;
|
|
801
|
+
/** Format: email */
|
|
802
|
+
copy_to?: string;
|
|
803
|
+
/** Format: email */
|
|
804
|
+
copy_reply_to?: string;
|
|
715
805
|
};
|
|
716
806
|
EmailSendResult: {
|
|
717
|
-
id
|
|
807
|
+
/** @description Email send id — poll GET /api/v1/emails/{id} with it. */
|
|
808
|
+
id: string | null;
|
|
809
|
+
/** @description Send id of the copy_to copy, or null when no copy was requested. */
|
|
810
|
+
copy_id: string | null;
|
|
811
|
+
contact_id: string | null;
|
|
718
812
|
status: string;
|
|
719
813
|
};
|
|
720
814
|
EmailSend: {
|
|
@@ -756,6 +850,18 @@ interface components {
|
|
|
756
850
|
total: number;
|
|
757
851
|
queued: number;
|
|
758
852
|
failed: number;
|
|
853
|
+
/** @description Per-recipient outcome, in request order. */
|
|
854
|
+
results: components["schemas"]["BatchSendRecipientResult"][];
|
|
855
|
+
};
|
|
856
|
+
BatchSendRecipientResult: {
|
|
857
|
+
/** Format: email */
|
|
858
|
+
email: string;
|
|
859
|
+
/** @description Email send id — poll GET /api/v1/emails/{id} with it. Null when not queued. */
|
|
860
|
+
id: string | null;
|
|
861
|
+
/** @enum {string} */
|
|
862
|
+
status: "queued" | "failed";
|
|
863
|
+
/** @description Failure reason for recipients that were not queued. */
|
|
864
|
+
error: string | null;
|
|
759
865
|
};
|
|
760
866
|
EmailTemplate: {
|
|
761
867
|
id: string;
|
|
@@ -1221,6 +1327,68 @@ interface components {
|
|
|
1221
1327
|
/** @constant */
|
|
1222
1328
|
status: "queued";
|
|
1223
1329
|
};
|
|
1330
|
+
/** @enum {string} */
|
|
1331
|
+
ConnectLinkStatus: "pending" | "consumed" | "expired" | "revoked";
|
|
1332
|
+
/** @enum {string} */
|
|
1333
|
+
ChannelConnectionState: "connecting" | "active" | "disconnected" | "disabled";
|
|
1334
|
+
CreateConnectLinkInput: {
|
|
1335
|
+
/** @description Channel type to connect (e.g. `telegram_inbox`). */
|
|
1336
|
+
channel_type: string;
|
|
1337
|
+
/** @description Display label shown on the hosted connect page. */
|
|
1338
|
+
label?: string;
|
|
1339
|
+
/**
|
|
1340
|
+
* Format: uri
|
|
1341
|
+
* @description URL the hosted page redirects to after a successful connect — must be https.
|
|
1342
|
+
*/
|
|
1343
|
+
redirect_url?: string;
|
|
1344
|
+
};
|
|
1345
|
+
ConnectLinkCreateResult: {
|
|
1346
|
+
id: string;
|
|
1347
|
+
/**
|
|
1348
|
+
* Format: uri
|
|
1349
|
+
* @description Single-use hosted connect URL containing the one-time link token — present ONLY in the live create response. An idempotent replay of the create request omits it; the token can never be retrieved again.
|
|
1350
|
+
*/
|
|
1351
|
+
url?: string;
|
|
1352
|
+
channel_type: string;
|
|
1353
|
+
label: string | null;
|
|
1354
|
+
status: components["schemas"]["ConnectLinkStatus"];
|
|
1355
|
+
/** @description Unix timestamp in milliseconds. */
|
|
1356
|
+
expires_at: number;
|
|
1357
|
+
};
|
|
1358
|
+
ConnectLink: {
|
|
1359
|
+
id: string;
|
|
1360
|
+
channel_type: string;
|
|
1361
|
+
label: string | null;
|
|
1362
|
+
status: components["schemas"]["ConnectLinkStatus"];
|
|
1363
|
+
/** @description Stable ref of the connection created by consuming this link, or `null`. */
|
|
1364
|
+
consumed_connection_ref: string | null;
|
|
1365
|
+
/** @description Unix timestamp in milliseconds. */
|
|
1366
|
+
expires_at: number;
|
|
1367
|
+
/** @description Unix timestamp in milliseconds. */
|
|
1368
|
+
created_at: number;
|
|
1369
|
+
};
|
|
1370
|
+
ConnectLinkRevokeResult: {
|
|
1371
|
+
id: string;
|
|
1372
|
+
/** @constant */
|
|
1373
|
+
status: "revoked";
|
|
1374
|
+
};
|
|
1375
|
+
ChannelConnection: {
|
|
1376
|
+
id: string;
|
|
1377
|
+
channel_type: string;
|
|
1378
|
+
label: string | null;
|
|
1379
|
+
state: components["schemas"]["ChannelConnectionState"];
|
|
1380
|
+
/** @description Privacy-preserving identity handle (e.g. a masked phone number). */
|
|
1381
|
+
masked_identity: string;
|
|
1382
|
+
/** @description Unix timestamp in milliseconds, or `null` if never active. */
|
|
1383
|
+
last_activity_at: number | null;
|
|
1384
|
+
/** @description Linked helpdesk channel connection ID, or `null`. */
|
|
1385
|
+
helpdesk_connection_id: string | null;
|
|
1386
|
+
};
|
|
1387
|
+
ChannelConnectionDisconnectResult: {
|
|
1388
|
+
id: string;
|
|
1389
|
+
/** @constant */
|
|
1390
|
+
state: "disconnected";
|
|
1391
|
+
};
|
|
1224
1392
|
ApiResponse_PostCreateResult: components["schemas"]["Envelope_PostCreateResult"];
|
|
1225
1393
|
ApiResponse_PostDetail: components["schemas"]["Envelope_PostDetail"];
|
|
1226
1394
|
ApiResponse_Success: components["schemas"]["Envelope_Success"];
|
|
@@ -1256,6 +1424,11 @@ interface components {
|
|
|
1256
1424
|
ApiResponse_WebhookDeleteResult: components["schemas"]["Envelope_WebhookDeleteResult"];
|
|
1257
1425
|
ApiResponse_WebhookDeliveryArray: components["schemas"]["Envelope_WebhookDeliveryArray"];
|
|
1258
1426
|
ApiResponse_WebhookTestResult: components["schemas"]["Envelope_WebhookTestResult"];
|
|
1427
|
+
ApiResponse_ConnectLinkCreateResult: components["schemas"]["Envelope_ConnectLinkCreateResult"];
|
|
1428
|
+
ApiResponse_ConnectLinkArray: components["schemas"]["Envelope_ConnectLinkArray"];
|
|
1429
|
+
ApiResponse_ConnectLinkRevokeResult: components["schemas"]["Envelope_ConnectLinkRevokeResult"];
|
|
1430
|
+
ApiResponse_ChannelConnectionArray: components["schemas"]["Envelope_ChannelConnectionArray"];
|
|
1431
|
+
ApiResponse_ChannelConnectionDisconnectResult: components["schemas"]["Envelope_ChannelConnectionDisconnectResult"];
|
|
1259
1432
|
PaginatedResponse_Post: {
|
|
1260
1433
|
data: components["schemas"]["Post"][];
|
|
1261
1434
|
pagination: components["schemas"]["Pagination"];
|
|
@@ -1385,6 +1558,21 @@ interface components {
|
|
|
1385
1558
|
Envelope_WebhookTestResult: {
|
|
1386
1559
|
data: components["schemas"]["WebhookTestResult"];
|
|
1387
1560
|
};
|
|
1561
|
+
Envelope_ConnectLinkCreateResult: {
|
|
1562
|
+
data: components["schemas"]["ConnectLinkCreateResult"];
|
|
1563
|
+
};
|
|
1564
|
+
Envelope_ConnectLinkArray: {
|
|
1565
|
+
data: components["schemas"]["ConnectLink"][];
|
|
1566
|
+
};
|
|
1567
|
+
Envelope_ConnectLinkRevokeResult: {
|
|
1568
|
+
data: components["schemas"]["ConnectLinkRevokeResult"];
|
|
1569
|
+
};
|
|
1570
|
+
Envelope_ChannelConnectionArray: {
|
|
1571
|
+
data: components["schemas"]["ChannelConnection"][];
|
|
1572
|
+
};
|
|
1573
|
+
Envelope_ChannelConnectionDisconnectResult: {
|
|
1574
|
+
data: components["schemas"]["ChannelConnectionDisconnectResult"];
|
|
1575
|
+
};
|
|
1388
1576
|
};
|
|
1389
1577
|
responses: {
|
|
1390
1578
|
/** @description API error. */
|
|
@@ -2524,6 +2712,122 @@ interface operations {
|
|
|
2524
2712
|
default: components["responses"]["ApiError"];
|
|
2525
2713
|
};
|
|
2526
2714
|
};
|
|
2715
|
+
listChannelConnectLinks: {
|
|
2716
|
+
parameters: {
|
|
2717
|
+
query?: {
|
|
2718
|
+
channel_type?: string;
|
|
2719
|
+
status?: components["schemas"]["ConnectLinkStatus"];
|
|
2720
|
+
};
|
|
2721
|
+
header?: never;
|
|
2722
|
+
path?: never;
|
|
2723
|
+
cookie?: never;
|
|
2724
|
+
};
|
|
2725
|
+
requestBody?: never;
|
|
2726
|
+
responses: {
|
|
2727
|
+
/** @description The workspace's connect links. */
|
|
2728
|
+
200: {
|
|
2729
|
+
headers: {
|
|
2730
|
+
[name: string]: unknown;
|
|
2731
|
+
};
|
|
2732
|
+
content: {
|
|
2733
|
+
"application/json": components["schemas"]["ApiResponse_ConnectLinkArray"];
|
|
2734
|
+
};
|
|
2735
|
+
};
|
|
2736
|
+
default: components["responses"]["ApiError"];
|
|
2737
|
+
};
|
|
2738
|
+
};
|
|
2739
|
+
createChannelConnectLink: {
|
|
2740
|
+
parameters: {
|
|
2741
|
+
query?: never;
|
|
2742
|
+
header?: never;
|
|
2743
|
+
path?: never;
|
|
2744
|
+
cookie?: never;
|
|
2745
|
+
};
|
|
2746
|
+
requestBody: {
|
|
2747
|
+
content: {
|
|
2748
|
+
"application/json": components["schemas"]["CreateConnectLinkInput"];
|
|
2749
|
+
};
|
|
2750
|
+
};
|
|
2751
|
+
responses: {
|
|
2752
|
+
/** @description Minted connect link, including the one-time `url`. */
|
|
2753
|
+
201: {
|
|
2754
|
+
headers: {
|
|
2755
|
+
[name: string]: unknown;
|
|
2756
|
+
};
|
|
2757
|
+
content: {
|
|
2758
|
+
"application/json": components["schemas"]["ApiResponse_ConnectLinkCreateResult"];
|
|
2759
|
+
};
|
|
2760
|
+
};
|
|
2761
|
+
default: components["responses"]["ApiError"];
|
|
2762
|
+
};
|
|
2763
|
+
};
|
|
2764
|
+
revokeChannelConnectLink: {
|
|
2765
|
+
parameters: {
|
|
2766
|
+
query?: never;
|
|
2767
|
+
header?: never;
|
|
2768
|
+
path: {
|
|
2769
|
+
id: components["parameters"]["Id"];
|
|
2770
|
+
};
|
|
2771
|
+
cookie?: never;
|
|
2772
|
+
};
|
|
2773
|
+
requestBody?: never;
|
|
2774
|
+
responses: {
|
|
2775
|
+
/** @description Revoke result. */
|
|
2776
|
+
200: {
|
|
2777
|
+
headers: {
|
|
2778
|
+
[name: string]: unknown;
|
|
2779
|
+
};
|
|
2780
|
+
content: {
|
|
2781
|
+
"application/json": components["schemas"]["ApiResponse_ConnectLinkRevokeResult"];
|
|
2782
|
+
};
|
|
2783
|
+
};
|
|
2784
|
+
default: components["responses"]["ApiError"];
|
|
2785
|
+
};
|
|
2786
|
+
};
|
|
2787
|
+
listChannelConnections: {
|
|
2788
|
+
parameters: {
|
|
2789
|
+
query?: never;
|
|
2790
|
+
header?: never;
|
|
2791
|
+
path?: never;
|
|
2792
|
+
cookie?: never;
|
|
2793
|
+
};
|
|
2794
|
+
requestBody?: never;
|
|
2795
|
+
responses: {
|
|
2796
|
+
/** @description The workspace's channel connections (generic shape). */
|
|
2797
|
+
200: {
|
|
2798
|
+
headers: {
|
|
2799
|
+
[name: string]: unknown;
|
|
2800
|
+
};
|
|
2801
|
+
content: {
|
|
2802
|
+
"application/json": components["schemas"]["ApiResponse_ChannelConnectionArray"];
|
|
2803
|
+
};
|
|
2804
|
+
};
|
|
2805
|
+
default: components["responses"]["ApiError"];
|
|
2806
|
+
};
|
|
2807
|
+
};
|
|
2808
|
+
disconnectChannelConnection: {
|
|
2809
|
+
parameters: {
|
|
2810
|
+
query?: never;
|
|
2811
|
+
header?: never;
|
|
2812
|
+
path: {
|
|
2813
|
+
id: components["parameters"]["Id"];
|
|
2814
|
+
};
|
|
2815
|
+
cookie?: never;
|
|
2816
|
+
};
|
|
2817
|
+
requestBody?: never;
|
|
2818
|
+
responses: {
|
|
2819
|
+
/** @description Disconnect result. */
|
|
2820
|
+
200: {
|
|
2821
|
+
headers: {
|
|
2822
|
+
[name: string]: unknown;
|
|
2823
|
+
};
|
|
2824
|
+
content: {
|
|
2825
|
+
"application/json": components["schemas"]["ApiResponse_ChannelConnectionDisconnectResult"];
|
|
2826
|
+
};
|
|
2827
|
+
};
|
|
2828
|
+
default: components["responses"]["ApiError"];
|
|
2829
|
+
};
|
|
2830
|
+
};
|
|
2527
2831
|
}
|
|
2528
2832
|
|
|
2529
2833
|
export type { $defs, components, operations, paths, webhooks };
|