Skip to content

Commit 5b6647a

Browse files
authored
Update Ghost.org components API version (#12816)
* ghost_org_content_api updates * ghost_org_admin_api updates * pnpm-lock.yaml
1 parent bac3568 commit 5b6647a

File tree

20 files changed

+286
-201
lines changed

20 files changed

+286
-201
lines changed

components/ghost_org_admin_api/actions/create-member/create-member.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import app from "../../ghost_org_admin_api.app.mjs";
33
export default {
44
key: "ghost_org_admin_api-create-member",
55
name: "Create Member",
6-
description: "Create a new member in Ghost. [See the docs here](https://ghost.org/docs/admin-api/#creating-a-member)",
7-
version: "0.0.3",
6+
description: "Create a new member in Ghost. [See the documentation](https://ghost.org/docs/admin-api/#creating-a-member)",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
app,

components/ghost_org_admin_api/actions/create-post/create-post.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Create post",
66
description: "Create a post. [See the documentation](https://ghost.org/docs/admin-api/#creating-a-post).",
77
type: "action",
8-
version: "0.0.4",
8+
version: "0.0.5",
99
props: {
1010
ghostAdminApi,
1111
title: {

components/ghost_org_admin_api/actions/update-member/update-member.mjs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import app from "../../ghost_org_admin_api.app.mjs";
2+
import { ConfigurationError } from "@pipedream/platform";
23

34
export default {
45
key: "ghost_org_admin_api-update-member",
56
name: "Update Member",
6-
description: "Update a member in Ghost. [See the docs here](https://ghost.org/docs/admin-api/#updating-a-member)",
7-
version: "0.0.3",
7+
description: "Update a member in Ghost. [See the documentation](https://ghost.org/docs/admin-api/#updating-a-member)",
8+
version: "0.0.4",
89
type: "action",
910
props: {
1011
app,
@@ -34,6 +35,9 @@ export default {
3435
},
3536
},
3637
async run({ $ }) {
38+
if (!this.name && !this.note && !this.labels) {
39+
throw new ConfigurationError("Must provide at least one of `name`, `note`, or `labels`");
40+
}
3741
const res = await this.app.updateMember({
3842
$,
3943
memberId: this.member,

components/ghost_org_admin_api/common/constants.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const VERSION_PATH = "/ghost/api/v3/admin";
1+
const VERSION_PATH = "/ghost/api/admin";
22
const DEFAULT_LIMIT = 100;
33
const MAX_RESOURCES = 200;
44

components/ghost_org_admin_api/ghost_org_admin_api.app.mjs

+6-2
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ export default {
5151
},
5252
methods: {
5353
getURL(path) {
54-
return `${this.$auth.admin_api_url}${constants.VERSION_PATH}${path}`;
54+
const { admin_api_url: domain } = this.$auth;
55+
return `${domain.includes("https://")
56+
? ""
57+
: "https://"}${domain}${constants.VERSION_PATH}${path}`;
5558
},
5659
getHeader() {
5760
const token = this.getToken();
5861
return {
59-
Authorization: `Ghost ${token}`,
62+
"Authorization": `Ghost ${token}`,
63+
"Accept-Version": "v5.0",
6064
};
6165
},
6266
getToken() {

0 commit comments

Comments
 (0)