Avatar

cescyang_service

4 public vals
Joined August 2, 2023
1
2
3
4
import _ from "npm:lodash-es";
let numbers = _.range(10);
console.log(numbers.map(n => n * 2));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { rule } from "https://esm.town/v/cescyang_service/rule";
import { email } from "https://esm.town/v/std/email?v=9";
import { fetch } from "https://esm.town/v/std/fetch";
export async function checkAndroidBingApps() {
const { default: axios } = await import("npm:axios");
const url =
"https://sapphire.api.microsoftapp.net/config/api/v1/get?setmkt=en-us&setplatform=android&setchannel=production&settenant=sapphire-bing";
try {
const response = await fetch(url, {
method: "GET",
});
const data = await response.json();
console.log(data);
const validateData = rule(data);
if (!validateData?.validate) {
email({
text: "ios config missing\n" + validateData.difference,
subject: "ios config missing\n" + validateData.difference,
});
}
}
catch (error) {
console.error("Error:", error);
return "Error occurred while accessing the URL , " + error.message;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { rule } from "https://esm.town/v/cescyang_service/rule";
import { email } from "https://esm.town/v/std/email?v=9";
import { fetch } from "https://esm.town/v/std/fetch";
export async function checkAndroidBingApps() {
const { default: axios } = await import("npm:axios");
const url =
"https://sapphire.api.microsoftapp.net/config/api/v1/get?setmkt=en-us&setplatform=android&setchannel=production&settenant=sapphire-bing";
try {
const response = await fetch(url, {
method: "GET",
});
const data = await response.json();
console.log(data);
const validateData = rule(data);
if (!validateData?.validate) {
email({
text: "android config missing\n" + validateData.difference,
subject: "android config missing\n" + validateData.difference,
});
}
}
catch (error) {
console.error("Error:", error);
return "Error occurred while accessing the URL , " + error.message;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
export function rule(response) {
const requiredApps = [
"55a54008ad1ba589aa210d2629c1df41",
"94b3bfd329374b9fb288f72cfcdcd4da",
"9ddc1d1392af462895f23c9aa7a64de1",
"30055ae3c14f46c38f11df1833a51893",
// "da65c5be95db4c09a68627e81a44d63c", // Scaffolding
"1876cd4464a749dbab0acfd57d797f90",
"15e54d64b8de45b1b869d012ba346c2f",
"6631176c87a24532b1a109205aec5e51",
"604b26fcabd84382be12777eddb538bf",
"0067acd6d05f4168b92f510d33b9ed74",
"32649384730b2d61c9e79d46de589115",
"c58cea7ef6e89ca39f9401edb12d241d",
"a9dbd9f32ca0f65d3132adac27137447",
// "a2db74d5666f462b8bf0df5ccd6a4fcf", // Sydney
// "6dc7564de7424d4698716df1b6d86867", // SydneyChat
"707225db60754189939e45b17b59ca13",
"559c57a353f445d6b7796d0d8c4932d9",
"d907c956035445239a134ad443f27294",
"90e07f90f13244d0ba8648db61bb198b",
"3539b7a134684b88addd55262f04d96b",
// "4fb480cc8d0746ebb7bc2ef6bc6f172a", // InAppBrowser
"5f9c29b288ec4c638677796251e04420", // Accounts
];
const apps = response.data.apps;
const appIds = apps.map((it) => it.appId);
const validate =
requiredApps.filter((appId) => appIds.includes(appId)).length ===
requiredApps.length;
const difference = requiredApps.filter((appId) => !appIds.includes(appId));
return {
validate: validate,
difference: difference,
};
}
Next