@octonodes/sdk 0.1.12 → 0.2.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.
Files changed (39) hide show
  1. package/PLUGINS.md +40 -0
  2. package/dist/gen/types.gen.d.ts +21 -0
  3. package/dist/gen/types.gen.d.ts.map +1 -1
  4. package/dist/plugins/schema/constants.d.ts +4 -0
  5. package/dist/plugins/schema/constants.d.ts.map +1 -1
  6. package/dist/plugins/schema/constants.js +5 -1
  7. package/dist/plugins/schema/constants.js.map +1 -1
  8. package/dist/plugins/schema/plugin/execution.constants.d.ts +8 -0
  9. package/dist/plugins/schema/plugin/execution.constants.d.ts.map +1 -0
  10. package/dist/plugins/schema/plugin/execution.constants.js +12 -0
  11. package/dist/plugins/schema/plugin/execution.constants.js.map +1 -0
  12. package/dist/plugins/schema/plugin/execution.d.ts +1070 -0
  13. package/dist/plugins/schema/plugin/execution.d.ts.map +1 -0
  14. package/dist/plugins/schema/plugin/execution.js +43 -0
  15. package/dist/plugins/schema/plugin/execution.js.map +1 -0
  16. package/dist/plugins/schema/plugin-publishing.d.ts +396 -0
  17. package/dist/plugins/schema/plugin-publishing.d.ts.map +1 -0
  18. package/dist/plugins/schema/plugin-publishing.js +57 -0
  19. package/dist/plugins/schema/plugin-publishing.js.map +1 -0
  20. package/dist/plugins/schema/plugin-sdk/index.d.ts +4 -1
  21. package/dist/plugins/schema/plugin-sdk/index.d.ts.map +1 -1
  22. package/dist/plugins/schema/plugin-sdk/index.js +9 -1
  23. package/dist/plugins/schema/plugin-sdk/index.js.map +1 -1
  24. package/dist/plugins/schema/plugin-version.d.ts +8 -0
  25. package/dist/plugins/schema/plugin-version.d.ts.map +1 -0
  26. package/dist/plugins/schema/plugin-version.js +61 -0
  27. package/dist/plugins/schema/plugin-version.js.map +1 -0
  28. package/dist/plugins/schema/plugin.d.ts +10 -0
  29. package/dist/plugins/schema/plugin.d.ts.map +1 -1
  30. package/dist/plugins/schema/plugin.js +6 -0
  31. package/dist/plugins/schema/plugin.js.map +1 -1
  32. package/dist/plugins/sdk/plugin.d.ts.map +1 -1
  33. package/dist/plugins/sdk/plugin.js +2 -1
  34. package/dist/plugins/sdk/plugin.js.map +1 -1
  35. package/dist/plugins/sdk/plugins/index.d.ts +3 -0
  36. package/dist/plugins/sdk/plugins/index.d.ts.map +1 -1
  37. package/dist/plugins/sdk/plugins/index.js +12 -1
  38. package/dist/plugins/sdk/plugins/index.js.map +1 -1
  39. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../../../src/plugins/schema/plugin/execution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;EASvB,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAM1B,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAexB,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthorizedPluginRelease = exports.PluginExecutionRequest = exports.PluginExecutionReference = exports.PreparedPluginRuntime = void 0;
