@abyss-project/main 40.5.0 → 41.0.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 (159) hide show
  1. package/dist/api/index.d.ts +1 -3
  2. package/dist/api/index.js +1 -3
  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/billing-metric-label/billing-metric-label.labels.d.ts +0 -12
  8. package/dist/billing-metric-label/billing-metric-label.labels.js +0 -12
  9. package/dist/billing-metric-label/billing-metric-label.labels.js.map +1 -1
  10. package/dist/constants/billing-catalog.constants.js +0 -21
  11. package/dist/constants/billing-catalog.constants.js.map +1 -1
  12. package/dist/constants/catalog-plan-quotas.constants.js +7 -13
  13. package/dist/constants/catalog-plan-quotas.constants.js.map +1 -1
  14. package/dist/constants/enforcement-registry.constants.js +0 -32
  15. package/dist/constants/enforcement-registry.constants.js.map +1 -1
  16. package/dist/constants/index.d.ts +0 -1
  17. package/dist/constants/index.js +0 -1
  18. package/dist/constants/index.js.map +1 -1
  19. package/dist/constants/public-plans.constants.js +0 -189
  20. package/dist/constants/public-plans.constants.js.map +1 -1
  21. package/dist/constants/quota-metric-kind.constants.js +0 -6
  22. package/dist/constants/quota-metric-kind.constants.js.map +1 -1
  23. package/dist/constants/tests/billing-catalog.constants.spec.js +54 -70
  24. package/dist/constants/tests/billing-catalog.constants.spec.js.map +1 -1
  25. package/dist/index.d.ts +7 -22
  26. package/dist/index.js +7 -22
  27. package/dist/index.js.map +1 -1
  28. package/dist/server/api-cors.util.d.ts +0 -8
  29. package/dist/server/api-cors.util.js +1 -83
  30. package/dist/server/api-cors.util.js.map +1 -1
  31. package/dist/server/archive-rows/index.d.ts +3 -0
  32. package/dist/server/archive-rows/index.js +20 -0
  33. package/dist/server/archive-rows/index.js.map +1 -0
  34. package/dist/server/archive-rows/row-archive.descriptor.d.ts +8 -0
  35. package/dist/server/archive-rows/row-archive.descriptor.js +26 -0
  36. package/dist/server/archive-rows/row-archive.descriptor.js.map +1 -0
  37. package/dist/server/archive-rows/row-archive.service.d.ts +7 -0
  38. package/dist/server/archive-rows/row-archive.service.js +250 -0
  39. package/dist/server/archive-rows/row-archive.service.js.map +1 -0
  40. package/dist/server/archive-rows/row-archive.types.d.ts +40 -0
  41. package/dist/{types/interface/api/requests/oauth-grant.request.js → server/archive-rows/row-archive.types.js} +1 -1
  42. package/dist/server/archive-rows/row-archive.types.js.map +1 -0
  43. package/dist/server/archive-rows/tests/row-archive.service.spec.js +338 -0
  44. package/dist/server/archive-rows/tests/row-archive.service.spec.js.map +1 -0
  45. package/dist/server/index.d.ts +1 -2
  46. package/dist/server/index.js +1 -2
  47. package/dist/server/index.js.map +1 -1
  48. package/dist/translate/en.translate.js +2 -2
  49. package/dist/translate/en.translate.js.map +1 -1
  50. package/dist/translate/fr.translate.js +2 -2
  51. package/dist/translate/fr.translate.js.map +1 -1
  52. package/dist/translate/tests/storage-over-limit-notification.spec.js +11 -0
  53. package/dist/translate/tests/storage-over-limit-notification.spec.js.map +1 -1
  54. package/dist/types/enum/abyss-application-event.enum.d.ts +4 -0
  55. package/dist/types/enum/abyss-application-event.enum.js +4 -0
  56. package/dist/types/enum/abyss-application-event.enum.js.map +1 -1
  57. package/dist/types/enum/api-error.enum.d.ts +0 -1
  58. package/dist/types/enum/api-error.enum.js +0 -1
  59. package/dist/types/enum/api-error.enum.js.map +1 -1
  60. package/dist/types/enum/email-type.enum.d.ts +1 -0
  61. package/dist/types/enum/email-type.enum.js +1 -0
  62. package/dist/types/enum/email-type.enum.js.map +1 -1
  63. package/dist/types/enum/index.d.ts +2 -1
  64. package/dist/types/enum/index.js +2 -1
  65. package/dist/types/enum/index.js.map +1 -1
  66. package/dist/types/enum/organization-billing.enum.d.ts +0 -6
  67. package/dist/types/enum/organization-billing.enum.js +0 -6
  68. package/dist/types/enum/organization-billing.enum.js.map +1 -1
  69. package/dist/types/enum/rehydration-admission.enum.d.ts +4 -0
  70. package/dist/types/enum/rehydration-admission.enum.js +9 -0
  71. package/dist/types/enum/rehydration-admission.enum.js.map +1 -0
  72. package/dist/types/enum/retention-rule.enum.d.ts +13 -0
  73. package/dist/types/enum/retention-rule.enum.js +20 -0
  74. package/dist/types/enum/retention-rule.enum.js.map +1 -0
  75. package/dist/types/enum/storage-over-limit.enum.d.ts +11 -1
  76. package/dist/types/enum/storage-over-limit.enum.js +13 -1
  77. package/dist/types/enum/storage-over-limit.enum.js.map +1 -1
  78. package/dist/types/enum/user-notification-content-type.enum.d.ts +7 -2
  79. package/dist/types/enum/user-notification-content-type.enum.js.map +1 -1
  80. package/dist/types/interface/api/index.d.ts +2 -5
  81. package/dist/types/interface/api/index.js +2 -5
  82. package/dist/types/interface/api/index.js.map +1 -1
  83. package/dist/types/interface/api/requests/index.d.ts +0 -2
  84. package/dist/types/interface/api/requests/index.js +0 -2
  85. package/dist/types/interface/api/requests/index.js.map +1 -1
  86. package/dist/types/interface/api/requests/rehydration-admission.request.d.ts +11 -0
  87. package/dist/types/interface/api/{responses/oauth-application.response.js → requests/rehydration-admission.request.js} +1 -1
  88. package/dist/types/interface/api/requests/rehydration-admission.request.js.map +1 -0
  89. package/dist/types/interface/api/responses/index.d.ts +0 -3
  90. package/dist/types/interface/api/responses/index.js +0 -3
  91. package/dist/types/interface/api/responses/index.js.map +1 -1
  92. package/dist/types/interface/api/responses/oauth-authorization-request.response.d.ts +2 -19
  93. package/dist/types/interface/api/responses/rehydration-admission.response.d.ts +9 -0
  94. package/dist/types/interface/api/responses/{oauth-grant.response.js → rehydration-admission.response.js} +1 -1
  95. package/dist/types/interface/api/responses/rehydration-admission.response.js.map +1 -0
  96. package/dist/types/interface/index.d.ts +2 -0
  97. package/dist/types/interface/index.js +2 -0
  98. package/dist/types/interface/index.js.map +1 -1
  99. package/dist/types/interface/mcp/mcp-oauth.d.ts +0 -2
  100. package/dist/types/interface/models/billing-account-addon.model.d.ts +2 -1
  101. package/dist/types/interface/models/billing-account.model.d.ts +2 -1
  102. package/dist/types/interface/retention-rule.interface.d.ts +20 -0
  103. package/dist/types/interface/{api/responses/oauth-userinfo.response.js → retention-rule.interface.js} +1 -1
  104. package/dist/types/interface/retention-rule.interface.js.map +1 -0
  105. package/dist/types/interface/storage-surplus.interface.d.ts +18 -0
  106. package/dist/types/interface/{api/requests/oauth-application.request.js → storage-surplus.interface.js} +1 -1
  107. package/dist/types/interface/storage-surplus.interface.js.map +1 -0
  108. package/dist/utils/index.d.ts +1 -0
  109. package/dist/utils/index.js +1 -0
  110. package/dist/utils/index.js.map +1 -1
  111. package/dist/utils/retention-rule.utils.d.ts +7 -0
  112. package/dist/utils/retention-rule.utils.js +50 -0
  113. package/dist/utils/retention-rule.utils.js.map +1 -0
  114. package/dist/utils/tests/retention-rule.utils.spec.js +103 -0
  115. package/dist/utils/tests/retention-rule.utils.spec.js.map +1 -0
  116. package/package.json +1 -3
  117. package/dist/api/oauth-application.admin.api.d.ts +0 -2
  118. package/dist/api/oauth-application.admin.api.js +0 -9
  119. package/dist/api/oauth-application.admin.api.js.map +0 -1
  120. package/dist/api/oauth-application.api.d.ts +0 -10
  121. package/dist/api/oauth-application.api.js +0 -39
  122. package/dist/api/oauth-application.api.js.map +0 -1
  123. package/dist/api/oauth-grant.api.d.ts +0 -4
  124. package/dist/api/oauth-grant.api.js +0 -15
  125. package/dist/api/oauth-grant.api.js.map +0 -1
  126. package/dist/constants/oauth-app.constants.d.ts +0 -19
  127. package/dist/constants/oauth-app.constants.js +0 -63
  128. package/dist/constants/oauth-app.constants.js.map +0 -1
  129. package/dist/constants/tests/oauth-app.constants.spec.js +0 -88
  130. package/dist/constants/tests/oauth-app.constants.spec.js.map +0 -1
  131. package/dist/server/oauth-access-token.util.d.ts +0 -27
  132. package/dist/server/oauth-access-token.util.js +0 -99
  133. package/dist/server/oauth-access-token.util.js.map +0 -1
  134. package/dist/server/oauth-request-guard.util.d.ts +0 -30
  135. package/dist/server/oauth-request-guard.util.js +0 -36
  136. package/dist/server/oauth-request-guard.util.js.map +0 -1
  137. package/dist/server/tests/api-cors-dynamic.util.spec.js +0 -220
  138. package/dist/server/tests/api-cors-dynamic.util.spec.js.map +0 -1
  139. package/dist/server/tests/oauth-access-token.util.spec.d.ts +0 -1
  140. package/dist/server/tests/oauth-access-token.util.spec.js +0 -142
  141. package/dist/server/tests/oauth-access-token.util.spec.js.map +0 -1
  142. package/dist/server/tests/oauth-request-guard.util.spec.d.ts +0 -1
  143. package/dist/server/tests/oauth-request-guard.util.spec.js +0 -68
  144. package/dist/server/tests/oauth-request-guard.util.spec.js.map +0 -1
  145. package/dist/types/enum/oauth-app.enum.d.ts +0 -58
  146. package/dist/types/enum/oauth-app.enum.js +0 -69
  147. package/dist/types/enum/oauth-app.enum.js.map +0 -1
  148. package/dist/types/interface/api/requests/oauth-application.request.d.ts +0 -34
  149. package/dist/types/interface/api/requests/oauth-application.request.js.map +0 -1
  150. package/dist/types/interface/api/requests/oauth-grant.request.d.ts +0 -3
  151. package/dist/types/interface/api/requests/oauth-grant.request.js.map +0 -1
  152. package/dist/types/interface/api/responses/oauth-application.response.d.ts +0 -49
  153. package/dist/types/interface/api/responses/oauth-application.response.js.map +0 -1
  154. package/dist/types/interface/api/responses/oauth-grant.response.d.ts +0 -20
  155. package/dist/types/interface/api/responses/oauth-grant.response.js.map +0 -1
  156. package/dist/types/interface/api/responses/oauth-userinfo.response.d.ts +0 -7
  157. package/dist/types/interface/api/responses/oauth-userinfo.response.js.map +0 -1
  158. /package/dist/{constants/tests/oauth-app.constants.spec.d.ts → server/archive-rows/tests/row-archive.service.spec.d.ts} +0 -0
  159. /package/dist/{server/tests/api-cors-dynamic.util.spec.d.ts → utils/tests/retention-rule.utils.spec.d.ts} +0 -0
