@configura/web-api 1.6.0-iotest.1 → 1.6.0-iotest.2
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.
|
@@ -7,7 +7,8 @@ export declare type CfgProdConfMessage = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const STAGE_PROD_CONF_MESSAGE_KEY = "stageProdConf";
|
|
9
9
|
export declare const STAGE_PROD_CONF_MESSAGE_VERSION = "1.0";
|
|
10
|
-
|
|
10
|
+
declare type ProdConfMessageCallback = (message: CfgProdConfMessage) => Promise<void>;
|
|
11
|
+
declare type ProdConfStringCallback = (prodConfAsString: string) => Promise<void>;
|
|
11
12
|
export declare abstract class CfgIOProdConfConnector<K extends keyof WindowEventMap, S, M extends CfgIOManager<K, S>> {
|
|
12
13
|
protected readonly _ioManager: M;
|
|
13
14
|
protected readonly _doValidate: boolean;
|
|
@@ -19,13 +20,14 @@ export declare abstract class CfgIOProdConfConnector<K extends keyof WindowEvent
|
|
|
19
20
|
protected abstract getInitialProdConf(): string | undefined;
|
|
20
21
|
protected abstract makeSendData(prodConfAsString: string, initial: boolean): S;
|
|
21
22
|
makeMessage(prodConfAsString: string, initial: boolean): CfgProdConfMessage;
|
|
22
|
-
makeMessageListener(callback:
|
|
23
|
+
makeMessageListener(callback: ProdConfMessageCallback): (message: unknown) => Promise<void>;
|
|
23
24
|
/**
|
|
24
25
|
* Register the callback to listen for Product Configuration messages
|
|
25
26
|
* @returns A function which when called will cancel listening
|
|
26
27
|
*/
|
|
27
|
-
listenForMessage(callback:
|
|
28
|
-
makeProdConfListener(callback:
|
|
29
|
-
listenForProdConf(product: CfgProduct, callback:
|
|
28
|
+
listenForMessage(callback: ProdConfMessageCallback): () => void;
|
|
29
|
+
makeProdConfListener(callback: ProdConfStringCallback): (n: CfgProductChangeNotification) => void;
|
|
30
|
+
listenForProdConf(product: CfgProduct, callback: ProdConfStringCallback): () => void;
|
|
30
31
|
}
|
|
32
|
+
export {};
|
|
31
33
|
//# sourceMappingURL=CfgIOProdConfConnector.d.ts.map
|
|
@@ -40,7 +40,8 @@ export class CfgIOProdConfConnector {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
this._ioManager.send(STAGE_PROD_CONF_MESSAGE_KEY, this.makeSendData(newProduct.getApiSelectionAsString(), true));
|
|
43
|
-
this._stopListenToMessage = this.listenForMessage((
|
|
43
|
+
this._stopListenToMessage = this.listenForMessage((message) => __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const prodConfAsString = message.prodConfAsString;
|
|
44
45
|
if (prodConfAsString === newProduct.getApiSelectionAsString()) {
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
@@ -60,12 +61,13 @@ export class CfgIOProdConfConnector {
|
|
|
60
61
|
}
|
|
61
62
|
makeMessageListener(callback) {
|
|
62
63
|
return (message) => __awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
const
|
|
64
|
+
const prodConfMessage = message;
|
|
65
|
+
const version = prodConfMessage.version;
|
|
64
66
|
if (version !== "1.0") {
|
|
65
67
|
console.error(`The a message was passed with an unsupported version "${version}". Currently only ${STAGE_PROD_CONF_MESSAGE_VERSION} is supported.`);
|
|
66
68
|
return;
|
|
67
69
|
}
|
|
68
|
-
yield callback(
|
|
70
|
+
yield callback(prodConfMessage);
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
73
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configura/web-api",
|
|
3
|
-
"version": "1.6.0-iotest.
|
|
3
|
+
"version": "1.6.0-iotest.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@configura/web-utilities": "1.6.0-iotest.
|
|
26
|
+
"@configura/web-utilities": "1.6.0-iotest.2"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "c03efb8cfe9fb28a83aaa19bbac09a30a7032e01"
|
|
29
29
|
}
|