-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgithub.spec.sql
121 lines (105 loc) · 3.2 KB
/
github.spec.sql
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
create or replace package github
as
/** Github api communication
* @author Morten Egan (github.com/morten-egan)
* @project OracleGit
* @version 0.1.0
*/
-- Global variables and types
type call_request is record (
call_endpoint varchar2(4000)
, call_method varchar2(100)
, call_json json
);
github_call_request call_request;
type call_result is record (
result_type varchar2(200)
, result json
, result_list json_list
);
github_response_result call_result;
github_api_raw_result clob;
github_call_status_code pls_integer;
github_call_status_reason varchar2(256);
type text_text_arr is table of varchar2(4000) index by varchar2(250);
type text_num_arr is table of varchar2(2000) index by pls_integer;
github_response_headers text_text_arr;
github_label_list text_num_arr;
/** Helper function to base64 encode content
* @author Morten Egan
* @param content The data to encode
* @return The content data as base64
*/
function encode64_clob(
content in clob
)
return clob;
/** Set default parameters for your GitHub session, such as API endpoint location and more.
* @author Morten Egan
* @param parameter_name The name of the variable to set.
* @param parameter_value The value of the parameter.
*/
procedure set_default_parameter (
parameter_name in varchar2
, parameter_value in varchar2
);
/** Set the Oracle wallet location and password
* @author Morten Egan
* @param wallet_location The location on the filesystem, excluding filename and trailing slash
* @param wallet_password Password to the wallet file. If autologin enabled on wallet, this should be null
*/
procedure set_session_wallet (
wallet_location in varchar2
, wallet_password in varchar2 default null
);
/** Set the account and password for the github session
* @author Morten Egan
* @param github_username The GitHub account name
* @param github_password The password for the github account
*/
procedure set_logon_info (
github_username in varchar2
, github_password in varchar2
);
/** Get the current github username set for the session
* @author Morten Egan
* @return Current set github username for session
*/
function get_session_github_user
return varchar2;
/** Create a committer hash for github content and commit calls
* @author Morten Egan
* @return A pljson stucture of github committer hash
*/
function github_committer_hash
return json;
/** Init the call structure
* @author Morten Egan
* @param endpoint The API endpoint
* @param endpoint_method The method of the request
*/
procedure init_talk (
endpoint in varchar2
, endpoint_method in varchar2
);
/** Send request to github api
* @author Morten Egan
* @param github_account The account to use as api user
* @param api_endpoint The API endpoint to use
* @param endpoint_method HTTP method
* @param api_data The data package to the endpoint
* @param api_result The result from the API call
*/
procedure talk (
github_account in varchar2
);
/** Get clob contents of url
* @author Morten Egan
* @param fetch_url The URL to fetch content from
*/
function listen (
fetch_url in varchar2
)
return clob;
end github;
/