@abyss-project/main 41.1.0 → 42.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.
Files changed (136) hide show
  1. package/dist/api/index.d.ts +1 -0
  2. package/dist/api/index.js +1 -0
  3. package/dist/api/index.js.map +1 -1
  4. package/dist/api/rehydration-admission.admin.api.d.ts +4 -0
  5. package/dist/api/rehydration-admission.admin.api.js +13 -0
  6. package/dist/api/rehydration-admission.admin.api.js.map +1 -0
  7. package/dist/api/support-ticket.admin.api.d.ts +8 -2
  8. package/dist/api/support-ticket.admin.api.js +13 -1
  9. package/dist/api/support-ticket.admin.api.js.map +1 -1
  10. package/dist/api/tests/sdk-support-ticket-merge.spec.d.ts +1 -0
  11. package/dist/api/tests/sdk-support-ticket-merge.spec.js +74 -0
  12. package/dist/api/tests/sdk-support-ticket-merge.spec.js.map +1 -0
  13. package/dist/billing-metric-label/billing-metric-label.labels.d.ts +0 -12
  14. package/dist/billing-metric-label/billing-metric-label.labels.js +0 -12
  15. package/dist/billing-metric-label/billing-metric-label.labels.js.map +1 -1
  16. package/dist/constants/billing-catalog.constants.js +0 -21
  17. package/dist/constants/billing-catalog.constants.js.map +1 -1
  18. package/dist/constants/catalog-plan-quotas.constants.js +7 -13
  19. package/dist/constants/catalog-plan-quotas.constants.js.map +1 -1
  20. package/dist/constants/enforcement-registry.constants.js +0 -32
  21. package/dist/constants/enforcement-registry.constants.js.map +1 -1
  22. package/dist/constants/public-plans.constants.js +0 -189
  23. package/dist/constants/public-plans.constants.js.map +1 -1
  24. package/dist/constants/quota-metric-kind.constants.js +0 -6
  25. package/dist/constants/quota-metric-kind.constants.js.map +1 -1
  26. package/dist/constants/support-ticket.constants.d.ts +2 -0
  27. package/dist/constants/support-ticket.constants.js +3 -1
  28. package/dist/constants/support-ticket.constants.js.map +1 -1
  29. package/dist/constants/tests/billing-catalog.constants.spec.js +54 -70
  30. package/dist/constants/tests/billing-catalog.constants.spec.js.map +1 -1
  31. package/dist/index.d.ts +13 -0
  32. package/dist/index.js +13 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/server/archive-rows/index.d.ts +3 -0
  35. package/dist/server/archive-rows/index.js +20 -0
  36. package/dist/server/archive-rows/index.js.map +1 -0
  37. package/dist/server/archive-rows/row-archive.descriptor.d.ts +8 -0
  38. package/dist/server/archive-rows/row-archive.descriptor.js +26 -0
  39. package/dist/server/archive-rows/row-archive.descriptor.js.map +1 -0
  40. package/dist/server/archive-rows/row-archive.service.d.ts +7 -0
  41. package/dist/server/archive-rows/row-archive.service.js +250 -0
  42. package/dist/server/archive-rows/row-archive.service.js.map +1 -0
  43. package/dist/server/archive-rows/row-archive.types.d.ts +40 -0
  44. package/dist/server/archive-rows/row-archive.types.js +3 -0
  45. package/dist/server/archive-rows/row-archive.types.js.map +1 -0
  46. package/dist/server/archive-rows/tests/row-archive.service.spec.d.ts +1 -0
  47. package/dist/server/archive-rows/tests/row-archive.service.spec.js +338 -0
  48. package/dist/server/archive-rows/tests/row-archive.service.spec.js.map +1 -0
  49. package/dist/server/index.d.ts +1 -0
  50. package/dist/server/index.js +1 -0
  51. package/dist/server/index.js.map +1 -1
  52. package/dist/translate/en.translate.js +2 -2
  53. package/dist/translate/en.translate.js.map +1 -1
  54. package/dist/translate/fr.translate.js +2 -2
  55. package/dist/translate/fr.translate.js.map +1 -1
  56. package/dist/translate/tests/storage-over-limit-notification.spec.js +11 -0
  57. package/dist/translate/tests/storage-over-limit-notification.spec.js.map +1 -1
  58. package/dist/types/enum/abyss-application-event.enum.d.ts +8 -0
  59. package/dist/types/enum/abyss-application-event.enum.js +8 -0
  60. package/dist/types/enum/abyss-application-event.enum.js.map +1 -1
  61. package/dist/types/enum/email-type.enum.d.ts +1 -0
  62. package/dist/types/enum/email-type.enum.js +1 -0
  63. package/dist/types/enum/email-type.enum.js.map +1 -1
  64. package/dist/types/enum/index.d.ts +2 -0
  65. package/dist/types/enum/index.js +2 -0
  66. package/dist/types/enum/index.js.map +1 -1
  67. package/dist/types/enum/organization-billing.enum.d.ts +0 -6
  68. package/dist/types/enum/organization-billing.enum.js +0 -6
  69. package/dist/types/enum/organization-billing.enum.js.map +1 -1
  70. package/dist/types/enum/rehydration-admission.enum.d.ts +4 -0
  71. package/dist/types/enum/rehydration-admission.enum.js +9 -0
  72. package/dist/types/enum/rehydration-admission.enum.js.map +1 -0
  73. package/dist/types/enum/retention-rule.enum.d.ts +13 -0
  74. package/dist/types/enum/retention-rule.enum.js +20 -0
  75. package/dist/types/enum/retention-rule.enum.js.map +1 -0
  76. package/dist/types/enum/storage-over-limit.enum.d.ts +11 -1
  77. package/dist/types/enum/storage-over-limit.enum.js +13 -1
  78. package/dist/types/enum/storage-over-limit.enum.js.map +1 -1
  79. package/dist/types/enum/support-ticket.enum.d.ts +30 -2
  80. package/dist/types/enum/support-ticket.enum.js +41 -1
  81. package/dist/types/enum/support-ticket.enum.js.map +1 -1
  82. package/dist/types/enum/user-notification-content-type.enum.d.ts +7 -2
  83. package/dist/types/enum/user-notification-content-type.enum.js.map +1 -1
  84. package/dist/types/interface/api/index.d.ts +2 -0
  85. package/dist/types/interface/api/index.js +2 -0
  86. package/dist/types/interface/api/index.js.map +1 -1
  87. package/dist/types/interface/api/requests/rehydration-admission.request.d.ts +11 -0
  88. package/dist/types/interface/api/requests/rehydration-admission.request.js +3 -0
  89. package/dist/types/interface/api/requests/rehydration-admission.request.js.map +1 -0
  90. package/dist/types/interface/api/requests/support-ticket-admin.request.d.ts +23 -0
  91. package/dist/types/interface/api/responses/rehydration-admission.response.d.ts +9 -0
  92. package/dist/types/interface/api/responses/rehydration-admission.response.js +3 -0
  93. package/dist/types/interface/api/responses/rehydration-admission.response.js.map +1 -0
  94. package/dist/types/interface/api/responses/support-ticket.response.d.ts +20 -0
  95. package/dist/types/interface/index.d.ts +7 -0
  96. package/dist/types/interface/index.js +7 -0
  97. package/dist/types/interface/index.js.map +1 -1
  98. package/dist/types/interface/models/billing-account-addon.model.d.ts +2 -1
  99. package/dist/types/interface/models/billing-account.model.d.ts +2 -1
  100. package/dist/types/interface/models/index.d.ts +5 -0
  101. package/dist/types/interface/models/index.js +5 -0
  102. package/dist/types/interface/models/index.js.map +1 -1
  103. package/dist/types/interface/models/support-ticket-activity.model.d.ts +1 -1
  104. package/dist/types/interface/models/support-ticket-auto-merge-rule.model.d.ts +7 -0
  105. package/dist/types/interface/models/support-ticket-auto-merge-rule.model.js +3 -0
  106. package/dist/types/interface/models/support-ticket-auto-merge-rule.model.js.map +1 -0
  107. package/dist/types/interface/models/support-ticket-merge-dismissal.model.d.ts +8 -0
  108. package/dist/types/interface/models/support-ticket-merge-dismissal.model.js +3 -0
  109. package/dist/types/interface/models/support-ticket-merge-dismissal.model.js.map +1 -0
  110. package/dist/types/interface/models/support-ticket-merge-event.model.d.ts +15 -0
  111. package/dist/types/interface/models/support-ticket-merge-event.model.js +3 -0
  112. package/dist/types/interface/models/support-ticket-merge-event.model.js.map +1 -0
  113. package/dist/types/interface/models/support-ticket-merge-view.model.d.ts +12 -0
  114. package/dist/types/interface/models/support-ticket-merge-view.model.js +3 -0
  115. package/dist/types/interface/models/support-ticket-merge-view.model.js.map +1 -0
  116. package/dist/types/interface/models/support-ticket-message.model.d.ts +1 -0
  117. package/dist/types/interface/models/support-ticket-player-report.model.d.ts +8 -0
  118. package/dist/types/interface/models/support-ticket-player-report.model.js +3 -0
  119. package/dist/types/interface/models/support-ticket-player-report.model.js.map +1 -0
  120. package/dist/types/interface/models/support-ticket.model.d.ts +5 -0
  121. package/dist/types/interface/retention-rule.interface.d.ts +20 -0
  122. package/dist/types/interface/retention-rule.interface.js +3 -0
  123. package/dist/types/interface/retention-rule.interface.js.map +1 -0
  124. package/dist/types/interface/storage-surplus.interface.d.ts +18 -0
  125. package/dist/types/interface/storage-surplus.interface.js +3 -0
  126. package/dist/types/interface/storage-surplus.interface.js.map +1 -0
  127. package/dist/utils/index.d.ts +1 -0
  128. package/dist/utils/index.js +1 -0
  129. package/dist/utils/index.js.map +1 -1
  130. package/dist/utils/retention-rule.utils.d.ts +7 -0
  131. package/dist/utils/retention-rule.utils.js +50 -0
  132. package/dist/utils/retention-rule.utils.js.map +1 -0
  133. package/dist/utils/tests/retention-rule.utils.spec.d.ts +1 -0
  134. package/dist/utils/tests/retention-rule.utils.spec.js +103 -0
  135. package/dist/utils/tests/retention-rule.utils.spec.js.map +1 -0
  136. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=rehydration-admission.response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rehydration-admission.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/rehydration-admission.response.ts"],"names":[],"mappings":""}