4
+ // Generated from packages/schema/src/plugin/execution.ts. Do not edit; run the Octonode SDK sync.
5
+ const zod_1 = require("zod");
6
+ const ipc_envelope_1 = require("../ipc-envelope");
7
+ const plugin_1 = require("../plugin");
8
+ const execution_constants_1 = require("./execution.constants");
9
+ exports.PreparedPluginRuntime = zod_1.z
10
+ .object({
11
+ format: zod_1.z.literal(1),
12
+ nodeMajor: zod_1.z.literal(24),
13
+ platform: zod_1.z.enum(["portable", "linux", "darwin"]),
14
+ arch: zod_1.z.string().max(32).optional(),
15
+ libc: zod_1.z.string().max(64).optional(),
16
+ dependencies: zod_1.z.literal(execution_constants_1.PREPARED_RUNTIME_ARCHIVE).optional(),
17
+ })
18
+ .strict();
19
+ exports.PluginExecutionReference = zod_1.z
20
+ .object({
21
+ installId: zod_1.z.string().uuid(),
22
+ sha256: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
23
+ nodeId: zod_1.z.string().regex(/^[a-z0-9][a-z0-9_-]*$/i),
24
+ })
25
+ .strict();
26
+ exports.PluginExecutionRequest = zod_1.z
27
+ .object({
28
+ plugin: exports.PluginExecutionReference,
29
+ request: ipc_envelope_1.InvokeRequest,
30
+ environment: zod_1.z
31
+ .record(zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/i), zod_1.z
32
+ .string()
33
+ .max(65_536)
34
+ .refine((value) => !value.includes("\0")))
35
+ .default({}),
36
+ timeoutMs: zod_1.z.number().int().positive().max(execution_constants_1.PLUGIN_EXECUTION_TIMEOUT_MS).default(execution_constants_1.PLUGIN_EXECUTION_TIMEOUT_MS),
37
+ })
38
+ .strict();
39
+ exports.AuthorizedPluginRelease = zod_1.z.object({
40
+ manifest: plugin_1.PluginManifest,
41
+ archiveSha256: zod_1.z.string().regex(/^[a-f0-9]{64}$/),
42
+ });
43
+ //# sourceMappingURL=execution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution.js","sourceRoot":"","sources":["../../../../src/plugins/schema/plugin/execution.ts"],"names":[],"mappings":";;;AAAA,kGAAkG;AAClG,6BAAwB;AACxB,kDAAgD;AAChD,sCAA2C;AAC3C,+DAA8F;AAEjF,QAAA,qBA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C,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,iDAA2B,CAAC,CAAC,OAAO,CAAC,iDAA2B,CAAC;CAC7G,CAAC;KACD,MAAM,EAAE,CAAC;AAGC,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,uBAAc;IACxB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC;CAClD,CAAC,CAAC"}
@@ -0,0 +1,396 @@
1
+ import { z } from "zod";
2
+ export declare const PluginConfigPath: z.ZodEffects<z.ZodString, string, string>;
3
+ export declare const PluginReleaseConfig: z.ZodEffects<z.ZodObject<{
4
+ apiVersion: z.ZodLiteral<"octonode.plugin/v1">;
5
+ id: z.ZodString;
6
+ version: z.ZodString;
7
+ scope: z.ZodEnum<["user", "team", "organization", "public"]>;
8
+ teamId: z.ZodOptional<z.ZodString>;
9
+ orgId: z.ZodOptional<z.ZodString>;
10
+ contributors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
+ workflow: z.ZodDefault<z.ZodString>;
12
+ }, "strict", z.ZodTypeAny, {
13
+ workflow: string;
14
+ id: string;
15
+ scope: "user" | "public" | "team" | "organization";
16
+ apiVersion: "octonode.plugin/v1";
17
+ version: string;
18
+ contributors?: string[] | undefined;
19
+ teamId?: string | undefined;
20
+ orgId?: string | undefined;
21
+ }, {
22
+ id: string;
23
+ scope: "user" | "public" | "team" | "organization";
24
+ apiVersion: "octonode.plugin/v1";
25
+ version: string;
26
+ workflow?: string | undefined;
27
+ contributors?: string[] | undefined;
28
+ teamId?: string | undefined;
29
+ orgId?: string | undefined;
30
+ }>, {
31
+ workflow: string;
32
+ id: string;
33
+ scope: "user" | "public" | "team" | "organization";
34
+ apiVersion: "octonode.plugin/v1";
35
+ version: string;
36
+ contributors?: string[] | undefined;
37
+ teamId?: string | undefined;
38
+ orgId?: string | undefined;
39
+ }, {
40
+ id: string;
41
+ scope: "user" | "public" | "team" | "organization";
42
+ apiVersion: "octonode.plugin/v1";
43
+ version: string;
44
+ workflow?: string | undefined;
45
+ contributors?: string[] | undefined;
46
+ teamId?: string | undefined;
47
+ orgId?: string | undefined;
48
+ }>;
49
+ export type PluginReleaseConfig = z.infer<typeof PluginReleaseConfig>;
50
+ export declare const pluginReleaseScope: (config: PluginReleaseConfig) => "user" | "group" | "org" | "public";
51
+ export declare const PluginPublisherInput: z.ZodObject<{
52
+ repositoryId: z.ZodNumber;
53
+ configPath: z.ZodEffects<z.ZodString, string, string>;
54
+ }, "strict", z.ZodTypeAny, {
55
+ repositoryId: number;
56
+ configPath: string;
57
+ }, {
58
+ repositoryId: number;
59
+ configPath: string;
60
+ }>;
61
+ export declare const PluginPublisherConsent: z.ZodObject<{
62
+ repositoryId: z.ZodNumber;
63
+ configPath: z.ZodEffects<z.ZodString, string, string>;
64
+ } & {
65
+ sha256: z.ZodString;
66
+ }, "strict", z.ZodTypeAny, {
67
+ sha256: string;
68
+ repositoryId: number;
69
+ configPath: string;
70
+ }, {
71
+ sha256: string;
72
+ repositoryId: number;
73
+ configPath: string;
74
+ }>;
75
+ export declare const PluginPublisherPreview: z.ZodObject<{
76
+ config: z.ZodEffects<z.ZodObject<{
77
+ apiVersion: z.ZodLiteral<"octonode.plugin/v1">;
78
+ id: z.ZodString;
79
+ version: z.ZodString;
80
+ scope: z.ZodEnum<["user", "team", "organization", "public"]>;
81
+ teamId: z.ZodOptional<z.ZodString>;
82
+ orgId: z.ZodOptional<z.ZodString>;
83
+ contributors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
84
+ workflow: z.ZodDefault<z.ZodString>;
85
+ }, "strict", z.ZodTypeAny, {
86
+ workflow: string;
87
+ id: string;
88
+ scope: "user" | "public" | "team" | "organization";
89
+ apiVersion: "octonode.plugin/v1";
90
+ version: string;
91
+ contributors?: string[] | undefined;
92
+ teamId?: string | undefined;
93
+ orgId?: string | undefined;
94
+ }, {
95
+ id: string;
96
+ scope: "user" | "public" | "team" | "organization";
97
+ apiVersion: "octonode.plugin/v1";
98
+ version: string;
99
+ workflow?: string | undefined;
100
+ contributors?: string[] | undefined;
101
+ teamId?: string | undefined;
102
+ orgId?: string | undefined;
103
+ }>, {
104
+ workflow: string;
105
+ id: string;
106
+ scope: "user" | "public" | "team" | "organization";
107
+ apiVersion: "octonode.plugin/v1";
108
+ version: string;
109
+ contributors?: string[] | undefined;
110
+ teamId?: string | undefined;
111
+ orgId?: string | undefined;
112
+ }, {
113
+ id: string;
114
+ scope: "user" | "public" | "team" | "organization";
115
+ apiVersion: "octonode.plugin/v1";
116
+ version: string;
117
+ workflow?: string | undefined;
118
+ contributors?: string[] | undefined;
119
+ teamId?: string | undefined;
120
+ orgId?: string | undefined;
121
+ }>;
122
+ sha256: z.ZodString;
123
+ repository: z.ZodString;
124
+ branch: z.ZodString;
125
+ }, "strip", z.ZodTypeAny, {
126
+ repository: string;
127
+ config: {
128
+ workflow: string;
129
+ id: string;
130
+ scope: "user" | "public" | "team" | "organization";
131
+ apiVersion: "octonode.plugin/v1";
132
+ version: string;
133
+ contributors?: string[] | undefined;
134
+ teamId?: string | undefined;
135
+ orgId?: string | undefined;
136
+ };
137
+ sha256: string;
138
+ branch: string;
139
+ }, {
140
+ repository: string;
141
+ config: {
142
+ id: string;
143
+ scope: "user" | "public" | "team" | "organization";
144
+ apiVersion: "octonode.plugin/v1";
145
+ version: string;
146
+ workflow?: string | undefined;
147
+ contributors?: string[] | undefined;
148
+ teamId?: string | undefined;
149
+ orgId?: string | undefined;
150
+ };
151
+ sha256: string;
152
+ branch: string;
153
+ }>;
154
+ export declare const PluginPublisherConnection: z.ZodObject<{
155
+ config: z.ZodEffects<z.ZodObject<{
156
+ apiVersion: z.ZodLiteral<"octonode.plugin/v1">;
157
+ id: z.ZodString;
158
+ version: z.ZodString;
159
+ scope: z.ZodEnum<["user", "team", "organization", "public"]>;
160
+ teamId: z.ZodOptional<z.ZodString>;
161
+ orgId: z.ZodOptional<z.ZodString>;
162
+ contributors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
163
+ workflow: z.ZodDefault<z.ZodString>;
164
+ }, "strict", z.ZodTypeAny, {
165
+ workflow: string;
166
+ id: string;
167
+ scope: "user" | "public" | "team" | "organization";
168
+ apiVersion: "octonode.plugin/v1";
169
+ version: string;
170
+ contributors?: string[] | undefined;
171
+ teamId?: string | undefined;
172
+ orgId?: string | undefined;
173
+ }, {
174
+ id: string;
175
+ scope: "user" | "public" | "team" | "organization";
176
+ apiVersion: "octonode.plugin/v1";
177
+ version: string;
178
+ workflow?: string | undefined;
179
+ contributors?: string[] | undefined;
180
+ teamId?: string | undefined;
181
+ orgId?: string | undefined;
182
+ }>, {
183
+ workflow: string;
184
+ id: string;
185
+ scope: "user" | "public" | "team" | "organization";
186
+ apiVersion: "octonode.plugin/v1";
187
+ version: string;
188
+ contributors?: string[] | undefined;
189
+ teamId?: string | undefined;
190
+ orgId?: string | undefined;
191
+ }, {
192
+ id: string;
193
+ scope: "user" | "public" | "team" | "organization";
194
+ apiVersion: "octonode.plugin/v1";
195
+ version: string;
196
+ workflow?: string | undefined;
197
+ contributors?: string[] | undefined;
198
+ teamId?: string | undefined;
199
+ orgId?: string | undefined;
200
+ }>;
201
+ sha256: z.ZodString;
202
+ repository: z.ZodString;
203
+ branch: z.ZodString;
204
+ } & {
205
+ id: z.ZodString;
206
+ repositoryId: z.ZodNumber;
207
+ configPath: z.ZodEffects<z.ZodString, string, string>;
208
+ lastVersion: z.ZodNullable<z.ZodString>;
209
+ lastSha: z.ZodNullable<z.ZodString>;
210
+ lastPublishedAt: z.ZodNullable<z.ZodNumber>;
211
+ }, "strip", z.ZodTypeAny, {
212
+ repository: string;
213
+ config: {
214
+ workflow: string;
215
+ id: string;
216
+ scope: "user" | "public" | "team" | "organization";
217
+ apiVersion: "octonode.plugin/v1";
218
+ version: string;
219
+ contributors?: string[] | undefined;
220
+ teamId?: string | undefined;
221
+ orgId?: string | undefined;
222
+ };
223
+ id: string;
224
+ sha256: string;
225
+ repositoryId: number;
226
+ configPath: string;
227
+ branch: string;
228
+ lastVersion: string | null;
229
+ lastSha: string | null;
230
+ lastPublishedAt: number | null;
231
+ }, {
232
+ repository: string;
233
+ config: {
234
+ id: string;
235
+ scope: "user" | "public" | "team" | "organization";
236
+ apiVersion: "octonode.plugin/v1";
237
+ version: string;
238
+ workflow?: string | undefined;
239
+ contributors?: string[] | undefined;
240
+ teamId?: string | undefined;
241
+ orgId?: string | undefined;
242
+ };
243
+ id: string;
244
+ sha256: string;
245
+ repositoryId: number;
246
+ configPath: string;
247
+ branch: string;
248
+ lastVersion: string | null;
249
+ lastSha: string | null;
250
+ lastPublishedAt: number | null;
251
+ }>;
252
+ export declare const PluginPublisherConnections: z.ZodObject<{
253
+ items: z.ZodArray<z.ZodObject<{
254
+ config: z.ZodEffects<z.ZodObject<{
255
+ apiVersion: z.ZodLiteral<"octonode.plugin/v1">;
256
+ id: z.ZodString;
257
+ version: z.ZodString;
258
+ scope: z.ZodEnum<["user", "team", "organization", "public"]>;
259
+ teamId: z.ZodOptional<z.ZodString>;
260
+ orgId: z.ZodOptional<z.ZodString>;
261
+ contributors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
262
+ workflow: z.ZodDefault<z.ZodString>;
263
+ }, "strict", z.ZodTypeAny, {
264
+ workflow: string;
265
+ id: string;
266
+ scope: "user" | "public" | "team" | "organization";
267
+ apiVersion: "octonode.plugin/v1";
268
+ version: string;
269
+ contributors?: string[] | undefined;
270
+ teamId?: string | undefined;
271
+ orgId?: string | undefined;
272
+ }, {
273
+ id: string;
274
+ scope: "user" | "public" | "team" | "organization";
275
+ apiVersion: "octonode.plugin/v1";
276
+ version: string;
277
+ workflow?: string | undefined;
278
+ contributors?: string[] | undefined;
279
+ teamId?: string | undefined;
280
+ orgId?: string | undefined;
281
+ }>, {
282
+ workflow: string;
283
+ id: string;
284
+ scope: "user" | "public" | "team" | "organization";
285
+ apiVersion: "octonode.plugin/v1";
286
+ version: string;
287
+ contributors?: string[] | undefined;
288
+ teamId?: string | undefined;
289
+ orgId?: string | undefined;
290
+ }, {
291
+ id: string;
292
+ scope: "user" | "public" | "team" | "organization";
293
+ apiVersion: "octonode.plugin/v1";
294
+ version: string;
295
+ workflow?: string | undefined;
296
+ contributors?: string[] | undefined;
297
+ teamId?: string | undefined;
298
+ orgId?: string | undefined;
299
+ }>;
300
+ sha256: z.ZodString;
301
+ repository: z.ZodString;
302
+ branch: z.ZodString;
303
+ } & {
304
+ id: z.ZodString;
305
+ repositoryId: z.ZodNumber;
306
+ configPath: z.ZodEffects<z.ZodString, string, string>;
307
+ lastVersion: z.ZodNullable<z.ZodString>;
308
+ lastSha: z.ZodNullable<z.ZodString>;
309
+ lastPublishedAt: z.ZodNullable<z.ZodNumber>;
310
+ }, "strip", z.ZodTypeAny, {
311
+ repository: string;
312
+ config: {
313
+ workflow: string;
314
+ id: string;
315
+ scope: "user" | "public" | "team" | "organization";
316
+ apiVersion: "octonode.plugin/v1";
317
+ version: string;
318
+ contributors?: string[] | undefined;
319
+ teamId?: string | undefined;
320
+ orgId?: string | undefined;
321
+ };
322
+ id: string;
323
+ sha256: string;
324
+ repositoryId: number;
325
+ configPath: string;
326
+ branch: string;
327
+ lastVersion: string | null;
328
+ lastSha: string | null;
329
+ lastPublishedAt: number | null;
330
+ }, {
331
+ repository: string;
332
+ config: {
333
+ id: string;
334
+ scope: "user" | "public" | "team" | "organization";
335
+ apiVersion: "octonode.plugin/v1";
336
+ version: string;
337
+ workflow?: string | undefined;
338
+ contributors?: string[] | undefined;
339
+ teamId?: string | undefined;
340
+ orgId?: string | undefined;
341
+ };
342
+ id: string;
343
+ sha256: string;
344
+ repositoryId: number;
345
+ configPath: string;
346
+ branch: string;
347
+ lastVersion: string | null;
348
+ lastSha: string | null;
349
+ lastPublishedAt: number | null;
350
+ }>, "many">;
351
+ }, "strip", z.ZodTypeAny, {
352
+ items: {
353
+ repository: string;
354
+ config: {
355
+ workflow: string;
356
+ id: string;
357
+ scope: "user" | "public" | "team" | "organization";
358
+ apiVersion: "octonode.plugin/v1";
359
+ version: string;
360
+ contributors?: string[] | undefined;
361
+ teamId?: string | undefined;
362
+ orgId?: string | undefined;
363
+ };
364
+ id: string;
365
+ sha256: string;
366
+ repositoryId: number;
367
+ configPath: string;
368
+ branch: string;
369
+ lastVersion: string | null;
370
+ lastSha: string | null;
371
+ lastPublishedAt: number | null;
372
+ }[];
373
+ }, {
374
+ items: {
375
+ repository: string;
376
+ config: {
377
+ id: string;
378
+ scope: "user" | "public" | "team" | "organization";
379
+ apiVersion: "octonode.plugin/v1";
380
+ version: string;
381
+ workflow?: string | undefined;
382
+ contributors?: string[] | undefined;
383
+ teamId?: string | undefined;
384
+ orgId?: string | undefined;
385
+ };
386
+ id: string;
387
+ sha256: string;
388
+ repositoryId: number;
389
+ configPath: string;
390
+ branch: string;
391
+ lastVersion: string | null;
392
+ lastSha: string | null;
393
+ lastPublishedAt: number | null;
394
+ }[];
395
+ }>;
396
+ //# sourceMappingURL=plugin-publishing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-publishing.d.ts","sourceRoot":"","sources":["../../../src/plugins/schema/plugin-publishing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB,2CAQ1B,CAAC;AACJ,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuB5B,CAAC;AACL,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,eAAO,MAAM,kBAAkB,GAAI,QAAQ,mBAAmB,wCACoD,CAAC;AAEnH,eAAO,MAAM,oBAAoB;;;;;;;;;EAEtB,CAAC;AACZ,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;EAA8E,CAAC;AAClH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKjC,CAAC;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0D,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PluginPublisherConnections = exports.PluginPublisherConnection = exports.PluginPublisherPreview = exports.PluginPublisherConsent = exports.PluginPublisherInput = exports.pluginReleaseScope = exports.PluginReleaseConfig = exports.PluginConfigPath = void 0;
4
+ // Generated from packages/schema/src/plugin-publishing.ts. Do not edit; run the Octonode SDK sync.
5
+ const zod_1 = require("zod");
6
+ const plugin_version_1 = require("./plugin-version");
7
+ exports.PluginConfigPath = zod_1.z
8
+ .string()
9
+ .max(512)
10
+ .refine((path) => /^(?:[a-zA-Z0-9_.-]+\/)*plugin\.octonode\.(json|ya?ml)$/.test(path) &&
11
+ !path.split("/").some((part) => [".", "..", ".git", "node_modules"].includes(part)), "Select a repository-relative plugin.octonode.json or .yml file");
12
+ exports.PluginReleaseConfig = zod_1.z
13
+ .object({
14
+ apiVersion: zod_1.z.literal("octonode.plugin/v1"),
15
+ id: zod_1.z
16
+ .string()
17
+ .max(128)
18
+ .regex(/^[a-z0-9][a-z0-9-]*$/),
19
+ version: plugin_version_1.PluginVersion,
20
+ scope: zod_1.z.enum(["user", "team", "organization", "public"]),
21
+ teamId: zod_1.z.string().min(1).max(128).optional(),
22
+ orgId: zod_1.z.string().min(1).max(128).optional(),
23
+ contributors: zod_1.z.array(zod_1.z.string().trim().min(1).max(240)).max(100).optional(),
24
+ workflow: zod_1.z
25
+ .string()
26
+ .regex(/^\.github\/workflows\/[a-zA-Z0-9_-]+\.ya?ml$/)
27
+ .default(".github/workflows/octonode-publish.yml"),
28
+ })
29
+ .strict()
30
+ .superRefine((config, ctx) => {
31
+ if ((config.scope === "team") !== Boolean(config.teamId))
32
+ ctx.addIssue({ code: "custom", path: ["teamId"], message: "teamId is required only for team scope" });
33
+ if ((config.scope === "organization") !== Boolean(config.orgId))
34
+ ctx.addIssue({ code: "custom", path: ["orgId"], message: "orgId is required only for organization scope" });
35
+ });
36
+ const pluginReleaseScope = (config) => config.scope === "team" ? "group" : config.scope === "organization" ? "org" : config.scope;
37
+ exports.pluginReleaseScope = pluginReleaseScope;
38
+ exports.PluginPublisherInput = zod_1.z
39
+ .object({ repositoryId: zod_1.z.number().int().positive(), configPath: exports.PluginConfigPath })
40
+ .strict();
41
+ exports.PluginPublisherConsent = exports.PluginPublisherInput.extend({ sha256: zod_1.z.string().regex(/^[a-f0-9]{64}$/) });
42
+ exports.PluginPublisherPreview = zod_1.z.object({
43
+ config: exports.PluginReleaseConfig,
44
+ sha256: zod_1.z.string(),
45
+ repository: zod_1.z.string(),
46
+ branch: zod_1.z.string(),
47
+ });
48
+ exports.PluginPublisherConnection = exports.PluginPublisherPreview.extend({
49
+ id: zod_1.z.string().uuid(),
50
+ repositoryId: zod_1.z.number(),
51
+ configPath: exports.PluginConfigPath,
52
+ lastVersion: zod_1.z.string().nullable(),
53
+ lastSha: zod_1.z.string().nullable(),
54
+ lastPublishedAt: zod_1.z.number().nullable(),
55
+ });
56
+ exports.PluginPublisherConnections = zod_1.z.object({ items: zod_1.z.array(exports.PluginPublisherConnection) });
57
+ //# sourceMappingURL=plugin-publishing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-publishing.js","source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AC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;AACrG,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,MAAM,EAAE,2BAAmB;IAC3B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AACU,QAAA,yBAAyB,GAAG,8BAAsB,CAAC,MAAM,CAAC;IACrE,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,wBAAgB;IAC5B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AACU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,iCAAyB,CAAC,EAAE,CAAC,CAAC"}
@@ -1,5 +1,8 @@
1
1
  export * from "../plugin";
