@stefaninigo/notifications-api 1.0.1 → 1.1.1

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.
@@ -2,3 +2,4 @@ export * from './health/health';
2
2
  export * from './notifications/notifications';
3
3
  export * from './send/send';
4
4
  export * from './stefaniniGoServiceAPI.schemas';
5
+ export * from './ws-notifications/ws-notifications';
@@ -18,4 +18,5 @@ __exportStar(require("./health/health"), exports);
18
18
  __exportStar(require("./notifications/notifications"), exports);
19
19
  __exportStar(require("./send/send"), exports);
20
20
  __exportStar(require("./stefaniniGoServiceAPI.schemas"), exports);
21
+ __exportStar(require("./ws-notifications/ws-notifications"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,gEAA8C;AAC9C,8CAA4B;AAC5B,kEAAgD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,gEAA8C;AAC9C,8CAA4B;AAC5B,kEAAgD;AAChD,sEAAoD"}
@@ -83,8 +83,65 @@ export interface SendByPurposeDto {
83
83
  data: SendByPurposeDtoData;
84
84
  attachments?: AttachmentDto[];
85
85
  }
86
+ export interface NotificationsPayloadDto {
87
+ userId: string;
88
+ }
89
+ export interface SubscribeNotificationsDto {
90
+ connectionId: string;
91
+ payload: NotificationsPayloadDto;
92
+ }
93
+ export interface UnsubscribeNotificationsDto {
94
+ connectionId: string;
95
+ payload: NotificationsPayloadDto;
96
+ }
97
+ export type CreateWsNotificationDtoStatus = typeof CreateWsNotificationDtoStatus[keyof typeof CreateWsNotificationDtoStatus];
98
+ export declare const CreateWsNotificationDtoStatus: {
99
+ readonly read: "read";
100
+ readonly unread: "unread";
101
+ };
102
+ export type CreateWsNotificationDtoCategory = typeof CreateWsNotificationDtoCategory[keyof typeof CreateWsNotificationDtoCategory];
103
+ export declare const CreateWsNotificationDtoCategory: {
104
+ readonly ticketAssigned: "ticketAssigned";
105
+ readonly ticketComment: "ticketComment";
106
+ readonly expensesApproved: "expensesApproved";
107
+ readonly expensesRejected: "expensesRejected";
108
+ readonly ticketResolved: "ticketResolved";
109
+ readonly expensesSubmitted: "expensesSubmitted";
110
+ };
111
+ export interface CreateWsNotificationDto {
112
+ emitterId: string;
113
+ receiverId: string;
114
+ status: CreateWsNotificationDtoStatus;
115
+ category: CreateWsNotificationDtoCategory;
116
+ url: string;
117
+ message?: string;
118
+ clientId?: string;
119
+ ticketId?: string;
120
+ ticketNumber?: string;
121
+ createdAt?: string;
122
+ }
123
+ export interface MarkAsReadDto {
124
+ notificationsId: string[];
125
+ }
126
+ export type BroadcastDtoPayload = {
127
+ [key: string]: unknown;
128
+ };
129
+ export interface BroadcastDto {
130
+ channel: string;
131
+ payload: BroadcastDtoPayload;
132
+ }
86
133
  export type NotificationsControllerFindAllParams = {
87
134
  page?: number;
88
135
  limit?: number;
89
136
  filters?: string;
90
137
  };
138
+ export type WsNotificationsControllerListParams = {
139
+ page: number;
140
+ limit: number;
141
+ filters?: string;
142
+ exclude?: string;
143
+ fields?: string;
144
+ sort?: string;
145
+ search?: string;
146
+ textSearch?: string;
147
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateNotificationConfigDtoPurpose = exports.UpdateNotificationConfigDtoType = exports.CreateNotificationConfigDtoPurpose = exports.CreateNotificationConfigDtoType = void 0;
3
+ exports.CreateWsNotificationDtoCategory = exports.CreateWsNotificationDtoStatus = exports.UpdateNotificationConfigDtoPurpose = exports.UpdateNotificationConfigDtoType = exports.CreateNotificationConfigDtoPurpose = exports.CreateNotificationConfigDtoType = void 0;
4
4
  exports.CreateNotificationConfigDtoType = {
5
5
  email: 'email',
6
6
  push: 'push',
@@ -25,4 +25,16 @@ exports.UpdateNotificationConfigDtoPurpose = {
25
25
  alert: 'alert',
26
26
  reminder: 'reminder',
27
27
  };
28
+ exports.CreateWsNotificationDtoStatus = {
29
+ read: 'read',
30
+ unread: 'unread',
31
+ };
32
+ exports.CreateWsNotificationDtoCategory = {
33
+ ticketAssigned: 'ticketAssigned',
34
+ ticketComment: 'ticketComment',
35
+ expensesApproved: 'expensesApproved',
36
+ expensesRejected: 'expensesRejected',
37
+ ticketResolved: 'ticketResolved',
38
+ expensesSubmitted: 'expensesSubmitted',
39
+ };
28
40
  //# sourceMappingURL=stefaniniGoServiceAPI.schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stefaniniGoServiceAPI.schemas.js","sourceRoot":"","sources":["../../src/generated/stefaniniGoServiceAPI.schemas.ts"],"names":[],"mappings":";;;AA2Ca,QAAA,+BAA+B,GAAG;IAC7C,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACV,CAAC;AASE,QAAA,kCAAkC,GAAG;IAChD,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACZ,CAAC;AAwBE,QAAA,+BAA+B,GAAG;IAC7C,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACV,CAAC;AASE,QAAA,kCAAkC,GAAG;IAChD,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACZ,CAAC"}
1
+ {"version":3,"file":"stefaniniGoServiceAPI.schemas.js","sourceRoot":"","sources":["../../src/generated/stefaniniGoServiceAPI.schemas.ts"],"names":[],"mappings":";;;AA2Ca,QAAA,+BAA+B,GAAG;IAC7C,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACV,CAAC;AASE,QAAA,kCAAkC,GAAG;IAChD,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACZ,CAAC;AAwBE,QAAA,+BAA+B,GAAG;IAC7C,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACV,CAAC;AASE,QAAA,kCAAkC,GAAG;IAChD,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACZ,CAAC;AAgFE,QAAA,6BAA6B,GAAG;IAC3C,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACR,CAAC;AAME,QAAA,+BAA+B,GAAG;IAC7C,cAAc,EAAE,gBAAgB;IAChC,aAAa,EAAE,eAAe;IAC9B,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;IAChC,iBAAiB,EAAE,mBAAmB;CAC9B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { BroadcastDto, CreateWsNotificationDto, MarkAsReadDto, SubscribeNotificationsDto, UnsubscribeNotificationsDto, WsNotificationsControllerListParams } from '../stefaniniGoServiceAPI.schemas';
2
+ import { customInstance } from '../../utils/mutator';
3
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
4
+ export declare const getWsNotifications: () => {
5
+ wsNotificationsControllerSubscribeNotifications: (subscribeNotificationsDto: SubscribeNotificationsDto, options?: SecondParameter<typeof customInstance<void>>) => Promise<void>;
6
+ wsNotificationsControllerUnsubscribeNotifications: (unsubscribeNotificationsDto: UnsubscribeNotificationsDto, options?: SecondParameter<typeof customInstance<void>>) => Promise<void>;
7
+ wsNotificationsControllerNewNotifications: (createWsNotificationDto: CreateWsNotificationDto, options?: SecondParameter<typeof customInstance<void>>) => Promise<void>;
8
+ wsNotificationsControllerList: (params: WsNotificationsControllerListParams, options?: SecondParameter<typeof customInstance<void>>) => Promise<void>;
9
+ wsNotificationsControllerMarkAsRead: (markAsReadDto: MarkAsReadDto, options?: SecondParameter<typeof customInstance<void>>) => Promise<void>;
10
+ wsNotificationsControllerMarkAllAsRead: (options?: SecondParameter<typeof customInstance<void>>) => Promise<void>;
11
+ wsNotificationsControllerCreateAndSendNotification: (createWsNotificationDto: CreateWsNotificationDto, options?: SecondParameter<typeof customInstance<void>>) => Promise<void>;
12
+ wsNotificationsControllerBroadcast: (broadcastDto: BroadcastDto, options?: SecondParameter<typeof customInstance<void>>) => Promise<void>;
13
+ };
14
+ export type WsNotificationsControllerSubscribeNotificationsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getWsNotifications>['wsNotificationsControllerSubscribeNotifications']>>>;
15
+ export type WsNotificationsControllerUnsubscribeNotificationsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getWsNotifications>['wsNotificationsControllerUnsubscribeNotifications']>>>;
16
+ export type WsNotificationsControllerNewNotificationsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getWsNotifications>['wsNotificationsControllerNewNotifications']>>>;
17
+ export type WsNotificationsControllerListResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getWsNotifications>['wsNotificationsControllerList']>>>;
18
+ export type WsNotificationsControllerMarkAsReadResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getWsNotifications>['wsNotificationsControllerMarkAsRead']>>>;
19
+ export type WsNotificationsControllerMarkAllAsReadResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getWsNotifications>['wsNotificationsControllerMarkAllAsRead']>>>;
20
+ export type WsNotificationsControllerCreateAndSendNotificationResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getWsNotifications>['wsNotificationsControllerCreateAndSendNotification']>>>;
21
+ export type WsNotificationsControllerBroadcastResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getWsNotifications>['wsNotificationsControllerBroadcast']>>>;
22
+ export {};
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWsNotifications = void 0;
4
+ const mutator_1 = require("../../utils/mutator");
5
+ const getWsNotifications = () => {
6
+ const wsNotificationsControllerSubscribeNotifications = (subscribeNotificationsDto, options) => {
7
+ return (0, mutator_1.customInstance)({ url: `/ws/notifications/subscribeNotifications`, method: 'POST',
8
+ headers: { 'Content-Type': 'application/json', },
9
+ data: subscribeNotificationsDto
10
+ }, options);
11
+ };
12
+ const wsNotificationsControllerUnsubscribeNotifications = (unsubscribeNotificationsDto, options) => {
13
+ return (0, mutator_1.customInstance)({ url: `/ws/notifications/unsubscribeNotifications`, method: 'POST',
14
+ headers: { 'Content-Type': 'application/json', },
15
+ data: unsubscribeNotificationsDto
16
+ }, options);
17
+ };
18
+ const wsNotificationsControllerNewNotifications = (createWsNotificationDto, options) => {
19
+ return (0, mutator_1.customInstance)({ url: `/ws/notifications`, method: 'POST',
20
+ headers: { 'Content-Type': 'application/json', },
21
+ data: createWsNotificationDto
22
+ }, options);
23
+ };
24
+ const wsNotificationsControllerList = (params, options) => {
25
+ return (0, mutator_1.customInstance)({ url: `/ws/notifications`, method: 'GET',
26
+ params
27
+ }, options);
28
+ };
29
+ const wsNotificationsControllerMarkAsRead = (markAsReadDto, options) => {
30
+ return (0, mutator_1.customInstance)({ url: `/ws/notifications/markasread`, method: 'POST',
31
+ headers: { 'Content-Type': 'application/json', },
32
+ data: markAsReadDto
33
+ }, options);
34
+ };
35
+ const wsNotificationsControllerMarkAllAsRead = (options) => {
36
+ return (0, mutator_1.customInstance)({ url: `/ws/notifications/mark-all-read`, method: 'POST'
37
+ }, options);
38
+ };
39
+ const wsNotificationsControllerCreateAndSendNotification = (createWsNotificationDto, options) => {
40
+ return (0, mutator_1.customInstance)({ url: `/ws/notifications/create-and-send`, method: 'POST',
41
+ headers: { 'Content-Type': 'application/json', },
42
+ data: createWsNotificationDto
43
+ }, options);
44
+ };
45
+ const wsNotificationsControllerBroadcast = (broadcastDto, options) => {
46
+ return (0, mutator_1.customInstance)({ url: `/ws/notifications/broadcast`, method: 'POST',
47
+ headers: { 'Content-Type': 'application/json', },
48
+ data: broadcastDto
49
+ }, options);
50
+ };
51
+ return { wsNotificationsControllerSubscribeNotifications, wsNotificationsControllerUnsubscribeNotifications, wsNotificationsControllerNewNotifications, wsNotificationsControllerList, wsNotificationsControllerMarkAsRead, wsNotificationsControllerMarkAllAsRead, wsNotificationsControllerCreateAndSendNotification, wsNotificationsControllerBroadcast };
52
+ };
53
+ exports.getWsNotifications = getWsNotifications;
54
+ //# sourceMappingURL=ws-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws-notifications.js","sourceRoot":"","sources":["../../../src/generated/ws-notifications/ws-notifications.ts"],"names":[],"mappings":";;;AAgBA,iDAAqD;AAM5C,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAIzC,MAAM,+CAA+C,GAAG,CACpD,yBAAoD,EACvD,OAAsD,EAAG,EAAE;QACtD,OAAO,IAAA,wBAAc,EACrB,EAAC,GAAG,EAAE,0CAA0C,EAAE,MAAM,EAAE,MAAM;YAChE,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,GAAG;YAC/C,IAAI,EAAE,yBAAyB;SAChC,EACC,OAAO,CAAC,CAAC;IACX,CAAC,CAAA;IAIL,MAAM,iDAAiD,GAAG,CACtD,2BAAwD,EAC3D,OAAsD,EAAG,EAAE;QACtD,OAAO,IAAA,wBAAc,EACrB,EAAC,GAAG,EAAE,4CAA4C,EAAE,MAAM,EAAE,MAAM;YAClE,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,GAAG;YAC/C,IAAI,EAAE,2BAA2B;SAClC,EACC,OAAO,CAAC,CAAC;IACX,CAAC,CAAA;IAIL,MAAM,yCAAyC,GAAG,CAC9C,uBAAgD,EACnD,OAAsD,EA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Ac,EACrB,EAAC,GAAG,EAAE,6BAA6B,EAAE,MAAM,EAAE,MAAM;YACnD,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,GAAG;YAC/C,IAAI,EAAE,YAAY;SACnB,EACC,OAAO,CAAC,CAAC;IACX,CAAC,CAAA;IACH,OAAO,EAAC,+CAA+C,EAAC,iDAAiD,EAAC,yCAAyC,EAAC,6BAA6B,EAAC,mCAAmC,EAAC,sCAAsC,EAAC,kDAAkD,EAAC,kCAAkC,EAAC,CAAA;AAAA,CAAC,CAAC;AAtGxU,QAAA,kBAAkB,sBAsGsT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stefaninigo/notifications-api",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Generated API SDK for StefaniniGo Notifications service",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",