@headless-lms/core 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/assets/file-urls.d.ts +5 -19
  2. package/dist/assets/file-urls.js +2 -23
  3. package/dist/assets/file-urls.js.map +1 -1
  4. package/dist/assets/index.d.ts +3 -3
  5. package/dist/assets/ports.d.ts +9 -10
  6. package/dist/assets/service.d.ts +10 -13
  7. package/dist/assets/service.js +41 -62
  8. package/dist/assets/service.js.map +1 -1
  9. package/dist/automations/index.d.ts +4 -4
  10. package/dist/automations/notifications/delivery.d.ts +3 -3
  11. package/dist/automations/notifications/delivery.js +1 -1
  12. package/dist/automations/notifications/delivery.js.map +1 -1
  13. package/dist/automations/ports.d.ts +2 -2
  14. package/dist/automations/service.d.ts +1 -8
  15. package/dist/automations/service.js +0 -8
  16. package/dist/automations/service.js.map +1 -1
  17. package/dist/content/service.d.ts +4 -1
  18. package/dist/content/service.js +52 -29
  19. package/dist/content/service.js.map +1 -1
  20. package/dist/discussion/chats.d.ts +1 -2
  21. package/dist/discussion/chats.js +8 -17
  22. package/dist/discussion/chats.js.map +1 -1
  23. package/dist/discussion/ports.d.ts +0 -6
  24. package/dist/discussion/ports.js.map +1 -1
  25. package/dist/discussion/posts.d.ts +1 -4
  26. package/dist/discussion/posts.js +8 -21
  27. package/dist/discussion/posts.js.map +1 -1
  28. package/dist/entitlements/events.d.ts +33 -33
  29. package/dist/identity/events.d.ts +2 -2
  30. package/dist/integrations/events.d.ts +3 -3
  31. package/dist/organizations/events.d.ts +2 -2
  32. package/dist/reporting/member/ports.d.ts +1 -10
  33. package/dist/reporting/member/service.d.ts +2 -11
  34. package/dist/reporting/member/service.js +12 -62
  35. package/dist/reporting/member/service.js.map +1 -1
  36. package/dist/types/automations.d.ts +5 -2
  37. package/dist/types/index.d.ts +2 -2
  38. package/dist/types/ports.d.ts +4 -2
  39. package/dist/types/ports.js.map +1 -1
  40. package/dist/types/schemas/content.d.ts +2 -2
  41. package/dist/types/schemas/discussion.d.ts +14 -14
  42. package/dist/types/schemas/entitlements.d.ts +8 -8
  43. package/dist/types/schemas/notifications.d.ts +3 -3
  44. package/package.json +1 -1
@@ -34,7 +34,9 @@ interface StoredObjectInfo {
34
34
  }
35
35
  interface PresignDownloadInput {
36
36
  key: string;
37
- expiresInSeconds?: number;
37
+ /** Links signed with the same key, times and filename are identical. */
38
+ signedAt: Date;
39
+ expiresAt: Date;
38
40
  /** Force a download with this filename (Content-Disposition: attachment). */
39
41
  downloadFilename?: string;
40
42
  }
@@ -46,7 +48,7 @@ interface ObjectStorage {
46
48
  contentType?: string;
47
49
  expiresInSeconds?: number;
48
50
  }): Promise<PresignedUpload>;
49
- /** Presigned URL to fetch/serve a private object (temporary, expiring). */
51
+ /** Signed URL to a private object, served with PUBLIC_CACHE_CONTROL. */
50
52
  presignDownload(input: PresignDownloadInput): Promise<string>;
51
53
  /** Object metadata, or null if it does not exist. */