@@ -5,6 +5,9 @@ import { ISupportTicketMessage } from '../../models/support-ticket-message.model
5
5
  import { ISupportTicketAttachment } from '../../models/support-ticket-attachment.model';
6
6
  import { ISupportTicketTag } from '../../models/support-ticket-tag.model';
7
7
  import { ISupportTicketActivity } from '../../models/support-ticket-activity.model';
8
+ import { ISupportTicketMergeEvent } from '../../models/support-ticket-merge-event.model';
9
+ import { ISupportTicketAutoMergeRule } from '../../models/support-ticket-auto-merge-rule.model';
10
+ import { ISupportTicketMergedThread, ISupportTicketRequesterMergeView } from '../../models/support-ticket-merge-view.model';
8
11
  export interface ICreateSupportTicketData {
9
12
  supportTicket: ISupportTicket;
10
13
  }
@@ -14,8 +17,14 @@ export interface IPaginateSupportTicketData extends BasePaginate<ISupportTicket>
14
17
  export type IPaginateSupportTicketResponse = IResponse<IPaginateSupportTicketData>;
15
18
  export interface IGetSupportTicketData {
16
19
  supportTicket: ISupportTicket;
20
+ mergeView: ISupportTicketRequesterMergeView | null;
17
21
  }
18
22
  export type IGetSupportTicketResponse = IResponse<IGetSupportTicketData>;