@@ -1,24 +1,7 @@
1
- import type { OAuthAppOwnerKind, OAuthAuthorizationRequestKind, OAuthClientType } from '../../../enum/oauth-app.enum';
2
- import type { IMcpOAuthAuthorizationRequestView, McpOAuthAuthorizationRequestStatus } from '../../mcp/mcp-oauth';
1
+ import type { IMcpOAuthAuthorizationRequestView } from '../../mcp/mcp-oauth';
3
2
  import type { IResponse } from '../type-message/response';
4
- export interface IOAuthAppAuthorizationRequestView {
5
- kind: OAuthAuthorizationRequestKind.APP;
6
- id: string;
7
- status: McpOAuthAuthorizationRequestStatus;
8
- application: {
9
- name: string;
10
- ownerName: string;
11
- ownerKind: OAuthAppOwnerKind;
12
- homepageUrl: string | null;
13
- clientType: OAuthClientType;
14
- };
15
- redirectHost: string;
16
- redirectWarning: boolean;
17
- scopes: string[];
18
- missingScopes: string[];
19
- }
20
3
  export interface IGetOAuthAuthorizationRequestData {
21
- request: IMcpOAuthAuthorizationRequestView | IOAuthAppAuthorizationRequestView;
4
+ request: IMcpOAuthAuthorizationRequestView;
22
5
  }
23
6
  export type IGetOAuthAuthorizationRequestResponse = IResponse<IGetOAuthAuthorizationRequestData>;
24
7
  export interface IDecideMcpOAuthAuthorizationRequestData {
@@ -0,0 +1,9 @@
1
+ import { RehydrationAdmissionRefusal } from '../../../enum/rehydration-admission.enum';
2
+ import { IResponse } from '../type-message/response';
3
+ export interface IAdmitRehydrationAdminData {
4
+ admitted: boolean;
5
+ refusal: RehydrationAdmissionRefusal | null;
6
+ usedGb: number;
7
+ limitGb: number;
8
+ }
9
+ export type IAdmitRehydrationAdminResponse = IResponse<IAdmitRehydrationAdminData>;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=oauth-grant.response.js.map
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":""}
@@ -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';
@@ -77,6 +78,7 @@ export * from './models/user-sidebar-pin.model';
77
78
  export * from './models/admin-audit-log.model';
78
79
  export * from './quota-reservation-event';
79
80
  export * from './scheduled-task-call-body';
81
+ export * from './retention-rule.interface';
80
82
  export * from './models/session.model';
81
83
  export * from './models/trusted-device.model';
82
84
  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);
@@ -93,6 +94,7 @@ __exportStar(require("./models/user-sidebar-pin.model"), exports);
93
94
  __exportStar(require("./models/admin-audit-log.model"), exports);
94
95
  __exportStar(require("./quota-reservation-event"), exports);
95
96
  __exportStar(require("./scheduled-task-call-body"), exports);
97
+ __exportStar(require("./retention-rule.interface"), exports);
96
98
  __exportStar(require("./models/session.model"), exports);
97
99
  __exportStar(require("./models/trusted-device.model"), exports);
98
100
  __exportStar(require("./models/passkey.model"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,sEAAoD;AACpD,4DAA0C;AAC1C,8DAA4C;AAC5C,yDAAuC;AACvC,gEAA8C;AAC9C,4EAA0D;AAC1D,6DAA2C;AAC3C,yEAAuD;AACvD,qEAAmD;AACnD,mEAAiD;AACjD,mEAA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C,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,13 +1,11 @@
1
1
  import type { McpFunctionalScope, McpScopeType } from '../../enum/mcp.enum';
2
2
  import type { McpOAuthClientSource } from '../../enum/mcp-oauth.enum';
3
- import type { OAuthAuthorizationRequestKind } from '../../enum/oauth-app.enum';
4
3
  export type McpOAuthAuthorizationRequestStatus = 'OPEN' | 'EXPIRED' | 'CONSUMED';
5
4
  export interface IMcpOAuthApprovedScope {
6
5
  scopeType: McpScopeType;
7
6
  scopeId: string | null;
8
7
  }
9
8
  export interface IMcpOAuthAuthorizationRequestView {
10
- kind: OAuthAuthorizationRequestKind.MCP;
11
9
  id: string;
12
10
  client: {
13
11
  name: string;
@@ -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;
@@ -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
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=oauth-userinfo.response.js.map
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
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=oauth-application.request.js.map
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"],"names":[],"mappings":";;;AAAA,2EAAyE;AAQzE,MAAM,UAAU,GAAG,EAAE,GAAG,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,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,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,CAAC,EAAE,yCAAmB,CAAC,OAAO,CAAC,CAAC;IAEjG,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACx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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": "40.5.0",
3
+ "version": "41.0.0",
4
4
  "description": "Core package to interact with Abyss-Project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -61,7 +61,6 @@
61
61
  "byte-size": "^8.1.0",
62
62
  "date-fns": "^2.29.3",
63
63
  "dayjs": "^1.10.7",
64
- "jsonwebtoken": "^9.0.0",
65
64
  "lodash": "^4.17.21",
66
65
  "lz-string": "^1.5.0",
67
66
  "reflect-metadata": "^0.1.13",
@@ -73,7 +72,6 @@
73
72
  "@types/express": "^4.17.21",
74
73
  "@types/express-serve-static-core": "^4.17.28",
75
74
  "@types/jest": "^29.5.5",
76
- "@types/jsonwebtoken": "^9.0.1",
77
75
  "@types/lodash": "^4.14.177",
78
76
  "@types/node": "^20.11.0",
79
77
  "@types/uuid": "^9.0.0",
@@ -1,2 +0,0 @@
1
- import type { IListAllowedOriginsOAuthApplicationAdminResponse } from '../types/interface/api/responses/oauth-application.response';
2
- export declare const listAllowedOriginsOAuthApplicationAdmin: () => Promise<IListAllowedOriginsOAuthApplicationAdminResponse>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listAllowedOriginsOAuthApplicationAdmin = void 0;
4
- const __1 = require("..");
5
- const listAllowedOriginsOAuthApplicationAdmin = async () => {
6
- return (await __1.AbyssCore.axios.get('oauth-application/admin/allowed-origins')).data;
7
- };
8
- exports.listAllowedOriginsOAuthApplicationAdmin = listAllowedOriginsOAuthApplicationAdmin;
9
- //# sourceMappingURL=oauth-application.admin.api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"oauth-application.admin.api.js","sourceRoot":"","sources":["../../src/api/oauth-application.admin.api.ts"],"names":[],"mappings":";;;AAAA,0BAA+B;AAIxB,MAAM,uCAAuC,GAClD,KAAK,IAA+D,EAAE;IACpE,OAAO,CACL,MAAM,aAAS,CAAC,KAAK,CAAC,GAAG,CACvB,yCAAyC,CAC1C,CACF,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AAPS,QAAA,uCAAuC,2CAOhD"}
@@ -1,10 +0,0 @@
1
- import type { ICreateOAuthApplicationBody, ICreateOAuthApplicationOrganizationParams, IDeleteOAuthApplicationParams, IGetOAuthApplicationParams, IListOAuthApplicationOrganizationParams, IRegenerateSecretOAuthApplicationParams, IUpdateOAuthApplicationBody, IUpdateOAuthApplicationParams } from '../types/interface/api/requests/oauth-application.request';
2
- import type { ICreateOAuthApplicationOrganizationResponse, ICreateOAuthApplicationUserResponse, IDeleteOAuthApplicationResponse, IGetOAuthApplicationResponse, IListOAuthApplicationOrganizationResponse, IListOAuthApplicationUserResponse, IRegenerateSecretOAuthApplicationResponse, IUpdateOAuthApplicationResponse } from '../types/interface/api/responses/oauth-application.response';
3
- export declare const listOAuthApplicationUser: () => Promise<IListOAuthApplicationUserResponse>;
4
- export declare const createOAuthApplicationUser: (body: ICreateOAuthApplicationBody) => Promise<ICreateOAuthApplicationUserResponse>;
5
- export declare const listOAuthApplicationOrganization: (params: IListOAuthApplicationOrganizationParams) => Promise<IListOAuthApplicationOrganizationResponse>;
6
- export declare const createOAuthApplicationOrganization: (params: ICreateOAuthApplicationOrganizationParams, body: ICreateOAuthApplicationBody) => Promise<ICreateOAuthApplicationOrganizationResponse>;
7
- export declare const getOAuthApplication: (params: IGetOAuthApplicationParams) => Promise<IGetOAuthApplicationResponse>;
8
- export declare const updateOAuthApplication: (params: IUpdateOAuthApplicationParams, body: IUpdateOAuthApplicationBody) => Promise<IUpdateOAuthApplicationResponse>;
9
- export declare const deleteOAuthApplication: (params: IDeleteOAuthApplicationParams) => Promise<IDeleteOAuthApplicationResponse>;
10
- export declare const regenerateSecretOAuthApplication: (params: IRegenerateSecretOAuthApplicationParams) => Promise<IRegenerateSecretOAuthApplicationResponse>;
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.regenerateSecretOAuthApplication = exports.deleteOAuthApplication = exports.updateOAuthApplication = exports.getOAuthApplication = exports.createOAuthApplicationOrganization = exports.listOAuthApplicationOrganization = exports.createOAuthApplicationUser = exports.listOAuthApplicationUser = void 0;
4
- const __1 = require("..");
5
- const base = 'oauth-application';
6
- const listOAuthApplicationUser = async () => {
7
- return (await __1.AbyssCore.axios.get(`${base}/user`)).data;
8
- };
9
- exports.listOAuthApplicationUser = listOAuthApplicationUser;
10
- const createOAuthApplicationUser = async (body) => {
11
- return (await __1.AbyssCore.axios.post(`${base}/user`, body))
12
- .data;
13
- };
14
- exports.createOAuthApplicationUser = createOAuthApplicationUser;
15
- const listOAuthApplicationOrganization = async (params) => {
16
- return (await __1.AbyssCore.axios.get(`${base}/organization/${params.organizationId}`)).data;
17
- };
18
- exports.listOAuthApplicationOrganization = listOAuthApplicationOrganization;
19
- const createOAuthApplicationOrganization = async (params, body) => {
20
- return (await __1.AbyssCore.axios.post(`${base}/organization/${params.organizationId}`, body)).data;
21
- };
22
- exports.createOAuthApplicationOrganization = createOAuthApplicationOrganization;
23
- const getOAuthApplication = async (params) => {
24
- return (await __1.AbyssCore.axios.get(`${base}/${params.applicationId}`)).data;
25
- };
26
- exports.getOAuthApplication = getOAuthApplication;
27
- const updateOAuthApplication = async (params, body) => {
28
- return (await __1.AbyssCore.axios.patch(`${base}/${params.applicationId}`, body)).data;
29
- };
30
- exports.updateOAuthApplication = updateOAuthApplication;
31
- const deleteOAuthApplication = async (params) => {
32
- return (await __1.AbyssCore.axios.delete(`${base}/${params.applicationId}`)).data;
33
- };
34
- exports.deleteOAuthApplication = deleteOAuthApplication;
35
- const regenerateSecretOAuthApplication = async (params) => {
36
- return (await __1.AbyssCore.axios.post(`${base}/${params.applicationId}/secret`)).data;
37
- };
38
- exports.regenerateSecretOAuthApplication = regenerateSecretOAuthApplication;
39
- //# sourceMappingURL=oauth-application.api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"oauth-application.api.js","sourceRoot":"","sources":["../../src/api/oauth-application.api.ts"],"names":[],"mappings":";;;AAAA,0BAA+B;AAsB/B,MAAM,IAAI,GAAG,mBAAmB,CAAC;AAE1B,MAAM,wBAAwB,GAAG,KAAK,IAAgD,EAAE;IAC7F,OAAO,CAAC,MAAM,aAAS,CAAC,KAAK,CAAC,GAAG,CAAoC,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7F,CAAC,CAAC;AAFW,QAAA,wBAAwB,4BAEnC;AAEK,MAAM,0BAA0B,GAAG,KAAK,EAC7C,IAAiC,EACa,EAAE;IAChD,OAAO,CAAC,MAAM,aAAS,CAAC,KAAK,CAAC,IAAI,CAAsC,GAAG,IAAI,OAAO,EAAE,IAAI,CAAC,CAAC;SAC3F,IAAI,CAAC;AACV,CAAC,CAAC;AALW,QAAA,0BAA0B,8BAKrC;AAEK,MAAM,gCAAgC,GAAG,KAAK,EACnD,MAA+C,EACK,EAAE;IACtD,OAAO,CACL,MAAM,aAAS,CAAC,KAAK,CAAC,GAAG,CACvB,GAAG,IAAI,iBAAiB,MAAM,CAAC,cAAc,EAAE,CAChD,CACF,CAAC,IAAI,CAAC;AACT,CAAC,C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AA,gCAAgC,oCAQ3C"}
@@ -1,4 +0,0 @@
1
- import type { IRevokeOAuthGrantParams } from '../types/interface/api/requests/oauth-grant.request';
2
- import type { IListOAuthGrantUserResponse, IRevokeOAuthGrantResponse } from '../types/interface/api/responses/oauth-grant.response';
3
- export declare const listOAuthGrantUser: () => Promise<IListOAuthGrantUserResponse>;
4
- export declare const revokeOAuthGrant: (params: IRevokeOAuthGrantParams) => Promise<IRevokeOAuthGrantResponse>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.revokeOAuthGrant = exports.listOAuthGrantUser = void 0;
4
- const __1 = require("..");
5
- const base = 'oauth-grant';
6
- const listOAuthGrantUser = async () => {
7
- return (await __1.AbyssCore.axios.get(`${base}/user/me`)).data;
8
- };
9
- exports.listOAuthGrantUser = listOAuthGrantUser;
10
- const revokeOAuthGrant = async (params) => {
11
- return (await __1.AbyssCore.axios.delete(`${base}/${params.grantId}`))
12
- .data;
13
- };
14
- exports.revokeOAuthGrant = revokeOAuthGrant;
15
- //# sourceMappingURL=oauth-grant.api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"oauth-grant.api.js","sourceRoot":"","sources":["../../src/api/oauth-grant.api.ts"],"names":[],"mappings":";;;AAAA,0BAA+B;AAO/B,MAAM,IAAI,GAAG,aAAa,CAAC;AAEpB,MAAM,kBAAkB,GAAG,KAAK,IAA0C,EAAE;IACjF,OAAO,CAAC,MAAM,aAAS,CAAC,KAAK,CAAC,GAAG,CAA8B,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1F,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,MAAM,gBAAgB,GAAG,KAAK,EACnC,MAA+B,EACK,EAAE;IACtC,OAAO,CAAC,MAAM,aAAS,CAAC,KAAK,CAAC,MAAM,CAA4B,GAAG,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;SAC1F,IAAI,CAAC;AACV,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B"}
@@ -1,19 +0,0 @@
1
- import { OAuthAppAccess, OAuthAppProduct, OAuthAudience } from '../types/enum/oauth-app.enum';
2
- export declare const OAUTH_APP_CLIENT_ID_PREFIX = "abys_app_";
3
- export declare const OAUTH_APP_CLIENT_SECRET_PREFIX = "abys_apsec_";
4
- export declare const OAUTH_APP_REFRESH_TOKEN_PREFIX = "abys_aprt_";
5
- export declare const OAUTH_APP_ACCESS_TOKEN_TYPE = "at+jwt";
6
- export declare const OAUTH_APP_ACCESS_TOKEN_TTL_SECONDS = 900;
7
- export declare const OAUTH_APP_REFRESH_TOKEN_TTL_SECONDS: number;
8
- export declare const OAUTH_APP_CODE_TTL_SECONDS = 60;
9
- export declare const OAUTH_APP_REQUEST_TTL_SECONDS = 600;
10
- export declare const OAUTH_APP_MAX_PER_OWNER = 25;
11
- export declare const OAUTH_APP_MAX_REDIRECT_URIS = 10;
12
- export declare const OAUTH_APP_MAX_ORIGINS = 10;
13
- export declare const OAUTH_APP_NAME_MAX_LENGTH = 100;
14
- export declare const OAUTH_APP_DESCRIPTION_MAX_LENGTH = 500;
15
- export declare const OAUTH_APP_PRODUCT_AUDIENCE: Record<OAuthAppProduct, OAuthAudience>;
16
- export declare const oauthAppScopeOf: (product: OAuthAppProduct, access: OAuthAppAccess) => `${OAuthAppProduct}:${OAuthAppAccess}`;
17
- export declare const OAUTH_APP_IDENTITY_SCOPES: readonly ["profile", "email"];
18
- export declare const OAUTH_APP_SCOPES_SUPPORTED: ReadonlyArray<string>;
19
- export declare const audiencesOfScopes: (scopes: readonly string[]) => OAuthAudience[];
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.audiencesOfScopes = exports.OAUTH_APP_SCOPES_SUPPORTED = exports.OAUTH_APP_IDENTITY_SCOPES = exports.oauthAppScopeOf = exports.OAUTH_APP_PRODUCT_AUDIENCE = exports.OAUTH_APP_DESCRIPTION_MAX_LENGTH = exports.OAUTH_APP_NAME_MAX_LENGTH = exports.OAUTH_APP_MAX_ORIGINS = exports.OAUTH_APP_MAX_REDIRECT_URIS = exports.OAUTH_APP_MAX_PER_OWNER = exports.OAUTH_APP_REQUEST_TTL_SECONDS = exports.OAUTH_APP_CODE_TTL_SECONDS = exports.OAUTH_APP_REFRESH_TOKEN_TTL_SECONDS = exports.OAUTH_APP_ACCESS_TOKEN_TTL_SECONDS = exports.OAUTH_APP_ACCESS_TOKEN_TYPE = exports.OAUTH_APP_REFRESH_TOKEN_PREFIX = exports.OAUTH_APP_CLIENT_SECRET_PREFIX = exports.OAUTH_APP_CLIENT_ID_PREFIX = void 0;
4
- const oauth_app_enum_1 = require("../types/enum/oauth-app.enum");
5
- exports.OAUTH_APP_CLIENT_ID_PREFIX = 'abys_app_';
6
- exports.OAUTH_APP_CLIENT_SECRET_PREFIX = 'abys_apsec_';
7
- exports.OAUTH_APP_REFRESH_TOKEN_PREFIX = 'abys_aprt_';
8
- exports.OAUTH_APP_ACCESS_TOKEN_TYPE = 'at+jwt';
9
- exports.OAUTH_APP_ACCESS_TOKEN_TTL_SECONDS = 900;
10
- exports.OAUTH_APP_REFRESH_TOKEN_TTL_SECONDS = 30 * 24 * 3600;
11
- exports.OAUTH_APP_CODE_TTL_SECONDS = 60;
12
- exports.OAUTH_APP_REQUEST_TTL_SECONDS = 600;
13
- exports.OAUTH_APP_MAX_PER_OWNER = 25;
14
- exports.OAUTH_APP_MAX_REDIRECT_URIS = 10;
15
- exports.OAUTH_APP_MAX_ORIGINS = 10;
16
- exports.OAUTH_APP_NAME_MAX_LENGTH = 100;
17
- exports.OAUTH_APP_DESCRIPTION_MAX_LENGTH = 500;
18
- exports.OAUTH_APP_PRODUCT_AUDIENCE = {
19
- [oauth_app_enum_1.OAuthAppProduct.WORKSPACE]: oauth_app_enum_1.OAuthAudience.ABYSS_WORKSPACE,
20
- [oauth_app_enum_1.OAuthAppProduct.BEAM]: oauth_app_enum_1.OAuthAudience.ABYSS_BEAM,
21
- [oauth_app_enum_1.OAuthAppProduct.EXTRACT]: oauth_app_enum_1.OAuthAudience.ABYSS_EXTRACT,
22
- [oauth_app_enum_1.OAuthAppProduct.PROBE]: oauth_app_enum_1.OAuthAudience.ABYSS_PROBE,
23
- [oauth_app_enum_1.OAuthAppProduct.CLOUD]: oauth_app_enum_1.OAuthAudience.ABYSS_CLOUD,
24
- [oauth_app_enum_1.OAuthAppProduct.CRYPT]: oauth_app_enum_1.OAuthAudience.ABYSS_CRYPT,
25
- [oauth_app_enum_1.OAuthAppProduct.FORM]: oauth_app_enum_1.OAuthAudience.ABYSS_FORM,
26
- [oauth_app_enum_1.OAuthAppProduct.MEMORIES]: oauth_app_enum_1.OAuthAudience.ABYSS_MEMORIES,
27
- [oauth_app_enum_1.OAuthAppProduct.SPOTLIGHT]: oauth_app_enum_1.OAuthAudience.ABYSS_SPOTLIGHT,
28
- [oauth_app_enum_1.OAuthAppProduct.BANKING]: oauth_app_enum_1.OAuthAudience.ABYSS_BANKING,
29
- [oauth_app_enum_1.OAuthAppProduct.TRAINING]: oauth_app_enum_1.OAuthAudience.ABYSS_TRAINING,
30
- [oauth_app_enum_1.OAuthAppProduct.STORAGE]: oauth_app_enum_1.OAuthAudience.ABYSS_STORAGE,
31
- [oauth_app_enum_1.OAuthAppProduct.MONITOR]: oauth_app_enum_1.OAuthAudience.ABYSS_MONITOR,
32
- [oauth_app_enum_1.OAuthAppProduct.CONSOLE]: oauth_app_enum_1.OAuthAudience.ABYSS_CONSOLE,
33
- [oauth_app_enum_1.OAuthAppProduct.REFLEX]: oauth_app_enum_1.OAuthAudience.ABYSS_REFLEX,
34
- };
35
- const oauthAppScopeOf = (product, access) => `${product}:${access}`;
36
- exports.oauthAppScopeOf = oauthAppScopeOf;
37
- exports.OAUTH_APP_IDENTITY_SCOPES = ['profile', 'email'];
38
- const OAUTH_APP_OFFLINE_ACCESS_SCOPE = 'offline_access';
39
- exports.OAUTH_APP_SCOPES_SUPPORTED = [
40
- ...Object.values(oauth_app_enum_1.OAuthAppProduct).flatMap((product) => Object.values(oauth_app_enum_1.OAuthAppAccess).map((access) => (0, exports.oauthAppScopeOf)(product, access))),
41
- ...exports.OAUTH_APP_IDENTITY_SCOPES,
42
- OAUTH_APP_OFFLINE_ACCESS_SCOPE,
43
- ];
44
- const PRODUCT_BY_VALUE = new Map(Object.values(oauth_app_enum_1.OAuthAppProduct).map((product) => [product, product]));
45
- const ACCESS_VALUES = new Set(Object.values(oauth_app_enum_1.OAuthAppAccess));
46
- const IDENTITY_SCOPES = new Set(exports.OAUTH_APP_IDENTITY_SCOPES);
47
- const audiencesOfScopes = (scopes) => {
48
- const audiences = new Set();
49
- for (const scope of scopes) {
50
- if (IDENTITY_SCOPES.has(scope)) {
51
- audiences.add(oauth_app_enum_1.OAuthAudience.ABYSS_MAIN);
52
- continue;
53
- }
54
- const [productPart, accessPart, ...rest] = scope.split(':');
55
- const product = PRODUCT_BY_VALUE.get(productPart);
56
- if (product !== undefined && rest.length === 0 && ACCESS_VALUES.has(accessPart ?? '')) {
57
- audiences.add(exports.OAUTH_APP_PRODUCT_AUDIENCE[product]);
58
- }
59
- }
60
- return [...audiences];
61
- };
62
- exports.audiencesOfScopes = audiencesOfScopes;
63
- //# sourceMappingURL=oauth-app.constants.js.map