@vicinae/api 0.15.6 → 0.16.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/dist/api/bus.d.ts +1 -0
- package/dist/api/command.d.ts +9 -0
- package/dist/api/command.js +17 -0
- package/dist/api/components/form.d.ts +1 -1
- package/dist/api/components/form.js +14 -3
- package/dist/api/components/grid.d.ts +13 -0
- package/dist/api/components/grid.js +20 -1
- package/dist/api/index.d.ts +4 -2
- package/dist/api/index.js +2 -0
- package/dist/api/proto/command.d.ts +35 -0
- package/dist/api/proto/command.js +182 -0
- package/dist/api/proto/extension.d.ts +17 -14
- package/dist/api/proto/extension.js +37 -0
- package/dist/commands/lint/index.d.ts +10 -0
- package/dist/commands/lint/index.js +46 -0
- package/dist/schemas/manifest.d.ts +18 -2
- package/dist/schemas/manifest.js +18 -2
- package/package.json +1 -1
package/dist/api/bus.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ type EndpointMapping = {
|
|
|
57
57
|
"wm.setWindowBounds": "wm.setWindowBounds";
|
|
58
58
|
"fileSearch.search": "fileSearch.search";
|
|
59
59
|
"ui.popToRoot": "ui.popToRoot";
|
|
60
|
+
"command.updateCommandMetadata": "command.updateCommandMetadata";
|
|
60
61
|
"storage.get": "storage.get";
|
|
61
62
|
"storage.set": "storage.set";
|
|
62
63
|
"storage.remove": "storage.remove";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update the values of properties declared in the manifest of the current command.
|
|
3
|
+
* Currently only `subtitle` is supported. Pass `null` to clear the custom subtitle.
|
|
4
|
+
*
|
|
5
|
+
* Raycast API: https://developers.raycast.com/api-reference/command#updatecommandmetadata
|
|
6
|
+
*/
|
|
7
|
+
export declare function updateCommandMetadata(metadata: {
|
|
8
|
+
subtitle?: string | null;
|
|
9
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateCommandMetadata = updateCommandMetadata;
|
|
4
|
+
const bus_1 = require("./bus");
|
|
5
|
+
/**
|
|
6
|
+
* Update the values of properties declared in the manifest of the current command.
|
|
7
|
+
* Currently only `subtitle` is supported. Pass `null` to clear the custom subtitle.
|
|
8
|
+
*
|
|
9
|
+
* Raycast API: https://developers.raycast.com/api-reference/command#updatecommandmetadata
|
|
10
|
+
*/
|
|
11
|
+
async function updateCommandMetadata(metadata) {
|
|
12
|
+
const payload = {};
|
|
13
|
+
if (Object.prototype.hasOwnProperty.call(metadata, 'subtitle')) {
|
|
14
|
+
payload.subtitle = metadata.subtitle ?? undefined;
|
|
15
|
+
}
|
|
16
|
+
await bus_1.bus.turboRequest('command.updateCommandMetadata', payload);
|
|
17
|
+
}
|
|
@@ -74,7 +74,7 @@ interface DropdownProps extends FormItemProps<string>, WithFormRef<Form.Dropdown
|
|
|
74
74
|
interface TagPickerProps extends FormItemProps<string[]>, WithFormRef<Form.TagPicker> {
|
|
75
75
|
children?: ReactNode;
|
|
76
76
|
}
|
|
77
|
-
interface TextAreaProps extends FormItemProps<string>, WithFormRef<Form.
|
|
77
|
+
interface TextAreaProps extends FormItemProps<string>, WithFormRef<Form.TextArea> {
|
|
78
78
|
}
|
|
79
79
|
interface FilePickerProps extends FormItemProps<string[]>, WithFormRef<Form.FilePicker> {
|
|
80
80
|
}
|
|
@@ -5,11 +5,22 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const use_imperative_form_handle_1 = require("../hooks/use-imperative-form-handle");
|
|
6
6
|
const dropdown_1 = require("./dropdown");
|
|
7
7
|
const wrapFormItemProps = (props) => {
|
|
8
|
-
// TODO: pass the current value in the event
|
|
9
8
|
return {
|
|
10
9
|
...props,
|
|
11
|
-
onFocus: () => props.onFocus?.({
|
|
12
|
-
|
|
10
|
+
onFocus: () => props.onFocus?.({
|
|
11
|
+
type: 'focus',
|
|
12
|
+
target: {
|
|
13
|
+
id: props.id,
|
|
14
|
+
value: (props.value ?? props.defaultValue),
|
|
15
|
+
},
|
|
16
|
+
}),
|
|
17
|
+
onBlur: () => props.onBlur?.({
|
|
18
|
+
type: 'blur',
|
|
19
|
+
target: {
|
|
20
|
+
id: props.id,
|
|
21
|
+
value: (props.value ?? props.defaultValue),
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
13
24
|
};
|
|
14
25
|
};
|
|
15
26
|
const FormRoot = ({ enableDrafts = false, actions, children, isLoading = false, navigationTitle, searchBarAccessory, }) => {
|
|
@@ -2,10 +2,20 @@ import React, { ReactNode } from "react";
|
|
|
2
2
|
import { Image, ImageLike } from "../image";
|
|
3
3
|
import { Color, ColorLike } from "../color";
|
|
4
4
|
declare enum GridInset {
|
|
5
|
+
Zero = "zero",
|
|
5
6
|
Small = "small",
|
|
6
7
|
Medium = "medium",
|
|
7
8
|
Large = "large"
|
|
8
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Enum representing the number of items that should be displayed on a single row.
|
|
12
|
+
* @deprecated - use `columns` instead.
|
|
13
|
+
*/
|
|
14
|
+
declare enum GridItemSize {
|
|
15
|
+
Small = "small",// Fits 8 items per row.
|
|
16
|
+
Medium = "medium",// Fits 5 items per row.
|
|
17
|
+
Large = "large"
|
|
18
|
+
}
|
|
9
19
|
declare enum GridFit {
|
|
10
20
|
Contain = "contain",
|
|
11
21
|
Fill = "fill"
|
|
@@ -13,6 +23,7 @@ declare enum GridFit {
|
|
|
13
23
|
export declare namespace Grid {
|
|
14
24
|
type BaseSection = {
|
|
15
25
|
inset?: GridInset;
|
|
26
|
+
itemSize?: GridItemSize;
|
|
16
27
|
columns?: number;
|
|
17
28
|
fit?: GridFit;
|
|
18
29
|
aspectRatio?: Grid.AspectRatio;
|
|
@@ -42,6 +53,7 @@ export declare namespace Grid {
|
|
|
42
53
|
}
|
|
43
54
|
export type Fit = GridFit;
|
|
44
55
|
export type Inset = GridInset;
|
|
56
|
+
export type ItemSize = GridItemSize;
|
|
45
57
|
export type AspectRatio = "1" | "3/2" | "2/3" | "4/3" | "3/4" | "16/9" | "9/16" | '21/9' | '9/21' | '32/9' | '9/32';
|
|
46
58
|
export namespace Item {
|
|
47
59
|
export type Props = {
|
|
@@ -110,6 +122,7 @@ export declare const Grid: React.FC<Grid.Props> & {
|
|
|
110
122
|
};
|
|
111
123
|
Fit: typeof GridFit;
|
|
112
124
|
Inset: typeof GridInset;
|
|
125
|
+
ItemSize: typeof GridItemSize;
|
|
113
126
|
Item: React.FC<Grid.Item.Props>;
|
|
114
127
|
};
|
|
115
128
|
export {};
|
|
@@ -8,10 +8,21 @@ const empty_view_1 = require("./empty-view");
|
|
|
8
8
|
const dropdown_1 = require("./dropdown");
|
|
9
9
|
var GridInset;
|
|
10
10
|
(function (GridInset) {
|
|
11
|
+
GridInset["Zero"] = "zero";
|
|
11
12
|
GridInset["Small"] = "small";
|
|
12
13
|
GridInset["Medium"] = "medium";
|
|
13
14
|
GridInset["Large"] = "large";
|
|
14
15
|
})(GridInset || (GridInset = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Enum representing the number of items that should be displayed on a single row.
|
|
18
|
+
* @deprecated - use `columns` instead.
|
|
19
|
+
*/
|
|
20
|
+
var GridItemSize;
|
|
21
|
+
(function (GridItemSize) {
|
|
22
|
+
GridItemSize["Small"] = "small";
|
|
23
|
+
GridItemSize["Medium"] = "medium";
|
|
24
|
+
GridItemSize["Large"] = "large";
|
|
25
|
+
})(GridItemSize || (GridItemSize = {}));
|
|
15
26
|
const aspectRatioMap = {
|
|
16
27
|
'1': 1,
|
|
17
28
|
'3/2': 3 / 2,
|
|
@@ -30,11 +41,18 @@ var GridFit;
|
|
|
30
41
|
GridFit["Contain"] = "contain";
|
|
31
42
|
GridFit["Fill"] = "fill";
|
|
32
43
|
})(GridFit || (GridFit = {}));
|
|
33
|
-
const GridRoot = ({ searchBarAccessory, children, actions, inset, fit = GridFit.Contain, aspectRatio = "1", ...props }) => {
|
|
44
|
+
const GridRoot = ({ searchBarAccessory, children, actions, inset, itemSize, fit = GridFit.Contain, aspectRatio = "1", ...props }) => {
|
|
34
45
|
if (typeof props.enableFiltering === "boolean" &&
|
|
35
46
|
typeof props.filtering === "undefined") {
|
|
36
47
|
props.filtering = props.enableFiltering;
|
|
37
48
|
}
|
|
49
|
+
if (props.columns === undefined && itemSize) {
|
|
50
|
+
props.columns = {
|
|
51
|
+
[GridItemSize.Small]: 8,
|
|
52
|
+
[GridItemSize.Medium]: 5,
|
|
53
|
+
[GridItemSize.Large]: 3,
|
|
54
|
+
}[itemSize];
|
|
55
|
+
}
|
|
38
56
|
return ((0, jsx_runtime_1.jsxs)("grid", { fit: fit, inset: inset, aspectRatio: aspectRatioMap[aspectRatio], ...props, children: [searchBarAccessory, children, actions] }));
|
|
39
57
|
};
|
|
40
58
|
const GridItem = ({ detail, actions, ...props }) => {
|
|
@@ -56,5 +74,6 @@ exports.Grid = Object.assign(GridRoot, {
|
|
|
56
74
|
Dropdown: dropdown_1.Dropdown,
|
|
57
75
|
Fit: GridFit,
|
|
58
76
|
Inset: GridInset,
|
|
77
|
+
ItemSize: GridItemSize,
|
|
59
78
|
Item: Object.assign(GridItem, {}),
|
|
60
79
|
});
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./ai.js";
|
|
1
2
|
export * from "./components/index.js";
|
|
2
3
|
export * from "./hooks/index.js";
|
|
3
4
|
export * from "./context/index.js";
|
|
@@ -16,5 +17,6 @@ export * from "./local-storage.js";
|
|
|
16
17
|
export * from "./oauth.js";
|
|
17
18
|
export * from "./alert.js";
|
|
18
19
|
export * from "./preference.js";
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
20
|
+
export * from "./file-search.js";
|
|
21
|
+
export * from "./window-management.js";
|
|
22
|
+
export * from "./command.js";
|
package/dist/api/index.js
CHANGED
|
@@ -14,6 +14,7 @@ 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
|
+
__exportStar(require("./ai.js"), exports);
|
|
17
18
|
__exportStar(require("./components/index.js"), exports);
|
|
18
19
|
__exportStar(require("./hooks/index.js"), exports);
|
|
19
20
|
__exportStar(require("./context/index.js"), exports);
|
|
@@ -34,3 +35,4 @@ __exportStar(require("./alert.js"), exports);
|
|
|
34
35
|
__exportStar(require("./preference.js"), exports);
|
|
35
36
|
__exportStar(require("./file-search.js"), exports);
|
|
36
37
|
__exportStar(require("./window-management.js"), exports);
|
|
38
|
+
__exportStar(require("./command.js"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { AckResponse } from "./common";
|
|
3
|
+
export declare const protobufPackage = "proto.ext.command";
|
|
4
|
+
export interface UpdateCommandMetadataRequest {
|
|
5
|
+
/** Null/empty clears the override. */
|
|
6
|
+
subtitle?: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface Request {
|
|
9
|
+
updateCommandMetadata?: UpdateCommandMetadataRequest | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface Response {
|
|
12
|
+
updateCommandMetadata?: AckResponse | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare const UpdateCommandMetadataRequest: MessageFns<UpdateCommandMetadataRequest>;
|
|
15
|
+
export declare const Request: MessageFns<Request>;
|
|
16
|
+
export declare const Response: MessageFns<Response>;
|
|
17
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
18
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
19
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
20
|
+
} : Partial<T>;
|
|
21
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
22
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
23
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
24
|
+
} & {
|
|
25
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
26
|
+
};
|
|
27
|
+
export interface MessageFns<T> {
|
|
28
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
29
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
30
|
+
fromJSON(object: any): T;
|
|
31
|
+
toJSON(message: T): unknown;
|
|
32
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
33
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.7.7
|
|
5
|
+
// protoc v6.32.1
|
|
6
|
+
// source: command.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Response = exports.Request = exports.UpdateCommandMetadataRequest = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
const common_1 = require("./common");
|
|
12
|
+
exports.protobufPackage = "proto.ext.command";
|
|
13
|
+
function createBaseUpdateCommandMetadataRequest() {
|
|
14
|
+
return { subtitle: undefined };
|
|
15
|
+
}
|
|
16
|
+
exports.UpdateCommandMetadataRequest = {
|
|
17
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
18
|
+
if (message.subtitle !== undefined) {
|
|
19
|
+
writer.uint32(10).string(message.subtitle);
|
|
20
|
+
}
|
|
21
|
+
return writer;
|
|
22
|
+
},
|
|
23
|
+
decode(input, length) {
|
|
24
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
25
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
26
|
+
const message = createBaseUpdateCommandMetadataRequest();
|
|
27
|
+
while (reader.pos < end) {
|
|
28
|
+
const tag = reader.uint32();
|
|
29
|
+
switch (tag >>> 3) {
|
|
30
|
+
case 1: {
|
|
31
|
+
if (tag !== 10) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
message.subtitle = reader.string();
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
reader.skip(tag & 7);
|
|
42
|
+
}
|
|
43
|
+
return message;
|
|
44
|
+
},
|
|
45
|
+
fromJSON(object) {
|
|
46
|
+
return { subtitle: isSet(object.subtitle) ? globalThis.String(object.subtitle) : undefined };
|
|
47
|
+
},
|
|
48
|
+
toJSON(message) {
|
|
49
|
+
const obj = {};
|
|
50
|
+
if (message.subtitle !== undefined) {
|
|
51
|
+
obj.subtitle = message.subtitle;
|
|
52
|
+
}
|
|
53
|
+
return obj;
|
|
54
|
+
},
|
|
55
|
+
create(base) {
|
|
56
|
+
return exports.UpdateCommandMetadataRequest.fromPartial(base ?? {});
|
|
57
|
+
},
|
|
58
|
+
fromPartial(object) {
|
|
59
|
+
const message = createBaseUpdateCommandMetadataRequest();
|
|
60
|
+
message.subtitle = object.subtitle ?? undefined;
|
|
61
|
+
return message;
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
function createBaseRequest() {
|
|
65
|
+
return { updateCommandMetadata: undefined };
|
|
66
|
+
}
|
|
67
|
+
exports.Request = {
|
|
68
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
69
|
+
if (message.updateCommandMetadata !== undefined) {
|
|
70
|
+
exports.UpdateCommandMetadataRequest.encode(message.updateCommandMetadata, writer.uint32(10).fork()).join();
|
|
71
|
+
}
|
|
72
|
+
return writer;
|
|
73
|
+
},
|
|
74
|
+
decode(input, length) {
|
|
75
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
76
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
77
|
+
const message = createBaseRequest();
|
|
78
|
+
while (reader.pos < end) {
|
|
79
|
+
const tag = reader.uint32();
|
|
80
|
+
switch (tag >>> 3) {
|
|
81
|
+
case 1: {
|
|
82
|
+
if (tag !== 10) {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
message.updateCommandMetadata = exports.UpdateCommandMetadataRequest.decode(reader, reader.uint32());
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
reader.skip(tag & 7);
|
|
93
|
+
}
|
|
94
|
+
return message;
|
|
95
|
+
},
|
|
96
|
+
fromJSON(object) {
|
|
97
|
+
return {
|
|
98
|
+
updateCommandMetadata: isSet(object.updateCommandMetadata)
|
|
99
|
+
? exports.UpdateCommandMetadataRequest.fromJSON(object.updateCommandMetadata)
|
|
100
|
+
: undefined,
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
toJSON(message) {
|
|
104
|
+
const obj = {};
|
|
105
|
+
if (message.updateCommandMetadata !== undefined) {
|
|
106
|
+
obj.updateCommandMetadata = exports.UpdateCommandMetadataRequest.toJSON(message.updateCommandMetadata);
|
|
107
|
+
}
|
|
108
|
+
return obj;
|
|
109
|
+
},
|
|
110
|
+
create(base) {
|
|
111
|
+
return exports.Request.fromPartial(base ?? {});
|
|
112
|
+
},
|
|
113
|
+
fromPartial(object) {
|
|
114
|
+
const message = createBaseRequest();
|
|
115
|
+
message.updateCommandMetadata =
|
|
116
|
+
(object.updateCommandMetadata !== undefined && object.updateCommandMetadata !== null)
|
|
117
|
+
? exports.UpdateCommandMetadataRequest.fromPartial(object.updateCommandMetadata)
|
|
118
|
+
: undefined;
|
|
119
|
+
return message;
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
function createBaseResponse() {
|
|
123
|
+
return { updateCommandMetadata: undefined };
|
|
124
|
+
}
|
|
125
|
+
exports.Response = {
|
|
126
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
127
|
+
if (message.updateCommandMetadata !== undefined) {
|
|
128
|
+
common_1.AckResponse.encode(message.updateCommandMetadata, writer.uint32(10).fork()).join();
|
|
129
|
+
}
|
|
130
|
+
return writer;
|
|
131
|
+
},
|
|
132
|
+
decode(input, length) {
|
|
133
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
134
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
135
|
+
const message = createBaseResponse();
|
|
136
|
+
while (reader.pos < end) {
|
|
137
|
+
const tag = reader.uint32();
|
|
138
|
+
switch (tag >>> 3) {
|
|
139
|
+
case 1: {
|
|
140
|
+
if (tag !== 10) {
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
message.updateCommandMetadata = common_1.AckResponse.decode(reader, reader.uint32());
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
reader.skip(tag & 7);
|
|
151
|
+
}
|
|
152
|
+
return message;
|
|
153
|
+
},
|
|
154
|
+
fromJSON(object) {
|
|
155
|
+
return {
|
|
156
|
+
updateCommandMetadata: isSet(object.updateCommandMetadata)
|
|
157
|
+
? common_1.AckResponse.fromJSON(object.updateCommandMetadata)
|
|
158
|
+
: undefined,
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
toJSON(message) {
|
|
162
|
+
const obj = {};
|
|
163
|
+
if (message.updateCommandMetadata !== undefined) {
|
|
164
|
+
obj.updateCommandMetadata = common_1.AckResponse.toJSON(message.updateCommandMetadata);
|
|
165
|
+
}
|
|
166
|
+
return obj;
|
|
167
|
+
},
|
|
168
|
+
create(base) {
|
|
169
|
+
return exports.Response.fromPartial(base ?? {});
|
|
170
|
+
},
|
|
171
|
+
fromPartial(object) {
|
|
172
|
+
const message = createBaseResponse();
|
|
173
|
+
message.updateCommandMetadata =
|
|
174
|
+
(object.updateCommandMetadata !== undefined && object.updateCommandMetadata !== null)
|
|
175
|
+
? common_1.AckResponse.fromPartial(object.updateCommandMetadata)
|
|
176
|
+
: undefined;
|
|
177
|
+
return message;
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
function isSet(value) {
|
|
181
|
+
return value !== null && value !== undefined;
|
|
182
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
import { Request as Request2, Response as
|
|
3
|
-
import { Request as Request3, Response as
|
|
2
|
+
import { Request as Request2, Response as Response10 } from "./application";
|
|
3
|
+
import { Request as Request3, Response as Response11 } from "./clipboard";
|
|
4
|
+
import { Request as Request8, Response as Response16 } from "./command";
|
|
4
5
|
import { ErrorResponse } from "./common";
|
|
5
|
-
import { Request as Request6, Response as
|
|
6
|
-
import { Request as Request5, Response as
|
|
7
|
-
import { Request as Request4, Response as
|
|
8
|
-
import { Request as Request1, Response as
|
|
9
|
-
import { Request as Request7, Response as
|
|
6
|
+
import { Request as Request6, Response as Response14 } from "./file-search";
|
|
7
|
+
import { Request as Request5, Response as Response13 } from "./oauth";
|
|
8
|
+
import { Request as Request4, Response as Response12 } from "./storage";
|
|
9
|
+
import { Request as Request1, Response as Response9 } from "./ui";
|
|
10
|
+
import { Request as Request7, Response as Response15 } from "./wm";
|
|
10
11
|
export declare const protobufPackage = "proto.ext.extension";
|
|
11
12
|
export interface Request {
|
|
12
13
|
requestId: string;
|
|
@@ -20,6 +21,7 @@ export interface RequestData {
|
|
|
20
21
|
oauth?: Request5 | undefined;
|
|
21
22
|
fileSearch?: Request6 | undefined;
|
|
22
23
|
wm?: Request7 | undefined;
|
|
24
|
+
command?: Request8 | undefined;
|
|
23
25
|
}
|
|
24
26
|
export interface Response {
|
|
25
27
|
requestId: string;
|
|
@@ -27,13 +29,14 @@ export interface Response {
|
|
|
27
29
|
error?: ErrorResponse | undefined;
|
|
28
30
|
}
|
|
29
31
|
export interface ResponseData {
|
|
30
|
-
ui?:
|
|
31
|
-
app?:
|
|
32
|
-
clipboard?:
|
|
33
|
-
storage?:
|
|
34
|
-
oauth?:
|
|
35
|
-
fileSearch?:
|
|
36
|
-
wm?:
|
|
32
|
+
ui?: Response9 | undefined;
|
|
33
|
+
app?: Response10 | undefined;
|
|
34
|
+
clipboard?: Response11 | undefined;
|
|
35
|
+
storage?: Response12 | undefined;
|
|
36
|
+
oauth?: Response13 | undefined;
|
|
37
|
+
fileSearch?: Response14 | undefined;
|
|
38
|
+
wm?: Response15 | undefined;
|
|
39
|
+
command?: Response16 | undefined;
|
|
37
40
|
}
|
|
38
41
|
export interface Event {
|
|
39
42
|
id: string;
|
|
@@ -10,6 +10,7 @@ exports.GenericEventData = exports.CrashEventData = exports.Event = exports.Resp
|
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const application_1 = require("./application");
|
|
12
12
|
const clipboard_1 = require("./clipboard");
|
|
13
|
+
const command_1 = require("./command");
|
|
13
14
|
const common_1 = require("./common");
|
|
14
15
|
const file_search_1 = require("./file-search");
|
|
15
16
|
const oauth_1 = require("./oauth");
|
|
@@ -96,6 +97,7 @@ function createBaseRequestData() {
|
|
|
96
97
|
oauth: undefined,
|
|
97
98
|
fileSearch: undefined,
|
|
98
99
|
wm: undefined,
|
|
100
|
+
command: undefined,
|
|
99
101
|
};
|
|
100
102
|
}
|
|
101
103
|
exports.RequestData = {
|
|
@@ -121,6 +123,9 @@ exports.RequestData = {
|
|
|
121
123
|
if (message.wm !== undefined) {
|
|
122
124
|
wm_1.Request.encode(message.wm, writer.uint32(58).fork()).join();
|
|
123
125
|
}
|
|
126
|
+
if (message.command !== undefined) {
|
|
127
|
+
command_1.Request.encode(message.command, writer.uint32(66).fork()).join();
|
|
128
|
+
}
|
|
124
129
|
return writer;
|
|
125
130
|
},
|
|
126
131
|
decode(input, length) {
|
|
@@ -179,6 +184,13 @@ exports.RequestData = {
|
|
|
179
184
|
message.wm = wm_1.Request.decode(reader, reader.uint32());
|
|
180
185
|
continue;
|
|
181
186
|
}
|
|
187
|
+
case 8: {
|
|
188
|
+
if (tag !== 66) {
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
message.command = command_1.Request.decode(reader, reader.uint32());
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
182
194
|
}
|
|
183
195
|
if ((tag & 7) === 4 || tag === 0) {
|
|
184
196
|
break;
|
|
@@ -196,6 +208,7 @@ exports.RequestData = {
|
|
|
196
208
|
oauth: isSet(object.oauth) ? oauth_1.Request.fromJSON(object.oauth) : undefined,
|
|
197
209
|
fileSearch: isSet(object.fileSearch) ? file_search_1.Request.fromJSON(object.fileSearch) : undefined,
|
|
198
210
|
wm: isSet(object.wm) ? wm_1.Request.fromJSON(object.wm) : undefined,
|
|
211
|
+
command: isSet(object.command) ? command_1.Request.fromJSON(object.command) : undefined,
|
|
199
212
|
};
|
|
200
213
|
},
|
|
201
214
|
toJSON(message) {
|
|
@@ -221,6 +234,9 @@ exports.RequestData = {
|
|
|
221
234
|
if (message.wm !== undefined) {
|
|
222
235
|
obj.wm = wm_1.Request.toJSON(message.wm);
|
|
223
236
|
}
|
|
237
|
+
if (message.command !== undefined) {
|
|
238
|
+
obj.command = command_1.Request.toJSON(message.command);
|
|
239
|
+
}
|
|
224
240
|
return obj;
|
|
225
241
|
},
|
|
226
242
|
create(base) {
|
|
@@ -243,6 +259,9 @@ exports.RequestData = {
|
|
|
243
259
|
? file_search_1.Request.fromPartial(object.fileSearch)
|
|
244
260
|
: undefined;
|
|
245
261
|
message.wm = (object.wm !== undefined && object.wm !== null) ? wm_1.Request.fromPartial(object.wm) : undefined;
|
|
262
|
+
message.command = (object.command !== undefined && object.command !== null)
|
|
263
|
+
? command_1.Request.fromPartial(object.command)
|
|
264
|
+
: undefined;
|
|
246
265
|
return message;
|
|
247
266
|
},
|
|
248
267
|
};
|
|
@@ -342,6 +361,7 @@ function createBaseResponseData() {
|
|
|
342
361
|
oauth: undefined,
|
|
343
362
|
fileSearch: undefined,
|
|
344
363
|
wm: undefined,
|
|
364
|
+
command: undefined,
|
|
345
365
|
};
|
|
346
366
|
}
|
|
347
367
|
exports.ResponseData = {
|
|
@@ -367,6 +387,9 @@ exports.ResponseData = {
|
|
|
367
387
|
if (message.wm !== undefined) {
|
|
368
388
|
wm_1.Response.encode(message.wm, writer.uint32(58).fork()).join();
|
|
369
389
|
}
|
|
390
|
+
if (message.command !== undefined) {
|
|
391
|
+
command_1.Response.encode(message.command, writer.uint32(66).fork()).join();
|
|
392
|
+
}
|
|
370
393
|
return writer;
|
|
371
394
|
},
|
|
372
395
|
decode(input, length) {
|
|
@@ -425,6 +448,13 @@ exports.ResponseData = {
|
|
|
425
448
|
message.wm = wm_1.Response.decode(reader, reader.uint32());
|
|
426
449
|
continue;
|
|
427
450
|
}
|
|
451
|
+
case 8: {
|
|
452
|
+
if (tag !== 66) {
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
message.command = command_1.Response.decode(reader, reader.uint32());
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
428
458
|
}
|
|
429
459
|
if ((tag & 7) === 4 || tag === 0) {
|
|
430
460
|
break;
|
|
@@ -442,6 +472,7 @@ exports.ResponseData = {
|
|
|
442
472
|
oauth: isSet(object.oauth) ? oauth_1.Response.fromJSON(object.oauth) : undefined,
|
|
443
473
|
fileSearch: isSet(object.fileSearch) ? file_search_1.Response.fromJSON(object.fileSearch) : undefined,
|
|
444
474
|
wm: isSet(object.wm) ? wm_1.Response.fromJSON(object.wm) : undefined,
|
|
475
|
+
command: isSet(object.command) ? command_1.Response.fromJSON(object.command) : undefined,
|
|
445
476
|
};
|
|
446
477
|
},
|
|
447
478
|
toJSON(message) {
|
|
@@ -467,6 +498,9 @@ exports.ResponseData = {
|
|
|
467
498
|
if (message.wm !== undefined) {
|
|
468
499
|
obj.wm = wm_1.Response.toJSON(message.wm);
|
|
469
500
|
}
|
|
501
|
+
if (message.command !== undefined) {
|
|
502
|
+
obj.command = command_1.Response.toJSON(message.command);
|
|
503
|
+
}
|
|
470
504
|
return obj;
|
|
471
505
|
},
|
|
472
506
|
create(base) {
|
|
@@ -489,6 +523,9 @@ exports.ResponseData = {
|
|
|
489
523
|
? file_search_1.Response.fromPartial(object.fileSearch)
|
|
490
524
|
: undefined;
|
|
491
525
|
message.wm = (object.wm !== undefined && object.wm !== null) ? wm_1.Response.fromPartial(object.wm) : undefined;
|
|
526
|
+
message.command = (object.command !== undefined && object.command !== null)
|
|
527
|
+
? command_1.Response.fromPartial(object.command)
|
|
528
|
+
: undefined;
|
|
492
529
|
return message;
|
|
493
530
|
},
|
|
494
531
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class Lint extends Command {
|
|
3
|
+
static args: {};
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
src: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const logger_js_1 = require("../../utils/logger.js");
|
|
10
|
+
const manifest_js_1 = __importDefault(require("../../schemas/manifest.js"));
|
|
11
|
+
class Lint extends core_1.Command {
|
|
12
|
+
static args = {};
|
|
13
|
+
static description = "Validate the extension manifest (package.json)";
|
|
14
|
+
static examples = [
|
|
15
|
+
`<%= config.bin %> <%= command.id %>`,
|
|
16
|
+
`<%= config.bin %> <%= command.id %> --src /path/to/extension`,
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
src: core_1.Flags.string({
|
|
20
|
+
aliases: ["src"],
|
|
21
|
+
char: "s",
|
|
22
|
+
default: process.cwd(),
|
|
23
|
+
defaultHelp: "The current working directory",
|
|
24
|
+
description: "Path to the extension source directory",
|
|
25
|
+
required: false,
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
const { flags } = await this.parse(Lint);
|
|
30
|
+
const logger = new logger_js_1.Logger();
|
|
31
|
+
const src = flags.src ?? process.cwd();
|
|
32
|
+
const pkgPath = (0, node_path_1.join)(src, "package.json");
|
|
33
|
+
if (!(0, node_fs_1.existsSync)(pkgPath)) {
|
|
34
|
+
logger.logError(`No package.json found at ${pkgPath}. Does this location point to a valid extension repository?`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
const json = JSON.parse((0, node_fs_1.readFileSync)(pkgPath, "utf8"));
|
|
38
|
+
const result = manifest_js_1.default.safeParse(json);
|
|
39
|
+
if (result.error) {
|
|
40
|
+
logger.logError(`${pkgPath} is not a valid extension manifest: ${result.error}`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
logger.logReady(`Manifest is valid`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = Lint;
|
|
@@ -64,11 +64,27 @@ declare const _default: z.ZodObject<{
|
|
|
64
64
|
keywords: z.ZodOptional<z.ZodAny>;
|
|
65
65
|
description: z.ZodString;
|
|
66
66
|
preferences: z.ZodOptional<z.ZodAny>;
|
|
67
|
-
categories: z.ZodOptional<z.ZodArray<z.
|
|
67
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
68
|
+
Web: "Web";
|
|
69
|
+
Applications: "Applications";
|
|
70
|
+
Communication: "Communication";
|
|
71
|
+
Data: "Data";
|
|
72
|
+
Documentation: "Documentation";
|
|
73
|
+
"Design Tools": "Design Tools";
|
|
74
|
+
"Developer Tools": "Developer Tools";
|
|
75
|
+
Finance: "Finance";
|
|
76
|
+
Fun: "Fun";
|
|
77
|
+
Media: "Media";
|
|
78
|
+
News: "News";
|
|
79
|
+
Productivity: "Productivity";
|
|
80
|
+
Security: "Security";
|
|
81
|
+
System: "System";
|
|
82
|
+
Other: "Other";
|
|
83
|
+
}>>>;
|
|
68
84
|
contributors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
85
|
pastContributors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
86
|
dependencies: z.ZodObject<{
|
|
71
|
-
"@
|
|
87
|
+
"@vicinae/api": z.ZodOptional<z.ZodString>;
|
|
72
88
|
}, z.core.$strip>;
|
|
73
89
|
external: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
74
90
|
}, z.core.$strip>;
|
package/dist/schemas/manifest.js
CHANGED
|
@@ -194,7 +194,23 @@ exports.default = zod_1.z.object({
|
|
|
194
194
|
.any()
|
|
195
195
|
.describe("Extensions can contribute preferences that are shown in Vicinae Preferences > Extensions. You can use preferences for configuration values and passwords or personal access tokens.")
|
|
196
196
|
.optional(),
|
|
197
|
-
categories: zod_1.z.array(zod_1.z.
|
|
197
|
+
categories: zod_1.z.array(zod_1.z.enum([
|
|
198
|
+
"Applications",
|
|
199
|
+
"Communication",
|
|
200
|
+
"Data",
|
|
201
|
+
"Documentation",
|
|
202
|
+
"Design Tools",
|
|
203
|
+
"Developer Tools",
|
|
204
|
+
"Finance",
|
|
205
|
+
"Fun",
|
|
206
|
+
"Media",
|
|
207
|
+
"News",
|
|
208
|
+
"Productivity",
|
|
209
|
+
"Security",
|
|
210
|
+
"System",
|
|
211
|
+
"Web",
|
|
212
|
+
"Other"
|
|
213
|
+
])).optional(),
|
|
198
214
|
contributors: zod_1.z
|
|
199
215
|
.array(zod_1.z
|
|
200
216
|
.string()
|
|
@@ -215,7 +231,7 @@ exports.default = zod_1.z.object({
|
|
|
215
231
|
.optional(),
|
|
216
232
|
dependencies: zod_1.z
|
|
217
233
|
.object({
|
|
218
|
-
"@
|
|
234
|
+
"@vicinae/api": zod_1.z
|
|
219
235
|
.string()
|
|
220
236
|
.describe("The Vicinae API version used by this extension.")
|
|
221
237
|
.optional(),
|