2
2
  export * from "../ipc-envelope";
3
3
  export * from "../icons";
4
- export { SETTINGS_API_VERSION, PLUGIN_SCHEMA_VERSION } from "../constants";
4
+ export { PreparedPluginRuntime } from "../plugin/execution";
5
+ export { SETTINGS_API_VERSION, PLUGIN_SCHEMA_VERSION, PLUGIN_RELEASE_FILES, PLUGIN_PUBLISH_AUDIENCE, PLUGIN_CONFIG_MAX_BYTES, PLUGIN_PUBLISH_MAX_BYTES, } from "../constants";
6
+ export * from "../plugin-publishing";
7
+ export * from "../plugin-version";
5
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/schema/plugin-sdk/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/schema/plugin-sdk/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAEtB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
@@ -14,12 +14,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.PLUGIN_SCHEMA_VERSION = exports.SETTINGS_API_VERSION = void 0;
17
+ exports.PLUGIN_PUBLISH_MAX_BYTES = exports.PLUGIN_CONFIG_MAX_BYTES = exports.PLUGIN_PUBLISH_AUDIENCE = exports.PLUGIN_RELEASE_FILES = exports.PLUGIN_SCHEMA_VERSION = exports.SETTINGS_API_VERSION = exports.PreparedPluginRuntime = void 0;
18
18
  // Generated from packages/schema/src/plugin-sdk/index.ts. Do not edit; run the Octonode SDK sync.
