@stackfactor/client-api 1.2.4 → 1.2.7
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/cjs/lib/actionNotifications.d.ts +42 -0
- package/dist/cjs/lib/actionNotifications.d.ts.map +1 -1
- package/dist/cjs/lib/actionNotifications.js +107 -1
- package/dist/cjs/lib/actionNotifications.js.map +1 -1
- package/dist/cjs/lib/avatar.js +1 -1
- package/dist/cjs/lib/avatar.js.map +1 -1
- package/dist/cjs/lib/channelProgrammes.d.ts +134 -0
- package/dist/cjs/lib/channelProgrammes.d.ts.map +1 -0
- package/dist/cjs/lib/channelProgrammes.js +205 -0
- package/dist/cjs/lib/channelProgrammes.js.map +1 -0
- package/dist/cjs/lib/incident.d.ts +25 -0
- package/dist/cjs/lib/incident.d.ts.map +1 -1
- package/dist/cjs/lib/incident.js +29 -1
- package/dist/cjs/lib/incident.js.map +1 -1
- package/dist/cjs/lib/index.d.ts +2 -0
- package/dist/cjs/lib/index.d.ts.map +1 -1
- package/dist/cjs/lib/index.js +4 -2
- package/dist/cjs/lib/index.js.map +1 -1
- package/dist/cjs/lib/integration.d.ts.map +1 -1
- package/dist/cjs/lib/integration.js +17 -2
- package/dist/cjs/lib/integration.js.map +1 -1
- package/dist/cjs/lib/partnerships.d.ts +141 -0
- package/dist/cjs/lib/partnerships.d.ts.map +1 -0
- package/dist/cjs/lib/partnerships.js +247 -0
- package/dist/cjs/lib/partnerships.js.map +1 -0
- package/dist/cjs/lib/utils.d.ts.map +1 -1
- package/dist/cjs/lib/utils.js +11 -0
- package/dist/cjs/lib/utils.js.map +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/esm/lib/actionNotifications.d.ts +42 -0
- package/dist/esm/lib/actionNotifications.d.ts.map +1 -1
- package/dist/esm/lib/actionNotifications.js +104 -0
- package/dist/esm/lib/actionNotifications.js.map +1 -1
- package/dist/esm/lib/avatar.js +1 -1
- package/dist/esm/lib/avatar.js.map +1 -1
- package/dist/esm/lib/channelProgrammes.d.ts +134 -0
- package/dist/esm/lib/channelProgrammes.d.ts.map +1 -0
- package/dist/esm/lib/channelProgrammes.js +193 -0
- package/dist/esm/lib/channelProgrammes.js.map +1 -0
- package/dist/esm/lib/incident.d.ts +25 -0
- package/dist/esm/lib/incident.d.ts.map +1 -1
- package/dist/esm/lib/incident.js +27 -0
- package/dist/esm/lib/incident.js.map +1 -1
- package/dist/esm/lib/index.d.ts +2 -0
- package/dist/esm/lib/index.d.ts.map +1 -1
- package/dist/esm/lib/index.js +2 -0
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/integration.d.ts.map +1 -1
- package/dist/esm/lib/integration.js +17 -2
- package/dist/esm/lib/integration.js.map +1 -1
- package/dist/esm/lib/partnerships.d.ts +141 -0
- package/dist/esm/lib/partnerships.d.ts.map +1 -0
- package/dist/esm/lib/partnerships.js +234 -0
- package/dist/esm/lib/partnerships.js.map +1 -0
- package/dist/esm/lib/utils.d.ts.map +1 -1
- package/dist/esm/lib/utils.js +11 -0
- package/dist/esm/lib/utils.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/package.json +11 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partnerships.js","sourceRoot":"","sources":["../../../src/lib/partnerships.ts"],"names":[],"mappings":";;;AACA,qDAA0C;AAiE1C,iFAAiF;AAEjF;;;;;;;;;;;;GAYG;AACI,MAAM,aAAa,GAAG,CAC3B,IAA4B,EAC5B,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,IAAI,EAAE;YAC/D,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE;SACtC,CAAC,CAAC;QACH,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CA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,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAnBW,QAAA,aAAa,iBAmBxB;AAEF,iFAAiF;AAEjF;;;;;;;;;;;;;GAaG;AACI,MAAM,oBAAoB,GAAG,CAClC,EAAU,EACV,MAAqB,EACrB,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAM,CAAC,IAAI,CACzB,kCAAkC,EAAE,EAAE,EACtC,EAAE,MAAM,EAAE,EACV,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAnBW,QAAA,oBAAoB,wBAmB/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AA2BA;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAO,MAqB7B,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,oBAAoB,GAAI,QAAQ;IAC3C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,KAAG,MAWH,CAAC"}
|
package/dist/cjs/lib/utils.js
CHANGED
|
@@ -11,6 +11,17 @@ const dotenv_1 = __importDefault(require("dotenv"));
|
|
|
11
11
|
// isomorphic — it's also bundled into the frontend — so only load the .env file
|
|
12
12
|
// when running under Node. In the browser the consuming bundler injects env
|
|
13
13
|
// vars at build time, so this is a no-op there.
|
|
14
|
+
//
|
|
15
|
+
// The guard below is a RUNTIME check, and a runtime check does nothing for
|
|
16
|
+
// bundle size: a bundler still follows this import statically. dotenv requires
|
|
17
|
+
// Node's `crypto`, which webpack satisfies with crypto-browserify — elliptic,
|
|
18
|
+
// asn1.js, bn.js, diffie-hellman, public-encrypt, create-ecdh, miller-rabin and
|
|
19
|
+
// ~20 more, about 950 KB in the frontend's entry chunk, to serve a branch that
|
|
20
|
+
// never runs in a browser. So package.json also maps `"browser": {"dotenv":
|
|
21
|
+
// false}`, which resolves this import to an empty module in web builds and
|
|
22
|
+
// leaves Node consumers completely unchanged. Both are needed: the browser
|
|
23
|
+
// field keeps the code out of the bundle, the guard below keeps config() from
|
|
24
|
+
// running under a bundler that ignores the field.
|
|
14
25
|
if (typeof window === "undefined" &&
|
|
15
26
|
typeof process !== "undefined" &&
|
|
16
27
|
Boolean(process.versions?.node)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,8EAA8E;AAC9E,qEAAqE;AACrE,6EAA6E;AAC7E,gFAAgF;AAChF,4EAA4E;AAC5E,gDAAgD;AAChD,IACE,OAAO,MAAM,KAAK,WAAW;IAC7B,OAAO,OAAO,KAAK,WAAW;IAC9B,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,EAC/B,CAAC;IACD,gBAAM,CAAC,MAAM,EAAE,CAAC;AAClB,CAAC;AAED;;;GAGG;AACI,MAAM,UAAU,GAAG,GAAW,EAAE;IACrC,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;QACtC,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;IAC3C,CAAC;SAAM,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AAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAClC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,MAAM,aAAa,GAAG,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7D,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,aAAa,EAAE,CAAC;YACtD,IAAA,4BAAoB,EAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAbW,QAAA,oBAAoB,wBAa/B"}
|
package/dist/cjs/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"commonjs"}
|
|
1
|
+
{"type":"commonjs","browser":{"dotenv":false}}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import { type Socket } from "socket.io-client";
|
|
1
2
|
/**
|
|
2
3
|
* Get all permissions
|
|
3
4
|
* @param {String} token The authentication token
|
|
4
5
|
* @returns {Promise<object>}
|
|
5
6
|
*/
|
|
6
7
|
export declare const getAllUserNotifications: (token: string) => Promise<object>;
|
|
8
|
+
/**
|
|
9
|
+
* Get one notification's full per-user view — including the heavy `details`
|
|
10
|
+
* and `data` payloads the list deliberately omits. Called on demand when a
|
|
11
|
+
* notification is opened.
|
|
12
|
+
* @param {String} id The notification id
|
|
13
|
+
* @param {String} token The authentication token
|
|
14
|
+
* @returns {Promise<object>}
|
|
15
|
+
*/
|
|
16
|
+
export declare const getUserNotificationDetails: (id: string, token: string) => Promise<object>;
|
|
7
17
|
/**
|
|
8
18
|
* Mark notifications as open or viewed
|
|
9
19
|
* @param {Array<String>} ids The id of the notifications to be marked
|
|
@@ -21,4 +31,36 @@ export declare const markNotifications: (ids: string[], status: string, authToke
|
|
|
21
31
|
* @returns {Promise<object>}
|
|
22
32
|
*/
|
|
23
33
|
export declare const processNotification: (id: string, action: string, comments: string, authToken: string) => Promise<object>;
|
|
34
|
+
/** Socket event the backend uses to push a user's full notification list. */
|
|
35
|
+
export declare const NOTIFICATIONS_LIST_EVENT = "notifications:list";
|
|
36
|
+
/** Handle returned by {@link subscribeToUserNotifications}. */
|
|
37
|
+
export interface UserNotificationsSubscription {
|
|
38
|
+
/** Permanently closes the subscription (e.g. on logout). */
|
|
39
|
+
disconnect: () => void;
|
|
40
|
+
/** The underlying socket, for connection-state inspection. */
|
|
41
|
+
socket: Socket;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Opens a persistent realtime subscription to the current user's action
|
|
45
|
+
* notifications. Unlike the per-operation sockets in this package, this
|
|
46
|
+
* connection reconnects automatically and stays open for the lifetime of the
|
|
47
|
+
* session.
|
|
48
|
+
*
|
|
49
|
+
* The backend sends the full current notification list (the same shape as
|
|
50
|
+
* `getAllUserNotifications`) on every connect and reconnect, and again
|
|
51
|
+
* whenever the list changes — so the consumer simply replaces its state with
|
|
52
|
+
* each `onList` payload and needs no polling and no merge logic.
|
|
53
|
+
*
|
|
54
|
+
* @param getToken Called before every (re)connect attempt so the handshake
|
|
55
|
+
* always carries a fresh token — pass an accessor that refreshes the
|
|
56
|
+
* short-lived bearer token, never a captured value.
|
|
57
|
+
* @param onList Receives the user's full notification list on every push.
|
|
58
|
+
* @param onConnectionChange Optional; observes socket connectivity so the
|
|
59
|
+
* consumer can fall back to polling while disconnected.
|
|
60
|
+
*/
|
|
61
|
+
export declare const subscribeToUserNotifications: ({ getToken, onList, onConnectionChange, }: {
|
|
62
|
+
getToken: () => Promise<string | null> | string | null;
|
|
63
|
+
onList: (notifications: object[]) => void;
|
|
64
|
+
onConnectionChange?: (connected: boolean) => void;
|
|
65
|
+
}) => UserNotificationsSubscription;
|
|
24
66
|
//# sourceMappingURL=actionNotifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionNotifications.d.ts","sourceRoot":"","sources":["../../../src/lib/actionNotifications.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,KAAG,OAAO,CAAC,MAAM,CAarE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,MAAM,EAAE,EACb,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAkBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,IAAI,MAAM,EACV,QAAQ,MAAM,EACd,UAAU,MAAM,EAChB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAmBhB,CAAC"}
|
|
1
|
+
{"version":3,"file":"actionNotifications.d.ts","sourceRoot":"","sources":["../../../src/lib/actionNotifications.ts"],"names":[],"mappings":"AAGA,OAAO,EAAM,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,KAAG,OAAO,CAAC,MAAM,CAarE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,IAAI,MAAM,EACV,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAahB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,MAAM,EAAE,EACb,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAkBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,IAAI,MAAM,EACV,QAAQ,MAAM,EACd,UAAU,MAAM,EAChB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAmBhB,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAQ7D,+DAA+D;AAC/D,MAAM,WAAW,6BAA6B;IAC5C,4DAA4D;IAC5D,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,GAAI,2CAI1C;IACD,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;IACvD,MAAM,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACnD,KAAG,6BAkDH,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { client } from "./axiosClient.js";
|
|
2
|
+
import { getBaseUrl } from "./utils.js";
|
|
3
|
+
import { io } from "socket.io-client";
|
|
2
4
|
/**
|
|
3
5
|
* Get all permissions
|
|
4
6
|
* @param {String} token The authentication token
|
|
@@ -18,6 +20,28 @@ export const getAllUserNotifications = (token) => {
|
|
|
18
20
|
});
|
|
19
21
|
});
|
|
20
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Get one notification's full per-user view — including the heavy `details`
|
|
25
|
+
* and `data` payloads the list deliberately omits. Called on demand when a
|
|
26
|
+
* notification is opened.
|
|
27
|
+
* @param {String} id The notification id
|
|
28
|
+
* @param {String} token The authentication token
|
|
29
|
+
* @returns {Promise<object>}
|
|
30
|
+
*/
|
|
31
|
+
export const getUserNotificationDetails = (id, token) => {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
const request = client.get(`/api/v1/actionnotifications/${id}`, {
|
|
34
|
+
headers: { authorization: token },
|
|
35
|
+
});
|
|
36
|
+
request
|
|
37
|
+
.then((response) => {
|
|
38
|
+
resolve(response.data);
|
|
39
|
+
})
|
|
40
|
+
.catch((error) => {
|
|
41
|
+
reject(error);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
};
|
|
21
45
|
/**
|
|
22
46
|
* Mark notifications as open or viewed
|
|
23
47
|
* @param {Array<String>} ids The id of the notifications to be marked
|
|
@@ -64,4 +88,84 @@ export const processNotification = (id, action, comments, authToken) => {
|
|
|
64
88
|
});
|
|
65
89
|
});
|
|
66
90
|
};
|
|
91
|
+
/** Socket event the backend uses to push a user's full notification list. */
|
|
92
|
+
export const NOTIFICATIONS_LIST_EVENT = "notifications:list";
|
|
93
|
+
// Retry cadence for handshake rejections (socket.io does not auto-reconnect
|
|
94
|
+
// after a middleware error, so the client must re-dial itself — with a fresh
|
|
95
|
+
// token, since an expired one is the most likely cause).
|
|
96
|
+
const HANDSHAKE_RETRY_BASE_MS = 2000;
|
|
97
|
+
const HANDSHAKE_RETRY_MAX_MS = 60000;
|
|
98
|
+
/**
|
|
99
|
+
* Opens a persistent realtime subscription to the current user's action
|
|
100
|
+
* notifications. Unlike the per-operation sockets in this package, this
|
|
101
|
+
* connection reconnects automatically and stays open for the lifetime of the
|
|
102
|
+
* session.
|
|
103
|
+
*
|
|
104
|
+
* The backend sends the full current notification list (the same shape as
|
|
105
|
+
* `getAllUserNotifications`) on every connect and reconnect, and again
|
|
106
|
+
* whenever the list changes — so the consumer simply replaces its state with
|
|
107
|
+
* each `onList` payload and needs no polling and no merge logic.
|
|
108
|
+
*
|
|
109
|
+
* @param getToken Called before every (re)connect attempt so the handshake
|
|
110
|
+
* always carries a fresh token — pass an accessor that refreshes the
|
|
111
|
+
* short-lived bearer token, never a captured value.
|
|
112
|
+
* @param onList Receives the user's full notification list on every push.
|
|
113
|
+
* @param onConnectionChange Optional; observes socket connectivity so the
|
|
114
|
+
* consumer can fall back to polling while disconnected.
|
|
115
|
+
*/
|
|
116
|
+
export const subscribeToUserNotifications = ({ getToken, onList, onConnectionChange, }) => {
|
|
117
|
+
let closed = false;
|
|
118
|
+
let retryTimer = null;
|
|
119
|
+
let retryDelay = HANDSHAKE_RETRY_BASE_MS;
|
|
120
|
+
const socket = io(getBaseUrl(), {
|
|
121
|
+
// Function form: evaluated on every connection attempt, so reconnects
|
|
122
|
+
// after a token expiry pick up the refreshed token.
|
|
123
|
+
auth: (cb) => {
|
|
124
|
+
Promise.resolve(getToken()).then((token) => cb({ token }));
|
|
125
|
+
},
|
|
126
|
+
path: `/api/v1/realtime`,
|
|
127
|
+
transports: ["websocket"],
|
|
128
|
+
withCredentials: true,
|
|
129
|
+
reconnection: true,
|
|
130
|
+
reconnectionDelay: 1000,
|
|
131
|
+
reconnectionDelayMax: 30000,
|
|
132
|
+
});
|
|
133
|
+
socket.on("connect", () => {
|
|
134
|
+
retryDelay = HANDSHAKE_RETRY_BASE_MS;
|
|
135
|
+
if (onConnectionChange)
|
|
136
|
+
onConnectionChange(true);
|
|
137
|
+
});
|
|
138
|
+
socket.on("disconnect", () => {
|
|
139
|
+
if (onConnectionChange)
|
|
140
|
+
onConnectionChange(false);
|
|
141
|
+
});
|
|
142
|
+
// A handshake rejection (invalid/expired token) closes the socket without
|
|
143
|
+
// automatic reconnection — re-dial with backoff and a fresh token.
|
|
144
|
+
socket.on("connect_error", () => {
|
|
145
|
+
if (onConnectionChange)
|
|
146
|
+
onConnectionChange(false);
|
|
147
|
+
if (closed || socket.active)
|
|
148
|
+
return;
|
|
149
|
+
if (retryTimer)
|
|
150
|
+
clearTimeout(retryTimer);
|
|
151
|
+
retryTimer = setTimeout(() => {
|
|
152
|
+
retryTimer = null;
|
|
153
|
+
if (!closed)
|
|
154
|
+
socket.connect();
|
|
155
|
+
}, retryDelay);
|
|
156
|
+
retryDelay = Math.min(retryDelay * 2, HANDSHAKE_RETRY_MAX_MS);
|
|
157
|
+
});
|
|
158
|
+
socket.on(NOTIFICATIONS_LIST_EVENT, (notifications) => {
|
|
159
|
+
onList(notifications);
|
|
160
|
+
});
|
|
161
|
+
return {
|
|
162
|
+
disconnect: () => {
|
|
163
|
+
closed = true;
|
|
164
|
+
if (retryTimer)
|
|
165
|
+
clearTimeout(retryTimer);
|
|
166
|
+
socket.disconnect();
|
|
167
|
+
},
|
|
168
|
+
socket,
|
|
169
|
+
};
|
|
170
|
+
};
|
|
67
171
|
//# sourceMappingURL=actionNotifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionNotifications.js","sourceRoot":"","sources":["../../../src/lib/actionNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"actionNotifications.js","sourceRoot":"","sources":["../../../src/lib/actionNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,EAAE,EAAe,MAAM,kBAAkB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAa,EAAmB,EAAE;IACxE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,6BAA6B,EAAE;YACxD,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CAAC,CAAC;QACH,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,EAAU,EACV,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;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AC,UAAU,EAAE,CAAC;QACtB,CAAC;QACD,MAAM;KACP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/esm/lib/avatar.js
CHANGED
|
@@ -11,7 +11,7 @@ import { client } from "./axiosClient.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export const getAvatar = (elementId, type, width, height, token, title = "") => {
|
|
13
13
|
return new Promise((resolve, reject) => {
|
|
14
|
-
const confirmationRequest = client.get(`/api/v1/avatar/getavatar/${elementId}/${type}/${width}/${height}${title?.length > 0 ? `/${title}` : ""}`, {
|
|
14
|
+
const confirmationRequest = client.get(`/api/v1/avatar/getavatar/${elementId}/${type}/${width}/${height}${title?.length > 0 ? `/${encodeURIComponent(title)}` : ""}`, {
|
|
15
15
|
headers: {
|
|
16
16
|
authorization: token,
|
|
17
17
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/lib/avatar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,SAAiB,EACjB,IAAY,EACZ,KAAa,EACb,MAAc,EACd,KAAa,EACb,QAAgB,EAAE,EACH,EAAE;IACjB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CACpC,4BAA4B,SAAS,IAAI,IAAI,IAAI,KAAK,IAAI,MAAM,GAAG,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/lib/avatar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,SAAiB,EACjB,IAAY,EACZ,KAAa,EACb,MAAc,EACd,KAAa,EACb,QAAgB,EAAE,EACH,EAAE;IACjB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CACpC,4BAA4B,SAAS,IAAI,IAAI,IAAI,KAAK,IAAI,MAAM,GAAG,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAC7H;YACE,OAAO,EAAE;gBACP,aAAa,EAAE,KAAK;aACrB;YACD,YAAY,EAAE,MAAM;SACrB,CACF,CAAC;QACF,mBAAmB;aAChB,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,MAAM,CAAC,sBAAsB,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/** Create / update payload for a programme's draft. */
|
|
2
|
+
export interface ChannelProgrammeInput {
|
|
3
|
+
name?: string;
|
|
4
|
+
description?: string | null;
|
|
5
|
+
/** What the programme exists to serve, shown to an invitee before accepting. */
|
|
6
|
+
objectives?: string[];
|
|
7
|
+
tiers?: ChannelProgrammeTier[];
|
|
8
|
+
terms?: ChannelProgrammeTerms;
|
|
9
|
+
/** This programme's slice of the vendor's PARTNER_SEATS pool. */
|
|
10
|
+
seatPool?: number;
|
|
11
|
+
/** How long an invitation to this programme stays open, in days. */
|
|
12
|
+
invitationValidityDays?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A tier gates seat allocation and certification requirements — and nothing
|
|
16
|
+
* else. It deliberately does NOT scope content: the programme grants content and
|
|
17
|
+
* every partner in it sees all of it.
|
|
18
|
+
*/
|
|
19
|
+
export interface ChannelProgrammeTier {
|
|
20
|
+
/** Stable machine key, referenced by a partnership's `tier`. */
|
|
21
|
+
key: string;
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string | null;
|
|
24
|
+
defaultSeatAllocation?: number;
|
|
25
|
+
requiredCredentialIds?: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Structured rather than prose, because the partner-facing scorecard has to read
|
|
29
|
+
* it.
|
|
30
|
+
*
|
|
31
|
+
* `version` is managed server-side and moves ONLY when the terms themselves
|
|
32
|
+
* change — adding content to a programme does not invalidate existing
|
|
33
|
+
* acceptances. A partnership's acceptance points at this number.
|
|
34
|
+
*/
|
|
35
|
+
export interface ChannelProgrammeTerms {
|
|
36
|
+
version?: number;
|
|
37
|
+
body?: string;
|
|
38
|
+
completionWindowDays?: number | null;
|
|
39
|
+
minimumCertifiedUsers?: number | null;
|
|
40
|
+
}
|
|
41
|
+
/** Optional filters for the programme listing. */
|
|
42
|
+
export interface ChannelProgrammeListParams {
|
|
43
|
+
/** "draft" | "published" — which version to project display fields from. */
|
|
44
|
+
version?: string;
|
|
45
|
+
includeDeleted?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* List the calling vendor's own channel programmes.
|
|
49
|
+
* POST /api/v1/exceed/channelprogrammes
|
|
50
|
+
* @param {ChannelProgrammeListParams} params Optional version / deleted filters
|
|
51
|
+
* @param {String} authToken Authentication token
|
|
52
|
+
* @returns {Promise<object>}
|
|
53
|
+
*/
|
|
54
|
+
export declare const listChannelProgrammes: (params: ChannelProgrammeListParams, authToken: string) => Promise<object>;
|
|
55
|
+
/**
|
|
56
|
+
* Create a programme, in draft. Nothing is visible to any partner until it is
|
|
57
|
+
* published and a partnership becomes active.
|
|
58
|
+
* PUT /api/v1/exceed/channelprogrammes
|
|
59
|
+
* @param {ChannelProgrammeInput} data Programme data (at minimum `name`)
|
|
60
|
+
* @param {String} authToken Authentication token
|
|
61
|
+
* @returns {Promise<object>}
|
|
62
|
+
*/
|
|
63
|
+
export declare const createChannelProgramme: (data: ChannelProgrammeInput, authToken: string) => Promise<object>;
|
|
64
|
+
/**
|
|
65
|
+
* Read one of the calling vendor's programmes.
|
|
66
|
+
* GET /api/v1/exceed/channelprogrammes/programme/:id/:version
|
|
67
|
+
* @param {String} id Programme id
|
|
68
|
+
* @param {String} version "draft" | "published"
|
|
69
|
+
* @param {String} authToken Authentication token
|
|
70
|
+
* @returns {Promise<object>}
|
|
71
|
+
*/
|
|
72
|
+
export declare const getChannelProgramme: (id: string, version: string, authToken: string) => Promise<object>;
|
|
73
|
+
/**
|
|
74
|
+
* Update a programme's draft.
|
|
75
|
+
* POST /api/v1/exceed/channelprogrammes/update
|
|
76
|
+
* @param {String} id Programme id
|
|
77
|
+
* @param {ChannelProgrammeInput} data Fields to merge into the draft
|
|
78
|
+
* @param {String} authToken Authentication token
|
|
79
|
+
* @returns {Promise<object>}
|
|
80
|
+
*/
|
|
81
|
+
export declare const updateChannelProgramme: (id: string, data: ChannelProgrammeInput, authToken: string) => Promise<object>;
|
|
82
|
+
/**
|
|
83
|
+
* Publish a programme's draft. The only operation that changes what partners can
|
|
84
|
+
* see — content granted or revoked since the last publish takes effect here.
|
|
85
|
+
* POST /api/v1/exceed/channelprogrammes/publish/:id
|
|
86
|
+
* @param {String} id Programme id
|
|
87
|
+
* @param {String} authToken Authentication token
|
|
88
|
+
* @returns {Promise<object>}
|
|
89
|
+
*/
|
|
90
|
+
export declare const publishChannelProgramme: (id: string, authToken: string) => Promise<object>;
|
|
91
|
+
/**
|
|
92
|
+
* Discard draft changes, restoring the draft from the published version.
|
|
93
|
+
* GET /api/v1/exceed/channelprogrammes/discard/:id
|
|
94
|
+
* @param {String} id Programme id
|
|
95
|
+
* @param {String} authToken Authentication token
|
|
96
|
+
* @returns {Promise<object>}
|
|
97
|
+
*/
|
|
98
|
+
export declare const discardChannelProgrammeChanges: (id: string, authToken: string) => Promise<object>;
|
|
99
|
+
/**
|
|
100
|
+
* Soft-delete a programme.
|
|
101
|
+
*
|
|
102
|
+
* Does NOT cascade to partnerships: a partnership records that an organization
|
|
103
|
+
* accepted terms on a date, which stays true whether or not the programme still
|
|
104
|
+
* exists. Terminate active partnerships first if that is the intent.
|
|
105
|
+
* DELETE /api/v1/exceed/channelprogrammes
|
|
106
|
+
* @param {String} id Programme id
|
|
107
|
+
* @param {String} authToken Authentication token
|
|
108
|
+
* @returns {Promise<object>}
|
|
109
|
+
*/
|
|
110
|
+
export declare const deleteChannelProgramme: (id: string, authToken: string) => Promise<object>;
|
|
111
|
+
/**
|
|
112
|
+
* Add learning content to a programme's grant.
|
|
113
|
+
*
|
|
114
|
+
* Additive and idempotent — pass what you want added, not the whole list, so two
|
|
115
|
+
* channel managers granting concurrently do not overwrite each other. Takes
|
|
116
|
+
* effect for partners only once the programme is published.
|
|
117
|
+
* POST /api/v1/exceed/channelprogrammes/content/grant
|
|
118
|
+
* @param {String} id Programme id
|
|
119
|
+
* @param {String[]} learningContentIds Content ids to add to the grant
|
|
120
|
+
* @param {String} authToken Authentication token
|
|
121
|
+
* @returns {Promise<object>}
|
|
122
|
+
*/
|
|
123
|
+
export declare const grantLearningContent: (id: string, learningContentIds: string[], authToken: string) => Promise<object>;
|
|
124
|
+
/**
|
|
125
|
+
* Remove learning content from a programme's grant. Takes effect for partners
|
|
126
|
+
* only once the programme is published.
|
|
127
|
+
* POST /api/v1/exceed/channelprogrammes/content/revoke
|
|
128
|
+
* @param {String} id Programme id
|
|
129
|
+
* @param {String[]} learningContentIds Content ids to remove from the grant
|
|
130
|
+
* @param {String} authToken Authentication token
|
|
131
|
+
* @returns {Promise<object>}
|
|
132
|
+
*/
|
|
133
|
+
export declare const revokeLearningContent: (id: string, learningContentIds: string[], authToken: string) => Promise<object>;
|
|
134
|
+
//# sourceMappingURL=channelProgrammes.d.ts.map
|
|
@@ -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AACH,eAAO,MAAM,sBAAsB,GACjC,MAAM,qBAAqB,EAC3B,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,IAAI,MAAM,EACV,SAAS,MAAM,EACf,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAchB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,IAAI,MAAM,EACV,MAAM,qBAAqB,EAC3B,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,IAAI,MAAM,EACV,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GACzC,IAAI,MAAM,EACV,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAchB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,IAAI,MAAM,EACV,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAchB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAC/B,IAAI,MAAM,EACV,oBAAoB,MAAM,EAAE,EAC5B,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,IAAI,MAAM,EACV,oBAAoB,MAAM,EAAE,EAC5B,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { client } from "./axiosClient.js";
|
|
2
|
+
/**
|
|
3
|
+
* List the calling vendor's own channel programmes.
|
|
4
|
+
* POST /api/v1/exceed/channelprogrammes
|
|
5
|
+
* @param {ChannelProgrammeListParams} params Optional version / deleted filters
|
|
6
|
+
* @param {String} authToken Authentication token
|
|
7
|
+
* @returns {Promise<object>}
|
|
8
|
+
*/
|
|
9
|
+
export const listChannelProgrammes = (params, authToken) => {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const request = client.post(`/api/v1/exceed/channelprogrammes`, params, {
|
|
12
|
+
headers: { authorization: authToken },
|
|
13
|
+
});
|
|
14
|
+
request
|
|
15
|
+
.then((response) => {
|
|
16
|
+
resolve(response.data);
|
|
17
|
+
})
|
|
18
|
+
.catch((error) => {
|
|
19
|
+
reject(error);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Create a programme, in draft. Nothing is visible to any partner until it is
|
|
25
|
+
* published and a partnership becomes active.
|
|
26
|
+
* PUT /api/v1/exceed/channelprogrammes
|
|
27
|
+
* @param {ChannelProgrammeInput} data Programme data (at minimum `name`)
|
|
28
|
+
* @param {String} authToken Authentication token
|
|
29
|
+
* @returns {Promise<object>}
|
|
30
|
+
*/
|
|
31
|
+
export const createChannelProgramme = (data, authToken) => {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
const request = client.put(`/api/v1/exceed/channelprogrammes`, { data }, { headers: { authorization: authToken } });
|
|
34
|
+
request
|
|
35
|
+
.then((response) => {
|
|
36
|
+
resolve(response.data);
|
|
37
|
+
})
|
|
38
|
+
.catch((error) => {
|
|
39
|
+
reject(error);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Read one of the calling vendor's programmes.
|
|
45
|
+
* GET /api/v1/exceed/channelprogrammes/programme/:id/:version
|
|
46
|
+
* @param {String} id Programme id
|
|
47
|
+
* @param {String} version "draft" | "published"
|
|
48
|
+
* @param {String} authToken Authentication token
|
|
49
|
+
* @returns {Promise<object>}
|
|
50
|
+
*/
|
|
51
|
+
export const getChannelProgramme = (id, version, authToken) => {
|
|
52
|
+
return new Promise((resolve, reject) => {
|
|
53
|
+
const request = client.get(`/api/v1/exceed/channelprogrammes/programme/${id}/${version}`, { headers: { authorization: authToken } });
|
|
54
|
+
request
|
|
55
|
+
.then((response) => {
|
|
56
|
+
resolve(response.data);
|
|
57
|
+
})
|
|
58
|
+
.catch((error) => {
|
|
59
|
+
reject(error);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Update a programme's draft.
|
|
65
|
+
* POST /api/v1/exceed/channelprogrammes/update
|
|
66
|
+
* @param {String} id Programme id
|
|
67
|
+
* @param {ChannelProgrammeInput} data Fields to merge into the draft
|
|
68
|
+
* @param {String} authToken Authentication token
|
|
69
|
+
* @returns {Promise<object>}
|
|
70
|
+
*/
|
|
71
|
+
export const updateChannelProgramme = (id, data, authToken) => {
|
|
72
|
+
return new Promise((resolve, reject) => {
|
|
73
|
+
const request = client.post(`/api/v1/exceed/channelprogrammes/update`, { id, data }, { headers: { authorization: authToken } });
|
|
74
|
+
request
|
|
75
|
+
.then((response) => {
|
|
76
|
+
resolve(response.data);
|
|
77
|
+
})
|
|
78
|
+
.catch((error) => {
|
|
79
|
+
reject(error);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Publish a programme's draft. The only operation that changes what partners can
|
|
85
|
+
* see — content granted or revoked since the last publish takes effect here.
|
|
86
|
+
* POST /api/v1/exceed/channelprogrammes/publish/:id
|
|
87
|
+
* @param {String} id Programme id
|
|
88
|
+
* @param {String} authToken Authentication token
|
|
89
|
+
* @returns {Promise<object>}
|
|
90
|
+
*/
|
|
91
|
+
export const publishChannelProgramme = (id, authToken) => {
|
|
92
|
+
return new Promise((resolve, reject) => {
|
|
93
|
+
const request = client.post(`/api/v1/exceed/channelprogrammes/publish/${id}`, {}, { headers: { authorization: authToken } });
|
|
94
|
+
request
|
|
95
|
+
.then((response) => {
|
|
96
|
+
resolve(response.data);
|
|
97
|
+
})
|
|
98
|
+
.catch((error) => {
|
|
99
|
+
reject(error);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Discard draft changes, restoring the draft from the published version.
|
|
105
|
+
* GET /api/v1/exceed/channelprogrammes/discard/:id
|
|
106
|
+
* @param {String} id Programme id
|
|
107
|
+
* @param {String} authToken Authentication token
|
|
108
|
+
* @returns {Promise<object>}
|
|
109
|
+
*/
|
|
110
|
+
export const discardChannelProgrammeChanges = (id, authToken) => {
|
|
111
|
+
return new Promise((resolve, reject) => {
|
|
112
|
+
const request = client.get(`/api/v1/exceed/channelprogrammes/discard/${id}`, { headers: { authorization: authToken } });
|
|
113
|
+
request
|
|
114
|
+
.then((response) => {
|
|
115
|
+
resolve(response.data);
|
|
116
|
+
})
|
|
117
|
+
.catch((error) => {
|
|
118
|
+
reject(error);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Soft-delete a programme.
|
|
124
|
+
*
|
|
125
|
+
* Does NOT cascade to partnerships: a partnership records that an organization
|
|
126
|
+
* accepted terms on a date, which stays true whether or not the programme still
|
|
127
|
+
* exists. Terminate active partnerships first if that is the intent.
|
|
128
|
+
* DELETE /api/v1/exceed/channelprogrammes
|
|
129
|
+
* @param {String} id Programme id
|
|
130
|
+
* @param {String} authToken Authentication token
|
|
131
|
+
* @returns {Promise<object>}
|
|
132
|
+
*/
|
|
133
|
+
export const deleteChannelProgramme = (id, authToken) => {
|
|
134
|
+
return new Promise((resolve, reject) => {
|
|
135
|
+
const request = client.delete(`/api/v1/exceed/channelprogrammes`, {
|
|
136
|
+
headers: { authorization: authToken },
|
|
137
|
+
data: { id },
|
|
138
|
+
});
|
|
139
|
+
request
|
|
140
|
+
.then((response) => {
|
|
141
|
+
resolve(response.data);
|
|
142
|
+
})
|
|
143
|
+
.catch((error) => {
|
|
144
|
+
reject(error);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Add learning content to a programme's grant.
|
|
150
|
+
*
|
|
151
|
+
* Additive and idempotent — pass what you want added, not the whole list, so two
|
|
152
|
+
* channel managers granting concurrently do not overwrite each other. Takes
|
|
153
|
+
* effect for partners only once the programme is published.
|
|
154
|
+
* POST /api/v1/exceed/channelprogrammes/content/grant
|
|
155
|
+
* @param {String} id Programme id
|
|
156
|
+
* @param {String[]} learningContentIds Content ids to add to the grant
|
|
157
|
+
* @param {String} authToken Authentication token
|
|
158
|
+
* @returns {Promise<object>}
|
|
159
|
+
*/
|
|
160
|
+
export const grantLearningContent = (id, learningContentIds, authToken) => {
|
|
161
|
+
return new Promise((resolve, reject) => {
|
|
162
|
+
const request = client.post(`/api/v1/exceed/channelprogrammes/content/grant`, { id, learningContentIds }, { headers: { authorization: authToken } });
|
|
163
|
+
request
|
|
164
|
+
.then((response) => {
|
|
165
|
+
resolve(response.data);
|
|
166
|
+
})
|
|
167
|
+
.catch((error) => {
|
|
168
|
+
reject(error);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Remove learning content from a programme's grant. Takes effect for partners
|
|
174
|
+
* only once the programme is published.
|
|
175
|
+
* POST /api/v1/exceed/channelprogrammes/content/revoke
|
|
176
|
+
* @param {String} id Programme id
|
|
177
|
+
* @param {String[]} learningContentIds Content ids to remove from the grant
|
|
178
|
+
* @param {String} authToken Authentication token
|
|
179
|
+
* @returns {Promise<object>}
|
|
180
|
+
*/
|
|
181
|
+
export const revokeLearningContent = (id, learningContentIds, authToken) => {
|
|
182
|
+
return new Promise((resolve, reject) => {
|
|
183
|
+
const request = client.post(`/api/v1/exceed/channelprogrammes/content/revoke`, { id, learningContentIds }, { headers: { authorization: authToken } });
|
|
184
|
+
request
|
|
185
|
+
.then((response) => {
|
|
186
|
+
resolve(response.data);
|
|
187
|
+
})
|
|
188
|
+
.catch((error) => {
|
|
189
|
+
reject(error);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=channelProgrammes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channelProgrammes.js","sourceRoot":"","sources":["../../../src/lib/channelProgrammes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAwE1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,MAAkC,EAClC,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,MAAM,EAAE;YACtE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE;SACtC,CAAC,CAAC;QACH,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,IAA2B,EAC3B,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CACxB,kCAAkC,EAClC,EAAE,IAAI,EAAE,EACR,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAA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M,qBAAqB,GAAG,CACnC,EAAU,EACV,kBAA4B,EAC5B,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CACzB,iDAAiD,EACjD,EAAE,EAAE,EAAE,kBAAkB,EAAE,EAC1B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -78,6 +78,31 @@ export declare const updateIncidentSettings: (settings: object, token: string) =
|
|
|
78
78
|
* @returns {Promise<object>} `{ incidentId, humanId, deduplicated }`
|
|
79
79
|
*/
|
|
80
80
|
export declare const createIncident: (event: object, token: string) => Promise<object>;
|
|
81
|
+
/**
|
|
82
|
+
* File an incident as an integration's webhook handler.
|
|
83
|
+
*
|
|
84
|
+
* For agent code, not the browser. A provider's webhook lands on the platform's
|
|
85
|
+
* `/webhooks/...` receiver, the connector's handler maps that payload onto the
|
|
86
|
+
* normalized event contract, and this is where it puts the result.
|
|
87
|
+
*
|
|
88
|
+
* Authenticated by the API token the delivery itself was authenticated with —
|
|
89
|
+
* `request.authToken` inside a handler — which already carries the System -
|
|
90
|
+
* Dispatch Events permission. There is no separate intake credential to
|
|
91
|
+
* provision or rotate for this path.
|
|
92
|
+
*
|
|
93
|
+
* `integrationId` is required and should come from `params.data.integration._id`.
|
|
94
|
+
* It attributes the incident to the connector that filed it; it is self-asserted
|
|
95
|
+
* (the token names a user, never an integration) and is checked against the
|
|
96
|
+
* tenant's enabled integrations, so treat it as a correlation label rather than
|
|
97
|
+
* as proof of origin.
|
|
98
|
+
*
|
|
99
|
+
* Resolves on `202` — durably stored, with triage enrichment and remediation
|
|
100
|
+
* dispatch still to run.
|
|
101
|
+
* @param {Object} event `{ integrationId, source, title, occurred_at, ... }`
|
|
102
|
+
* @param {String} token Authorization token; a handler's `request.authToken`
|
|
103
|
+
* @returns {Promise<object>} `{ incidentId, humanId, deduplicated }`
|
|
104
|
+
*/
|
|
105
|
+
export declare const ingestIncident: (event: object, token: string) => Promise<object>;
|
|
81
106
|
/**
|
|
82
107
|
* Edit whitelisted fields. Status and severity are deliberately not among them:
|
|
83
108
|
* they move through `transitionIncident` and `changeIncidentSeverity`, so neither
|