@girs/rest-1.0 1.0.0-3.2.6 → 1.0.0-3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +6 -6
- package/rest-1.0.d.cts +55 -55
- package/rest-1.0.d.ts +55 -55
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for Rest-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.
|
|
8
|
+
GJS TypeScript type definitions for Rest-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.7.
|
|
9
9
|
|
|
10
10
|
A helper library for RESTful services.
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/rest-1.0",
|
|
3
|
-
"version": "1.0.0-3.2.
|
|
3
|
+
"version": "1.0.0-3.2.7",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Rest-1.0, generated from library version 1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "rest-1.0.js",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit rest-1.0.d.cts"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@girs/gio-2.0": "^2.78.0-3.2.
|
|
29
|
-
"@girs/gjs": "^3.2.
|
|
30
|
-
"@girs/glib-2.0": "^2.78.0-3.2.
|
|
31
|
-
"@girs/gobject-2.0": "^2.78.0-3.2.
|
|
32
|
-
"@girs/soup-3.0": "^3.4.4-3.2.
|
|
28
|
+
"@girs/gio-2.0": "^2.78.0-3.2.7",
|
|
29
|
+
"@girs/gjs": "^3.2.7",
|
|
30
|
+
"@girs/glib-2.0": "^2.78.0-3.2.7",
|
|
31
|
+
"@girs/gobject-2.0": "^2.78.0-3.2.7",
|
|
32
|
+
"@girs/soup-3.0": "^3.4.4-3.2.7"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "*"
|
package/rest-1.0.d.cts
CHANGED
|
@@ -224,7 +224,7 @@ export interface ProxyCallAsyncCallback {
|
|
|
224
224
|
(call: ProxyCall, error: GLib.Error, weak_object: GObject.Object, userdata: any | null): void
|
|
225
225
|
}
|
|
226
226
|
export interface ProxyCallContinuousCallback {
|
|
227
|
-
(call: ProxyCall, buf: string
|
|
227
|
+
(call: ProxyCall, buf: string, len: number, error: GLib.Error, weak_object: GObject.Object, userdata: any | null): void
|
|
228
228
|
}
|
|
229
229
|
export interface ProxyCallUploadCallback {
|
|
230
230
|
(call: ProxyCall, total: number, uploaded: number, error: GLib.Error, weak_object: GObject.Object, userdata: any | null): void
|
|
@@ -284,8 +284,8 @@ export interface OAuth2Proxy {
|
|
|
284
284
|
|
|
285
285
|
// Owm methods of Rest-1.0.Rest.OAuth2Proxy
|
|
286
286
|
|
|
287
|
-
build_authorization_url(code_challenge: string
|
|
288
|
-
fetch_access_token_async(authorization_code: string
|
|
287
|
+
build_authorization_url(code_challenge: string, scope: string | null): [ /* returnType */ string | null, /* state */ string | null ]
|
|
288
|
+
fetch_access_token_async(authorization_code: string, code_verifier: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
289
289
|
|
|
290
290
|
// Overloads of fetch_access_token_async
|
|
291
291
|
|
|
@@ -298,16 +298,16 @@ export interface OAuth2Proxy {
|
|
|
298
298
|
* @param cancellable
|
|
299
299
|
* @returns A Promise of the result of {@link fetch_access_token_async}
|
|
300
300
|
*/
|
|
301
|
-
fetch_access_token_async(authorization_code: string
|
|
301
|
+
fetch_access_token_async(authorization_code: string, code_verifier: string, cancellable: Gio.Cancellable | null): globalThis.Promise<boolean>
|
|
302
302
|
fetch_access_token_finish(result: Gio.AsyncResult): boolean
|
|
303
|
-
get_access_token(): string
|
|
304
|
-
get_auth_url(): string
|
|
305
|
-
get_client_id(): string
|
|
306
|
-
get_client_secret(): string
|
|
303
|
+
get_access_token(): string
|
|
304
|
+
get_auth_url(): string
|
|
305
|
+
get_client_id(): string
|
|
306
|
+
get_client_secret(): string
|
|
307
307
|
get_expiration_date(): GLib.DateTime
|
|
308
|
-
get_redirect_uri(): string
|
|
309
|
-
get_refresh_token(): string
|
|
310
|
-
get_token_url(): string
|
|
308
|
+
get_redirect_uri(): string
|
|
309
|
+
get_refresh_token(): string
|
|
310
|
+
get_token_url(): string
|
|
311
311
|
refresh_access_token(): boolean
|
|
312
312
|
refresh_access_token_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
313
313
|
|
|
@@ -322,14 +322,14 @@ export interface OAuth2Proxy {
|
|
|
322
322
|
*/
|
|
323
323
|
refresh_access_token_async(cancellable: Gio.Cancellable | null): globalThis.Promise<boolean>
|
|
324
324
|
refresh_access_token_finish(result: Gio.AsyncResult): boolean
|
|
325
|
-
set_access_token(access_token: string
|
|
326
|
-
set_auth_url(tokenurl: string
|
|
327
|
-
set_client_id(client_id: string
|
|
328
|
-
set_client_secret(client_secret: string
|
|
325
|
+
set_access_token(access_token: string): void
|
|
326
|
+
set_auth_url(tokenurl: string): void
|
|
327
|
+
set_client_id(client_id: string): void
|
|
328
|
+
set_client_secret(client_secret: string): void
|
|
329
329
|
set_expiration_date(expiration_date: GLib.DateTime): void
|
|
330
|
-
set_redirect_uri(redirect_uri: string
|
|
331
|
-
set_refresh_token(refresh_token: string
|
|
332
|
-
set_token_url(tokenurl: string
|
|
330
|
+
set_redirect_uri(redirect_uri: string): void
|
|
331
|
+
set_refresh_token(refresh_token: string): void
|
|
332
|
+
set_token_url(tokenurl: string): void
|
|
333
333
|
|
|
334
334
|
// Own virtual methods of Rest-1.0.Rest.OAuth2Proxy
|
|
335
335
|
|
|
@@ -412,7 +412,7 @@ export class OAuth2Proxy extends Proxy {
|
|
|
412
412
|
* @param baseurl
|
|
413
413
|
* @returns a newly created #RestOAuth2Proxy
|
|
414
414
|
*/
|
|
415
|
-
constructor(authurl: string
|
|
415
|
+
constructor(authurl: string, tokenurl: string, redirecturl: string, client_id: string, client_secret: string, baseurl: string)
|
|
416
416
|
/**
|
|
417
417
|
* Create a new #RestOAuth2Proxy.
|
|
418
418
|
* @constructor
|
|
@@ -424,7 +424,7 @@ export class OAuth2Proxy extends Proxy {
|
|
|
424
424
|
* @param baseurl
|
|
425
425
|
* @returns a newly created #RestOAuth2Proxy
|
|
426
426
|
*/
|
|
427
|
-
static new(authurl: string
|
|
427
|
+
static new(authurl: string, tokenurl: string, redirecturl: string, client_id: string, client_secret: string, baseurl: string): OAuth2Proxy
|
|
428
428
|
|
|
429
429
|
// Overloads of new
|
|
430
430
|
|
|
@@ -440,7 +440,7 @@ export class OAuth2Proxy extends Proxy {
|
|
|
440
440
|
* @param binding_required whether the URL needs to be bound before calling
|
|
441
441
|
* @returns A new #RestProxy.
|
|
442
442
|
*/
|
|
443
|
-
static new(url_format: string
|
|
443
|
+
static new(url_format: string, binding_required: boolean): Proxy
|
|
444
444
|
_init(config?: OAuth2Proxy.ConstructorProperties): void
|
|
445
445
|
}
|
|
446
446
|
|
|
@@ -552,14 +552,14 @@ export interface Proxy {
|
|
|
552
552
|
* @param feature A #SoupSessionFeature
|
|
553
553
|
*/
|
|
554
554
|
add_soup_feature(feature: Soup.SessionFeature): void
|
|
555
|
-
get_user_agent(): string
|
|
555
|
+
get_user_agent(): string
|
|
556
556
|
/**
|
|
557
557
|
* Create a new #RestProxyCall for making a call to the web service. This call
|
|
558
558
|
* is one-shot and should not be re-used for making multiple calls.
|
|
559
559
|
* @returns a new #RestProxyCall.
|
|
560
560
|
*/
|
|
561
561
|
new_call(): ProxyCall
|
|
562
|
-
set_user_agent(user_agent: string
|
|
562
|
+
set_user_agent(user_agent: string): void
|
|
563
563
|
|
|
564
564
|
// Own virtual methods of Rest-1.0.Rest.Proxy
|
|
565
565
|
|
|
@@ -630,7 +630,7 @@ export class Proxy extends GObject.Object {
|
|
|
630
630
|
* @param binding_required whether the URL needs to be bound before calling
|
|
631
631
|
* @returns A new #RestProxy.
|
|
632
632
|
*/
|
|
633
|
-
constructor(url_format: string
|
|
633
|
+
constructor(url_format: string, binding_required: boolean)
|
|
634
634
|
/**
|
|
635
635
|
* Create a new #RestProxy for the specified endpoint `url_format,` using the
|
|
636
636
|
* "GET" method.
|
|
@@ -643,7 +643,7 @@ export class Proxy extends GObject.Object {
|
|
|
643
643
|
* @param binding_required whether the URL needs to be bound before calling
|
|
644
644
|
* @returns A new #RestProxy.
|
|
645
645
|
*/
|
|
646
|
-
static new(url_format: string
|
|
646
|
+
static new(url_format: string, binding_required: boolean): Proxy
|
|
647
647
|
/**
|
|
648
648
|
* Create a new #RestProxy for the specified endpoint `url_format,` using the
|
|
649
649
|
* "GET" method.
|
|
@@ -658,7 +658,7 @@ export class Proxy extends GObject.Object {
|
|
|
658
658
|
* @param password the password provided by the user or client
|
|
659
659
|
* @returns A new #RestProxy.
|
|
660
660
|
*/
|
|
661
|
-
static new_with_authentication(url_format: string
|
|
661
|
+
static new_with_authentication(url_format: string, binding_required: boolean, username: string, password: string): Proxy
|
|
662
662
|
_init(config?: Proxy.ConstructorProperties): void
|
|
663
663
|
}
|
|
664
664
|
|
|
@@ -755,7 +755,7 @@ export interface ProxyCall {
|
|
|
755
755
|
* @param header The name of the header to set
|
|
756
756
|
* @param value The value of the header
|
|
757
757
|
*/
|
|
758
|
-
add_header(header: string
|
|
758
|
+
add_header(header: string, value: string): void
|
|
759
759
|
/**
|
|
760
760
|
* Add a query parameter called `param` with the string value `value` to the call.
|
|
761
761
|
* If a parameter with this name already exists, the new value will replace the
|
|
@@ -763,7 +763,7 @@ export interface ProxyCall {
|
|
|
763
763
|
* @param name The name of the parameter to set
|
|
764
764
|
* @param value The value of the parameter
|
|
765
765
|
*/
|
|
766
|
-
add_param(name: string
|
|
766
|
+
add_param(name: string, value: string): void
|
|
767
767
|
/**
|
|
768
768
|
* Add a query parameter `param` to the call.
|
|
769
769
|
* If a parameter with this name already exists, the new value will replace the
|
|
@@ -775,12 +775,12 @@ export interface ProxyCall {
|
|
|
775
775
|
* Get the REST function that is going to be called on the proxy.
|
|
776
776
|
* @returns The REST "function" for the current call, see also rest_proxy_call_set_function(). This string is owned by the #RestProxyCall and should not be freed.
|
|
777
777
|
*/
|
|
778
|
-
get_function(): string
|
|
778
|
+
get_function(): string
|
|
779
779
|
/**
|
|
780
780
|
* Get the HTTP method to use when making the call, for example GET or POST.
|
|
781
781
|
* @returns the HTTP method
|
|
782
782
|
*/
|
|
783
|
-
get_method(): string
|
|
783
|
+
get_method(): string
|
|
784
784
|
/**
|
|
785
785
|
* Get the parameters as a #RestParams of parameter names to values. The
|
|
786
786
|
* returned value is owned by the RestProxyCall instance and should not
|
|
@@ -792,7 +792,7 @@ export interface ProxyCall {
|
|
|
792
792
|
* Get the return payload.
|
|
793
793
|
* @returns A pointer to the payload. This is owned by #RestProxyCall and should not be freed.
|
|
794
794
|
*/
|
|
795
|
-
get_payload(): string
|
|
795
|
+
get_payload(): string
|
|
796
796
|
/**
|
|
797
797
|
* Get the length of the return payload.
|
|
798
798
|
* @returns the length of the payload in bytes.
|
|
@@ -807,7 +807,7 @@ export interface ProxyCall {
|
|
|
807
807
|
* Get the human-readable HTTP status message for the call.
|
|
808
808
|
* @returns The status message. This string is owned by #RestProxyCall and should not be freed.
|
|
809
809
|
*/
|
|
810
|
-
get_status_message(): string
|
|
810
|
+
get_status_message(): string
|
|
811
811
|
invoke_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
812
812
|
|
|
813
813
|
// Overloads of invoke_async
|
|
@@ -826,29 +826,29 @@ export interface ProxyCall {
|
|
|
826
826
|
* @param header The header name
|
|
827
827
|
* @returns The header value, or %NULL if it does not exist. This string is owned by the #RestProxyCall and should not be freed.
|
|
828
828
|
*/
|
|
829
|
-
lookup_header(header: string
|
|
829
|
+
lookup_header(header: string): string
|
|
830
830
|
/**
|
|
831
831
|
* Get the value of the parameter called `name`.
|
|
832
832
|
* @param name The paramter name
|
|
833
833
|
* @returns The parameter value, or %NULL if it does not exist. This string is owned by the #RestProxyCall and should not be freed.
|
|
834
834
|
*/
|
|
835
|
-
lookup_param(name: string
|
|
835
|
+
lookup_param(name: string): Param | null
|
|
836
836
|
/**
|
|
837
837
|
* Get the string value of the header `header` or %NULL if that header is not
|
|
838
838
|
* present or there are no headers.
|
|
839
839
|
* @param header The name of the header to lookup.
|
|
840
840
|
*/
|
|
841
|
-
lookup_response_header(header: string
|
|
841
|
+
lookup_response_header(header: string): string
|
|
842
842
|
/**
|
|
843
843
|
* Remove the header named `header` from the call.
|
|
844
844
|
* @param header The header name
|
|
845
845
|
*/
|
|
846
|
-
remove_header(header: string
|
|
846
|
+
remove_header(header: string): void
|
|
847
847
|
/**
|
|
848
848
|
* Remove the parameter named `name` from the call.
|
|
849
849
|
* @param name The paramter name
|
|
850
850
|
*/
|
|
851
|
-
remove_param(name: string
|
|
851
|
+
remove_param(name: string): void
|
|
852
852
|
/**
|
|
853
853
|
* Invoker for a virtual method to serialize the parameters for this
|
|
854
854
|
* #RestProxyCall.
|
|
@@ -863,12 +863,12 @@ export interface ProxyCall {
|
|
|
863
863
|
* <literal>http://www.example.com/test</literal>
|
|
864
864
|
* @param function_ The function to call
|
|
865
865
|
*/
|
|
866
|
-
set_function(function_: string
|
|
866
|
+
set_function(function_: string): void
|
|
867
867
|
/**
|
|
868
868
|
* Set the HTTP method to use when making the call, for example GET or POST.
|
|
869
869
|
* @param method The HTTP method to use
|
|
870
870
|
*/
|
|
871
|
-
set_method(method: string
|
|
871
|
+
set_method(method: string): void
|
|
872
872
|
/**
|
|
873
873
|
* Synchronously invokes `call`. After this function has returned,
|
|
874
874
|
* rest_proxy_call_get_payload() will return the result of this call.
|
|
@@ -959,7 +959,7 @@ export interface XmlParser {
|
|
|
959
959
|
* @param len the length of `data,` or -1 if `data` is a nul-terminated string
|
|
960
960
|
* @returns a new #RestXmlNode, or %NULL if the XML was invalid.
|
|
961
961
|
*/
|
|
962
|
-
parse_from_data(data: string
|
|
962
|
+
parse_from_data(data: string, len: number): XmlNode
|
|
963
963
|
|
|
964
964
|
// Class property signals of Rest-1.0.Rest.XmlParser
|
|
965
965
|
|
|
@@ -1048,17 +1048,17 @@ export interface Param {
|
|
|
1048
1048
|
* type "text/plain".
|
|
1049
1049
|
* @returns the MIME type
|
|
1050
1050
|
*/
|
|
1051
|
-
get_content_type(): string
|
|
1051
|
+
get_content_type(): string
|
|
1052
1052
|
/**
|
|
1053
1053
|
* Get the original file name of the parameter, if one is available.
|
|
1054
1054
|
* @returns the filename if set, or %NULL.
|
|
1055
1055
|
*/
|
|
1056
|
-
get_file_name(): string
|
|
1056
|
+
get_file_name(): string
|
|
1057
1057
|
/**
|
|
1058
1058
|
* Get the name of the parameter.
|
|
1059
1059
|
* @returns the parameter name.
|
|
1060
1060
|
*/
|
|
1061
|
-
get_name(): string
|
|
1061
|
+
get_name(): string
|
|
1062
1062
|
/**
|
|
1063
1063
|
* Determine if the parameter is a string value, i.e. the content type is "text/plain".
|
|
1064
1064
|
* @returns %TRUE if the parameter is a string, %FALSE otherwise.
|
|
@@ -1098,7 +1098,7 @@ export class Param {
|
|
|
1098
1098
|
* @param filename the original filename, or %NULL
|
|
1099
1099
|
* @returns a new #RestParam.
|
|
1100
1100
|
*/
|
|
1101
|
-
static new_full(name: string
|
|
1101
|
+
static new_full(name: string, use: MemoryUse, data: Uint8Array, content_type: string, filename: string | null): Param
|
|
1102
1102
|
/**
|
|
1103
1103
|
* A convience constructor to create a #RestParam from a given UTF-8 string.
|
|
1104
1104
|
* The resulting #RestParam will have a content type of "text/plain".
|
|
@@ -1108,7 +1108,7 @@ export class Param {
|
|
|
1108
1108
|
* @param string the parameter value
|
|
1109
1109
|
* @returns a new #RestParam.
|
|
1110
1110
|
*/
|
|
1111
|
-
static new_string(name: string
|
|
1111
|
+
static new_string(name: string, use: MemoryUse, string: string): Param
|
|
1112
1112
|
/**
|
|
1113
1113
|
* Create a new #RestParam called `name` with `length` bytes of `data` as the
|
|
1114
1114
|
* value. `content_type` is the type of the data as a MIME type, for example
|
|
@@ -1140,7 +1140,7 @@ export class Param {
|
|
|
1140
1140
|
* @param owner_dnotify a function to free/unref `owner` when the buffer is freed
|
|
1141
1141
|
* @returns a new #RestParam.
|
|
1142
1142
|
*/
|
|
1143
|
-
static new_with_owner(name: string
|
|
1143
|
+
static new_with_owner(name: string, data: Uint8Array, content_type: string, filename: string | null, owner: any | null, owner_dnotify: GLib.DestroyNotify | null): Param
|
|
1144
1144
|
}
|
|
1145
1145
|
|
|
1146
1146
|
export interface Params {
|
|
@@ -1177,7 +1177,7 @@ export interface Params {
|
|
|
1177
1177
|
* @param name a parameter name
|
|
1178
1178
|
* @returns a #RestParam or %NULL if the name doesn't exist
|
|
1179
1179
|
*/
|
|
1180
|
-
get(name: string
|
|
1180
|
+
get(name: string): Param | null
|
|
1181
1181
|
/**
|
|
1182
1182
|
* Increments the reference count of `self` by one.
|
|
1183
1183
|
* @returns @self
|
|
@@ -1187,7 +1187,7 @@ export interface Params {
|
|
|
1187
1187
|
* Remove the #RestParam called `name`.
|
|
1188
1188
|
* @param name a parameter name
|
|
1189
1189
|
*/
|
|
1190
|
-
remove(name: string
|
|
1190
|
+
remove(name: string): void
|
|
1191
1191
|
/**
|
|
1192
1192
|
* Decrements the reference count of `self` by one, freeing the structure when
|
|
1193
1193
|
* the reference count reaches zero.
|
|
@@ -1273,12 +1273,12 @@ export interface PkceCodeChallenge {
|
|
|
1273
1273
|
* Returns the Code Challenge for the Pkce verification.
|
|
1274
1274
|
* @returns the code_challenge
|
|
1275
1275
|
*/
|
|
1276
|
-
get_challenge(): string
|
|
1276
|
+
get_challenge(): string
|
|
1277
1277
|
/**
|
|
1278
1278
|
* Returns the Code Verifier for the Pkce verification.
|
|
1279
1279
|
* @returns the code_verifier
|
|
1280
1280
|
*/
|
|
1281
|
-
get_verifier(): string
|
|
1281
|
+
get_verifier(): string
|
|
1282
1282
|
}
|
|
1283
1283
|
|
|
1284
1284
|
/**
|
|
@@ -1408,27 +1408,27 @@ export interface XmlNode {
|
|
|
1408
1408
|
* @param attribute name of the attribute
|
|
1409
1409
|
* @param value value to set attribute to
|
|
1410
1410
|
*/
|
|
1411
|
-
add_attr(attribute: string
|
|
1411
|
+
add_attr(attribute: string, value: string): void
|
|
1412
1412
|
/**
|
|
1413
1413
|
* Adds a new node to the given parent node; to create the top-level node,
|
|
1414
1414
|
* parent should be %NULL.
|
|
1415
1415
|
* @param tag name of the child node
|
|
1416
1416
|
* @returns the newly added #RestXmlNode; the node object is owned by, and valid for the life time of, the #RestXmlCreator.
|
|
1417
1417
|
*/
|
|
1418
|
-
add_child(tag: string
|
|
1418
|
+
add_child(tag: string): XmlNode
|
|
1419
1419
|
/**
|
|
1420
1420
|
* Searches for the first child node of `start` named `tag`.
|
|
1421
1421
|
* @param tag the name of a node
|
|
1422
1422
|
* @returns the first child node, or %NULL if it doesn't exist.
|
|
1423
1423
|
*/
|
|
1424
|
-
find(tag: string
|
|
1424
|
+
find(tag: string): XmlNode
|
|
1425
1425
|
/**
|
|
1426
1426
|
* Get the value of the attribute named `attr_name,` or %NULL if it doesn't
|
|
1427
1427
|
* exist.
|
|
1428
1428
|
* @param attr_name the name of an attribute
|
|
1429
1429
|
* @returns the attribute value. This string is owned by #RestXmlNode and should not be freed.
|
|
1430
1430
|
*/
|
|
1431
|
-
get_attr(attr_name: string
|
|
1431
|
+
get_attr(attr_name: string): string
|
|
1432
1432
|
/**
|
|
1433
1433
|
* Recursively outputs given node and it's children.
|
|
1434
1434
|
* @returns xml string representing the node.
|
|
@@ -1438,7 +1438,7 @@ export interface XmlNode {
|
|
|
1438
1438
|
* Sets content for the given node.
|
|
1439
1439
|
* @param value the content
|
|
1440
1440
|
*/
|
|
1441
|
-
set_content(value: string
|
|
1441
|
+
set_content(value: string): void
|
|
1442
1442
|
}
|
|
1443
1443
|
|
|
1444
1444
|
/**
|
package/rest-1.0.d.ts
CHANGED
|
@@ -226,7 +226,7 @@ interface ProxyCallAsyncCallback {
|
|
|
226
226
|
(call: ProxyCall, error: GLib.Error, weak_object: GObject.Object, userdata: any | null): void
|
|
227
227
|
}
|
|
228
228
|
interface ProxyCallContinuousCallback {
|
|
229
|
-
(call: ProxyCall, buf: string
|
|
229
|
+
(call: ProxyCall, buf: string, len: number, error: GLib.Error, weak_object: GObject.Object, userdata: any | null): void
|
|
230
230
|
}
|
|
231
231
|
interface ProxyCallUploadCallback {
|
|
232
232
|
(call: ProxyCall, total: number, uploaded: number, error: GLib.Error, weak_object: GObject.Object, userdata: any | null): void
|
|
@@ -286,8 +286,8 @@ interface OAuth2Proxy {
|
|
|
286
286
|
|
|
287
287
|
// Owm methods of Rest-1.0.Rest.OAuth2Proxy
|
|
288
288
|
|
|
289
|
-
build_authorization_url(code_challenge: string
|
|
290
|
-
fetch_access_token_async(authorization_code: string
|
|
289
|
+
build_authorization_url(code_challenge: string, scope: string | null): [ /* returnType */ string | null, /* state */ string | null ]
|
|
290
|
+
fetch_access_token_async(authorization_code: string, code_verifier: string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
291
291
|
|
|
292
292
|
// Overloads of fetch_access_token_async
|
|
293
293
|
|
|
@@ -300,16 +300,16 @@ interface OAuth2Proxy {
|
|
|
300
300
|
* @param cancellable
|
|
301
301
|
* @returns A Promise of the result of {@link fetch_access_token_async}
|
|
302
302
|
*/
|
|
303
|
-
fetch_access_token_async(authorization_code: string
|
|
303
|
+
fetch_access_token_async(authorization_code: string, code_verifier: string, cancellable: Gio.Cancellable | null): globalThis.Promise<boolean>
|
|
304
304
|
fetch_access_token_finish(result: Gio.AsyncResult): boolean
|
|
305
|
-
get_access_token(): string
|
|
306
|
-
get_auth_url(): string
|
|
307
|
-
get_client_id(): string
|
|
308
|
-
get_client_secret(): string
|
|
305
|
+
get_access_token(): string
|
|
306
|
+
get_auth_url(): string
|
|
307
|
+
get_client_id(): string
|
|
308
|
+
get_client_secret(): string
|
|
309
309
|
get_expiration_date(): GLib.DateTime
|
|
310
|
-
get_redirect_uri(): string
|
|
311
|
-
get_refresh_token(): string
|
|
312
|
-
get_token_url(): string
|
|
310
|
+
get_redirect_uri(): string
|
|
311
|
+
get_refresh_token(): string
|
|
312
|
+
get_token_url(): string
|
|
313
313
|
refresh_access_token(): boolean
|
|
314
314
|
refresh_access_token_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
315
315
|
|
|
@@ -324,14 +324,14 @@ interface OAuth2Proxy {
|
|
|
324
324
|
*/
|
|
325
325
|
refresh_access_token_async(cancellable: Gio.Cancellable | null): globalThis.Promise<boolean>
|
|
326
326
|
refresh_access_token_finish(result: Gio.AsyncResult): boolean
|
|
327
|
-
set_access_token(access_token: string
|
|
328
|
-
set_auth_url(tokenurl: string
|
|
329
|
-
set_client_id(client_id: string
|
|
330
|
-
set_client_secret(client_secret: string
|
|
327
|
+
set_access_token(access_token: string): void
|
|
328
|
+
set_auth_url(tokenurl: string): void
|
|
329
|
+
set_client_id(client_id: string): void
|
|
330
|
+
set_client_secret(client_secret: string): void
|
|
331
331
|
set_expiration_date(expiration_date: GLib.DateTime): void
|
|
332
|
-
set_redirect_uri(redirect_uri: string
|
|
333
|
-
set_refresh_token(refresh_token: string
|
|
334
|
-
set_token_url(tokenurl: string
|
|
332
|
+
set_redirect_uri(redirect_uri: string): void
|
|
333
|
+
set_refresh_token(refresh_token: string): void
|
|
334
|
+
set_token_url(tokenurl: string): void
|
|
335
335
|
|
|
336
336
|
// Own virtual methods of Rest-1.0.Rest.OAuth2Proxy
|
|
337
337
|
|
|
@@ -414,7 +414,7 @@ class OAuth2Proxy extends Proxy {
|
|
|
414
414
|
* @param baseurl
|
|
415
415
|
* @returns a newly created #RestOAuth2Proxy
|
|
416
416
|
*/
|
|
417
|
-
constructor(authurl: string
|
|
417
|
+
constructor(authurl: string, tokenurl: string, redirecturl: string, client_id: string, client_secret: string, baseurl: string)
|
|
418
418
|
/**
|
|
419
419
|
* Create a new #RestOAuth2Proxy.
|
|
420
420
|
* @constructor
|
|
@@ -426,7 +426,7 @@ class OAuth2Proxy extends Proxy {
|
|
|
426
426
|
* @param baseurl
|
|
427
427
|
* @returns a newly created #RestOAuth2Proxy
|
|
428
428
|
*/
|
|
429
|
-
static new(authurl: string
|
|
429
|
+
static new(authurl: string, tokenurl: string, redirecturl: string, client_id: string, client_secret: string, baseurl: string): OAuth2Proxy
|
|
430
430
|
|
|
431
431
|
// Overloads of new
|
|
432
432
|
|
|
@@ -442,7 +442,7 @@ class OAuth2Proxy extends Proxy {
|
|
|
442
442
|
* @param binding_required whether the URL needs to be bound before calling
|
|
443
443
|
* @returns A new #RestProxy.
|
|
444
444
|
*/
|
|
445
|
-
static new(url_format: string
|
|
445
|
+
static new(url_format: string, binding_required: boolean): Proxy
|
|
446
446
|
_init(config?: OAuth2Proxy.ConstructorProperties): void
|
|
447
447
|
}
|
|
448
448
|
|
|
@@ -554,14 +554,14 @@ interface Proxy {
|
|
|
554
554
|
* @param feature A #SoupSessionFeature
|
|
555
555
|
*/
|
|
556
556
|
add_soup_feature(feature: Soup.SessionFeature): void
|
|
557
|
-
get_user_agent(): string
|
|
557
|
+
get_user_agent(): string
|
|
558
558
|
/**
|
|
559
559
|
* Create a new #RestProxyCall for making a call to the web service. This call
|
|
560
560
|
* is one-shot and should not be re-used for making multiple calls.
|
|
561
561
|
* @returns a new #RestProxyCall.
|
|
562
562
|
*/
|
|
563
563
|
new_call(): ProxyCall
|
|
564
|
-
set_user_agent(user_agent: string
|
|
564
|
+
set_user_agent(user_agent: string): void
|
|
565
565
|
|
|
566
566
|
// Own virtual methods of Rest-1.0.Rest.Proxy
|
|
567
567
|
|
|
@@ -632,7 +632,7 @@ class Proxy extends GObject.Object {
|
|
|
632
632
|
* @param binding_required whether the URL needs to be bound before calling
|
|
633
633
|
* @returns A new #RestProxy.
|
|
634
634
|
*/
|
|
635
|
-
constructor(url_format: string
|
|
635
|
+
constructor(url_format: string, binding_required: boolean)
|
|
636
636
|
/**
|
|
637
637
|
* Create a new #RestProxy for the specified endpoint `url_format,` using the
|
|
638
638
|
* "GET" method.
|
|
@@ -645,7 +645,7 @@ class Proxy extends GObject.Object {
|
|
|
645
645
|
* @param binding_required whether the URL needs to be bound before calling
|
|
646
646
|
* @returns A new #RestProxy.
|
|
647
647
|
*/
|
|
648
|
-
static new(url_format: string
|
|
648
|
+
static new(url_format: string, binding_required: boolean): Proxy
|
|
649
649
|
/**
|
|
650
650
|
* Create a new #RestProxy for the specified endpoint `url_format,` using the
|
|
651
651
|
* "GET" method.
|
|
@@ -660,7 +660,7 @@ class Proxy extends GObject.Object {
|
|
|
660
660
|
* @param password the password provided by the user or client
|
|
661
661
|
* @returns A new #RestProxy.
|
|
662
662
|
*/
|
|
663
|
-
static new_with_authentication(url_format: string
|
|
663
|
+
static new_with_authentication(url_format: string, binding_required: boolean, username: string, password: string): Proxy
|
|
664
664
|
_init(config?: Proxy.ConstructorProperties): void
|
|
665
665
|
}
|
|
666
666
|
|
|
@@ -757,7 +757,7 @@ interface ProxyCall {
|
|
|
757
757
|
* @param header The name of the header to set
|
|
758
758
|
* @param value The value of the header
|
|
759
759
|
*/
|
|
760
|
-
add_header(header: string
|
|
760
|
+
add_header(header: string, value: string): void
|
|
761
761
|
/**
|
|
762
762
|
* Add a query parameter called `param` with the string value `value` to the call.
|
|
763
763
|
* If a parameter with this name already exists, the new value will replace the
|
|
@@ -765,7 +765,7 @@ interface ProxyCall {
|
|
|
765
765
|
* @param name The name of the parameter to set
|
|
766
766
|
* @param value The value of the parameter
|
|
767
767
|
*/
|
|
768
|
-
add_param(name: string
|
|
768
|
+
add_param(name: string, value: string): void
|
|
769
769
|
/**
|
|
770
770
|
* Add a query parameter `param` to the call.
|
|
771
771
|
* If a parameter with this name already exists, the new value will replace the
|
|
@@ -777,12 +777,12 @@ interface ProxyCall {
|
|
|
777
777
|
* Get the REST function that is going to be called on the proxy.
|
|
778
778
|
* @returns The REST "function" for the current call, see also rest_proxy_call_set_function(). This string is owned by the #RestProxyCall and should not be freed.
|
|
779
779
|
*/
|
|
780
|
-
get_function(): string
|
|
780
|
+
get_function(): string
|
|
781
781
|
/**
|
|
782
782
|
* Get the HTTP method to use when making the call, for example GET or POST.
|
|
783
783
|
* @returns the HTTP method
|
|
784
784
|
*/
|
|
785
|
-
get_method(): string
|
|
785
|
+
get_method(): string
|
|
786
786
|
/**
|
|
787
787
|
* Get the parameters as a #RestParams of parameter names to values. The
|
|
788
788
|
* returned value is owned by the RestProxyCall instance and should not
|
|
@@ -794,7 +794,7 @@ interface ProxyCall {
|
|
|
794
794
|
* Get the return payload.
|
|
795
795
|
* @returns A pointer to the payload. This is owned by #RestProxyCall and should not be freed.
|
|
796
796
|
*/
|
|
797
|
-
get_payload(): string
|
|
797
|
+
get_payload(): string
|
|
798
798
|
/**
|
|
799
799
|
* Get the length of the return payload.
|
|
800
800
|
* @returns the length of the payload in bytes.
|
|
@@ -809,7 +809,7 @@ interface ProxyCall {
|
|
|
809
809
|
* Get the human-readable HTTP status message for the call.
|
|
810
810
|
* @returns The status message. This string is owned by #RestProxyCall and should not be freed.
|
|
811
811
|
*/
|
|
812
|
-
get_status_message(): string
|
|
812
|
+
get_status_message(): string
|
|
813
813
|
invoke_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void
|
|
814
814
|
|
|
815
815
|
// Overloads of invoke_async
|
|
@@ -828,29 +828,29 @@ interface ProxyCall {
|
|
|
828
828
|
* @param header The header name
|
|
829
829
|
* @returns The header value, or %NULL if it does not exist. This string is owned by the #RestProxyCall and should not be freed.
|
|
830
830
|
*/
|
|
831
|
-
lookup_header(header: string
|
|
831
|
+
lookup_header(header: string): string
|
|
832
832
|
/**
|
|
833
833
|
* Get the value of the parameter called `name`.
|
|
834
834
|
* @param name The paramter name
|
|
835
835
|
* @returns The parameter value, or %NULL if it does not exist. This string is owned by the #RestProxyCall and should not be freed.
|
|
836
836
|
*/
|
|
837
|
-
lookup_param(name: string
|
|
837
|
+
lookup_param(name: string): Param | null
|
|
838
838
|
/**
|
|
839
839
|
* Get the string value of the header `header` or %NULL if that header is not
|
|
840
840
|
* present or there are no headers.
|
|
841
841
|
* @param header The name of the header to lookup.
|
|
842
842
|
*/
|
|
843
|
-
lookup_response_header(header: string
|
|
843
|
+
lookup_response_header(header: string): string
|
|
844
844
|
/**
|
|
845
845
|
* Remove the header named `header` from the call.
|
|
846
846
|
* @param header The header name
|
|
847
847
|
*/
|
|
848
|
-
remove_header(header: string
|
|
848
|
+
remove_header(header: string): void
|
|
849
849
|
/**
|
|
850
850
|
* Remove the parameter named `name` from the call.
|
|
851
851
|
* @param name The paramter name
|
|
852
852
|
*/
|
|
853
|
-
remove_param(name: string
|
|
853
|
+
remove_param(name: string): void
|
|
854
854
|
/**
|
|
855
855
|
* Invoker for a virtual method to serialize the parameters for this
|
|
856
856
|
* #RestProxyCall.
|
|
@@ -865,12 +865,12 @@ interface ProxyCall {
|
|
|
865
865
|
* <literal>http://www.example.com/test</literal>
|
|
866
866
|
* @param function_ The function to call
|
|
867
867
|
*/
|
|
868
|
-
set_function(function_: string
|
|
868
|
+
set_function(function_: string): void
|
|
869
869
|
/**
|
|
870
870
|
* Set the HTTP method to use when making the call, for example GET or POST.
|
|
871
871
|
* @param method The HTTP method to use
|
|
872
872
|
*/
|
|
873
|
-
set_method(method: string
|
|
873
|
+
set_method(method: string): void
|
|
874
874
|
/**
|
|
875
875
|
* Synchronously invokes `call`. After this function has returned,
|
|
876
876
|
* rest_proxy_call_get_payload() will return the result of this call.
|
|
@@ -961,7 +961,7 @@ interface XmlParser {
|
|
|
961
961
|
* @param len the length of `data,` or -1 if `data` is a nul-terminated string
|
|
962
962
|
* @returns a new #RestXmlNode, or %NULL if the XML was invalid.
|
|
963
963
|
*/
|
|
964
|
-
parse_from_data(data: string
|
|
964
|
+
parse_from_data(data: string, len: number): XmlNode
|
|
965
965
|
|
|
966
966
|
// Class property signals of Rest-1.0.Rest.XmlParser
|
|
967
967
|
|
|
@@ -1050,17 +1050,17 @@ interface Param {
|
|
|
1050
1050
|
* type "text/plain".
|
|
1051
1051
|
* @returns the MIME type
|
|
1052
1052
|
*/
|
|
1053
|
-
get_content_type(): string
|
|
1053
|
+
get_content_type(): string
|
|
1054
1054
|
/**
|
|
1055
1055
|
* Get the original file name of the parameter, if one is available.
|
|
1056
1056
|
* @returns the filename if set, or %NULL.
|
|
1057
1057
|
*/
|
|
1058
|
-
get_file_name(): string
|
|
1058
|
+
get_file_name(): string
|
|
1059
1059
|
/**
|
|
1060
1060
|
* Get the name of the parameter.
|
|
1061
1061
|
* @returns the parameter name.
|
|
1062
1062
|
*/
|
|
1063
|
-
get_name(): string
|
|
1063
|
+
get_name(): string
|
|
1064
1064
|
/**
|
|
1065
1065
|
* Determine if the parameter is a string value, i.e. the content type is "text/plain".
|
|
1066
1066
|
* @returns %TRUE if the parameter is a string, %FALSE otherwise.
|
|
@@ -1100,7 +1100,7 @@ class Param {
|
|
|
1100
1100
|
* @param filename the original filename, or %NULL
|
|
1101
1101
|
* @returns a new #RestParam.
|
|
1102
1102
|
*/
|
|
1103
|
-
static new_full(name: string
|
|
1103
|
+
static new_full(name: string, use: MemoryUse, data: Uint8Array, content_type: string, filename: string | null): Param
|
|
1104
1104
|
/**
|
|
1105
1105
|
* A convience constructor to create a #RestParam from a given UTF-8 string.
|
|
1106
1106
|
* The resulting #RestParam will have a content type of "text/plain".
|
|
@@ -1110,7 +1110,7 @@ class Param {
|
|
|
1110
1110
|
* @param string the parameter value
|
|
1111
1111
|
* @returns a new #RestParam.
|
|
1112
1112
|
*/
|
|
1113
|
-
static new_string(name: string
|
|
1113
|
+
static new_string(name: string, use: MemoryUse, string: string): Param
|
|
1114
1114
|
/**
|
|
1115
1115
|
* Create a new #RestParam called `name` with `length` bytes of `data` as the
|
|
1116
1116
|
* value. `content_type` is the type of the data as a MIME type, for example
|
|
@@ -1142,7 +1142,7 @@ class Param {
|
|
|
1142
1142
|
* @param owner_dnotify a function to free/unref `owner` when the buffer is freed
|
|
1143
1143
|
* @returns a new #RestParam.
|
|
1144
1144
|
*/
|
|
1145
|
-
static new_with_owner(name: string
|
|
1145
|
+
static new_with_owner(name: string, data: Uint8Array, content_type: string, filename: string | null, owner: any | null, owner_dnotify: GLib.DestroyNotify | null): Param
|
|
1146
1146
|
}
|
|
1147
1147
|
|
|
1148
1148
|
interface Params {
|
|
@@ -1179,7 +1179,7 @@ interface Params {
|
|
|
1179
1179
|
* @param name a parameter name
|
|
1180
1180
|
* @returns a #RestParam or %NULL if the name doesn't exist
|
|
1181
1181
|
*/
|
|
1182
|
-
get(name: string
|
|
1182
|
+
get(name: string): Param | null
|
|
1183
1183
|
/**
|
|
1184
1184
|
* Increments the reference count of `self` by one.
|
|
1185
1185
|
* @returns @self
|
|
@@ -1189,7 +1189,7 @@ interface Params {
|
|
|
1189
1189
|
* Remove the #RestParam called `name`.
|
|
1190
1190
|
* @param name a parameter name
|
|
1191
1191
|
*/
|
|
1192
|
-
remove(name: string
|
|
1192
|
+
remove(name: string): void
|
|
1193
1193
|
/**
|
|
1194
1194
|
* Decrements the reference count of `self` by one, freeing the structure when
|
|
1195
1195
|
* the reference count reaches zero.
|
|
@@ -1275,12 +1275,12 @@ interface PkceCodeChallenge {
|
|
|
1275
1275
|
* Returns the Code Challenge for the Pkce verification.
|
|
1276
1276
|
* @returns the code_challenge
|
|
1277
1277
|
*/
|
|
1278
|
-
get_challenge(): string
|
|
1278
|
+
get_challenge(): string
|
|
1279
1279
|
/**
|
|
1280
1280
|
* Returns the Code Verifier for the Pkce verification.
|
|
1281
1281
|
* @returns the code_verifier
|
|
1282
1282
|
*/
|
|
1283
|
-
get_verifier(): string
|
|
1283
|
+
get_verifier(): string
|
|
1284
1284
|
}
|
|
1285
1285
|
|
|
1286
1286
|
/**
|
|
@@ -1410,27 +1410,27 @@ interface XmlNode {
|
|
|
1410
1410
|
* @param attribute name of the attribute
|
|
1411
1411
|
* @param value value to set attribute to
|
|
1412
1412
|
*/
|
|
1413
|
-
add_attr(attribute: string
|
|
1413
|
+
add_attr(attribute: string, value: string): void
|
|
1414
1414
|
/**
|
|
1415
1415
|
* Adds a new node to the given parent node; to create the top-level node,
|
|
1416
1416
|
* parent should be %NULL.
|
|
1417
1417
|
* @param tag name of the child node
|
|
1418
1418
|
* @returns the newly added #RestXmlNode; the node object is owned by, and valid for the life time of, the #RestXmlCreator.
|
|
1419
1419
|
*/
|
|
1420
|
-
add_child(tag: string
|
|
1420
|
+
add_child(tag: string): XmlNode
|
|
1421
1421
|
/**
|
|
1422
1422
|
* Searches for the first child node of `start` named `tag`.
|
|
1423
1423
|
* @param tag the name of a node
|
|
1424
1424
|
* @returns the first child node, or %NULL if it doesn't exist.
|
|
1425
1425
|
*/
|
|
1426
|
-
find(tag: string
|
|
1426
|
+
find(tag: string): XmlNode
|
|
1427
1427
|
/**
|
|
1428
1428
|
* Get the value of the attribute named `attr_name,` or %NULL if it doesn't
|
|
1429
1429
|
* exist.
|
|
1430
1430
|
* @param attr_name the name of an attribute
|
|
1431
1431
|
* @returns the attribute value. This string is owned by #RestXmlNode and should not be freed.
|
|
1432
1432
|
*/
|
|
1433
|
-
get_attr(attr_name: string
|
|
1433
|
+
get_attr(attr_name: string): string
|
|
1434
1434
|
/**
|
|
1435
1435
|
* Recursively outputs given node and it's children.
|
|
1436
1436
|
* @returns xml string representing the node.
|
|
@@ -1440,7 +1440,7 @@ interface XmlNode {
|
|
|
1440
1440
|
* Sets content for the given node.
|
|
1441
1441
|
* @param value the content
|
|
1442
1442
|
*/
|
|
1443
|
-
set_content(value: string
|
|
1443
|
+
set_content(value: string): void
|
|
1444
1444
|
}
|
|
1445
1445
|
|
|
1446
1446
|
/**
|