@skillcdn/console 0.4.1 → 0.4.2
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/README.md +19 -2
- package/SKILLCDN.md +7 -5
- package/dist/api.d.ts +4 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4 -3
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +543 -34
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +34 -3
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +277 -6
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +35 -2
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/plugin-check.d.ts +21 -0
- package/dist/cli/plugin-check.d.ts.map +1 -0
- package/dist/cli/plugin-check.js +374 -0
- package/dist/cli/plugin-check.js.map +1 -0
- package/dist/cli/plugin-cli.d.ts +20 -0
- package/dist/cli/plugin-cli.d.ts.map +1 -0
- package/dist/cli/plugin-cli.js +123 -0
- package/dist/cli/plugin-cli.js.map +1 -0
- package/dist/cli/plugin-init.d.ts +20 -0
- package/dist/cli/plugin-init.d.ts.map +1 -0
- package/dist/cli/plugin-init.js +74 -0
- package/dist/cli/plugin-init.js.map +1 -0
- package/dist/cli/plugin-main.d.ts +3 -0
- package/dist/cli/plugin-main.d.ts.map +1 -0
- package/dist/cli/plugin-main.js +28 -0
- package/dist/cli/plugin-main.js.map +1 -0
- package/dist/client.d.ts +97 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +63 -2
- package/dist/client.js.map +1 -1
- package/dist/compat.d.ts +1 -1
- package/dist/compat.js +2 -2
- package/dist/components/board.d.ts +8 -0
- package/dist/components/board.d.ts.map +1 -1
- package/dist/components/board.js +59 -15
- package/dist/components/board.js.map +1 -1
- package/dist/components/event-feed.d.ts +1 -1
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +33 -1
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/plugin-frame.d.ts +52 -0
- package/dist/components/plugin-frame.d.ts.map +1 -0
- package/dist/components/plugin-frame.js +314 -0
- package/dist/components/plugin-frame.js.map +1 -0
- package/dist/components/plugin-settings.d.ts +38 -0
- package/dist/components/plugin-settings.d.ts.map +1 -0
- package/dist/components/plugin-settings.js +348 -0
- package/dist/components/plugin-settings.js.map +1 -0
- package/dist/components/shell.d.ts +2 -0
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +26 -1
- package/dist/components/shell.js.map +1 -1
- package/dist/components/workspace.d.ts +7 -1
- package/dist/components/workspace.d.ts.map +1 -1
- package/dist/components/workspace.js +1 -1
- package/dist/components/workspace.js.map +1 -1
- package/dist/console.css +327 -0
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +136 -26
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +7 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +19 -2
- package/dist/data.js.map +1 -1
- package/dist/i18n/en.d.ts +149 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +160 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +144 -0
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin/args.d.ts +148 -0
- package/dist/plugin/args.d.ts.map +1 -0
- package/dist/plugin/args.js +369 -0
- package/dist/plugin/args.js.map +1 -0
- package/dist/plugin/bridge.d.ts +146 -0
- package/dist/plugin/bridge.d.ts.map +1 -0
- package/dist/plugin/bridge.js +125 -0
- package/dist/plugin/bridge.js.map +1 -0
- package/dist/plugin/capabilities.d.ts +20 -0
- package/dist/plugin/capabilities.d.ts.map +1 -0
- package/dist/plugin/capabilities.js +133 -0
- package/dist/plugin/capabilities.js.map +1 -0
- package/dist/plugin/context.d.ts +374 -0
- package/dist/plugin/context.d.ts.map +1 -0
- package/dist/plugin/context.js +2 -0
- package/dist/plugin/context.js.map +1 -0
- package/dist/plugin/define.d.ts +208 -0
- package/dist/plugin/define.d.ts.map +1 -0
- package/dist/plugin/define.js +482 -0
- package/dist/plugin/define.js.map +1 -0
- package/dist/plugin/definition-error.d.ts +11 -0
- package/dist/plugin/definition-error.d.ts.map +1 -0
- package/dist/plugin/definition-error.js +17 -0
- package/dist/plugin/definition-error.js.map +1 -0
- package/dist/plugin/limits.d.ts +67 -0
- package/dist/plugin/limits.d.ts.map +1 -0
- package/dist/plugin/limits.js +70 -0
- package/dist/plugin/limits.js.map +1 -0
- package/dist/plugin/load-worker.d.ts +7 -0
- package/dist/plugin/load-worker.d.ts.map +1 -0
- package/dist/plugin/load-worker.js +41 -0
- package/dist/plugin/load-worker.js.map +1 -0
- package/dist/plugin/load.d.ts +18 -0
- package/dist/plugin/load.d.ts.map +1 -0
- package/dist/plugin/load.js +62 -0
- package/dist/plugin/load.js.map +1 -0
- package/dist/plugin/manifest.d.ts +237 -0
- package/dist/plugin/manifest.d.ts.map +1 -0
- package/dist/plugin/manifest.js +411 -0
- package/dist/plugin/manifest.js.map +1 -0
- package/dist/plugin/refusals.d.ts +49 -0
- package/dist/plugin/refusals.d.ts.map +1 -0
- package/dist/plugin/refusals.js +79 -0
- package/dist/plugin/refusals.js.map +1 -0
- package/dist/plugin/rest-schemas.d.ts +556 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -0
- package/dist/plugin/rest-schemas.js +262 -0
- package/dist/plugin/rest-schemas.js.map +1 -0
- package/dist/plugin/sandbox.d.ts +23 -0
- package/dist/plugin/sandbox.d.ts.map +1 -0
- package/dist/plugin/sandbox.js +99 -0
- package/dist/plugin/sandbox.js.map +1 -0
- package/dist/plugin/testing.d.ts +45 -0
- package/dist/plugin/testing.d.ts.map +1 -0
- package/dist/plugin/testing.js +420 -0
- package/dist/plugin/testing.js.map +1 -0
- package/dist/plugin/web-react.d.ts +11 -0
- package/dist/plugin/web-react.d.ts.map +1 -0
- package/dist/plugin/web-react.js +34 -0
- package/dist/plugin/web-react.js.map +1 -0
- package/dist/plugin/web.d.ts +95 -0
- package/dist/plugin/web.d.ts.map +1 -0
- package/dist/plugin/web.js +245 -0
- package/dist/plugin/web.js.map +1 -0
- package/dist/plugin-nav.d.ts +29 -0
- package/dist/plugin-nav.d.ts.map +1 -0
- package/dist/plugin-nav.js +92 -0
- package/dist/plugin-nav.js.map +1 -0
- package/dist/plugin-testing.d.ts +2 -0
- package/dist/plugin-testing.d.ts.map +1 -0
- package/dist/plugin-testing.js +4 -0
- package/dist/plugin-testing.js.map +1 -0
- package/dist/plugin-web-react.d.ts +3 -0
- package/dist/plugin-web-react.d.ts.map +1 -0
- package/dist/plugin-web-react.js +3 -0
- package/dist/plugin-web-react.js.map +1 -0
- package/dist/plugin-web.d.ts +4 -0
- package/dist/plugin-web.d.ts.map +1 -0
- package/dist/plugin-web.js +5 -0
- package/dist/plugin-web.js.map +1 -0
- package/dist/plugin.d.ts +11 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +15 -0
- package/dist/plugin.js.map +1 -0
- package/dist/router.d.ts +28 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +47 -0
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +4 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +6 -0
- package/dist/routes.js.map +1 -1
- package/dist/schemas.d.ts +117 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +40 -1
- package/dist/schemas.js.map +1 -1
- package/dist/tokens.d.ts +2 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +101 -0
- package/dist/tokens.js.map +1 -0
- package/dist/vocabulary.d.ts +11 -1
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +24 -0
- package/dist/vocabulary.js.map +1 -1
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +2 -0
- package/dist/web.js.map +1 -1
- package/docs/specs/cli.md +11 -4
- package/docs/specs/plugins.md +487 -0
- package/docs/specs/rest.md +3 -2
- package/package.json +20 -2
- package/skills/building-a-console/SKILL.md +25 -26
- package/skills/building-a-console/references/configuring.md +40 -0
- package/skills/building-a-console/references/the-default-console.md +1 -1
- package/skills/building-a-console/references/the-look-from-a-website.md +5 -5
- package/skills/building-a-plugin/SKILL.md +137 -0
- package/skills/deploying-a-console/SKILL.md +24 -26
- package/skills/deploying-a-console/references/access.md +13 -9
- package/skills/deploying-a-console/references/resources.md +25 -10
- package/skills/deploying-a-console/references/running-it-again.md +15 -0
- package/skills/deploying-a-console/references/sizing.md +2 -0
- package/skills/planning-the-board/SKILL.md +96 -0
- package/skills/planning-the-board/references/a-task.md +36 -0
- package/skills/planning-the-board/references/setting-up.md +44 -0
- package/skills/working-the-board/SKILL.md +43 -34
- package/skills/working-the-board/references/the-pack.md +19 -0
- package/src/api.ts +8 -0
- package/src/cli/cli.ts +697 -33
- package/src/cli/format.ts +356 -9
- package/src/cli/help.ts +41 -2
- package/src/cli/plugin-check.ts +470 -0
- package/src/cli/plugin-cli.ts +148 -0
- package/src/cli/plugin-init.ts +90 -0
- package/src/cli/plugin-main.ts +30 -0
- package/src/client.ts +294 -0
- package/src/compat.ts +2 -2
- package/src/components/board.tsx +62 -14
- package/src/components/event-feed.tsx +42 -1
- package/src/components/plugin-frame.tsx +437 -0
- package/src/components/plugin-settings.tsx +1111 -0
- package/src/components/shell.tsx +82 -14
- package/src/components/workspace.tsx +18 -0
- package/src/console.tsx +286 -19
- package/src/data.ts +27 -2
- package/src/i18n/en.ts +168 -0
- package/src/i18n/ko.ts +148 -0
- package/src/index.ts +12 -0
- package/src/plugin/args.ts +526 -0
- package/src/plugin/bridge.ts +314 -0
- package/src/plugin/capabilities.ts +150 -0
- package/src/plugin/context.ts +416 -0
- package/src/plugin/define.ts +792 -0
- package/src/plugin/definition-error.ts +19 -0
- package/src/plugin/limits.ts +70 -0
- package/src/plugin/load-worker.ts +50 -0
- package/src/plugin/load.ts +82 -0
- package/src/plugin/manifest.ts +561 -0
- package/src/plugin/refusals.ts +94 -0
- package/src/plugin/rest-schemas.ts +354 -0
- package/src/plugin/sandbox.ts +123 -0
- package/src/plugin/testing.ts +612 -0
- package/src/plugin/web-react.ts +45 -0
- package/src/plugin/web.ts +403 -0
- package/src/plugin-nav.ts +132 -0
- package/src/plugin-testing.ts +10 -0
- package/src/plugin-web-react.ts +4 -0
- package/src/plugin-web.ts +35 -0
- package/src/plugin.ts +126 -0
- package/src/router.ts +73 -0
- package/src/routes.ts +7 -0
- package/src/schemas.ts +43 -0
- package/src/styles/console.css +327 -0
- package/src/tokens.ts +101 -0
- package/src/vocabulary.ts +30 -0
- package/src/web.ts +2 -0
- package/template/plugin/.gitignore +2 -0
- package/template/plugin/README.md +26 -0
- package/template/plugin/SKILLCDN.md +13 -0
- package/template/plugin/build.mjs +40 -0
- package/template/plugin/console-plugin.json +50 -0
- package/template/plugin/package.json +27 -0
- package/template/plugin/skills/__key__/SKILL.md +23 -0
- package/template/plugin/src/check.test.ts +34 -0
- package/template/plugin/src/server/index.test.ts +41 -0
- package/template/plugin/src/server/index.ts +72 -0
- package/template/plugin/src/web/index.css +51 -0
- package/template/plugin/src/web/index.ts +115 -0
- package/template/plugin/tsconfig.json +17 -0
- package/skills/working-the-board/references/setting-up.md +0 -3
- /package/skills/{working-the-board → planning-the-board}/references/project-rules.md +0 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import type { TaskFilter } from "../client.js";
|
|
2
|
+
import type { RestComment, RestDecision, RestDocument, RestDocumentSummary, RestMember, RestPerson, RestProject, RestRun, RestTask, RestTaskInput, RestTaskPatch } from "../schemas.js";
|
|
3
|
+
import type { PluginFileHandle } from "./args.js";
|
|
4
|
+
/** A schema as the Standard Schema interface spells one: what every build of zod implements, so that a plugin's own copy validates its records. */
|
|
5
|
+
export interface RecordSchema<T = unknown> {
|
|
6
|
+
readonly "~standard": {
|
|
7
|
+
readonly version: 1;
|
|
8
|
+
readonly vendor: string;
|
|
9
|
+
readonly validate: (value: unknown) => RecordSchemaResult<T> | Promise<RecordSchemaResult<T>>;
|
|
10
|
+
readonly types?: {
|
|
11
|
+
readonly input: unknown;
|
|
12
|
+
readonly output: T;
|
|
13
|
+
} | undefined;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export type RecordSchemaResult<T> = {
|
|
17
|
+
readonly value: T;
|
|
18
|
+
readonly issues?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
readonly issues: readonly {
|
|
21
|
+
readonly message: string;
|
|
22
|
+
readonly path?: readonly (PropertyKey | {
|
|
23
|
+
readonly key: PropertyKey;
|
|
24
|
+
})[] | undefined;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
/** The data a record of a collection holds, from its schema. */
|
|
28
|
+
export type RecordData<S> = S extends RecordSchema<infer T> ? T : never;
|
|
29
|
+
/** A collection as `defineCollection` yields it: the name, the schema, and what the console indexes and who reads. */
|
|
30
|
+
export interface CollectionDefinition<S extends RecordSchema = RecordSchema> {
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly schema: S;
|
|
33
|
+
readonly indexes: readonly string[];
|
|
34
|
+
readonly search: readonly string[];
|
|
35
|
+
readonly owner: string | null;
|
|
36
|
+
readonly project: "none" | "optional" | "required";
|
|
37
|
+
readonly read: readonly string[];
|
|
38
|
+
readonly readOwn: readonly string[];
|
|
39
|
+
readonly history: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface PluginRecord<T = Record<string, unknown>> {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly collection: string;
|
|
44
|
+
/** The id of the project the record is linked to, or none. */
|
|
45
|
+
readonly project: string | null;
|
|
46
|
+
/** The id of the person the record is about, where the collection has an `owner`. */
|
|
47
|
+
readonly owner: string | null;
|
|
48
|
+
readonly data: T;
|
|
49
|
+
readonly version: number;
|
|
50
|
+
readonly createdAt: string;
|
|
51
|
+
readonly updatedAt: string;
|
|
52
|
+
/** The person who caused the write, or none for the console. */
|
|
53
|
+
readonly createdBy: string | null;
|
|
54
|
+
readonly updatedBy: string | null;
|
|
55
|
+
readonly archivedAt: string | null;
|
|
56
|
+
}
|
|
57
|
+
export interface RecordVersion<T = Record<string, unknown>> {
|
|
58
|
+
readonly version: number;
|
|
59
|
+
readonly data: T;
|
|
60
|
+
readonly at: string;
|
|
61
|
+
readonly by: string | null;
|
|
62
|
+
}
|
|
63
|
+
export type WhereScalar = string | number | boolean | null;
|
|
64
|
+
/** One condition on an indexed field: equal, one of, within bounds, or present at all. */
|
|
65
|
+
export type WhereValue = WhereScalar | {
|
|
66
|
+
readonly in: readonly WhereScalar[];
|
|
67
|
+
} | {
|
|
68
|
+
readonly gte?: WhereScalar;
|
|
69
|
+
readonly gt?: WhereScalar;
|
|
70
|
+
readonly lte?: WhereScalar;
|
|
71
|
+
readonly lt?: WhereScalar;
|
|
72
|
+
} | {
|
|
73
|
+
readonly exists: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type Where = Readonly<Record<string, WhereValue>>;
|
|
76
|
+
export interface RecordOrder {
|
|
77
|
+
readonly field: string;
|
|
78
|
+
readonly descending?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export interface RecordQuery {
|
|
81
|
+
readonly where?: Where;
|
|
82
|
+
readonly order?: RecordOrder;
|
|
83
|
+
/** Up to the list bound; the bound when left out. */
|
|
84
|
+
readonly limit?: number;
|
|
85
|
+
/** The cursor the last page answered with. */
|
|
86
|
+
readonly after?: string;
|
|
87
|
+
/** The key of a project the records are linked to. */
|
|
88
|
+
readonly project?: string;
|
|
89
|
+
/** Archived records too; left out, they are not listed. */
|
|
90
|
+
readonly archived?: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface RecordPage<T> {
|
|
93
|
+
readonly items: readonly PluginRecord<T>[];
|
|
94
|
+
/** The cursor for the next page, or none when this was the last. */
|
|
95
|
+
readonly after: string | null;
|
|
96
|
+
}
|
|
97
|
+
export interface RecordAggregation {
|
|
98
|
+
readonly where?: Where;
|
|
99
|
+
/** Up to two indexed fields. */
|
|
100
|
+
readonly groupBy?: readonly string[];
|
|
101
|
+
readonly count?: boolean;
|
|
102
|
+
readonly sum?: readonly string[];
|
|
103
|
+
readonly min?: readonly string[];
|
|
104
|
+
readonly max?: readonly string[];
|
|
105
|
+
}
|
|
106
|
+
export interface RecordAggregate {
|
|
107
|
+
readonly group: Readonly<Record<string, WhereScalar>>;
|
|
108
|
+
readonly count?: number;
|
|
109
|
+
readonly sum?: Readonly<Record<string, number>>;
|
|
110
|
+
readonly min?: Readonly<Record<string, WhereScalar>>;
|
|
111
|
+
readonly max?: Readonly<Record<string, WhereScalar>>;
|
|
112
|
+
}
|
|
113
|
+
/** What a record may be linked to: an item of the board, a project, or a record of any plugin. */
|
|
114
|
+
export type LinkTarget = {
|
|
115
|
+
readonly kind: "task" | "decision" | "document" | "run" | "project";
|
|
116
|
+
readonly id: string;
|
|
117
|
+
} | {
|
|
118
|
+
readonly kind: "record";
|
|
119
|
+
readonly plugin?: string;
|
|
120
|
+
readonly collection: string;
|
|
121
|
+
readonly id: string;
|
|
122
|
+
};
|
|
123
|
+
export interface RecordFile {
|
|
124
|
+
readonly id: string;
|
|
125
|
+
readonly name: string;
|
|
126
|
+
readonly type: string;
|
|
127
|
+
readonly bytes: number;
|
|
128
|
+
readonly sha256: string;
|
|
129
|
+
readonly createdAt: string;
|
|
130
|
+
}
|
|
131
|
+
export interface RecordFiles {
|
|
132
|
+
/** A handle a command received or a page uploaded, kept on the record; `files` capability. */
|
|
133
|
+
attach(handle: PluginFileHandle | string, options?: {
|
|
134
|
+
readonly name?: string;
|
|
135
|
+
readonly type?: string;
|
|
136
|
+
}): Promise<RecordFile>;
|
|
137
|
+
list(): Promise<readonly RecordFile[]>;
|
|
138
|
+
remove(fileId: string): Promise<void>;
|
|
139
|
+
}
|
|
140
|
+
/** A plugin's records of one collection. */
|
|
141
|
+
export interface PluginRecords<T = Record<string, unknown>> {
|
|
142
|
+
create(data: T, options?: {
|
|
143
|
+
readonly project?: string;
|
|
144
|
+
readonly owner?: string;
|
|
145
|
+
}): Promise<PluginRecord<T>>;
|
|
146
|
+
/** The record, or none when there is no such record in this collection. */
|
|
147
|
+
get(id: string): Promise<PluginRecord<T> | null>;
|
|
148
|
+
/** The fields given replace those of the record; `baseVersion` refuses with `plugin.conflict` when the record moved on. */
|
|
149
|
+
update(id: string, patch: Partial<T>, options?: {
|
|
150
|
+
readonly baseVersion?: number;
|
|
151
|
+
}): Promise<PluginRecord<T>>;
|
|
152
|
+
archive(id: string): Promise<void>;
|
|
153
|
+
restore(id: string): Promise<void>;
|
|
154
|
+
list(query?: RecordQuery): Promise<RecordPage<T>>;
|
|
155
|
+
search(words: string, options?: Pick<RecordQuery, "where" | "limit" | "project">): Promise<RecordPage<T>>;
|
|
156
|
+
aggregate(aggregation: RecordAggregation): Promise<readonly RecordAggregate[]>;
|
|
157
|
+
versions(id: string): Promise<readonly RecordVersion<T>[]>;
|
|
158
|
+
link(id: string, target: LinkTarget): Promise<void>;
|
|
159
|
+
unlink(id: string, target: LinkTarget): Promise<void>;
|
|
160
|
+
links(id: string): Promise<readonly LinkTarget[]>;
|
|
161
|
+
files(id: string): RecordFiles;
|
|
162
|
+
}
|
|
163
|
+
export interface PluginInfo {
|
|
164
|
+
readonly key: string;
|
|
165
|
+
readonly version: string;
|
|
166
|
+
readonly dataVersion: number;
|
|
167
|
+
/** The settings as the administrator set them, by key, without the secrets. */
|
|
168
|
+
readonly settings: Readonly<Record<string, unknown>>;
|
|
169
|
+
/** The board project, or none. */
|
|
170
|
+
readonly board: {
|
|
171
|
+
readonly id: string;
|
|
172
|
+
readonly key: string;
|
|
173
|
+
} | null;
|
|
174
|
+
/** The projects the plugin is on: all, or their keys. */
|
|
175
|
+
readonly projects: "all" | readonly string[];
|
|
176
|
+
}
|
|
177
|
+
export interface CallerPerson {
|
|
178
|
+
readonly id: string;
|
|
179
|
+
readonly login: string;
|
|
180
|
+
readonly name: string | null;
|
|
181
|
+
readonly language: string;
|
|
182
|
+
readonly admin: boolean;
|
|
183
|
+
}
|
|
184
|
+
export interface CallerProject {
|
|
185
|
+
readonly id: string;
|
|
186
|
+
readonly key: string;
|
|
187
|
+
readonly name: string;
|
|
188
|
+
}
|
|
189
|
+
/** Who a command, a query or a person's endpoint acts as, and with which roles in this plugin. */
|
|
190
|
+
export interface PersonCaller {
|
|
191
|
+
readonly kind: "person";
|
|
192
|
+
readonly person: CallerPerson;
|
|
193
|
+
/** The agent's name where a token acts, or none for a person on the pages. */
|
|
194
|
+
readonly agent: string | null;
|
|
195
|
+
readonly roles: readonly string[];
|
|
196
|
+
/** The caller's open run in the board project, if any. */
|
|
197
|
+
readonly run: {
|
|
198
|
+
readonly id: string;
|
|
199
|
+
readonly taskNumber: number | null;
|
|
200
|
+
} | null;
|
|
201
|
+
/** The project the call is on, if any. */
|
|
202
|
+
readonly project: CallerProject | null;
|
|
203
|
+
}
|
|
204
|
+
/** The console itself: a job, a hook, an upgrade or a webhook, with every role. */
|
|
205
|
+
export interface ConsoleCaller {
|
|
206
|
+
readonly kind: "console";
|
|
207
|
+
readonly roles: readonly string[];
|
|
208
|
+
readonly project: CallerProject | null;
|
|
209
|
+
}
|
|
210
|
+
export type PluginCaller = PersonCaller | ConsoleCaller;
|
|
211
|
+
export interface PluginWorkspace {
|
|
212
|
+
readonly name: string;
|
|
213
|
+
readonly languages: readonly string[];
|
|
214
|
+
readonly timeZone: string;
|
|
215
|
+
readonly categories: readonly {
|
|
216
|
+
readonly key: string;
|
|
217
|
+
readonly name: string;
|
|
218
|
+
readonly color: string;
|
|
219
|
+
}[];
|
|
220
|
+
}
|
|
221
|
+
export interface DecisionAsk {
|
|
222
|
+
readonly question: string;
|
|
223
|
+
readonly body?: string;
|
|
224
|
+
readonly options: readonly {
|
|
225
|
+
readonly label: string;
|
|
226
|
+
}[];
|
|
227
|
+
/** Who is to answer: a person who may work in the project; the project's owners when left out. */
|
|
228
|
+
readonly deciderId?: string;
|
|
229
|
+
readonly taskId?: string;
|
|
230
|
+
/** The record the decision is for, by which the plugin maps the answer back. */
|
|
231
|
+
readonly about: {
|
|
232
|
+
readonly collection: string;
|
|
233
|
+
readonly id: string;
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/** The console's board, as a plugin reaches it with the `board:*` capabilities, each read the caller's own. */
|
|
237
|
+
export interface PluginConsole {
|
|
238
|
+
workspace(): Promise<PluginWorkspace>;
|
|
239
|
+
people: {
|
|
240
|
+
list(options?: {
|
|
241
|
+
readonly q?: string;
|
|
242
|
+
}): Promise<readonly RestPerson[]>;
|
|
243
|
+
get(id: string): Promise<RestPerson | null>;
|
|
244
|
+
};
|
|
245
|
+
projects: {
|
|
246
|
+
list(): Promise<readonly RestProject[]>;
|
|
247
|
+
get(key: string): Promise<RestProject | null>;
|
|
248
|
+
members(key: string): Promise<readonly RestMember[]>;
|
|
249
|
+
};
|
|
250
|
+
tasks: {
|
|
251
|
+
list(project: string, filter?: TaskFilter): Promise<readonly RestTask[]>;
|
|
252
|
+
get(project: string, number: number): Promise<RestTask | null>;
|
|
253
|
+
create(project: string, task: RestTaskInput): Promise<RestTask>;
|
|
254
|
+
update(project: string, number: number, patch: RestTaskPatch): Promise<RestTask>;
|
|
255
|
+
comment(project: string, number: number, body: string): Promise<RestComment>;
|
|
256
|
+
};
|
|
257
|
+
decisions: {
|
|
258
|
+
list(project: string): Promise<readonly RestDecision[]>;
|
|
259
|
+
get(id: string): Promise<RestDecision | null>;
|
|
260
|
+
ask(project: string, decision: DecisionAsk): Promise<RestDecision>;
|
|
261
|
+
};
|
|
262
|
+
documents: {
|
|
263
|
+
list(project: string, folder?: string): Promise<readonly RestDocumentSummary[]>;
|
|
264
|
+
read(project: string, path: string): Promise<RestDocument | null>;
|
|
265
|
+
/** Under `plugins/<key>/`; anywhere else is `plugin.forbidden`. */
|
|
266
|
+
write(project: string, path: string, document: {
|
|
267
|
+
readonly title: string;
|
|
268
|
+
readonly body: string;
|
|
269
|
+
readonly baseVersion?: number;
|
|
270
|
+
}): Promise<RestDocument>;
|
|
271
|
+
};
|
|
272
|
+
runs: {
|
|
273
|
+
list(project: string): Promise<readonly RestRun[]>;
|
|
274
|
+
get(id: string): Promise<RestRun | null>;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
export interface PluginSqlResult<Row> {
|
|
278
|
+
readonly rows: readonly Row[];
|
|
279
|
+
readonly rowCount: number;
|
|
280
|
+
}
|
|
281
|
+
export interface PluginSqlClient {
|
|
282
|
+
query<Row = Record<string, unknown>>(text: string, params?: readonly unknown[]): Promise<PluginSqlResult<Row>>;
|
|
283
|
+
}
|
|
284
|
+
/** SQL on the plugin's own schema and role, with `storage:sql`. */
|
|
285
|
+
export interface PluginSql extends PluginSqlClient {
|
|
286
|
+
transaction<T>(work: (tx: PluginSqlClient) => Promise<T>): Promise<T>;
|
|
287
|
+
}
|
|
288
|
+
/** Where the console puts a secret into an outbound request. */
|
|
289
|
+
export type SecretPlacement = `header:${string}` | `query:${string}` | "basic";
|
|
290
|
+
export interface PluginFetchInit {
|
|
291
|
+
readonly method?: string;
|
|
292
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
293
|
+
readonly body?: string | Uint8Array;
|
|
294
|
+
/** A secret setting, put where `as` says: a header, a query parameter, or as basic authentication (`user:password`). */
|
|
295
|
+
readonly secret?: {
|
|
296
|
+
readonly name: string;
|
|
297
|
+
readonly as: SecretPlacement;
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
/** An outbound answer, whole: the host reads it to the bound before handing it over. */
|
|
301
|
+
export interface PluginFetchResponse {
|
|
302
|
+
readonly status: number;
|
|
303
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
304
|
+
readonly bytes: Uint8Array;
|
|
305
|
+
text(): string;
|
|
306
|
+
json(): unknown;
|
|
307
|
+
}
|
|
308
|
+
export interface PluginSecrets {
|
|
309
|
+
has(name: string): Promise<boolean>;
|
|
310
|
+
sign(name: string, payload: string | Uint8Array, algorithm: "hmac-sha256"): Promise<string>;
|
|
311
|
+
verify(name: string, payload: string | Uint8Array, signature: string, algorithm: "hmac-sha256"): Promise<boolean>;
|
|
312
|
+
}
|
|
313
|
+
export interface OtherPlugin {
|
|
314
|
+
readonly version: string;
|
|
315
|
+
readonly api: Readonly<Record<string, (input: unknown) => Promise<unknown>>>;
|
|
316
|
+
}
|
|
317
|
+
export interface PluginLog {
|
|
318
|
+
info(message: string, fields?: Readonly<Record<string, unknown>>): void;
|
|
319
|
+
warn(message: string, fields?: Readonly<Record<string, unknown>>): void;
|
|
320
|
+
error(message: string, fields?: Readonly<Record<string, unknown>>): void;
|
|
321
|
+
}
|
|
322
|
+
/** Everything a plugin does to the console: one object, handed to every function the plugin defines. */
|
|
323
|
+
export interface PluginContext {
|
|
324
|
+
readonly plugin: PluginInfo;
|
|
325
|
+
readonly caller: PluginCaller;
|
|
326
|
+
/** The records of a collection, typed by its definition, or by name. */
|
|
327
|
+
records<S extends RecordSchema>(collection: CollectionDefinition<S>): PluginRecords<RecordData<S>>;
|
|
328
|
+
records(collection: string): PluginRecords<Record<string, unknown>>;
|
|
329
|
+
readonly sql: PluginSql;
|
|
330
|
+
readonly console: PluginConsole;
|
|
331
|
+
readonly events: {
|
|
332
|
+
emit(kind: string, data: unknown): Promise<void>;
|
|
333
|
+
};
|
|
334
|
+
fetch(url: string, init?: PluginFetchInit): Promise<PluginFetchResponse>;
|
|
335
|
+
readonly secrets: PluginSecrets;
|
|
336
|
+
readonly plugins: {
|
|
337
|
+
get(key: string): Promise<OtherPlugin>;
|
|
338
|
+
};
|
|
339
|
+
readonly log: PluginLog;
|
|
340
|
+
now(): Date;
|
|
341
|
+
/** The caller's language, `en` for the console. */
|
|
342
|
+
readonly language: string;
|
|
343
|
+
/** Fires when the call's time is up; the thread is ended soon after. */
|
|
344
|
+
readonly signal: AbortSignal;
|
|
345
|
+
}
|
|
346
|
+
/** An event a hook receives: the console's, of the plugin's board projects, or another plugin's. */
|
|
347
|
+
export interface PluginHookEvent {
|
|
348
|
+
readonly source: "console" | "plugin";
|
|
349
|
+
/** `console:<kind>` or `plugin:<key>:<kind>`, as the hook was named. */
|
|
350
|
+
readonly kind: string;
|
|
351
|
+
readonly at: string;
|
|
352
|
+
/** The plugin that emitted or caused it, or none. */
|
|
353
|
+
readonly plugin: string | null;
|
|
354
|
+
readonly project: {
|
|
355
|
+
readonly id: string;
|
|
356
|
+
readonly key: string;
|
|
357
|
+
} | null;
|
|
358
|
+
readonly data: unknown;
|
|
359
|
+
}
|
|
360
|
+
/** What an endpoint receives: the request, bounded, with the headers the definition named. */
|
|
361
|
+
export interface EndpointRequest {
|
|
362
|
+
readonly method: string;
|
|
363
|
+
/** What followed the endpoint's name. */
|
|
364
|
+
readonly path: string;
|
|
365
|
+
readonly query: Readonly<Record<string, string>>;
|
|
366
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
367
|
+
readonly body: string;
|
|
368
|
+
}
|
|
369
|
+
export interface EndpointResponse {
|
|
370
|
+
readonly status: number;
|
|
371
|
+
readonly headers?: Readonly<Partial<Record<"content-type" | "location" | "cache-control", string>>>;
|
|
372
|
+
readonly body?: string | Readonly<Record<string, unknown>> | readonly unknown[];
|
|
373
|
+
}
|
|
374
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/plugin/context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,WAAW,EACX,OAAO,EACP,QAAQ,EACR,aAAa,EACb,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAA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IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CACzB,OAAO,CAAC,MAAM,CAAC,cAAc,GAAG,UAAU,GAAG,eAAe,EAAE,MAAM,CAAC,CAAC,CACvE,CAAC;IACF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,OAAO,EAAE,CAAC;CACjF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/plugin/context.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import type { ArgDefinitions, ArgDescription, ArgsOf } from "./args.js";
|
|
2
|
+
import type { CollectionDefinition, EndpointRequest, EndpointResponse, PluginContext, PluginHookEvent, RecordSchema } from "./context.js";
|
|
3
|
+
/** The milliseconds an ISO 8601 duration such as `P1D`, `PT30M` or `P1W` stands for; nothing for what is not one. */
|
|
4
|
+
export declare function durationMs(iso: string): number | undefined;
|
|
5
|
+
export interface CollectionInput<S extends RecordSchema> {
|
|
6
|
+
/** A zod schema of the record's data, or any schema that follows Standard Schema. Checked on every write. */
|
|
7
|
+
readonly schema: S;
|
|
8
|
+
/** The fields `where` and `order` may name, and `aggregate` groups by; up to eight. */
|
|
9
|
+
readonly indexes?: readonly string[];
|
|
10
|
+
/** The fields searched as words. */
|
|
11
|
+
readonly search?: readonly string[];
|
|
12
|
+
/** The field that holds a person's id, by which `readOwn` roles read their own records. */
|
|
13
|
+
readonly owner?: string;
|
|
14
|
+
/** Whether a record is linked to a project: never, where the caller says, or always. */
|
|
15
|
+
readonly project?: "none" | "optional" | "required";
|
|
16
|
+
/** The roles that read the collection through the console's routes and the bridge. */
|
|
17
|
+
readonly read?: readonly string[];
|
|
18
|
+
/** The roles that read their own records in it. */
|
|
19
|
+
readonly readOwn?: readonly string[];
|
|
20
|
+
/** A version kept per write; on unless said otherwise. */
|
|
21
|
+
readonly history?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** A collection of records the console keeps for the plugin, by name. */
|
|
24
|
+
export declare function defineCollection<S extends RecordSchema>(name: string, input: CollectionInput<S>): CollectionDefinition<S>;
|
|
25
|
+
/** What a command answers: what it prints, what `--json` prints, and the decision the caller waits for, if any. */
|
|
26
|
+
export interface CommandResult {
|
|
27
|
+
readonly text: string;
|
|
28
|
+
readonly data?: unknown;
|
|
29
|
+
readonly waiting?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CommandInput<A extends ArgDefinitions> {
|
|
32
|
+
readonly about: string;
|
|
33
|
+
readonly args?: A;
|
|
34
|
+
/** The roles that may run it, any of them; left out, every member may. */
|
|
35
|
+
readonly roles?: readonly string[];
|
|
36
|
+
run(ctx: PluginContext, args: ArgsOf<A>): Promise<CommandResult>;
|
|
37
|
+
}
|
|
38
|
+
export interface CommandDefinition<A extends ArgDefinitions = ArgDefinitions> {
|
|
39
|
+
readonly kind: "command";
|
|
40
|
+
readonly about: string;
|
|
41
|
+
readonly args: A;
|
|
42
|
+
readonly roles: readonly string[] | null;
|
|
43
|
+
run(ctx: PluginContext, args: ArgsOf<A>): Promise<CommandResult>;
|
|
44
|
+
}
|
|
45
|
+
/** A file a query answers with, in place of JSON. */
|
|
46
|
+
export interface QueryFile {
|
|
47
|
+
readonly file: {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly type: string;
|
|
50
|
+
readonly bytes: Uint8Array;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export declare function isQueryFile(value: unknown): value is QueryFile;
|
|
54
|
+
export interface QueryInput<A extends ArgDefinitions> {
|
|
55
|
+
readonly about: string;
|
|
56
|
+
readonly args?: A;
|
|
57
|
+
readonly roles?: readonly string[];
|
|
58
|
+
/** JSON, or a `QueryFile` for an export. */
|
|
59
|
+
run(ctx: PluginContext, args: ArgsOf<A>): Promise<unknown>;
|
|
60
|
+
}
|
|
61
|
+
export interface QueryDefinition<A extends ArgDefinitions = ArgDefinitions> {
|
|
62
|
+
readonly kind: "query";
|
|
63
|
+
readonly about: string;
|
|
64
|
+
readonly args: A;
|
|
65
|
+
readonly roles: readonly string[] | null;
|
|
66
|
+
run(ctx: PluginContext, args: ArgsOf<A>): Promise<unknown>;
|
|
67
|
+
}
|
|
68
|
+
/** Plugin code that writes, run as the person who asked. */
|
|
69
|
+
export declare function defineCommand<A extends ArgDefinitions = Record<never, never>>(input: CommandInput<A>): CommandDefinition<A>;
|
|
70
|
+
/** Plugin code that reads, run as the person who asked. */
|
|
71
|
+
export declare function defineQuery<A extends ArgDefinitions = Record<never, never>>(input: QueryInput<A>): QueryDefinition<A>;
|
|
72
|
+
export type EndpointAuth = "person" | "webhook";
|
|
73
|
+
export interface EndpointInput {
|
|
74
|
+
/** `person`: a session or a token, with `roles`; `webhook`: nobody, the plugin verifies the signature with `secret`. */
|
|
75
|
+
readonly auth: EndpointAuth;
|
|
76
|
+
readonly roles?: readonly string[];
|
|
77
|
+
/** The `secret` setting a webhook's signature is verified with, through `ctx.secrets.verify`. */
|
|
78
|
+
readonly secret?: string;
|
|
79
|
+
/** The methods accepted; `POST` alone when left out. */
|
|
80
|
+
readonly methods?: readonly string[];
|
|
81
|
+
/** The request headers handed to `run` beside `content-type`, in lowercase. */
|
|
82
|
+
readonly headers?: readonly string[];
|
|
83
|
+
run(ctx: PluginContext, request: EndpointRequest): Promise<EndpointResponse>;
|
|
84
|
+
}
|
|
85
|
+
export interface EndpointDefinition {
|
|
86
|
+
readonly kind: "endpoint";
|
|
87
|
+
readonly auth: EndpointAuth;
|
|
88
|
+
readonly roles: readonly string[] | null;
|
|
89
|
+
readonly secret: string | null;
|
|
90
|
+
readonly methods: readonly string[];
|
|
91
|
+
readonly headers: readonly string[];
|
|
92
|
+
run(ctx: PluginContext, request: EndpointRequest): Promise<EndpointResponse>;
|
|
93
|
+
}
|
|
94
|
+
/** An inbound request the plugin accepts under `/api/v1/plugins/<key>/x/<name>`, with the `endpoints` capability. */
|
|
95
|
+
export declare function defineEndpoint(input: EndpointInput): EndpointDefinition;
|
|
96
|
+
export type HookHandler = (ctx: PluginContext, event: PluginHookEvent) => Promise<void>;
|
|
97
|
+
export interface JobDefinition {
|
|
98
|
+
readonly about: string;
|
|
99
|
+
/** An ISO 8601 duration, five minutes or more. */
|
|
100
|
+
readonly every: string;
|
|
101
|
+
/** A time of day, `HH:MM` in the workspace's time zone, for a daily or longer `every`. */
|
|
102
|
+
readonly at?: string;
|
|
103
|
+
run(ctx: PluginContext): Promise<void>;
|
|
104
|
+
}
|
|
105
|
+
export interface UpgradeDefinition {
|
|
106
|
+
/** The `dataVersion` this upgrade brings the records to. */
|
|
107
|
+
readonly to: number;
|
|
108
|
+
readonly about: string;
|
|
109
|
+
run(ctx: PluginContext): Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
export interface ApiDefinition<S extends RecordSchema = RecordSchema> {
|
|
112
|
+
readonly about: string;
|
|
113
|
+
/** The schema of what a caller sends. */
|
|
114
|
+
readonly input: S;
|
|
115
|
+
run(ctx: PluginContext, input: unknown): Promise<unknown>;
|
|
116
|
+
}
|
|
117
|
+
export type Lifecycle = (ctx: PluginContext) => Promise<void>;
|
|
118
|
+
export interface PluginParts {
|
|
119
|
+
readonly collections?: readonly CollectionDefinition[];
|
|
120
|
+
readonly commands?: Readonly<Record<string, CommandDefinition>>;
|
|
121
|
+
readonly queries?: Readonly<Record<string, QueryDefinition>>;
|
|
122
|
+
readonly endpoints?: Readonly<Record<string, EndpointDefinition>>;
|
|
123
|
+
/** Hooks: `"console:<kind>"` with `events:console`, `"plugin:<key>:<kind>"` with `events:plugins`. */
|
|
124
|
+
readonly on?: Readonly<Record<string, HookHandler>>;
|
|
125
|
+
readonly jobs?: Readonly<Record<string, JobDefinition>>;
|
|
126
|
+
readonly upgrades?: readonly UpgradeDefinition[];
|
|
127
|
+
/** What other plugins may call with `plugins:<key>`. */
|
|
128
|
+
readonly api?: Readonly<Record<string, ApiDefinition>>;
|
|
129
|
+
readonly onEnable?: Lifecycle;
|
|
130
|
+
readonly onDisable?: Lifecycle;
|
|
131
|
+
}
|
|
132
|
+
/** The default export of a plugin's server module. */
|
|
133
|
+
export interface PluginDefinition {
|
|
134
|
+
readonly pluginApi: number;
|
|
135
|
+
readonly collections: readonly CollectionDefinition[];
|
|
136
|
+
readonly commands: Readonly<Record<string, CommandDefinition>>;
|
|
137
|
+
readonly queries: Readonly<Record<string, QueryDefinition>>;
|
|
138
|
+
readonly endpoints: Readonly<Record<string, EndpointDefinition>>;
|
|
139
|
+
readonly on: Readonly<Record<string, HookHandler>>;
|
|
140
|
+
readonly jobs: Readonly<Record<string, JobDefinition>>;
|
|
141
|
+
readonly upgrades: readonly UpgradeDefinition[];
|
|
142
|
+
readonly api: Readonly<Record<string, ApiDefinition>>;
|
|
143
|
+
readonly onEnable: Lifecycle | null;
|
|
144
|
+
readonly onDisable: Lifecycle | null;
|
|
145
|
+
}
|
|
146
|
+
/** The whole of a plugin's server module, checked once when it loads. */
|
|
147
|
+
export declare function definePlugin(parts: PluginParts): PluginDefinition;
|
|
148
|
+
/** True for what `definePlugin` yields, whichever copy of this package built it. */
|
|
149
|
+
export declare function isPluginDefinition(value: unknown): value is PluginDefinition;
|
|
150
|
+
/** A command or a query as the console describes it: enough to parse words, write help and draw a form. */
|
|
151
|
+
export interface OperationDescription {
|
|
152
|
+
readonly about: string;
|
|
153
|
+
readonly args: Readonly<Record<string, ArgDescription>>;
|
|
154
|
+
readonly roles: readonly string[] | null;
|
|
155
|
+
}
|
|
156
|
+
export interface CollectionDescription {
|
|
157
|
+
readonly name: string;
|
|
158
|
+
readonly indexes: readonly string[];
|
|
159
|
+
readonly search: readonly string[];
|
|
160
|
+
readonly owner: string | null;
|
|
161
|
+
readonly project: "none" | "optional" | "required";
|
|
162
|
+
readonly read: readonly string[];
|
|
163
|
+
readonly readOwn: readonly string[];
|
|
164
|
+
readonly history: boolean;
|
|
165
|
+
}
|
|
166
|
+
export interface EndpointDescription {
|
|
167
|
+
readonly auth: EndpointAuth;
|
|
168
|
+
readonly roles: readonly string[] | null;
|
|
169
|
+
readonly secret: string | null;
|
|
170
|
+
readonly methods: readonly string[];
|
|
171
|
+
readonly headers: readonly string[];
|
|
172
|
+
}
|
|
173
|
+
/** The server module as data: what crosses from the plugin's thread to the console, as JSON. */
|
|
174
|
+
export interface PluginDescription {
|
|
175
|
+
readonly pluginApi: number;
|
|
176
|
+
readonly collections: readonly CollectionDescription[];
|
|
177
|
+
readonly commands: Readonly<Record<string, OperationDescription>>;
|
|
178
|
+
readonly queries: Readonly<Record<string, OperationDescription>>;
|
|
179
|
+
readonly endpoints: Readonly<Record<string, EndpointDescription>>;
|
|
180
|
+
readonly hooks: readonly string[];
|
|
181
|
+
readonly jobs: Readonly<Record<string, {
|
|
182
|
+
readonly about: string;
|
|
183
|
+
readonly every: string;
|
|
184
|
+
readonly at: string | null;
|
|
185
|
+
}>>;
|
|
186
|
+
readonly upgrades: readonly {
|
|
187
|
+
readonly to: number;
|
|
188
|
+
readonly about: string;
|
|
189
|
+
}[];
|
|
190
|
+
readonly api: Readonly<Record<string, {
|
|
191
|
+
readonly about: string;
|
|
192
|
+
}>>;
|
|
193
|
+
readonly onEnable: boolean;
|
|
194
|
+
readonly onDisable: boolean;
|
|
195
|
+
}
|
|
196
|
+
/** The definition as JSON, functions and schemas left behind. */
|
|
197
|
+
export declare function describePlugin(definition: PluginDefinition): PluginDescription;
|
|
198
|
+
/** What a manifest must declare for a description to hold: the problems, or none. */
|
|
199
|
+
export declare function descriptionProblems(description: PluginDescription, manifest: {
|
|
200
|
+
readonly roles: Readonly<Record<string, unknown>>;
|
|
201
|
+
readonly capabilities: readonly string[];
|
|
202
|
+
readonly settings: readonly {
|
|
203
|
+
readonly key: string;
|
|
204
|
+
readonly type: string;
|
|
205
|
+
}[];
|
|
206
|
+
readonly dataVersion: number;
|
|
207
|
+
}): string[];
|
|
208
|
+
//# sourceMappingURL=define.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/plugin/define.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,YAAY,EACb,MAAM,cAAc,CAAC;AA0BtB,qHAAqH;AACrH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAa1D;AAmCD,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,YAAY;IACrD,6GAA6G;IAC7G,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACnB,uFAAuF;IACvF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,oCAAoC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,wFAAwF;IACxF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IACpD,sFAAsF;IACtF,QAAQ,CAAC,IAAI,CAAC,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