alicezetion 1.9.4 → 1.9.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,9 +49,9 @@
49
49
  "dev": true
50
50
  },
51
51
  "node_modules/@types/react": {
52
- "version": "18.2.55",
53
- "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz",
54
- "integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==",
52
+ "version": "18.2.57",
53
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.57.tgz",
54
+ "integrity": "sha512-ZvQsktJgSYrQiMirAN60y4O/LRevIV8hUzSOSNB6gfR3/o3wCBFQx3sPwIYtuDMeiVgsSS3UzCV26tEzgnfvQw==",
55
55
  "dev": true,
56
56
  "dependencies": {
57
57
  "@types/prop-types": "*",
@@ -8,7 +8,7 @@ This package contains type definitions for react (https://react.dev/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 06 Feb 2024 09:35:42 GMT
11
+ * Last updated: Mon, 19 Feb 2024 21:35:40 GMT
12
12
  * Dependencies: [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler), [csstype](https://npmjs.com/package/csstype)
13
13
 
14
14
  # Credits
@@ -140,6 +140,7 @@ interface SVGPolygonElement extends SVGElement {}
140
140
  interface SVGPolylineElement extends SVGElement {}
141
141
  interface SVGRadialGradientElement extends SVGElement {}
142
142
  interface SVGRectElement extends SVGElement {}
143
+ interface SVGSetElement extends SVGElement {}
143
144
  interface SVGStopElement extends SVGElement {}
144
145
  interface SVGSwitchElement extends SVGElement {}
145
146
  interface SVGSymbolElement extends SVGElement {}
@@ -3177,10 +3177,72 @@ declare namespace React {
3177
3177
  | "week"
3178
3178
  | (string & {});
3179
3179
 
3180
+ type AutoFillAddressKind = "billing" | "shipping";
3181
+ type AutoFillBase = "" | "off" | "on";
3182
+ type AutoFillContactField =
3183
+ | "email"
3184
+ | "tel"
3185
+ | "tel-area-code"
3186
+ | "tel-country-code"
3187
+ | "tel-extension"
3188
+ | "tel-local"
3189
+ | "tel-local-prefix"
3190
+ | "tel-local-suffix"
3191
+ | "tel-national";
3192
+ type AutoFillContactKind = "home" | "mobile" | "work";
3193
+ type AutoFillCredentialField = "webauthn";
3194
+ type AutoFillNormalField =
3195
+ | "additional-name"
3196
+ | "address-level1"
3197
+ | "address-level2"
3198
+ | "address-level3"
3199
+ | "address-level4"
3200
+ | "address-line1"
3201
+ | "address-line2"
3202
+ | "address-line3"
3203
+ | "bday-day"
3204
+ | "bday-month"
3205
+ | "bday-year"
3206
+ | "cc-csc"
3207
+ | "cc-exp"
3208
+ | "cc-exp-month"
3209
+ | "cc-exp-year"
3210
+ | "cc-family-name"
3211
+ | "cc-given-name"
3212
+ | "cc-name"
3213
+ | "cc-number"
3214
+ | "cc-type"
3215
+ | "country"
3216
+ | "country-name"
3217
+ | "current-password"
3218
+ | "family-name"
3219
+ | "given-name"
3220
+ | "honorific-prefix"
3221
+ | "honorific-suffix"
3222
+ | "name"
3223
+ | "new-password"
3224
+ | "one-time-code"
3225
+ | "organization"
3226
+ | "postal-code"
3227
+ | "street-address"
3228
+ | "transaction-amount"
3229
+ | "transaction-currency"
3230
+ | "username";
3231
+ type OptionalPrefixToken<T extends string> = `${T} ` | "";
3232
+ type OptionalPostfixToken<T extends string> = ` ${T}` | "";
3233
+ type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`;
3234
+ type AutoFillSection = `section-${string}`;
3235
+ type AutoFill =
3236
+ | AutoFillBase
3237
+ | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<
3238
+ AutoFillAddressKind
3239
+ >}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`;
3240
+ type HTMLInputAutoCompleteAttribute = AutoFill | (string & {});
3241
+
3180
3242
  interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
3181
3243
  accept?: string | undefined;
3182
3244
  alt?: string | undefined;
3183
- autoComplete?: string | undefined;
3245
+ autoComplete?: HTMLInputAutoCompleteAttribute | undefined;
3184
3246
  capture?: boolean | "user" | "environment" | undefined; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
3185
3247
  checked?: boolean | undefined;
3186
3248
  disabled?: boolean | undefined;
@@ -4322,6 +4384,7 @@ declare global {
4322
4384
  polyline: React.SVGProps<SVGPolylineElement>;
4323
4385
  radialGradient: React.SVGProps<SVGRadialGradientElement>;
4324
4386
  rect: React.SVGProps<SVGRectElement>;
4387
+ set: React.SVGProps<SVGSetElement>;
4325
4388
  stop: React.SVGProps<SVGStopElement>;
4326
4389
  switch: React.SVGProps<SVGSwitchElement>;
4327
4390
  symbol: React.SVGProps<SVGSymbolElement>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "18.2.55",
3
+ "version": "18.2.57",
4
4
  "description": "TypeScript definitions for react",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -201,6 +201,6 @@
201
201
  "@types/scheduler": "*",
202
202
  "csstype": "^3.0.2"
203
203
  },
204
- "typesPublisherContentHash": "41cc4f9203a010eff4158b37583d535e6867e99253ce9e203f10ddc95a2cdb36",
204
+ "typesPublisherContentHash": "851885a76a4fc913181b30859ae933c9e4649b77039b4882c136df034e4094e8",
205
205
  "typeScriptVersion": "4.6"
206
206
  }
@@ -140,6 +140,7 @@ interface SVGPolygonElement extends SVGElement {}
140
140
  interface SVGPolylineElement extends SVGElement {}
141
141
  interface SVGRadialGradientElement extends SVGElement {}
142
142
  interface SVGRectElement extends SVGElement {}
143
+ interface SVGSetElement extends SVGElement {}
143
144
  interface SVGStopElement extends SVGElement {}
144
145
  interface SVGSwitchElement extends SVGElement {}
145
146
  interface SVGSymbolElement extends SVGElement {}
@@ -3175,10 +3175,72 @@ declare namespace React {
3175
3175
  | "week"
3176
3176
  | (string & {});
3177
3177
 
3178
+ type AutoFillAddressKind = "billing" | "shipping";
3179
+ type AutoFillBase = "" | "off" | "on";
3180
+ type AutoFillContactField =
3181
+ | "email"
3182
+ | "tel"
3183
+ | "tel-area-code"
3184
+ | "tel-country-code"
3185
+ | "tel-extension"
3186
+ | "tel-local"
3187
+ | "tel-local-prefix"
3188
+ | "tel-local-suffix"
3189
+ | "tel-national";
3190
+ type AutoFillContactKind = "home" | "mobile" | "work";
3191
+ type AutoFillCredentialField = "webauthn";
3192
+ type AutoFillNormalField =
3193
+ | "additional-name"
3194
+ | "address-level1"
3195
+ | "address-level2"
3196
+ | "address-level3"
3197
+ | "address-level4"
3198
+ | "address-line1"
3199
+ | "address-line2"
3200
+ | "address-line3"
3201
+ | "bday-day"
3202
+ | "bday-month"
3203
+ | "bday-year"
3204
+ | "cc-csc"
3205
+ | "cc-exp"
3206
+ | "cc-exp-month"
3207
+ | "cc-exp-year"
3208
+ | "cc-family-name"
3209
+ | "cc-given-name"
3210
+ | "cc-name"
3211
+ | "cc-number"
3212
+ | "cc-type"
3213
+ | "country"
3214
+ | "country-name"
3215
+ | "current-password"
3216
+ | "family-name"
3217
+ | "given-name"
3218
+ | "honorific-prefix"
3219
+ | "honorific-suffix"
3220
+ | "name"
3221
+ | "new-password"
3222
+ | "one-time-code"
3223
+ | "organization"
3224
+ | "postal-code"
3225
+ | "street-address"
3226
+ | "transaction-amount"
3227
+ | "transaction-currency"
3228
+ | "username";
3229
+ type OptionalPrefixToken<T extends string> = `${T} ` | "";
3230
+ type OptionalPostfixToken<T extends string> = ` ${T}` | "";
3231
+ type AutoFillField = AutoFillNormalField | `${OptionalPrefixToken<AutoFillContactKind>}${AutoFillContactField}`;
3232
+ type AutoFillSection = `section-${string}`;
3233
+ type AutoFill =
3234
+ | AutoFillBase
3235
+ | `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<
3236
+ AutoFillAddressKind
3237
+ >}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`;
3238
+ type HTMLInputAutoCompleteAttribute = AutoFill | (string & {});
3239
+
3178
3240
  interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
3179
3241
  accept?: string | undefined;
3180
3242
  alt?: string | undefined;
3181
- autoComplete?: string | undefined;
3243
+ autoComplete?: HTMLInputAutoCompleteAttribute | undefined;
3182
3244
  capture?: boolean | "user" | "environment" | undefined; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
3183
3245
  checked?: boolean | undefined;
3184
3246
  disabled?: boolean | undefined;
@@ -4305,6 +4367,7 @@ declare global {
4305
4367
  polyline: React.SVGProps<SVGPolylineElement>;
4306
4368
  radialGradient: React.SVGProps<SVGRadialGradientElement>;
4307
4369
  rect: React.SVGProps<SVGRectElement>;
4370
+ set: React.SVGProps<SVGSetElement>;
4308
4371
  stop: React.SVGProps<SVGStopElement>;
4309
4372
  switch: React.SVGProps<SVGSwitchElement>;
4310
4373
  symbol: React.SVGProps<SVGSymbolElement>;
@@ -12,7 +12,7 @@
12
12
  "@types/cheerio": "^0.22.35",
13
13
  "@types/node": "^20.11.16",
14
14
  "@types/npmlog": "^7.0.0",
15
- "@types/react": "^18.2.55",
15
+ "@types/react": "^18.2.57",
16
16
  "@types/request": "^2.48.12"
17
17
  }
18
18
  },
@@ -62,9 +62,9 @@
62
62
  "dev": true
63
63
  },
64
64
  "node_modules/@types/react": {
65
- "version": "18.2.55",
66
- "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz",
67
- "integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==",
65
+ "version": "18.2.57",
66
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.57.tgz",
67
+ "integrity": "sha512-ZvQsktJgSYrQiMirAN60y4O/LRevIV8hUzSOSNB6gfR3/o3wCBFQx3sPwIYtuDMeiVgsSS3UzCV26tEzgnfvQw==",
68
68
  "dev": true,
69
69
  "dependencies": {
70
70
  "@types/prop-types": "*",
@@ -1 +1 @@
1
- {"private":true,"dependencies":{"types-registry":"^0.1.684"},"devDependencies":{"@types/bluebird":"^3.5.42","@types/cheerio":"^0.22.35","@types/node":"^20.11.16","@types/npmlog":"^7.0.0","@types/react":"^18.2.55","@types/request":"^2.48.12"}}
1
+ {"private":true,"dependencies":{"types-registry":"^0.1.684"},"devDependencies":{"@types/bluebird":"^3.5.42","@types/cheerio":"^0.22.35","@types/node":"^20.11.16","@types/npmlog":"^7.0.0","@types/react":"^18.2.57","@types/request":"^2.48.12"}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alicezetion",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "start": "node index.js"
package/src/react.js CHANGED
@@ -1,25 +1,10 @@
1
- /**
2
- * @fix by NTKhang
3
- * update as Thursday, 10 February 2022
4
- * do not remove the author name to get more updates
5
- */
6
-
7
1
  "use strict";
8
2
 
9
3
  const utils = require("../utils");
10
4
  const log = require("npmlog");
11
5
 
12
- function formatData(resData) {
13
- return {
14
- viewer_feedback_reaction_info: resData.feedback_react.feedback.viewer_feedback_reaction_info,
15
- supported_reactions: resData.feedback_react.feedback.supported_reactions,
16
- top_reactions: resData.feedback_react.feedback.top_reactions.edges,
17
- reaction_count: resData.feedback_react.feedback.reaction_count
18
- };
19
- }
20
-
21
6
  module.exports = function (defaultFuncs, api, ctx) {
22
- return function setPostReaction(postID, type, callback) {
7
+ return function setMessageReaction(reaction, messageID, callback, forceCustomReaction) {
23
8
  let resolveFunc = function () { };
24
9
  let rejectFunc = function () { };
25
10
  const returnPromise = new Promise(function (resolve, reject) {
@@ -28,82 +13,109 @@ module.exports = function (defaultFuncs, api, ctx) {
28
13
  });
29
14
 
30
15
  if (!callback) {
31
- if (utils.getType(type) === "Function" || utils.getType(type) === "AsyncFunction") {
32
- callback = type;
33
- type = 0;
34
- }
35
- else {
36
- callback = function (err, data) {
37
- if (err) {
38
- return rejectFunc(err);
39
- }
40
- resolveFunc(data);
41
- };
42
- }
16
+ callback = function (err, friendList) {
17
+ if (err) {
18
+ return rejectFunc(err);
19
+ }
20
+ resolveFunc(friendList);
21
+ };
43
22
  }
44
23
 
45
- const map = {
46
- unlike: 0,
47
- like: 1,
48
- heart: 2,
49
- love: 16,
50
- haha: 4,
51
- wow: 3,
52
- sad: 7,
53
- angry: 8
54
- };
55
-
56
- if (utils.getType(type) !== "Number" && utils.getType(type) === "String") {
57
- type = map[type.toLowerCase()];
24
+ if (ctx.i_userID) {
25
+ throw { error: "Cannot set reaction as another profile." };
58
26
  }
59
27
 
60
- if (utils.getType(type) !== "Number" && utils.getType(type) !== "String") {
61
- throw {
62
- error: "setPostReaction: Invalid reaction type"
63
- };
28
+ switch (reaction) {
29
+ case "\uD83D\uDE0D": //:heart_eyes:
30
+ case "\uD83D\uDE06": //:laughing:
31
+ case "\uD83D\uDE2E": //:open_mouth:
32
+ case "\uD83D\uDE22": //:cry:
33
+ case "\uD83D\uDE20": //:angry:
34
+ case "\uD83D\uDC4D": //:thumbsup:
35
+ case "\uD83D\uDC4E": //:thumbsdown:
36
+ case "\u2764": //:heart:
37
+ case "\uD83D\uDC97": //:glowingheart:
38
+ case "":
39
+ //valid
40
+ break;
41
+ case ":heart_eyes:":
42
+ case ":love:":
43
+ reaction = "\uD83D\uDE0D";
44
+ break;
45
+ case ":laughing:":
46
+ case ":haha:":
47
+ reaction = "\uD83D\uDE06";
48
+ break;
49
+ case ":open_mouth:":
50
+ case ":wow:":
51
+ reaction = "\uD83D\uDE2E";
52
+ break;
53
+ case ":cry:":
54
+ case ":sad:":
55
+ reaction = "\uD83D\uDE22";
56
+ break;
57
+ case ":angry:":
58
+ reaction = "\uD83D\uDE20";
59
+ break;
60
+ case ":thumbsup:":
61
+ case ":like:":
62
+ reaction = "\uD83D\uDC4D";
63
+ break;
64
+ case ":thumbsdown:":
65
+ case ":dislike:":
66
+ reaction = "\uD83D\uDC4E";
67
+ break;
68
+ case ":heart:":
69
+ reaction = "\u2764";
70
+ break;
71
+ case ":glowingheart:":
72
+ reaction = "\uD83D\uDC97";
73
+ break;
74
+ default:
75
+ if (forceCustomReaction) {
76
+ break;
77
+ }
78
+ return callback({ error: "Reaction is not a valid emoji." });
64
79
  }
65
80
 
66
- if (type != 0 && !type) {
67
- throw {
68
- error: "setPostReaction: Invalid reaction type"
69
- };
70
- }
81
+ const variables = {
82
+ data: {
83
+ client_mutation_id: ctx.clientMutationId++,
84
+ actor_id: ctx.i_userID || ctx.userID,
85
+ action: reaction == "" ? "REMOVE_REACTION" : "ADD_REACTION",
86
+ message_id: messageID,
87
+ reaction: reaction
88
+ }
89
+ };
71
90
 
72
- const form = {
73
- av: ctx.i_userID || ctx.userID,
74
- fb_api_caller_class: "RelayModern",
75
- fb_api_req_friendly_name: "CometUFIFeedbackReactMutation",
76
- doc_id: "4769042373179384",
77
- variables: JSON.stringify({
78
- input: {
79
- actor_id: ctx.i_userID || ctx.userID,
80
- feedback_id: (new Buffer("feedback:" + postID)).toString("base64"),
81
- feedback_reaction: type,
82
- feedback_source: "OBJECT",
83
- is_tracking_encrypted: true,
84
- tracking: [],
85
- session_id: "f7dd50dd-db6e-4598-8cd9-561d5002b423",
86
- client_mutation_id: Math.round(Math.random() * 19).toString()
87
- },
88
- useDefaultActor: false,
89
- scale: 3
90
- })
91
+ const qs = {
92
+ doc_id: "1491398900900362",
93
+ variables: JSON.stringify(variables),
94
+ dpr: 1
91
95
  };
92
96
 
93
97
  defaultFuncs
94
- .post("https://www.facebook.com/api/graphql/", ctx.jar, form)
95
- .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
98
+ .postFormData(
99
+ "https://www.facebook.com/webgraphql/mutation/",
100
+ ctx.jar,
101
+ {},
102
+ qs
103
+ )
104
+ .then(utils.parseAndCheckLogin(ctx.jar, defaultFuncs))
96
105
  .then(function (resData) {
97
- if (resData.errors) {
106
+ if (!resData) {
107
+ throw { error: "setReaction returned empty object." };
108
+ }
109
+ if (resData.error || resData.errors) {
98
110
  throw resData;
99
111
  }
100
- return callback(null, formatData(resData.data));
112
+ callback(null);
101
113
  })
102
114
  .catch(function (err) {
103
- log.error("setPostReaction", err);
115
+ log.error("setReaction", err);
104
116
  return callback(err);
105
117
  });
106
118
 
107
119
  return returnPromise;
108
120
  };
109
- };
121
+ };