19
19
  __exportStar(require("../plugin"), exports);
20
20
  __exportStar(require("../ipc-envelope"), exports);
21
21
  __exportStar(require("../icons"), exports);
22
+ var execution_1 = require("../plugin/execution");
23
+ Object.defineProperty(exports, "PreparedPluginRuntime", { enumerable: true, get: function () { return execution_1.PreparedPluginRuntime; } });
22
24
  var constants_1 = require("../constants");
23
25
  Object.defineProperty(exports, "SETTINGS_API_VERSION", { enumerable: true, get: function () { return constants_1.SETTINGS_API_VERSION; } });
24
26
  Object.defineProperty(exports, "PLUGIN_SCHEMA_VERSION", { enumerable: true, get: function () { return constants_1.PLUGIN_SCHEMA_VERSION; } });
27
+ Object.defineProperty(exports, "PLUGIN_RELEASE_FILES", { enumerable: true, get: function () { return constants_1.PLUGIN_RELEASE_FILES; } });
28
+ Object.defineProperty(exports, "PLUGIN_PUBLISH_AUDIENCE", { enumerable: true, get: function () { return constants_1.PLUGIN_PUBLISH_AUDIENCE; } });
29
+ Object.defineProperty(exports, "PLUGIN_CONFIG_MAX_BYTES", { enumerable: true, get: function () { return constants_1.PLUGIN_CONFIG_MAX_BYTES; } });
30
+ Object.defineProperty(exports, "PLUGIN_PUBLISH_MAX_BYTES", { enumerable: true, get: function () { return constants_1.PLUGIN_PUBLISH_MAX_BYTES; } });
31
+ __exportStar(require("../plugin-publishing"), exports);
32
+ __exportStar(require("../plugin-version"), exports);
25
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/schema/plugin-sdk/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kGAAkG;AAClG,4CAA0B;AAC1B,kDAAgC;AAChC,2CAAyB;AACzB,0CAA2E;AAAlE,iHAAA,oBAAoB,OAAA;AAAE,kHAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/schema/plugin-sdk/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kGAAkG;AAClG,4CAA0B;AAC1B,kDAAgC;AAChC,2CAAyB;AACzB,iDAA4D;AAAnD,kHAAA,qBAAqB,OAAA;AAC9B,0CAOsB;AANpB,iHAAA,oBAAoB,OAAA;AACpB,kHAAA,qBAAqB,OAAA;AACrB,iHAAA,oBAAoB,OAAA;AACpB,oHAAA,uBAAuB,OAAA;AACvB,oHAAA,uBAAuB,OAAA;AACvB,qHAAA,wBAAwB,OAAA;AAG1B,uDAAqC;AACrC,oDAAkC"}
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ /** SemVer 2.0.0: no leading zeroes in numeric identifiers. */
3
+ export declare const PluginVersion: z.ZodString;
4
+ /** Legacy invalid versions sort below SemVer; build metadata never affects precedence. */
5
+ export declare function comparePluginVersions(left: string, right: string): number;
6
+ /** Match npm's stable patch/minor/major bumps, including promotion from prereleases. */
7
+ export declare function bumpPluginVersion(version: string, release: "patch" | "minor" | "major"): string;
8
+ //# sourceMappingURL=plugin-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-version.d.ts","sourceRoot":"","sources":["../../../src/plugins/schema/plugin-version.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8DAA8D;AAC9D,eAAO,MAAM,aAAa,aAMvB,CAAC;AAEJ,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAuBzE;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAc/F"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PluginVersion = void 0;
4
+ exports.comparePluginVersions = comparePluginVersions;
5
+ exports.bumpPluginVersion = bumpPluginVersion;
6
+ // Generated from packages/schema/src/plugin-version.ts. Do not edit; run the Octonode SDK sync.
7
+ const zod_1 = require("zod");
8
+ /** SemVer 2.0.0: no leading zeroes in numeric identifiers. */
9
+ exports.PluginVersion = zod_1.z
10
+ .string()
11
+ .max(200)
12
+ .regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/, "Use a semantic version such as 1.2.3 or 2.0.0-beta.1");
13
+ /** Legacy invalid versions sort below SemVer; build metadata never affects precedence. */
14
+ function comparePluginVersions(left, right) {
15
+ const validLeft = exports.PluginVersion.safeParse(left).success;
16
+ const validRight = exports.PluginVersion.safeParse(right).success;
17
+ if (!validLeft || !validRight)
18
+ return Number(validLeft) - Number(validRight) || left.localeCompare(right);
19
+ const [leftCore, ...leftPre] = left.split("+")[0].split("-");
20
+ const [rightCore, ...rightPre] = right.split("+")[0].split("-");
21
+ const numeric = (a, b) => a.length - b.length || (a > b ? 1 : a < b ? -1 : 0);
22
+ const a = leftCore.split(".");
23
+ const b = rightCore.split(".");
24
+ for (let i = 0; i < 3; i++) {
25
+ const difference = numeric(a[i], b[i]);
26
+ if (difference)
27
+ return difference;
28
+ }
29
+ if (!leftPre.length || !rightPre.length)
30
+ return Number(!leftPre.length) - Number(!rightPre.length);
31
+ const ap = leftPre.join("-").split(".");
32
+ const bp = rightPre.join("-").split(".");
33
+ for (let i = 0; i < Math.min(ap.length, bp.length); i++) {
34
+ if (ap[i] === bp[i])
35
+ continue;
36
+ const an = /^\d+$/.test(ap[i]);
37
+ const bn = /^\d+$/.test(bp[i]);
38
+ return an && bn ? numeric(ap[i], bp[i]) : an !== bn ? Number(bn) - Number(an) : ap[i] > bp[i] ? 1 : -1;
39
+ }
40
+ return ap.length - bp.length;
41
+ }
42
+ /** Match npm's stable patch/minor/major bumps, including promotion from prereleases. */
43
+ function bumpPluginVersion(version, release) {
44
+ exports.PluginVersion.parse(version);
45
+ const core = version.split("+")[0];
46
+ const prerelease = core.includes("-");
47
+ let [major, minor, patch] = core.split("-")[0].split(".").map(BigInt);
48
+ if (release === "major") {
49
+ major += !prerelease || minor !== 0n || patch !== 0n ? 1n : 0n;
50
+ minor = 0n;
51
+ patch = 0n;
52
+ }
53
+ else if (release === "minor") {
54
+ minor += !prerelease || patch !== 0n ? 1n : 0n;
55
+ patch = 0n;
56
+ }
57
+ else
58
+ patch += prerelease ? 0n : 1n;
59
+ return exports.PluginVersion.parse(`${major}.${minor}.${patch}`);
60
+ }
61
+ //# sourceMappingURL=plugin-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-version.js","sourceRoot":"","sources":["../../../src/plugins/schema/plugin-version.ts"],"names":[],"mappings":";;;AAaA,sDAuBC;AAGD,8CAcC;AArDD,gGAAgG;AAChG,6BAAwB;AAExB,8DAA8D;AACjD,QAAA,aAAa,GAAG,OAAC;KAC3B,MAAM,EAAE;KACR,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CACJ,mLAAmL,EACnL,sDAAsD,CACvD,CAAC;AAEJ,0FAA0F;AAC1F,SAAgB,qBAAqB,CAAC,IAAY,EAAE,KAAa;IAC/D,MAAM,SAAS,GAAG,qBAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;IACxD,MAAM,UAAU,GAAG,qBAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;IAC1D,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1G,MAAM,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7D,MAAM,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAA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