space-data-module-sdk 0.2.6 → 0.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.
@@ -0,0 +1,224 @@
1
+ import type {
2
+ PluginManifest,
3
+ ProtocolRoleName,
4
+ ProtocolSpec,
5
+ ProtocolTransportKindName,
6
+ } from "../index.js";
7
+
8
+ export type InputBindingSourceKindName =
9
+ | "pubsub"
10
+ | "protocol-stream"
11
+ | "catalog-sync";
12
+ export type DeploymentBindingModeName = "local" | "delegated";
13
+ export type ScheduleBindingKindName = "interval" | "cron" | "once";
14
+
15
+ export interface ResolvedProtocolInstallation {
16
+ protocolId: string;
17
+ wireId: string;
18
+ transportKind: ProtocolTransportKindName | string;
19
+ role: ProtocolRoleName | string;
20
+ peerId?: string | null;
21
+ listenMultiaddrs?: string[];
22
+ advertisedMultiaddrs?: string[];
23
+ nodeInfoUrl?: string | null;
24
+ serviceName?: string | null;
25
+ resolvedPort?: number;
26
+ artifactCid?: string | null;
27
+ description?: string | null;
28
+ }
29
+
30
+ export interface InputBinding {
31
+ bindingId: string;
32
+ targetPluginId?: string | null;
33
+ targetMethodId: string;
34
+ targetInputPortId: string;
35
+ sourceKind: InputBindingSourceKindName | string;
36
+ topic?: string | null;
37
+ wireId?: string | null;
38
+ nodeInfoUrl?: string | null;
39
+ multiaddrs?: string[];
40
+ allowPeerIds?: string[];
41
+ allowServerKeys?: string[];
42
+ deliveryMode?: string | null;
43
+ description?: string | null;
44
+ }
45
+
46
+ export interface ScheduleBinding {
47
+ scheduleId: string;
48
+ bindingMode: DeploymentBindingModeName | string;
49
+ triggerId?: string | null;
50
+ targetMethodId?: string | null;
51
+ targetInputPortId?: string | null;
52
+ scheduleKind: ScheduleBindingKindName | string;
53
+ cron?: string | null;
54
+ intervalMs?: number;
55
+ runAtStartup?: boolean;
56
+ startupDelayMs?: number;
57
+ timezone?: string | null;
58
+ description?: string | null;
59
+ }
60
+
61
+ export interface ServiceBinding {
62
+ serviceId: string;
63
+ bindingMode: DeploymentBindingModeName | string;
64
+ serviceKind: string;
65
+ triggerId?: string | null;
66
+ protocolId?: string | null;
67
+ routePath?: string | null;
68
+ method?: string | null;
69
+ transportKind?: ProtocolTransportKindName | string | null;
70
+ adapter?: string | null;
71
+ listenHost?: string | null;
72
+ listenPort?: number;
73
+ remoteUrl?: string | null;
74
+ allowTransports?: string[];
75
+ authPolicyId?: string | null;
76
+ description?: string | null;
77
+ properties?: Record<string, unknown>;
78
+ }
79
+
80
+ export interface AuthPolicy {
81
+ policyId: string;
82
+ bindingMode: DeploymentBindingModeName | string;
83
+ targetKind: string;
84
+ targetId?: string | null;
85
+ adapter?: string | null;
86
+ walletProfileId?: string | null;
87
+ trustMapId?: string | null;
88
+ allowPeerIds?: string[];
89
+ allowServerKeys?: string[];
90
+ allowEntityIds?: string[];
91
+ requireSignedRequests?: boolean;
92
+ requireEncryptedTransport?: boolean;
93
+ description?: string | null;
94
+ properties?: Record<string, unknown>;
95
+ }
96
+
97
+ export interface PublicationBinding {
98
+ publicationId: string;
99
+ bindingMode: DeploymentBindingModeName | string;
100
+ sourceKind: string;
101
+ sourceMethodId?: string | null;
102
+ sourceOutputPortId?: string | null;
103
+ sourceNodeId?: string | null;
104
+ sourceTriggerId?: string | null;
105
+ topic?: string | null;
106
+ wireId?: string | null;
107
+ schemaName?: string | null;
108
+ mediaType?: string | null;
109
+ archivePath?: string | null;
110
+ queryServiceId?: string | null;
111
+ emitPnm?: boolean;
112
+ emitFlatbufferArchive?: boolean;
113
+ pinPolicy?: string | null;
114
+ maxRecords?: number;
115
+ maxBytes?: number;
116
+ minLivelinessSeconds?: number;
117
+ recordRangeStartField?: string | null;
118
+ recordRangeStopField?: string | null;
119
+ description?: string | null;
120
+ properties?: Record<string, unknown>;
121
+ }
122
+
123
+ export interface ModuleDeploymentPlan {
124
+ formatVersion?: number;
125
+ pluginId?: string | null;
126
+ version?: string | null;
127
+ artifactCid?: string | null;
128
+ bundleCid?: string | null;
129
+ environmentId?: string | null;
130
+ protocolInstallations?: ResolvedProtocolInstallation[];
131
+ inputBindings?: InputBinding[];
132
+ scheduleBindings?: ScheduleBinding[];
133
+ serviceBindings?: ServiceBinding[];
134
+ authPolicies?: AuthPolicy[];
135
+ publicationBindings?: PublicationBinding[];
136
+ }
137
+
138
+ export interface DeploymentPlanIssue {
139
+ severity: "error" | "warning";
140
+ code: string;
141
+ message: string;
142
+ location?: string;
143
+ }
144
+
145
+ export interface DeploymentPlanValidationReport {
146
+ ok: boolean;
147
+ plan: ModuleDeploymentPlan;
148
+ issues: DeploymentPlanIssue[];
149
+ errors: DeploymentPlanIssue[];
150
+ warnings: DeploymentPlanIssue[];
151
+ }
152
+
153
+ export const DEPLOYMENT_PLAN_FORMAT_VERSION: number;
154
+
155
+ export const InputBindingSourceKind: {
156
+ PUBSUB: InputBindingSourceKindName;
157
+ PROTOCOL_STREAM: InputBindingSourceKindName;
158
+ CATALOG_SYNC: InputBindingSourceKindName;
159
+ };
160
+
161
+ export const DeploymentBindingMode: {
162
+ LOCAL: DeploymentBindingModeName;
163
+ DELEGATED: DeploymentBindingModeName;
164
+ };
165
+
166
+ export const ScheduleBindingKind: {
167
+ INTERVAL: ScheduleBindingKindName;
168
+ CRON: ScheduleBindingKindName;
169
+ ONCE: ScheduleBindingKindName;
170
+ };
171
+
172
+ export function normalizeProtocolTransportKindName(
173
+ value: ProtocolTransportKindName | string | null | undefined,
174
+ ): ProtocolTransportKindName | string | null;
175
+
176
+ export function normalizeProtocolRoleName(
177
+ value: ProtocolRoleName | string | null | undefined,
178
+ ): ProtocolRoleName | string | null;
179
+
180
+ export function normalizeInputBindingSourceKindName(
181
+ value: InputBindingSourceKindName | string | null | undefined,
182
+ ): InputBindingSourceKindName | string | null;
183
+
184
+ export function normalizeDeploymentBindingModeName(
185
+ value: DeploymentBindingModeName | string | null | undefined,
186
+ ): DeploymentBindingModeName | string | null;
187
+
188
+ export function normalizeScheduleBindingKindName(
189
+ value: ScheduleBindingKindName | string | null | undefined,
190
+ ): ScheduleBindingKindName | string | null;
191
+
192
+ export function normalizeDeploymentPlan(
193
+ plan: ModuleDeploymentPlan | null | undefined,
194
+ ): ModuleDeploymentPlan;
195
+
196
+ export function validateDeploymentPlan(
197
+ plan: ModuleDeploymentPlan | null | undefined,
198
+ options?: { manifest?: PluginManifest | null },
199
+ ): DeploymentPlanValidationReport;
200
+
201
+ export function createDeploymentPlanBundleEntry(
202
+ plan: ModuleDeploymentPlan | null | undefined,
203
+ options?: {
204
+ entryId?: string;
205
+ role?: string;
206
+ sectionName?: string;
207
+ mediaType?: string;
208
+ description?: string;
209
+ },
210
+ ): {
211
+ entryId: string;
212
+ role: string;
213
+ sectionName: string;
214
+ payloadEncoding: "json-utf8";
215
+ mediaType: string;
216
+ payload: ModuleDeploymentPlan;
217
+ description: string;
218
+ };
219
+
220
+ export function findDeploymentPlanEntry(bundleLike: unknown): unknown | null;
221
+
222
+ export function readDeploymentPlanFromBundle(
223
+ bundleLike: unknown,
224
+ ): ModuleDeploymentPlan | null;