Update to new install.

This commit is contained in:
Laur Ivan 2022-06-26 22:08:19 +02:00
parent 141ded8d85
commit d8faf1ff67
2 changed files with 18 additions and 554 deletions

View File

@ -4,13 +4,13 @@ import fs from "fs";
// Configure the client // Configure the client
const api = new GhostAdminAPI({ const api = new GhostAdminAPI({
url: "http://localhost:3001", url: "http://localhost:2368",
// Admin API key goes here // Admin API key goes here
key: "62ac6f5ab1479d0001082bd4:73341f843a5be78647c6f7e47d43d6cb09ec323df6d5706915df4685b3d46ce7", key: "62ac6f5ab1479d0001082bd4:73341f843a5be78647c6f7e47d43d6cb09ec323df6d5706915df4685b3d46ce7",
version: "v4.0", version: "v4.0",
}); });
const command: number = 1; // create const command: number = 0; // create
// List posts // List posts
switch (command) { switch (command) {

View File

@ -1,554 +1,18 @@
[ [
{ {
"id": "62b80d5a5fb4ca000119c888", "id": "62b81b265fb4ca000119c894",
"uuid": "0ab9c273-cd04-4d44-952a-fa1fc82b7fea", "uuid": "41ced005-2d7c-4965-907c-0c87f5bfe1af",
"title": "A post",
"slug": "a-post-2",
"mobiledoc": "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[],\"markups\":[[\"strong\"]],\"sections\":[[1,\"p\",[[0,[0],0,\"Hi \"],[0,[],1,\" Bye\"]]]]}",
"comment_id": "62b80d5a5fb4ca000119c888",
"feature_image": null,
"featured": false,
"status": "draft",
"visibility": "public",
"created_at": "2022-06-26T07:40:10.000Z",
"updated_at": "2022-06-26T07:40:10.000Z",
"published_at": null,
"custom_excerpt": null,
"codeinjection_head": null,
"codeinjection_foot": null,
"custom_template": null,
"canonical_url": null,
"tags": [],
"authors": [
{
"id": "1",
"name": "Laur Ivan",
"slug": "laur",
"email": "laur.ivan@gmail.com",
"profile_image": "https://www.gravatar.com/avatar/1abe88862a65973704f7c9b028cf7afe?s=250&r=x&d=mp",
"cover_image": null,
"bio": null,
"website": null,
"location": null,
"facebook": null,
"twitter": null,
"accessibility": "{\"nightShift\":true}",
"status": "active",
"meta_title": null,
"meta_description": null,
"tour": null,
"last_seen": "2022-06-26T07:38:14.000Z",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z",
"roles": [
{
"id": "629609ae8b281d00012eb297",
"name": "Owner",
"description": "Blog Owner",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
}
],
"url": "http://localhost:2368/author/laur/"
}
],
"tiers": [
{
"id": "629609ae8b281d00012eb29c",
"name": "Free",
"slug": "free",
"active": true,
"welcome_page_url": null,
"visibility": "public",
"monthly_price_id": null,
"yearly_price_id": null,
"description": null,
"type": "free",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
},
{
"id": "629609ae8b281d00012eb29d",
"name": "Laur's blog",
"slug": "default-product",
"active": true,
"welcome_page_url": null,
"visibility": "public",
"monthly_price_id": null,
"yearly_price_id": null,
"description": null,
"type": "paid",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:29:05.000Z"
}
],
"primary_author": {
"id": "1",
"name": "Laur Ivan",
"slug": "laur",
"email": "laur.ivan@gmail.com",
"profile_image": "https://www.gravatar.com/avatar/1abe88862a65973704f7c9b028cf7afe?s=250&r=x&d=mp",
"cover_image": null,
"bio": null,
"website": null,
"location": null,
"facebook": null,
"twitter": null,
"accessibility": "{\"nightShift\":true}",
"status": "active",
"meta_title": null,
"meta_description": null,
"tour": null,
"last_seen": "2022-06-26T07:38:14.000Z",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z",
"roles": [
{
"id": "629609ae8b281d00012eb297",
"name": "Owner",
"description": "Blog Owner",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
}
],
"url": "http://localhost:2368/author/laur/"
},
"primary_tag": null,
"email_segment": "all",
"url": "http://localhost:2368/p/0ab9c273-cd04-4d44-952a-fa1fc82b7fea/",
"excerpt": "Hi Bye",
"og_image": null,
"og_title": null,
"og_description": null,
"twitter_image": null,
"twitter_title": null,
"twitter_description": null,
"meta_title": null,
"meta_description": null,
"email_subject": null,
"frontmatter": null,
"feature_image_alt": null,
"feature_image_caption": null,
"email_only": false,
"email": null,
"newsletter": null
},
{
"id": "62b72a81609faa00017b7f4f",
"uuid": "2bf754c6-ab73-42ee-8ceb-cccd43a9f49a",
"title": "A post", "title": "A post",
"slug": "a-post", "slug": "a-post",
"mobiledoc": "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[[\"markdown\",{\"markdown\":\"```js\\nlet value = 0\\n```\"}]],\"markups\":[[\"strong\"]],\"sections\":[[1,\"p\",[[0,[0],1,\"Hi Bye\"]]],[1,\"h3\",[[0,[],0,\"Something better comes this way\"]]],[10,0],[1,\"p\",[]]],\"ghostVersion\":\"4.0\"}", "mobiledoc": "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[[\"markdown\",{\"markdown\":\"```js\\nlet value = 0\\n```\"}],[\"image\",{\"src\":\"http://localhost:2368/content/images/2022/06/ubuntu_black-orange_hex-1.png\",\"width\":758,\"height\":171,\"alt\":\"Ubuntu logo\"}]],\"markups\":[[\"strong\"]],\"sections\":[[1,\"p\",[[0,[0],0,\"Hi \"],[0,[],1,\" Bye\"]]],[10,0],[10,1],[1,\"p\",[]]],\"ghostVersion\":\"4.0\"}",
"comment_id": "62b72a81609faa00017b7f4f", "comment_id": "62b81b265fb4ca000119c894",
"feature_image": null, "feature_image": "http://localhost:2368/content/images/2022/06/dragonfly.jpg",
"featured": false, "featured": false,
"status": "published", "status": "published",
"visibility": "public", "visibility": "public",
"created_at": "2022-06-25T15:32:17.000Z", "created_at": "2022-06-26T08:39:02.000Z",
"updated_at": "2022-06-26T08:22:08.000Z", "updated_at": "2022-06-26T19:39:24.000Z",
"published_at": "2022-06-26T07:39:46.000Z", "published_at": "2022-06-26T08:39:23.000Z",
"custom_excerpt": null,
"codeinjection_head": null,
"codeinjection_foot": null,
"custom_template": null,
"canonical_url": null,
"tags": [],
"authors": [
{
"id": "1",
"name": "Laur Ivan",
"slug": "laur",
"email": "laur.ivan@gmail.com",
"profile_image": "https://www.gravatar.com/avatar/1abe88862a65973704f7c9b028cf7afe?s=250&r=x&d=mp",
"cover_image": null,
"bio": null,
"website": null,
"location": null,
"facebook": null,
"twitter": null,
"accessibility": "{\"nightShift\":true}",
"status": "active",
"meta_title": null,
"meta_description": null,
"tour": null,
"last_seen": "2022-06-26T07:38:14.000Z",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z",
"roles": [
{
"id": "629609ae8b281d00012eb297",
"name": "Owner",
"description": "Blog Owner",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
}
],
"url": "http://localhost:2368/author/laur/"
}
],
"tiers": [
{
"id": "629609ae8b281d00012eb29c",
"name": "Free",
"slug": "free",
"active": true,
"welcome_page_url": null,
"visibility": "public",
"monthly_price_id": null,
"yearly_price_id": null,
"description": null,
"type": "free",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
},
{
"id": "629609ae8b281d00012eb29d",
"name": "Laur's blog",
"slug": "default-product",
"active": true,
"welcome_page_url": null,
"visibility": "public",
"monthly_price_id": null,
"yearly_price_id": null,
"description": null,
"type": "paid",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:29:05.000Z"
}
],
"primary_author": {
"id": "1",
"name": "Laur Ivan",
"slug": "laur",
"email": "laur.ivan@gmail.com",
"profile_image": "https://www.gravatar.com/avatar/1abe88862a65973704f7c9b028cf7afe?s=250&r=x&d=mp",
"cover_image": null,
"bio": null,
"website": null,
"location": null,
"facebook": null,
"twitter": null,
"accessibility": "{\"nightShift\":true}",
"status": "active",
"meta_title": null,
"meta_description": null,
"tour": null,
"last_seen": "2022-06-26T07:38:14.000Z",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z",
"roles": [
{
"id": "629609ae8b281d00012eb297",
"name": "Owner",
"description": "Blog Owner",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
}
],
"url": "http://localhost:2368/author/laur/"
},
"primary_tag": null,
"email_segment": "all",
"url": "http://localhost:2368/a-post/",
"excerpt": "Hi Bye\n\n\nSomething better comes this way\n\nlet value = 0\n\n",
"og_image": null,
"og_title": null,
"og_description": null,
"twitter_image": null,
"twitter_title": null,
"twitter_description": null,
"meta_title": null,
"meta_description": null,
"email_subject": null,
"frontmatter": null,
"feature_image_alt": null,
"feature_image_caption": null,
"email_only": false,
"email": null,
"newsletter": null
},
{
"id": "62b72926609faa00017b7f44",
"uuid": "948abc50-4233-4c29-8429-3fa75eba6610",
"title": "This is the title",
"slug": "this-is-the-title",
"mobiledoc": "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[],\"markups\":[[\"strong\"],[\"em\"]],\"sections\":[[1,\"p\",[[0,[],0,\"I am \"],[0,[0],1,\"writing \"],[0,[],0,\"my \"],[0,[1],1,\"post @laur\"]]]],\"ghostVersion\":\"4.0\"}",
"comment_id": "62b72926609faa00017b7f44",
"feature_image": null,
"featured": false,
"status": "published",
"visibility": "public",
"created_at": "2022-06-25T15:26:30.000Z",
"updated_at": "2022-06-25T15:27:08.000Z",
"published_at": "2022-06-25T15:27:08.000Z",
"custom_excerpt": null,
"codeinjection_head": null,
"codeinjection_foot": null,
"custom_template": null,
"canonical_url": null,
"tags": [],
"authors": [
{
"id": "1",
"name": "Laur Ivan",
"slug": "laur",
"email": "laur.ivan@gmail.com",
"profile_image": "https://www.gravatar.com/avatar/1abe88862a65973704f7c9b028cf7afe?s=250&r=x&d=mp",
"cover_image": null,
"bio": null,
"website": null,
"location": null,
"facebook": null,
"twitter": null,
"accessibility": "{\"nightShift\":true}",
"status": "active",
"meta_title": null,
"meta_description": null,
"tour": null,
"last_seen": "2022-06-26T07:38:14.000Z",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z",
"roles": [
{
"id": "629609ae8b281d00012eb297",
"name": "Owner",
"description": "Blog Owner",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
}
],
"url": "http://localhost:2368/author/laur/"
}
],
"tiers": [
{
"id": "629609ae8b281d00012eb29c",
"name": "Free",
"slug": "free",
"active": true,
"welcome_page_url": null,
"visibility": "public",
"monthly_price_id": null,
"yearly_price_id": null,
"description": null,
"type": "free",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
},
{
"id": "629609ae8b281d00012eb29d",
"name": "Laur's blog",
"slug": "default-product",
"active": true,
"welcome_page_url": null,
"visibility": "public",
"monthly_price_id": null,
"yearly_price_id": null,
"description": null,
"type": "paid",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:29:05.000Z"
}
],
"primary_author": {
"id": "1",
"name": "Laur Ivan",
"slug": "laur",
"email": "laur.ivan@gmail.com",
"profile_image": "https://www.gravatar.com/avatar/1abe88862a65973704f7c9b028cf7afe?s=250&r=x&d=mp",
"cover_image": null,
"bio": null,
"website": null,
"location": null,
"facebook": null,
"twitter": null,
"accessibility": "{\"nightShift\":true}",
"status": "active",
"meta_title": null,
"meta_description": null,
"tour": null,
"last_seen": "2022-06-26T07:38:14.000Z",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z",
"roles": [
{
"id": "629609ae8b281d00012eb297",
"name": "Owner",
"description": "Blog Owner",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
}
],
"url": "http://localhost:2368/author/laur/"
},
"primary_tag": null,
"email_segment": "all",
"url": "http://localhost:2368/this-is-the-title/",
"excerpt": "I am writing my post @laur",
"og_image": null,
"og_title": null,
"og_description": null,
"twitter_image": null,
"twitter_title": null,
"twitter_description": null,
"meta_title": null,
"meta_description": null,
"email_subject": null,
"frontmatter": null,
"feature_image_alt": null,
"feature_image_caption": null,
"email_only": false,
"email": null,
"newsletter": null
},
{
"id": "62960a928b281d00012eb478",
"uuid": "e50c8ca6-055d-483e-ba27-bbb3bc2f854a",
"title": "I really want this",
"slug": "i-really-want-this",
"mobiledoc": "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[[\"markdown\",{\"markdown\":\"## I am very markdowny\"}],[\"markdown\",{\"markdown\":\"```json\\n{\\n \\\"a\\\": true\\n}\\n```\\n\\n| one | two | three | four | five |\\n|---|---|---|---|---|\\n| row | | | | |\\n| row | | | | |\\n| row | | | | row |\"}]],\"markups\":[],\"sections\":[[1,\"p\",[[0,[],0,\"Some markdown to be put here\"]]],[10,0],[10,1],[1,\"p\",[]]],\"ghostVersion\":\"4.0\"}",
"comment_id": "62960a928b281d00012eb478",
"feature_image": null,
"featured": false,
"status": "published",
"visibility": "public",
"created_at": "2022-05-31T12:31:14.000Z",
"updated_at": "2022-06-15T18:15:52.000Z",
"published_at": "2022-06-15T18:13:26.000Z",
"custom_excerpt": null,
"codeinjection_head": null,
"codeinjection_foot": null,
"custom_template": null,
"canonical_url": null,
"tags": [],
"authors": [
{
"id": "1",
"name": "Laur Ivan",
"slug": "laur",
"email": "laur.ivan@gmail.com",
"profile_image": "https://www.gravatar.com/avatar/1abe88862a65973704f7c9b028cf7afe?s=250&r=x&d=mp",
"cover_image": null,
"bio": null,
"website": null,
"location": null,
"facebook": null,
"twitter": null,
"accessibility": "{\"nightShift\":true}",
"status": "active",
"meta_title": null,
"meta_description": null,
"tour": null,
"last_seen": "2022-06-26T07:38:14.000Z",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z",
"roles": [
{
"id": "629609ae8b281d00012eb297",
"name": "Owner",
"description": "Blog Owner",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
}
],
"url": "http://localhost:2368/author/laur/"
}
],
"tiers": [
{
"id": "629609ae8b281d00012eb29c",
"name": "Free",
"slug": "free",
"active": true,
"welcome_page_url": null,
"visibility": "public",
"monthly_price_id": null,
"yearly_price_id": null,
"description": null,
"type": "free",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
},
{
"id": "629609ae8b281d00012eb29d",
"name": "Laur's blog",
"slug": "default-product",
"active": true,
"welcome_page_url": null,
"visibility": "public",
"monthly_price_id": null,
"yearly_price_id": null,
"description": null,
"type": "paid",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:29:05.000Z"
}
],
"primary_author": {
"id": "1",
"name": "Laur Ivan",
"slug": "laur",
"email": "laur.ivan@gmail.com",
"profile_image": "https://www.gravatar.com/avatar/1abe88862a65973704f7c9b028cf7afe?s=250&r=x&d=mp",
"cover_image": null,
"bio": null,
"website": null,
"location": null,
"facebook": null,
"twitter": null,
"accessibility": "{\"nightShift\":true}",
"status": "active",
"meta_title": null,
"meta_description": null,
"tour": null,
"last_seen": "2022-06-26T07:38:14.000Z",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z",
"roles": [
{
"id": "629609ae8b281d00012eb297",
"name": "Owner",
"description": "Blog Owner",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:27:26.000Z"
}
],
"url": "http://localhost:2368/author/laur/"
},
"primary_tag": null,
"email_segment": "all",
"url": "http://localhost:2368/i-really-want-this/",
"excerpt": "Some markdown to be put here\n\n\nI am very markdowny\n\n\n{\n \"a\": true\n}\n\n\n\n\n\n\none\ntwo\nthree\nfour\nfive\n\n\n\n\nrow\n\n\n\n\n\n\nrow\n\n\n\n\n\n\nrow\n\n\n\nrow\n\n\n\n",
"og_image": null,
"og_title": null,
"og_description": null,
"twitter_image": null,
"twitter_title": null,
"twitter_description": null,
"meta_title": null,
"meta_description": null,
"email_subject": null,
"frontmatter": null,
"feature_image_alt": null,
"feature_image_caption": null,
"email_only": false,
"email": null,
"newsletter": null
},
{
"id": "629609ae8b281d00012eb300",
"uuid": "49d5c2d3-2aa8-4ea9-9682-47da5c4b73fd",
"title": "Coming really soon",
"slug": "coming-soon",
"mobiledoc": "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[],\"markups\":[[\"a\",[\"href\",\"#/portal/\"]]],\"sections\":[[1,\"p\",[[0,[],0,\"This is Laur's blog, a brand new site by Laur Ivan that's just getting started. Things will be up and running here shortly, but you can \"],[0,[0],1,\"subscribe\"],[0,[],0,\" in the meantime if you'd like to stay up to date and receive emails when new content is published!\"]]]],\"ghostVersion\":\"4.0\"}",
"comment_id": "629609ae8b281d00012eb300",
"feature_image": "https://static.ghost.org/v4.0.0/images/feature-image.jpg",
"featured": false,
"status": "published",
"visibility": "public",
"created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:30:09.000Z",
"published_at": "2022-05-31T12:27:26.000Z",
"custom_excerpt": null, "custom_excerpt": null,
"codeinjection_head": null, "codeinjection_head": null,
"codeinjection_foot": null, "codeinjection_foot": null,
@ -575,7 +39,7 @@
"canonical_url": null, "canonical_url": null,
"accent_color": null, "accent_color": null,
"created_at": "2022-05-31T12:27:26.000Z", "created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:30:09.000Z", "updated_at": "2022-06-26T19:39:24.000Z",
"url": "http://localhost:2368/tag/news/" "url": "http://localhost:2368/tag/news/"
} }
], ],
@ -597,9 +61,9 @@
"meta_title": null, "meta_title": null,
"meta_description": null, "meta_description": null,
"tour": null, "tour": null,
"last_seen": "2022-06-26T07:38:14.000Z", "last_seen": "2022-06-26T19:50:38.000Z",
"created_at": "2022-05-31T12:27:26.000Z", "created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z", "updated_at": "2022-06-26T19:50:38.000Z",
"roles": [ "roles": [
{ {
"id": "629609ae8b281d00012eb297", "id": "629609ae8b281d00012eb297",
@ -659,9 +123,9 @@
"meta_title": null, "meta_title": null,
"meta_description": null, "meta_description": null,
"tour": null, "tour": null,
"last_seen": "2022-06-26T07:38:14.000Z", "last_seen": "2022-06-26T19:50:38.000Z",
"created_at": "2022-05-31T12:27:26.000Z", "created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-06-26T07:38:14.000Z", "updated_at": "2022-06-26T19:50:38.000Z",
"roles": [ "roles": [
{ {
"id": "629609ae8b281d00012eb297", "id": "629609ae8b281d00012eb297",
@ -693,12 +157,12 @@
"canonical_url": null, "canonical_url": null,
"accent_color": null, "accent_color": null,
"created_at": "2022-05-31T12:27:26.000Z", "created_at": "2022-05-31T12:27:26.000Z",
"updated_at": "2022-05-31T12:30:09.000Z", "updated_at": "2022-06-26T19:39:24.000Z",
"url": "http://localhost:2368/tag/news/" "url": "http://localhost:2368/tag/news/"
}, },
"email_segment": "all", "email_segment": "all",
"url": "http://localhost:2368/coming-soon/", "url": "http://localhost:2368/a-post/",
"excerpt": "This is Laur's blog, a brand new site by Laur Ivan that's just getting started. Things will be up and running here shortly, but you can subscribe in the meantime if you'd like to stay up to date and receive emails when new content is published!", "excerpt": "Hi Bye\n\nlet value = 0\n\n",
"og_image": null, "og_image": null,
"og_title": null, "og_title": null,
"og_description": null, "og_description": null,