@girs/tracker-3.0 3.6.0-4.0.0-beta.3 → 3.7.2-4.0.0-beta.4

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 CHANGED
@@ -5,7 +5,7 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/tracker-3.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for Tracker-3.0, generated from library version 3.6.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
8
+ GJS TypeScript type definitions for Tracker-3.0, generated from library version 3.7.2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
9
9
 
10
10
 
11
11
  ## Install
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@girs/tracker-3.0",
3
- "version": "3.6.0-4.0.0-beta.3",
4
- "description": "GJS TypeScript type definitions for Tracker-3.0, generated from library version 3.6.0",
3
+ "version": "3.7.2-4.0.0-beta.4",
4
+ "description": "GJS TypeScript type definitions for Tracker-3.0, generated from library version 3.7.2",
5
5
  "type": "module",
6
6
  "module": "tracker-3.0.js",
7
7
  "main": "tracker-3.0.js",
@@ -26,10 +26,10 @@
26
26
  "test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit tracker-3.0.d.ts"
27
27
  },
28
28
  "dependencies": {
29
- "@girs/gio-2.0": "^2.80.0-4.0.0-beta.3",
30
- "@girs/gjs": "^4.0.0-beta.3",
31
- "@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
32
- "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3"
29
+ "@girs/gio-2.0": "^2.80.0-4.0.0-beta.4",
30
+ "@girs/gjs": "^4.0.0-beta.4",
31
+ "@girs/glib-2.0": "^2.80.0-4.0.0-beta.4",
32
+ "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "typescript": "*"
package/tracker-3.0.d.ts CHANGED
@@ -146,6 +146,14 @@ export namespace Tracker {
146
146
  static INCOMPLETE_PROPERTY_DEFINITION: number;
147
147
  /**
148
148
  * A soft/hard corruption was found in the database during operation.
149
+ * If this error is obtained during regular operations with an existing [class`Tracker`.SparqlConnection],
150
+ * the corruption was newly found. This event will be persistently recorded so that the
151
+ * [func`Tracker`.SparqlConnection.new_async] constructor (or its synchronous variant) will
152
+ * perform database repair attempts. If this error is obtained during one of those constructors, the
153
+ * database could not be repaired automatically and data loss is unavoidable. It is left to the discretion
154
+ * of the API user to set up the appropriate fallbacks in this situation, to replace the
155
+ * database and recover from the error. See [ctor`Tracker`.SparqlConnection.new] documentation
156
+ * for more information on corruption handling.
149
157
  */
150
158
  static CORRUPT: number;
151
159
  /**
@@ -176,7 +184,7 @@ export namespace Tracker {
176
184
  */
177
185
  URI,
178
186
  /**
179
- * String value type, xsd:string
187
+ * String value type, xsd:string or rdf:langString
180
188
  */
181
189
  STRING,
182
190
  /**
@@ -498,6 +506,11 @@ export namespace Tracker {
498
506
  // Constructor properties interface
499
507
 
500
508
  interface ConstructorProps extends GObject.Object.ConstructorProps {
509
+ allowed_graphs: string[];
510
+ allowedGraphs: string[];
511
+ allowed_services: string[];
512
+ allowedServices: string[];
513
+ readonly: boolean;
501
514
  sparql_connection: SparqlConnection;
502
515
  sparqlConnection: SparqlConnection;
503
516
  }
@@ -517,12 +530,60 @@ export namespace Tracker {
517
530
  * [ctor`Tracker`.SparqlConnection.bus_new] or [ctor`Tracker`.SparqlConnection.remote_new]
518
531
  * to access this endpoint exclusively, or they may use the `SERVICE <uri> { ... }` SPARQL
519
532
  * syntax from their own [class`Tracker`.SparqlConnection]s to expand their data set.
533
+ *
534
+ * By default, and as long as the underlying [class`Tracker`.SparqlConnection]
535
+ * allows SPARQL updates and RDF graph changes, endpoints will allow updates
536
+ * and modifications to happen through them. Use [method`Tracker`.Endpoint.set_readonly]
537
+ * to change this behavior.
538
+ *
539
+ * By default, endpoints allow access to every RDF graph in the triple store
540
+ * and further external SPARQL endpoints to the queries performed on it. Use
541
+ * [method`Tracker`.Endpoint.set_allowed_graphs] and
542
+ * [method`Tracker`.Endpoint.set_allowed_services] to change this behavior. Users do
543
+ * not typically need to do this for D-Bus endpoints, as these do already have a layer
544
+ * of protection with the Tracker portal. This is the mechanism used by the portal
545
+ * itself. This access control API may not interoperate with other SPARQL endpoint
546
+ * implementations than Tracker.
520
547
  */
521
548
  abstract class Endpoint extends GObject.Object {
522
549
  static $gtype: GObject.GType<Endpoint>;
523
550
 
524
551
  // Own properties of Tracker.Endpoint
525
552
 
553
+ /**
554
+ * RDF graphs that are allowed to be accessed
555
+ * through queries to this endpoint. See
556
+ * tracker_endpoint_set_allowed_graphs().
557
+ */
558
+ get allowed_graphs(): string[];
559
+ set allowed_graphs(val: string[]);
560
+ /**
561
+ * RDF graphs that are allowed to be accessed
562
+ * through queries to this endpoint. See
563
+ * tracker_endpoint_set_allowed_graphs().
564
+ */
565
+ get allowedGraphs(): string[];
566
+ set allowedGraphs(val: string[]);
567
+ /**
568
+ * External SPARQL endpoints that are allowed to be
569
+ * accessed through queries to this endpint. See
570
+ * tracker_endpoint_set_allowed_services().
571
+ */
572
+ get allowed_services(): string[];
573
+ set allowed_services(val: string[]);
574
+ /**
575
+ * External SPARQL endpoints that are allowed to be
576
+ * accessed through queries to this endpint. See
577
+ * tracker_endpoint_set_allowed_services().
578
+ */
579
+ get allowedServices(): string[];
580
+ set allowedServices(val: string[]);
581
+ /**
582
+ * Whether the endpoint allows SPARQL updates or not. See
583
+ * tracker_endpoint_set_readonly().
584
+ */
585
+ get readonly(): boolean;
586
+ set readonly(val: boolean);
526
587
  /**
527
588
  * The [class`Tracker`.SparqlConnection] being proxied by this endpoint.
528
589
  */
@@ -540,15 +601,86 @@ export namespace Tracker {
540
601
 
541
602
  // Own methods of Tracker.Endpoint
542
603
 
604
+ /**
605
+ * Returns the list of RDF graphs that the endpoint allows
606
+ * access for.
607
+ * @returns The list of allowed RDF graphs
608
+ */
609
+ get_allowed_graphs(): string[];
610
+ /**
611
+ * Returns the list of external SPARQL endpoints that are
612
+ * allowed to be accessed through this endpoint.
613
+ * @returns The list of allowed services
614
+ */
615
+ get_allowed_services(): string[];
616
+ /**
617
+ * Returns whether the endpoint is readonly, thus SPARQL update
618
+ * queries are disallowed.
619
+ * @returns %TRUE if the endpoint is readonly
620
+ */
621
+ get_readonly(): boolean;
543
622
  /**
544
623
  * Returns the [class`Tracker`.SparqlConnection] that this endpoint proxies
545
624
  * to a wider audience.
546
625
  * @returns The proxied SPARQL connection
547
626
  */
548
627
  get_sparql_connection(): SparqlConnection;
628
+ /**
629
+ * Sets the list of RDF graphs that this endpoint will allow access
630
+ * for. Any explicit (e.g. `GRAPH` keyword) or implicit (e.g. through the
631
+ * default anonymous graph) access to RDF graphs unespecified in this
632
+ * list in SPARQL queries will be seen as if those graphs did not exist, or
633
+ * (equivalently) had an empty set. Changes to these graphs through SPARQL
634
+ * updates will also be disallowed.
635
+ *
636
+ * If `graphs` is %NULL, access will be allowed to every RDF graph stored
637
+ * in the endpoint, this is the default behavior. If you want to forbid access
638
+ * to all RDF graphs, use an empty list.
639
+ *
640
+ * The empty string (`""`) is allowed as a special value, to allow access
641
+ * to the stock anonymous graph. All graph names are otherwise dependent
642
+ * on the endpoint and its contained data.
643
+ * @param graphs List of allowed graphs, or %NULL to allow all graphs
644
+ */
645
+ set_allowed_graphs(graphs: string): void;
646
+ /**
647
+ * Sets the list of external SPARQL endpoints that this endpoint
648
+ * will allow access for. Access through the `SERVICE` SPARQL syntax
649
+ * will fail for services not specified in this list.
650
+ *
651
+ * If `services` is %NULL, access will be allowed to every external endpoint,
652
+ * this is the default behavior. If you want to forbid access to all
653
+ * external SPARQL endpoints, use an empty list.
654
+ *
655
+ * This affects both remote SPARQL endpoints accessed through HTTP,
656
+ * and external SPARQL endpoints offered through D-Bus. For the latter,
657
+ * the following syntax is allowed to describe them as an URI:
658
+ *
659
+ * `DBUS_URI = 'dbus:' [ ('system' | 'session') ':' ]? dbus-name [ ':' object-path ]?`
660
+ *
661
+ * If the system/session part is omitted, it will default to the session
662
+ * bus. If the object path is omitted, the `/org/freedesktop/Tracker3/Endpoint`
663
+ * [class`Tracker`.EndpointDBus] default will be assumed.
664
+ * @param services List of allowed services, or %NULL to allow all services
665
+ */
666
+ set_allowed_services(services: string): void;
667
+ /**
668
+ * Sets whether the endpoint will be readonly. Readonly endpoints
669
+ * will not allow SPARQL update queries. The underlying
670
+ * [class`Tracker`.SparqlConnection] may be readonly of its own, this
671
+ * method does not change its behavior in any way.
672
+ * @param readonly Whether the endpoint will be readonly
673
+ */
674
+ set_readonly(readonly: boolean): void;
549
675
  }
550
676
 
551
677
  module EndpointDBus {
678
+ // Signal callback interfaces
679
+
680
+ interface BlockCall {
681
+ (object: string): boolean;
682
+ }
683
+
552
684
  // Constructor properties interface
553
685
 
554
686
  interface ConstructorProps extends Endpoint.ConstructorProps, Gio.Initable.ConstructorProps {
@@ -587,10 +719,17 @@ export namespace Tracker {
587
719
  * given the object will be at the default `/org/freedesktop/Tracker3/Endpoint`
588
720
  * location.
589
721
  *
590
- * Access to these endpoints may be transparently managed through
591
- * the Tracker portal service for applications sandboxed via Flatpak, and
592
- * access to data constrained to the graphs defined in the applications
593
- * manifest.
722
+ * Access to D-Bus endpoints may be managed via the
723
+ * [signal`Tracker`.EndpointDBus::block-call] signal, the boolean
724
+ * return value expressing whether the request is blocked or not.
725
+ * Inspection of the requester address is left up to the user. The
726
+ * default value allows all requests independently of their provenance.
727
+ *
728
+ * However, moderating access to D-Bus interfaces is typically not necessary
729
+ * in user code, as access to public D-Bus endpoints will be transparently
730
+ * managed through the Tracker portal service for applications sandboxed
731
+ * via XDG portals. These already have access to D-Bus SPARQL endpoints and
732
+ * their data naturally filtered as defined in the application manifest.
594
733
  *
595
734
  * A `TrackerEndpointDBus` may be created on a different thread/main
596
735
  * context from the one that created [class`Tracker`.SparqlConnection].
@@ -630,6 +769,15 @@ export namespace Tracker {
630
769
  cancellable?: Gio.Cancellable | null,
631
770
  ): EndpointDBus;
632
771
 
772
+ // Own signals of Tracker.EndpointDBus
773
+
774
+ connect(id: string, callback: (...args: any[]) => any): number;
775
+ connect_after(id: string, callback: (...args: any[]) => any): number;
776
+ emit(id: string, ...args: any[]): void;
777
+ connect(signal: 'block-call', callback: (_source: this, object: string) => boolean): number;
778
+ connect_after(signal: 'block-call', callback: (_source: this, object: string) => boolean): number;
779
+ emit(signal: 'block-call', object: string): void;
780
+
633
781
  // Inherited methods
634
782
  /**
635
783
  * Initializes the object implementing the interface.
@@ -893,7 +1041,7 @@ export namespace Tracker {
893
1041
  * static void
894
1042
  * my_object_class_init (MyObjectClass *klass)
895
1043
  * {
896
- * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
1044
+ * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
897
1045
  * 0, 100,
898
1046
  * 50,
899
1047
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -1444,7 +1592,7 @@ export namespace Tracker {
1444
1592
  * static void
1445
1593
  * my_object_class_init (MyObjectClass *klass)
1446
1594
  * {
1447
- * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
1595
+ * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
1448
1596
  * 0, 100,
1449
1597
  * 50,
1450
1598
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -1806,6 +1954,10 @@ export namespace Tracker {
1806
1954
  /**
1807
1955
  * Listens to notification events from a remote DBus SPARQL endpoint.
1808
1956
  *
1957
+ * If `connection` refers to a message bus (system/session), `service` must refer
1958
+ * to a D-Bus name (either unique or well-known). If `connection` is a non-message
1959
+ * bus (e.g. a peer-to-peer D-Bus connection) the `service` argument may be %NULL.
1960
+ *
1809
1961
  * If the `object_path` argument is %NULL, the default
1810
1962
  * `/org/freedesktop/Tracker3/Endpoint` path will be
1811
1963
  * used. If `graph` is %NULL, all graphs will be listened for.
@@ -1817,14 +1969,14 @@ export namespace Tracker {
1817
1969
  * a connection obtained through [ctor`Tracker`.SparqlConnection.bus_new],
1818
1970
  * only to listen to update notifications from additional DBus endpoints.
1819
1971
  * @param connection A [class@Gio.DBusConnection]
1820
- * @param service DBus service name to subscribe to events for
1972
+ * @param service DBus service name to subscribe to events for, or %NULL
1821
1973
  * @param object_path DBus object path to subscribe to events for, or %NULL
1822
1974
  * @param graph Graph to listen events for, or %NULL
1823
1975
  * @returns An ID for this subscription
1824
1976
  */
1825
1977
  signal_subscribe(
1826
1978
  connection: Gio.DBusConnection,
1827
- service: string,
1979
+ service?: string | null,
1828
1980
  object_path?: string | null,
1829
1981
  graph?: string | null,
1830
1982
  ): number;
@@ -2916,6 +3068,17 @@ export namespace Tracker {
2916
3068
  * @returns a 64-bit integer value.
2917
3069
  */
2918
3070
  get_integer(column: number): number;
3071
+ /**
3072
+ * Retrieves a string representation of the data in the current
3073
+ * row in `column`. If the string has language information (i.e. it is
3074
+ * a `rdf:langString`](rdf-ontology.html#rdf:langString)), the language
3075
+ * tag will be returned in the location provided through `langtag`. This
3076
+ * language tag will typically be in a format conforming
3077
+ * [RFC 5646](https://www.rfc-editor.org/rfc/rfc5646.html).
3078
+ * @param column column number to retrieve
3079
+ * @returns a string which must not be freed. %NULL is returned if the column is not in the `[0, n_columns]` range, or if the row/column refer to a nullable optional value in the result set.
3080
+ */
3081
+ get_langstring(column: number): [string | null, string, number];
2919
3082
  /**
2920
3083
  * Retrieves the number of columns available in the result set.
2921
3084
  *
@@ -3094,6 +3257,16 @@ export namespace Tracker {
3094
3257
  * @param value value
3095
3258
  */
3096
3259
  bind_int(name: string, value: number): void;
3260
+ /**
3261
+ * Binds the `value` to the parameterized variable given by `name,` tagged
3262
+ * with the language defined by `langtag`. The language tag should follow
3263
+ * [RFC 5646](https://www.rfc-editor.org/rfc/rfc5646.html). The parameter
3264
+ * will be represented as a [`rdf:langString`](rdf-ontology.html#rdf:langString).
3265
+ * @param name variable name
3266
+ * @param value value
3267
+ * @param langtag language tag
3268
+ */
3269
+ bind_langstring(name: string, value: string, langtag: string): void;
3097
3270
  /**
3098
3271
  * Binds the string `value` to the parameterized variable given by `name`.
3099
3272
  * @param name variable name