@anchrd/colab-sdk 0.1.32 → 0.1.33
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 +3 -1
- package/dist/actions/actions.d.ts +46 -17
- package/dist/actions/actions.js +10 -0
- package/dist/archive/archive.d.ts +10 -0
- package/dist/archive/archive.js +9 -0
- package/dist/boards/boards.d.ts +29 -25
- package/dist/boards/boards.js +3 -2
- package/dist/card-kinds/card-kinds.d.ts +5 -5
- package/dist/columns/columns.d.ts +2 -2
- package/dist/connectors/connectors.d.ts +37 -3
- package/dist/connectors/connectors.js +6 -2
- package/dist/crawls/crawls.d.ts +3 -3
- package/dist/documents/documents.d.ts +4 -0
- package/dist/documents/documents.js +3 -2
- package/dist/error/error.d.ts +1 -0
- package/dist/error/error.js +8 -1
- package/dist/files/files.d.ts +4 -0
- package/dist/files/files.js +3 -2
- package/dist/gadgets/gadgets.d.ts +44 -0
- package/dist/gadgets/gadgets.js +35 -5
- package/dist/goals/goals.d.ts +7 -0
- package/dist/goals/goals.js +7 -5
- package/dist/grammar/grammar.d.ts +2 -1
- package/dist/grammar/grammar.js +9 -3
- package/dist/mcps/mcps.d.ts +41 -3
- package/dist/mcps/mcps.js +53 -3
- package/dist/nodes/nodes.d.ts +21 -9
- package/dist/nodes/nodes.js +16 -2
- package/dist/operators/operators.js +1 -1
- package/dist/organisation/organisation.d.ts +45 -0
- package/dist/organisation/organisation.js +45 -0
- package/dist/profile/profile.d.ts +3 -3
- package/dist/profile/profile.js +3 -2
- package/dist/providers/providers.d.ts +128 -0
- package/dist/providers/providers.js +118 -0
- package/dist/runs/runs.d.ts +3 -3
- package/dist/runtime-config.d.ts +12 -0
- package/dist/runtime-config.js +10 -0
- package/dist/sdk.d.ts +5 -4
- package/dist/sdk.js +5 -4
- package/dist/skills/skills.d.ts +4 -0
- package/dist/skills/skills.js +3 -2
- package/dist/sources/sources.d.ts +19 -4
- package/dist/sources/sources.js +8 -3
- package/dist/tables/tables.d.ts +4 -0
- package/dist/tables/tables.js +3 -2
- package/dist/versions/versions.d.ts +13 -13
- package/dist/written/written.d.ts +5 -2
- package/dist/written/written.js +2 -2
- package/package.json +1 -1
- package/dist/sso/sso.d.ts +0 -71
- package/dist/sso/sso.js +0 -59
package/dist/nodes/nodes.d.ts
CHANGED
|
@@ -38,6 +38,11 @@ export declare const NodeSection: z.ZodEnum<{
|
|
|
38
38
|
shared: "shared";
|
|
39
39
|
}>;
|
|
40
40
|
export type NodeSection = z.infer<typeof NodeSection>;
|
|
41
|
+
export declare const CreateSection: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
own: "own";
|
|
43
|
+
shared: "shared";
|
|
44
|
+
}>>;
|
|
45
|
+
export type CreateSection = z.infer<typeof CreateSection>;
|
|
41
46
|
export declare const NodeSort: z.ZodEnum<{
|
|
42
47
|
name: "name";
|
|
43
48
|
status: "status";
|
|
@@ -129,13 +134,13 @@ export declare const NodeListItem: z.ZodObject<{
|
|
|
129
134
|
sharedWith: z.ZodNumber;
|
|
130
135
|
archivedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
131
136
|
status: z.ZodNullable<z.ZodEnum<{
|
|
137
|
+
archive: "archive";
|
|
132
138
|
backlog: "backlog";
|
|
133
139
|
open: "open";
|
|
134
140
|
progress: "progress";
|
|
135
141
|
done: "done";
|
|
136
142
|
discarded: "discarded";
|
|
137
143
|
blocked: "blocked";
|
|
138
|
-
archive: "archive";
|
|
139
144
|
}>>;
|
|
140
145
|
system: z.ZodNullable<z.ZodEnum<{
|
|
141
146
|
validation: "validation";
|
|
@@ -201,13 +206,13 @@ export declare const NodeList: z.ZodObject<{
|
|
|
201
206
|
sharedWith: z.ZodNumber;
|
|
202
207
|
archivedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
203
208
|
status: z.ZodNullable<z.ZodEnum<{
|
|
209
|
+
archive: "archive";
|
|
204
210
|
backlog: "backlog";
|
|
205
211
|
open: "open";
|
|
206
212
|
progress: "progress";
|
|
207
213
|
done: "done";
|
|
208
214
|
discarded: "discarded";
|
|
209
215
|
blocked: "blocked";
|
|
210
|
-
archive: "archive";
|
|
211
216
|
}>>;
|
|
212
217
|
system: z.ZodNullable<z.ZodEnum<{
|
|
213
218
|
validation: "validation";
|
|
@@ -250,8 +255,8 @@ export declare const NodeList: z.ZodObject<{
|
|
|
250
255
|
export type NodeList = z.infer<typeof NodeList>;
|
|
251
256
|
export declare const NodeHitFoundIn: z.ZodObject<{
|
|
252
257
|
kind: z.ZodEnum<{
|
|
253
|
-
column: "column";
|
|
254
258
|
page: "page";
|
|
259
|
+
column: "column";
|
|
255
260
|
title: "title";
|
|
256
261
|
text: "text";
|
|
257
262
|
card: "card";
|
|
@@ -288,8 +293,8 @@ export declare const NodeHit: z.ZodObject<{
|
|
|
288
293
|
snippet: z.ZodString;
|
|
289
294
|
foundIn: z.ZodObject<{
|
|
290
295
|
kind: z.ZodEnum<{
|
|
291
|
-
column: "column";
|
|
292
296
|
page: "page";
|
|
297
|
+
column: "column";
|
|
293
298
|
title: "title";
|
|
294
299
|
text: "text";
|
|
295
300
|
card: "card";
|
|
@@ -298,13 +303,13 @@ export declare const NodeHit: z.ZodObject<{
|
|
|
298
303
|
}, z.core.$strip>;
|
|
299
304
|
rank: z.ZodNumber;
|
|
300
305
|
status: z.ZodNullable<z.ZodEnum<{
|
|
306
|
+
archive: "archive";
|
|
301
307
|
backlog: "backlog";
|
|
302
308
|
open: "open";
|
|
303
309
|
progress: "progress";
|
|
304
310
|
done: "done";
|
|
305
311
|
discarded: "discarded";
|
|
306
312
|
blocked: "blocked";
|
|
307
|
-
archive: "archive";
|
|
308
313
|
}>>;
|
|
309
314
|
updatedAt: z.ZodISODateTime;
|
|
310
315
|
boardKind: z.ZodNullable<z.ZodEnum<{
|
|
@@ -361,8 +366,8 @@ export declare const NodeSearch: z.ZodObject<{
|
|
|
361
366
|
snippet: z.ZodString;
|
|
362
367
|
foundIn: z.ZodObject<{
|
|
363
368
|
kind: z.ZodEnum<{
|
|
364
|
-
column: "column";
|
|
365
369
|
page: "page";
|
|
370
|
+
column: "column";
|
|
366
371
|
title: "title";
|
|
367
372
|
text: "text";
|
|
368
373
|
card: "card";
|
|
@@ -371,13 +376,13 @@ export declare const NodeSearch: z.ZodObject<{
|
|
|
371
376
|
}, z.core.$strip>;
|
|
372
377
|
rank: z.ZodNumber;
|
|
373
378
|
status: z.ZodNullable<z.ZodEnum<{
|
|
379
|
+
archive: "archive";
|
|
374
380
|
backlog: "backlog";
|
|
375
381
|
open: "open";
|
|
376
382
|
progress: "progress";
|
|
377
383
|
done: "done";
|
|
378
384
|
discarded: "discarded";
|
|
379
385
|
blocked: "blocked";
|
|
380
|
-
archive: "archive";
|
|
381
386
|
}>>;
|
|
382
387
|
updatedAt: z.ZodISODateTime;
|
|
383
388
|
boardKind: z.ZodNullable<z.ZodEnum<{
|
|
@@ -430,13 +435,13 @@ export declare const NodeValidation: z.ZodObject<{
|
|
|
430
435
|
columnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
431
436
|
name: z.ZodString;
|
|
432
437
|
type: z.ZodEnum<{
|
|
438
|
+
archive: "archive";
|
|
433
439
|
backlog: "backlog";
|
|
434
440
|
open: "open";
|
|
435
441
|
progress: "progress";
|
|
436
442
|
done: "done";
|
|
437
443
|
discarded: "discarded";
|
|
438
444
|
blocked: "blocked";
|
|
439
|
-
archive: "archive";
|
|
440
445
|
}>;
|
|
441
446
|
}, z.core.$strip>;
|
|
442
447
|
validUntil: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -534,13 +539,13 @@ export declare const NodeDetail: z.ZodObject<{
|
|
|
534
539
|
columnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
535
540
|
name: z.ZodString;
|
|
536
541
|
type: z.ZodEnum<{
|
|
542
|
+
archive: "archive";
|
|
537
543
|
backlog: "backlog";
|
|
538
544
|
open: "open";
|
|
539
545
|
progress: "progress";
|
|
540
546
|
done: "done";
|
|
541
547
|
discarded: "discarded";
|
|
542
548
|
blocked: "blocked";
|
|
543
|
-
archive: "archive";
|
|
544
549
|
}>;
|
|
545
550
|
}, z.core.$strip>;
|
|
546
551
|
validUntil: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -585,6 +590,9 @@ export type NodeUpdateInput = z.infer<typeof NodeUpdateInput>;
|
|
|
585
590
|
export declare const NodeMoveInput: z.ZodObject<{
|
|
586
591
|
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
587
592
|
parentId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
593
|
+
section: z.ZodOptional<z.ZodEnum<{
|
|
594
|
+
shared: "shared";
|
|
595
|
+
}>>;
|
|
588
596
|
}, z.core.$strict>;
|
|
589
597
|
export type NodeMoveInput = z.infer<typeof NodeMoveInput>;
|
|
590
598
|
export declare const NodeReader: z.ZodObject<{
|
|
@@ -633,6 +641,10 @@ export declare const NodeMoved: z.ZodObject<{
|
|
|
633
641
|
export type NodeMoved = z.infer<typeof NodeMoved>;
|
|
634
642
|
export declare const FolderCreateInput: z.ZodObject<{
|
|
635
643
|
parentId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
644
|
+
section: z.ZodOptional<z.ZodEnum<{
|
|
645
|
+
own: "own";
|
|
646
|
+
shared: "shared";
|
|
647
|
+
}>>;
|
|
636
648
|
name: z.ZodString;
|
|
637
649
|
idempotencyKey: z.ZodString;
|
|
638
650
|
}, z.core.$strict>;
|
package/dist/nodes/nodes.js
CHANGED
|
@@ -59,6 +59,14 @@ export const BoardSystem = z.enum(["validation"]);
|
|
|
59
59
|
export const BoardShownKind = z.enum(["board", "process", "validation"]);
|
|
60
60
|
// The three sections of the tree (Funktionen › Seitenbaum, E67).
|
|
61
61
|
export const NodeSection = z.enum(["own", "shared", "users"]);
|
|
62
|
+
// Where a create without a parent lands (#930, after #791): Own unless the caller says Shared. Only
|
|
63
|
+
// with `parentId: null`; the UI sends `shared` from "Neu" at the top of Shared, an AI only when it
|
|
64
|
+
// means Shared. Without it the node goes into the caller's root folder, so it is never found by
|
|
65
|
+
// nobody by accident (Diana's folder, #791).
|
|
66
|
+
export const CreateSection = z
|
|
67
|
+
.enum(["own", "shared"])
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("Only with parentId null: shared creates the node on the top level of Shared, where you see it and everyone you share it with; own or leaving it out creates it in your own root folder (Own). Send shared only when Shared is meant.");
|
|
62
70
|
export const NodeSort = z.enum(["name", "updated", "kind", "status"]);
|
|
63
71
|
const Limit = PageSize.describe("How many entries one page holds, 1 to 100. Leaving it out gives 50.");
|
|
64
72
|
// The name a person reads. ⚠️ A name starting with a dot hides the node from listings (`.Intern`),
|
|
@@ -292,7 +300,12 @@ export const NodeMoveInput = z.strictObject({
|
|
|
292
300
|
nodeId: NodeId,
|
|
293
301
|
// ⚠️ Required and nullable (trap C015): null is the top level of Shared, and leaving the field out
|
|
294
302
|
// is refused, so a forgetful caller cannot move a node to the top by accident.
|
|
295
|
-
parentId: NodeId.nullable().describe("The folder to move the node into, one you can write to; null puts it on the top level of Shared. The node takes the grants of its new folder and loses those of the old one."),
|
|
303
|
+
parentId: NodeId.nullable().describe("The folder to move the node into, one you can write to; null puts it on the top level of Shared, a node without a grant of its own only with section shared. The node takes the grants of its new folder and loses those of the old one."),
|
|
304
|
+
// #930: like a create, the top of Shared is said, not implied: the tree sends it on a drop there.
|
|
305
|
+
section: z
|
|
306
|
+
.enum(["shared"])
|
|
307
|
+
.optional()
|
|
308
|
+
.describe("Only with parentId null: shared puts the node on the top level of Shared even without a grant of its own, where its creator and everyone it is shared with see it. Leaving it out refuses a node without a grant of its own there."),
|
|
296
309
|
});
|
|
297
310
|
// Who reaches a node after inheritance (`readersOf`), and where it comes from.
|
|
298
311
|
export const NodeReader = z.object({
|
|
@@ -313,7 +326,8 @@ export const NodeMoved = z.object({
|
|
|
313
326
|
});
|
|
314
327
|
export const FolderCreateInput = z.strictObject({
|
|
315
328
|
// ⚠️ Required and nullable (trap C015): null is the top level of Shared.
|
|
316
|
-
parentId: NodeId.nullable().describe("The folder to create it in, one you can write to; null creates it on the top level of Shared,
|
|
329
|
+
parentId: NodeId.nullable().describe("The folder to create it in, one you can write to; null creates it in your own root folder (Own), or on the top level of Shared with section shared, where only you see it until you share it."),
|
|
330
|
+
section: CreateSection,
|
|
317
331
|
name: NodeName,
|
|
318
332
|
idempotencyKey: IdempotencyKey,
|
|
319
333
|
});
|
|
@@ -416,7 +416,7 @@ export const OperatorUserListInput = z.strictObject({
|
|
|
416
416
|
export const OperatorUserUpdateInput = z
|
|
417
417
|
.strictObject({
|
|
418
418
|
userId: UserId.optional().describe("The person whose own values change, `user_…`. Leaving it out changes the defaults for every person."),
|
|
419
|
-
limitUsd: UserLimitUsd.optional().describe("The limit of a month in dollars for all personal Operators of a person together. null: no limit for the defaults; for a person, the defaults again."),
|
|
419
|
+
limitUsd: UserLimitUsd.optional().describe("The limit of a month in US dollars for all personal Operators of a person together. null: no limit for the defaults; for a person, the defaults again."),
|
|
420
420
|
models: UserModels.optional().describe("The models a person's Operators may take. null: every model a credential marked personal offers for the defaults; for a person, the defaults again."),
|
|
421
421
|
})
|
|
422
422
|
.refine((input) => input.limitUsd !== undefined || input.models !== undefined, {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const currencies: readonly ["EUR", "USD", "CHF", "GBP"];
|
|
3
|
+
export declare const Currency: z.ZodEnum<{
|
|
4
|
+
EUR: "EUR";
|
|
5
|
+
USD: "USD";
|
|
6
|
+
CHF: "CHF";
|
|
7
|
+
GBP: "GBP";
|
|
8
|
+
}>;
|
|
9
|
+
export type Currency = z.infer<typeof Currency>;
|
|
10
|
+
export declare const CurrencyRate: z.ZodNumber;
|
|
11
|
+
export declare const OrganisationGetInput: z.ZodObject<{}, z.core.$strict>;
|
|
12
|
+
export type OrganisationGetInput = z.infer<typeof OrganisationGetInput>;
|
|
13
|
+
export declare const OrganisationUpdateInput: z.ZodObject<{
|
|
14
|
+
timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
16
|
+
en: "en";
|
|
17
|
+
de: "de";
|
|
18
|
+
}>>>;
|
|
19
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
20
|
+
EUR: "EUR";
|
|
21
|
+
USD: "USD";
|
|
22
|
+
CHF: "CHF";
|
|
23
|
+
GBP: "GBP";
|
|
24
|
+
}>>>;
|
|
25
|
+
currencyRate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type OrganisationUpdateInput = z.infer<typeof OrganisationUpdateInput>;
|
|
28
|
+
export declare const Organisation: z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
timeZone: z.ZodNullable<z.ZodString>;
|
|
31
|
+
locale: z.ZodNullable<z.ZodEnum<{
|
|
32
|
+
en: "en";
|
|
33
|
+
de: "de";
|
|
34
|
+
}>>;
|
|
35
|
+
currency: z.ZodNullable<z.ZodEnum<{
|
|
36
|
+
EUR: "EUR";
|
|
37
|
+
USD: "USD";
|
|
38
|
+
CHF: "CHF";
|
|
39
|
+
GBP: "GBP";
|
|
40
|
+
}>>;
|
|
41
|
+
currencyRate: z.ZodNullable<z.ZodNumber>;
|
|
42
|
+
setAt: z.ZodNullable<z.ZodISODateTime>;
|
|
43
|
+
setBy: z.ZodNullable<z.ZodTemplateLiteral<`user_${string}`>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type Organisation = z.infer<typeof Organisation>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Locale, TimeZone } from "../profile/profile.js";
|
|
3
|
+
import { UserId } from "../users/users.js";
|
|
4
|
+
// Organisation › System (#930): what holds for the whole company. The name is the installation's
|
|
5
|
+
// (`INSTALLATION_NAME`, #79) and only stands to read. The default time zone and language are set
|
|
6
|
+
// here by an admin: a person without their own in the profile takes them, a machine always does
|
|
7
|
+
// (the rhythm of goals, "due today", times in mails), and so does every mail to a person without a
|
|
8
|
+
// language of their own. Null: not set, and the old default holds (UTC; `DEFAULT_LANGUAGE`, else
|
|
9
|
+
// English).
|
|
10
|
+
//
|
|
11
|
+
// The currency (#930, Jack 2026-10-30): providers bill in US dollars and every amount is stored in
|
|
12
|
+
// US dollars. With a currency other than USD and a fixed rate the admin enters (1 USD = `currencyRate`
|
|
13
|
+
// of the currency), the UI shows and takes amounts in that currency, converted with the rate. The
|
|
14
|
+
// MCP tools stay in US dollars. Null or USD: dollars everywhere, as before.
|
|
15
|
+
export const currencies = ["EUR", "USD", "CHF", "GBP"];
|
|
16
|
+
export const Currency = z.enum(currencies);
|
|
17
|
+
// How many units of the currency one US dollar buys; fixed until an admin changes it.
|
|
18
|
+
export const CurrencyRate = z.number().positive().max(1_000_000);
|
|
19
|
+
export const OrganisationGetInput = z.strictObject({});
|
|
20
|
+
export const OrganisationUpdateInput = z.strictObject({
|
|
21
|
+
timeZone: TimeZone.nullable()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("The default IANA time zone, such as Europe/Berlin, for people without their own and for every machine. null takes it out (UTC). Left out: unchanged."),
|
|
24
|
+
locale: Locale.nullable()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("The default language, en or de, for new people, invitations and mails to anyone without their own. null takes it out. Left out: unchanged."),
|
|
27
|
+
currency: Currency.nullable()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("The currency the UI shows amounts in: EUR, USD, CHF or GBP. Anything other than USD needs currencyRate, now or already set. null or USD: US dollars. Left out: unchanged. Every amount stays stored, and every tool answers and takes, in US dollars."),
|
|
30
|
+
currencyRate: CurrencyRate.nullable()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("The fixed rate: how many units of the currency one US dollar is (1 USD = currencyRate), greater than 0, such as 0.92 for EUR. null takes it out. Left out: unchanged."),
|
|
33
|
+
});
|
|
34
|
+
export const Organisation = z.object({
|
|
35
|
+
// The installation's name for people; empty when the installation sets none.
|
|
36
|
+
name: z.string(),
|
|
37
|
+
timeZone: z.string().nullable(),
|
|
38
|
+
locale: Locale.nullable(),
|
|
39
|
+
currency: Currency.nullable(),
|
|
40
|
+
// 1 USD = currencyRate of the currency; null while unset.
|
|
41
|
+
currencyRate: z.number().nullable(),
|
|
42
|
+
// When and by whom the defaults were last changed; null while nobody has.
|
|
43
|
+
setAt: z.iso.datetime().nullable(),
|
|
44
|
+
setBy: UserId.nullable(),
|
|
45
|
+
});
|
|
@@ -17,11 +17,11 @@ export type TimeZone = z.infer<typeof TimeZone>;
|
|
|
17
17
|
export declare const Name: z.ZodString;
|
|
18
18
|
export declare const ProfileUpdateInput: z.ZodObject<{
|
|
19
19
|
name: z.ZodOptional<z.ZodString>;
|
|
20
|
-
locale: z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
21
21
|
en: "en";
|
|
22
22
|
de: "de";
|
|
23
|
-
}
|
|
24
|
-
timezone: z.ZodOptional<z.ZodString
|
|
23
|
+
}>>>;
|
|
24
|
+
timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
25
|
theme: z.ZodOptional<z.ZodEnum<{
|
|
26
26
|
light: "light";
|
|
27
27
|
dark: "dark";
|
package/dist/profile/profile.js
CHANGED
|
@@ -28,8 +28,9 @@ export const Name = z.string().trim().min(1).max(200);
|
|
|
28
28
|
// because it identifies the account, the picture because it only comes through its own door.
|
|
29
29
|
export const ProfileUpdateInput = z.strictObject({
|
|
30
30
|
name: Name.optional(),
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// `null` takes the choice back: the organisation's default holds again (#930).
|
|
32
|
+
locale: Locale.nullable().optional(),
|
|
33
|
+
timezone: TimeZone.nullable().optional(),
|
|
33
34
|
theme: Theme.optional(),
|
|
34
35
|
});
|
|
35
36
|
// The picture's upload door takes the file itself as body, never base64 in JSON. The allowlist is
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const providerIds: readonly ["google", "microsoft", "slack"];
|
|
3
|
+
export declare const ProviderId: z.ZodEnum<{
|
|
4
|
+
google: "google";
|
|
5
|
+
microsoft: "microsoft";
|
|
6
|
+
slack: "slack";
|
|
7
|
+
}>;
|
|
8
|
+
export type ProviderId = z.infer<typeof ProviderId>;
|
|
9
|
+
export declare const signInProviderIds: readonly ["google", "microsoft"];
|
|
10
|
+
export declare const SignInProviderId: z.ZodEnum<{
|
|
11
|
+
google: "google";
|
|
12
|
+
microsoft: "microsoft";
|
|
13
|
+
}>;
|
|
14
|
+
export type SignInProviderId = z.infer<typeof SignInProviderId>;
|
|
15
|
+
export declare const offersSignIn: (id: ProviderId) => id is SignInProviderId;
|
|
16
|
+
export declare const providerEndpoints: {
|
|
17
|
+
readonly google: {
|
|
18
|
+
readonly authorize: "https://accounts.google.com/o/oauth2/v2/auth";
|
|
19
|
+
readonly token: "https://oauth2.googleapis.com/token";
|
|
20
|
+
readonly params: {
|
|
21
|
+
readonly access_type: "offline";
|
|
22
|
+
readonly prompt: "consent";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
readonly microsoft: {
|
|
26
|
+
readonly authorize: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
|
|
27
|
+
readonly token: "https://login.microsoftonline.com/common/oauth2/v2.0/token";
|
|
28
|
+
};
|
|
29
|
+
readonly slack: {
|
|
30
|
+
readonly authorize: "https://slack.com/oauth/v2_user/authorize";
|
|
31
|
+
readonly token: "https://slack.com/api/oauth.v2.user.access";
|
|
32
|
+
readonly separator: ",";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const ProviderSource: z.ZodEnum<{
|
|
36
|
+
settings: "settings";
|
|
37
|
+
environment: "environment";
|
|
38
|
+
}>;
|
|
39
|
+
export type ProviderSource = z.infer<typeof ProviderSource>;
|
|
40
|
+
export declare const ProviderListInput: z.ZodObject<{}, z.core.$strict>;
|
|
41
|
+
export type ProviderListInput = z.infer<typeof ProviderListInput>;
|
|
42
|
+
export declare const ProviderUpdateInput: z.ZodObject<{
|
|
43
|
+
providerId: z.ZodEnum<{
|
|
44
|
+
google: "google";
|
|
45
|
+
microsoft: "microsoft";
|
|
46
|
+
slack: "slack";
|
|
47
|
+
}>;
|
|
48
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
49
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
50
|
+
signIn: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
mcp: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export type ProviderUpdateInput = z.infer<typeof ProviderUpdateInput>;
|
|
54
|
+
export declare const ProviderRemoveInput: z.ZodObject<{
|
|
55
|
+
providerId: z.ZodEnum<{
|
|
56
|
+
google: "google";
|
|
57
|
+
microsoft: "microsoft";
|
|
58
|
+
slack: "slack";
|
|
59
|
+
}>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
export type ProviderRemoveInput = z.infer<typeof ProviderRemoveInput>;
|
|
62
|
+
export declare const ProviderTestInput: z.ZodObject<{
|
|
63
|
+
providerId: z.ZodEnum<{
|
|
64
|
+
google: "google";
|
|
65
|
+
microsoft: "microsoft";
|
|
66
|
+
slack: "slack";
|
|
67
|
+
}>;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export type ProviderTestInput = z.infer<typeof ProviderTestInput>;
|
|
70
|
+
export declare const Provider: z.ZodObject<{
|
|
71
|
+
providerId: z.ZodEnum<{
|
|
72
|
+
google: "google";
|
|
73
|
+
microsoft: "microsoft";
|
|
74
|
+
slack: "slack";
|
|
75
|
+
}>;
|
|
76
|
+
clientId: z.ZodNullable<z.ZodString>;
|
|
77
|
+
setAt: z.ZodNullable<z.ZodISODateTime>;
|
|
78
|
+
setBy: z.ZodNullable<z.ZodTemplateLiteral<`user_${string}`>>;
|
|
79
|
+
signIn: z.ZodBoolean;
|
|
80
|
+
mcp: z.ZodBoolean;
|
|
81
|
+
source: z.ZodNullable<z.ZodEnum<{
|
|
82
|
+
settings: "settings";
|
|
83
|
+
environment: "environment";
|
|
84
|
+
}>>;
|
|
85
|
+
signInRedirectUrl: z.ZodNullable<z.ZodURL>;
|
|
86
|
+
mcpRedirectUrl: z.ZodURL;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export type Provider = z.infer<typeof Provider>;
|
|
89
|
+
export declare const ProviderList: z.ZodObject<{
|
|
90
|
+
items: z.ZodArray<z.ZodObject<{
|
|
91
|
+
providerId: z.ZodEnum<{
|
|
92
|
+
google: "google";
|
|
93
|
+
microsoft: "microsoft";
|
|
94
|
+
slack: "slack";
|
|
95
|
+
}>;
|
|
96
|
+
clientId: z.ZodNullable<z.ZodString>;
|
|
97
|
+
setAt: z.ZodNullable<z.ZodISODateTime>;
|
|
98
|
+
setBy: z.ZodNullable<z.ZodTemplateLiteral<`user_${string}`>>;
|
|
99
|
+
signIn: z.ZodBoolean;
|
|
100
|
+
mcp: z.ZodBoolean;
|
|
101
|
+
source: z.ZodNullable<z.ZodEnum<{
|
|
102
|
+
settings: "settings";
|
|
103
|
+
environment: "environment";
|
|
104
|
+
}>>;
|
|
105
|
+
signInRedirectUrl: z.ZodNullable<z.ZodURL>;
|
|
106
|
+
mcpRedirectUrl: z.ZodURL;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
nextCursor: z.ZodNull;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
export type ProviderList = z.infer<typeof ProviderList>;
|
|
111
|
+
export declare const ProviderTest: z.ZodObject<{
|
|
112
|
+
providerId: z.ZodEnum<{
|
|
113
|
+
google: "google";
|
|
114
|
+
microsoft: "microsoft";
|
|
115
|
+
slack: "slack";
|
|
116
|
+
}>;
|
|
117
|
+
ok: z.ZodBoolean;
|
|
118
|
+
problem: z.ZodNullable<z.ZodString>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export type ProviderTest = z.infer<typeof ProviderTest>;
|
|
121
|
+
export declare const SignInProviders: z.ZodObject<{
|
|
122
|
+
providers: z.ZodArray<z.ZodEnum<{
|
|
123
|
+
google: "google";
|
|
124
|
+
microsoft: "microsoft";
|
|
125
|
+
}>>;
|
|
126
|
+
signUp: z.ZodBoolean;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
export type SignInProviders = z.infer<typeof SignInProviders>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { UserId } from "../users/users.js";
|
|
3
|
+
// Einstellungen › Anbieter (E153, #925; until 2026-10-30 Einstellungen › SSO, #358, E90): ONE app per
|
|
4
|
+
// provider, registered by the customer at Google, Microsoft or Slack, with two purposes as switches:
|
|
5
|
+
// the sign-in to Colab (`signIn`) and the employees' MCPs (`mcp`, Einstellungen › MCPs). Slack offers
|
|
6
|
+
// no sign-in to Colab, only MCPs. The id is the provider's word from the code (`google`), not a ULID,
|
|
7
|
+
// like a connector's id: there are exactly these three, and the sign-in page and Better Auth name them
|
|
8
|
+
// so.
|
|
9
|
+
//
|
|
10
|
+
// ⚠️ The client secret goes in and never comes out: no answer carries it, and no field of an answer
|
|
11
|
+
// is called `secret` (`/mcp` would strike it, `redactSecrets`). The input field is `clientSecret`.
|
|
12
|
+
export const providerIds = ["google", "microsoft", "slack"];
|
|
13
|
+
export const ProviderId = z.enum(providerIds);
|
|
14
|
+
// The providers Colab offers a sign-in through. Slack is not one of them (E153).
|
|
15
|
+
export const signInProviderIds = ["google", "microsoft"];
|
|
16
|
+
export const SignInProviderId = z.enum(signInProviderIds);
|
|
17
|
+
export const offersSignIn = (id) => signInProviderIds.includes(id);
|
|
18
|
+
// The provider's OAuth endpoints for an app of its own (E153): an MCP of the catalog signs in there
|
|
19
|
+
// (`operator`), and `access_provider_test` asks the token endpoint. Microsoft's `common` takes an app
|
|
20
|
+
// for any tenant ("Konten in einem beliebigen Organisationsverzeichnis"). Slack's are those of a user
|
|
21
|
+
// token, which its MCP server takes. ⚠️ Proven on the stage only (#35), like the catalog's addresses.
|
|
22
|
+
export const providerEndpoints = {
|
|
23
|
+
google: {
|
|
24
|
+
authorize: "https://accounts.google.com/o/oauth2/v2/auth",
|
|
25
|
+
token: "https://oauth2.googleapis.com/token",
|
|
26
|
+
// Without both, Google hands out no refresh token and the MCP runs out after an hour.
|
|
27
|
+
params: { access_type: "offline", prompt: "consent" },
|
|
28
|
+
},
|
|
29
|
+
microsoft: {
|
|
30
|
+
authorize: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
|
|
31
|
+
token: "https://login.microsoftonline.com/common/oauth2/v2.0/token",
|
|
32
|
+
},
|
|
33
|
+
slack: {
|
|
34
|
+
authorize: "https://slack.com/oauth/v2_user/authorize",
|
|
35
|
+
token: "https://slack.com/api/oauth.v2.user.access",
|
|
36
|
+
// Slack reads its scopes comma-separated.
|
|
37
|
+
separator: ",",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
// Where the sign-in page gets a provider from right now: `settings` (set up here, in the database of
|
|
41
|
+
// `access`), `environment` (the installation's variables; locally `.dev.vars`), or null: not offered.
|
|
42
|
+
// Only the sign-in knows the variables; an app for MCPs exists in the settings alone.
|
|
43
|
+
export const ProviderSource = z.enum(["settings", "environment"]);
|
|
44
|
+
export const ProviderListInput = z.strictObject({});
|
|
45
|
+
// "Einrichten": the app's pair, the purposes, or both. A new client id with the old secret would sign
|
|
46
|
+
// nobody in, so the pair is replaced together; the first setup needs it. A purpose left out keeps its
|
|
47
|
+
// switch (off on a first setup).
|
|
48
|
+
export const ProviderUpdateInput = z.strictObject({
|
|
49
|
+
providerId: ProviderId.describe("The provider: google, microsoft or slack."),
|
|
50
|
+
clientId: z
|
|
51
|
+
.string()
|
|
52
|
+
.trim()
|
|
53
|
+
.min(1)
|
|
54
|
+
.max(512)
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("The client id of the app registered at the provider. Required on the first setup, always together with clientSecret."),
|
|
57
|
+
clientSecret: z
|
|
58
|
+
.string()
|
|
59
|
+
.trim()
|
|
60
|
+
.min(1)
|
|
61
|
+
.max(1024)
|
|
62
|
+
.optional()
|
|
63
|
+
.describe("The client secret of that app, always together with clientId. Stored sealed; no answer ever shows it again."),
|
|
64
|
+
signIn: z
|
|
65
|
+
.boolean()
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("Whether the sign-in page offers this provider (google and microsoft only). Left out: unchanged."),
|
|
68
|
+
mcp: z
|
|
69
|
+
.boolean()
|
|
70
|
+
.optional()
|
|
71
|
+
.describe("Whether the employees' MCPs of this provider (Gmail, Google Calendar, Google Drive; Outlook, Microsoft Teams; Slack) connect through this app. Left out: unchanged."),
|
|
72
|
+
});
|
|
73
|
+
// "Entfernen": the provider's app is deleted at once and without archive. A provider the
|
|
74
|
+
// installation's variables name stays offered for the sign-in from there.
|
|
75
|
+
export const ProviderRemoveInput = z.strictObject({
|
|
76
|
+
providerId: ProviderId.describe("The provider: google, microsoft or slack."),
|
|
77
|
+
});
|
|
78
|
+
// "Testen" of the app itself: does the provider know this client id and secret? The sign-in's own
|
|
79
|
+
// test is a round trip in the person's browser and has no tool (`provider.ts`).
|
|
80
|
+
export const ProviderTestInput = z.strictObject({
|
|
81
|
+
providerId: ProviderId.describe("The provider: google, microsoft or slack."),
|
|
82
|
+
});
|
|
83
|
+
export const Provider = z.object({
|
|
84
|
+
providerId: ProviderId,
|
|
85
|
+
// Set up here: the client id, when and by whom. Null while it is not set up here.
|
|
86
|
+
clientId: z.string().nullable(),
|
|
87
|
+
setAt: z.iso.datetime().nullable(),
|
|
88
|
+
setBy: UserId.nullable(),
|
|
89
|
+
// What the app serves now. `signIn` is always false for Slack.
|
|
90
|
+
signIn: z.boolean(),
|
|
91
|
+
mcp: z.boolean(),
|
|
92
|
+
// Where the sign-in page takes the provider from; null when it offers none.
|
|
93
|
+
source: ProviderSource.nullable(),
|
|
94
|
+
// The addresses to enter at the provider as redirect URIs ("Weiterleitungs-Adresse"), one per
|
|
95
|
+
// purpose, both in the same app. `signInRedirectUrl` is null for Slack.
|
|
96
|
+
signInRedirectUrl: z.url().nullable(),
|
|
97
|
+
mcpRedirectUrl: z.url(),
|
|
98
|
+
});
|
|
99
|
+
export const ProviderList = z.object({
|
|
100
|
+
items: z.array(Provider),
|
|
101
|
+
// Three rows at most: never a further page.
|
|
102
|
+
nextCursor: z.null(),
|
|
103
|
+
});
|
|
104
|
+
// What the provider said to the client id and secret: `ok` when it knows the app, else `problem` in
|
|
105
|
+
// one sentence. Nobody is signed in by the test.
|
|
106
|
+
export const ProviderTest = z.object({
|
|
107
|
+
providerId: ProviderId,
|
|
108
|
+
ok: z.boolean(),
|
|
109
|
+
problem: z.string().nullable(),
|
|
110
|
+
});
|
|
111
|
+
// `GET /auth/providers`, public: which buttons the sign-in page shows, in their order. Nothing else
|
|
112
|
+
// of a provider travels here. `signUp` is true only while no person exists, or only one whose sign-up
|
|
113
|
+
// lapsed unconfirmed (E131): the first one signs up on the page and becomes the main admin (E9,
|
|
114
|
+
// #539); after that it says nothing about anybody.
|
|
115
|
+
export const SignInProviders = z.object({
|
|
116
|
+
providers: z.array(SignInProviderId),
|
|
117
|
+
signUp: z.boolean(),
|
|
118
|
+
});
|
package/dist/runs/runs.d.ts
CHANGED
|
@@ -102,25 +102,25 @@ export declare const RunList: z.ZodObject<{
|
|
|
102
102
|
export type RunList = z.infer<typeof RunList>;
|
|
103
103
|
export declare const RunDetail: z.ZodObject<{
|
|
104
104
|
counts: z.ZodNullable<z.ZodRecord<z.ZodEnum<{
|
|
105
|
+
archive: "archive";
|
|
105
106
|
backlog: "backlog";
|
|
106
107
|
open: "open";
|
|
107
108
|
progress: "progress";
|
|
108
109
|
done: "done";
|
|
109
110
|
discarded: "discarded";
|
|
110
111
|
blocked: "blocked";
|
|
111
|
-
archive: "archive";
|
|
112
112
|
}> & z.core.$partial, z.ZodNumber>>;
|
|
113
113
|
columns: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
114
114
|
columnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
115
115
|
name: z.ZodString;
|
|
116
116
|
type: z.ZodEnum<{
|
|
117
|
+
archive: "archive";
|
|
117
118
|
backlog: "backlog";
|
|
118
119
|
open: "open";
|
|
119
120
|
progress: "progress";
|
|
120
121
|
done: "done";
|
|
121
122
|
discarded: "discarded";
|
|
122
123
|
blocked: "blocked";
|
|
123
|
-
archive: "archive";
|
|
124
124
|
}>;
|
|
125
125
|
tasks: z.ZodNumber;
|
|
126
126
|
}, z.core.$strip>>>;
|
|
@@ -131,8 +131,8 @@ export declare const RunDetail: z.ZodObject<{
|
|
|
131
131
|
message: "message";
|
|
132
132
|
user: "user";
|
|
133
133
|
package: "package";
|
|
134
|
-
target: "target";
|
|
135
134
|
search: "search";
|
|
135
|
+
target: "target";
|
|
136
136
|
calendar: "calendar";
|
|
137
137
|
flag: "flag";
|
|
138
138
|
route: "route";
|
package/dist/runtime-config.d.ts
CHANGED
|
@@ -8,5 +8,17 @@ export declare const RuntimeConfig: z.ZodObject<{
|
|
|
8
8
|
en: "en";
|
|
9
9
|
de: "de";
|
|
10
10
|
}>;
|
|
11
|
+
organisationLanguage: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
12
|
+
en: "en";
|
|
13
|
+
de: "de";
|
|
14
|
+
}>>>;
|
|
15
|
+
organisationTimeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
organisationCurrency: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
17
|
+
EUR: "EUR";
|
|
18
|
+
USD: "USD";
|
|
19
|
+
CHF: "CHF";
|
|
20
|
+
GBP: "GBP";
|
|
21
|
+
}>>>;
|
|
22
|
+
organisationCurrencyRate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
11
23
|
}, z.core.$strip>;
|
|
12
24
|
export type RuntimeConfig = z.infer<typeof RuntimeConfig>;
|
package/dist/runtime-config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { Currency, CurrencyRate } from "./organisation/organisation.js";
|
|
2
3
|
// What the UI learns from the Worker at `GET /config.json` before it renders (#19). One build serves
|
|
3
4
|
// every installation, so nothing installation-specific may be baked into the bundle.
|
|
4
5
|
//
|
|
@@ -15,4 +16,13 @@ export const RuntimeConfig = z.object({
|
|
|
15
16
|
name: z.string(),
|
|
16
17
|
// The installation's default UI language, used when the browser asks for none Colab speaks.
|
|
17
18
|
language: z.enum(["en", "de"]),
|
|
19
|
+
// The defaults an admin set under Organisation › System (#930), null while unset: the language
|
|
20
|
+
// goes before the browser's for a person without their own, the zone is every time's lens for a
|
|
21
|
+
// person without their own. Optional: an older Worker does not send them.
|
|
22
|
+
organisationLanguage: z.enum(["en", "de"]).nullable().optional(),
|
|
23
|
+
organisationTimeZone: z.string().nullable().optional(),
|
|
24
|
+
// The currency amounts show in and its fixed rate (1 USD = rate), null while unset: amounts stay
|
|
25
|
+
// stored in US dollars and only the UI converts.
|
|
26
|
+
organisationCurrency: Currency.nullable().optional(),
|
|
27
|
+
organisationCurrencyRate: CurrencyRate.nullable().optional(),
|
|
18
28
|
});
|