23
+ export interface IGetSupportTicketAdminData {
24
+ supportTicket: ISupportTicket;
25
+ mergedThreads: ISupportTicketMergedThread[];
26
+ }
27
+ export type IGetSupportTicketAdminResponse = IResponse<IGetSupportTicketAdminData>;
19
28
  export interface IUpdateSupportTicketData {
20
29
  supportTicket: ISupportTicket;
21
30
  }
@@ -66,3 +75,14 @@ export type IAddSupportTicketTagResponse = IResponse<Record<string, never>>;
66
75
  export type IRemoveSupportTicketTagResponse = IResponse<Record<string, never>>;
67
76
  export type IBulkCloseSupportTicketResponse = IResponse<Record<string, never>>;
68
77
  export type IBulkAssignSupportTicketResponse = IResponse<Record<string, never>>;
78
+ export interface ISupportTicketLinkedResponse {
79
+ candidates: ISupportTicket[];
80
+ merged: ISupportTicket[];
81
+ dismissed: ISupportTicket[];
82
+ events: ISupportTicketMergeEvent[];
83
+ requesterCount: number;
84
+ }
85
+ export interface ISupportTicketAutoMergeRulesResponse {
86
+ rules: ISupportTicketAutoMergeRule[];
87
+ knownContextTypes: string[];
88
+ }
@@ -50,6 +50,7 @@ export * from './models/billing-plan-request.model';
50
50
  export * from './models/billing-quota-cap.model';
51
51
  export * from './models/quota-reservation.model';
52
52
  export * from './models/storage-subtotal.model';
53
+ export * from './storage-surplus.interface';
53
54
  export * from './models/billing-trial-grant.model';
54
55
  export * from './models/billing-daily-snapshot.model';
55
56
  export * from './models/webhook-event.model';
@@ -70,6 +71,11 @@ export * from './models/support-ticket-message.model';
70
71
  export * from './models/support-ticket-attachment.model';
71
72
  export * from './models/support-ticket-tag.model';
72
73
  export * from './models/support-ticket-activity.model';
74
+ export * from './models/support-ticket-merge-event.model';
75
+ export * from './models/support-ticket-merge-dismissal.model';
76
+ export * from './models/support-ticket-auto-merge-rule.model';
77
+ export * from './models/support-ticket-merge-view.model';
78
+ export * from './models/support-ticket-player-report.model';
73
79
  export * from './models/invitation.model';
74
80
  export * from './models/user-asset.model';
75
81
  export * from './models/user-cookie-consent.model';
@@ -77,6 +83,7 @@ export * from './models/user-sidebar-pin.model';
77
83
  export * from './models/admin-audit-log.model';
78
84
  export * from './quota-reservation-event';
79
85
  export * from './scheduled-task-call-body';
86
+ export * from './retention-rule.interface';
80
87
  export * from './models/session.model';
81
88
  export * from './models/trusted-device.model';
82
89
  export * from './models/passkey.model';
@@ -66,6 +66,7 @@ __exportStar(require("./models/billing-plan-request.model"), exports);
66
66
  __exportStar(require("./models/billing-quota-cap.model"), exports);
67
67
  __exportStar(require("./models/quota-reservation.model"), exports);
68
68
  __exportStar(require("./models/storage-subtotal.model"), exports);
69
+ __exportStar(require("./storage-surplus.interface"), exports);
69
70
  __exportStar(require("./models/billing-trial-grant.model"), exports);
70
71
  __exportStar(require("./models/billing-daily-snapshot.model"), exports);
71
72
  __exportStar(require("./models/webhook-event.model"), exports);
@@ -86,6 +87,11 @@ __exportStar(require("./models/support-ticket-message.model"), exports);
86
87
  __exportStar(require("./models/support-ticket-attachment.model"), exports);
87
88
  __exportStar(require("./models/support-ticket-tag.model"), exports);
88
89
  __exportStar(require("./models/support-ticket-activity.model"), exports);
90
+ __exportStar(require("./models/support-ticket-merge-event.model"), exports);
91
+ __exportStar(require("./models/support-ticket-merge-dismissal.model"), exports);
92
+ __exportStar(require("./models/support-ticket-auto-merge-rule.model"), exports);
93
+ __exportStar(require("./models/support-ticket-merge-view.model"), exports);
94
+ __exportStar(require("./models/support-ticket-player-report.model"), exports);
89
95
  __exportStar(require("./models/invitation.model"), exports);
90
96
  __exportStar(require("./models/user-asset.model"), exports);
91
97
  __exportStar(require("./models/user-cookie-consent.model"), exports);
@@ -93,6 +99,7 @@ __exportStar(require("./models/user-sidebar-pin.model"), exports);
93
99
  __exportStar(require("./models/admin-audit-log.model"), exports);
94
100
  __exportStar(require("./quota-reservation-event"), exports);
95
101
  __exportStar(require("./scheduled-task-call-body"), exports);
102
+ __exportStar(require("./retention-rule.interface"), exports);
96
103
  __exportStar(require("./models/session.model"), exports);
97
104
  __exportStar(require("./models/trusted-device.model"), exports);
