@dawntech/dwntbots-services 0.0.77 → 0.0.79
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/package.json
CHANGED
package/src/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/services/src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+DAA6C;AAC7C,6DAA2C;AAC3C,gEAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/services/src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+DAA6C;AAC7C,6DAA2C;AAC3C,gEAA8C;AAC9C,kDAAgC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
/* The script will generate a public and private key pair and log the same in the console.
|
|
10
|
+
* Copy paste the private key into your /.env file and public key should be added to your account.
|
|
11
|
+
* For more details visit: https://developers.facebook.com/docs/whatsapp/flows/guides/implementingyourflowendpoint#upload_public_key
|
|
12
|
+
*
|
|
13
|
+
* Run this script using command below:
|
|
14
|
+
*
|
|
15
|
+
* node src/keyGenerator.js {passphrase}
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
const crypto_1 = require("crypto");
|
|
19
|
+
const passphrase = process.argv[2];
|
|
20
|
+
if (!passphrase) {
|
|
21
|
+
throw new Error("Passphrase is empty. Please include passphrase argument to generate the keys like: node src/keyGenerator.js {passphrase}");
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const keyPair = (0, crypto_1.generateKeyPairSync)("rsa", {
|
|
25
|
+
modulusLength: 2048,
|
|
26
|
+
publicKeyEncoding: {
|
|
27
|
+
type: "spki",
|
|
28
|
+
format: "pem",
|
|
29
|
+
},
|
|
30
|
+
privateKeyEncoding: {
|
|
31
|
+
type: "pkcs1",
|
|
32
|
+
format: "pem",
|
|
33
|
+
cipher: "des-ede3-cbc",
|
|
34
|
+
passphrase,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
console.log(`Successfully created your public private key pair. Please copy the below values into your /.env file
|
|
38
|
+
************* COPY PASSPHRASE & PRIVATE KEY BELOW TO .env FILE *************
|
|
39
|
+
PASSPHRASE="${passphrase}"
|
|
40
|
+
|
|
41
|
+
PRIVATE_KEY="${keyPair.privateKey}"
|
|
42
|
+
************* COPY PASSPHRASE & PRIVATE KEY ABOVE TO .env FILE *************
|
|
43
|
+
|
|
44
|
+
************* COPY PUBLIC KEY BELOW *************
|
|
45
|
+
${keyPair.publicKey}
|
|
46
|
+
************* COPY PUBLIC KEY ABOVE *************
|
|
47
|
+
`);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
console.error("Error while creating public private key pair:", err);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../libs/services/src/lib/whatsapp-flow/generator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH;;;;;;;;GAQG;AAEH,mCAA6C;AAE7C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnC,IAAI,CAAC,UAAU,EAAE;IAChB,MAAM,IAAI,KAAK,CACd,0HAA0H,CAC1H,CAAC;CACF;AAED,IAAI;IACH,MAAM,OAAO,GAAG,IAAA,4BAAmB,EAAC,KAAK,EAAE;QAC1C,aAAa,EAAE,IAAI;QACnB,iBAAiB,EAAE;YAClB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,KAAK;SACb;QACD,kBAAkB,EAAE;YACnB,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,cAAc;YACtB,UAAU;SACV;KACD,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC;;cAEC,UAAU;;eAET,OAAO,CAAC,UAAU;;;;EAI/B,OAAO,CAAC,SAAS;;CAElB,CAAC,CAAC;CACF;AAAC,OAAO,GAAG,EAAE;IACb,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,GAAG,CAAC,CAAC;CACpE"}
|