52
54
  stat(key: string): Promise<StoredObjectInfo | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"ports.js","names":[],"sources":["../../src/types/ports.ts"],"sourcesContent":["// Deployment-swappable ports, implemented by @headless-lms/adapter-* packages.\n\nexport interface Logger {\n debug(msg: string, meta?: Record<string, unknown>): void;\n info(msg: string, meta?: Record<string, unknown>): void;\n warn(msg: string, meta?: Record<string, unknown>): void;\n error(msg: string, meta?: Record<string, unknown>): void;\n /** A logger whose every entry carries `bindings` (call-site meta wins on key clash). */\n child(bindings: Record<string, unknown>): Logger;\n}\n\nexport interface EmailMessage {\n to: string;\n subject: string;\n text: string;\n /** Optional rendered HTML body; transports fall back to text when absent. */\n html?: string;\n}\n\nexport interface EmailSender {\n send(message: EmailMessage): Promise<void>;\n}\n\n// --- Object storage (S3-compatible, opaque keys) ----------------------------\n\n/** A presigned URL the browser uses to PUT a file straight to the store. */\nexport interface PresignedUpload {\n url: string;\n method: 'PUT';\n key: string;\n expiresInSeconds: number;\n /** Headers the client must send on the PUT (e.g. Content-Type). */\n headers: Record<string, string>;\n}\n\nexport interface StoredObjectInfo {\n key: string;\n size: number;\n contentType?: string;\n lastModified?: string;\n}\n\nexport interface PresignDownloadInput {\n key: string;\n expiresInSeconds?: number;\n /** Force a download with this filename (Content-Disposition: attachment). */\n downloadFilename?: string;\n}\n\nexport interface ObjectStorage {\n readonly uploadExpirySeconds: number;\n /** Presigned URL for a direct browser upload (temporary, expiring). */\n presignUpload(input: {\n key: string;\n contentType?: string;\n expiresInSeconds?: number;\n }): Promise<PresignedUpload>;\n /** Presigned URL to fetch/serve a private object (temporary, expiring). */\n presignDownload(input: PresignDownloadInput): Promise<string>;\n /** Object metadata, or null if it does not exist. */\n stat(key: string): Promise<StoredObjectInfo | null>;\n list(prefix: string): Promise<StoredObjectInfo[]>;\n copy(input: { from: string; to: string }): Promise<void>;\n publish(input: { from: string; to: string }): Promise<void>;\n publicUrl(key: string): string;\n /** Permanently remove an object. */\n remove(key: string): Promise<void>;\n}\n\nexport const PUBLIC_PREFIX = 'public/';\nexport const PUBLIC_CACHE_CONTROL = 'public, max-age=31536000, immutable';\n"],"mappings":";AAqEA,MAAa,gBAAgB;AAC7B,MAAa,uBAAuB"}
1
+ {"version":3,"file":"ports.js","names":[],"sources":["../../src/types/ports.ts"],"sourcesContent":["// Deployment-swappable ports, implemented by @headless-lms/adapter-* packages.\n\nexport interface Logger {\n debug(msg: string, meta?: Record<string, unknown>): void;\n info(msg: string, meta?: Record<string, unknown>): void;\n warn(msg: string, meta?: Record<string, unknown>): void;\n error(msg: string, meta?: Record<string, unknown>): void;\n /** A logger whose every entry carries `bindings` (call-site meta wins on key clash). */\n child(bindings: Record<string, unknown>): Logger;\n}\n\nexport interface EmailMessage {\n to: string;\n subject: string;\n text: string;\n /** Optional rendered HTML body; transports fall back to text when absent. */\n html?: string;\n}\n\nexport interface EmailSender {\n send(message: EmailMessage): Promise<void>;\n}\n\n// --- Object storage (S3-compatible, opaque keys) ----------------------------\n\n/** A presigned URL the browser uses to PUT a file straight to the store. */\nexport interface PresignedUpload {\n url: string;\n method: 'PUT';\n key: string;\n expiresInSeconds: number;\n /** Headers the client must send on the PUT (e.g. Content-Type). */\n headers: Record<string, string>;\n}\n\nexport interface StoredObjectInfo {\n key: string;\n size: number;\n contentType?: string;\n lastModified?: string;\n}\n\nexport interface PresignDownloadInput {\n key: string;\n /** Links signed with the same key, times and filename are identical. */\n signedAt: Date;\n expiresAt: Date;\n /** Force a download with this filename (Content-Disposition: attachment). */\n downloadFilename?: string;\n}\n\nexport interface ObjectStorage {\n readonly uploadExpirySeconds: number;\n /** Presigned URL for a direct browser upload (temporary, expiring). */\n presignUpload(input: {\n key: string;\n contentType?: string;\n expiresInSeconds?: number;\n }): Promise<PresignedUpload>;\n /** Signed URL to a private object, served with PUBLIC_CACHE_CONTROL. */\n presignDownload(input: PresignDownloadInput): Promise<string>;\n /** Object metadata, or null if it does not exist. */\n stat(key: string): Promise<StoredObjectInfo | null>;\n list(prefix: string): Promise<StoredObjectInfo[]>;\n copy(input: { from: string; to: string }): Promise<void>;\n publish(input: { from: string; to: string }): Promise<void>;\n publicUrl(key: string): string;\n /** Permanently remove an object. */\n remove(key: string): Promise<void>;\n}\n\nexport const PUBLIC_PREFIX = 'public/';\nexport const PUBLIC_CACHE_CONTROL = 'public, max-age=31536000, immutable';\n"],"mappings":";AAuEA,MAAa,gBAAgB;AAC7B,MAAa,uBAAuB"}
@@ -1017,8 +1017,8 @@ declare const eventLeadSchema: z.ZodEnum<{
1017
1017
  }>;
