2021-03-08 16:01:00 +00:00
|
|
|
module Rep : sig
|
|
|
|
type id
|
|
|
|
type file = {
|
|
|
|
filepath : Fpath.t;
|
|
|
|
localpath : Fpath.t;
|
|
|
|
sha256 : Cstruct.t;
|
|
|
|
size : int;
|
|
|
|
}
|
|
|
|
|
|
|
|
val id : id Caqti_type.t
|
|
|
|
val uuid : Uuidm.t Caqti_type.t
|
|
|
|
val ptime : Ptime.t Caqti_type.t
|
|
|
|
val fpath : Fpath.t Caqti_type.t
|
|
|
|
val cstruct : Cstruct.t Caqti_type.t
|
|
|
|
val file : file Caqti_type.t
|
|
|
|
val execution_result : Builder.execution_result Caqti_type.t
|
|
|
|
val console : (int * string) list Caqti_type.t
|
|
|
|
end
|
|
|
|
type id = Rep.id
|
2021-01-08 12:47:17 +00:00
|
|
|
|
2021-03-08 16:01:00 +00:00
|
|
|
type file = Rep.file = {
|
2021-01-08 12:47:17 +00:00
|
|
|
filepath : Fpath.t;
|
|
|
|
localpath : Fpath.t;
|
|
|
|
sha256 : Cstruct.t;
|
2021-02-25 14:27:45 +00:00
|
|
|
size : int;
|
2021-01-08 12:47:17 +00:00
|
|
|
}
|
|
|
|
|
2021-01-27 20:25:51 +00:00
|
|
|
val application_id : int32
|
|
|
|
|
|
|
|
val current_version : int64
|
|
|
|
|
|
|
|
val get_application_id :
|
|
|
|
(unit, int32, [< `Many | `One | `Zero > `One ]) Caqti_request.t
|
|
|
|
|
|
|
|
val set_application_id :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
|
|
|
|
val get_version :
|
|
|
|
(unit, int64, [< `Many | `One | `Zero > `One ]) Caqti_request.t
|
|
|
|
|
|
|
|
val set_current_version :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
|
2021-01-08 12:47:17 +00:00
|
|
|
val last_insert_rowid :
|
|
|
|
(unit, id, [< `Many | `One | `Zero > `One ]) Caqti_request.t
|
|
|
|
|
|
|
|
module Job : sig
|
|
|
|
val migrate :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val rollback :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
|
|
|
|
val get :
|
2021-03-23 10:53:41 +00:00
|
|
|
(id, string, [< `Many | `One | `Zero > `One ])
|
2021-01-08 12:47:17 +00:00
|
|
|
Caqti_request.t
|
|
|
|
val get_id_by_name :
|
2021-06-09 09:48:51 +00:00
|
|
|
(string, id, [< `Many | `One | `Zero > `One `Zero ]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
val get_all :
|
|
|
|
(unit, id * string, [ `Many | `One | `Zero ]) Caqti_request.t
|
|
|
|
val try_add :
|
|
|
|
(string, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val remove :
|
|
|
|
(id, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
end
|
|
|
|
|
|
|
|
module Build_artifact : sig
|
|
|
|
val migrate :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val rollback :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
|
2021-01-27 20:25:51 +00:00
|
|
|
val get_by_build :
|
|
|
|
(id * Fpath.t, id * file,
|
|
|
|
[< `Many | `One | `Zero > `One ]) Caqti_request.t
|
|
|
|
|
2021-01-08 12:47:17 +00:00
|
|
|
val get_by_build_uuid :
|
2021-01-27 20:25:51 +00:00
|
|
|
(Uuidm.t * Fpath.t, id * file,
|
2021-01-08 12:47:17 +00:00
|
|
|
[< `Many | `One | `Zero > `One `Zero ])
|
|
|
|
Caqti_request.t
|
|
|
|
val get_all_by_build :
|
|
|
|
(id, id * file, [ `Many | `One | `Zero ]) Caqti_request.t
|
|
|
|
val add :
|
|
|
|
(file * id, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val remove_by_build :
|
|
|
|
(id, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
2021-06-25 12:01:20 +00:00
|
|
|
val remove :
|
|
|
|
(id, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
module Build :
|
|
|
|
sig
|
|
|
|
type t = {
|
|
|
|
uuid : Uuidm.t;
|
|
|
|
start : Ptime.t;
|
|
|
|
finish : Ptime.t;
|
|
|
|
result : Builder.execution_result;
|
|
|
|
console : (int * string) list;
|
|
|
|
script : string;
|
2021-06-02 10:29:08 +00:00
|
|
|
main_binary : id option;
|
2021-06-09 11:54:24 +00:00
|
|
|
user_id : id;
|
2021-01-08 12:47:17 +00:00
|
|
|
job_id : id;
|
|
|
|
}
|
|
|
|
module Meta :
|
|
|
|
sig
|
|
|
|
type t = {
|
|
|
|
uuid : Uuidm.t;
|
|
|
|
start : Ptime.t;
|
|
|
|
finish : Ptime.t;
|
|
|
|
result : Builder.execution_result;
|
2021-06-02 10:29:08 +00:00
|
|
|
main_binary : id option;
|
2021-06-09 11:54:24 +00:00
|
|
|
user_id : id;
|
2021-01-08 12:47:17 +00:00
|
|
|
job_id : id;
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
val migrate :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val rollback :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
|
|
|
|
val get_opt :
|
|
|
|
(id, t, [< `Many | `One | `Zero > `One `Zero ]) Caqti_request.t
|
|
|
|
val get_by_uuid :
|
|
|
|
(Uuidm.t, id * t, [< `Many | `One | `Zero > `One `Zero ])
|
|
|
|
Caqti_request.t
|
|
|
|
val get_all :
|
|
|
|
(id, id * t, [ `Many | `One | `Zero ]) Caqti_request.t
|
|
|
|
val get_all_meta :
|
2021-06-07 13:52:37 +00:00
|
|
|
(id, id * Meta.t * file option, [ `Many | `One | `Zero ]) Caqti_request.t
|
2021-01-29 13:34:56 +00:00
|
|
|
val get_latest :
|
|
|
|
(id, id * Meta.t * file option, [< `Many | `One | `Zero > `One `Zero ])
|
|
|
|
Caqti_request.t
|
2021-04-23 13:00:12 +00:00
|
|
|
val get_latest_uuid :
|
|
|
|
(id, id * Uuidm.t, [< `Many | `One | `Zero > `One `Zero ])
|
|
|
|
Caqti_request.t
|
2021-06-02 12:23:40 +00:00
|
|
|
val get_latest_successful_uuid :
|
2021-06-02 13:05:10 +00:00
|
|
|
(id, Uuidm.t, [< `Many | `One | `Zero > `One `Zero ])
|
2021-06-02 12:23:40 +00:00
|
|
|
Caqti_request.t
|
2021-06-02 13:05:10 +00:00
|
|
|
val get_previous_successful :
|
2021-04-23 10:06:39 +00:00
|
|
|
(id, id * Meta.t, [< `Many | `One | `Zero > `One `Zero ])
|
|
|
|
Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
val add : (t, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
2021-02-02 08:34:21 +00:00
|
|
|
val get_by_hash :
|
|
|
|
(Cstruct.t, string * t, [< `Many | `One | `Zero > `One `Zero]) Caqti_request.t
|
2021-06-02 10:29:08 +00:00
|
|
|
val set_main_binary : (id * id, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
2021-03-08 16:01:00 +00:00
|
|
|
val remove : (id, unit, [< `Many | `One | `Zero > `Zero]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
end
|
|
|
|
|
2021-01-20 21:50:35 +00:00
|
|
|
module User : sig
|
|
|
|
val migrate :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val rollback :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val get_user :
|
2021-02-23 15:20:18 +00:00
|
|
|
(string, id * Builder_web_auth.scrypt Builder_web_auth.user_info,
|
2021-01-20 21:50:35 +00:00
|
|
|
[< `Many | `One | `Zero > `One `Zero ])
|
|
|
|
Caqti_request.t
|
|
|
|
val get_all :
|
|
|
|
(unit, string, [ `Many | `One | `Zero ]) Caqti_request.t
|
|
|
|
val add :
|
2021-02-23 15:20:18 +00:00
|
|
|
(Builder_web_auth.scrypt Builder_web_auth.user_info, unit, [< `Many | `One | `Zero > `Zero ])
|
2021-01-20 21:50:35 +00:00
|
|
|
Caqti_request.t
|
|
|
|
val remove : (id, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val remove_user :
|
|
|
|
(string, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val update_user :
|
2021-02-23 15:20:18 +00:00
|
|
|
(Builder_web_auth.scrypt Builder_web_auth.user_info, unit, [< `Many | `One | `Zero > `Zero ])
|
2021-01-20 21:50:35 +00:00
|
|
|
Caqti_request.t
|
|
|
|
end
|
|
|
|
|
2021-06-08 14:54:23 +00:00
|
|
|
module Access_list : sig
|
|
|
|
val migrate :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val rollback :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val get :
|
|
|
|
(id * id, id, [< `Many | `One | `Zero > `One ]) Caqti_request.t
|
|
|
|
val add :
|
|
|
|
(id * id, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val remove :
|
|
|
|
(id * id, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
val remove_all_by_username :
|
|
|
|
(string, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t
|
|
|
|
end
|
|
|
|
|
2021-01-08 12:47:17 +00:00
|
|
|
val migrate :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t list
|
|
|
|
val rollback :
|
|
|
|
(unit, unit, [< `Many | `One | `Zero > `Zero ]) Caqti_request.t list
|