@kiipu/cli 0.0.5 → 0.0.6
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.
|
@@ -45,7 +45,7 @@ function parsePostMutationRequest(input) {
|
|
|
45
45
|
postId,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
export class
|
|
48
|
+
export class KiipuIntegrationApiClient {
|
|
49
49
|
config;
|
|
50
50
|
constructor(config) {
|
|
51
51
|
this.config = config;
|
|
@@ -88,18 +88,18 @@ export class KiipuSkillApiClient {
|
|
|
88
88
|
: 'request_failed');
|
|
89
89
|
}
|
|
90
90
|
createPost(input) {
|
|
91
|
-
return this.request('/
|
|
91
|
+
return this.request('/integrations/posts', 'POST', parseCreatePostRequest(input));
|
|
92
92
|
}
|
|
93
93
|
deletePost(input) {
|
|
94
94
|
const body = parsePostMutationRequest(input);
|
|
95
|
-
return this.request(`/
|
|
95
|
+
return this.request(`/integrations/posts/${body.postId}/delete`, 'POST', body);
|
|
96
96
|
}
|
|
97
97
|
restorePost(input) {
|
|
98
98
|
const body = parsePostMutationRequest(input);
|
|
99
|
-
return this.request(`/
|
|
99
|
+
return this.request(`/integrations/posts/${body.postId}/restore`, 'POST', body);
|
|
100
100
|
}
|
|
101
101
|
permanentDeletePost(input) {
|
|
102
102
|
const body = parsePostMutationRequest(input);
|
|
103
|
-
return this.request(`/
|
|
103
|
+
return this.request(`/integrations/posts/${body.postId}/permanent-delete`, 'POST', body);
|
|
104
104
|
}
|
|
105
105
|
}
|
package/dist/lib/post-actions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import {
|
|
2
|
+
import { KiipuIntegrationApiClient } from './kiipu-integration-client.js';
|
|
3
3
|
function formatRequestFailed(message, code) {
|
|
4
4
|
return `Request failed: ${message} (${code}).`;
|
|
5
5
|
}
|
|
@@ -14,7 +14,7 @@ function getPostApiClient(config) {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
return {
|
|
17
|
-
client: new
|
|
17
|
+
client: new KiipuIntegrationApiClient({
|
|
18
18
|
apiBaseUrl: config.apiBaseUrl,
|
|
19
19
|
apiKey,
|
|
20
20
|
}),
|