1018
1018
  type EventLead = z.infer<typeof eventLeadSchema>;
1019
1019
  declare const eventAttendeeSourceSchema: z.ZodEnum<{
1020
- self: "self";
1021
1020
  manual: "manual";
1021
+ self: "self";
1022
1022
  automation: "automation";
1023
1023
  bundle: "bundle";
1024
1024
  }>;
@@ -1028,8 +1028,8 @@ declare const eventAttendeeSchema: z.ZodObject<{
1028
1028
  name: z.ZodString;
1029
1029
  avatarUrl: z.ZodNullable<z.ZodString>;
1030
1030
  source: z.ZodEnum<{
1031
- self: "self";
1032
1031
  manual: "manual";
1032
+ self: "self";
1033
1033
  automation: "automation";
1034
1034
  bundle: "bundle";
1035
1035
  }>;
@@ -238,9 +238,9 @@ declare const listCommentsQuerySchema: z.ZodObject<{
238
238
  }, z.core.$strict>;
239
239
  type ListCommentsQuery = z.infer<typeof listCommentsQuerySchema>;
240
240
  declare const subscriptionItemTypeSchema: z.ZodEnum<{
241
- post: "post";
242
241
  space: "space";
243
242
  chat: "chat";
243
+ post: "post";
244
244
  }>;
245
245
  type SubscriptionItemType = z.infer<typeof subscriptionItemTypeSchema>;
246
246
  declare const subscriptionStateSchema: z.ZodEnum<{
@@ -252,9 +252,9 @@ declare const subscriptionSchema: z.ZodObject<{
252
252
  orgId: z.ZodString;
253
253
  orgUserId: z.ZodString;
254
254
  itemType: z.ZodEnum<{
255
- post: "post";
256
255
  space: "space";
257
256
  chat: "chat";
257
+ post: "post";
258
258
  }>;
259
259
  itemId: z.ZodString;
260
260
  state: z.ZodEnum<{
@@ -601,15 +601,15 @@ declare const liveMessageSchema: z.ZodObject<{
601
601
  communityId: z.ZodString;
602
602
  orgUserId: z.ZodString;
603
603
  body: z.ZodString;
604
- mentions: z.ZodArray<z.ZodObject<{
605
- orgUserId: z.ZodString;
606
- name: z.ZodString;
607
- }, z.core.$strict>>;
608
604
  chatId: z.ZodString;
609
605
  replyToId: z.ZodNullable<z.ZodString>;
610
606
  clientId: z.ZodNullable<z.ZodUUID>;
611
607
  editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
612
608
  deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
609
+ mentions: z.ZodArray<z.ZodObject<{
610
+ orgUserId: z.ZodString;
611
+ name: z.ZodString;
612
+ }, z.core.$strict>>;
613
613
  sender: z.ZodObject<{
614
614
  id: z.ZodString;
615
615
  firstName: z.ZodNullable<z.ZodString>;
@@ -715,15 +715,15 @@ declare const chatLiveEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
715
715
  communityId: z.ZodString;
716
716
  orgUserId: z.ZodString;
717
717
  body: z.ZodString;
718
- mentions: z.ZodArray<z.ZodObject<{
719
- orgUserId: z.ZodString;
720
- name: z.ZodString;
721
- }, z.core.$strict>>;
722
718
  chatId: z.ZodString;
723
719
  replyToId: z.ZodNullable<z.ZodString>;
724
720
  clientId: z.ZodNullable<z.ZodUUID>;
725
721
  editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
726
722
  deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
723
+ mentions: z.ZodArray<z.ZodObject<{
724
+ orgUserId: z.ZodString;
725
+ name: z.ZodString;
726
+ }, z.core.$strict>>;
727
727
  sender: z.ZodObject<{
728
728
  id: z.ZodString;
729
729
  firstName: z.ZodNullable<z.ZodString>;
@@ -753,15 +753,15 @@ declare const chatLiveEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
753
753
  communityId: z.ZodString;
754
754
  orgUserId: z.ZodString;
755
755
  body: z.ZodString;
756
- mentions: z.ZodArray<z.ZodObject<{
757
- orgUserId: z.ZodString;
758
- name: z.ZodString;
759
- }, z.core.$strict>>;
760
756
  chatId: z.ZodString;
761
757
  replyToId: z.ZodNullable<z.ZodString>;
762
758
  clientId: z.ZodNullable<z.ZodUUID>;
763
759
  editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
764
760
  deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
761
+ mentions: z.ZodArray<z.ZodObject<{
762
+ orgUserId: z.ZodString;
763
+ name: z.ZodString;
764
+ }, z.core.$strict>>;
765
765
  sender: z.ZodObject<{
766
766
  id: z.ZodString;
767
767
  firstName: z.ZodNullable<z.ZodString>;
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  //#region src/types/schemas/entitlements.d.ts
3
3
  declare const entitlementStatusSchema: z.ZodEnum<{
4
- revoked: "revoked";
5
4
  active: "active";
5
+ revoked: "revoked";
6
6
  }>;
7
7
  type EntitlementStatus = z.infer<typeof entitlementStatusSchema>;
8
8
  declare const entitlementSchema: z.ZodObject<{
@@ -12,8 +12,8 @@ declare const entitlementSchema: z.ZodObject<{
12
12
  bundleId: z.ZodNullable<z.ZodString>;
13
13
  contentId: z.ZodNullable<z.ZodString>;
14
14
  status: z.ZodEnum<{
15
- revoked: "revoked";
16
15
  active: "active";
16
+ revoked: "revoked";
17
17
  }>;
18
18
  source: z.ZodString;
19
19
  grantedAt: z.ZodCoercedDate<unknown>;
@@ -29,8 +29,8 @@ declare const entitlementsQuerySchema: z.ZodObject<{
29
29
  search: z.ZodOptional<z.ZodString>;
30
30
  sort: z.ZodOptional<z.ZodString>;
31
31
  status: z.ZodOptional<z.ZodEnum<{
32
- revoked: "revoked";
33
32
  active: "active";
33
+ revoked: "revoked";
34
34
  expired: "expired";
35
35
  }>>;
36
36
  source: z.ZodOptional<z.ZodString>;
@@ -59,22 +59,22 @@ declare const grantEntitlementInputSchema: z.ZodObject<{
59
59
  }, z.core.$strict>;
60
60
  type GrantEntitlementInput = z.output<typeof grantEntitlementInputSchema>;
61
61
  declare const grantSourceSchema: z.ZodEnum<{
62
- self: "self";
63
62
  manual: "manual";
63
+ self: "self";
64
64
  automation: "automation";
65
65
  }>;
66
66
  type GrantSource = z.infer<typeof grantSourceSchema>;
67
67
  declare const spaceMemberStatusSchema: z.ZodEnum<{
68
- revoked: "revoked";
69
68
  active: "active";
69
+ revoked: "revoked";
70
70
  requested: "requested";
71
71
  invited: "invited";
72
72
  }>;
73
73
  type SpaceMemberStatus = z.infer<typeof spaceMemberStatusSchema>;
74
74
  declare const spaceMemberSourceSchema: z.ZodEnum<{
75
- manual: "manual";
76
75
  request: "request";
77
76
  invite: "invite";
77
+ manual: "manual";
78
78
  }>;
79
79
  type SpaceMemberSource = z.infer<typeof spaceMemberSourceSchema>;
80
80
  declare const spaceMemberSchema: z.ZodObject<{
@@ -84,15 +84,15 @@ declare const spaceMemberSchema: z.ZodObject<{
84
84
  spaceId: z.ZodString;
85
85
  orgUserId: z.ZodString;
86
86
  status: z.ZodEnum<{
87
- revoked: "revoked";
88
87
  active: "active";
88
+ revoked: "revoked";
89
89
  requested: "requested";
90
90
  invited: "invited";
91
91
  }>;
92
92
  source: z.ZodEnum<{
93
- manual: "manual";
94
93
  request: "request";
95
94
  invite: "invite";
95
+ manual: "manual";
96
96
  }>;
97
97
  createdAt: z.ZodCoercedDate<unknown>;
98
98
  updatedAt: z.ZodCoercedDate<unknown>;
@@ -17,9 +17,9 @@ declare const reasonSchema: z.ZodEnum<{
17
17
  }>;
18
18
  declare const notificationScopeSchema: z.ZodEnum<{
19
19
  community: "community";
20
+ org: "org";
20
21
  space: "space";
21
22
  chat: "chat";
22
- org: "org";
23
23
  }>;
24
24
  declare const subjectTypeSchema: z.ZodEnum<{
25
25
  message: "message";
@@ -28,10 +28,10 @@ declare const subjectTypeSchema: z.ZodEnum<{
28
28
  download: "download";
29
29
  community: "community";
30
30
  bundle: "bundle";
31
- post: "post";
32
- comment: "comment";
33
31
  space: "space";
34
32
  chat: "chat";
33
+ post: "post";
34
+ comment: "comment";
35
35
  activity: "activity";
36
36
  }>;
37
37
  declare const notificationCategoryKeySchema: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-lms/core",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {