@usenadia/node 0.4.0 → 0.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 +19 -46
- package/dist/index.d.mts +1238 -239
- package/dist/index.d.ts +1238 -239
- package/dist/index.js +105 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -978,6 +978,34 @@ var changePostStatus = (options) => (options.client ?? client).put({
|
|
|
978
978
|
...options.headers
|
|
979
979
|
}
|
|
980
980
|
});
|
|
981
|
+
var listPostsAwaitingApproval = (options) => (options?.client ?? client).get({
|
|
982
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
983
|
+
url: "/public/v1/posts/approvals",
|
|
984
|
+
...options
|
|
985
|
+
});
|
|
986
|
+
var listUndatedDrafts = (options) => (options?.client ?? client).get({
|
|
987
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
988
|
+
url: "/public/v1/posts/drafts",
|
|
989
|
+
...options
|
|
990
|
+
});
|
|
991
|
+
var approvePost = (options) => (options.client ?? client).post({
|
|
992
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
993
|
+
url: "/public/v1/posts/{id}/approve",
|
|
994
|
+
...options,
|
|
995
|
+
headers: {
|
|
996
|
+
"Content-Type": "application/json",
|
|
997
|
+
...options.headers
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
var refusePost = (options) => (options.client ?? client).post({
|
|
1001
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1002
|
+
url: "/public/v1/posts/{id}/refuse",
|
|
1003
|
+
...options,
|
|
1004
|
+
headers: {
|
|
1005
|
+
"Content-Type": "application/json",
|
|
1006
|
+
...options.headers
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
981
1009
|
var removePostAutomation = (options) => (options.client ?? client).delete({
|
|
982
1010
|
security: [{ name: "Authorization", type: "apiKey" }],
|
|
983
1011
|
url: "/public/v1/posts/{id}/automation",
|
|
@@ -1015,6 +1043,15 @@ var setPostCover = (options) => (options.client ?? client).put({
|
|
|
1015
1043
|
...options.headers
|
|
1016
1044
|
}
|
|
1017
1045
|
});
|
|
1046
|
+
var setPostThread = (options) => (options.client ?? client).put({
|
|
1047
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1048
|
+
url: "/public/v1/posts/{id}/thread",
|
|
1049
|
+
...options,
|
|
1050
|
+
headers: {
|
|
1051
|
+
"Content-Type": "application/json",
|
|
1052
|
+
...options.headers
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1018
1055
|
var setPostPublication = (options) => (options.client ?? client).put({
|
|
1019
1056
|
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1020
1057
|
url: "/public/v1/posts/{id}/publication",
|
|
@@ -1078,6 +1115,15 @@ var listMediaComments = (options) => (options.client ?? client).get({
|
|
|
1078
1115
|
url: "/public/v1/inbox/comments/{integrationId}/{mediaId}",
|
|
1079
1116
|
...options
|
|
1080
1117
|
});
|
|
1118
|
+
var commentPublication = (options) => (options.client ?? client).post({
|
|
1119
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1120
|
+
url: "/public/v1/inbox/comments/{integrationId}/{mediaId}",
|
|
1121
|
+
...options,
|
|
1122
|
+
headers: {
|
|
1123
|
+
"Content-Type": "application/json",
|
|
1124
|
+
...options.headers
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1081
1127
|
var replyToComment = (options) => (options.client ?? client).post({
|
|
1082
1128
|
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1083
1129
|
url: "/public/v1/inbox/comments/{commentId}/reply",
|
|
@@ -1441,6 +1487,39 @@ var updateWorkspace = (options) => (options.client ?? client).put({
|
|
|
1441
1487
|
...options.headers
|
|
1442
1488
|
}
|
|
1443
1489
|
});
|
|
1490
|
+
var listApiKeys = (options) => (options?.client ?? client).get({
|
|
1491
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1492
|
+
url: "/public/v1/api-keys",
|
|
1493
|
+
...options
|
|
1494
|
+
});
|
|
1495
|
+
var createApiKey = (options) => (options.client ?? client).post({
|
|
1496
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1497
|
+
url: "/public/v1/api-keys",
|
|
1498
|
+
...options,
|
|
1499
|
+
headers: {
|
|
1500
|
+
"Content-Type": "application/json",
|
|
1501
|
+
...options.headers
|
|
1502
|
+
}
|
|
1503
|
+
});
|
|
1504
|
+
var revokeApiKey = (options) => (options.client ?? client).delete({
|
|
1505
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1506
|
+
url: "/public/v1/api-keys/{id}",
|
|
1507
|
+
...options
|
|
1508
|
+
});
|
|
1509
|
+
var updateApiKey = (options) => (options.client ?? client).put({
|
|
1510
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1511
|
+
url: "/public/v1/api-keys/{id}",
|
|
1512
|
+
...options,
|
|
1513
|
+
headers: {
|
|
1514
|
+
"Content-Type": "application/json",
|
|
1515
|
+
...options.headers
|
|
1516
|
+
}
|
|
1517
|
+
});
|
|
1518
|
+
var rotateApiKey = (options) => (options.client ?? client).post({
|
|
1519
|
+
security: [{ name: "Authorization", type: "apiKey" }],
|
|
1520
|
+
url: "/public/v1/api-keys/{id}/rotate",
|
|
1521
|
+
...options
|
|
1522
|
+
});
|
|
1444
1523
|
|
|
1445
1524
|
// src/index.ts
|
|
1446
1525
|
var DEFAULT_BASE_URL = "https://app.usenadia.com/api";
|
|
@@ -1599,7 +1678,7 @@ var Nadia = class {
|
|
|
1599
1678
|
});
|
|
1600
1679
|
}
|
|
1601
1680
|
/* --------------------------------------------------------------- *
|
|
1602
|
-
* The five calls
|
|
1681
|
+
* The five basic calls
|
|
1603
1682
|
* --------------------------------------------------------------- */
|
|
1604
1683
|
/** Schedule, publish or draft a post on one or more channels. */
|
|
1605
1684
|
post(body) {
|
|
@@ -1622,8 +1701,8 @@ var Nadia = class {
|
|
|
1622
1701
|
* time, a part cut by the network sent again, and the parts the confirm
|
|
1623
1702
|
* says are missing sent again before confirming once more. A server that
|
|
1624
1703
|
* does not take parts answers a single PUT, which is done instead; a
|
|
1625
|
-
* server without that route (older
|
|
1626
|
-
*
|
|
1704
|
+
* server without that route (an older release) and any other type
|
|
1705
|
+
* (HEIC… which the server converts to JPEG) go through
|
|
1627
1706
|
* `POST /public/v1/upload`, the whole file in one request, as before. A
|
|
1628
1707
|
* MOV or an M4V is refused there (`415`): convert it to MP4 first.
|
|
1629
1708
|
*
|
|
@@ -1793,7 +1872,7 @@ var Nadia = class {
|
|
|
1793
1872
|
);
|
|
1794
1873
|
}
|
|
1795
1874
|
/* --------------------------------------------------------------- *
|
|
1796
|
-
* The rest of
|
|
1875
|
+
* The rest of the surface
|
|
1797
1876
|
* --------------------------------------------------------------- */
|
|
1798
1877
|
/** Check that the API key is valid. Throws `NadiaError` with status 401 if not. */
|
|
1799
1878
|
async isConnected() {
|
|
@@ -1974,10 +2053,13 @@ export {
|
|
|
1974
2053
|
NadiaConfirmationRequired,
|
|
1975
2054
|
NadiaError,
|
|
1976
2055
|
NadiaWebhookError,
|
|
2056
|
+
approvePost,
|
|
1977
2057
|
catchUpAutomationPose,
|
|
1978
2058
|
changePostStatus,
|
|
1979
2059
|
checkConnection,
|
|
2060
|
+
commentPublication,
|
|
1980
2061
|
confirmUpload,
|
|
2062
|
+
createApiKey,
|
|
1981
2063
|
createAutomationFlow,
|
|
1982
2064
|
createContent,
|
|
1983
2065
|
createContentFromLink,
|
|
@@ -2018,6 +2100,7 @@ export {
|
|
|
2018
2100
|
hideComment,
|
|
2019
2101
|
importMusic,
|
|
2020
2102
|
linkContentPost,
|
|
2103
|
+
listApiKeys,
|
|
2021
2104
|
listAutomationFlowPoses,
|
|
2022
2105
|
listAutomationFlows,
|
|
2023
2106
|
listAutomationPoseRuns,
|
|
@@ -2035,6 +2118,8 @@ export {
|
|
|
2035
2118
|
listMusicPillars,
|
|
2036
2119
|
listNotifications,
|
|
2037
2120
|
listPosts,
|
|
2121
|
+
listPostsAwaitingApproval,
|
|
2122
|
+
listUndatedDrafts,
|
|
2038
2123
|
listVideoPerformance,
|
|
2039
2124
|
listWebhookEvents,
|
|
2040
2125
|
listWebhooks,
|
|
@@ -2046,9 +2131,12 @@ export {
|
|
|
2046
2131
|
poseAutomationFlow,
|
|
2047
2132
|
previewAutomationEmail,
|
|
2048
2133
|
previewAutomationPoseCatchUp,
|
|
2134
|
+
refusePost,
|
|
2049
2135
|
removePostAutomation,
|
|
2050
2136
|
replayAutomationPose,
|
|
2051
2137
|
replyToComment,
|
|
2138
|
+
revokeApiKey,
|
|
2139
|
+
rotateApiKey,
|
|
2052
2140
|
runChannelTool,
|
|
2053
2141
|
searchHooks,
|
|
2054
2142
|
sendAutomationTestEmail,
|
|
@@ -2060,10 +2148,12 @@ export {
|
|
|
2060
2148
|
setPostCover,
|
|
2061
2149
|
setPostPublication,
|
|
2062
2150
|
setPostReleaseId,
|
|
2151
|
+
setPostThread,
|
|
2063
2152
|
setPostingTimes,
|
|
2064
2153
|
startChannelConnection,
|
|
2065
2154
|
subscribeInboxWebhook,
|
|
2066
2155
|
testWebhook,
|
|
2156
|
+
updateApiKey,
|
|
2067
2157
|
updateAutomationFlow,
|
|
2068
2158
|
updateAutomationPose,
|
|
2069
2159
|
updateContent,
|