@headless-lms/server 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/app/community-mail.d.ts +5 -3
- package/dist/app/community-mail.js +60 -12
- package/dist/app/community-mail.js.map +1 -1
- package/dist/app/container.d.ts +24 -3
- package/dist/app/container.js +102 -38
- package/dist/app/container.js.map +1 -1
- package/dist/app/notification-channels.js +1 -0
- package/dist/app/notification-channels.js.map +1 -1
- package/dist/app/notification-reads.d.ts +3 -3
- package/dist/app/notification-reads.js +7 -28
- package/dist/app/notification-reads.js.map +1 -1
- package/dist/app/platform.d.ts +14 -0
- package/dist/app/platform.js +14 -0
- package/dist/app/platform.js.map +1 -0
- package/dist/http/config.d.ts +4 -0
- package/dist/http/errors.js +9 -4
- package/dist/http/errors.js.map +1 -1
- package/dist/http/fastify.d.ts +8 -0
- package/dist/http/mcp/catalogue.d.ts +11 -9
- package/dist/http/mcp/catalogue.js +15 -21
- package/dist/http/mcp/catalogue.js.map +1 -1
- package/dist/http/mcp/challenge.js +3 -3
- package/dist/http/mcp/challenge.js.map +1 -1
- package/dist/http/mcp/route.js +7 -7
- package/dist/http/mcp/route.js.map +1 -1
- package/dist/http/mcp/test-support.d.ts +6 -5
- package/dist/http/mcp/test-support.js +32 -11
- package/dist/http/mcp/test-support.js.map +1 -1
- package/dist/http/mcp/tool.d.ts +3 -9
- package/dist/http/mcp/tool.js +14 -6
- package/dist/http/mcp/tool.js.map +1 -1
- package/dist/http/mcp/tools/automations.js +10 -20
- package/dist/http/mcp/tools/automations.js.map +1 -1
- package/dist/http/mcp/tools/catalog.js +25 -42
- package/dist/http/mcp/tools/catalog.js.map +1 -1
- package/dist/http/mcp/tools/comments.js +9 -19
- package/dist/http/mcp/tools/comments.js.map +1 -1
- package/dist/http/mcp/tools/communities.js +17 -32
- package/dist/http/mcp/tools/communities.js.map +1 -1
- package/dist/http/mcp/tools/community-members.js +9 -16
- package/dist/http/mcp/tools/community-members.js.map +1 -1
- package/dist/http/mcp/tools/community-moderation.js +13 -25
- package/dist/http/mcp/tools/community-moderation.js.map +1 -1
- package/dist/http/mcp/tools/courses.js +11 -21
- package/dist/http/mcp/tools/courses.js.map +1 -1
- package/dist/http/mcp/tools/events.d.ts +6 -0
- package/dist/http/mcp/tools/events.js +170 -0
- package/dist/http/mcp/tools/events.js.map +1 -0
- package/dist/http/mcp/tools/index.d.ts +5 -1
- package/dist/http/mcp/tools/index.js +45 -10
- package/dist/http/mcp/tools/index.js.map +1 -1
- package/dist/http/mcp/tools/organization.d.ts +6 -0
- package/dist/http/mcp/tools/organization.js +214 -0
- package/dist/http/mcp/tools/organization.js.map +1 -0
- package/dist/http/mcp/tools/people.js +30 -49
- package/dist/http/mcp/tools/people.js.map +1 -1
- package/dist/http/plugins/auth.js +37 -8
- package/dist/http/plugins/auth.js.map +1 -1
- package/dist/http/plugins/error-handler.d.ts +5 -1
- package/dist/http/plugins/error-handler.js +10 -2
- package/dist/http/plugins/error-handler.js.map +1 -1
- package/dist/http/plugins/openapi.js +18 -2
- package/dist/http/plugins/openapi.js.map +1 -1
- package/dist/http/plugins/platform.d.ts +7 -0
- package/dist/http/plugins/platform.js +13 -0
- package/dist/http/plugins/platform.js.map +1 -0
- package/dist/http/routes/access.js +54 -36
- package/dist/http/routes/access.js.map +1 -1
- package/dist/http/routes/activities.js +45 -45
- package/dist/http/routes/activities.js.map +1 -1
- package/dist/http/routes/assets.js +30 -65
- package/dist/http/routes/assets.js.map +1 -1
- package/dist/http/routes/automations.js +37 -42
- package/dist/http/routes/automations.js.map +1 -1
- package/dist/http/routes/bundles.js +33 -36
- package/dist/http/routes/bundles.js.map +1 -1
- package/dist/http/routes/communities.js +93 -145
- package/dist/http/routes/communities.js.map +1 -1
- package/dist/http/routes/community-moderation.js +83 -137
- package/dist/http/routes/community-moderation.js.map +1 -1
- package/dist/http/routes/course-analytics.js +32 -15
- package/dist/http/routes/course-analytics.js.map +1 -1
- package/dist/http/routes/courses.js +25 -32
- package/dist/http/routes/courses.js.map +1 -1
- package/dist/http/routes/dashboard.js +9 -9
- package/dist/http/routes/dashboard.js.map +1 -1
- package/dist/http/routes/discussion.js +21 -39
- package/dist/http/routes/discussion.js.map +1 -1
- package/dist/http/routes/downloads.js +41 -47
- package/dist/http/routes/downloads.js.map +1 -1
- package/dist/http/routes/entitlements.js +19 -23
- package/dist/http/routes/entitlements.js.map +1 -1
- package/dist/http/routes/events.d.ts +7 -0
- package/dist/http/routes/events.js +333 -0
- package/dist/http/routes/events.js.map +1 -0
- package/dist/http/routes/integrations.js +40 -73
- package/dist/http/routes/integrations.js.map +1 -1
- package/dist/http/routes/member/assets.js +10 -13
- package/dist/http/routes/member/assets.js.map +1 -1
- package/dist/http/routes/member/chats.js +170 -47
- package/dist/http/routes/member/chats.js.map +1 -1
- package/dist/http/routes/member/comments.js +65 -26
- package/dist/http/routes/member/comments.js.map +1 -1
- package/dist/http/routes/member/community.js +45 -52
- package/dist/http/routes/member/community.js.map +1 -1
- package/dist/http/routes/member/courses.js +12 -19
- package/dist/http/routes/member/courses.js.map +1 -1
- package/dist/http/routes/member/devices.js +9 -10
- package/dist/http/routes/member/devices.js.map +1 -1
- package/dist/http/routes/member/downloads.js +6 -9
- package/dist/http/routes/member/downloads.js.map +1 -1
- package/dist/http/routes/member/events.d.ts +7 -0
- package/dist/http/routes/member/events.js +386 -0
- package/dist/http/routes/member/events.js.map +1 -0
- package/dist/http/routes/member/files.js +88 -46
- package/dist/http/routes/member/files.js.map +1 -1
- package/dist/http/routes/member/index.js +2 -0
- package/dist/http/routes/member/index.js.map +1 -1
- package/dist/http/routes/member/notification-settings.js +15 -23
- package/dist/http/routes/member/notification-settings.js.map +1 -1
- package/dist/http/routes/member/notifications.js +16 -16
- package/dist/http/routes/member/notifications.js.map +1 -1
- package/dist/http/routes/member/org.js +5 -15
- package/dist/http/routes/member/org.js.map +1 -1
- package/dist/http/routes/member/posts.js +67 -68
- package/dist/http/routes/member/posts.js.map +1 -1
- package/dist/http/routes/member/profile.js +15 -6
- package/dist/http/routes/member/profile.js.map +1 -1
- package/dist/http/routes/member/progress.js +7 -11
- package/dist/http/routes/member/progress.js.map +1 -1
- package/dist/http/routes/organizations.js +319 -135
- package/dist/http/routes/organizations.js.map +1 -1
- package/dist/http/routes/platform.d.ts +7 -0
- package/dist/http/routes/platform.js +61 -0
- package/dist/http/routes/platform.js.map +1 -0
- package/dist/http/routes/students.js +12 -75
- package/dist/http/routes/students.js.map +1 -1
- package/dist/http/routes/webhooks.js +30 -39
- package/dist/http/routes/webhooks.js.map +1 -1
- package/dist/http/routes.js +9 -0
- package/dist/http/routes.js.map +1 -1
- package/dist/http/schemas/access.d.ts +346 -64
- package/dist/http/schemas/access.js +39 -12
- package/dist/http/schemas/access.js.map +1 -1
- package/dist/http/schemas/assets.d.ts +8 -3
- package/dist/http/schemas/assets.js +6 -5
- package/dist/http/schemas/assets.js.map +1 -1
- package/dist/http/schemas/automations.d.ts +4 -4
- package/dist/http/schemas/chats.d.ts +216 -37
- package/dist/http/schemas/chats.js +13 -4
- package/dist/http/schemas/chats.js.map +1 -1
- package/dist/http/schemas/community.d.ts +105 -31
- package/dist/http/schemas/community.js +25 -9
- package/dist/http/schemas/community.js.map +1 -1
- package/dist/http/schemas/course-analytics.d.ts +51 -1
- package/dist/http/schemas/course-analytics.js +19 -1
- package/dist/http/schemas/course-analytics.js.map +1 -1
- package/dist/http/schemas/dashboard.d.ts +1 -0
- package/dist/http/schemas/dashboard.js +2 -1
- package/dist/http/schemas/dashboard.js.map +1 -1
- package/dist/http/schemas/discussion.d.ts +22 -72
- package/dist/http/schemas/discussion.js +2 -2
- package/dist/http/schemas/discussion.js.map +1 -1
- package/dist/http/schemas/entitlements.d.ts +9 -12
- package/dist/http/schemas/entitlements.js +11 -5
- package/dist/http/schemas/entitlements.js.map +1 -1
- package/dist/http/schemas/events.d.ts +527 -0
- package/dist/http/schemas/events.js +64 -0
- package/dist/http/schemas/events.js.map +1 -0
- package/dist/http/schemas/files.d.ts +24 -5
- package/dist/http/schemas/files.js +15 -2
- package/dist/http/schemas/files.js.map +1 -1
- package/dist/http/schemas/index.d.ts +11 -9
- package/dist/http/schemas/index.js +11 -9
- package/dist/http/schemas/invites.d.ts +3 -47
- package/dist/http/schemas/invites.js +4 -25
- package/dist/http/schemas/invites.js.map +1 -1
- package/dist/http/schemas/member.d.ts +94 -7
- package/dist/http/schemas/member.js +7 -3
- package/dist/http/schemas/member.js.map +1 -1
- package/dist/http/schemas/members.d.ts +329 -65
- package/dist/http/schemas/members.js +67 -25
- package/dist/http/schemas/members.js.map +1 -1
- package/dist/http/schemas/notifications.d.ts +58 -54
- package/dist/http/schemas/platform.d.ts +38 -0
- package/dist/http/schemas/platform.js +19 -0
- package/dist/http/schemas/platform.js.map +1 -0
- package/dist/http/schemas/posts.d.ts +55 -35
- package/dist/http/schemas/posts.js +4 -4
- package/dist/http/schemas/posts.js.map +1 -1
- package/dist/http/schemas/profile.d.ts +1 -1
- package/dist/http/schemas/shared.d.ts +1 -11
- package/dist/http/schemas/shared.js +1 -10
- package/dist/http/schemas/shared.js.map +1 -1
- package/dist/http/schemas/students.d.ts +22 -0
- package/dist/http/schemas/students.js +3 -1
- package/dist/http/schemas/students.js.map +1 -1
- package/dist/http/scope.d.ts +9 -13
- package/dist/http/scope.js +29 -40
- package/dist/http/scope.js.map +1 -1
- package/dist/http/server.js +9 -0
- package/dist/http/server.js.map +1 -1
- package/dist/http/shutdown.d.ts +11 -0
- package/dist/http/shutdown.js +40 -0
- package/dist/http/shutdown.js.map +1 -0
- package/dist/http/sse.d.ts +19 -0
- package/dist/http/sse.js +104 -0
- package/dist/http/sse.js.map +1 -0
- package/dist/http/test-caller.d.ts +13 -0
- package/dist/http/test-caller.js +14 -0
- package/dist/http/test-caller.js.map +1 -0
- package/dist/http/well-known.js +2 -2
- package/dist/http/well-known.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/packages/server/package.js +1 -1
- package/package.json +7 -6
- package/dist/http/routes/member/actor.d.ts +0 -14
- package/dist/http/routes/member/actor.js +0 -11
- package/dist/http/routes/member/actor.js.map +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ListQuery, paginated } from "./shared.js";
|
|
2
|
-
import { MEMBER_IMAGE_TYPE } from "@headless-lms/core/assets";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
import { assetKindSchema, assetSourceSchema, assetStatusSchema, assetViewSchema, uploadTicketSchema } from "@headless-lms/core/schemas";
|
|
5
4
|
//#region src/http/schemas/assets.ts
|
|
6
5
|
const AssetKind = assetKindSchema.describe("The media class, derived by the server from the content type.");
|
|
7
|
-
const AssetSource = assetSourceSchema.describe("Where the file came from: `library` is the org's media
|
|
6
|
+
const AssetSource = assetSourceSchema.describe("Where the file came from: `library` is the org's media, `member` is a person's own upload.");
|
|
8
7
|
const AssetStatus = assetStatusSchema;
|
|
9
8
|
const Asset = assetViewSchema.omit({ key: true }).extend({
|
|
10
9
|
kind: AssetKind,
|
|
@@ -14,18 +13,20 @@ const Asset = assetViewSchema.omit({ key: true }).extend({
|
|
|
14
13
|
}).strip();
|
|
15
14
|
const AssetsQuery = ListQuery.extend({
|
|
16
15
|
kind: AssetKind.optional(),
|
|
17
|
-
source: AssetSource.optional().describe("Defaults to `library`.")
|
|
16
|
+
source: AssetSource.optional().describe("Defaults to `library`."),
|
|
17
|
+
contentId: z.string().optional().describe("Only the files uploaded for this content item.")
|
|
18
18
|
});
|
|
19
19
|
const AssetsPage = paginated(Asset);
|
|
20
20
|
const AssetIdParam = z.object({ id: z.string() });
|
|
21
21
|
const Filename = z.string().trim().min(1).max(255);
|
|
22
22
|
const RequestUpload = z.object({
|
|
23
23
|
filename: Filename,
|
|
24
|
-
contentType: z.string().min(1).max(255).describe("The media class is derived from this.")
|
|
24
|
+
contentType: z.string().min(1).max(255).describe("The media class is derived from this."),
|
|
25
|
+
contentId: z.string().optional().describe("The course, download or community the file is for.")
|
|
25
26
|
});
|
|
26
27
|
const RequestMemberUpload = z.object({
|
|
27
28
|
filename: Filename,
|
|
28
|
-
contentType: z.string().
|
|
29
|
+
contentType: z.string().min(1).max(255).describe("Any type. Only `image/png`, `image/jpeg`, `image/gif`, `image/webp` and `image/avif` count as images (a profile photo, a post cover, a message attachment); every other type is a file a post can show. The stored type and size are checked when the upload is finalized.")
|
|
29
30
|
});
|
|
30
31
|
const UploadTicket = uploadTicketSchema.extend({ asset: Asset });
|
|
31
32
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.js","names":[],"sources":["../../../src/http/schemas/assets.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n assetKindSchema,\n assetSourceSchema,\n assetStatusSchema,\n assetViewSchema,\n uploadTicketSchema,\n} from '@headless-lms/core/schemas';\nimport {
|
|
1
|
+
{"version":3,"file":"assets.js","names":[],"sources":["../../../src/http/schemas/assets.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n assetKindSchema,\n assetSourceSchema,\n assetStatusSchema,\n assetViewSchema,\n uploadTicketSchema,\n} from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const AssetKind = assetKindSchema.describe(\n 'The media class, derived by the server from the content type.',\n);\nexport type AssetKind = z.infer<typeof AssetKind>;\n\nexport const AssetSource = assetSourceSchema.describe(\n \"Where the file came from: `library` is the org's media, `member` is a person's own upload.\",\n);\nexport type AssetSource = z.infer<typeof AssetSource>;\n\nexport const AssetStatus = assetStatusSchema;\nexport type AssetStatus = z.infer<typeof AssetStatus>;\n\nexport const Asset = assetViewSchema\n .omit({ key: true })\n .extend({\n kind: AssetKind,\n source: AssetSource,\n url: z\n .string()\n .nullable()\n .describe(\n 'A short-lived signed URL that shows a ready library file. `null` while pending and for a member upload, which is served with what it is attached to.',\n ),\n downloadUrl: z\n .string()\n .nullable()\n .describe('The same file as a download saved under its filename. `null` when `url` is.'),\n })\n .strip();\nexport type Asset = z.infer<typeof Asset>;\n\nexport const AssetsQuery = ListQuery.extend({\n kind: AssetKind.optional(),\n source: AssetSource.optional().describe('Defaults to `library`.'),\n contentId: z.string().optional().describe('Only the files uploaded for this content item.'),\n});\nexport type AssetsQuery = z.infer<typeof AssetsQuery>;\n\nexport const AssetsPage = paginated(Asset);\nexport type AssetsPage = z.infer<typeof AssetsPage>;\n\nexport const AssetIdParam = z.object({ id: z.string() });\nexport type AssetIdParam = z.infer<typeof AssetIdParam>;\n\nconst Filename = z.string().trim().min(1).max(255);\n\nexport const RequestUpload = z.object({\n filename: Filename,\n contentType: z.string().min(1).max(255).describe('The media class is derived from this.'),\n contentId: z.string().optional().describe('The course, download or community the file is for.'),\n});\nexport type RequestUpload = z.infer<typeof RequestUpload>;\n\nexport const RequestMemberUpload = z.object({\n filename: Filename,\n contentType: z\n .string()\n .min(1)\n .max(255)\n .describe(\n 'Any type. Only `image/png`, `image/jpeg`, `image/gif`, `image/webp` and `image/avif` count as images (a profile photo, a post cover, a message attachment); every other type is a file a post can show. The stored type and size are checked when the upload is finalized.',\n ),\n});\nexport type RequestMemberUpload = z.infer<typeof RequestMemberUpload>;\n\nexport const UploadTicket = uploadTicketSchema.extend({ asset: Asset });\nexport type UploadTicket = z.infer<typeof UploadTicket>;\n"],"mappings":";;;;AAUA,MAAa,YAAY,gBAAgB,SACvC,+DACF;AAGA,MAAa,cAAc,kBAAkB,SAC3C,4FACF;AAGA,MAAa,cAAc;AAG3B,MAAa,QAAQ,gBAClB,KAAK,EAAE,KAAK,KAAK,CAAC,CAAC,CACnB,OAAO;CACN,MAAM;CACN,QAAQ;CACR,KAAK,EACF,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SACC,sJACF;CACF,aAAa,EACV,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SAAS,6EAA6E;AAC3F,CAAC,CAAC,CACD,MAAM;AAGT,MAAa,cAAc,UAAU,OAAO;CAC1C,MAAM,UAAU,SAAS;CACzB,QAAQ,YAAY,SAAS,CAAC,CAAC,SAAS,wBAAwB;CAChE,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,gDAAgD;AAC5F,CAAC;AAGD,MAAa,aAAa,UAAU,KAAK;AAGzC,MAAa,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAGvD,MAAM,WAAW,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;AAEjD,MAAa,gBAAgB,EAAE,OAAO;CACpC,UAAU;CACV,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,uCAAuC;CACxF,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,oDAAoD;AAChG,CAAC;AAGD,MAAa,sBAAsB,EAAE,OAAO;CAC1C,UAAU;CACV,aAAa,EACV,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,GAAG,CAAC,CACR,SACC,4QACF;AACJ,CAAC;AAGD,MAAa,eAAe,mBAAmB,OAAO,EAAE,OAAO,MAAM,CAAC"}
|
|
@@ -93,8 +93,8 @@ declare const AvailableTriggers: z.ZodObject<{
|
|
|
93
93
|
}, z.core.$strict>;
|
|
94
94
|
type AvailableTriggers = z.infer<typeof AvailableTriggers>;
|
|
95
95
|
declare const AutomationRunStatus: z.ZodEnum<{
|
|
96
|
-
running: "running";
|
|
97
96
|
completed: "completed";
|
|
97
|
+
running: "running";
|
|
98
98
|
failed: "failed";
|
|
99
99
|
}>;
|
|
100
100
|
type AutomationRunStatus = z.infer<typeof AutomationRunStatus>;
|
|
@@ -117,8 +117,8 @@ declare const AutomationRun: z.ZodObject<{
|
|
|
117
117
|
eventId: z.ZodString;
|
|
118
118
|
event: z.ZodType<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown>>;
|
|
119
119
|
status: z.ZodEnum<{
|
|
120
|
-
running: "running";
|
|
121
120
|
completed: "completed";
|
|
121
|
+
running: "running";
|
|
122
122
|
failed: "failed";
|
|
123
123
|
}>;
|
|
124
124
|
actionResults: z.ZodArray<z.ZodObject<{
|
|
@@ -143,8 +143,8 @@ declare const AutomationRunsQuery: z.ZodObject<{
|
|
|
143
143
|
search: z.ZodOptional<z.ZodString>;
|
|
144
144
|
sort: z.ZodOptional<z.ZodString>;
|
|
145
145
|
status: z.ZodOptional<z.ZodEnum<{
|
|
146
|
-
running: "running";
|
|
147
146
|
completed: "completed";
|
|
147
|
+
running: "running";
|
|
148
148
|
failed: "failed";
|
|
149
149
|
}>>;
|
|
150
150
|
}, z.core.$strip>;
|
|
@@ -158,8 +158,8 @@ declare const AutomationRunsPage: z.ZodObject<{
|
|
|
158
158
|
eventId: z.ZodString;
|
|
159
159
|
event: z.ZodType<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown>>;
|
|
160
160
|
status: z.ZodEnum<{
|
|
161
|
-
running: "running";
|
|
162
161
|
completed: "completed";
|
|
162
|
+
running: "running";
|
|
163
163
|
failed: "failed";
|
|
164
164
|
}>;
|
|
165
165
|
actionResults: z.ZodArray<z.ZodObject<{
|
|
@@ -5,8 +5,8 @@ declare const Chat: z.ZodObject<{
|
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
communityId: z.ZodString;
|
|
7
7
|
kind: z.ZodEnum<{
|
|
8
|
-
direct: "direct";
|
|
9
8
|
group: "group";
|
|
9
|
+
direct: "direct";
|
|
10
10
|
}>;
|
|
11
11
|
status: z.ZodEnum<{
|
|
12
12
|
pending: "pending";
|
|
@@ -28,9 +28,9 @@ declare const MessageFlag: z.ZodObject<{
|
|
|
28
28
|
reason: z.ZodString;
|
|
29
29
|
resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
30
30
|
resolution: z.ZodNullable<z.ZodEnum<{
|
|
31
|
-
locked: "locked";
|
|
32
31
|
dismissed: "dismissed";
|
|
33
32
|
deleted: "deleted";
|
|
33
|
+
locked: "locked";
|
|
34
34
|
}>>;
|
|
35
35
|
resolvedBy: z.ZodNullable<z.ZodString>;
|
|
36
36
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -44,6 +44,7 @@ declare const MessageView: z.ZodObject<{
|
|
|
44
44
|
orgUserId: z.ZodString;
|
|
45
45
|
body: z.ZodString;
|
|
46
46
|
replyToId: z.ZodNullable<z.ZodString>;
|
|
47
|
+
clientId: z.ZodNullable<z.ZodUUID>;
|
|
47
48
|
editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
48
49
|
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
49
50
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -57,13 +58,8 @@ declare const MessageView: z.ZodObject<{
|
|
|
57
58
|
image: z.ZodNullable<z.ZodString>;
|
|
58
59
|
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
59
60
|
imageUrl: z.ZodNullable<z.ZodString>;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
admin: "admin";
|
|
63
|
-
instructor: "instructor";
|
|
64
|
-
moderator: "moderator";
|
|
65
|
-
student: "student";
|
|
66
|
-
}>;
|
|
61
|
+
team: z.ZodBoolean;
|
|
62
|
+
roleName: z.ZodNullable<z.ZodString>;
|
|
67
63
|
}, z.core.$strict>;
|
|
68
64
|
attachments: z.ZodArray<z.ZodObject<{
|
|
69
65
|
assetId: z.ZodString;
|
|
@@ -85,6 +81,7 @@ declare const MessagesPage: z.ZodObject<{
|
|
|
85
81
|
orgUserId: z.ZodString;
|
|
86
82
|
body: z.ZodString;
|
|
87
83
|
replyToId: z.ZodNullable<z.ZodString>;
|
|
84
|
+
clientId: z.ZodNullable<z.ZodUUID>;
|
|
88
85
|
editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
89
86
|
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
90
87
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -98,13 +95,8 @@ declare const MessagesPage: z.ZodObject<{
|
|
|
98
95
|
image: z.ZodNullable<z.ZodString>;
|
|
99
96
|
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
100
97
|
imageUrl: z.ZodNullable<z.ZodString>;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
admin: "admin";
|
|
104
|
-
instructor: "instructor";
|
|
105
|
-
moderator: "moderator";
|
|
106
|
-
student: "student";
|
|
107
|
-
}>;
|
|
98
|
+
team: z.ZodBoolean;
|
|
99
|
+
roleName: z.ZodNullable<z.ZodString>;
|
|
108
100
|
}, z.core.$strict>;
|
|
109
101
|
attachments: z.ZodArray<z.ZodObject<{
|
|
110
102
|
assetId: z.ZodString;
|
|
@@ -127,8 +119,8 @@ declare const ChatListItem: z.ZodObject<{
|
|
|
127
119
|
id: z.ZodString;
|
|
128
120
|
communityId: z.ZodString;
|
|
129
121
|
kind: z.ZodEnum<{
|
|
130
|
-
direct: "direct";
|
|
131
122
|
group: "group";
|
|
123
|
+
direct: "direct";
|
|
132
124
|
}>;
|
|
133
125
|
status: z.ZodEnum<{
|
|
134
126
|
pending: "pending";
|
|
@@ -142,6 +134,18 @@ declare const ChatListItem: z.ZodObject<{
|
|
|
142
134
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
143
135
|
}, z.core.$strict>;
|
|
144
136
|
participantIds: z.ZodArray<z.ZodString>;
|
|
137
|
+
participants: z.ZodArray<z.ZodObject<{
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
140
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
141
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
142
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
143
|
+
image: z.ZodNullable<z.ZodString>;
|
|
144
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
145
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
146
|
+
team: z.ZodBoolean;
|
|
147
|
+
roleName: z.ZodNullable<z.ZodString>;
|
|
148
|
+
}, z.core.$strict>>;
|
|
145
149
|
lastReadMessageId: z.ZodNullable<z.ZodString>;
|
|
146
150
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
147
151
|
state: z.ZodEnum<{
|
|
@@ -166,8 +170,8 @@ declare const ChatsPage: z.ZodObject<{
|
|
|
166
170
|
id: z.ZodString;
|
|
167
171
|
communityId: z.ZodString;
|
|
168
172
|
kind: z.ZodEnum<{
|
|
169
|
-
direct: "direct";
|
|
170
173
|
group: "group";
|
|
174
|
+
direct: "direct";
|
|
171
175
|
}>;
|
|
172
176
|
status: z.ZodEnum<{
|
|
173
177
|
pending: "pending";
|
|
@@ -181,6 +185,18 @@ declare const ChatsPage: z.ZodObject<{
|
|
|
181
185
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
182
186
|
}, z.core.$strict>;
|
|
183
187
|
participantIds: z.ZodArray<z.ZodString>;
|
|
188
|
+
participants: z.ZodArray<z.ZodObject<{
|
|
189
|
+
id: z.ZodString;
|
|
190
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
191
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
192
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
193
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
194
|
+
image: z.ZodNullable<z.ZodString>;
|
|
195
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
196
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
197
|
+
team: z.ZodBoolean;
|
|
198
|
+
roleName: z.ZodNullable<z.ZodString>;
|
|
199
|
+
}, z.core.$strict>>;
|
|
184
200
|
lastReadMessageId: z.ZodNullable<z.ZodString>;
|
|
185
201
|
subscription: z.ZodNullable<z.ZodObject<{
|
|
186
202
|
state: z.ZodEnum<{
|
|
@@ -202,6 +218,172 @@ declare const ChatsPage: z.ZodObject<{
|
|
|
202
218
|
page: z.ZodNumber;
|
|
203
219
|
pageSize: z.ZodNumber;
|
|
204
220
|
}, z.core.$strip>;
|
|
221
|
+
declare const ChatListQuery: z.ZodObject<{
|
|
222
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
223
|
+
pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
224
|
+
requests: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
|
|
225
|
+
}, z.core.$strict>;
|
|
226
|
+
declare const ChatUnreadSummary: z.ZodObject<{
|
|
227
|
+
unread: z.ZodNumber;
|
|
228
|
+
requests: z.ZodNumber;
|
|
229
|
+
}, z.core.$strict>;
|
|
230
|
+
declare const ChatLiveEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
231
|
+
type: z.ZodLiteral<"ready">;
|
|
232
|
+
heartbeatMs: z.ZodNumber;
|
|
233
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
234
|
+
type: z.ZodLiteral<"message.created">;
|
|
235
|
+
chatId: z.ZodString;
|
|
236
|
+
message: z.ZodObject<{
|
|
237
|
+
clientId: z.ZodNullable<z.ZodUUID>;
|
|
238
|
+
id: z.ZodString;
|
|
239
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
240
|
+
orgId: z.ZodString;
|
|
241
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
242
|
+
communityId: z.ZodString;
|
|
243
|
+
orgUserId: z.ZodString;
|
|
244
|
+
chatId: z.ZodString;
|
|
245
|
+
body: z.ZodString;
|
|
246
|
+
replyToId: z.ZodNullable<z.ZodString>;
|
|
247
|
+
editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
248
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
249
|
+
sender: z.ZodObject<{
|
|
250
|
+
id: z.ZodString;
|
|
251
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
252
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
253
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
254
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
255
|
+
image: z.ZodNullable<z.ZodString>;
|
|
256
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
257
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
258
|
+
team: z.ZodBoolean;
|
|
259
|
+
roleName: z.ZodNullable<z.ZodString>;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
262
|
+
assetId: z.ZodString;
|
|
263
|
+
url: z.ZodString;
|
|
264
|
+
}, z.core.$strict>>;
|
|
265
|
+
reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
266
|
+
mentions: z.ZodArray<z.ZodObject<{
|
|
267
|
+
orgUserId: z.ZodString;
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
}, z.core.$strict>>;
|
|
270
|
+
}, z.core.$strict>;
|
|
271
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
272
|
+
type: z.ZodLiteral<"message.updated">;
|
|
273
|
+
chatId: z.ZodString;
|
|
274
|
+
message: z.ZodObject<{
|
|
275
|
+
clientId: z.ZodNullable<z.ZodUUID>;
|
|
276
|
+
id: z.ZodString;
|
|
277
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
278
|
+
orgId: z.ZodString;
|
|
279
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
280
|
+
communityId: z.ZodString;
|
|
281
|
+
orgUserId: z.ZodString;
|
|
282
|
+
chatId: z.ZodString;
|
|
283
|
+
body: z.ZodString;
|
|
284
|
+
replyToId: z.ZodNullable<z.ZodString>;
|
|
285
|
+
editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
286
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
287
|
+
sender: z.ZodObject<{
|
|
288
|
+
id: z.ZodString;
|
|
289
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
290
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
291
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
292
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
293
|
+
image: z.ZodNullable<z.ZodString>;
|
|
294
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
295
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
296
|
+
team: z.ZodBoolean;
|
|
297
|
+
roleName: z.ZodNullable<z.ZodString>;
|
|
298
|
+
}, z.core.$strict>;
|
|
299
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
300
|
+
assetId: z.ZodString;
|
|
301
|
+
url: z.ZodString;
|
|
302
|
+
}, z.core.$strict>>;
|
|
303
|
+
reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
304
|
+
mentions: z.ZodArray<z.ZodObject<{
|
|
305
|
+
orgUserId: z.ZodString;
|
|
306
|
+
name: z.ZodString;
|
|
307
|
+
}, z.core.$strict>>;
|
|
308
|
+
}, z.core.$strict>;
|
|
309
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
310
|
+
type: z.ZodLiteral<"message.deleted">;
|
|
311
|
+
chatId: z.ZodString;
|
|
312
|
+
messageId: z.ZodString;
|
|
313
|
+
deletedAt: z.ZodCoercedDate<unknown>;
|
|
314
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
315
|
+
type: z.ZodLiteral<"message.reactions">;
|
|
316
|
+
chatId: z.ZodString;
|
|
317
|
+
messageId: z.ZodString;
|
|
318
|
+
reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
319
|
+
orgUserId: z.ZodString;
|
|
320
|
+
reaction: z.ZodNullable<z.ZodString>;
|
|
321
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
322
|
+
type: z.ZodLiteral<"chat.updated">;
|
|
323
|
+
chatId: z.ZodString;
|
|
324
|
+
chat: z.ZodObject<{
|
|
325
|
+
orgId: z.ZodString;
|
|
326
|
+
id: z.ZodString;
|
|
327
|
+
communityId: z.ZodString;
|
|
328
|
+
kind: z.ZodEnum<{
|
|
329
|
+
group: "group";
|
|
330
|
+
direct: "direct";
|
|
331
|
+
}>;
|
|
332
|
+
status: z.ZodEnum<{
|
|
333
|
+
pending: "pending";
|
|
334
|
+
open: "open";
|
|
335
|
+
closed: "closed";
|
|
336
|
+
}>;
|
|
337
|
+
createdBy: z.ZodNullable<z.ZodString>;
|
|
338
|
+
lockedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
339
|
+
lockedBy: z.ZodNullable<z.ZodString>;
|
|
340
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
341
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
342
|
+
}, z.core.$strict>;
|
|
343
|
+
participants: z.ZodArray<z.ZodObject<{
|
|
344
|
+
id: z.ZodString;
|
|
345
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
346
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
347
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
348
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
349
|
+
image: z.ZodNullable<z.ZodString>;
|
|
350
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
351
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
352
|
+
team: z.ZodBoolean;
|
|
353
|
+
roleName: z.ZodNullable<z.ZodString>;
|
|
354
|
+
}, z.core.$strict>>;
|
|
355
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
356
|
+
type: z.ZodLiteral<"chat.removed">;
|
|
357
|
+
chatId: z.ZodString;
|
|
358
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
359
|
+
type: z.ZodLiteral<"chat.state">;
|
|
360
|
+
chatId: z.ZodString;
|
|
361
|
+
unread: z.ZodNumber;
|
|
362
|
+
lastReadMessageId: z.ZodNullable<z.ZodString>;
|
|
363
|
+
subscription: z.ZodNullable<z.ZodObject<{
|
|
364
|
+
state: z.ZodEnum<{
|
|
365
|
+
following: "following";
|
|
366
|
+
muted: "muted";
|
|
367
|
+
}>;
|
|
368
|
+
mutedUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
369
|
+
}, z.core.$strict>>;
|
|
370
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
371
|
+
unread: z.ZodNumber;
|
|
372
|
+
requests: z.ZodNumber;
|
|
373
|
+
type: z.ZodLiteral<"unread">;
|
|
374
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
375
|
+
type: z.ZodLiteral<"typing">;
|
|
376
|
+
chatId: z.ZodString;
|
|
377
|
+
orgUserId: z.ZodString;
|
|
378
|
+
until: z.ZodCoercedDate<unknown>;
|
|
379
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
380
|
+
type: z.ZodLiteral<"resync">;
|
|
381
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
382
|
+
type: z.ZodLiteral<"closed">;
|
|
383
|
+
reason: z.ZodEnum<{
|
|
384
|
+
shutdown: "shutdown";
|
|
385
|
+
}>;
|
|
386
|
+
}, z.core.$strict>], "type">;
|
|
205
387
|
declare const MessageQueueEntry: z.ZodObject<{
|
|
206
388
|
message: z.ZodObject<{
|
|
207
389
|
orgId: z.ZodString;
|
|
@@ -211,6 +393,7 @@ declare const MessageQueueEntry: z.ZodObject<{
|
|
|
211
393
|
orgUserId: z.ZodString;
|
|
212
394
|
body: z.ZodString;
|
|
213
395
|
replyToId: z.ZodNullable<z.ZodString>;
|
|
396
|
+
clientId: z.ZodNullable<z.ZodUUID>;
|
|
214
397
|
editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
215
398
|
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
216
399
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -224,13 +407,8 @@ declare const MessageQueueEntry: z.ZodObject<{
|
|
|
224
407
|
image: z.ZodNullable<z.ZodString>;
|
|
225
408
|
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
226
409
|
imageUrl: z.ZodNullable<z.ZodString>;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
admin: "admin";
|
|
230
|
-
instructor: "instructor";
|
|
231
|
-
moderator: "moderator";
|
|
232
|
-
student: "student";
|
|
233
|
-
}>;
|
|
410
|
+
team: z.ZodBoolean;
|
|
411
|
+
roleName: z.ZodNullable<z.ZodString>;
|
|
234
412
|
}, z.core.$strict>;
|
|
235
413
|
attachments: z.ZodArray<z.ZodObject<{
|
|
236
414
|
assetId: z.ZodString;
|
|
@@ -252,9 +430,9 @@ declare const MessageQueueEntry: z.ZodObject<{
|
|
|
252
430
|
reason: z.ZodString;
|
|
253
431
|
resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
254
432
|
resolution: z.ZodNullable<z.ZodEnum<{
|
|
255
|
-
locked: "locked";
|
|
256
433
|
dismissed: "dismissed";
|
|
257
434
|
deleted: "deleted";
|
|
435
|
+
locked: "locked";
|
|
258
436
|
}>>;
|
|
259
437
|
resolvedBy: z.ZodNullable<z.ZodString>;
|
|
260
438
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -265,8 +443,8 @@ declare const MessageQueueEntry: z.ZodObject<{
|
|
|
265
443
|
id: z.ZodString;
|
|
266
444
|
communityId: z.ZodString;
|
|
267
445
|
kind: z.ZodEnum<{
|
|
268
|
-
direct: "direct";
|
|
269
446
|
group: "group";
|
|
447
|
+
direct: "direct";
|
|
270
448
|
}>;
|
|
271
449
|
status: z.ZodEnum<{
|
|
272
450
|
pending: "pending";
|
|
@@ -291,6 +469,7 @@ declare const MessageQueue: z.ZodObject<{
|
|
|
291
469
|
orgUserId: z.ZodString;
|
|
292
470
|
body: z.ZodString;
|
|
293
471
|
replyToId: z.ZodNullable<z.ZodString>;
|
|
472
|
+
clientId: z.ZodNullable<z.ZodUUID>;
|
|
294
473
|
editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
295
474
|
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
296
475
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -304,13 +483,8 @@ declare const MessageQueue: z.ZodObject<{
|
|
|
304
483
|
image: z.ZodNullable<z.ZodString>;
|
|
305
484
|
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
306
485
|
imageUrl: z.ZodNullable<z.ZodString>;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
admin: "admin";
|
|
310
|
-
instructor: "instructor";
|
|
311
|
-
moderator: "moderator";
|
|
312
|
-
student: "student";
|
|
313
|
-
}>;
|
|
486
|
+
team: z.ZodBoolean;
|
|
487
|
+
roleName: z.ZodNullable<z.ZodString>;
|
|
314
488
|
}, z.core.$strict>;
|
|
315
489
|
attachments: z.ZodArray<z.ZodObject<{
|
|
316
490
|
assetId: z.ZodString;
|
|
@@ -332,9 +506,9 @@ declare const MessageQueue: z.ZodObject<{
|
|
|
332
506
|
reason: z.ZodString;
|
|
333
507
|
resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
334
508
|
resolution: z.ZodNullable<z.ZodEnum<{
|
|
335
|
-
locked: "locked";
|
|
336
509
|
dismissed: "dismissed";
|
|
337
510
|
deleted: "deleted";
|
|
511
|
+
locked: "locked";
|
|
338
512
|
}>>;
|
|
339
513
|
resolvedBy: z.ZodNullable<z.ZodString>;
|
|
340
514
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -345,8 +519,8 @@ declare const MessageQueue: z.ZodObject<{
|
|
|
345
519
|
id: z.ZodString;
|
|
346
520
|
communityId: z.ZodString;
|
|
347
521
|
kind: z.ZodEnum<{
|
|
348
|
-
direct: "direct";
|
|
349
522
|
group: "group";
|
|
523
|
+
direct: "direct";
|
|
350
524
|
}>;
|
|
351
525
|
status: z.ZodEnum<{
|
|
352
526
|
pending: "pending";
|
|
@@ -376,6 +550,7 @@ declare const SendMessage: z.ZodObject<{
|
|
|
376
550
|
body: z.ZodString;
|
|
377
551
|
replyToId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
378
552
|
assetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
553
|
+
clientId: z.ZodOptional<z.ZodUUID>;
|
|
379
554
|
}, z.core.$strict>;
|
|
380
555
|
declare const EditMessage: z.ZodObject<{
|
|
381
556
|
body: z.ZodString;
|
|
@@ -404,6 +579,10 @@ declare const BlockParam: z.ZodObject<{
|
|
|
404
579
|
communityId: z.ZodString;
|
|
405
580
|
orgUserId: z.ZodString;
|
|
406
581
|
}, z.core.$strip>;
|
|
582
|
+
declare const DirectChatParam: z.ZodObject<{
|
|
583
|
+
communityId: z.ZodString;
|
|
584
|
+
orgUserId: z.ZodString;
|
|
585
|
+
}, z.core.$strip>;
|
|
407
586
|
//#endregion
|
|
408
|
-
export { BlockParam, Chat, ChatIdParam, ChatListItem, ChatsPage, CommunityParam, EditMessage, MarkRead, MessageFlag, MessageIdParam, MessageQueue, MessageQueueEntry, MessageView, MessagesPage, OrgUserBody, ResolveMessageFlags, SendMessage, StartDirectChat, StartGroupChat };
|
|
587
|
+
export { BlockParam, Chat, ChatIdParam, ChatListItem, ChatListQuery, ChatLiveEvent, ChatUnreadSummary, ChatsPage, CommunityParam, DirectChatParam, EditMessage, MarkRead, MessageFlag, MessageIdParam, MessageQueue, MessageQueueEntry, MessageView, MessagesPage, OrgUserBody, ResolveMessageFlags, SendMessage, StartDirectChat, StartGroupChat };
|
|
409
588
|
//# sourceMappingURL=chats.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { paginated } from "./shared.js";
|
|
1
|
+
import { PageQuery, paginated } from "./shared.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { chatLastMessageSchema, chatSchema, idSchema, messageFlagResolutionSchema, messageFlagSchema, messageViewSchema, subscriptionViewSchema } from "@headless-lms/core/schemas";
|
|
3
|
+
import { chatLastMessageSchema, chatLiveEventSchema, chatSchema, chatUnreadSummarySchema, commentAuthorSchema, idSchema, messageFlagResolutionSchema, messageFlagSchema, messageViewSchema, subscriptionViewSchema } from "@headless-lms/core/schemas";
|
|
4
4
|
//#region src/http/schemas/chats.ts
|
|
5
5
|
const Chat = chatSchema;
|
|
6
6
|
const MessageFlag = messageFlagSchema;
|
|
@@ -9,12 +9,16 @@ const MessagesPage = paginated(MessageView);
|
|
|
9
9
|
const ChatListItem = z.object({
|
|
10
10
|
chat: Chat,
|
|
11
11
|
participantIds: z.array(z.string()),
|
|
12
|
+
participants: z.array(commentAuthorSchema).describe("The profiles of the people in `participantIds`"),
|
|
12
13
|
lastReadMessageId: z.string().nullable(),
|
|
13
14
|
subscription: subscriptionViewSchema.nullable().describe("Your mute on this chat while it applies; null when none"),
|
|
14
15
|
unread: z.number().int(),
|
|
15
16
|
lastMessage: chatLastMessageSchema.nullable()
|
|
16
17
|
});
|
|
17
18
|
const ChatsPage = paginated(ChatListItem);
|
|
19
|
+
const ChatListQuery = PageQuery.extend({ requests: z.stringbool().optional().describe("`true` for only the pending message requests to you, `false` for everything else; omit for every chat") }).strict();
|
|
20
|
+
const ChatUnreadSummary = chatUnreadSummarySchema;
|
|
21
|
+
const ChatLiveEvent = chatLiveEventSchema;
|
|
18
22
|
const MessageQueueEntry = z.object({
|
|
19
23
|
message: MessageView,
|
|
20
24
|
flags: z.array(MessageFlag),
|
|
@@ -37,7 +41,8 @@ const StartGroupChat = z.object({
|
|
|
37
41
|
const SendMessage = z.object({
|
|
38
42
|
body: MessageBody,
|
|
39
43
|
replyToId: idSchema.nullable().default(null).describe("A message in the same chat this one answers"),
|
|
40
|
-
assetIds: Attachments
|
|
44
|
+
assetIds: Attachments,
|
|
45
|
+
clientId: z.uuid().optional().describe("Your id for this send. Sending again with the same id returns the message already sent.")
|
|
41
46
|
}).strict();
|
|
42
47
|
const EditMessage = z.object({ body: MessageBody }).strict();
|
|
43
48
|
const MarkRead = z.object({ messageId: idSchema.describe("The newest message you have read in this chat") }).strict();
|
|
@@ -50,7 +55,11 @@ const BlockParam = z.object({
|
|
|
50
55
|
communityId: z.string(),
|
|
51
56
|
orgUserId: z.string()
|
|
52
57
|
});
|
|
58
|
+
const DirectChatParam = z.object({
|
|
59
|
+
communityId: z.string(),
|
|
60
|
+
orgUserId: z.string()
|
|
61
|
+
});
|
|
53
62
|
//#endregion
|
|
54
|
-
export { BlockParam, Chat, ChatIdParam, ChatListItem, ChatsPage, CommunityParam, EditMessage, MarkRead, MessageFlag, MessageIdParam, MessageQueue, MessageQueueEntry, MessageView, MessagesPage, OrgUserBody, ResolveMessageFlags, SendMessage, StartDirectChat, StartGroupChat };
|
|
63
|
+
export { BlockParam, Chat, ChatIdParam, ChatListItem, ChatListQuery, ChatLiveEvent, ChatUnreadSummary, ChatsPage, CommunityParam, DirectChatParam, EditMessage, MarkRead, MessageFlag, MessageIdParam, MessageQueue, MessageQueueEntry, MessageView, MessagesPage, OrgUserBody, ResolveMessageFlags, SendMessage, StartDirectChat, StartGroupChat };
|
|
55
64
|
|
|
56
65
|
//# sourceMappingURL=chats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats.js","names":[],"sources":["../../../src/http/schemas/chats.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n chatLastMessageSchema,\n chatSchema,\n idSchema,\n messageFlagResolutionSchema,\n messageFlagSchema,\n messageViewSchema,\n subscriptionViewSchema,\n} from '@headless-lms/core/schemas';\nimport { paginated } from './shared.js';\n\nexport const Chat = chatSchema;\nexport const MessageFlag = messageFlagSchema;\nexport const MessageView = messageViewSchema;\nexport const MessagesPage = paginated(MessageView);\n\nexport const ChatListItem = z.object({\n chat: Chat,\n participantIds: z.array(z.string()),\n lastReadMessageId: z.string().nullable(),\n subscription: subscriptionViewSchema\n .nullable()\n .describe('Your mute on this chat while it applies; null when none'),\n unread: z.number().int(),\n lastMessage: chatLastMessageSchema.nullable(),\n});\nexport const ChatsPage = paginated(ChatListItem);\n\nexport const MessageQueueEntry = z.object({\n message: MessageView,\n flags: z.array(MessageFlag),\n chat: Chat,\n participantIds: z.array(z.string()),\n});\n\nexport const MessageQueue = z.object({\n entries: z.array(MessageQueueEntry),\n});\n\nconst MessageBody = z.string().trim().min(1).max(10_000);\nconst Attachments = z\n .array(idSchema)\n .max(10)\n .default([])\n .describe('Up to 10 finalized images you uploaded through `requestMemberUpload`');\n\nexport const StartDirectChat = z\n .object({\n communityId: idSchema,\n orgUserId: idSchema.describe('The person to talk to'),\n body: MessageBody.nullable().describe(\n 'The first message. Null opens the chat without one; a new chat that starts as a message request needs one, and attachments need one.',\n ),\n assetIds: Attachments,\n })\n .strict();\n\nexport const StartGroupChat = z\n .object({\n communityId: idSchema,\n orgUserIds: z\n .array(idSchema)\n .min(2)\n .max(99)\n .describe(\n \"The people to add besides you. The chat may not exceed the community's group size.\",\n ),\n })\n .strict();\n\nexport const SendMessage = z\n .object({\n body: MessageBody,\n replyToId: idSchema\n .nullable()\n .default(null)\n .describe('A message in the same chat this one answers'),\n assetIds: Attachments,\n })\n .strict();\n\nexport const EditMessage = z.object({ body: MessageBody }).strict();\nexport const MarkRead = z\n .object({ messageId: idSchema.describe('The newest message you have read in this chat') })\n .strict();\nexport const OrgUserBody = z.object({ orgUserId: idSchema }).strict();\nexport const ResolveMessageFlags = z\n .object({\n resolution: messageFlagResolutionSchema\n .extract(['dismissed'])\n .describe(\n '`dismissed` closes the open flags and leaves the message up. Deleting the message or locking the chat resolves its flags as `deleted` or `locked` instead.',\n ),\n })\n .strict();\n\nexport const ChatIdParam = z.object({ chatId: z.string() });\nexport const MessageIdParam = z.object({ messageId: z.string() });\nexport const CommunityParam = z.object({ communityId: z.string() });\nexport const BlockParam = z.object({ communityId: z.string(), orgUserId: z.string() });\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"chats.js","names":[],"sources":["../../../src/http/schemas/chats.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n chatLastMessageSchema,\n chatLiveEventSchema,\n chatSchema,\n chatUnreadSummarySchema,\n commentAuthorSchema,\n idSchema,\n messageFlagResolutionSchema,\n messageFlagSchema,\n messageViewSchema,\n subscriptionViewSchema,\n} from '@headless-lms/core/schemas';\nimport { PageQuery, paginated } from './shared.js';\n\nexport const Chat = chatSchema;\nexport const MessageFlag = messageFlagSchema;\nexport const MessageView = messageViewSchema;\nexport const MessagesPage = paginated(MessageView);\n\nexport const ChatListItem = z.object({\n chat: Chat,\n participantIds: z.array(z.string()),\n participants: z\n .array(commentAuthorSchema)\n .describe('The profiles of the people in `participantIds`'),\n lastReadMessageId: z.string().nullable(),\n subscription: subscriptionViewSchema\n .nullable()\n .describe('Your mute on this chat while it applies; null when none'),\n unread: z.number().int(),\n lastMessage: chatLastMessageSchema.nullable(),\n});\nexport const ChatsPage = paginated(ChatListItem);\n\nexport const ChatListQuery = PageQuery.extend({\n requests: z\n .stringbool()\n .optional()\n .describe(\n '`true` for only the pending message requests to you, `false` for everything else; omit for every chat',\n ),\n}).strict();\n\nexport const ChatUnreadSummary = chatUnreadSummarySchema;\nexport const ChatLiveEvent = chatLiveEventSchema;\n\nexport const MessageQueueEntry = z.object({\n message: MessageView,\n flags: z.array(MessageFlag),\n chat: Chat,\n participantIds: z.array(z.string()),\n});\n\nexport const MessageQueue = z.object({\n entries: z.array(MessageQueueEntry),\n});\n\nconst MessageBody = z.string().trim().min(1).max(10_000);\nconst Attachments = z\n .array(idSchema)\n .max(10)\n .default([])\n .describe('Up to 10 finalized images you uploaded through `requestMemberUpload`');\n\nexport const StartDirectChat = z\n .object({\n communityId: idSchema,\n orgUserId: idSchema.describe('The person to talk to'),\n body: MessageBody.nullable().describe(\n 'The first message. Null opens the chat without one; a new chat that starts as a message request needs one, and attachments need one.',\n ),\n assetIds: Attachments,\n })\n .strict();\n\nexport const StartGroupChat = z\n .object({\n communityId: idSchema,\n orgUserIds: z\n .array(idSchema)\n .min(2)\n .max(99)\n .describe(\n \"The people to add besides you. The chat may not exceed the community's group size.\",\n ),\n })\n .strict();\n\nexport const SendMessage = z\n .object({\n body: MessageBody,\n replyToId: idSchema\n .nullable()\n .default(null)\n .describe('A message in the same chat this one answers'),\n assetIds: Attachments,\n clientId: z\n .uuid()\n .optional()\n .describe(\n 'Your id for this send. Sending again with the same id returns the message already sent.',\n ),\n })\n .strict();\n\nexport const EditMessage = z.object({ body: MessageBody }).strict();\nexport const MarkRead = z\n .object({ messageId: idSchema.describe('The newest message you have read in this chat') })\n .strict();\nexport const OrgUserBody = z.object({ orgUserId: idSchema }).strict();\nexport const ResolveMessageFlags = z\n .object({\n resolution: messageFlagResolutionSchema\n .extract(['dismissed'])\n .describe(\n '`dismissed` closes the open flags and leaves the message up. Deleting the message or locking the chat resolves its flags as `deleted` or `locked` instead.',\n ),\n })\n .strict();\n\nexport const ChatIdParam = z.object({ chatId: z.string() });\nexport const MessageIdParam = z.object({ messageId: z.string() });\nexport const CommunityParam = z.object({ communityId: z.string() });\nexport const BlockParam = z.object({ communityId: z.string(), orgUserId: z.string() });\nexport const DirectChatParam = z.object({ communityId: z.string(), orgUserId: z.string() });\n"],"mappings":";;;;AAeA,MAAa,OAAO;AACpB,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,eAAe,UAAU,WAAW;AAEjD,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM;CACN,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC;CAClC,cAAc,EACX,MAAM,mBAAmB,CAAC,CAC1B,SAAS,gDAAgD;CAC5D,mBAAmB,EAAE,OAAO,CAAC,CAAC,SAAS;CACvC,cAAc,uBACX,SAAS,CAAC,CACV,SAAS,yDAAyD;CACrE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI;CACvB,aAAa,sBAAsB,SAAS;AAC9C,CAAC;AACD,MAAa,YAAY,UAAU,YAAY;AAE/C,MAAa,gBAAgB,UAAU,OAAO,EAC5C,UAAU,EACP,WAAW,CAAC,CACZ,SAAS,CAAC,CACV,SACC,uGACF,EACJ,CAAC,CAAC,CAAC,OAAO;AAEV,MAAa,oBAAoB;AACjC,MAAa,gBAAgB;AAE7B,MAAa,oBAAoB,EAAE,OAAO;CACxC,SAAS;CACT,OAAO,EAAE,MAAM,WAAW;CAC1B,MAAM;CACN,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC;AACpC,CAAC;AAED,MAAa,eAAe,EAAE,OAAO,EACnC,SAAS,EAAE,MAAM,iBAAiB,EACpC,CAAC;AAED,MAAM,cAAc,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM;AACvD,MAAM,cAAc,EACjB,MAAM,QAAQ,CAAC,CACf,IAAI,EAAE,CAAC,CACP,QAAQ,CAAC,CAAC,CAAC,CACX,SAAS,sEAAsE;AAElF,MAAa,kBAAkB,EAC5B,OAAO;CACN,aAAa;CACb,WAAW,SAAS,SAAS,uBAAuB;CACpD,MAAM,YAAY,SAAS,CAAC,CAAC,SAC3B,sIACF;CACA,UAAU;AACZ,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,iBAAiB,EAC3B,OAAO;CACN,aAAa;CACb,YAAY,EACT,MAAM,QAAQ,CAAC,CACf,IAAI,CAAC,CAAC,CACN,IAAI,EAAE,CAAC,CACP,SACC,oFACF;AACJ,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,cAAc,EACxB,OAAO;CACN,MAAM;CACN,WAAW,SACR,SAAS,CAAC,CACV,QAAQ,IAAI,CAAC,CACb,SAAS,6CAA6C;CACzD,UAAU;CACV,UAAU,EACP,KAAK,CAAC,CACN,SAAS,CAAC,CACV,SACC,yFACF;AACJ,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,cAAc,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC,CAAC,CAAC,OAAO;AAClE,MAAa,WAAW,EACrB,OAAO,EAAE,WAAW,SAAS,SAAS,+CAA+C,EAAE,CAAC,CAAC,CACzF,OAAO;AACV,MAAa,cAAc,EAAE,OAAO,EAAE,WAAW,SAAS,CAAC,CAAC,CAAC,OAAO;AACpE,MAAa,sBAAsB,EAChC,OAAO,EACN,YAAY,4BACT,QAAQ,CAAC,WAAW,CAAC,CAAC,CACtB,SACC,4JACF,EACJ,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC1D,MAAa,iBAAiB,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AAChE,MAAa,iBAAiB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;AAClE,MAAa,aAAa,EAAE,OAAO;CAAE,aAAa,EAAE,OAAO;CAAG,WAAW,EAAE,OAAO;AAAE,CAAC;AACrF,MAAa,kBAAkB,EAAE,OAAO;CAAE,aAAa,EAAE,OAAO;CAAG,WAAW,EAAE,OAAO;AAAE,CAAC"}
|