@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.
- package/README.md +145 -1
- package/dist/openapi/medal-social.openapi.json +725 -5
- package/dist/src/index.d.mts +788 -240
- package/dist/src/index.d.ts +788 -240
- package/dist/src/index.js +310 -26
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +305 -26
- package/dist/src/index.mjs.map +1 -1
- package/dist/src/openapi.generated.d.mts +321 -7
- package/dist/src/openapi.generated.d.ts +321 -7
- package/dist/src/openapi.generated.js.map +1 -1
- package/openapi/medal-social.openapi.yaml +428 -5
- package/package.json +1 -1
- package/skills/resources/SKILL.md +3 -2
|
@@ -29,10 +29,19 @@ tags:
|
|
|
29
29
|
description: Read helpdesk conversations, reply, and manage assignment/status.
|
|
30
30
|
- name: Webhooks
|
|
31
31
|
description: Manage webhook endpoints and inspect their deliveries.
|
|
32
|
+
- name: Capabilities
|
|
33
|
+
description: >-
|
|
34
|
+
Mint short-lived capability confirmation tokens for confirmable write
|
|
35
|
+
routes.
|
|
32
36
|
- name: Channels
|
|
33
37
|
description: >-
|
|
34
38
|
Partner channel connect — mint hosted connect links and manage the
|
|
35
39
|
resulting channel connections.
|
|
40
|
+
- name: Scan
|
|
41
|
+
description: >-
|
|
42
|
+
Company & website scans (Nettsjekk) — queue a scan by URL, organisation
|
|
43
|
+
number, or company name, poll the result, and search the Norwegian
|
|
44
|
+
company registry.
|
|
36
45
|
paths:
|
|
37
46
|
/api/v1/posts:
|
|
38
47
|
get:
|
|
@@ -930,6 +939,34 @@ paths:
|
|
|
930
939
|
$ref: "#/components/schemas/ApiResponse_WebhookTestResult"
|
|
931
940
|
default:
|
|
932
941
|
$ref: "#/components/responses/ApiError"
|
|
942
|
+
/api/v1/capability-confirmations:
|
|
943
|
+
post:
|
|
944
|
+
tags: [Capabilities]
|
|
945
|
+
operationId: issueCapabilityConfirmation
|
|
946
|
+
summary: Issue a capability confirmation token
|
|
947
|
+
description: >-
|
|
948
|
+
Mints a short-lived `X-Capability-Confirmation` token for one pending
|
|
949
|
+
write. Confirmable write routes require BOTH `Idempotency-Key` and
|
|
950
|
+
`X-Capability-Confirmation` when the credential holds the capability
|
|
951
|
+
scope directly; API keys with legacy scopes are exempt. The token is
|
|
952
|
+
bound to the workspace, auth subject, method, path, required scopes and
|
|
953
|
+
idempotency key, and expires within 15 minutes. `user_approved: true`
|
|
954
|
+
asserts that a human on the caller's side approved this exact action.
|
|
955
|
+
requestBody:
|
|
956
|
+
required: true
|
|
957
|
+
content:
|
|
958
|
+
application/json:
|
|
959
|
+
schema:
|
|
960
|
+
$ref: "#/components/schemas/IssueCapabilityConfirmationInput"
|
|
961
|
+
responses:
|
|
962
|
+
"200":
|
|
963
|
+
description: Minted confirmation token.
|
|
964
|
+
content:
|
|
965
|
+
application/json:
|
|
966
|
+
schema:
|
|
967
|
+
$ref: "#/components/schemas/ApiResponse_CapabilityConfirmation"
|
|
968
|
+
default:
|
|
969
|
+
$ref: "#/components/responses/ApiError"
|
|
933
970
|
/api/v1/channels/connect-links:
|
|
934
971
|
post:
|
|
935
972
|
tags: [Channels]
|
|
@@ -962,8 +999,20 @@ paths:
|
|
|
962
999
|
tags: [Channels]
|
|
963
1000
|
operationId: listChannelConnectLinks
|
|
964
1001
|
summary: List connect links
|
|
965
|
-
description:
|
|
1002
|
+
description: >-
|
|
1003
|
+
Link tokens are never returned. Newest first, cursor-paginated. The
|
|
1004
|
+
`channel_type` / `status` filters are applied within each page, so a
|
|
1005
|
+
page may hold fewer than `limit` items while `pagination.has_more` is
|
|
1006
|
+
still true — page off `has_more`, not the item count.
|
|
966
1007
|
parameters:
|
|
1008
|
+
- name: limit
|
|
1009
|
+
in: query
|
|
1010
|
+
schema:
|
|
1011
|
+
type: integer
|
|
1012
|
+
minimum: 1
|
|
1013
|
+
maximum: 100
|
|
1014
|
+
description: Page size (default 50, capped at 100).
|
|
1015
|
+
- $ref: "#/components/parameters/Cursor"
|
|
967
1016
|
- name: channel_type
|
|
968
1017
|
in: query
|
|
969
1018
|
schema:
|
|
@@ -974,11 +1023,11 @@ paths:
|
|
|
974
1023
|
$ref: "#/components/schemas/ConnectLinkStatus"
|
|
975
1024
|
responses:
|
|
976
1025
|
"200":
|
|
977
|
-
description:
|
|
1026
|
+
description: Connect links page.
|
|
978
1027
|
content:
|
|
979
1028
|
application/json:
|
|
980
1029
|
schema:
|
|
981
|
-
$ref: "#/components/schemas/
|
|
1030
|
+
$ref: "#/components/schemas/PaginatedResponse_ConnectLink"
|
|
982
1031
|
default:
|
|
983
1032
|
$ref: "#/components/responses/ApiError"
|
|
984
1033
|
/api/v1/channels/connect-links/{id}:
|
|
@@ -1005,13 +1054,28 @@ paths:
|
|
|
1005
1054
|
tags: [Channels]
|
|
1006
1055
|
operationId: listChannelConnections
|
|
1007
1056
|
summary: List channel connections
|
|
1057
|
+
description: >-
|
|
1058
|
+
The workspace's channel connections in a generic, channel-agnostic
|
|
1059
|
+
shape. Newest first, cursor-paginated. Rows that are not projectable
|
|
1060
|
+
as connections are dropped within the page, so a page may hold fewer
|
|
1061
|
+
than `limit` items while `pagination.has_more` is still true — page
|
|
1062
|
+
off `has_more`, not the item count.
|
|
1063
|
+
parameters:
|
|
1064
|
+
- name: limit
|
|
1065
|
+
in: query
|
|
1066
|
+
schema:
|
|
1067
|
+
type: integer
|
|
1068
|
+
minimum: 1
|
|
1069
|
+
maximum: 100
|
|
1070
|
+
description: Page size (default 50, capped at 100).
|
|
1071
|
+
- $ref: "#/components/parameters/Cursor"
|
|
1008
1072
|
responses:
|
|
1009
1073
|
"200":
|
|
1010
|
-
description:
|
|
1074
|
+
description: Channel connections page.
|
|
1011
1075
|
content:
|
|
1012
1076
|
application/json:
|
|
1013
1077
|
schema:
|
|
1014
|
-
$ref: "#/components/schemas/
|
|
1078
|
+
$ref: "#/components/schemas/PaginatedResponse_ChannelConnection"
|
|
1015
1079
|
default:
|
|
1016
1080
|
$ref: "#/components/responses/ApiError"
|
|
1017
1081
|
/api/v1/channels/connections/{id}:
|
|
@@ -1035,6 +1099,66 @@ paths:
|
|
|
1035
1099
|
$ref: "#/components/schemas/ApiResponse_ChannelConnectionDisconnectResult"
|
|
1036
1100
|
default:
|
|
1037
1101
|
$ref: "#/components/responses/ApiError"
|
|
1102
|
+
/api/v1/scan:
|
|
1103
|
+
post:
|
|
1104
|
+
tags: [Scan]
|
|
1105
|
+
operationId: createScan
|
|
1106
|
+
summary: Queue a company/site scan
|
|
1107
|
+
description: >-
|
|
1108
|
+
Queues an asynchronous scan. Provide exactly one of `url`, `orgnr`, or
|
|
1109
|
+
`name`; poll the returned id via `GET /api/v1/scan/{id}`.
|
|
1110
|
+
requestBody:
|
|
1111
|
+
required: true
|
|
1112
|
+
content:
|
|
1113
|
+
application/json:
|
|
1114
|
+
schema:
|
|
1115
|
+
$ref: "#/components/schemas/ScanCreateInput"
|
|
1116
|
+
responses:
|
|
1117
|
+
"202":
|
|
1118
|
+
description: Scan job queued.
|
|
1119
|
+
content:
|
|
1120
|
+
application/json:
|
|
1121
|
+
schema:
|
|
1122
|
+
$ref: "#/components/schemas/ApiResponse_ScanCreateResult"
|
|
1123
|
+
default:
|
|
1124
|
+
$ref: "#/components/responses/ApiError"
|
|
1125
|
+
/api/v1/scan/companies:
|
|
1126
|
+
get:
|
|
1127
|
+
tags: [Scan]
|
|
1128
|
+
operationId: searchScanCompanies
|
|
1129
|
+
summary: Search the Norwegian company registry
|
|
1130
|
+
parameters:
|
|
1131
|
+
- name: q
|
|
1132
|
+
in: query
|
|
1133
|
+
required: true
|
|
1134
|
+
schema:
|
|
1135
|
+
type: string
|
|
1136
|
+
minLength: 2
|
|
1137
|
+
responses:
|
|
1138
|
+
"200":
|
|
1139
|
+
description: Registry matches (top 5, relevance-ranked).
|
|
1140
|
+
content:
|
|
1141
|
+
application/json:
|
|
1142
|
+
schema:
|
|
1143
|
+
$ref: "#/components/schemas/ApiResponse_ScanCompanyArray"
|
|
1144
|
+
default:
|
|
1145
|
+
$ref: "#/components/responses/ApiError"
|
|
1146
|
+
/api/v1/scan/{id}:
|
|
1147
|
+
parameters:
|
|
1148
|
+
- $ref: "#/components/parameters/Id"
|
|
1149
|
+
get:
|
|
1150
|
+
tags: [Scan]
|
|
1151
|
+
operationId: getScan
|
|
1152
|
+
summary: Get a scan job
|
|
1153
|
+
responses:
|
|
1154
|
+
"200":
|
|
1155
|
+
description: Scan job status and, once done, the findings payload.
|
|
1156
|
+
content:
|
|
1157
|
+
application/json:
|
|
1158
|
+
schema:
|
|
1159
|
+
$ref: "#/components/schemas/ApiResponse_ScanJob"
|
|
1160
|
+
default:
|
|
1161
|
+
$ref: "#/components/responses/ApiError"
|
|
1038
1162
|
components:
|
|
1039
1163
|
securitySchemes:
|
|
1040
1164
|
bearerAuth:
|
|
@@ -2154,6 +2278,8 @@ components:
|
|
|
2154
2278
|
- author_user_id
|
|
2155
2279
|
- author_name
|
|
2156
2280
|
- body
|
|
2281
|
+
- delivery_status
|
|
2282
|
+
- delivery_error
|
|
2157
2283
|
- created_at
|
|
2158
2284
|
properties:
|
|
2159
2285
|
id:
|
|
@@ -2170,9 +2296,26 @@ components:
|
|
|
2170
2296
|
type: [string, "null"]
|
|
2171
2297
|
body:
|
|
2172
2298
|
type: string
|
|
2299
|
+
delivery_status:
|
|
2300
|
+
oneOf:
|
|
2301
|
+
- $ref: "#/components/schemas/HelpdeskMessageDeliveryStatus"
|
|
2302
|
+
- type: "null"
|
|
2303
|
+
description: >-
|
|
2304
|
+
Outbound delivery state, or `null` for inbound messages and
|
|
2305
|
+
internal notes. A `201` from `POST /api/v1/helpdesk/replies` means
|
|
2306
|
+
the reply was accepted, NOT delivered — the channel hand-off is
|
|
2307
|
+
asynchronous, so poll this field (or subscribe to
|
|
2308
|
+
`helpdesk.message_delivery_updated`) to learn the outcome.
|
|
2309
|
+
delivery_error:
|
|
2310
|
+
type: [string, "null"]
|
|
2311
|
+
description: >-
|
|
2312
|
+
Last send error for a `failed` outbound message, otherwise `null`.
|
|
2173
2313
|
created_at:
|
|
2174
2314
|
type: integer
|
|
2175
2315
|
description: Unix timestamp in milliseconds.
|
|
2316
|
+
HelpdeskMessageDeliveryStatus:
|
|
2317
|
+
type: string
|
|
2318
|
+
enum: [pending, sent, delivered, failed]
|
|
2176
2319
|
UpdateHelpdeskConversationInput:
|
|
2177
2320
|
type: object
|
|
2178
2321
|
minProperties: 1
|
|
@@ -2363,9 +2506,22 @@ components:
|
|
|
2363
2506
|
const: deleted
|
|
2364
2507
|
WebhookDelivery:
|
|
2365
2508
|
type: object
|
|
2509
|
+
description: >-
|
|
2510
|
+
A delivery attempt record. `id` is the same value sent as the
|
|
2511
|
+
`X-Medal-Delivery-Id` and `Idempotency-Key` headers on the outbound
|
|
2512
|
+
request. Deliveries never carry payload bodies (payloads can contain
|
|
2513
|
+
customer PII). The correlation fields are derived from the stored event
|
|
2514
|
+
and fail closed to `null` when no canonical event exists — e.g.
|
|
2515
|
+
`test.ping` deliveries or events that have aged out of retention.
|
|
2366
2516
|
required:
|
|
2367
2517
|
- id
|
|
2368
2518
|
- event_type
|
|
2519
|
+
- resource_id
|
|
2520
|
+
- conversation_id
|
|
2521
|
+
- message_id
|
|
2522
|
+
- connection_ref
|
|
2523
|
+
- channel
|
|
2524
|
+
- channel_connection_id
|
|
2369
2525
|
- status
|
|
2370
2526
|
- attempt_count
|
|
2371
2527
|
- next_attempt_at
|
|
@@ -2379,6 +2535,19 @@ components:
|
|
|
2379
2535
|
type: string
|
|
2380
2536
|
event_type:
|
|
2381
2537
|
type: string
|
|
2538
|
+
resource_id:
|
|
2539
|
+
type: [string, "null"]
|
|
2540
|
+
description: Primary subject id of the announced event, or `null`.
|
|
2541
|
+
conversation_id:
|
|
2542
|
+
type: [string, "null"]
|
|
2543
|
+
message_id:
|
|
2544
|
+
type: [string, "null"]
|
|
2545
|
+
connection_ref:
|
|
2546
|
+
type: [string, "null"]
|
|
2547
|
+
channel:
|
|
2548
|
+
type: [string, "null"]
|
|
2549
|
+
channel_connection_id:
|
|
2550
|
+
type: [string, "null"]
|
|
2382
2551
|
status:
|
|
2383
2552
|
type: string
|
|
2384
2553
|
enum: [pending, delivered, dead_letter]
|
|
@@ -2580,6 +2749,12 @@ components:
|
|
|
2580
2749
|
$ref: "#/components/schemas/Envelope_GdprExportArray"
|
|
2581
2750
|
ApiResponse_GdprExport:
|
|
2582
2751
|
$ref: "#/components/schemas/Envelope_GdprExport"
|
|
2752
|
+
ApiResponse_ScanCreateResult:
|
|
2753
|
+
$ref: "#/components/schemas/Envelope_ScanCreateResult"
|
|
2754
|
+
ApiResponse_ScanCompanyArray:
|
|
2755
|
+
$ref: "#/components/schemas/Envelope_ScanCompanyArray"
|
|
2756
|
+
ApiResponse_ScanJob:
|
|
2757
|
+
$ref: "#/components/schemas/Envelope_ScanJob"
|
|
2583
2758
|
ApiResponse_ConsentResult:
|
|
2584
2759
|
$ref: "#/components/schemas/Envelope_ConsentResult"
|
|
2585
2760
|
ApiResponse_ConsentRecordArray:
|
|
@@ -2604,6 +2779,11 @@ components:
|
|
|
2604
2779
|
$ref: "#/components/schemas/Envelope_WebhookTestResult"
|
|
2605
2780
|
ApiResponse_ConnectLinkCreateResult:
|
|
2606
2781
|
$ref: "#/components/schemas/Envelope_ConnectLinkCreateResult"
|
|
2782
|
+
# Deprecated: the channels listings are cursor-paginated and now respond
|
|
2783
|
+
# with PaginatedResponse_ConnectLink / PaginatedResponse_ChannelConnection.
|
|
2784
|
+
# These unpaginated aliases are retained (unreferenced by any operation)
|
|
2785
|
+
# so consumers importing the generated contract via
|
|
2786
|
+
# `@medalsocial/sdk/openapi-types` or `OpenApiComponents` keep compiling.
|
|
2607
2787
|
ApiResponse_ConnectLinkArray:
|
|
2608
2788
|
$ref: "#/components/schemas/Envelope_ConnectLinkArray"
|
|
2609
2789
|
ApiResponse_ConnectLinkRevokeResult:
|
|
@@ -2672,6 +2852,26 @@ components:
|
|
|
2672
2852
|
$ref: "#/components/schemas/HelpdeskMessage"
|
|
2673
2853
|
pagination:
|
|
2674
2854
|
$ref: "#/components/schemas/Pagination"
|
|
2855
|
+
PaginatedResponse_ConnectLink:
|
|
2856
|
+
type: object
|
|
2857
|
+
required: [data, pagination]
|
|
2858
|
+
properties:
|
|
2859
|
+
data:
|
|
2860
|
+
type: array
|
|
2861
|
+
items:
|
|
2862
|
+
$ref: "#/components/schemas/ConnectLink"
|
|
2863
|
+
pagination:
|
|
2864
|
+
$ref: "#/components/schemas/Pagination"
|
|
2865
|
+
PaginatedResponse_ChannelConnection:
|
|
2866
|
+
type: object
|
|
2867
|
+
required: [data, pagination]
|
|
2868
|
+
properties:
|
|
2869
|
+
data:
|
|
2870
|
+
type: array
|
|
2871
|
+
items:
|
|
2872
|
+
$ref: "#/components/schemas/ChannelConnection"
|
|
2873
|
+
pagination:
|
|
2874
|
+
$ref: "#/components/schemas/Pagination"
|
|
2675
2875
|
Envelope_PostCreateResult:
|
|
2676
2876
|
type: object
|
|
2677
2877
|
required: [data]
|
|
@@ -2802,6 +3002,131 @@ components:
|
|
|
2802
3002
|
properties:
|
|
2803
3003
|
data:
|
|
2804
3004
|
$ref: "#/components/schemas/DealRemoveResult"
|
|
3005
|
+
ScanCreateInput:
|
|
3006
|
+
type: object
|
|
3007
|
+
description: Provide exactly one of `url`, `orgnr`, or `name`.
|
|
3008
|
+
oneOf:
|
|
3009
|
+
- required: [url]
|
|
3010
|
+
not:
|
|
3011
|
+
anyOf: [{ required: [orgnr] }, { required: [name] }]
|
|
3012
|
+
- required: [orgnr]
|
|
3013
|
+
not:
|
|
3014
|
+
anyOf: [{ required: [url] }, { required: [name] }]
|
|
3015
|
+
- required: [name]
|
|
3016
|
+
not:
|
|
3017
|
+
anyOf: [{ required: [url] }, { required: [orgnr] }]
|
|
3018
|
+
properties:
|
|
3019
|
+
url:
|
|
3020
|
+
type: string
|
|
3021
|
+
minLength: 4
|
|
3022
|
+
maxLength: 500
|
|
3023
|
+
orgnr:
|
|
3024
|
+
type: string
|
|
3025
|
+
pattern: "^\\d{9}$"
|
|
3026
|
+
name:
|
|
3027
|
+
type: string
|
|
3028
|
+
minLength: 2
|
|
3029
|
+
maxLength: 120
|
|
3030
|
+
ScanCreateResult:
|
|
3031
|
+
type: object
|
|
3032
|
+
required: [id, status]
|
|
3033
|
+
properties:
|
|
3034
|
+
id:
|
|
3035
|
+
type: string
|
|
3036
|
+
status:
|
|
3037
|
+
type: string
|
|
3038
|
+
message:
|
|
3039
|
+
type: string
|
|
3040
|
+
ScanCompany:
|
|
3041
|
+
type: object
|
|
3042
|
+
required: [orgnr, name, org_form, industry, city, website]
|
|
3043
|
+
properties:
|
|
3044
|
+
orgnr:
|
|
3045
|
+
type: string
|
|
3046
|
+
name:
|
|
3047
|
+
type: string
|
|
3048
|
+
org_form:
|
|
3049
|
+
type: [string, "null"]
|
|
3050
|
+
industry:
|
|
3051
|
+
type: [string, "null"]
|
|
3052
|
+
city:
|
|
3053
|
+
type: [string, "null"]
|
|
3054
|
+
website:
|
|
3055
|
+
type: [string, "null"]
|
|
3056
|
+
ScanJob:
|
|
3057
|
+
type: object
|
|
3058
|
+
required: [id, status, input, resolved, result, error, created_at, finished_at]
|
|
3059
|
+
properties:
|
|
3060
|
+
id:
|
|
3061
|
+
type: string
|
|
3062
|
+
status:
|
|
3063
|
+
type: string
|
|
3064
|
+
description: pending | running | done | failed
|
|
3065
|
+
input:
|
|
3066
|
+
$ref: "#/components/schemas/ScanCreateInput"
|
|
3067
|
+
resolved:
|
|
3068
|
+
type: [object, "null"]
|
|
3069
|
+
properties:
|
|
3070
|
+
orgnr:
|
|
3071
|
+
type: string
|
|
3072
|
+
companyName:
|
|
3073
|
+
type: string
|
|
3074
|
+
websiteUrl:
|
|
3075
|
+
type: string
|
|
3076
|
+
result:
|
|
3077
|
+
type: [object, "null"]
|
|
3078
|
+
description: >-
|
|
3079
|
+
Versioned findings payload (see the SDK `ScanResultPayload` type);
|
|
3080
|
+
additive per `version`. The stable core is documented below;
|
|
3081
|
+
further sections (registry, signals, pagespeed, seo, ai, gdpr,
|
|
3082
|
+
mailAuth, httpsOk) evolve additively.
|
|
3083
|
+
required: [version, nettskaar, subScores]
|
|
3084
|
+
properties:
|
|
3085
|
+
version:
|
|
3086
|
+
type: integer
|
|
3087
|
+
nettskaar:
|
|
3088
|
+
type: [integer, "null"]
|
|
3089
|
+
description: Weighted composite score (0-100); null when unmeasurable.
|
|
3090
|
+
subScores:
|
|
3091
|
+
type: object
|
|
3092
|
+
description: Per-axis 0-100 scores; null axes were unmeasurable.
|
|
3093
|
+
required: [fart, google, ai, trygghet, omdomme]
|
|
3094
|
+
properties:
|
|
3095
|
+
fart: { type: [integer, "null"] }
|
|
3096
|
+
google: { type: [integer, "null"] }
|
|
3097
|
+
ai: { type: [integer, "null"] }
|
|
3098
|
+
trygghet: { type: [integer, "null"] }
|
|
3099
|
+
omdomme: { type: [integer, "null"] }
|
|
3100
|
+
additionalProperties: true
|
|
3101
|
+
error:
|
|
3102
|
+
type: [string, "null"]
|
|
3103
|
+
description: Public-safe failure code (company_not_found, no_website, …).
|
|
3104
|
+
created_at:
|
|
3105
|
+
type: [string, "null"]
|
|
3106
|
+
format: date-time
|
|
3107
|
+
finished_at:
|
|
3108
|
+
type: [string, "null"]
|
|
3109
|
+
format: date-time
|
|
3110
|
+
Envelope_ScanCreateResult:
|
|
3111
|
+
type: object
|
|
3112
|
+
required: [data]
|
|
3113
|
+
properties:
|
|
3114
|
+
data:
|
|
3115
|
+
$ref: "#/components/schemas/ScanCreateResult"
|
|
3116
|
+
Envelope_ScanCompanyArray:
|
|
3117
|
+
type: object
|
|
3118
|
+
required: [data]
|
|
3119
|
+
properties:
|
|
3120
|
+
data:
|
|
3121
|
+
type: array
|
|
3122
|
+
items:
|
|
3123
|
+
$ref: "#/components/schemas/ScanCompany"
|
|
3124
|
+
Envelope_ScanJob:
|
|
3125
|
+
type: object
|
|
3126
|
+
required: [data]
|
|
3127
|
+
properties:
|
|
3128
|
+
data:
|
|
3129
|
+
$ref: "#/components/schemas/ScanJob"
|
|
2805
3130
|
Envelope_GdprExportRequest:
|
|
2806
3131
|
type: object
|
|
2807
3132
|
required: [data]
|
|
@@ -2882,6 +3207,94 @@ components:
|
|
|
2882
3207
|
properties:
|
|
2883
3208
|
data:
|
|
2884
3209
|
$ref: "#/components/schemas/WebhookDeleteResult"
|
|
3210
|
+
IssueCapabilityConfirmationInput:
|
|
3211
|
+
type: object
|
|
3212
|
+
required: [capability_id, preview_summary, user_approved]
|
|
3213
|
+
properties:
|
|
3214
|
+
capability_id:
|
|
3215
|
+
type: string
|
|
3216
|
+
minLength: 1
|
|
3217
|
+
maxLength: 160
|
|
3218
|
+
description: Confirmable capability to mint a token for.
|
|
3219
|
+
api_path:
|
|
3220
|
+
type: string
|
|
3221
|
+
minLength: 1
|
|
3222
|
+
maxLength: 512
|
|
3223
|
+
description: >-
|
|
3224
|
+
Concrete `/api/v1/...` path to bind the token to. Optional when the
|
|
3225
|
+
capability has exactly one API target; required when it has several.
|
|
3226
|
+
path_params:
|
|
3227
|
+
type: object
|
|
3228
|
+
additionalProperties:
|
|
3229
|
+
type: [string, number, boolean]
|
|
3230
|
+
description: Values for the capability path template's parameters.
|
|
3231
|
+
idempotency_key:
|
|
3232
|
+
type: string
|
|
3233
|
+
minLength: 1
|
|
3234
|
+
description: >-
|
|
3235
|
+
The exact `Idempotency-Key` the confirmed write will send. The token
|
|
3236
|
+
is bound to it.
|
|
3237
|
+
preview_summary:
|
|
3238
|
+
type: string
|
|
3239
|
+
minLength: 1
|
|
3240
|
+
maxLength: 4000
|
|
3241
|
+
description: >-
|
|
3242
|
+
Human-readable description of the approved action, retained for
|
|
3243
|
+
audit.
|
|
3244
|
+
user_approved:
|
|
3245
|
+
const: true
|
|
3246
|
+
description: >-
|
|
3247
|
+
Asserts that a human on the caller's side approved this specific
|
|
3248
|
+
action.
|
|
3249
|
+
CapabilityConfirmation:
|
|
3250
|
+
type: object
|
|
3251
|
+
required:
|
|
3252
|
+
- confirmation_token
|
|
3253
|
+
- token_type
|
|
3254
|
+
- capability_id
|
|
3255
|
+
- method
|
|
3256
|
+
- path
|
|
3257
|
+
- required_scopes
|
|
3258
|
+
- idempotency_key
|
|
3259
|
+
- expires_in
|
|
3260
|
+
- expires_at
|
|
3261
|
+
- preview_summary
|
|
3262
|
+
properties:
|
|
3263
|
+
confirmation_token:
|
|
3264
|
+
type: string
|
|
3265
|
+
description: Send as the `X-Capability-Confirmation` header on the write.
|
|
3266
|
+
token_type:
|
|
3267
|
+
type: string
|
|
3268
|
+
const: medal_capability_confirmation
|
|
3269
|
+
capability_id:
|
|
3270
|
+
type: string
|
|
3271
|
+
method:
|
|
3272
|
+
type: string
|
|
3273
|
+
path:
|
|
3274
|
+
type: string
|
|
3275
|
+
required_scopes:
|
|
3276
|
+
type: array
|
|
3277
|
+
items:
|
|
3278
|
+
type: string
|
|
3279
|
+
idempotency_key:
|
|
3280
|
+
type: [string, "null"]
|
|
3281
|
+
expires_in:
|
|
3282
|
+
type: integer
|
|
3283
|
+
minimum: 60
|
|
3284
|
+
maximum: 900
|
|
3285
|
+
expires_at:
|
|
3286
|
+
type: string
|
|
3287
|
+
format: date-time
|
|
3288
|
+
preview_summary:
|
|
3289
|
+
type: string
|
|
3290
|
+
ApiResponse_CapabilityConfirmation:
|
|
3291
|
+
$ref: "#/components/schemas/Envelope_CapabilityConfirmation"
|
|
3292
|
+
Envelope_CapabilityConfirmation:
|
|
3293
|
+
type: object
|
|
3294
|
+
required: [data]
|
|
3295
|
+
properties:
|
|
3296
|
+
data:
|
|
3297
|
+
$ref: "#/components/schemas/CapabilityConfirmation"
|
|
2885
3298
|
Envelope_WebhookDeliveryArray:
|
|
2886
3299
|
type: object
|
|
2887
3300
|
required: [data]
|
|
@@ -2904,6 +3317,11 @@ components:
|
|
|
2904
3317
|
$ref: "#/components/schemas/ConnectLinkCreateResult"
|
|
2905
3318
|
Envelope_ConnectLinkArray:
|
|
2906
3319
|
type: object
|
|
3320
|
+
deprecated: true
|
|
3321
|
+
description: >-
|
|
3322
|
+
Deprecated — `listChannelConnectLinks` responds with
|
|
3323
|
+
`PaginatedResponse_ConnectLink`. Retained for backwards compatibility
|
|
3324
|
+
with consumers of the generated contract types.
|
|
2907
3325
|
required: [data]
|
|
2908
3326
|
properties:
|
|
2909
3327
|
data:
|
|
@@ -2918,6 +3336,11 @@ components:
|
|
|
2918
3336
|
$ref: "#/components/schemas/ConnectLinkRevokeResult"
|
|
2919
3337
|
Envelope_ChannelConnectionArray:
|
|
2920
3338
|
type: object
|
|
3339
|
+
deprecated: true
|
|
3340
|
+
description: >-
|
|
3341
|
+
Deprecated — `listChannelConnections` responds with
|
|
3342
|
+
`PaginatedResponse_ChannelConnection`. Retained for backwards
|
|
3343
|
+
compatibility with consumers of the generated contract types.
|
|
2921
3344
|
required: [data]
|
|
2922
3345
|
properties:
|
|
2923
3346
|
data:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medalsocial/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "TypeScript SDK for Medal Social API — posts, emails, contacts, deals, helpdesk, webhooks, and GDPR compliance",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Medal Social / Ali Aljumaili",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: resources
|
|
3
|
-
description: Use when calling any of the SDK resources (contacts, deals, emails, gdpr, posts, workspaces) — listing with pagination, sending transactional or batch emails, scheduling and publishing posts, recording GDPR consent or running an export workflow, fetching a contact's activity timeline — or when needing OpenAPI-derived TypeScript types or the raw OpenAPI document from `@medalsocial/sdk`.
|
|
3
|
+
description: Use when calling any of the SDK resources (contacts, deals, emails, gdpr, posts, scan, workspaces) — listing with pagination, sending transactional or batch emails, scheduling and publishing posts, recording GDPR consent or running an export workflow, fetching a contact's activity timeline — or when needing OpenAPI-derived TypeScript types or the raw OpenAPI document from `@medalsocial/sdk`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Medal Social SDK — Resources
|
|
7
7
|
|
|
8
8
|
## When to load this skill
|
|
9
9
|
|
|
10
|
-
- Calling `medal.contacts.*`, `medal.deals.*`, `medal.emails.*`, `medal.gdpr.*`, `medal.posts.*`, or `medal.workspaces.*`.
|
|
10
|
+
- Calling `medal.contacts.*`, `medal.deals.*`, `medal.emails.*`, `medal.gdpr.*`, `medal.posts.*`, `medal.scan.*`, or `medal.workspaces.*`.
|
|
11
11
|
- Looking up an exact method signature or response shape.
|
|
12
12
|
- Building a list view that needs pagination.
|
|
13
13
|
- Sending a single transactional email or a bulk batch.
|
|
@@ -35,6 +35,7 @@ Errors throw `MedalApiError` (see the `client` skill for details).
|
|
|
35
35
|
| `medal.emails.templates` | `src/resources/emails.ts` (`EmailTemplates`) | `list()`, `get(slug, opts?)` |
|
|
36
36
|
| `medal.emails` | `src/resources/emails.ts` (`Emails`) | `send(input)`, `get(id)`, `batch(input)` |
|
|
37
37
|
| `medal.gdpr` | `src/resources/gdpr.ts` | `requestExport()`, `listExports()`, `getExport(id)`, `recordConsent(input)`, `getConsent(email)`, `cookieConsent(input)` |
|
|
38
|
+
| `medal.scan` | `src/resources/scan.ts` | `create(input)` (exactly one of `url`/`orgnr`/`name`; 202 async job), `get(id)`, `companies(q)` (Norwegian registry typeahead), `waitForResult(id, opts?)` (polls until done/failed; returns the job either way, throws only on deadline) |
|
|
38
39
|
| `medal.posts` | `src/resources/posts.ts` | `list(opts?)`, `create(input)`, `get(id)`, `update(id, input)`, `remove(id)`, `schedule(id, input)`, `publish(id)`, `channels()` |
|
|
39
40
|
| `medal.workspaces` | `src/resources/workspaces.ts` | `list()` |
|
|
40
41
|
|