@headless-lms/core 0.1.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/LICENSE +21 -0
- package/dist/assets/events.d.ts +81 -0
- package/dist/assets/events.js +24 -0
- package/dist/assets/events.js.map +1 -0
- package/dist/assets/index.d.ts +7 -0
- package/dist/assets/index.js +3 -0
- package/dist/assets/model.d.ts +4 -0
- package/dist/assets/model.js +1 -0
- package/dist/assets/ports.d.ts +34 -0
- package/dist/assets/ports.js +1 -0
- package/dist/assets/service.d.ts +29 -0
- package/dist/assets/service.js +130 -0
- package/dist/assets/service.js.map +1 -0
- package/dist/automations/actions.d.ts +24 -0
- package/dist/automations/actions.js +59 -0
- package/dist/automations/actions.js.map +1 -0
- package/dist/automations/catalog.d.ts +12 -0
- package/dist/automations/catalog.js +224 -0
- package/dist/automations/catalog.js.map +1 -0
- package/dist/automations/events.d.ts +264 -0
- package/dist/automations/events.js +54 -0
- package/dist/automations/events.js.map +1 -0
- package/dist/automations/index.d.ts +9 -0
- package/dist/automations/index.js +4 -0
- package/dist/automations/model.d.ts +12 -0
- package/dist/automations/model.js +14 -0
- package/dist/automations/model.js.map +1 -0
- package/dist/automations/ports.d.ts +56 -0
- package/dist/automations/ports.js +1 -0
- package/dist/automations/service.d.ts +53 -0
- package/dist/automations/service.js +225 -0
- package/dist/automations/service.js.map +1 -0
- package/dist/automations/types.d.ts +3 -0
- package/dist/automations/types.js +1 -0
- package/dist/content/events.d.ts +410 -0
- package/dist/content/events.js +105 -0
- package/dist/content/events.js.map +1 -0
- package/dist/content/index.d.ts +8 -0
- package/dist/content/index.js +3 -0
- package/dist/content/model.d.ts +3 -0
- package/dist/content/model.js +1 -0
- package/dist/content/ports.d.ts +85 -0
- package/dist/content/ports.js +1 -0
- package/dist/content/service.d.ts +54 -0
- package/dist/content/service.js +479 -0
- package/dist/content/service.js.map +1 -0
- package/dist/content/types.d.ts +4 -0
- package/dist/content/types.js +1 -0
- package/dist/discussion/events.d.ts +101 -0
- package/dist/discussion/events.js +29 -0
- package/dist/discussion/events.js.map +1 -0
- package/dist/discussion/index.d.ts +8 -0
- package/dist/discussion/index.js +3 -0
- package/dist/discussion/model.d.ts +5 -0
- package/dist/discussion/model.js +1 -0
- package/dist/discussion/ports.d.ts +112 -0
- package/dist/discussion/ports.js +1 -0
- package/dist/discussion/service.d.ts +67 -0
- package/dist/discussion/service.js +343 -0
- package/dist/discussion/service.js.map +1 -0
- package/dist/discussion/types.d.ts +4 -0
- package/dist/discussion/types.js +1 -0
- package/dist/entitlements/events.d.ts +89 -0
- package/dist/entitlements/events.js +29 -0
- package/dist/entitlements/events.js.map +1 -0
- package/dist/entitlements/index.d.ts +7 -0
- package/dist/entitlements/index.js +3 -0
- package/dist/entitlements/model.d.ts +4 -0
- package/dist/entitlements/model.js +1 -0
- package/dist/entitlements/ports.d.ts +34 -0
- package/dist/entitlements/ports.js +1 -0
- package/dist/entitlements/service.d.ts +27 -0
- package/dist/entitlements/service.js +60 -0
- package/dist/entitlements/service.js.map +1 -0
- package/dist/identity/events.d.ts +63 -0
- package/dist/identity/events.js +24 -0
- package/dist/identity/events.js.map +1 -0
- package/dist/identity/index.d.ts +8 -0
- package/dist/identity/index.js +3 -0
- package/dist/identity/model.d.ts +3 -0
- package/dist/identity/model.js +1 -0
- package/dist/identity/ports.d.ts +58 -0
- package/dist/identity/ports.js +1 -0
- package/dist/identity/service.d.ts +38 -0
- package/dist/identity/service.js +79 -0
- package/dist/identity/service.js.map +1 -0
- package/dist/identity/types.d.ts +4 -0
- package/dist/identity/types.js +1 -0
- package/dist/integrations/events.d.ts +70 -0
- package/dist/integrations/events.js +24 -0
- package/dist/integrations/events.js.map +1 -0
- package/dist/integrations/index.d.ts +9 -0
- package/dist/integrations/index.js +6 -0
- package/dist/integrations/model.d.ts +28 -0
- package/dist/integrations/model.js +45 -0
- package/dist/integrations/model.js.map +1 -0
- package/dist/integrations/ports.d.ts +62 -0
- package/dist/integrations/ports.js +1 -0
- package/dist/integrations/registry.d.ts +7 -0
- package/dist/integrations/registry.js +16 -0
- package/dist/integrations/registry.js.map +1 -0
- package/dist/integrations/service.d.ts +47 -0
- package/dist/integrations/service.js +184 -0
- package/dist/integrations/service.js.map +1 -0
- package/dist/integrations/zod.d.ts +29 -0
- package/dist/integrations/zod.js +40 -0
- package/dist/integrations/zod.js.map +1 -0
- package/dist/organizations/events.d.ts +197 -0
- package/dist/organizations/events.js +59 -0
- package/dist/organizations/events.js.map +1 -0
- package/dist/organizations/index.d.ts +11 -0
- package/dist/organizations/index.js +5 -0
- package/dist/organizations/members.d.ts +32 -0
- package/dist/organizations/members.js +12 -0
- package/dist/organizations/members.js.map +1 -0
- package/dist/organizations/model.d.ts +3 -0
- package/dist/organizations/model.js +1 -0
- package/dist/organizations/ports.d.ts +127 -0
- package/dist/organizations/ports.js +1 -0
- package/dist/organizations/roles.d.ts +23 -0
- package/dist/organizations/roles.js +70 -0
- package/dist/organizations/roles.js.map +1 -0
- package/dist/organizations/service.d.ts +58 -0
- package/dist/organizations/service.js +359 -0
- package/dist/organizations/service.js.map +1 -0
- package/dist/organizations/types.d.ts +39 -0
- package/dist/organizations/types.js +1 -0
- package/dist/progress/events.d.ts +55 -0
- package/dist/progress/events.js +19 -0
- package/dist/progress/events.js.map +1 -0
- package/dist/progress/index.d.ts +8 -0
- package/dist/progress/index.js +3 -0
- package/dist/progress/model.d.ts +3 -0
- package/dist/progress/model.js +1 -0
- package/dist/progress/ports.d.ts +37 -0
- package/dist/progress/ports.js +1 -0
- package/dist/progress/service.d.ts +33 -0
- package/dist/progress/service.js +181 -0
- package/dist/progress/service.js.map +1 -0
- package/dist/progress/types.d.ts +4 -0
- package/dist/progress/types.js +1 -0
- package/dist/reporting/dashboard/index.d.ts +4 -0
- package/dist/reporting/dashboard/index.js +2 -0
- package/dist/reporting/dashboard/model.d.ts +14 -0
- package/dist/reporting/dashboard/model.js +1 -0
- package/dist/reporting/dashboard/ports.d.ts +13 -0
- package/dist/reporting/dashboard/ports.js +1 -0
- package/dist/reporting/dashboard/service.d.ts +19 -0
- package/dist/reporting/dashboard/service.js +20 -0
- package/dist/reporting/dashboard/service.js.map +1 -0
- package/dist/reporting/learn/index.d.ts +5 -0
- package/dist/reporting/learn/index.js +2 -0
- package/dist/reporting/learn/model.d.ts +23 -0
- package/dist/reporting/learn/model.js +1 -0
- package/dist/reporting/learn/ports.d.ts +42 -0
- package/dist/reporting/learn/ports.js +1 -0
- package/dist/reporting/learn/service.d.ts +48 -0
- package/dist/reporting/learn/service.js +111 -0
- package/dist/reporting/learn/service.js.map +1 -0
- package/dist/reporting/students/index.d.ts +4 -0
- package/dist/reporting/students/index.js +2 -0
- package/dist/reporting/students/model.d.ts +31 -0
- package/dist/reporting/students/model.js +1 -0
- package/dist/reporting/students/ports.d.ts +13 -0
- package/dist/reporting/students/ports.js +1 -0
- package/dist/reporting/students/service.d.ts +19 -0
- package/dist/reporting/students/service.js +20 -0
- package/dist/reporting/students/service.js.map +1 -0
- package/dist/shared/errors.d.ts +22 -0
- package/dist/shared/errors.js +34 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/events.d.ts +31 -0
- package/dist/shared/events.js +75 -0
- package/dist/shared/events.js.map +1 -0
- package/dist/shared/id.d.ts +44 -0
- package/dist/shared/id.js +53 -0
- package/dist/shared/id.js.map +1 -0
- package/dist/shared/invite-token.d.ts +9 -0
- package/dist/shared/invite-token.js +16 -0
- package/dist/shared/invite-token.js.map +1 -0
- package/dist/shared/logger.d.ts +19 -0
- package/dist/shared/logger.js +44 -0
- package/dist/shared/logger.js.map +1 -0
- package/dist/shared/mailer.d.ts +23 -0
- package/dist/shared/mailer.js +27 -0
- package/dist/shared/mailer.js.map +1 -0
- package/dist/shared/ports.d.ts +62 -0
- package/dist/shared/ports.js +2 -0
- package/dist/shared/settings.d.ts +25 -0
- package/dist/shared/settings.js +21 -0
- package/dist/shared/settings.js.map +1 -0
- package/dist/types/assets.d.ts +2 -0
- package/dist/types/assets.js +1 -0
- package/dist/types/automations.d.ts +23 -0
- package/dist/types/automations.js +1 -0
- package/dist/types/content.d.ts +2 -0
- package/dist/types/content.js +1 -0
- package/dist/types/discussion.d.ts +36 -0
- package/dist/types/discussion.js +1 -0
- package/dist/types/email-templates.d.ts +57 -0
- package/dist/types/email-templates.js +1 -0
- package/dist/types/entitlements.d.ts +3 -0
- package/dist/types/entitlements.js +1 -0
- package/dist/types/events.d.ts +25 -0
- package/dist/types/events.js +1 -0
- package/dist/types/identity.d.ts +37 -0
- package/dist/types/identity.js +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.js +1 -0
- package/dist/types/integrations.d.ts +45 -0
- package/dist/types/integrations.js +1 -0
- package/dist/types/organizations.d.ts +15 -0
- package/dist/types/organizations.js +1 -0
- package/dist/types/ports.d.ts +57 -0
- package/dist/types/ports.js +1 -0
- package/dist/types/progress.d.ts +6 -0
- package/dist/types/progress.js +1 -0
- package/dist/types/schemas/assets.d.ts +109 -0
- package/dist/types/schemas/assets.js +49 -0
- package/dist/types/schemas/assets.js.map +1 -0
- package/dist/types/schemas/automations.d.ts +118 -0
- package/dist/types/schemas/automations.js +73 -0
- package/dist/types/schemas/automations.js.map +1 -0
- package/dist/types/schemas/content.d.ts +216 -0
- package/dist/types/schemas/content.js +138 -0
- package/dist/types/schemas/content.js.map +1 -0
- package/dist/types/schemas/credentials.d.ts +15 -0
- package/dist/types/schemas/credentials.js +15 -0
- package/dist/types/schemas/credentials.js.map +1 -0
- package/dist/types/schemas/discussion.d.ts +192 -0
- package/dist/types/schemas/discussion.js +100 -0
- package/dist/types/schemas/discussion.js.map +1 -0
- package/dist/types/schemas/entitlements.d.ts +50 -0
- package/dist/types/schemas/entitlements.js +38 -0
- package/dist/types/schemas/entitlements.js.map +1 -0
- package/dist/types/schemas/identity.d.ts +37 -0
- package/dist/types/schemas/identity.js +34 -0
- package/dist/types/schemas/identity.js.map +1 -0
- package/dist/types/schemas/index.d.ts +14 -0
- package/dist/types/schemas/index.js +14 -0
- package/dist/types/schemas/integrations.d.ts +36 -0
- package/dist/types/schemas/integrations.js +30 -0
- package/dist/types/schemas/integrations.js.map +1 -0
- package/dist/types/schemas/organizations.d.ts +135 -0
- package/dist/types/schemas/organizations.js +90 -0
- package/dist/types/schemas/organizations.js.map +1 -0
- package/dist/types/schemas/outbox.d.ts +19 -0
- package/dist/types/schemas/outbox.js +18 -0
- package/dist/types/schemas/outbox.js.map +1 -0
- package/dist/types/schemas/progress.d.ts +53 -0
- package/dist/types/schemas/progress.js +37 -0
- package/dist/types/schemas/progress.js.map +1 -0
- package/dist/types/schemas/settings.d.ts +16 -0
- package/dist/types/schemas/settings.js +15 -0
- package/dist/types/schemas/settings.js.map +1 -0
- package/dist/types/schemas/shared.d.ts +13 -0
- package/dist/types/schemas/shared.js +28 -0
- package/dist/types/schemas/shared.js.map +1 -0
- package/dist/types/shared.d.ts +25 -0
- package/dist/types/shared.js +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { DomainEvent, JsonValue } from "../shared.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/types/schemas/automations.d.ts
|
|
4
|
+
declare const automationTriggerSchema: z.ZodString;
|
|
5
|
+
type AutomationTrigger = z.infer<typeof automationTriggerSchema>;
|
|
6
|
+
declare const automationActionSchema: z.ZodObject<{
|
|
7
|
+
type: z.ZodString;
|
|
8
|
+
input: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
type AutomationAction = z.infer<typeof automationActionSchema>;
|
|
11
|
+
declare const automationSchema: z.ZodObject<{
|
|
12
|
+
orgId: z.ZodString;
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
description: z.ZodNullable<z.ZodString>;
|
|
16
|
+
trigger: z.ZodString;
|
|
17
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
18
|
+
type: z.ZodString;
|
|
19
|
+
input: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
20
|
+
}, z.core.$strict>>;
|
|
21
|
+
enabled: z.ZodBoolean;
|
|
22
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
23
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
type Automation = z.output<typeof automationSchema>;
|
|
26
|
+
type AutomationInput = z.input<typeof automationSchema>;
|
|
27
|
+
declare const createAutomationInputSchema: z.ZodObject<{
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
description: z.ZodOptional<z.ZodString>;
|
|
30
|
+
trigger: z.ZodString;
|
|
31
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
32
|
+
type: z.ZodString;
|
|
33
|
+
input: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
type CreateAutomationInput = z.infer<typeof createAutomationInputSchema>;
|
|
37
|
+
declare const updateAutomationInputSchema: z.ZodObject<{
|
|
38
|
+
name: z.ZodOptional<z.ZodString>;
|
|
39
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
40
|
+
trigger: z.ZodOptional<z.ZodString>;
|
|
41
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
42
|
+
type: z.ZodString;
|
|
43
|
+
input: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
44
|
+
}, z.core.$strict>>>;
|
|
45
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
type UpdateAutomationInput = z.infer<typeof updateAutomationInputSchema>;
|
|
48
|
+
declare const automationRunsQuerySchema: z.ZodObject<{
|
|
49
|
+
page: z.ZodNumber;
|
|
50
|
+
pageSize: z.ZodNumber;
|
|
51
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
running: "running";
|
|
53
|
+
completed: "completed";
|
|
54
|
+
failed: "failed";
|
|
55
|
+
}>>;
|
|
56
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
type AutomationRunsQuery = z.infer<typeof automationRunsQuerySchema>;
|
|
59
|
+
declare const automationRunStatusSchema: z.ZodEnum<{
|
|
60
|
+
running: "running";
|
|
61
|
+
completed: "completed";
|
|
62
|
+
failed: "failed";
|
|
63
|
+
}>;
|
|
64
|
+
type AutomationRunStatus = z.infer<typeof automationRunStatusSchema>;
|
|
65
|
+
declare const automationActionResultSchema: z.ZodObject<{
|
|
66
|
+
index: z.ZodNumber;
|
|
67
|
+
type: z.ZodString;
|
|
68
|
+
status: z.ZodEnum<{
|
|
69
|
+
completed: "completed";
|
|
70
|
+
failed: "failed";
|
|
71
|
+
}>;
|
|
72
|
+
error: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
type AutomationActionResult = z.infer<typeof automationActionResultSchema>;
|
|
75
|
+
declare const automationRunSchema: z.ZodObject<{
|
|
76
|
+
orgId: z.ZodString;
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
automationId: z.ZodString;
|
|
79
|
+
trigger: z.ZodString;
|
|
80
|
+
eventId: z.ZodString;
|
|
81
|
+
event: z.ZodType<DomainEvent<unknown, string, number>, unknown, z.core.$ZodTypeInternals<DomainEvent<unknown, string, number>, unknown>>;
|
|
82
|
+
status: z.ZodEnum<{
|
|
83
|
+
running: "running";
|
|
84
|
+
completed: "completed";
|
|
85
|
+
failed: "failed";
|
|
86
|
+
}>;
|
|
87
|
+
actionResults: z.ZodArray<z.ZodObject<{
|
|
88
|
+
index: z.ZodNumber;
|
|
89
|
+
type: z.ZodString;
|
|
90
|
+
status: z.ZodEnum<{
|
|
91
|
+
completed: "completed";
|
|
92
|
+
failed: "failed";
|
|
93
|
+
}>;
|
|
94
|
+
error: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strict>>;
|
|
96
|
+
startedAt: z.ZodCoercedDate<unknown>;
|
|
97
|
+
finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
type AutomationRun = z.output<typeof automationRunSchema>;
|
|
100
|
+
type AutomationRunInput = z.input<typeof automationRunSchema>;
|
|
101
|
+
declare const availableActionSchema: z.ZodObject<{
|
|
102
|
+
type: z.ZodString;
|
|
103
|
+
description: z.ZodString;
|
|
104
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
105
|
+
source: z.ZodString;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
type AvailableAction = z.infer<typeof availableActionSchema>;
|
|
108
|
+
type AvailableActions = AvailableAction[];
|
|
109
|
+
declare const availableTriggersSchema: z.ZodObject<{
|
|
110
|
+
triggers: z.ZodArray<z.ZodObject<{
|
|
111
|
+
type: z.ZodString;
|
|
112
|
+
description: z.ZodString;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
type AvailableTriggers = z.infer<typeof availableTriggersSchema>;
|
|
116
|
+
//#endregion
|
|
117
|
+
export { Automation, AutomationAction, AutomationActionResult, AutomationInput, AutomationRun, AutomationRunInput, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, UpdateAutomationInput, automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, updateAutomationInputSchema };
|
|
118
|
+
//# sourceMappingURL=automations.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { domainEventSchema, idSchema, jsonRecordSchema } from "./shared.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/types/schemas/automations.ts
|
|
4
|
+
const automationTriggerSchema = z.string().trim().min(1);
|
|
5
|
+
const automationActionSchema = z.object({
|
|
6
|
+
type: z.string().trim().min(1),
|
|
7
|
+
input: jsonRecordSchema
|
|
8
|
+
}).strict();
|
|
9
|
+
const automationSchema = z.object({
|
|
10
|
+
orgId: idSchema,
|
|
11
|
+
id: idSchema,
|
|
12
|
+
name: z.string(),
|
|
13
|
+
description: z.string().nullable(),
|
|
14
|
+
trigger: automationTriggerSchema,
|
|
15
|
+
actions: z.array(automationActionSchema),
|
|
16
|
+
enabled: z.boolean(),
|
|
17
|
+
createdAt: z.coerce.date(),
|
|
18
|
+
updatedAt: z.coerce.date()
|
|
19
|
+
}).strict();
|
|
20
|
+
const createAutomationInputSchema = z.object({
|
|
21
|
+
name: z.string(),
|
|
22
|
+
description: z.string().optional(),
|
|
23
|
+
trigger: automationTriggerSchema,
|
|
24
|
+
actions: z.array(automationActionSchema)
|
|
25
|
+
}).strict();
|
|
26
|
+
const updateAutomationInputSchema = createAutomationInputSchema.partial().extend({ enabled: z.boolean().optional() });
|
|
27
|
+
const automationRunsQuerySchema = z.object({
|
|
28
|
+
page: z.number().int().min(1),
|
|
29
|
+
pageSize: z.number().int().min(1),
|
|
30
|
+
status: z.enum([
|
|
31
|
+
"running",
|
|
32
|
+
"completed",
|
|
33
|
+
"failed"
|
|
34
|
+
]).optional(),
|
|
35
|
+
sort: z.string().optional()
|
|
36
|
+
}).strict();
|
|
37
|
+
const automationRunStatusSchema = z.enum([
|
|
38
|
+
"running",
|
|
39
|
+
"completed",
|
|
40
|
+
"failed"
|
|
41
|
+
]);
|
|
42
|
+
const automationActionResultSchema = z.object({
|
|
43
|
+
index: z.number().int().min(0),
|
|
44
|
+
type: z.string().trim().min(1),
|
|
45
|
+
status: z.enum(["completed", "failed"]),
|
|
46
|
+
error: z.string().optional()
|
|
47
|
+
}).strict();
|
|
48
|
+
const automationRunSchema = z.object({
|
|
49
|
+
orgId: idSchema,
|
|
50
|
+
id: idSchema,
|
|
51
|
+
automationId: idSchema,
|
|
52
|
+
trigger: automationTriggerSchema,
|
|
53
|
+
eventId: idSchema,
|
|
54
|
+
event: domainEventSchema,
|
|
55
|
+
status: automationRunStatusSchema,
|
|
56
|
+
actionResults: z.array(automationActionResultSchema),
|
|
57
|
+
startedAt: z.coerce.date(),
|
|
58
|
+
finishedAt: z.coerce.date().nullable()
|
|
59
|
+
}).strict();
|
|
60
|
+
const availableActionSchema = z.object({
|
|
61
|
+
type: z.string().trim().min(1),
|
|
62
|
+
description: z.string(),
|
|
63
|
+
inputSchema: jsonRecordSchema,
|
|
64
|
+
source: z.string()
|
|
65
|
+
}).strict();
|
|
66
|
+
const availableTriggersSchema = z.object({ triggers: z.array(z.object({
|
|
67
|
+
type: z.string().trim().min(1),
|
|
68
|
+
description: z.string()
|
|
69
|
+
}).strict()) }).strict();
|
|
70
|
+
//#endregion
|
|
71
|
+
export { automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, updateAutomationInputSchema };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=automations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automations.js","names":[],"sources":["../../../src/types/schemas/automations.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { domainEventSchema, idSchema, jsonRecordSchema } from \"./shared.js\";\n\nexport const automationTriggerSchema = z.string().trim().min(1);\nexport type AutomationTrigger = z.infer<typeof automationTriggerSchema>;\n\nexport const automationActionSchema = z.object({\n type: z.string().trim().min(1),\n input: jsonRecordSchema,\n}).strict();\nexport type AutomationAction = z.infer<typeof automationActionSchema>;\n\nexport const automationSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n name: z.string(),\n description: z.string().nullable(),\n trigger: automationTriggerSchema,\n actions: z.array(automationActionSchema),\n enabled: z.boolean(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Automation = z.output<typeof automationSchema>;\nexport type AutomationInput = z.input<typeof automationSchema>;\n\nexport const createAutomationInputSchema = z.object({\n name: z.string(),\n description: z.string().optional(),\n trigger: automationTriggerSchema,\n actions: z.array(automationActionSchema),\n}).strict();\nexport type CreateAutomationInput = z.infer<typeof createAutomationInputSchema>;\n\nexport const updateAutomationInputSchema = createAutomationInputSchema.partial().extend({\n enabled: z.boolean().optional(),\n});\nexport type UpdateAutomationInput = z.infer<typeof updateAutomationInputSchema>;\n\nexport const automationRunsQuerySchema = z.object({\n page: z.number().int().min(1),\n pageSize: z.number().int().min(1),\n status: z.enum([\"running\", \"completed\", \"failed\"]).optional(),\n sort: z.string().optional(),\n}).strict();\nexport type AutomationRunsQuery = z.infer<typeof automationRunsQuerySchema>;\n\nexport const automationRunStatusSchema = z.enum([\"running\", \"completed\", \"failed\"]);\nexport type AutomationRunStatus = z.infer<typeof automationRunStatusSchema>;\n\nexport const automationActionResultSchema = z.object({\n index: z.number().int().min(0),\n type: z.string().trim().min(1),\n status: z.enum([\"completed\", \"failed\"]),\n error: z.string().optional(),\n}).strict();\nexport type AutomationActionResult = z.infer<typeof automationActionResultSchema>;\n\nexport const automationRunSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n automationId: idSchema,\n trigger: automationTriggerSchema,\n eventId: idSchema,\n event: domainEventSchema,\n status: automationRunStatusSchema,\n actionResults: z.array(automationActionResultSchema),\n startedAt: z.coerce.date(),\n finishedAt: z.coerce.date().nullable(),\n}).strict();\nexport type AutomationRun = z.output<typeof automationRunSchema>;\nexport type AutomationRunInput = z.input<typeof automationRunSchema>;\n\nexport const availableActionSchema = z.object({\n type: z.string().trim().min(1),\n description: z.string(),\n inputSchema: jsonRecordSchema,\n source: z.string(),\n}).strict();\nexport type AvailableAction = z.infer<typeof availableActionSchema>;\nexport type AvailableActions = AvailableAction[];\n\nexport const availableTriggersSchema = z.object({\n triggers: z.array(z.object({ type: z.string().trim().min(1), description: z.string() }).strict()),\n}).strict();\nexport type AvailableTriggers = z.infer<typeof availableTriggersSchema>;\n"],"mappings":";;;AAGA,MAAa,0BAA0B,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;AAG9D,MAAa,yBAAyB,EAAE,OAAO;CAC7C,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC7B,OAAO;AACT,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,mBAAmB,EAAE,OAAO;CACvC,OAAO;CACP,IAAI;CACJ,MAAM,EAAE,OAAO;CACf,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,SAAS;CACT,SAAS,EAAE,MAAM,sBAAsB;CACvC,SAAS,EAAE,QAAQ;CACnB,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO;AAIV,MAAa,8BAA8B,EAAE,OAAO;CAClD,MAAM,EAAE,OAAO;CACf,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,SAAS;CACT,SAAS,EAAE,MAAM,sBAAsB;AACzC,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,8BAA8B,4BAA4B,QAAQ,CAAC,CAAC,OAAO,EACtF,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,EAChC,CAAC;AAGD,MAAa,4BAA4B,EAAE,OAAO;CAChD,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAC5B,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAChC,QAAQ,EAAE,KAAK;EAAC;EAAW;EAAa;CAAQ,CAAC,CAAC,CAAC,SAAS;CAC5D,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;AAC5B,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,4BAA4B,EAAE,KAAK;CAAC;CAAW;CAAa;AAAQ,CAAC;AAGlF,MAAa,+BAA+B,EAAE,OAAO;CACnD,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAC7B,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC7B,QAAQ,EAAE,KAAK,CAAC,aAAa,QAAQ,CAAC;CACtC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;AAC7B,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,sBAAsB,EAAE,OAAO;CAC1C,OAAO;CACP,IAAI;CACJ,cAAc;CACd,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACR,eAAe,EAAE,MAAM,4BAA4B;CACnD,WAAW,EAAE,OAAO,KAAK;CACzB,YAAY,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;AACvC,CAAC,CAAC,CAAC,OAAO;AAIV,MAAa,wBAAwB,EAAE,OAAO;CAC5C,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC7B,aAAa,EAAE,OAAO;CACtB,aAAa;CACb,QAAQ,EAAE,OAAO;AACnB,CAAC,CAAC,CAAC,OAAO;AAIV,MAAa,0BAA0B,EAAE,OAAO,EAC9C,UAAU,EAAE,MAAM,EAAE,OAAO;CAAE,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAAG,aAAa,EAAE,OAAO;AAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAClG,CAAC,CAAC,CAAC,OAAO"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { JsonValue } from "../shared.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/types/schemas/content.d.ts
|
|
4
|
+
declare const contentTypeSchema: z.ZodEnum<{
|
|
5
|
+
download: "download";
|
|
6
|
+
course: "course";
|
|
7
|
+
}>;
|
|
8
|
+
type ContentType = z.infer<typeof contentTypeSchema>;
|
|
9
|
+
declare const courseStatusSchema: z.ZodEnum<{
|
|
10
|
+
draft: "draft";
|
|
11
|
+
published: "published";
|
|
12
|
+
}>;
|
|
13
|
+
type CourseStatus = z.infer<typeof courseStatusSchema>;
|
|
14
|
+
declare const courseSettingsSchema: z.ZodObject<{
|
|
15
|
+
transcriptDownloads: z.ZodBoolean;
|
|
16
|
+
comments: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
enabled: z.ZodBoolean;
|
|
18
|
+
threaded: z.ZodBoolean;
|
|
19
|
+
requireReview: z.ZodBoolean;
|
|
20
|
+
reactions: z.ZodBoolean;
|
|
21
|
+
}, z.core.$strict>>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
type CourseSettings = z.infer<typeof courseSettingsSchema>;
|
|
24
|
+
declare const activityCommentsRuleSchema: z.ZodEnum<{
|
|
25
|
+
never: "never";
|
|
26
|
+
inherit: "inherit";
|
|
27
|
+
always: "always";
|
|
28
|
+
}>;
|
|
29
|
+
type ActivityCommentsRule = z.infer<typeof activityCommentsRuleSchema>;
|
|
30
|
+
declare const activitySettingsSchema: z.ZodObject<{
|
|
31
|
+
comments: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
never: "never";
|
|
33
|
+
inherit: "inherit";
|
|
34
|
+
always: "always";
|
|
35
|
+
}>>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
type ActivitySettings = z.infer<typeof activitySettingsSchema>;
|
|
38
|
+
declare const contentItemSchema: z.ZodObject<{
|
|
39
|
+
orgId: z.ZodString;
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
type: z.ZodEnum<{
|
|
42
|
+
download: "download";
|
|
43
|
+
course: "course";
|
|
44
|
+
}>;
|
|
45
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
type ContentItem = z.output<typeof contentItemSchema>;
|
|
48
|
+
type ContentItemInput = z.input<typeof contentItemSchema>;
|
|
49
|
+
declare const courseSchema: z.ZodObject<{
|
|
50
|
+
orgId: z.ZodString;
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
type: z.ZodLiteral<"course">;
|
|
53
|
+
title: z.ZodString;
|
|
54
|
+
slug: z.ZodString;
|
|
55
|
+
description: z.ZodString;
|
|
56
|
+
status: z.ZodEnum<{
|
|
57
|
+
draft: "draft";
|
|
58
|
+
published: "published";
|
|
59
|
+
}>;
|
|
60
|
+
category: z.ZodString;
|
|
61
|
+
thumbnailAssetId: z.ZodNullable<z.ZodString>;
|
|
62
|
+
settings: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
|
|
63
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
64
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
type Course = z.output<typeof courseSchema>;
|
|
67
|
+
type CourseInput = z.input<typeof courseSchema>;
|
|
68
|
+
declare const activitySchema: z.ZodObject<{
|
|
69
|
+
orgId: z.ZodString;
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
moduleId: z.ZodString;
|
|
72
|
+
courseId: z.ZodString;
|
|
73
|
+
seq: z.ZodNumber;
|
|
74
|
+
settings: z.ZodNullable<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
75
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
76
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
type Activity = z.output<typeof activitySchema>;
|
|
79
|
+
type ActivityInput = z.input<typeof activitySchema>;
|
|
80
|
+
declare const moduleSchema: z.ZodObject<{
|
|
81
|
+
orgId: z.ZodString;
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
courseId: z.ZodString;
|
|
84
|
+
title: z.ZodString;
|
|
85
|
+
seq: z.ZodNumber;
|
|
86
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
87
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
type Module = z.output<typeof moduleSchema>;
|
|
90
|
+
type ModuleInput = z.input<typeof moduleSchema>;
|
|
91
|
+
declare const activityAssetSchema: z.ZodObject<{
|
|
92
|
+
orgId: z.ZodString;
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
activityId: z.ZodString;
|
|
95
|
+
assetId: z.ZodString;
|
|
96
|
+
seq: z.ZodNumber;
|
|
97
|
+
}, z.core.$strict>;
|
|
98
|
+
type ActivityAsset = z.output<typeof activityAssetSchema>;
|
|
99
|
+
type ActivityAssetInput = z.input<typeof activityAssetSchema>;
|
|
100
|
+
declare const saveActivityInputSchema: z.ZodObject<{
|
|
101
|
+
settings: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
102
|
+
assetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
}, z.core.$strict>;
|
|
104
|
+
type SaveActivityInput = z.infer<typeof saveActivityInputSchema>;
|
|
105
|
+
declare const listCoursesQuerySchema: z.ZodObject<{
|
|
106
|
+
page: z.ZodNumber;
|
|
107
|
+
pageSize: z.ZodNumber;
|
|
108
|
+
search: z.ZodOptional<z.ZodString>;
|
|
109
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
110
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
draft: "draft";
|
|
112
|
+
published: "published";
|
|
113
|
+
}>>;
|
|
114
|
+
category: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
type ListCoursesQuery = z.infer<typeof listCoursesQuerySchema>;
|
|
117
|
+
declare const createCourseInputSchema: z.ZodObject<{
|
|
118
|
+
title: z.ZodString;
|
|
119
|
+
description: z.ZodOptional<z.ZodString>;
|
|
120
|
+
category: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strict>;
|
|
122
|
+
type CreateCourseInput = z.infer<typeof createCourseInputSchema>;
|
|
123
|
+
declare const updateCourseInputSchema: z.ZodObject<{
|
|
124
|
+
title: z.ZodOptional<z.ZodString>;
|
|
125
|
+
description: z.ZodOptional<z.ZodString>;
|
|
126
|
+
category: z.ZodOptional<z.ZodString>;
|
|
127
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
draft: "draft";
|
|
129
|
+
published: "published";
|
|
130
|
+
}>>;
|
|
131
|
+
thumbnailAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
transcriptDownloads: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
comments: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
135
|
+
enabled: z.ZodBoolean;
|
|
136
|
+
threaded: z.ZodBoolean;
|
|
137
|
+
requireReview: z.ZodBoolean;
|
|
138
|
+
reactions: z.ZodBoolean;
|
|
139
|
+
}, z.core.$strict>>>;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
}, z.core.$strict>;
|
|
142
|
+
type UpdateCourseInput = z.infer<typeof updateCourseInputSchema>;
|
|
143
|
+
declare const downloadStatusSchema: z.ZodEnum<{
|
|
144
|
+
draft: "draft";
|
|
145
|
+
published: "published";
|
|
146
|
+
}>;
|
|
147
|
+
type DownloadStatus = z.infer<typeof downloadStatusSchema>;
|
|
148
|
+
declare const downloadSchema: z.ZodObject<{
|
|
149
|
+
orgId: z.ZodString;
|
|
150
|
+
id: z.ZodString;
|
|
151
|
+
type: z.ZodLiteral<"download">;
|
|
152
|
+
title: z.ZodString;
|
|
153
|
+
slug: z.ZodString;
|
|
154
|
+
description: z.ZodString;
|
|
155
|
+
status: z.ZodEnum<{
|
|
156
|
+
draft: "draft";
|
|
157
|
+
published: "published";
|
|
158
|
+
}>;
|
|
159
|
+
category: z.ZodString;
|
|
160
|
+
thumbnailAssetId: z.ZodNullable<z.ZodString>;
|
|
161
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
162
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
type Download = z.output<typeof downloadSchema>;
|
|
165
|
+
type DownloadInput = z.input<typeof downloadSchema>;
|
|
166
|
+
declare const downloadAssetSchema: z.ZodObject<{
|
|
167
|
+
orgId: z.ZodString;
|
|
168
|
+
id: z.ZodString;
|
|
169
|
+
downloadId: z.ZodString;
|
|
170
|
+
assetId: z.ZodString;
|
|
171
|
+
seq: z.ZodNumber;
|
|
172
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
173
|
+
}, z.core.$strict>;
|
|
174
|
+
type DownloadAsset = z.output<typeof downloadAssetSchema>;
|
|
175
|
+
type DownloadAssetInput = z.input<typeof downloadAssetSchema>;
|
|
176
|
+
declare const listDownloadsQuerySchema: z.ZodObject<{
|
|
177
|
+
page: z.ZodNumber;
|
|
178
|
+
pageSize: z.ZodNumber;
|
|
179
|
+
search: z.ZodOptional<z.ZodString>;
|
|
180
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
181
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
182
|
+
draft: "draft";
|
|
183
|
+
published: "published";
|
|
184
|
+
}>>;
|
|
185
|
+
category: z.ZodOptional<z.ZodString>;
|
|
186
|
+
}, z.core.$strict>;
|
|
187
|
+
type ListDownloadsQuery = z.infer<typeof listDownloadsQuerySchema>;
|
|
188
|
+
declare const createDownloadInputSchema: z.ZodObject<{
|
|
189
|
+
title: z.ZodString;
|
|
190
|
+
description: z.ZodOptional<z.ZodString>;
|
|
191
|
+
category: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strict>;
|
|
193
|
+
type CreateDownloadInput = z.infer<typeof createDownloadInputSchema>;
|
|
194
|
+
declare const updateDownloadInputSchema: z.ZodObject<{
|
|
195
|
+
title: z.ZodOptional<z.ZodString>;
|
|
196
|
+
description: z.ZodOptional<z.ZodString>;
|
|
197
|
+
category: z.ZodOptional<z.ZodString>;
|
|
198
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
199
|
+
draft: "draft";
|
|
200
|
+
published: "published";
|
|
201
|
+
}>>;
|
|
202
|
+
thumbnailAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
type UpdateDownloadInput = z.infer<typeof updateDownloadInputSchema>;
|
|
205
|
+
declare const addDownloadAssetInputSchema: z.ZodObject<{
|
|
206
|
+
assetId: z.ZodString;
|
|
207
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
208
|
+
}, z.core.$strict>;
|
|
209
|
+
type AddDownloadAssetInput = z.infer<typeof addDownloadAssetInputSchema>;
|
|
210
|
+
declare const reorderDownloadAssetsInputSchema: z.ZodObject<{
|
|
211
|
+
assetIds: z.ZodArray<z.ZodString>;
|
|
212
|
+
}, z.core.$strict>;
|
|
213
|
+
type ReorderDownloadAssetsInput = z.infer<typeof reorderDownloadAssetsInputSchema>;
|
|
214
|
+
//#endregion
|
|
215
|
+
export { Activity, ActivityAsset, ActivityAssetInput, ActivityCommentsRule, ActivityInput, ActivitySettings, AddDownloadAssetInput, ContentItem, ContentItemInput, ContentType, Course, CourseInput, CourseSettings, CourseStatus, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadAssetInput, DownloadInput, DownloadStatus, ListCoursesQuery, ListDownloadsQuery, Module, ModuleInput, ReorderDownloadAssetsInput, SaveActivityInput, UpdateCourseInput, UpdateDownloadInput, activityAssetSchema, activityCommentsRuleSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsSchema, courseStatusSchema, createCourseInputSchema, createDownloadInputSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, reorderDownloadAssetsInputSchema, saveActivityInputSchema, updateCourseInputSchema, updateDownloadInputSchema };
|
|
216
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { idSchema, jsonValueSchema } from "./shared.js";
|
|
2
|
+
import { commentSettingsSchema } from "./discussion.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/types/schemas/content.ts
|
|
5
|
+
const contentTypeSchema = z.enum(["course", "download"]);
|
|
6
|
+
const courseStatusSchema = z.enum(["draft", "published"]);
|
|
7
|
+
const courseSettingsSchema = z.object({
|
|
8
|
+
transcriptDownloads: z.boolean(),
|
|
9
|
+
comments: commentSettingsSchema.optional()
|
|
10
|
+
}).strict();
|
|
11
|
+
const activityCommentsRuleSchema = z.enum([
|
|
12
|
+
"inherit",
|
|
13
|
+
"always",
|
|
14
|
+
"never"
|
|
15
|
+
]);
|
|
16
|
+
const activitySettingsSchema = z.object({ comments: activityCommentsRuleSchema.optional() }).strict();
|
|
17
|
+
const contentItemSchema = z.object({
|
|
18
|
+
orgId: idSchema,
|
|
19
|
+
id: idSchema,
|
|
20
|
+
type: contentTypeSchema,
|
|
21
|
+
createdAt: z.coerce.date()
|
|
22
|
+
}).strict();
|
|
23
|
+
const courseSchema = z.object({
|
|
24
|
+
orgId: idSchema,
|
|
25
|
+
id: idSchema,
|
|
26
|
+
type: z.literal("course"),
|
|
27
|
+
title: z.string(),
|
|
28
|
+
slug: z.string(),
|
|
29
|
+
description: z.string(),
|
|
30
|
+
status: courseStatusSchema,
|
|
31
|
+
category: z.string(),
|
|
32
|
+
thumbnailAssetId: idSchema.nullable(),
|
|
33
|
+
settings: jsonValueSchema,
|
|
34
|
+
createdAt: z.coerce.date(),
|
|
35
|
+
updatedAt: z.coerce.date()
|
|
36
|
+
}).strict();
|
|
37
|
+
const activitySchema = z.object({
|
|
38
|
+
orgId: idSchema,
|
|
39
|
+
id: idSchema,
|
|
40
|
+
moduleId: idSchema,
|
|
41
|
+
courseId: idSchema,
|
|
42
|
+
seq: z.number().int().min(0),
|
|
43
|
+
settings: jsonValueSchema.nullable(),
|
|
44
|
+
createdAt: z.coerce.date(),
|
|
45
|
+
updatedAt: z.coerce.date()
|
|
46
|
+
}).strict();
|
|
47
|
+
const moduleSchema = z.object({
|
|
48
|
+
orgId: idSchema,
|
|
49
|
+
id: idSchema,
|
|
50
|
+
courseId: idSchema,
|
|
51
|
+
title: z.string(),
|
|
52
|
+
seq: z.number().int().min(0),
|
|
53
|
+
createdAt: z.coerce.date(),
|
|
54
|
+
updatedAt: z.coerce.date()
|
|
55
|
+
}).strict();
|
|
56
|
+
const activityAssetSchema = z.object({
|
|
57
|
+
orgId: idSchema,
|
|
58
|
+
id: idSchema,
|
|
59
|
+
activityId: idSchema,
|
|
60
|
+
assetId: idSchema,
|
|
61
|
+
seq: z.number().int()
|
|
62
|
+
}).strict();
|
|
63
|
+
const saveActivityInputSchema = z.object({
|
|
64
|
+
settings: jsonValueSchema.optional(),
|
|
65
|
+
assetIds: z.array(idSchema).optional()
|
|
66
|
+
}).strict();
|
|
67
|
+
const listCoursesQuerySchema = z.object({
|
|
68
|
+
page: z.number().int().min(1),
|
|
69
|
+
pageSize: z.number().int().min(1),
|
|
70
|
+
search: z.string().optional(),
|
|
71
|
+
sort: z.string().optional(),
|
|
72
|
+
status: courseStatusSchema.optional(),
|
|
73
|
+
category: z.string().optional()
|
|
74
|
+
}).strict();
|
|
75
|
+
const createCourseInputSchema = z.object({
|
|
76
|
+
title: z.string(),
|
|
77
|
+
description: z.string().optional(),
|
|
78
|
+
category: z.string().optional()
|
|
79
|
+
}).strict();
|
|
80
|
+
const updateCourseInputSchema = z.object({
|
|
81
|
+
title: z.string().optional(),
|
|
82
|
+
description: z.string().optional(),
|
|
83
|
+
category: z.string().optional(),
|
|
84
|
+
status: courseStatusSchema.optional(),
|
|
85
|
+
thumbnailAssetId: idSchema.nullable().optional(),
|
|
86
|
+
settings: courseSettingsSchema.partial().optional()
|
|
87
|
+
}).strict();
|
|
88
|
+
const downloadStatusSchema = z.enum(["draft", "published"]);
|
|
89
|
+
const downloadSchema = z.object({
|
|
90
|
+
orgId: idSchema,
|
|
91
|
+
id: idSchema,
|
|
92
|
+
type: z.literal("download"),
|
|
93
|
+
title: z.string(),
|
|
94
|
+
slug: z.string(),
|
|
95
|
+
description: z.string(),
|
|
96
|
+
status: downloadStatusSchema,
|
|
97
|
+
category: z.string(),
|
|
98
|
+
thumbnailAssetId: idSchema.nullable(),
|
|
99
|
+
createdAt: z.coerce.date(),
|
|
100
|
+
updatedAt: z.coerce.date()
|
|
101
|
+
}).strict();
|
|
102
|
+
const downloadAssetSchema = z.object({
|
|
103
|
+
orgId: idSchema,
|
|
104
|
+
id: idSchema,
|
|
105
|
+
downloadId: idSchema,
|
|
106
|
+
assetId: idSchema,
|
|
107
|
+
seq: z.number().int(),
|
|
108
|
+
displayName: z.string().nullable()
|
|
109
|
+
}).strict();
|
|
110
|
+
const listDownloadsQuerySchema = z.object({
|
|
111
|
+
page: z.number().int().min(1),
|
|
112
|
+
pageSize: z.number().int().min(1),
|
|
113
|
+
search: z.string().optional(),
|
|
114
|
+
sort: z.string().optional(),
|
|
115
|
+
status: downloadStatusSchema.optional(),
|
|
116
|
+
category: z.string().optional()
|
|
117
|
+
}).strict();
|
|
118
|
+
const createDownloadInputSchema = z.object({
|
|
119
|
+
title: z.string(),
|
|
120
|
+
description: z.string().optional(),
|
|
121
|
+
category: z.string().optional()
|
|
122
|
+
}).strict();
|
|
123
|
+
const updateDownloadInputSchema = z.object({
|
|
124
|
+
title: z.string().optional(),
|
|
125
|
+
description: z.string().optional(),
|
|
126
|
+
category: z.string().optional(),
|
|
127
|
+
status: downloadStatusSchema.optional(),
|
|
128
|
+
thumbnailAssetId: idSchema.nullable().optional()
|
|
129
|
+
}).strict();
|
|
130
|
+
const addDownloadAssetInputSchema = z.object({
|
|
131
|
+
assetId: idSchema,
|
|
132
|
+
displayName: z.string().optional()
|
|
133
|
+
}).strict();
|
|
134
|
+
const reorderDownloadAssetsInputSchema = z.object({ assetIds: z.array(idSchema) }).strict();
|
|
135
|
+
//#endregion
|
|
136
|
+
export { activityAssetSchema, activityCommentsRuleSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsSchema, courseStatusSchema, createCourseInputSchema, createDownloadInputSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, reorderDownloadAssetsInputSchema, saveActivityInputSchema, updateCourseInputSchema, updateDownloadInputSchema };
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","names":[],"sources":["../../../src/types/schemas/content.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { commentSettingsSchema } from \"./discussion.js\";\nimport { idSchema, jsonValueSchema } from \"./shared.js\";\n\nexport const contentTypeSchema = z.enum([\"course\", \"download\"]);\nexport type ContentType = z.infer<typeof contentTypeSchema>;\n\nexport const courseStatusSchema = z.enum([\"draft\", \"published\"]);\nexport type CourseStatus = z.infer<typeof courseStatusSchema>;\n\nexport const courseSettingsSchema = z.object({\n transcriptDownloads: z.boolean(),\n comments: commentSettingsSchema.optional(),\n}).strict();\nexport type CourseSettings = z.infer<typeof courseSettingsSchema>;\n\nexport const activityCommentsRuleSchema = z.enum([\"inherit\", \"always\", \"never\"]);\nexport type ActivityCommentsRule = z.infer<typeof activityCommentsRuleSchema>;\n\nexport const activitySettingsSchema = z.object({\n comments: activityCommentsRuleSchema.optional(),\n}).strict();\nexport type ActivitySettings = z.infer<typeof activitySettingsSchema>;\n\nexport const contentItemSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n type: contentTypeSchema,\n createdAt: z.coerce.date(),\n}).strict();\nexport type ContentItem = z.output<typeof contentItemSchema>;\nexport type ContentItemInput = z.input<typeof contentItemSchema>;\n\nexport const courseSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n type: z.literal(\"course\"),\n title: z.string(),\n slug: z.string(),\n description: z.string(),\n status: courseStatusSchema,\n category: z.string(),\n thumbnailAssetId: idSchema.nullable(),\n settings: jsonValueSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Course = z.output<typeof courseSchema>;\nexport type CourseInput = z.input<typeof courseSchema>;\n\nexport const activitySchema = z.object({\n orgId: idSchema,\n id: idSchema,\n moduleId: idSchema,\n courseId: idSchema,\n seq: z.number().int().min(0),\n settings: jsonValueSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Activity = z.output<typeof activitySchema>;\nexport type ActivityInput = z.input<typeof activitySchema>;\n\nexport const moduleSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n courseId: idSchema,\n title: z.string(),\n seq: z.number().int().min(0),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Module = z.output<typeof moduleSchema>;\nexport type ModuleInput = z.input<typeof moduleSchema>;\n\nexport const activityAssetSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n activityId: idSchema,\n assetId: idSchema,\n seq: z.number().int(),\n}).strict();\nexport type ActivityAsset = z.output<typeof activityAssetSchema>;\nexport type ActivityAssetInput = z.input<typeof activityAssetSchema>;\n\nexport const saveActivityInputSchema = z.object({\n settings: jsonValueSchema.optional(),\n assetIds: z.array(idSchema).optional(),\n}).strict();\nexport type SaveActivityInput = z.infer<typeof saveActivityInputSchema>;\n\nexport const listCoursesQuerySchema = z.object({\n page: z.number().int().min(1),\n pageSize: z.number().int().min(1),\n search: z.string().optional(),\n sort: z.string().optional(),\n status: courseStatusSchema.optional(),\n category: z.string().optional(),\n}).strict();\nexport type ListCoursesQuery = z.infer<typeof listCoursesQuerySchema>;\n\nexport const createCourseInputSchema = z.object({\n title: z.string(),\n description: z.string().optional(),\n category: z.string().optional(),\n}).strict();\nexport type CreateCourseInput = z.infer<typeof createCourseInputSchema>;\n\nexport const updateCourseInputSchema = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n category: z.string().optional(),\n status: courseStatusSchema.optional(),\n thumbnailAssetId: idSchema.nullable().optional(),\n settings: courseSettingsSchema.partial().optional(),\n}).strict();\nexport type UpdateCourseInput = z.infer<typeof updateCourseInputSchema>;\n\nexport const downloadStatusSchema = z.enum([\"draft\", \"published\"]);\nexport type DownloadStatus = z.infer<typeof downloadStatusSchema>;\n\nexport const downloadSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n type: z.literal(\"download\"),\n title: z.string(),\n slug: z.string(),\n description: z.string(),\n status: downloadStatusSchema,\n category: z.string(),\n thumbnailAssetId: idSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Download = z.output<typeof downloadSchema>;\nexport type DownloadInput = z.input<typeof downloadSchema>;\n\nexport const downloadAssetSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n downloadId: idSchema,\n assetId: idSchema,\n seq: z.number().int(),\n displayName: z.string().nullable(),\n}).strict();\nexport type DownloadAsset = z.output<typeof downloadAssetSchema>;\nexport type DownloadAssetInput = z.input<typeof downloadAssetSchema>;\n\nexport const listDownloadsQuerySchema = z.object({\n page: z.number().int().min(1),\n pageSize: z.number().int().min(1),\n search: z.string().optional(),\n sort: z.string().optional(),\n status: downloadStatusSchema.optional(),\n category: z.string().optional(),\n}).strict();\nexport type ListDownloadsQuery = z.infer<typeof listDownloadsQuerySchema>;\n\nexport const createDownloadInputSchema = z.object({\n title: z.string(),\n description: z.string().optional(),\n category: z.string().optional(),\n}).strict();\nexport type CreateDownloadInput = z.infer<typeof createDownloadInputSchema>;\n\nexport const updateDownloadInputSchema = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n category: z.string().optional(),\n status: downloadStatusSchema.optional(),\n thumbnailAssetId: idSchema.nullable().optional(),\n}).strict();\nexport type UpdateDownloadInput = z.infer<typeof updateDownloadInputSchema>;\n\nexport const addDownloadAssetInputSchema = z.object({\n assetId: idSchema,\n displayName: z.string().optional(),\n}).strict();\nexport type AddDownloadAssetInput = z.infer<typeof addDownloadAssetInputSchema>;\n\nexport const reorderDownloadAssetsInputSchema = z.object({\n assetIds: z.array(idSchema),\n}).strict();\nexport type ReorderDownloadAssetsInput = z.infer<typeof reorderDownloadAssetsInputSchema>;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/types/schemas/credentials.d.ts
|
|
3
|
+
declare const credentialSchema: z.ZodObject<{
|
|
4
|
+
orgId: z.ZodString;
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
ciphertext: z.ZodString;
|
|
7
|
+
keyVersion: z.ZodNumber;
|
|
8
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
9
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
type Credential = z.output<typeof credentialSchema>;
|
|
12
|
+
type CredentialInput = z.input<typeof credentialSchema>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Credential, CredentialInput, credentialSchema };
|
|
15
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { idSchema } from "./shared.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/types/schemas/credentials.ts
|
|
4
|
+
const credentialSchema = z.object({
|
|
5
|
+
orgId: idSchema,
|
|
6
|
+
id: idSchema,
|
|
7
|
+
ciphertext: z.string(),
|
|
8
|
+
keyVersion: z.number().int(),
|
|
9
|
+
createdAt: z.coerce.date(),
|
|
10
|
+
updatedAt: z.coerce.date()
|
|
11
|
+
}).strict();
|
|
12
|
+
//#endregion
|
|
13
|
+
export { credentialSchema };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","names":[],"sources":["../../../src/types/schemas/credentials.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { idSchema } from \"./shared.js\";\n\nexport const credentialSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n ciphertext: z.string(),\n keyVersion: z.number().int(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Credential = z.output<typeof credentialSchema>;\nexport type CredentialInput = z.input<typeof credentialSchema>;\n"],"mappings":";;;AAGA,MAAa,mBAAmB,EAAE,OAAO;CACvC,OAAO;CACP,IAAI;CACJ,YAAY,EAAE,OAAO;CACrB,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI;CAC3B,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO"}
|