File: WordPress.mli

package info (click to toggle)
xmlrpc-light 0.6.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,308 kB
  • sloc: ml: 3,183; makefile: 54; sh: 1
file content (242 lines) | stat: -rw-r--r-- 7,677 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
(*
 * XmlRpc Light, a small XmlRpc library based on Xml Light and Ocamlnet
 * Copyright (C) 2007-2009 Dave Benjamin (dave@ramenlabs.com)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *)

exception Type_error of string
exception Unknown_field of string

val strict : bool ref

module Blog :
sig
  type t = {
             mutable is_admin : bool;
             mutable url : string;
             mutable blog_id : int;
             mutable blog_name : string;
             mutable xmlrpc : string;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
end

module Category :
sig
  type t = {
             mutable category_id : int;
             mutable parent_id : int;
             mutable description : string;
             mutable category_name : string;
             mutable html_url : string;
             mutable rss_url : string;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
end

module CommentCount :
sig
  type t = {
             mutable approved : int;
             mutable awaiting_moderation : int;
             mutable spam : int;
             mutable total_comments : int;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
end

module Comment :
sig
  type t = {
             mutable date_created : XmlRpcDateTime.t;
             mutable user_id : int;
             mutable comment_id : int;
             mutable parent : int;
             mutable status : string;
             mutable content : string;
             mutable link : string;
             mutable post_id : int;
             mutable post_title : string;
             mutable author : string;
             mutable author_url : string;
             mutable author_email : string;
             mutable author_ip : string;
             mutable typ : string;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
  val to_xmlrpc : t -> XmlRpc.value
end

module CustomField :
sig
  type t = {
             mutable id : int option;
             mutable key : string option;
             mutable value : string;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
  val to_xmlrpc : t -> XmlRpc.value
end

module Option :
sig
  type t = {
             mutable desc : string;
             mutable readonly : bool;
             mutable value : string;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
end

module User :
sig
  type t = {
             mutable user_id : int;
             mutable user_login : string;
             mutable display_name : string;
             mutable user_email : string;
             mutable meta_value : string;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
end

module PageListItem :
sig
  type t = {
             mutable page_id : int;
             mutable page_title : string;
             mutable page_parent_id : int;
             mutable date_created : XmlRpcDateTime.t;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
end

module Page :
sig
  type t = {
             mutable date_created : XmlRpcDateTime.t;
             mutable user_id : int;
             mutable page_id : int;
             mutable page_status : string;
             mutable description : string;
             mutable title : string;
             mutable link : string;
             mutable permalink : string;
             mutable categories : string list;
             mutable excerpt : string;
             mutable text_more : string;
             mutable mt_allow_comments : bool;
             mutable mt_allow_pings : bool;
             mutable wp_slug : string;
             mutable wp_password : string;
             mutable wp_author : string;
             mutable wp_page_parent_id : int;
             mutable wp_page_parent_title : string;
             mutable wp_page_order : int;
             mutable wp_author_id : int;
             mutable wp_author_display_name : string;
             mutable custom_fields : CustomField.t list;
             mutable wp_page_template : string;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
  val to_xmlrpc : t -> XmlRpc.value
end

module Post :
sig
  type t = {
             mutable user_id : int;
             mutable post_id : int;
             mutable post_status : string;
             mutable date_created : XmlRpcDateTime.t;
             mutable description : string;
             mutable title : string;
             mutable link : string;
             mutable permalink : string;
             mutable categories : string list;
             mutable excerpt : string;
             mutable text_more : string;
             mutable mt_allow_comments : bool;
             mutable mt_allow_pings : bool;
             mutable mt_keywords : string;
             mutable wp_slug : string;
             mutable wp_password : string;
             mutable wp_author_id : int;
             mutable wp_author_display_name : string;
             mutable custom_fields : CustomField.t list;
           }
  val make : unit -> t
  val of_xmlrpc : XmlRpc.value -> t
  val to_xmlrpc : t -> XmlRpc.value
end

class api :
  url:string ->
  blog_id:int ->
  username:string ->
  password:string ->
object
  val blog_id : int
  val password : string
  val rpc : XmlRpc.client
  val std_args : XmlRpc.value list
  val username : string
  method rpc : XmlRpc.client
  method delete_comment : int -> unit
  method delete_page : int -> unit
  method delete_post : int -> unit
  method edit_comment : int -> Comment.t -> unit
  method edit_page : int -> Page.t -> bool -> unit
  method edit_post : int -> Post.t -> bool -> unit
  method get_authors : unit -> User.t list
  method get_blogs : unit -> Blog.t list
  method get_categories : unit -> Category.t list
  method get_comment : int -> Comment.t
  method get_comment_count : int -> CommentCount.t
  method get_comment_status_list : unit -> (string * string) list
  method get_comments :
    ?status:string ->
    ?post_id:int -> ?offset:int -> ?number:int -> unit -> Comment.t list
  method get_options : string list -> (string * Option.t) list
  method get_page : int -> Page.t
  method get_page_list : unit -> PageListItem.t list
  method get_page_status_list : unit -> (string * string) list
  method get_page_templates : unit -> (string * string) list
  method get_pages : unit -> Page.t list
  method get_post : int -> Post.t
  method get_post_status_list : unit -> (string * string) list
  method get_recent_posts : int -> Post.t list
  method new_category :
    name:string ->
    slug:string -> parent_id:int -> description:string -> int
  method new_comment : Comment.t -> int
  method new_page : Page.t -> bool -> int
  method new_post : Post.t -> bool -> int
  method set_options : (string * string) list -> (string * Option.t) list
  method suggest_categories : string -> int -> XmlRpc.value
  method upload_file :
    name:string ->
    typ:string -> bits:string -> overwrite:bool -> string * string * string
end