@taqueria/protocol 0.0.0-pr-465-ed5ef23a → 0.0.0-pr-514-4f41dd4c
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/package.json +1 -1
- package/taqueria-protocol-types.ts +18 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taqueria/protocol",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-514-4f41dd4c",
|
|
4
4
|
"description": "A TypeScript package which contains types that are to be shared between @taqueria/node-sdk and @taqueria/taqueria.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -226,7 +226,6 @@ export interface UnvalidatedTask {
|
|
|
226
226
|
readonly handler: "proxy" | string | string[]
|
|
227
227
|
readonly hidden?: boolean
|
|
228
228
|
readonly example?: string
|
|
229
|
-
readonly encoding?: "json" | "application/json" | "none"
|
|
230
229
|
}
|
|
231
230
|
|
|
232
231
|
export interface UnvalidatedPluginInfo {
|
|
@@ -373,8 +372,6 @@ export class Option {
|
|
|
373
372
|
}
|
|
374
373
|
}
|
|
375
374
|
|
|
376
|
-
export type TaskEncoding = "none" | "json" | "application/json"
|
|
377
|
-
|
|
378
375
|
const taskType: unique symbol = Symbol()
|
|
379
376
|
export class Task {
|
|
380
377
|
[taskType]: void
|
|
@@ -387,8 +384,7 @@ export type TaskEncoding = "none" | "json" | "application/json"
|
|
|
387
384
|
readonly handler: TaskHandler
|
|
388
385
|
readonly hidden: boolean
|
|
389
386
|
readonly positionals: PositionalArg[]
|
|
390
|
-
|
|
391
|
-
protected constructor(name: Verb, command: Command, description: string, handler: TaskHandler, options: Option[]=[], positionals: PositionalArg[]=[], aliases: Alias[]=[], hidden=false, encoding="none", example?: string) {
|
|
387
|
+
protected constructor(name: Verb, command: Command, description: string, handler: TaskHandler, options: Option[]=[], positionals: PositionalArg[]=[], aliases: Alias[]=[], hidden=false, example?: string) {
|
|
392
388
|
this.task = name
|
|
393
389
|
this.command = command
|
|
394
390
|
this.description = description
|
|
@@ -398,9 +394,6 @@ export type TaskEncoding = "none" | "json" | "application/json"
|
|
|
398
394
|
this.hidden = hidden
|
|
399
395
|
this.example = example
|
|
400
396
|
this.positionals = positionals
|
|
401
|
-
this.encoding = ["none", "json", "application/json"].includes(encoding)
|
|
402
|
-
? encoding as TaskEncoding
|
|
403
|
-
: "none"
|
|
404
397
|
}
|
|
405
398
|
static createAlias(value: string): Alias | undefined {
|
|
406
399
|
return Verb.create(value) || SingleChar.create(value)
|
|
@@ -453,7 +446,7 @@ export type TaskEncoding = "none" | "json" | "application/json"
|
|
|
453
446
|
)
|
|
454
447
|
|
|
455
448
|
return name && command
|
|
456
|
-
? new Task(name, command, task.description, task.handler, options, positionals, aliases, task.hidden ? true : false, task.
|
|
449
|
+
? new Task(name, command, task.description, task.handler, options, positionals, aliases, task.hidden ? true : false, task.example)
|
|
457
450
|
: undefined
|
|
458
451
|
}
|
|
459
452
|
}
|
|
@@ -593,34 +586,38 @@ export interface Environment {
|
|
|
593
586
|
readonly storage: Record<string, unknown>
|
|
594
587
|
}
|
|
595
588
|
|
|
596
|
-
export type
|
|
597
|
-
|
|
598
|
-
export type PluginProxyAction = Task
|
|
599
|
-
|
|
600
|
-
export type PluginAction = "checkRuntimeDependencies" | "installRuntimeDependencies" | "pluginInfo" | PluginProxyAction
|
|
589
|
+
export type PluginAction = "checkRuntimeDependencies" | "installRuntimeDependencies" | "proxy" | "pluginInfo" | string
|
|
601
590
|
|
|
602
591
|
export interface RuntimeDependencyReport extends RuntimeDependency {
|
|
603
592
|
readonly met: boolean
|
|
604
593
|
}
|
|
605
594
|
|
|
606
|
-
export interface
|
|
595
|
+
export interface CheckRuntimeDependenciesAction {
|
|
596
|
+
readonly status: PluginResponseCode,
|
|
607
597
|
readonly report: RuntimeDependencyReport[]
|
|
608
598
|
}
|
|
609
599
|
|
|
610
|
-
export interface
|
|
600
|
+
export interface InstallRuntimeDependenciesAction {
|
|
601
|
+
readonly status: PluginResponseCode,
|
|
611
602
|
readonly report: RuntimeDependencyReport[]
|
|
612
603
|
}
|
|
613
604
|
|
|
614
|
-
export type
|
|
605
|
+
export type PluginResponseCode = "success" | "failed" | "notSupported"
|
|
606
|
+
|
|
607
|
+
export type PluginActionNotSupported = {
|
|
615
608
|
readonly status: "notSupported",
|
|
616
609
|
readonly msg: string
|
|
617
610
|
}
|
|
618
611
|
|
|
619
|
-
export interface
|
|
620
|
-
readonly
|
|
612
|
+
export interface ProxyAction {
|
|
613
|
+
readonly status: PluginResponseCode,
|
|
614
|
+
readonly stdout: string | unknown,
|
|
615
|
+
readonly stderr: string,
|
|
621
616
|
readonly render?: 'none' | 'string' | 'table'
|
|
622
617
|
}
|
|
623
618
|
|
|
624
|
-
export
|
|
619
|
+
export interface ActionPluginInfo extends UnvalidatedPluginInfo {
|
|
620
|
+
readonly status: PluginResponseCode,
|
|
621
|
+
}
|
|
625
622
|
|
|
626
|
-
export type PluginResponse =
|
|
623
|
+
export type PluginResponse = ProxyAction | CheckRuntimeDependenciesAction | InstallRuntimeDependenciesAction | ActionPluginInfo | PluginActionNotSupported
|