98
105
  __exportStar(require("./models/passkey.model"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interface/index.ts"],"names":[],"mappings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EAA+C;AAC/C,oFAAkE;AAGlE,kEAAgD;AAGhD,mEAAiD;AAGjD,+DAA6C;AAO7C,gEAA8C;AAG9C,gEAA8C;AAC9C,wEAAsD;AACtD,2EAAyD;AACzD,oEAAkD;AAClD,yEAAuD;AACvD,4EAA0D;AAC1D,gFAA8D;AAC9D,gFAA8D;AAC9D,2EAAyD;AACzD,8EAA4D;AAG5D,4DAA0C;AAG1C,4DAA0C;AAG1C,qEAAmD;AAKnD,kEAAgD;AAGhD,iEAA+C;AAC/C,4DAA0C;AAC1C,6DAA2C;AAC3C,6DAA2C;AAG3C,yDAAuC;AACvC,gEAA8C;AAC9C,yDAAuC;AAGvC,gEAA8C;AAC9C,qEAAmD;AACnD,wCAAsB;AAGtB,0DAAwC;AAGxC,+DAA6C;AAG7C,0EAAwD;AACxD,2EAAyD;AAGzD,yDAAuC;AAGvC,4EAA0D;AAC1D,8DAA4C;AAG5C,4DAA0C"}
@@ -1,4 +1,4 @@
1
- import { BillingAddonStatus } from '../../enum';
1
+ import { BillingAddonStatus, StorageOverLimitCause } from '../../enum';
2
2
  import { BillingModuleId } from '../../../constants/module-catalog.constants';
3
3
  import { IBillingAccount } from './billing-account.model';
4
4
  export interface IBillingAccountAddon {
@@ -10,6 +10,7 @@ export interface IBillingAccountAddon {
10
10
  status: BillingAddonStatus;
11
11
  pendingEffectiveAt: Date | null;
12
12
  pendingQuantity: number | null;
13
+ pendingQuantityCause: StorageOverLimitCause | null;
13
14
  updatedAt?: Date;
14
15
  createdAt?: Date;
15
16
  billingAccount?: IBillingAccount;
@@ -1,4 +1,4 @@
1
- import { BillingAccountStatus, BillingAddonStatus, BillingInterval } from '../../enum';
1
+ import { BillingAccountStatus, BillingAddonStatus, BillingInterval, StorageOverLimitCause } from '../../enum';
2
2
  import { BillingModuleId } from '../../../constants/module-catalog.constants';
3
3
  import { IOrganization } from './organization.model';
4
4
  import { IUser } from './user.model';
@@ -34,6 +34,7 @@ export interface IBillingAccount {
34
34
  closedUserId: string | null;
35
35
  planTemplateId: string;
36
36
  pendingPlanTemplateId: string | null;
37
+ pendingPlanCause: StorageOverLimitCause | null;
37
38
  status: BillingAccountStatus;
38
39
  creditBalance: number;
39
40
  eurBalance: number;
@@ -60,6 +60,11 @@ export * from './support-ticket-attachment.model';
60
60
  export * from './file-scan-status.dto';
61
61
  export * from './support-ticket-tag.model';
62
62
  export * from './support-ticket-activity.model';
63
+ export * from './support-ticket-merge-event.model';
64
+ export * from './support-ticket-merge-dismissal.model';
65
+ export * from './support-ticket-auto-merge-rule.model';
66
+ export * from './support-ticket-merge-view.model';
67
+ export * from './support-ticket-player-report.model';
63
68
  export * from './invitation.model';
64
69
  export * from './user-asset.model';
65
70
  export * from './user-cookie-consent.model';
@@ -76,6 +76,11 @@ __exportStar(require("./support-ticket-attachment.model"), exports);
76
76
  __exportStar(require("./file-scan-status.dto"), exports);
77
77
  __exportStar(require("./support-ticket-tag.model"), exports);
78
78
  __exportStar(require("./support-ticket-activity.model"), exports);
79
+ __exportStar(require("./support-ticket-merge-event.model"), exports);
80
+ __exportStar(require("./support-ticket-merge-dismissal.model"), exports);
81
+ __exportStar(require("./support-ticket-auto-merge-rule.model"), exports);
82
+ __exportStar(require("./support-ticket-merge-view.model"), exports);
83
+ __exportStar(require("./support-ticket-player-report.model"), exports);
79
84
  __exportStar(require("./invitation.model"), exports);
80
85
  __exportStar(require("./user-asset.model"), exports);
81
86
  __exportStar(require("./user-cookie-consent.model"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/interface/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+DAA6C;AAC7C,kDAAgC;AAChC,yDAAuC;AACvC,qEAAmD;AACnD,sDAAoC;AACpC,kEAAgD;AAChD,8DAA4C;AAC5C,4DAA0C;AAC1C,4DAA0C;AAC1C,wDAAsC;AACtC,wDAAsC;AACtC,uDAAqC;AACrC,4DAA0C;AAC1C,6DAA2C;AAG3C,oDAAkC;AAClC,+DAA6C;AAG7C,gDAA8B;AAG9B,iDAA+B;AAG/B,uDAAqC;AACrC,mEAAiD;AACjD,8DAA4C;AAG5C,wDAAsC;AACtC,0DAAwC;AACxC,gEAA8C;AAC9C,qEAAmD;AACnD,qEAAmD;AACnD,uDAAqC;AACrC,kDAAgC;AAChC,uDAAqC;AACrC,6DAA2C;AAC3C,sDAAoC;AACpC,6DAA2C;AAC3C,0DAAwC;AACxC,mEAAiD;AACjD,sDAAoC;AACpC,+DAA6C;AAC7C,4DAA0C;AAC1C,4DAA0C;AAC1C,2DAAyC;AACzC,8DAA4C;AAC5C,qEAAmD;AACnD,uDAAqC;AACrC,iEAA+C;AAC/C,wDAAsC;AACtC,uDAAqC;AACrC,8DAA4C;AAC5C,+CAA6B;AAC7B,sDAAoC;AACpC,8DAA4C;AAC5C,0EAAwD;AACxD,0DAAwC;AACxC,6EAA2D;AAG3D,2DAAyC;AAGzC,4DAA0C;AAG1C,wDAAsC;AAGtC,yDAAuC;AACvC,iEAA+C;AAC/C,oEAAkD;AAClD,yDAAuC;AACvC,6DAA2C;AAC3C,kEAAgD;AAGhD,qDAAmC;AAGnC,qDAAmC;AAGnC,8DAA4C;AAK5C,2DAAyC;AAGzC,0DAAwC;AAGxC,kDAAgC;AAChC,kDAAgC;AAChC,yDAAuC;AAGvC,yDAAuC;AACvC,8DAA4C;AAG5C,mDAAiC;AAGjC,wDAAsC;AAGtC,kDAAgC;AAEhC,6DAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/interface/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+DAA6C;AAC7C,kDAAgC;AAChC,yDAAuC;AACvC,qEAAmD;AACnD,sDAAoC;AACpC,kEAAgD;AAChD,8DAA4C;AAC5C,4DAA0C;AAC1C,4DAA0C;AAC1C,wDAAsC;AACtC,wDAAsC;AACtC,uDAAqC;AACrC,4DAA0C;AAC1C,6DAA2C;AAG3C,oDAAkC;AAClC,+DAA6C;AAG7C,gDAA8B;AAG9B,iDAA+B;AAG/B,uDAAqC;AACrC,mEAAiD;AACjD,8DAA4C;AAG5C,wDAAsC;AACtC,0DAAwC;AACxC,gEAA8C;AAC9C,qEAAmD;AACnD,qEAAmD;AACnD,uDAAqC;AACrC,kDAAgC;AAChC,uDAAqC;AACrC,6DAA2C;AAC3C,sDAAoC;AACpC,6DAA2C;AAC3C,0DAAwC;AACxC,mEAAiD;AACjD,sDAAoC;AACpC,+DAA6C;AAC7C,4DAA0C;AAC1C,4DAA0C;AAC1C,2DAAyC;AACzC,8DAA4C;AAC5C,qEAAmD;AACnD,uDAAqC;AACrC,iEAA+C;AAC/C,wDAAsC;AACtC,uDAAqC;AACrC,8DAA4C;AAC5C,+CAA6B;AAC7B,sDAAoC;AACpC,8DAA4C;AAC5C,0EAAwD;AACxD,0DAAwC;AACxC,6EAA2D;AAG3D,2DAAyC;AAGzC,4DAA0C;AAG1C,wDAAsC;AAGtC,yDAAuC;AACvC,iEAA+C;AAC/C,oEAAkD;AAClD,yDAAuC;AACvC,6DAA2C;AAC3C,kEAAgD;AAChD,qEAAmD;AACnD,yEAAuD;AACvD,yEAAuD;AACvD,oEAAkD;AAClD,uEAAqD;AAGrD,qDAAmC;AAGnC,qDAAmC;AAGnC,8DAA4C;AAK5C,2DAAyC;AAGzC,0DAAwC;AAGxC,kDAAgC;AAChC,kDAAgC;AAChC,yDAAuC;AAGvC,yDAAuC;AACvC,8DAA4C;AAG5C,mDAAiC;AAGjC,wDAAsC;AAGtC,kDAAgC;AAEhC,6DAA2C"}
@@ -4,7 +4,7 @@ import { ISupportTicket } from './support-ticket.model';
4
4
  export interface ISupportTicketActivity {
5
5
  id?: string;
6
6
  supportTicketId: string;
7
- userId: string;
7
+ userId: string | null;
8
8
  action: SupportTicketActivityAction;
9
9
  metadata: Record<string, unknown> | null;
10
10
  updatedAt?: Date;
@@ -0,0 +1,7 @@
1
+ export interface ISupportTicketAutoMergeRule {
2
+ contextType: string;
3
+ isEnabled: boolean;
4
+ updatedByUserId: string | null;
5
+ createdAt: Date;
6
+ updatedAt: Date;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=support-ticket-auto-merge-rule.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-ticket-auto-merge-rule.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/support-ticket-auto-merge-rule.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { ISupportTicketMergeEvent } from './support-ticket-merge-event.model';
2
+ export interface ISupportTicketMergeDismissal {
3
+ ticketLowId: string;
4
+ ticketHighId: string;
5
+ eventId: string;
6
+ createdAt: Date;
7
+ event?: ISupportTicketMergeEvent;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=support-ticket-merge-dismissal.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-ticket-merge-dismissal.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/support-ticket-merge-dismissal.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { SupportTicketMergeEventType } from '../../enum';
2
+ import { ISupportTicket } from './support-ticket.model';
3
+ export interface ISupportTicketMergeEvent {
4
+ id: string;
5
+ primaryTicketId: string;
6
+ secondaryTicketId: string;
7
+ type: SupportTicketMergeEventType;
8
+ actorUserId: string | null;
9
+ isAutomatic: boolean;
10
+ reversesEventId: string | null;
11
+ createdAt: Date;
12
+ primaryTicket?: ISupportTicket;
13
+ secondaryTicket?: ISupportTicket;
14
+ reversesEvent?: ISupportTicketMergeEvent | null;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=support-ticket-merge-event.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-ticket-merge-event.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/support-ticket-merge-event.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { SupportTicketStatus } from '../../enum';
2
+ import { ISupportTicket } from './support-ticket.model';
3
+ import { ISupportTicketMessage } from './support-ticket-message.model';
4
+ export interface ISupportTicketMergedThread {
5
+ ticket: ISupportTicket;
6
+ messages: ISupportTicketMessage[];
7
+ }
8
+ export interface ISupportTicketRequesterMergeView {
9
+ primaryStatus: SupportTicketStatus;
10
+ isCurrentlyMerged: boolean;
11
+ teamMessages: ISupportTicketMessage[];
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=support-ticket-merge-view.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-ticket-merge-view.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/support-ticket-merge-view.model.ts"],"names":[],"mappings":""}
@@ -10,6 +10,7 @@ export interface ISupportTicketMessage {
10
10
  userId: string | null;
11
11
  content: string;
12
12
  isAdminNote: boolean;
13
+ isTeamReply: boolean;
13
14
  systemEvent: SupportTicketSystemEvent | null;
14
15
  systemData: SupportTicketSystemData | null;
15
16
  replyToMessageId: string | null;
@@ -0,0 +1,8 @@
1
+ import { PlayerReportLocation, PlayerReportReason } from '../../enum';
2
+ export interface IPlayerReportContextData {
3
+ location: PlayerReportLocation;
4
+ reason: PlayerReportReason;
5
+ messageRefs: string[];
6
+ reportedDisplayName: string;
7
+ targetUserId: string | null;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=support-ticket-player-report.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-ticket-player-report.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/support-ticket-player-report.model.ts"],"names":[],"mappings":""}
@@ -27,6 +27,9 @@ export interface ISupportTicket {
27
27
  closedAt: Date | null;
28
28
  closedReason: string | null;
29
29
  archivedAt: Date | null;
30
+ mergedIntoTicketId: string | null;
31
+ mergedAt: Date | null;
32
+ statusBeforeMerge: SupportTicketStatus | null;
30
33
  updatedAt?: Date;
31
34
  createdAt?: Date;
32
35
  user?: IUser;
@@ -36,4 +39,6 @@ export interface ISupportTicket {
36
39
  supportTicketTags?: ISupportTicketTag[];
37
40
  supportTicketActivities?: ISupportTicketActivity[];
38
41
  supportTicketAttachments?: ISupportTicketAttachment[];
42
+ mergedIntoTicket?: ISupportTicket | null;
43
+ mergedTickets?: ISupportTicket[];
39
44
  }
@@ -0,0 +1,20 @@
1
+ import { RetentionRuleAction, RetentionRuleTrigger } from '../enum/retention-rule.enum';
2
+ export interface IRetentionRule {
3
+ trigger: RetentionRuleTrigger;
4
+ threshold: number;
5
+ action: RetentionRuleAction;
6
+ }
7
+ export interface IRetentionSetting {
8
+ rule: IRetentionRule | null;
9
+ }
10
+ export interface IRetentionItem {
11
+ id: string;
12
+ sizeBytes: number;
13
+ createdAt: Date | string;
14
+ isFavorite: boolean;
15
+ }
16
+ export interface IRetentionSelection {
17
+ action: RetentionRuleAction;
18
+ itemIds: string[];
19
+ bytes: number;
20
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=retention-rule.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention-rule.interface.js","sourceRoot":"","sources":["../../../src/types/interface/retention-rule.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ export interface IStorageSurplusOwner {
2
+ organizationId: string | null;
3
+ userId: string | null;
4
+ }
5
+ export interface IStorageSurplusItem {
6
+ id: string;
7
+ sizeBytes: number;
8
+ createdAt: Date | string;
9
+ isFavorite: boolean;
10
+ label: string;
11
+ }
12
+ export interface IStorageEveServiceNotice {
13
+ label: string;
14
+ archiveCount: number;
15
+ archiveBytes: number;
16
+ deleteCount: number;
17
+ deleteBytes: number;
18
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=storage-surplus.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-surplus.interface.js","sourceRoot":"","sources":["../../../src/types/interface/storage-surplus.interface.ts"],"names":[],"mappings":""}
@@ -31,4 +31,5 @@ export * from './pricing.utils';
31
31
  export * from './plan-capacity.utils';
32
32
  export * from './billing-deep-link.utils';
33
33
  export * from './board-card-due.utils';
34
+ export * from './retention-rule.utils';
34
35
  export * from './time-zone.utils';
@@ -47,5 +47,6 @@ __exportStar(require("./pricing.utils"), exports);
47
47
  __exportStar(require("./plan-capacity.utils"), exports);
48
48
  __exportStar(require("./billing-deep-link.utils"), exports);
49
49
  __exportStar(require("./board-card-due.utils"), exports);
50
+ __exportStar(require("./retention-rule.utils"), exports);
50
51
  __exportStar(require("./time-zone.utils"), exports);
51
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,gDAA8B;AAC9B,0DAAwC;AACxC,+CAA6B;AAC7B,iDAA+B;AAC/B,uDAAqC;AACrC,gDAA8B;AAC9B,gDAA8B;AAC9B,gDAA8B;AAC9B,gDAA8B;AAC9B,+CAA6B;AAC7B,sDAAoC;AACpC,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,sDAAoC;AACpC,kDAAgC;AAChC,0DAAwC;AACxC,wDAAsC;AACtC,wDAAsC;AACtC,wDAAsC;AACtC,6DAA2C;AAC3C,8DAA4C;AAC5C,qDAAmC;AACnC,0DAAwC;AACxC,6DAA2C;AAC3C,uDAAqC;AACrC,0DAAwC;AACxC,iEAA+C;AAI/C,kDAAgC;AAChC,wDAAsC;AACtC,4DAA0C;AAC1C,yDAAuC;AACvC,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,gDAA8B;AAC9B,0DAAwC;AACxC,+CAA6B;AAC7B,iDAA+B;AAC/B,uDAAqC;AACrC,gDAA8B;AAC9B,gDAA8B;AAC9B,gDAA8B;AAC9B,gDAA8B;AAC9B,+CAA6B;AAC7B,sDAAoC;AACpC,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,sDAAoC;AACpC,kDAAgC;AAChC,0DAAwC;AACxC,wDAAsC;AACtC,wDAAsC;AACtC,wDAAsC;AACtC,6DAA2C;AAC3C,8DAA4C;AAC5C,qDAAmC;AACnC,0DAAwC;AACxC,6DAA2C;AAC3C,uDAAqC;AACrC,0DAAwC;AACxC,iEAA+C;AAI/C,kDAAgC;AAChC,wDAAsC;AACtC,4DAA0C;AAC1C,yDAAuC;AACvC,yDAAuC;AACvC,oDAAkC"}
@@ -0,0 +1,7 @@
1
+ import { IRetentionItem, IRetentionRule, IRetentionSelection, IRetentionSetting } from '../types/interface/retention-rule.interface';
2
+ export declare const resolveRetentionRule: (settings: {
3
+ element?: IRetentionSetting;
4
+ global?: IRetentionSetting;
5
+ }) => IRetentionRule | null;
6
+ export declare const isValidRetentionRule: (rule: IRetentionRule) => boolean;
7
+ export declare const selectRetentionItems: (items: IRetentionItem[], rule: IRetentionRule, now: Date) => IRetentionSelection;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectRetentionItems = exports.isValidRetentionRule = exports.resolveRetentionRule = void 0;
4
+ const retention_rule_enum_1 = require("../types/enum/retention-rule.enum");
5
+ const MS_PER_DAY = 24 * 60 * 60 * 1000;
6
+ const resolveRetentionRule = (settings) => {
7
+ if (settings.element !== undefined)
8
+ return settings.element.rule;
9
+ return settings.global?.rule ?? null;
10
+ };
11
+ exports.resolveRetentionRule = resolveRetentionRule;
12
+ const isValidRetentionRule = (rule) => Number.isSafeInteger(rule.threshold) &&
13
+ rule.threshold > 0 &&
14
+ Object.values(retention_rule_enum_1.RetentionRuleTrigger).includes(rule.trigger);
15
+ exports.isValidRetentionRule = isValidRetentionRule;
16
+ const timeOf = (item) => new Date(item.createdAt).getTime();
17
+ const newestFirst = (a, b) => timeOf(b) - timeOf(a) || (a.id < b.id ? 1 : a.id > b.id ? -1 : 0);
18
+ const selectedByTrigger = (sorted, rule, now) => {
19
+ switch (rule.trigger) {
20
+ case retention_rule_enum_1.RetentionRuleTrigger.MAX_AGE_DAYS: {
21
+ const cutoff = now.getTime() - rule.threshold * MS_PER_DAY;
22
+ return sorted.filter((item) => !item.isFavorite && timeOf(item) < cutoff);
23
+ }
24
+ case retention_rule_enum_1.RetentionRuleTrigger.KEEP_LATEST_COUNT:
25
+ return sorted.slice(rule.threshold).filter((item) => !item.isFavorite);
26
+ case retention_rule_enum_1.RetentionRuleTrigger.MAX_TOTAL_BYTES: {
27
+ let total = sorted.reduce((sum, item) => sum + item.sizeBytes, 0);
28
+ const selected = [];
29
+ for (let index = sorted.length - 1; index >= 0 && total > rule.threshold; index -= 1) {
30
+ const item = sorted[index];
31
+ if (item.isFavorite)
32
+ continue;
33
+ selected.push(item);
34
+ total -= item.sizeBytes;
35
+ }
36
+ return selected;
37
+ }
38
+ }
39
+ };
40
+ const selectRetentionItems = (items, rule, now) => {
41
+ const sorted = [...items].sort(newestFirst);
42
+ const selected = selectedByTrigger(sorted, rule, now).sort((a, b) => newestFirst(b, a));
43
+ return {
44
+ action: rule.action,
45
+ itemIds: selected.map((item) => item.id),
46
+ bytes: selected.reduce((sum, item) => sum + item.sizeBytes, 0),
47
+ };
48
+ };
49
+ exports.selectRetentionItems = selectRetentionItems;
50
+ //# sourceMappingURL=retention-rule.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention-rule.utils.js","sourceRoot":"","sources":["../../src/utils/retention-rule.utils.ts"],"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C,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxF,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;KAC/D,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const retention_rule_enum_1 = require("../../types/enum/retention-rule.enum");
4
+ const retention_rule_utils_1 = require("../retention-rule.utils");
5
+ const NOW = new Date('2026-11-25T12:00:00.000Z');
6
+ const daysAgo = (days) => new Date(NOW.getTime() - days * 86_400_000).toISOString();
7
+ const item = (id, ageDays, sizeBytes = 100, isFavorite = false) => ({
8
+ id,
9
+ sizeBytes,
10
+ createdAt: daysAgo(ageDays),
11
+ isFavorite,
12
+ });
13
+ const rule = (trigger, threshold, action = retention_rule_enum_1.RetentionRuleAction.DELETE) => ({ trigger, threshold, action });
14
+ describe('resolveRetentionRule', () => {
15
+ const globalRule = rule(retention_rule_enum_1.RetentionRuleTrigger.MAX_AGE_DAYS, 30);
16
+ const elementRule = rule(retention_rule_enum_1.RetentionRuleTrigger.KEEP_LATEST_COUNT, 5, retention_rule_enum_1.RetentionRuleAction.ARCHIVE);
17
+ it("applies the element's rule over the global one", () => {
18
+ expect((0, retention_rule_utils_1.resolveRetentionRule)({ element: { rule: elementRule }, global: { rule: globalRule } })).toBe(elementRule);
19
+ });
20
+ it('lets an element keep for ever against a global rule', () => {
21
+ expect((0, retention_rule_utils_1.resolveRetentionRule)({ element: { rule: null }, global: { rule: globalRule } })).toBeNull();
22
+ });
23
+ it('inherits the global rule when the element has no setting', () => {
24
+ expect((0, retention_rule_utils_1.resolveRetentionRule)({ global: { rule: globalRule } })).toBe(globalRule);
25
+ });
26
+ it('keeps for ever when nothing is set', () => {
27
+ expect((0, retention_rule_utils_1.resolveRetentionRule)({})).toBeNull();
28
+ });
29
+ });
30
+ describe('isValidRetentionRule', () => {
31
+ it('accepts a positive whole threshold', () => {
32
+ expect((0, retention_rule_utils_1.isValidRetentionRule)(rule(retention_rule_enum_1.RetentionRuleTrigger.MAX_TOTAL_BYTES, 1024))).toBe(true);
33
+ });
34
+ it.each([0, -1, 1.5, Number.NaN])('refuses the threshold %p', (threshold) => {
35
+ expect((0, retention_rule_utils_1.isValidRetentionRule)(rule(retention_rule_enum_1.RetentionRuleTrigger.MAX_AGE_DAYS, threshold))).toBe(false);
36
+ });
37
+ });
38
+ describe('selectRetentionItems', () => {
39
+ describe('MAX_AGE_DAYS', () => {
40
+ it('selects the items older than the threshold, oldest first, never a favorite', () => {
41
+ const items = [item('a', 10), item('b', 40), item('c', 31, 100, true), item('d', 90)];
42
+ const selection = (0, retention_rule_utils_1.selectRetentionItems)(items, rule(retention_rule_enum_1.RetentionRuleTrigger.MAX_AGE_DAYS, 30), NOW);
43
+ expect(selection).toEqual({
44
+ action: retention_rule_enum_1.RetentionRuleAction.DELETE,
45
+ itemIds: ['d', 'b'],
46
+ bytes: 200,
47
+ });
48
+ });
49
+ it('keeps an item exactly at the threshold', () => {
50
+ const selection = (0, retention_rule_utils_1.selectRetentionItems)([item('a', 30)], rule(retention_rule_enum_1.RetentionRuleTrigger.MAX_AGE_DAYS, 30), NOW);
51
+ expect(selection.itemIds).toEqual([]);
52
+ });
53
+ });
54
+ describe('KEEP_LATEST_COUNT', () => {
55
+ it('keeps the most recent items, favorites counted, and selects the rest but favorites', () => {
56
+ const items = [
57
+ item('a', 1),
58
+ item('b', 2, 100, true),
59
+ item('c', 3),
60
+ item('d', 4, 100, true),
61
+ item('e', 5),
62
+ ];
63
+ const selection = (0, retention_rule_utils_1.selectRetentionItems)(items, rule(retention_rule_enum_1.RetentionRuleTrigger.KEEP_LATEST_COUNT, 2, retention_rule_enum_1.RetentionRuleAction.ARCHIVE), NOW);
64
+ expect(selection).toEqual({
65
+ action: retention_rule_enum_1.RetentionRuleAction.ARCHIVE,
66
+ itemIds: ['e', 'c'],
67
+ bytes: 200,
68
+ });
69
+ });
70
+ it('does not depend on the input order when dates are equal', () => {
71
+ const same = [item('x', 1), item('y', 1), item('z', 1)];
72
+ const reversed = [...same].reverse();
73
+ const keepOne = rule(retention_rule_enum_1.RetentionRuleTrigger.KEEP_LATEST_COUNT, 1);
74
+ expect((0, retention_rule_utils_1.selectRetentionItems)(same, keepOne, NOW).itemIds).toEqual((0, retention_rule_utils_1.selectRetentionItems)(reversed, keepOne, NOW).itemIds);
75
+ });
76
+ });
77
+ describe('MAX_TOTAL_BYTES', () => {
78
+ it('removes the oldest until the total fits, skipping favorites', () => {
79
+ const items = [
80
+ item('new', 1, 400),
81
+ item('fav', 50, 300, true),
82
+ item('mid', 20, 200),
83
+ item('old', 60, 100),
84
+ ];
85
+ const selection = (0, retention_rule_utils_1.selectRetentionItems)(items, rule(retention_rule_enum_1.RetentionRuleTrigger.MAX_TOTAL_BYTES, 750), NOW);
86
+ expect(selection).toEqual({
87
+ action: retention_rule_enum_1.RetentionRuleAction.DELETE,
88
+ itemIds: ['old', 'mid'],
89
+ bytes: 300,
90
+ });
91
+ });
92
+ it('selects nothing when the total already fits', () => {
93
+ const selection = (0, retention_rule_utils_1.selectRetentionItems)([item('a', 1, 100), item('b', 2, 100)], rule(retention_rule_enum_1.RetentionRuleTrigger.MAX_TOTAL_BYTES, 200), NOW);
94
+ expect(selection.itemIds).toEqual([]);
95
+ });
96
+ it('stays unmet without touching favorites when they alone exceed the limit', () => {
97
+ const items = [item('fav', 1, 500, true), item('a', 2, 100)];
98
+ const selection = (0, retention_rule_utils_1.selectRetentionItems)(items, rule(retention_rule_enum_1.RetentionRuleTrigger.MAX_TOTAL_BYTES, 300), NOW);
99
+ expect(selection.itemIds).toEqual(['a']);
100
+ });
101
+ });
102
+ });
103
+ //# sourceMappingURL=retention-rule.utils.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention-rule.utils.spec.js","sourceRoot":"","sources":["../../../src/utils/tests/retention-rule.utils.spec.ts"],"names":[],"mappings":";;AAAA,8EAAiG;AAEjG,kEAIiC;AAEjC,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,0BAA0B,CAAC,CAAC;AACjD,MAAM,OAAO,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;AAEpG,MAAM,IAAI,GAAG,CACX,EAAU,EACV,OAAe,EACf,SAAS,GAAG,GAAG,EACf,UAAU,GAAG,KAAK,EACF,EAAE,CAAC,CAAC;IACpB,EAAE;IACF,SAAS;IACT,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC;IAC3B,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,CACX,OAA6B,EAC7B,SAAiB,EACjB,MAAM,GAAG,yCAAmB,CAAC,MAAM,EACnB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;AAEtD,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,MAAM,UAAU,GAAG,IAAI,CAAC,0CAAoB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,0CAAoB,CAAC,iBAAiB,EAAE,C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S,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;YACjF,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YAE7D,MAAM,SAAS,GAAG,IAAA,2CAAoB,EACpC,KAAK,EACL,IAAI,CAAC,0CAAoB,CAAC,eAAe,EAAE,GAAG,CAAC,EAC/C,GAAG,CACJ,CAAC;YAEF,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/main",
3
- "version": "41.1.0",
3
+ "version": "42.1.0",
4
4
  "description": "Core package to interact with Abyss-Project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",