pgkiln 0.50.0 → 0.52.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 (104) hide show
  1. package/SECURITY.md +7 -0
  2. package/db/migrations/119_workspace_home.sql +30 -0
  3. package/db/migrations/120_datasets.sql +87 -0
  4. package/db/migrations/121_ai_agents.sql +94 -0
  5. package/db/migrations/122_team_development.sql +186 -0
  6. package/db/migrations/123_workflow_outcomes.sql +407 -0
  7. package/db/migrations/124_component_details.sql +51 -0
  8. package/docs/apex-feature-parity.md +15 -12
  9. package/docs/guide/01-installation.md +9 -3
  10. package/docs/guide/03-builder.md +211 -11
  11. package/docs/guide/04-pages-and-regions.md +96 -22
  12. package/docs/guide/05-items.md +7 -1
  13. package/docs/guide/06-processing.md +123 -8
  14. package/docs/guide/07-dynamic-actions.md +34 -0
  15. package/docs/guide/09-reference.md +2 -1
  16. package/docs/guide/11-from-apex.md +2 -1
  17. package/docs/guide/12-development.md +70 -11
  18. package/docs/guide/20-ai-agents.md +4 -2
  19. package/examples/hr/README.md +2 -0
  20. package/examples/hr/hr_63_datasets.sql +29 -0
  21. package/examples/hr/hr_64_ai_agent.sql +97 -0
  22. package/examples/hr/hr_65_ask_reports.sql +21 -0
  23. package/examples/hr/hr_66_team_development.sql +58 -0
  24. package/examples/hr/hr_67_workflow_outcomes.sql +113 -0
  25. package/examples/hr/hr_68_component_details.sql +96 -0
  26. package/package.json +1 -1
  27. package/public/app.css +46 -0
  28. package/public/app.js +134 -20
  29. package/public/builder.css +116 -0
  30. package/public/builder.js +47 -0
  31. package/src/ai/chat.ts +18 -18
  32. package/src/ai/service.ts +35 -11
  33. package/src/ai/types.ts +7 -2
  34. package/src/app.ts +11 -1
  35. package/src/builder/advisor.ts +6 -3
  36. package/src/builder/ai-agents.ts +372 -0
  37. package/src/builder/ai-builder.ts +3 -3
  38. package/src/builder/ai.ts +13 -9
  39. package/src/builder/assistant.ts +22 -7
  40. package/src/builder/components.ts +38 -9
  41. package/src/builder/datasets.ts +472 -0
  42. package/src/builder/designer.ts +8 -3
  43. package/src/builder/feedback.ts +6 -1
  44. package/src/builder/home.ts +12 -7
  45. package/src/builder/instance.ts +2 -0
  46. package/src/builder/locks.ts +7 -1
  47. package/src/builder/region-help.ts +2 -2
  48. package/src/builder/reporter.ts +52 -3
  49. package/src/builder/routes.ts +7 -4
  50. package/src/builder/shared.ts +1 -1
  51. package/src/builder/subscriptions.ts +1 -0
  52. package/src/builder/team.ts +991 -0
  53. package/src/builder/ui.ts +8 -5
  54. package/src/builder/workflow-migrate.ts +210 -0
  55. package/src/builder/workflows.ts +29 -6
  56. package/src/builder/workspace-home.ts +285 -0
  57. package/src/builder/workspace-transfer.ts +1 -1
  58. package/src/builder/workspaces.ts +7 -4
  59. package/src/cli/replace.ts +7 -1
  60. package/src/datasets.ts +367 -0
  61. package/src/i18n/ar.ts +33 -0
  62. package/src/i18n/cs.ts +33 -0
  63. package/src/i18n/da.ts +33 -0
  64. package/src/i18n/de.ts +33 -0
  65. package/src/i18n/el.ts +33 -0
  66. package/src/i18n/es.ts +33 -0
  67. package/src/i18n/fi.ts +33 -0
  68. package/src/i18n/fr.ts +33 -0
  69. package/src/i18n/he.ts +33 -0
  70. package/src/i18n/it.ts +33 -0
  71. package/src/i18n/ja.ts +33 -0
  72. package/src/i18n/ko.ts +33 -0
  73. package/src/i18n/nb.ts +33 -0
  74. package/src/i18n/pl.ts +33 -0
  75. package/src/i18n/pt.ts +33 -0
  76. package/src/i18n/ru.ts +33 -0
  77. package/src/i18n/sv.ts +33 -0
  78. package/src/i18n/tr.ts +33 -0
  79. package/src/i18n/uk.ts +33 -0
  80. package/src/i18n/zh.ts +33 -0
  81. package/src/i18n.ts +66 -0
  82. package/src/instance.ts +3 -0
  83. package/src/metadata.ts +9 -3
  84. package/src/release-check.ts +139 -0
  85. package/src/reporting-app.ts +101 -0
  86. package/src/runtime/ai-agents.ts +365 -0
  87. package/src/runtime/ai-filter.ts +385 -107
  88. package/src/runtime/assistant.ts +64 -11
  89. package/src/runtime/context.ts +2 -0
  90. package/src/runtime/data-reporter.ts +199 -32
  91. package/src/runtime/ir-phrases.ts +812 -0
  92. package/src/runtime/ir-plan.ts +449 -0
  93. package/src/runtime/items.ts +1 -1
  94. package/src/runtime/regions.ts +6 -2
  95. package/src/runtime/render.ts +1 -1
  96. package/src/runtime/report.ts +1 -1
  97. package/src/runtime/tasks.ts +63 -12
  98. package/src/session.ts +2 -0
  99. package/src/subscriptions.ts +2 -1
  100. package/src/task-events.ts +232 -0
  101. package/src/team-samples.ts +74 -0
  102. package/src/team.ts +342 -0
  103. package/src/workflow.ts +135 -18
  104. package/src/workspace-export.ts +39 -4
@@ -11,7 +11,7 @@
11
11
  import pg from 'pg';
12
12
  import { owner } from './db.ts';
13
13
 
14
- export const APP_TYPES = ['standard', 'theme', 'library', 'boilerplate'] as const;
14
+ export const APP_TYPES = ['standard', 'theme', 'library', 'boilerplate', 'reporting'] as const;
15
15
  export type AppType = (typeof APP_TYPES)[number];
16
16
 
17
17
  export const APP_TYPE_LABELS: Record<AppType, string> = {
@@ -19,6 +19,7 @@ export const APP_TYPE_LABELS: Record<AppType, string> = {
19
19
  theme: 'Theme application',
20
20
  library: 'Library application',
21
21
  boilerplate: 'Boilerplate application',
22
+ reporting: 'Reporting application',
22
23
  };
23
24
 
24
25
  /** What can be subscribed to: table, key column, label; and the master types that offer it. */
@@ -0,0 +1,232 @@
1
+ import pg from 'pg';
2
+ import { applyBinds, splitStatements, type BindValues } from './binds.ts';
3
+ import { owner } from './db.ts';
4
+ import { isQuery, stepTx } from './workflow.ts';
5
+
6
+ // (123) Task events and built-in notifications (APEX 26.2: Human Task events).
7
+ //
8
+ // A task definition's "events" are actions on what happens to its tasks:
9
+ //
10
+ // [{"on": "complete", "type": "sql", "code": "select hr.salary_decided(:DETAIL_PK::int, :OUTCOME)"},
11
+ // {"on": "expire", "type": "mail", "to": "select email from staff where role = 'hr'", "template": "TASK_EXPIRED"},
12
+ // {"on": "fail", "type": "workflow", "workflow": "ESCALATE", "vars": {"REASON": "&ERROR."}}]
13
+ //
14
+ // on complete the task was completed (any outcome; also meta.close_tasks with an outcome)
15
+ // expire the task expired (the definition's expiration policy)
16
+ // fail the definition's completion SQL raised an error: the actions run in the same
17
+ // request, after the SQL's effect is undone; "fail_recovery" says whether the task
18
+ // then stays open (reopen, the default: the decision is undone) or is completed
19
+ // type sql statements, as the application's role, with the task's binds
20
+ // mail meta.send_mail_template (template) or meta.send_mail (subject, body); "to" is a
21
+ // SELECT returning addresses, or addresses with &NAME. substitutions
22
+ // workflow meta.start_workflow(workflow, the task's detail_pk, its parameters + "vars")
23
+ //
24
+ // Binds (and #NAME# placeholders in mail): the task's parameters, TASK_ID, DETAIL_PK, SUBJECT,
25
+ // OUTCOME (upper case), APPROVER, INITIATOR, EVENT, and for fail ERROR and COMMENT.
26
+ //
27
+ // "notifications" ({"create": "TEMPLATE", "complete": "TEMPLATE", "expire": "TEMPLATE"}) send the
28
+ // application's e-mail template to the potential owners (create), the initiator (complete) or both
29
+ // (expire), at the addresses of their accounts.
30
+ //
31
+ // Complete, expire and create run after the commit: a trigger queues them in meta.task_hook and the
32
+ // workflow runner (src/workflow.ts startWorkflowRunner) works them off, each in its own transaction as
33
+ // the application's role. A hook that fails is tried three times; its error stays on the row.
34
+
35
+ export const EVENTS = ['complete', 'expire', 'fail'] as const;
36
+ export const ACTION_TYPES = ['sql', 'mail', 'workflow'] as const;
37
+ export const OUTCOME_COLOURS = ['default', 'primary', 'success', 'danger', 'warning'] as const;
38
+ const NAME = /^[A-Za-z][A-Za-z0-9_]{0,59}$/;
39
+
40
+ export interface TaskAction {
41
+ on: (typeof EVENTS)[number];
42
+ type: (typeof ACTION_TYPES)[number];
43
+ code?: string;
44
+ to?: string;
45
+ template?: string;
46
+ subject?: string;
47
+ body?: string;
48
+ workflow?: string;
49
+ vars?: Record<string, string>;
50
+ }
51
+
52
+ /** Problems with a task definition's custom outcomes (the database checks the same). */
53
+ export function outcomeProblems(v: unknown): string[] {
54
+ if (v === null || v === undefined || v === '') return [];
55
+ if (!Array.isArray(v)) return ['Outcomes: a JSON array of {"name": "YES", "label": "Yes", "colour": "success"}.'];
56
+ const problems: string[] = [];
57
+ const seen = new Set<string>();
58
+ if (v.length > 10) problems.push('Outcomes: at most 10.');
59
+ for (const o of v) {
60
+ if (!o || typeof o !== 'object') { problems.push('Outcomes: each is an object {"name", "label", "colour"}.'); continue; }
61
+ const { name, label, colour } = o as Record<string, unknown>;
62
+ if (typeof name !== 'string' || !/^[A-Za-z][A-Za-z0-9_]{0,29}$/.test(name)) { problems.push(`Outcome ${JSON.stringify(name)}: a name of letters, digits and underscores, e.g. YES.`); continue; }
63
+ if (['cancelled', 'expired', 'default'].includes(name.toLowerCase())) problems.push(`Outcome ${name}: the name is reserved.`);
64
+ if (seen.has(name.toLowerCase())) problems.push(`Outcome ${name} is listed twice.`);
65
+ seen.add(name.toLowerCase());
66
+ if (label !== undefined && (typeof label !== 'string' || !label.trim() || label.length > 60)) problems.push(`Outcome ${name}: the label is text (at most 60 characters).`);
67
+ if (colour !== undefined && !OUTCOME_COLOURS.includes(colour as never)) problems.push(`Outcome ${name}: the colour is ${OUTCOME_COLOURS.join(', ')}.`);
68
+ }
69
+ return problems;
70
+ }
71
+
72
+ /** Problems with a task definition's events. */
73
+ export function eventProblems(v: unknown): string[] {
74
+ if (v === null || v === undefined || v === '') return [];
75
+ if (!Array.isArray(v)) return ['Events: a JSON array of {"on": "complete", "type": "sql", "code": "…"}.'];
76
+ const problems: string[] = [];
77
+ if (v.length > 20) problems.push('Events: at most 20 actions.');
78
+ v.forEach((x, i) => {
79
+ const where = `Event ${i + 1}`;
80
+ if (!x || typeof x !== 'object') return void problems.push(`${where}: an object.`);
81
+ const a = x as Record<string, unknown>;
82
+ if (!EVENTS.includes(a.on as never)) problems.push(`${where}: "on" is ${EVENTS.join(', ')}.`);
83
+ if (!ACTION_TYPES.includes(a.type as never)) return void problems.push(`${where}: "type" is ${ACTION_TYPES.join(', ')}.`);
84
+ if (a.type === 'sql' && (typeof a.code !== 'string' || !a.code.trim())) problems.push(`${where}: "code" is the SQL to run.`);
85
+ if (a.type === 'mail') {
86
+ if (typeof a.to !== 'string' || !a.to.trim()) problems.push(`${where}: "to" is a SELECT returning e-mail addresses, or addresses.`);
87
+ if (a.template !== undefined && (typeof a.template !== 'string' || !NAME.test(a.template))) problems.push(`${where}: "template" names an e-mail template.`);
88
+ if (a.template === undefined && (typeof a.subject !== 'string' || !a.subject.trim() || typeof a.body !== 'string')) problems.push(`${where}: give a "template", or a "subject" and a "body".`);
89
+ }
90
+ if (a.type === 'workflow') {
91
+ if (typeof a.workflow !== 'string' || !/^[A-Za-z][A-Za-z0-9_]*$/.test(a.workflow)) problems.push(`${where}: "workflow" names a workflow definition.`);
92
+ if (a.vars !== undefined && (!a.vars || typeof a.vars !== 'object' || Array.isArray(a.vars) || Object.entries(a.vars).some(([k, val]) => !/^[A-Za-z][A-Za-z0-9_]*$/.test(k) || typeof val !== 'string')))
93
+ problems.push(`${where}: "vars" is an object of variable → text (&NAME. allowed).`);
94
+ }
95
+ });
96
+ return problems;
97
+ }
98
+
99
+ /** Problems with a task definition's notifications. */
100
+ export function notificationProblems(v: unknown): string[] {
101
+ if (v === null || v === undefined || v === '') return [];
102
+ if (typeof v !== 'object' || Array.isArray(v)) return ['Notifications: a JSON object such as {"create": "TASK_CREATED", "complete": "TASK_DONE"}.'];
103
+ const problems: string[] = [];
104
+ for (const [k, t] of Object.entries(v)) {
105
+ if (!['create', 'complete', 'expire'].includes(k)) problems.push(`Notifications: "${k}" is not create, complete or expire.`);
106
+ if (typeof t !== 'string' || !NAME.test(t)) problems.push(`Notifications: "${k}" names an e-mail template.`);
107
+ }
108
+ return problems;
109
+ }
110
+
111
+ /** Binds for a task's actions: upper-case names, text values. */
112
+ export function taskBinds(t: { id: string; detail_pk: string | null; params: Record<string, unknown> | null; subject: string; outcome: string | null; completed_by: string | null; initiator: string },
113
+ extra: Record<string, string | null> = {}): BindValues {
114
+ const params = Object.fromEntries(Object.entries(t.params ?? {}).map(([k, v]) => [k.toUpperCase(), v === null || v === undefined ? null : typeof v === 'object' ? JSON.stringify(v) : String(v)]));
115
+ return { ...params, TASK_ID: String(t.id), DETAIL_PK: t.detail_pk, SUBJECT: t.subject, OUTCOME: t.outcome ? t.outcome.toUpperCase() : null, APPROVER: t.completed_by, INITIATOR: t.initiator, ...extra };
116
+ }
117
+
118
+ const substitute = (text: string, b: BindValues) => text.replace(/&([A-Za-z][A-Za-z0-9_]*)\./g, (m, name: string) => (name.toUpperCase() in b ? (b[name.toUpperCase()] ?? '') : m));
119
+
120
+ /** Addresses from a "to": a SELECT (as the application's role) or a list with &NAME. substitutions. */
121
+ export async function recipients(q: pg.PoolClient, to: string, b: BindValues): Promise<string> {
122
+ if (!isQuery(to)) return substitute(to, b);
123
+ const rows = (await q.query({ text: applyBinds(to.trim().replace(/;+\s*$/, ''), b), rowMode: 'array' })).rows;
124
+ return rows.map((r) => r[0]).filter((x) => typeof x === 'string' && x.trim()).join(', ');
125
+ }
126
+
127
+ /** Queue a mail as the application's role: a template with #NAME# placeholders, or a subject and body. */
128
+ export async function queueMail(q: pg.PoolClient, m: { to: string; template?: string; subject?: string; body?: string }, b: BindValues) {
129
+ const values = Object.fromEntries(Object.entries(b).map(([k, v]) => [k, v ?? '']));
130
+ return m.template
131
+ ? (await q.query('select meta.send_mail_template($1, $2, $3) as id', [m.template, values, m.to])).rows[0].id
132
+ : (await q.query(`select meta.send_mail($1, regexp_replace(meta.mail_fill($2, $4, false), '[\\r\\n]+', ' ', 'g'), meta.mail_fill($3, $4, false)) as id`, [m.to, m.subject ?? '', m.body ?? '', values])).rows[0].id;
133
+ }
134
+
135
+ /** Run a task event's actions on `q`, which is the application's role. Returns what was done (for the log). */
136
+ export async function runActions(q: pg.PoolClient, actions: TaskAction[], b: BindValues, detailPk: string | null): Promise<string[]> {
137
+ const done: string[] = [];
138
+ for (const a of actions) {
139
+ if (a.type === 'sql' && a.code?.trim()) {
140
+ for (const stmt of splitStatements(applyBinds(a.code, b))) await q.query(stmt);
141
+ done.push('sql');
142
+ } else if (a.type === 'mail' && a.to) {
143
+ const to = await recipients(q, a.to, b);
144
+ if (to.trim()) done.push(`mail ${await queueMail(q, { to, template: a.template, subject: a.subject, body: a.body }, b)}`);
145
+ } else if (a.type === 'workflow' && a.workflow) {
146
+ const params = Object.fromEntries(Object.entries(b).filter(([k]) => !['TASK_ID', 'SUBJECT', 'APPROVER', 'INITIATOR', 'EVENT', 'ERROR', 'COMMENT', 'DETAIL_PK'].includes(k)));
147
+ const vars = { ...params, TASK_ID: b.TASK_ID, OUTCOME: b.OUTCOME, ...Object.fromEntries(Object.entries(a.vars ?? {}).map(([k, v]) => [k.toUpperCase(), substitute(v, b)])) };
148
+ done.push(`workflow ${(await q.query('select meta.start_workflow($1, $2, $3) as id', [a.workflow, detailPk, vars])).rows[0].id}`);
149
+ }
150
+ }
151
+ return done;
152
+ }
153
+
154
+ /** The actions of a definition's events for one event. */
155
+ export const actionsFor = (events: unknown, on: string): TaskAction[] => (Array.isArray(events) ? (events as TaskAction[]).filter((a) => a && typeof a === 'object' && a.on === on) : []);
156
+
157
+ interface Hook {
158
+ hook_id: string;
159
+ event: 'create' | 'complete' | 'expire';
160
+ id: string;
161
+ app_id: number;
162
+ detail_pk: string | null;
163
+ params: Record<string, unknown> | null;
164
+ subject: string;
165
+ outcome: string | null;
166
+ completed_by: string | null;
167
+ initiator: string;
168
+ tenant_id: string;
169
+ workflow_id: string | null;
170
+ events: unknown;
171
+ notifications: Record<string, string> | null;
172
+ db_role: string | null;
173
+ }
174
+
175
+ /** Run one queued hook in its own transaction. */
176
+ async function runHook(id: string): Promise<boolean> {
177
+ return stepTx(async (c, side) => {
178
+ const h = (
179
+ await c.query<Hook>(
180
+ `select h.id::text as hook_id, h.event, t.id::text, t.app_id, t.detail_pk, t.params, t.subject, t.outcome, t.completed_by, t.initiator,
181
+ coalesce(t.tenant_id, '') as tenant_id, t.workflow_id::text, d.events, d.notifications, a.db_role
182
+ from meta.task_hook h join meta.task t on t.id = h.task_id join meta.task_definition d on d.id = t.definition_id join meta.app a on a.id = t.app_id
183
+ where h.id = $1 and h.done_at is null for update of h skip locked`,
184
+ [id],
185
+ )
186
+ ).rows[0];
187
+ if (!h) return false;
188
+ // the person whose act it was: the one who completed it, else the initiator
189
+ const actor = h.event === 'complete' ? (h.completed_by ?? h.initiator) : h.initiator;
190
+ await c.query(
191
+ `select set_config('pgkiln.app_id', $1, true), set_config('pgkiln.app_user', $2, true), set_config('pgkiln.session_id', '', true),
192
+ set_config('pgkiln.workflow_id', $3, true), set_config('statement_timeout', '30s', true), set_config('pgkiln.tenant_id', $4, true)`,
193
+ [String(h.app_id), actor, h.workflow_id ?? '', h.tenant_id],
194
+ );
195
+ const template = h.notifications?.[h.event];
196
+ // recipients of a notification, as the owner (accounts aren't the application's)
197
+ const to = template
198
+ ? ((await c.query('select meta.task_addresses($1, $2, $3) as a', [h.id, h.event !== 'complete', h.event !== 'create'])).rows[0].a as string[])
199
+ : [];
200
+ const b = taskBinds(h, { EVENT: h.event.toUpperCase() });
201
+ const asApp = async <T>(fn: (q: pg.PoolClient) => Promise<T>) => {
202
+ const isolated = await side.open({ app_id: h.app_id, db_role: h.db_role, initiator: actor, id: h.workflow_id ?? '', tenant_id: h.tenant_id });
203
+ if (isolated) return fn(isolated);
204
+ if (h.db_role) await c.query(`set local role ${pg.escapeIdentifier(h.db_role)}`);
205
+ const result = await fn(c);
206
+ if (h.db_role) await c.query('reset role');
207
+ return result;
208
+ };
209
+ await asApp(async (q) => {
210
+ await runActions(q, actionsFor(h.events, h.event), b, h.detail_pk);
211
+ if (template && to.length) await queueMail(q, { to: to.join(', '), template }, b);
212
+ });
213
+ await c.query('update meta.task_hook set done_at = now(), attempts = attempts + 1, error = null where id = $1', [h.hook_id]);
214
+ return true;
215
+ });
216
+ }
217
+
218
+ /** Work off the queued task events and notifications. Returns how many ran. */
219
+ export async function runTaskHooks(): Promise<number> {
220
+ const ids = (await owner.query<{ id: string }>('select id::text from meta.task_hook where done_at is null and attempts < 3 order by id limit 100')).rows.map((r) => r.id);
221
+ let n = 0;
222
+ for (const id of ids) {
223
+ try {
224
+ if (await runHook(id)) n++;
225
+ } catch (e) {
226
+ const msg = (e as Error).message.slice(0, 2000);
227
+ await owner.query(`update meta.task_hook set attempts = attempts + 1, error = $2, done_at = case when attempts + 1 >= 3 then now() end where id = $1`, [id, msg]);
228
+ console.error(`task event ${id}:`, msg);
229
+ }
230
+ }
231
+ return n;
232
+ }
@@ -0,0 +1,74 @@
1
+ // (sprint 113, WS-3) Team Development's set-up wizard (APEX: Team Development → Set up): sample label groups
2
+ // and labels, issue templates, canned responses and milestones, per builder language. Only English is written
3
+ // so far: add a language by adding an entry to TEAM_SAMPLES with the same structure (the wizard offers every
4
+ // key). Names stay short: labels and milestones are at most 40 characters, templates 60.
5
+
6
+ export type LabelColor = 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'purple' | 'gray';
7
+
8
+ export interface TeamSample {
9
+ /** the language's name in its own language (the wizard's choice) */
10
+ language: string;
11
+ groups: { name: string; description: string; labels: { name: string; color: LabelColor; description: string }[] }[];
12
+ milestones: { name: string; description: string; /** due in this many days from the set-up */ dueInDays: number | null }[];
13
+ issueTemplates: { name: string; title: string; body: string; labels: string[] }[];
14
+ responses: { name: string; body: string }[];
15
+ }
16
+
17
+ export const TEAM_SAMPLES: Record<string, TeamSample> = {
18
+ en: {
19
+ language: 'English',
20
+ groups: [
21
+ {
22
+ name: 'Type',
23
+ description: 'What kind of work the issue is.',
24
+ labels: [
25
+ { name: 'Bug', color: 'red', description: 'Something does not work as it should.' },
26
+ { name: 'Feature', color: 'blue', description: 'New functionality.' },
27
+ { name: 'Task', color: 'teal', description: 'Work to do that is neither a bug nor a feature.' },
28
+ ],
29
+ },
30
+ {
31
+ name: 'Priority',
32
+ description: 'How soon it should be done.',
33
+ labels: [
34
+ { name: 'High', color: 'orange', description: 'Do this first.' },
35
+ { name: 'Medium', color: 'yellow', description: 'Do this soon.' },
36
+ { name: 'Low', color: 'gray', description: 'Do this when there is time.' },
37
+ ],
38
+ },
39
+ ],
40
+ milestones: [
41
+ { name: '1.0', description: 'The first release.', dueInDays: 30 },
42
+ { name: '1.1', description: 'The first update after the release.', dueInDays: 90 },
43
+ { name: 'Backlog', description: 'Not planned yet.', dueInDays: null },
44
+ ],
45
+ issueTemplates: [
46
+ {
47
+ name: 'Bug report',
48
+ title: 'Bug: ',
49
+ labels: ['Bug'],
50
+ body: '## What happens\n\n\n## What should happen\n\n\n## Steps to reproduce\n\n1. \n2. \n3. \n\n## Environment\n\nApplication, page, browser, user:\n',
51
+ },
52
+ {
53
+ name: 'Feature request',
54
+ title: 'Feature: ',
55
+ labels: ['Feature'],
56
+ body: '## The problem\n\nWho needs this, and why?\n\n## The proposal\n\n\n## Done when\n\n- \n',
57
+ },
58
+ {
59
+ name: 'Task',
60
+ title: '',
61
+ labels: ['Task'],
62
+ body: '## To do\n\n- [ ] \n- [ ] \n',
63
+ },
64
+ ],
65
+ responses: [
66
+ { name: 'Thanks, we will look at it', body: 'Thank you for reporting this. We will look at it and keep this issue up to date.' },
67
+ { name: 'Need more information', body: 'Could you tell us more? Which page were you on, what did you do, and what did you expect to happen?' },
68
+ { name: 'Fixed', body: 'This is fixed and will be in the next release.' },
69
+ { name: 'Duplicate', body: 'This is the same as another issue; we follow it up there.' },
70
+ ],
71
+ },
72
+ };
73
+
74
+ export const TEAM_LANGUAGES = Object.keys(TEAM_SAMPLES);