@marinade.finance/notifications-ts-subscription-client 1.0.2 → 1.0.3
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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/types.d.ts +4 -2
- package/dist/types.js +16 -1
- package/index.ts +5 -1
- package/package.json +1 -1
- package/types.ts +15 -12
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { SubscriptionClient } from './client';
|
|
|
2
2
|
import type { SubscriptionClientConfig } from './types';
|
|
3
3
|
export { SubscriptionClient };
|
|
4
4
|
export { subscribeMessage, unsubscribeMessage, listSubscriptionsMessage, } from './message';
|
|
5
|
-
export { NetworkError } from './types';
|
|
5
|
+
export { NetworkError, NOTIFICATION_PRIORITIES, BONDS_EVENT_INNER_TYPES, } from './types';
|
|
6
6
|
export type { Logger, SubscriptionClientConfig, SubscribeRequest, SubscribeResponse, UnsubscribeRequest, UnsubscribeResponse, ListSubscriptionsQuery, ListSubscriptionsAuth, Subscription, ListNotificationsQuery, ListBroadcastNotificationsQuery, Notification, NotificationScope, NotificationPriority, BondsEventInnerType, } from './types';
|
|
7
7
|
export declare const NOTIFICATION_TYPE_SAM_AUCTION = "sam_auction";
|
|
8
8
|
export declare const NOTIFICATION_TYPE_INSTITUTIONAL_SELECT = "institutional_select";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NOTIFICATION_TYPE_INSTITUTIONAL_SELECT = exports.NOTIFICATION_TYPE_SAM_AUCTION = exports.NetworkError = exports.listSubscriptionsMessage = exports.unsubscribeMessage = exports.subscribeMessage = exports.SubscriptionClient = void 0;
|
|
3
|
+
exports.NOTIFICATION_TYPE_INSTITUTIONAL_SELECT = exports.NOTIFICATION_TYPE_SAM_AUCTION = exports.BONDS_EVENT_INNER_TYPES = exports.NOTIFICATION_PRIORITIES = exports.NetworkError = exports.listSubscriptionsMessage = exports.unsubscribeMessage = exports.subscribeMessage = exports.SubscriptionClient = void 0;
|
|
4
4
|
exports.createSubscriptionClient = createSubscriptionClient;
|
|
5
5
|
const client_1 = require("./client");
|
|
6
6
|
Object.defineProperty(exports, "SubscriptionClient", { enumerable: true, get: function () { return client_1.SubscriptionClient; } });
|
|
@@ -10,6 +10,8 @@ Object.defineProperty(exports, "unsubscribeMessage", { enumerable: true, get: fu
|
|
|
10
10
|
Object.defineProperty(exports, "listSubscriptionsMessage", { enumerable: true, get: function () { return message_1.listSubscriptionsMessage; } });
|
|
11
11
|
var types_1 = require("./types");
|
|
12
12
|
Object.defineProperty(exports, "NetworkError", { enumerable: true, get: function () { return types_1.NetworkError; } });
|
|
13
|
+
Object.defineProperty(exports, "NOTIFICATION_PRIORITIES", { enumerable: true, get: function () { return types_1.NOTIFICATION_PRIORITIES; } });
|
|
14
|
+
Object.defineProperty(exports, "BONDS_EVENT_INNER_TYPES", { enumerable: true, get: function () { return types_1.BONDS_EVENT_INNER_TYPES; } });
|
|
13
15
|
exports.NOTIFICATION_TYPE_SAM_AUCTION = 'sam_auction';
|
|
14
16
|
exports.NOTIFICATION_TYPE_INSTITUTIONAL_SELECT = 'institutional_select';
|
|
15
17
|
function createSubscriptionClient(config) {
|
package/dist/types.d.ts
CHANGED
|
@@ -80,8 +80,10 @@ export interface ListBroadcastNotificationsQuery {
|
|
|
80
80
|
offset?: number;
|
|
81
81
|
}
|
|
82
82
|
export type NotificationScope = 'broadcast' | 'individual';
|
|
83
|
-
export
|
|
84
|
-
export type
|
|
83
|
+
export declare const NOTIFICATION_PRIORITIES: readonly ["critical", "warning", "info"];
|
|
84
|
+
export type NotificationPriority = (typeof NOTIFICATION_PRIORITIES)[number];
|
|
85
|
+
export declare const BONDS_EVENT_INNER_TYPES: readonly ["first_seen", "bond_removed", "auction_entered", "auction_exited", "cap_changed", "bond_underfunded_change", "bond_balance_change", "announcement", "version_bump", "sam_eligible_change"];
|
|
86
|
+
export type BondsEventInnerType = (typeof BONDS_EVENT_INNER_TYPES)[number];
|
|
85
87
|
/** GET /v1/notifications response item */
|
|
86
88
|
export interface Notification {
|
|
87
89
|
/** BIGSERIAL in PostgreSQL, serialized as string via JSON replacer */
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NetworkError = void 0;
|
|
3
|
+
exports.NetworkError = exports.BONDS_EVENT_INNER_TYPES = exports.NOTIFICATION_PRIORITIES = void 0;
|
|
4
|
+
// Keep in sync with notifications-bonds/src/types.ts NotificationPriority
|
|
5
|
+
exports.NOTIFICATION_PRIORITIES = ['critical', 'warning', 'info'];
|
|
6
|
+
// Keep in sync with notifications-bonds-event-v1 BondsEventInnerType
|
|
7
|
+
exports.BONDS_EVENT_INNER_TYPES = [
|
|
8
|
+
'first_seen',
|
|
9
|
+
'bond_removed',
|
|
10
|
+
'auction_entered',
|
|
11
|
+
'auction_exited',
|
|
12
|
+
'cap_changed',
|
|
13
|
+
'bond_underfunded_change',
|
|
14
|
+
'bond_balance_change',
|
|
15
|
+
'announcement',
|
|
16
|
+
'version_bump',
|
|
17
|
+
'sam_eligible_change',
|
|
18
|
+
];
|
|
4
19
|
class NetworkError extends Error {
|
|
5
20
|
constructor(message, status, response) {
|
|
6
21
|
super(message);
|
package/index.ts
CHANGED
|
@@ -8,7 +8,11 @@ export {
|
|
|
8
8
|
unsubscribeMessage,
|
|
9
9
|
listSubscriptionsMessage,
|
|
10
10
|
} from './message'
|
|
11
|
-
export {
|
|
11
|
+
export {
|
|
12
|
+
NetworkError,
|
|
13
|
+
NOTIFICATION_PRIORITIES,
|
|
14
|
+
BONDS_EVENT_INNER_TYPES,
|
|
15
|
+
} from './types'
|
|
12
16
|
export type {
|
|
13
17
|
Logger,
|
|
14
18
|
SubscriptionClientConfig,
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -106,20 +106,23 @@ export interface ListBroadcastNotificationsQuery {
|
|
|
106
106
|
export type NotificationScope = 'broadcast' | 'individual'
|
|
107
107
|
|
|
108
108
|
// Keep in sync with notifications-bonds/src/types.ts NotificationPriority
|
|
109
|
-
export
|
|
109
|
+
export const NOTIFICATION_PRIORITIES = ['critical', 'warning', 'info'] as const
|
|
110
|
+
export type NotificationPriority = (typeof NOTIFICATION_PRIORITIES)[number]
|
|
110
111
|
|
|
111
112
|
// Keep in sync with notifications-bonds-event-v1 BondsEventInnerType
|
|
112
|
-
export
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
113
|
+
export const BONDS_EVENT_INNER_TYPES = [
|
|
114
|
+
'first_seen',
|
|
115
|
+
'bond_removed',
|
|
116
|
+
'auction_entered',
|
|
117
|
+
'auction_exited',
|
|
118
|
+
'cap_changed',
|
|
119
|
+
'bond_underfunded_change',
|
|
120
|
+
'bond_balance_change',
|
|
121
|
+
'announcement',
|
|
122
|
+
'version_bump',
|
|
123
|
+
'sam_eligible_change',
|
|
124
|
+
] as const
|
|
125
|
+
export type BondsEventInnerType = (typeof BONDS_EVENT_INNER_TYPES)[number]
|
|
123
126
|
|
|
124
127
|
/** GET /v1/notifications response item */
|
|
125
128
|
export interface Notification {
|