successfully creating pages

This commit is contained in:
Daniel Cronin 2024-10-05 05:47:54 -05:00
parent 6b619c747f
commit e20b368643
3 changed files with 140 additions and 63 deletions

View File

@ -1,63 +0,0 @@
{
'post_books_create',
'get_attachments_read',
'get_chapters_list',
'get_content_permissions_read',
'get_chapters_export_markdown',
'post_roles_create',
'put_recycle_bin_restore',
'put_image_gallery_update',
'put_books_update',
'post_shelves_create',
'get_books_read',
'get_attachments_list',
'put_content_permissions_update',
'get_recycle_bin_list',
'delete_users_delete',
'get_users_list',
'get_docs_json',
'get_books_export_html',
'put_chapters_update',
'get_chapters_export_pdf',
'get_pages_export_markdown',
'delete_pages_delete',
'post_attachments_create',
'put_attachments_update',
'get_roles_read',
'get_chapters_export_plain_text',
'get_users_read',
'delete_chapters_delete',
'put_pages_update',
'post_chapters_create',
'get_chapters_read',
'get_pages_list',
'get_pages_export_plain_text',
'get_roles_list',
'get_pages_export_html',
'get_image_gallery_read',
'delete_attachments_delete',
'post_users_create',
'get_audit_log_list',
'get_pages_export_pdf',
'delete_books_delete',
'get_shelves_read',
'delete_roles_delete',
'get_pages_read',
'put_shelves_update',
'get_books_export_plain_text',
'delete_shelves_delete',
'get_books_export_markdown',
'delete_image_gallery_delete',
'get_search_all',
'get_books_list',
'post_image_gallery_create',
'get_books_export_pdf',
'post_pages_create',
'get_shelves_list',
'get_docs_display',
'put_users_update',
'put_roles_update',
'delete_recycle_bin_destroy',
'get_chapters_export_html',
'get_image_gallery_list'
}

121
src/bstack_api_calls.md Normal file
View File

@ -0,0 +1,121 @@
`'post_books_create',`
`'get_attachments_read',`
`'get_chapters_list',`
`'get_content_permissions_read',`
`'get_chapters_export_markdown',`
`'post_roles_create',`
`'put_recycle_bin_restore',`
`'put_image_gallery_update',`
`'put_books_update',`
`'post_shelves_create',`
`'get_books_read',`
`'get_attachments_list',`
`'put_content_permissions_update',`
`'get_recycle_bin_list',`
`'delete_users_delete',`
`'get_users_list',`
`'get_docs_json',`
`'get_books_export_html',`
`'put_chapters_update',`
`'get_chapters_export_pdf',`
`'get_pages_export_markdown',`
`'delete_pages_delete',`
`'post_attachments_create',`
`'put_attachments_update',`
`'get_roles_read',`
`'get_chapters_export_plain_text',`
`'get_users_read',`
`'delete_chapters_delete',`
`'put_pages_update',`
`'post_chapters_create',`
`'get_chapters_read',`
`'get_pages_list',`
`'get_pages_export_plain_text',`
`'get_roles_list',`
`'get_pages_export_html',`
`'get_image_gallery_read',`
`'delete_attachments_delete',`
`'post_users_create',`
`'get_audit_log_list',`
`'get_pages_export_pdf',`
`'delete_books_delete',`
`'get_shelves_read',`
`'delete_roles_delete',`
`'get_pages_read',`
`'put_shelves_update',`
`'get_books_export_plain_text',`
`'delete_shelves_delete',`
`'get_books_export_markdown',`
`'delete_image_gallery_delete',`
`'get_search_all',`
`'get_books_list',`
`'post_image_gallery_create',`
`'get_books_export_pdf',`
`'post_pages_create',`
`'get_shelves_list',`
`'get_docs_display',`
`'put_users_update',`
`'put_roles_update',`
`'delete_recycle_bin_destroy',`
`'get_chapters_export_html',`
`'get_image_gallery_list'`

View File

@ -38,6 +38,22 @@ def rec_exists(r):
return True
else: return False
def create_page(r):
pk = r['pk']
name = r['title']
markdown = r['content']
check = r['check']
request = lib.api.post_pages_create({
'book_id': 3,
'page_id': pk,
'name': name,
'markdown': markdown,
})
# if 'message' in request:
print(request)
def parse():
f = json_file()
print("Parsing manifest json...")
@ -50,6 +66,9 @@ def parse():
r['title'] = fields['title']
r['content'] = fields['content']
r['check'] = fields['checksum']
create_page(r)
if rec_exists(r):
continue
else: