@abyss-project/main 1.0.104 → 1.0.106

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 (27) hide show
  1. package/dist/api/user-notification.api.d.ts +2 -1
  2. package/dist/api/user-notification.api.js +5 -1
  3. package/dist/types/enum/abyss-application-event.enum.d.ts +7 -0
  4. package/dist/types/enum/abyss-application-event.enum.js +7 -0
  5. package/dist/types/enum/invoice-status.enum.d.ts +7 -0
  6. package/dist/types/enum/invoice-status.enum.js +11 -0
  7. package/dist/types/enum/organization-permission.enum.d.ts +17 -0
  8. package/dist/types/enum/organization-permission.enum.js +21 -0
  9. package/dist/types/enum/organization-role.enum.d.ts +6 -0
  10. package/dist/types/enum/organization-role.enum.js +10 -0
  11. package/dist/types/enum/organization-subscription-status.enum.d.ts +7 -0
  12. package/dist/types/enum/organization-subscription-status.enum.js +11 -0
  13. package/dist/types/enum/plan-billing-period.enum.d.ts +4 -0
  14. package/dist/types/enum/plan-billing-period.enum.js +8 -0
  15. package/dist/types/enum/plan-status.enum.d.ts +4 -0
  16. package/dist/types/enum/plan-status.enum.js +8 -0
  17. package/dist/types/enum/usage-record-type.enum.d.ts +8 -0
  18. package/dist/types/enum/usage-record-type.enum.js +12 -0
  19. package/dist/types/interface/api/requests/user-notification.request.d.ts +3 -0
  20. package/dist/types/interface/api/responses/user-notification.response.d.ts +4 -0
  21. package/dist/types/interface/models/organization-member.model.d.ts +16 -0
  22. package/dist/types/interface/models/organization-member.model.js +2 -0
  23. package/dist/types/interface/models/organization.model.d.ts +22 -0
  24. package/dist/types/interface/models/organization.model.js +2 -0
  25. package/dist/utils/organization-permission.utils.d.ts +3 -0
  26. package/dist/utils/organization-permission.utils.js +36 -0
  27. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
- import { IPaginateUserNotificationQuery, IPaginateUserNotificationResponse, IOpenUserNotificationParams, IOpenUserNotificationResponse, IGetUserNotificationParams, IGetUserNotificationResponse } from '../types';
1
+ import { IPaginateUserNotificationQuery, IPaginateUserNotificationResponse, IOpenUserNotificationParams, IOpenUserNotificationResponse, IOpenUserNotificationsByTicketBody, IOpenUserNotificationsByTicketResponse, IGetUserNotificationParams, IGetUserNotificationResponse } from '../types';
2
2
  export declare const paginateUserNotification: (query: IPaginateUserNotificationQuery) => Promise<IPaginateUserNotificationResponse>;
3
3
  export declare const getUserNotification: (params: IGetUserNotificationParams) => Promise<IGetUserNotificationResponse>;
4
4
  export declare const openUserNotification: (params: IOpenUserNotificationParams) => Promise<IOpenUserNotificationResponse>;
5
+ export declare const openUserNotificationsByTicket: (body: IOpenUserNotificationsByTicketBody) => Promise<IOpenUserNotificationsByTicketResponse>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.openUserNotification = exports.getUserNotification = exports.paginateUserNotification = void 0;
3
+ exports.openUserNotificationsByTicket = exports.openUserNotification = exports.getUserNotification = exports.paginateUserNotification = void 0;
4
4
  const __1 = require("..");
5
5
  const paginateUserNotification = async (query) => {
6
6
  return (await __1.AbyssCore.axios.get(`user-notifications/paginate`, {
@@ -16,3 +16,7 @@ const openUserNotification = async (params) => {
16
16
  return (await __1.AbyssCore.axios.put(`user-notifications/${params.userNotificationId}/open`)).data;
17
17
  };
18
18
  exports.openUserNotification = openUserNotification;
19
+ const openUserNotificationsByTicket = async (body) => {
20
+ return (await __1.AbyssCore.axios.put(`user-notifications/open-by-ticket`, body)).data;
21
+ };
22
+ exports.openUserNotificationsByTicket = openUserNotificationsByTicket;
@@ -273,6 +273,13 @@ export declare enum AbyssApplicationEvent {
273
273
  ABYSS_CONSOLE_WORKFLOW_TRIGGER_SHORT_LINK_DELETE = "abyss-console.workflow.trigger.short-link.delete",
274
274
  ABYSS_CONSOLE_WORKFLOW_TRIGGER_SHORT_LINK_RENEW = "abyss-console.workflow.trigger.short-link.renew",
275
275
  ABYSS_CONSOLE_WORKFLOW_TRIGGER_SHORT_LINK_CLICK = "abyss-console.workflow.trigger.short-link.click",
276
+ ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_CREATE = "abyss-console.workflow.trigger.internal-ticket.create",
277
+ ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_DELETE = "abyss-console.workflow.trigger.internal-ticket.delete",
278
+ ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_STATUS_CHANGE = "abyss-console.workflow.trigger.internal-ticket.status-change",
279
+ ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_MESSAGE = "abyss-console.workflow.trigger.internal-ticket.message",
280
+ ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_ASSIGN = "abyss-console.workflow.trigger.internal-ticket.assign",
281
+ ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_UNASSIGN = "abyss-console.workflow.trigger.internal-ticket.unassign",
282
+ ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_ACTIVITY = "abyss-console.workflow.trigger.internal-ticket.activity",
276
283
  ABYSS_CONSOLE_WORKFLOW_STEP_CREATE = "abyss-console.workflow.step.create",
277
284
  ABYSS_CONSOLE_WORKFLOW_STEP_UPDATE = "abyss-console.workflow.step.update",
278
285
  ABYSS_CONSOLE_WORKFLOW_STEP_DELETE = "abyss-console.workflow.step.delete",
@@ -277,6 +277,13 @@ var AbyssApplicationEvent;
277
277
  AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_SHORT_LINK_DELETE"] = "abyss-console.workflow.trigger.short-link.delete";
278
278
  AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_SHORT_LINK_RENEW"] = "abyss-console.workflow.trigger.short-link.renew";
279
279
  AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_SHORT_LINK_CLICK"] = "abyss-console.workflow.trigger.short-link.click";
280
+ AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_CREATE"] = "abyss-console.workflow.trigger.internal-ticket.create";
281
+ AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_DELETE"] = "abyss-console.workflow.trigger.internal-ticket.delete";
282
+ AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_STATUS_CHANGE"] = "abyss-console.workflow.trigger.internal-ticket.status-change";
283
+ AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_MESSAGE"] = "abyss-console.workflow.trigger.internal-ticket.message";
284
+ AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_ASSIGN"] = "abyss-console.workflow.trigger.internal-ticket.assign";
285
+ AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_UNASSIGN"] = "abyss-console.workflow.trigger.internal-ticket.unassign";
286
+ AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_TRIGGER_INTERNAL_TICKET_ACTIVITY"] = "abyss-console.workflow.trigger.internal-ticket.activity";
280
287
  AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_STEP_CREATE"] = "abyss-console.workflow.step.create";
281
288
  AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_STEP_UPDATE"] = "abyss-console.workflow.step.update";
282
289
  AbyssApplicationEvent["ABYSS_CONSOLE_WORKFLOW_STEP_DELETE"] = "abyss-console.workflow.step.delete";
@@ -0,0 +1,7 @@
1
+ export declare enum InvoiceStatus {
2
+ DRAFT = "DRAFT",
3
+ PENDING = "PENDING",
4
+ PAID = "PAID",
5
+ FAILED = "FAILED",
6
+ VOID = "VOID"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceStatus = void 0;
4
+ var InvoiceStatus;
5
+ (function (InvoiceStatus) {
6
+ InvoiceStatus["DRAFT"] = "DRAFT";
7
+ InvoiceStatus["PENDING"] = "PENDING";
8
+ InvoiceStatus["PAID"] = "PAID";
9
+ InvoiceStatus["FAILED"] = "FAILED";
10
+ InvoiceStatus["VOID"] = "VOID";
11
+ })(InvoiceStatus || (exports.InvoiceStatus = InvoiceStatus = {}));
@@ -0,0 +1,17 @@
1
+ export declare enum OrganizationPermission {
2
+ ORG_UPDATE = "ORG_UPDATE",
3
+ ORG_DELETE = "ORG_DELETE",
4
+ ORG_BILLING_READ = "ORG_BILLING_READ",
5
+ ORG_BILLING_MANAGE = "ORG_BILLING_MANAGE",
6
+ MEMBER_INVITE = "MEMBER_INVITE",
7
+ MEMBER_REMOVE = "MEMBER_REMOVE",
8
+ MEMBER_UPDATE_ROLE = "MEMBER_UPDATE_ROLE",
9
+ TEAM_CREATE = "TEAM_CREATE",
10
+ TEAM_UPDATE = "TEAM_UPDATE",
11
+ TEAM_DELETE = "TEAM_DELETE",
12
+ PROJECT_CREATE = "PROJECT_CREATE",
13
+ PROJECT_DELETE = "PROJECT_DELETE",
14
+ TICKET_READ = "TICKET_READ",
15
+ TICKET_CREATE = "TICKET_CREATE",
16
+ TICKET_MANAGE = "TICKET_MANAGE"
17
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganizationPermission = void 0;
4
+ var OrganizationPermission;
5
+ (function (OrganizationPermission) {
6
+ OrganizationPermission["ORG_UPDATE"] = "ORG_UPDATE";
7
+ OrganizationPermission["ORG_DELETE"] = "ORG_DELETE";
8
+ OrganizationPermission["ORG_BILLING_READ"] = "ORG_BILLING_READ";
9
+ OrganizationPermission["ORG_BILLING_MANAGE"] = "ORG_BILLING_MANAGE";
10
+ OrganizationPermission["MEMBER_INVITE"] = "MEMBER_INVITE";
11
+ OrganizationPermission["MEMBER_REMOVE"] = "MEMBER_REMOVE";
12
+ OrganizationPermission["MEMBER_UPDATE_ROLE"] = "MEMBER_UPDATE_ROLE";
13
+ OrganizationPermission["TEAM_CREATE"] = "TEAM_CREATE";
14
+ OrganizationPermission["TEAM_UPDATE"] = "TEAM_UPDATE";
15
+ OrganizationPermission["TEAM_DELETE"] = "TEAM_DELETE";
16
+ OrganizationPermission["PROJECT_CREATE"] = "PROJECT_CREATE";
17
+ OrganizationPermission["PROJECT_DELETE"] = "PROJECT_DELETE";
18
+ OrganizationPermission["TICKET_READ"] = "TICKET_READ";
19
+ OrganizationPermission["TICKET_CREATE"] = "TICKET_CREATE";
20
+ OrganizationPermission["TICKET_MANAGE"] = "TICKET_MANAGE";
21
+ })(OrganizationPermission || (exports.OrganizationPermission = OrganizationPermission = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum OrganizationRole {
2
+ OWNER = "OWNER",
3
+ ADMIN = "ADMIN",
4
+ MEMBER = "MEMBER",
5
+ VIEWER = "VIEWER"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganizationRole = void 0;
4
+ var OrganizationRole;
5
+ (function (OrganizationRole) {
6
+ OrganizationRole["OWNER"] = "OWNER";
7
+ OrganizationRole["ADMIN"] = "ADMIN";
8
+ OrganizationRole["MEMBER"] = "MEMBER";
9
+ OrganizationRole["VIEWER"] = "VIEWER";
10
+ })(OrganizationRole || (exports.OrganizationRole = OrganizationRole = {}));
@@ -0,0 +1,7 @@
1
+ export declare enum OrganizationSubscriptionStatus {
2
+ ACTIVE = "ACTIVE",
3
+ TRIALING = "TRIALING",
4
+ PAST_DUE = "PAST_DUE",
5
+ CANCELED = "CANCELED",
6
+ DOWNGRADED = "DOWNGRADED"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganizationSubscriptionStatus = void 0;
4
+ var OrganizationSubscriptionStatus;
5
+ (function (OrganizationSubscriptionStatus) {
6
+ OrganizationSubscriptionStatus["ACTIVE"] = "ACTIVE";
7
+ OrganizationSubscriptionStatus["TRIALING"] = "TRIALING";
8
+ OrganizationSubscriptionStatus["PAST_DUE"] = "PAST_DUE";
9
+ OrganizationSubscriptionStatus["CANCELED"] = "CANCELED";
10
+ OrganizationSubscriptionStatus["DOWNGRADED"] = "DOWNGRADED";
11
+ })(OrganizationSubscriptionStatus || (exports.OrganizationSubscriptionStatus = OrganizationSubscriptionStatus = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum PlanBillingPeriod {
2
+ MONTHLY = "MONTHLY",
3
+ YEARLY = "YEARLY"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlanBillingPeriod = void 0;
4
+ var PlanBillingPeriod;
5
+ (function (PlanBillingPeriod) {
6
+ PlanBillingPeriod["MONTHLY"] = "MONTHLY";
7
+ PlanBillingPeriod["YEARLY"] = "YEARLY";
8
+ })(PlanBillingPeriod || (exports.PlanBillingPeriod = PlanBillingPeriod = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum PlanStatus {
2
+ ACTIVE = "ACTIVE",
3
+ ARCHIVED = "ARCHIVED"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlanStatus = void 0;
4
+ var PlanStatus;
5
+ (function (PlanStatus) {
6
+ PlanStatus["ACTIVE"] = "ACTIVE";
7
+ PlanStatus["ARCHIVED"] = "ARCHIVED";
8
+ })(PlanStatus || (exports.PlanStatus = PlanStatus = {}));
@@ -0,0 +1,8 @@
1
+ export declare enum UsageRecordType {
2
+ STORAGE_FILE_COUNT = "STORAGE_FILE_COUNT",
3
+ STORAGE_SIZE_BYTES = "STORAGE_SIZE_BYTES",
4
+ MONITOR_LOG_COUNT = "MONITOR_LOG_COUNT",
5
+ MONITOR_EVENT_COUNT = "MONITOR_EVENT_COUNT",
6
+ WORKFLOW_EXECUTION_COUNT = "WORKFLOW_EXECUTION_COUNT",
7
+ INTERNAL_TICKET_COUNT = "INTERNAL_TICKET_COUNT"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UsageRecordType = void 0;
4
+ var UsageRecordType;
5
+ (function (UsageRecordType) {
6
+ UsageRecordType["STORAGE_FILE_COUNT"] = "STORAGE_FILE_COUNT";
7
+ UsageRecordType["STORAGE_SIZE_BYTES"] = "STORAGE_SIZE_BYTES";
8
+ UsageRecordType["MONITOR_LOG_COUNT"] = "MONITOR_LOG_COUNT";
9
+ UsageRecordType["MONITOR_EVENT_COUNT"] = "MONITOR_EVENT_COUNT";
10
+ UsageRecordType["WORKFLOW_EXECUTION_COUNT"] = "WORKFLOW_EXECUTION_COUNT";
11
+ UsageRecordType["INTERNAL_TICKET_COUNT"] = "INTERNAL_TICKET_COUNT";
12
+ })(UsageRecordType || (exports.UsageRecordType = UsageRecordType = {}));
@@ -11,3 +11,6 @@ export type IPaginateUserNotificationQuery = {
11
11
  export interface IOpenUserNotificationParams {
12
12
  userNotificationId: string;
13
13
  }
14
+ export interface IOpenUserNotificationsByTicketBody {
15
+ ticketId: string;
16
+ }
@@ -11,3 +11,7 @@ export interface IOpenUserNotificationData {
11
11
  }
12
12
  export type IOpenUserNotificationResponse = IResponse<IOpenUserNotificationData>;
13
13
  export type IPaginateUserNotificationResponse = IResponse<BasePaginate<IUserNotification & NotificationDTO>>;
14
+ export interface IOpenUserNotificationsByTicketData {
15
+ count: number;
16
+ }
17
+ export type IOpenUserNotificationsByTicketResponse = IResponse<IOpenUserNotificationsByTicketData>;
@@ -0,0 +1,16 @@
1
+ import { OrganizationPermission, OrganizationRole } from '../../enum';
2
+ import { IOrganization } from './organization.model';
3
+ import { IUser } from './user.model';
4
+ export interface IOrganizationMember {
5
+ id?: string;
6
+ organizationId: string;
7
+ userId: string;
8
+ role: OrganizationRole;
9
+ customPermissions: OrganizationPermission[] | null;
10
+ isConfirmed: boolean;
11
+ joinedAt: Date;
12
+ updatedAt?: Date;
13
+ createdAt?: Date;
14
+ organization?: IOrganization;
15
+ user?: IUser;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { IOrganizationMember } from './organization-member.model';
2
+ import { IProject } from './project.model';
3
+ import { IOrganizationSubscription } from './organization-subscription.model';
4
+ export interface IOrganizationSettings {
5
+ defaultTeamId?: string | null;
6
+ allowMemberProjectCreation?: boolean;
7
+ }
8
+ export interface IOrganization {
9
+ id?: string;
10
+ name: string;
11
+ slug: string;
12
+ description: string | null;
13
+ pictureId: string | null;
14
+ pictureThumbnailId: string | null;
15
+ balance: number;
16
+ settings: IOrganizationSettings;
17
+ updatedAt?: Date;
18
+ createdAt?: Date;
19
+ organizationMember?: IOrganizationMember[];
20
+ project?: IProject[];
21
+ organizationSubscription?: IOrganizationSubscription | null;
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { OrganizationPermission, OrganizationRole } from '../types/enum';
2
+ export declare const ORGANIZATION_ROLE_PERMISSIONS: Record<OrganizationRole, OrganizationPermission[]>;
3
+ export declare function getEffectiveOrgPermissions(role: OrganizationRole, customPermissions: OrganizationPermission[] | null): OrganizationPermission[];
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEffectiveOrgPermissions = exports.ORGANIZATION_ROLE_PERMISSIONS = void 0;
4
+ const enum_1 = require("../types/enum");
5
+ exports.ORGANIZATION_ROLE_PERMISSIONS = {
6
+ [enum_1.OrganizationRole.OWNER]: Object.values(enum_1.OrganizationPermission),
7
+ [enum_1.OrganizationRole.ADMIN]: [
8
+ enum_1.OrganizationPermission.ORG_UPDATE,
9
+ enum_1.OrganizationPermission.ORG_BILLING_READ,
10
+ enum_1.OrganizationPermission.ORG_BILLING_MANAGE,
11
+ enum_1.OrganizationPermission.MEMBER_INVITE,
12
+ enum_1.OrganizationPermission.MEMBER_REMOVE,
13
+ enum_1.OrganizationPermission.MEMBER_UPDATE_ROLE,
14
+ enum_1.OrganizationPermission.TEAM_CREATE,
15
+ enum_1.OrganizationPermission.TEAM_UPDATE,
16
+ enum_1.OrganizationPermission.TEAM_DELETE,
17
+ enum_1.OrganizationPermission.PROJECT_CREATE,
18
+ enum_1.OrganizationPermission.PROJECT_DELETE,
19
+ enum_1.OrganizationPermission.TICKET_READ,
20
+ enum_1.OrganizationPermission.TICKET_CREATE,
21
+ enum_1.OrganizationPermission.TICKET_MANAGE,
22
+ ],
23
+ [enum_1.OrganizationRole.MEMBER]: [
24
+ enum_1.OrganizationPermission.PROJECT_CREATE,
25
+ enum_1.OrganizationPermission.TICKET_READ,
26
+ enum_1.OrganizationPermission.TICKET_CREATE,
27
+ ],
28
+ [enum_1.OrganizationRole.VIEWER]: [enum_1.OrganizationPermission.TICKET_READ],
29
+ };
30
+ function getEffectiveOrgPermissions(role, customPermissions) {
31
+ if (customPermissions !== null) {
32
+ return customPermissions;
33
+ }
34
+ return exports.ORGANIZATION_ROLE_PERMISSIONS[role];
35
+ }
36
+ exports.getEffectiveOrgPermissions = getEffectiveOrgPermissions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/main",
3
- "version": "1.0.104",
3
+ "version": "1.0.106",
4
4
  "description": "Core package to interact with Abyss-Project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",