Skip to content

Commit

Permalink
Merge pull request #619 from BlueBubblesApp/development
Browse files Browse the repository at this point in the history
v1.9.5
  • Loading branch information
zlshames authored Feb 8, 2024
2 parents 4a36b7d + 7f2a407 commit 7c33356
Show file tree
Hide file tree
Showing 55 changed files with 682 additions and 366 deletions.
10 changes: 10 additions & 0 deletions macos/database/samples/big-sur/CallHistoryDB/ZCALLDBPROPERTIES.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE ZCALLDBPROPERTIES (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZTIMER_ALL FLOAT,
ZTIMER_INCOMING FLOAT,
ZTIMER_LAST FLOAT,
ZTIMER_LIFETIME FLOAT,
ZTIMER_OUTGOING FLOAT
)
27 changes: 27 additions & 0 deletions macos/database/samples/big-sur/CallHistoryDB/ZCALLRECORD.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CREATE TABLE ZCALLRECORD (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZANSWERED INTEGER,
ZCALL_CATEGORY INTEGER,
ZCALLTYPE INTEGER,
ZDISCONNECTED_CAUSE INTEGER,
ZFACE_TIME_DATA INTEGER,
ZFILTERED_OUT_REASON INTEGER,
ZHANDLE_TYPE INTEGER,
ZJUNKCONFIDENCE INTEGER,
ZNUMBER_AVAILABILITY INTEGER,
ZORIGINATED INTEGER,
ZREAD INTEGER,
ZVERIFICATIONSTATUS INTEGER,
ZDATE TIMESTAMP,
ZDURATION FLOAT,
ZISO_COUNTRY_CODE VARCHAR,
ZLOCATION VARCHAR,
ZNAME VARCHAR,
ZSERVICE_PROVIDER VARCHAR,
ZUNIQUE_ID VARCHAR,
ZLOCALPARTICIPANTUUID BLOB,
ZOUTGOINGLOCALPARTICIPANTUUID BLOB,
ZADDRESS BLOB
)
8 changes: 8 additions & 0 deletions macos/database/samples/big-sur/CallHistoryDB/ZHANDLE.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE ZHANDLE (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZTYPE INTEGER,
ZNORMALIZEDVALUE VARCHAR,
ZVALUE BLOB
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE Z_2REMOTEPARTICIPANTHANDLES (
Z_2REMOTEPARTICIPANTCALLS INTEGER,
Z_3REMOTEPARTICIPANTHANDLES INTEGER,
PRIMARY KEY (
Z_2REMOTEPARTICIPANTCALLS,
Z_3REMOTEPARTICIPANTHANDLES
)
)
5 changes: 5 additions & 0 deletions macos/database/samples/big-sur/CallHistoryDB/Z_METADATA.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE Z_METADATA (
Z_VERSION INTEGER PRIMARY KEY,
Z_UUID VARCHAR(255),
Z_PLIST BLOB
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TABLE Z_MODELCACHE (Z_CONTENT BLOB)
6 changes: 6 additions & 0 deletions macos/database/samples/big-sur/CallHistoryDB/Z_PRIMARYKEY.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE Z_PRIMARYKEY (
Z_ENT INTEGER PRIMARY KEY,
Z_NAME VARCHAR,
Z_SUPER INTEGER,
Z_MAX INTEGER
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bluebubbles-server",
"version": "1.9.4",
"version": "1.9.5",
"description": "BlueBubbles Server is the app that powers the BlueBubbles app ecosystem",
"private": true,
"workspaces": [
Expand Down
Binary file modified packages/server/appResources/private-api/macos11/BlueBubblesHelper.dylib
100755 → 100644
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7c5f6f04d0d178ffbf2a1ce623b65370
49d31742bc468cb5287413a7c0cf13c7
2 changes: 1 addition & 1 deletion packages/server/appResources/private-api/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.18
0.0.19
5 changes: 4 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bluebubbles/server",
"version": "1.9.4",
"version": "1.9.5",
"main": "./dist/main.js",
"license": "Apache-2.0",
"author": {
Expand Down Expand Up @@ -54,6 +54,7 @@
"@types/node-forge": "^1.0.4",
"@types/numeral": "^0.0.26",
"@types/plist": "^3.0.2",
"@types/uuid": "^9.0.8",
"@types/validatorjs": "^3.15.0",
"@types/vcf": "^2.0.3",
"@types/webpack-env": "^1.15.1",
Expand Down Expand Up @@ -83,6 +84,7 @@
"@firebase/app-types": "^0.9.0",
"@firebase/util": "^1.9.3",
"@peculiar/x509": "^1.6.1",
"async-sema": "^3.1.1",
"axios": "^0.25.0",
"better-sqlite3": "^8.0.1",
"blurhash": "^1.1.3",
Expand Down Expand Up @@ -119,6 +121,7 @@
"slugify": "^1.6.0",
"socket.io": "3.1.2",
"typeorm": "0.3.6",
"uuid": "^9.0.1",
"validatorjs": "^3.22.1",
"vcf": "^2.1.1",
"zx": "^4.3.0"
Expand Down
9 changes: 5 additions & 4 deletions packages/server/src/server/api/http/api/v1/httpRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { ScheduledMessageValidator } from "./validators/scheduledMessageValidato
import { ScheduledMessageRouter } from "./routers/scheduledMessageRouter";
import { ThemeValidator } from "./validators/themeValidator";
import type { Context, Next } from "koa";
import { FindMyRouter } from "./routers/findmyRouter";

export class HttpRoutes {
static version = 1;
Expand Down Expand Up @@ -110,23 +111,23 @@ export class HttpRoutes {
{
method: HttpMethod.GET,
path: "findmy/devices",
controller: iCloudRouter.devices
controller: FindMyRouter.devices
},
{
method: HttpMethod.POST,
path: "findmy/devices/refresh",
controller: iCloudRouter.refreshDevices
controller: FindMyRouter.refreshDevices
},
{
method: HttpMethod.GET,
path: "findmy/friends",
middleware: [...HttpRoutes.protected, PrivateApiMiddleware],
controller: iCloudRouter.friends
controller: FindMyRouter.friends
},
{
method: HttpMethod.POST,
path: "findmy/friends/refresh",
controller: iCloudRouter.refreshFriends
controller: FindMyRouter.refreshFriends
}
]
},
Expand Down
58 changes: 58 additions & 0 deletions packages/server/src/server/api/http/api/v1/routers/findmyRouter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { Next } from "koa";
import { RouterContext } from "koa-router";
import { Success } from "../responses/success";
import { ServerError } from "../responses/errors";
import { FindMyInterface } from "@server/api/interfaces/findMyInterface";

export class FindMyRouter {
static async refreshDevices(ctx: RouterContext, _: Next) {
try {
await FindMyInterface.refreshDevices();
return new Success(ctx, { message: "Successfully refreshed Find My device locations!" }).send();
} catch (ex: any) {
throw new ServerError({
message: "Failed to refresh Find My device locations!",
error: ex?.message ?? ex.toString()
});
}
}

static async refreshFriends(ctx: RouterContext, _: Next) {
try {
const locations = await FindMyInterface.refreshFriends();
return new Success(ctx, {
message: "Successfully refreshed Find My friends locations!",
data: locations
}).send();
} catch (ex: any) {
throw new ServerError({
message: "Failed to refresh Find My friends locations!",
error: ex?.message ?? ex.toString()
});
}
}

static async devices(ctx: RouterContext, _: Next) {
try {
const data = await FindMyInterface.getDevices();
return new Success(ctx, { message: "Successfully fetched Find My device locations!", data }).send();
} catch (ex: any) {
throw new ServerError({
message: "Failed to fetch Find My device locations!",
error: ex?.message ?? ex.toString()
});
}
}

static async friends(ctx: RouterContext, _: Next) {
try {
const data: any = await FindMyInterface.getFriends();
return new Success(ctx, { message: "Successfully fetched Find My friends locations!", data }).send();
} catch (ex: any) {
throw new ServerError({
message: "Failed to fetch Find My friends locations!",
error: ex?.message ?? ex.toString()
});
}
}
}
43 changes: 0 additions & 43 deletions packages/server/src/server/api/http/api/v1/routers/icloudRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,9 @@ import { Next } from "koa";
import { RouterContext } from "koa-router";
import { Success } from "../responses/success";
import { ServerError } from "../responses/errors";
import { FindMyService } from "@server/services/findMyService";
import { iCloudInterface } from "@server/api/interfaces/iCloudInterface";
import { findMyInterface } from "@server/api/interfaces/findMyInterface";

export class iCloudRouter {
static async refreshDevices(ctx: RouterContext, _: Next) {
try {
const data = await FindMyService.refreshDevices();
return new Success(ctx, { message: "Successfully refreshed Find My device locations!", data }).send();
} catch (ex: any) {
throw new ServerError(
{ message: "Failed to refresh Find My device locations!", error: ex?.message ?? ex.toString() });
}
}

static async refreshFriends(ctx: RouterContext, _: Next) {
try {
await FindMyService.refreshFriends();
const data = findMyInterface.getFriends();
return new Success(ctx, { message: "Successfully refreshed Find My friends locations!", data }).send();
} catch (ex: any) {
throw new ServerError(
{ message: "Failed to refresh Find My friends locations!", error: ex?.message ?? ex.toString() });
}
}

static async devices(ctx: RouterContext, _: Next) {
try {
const data = await FindMyService.getDevices();
return new Success(ctx, { message: "Successfully fetched Find My device locations!", data }).send();
} catch (ex: any) {
throw new ServerError(
{ message: "Failed to fetch Find My device locations!", error: ex?.message ?? ex.toString() });
}
}

static async friends(ctx: RouterContext, _: Next) {
try {
const data: any = await findMyInterface.getFriends();
return new Success(ctx, { message: "Successfully fetched Find My friends locations!", data }).send();
} catch (ex: any) {
throw new ServerError(
{ message: "Failed to fetch Find My friends locations!", error: ex?.message ?? ex.toString() });
}
}

static async getAccountInfo(ctx: RouterContext, _: Next) {
try {
const data: any = await iCloudInterface.getAccountInfo();
Expand Down
17 changes: 6 additions & 11 deletions packages/server/src/server/api/interfaces/contactInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ export class ContactInterface {

// Also load the thumbnail if the image is requested.
// The regular thumbnail will take precedence over the contactImageThumbnail
if (extraProps.includes('contactImage') && !extraProps.includes('contactThumbnailImage')) {
extraProps.push('contactThumbnailImage');
if (extraProps.includes("contactImage") && !extraProps.includes("contactThumbnailImage")) {
extraProps.push("contactThumbnailImage");
}

return ContactInterface.mapContacts(ContactsLib.getAllContacts(extraProps), "api", { extraProps });
Expand Down Expand Up @@ -471,18 +471,13 @@ export class ContactInterface {
const parsed = vcf.parse(content);
const output: Contact[] = [];
for (const contact of parsed) {
const nameParts = contact
.get("n")
.valueOf()
.toString()
.split(";")
.reverse()
.filter(e => e && e.length > 0);
const nameParts = contact.get("n").valueOf().toString().split(";");
if (nameParts.length === 0) continue;

const params: any = {
firstName: nameParts[0],
lastName: nameParts.length > 1 ? nameParts.slice(1).join(" ") : ""
// If a first name isn't provided, use the middle name
firstName: nameParts[1] ?? nameParts[2] ?? "",
lastName: nameParts[0] ?? ""
};

if (contact.get("tel")) {
Expand Down
Loading

0 comments on commit 7c33356

Please sign in to comment.