@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/dist/index.js CHANGED
@@ -35,10 +35,13 @@ __export(index_exports, {
35
35
  NadiaConfirmationRequired: () => NadiaConfirmationRequired,
36
36
  NadiaError: () => NadiaError,
37
37
  NadiaWebhookError: () => NadiaWebhookError,
38
+ approvePost: () => approvePost,
38
39
  catchUpAutomationPose: () => catchUpAutomationPose,
39
40
  changePostStatus: () => changePostStatus,
40
41
  checkConnection: () => checkConnection,
42
+ commentPublication: () => commentPublication,
41
43
  confirmUpload: () => confirmUpload,
44
+ createApiKey: () => createApiKey,
42
45
  createAutomationFlow: () => createAutomationFlow,
43
46
  createContent: () => createContent,
44
47
  createContentFromLink: () => createContentFromLink,
@@ -79,6 +82,7 @@ __export(index_exports, {
79
82
  hideComment: () => hideComment,
80
83
  importMusic: () => importMusic,
81
84
  linkContentPost: () => linkContentPost,
85
+ listApiKeys: () => listApiKeys,
82
86
  listAutomationFlowPoses: () => listAutomationFlowPoses,
83
87
  listAutomationFlows: () => listAutomationFlows,
84
88
  listAutomationPoseRuns: () => listAutomationPoseRuns,
@@ -96,6 +100,8 @@ __export(index_exports, {
96
100
  listMusicPillars: () => listMusicPillars,
97
101
  listNotifications: () => listNotifications,
98
102
  listPosts: () => listPosts,
103
+ listPostsAwaitingApproval: () => listPostsAwaitingApproval,
104
+ listUndatedDrafts: () => listUndatedDrafts,
99
105
  listVideoPerformance: () => listVideoPerformance,
100
106
  listWebhookEvents: () => listWebhookEvents,
101
107
  listWebhooks: () => listWebhooks,
@@ -107,9 +113,12 @@ __export(index_exports, {
107
113
  poseAutomationFlow: () => poseAutomationFlow,
108
114
  previewAutomationEmail: () => previewAutomationEmail,
109
115
  previewAutomationPoseCatchUp: () => previewAutomationPoseCatchUp,
116
+ refusePost: () => refusePost,
110
117
  removePostAutomation: () => removePostAutomation,
111
118
  replayAutomationPose: () => replayAutomationPose,
112
119
  replyToComment: () => replyToComment,
120
+ revokeApiKey: () => revokeApiKey,
121
+ rotateApiKey: () => rotateApiKey,
113
122
  runChannelTool: () => runChannelTool,
114
123
  searchHooks: () => searchHooks,
115
124
  sendAutomationTestEmail: () => sendAutomationTestEmail,
@@ -121,10 +130,12 @@ __export(index_exports, {
121
130
  setPostCover: () => setPostCover,
122
131
  setPostPublication: () => setPostPublication,
123
132
  setPostReleaseId: () => setPostReleaseId,
133
+ setPostThread: () => setPostThread,
124
134
  setPostingTimes: () => setPostingTimes,
125
135
  startChannelConnection: () => startChannelConnection,
126
136
  subscribeInboxWebhook: () => subscribeInboxWebhook,
127
137
  testWebhook: () => testWebhook,
138
+ updateApiKey: () => updateApiKey,
128
139
  updateAutomationFlow: () => updateAutomationFlow,
129
140
  updateAutomationPose: () => updateAutomationPose,
130
141
  updateContent: () => updateContent,
@@ -1116,6 +1127,34 @@ var changePostStatus = (options) => (options.client ?? client).put({
1116
1127
  ...options.headers
1117
1128
  }
1118
1129
  });
1130
+ var listPostsAwaitingApproval = (options) => (options?.client ?? client).get({
1131
+ security: [{ name: "Authorization", type: "apiKey" }],
1132
+ url: "/public/v1/posts/approvals",
1133
+ ...options
1134
+ });
1135
+ var listUndatedDrafts = (options) => (options?.client ?? client).get({
1136
+ security: [{ name: "Authorization", type: "apiKey" }],
1137
+ url: "/public/v1/posts/drafts",
1138
+ ...options
1139
+ });
1140
+ var approvePost = (options) => (options.client ?? client).post({
1141
+ security: [{ name: "Authorization", type: "apiKey" }],
1142
+ url: "/public/v1/posts/{id}/approve",
1143
+ ...options,
1144
+ headers: {
1145
+ "Content-Type": "application/json",
1146
+ ...options.headers
1147
+ }
1148
+ });
1149
+ var refusePost = (options) => (options.client ?? client).post({
1150
+ security: [{ name: "Authorization", type: "apiKey" }],
1151
+ url: "/public/v1/posts/{id}/refuse",
1152
+ ...options,
1153
+ headers: {
1154
+ "Content-Type": "application/json",
1155
+ ...options.headers
1156
+ }
1157
+ });
1119
1158
  var removePostAutomation = (options) => (options.client ?? client).delete({
1120
1159
  security: [{ name: "Authorization", type: "apiKey" }],
1121
1160
  url: "/public/v1/posts/{id}/automation",
@@ -1153,6 +1192,15 @@ var setPostCover = (options) => (options.client ?? client).put({
1153
1192
  ...options.headers
1154
1193
  }
1155
1194
  });
1195
+ var setPostThread = (options) => (options.client ?? client).put({
1196
+ security: [{ name: "Authorization", type: "apiKey" }],
1197
+ url: "/public/v1/posts/{id}/thread",
1198
+ ...options,
1199
+ headers: {
1200
+ "Content-Type": "application/json",
1201
+ ...options.headers
1202
+ }
1203
+ });
1156
1204
  var setPostPublication = (options) => (options.client ?? client).put({
1157
1205
  security: [{ name: "Authorization", type: "apiKey" }],
1158
1206
  url: "/public/v1/posts/{id}/publication",
@@ -1216,6 +1264,15 @@ var listMediaComments = (options) => (options.client ?? client).get({
1216
1264
  url: "/public/v1/inbox/comments/{integrationId}/{mediaId}",
1217
1265
  ...options
1218
1266
  });
1267
+ var commentPublication = (options) => (options.client ?? client).post({
1268
+ security: [{ name: "Authorization", type: "apiKey" }],
1269
+ url: "/public/v1/inbox/comments/{integrationId}/{mediaId}",
1270
+ ...options,
1271
+ headers: {
1272
+ "Content-Type": "application/json",
1273
+ ...options.headers
1274
+ }
1275
+ });
1219
1276
  var replyToComment = (options) => (options.client ?? client).post({
1220
1277
  security: [{ name: "Authorization", type: "apiKey" }],
1221
1278
  url: "/public/v1/inbox/comments/{commentId}/reply",
@@ -1579,6 +1636,39 @@ var updateWorkspace = (options) => (options.client ?? client).put({
1579
1636
  ...options.headers
1580
1637
  }
1581
1638
  });
1639
+ var listApiKeys = (options) => (options?.client ?? client).get({
1640
+ security: [{ name: "Authorization", type: "apiKey" }],
1641
+ url: "/public/v1/api-keys",
1642
+ ...options
1643
+ });
1644
+ var createApiKey = (options) => (options.client ?? client).post({
1645
+ security: [{ name: "Authorization", type: "apiKey" }],
1646
+ url: "/public/v1/api-keys",
1647
+ ...options,
1648
+ headers: {
1649
+ "Content-Type": "application/json",
1650
+ ...options.headers
1651
+ }
1652
+ });
1653
+ var revokeApiKey = (options) => (options.client ?? client).delete({
1654
+ security: [{ name: "Authorization", type: "apiKey" }],
1655
+ url: "/public/v1/api-keys/{id}",
1656
+ ...options
1657
+ });
1658
+ var updateApiKey = (options) => (options.client ?? client).put({
1659
+ security: [{ name: "Authorization", type: "apiKey" }],
1660
+ url: "/public/v1/api-keys/{id}",
1661
+ ...options,
1662
+ headers: {
1663
+ "Content-Type": "application/json",
1664
+ ...options.headers
1665
+ }
1666
+ });
1667
+ var rotateApiKey = (options) => (options.client ?? client).post({
1668
+ security: [{ name: "Authorization", type: "apiKey" }],
1669
+ url: "/public/v1/api-keys/{id}/rotate",
1670
+ ...options
1671
+ });
1582
1672
 
1583
1673
  // src/index.ts
1584
1674
  var DEFAULT_BASE_URL = "https://app.usenadia.com/api";
@@ -1737,7 +1827,7 @@ var Nadia = class {
1737
1827
  });
1738
1828
  }
1739
1829
  /* --------------------------------------------------------------- *
1740
- * The five calls upstream had, same names, same shape
1830
+ * The five basic calls
1741
1831
  * --------------------------------------------------------------- */
1742
1832
  /** Schedule, publish or draft a post on one or more channels. */
1743
1833
  post(body) {
@@ -1760,8 +1850,8 @@ var Nadia = class {
1760
1850
  * time, a part cut by the network sent again, and the parts the confirm
1761
1851
  * says are missing sent again before confirming once more. A server that
1762
1852
  * does not take parts answers a single PUT, which is done instead; a
1763
- * server without that route (older, or self-hosted on an older release)
1764
- * and any other type (HEIC… which the server converts to JPEG) go through
1853
+ * server without that route (an older release) and any other type
1854
+ * (HEIC… which the server converts to JPEG) go through
1765
1855
  * `POST /public/v1/upload`, the whole file in one request, as before. A
1766
1856
  * MOV or an M4V is refused there (`415`): convert it to MP4 first.
1767
1857
  *
@@ -1931,7 +2021,7 @@ var Nadia = class {
1931
2021
  );
1932
2022
  }
1933
2023
  /* --------------------------------------------------------------- *
1934
- * The rest of our surface, which upstream never had
2024
+ * The rest of the surface
1935
2025
  * --------------------------------------------------------------- */
1936
2026
  /** Check that the API key is valid. Throws `NadiaError` with status 401 if not. */
1937
2027
  async isConnected() {
@@ -2113,10 +2203,13 @@ function parseWebhook(options) {
2113
2203
  NadiaConfirmationRequired,
2114
2204
  NadiaError,
2115
2205
  NadiaWebhookError,
2206
+ approvePost,
2116
2207
  catchUpAutomationPose,
2117
2208
  changePostStatus,
2118
2209
  checkConnection,
2210
+ commentPublication,
2119
2211
  confirmUpload,
2212
+ createApiKey,
2120
2213
  createAutomationFlow,
2121
2214
  createContent,
2122
2215
  createContentFromLink,
@@ -2156,6 +2249,7 @@ function parseWebhook(options) {
2156
2249
  hideComment,
2157
2250
  importMusic,
2158
2251
  linkContentPost,
2252
+ listApiKeys,
2159
2253
  listAutomationFlowPoses,
2160
2254
  listAutomationFlows,
2161
2255
  listAutomationPoseRuns,
@@ -2173,6 +2267,8 @@ function parseWebhook(options) {
2173
2267
  listMusicPillars,
2174
2268
  listNotifications,
2175
2269
  listPosts,
2270
+ listPostsAwaitingApproval,
2271
+ listUndatedDrafts,
2176
2272
  listVideoPerformance,
2177
2273
  listWebhookEvents,
2178
2274
  listWebhooks,
@@ -2184,9 +2280,12 @@ function parseWebhook(options) {
2184
2280
  poseAutomationFlow,
2185
2281
  previewAutomationEmail,
2186
2282
  previewAutomationPoseCatchUp,
2283
+ refusePost,
2187
2284
  removePostAutomation,
2188
2285
  replayAutomationPose,
2189
2286
  replyToComment,
2287
+ revokeApiKey,
2288
+ rotateApiKey,
2190
2289
  runChannelTool,
2191
2290
  searchHooks,
2192
2291
  sendAutomationTestEmail,
@@ -2198,10 +2297,12 @@ function parseWebhook(options) {
2198
2297
  setPostCover,
2199
2298
  setPostPublication,
2200
2299
  setPostReleaseId,
2300
+ setPostThread,
2201
2301
  setPostingTimes,
2202
2302
  startChannelConnection,
2203
2303
  subscribeInboxWebhook,
2204
2304
  testWebhook,
2305
+ updateApiKey,
2205
2306
  updateAutomationFlow,
2206
2307
  updateAutomationPose,
2207
2308
  updateContent,