@meistrari/chat-nuxt 4.10.0-rc.16 → 4.10.0-rc.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/embed/components/chat-embed-inner.vue +1 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +1 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +2 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +1 -0
- package/dist/runtime/types/schemas/integrations/slack-apps.d.ts +53 -0
- package/dist/runtime/types/schemas/integrations/slack-apps.js +6 -0
- package/dist/runtime/types/schemas/integrations/slack-identity.d.ts +26 -0
- package/dist/runtime/types/schemas/integrations/slack-identity.js +23 -0
- package/dist/runtime/types/schemas/integrations/tela-auth.d.ts +39 -0
- package/dist/runtime/types/schemas/integrations/tela-auth.js +12 -0
- package/dist/runtime/types/schemas/slack/apps.d.ts +144 -0
- package/dist/runtime/types/schemas/slack/apps.js +53 -0
- package/dist/runtime/types/schemas/slack/identities.d.ts +58 -0
- package/dist/runtime/types/schemas/slack/identities.js +19 -0
- package/dist/runtime/types/schemas/slack/installations.d.ts +39 -0
- package/dist/runtime/types/schemas/slack/installations.js +18 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1012,6 +1012,7 @@ async function handleDelete() {
|
|
|
1012
1012
|
:generating-title="generatingTitle"
|
|
1013
1013
|
:has-messages="hasMessages"
|
|
1014
1014
|
:has-pending-message="composerLocked"
|
|
1015
|
+
:draft-storage-key="draftStorageKey"
|
|
1015
1016
|
:hide-settings="hideSettings"
|
|
1016
1017
|
:hide-sidebar="hideSidebar"
|
|
1017
1018
|
:is-editing="isEditing"
|
|
@@ -27,6 +27,7 @@ const props = defineProps({
|
|
|
27
27
|
conversationsLoading: { type: Boolean, required: false },
|
|
28
28
|
conversationFiles: { type: Array, required: true },
|
|
29
29
|
drawerOpen: { type: Boolean, required: true },
|
|
30
|
+
draftStorageKey: { type: [String, null], required: false },
|
|
30
31
|
editTitle: { type: String, required: true },
|
|
31
32
|
filesCount: { type: Number, required: true },
|
|
32
33
|
generatingTitle: { type: Boolean, required: false },
|
|
@@ -235,6 +236,7 @@ function startNewConversationFromOutdatedSettings() {
|
|
|
235
236
|
v-model:selected-model="selectedModel"
|
|
236
237
|
v-model:selected-reasoning-effort="selectedReasoningEffort"
|
|
237
238
|
:loading="hasPendingMessage"
|
|
239
|
+
:draft-storage-key="draftStorageKey"
|
|
238
240
|
:creator-name="currentUser?.name ?? void 0"
|
|
239
241
|
:creator-email="currentUser?.email ?? void 0"
|
|
240
242
|
:creator-image="currentUser?.image ?? void 0"
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export type SlackOutcome<T> = {
|
|
3
|
+
kind: 'ok';
|
|
4
|
+
value: T;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'rejected';
|
|
7
|
+
error: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'rate_limited';
|
|
10
|
+
retryAfter: number;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'unknown';
|
|
13
|
+
appId?: string;
|
|
14
|
+
};
|
|
15
|
+
export interface CreatedApp {
|
|
16
|
+
appId: string;
|
|
17
|
+
credentials: {
|
|
18
|
+
clientId: string;
|
|
19
|
+
clientSecret: string;
|
|
20
|
+
signingSecret: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface RotatedConfigToken {
|
|
24
|
+
token: string;
|
|
25
|
+
refreshToken: string;
|
|
26
|
+
teamId: string;
|
|
27
|
+
userId: string;
|
|
28
|
+
exp: number;
|
|
29
|
+
}
|
|
30
|
+
export declare const slackAppIdSchema: z.ZodString;
|
|
31
|
+
export declare const slackApiResponseSchema: z.ZodObject<{
|
|
32
|
+
ok: z.ZodBoolean;
|
|
33
|
+
error: z.ZodOptional<z.ZodString>;
|
|
34
|
+
app_id: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$loose>;
|
|
36
|
+
export declare const slackCreatedAppResponseSchema: z.ZodObject<{
|
|
37
|
+
app_id: z.ZodString;
|
|
38
|
+
credentials: z.ZodObject<{
|
|
39
|
+
client_id: z.ZodString;
|
|
40
|
+
client_secret: z.ZodString;
|
|
41
|
+
signing_secret: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const slackExportedManifestResponseSchema: z.ZodObject<{
|
|
45
|
+
manifest: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export declare const slackRotatedConfigTokenResponseSchema: z.ZodObject<{
|
|
48
|
+
token: z.ZodString;
|
|
49
|
+
refresh_token: z.ZodString;
|
|
50
|
+
team_id: z.ZodString;
|
|
51
|
+
user_id: z.ZodString;
|
|
52
|
+
exp: z.ZodNumber;
|
|
53
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const slackAppIdSchema = z.string().regex(/^A[A-Z0-9]+$/).max(100);
|
|
3
|
+
export const slackApiResponseSchema = z.object({ ok: z.boolean(), error: z.string().max(200).optional(), app_id: slackAppIdSchema.optional() }).passthrough();
|
|
4
|
+
export const slackCreatedAppResponseSchema = z.object({ app_id: slackAppIdSchema, credentials: z.object({ client_id: z.string().regex(/^\d+\.\d+$/).max(100), client_secret: z.string().min(1).max(2000), signing_secret: z.string().min(1).max(2000) }) });
|
|
5
|
+
export const slackExportedManifestResponseSchema = z.object({ manifest: z.record(z.string(), z.unknown()) });
|
|
6
|
+
export const slackRotatedConfigTokenResponseSchema = z.object({ token: z.string().regex(/^xoxe\.xoxp-[\w-]+$/).max(4000), refresh_token: z.string().regex(/^xoxe-[\w-]+$/).max(4000), team_id: z.string().regex(/^T[A-Z0-9]+$/).max(100), user_id: z.string().regex(/^U[A-Z0-9]+$/).max(100), exp: z.number().int().positive() });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const slackIdTokenHeaderSchema: z.ZodObject<{
|
|
3
|
+
alg: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const slackIdTokenClaimsSchema: z.ZodObject<{
|
|
6
|
+
iss: z.ZodLiteral<"https://slack.com">;
|
|
7
|
+
sub: z.ZodString;
|
|
8
|
+
aud: z.ZodString;
|
|
9
|
+
exp: z.ZodNumber;
|
|
10
|
+
nonce: z.ZodString;
|
|
11
|
+
'https://slack.com/team_id': z.ZodString;
|
|
12
|
+
'https://slack.com/user_id': z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const slackOpenIdTokenSchema: z.ZodObject<{
|
|
15
|
+
ok: z.ZodLiteral<true>;
|
|
16
|
+
access_token: z.ZodString;
|
|
17
|
+
id_token: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const slackUserInfoSchema: z.ZodObject<{
|
|
20
|
+
ok: z.ZodLiteral<true>;
|
|
21
|
+
sub: z.ZodString;
|
|
22
|
+
'https://slack.com/user_id': z.ZodString;
|
|
23
|
+
'https://slack.com/team_id': z.ZodString;
|
|
24
|
+
'https://slack.com/team_name': z.ZodOptional<z.ZodString>;
|
|
25
|
+
name: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const slackUserId = z.string().regex(/^[UW][A-Z0-9]{1,99}$/);
|
|
3
|
+
const slackTeamId = z.string().regex(/^T[A-Z0-9]{1,99}$/);
|
|
4
|
+
export const slackIdTokenHeaderSchema = z.object({ alg: z.string().min(1).max(20) });
|
|
5
|
+
export const slackIdTokenClaimsSchema = z.object({
|
|
6
|
+
'iss': z.literal('https://slack.com'),
|
|
7
|
+
'sub': slackUserId,
|
|
8
|
+
'aud': z.string(),
|
|
9
|
+
'exp': z.number(),
|
|
10
|
+
'nonce': z.string(),
|
|
11
|
+
'https://slack.com/team_id': slackTeamId,
|
|
12
|
+
'https://slack.com/user_id': slackUserId,
|
|
13
|
+
});
|
|
14
|
+
export const slackOpenIdTokenSchema = z.object({ ok: z.literal(true), access_token: z.string().min(1).max(4096), id_token: z.string().min(1).max(16_384) });
|
|
15
|
+
// openid.connect.userInfo documents the workspace name; the ID token does not.
|
|
16
|
+
export const slackUserInfoSchema = z.object({
|
|
17
|
+
'ok': z.literal(true),
|
|
18
|
+
'sub': z.string(),
|
|
19
|
+
'https://slack.com/user_id': z.string(),
|
|
20
|
+
'https://slack.com/team_id': z.string(),
|
|
21
|
+
'https://slack.com/team_name': z.string().min(1).optional(),
|
|
22
|
+
'name': z.string().min(1).optional(),
|
|
23
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const organizationSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const identitySchema: z.ZodObject<{
|
|
7
|
+
user: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
name: z.ZodOptional<z.ZodString>;
|
|
10
|
+
email: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
organization: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const tokensSchema: z.ZodObject<{
|
|
18
|
+
user: z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
name: z.ZodOptional<z.ZodString>;
|
|
21
|
+
email: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
organization: z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
accessToken: z.ZodString;
|
|
28
|
+
refreshToken: z.ZodString;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const deviceSchema: z.ZodObject<{
|
|
31
|
+
device_code: z.ZodString;
|
|
32
|
+
user_code: z.ZodString;
|
|
33
|
+
verification_uri: z.ZodURL;
|
|
34
|
+
verification_uri_complete: z.ZodURL;
|
|
35
|
+
expires_in: z.ZodNumber;
|
|
36
|
+
interval: z.ZodNumber;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type AuthTokens = z.infer<typeof tokensSchema>;
|
|
39
|
+
export type DeviceAuthorization = z.infer<typeof deviceSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const organizationSchema = z.object({ id: z.string().min(1), name: z.string() });
|
|
3
|
+
export const identitySchema = z.object({ user: z.object({ id: z.string().min(1), name: z.string().max(300).optional(), email: z.string().max(320).optional() }), organization: organizationSchema });
|
|
4
|
+
export const tokensSchema = identitySchema.extend({ accessToken: z.string().min(1), refreshToken: z.string().min(1) });
|
|
5
|
+
export const deviceSchema = z.object({
|
|
6
|
+
device_code: z.string().min(1),
|
|
7
|
+
user_code: z.string().min(1),
|
|
8
|
+
verification_uri: z.url(),
|
|
9
|
+
verification_uri_complete: z.url(),
|
|
10
|
+
expires_in: z.number().int().positive(),
|
|
11
|
+
interval: z.number().int().positive(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const credentialsSchema: z.ZodObject<{
|
|
3
|
+
clientId: z.ZodString;
|
|
4
|
+
clientSecret: z.ZodString;
|
|
5
|
+
signingSecret: z.ZodString;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const registrationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
|
+
role: z.ZodLiteral<"manager">;
|
|
9
|
+
appId: z.ZodString;
|
|
10
|
+
teamId: z.ZodString;
|
|
11
|
+
creatorId: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
credentials: z.ZodObject<{
|
|
14
|
+
clientId: z.ZodString;
|
|
15
|
+
clientSecret: z.ZodString;
|
|
16
|
+
signingSecret: z.ZodString;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
19
|
+
role: z.ZodLiteral<"dedicated">;
|
|
20
|
+
workspaceId: z.ZodUUID;
|
|
21
|
+
agentId: z.ZodUUID;
|
|
22
|
+
appId: z.ZodString;
|
|
23
|
+
teamId: z.ZodString;
|
|
24
|
+
creatorId: z.ZodString;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
credentials: z.ZodObject<{
|
|
27
|
+
clientId: z.ZodString;
|
|
28
|
+
clientSecret: z.ZodString;
|
|
29
|
+
signingSecret: z.ZodString;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
}, z.core.$strict>], "role">;
|
|
32
|
+
export type AppCredentials = z.infer<typeof credentialsSchema>;
|
|
33
|
+
export declare const appNameSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
34
|
+
export declare const botStatuses: readonly ["creating", "configuring", "awaiting_distribution", "awaiting_installation", "active", "uninstalled", "failed", "unknown", "deactivated", "deleting", "delete_failed", "deleted"];
|
|
35
|
+
export declare const botStatusSchema: z.ZodEnum<{
|
|
36
|
+
unknown: "unknown";
|
|
37
|
+
failed: "failed";
|
|
38
|
+
creating: "creating";
|
|
39
|
+
configuring: "configuring";
|
|
40
|
+
awaiting_distribution: "awaiting_distribution";
|
|
41
|
+
awaiting_installation: "awaiting_installation";
|
|
42
|
+
active: "active";
|
|
43
|
+
uninstalled: "uninstalled";
|
|
44
|
+
deactivated: "deactivated";
|
|
45
|
+
deleting: "deleting";
|
|
46
|
+
delete_failed: "delete_failed";
|
|
47
|
+
deleted: "deleted";
|
|
48
|
+
}>;
|
|
49
|
+
export declare const botTargetSchema: z.ZodObject<{
|
|
50
|
+
actorId: z.ZodString;
|
|
51
|
+
workspaceId: z.ZodUUID;
|
|
52
|
+
agentId: z.ZodUUID;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export declare const botRequestSchema: z.ZodObject<{
|
|
55
|
+
actorId: z.ZodString;
|
|
56
|
+
workspaceId: z.ZodUUID;
|
|
57
|
+
agentId: z.ZodUUID;
|
|
58
|
+
teamId: z.ZodString;
|
|
59
|
+
workspaceName: z.ZodString;
|
|
60
|
+
agentName: z.ZodString;
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
requestKey: z.ZodUUID;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export declare const botChangesSchema: z.ZodObject<{
|
|
65
|
+
actorId: z.ZodString;
|
|
66
|
+
workspaceId: z.ZodUUID;
|
|
67
|
+
agentId: z.ZodUUID;
|
|
68
|
+
name: z.ZodOptional<z.ZodString>;
|
|
69
|
+
addAdminActorIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
removeAdminSlackUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export declare const botIdSchema: z.ZodUUID;
|
|
73
|
+
export type BotTarget = z.infer<typeof botTargetSchema>;
|
|
74
|
+
export type BotRequest = z.infer<typeof botRequestSchema>;
|
|
75
|
+
export type BotChanges = z.infer<typeof botChangesSchema> & {
|
|
76
|
+
botId: z.infer<typeof botIdSchema>;
|
|
77
|
+
};
|
|
78
|
+
export type BotAction = BotTarget & {
|
|
79
|
+
botId: z.infer<typeof botIdSchema>;
|
|
80
|
+
};
|
|
81
|
+
export type BotStatus = z.infer<typeof botStatusSchema>;
|
|
82
|
+
export declare const botAdministratorSchema: z.ZodObject<{
|
|
83
|
+
slackUserId: z.ZodString;
|
|
84
|
+
actorId: z.ZodNullable<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export declare const botSchema: z.ZodObject<{
|
|
87
|
+
id: z.ZodUUID;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
teamId: z.ZodString;
|
|
90
|
+
teamName: z.ZodNullable<z.ZodString>;
|
|
91
|
+
status: z.ZodEnum<{
|
|
92
|
+
unknown: "unknown";
|
|
93
|
+
failed: "failed";
|
|
94
|
+
creating: "creating";
|
|
95
|
+
configuring: "configuring";
|
|
96
|
+
awaiting_distribution: "awaiting_distribution";
|
|
97
|
+
awaiting_installation: "awaiting_installation";
|
|
98
|
+
active: "active";
|
|
99
|
+
uninstalled: "uninstalled";
|
|
100
|
+
deactivated: "deactivated";
|
|
101
|
+
deleting: "deleting";
|
|
102
|
+
delete_failed: "delete_failed";
|
|
103
|
+
deleted: "deleted";
|
|
104
|
+
}>;
|
|
105
|
+
error: z.ZodNullable<z.ZodString>;
|
|
106
|
+
updating: z.ZodBoolean;
|
|
107
|
+
openUrl: z.ZodNullable<z.ZodURL>;
|
|
108
|
+
creatorActorId: z.ZodString;
|
|
109
|
+
admins: z.ZodArray<z.ZodObject<{
|
|
110
|
+
slackUserId: z.ZodString;
|
|
111
|
+
actorId: z.ZodNullable<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
manageable: z.ZodBoolean;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export type BotAdministrator = z.infer<typeof botAdministratorSchema>;
|
|
116
|
+
export type Bot = z.infer<typeof botSchema>;
|
|
117
|
+
export declare const operationResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
118
|
+
resolution: z.ZodLiteral<"absent">;
|
|
119
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
120
|
+
resolution: z.ZodLiteral<"created">;
|
|
121
|
+
appId: z.ZodString;
|
|
122
|
+
credentials: z.ZodObject<{
|
|
123
|
+
clientId: z.ZodString;
|
|
124
|
+
clientSecret: z.ZodString;
|
|
125
|
+
signingSecret: z.ZodString;
|
|
126
|
+
}, z.core.$strict>;
|
|
127
|
+
}, z.core.$strict>], "resolution">;
|
|
128
|
+
export declare const configTokenPairSchema: z.ZodObject<{
|
|
129
|
+
accessToken: z.ZodString;
|
|
130
|
+
refreshToken: z.ZodString;
|
|
131
|
+
}, z.core.$strict>;
|
|
132
|
+
export declare const configTokenImportSchema: z.ZodObject<{
|
|
133
|
+
expiresAt: z.ZodNumber;
|
|
134
|
+
accessToken: z.ZodString;
|
|
135
|
+
refreshToken: z.ZodString;
|
|
136
|
+
teamId: z.ZodString;
|
|
137
|
+
userId: z.ZodString;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
export type ConfigTokenPair = z.infer<typeof configTokenPairSchema>;
|
|
140
|
+
export declare const botInstallLinkSchema: z.ZodObject<{
|
|
141
|
+
url: z.ZodURL;
|
|
142
|
+
expiresAt: z.ZodISODateTime;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
export type BotInstallLink = z.infer<typeof botInstallLinkSchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { actorIdSchema } from './identities';
|
|
3
|
+
export const credentialsSchema = z.strictObject({
|
|
4
|
+
clientId: z.string().regex(/^\d+\.\d+$/),
|
|
5
|
+
clientSecret: z.string().min(1).max(2000),
|
|
6
|
+
signingSecret: z.string().min(1).max(2000),
|
|
7
|
+
});
|
|
8
|
+
const common = {
|
|
9
|
+
appId: z.string().regex(/^A[A-Z0-9]+$/),
|
|
10
|
+
teamId: z.string().regex(/^T[A-Z0-9]+$/),
|
|
11
|
+
creatorId: z.string().regex(/^[UW][A-Z0-9]+$/),
|
|
12
|
+
name: z.string().trim().min(1).max(80),
|
|
13
|
+
credentials: credentialsSchema,
|
|
14
|
+
};
|
|
15
|
+
export const registrationSchema = z.discriminatedUnion('role', [
|
|
16
|
+
z.strictObject({ ...common, role: z.literal('manager') }),
|
|
17
|
+
z.strictObject({ ...common, role: z.literal('dedicated'), workspaceId: z.uuid(), agentId: z.uuid() }),
|
|
18
|
+
]);
|
|
19
|
+
// Slack limits app names to 35 characters. Plain words only: no mention, link or mrkdwn syntax.
|
|
20
|
+
export const appNameSchema = z.string().max(200).transform(value => value.normalize('NFC').trim().replace(/ {2,}/g, ' ')).pipe(z.string().min(1).max(35).regex(/^[\p{L}\p{N}][\p{L}\p{N} .'()·-]*$/u));
|
|
21
|
+
export const botStatuses = ['creating', 'configuring', 'awaiting_distribution', 'awaiting_installation', 'active', 'uninstalled', 'failed', 'unknown', 'deactivated', 'deleting', 'delete_failed', 'deleted'];
|
|
22
|
+
export const botStatusSchema = z.enum(botStatuses);
|
|
23
|
+
export const botTargetSchema = z.object({ actorId: actorIdSchema, workspaceId: z.uuid(), agentId: z.uuid() });
|
|
24
|
+
// Workspace and agent names are Tela's current titles, shown in the Slack app; the name is validated by the bot rules.
|
|
25
|
+
export const botRequestSchema = botTargetSchema.extend({ teamId: z.string().regex(/^T[A-Z0-9]+$/).max(100), workspaceName: z.string().min(1).max(200), agentName: z.string().min(1).max(200), name: z.string().max(200), requestKey: z.uuid() });
|
|
26
|
+
export const botChangesSchema = botTargetSchema.extend({ name: z.string().max(200).optional(), addAdminActorIds: z.array(actorIdSchema).max(20).optional(), removeAdminSlackUserIds: z.array(z.string().regex(/^[UW][A-Z0-9]{1,99}$/)).max(20).optional() });
|
|
27
|
+
export const botIdSchema = z.uuid();
|
|
28
|
+
export const botAdministratorSchema = z.object({
|
|
29
|
+
slackUserId: z.string(),
|
|
30
|
+
actorId: z.string().nullable().describe('The administrator\'s Tela account while their Slack identity in the bot\'s team is connected.'),
|
|
31
|
+
});
|
|
32
|
+
export const botSchema = z.object({
|
|
33
|
+
id: z.uuid().describe('The bot id: its app registration id, reserved before the Slack app exists.'),
|
|
34
|
+
name: z.string(),
|
|
35
|
+
teamId: z.string().describe('Slack workspace the bot is installed in.'),
|
|
36
|
+
teamName: z.string().nullable().describe('Workspace name learned from Sign in with Slack.'),
|
|
37
|
+
status: botStatusSchema,
|
|
38
|
+
error: z.string().nullable().describe('Why provisioning failed or is unknown, or why a deletion waits or failed.'),
|
|
39
|
+
updating: z.boolean().describe('A rename is being applied to the Slack app.'),
|
|
40
|
+
openUrl: z.url().nullable().describe('Slack deep link, only while the bot is installed.'),
|
|
41
|
+
creatorActorId: z.string(),
|
|
42
|
+
// An administrator's Tela account while their Slack identity in the bot's team is connected, otherwise null.
|
|
43
|
+
admins: z.array(botAdministratorSchema),
|
|
44
|
+
manageable: z.boolean().describe('The actor manages the bot: its creator or a designated administrator, through a single active Slack identity in its team.'),
|
|
45
|
+
});
|
|
46
|
+
const createdCredentialsSchema = z.strictObject({ clientId: z.string().regex(/^\d+\.\d+$/).max(100), clientSecret: z.string().min(1).max(2000), signingSecret: z.string().min(1).max(2000) });
|
|
47
|
+
export const operationResolutionSchema = z.discriminatedUnion('resolution', [
|
|
48
|
+
z.strictObject({ resolution: z.literal('absent') }),
|
|
49
|
+
z.strictObject({ resolution: z.literal('created'), appId: z.string().regex(/^A[A-Z0-9]+$/).max(100), credentials: createdCredentialsSchema }),
|
|
50
|
+
]);
|
|
51
|
+
export const configTokenPairSchema = z.strictObject({ accessToken: z.string().regex(/^xoxe\.xoxp-[\w-]+$/).max(4000), refreshToken: z.string().regex(/^xoxe-[\w-]+$/).max(4000) });
|
|
52
|
+
export const configTokenImportSchema = z.strictObject({ teamId: z.string().regex(/^T[A-Z0-9]+$/).max(100), userId: z.string().regex(/^U[A-Z0-9]+$/).max(100), ...configTokenPairSchema.shape, expiresAt: z.number().int().positive() });
|
|
53
|
+
export const botInstallLinkSchema = z.object({ url: z.url(), expiresAt: z.iso.datetime() });
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const actorIdSchema: z.ZodString;
|
|
3
|
+
export declare const actorSchema: z.ZodObject<{
|
|
4
|
+
actorId: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const onboardingStartSchema: z.ZodObject<{
|
|
7
|
+
actorId: z.ZodString;
|
|
8
|
+
agentId: z.ZodUUID;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type OnboardingStart = z.infer<typeof onboardingStartSchema>;
|
|
11
|
+
export declare const onboardingIdSchema: z.ZodUUID;
|
|
12
|
+
export declare const onboardingStates: readonly ["created", "redirected", "identifying", "approving", "exchanging", "identity", "connected", "failed", "expired"];
|
|
13
|
+
export declare const onboardingStateSchema: z.ZodEnum<{
|
|
14
|
+
failed: "failed";
|
|
15
|
+
expired: "expired";
|
|
16
|
+
connected: "connected";
|
|
17
|
+
created: "created";
|
|
18
|
+
redirected: "redirected";
|
|
19
|
+
identifying: "identifying";
|
|
20
|
+
approving: "approving";
|
|
21
|
+
exchanging: "exchanging";
|
|
22
|
+
identity: "identity";
|
|
23
|
+
}>;
|
|
24
|
+
export declare const slackIdentitySchema: z.ZodObject<{
|
|
25
|
+
teamId: z.ZodString;
|
|
26
|
+
teamName: z.ZodNullable<z.ZodString>;
|
|
27
|
+
slackUserId: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export declare const onboardingViewSchema: z.ZodObject<{
|
|
30
|
+
id: z.ZodUUID;
|
|
31
|
+
state: z.ZodEnum<{
|
|
32
|
+
failed: "failed";
|
|
33
|
+
expired: "expired";
|
|
34
|
+
connected: "connected";
|
|
35
|
+
created: "created";
|
|
36
|
+
redirected: "redirected";
|
|
37
|
+
identifying: "identifying";
|
|
38
|
+
approving: "approving";
|
|
39
|
+
exchanging: "exchanging";
|
|
40
|
+
identity: "identity";
|
|
41
|
+
}>;
|
|
42
|
+
error: z.ZodNullable<z.ZodString>;
|
|
43
|
+
identity: z.ZodNullable<z.ZodObject<{
|
|
44
|
+
teamId: z.ZodString;
|
|
45
|
+
teamName: z.ZodNullable<z.ZodString>;
|
|
46
|
+
slackUserId: z.ZodString;
|
|
47
|
+
slackUserName: z.ZodNullable<z.ZodString>;
|
|
48
|
+
replacesExisting: z.ZodBoolean;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type OnboardingState = z.infer<typeof onboardingStateSchema>;
|
|
52
|
+
export type SlackIdentity = z.infer<typeof slackIdentitySchema>;
|
|
53
|
+
export type OnboardingView = z.infer<typeof onboardingViewSchema>;
|
|
54
|
+
export declare const onboardingStartResultSchema: z.ZodObject<{
|
|
55
|
+
id: z.ZodUUID;
|
|
56
|
+
startUrl: z.ZodURL;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export type OnboardingStartResult = z.infer<typeof onboardingStartResultSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const actorIdSchema = z.string().min(1).max(100);
|
|
3
|
+
export const actorSchema = z.object({ actorId: actorIdSchema });
|
|
4
|
+
export const onboardingStartSchema = z.object({ actorId: actorIdSchema, agentId: z.uuid() });
|
|
5
|
+
export const onboardingIdSchema = z.uuid();
|
|
6
|
+
export const onboardingStates = ['created', 'redirected', 'identifying', 'approving', 'exchanging', 'identity', 'connected', 'failed', 'expired'];
|
|
7
|
+
export const onboardingStateSchema = z.enum(onboardingStates);
|
|
8
|
+
export const slackIdentitySchema = z.object({ teamId: z.string(), teamName: z.string().nullable(), slackUserId: z.string() });
|
|
9
|
+
export const onboardingViewSchema = z.object({
|
|
10
|
+
id: z.uuid(),
|
|
11
|
+
state: onboardingStateSchema.describe('An unfinished onboarding past its lifetime, or an identity whose confirmation window lapsed, reads as `expired`.'),
|
|
12
|
+
error: z.string().nullable().describe('Why the onboarding failed.'),
|
|
13
|
+
// The Slack identity awaiting the member's confirmation; only in the `identity` state.
|
|
14
|
+
identity: slackIdentitySchema.extend({
|
|
15
|
+
slackUserName: z.string().nullable(),
|
|
16
|
+
replacesExisting: z.boolean().describe('Confirming disconnects the Tela account the Slack member had connected.'),
|
|
17
|
+
}).nullable().describe('The Slack identity awaiting the actor\'s confirmation, only in the `identity` state.'),
|
|
18
|
+
});
|
|
19
|
+
export const onboardingStartResultSchema = z.object({ id: z.uuid(), startUrl: z.url() });
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const installationSchema: z.ZodObject<{
|
|
3
|
+
appId: z.ZodString;
|
|
4
|
+
authVersion: z.ZodLiteral<"v2">;
|
|
5
|
+
tokenType: z.ZodLiteral<"bot">;
|
|
6
|
+
isEnterpriseInstall: z.ZodLiteral<false>;
|
|
7
|
+
team: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
user: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
token: z.ZodUndefined;
|
|
13
|
+
refreshToken: z.ZodUndefined;
|
|
14
|
+
expiresAt: z.ZodUndefined;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
bot: z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
userId: z.ZodString;
|
|
19
|
+
token: z.ZodString;
|
|
20
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
21
|
+
refreshToken: z.ZodUndefined;
|
|
22
|
+
expiresAt: z.ZodUndefined;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
metadata: z.ZodUUID;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export declare const installationCallbackQuerySchema: z.ZodObject<{
|
|
27
|
+
code: z.ZodString;
|
|
28
|
+
state: z.ZodString;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const installationRevocationSchema: z.ZodObject<{
|
|
31
|
+
eventId: z.ZodString;
|
|
32
|
+
eventTime: z.ZodNumber;
|
|
33
|
+
type: z.ZodEnum<{
|
|
34
|
+
app_uninstalled: "app_uninstalled";
|
|
35
|
+
tokens_revoked: "tokens_revoked";
|
|
36
|
+
}>;
|
|
37
|
+
botUserIds: z.ZodArray<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type InstallationRevocation = z.infer<typeof installationRevocationSchema>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const installationSchema = z.object({
|
|
3
|
+
appId: z.string(),
|
|
4
|
+
authVersion: z.literal('v2'),
|
|
5
|
+
tokenType: z.literal('bot'),
|
|
6
|
+
isEnterpriseInstall: z.literal(false),
|
|
7
|
+
team: z.object({ id: z.string() }),
|
|
8
|
+
user: z.object({ id: z.string(), token: z.undefined(), refreshToken: z.undefined(), expiresAt: z.undefined() }),
|
|
9
|
+
bot: z.object({ id: z.string().regex(/^B[A-Z0-9]+$/), userId: z.string().regex(/^U[A-Z0-9]+$/), token: z.string().regex(/^xoxb-[\w-]+$/).max(2000), scopes: z.array(z.string()), refreshToken: z.undefined(), expiresAt: z.undefined() }),
|
|
10
|
+
metadata: z.uuid(),
|
|
11
|
+
});
|
|
12
|
+
export const installationCallbackQuerySchema = z.object({ code: z.string().max(2000), state: z.string().regex(/^[a-f0-9]{64}$/) });
|
|
13
|
+
export const installationRevocationSchema = z.object({
|
|
14
|
+
eventId: z.string(),
|
|
15
|
+
eventTime: z.number(),
|
|
16
|
+
type: z.enum(['app_uninstalled', 'tokens_revoked']),
|
|
17
|
+
botUserIds: z.array(z.string()),
|
|
18
|
+
});
|