@archont561/qgis-sdk 0.0.0 → 0.4.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QGIS SDK contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,45 +1,55 @@
1
1
  # @archont561/qgis-sdk
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ **TypeScript client for QGIS plugin interfaces hosted in `QWebEngineView`.**
4
4
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
5
+ The companion to [`qgis-sdk`](https://pypi.org/project/qgis-sdk/): a correlated
6
+ transport client with subscriptions, the curated host namespaces, and the
7
+ contract a generated per-plugin client is built on. Every exported error begins
8
+ with `QgisSdk` and carries a stable wire `code`.
6
9
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
10
+ > Experimental. Published as `@archont561/qgis-sdk-bridge` through `0.2.0`;
11
+ > `@archont561/qgis-sdk` continues from `0.3.0`. The root exports the
12
+ > transport client, the error root and the description contract; `./host`,
13
+ > `./react` and `./testing` are opt-in entry points.
8
14
 
9
- ## Purpose
15
+ ## Installation
10
16
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@archont561/qgis-sdk`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
17
+ ```sh
18
+ bun add @archont561/qgis-sdk
19
+ npm install @archont561/qgis-sdk
20
+ ```
15
21
 
16
- ## What is OIDC Trusted Publishing?
22
+ ## Example
17
23
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
24
+ ```ts
25
+ import { BridgeClient } from "@archont561/qgis-sdk";
26
+ import { createHost } from "@archont561/qgis-sdk/host";
19
27
 
20
- ## Setup Instructions
28
+ const client = new BridgeClient({
29
+ send: (message) => channel.send(JSON.stringify(message)),
30
+ subscribe: (listener) => {
31
+ channel.onmessage = (text: string) => listener(JSON.parse(text));
32
+ return () => {
33
+ channel.onmessage = null;
34
+ };
35
+ },
36
+ });
21
37
 
22
- To properly configure OIDC trusted publishing for this package:
38
+ const host = createHost(client);
39
+ const page = await host.layers.list({ limit: 20 });
40
+ ```
23
41
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
42
+ A plugin's own operations come from the client `qgis-sdk bridge generate`
43
+ renders from its Python declarations.
28
44
 
29
- ## DO NOT USE THIS PACKAGE
45
+ ## Documentation
30
46
 
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
47
+ - [TypeScript package guide](https://github.com/Archont561/qgis-sdk/blob/main/backlog/docs/guides/doc-13%20-%20qgis-sdk-TypeScript-package-guide.md) -
48
+ exports, the transport client, host namespaces, generated clients, streams,
49
+ the React bindings and testing against a scripted host.
50
+ - [Python package guide](https://github.com/Archont561/qgis-sdk/blob/main/backlog/docs/guides/doc-12%20-%20qgis-sdk-Python-package-guide.md) -
51
+ the host half of every surface above.
36
52
 
37
- ## More Information
53
+ ## License
38
54
 
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
42
-
43
- ---
44
-
45
- **Maintained for OIDC setup purposes only**
55
+ MIT
@@ -0,0 +1,2 @@
1
+ import { StreamEventKind2, BRIDGE_PROTOCOL_VERSION2, MAX_CALL_ID_LENGTH2, BridgeFailure2, InvokeReply2, StreamTerminalKind2, BridgeStreamEvent2, BridgeStreamTerminal2, BridgeEventFrame2, BridgeTerminalFrame2, BridgeStreamFrame2, WireTransport2, BridgeClientOptions2, InvokeOptions2, QgisSdkBridgeProtocolError2, QgisSdkBridgeTimeoutError2, QgisSdkBridgeAbortedError2, QgisSdkBridgeClosedError2, QgisSdkBridgeSequenceError2, QgisSdkBridgeStreamEndedError2, QgisSdkBridgeRemoteError2, parseInvokeReply2, parseStreamFrame2, SubscriptionHandlers2, BridgeSubscription2, BridgeClient2 } from "./shared/chunk-wtv4vt4q.js";
2
+ export { BRIDGE_PROTOCOL_VERSION2 as BRIDGE_PROTOCOL_VERSION, BridgeClient2 as BridgeClient, BridgeClientOptions2 as BridgeClientOptions, BridgeEventFrame2 as BridgeEventFrame, BridgeFailure2 as BridgeFailure, BridgeStreamEvent2 as BridgeStreamEvent, BridgeStreamFrame2 as BridgeStreamFrame, BridgeStreamTerminal2 as BridgeStreamTerminal, BridgeSubscription2 as BridgeSubscription, BridgeTerminalFrame2 as BridgeTerminalFrame, InvokeOptions2 as InvokeOptions, InvokeReply2 as InvokeReply, MAX_CALL_ID_LENGTH2 as MAX_CALL_ID_LENGTH, QgisSdkBridgeAbortedError2 as QgisSdkBridgeAbortedError, QgisSdkBridgeClosedError2 as QgisSdkBridgeClosedError, QgisSdkBridgeProtocolError2 as QgisSdkBridgeProtocolError, QgisSdkBridgeRemoteError2 as QgisSdkBridgeRemoteError, QgisSdkBridgeSequenceError2 as QgisSdkBridgeSequenceError, QgisSdkBridgeStreamEndedError2 as QgisSdkBridgeStreamEndedError, QgisSdkBridgeTimeoutError2 as QgisSdkBridgeTimeoutError, StreamEventKind2 as StreamEventKind, StreamTerminalKind2 as StreamTerminalKind, SubscriptionHandlers2 as SubscriptionHandlers, WireTransport2 as WireTransport, parseInvokeReply2 as parseInvokeReply, parseStreamFrame2 as parseStreamFrame };
package/dist/bridge.js ADDED
@@ -0,0 +1,31 @@
1
+ import {
2
+ BRIDGE_PROTOCOL_VERSION2,
3
+ MAX_CALL_ID_LENGTH2,
4
+ QgisSdkBridgeProtocolError2,
5
+ QgisSdkBridgeTimeoutError2,
6
+ QgisSdkBridgeAbortedError2,
7
+ QgisSdkBridgeClosedError2,
8
+ QgisSdkBridgeSequenceError2,
9
+ QgisSdkBridgeStreamEndedError2,
10
+ QgisSdkBridgeRemoteError2,
11
+ parseInvokeReply2,
12
+ parseStreamFrame2,
13
+ BridgeClient2
14
+ } from "./shared/chunk-8gawbn19.js";
15
+ export {
16
+ BRIDGE_PROTOCOL_VERSION2 as BRIDGE_PROTOCOL_VERSION,
17
+ BridgeClient2 as BridgeClient,
18
+ MAX_CALL_ID_LENGTH2 as MAX_CALL_ID_LENGTH,
19
+ QgisSdkBridgeAbortedError2 as QgisSdkBridgeAbortedError,
20
+ QgisSdkBridgeClosedError2 as QgisSdkBridgeClosedError,
21
+ QgisSdkBridgeProtocolError2 as QgisSdkBridgeProtocolError,
22
+ QgisSdkBridgeRemoteError2 as QgisSdkBridgeRemoteError,
23
+ QgisSdkBridgeSequenceError2 as QgisSdkBridgeSequenceError,
24
+ QgisSdkBridgeStreamEndedError2 as QgisSdkBridgeStreamEndedError,
25
+ QgisSdkBridgeTimeoutError2 as QgisSdkBridgeTimeoutError,
26
+ parseInvokeReply2 as parseInvokeReply,
27
+ parseStreamFrame2 as parseStreamFrame
28
+ };
29
+
30
+ //# debugId=40AA08F7CCD69E0B64756E2164756E21
31
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFsKICBdLAogICJtYXBwaW5ncyI6ICIiLAogICJkZWJ1Z0lkIjogIjQwQUEwOEY3Q0NENjlFMEI2NDc1NkUyMTY0NzU2RTIxIiwKICAibmFtZXMiOiBbXQp9
package/dist/host.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { HOST_ID2, HOST_FINGERPRINT2, HOST_SCHEMA_VERSION2, HOST_OPERATIONS2, HostOperationId2, HostInvokeOptions2, HostClientLike2, HostStreamTerminal2, HostStreamHandlers2, HostStreamHandle2, QgisSdkHostContractError2, ExportRequest2, ExportResult2, FetchRequest2, FileRef2, HttpHeader2, IdPage2, LayerPage2, LayerRequest2, NetworkFetchData2, NotificationsInfoRequest2, OpenVectorRequest2, PageRequest2, SettingsGetRequest2, StylesApplyRequest2, VectorLayerInfo2, NetworkFetchEvent2, HostOperations2, createHost2 } from "./shared/chunk-khemhx86.js";
2
+ export { ExportRequest2 as ExportRequest, ExportResult2 as ExportResult, FetchRequest2 as FetchRequest, FileRef2 as FileRef, HOST_FINGERPRINT2 as HOST_FINGERPRINT, HOST_ID2 as HOST_ID, HOST_OPERATIONS2 as HOST_OPERATIONS, HOST_SCHEMA_VERSION2 as HOST_SCHEMA_VERSION, HostClientLike2 as HostClientLike, HostInvokeOptions2 as HostInvokeOptions, HostOperationId2 as HostOperationId, HostOperations2 as HostOperations, HostStreamHandle2 as HostStreamHandle, HostStreamHandlers2 as HostStreamHandlers, HostStreamTerminal2 as HostStreamTerminal, HttpHeader2 as HttpHeader, IdPage2 as IdPage, LayerPage2 as LayerPage, LayerRequest2 as LayerRequest, NetworkFetchData2 as NetworkFetchData, NetworkFetchEvent2 as NetworkFetchEvent, NotificationsInfoRequest2 as NotificationsInfoRequest, OpenVectorRequest2 as OpenVectorRequest, PageRequest2 as PageRequest, QgisSdkHostContractError2 as QgisSdkHostContractError, SettingsGetRequest2 as SettingsGetRequest, StylesApplyRequest2 as StylesApplyRequest, VectorLayerInfo2 as VectorLayerInfo, createHost2 as createHost };
package/dist/host.js ADDED
@@ -0,0 +1,51 @@
1
+ import {
2
+ HOST_ID2,
3
+ HOST_FINGERPRINT2,
4
+ HOST_SCHEMA_VERSION2,
5
+ HOST_OPERATIONS2,
6
+ QgisSdkHostContractError2,
7
+ ExportRequest2,
8
+ ExportResult2,
9
+ FetchRequest2,
10
+ FileRef2,
11
+ HttpHeader2,
12
+ IdPage2,
13
+ LayerPage2,
14
+ LayerRequest2,
15
+ NetworkFetchData2,
16
+ NotificationsInfoRequest2,
17
+ OpenVectorRequest2,
18
+ PageRequest2,
19
+ SettingsGetRequest2,
20
+ StylesApplyRequest2,
21
+ VectorLayerInfo2,
22
+ NetworkFetchEvent2,
23
+ createHost2
24
+ } from "./shared/chunk-vqyymknv.js";
25
+ export {
26
+ ExportRequest2 as ExportRequest,
27
+ ExportResult2 as ExportResult,
28
+ FetchRequest2 as FetchRequest,
29
+ FileRef2 as FileRef,
30
+ HOST_FINGERPRINT2 as HOST_FINGERPRINT,
31
+ HOST_ID2 as HOST_ID,
32
+ HOST_OPERATIONS2 as HOST_OPERATIONS,
33
+ HOST_SCHEMA_VERSION2 as HOST_SCHEMA_VERSION,
34
+ HttpHeader2 as HttpHeader,
35
+ IdPage2 as IdPage,
36
+ LayerPage2 as LayerPage,
37
+ LayerRequest2 as LayerRequest,
38
+ NetworkFetchData2 as NetworkFetchData,
39
+ NetworkFetchEvent2 as NetworkFetchEvent,
40
+ NotificationsInfoRequest2 as NotificationsInfoRequest,
41
+ OpenVectorRequest2 as OpenVectorRequest,
42
+ PageRequest2 as PageRequest,
43
+ QgisSdkHostContractError2 as QgisSdkHostContractError,
44
+ SettingsGetRequest2 as SettingsGetRequest,
45
+ StylesApplyRequest2 as StylesApplyRequest,
46
+ VectorLayerInfo2 as VectorLayerInfo,
47
+ createHost2 as createHost
48
+ };
49
+
50
+ //# debugId=5475A84EF80D664964756E2164756E21
51
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFsKICBdLAogICJtYXBwaW5ncyI6ICIiLAogICJkZWJ1Z0lkIjogIjU0NzVBODRFRjgwRDY2NDk2NDc1NkUyMTY0NzU2RTIxIiwKICAibmFtZXMiOiBbXQp9
@@ -0,0 +1,67 @@
1
+ import { MAX_SAFE_INTEGER2, MIN_SAFE_INTEGER2, PLUGIN_DESCRIPTION_SCHEMA_VERSION2, ValidationDirection2, SerializedValidationIssue2, SerializedContractValidationError2, ActionDescription2, StreamEventKind2, StreamDescription2, PluginDescription2, isSafeJsonInteger2, QgisSdkDeclarationError2, QgisSdkValidationIssue2, QgisSdkContractValidationError2, parsePluginDescription2, BRIDGE_PROTOCOL_VERSION2, MAX_CALL_ID_LENGTH2, BridgeFailure2, InvokeReply2, StreamTerminalKind2, BridgeStreamEvent2, BridgeStreamTerminal2, BridgeEventFrame2, BridgeTerminalFrame2, BridgeStreamFrame2, WireTransport2, BridgeClientOptions2, InvokeOptions2, QgisSdkBridgeProtocolError2, QgisSdkBridgeTimeoutError2, QgisSdkBridgeAbortedError2, QgisSdkBridgeClosedError2, QgisSdkBridgeSequenceError2, QgisSdkBridgeStreamEndedError2, QgisSdkBridgeRemoteError2, parseInvokeReply2, parseStreamFrame2, SubscriptionHandlers2, BridgeSubscription2, BridgeClient2 } from "./shared/chunk-wtv4vt4q.js";
2
+ import "./shared/chunk-khemhx86.js";
3
+ import { OperationShape2, StreamShape2, OperationMap2, StreamMap2, BridgeSchema2, OperationsOf2, StreamsOf2, defineBridgeSchema2 } from "./shared/chunk-jjx14tgd.js";
4
+ import { QgisSdkOptions2, StreamHandlers2, StreamHandle2, OperationMethod2, StreamMethod2, QgisSdkHost2, QgisSdkCore2, OperationTree2, StreamTree2, QGIS_SDK_MEMBERS2, QgisSdk2 } from "./shared/chunk-tmca1ynt.js";
5
+ import { QgisSdkError2 } from "./shared/chunk-pdj2fxjb.js";
6
+ /** One schema of the declared dialect, as the description carries it. */
7
+ type DeclaredSchema = Readonly<Record<string, unknown>>;
8
+ /** Options for {@link validateAgainstSchema}. */
9
+ interface ValidateOptions {
10
+ /** Ignore properties the schema does not name (results and events). */
11
+ readonly allowUnknown?: boolean;
12
+ /** Where the value sits, prefixed to every issue's path. */
13
+ readonly path?: readonly (string | number)[];
14
+ }
15
+ /** Which side of a call a contract issue belongs to. */
16
+ type ContractDirection = "request" | "result" | "event";
17
+ /** The JSON form of {@link QgisSdkContractError}. */
18
+ interface SerializedContractError {
19
+ readonly code: string;
20
+ readonly operation: string;
21
+ readonly direction: ContractDirection;
22
+ readonly issues: SerializedValidationIssue2[];
23
+ }
24
+ /**
25
+ * An argument, a reply or an event does not match the declared contract.
26
+ *
27
+ * The code is the one both languages use for this category, so a page that
28
+ * already matches `contract_validation_failed` needs no second branch.
29
+ */
30
+ declare class QgisSdkContractError extends QgisSdkError2 {
31
+ readonly operation: string;
32
+ readonly direction: ContractDirection;
33
+ readonly issues: readonly QgisSdkValidationIssue2[];
34
+ constructor(operation: string, direction: ContractDirection, issues: readonly QgisSdkValidationIssue2[]);
35
+ toJSON(): SerializedContractError;
36
+ }
37
+ /**
38
+ * Return every issue `value` has against `schema`; an empty array is a match.
39
+ *
40
+ * Throws {@link QgisSdkDeclarationError} when `schema` leaves the declared
41
+ * dialect, because that is a fault in the declaration, never in the value.
42
+ */
43
+ declare function validateAgainstSchema(value: unknown, schema: DeclaredSchema, options?: ValidateOptions): QgisSdkValidationIssue2[];
44
+ /** The web view did not provide a usable channel. */
45
+ declare class QgisSdkWebChannelError extends QgisSdkError2 {
46
+ constructor(message: string);
47
+ }
48
+ /** The transport {@link createWebChannelTransport} returns. */
49
+ interface WebChannelTransport extends WireTransport2 {
50
+ /** Resolves once the channel object answered; rejects when it never will. */
51
+ readonly ready: Promise<void>;
52
+ /** Stop forwarding messages; sends after this throw. */
53
+ close(): void;
54
+ }
55
+ /** True inside a QGIS web view, where Qt injected its transport and script. */
56
+ declare function insideQgis(): boolean;
57
+ /**
58
+ * Connect to the channel object `objectName` and return a transport on it.
59
+ *
60
+ * Throws {@link QgisSdkWebChannelError} synchronously outside a QGIS web view,
61
+ * so a page learns in its first statement that it has no host to talk to.
62
+ * Inside one, messages sent before the channel is ready are queued and
63
+ * delivered in order once it is; `ready` rejects (and queued sends are
64
+ * dropped) when the host registered no object under that name.
65
+ */
66
+ declare function createWebChannelTransport(objectName?: string): WebChannelTransport;
67
+ export { ActionDescription2 as ActionDescription, BRIDGE_PROTOCOL_VERSION2 as BRIDGE_PROTOCOL_VERSION, BridgeClient2 as BridgeClient, BridgeClientOptions2 as BridgeClientOptions, BridgeEventFrame2 as BridgeEventFrame, BridgeFailure2 as BridgeFailure, BridgeSchema2 as BridgeSchema, BridgeStreamEvent2 as BridgeStreamEvent, BridgeStreamFrame2 as BridgeStreamFrame, BridgeStreamTerminal2 as BridgeStreamTerminal, BridgeSubscription2 as BridgeSubscription, BridgeTerminalFrame2 as BridgeTerminalFrame, ContractDirection, DeclaredSchema, InvokeOptions2 as InvokeOptions, InvokeReply2 as InvokeReply, MAX_CALL_ID_LENGTH2 as MAX_CALL_ID_LENGTH, MAX_SAFE_INTEGER2 as MAX_SAFE_INTEGER, MIN_SAFE_INTEGER2 as MIN_SAFE_INTEGER, OperationMap2 as OperationMap, OperationMethod2 as OperationMethod, OperationShape2 as OperationShape, OperationTree2 as OperationTree, OperationsOf2 as OperationsOf, PLUGIN_DESCRIPTION_SCHEMA_VERSION2 as PLUGIN_DESCRIPTION_SCHEMA_VERSION, PluginDescription2 as PluginDescription, QGIS_SDK_MEMBERS2 as QGIS_SDK_MEMBERS, QgisSdk2 as QgisSdk, QgisSdkBridgeAbortedError2 as QgisSdkBridgeAbortedError, QgisSdkBridgeClosedError2 as QgisSdkBridgeClosedError, QgisSdkBridgeProtocolError2 as QgisSdkBridgeProtocolError, QgisSdkBridgeRemoteError2 as QgisSdkBridgeRemoteError, QgisSdkBridgeSequenceError2 as QgisSdkBridgeSequenceError, QgisSdkBridgeStreamEndedError2 as QgisSdkBridgeStreamEndedError, QgisSdkBridgeTimeoutError2 as QgisSdkBridgeTimeoutError, QgisSdkContractError, QgisSdkContractValidationError2 as QgisSdkContractValidationError, QgisSdkCore2 as QgisSdkCore, QgisSdkDeclarationError2 as QgisSdkDeclarationError, QgisSdkError2 as QgisSdkError, QgisSdkHost2 as QgisSdkHost, QgisSdkOptions2 as QgisSdkOptions, QgisSdkValidationIssue2 as QgisSdkValidationIssue, QgisSdkWebChannelError, SerializedContractError, SerializedContractValidationError2 as SerializedContractValidationError, SerializedValidationIssue2 as SerializedValidationIssue, StreamDescription2 as StreamDescription, StreamEventKind2 as StreamEventKind, StreamHandle2 as StreamHandle, StreamHandlers2 as StreamHandlers, StreamMap2 as StreamMap, StreamMethod2 as StreamMethod, StreamShape2 as StreamShape, StreamTerminalKind2 as StreamTerminalKind, StreamTree2 as StreamTree, StreamsOf2 as StreamsOf, SubscriptionHandlers2 as SubscriptionHandlers, ValidateOptions, ValidationDirection2 as ValidationDirection, WebChannelTransport, WireTransport2 as WireTransport, createWebChannelTransport, defineBridgeSchema2 as defineBridgeSchema, insideQgis, isSafeJsonInteger2 as isSafeJsonInteger, parseInvokeReply2 as parseInvokeReply, parsePluginDescription2 as parsePluginDescription, parseStreamFrame2 as parseStreamFrame, validateAgainstSchema };